Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
nbconvert Jupyter to LaTeX
#1
Hi ,

Im brand new to python and have recently purchased "python for civil and structural Engineers" . I currently work in engineering and im hoping to move away from excel and use python for some calculations , charts, graphs etc...

One of the main things that appeals to me is being able to export the jupyter notebook to LaTeX. This would automate a lot of reports i do and save me manually inputting mathematical notation.

I have installed nbconvert through anaconda using
-c conda-forge jupyter_contrib_nbextensions

I've then enabled the Nb extensions located https://python4civil.weebly.com/exporting-in-latex.html

ive also downloaded the default template like the book suggests .I then navigate to the folder where the notebook and the template are saved in the anaconda prompt.I have then typed :

jupyter nbconvert --to latex --template temp.tplx notebook_name.ipynb

where my file is notebook_name.ipynb and no .tex file is created .

ive also tried other formats , such as PDF and other templates such as

jupyter nbconvert --to latex --template article notebook_name.ipynb

None of which have worked either . Im just wondering if anyone else uses the conversion and has any issues as ive literally copied this bit out line by line from the book.
Reply
#2
(Jul-07-2020, 08:13 PM)ross1993hall Wrote: I have installed nbconvert through anaconda using
There are more installation that that need to be installed separately.
Example for --to latex to work need to install pandoc,see also LaTeX.
--to pdf need Tex install as you see in link over.
Reply
#3
I have installed Pandoc and ensured it is enabled in the environments and In get the following in the prompt

jupyter nbconvert --to latex --template temp.tplx notebook_name.ipynb
[NbConvertApp] Converting notebook notebook_name.ipynb to latex
[NbConvertApp] Support files will be in notebook_name_files\
[NbConvertApp] Making directory notebook_name_files
[NbConvertApp] Writing 26859 bytes to notebook_name.tex

while it looks like its converting there has not been any .tex file produced.
Reply
#4
https://jupyter-contrib-nbextensions.rea...stall.html

follows these instructions and everything now works.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  A loop for autocompile LaTeX file takes high CPU meknowsnothing 1 953 Jun-25-2022, 07:52 AM
Last Post: Gribouillis
  Latex spacing question StillAnotherDave 0 1,495 Mar-28-2020, 05:51 PM
Last Post: StillAnotherDave
  Error executing Jupyter command 'notebook': [Errno 'jupyter-notebook' not found] 2 Newtopython123 10 31,347 Apr-25-2019, 07:30 AM
Last Post: banu0395
  How to edit jupyter nbconvert templates Sito 0 3,646 Jul-08-2017, 04:16 PM
Last Post: Sito

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020