[IPython-dev] How to tell IPython to render %%latex or other magical stuff
MinRK
benjaminrk at gmail.com
Wed Jul 29 14:14:27 EDT 2015
The IPython kernel provides cell magics like %%latex as shorthand for
IPython display calls, so
%%latex
$a = 5$
is equivalent to:
from IPython.display import Latex, display
display(Latex("""
$a = 5$
"""))
As Thomas mentioned, you want to make sure a display_data message is sent.
-MinRK
On Wed, Jul 29, 2015 at 10:54 AM, Robert Dodier <robert.dodier at gmail.com>
wrote:
> Hi,
>
> I guess this must be an obvious question, but I haven't been able to
> find the answer. I am creating a kernel for Maxima (computer algebra
> system) and I've been able to get Maxima to talk to the IPython front
> end via Fishbowl (kernel for Common Lisp). O happy day! Many thanks to
> Frederic Peschanski for Fishbowl.
>
> Anyway now I'm trying to figure out how to have formulas and plots
> displayed by the IPython notebook. What does the kernel return to tell
> the front end to render stuff as LaTeX? or as a plot? If I get Maxima
> to return "%%latex $x^2$" it is still displayed as a string, so I must
> be missing something.
>
> Thanks in advance for any information.
>
> Robert Dodier
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150729/bc2af7ec/attachment.html>
More information about the IPython-dev
mailing list