How to put equation numbers in notebook cells?

asked 2023-09-17 21:48:32 +0100

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

edit retag flag offensive close merge delete

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 ( 2023-09-18 17:08:00 +0100 )edit

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 ( 2023-09-18 20:23:28 +0100 )edit

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 ( 2023-09-19 15:10:16 +0100 )edit