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.
Asked
Active
Viewed 3.6k times
24
-
3`jupyter nbconvert` from commandline should do. `--to latex` is the flag you may want to use. – cel Sep 14 '15 at 12:25
-
Thanks! Do you want to add that as an answer for me to accept? – J-S Sep 14 '15 at 12:26
-
1feel free to post an answer. – cel Sep 14 '15 at 14:05
2 Answers
31
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

J-S
- 973
- 2
- 8
- 13
-
6This answer is old. I am using File | Download As... | Latex. Pandoc must be installed. – Daisuke Aramaki Aug 23 '18 at 17:32
-
docs: https://nbconvert.readthedocs.io/en/latest/usage.html#convert-latex – Alireza Rezaee Jul 25 '22 at 09:08
3
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.
-
+1 Just note that you don't need to use Anaconda Navigator for this; any way of installing JupyterLab should work. Just be sure to install `pandoc` as well. – Mike Sep 30 '22 at 14:52