You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to convert a minimum Jupyter notebook to pdf, jupyter nbconvert fails:
▶ jupyter nbconvert --to pdf failing.ipynb
Gives the following traceback:
...
lse\n* (1in=72.27pt=25.4mm, 1cm=28.453pt)\n\n\nPackage hyperref Warning: Rerun to get /PageLabels entry.\n\n(/usr/local/texlive/2024/texmf-dist/tex/latex/amsfonts/umsa.fd)\n(/usr/local/texlive/2024/texmf-dist/tex/latex/amsfonts/umsb.fd)\n(/usr/local/texlive/2024/texmf-dist/tex/latex/jknapltx/ursfs.fd)\n\nLaTeX Warning: No \\author given.\n\n\nLaTeX Font Warning: Font shape `U/rsfs/m/n' in size <5.475> not available\n(Font) size <5> substituted on input line 395.\n\n! Undefined control sequence.\nl.395 \\(\\degree\n \\)\n? \n! Emergency stop.\nl.395 \n \nNo pages of output.\nTranscript written on notebook.log.\n"Traceback (most recent call last): File "/Users/dave646/.conda/envs/cadet/bin/jupyter-nbconvert", line 10, in <module> sys.exit(main()) File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/jupyter_core/application.py", line 283, in launch_instance super().launch_instance(argv=argv, **kwargs) File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/traitlets/config/application.py", line 1075, in launch_instance app.start() File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/nbconvert/nbconvertapp.py", line 412, in start self.convert_notebooks() File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/nbconvert/nbconvertapp.py", line 590, in convert_notebooks self.convert_single_notebook(notebook_filename) File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/nbconvert/nbconvertapp.py", line 556, in convert_single_notebook output, resources = self.export_single_notebook( File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/nbconvert/nbconvertapp.py", line 479, in export_single_notebook output, resources = self.exporter.from_filename( File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/nbconvert/exporters/templateexporter.py", line 389, in from_filename return super().from_filename(filename, resources, **kw) # type:ignore[return-value] File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/nbconvert/exporters/exporter.py", line 203, in from_filename return self.from_file(f, resources=resources, **kw) File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/nbconvert/exporters/templateexporter.py", line 395, in from_file return super().from_file(file_stream, resources, **kw) # type:ignore[return-value] File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/nbconvert/exporters/exporter.py", line 222, in from_file return self.from_notebook_node( File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/nbconvert/exporters/pdf.py", line 200, in from_notebook_node self.run_latex(tex_file) File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/nbconvert/exporters/pdf.py", line 169, in run_latex return self.run_command( File "/Users/me/.conda/envs/my_env/lib/python3.10/site-packages/nbconvert/exporters/pdf.py", line 159, in run_command raise raise_on_failure(msg)nbconvert.exporters.pdf.LatexFailed: PDF creating failed, captured latex output:Failed to run "['xelatex', 'notebook.tex', '-quiet']" command:This is XeTeX, Version 3.141592653-2.6-0.999996 (TeX Live 2024) (preloaded format=xelatex) restricted \write18 enabled.entering extended mode(./notebook.tex...
The following jupyter notebook failing.ipynb contains only the text \degree in a markdown cell. Literally, the 1st and only cell in the notebook is markdown and contains the word degree with a backslash preceding it.
failing.ipynb
What I expect is to get is the following which was obtained by removing the backslash before degree in the notebook cell:
▶ jupyter nbconvert --to pdf failing.ipynb
[NbConvertApp] Converting notebook failing.ipynb to pdf
[NbConvertApp] Writing 19514 bytes to notebook.tex
[NbConvertApp] Building PDF
[NbConvertApp] Running xelatex 3 times: ['xelatex', 'notebook.tex', '-quiet']
[NbConvertApp] Running bibtex 1 time: ['bibtex', 'notebook']
[NbConvertApp] WARNING | bibtex had problems, most likely because there were no citations
[NbConvertApp] PDF successfully created
[NbConvertApp] Writing 8363 bytes to failing.pdf
I originally encountered this issue because I was using $\degree$ in a different notebook to get a degree ($\degree$) symbol in my markdown. This SO issue caused me to investigate this avenue. However, I came to realize that the issue could be reproduced without the LaTeX.
\degree in a python cell, for example in a comment, does not reproduce the failure. For example this notebook is successfully exportable:
While trying to convert a minimum Jupyter notebook to pdf, jupyter nbconvert fails:
Gives the following traceback:
The following jupyter notebook
failing.ipynb
contains only the text\degree
in a markdown cell. Literally, the 1st and only cell in the notebook is markdown and contains the word degree with a backslash preceding it.failing.ipynb
What I expect is to get is the following which was obtained by removing the backslash before degree in the notebook cell:
I originally encountered this issue because I was using$\degree$ ) symbol in my markdown. This SO issue caused me to investigate this avenue. However, I came to realize that the issue could be reproduced without the LaTeX.
$\degree$
in a different notebook to get a degree (\degree
in a python cell, for example in a comment, does not reproduce the failure. For example this notebook is successfully exportable:The text was updated successfully, but these errors were encountered: