Generic display function which handles local as well as remote clients.
The 'display' function is a replacement for 'str', in the sense that it will generate human-readable output. However, in contrast to 'str', it knows about what the front-end ('server') can display, and will adapt the output to that. For instance, if server.handles('latex_view') is true, it will generate LaTeX output, while it will generate just plain text otherwise.
Once it has figured out which display is accepted by 'server', it will call server.send() with data depending on the object type it is being fed. Data types the server object can support are:
- "latex_view": text-mode LaTeX string.
- "image_png": base64 encoded png image.
- "verbatim": ascii string to be displayed verbatim.
Generalised 'print' function which knows how to display objects in the
best possible way on the used interface, be it a console or graphical
notebook. In particular, it knows how to display Cadabra expressions
in typeset form whenever LaTeX functionality is available. Can also be
used to display matplotlib plots.
When using a Cadabra front-end (command line or notebook), an expression
with a trailing semi-colon ';' will automatically be wrapped in a
'display' function call so that the expression is displayed immediately.