Latex kernel for jupyter?

479 views
Skip to first unread message

Andrew

unread,
Aug 7, 2018, 12:35:49 AM8/7/18
to Project Jupyter
I want to write some jupyter notebooks that show how to use latex and I would like ,y "readers" to be able to compile code snippets and see its output. I know that jupyter accepts a (fairly large) subset of latex as markdown but as far as I can see no one has written a latex kernel for jupyter. I have consulted the official kernel list at https://github.com/jupyter/jupyter/wiki/Jupyter-kernels and googled in all ways that I can think of but it seems that a latex kernel does not exist. Have I missed it?

Andrew

William Stein

unread,
Aug 7, 2018, 9:51:46 AM8/7/18
to jup...@googlegroups.com
For what it's worth, we've had functionality that is very similar to
this in Sage for a long time, and by now it is
pretty mature (i.e., deals with edge cases and what people care about):

https://github.com/sagemath/sage/blob/master/src/sage/misc/latex.py#L1034

This is used by Sage worksheets to provide a %latex mode here:

https://github.com/sagemathinc/cocalc/blob/master/src/smc_sagews/smc_sagews/sage_salvus.py#L1449

That makes it so in a Sage Worksheet (in https://cocalc.com), one can
type %latex at the beginning
of the cell, and the rest of the cell is interpreted using latex.

In any case, if somebody is ever going to implement this from scratch
as a Jupyter kernel, it can be helpful to be
aware of (or at least play with) the implementation in Sage...


--
William (http://wstein.org)
Screenshot 2018-08-07 at 6.50.23 AM.png
Reply all
Reply to author
Forward
0 new messages