Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert Jupyter/IPython notebooks to LaTex?

Tags:

How can I export Jupyter notebooks to LaTeX? I can convert to PDF through LaTeX using the inbuilt menus but I'm unsure how to step in at the intermediate step and extract the actual LaTeX file.

like image 525
J-S Avatar asked Sep 14 '15 12:09

J-S


People also ask

Can you do LaTeX in Jupyter Notebook?

Jupyter Book uses MathJax for typesetting math in your HTML book build. This allows you to have LaTeX-style mathematics in your online content.

How do I Download LaTeX on Jupyter Notebook?

Choose File/Download as LaTeX (. tex) from the Jupyter Notebook Menu. Open the downloaded zip archive, then open the . tex file with the LaTex Typesetter (TeXShop on Mac, TeXWorks on Windows) and press the “Typeset” button, or choose typeset from the menu.

How do I save a Jupyter Notebook as a PDF in LaTeX?

The Jupyter Notebook has an option to export the notebook to many formats. It can be accessed by clicking File -> Download as -> PDF via LaTeX (or PDF via HTML - not visible in the screenshot).

Is IPython the same as Jupyter Notebook?

(Formerly known as the IPython Notebook)The IPython Notebook is now known as the Jupyter Notebook. It is an interactive computational environment, in which you can combine code execution, rich text, mathematics, plots and rich media. For more details on the Jupyter Notebook, please see the Jupyter website.


2 Answers

You have to do this from the command line rather than the web interface with the following command:

jupyter nbconvert /path/to/mynotebook.ipynb --to latex

like image 180
J-S Avatar answered Sep 28 '22 09:09

J-S


Anaconda Navigator provides JupyterLab. Use this to open jupyter notebook.

Under File menu you can find an item "Export Notebook As...".

This provides format such as Asciidoc, HTML, latex, pdf, Markdown, etc. You can choose your desired format.

like image 42
Arivarignan Gunaseelan Avatar answered Sep 28 '22 09:09

Arivarignan Gunaseelan