How to put equation numbers in notebook cells?

asked 1 year ago

Smrz gravatar image

Is it possible to display equation numbers in jupyter notebook code cells?

I use "display latex" to display code cells and would like to have equation numbers appear on the same line as equations.

I haven't been able to find anything recent about this. All the discussion I've found are at least five years old. Back then there was talk of this as a feature for future releases, but I haven't found anything about whether it ever happened.

Thanks

Preview: (hide)

Comments

This kind of cross-referencing is probably not (well-)doable in a Jupyter notebook, whereas structured markup languages are much more apt to create it (and create document implementing such cross-referencing).

I'd think that the clearest way to create such a document would be SageTeX, possibly followed by emacs' org-mode, or possibly Markdown (pandoc + PythonTeX + pandoc-crossref).

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 1 year ago )

I hadn't heard of SageTeX. Is there anything like a notebook interface for it? I gather SageTeX generates LaTeX documents. Is there a simple way of using it to generate pdf and doc files? Ultimately I need to put papers into these formats. Thanks.

Smrz gravatar imageSmrz ( 1 year ago )

Read this tutorial, as well as a LATEX tutorial.

Is there anything like a notebook interface for it?

Nope. Any text ediror (my personnal recomendation is emacs).

Is there a simple way of using it to generate pdf and doc ?

PDF : pdflatex foo.tex ; sage foo.sagetex.sage ; pdflatex foo.tex.

DOC : less obvious. Try pandoc.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 1 year ago )