python – Failed to download as pdf via latex in Jupyter notebook

When I try to download as PDF via Latex in Jupyter notebook, it shows “500 : Internal Server Error”. I know this has been posted many times, but I tried them all, none of them fixed the problem. Here is the error message.

nbconvert failed: PDF creating failed, captured latex output:
Failed to run "xelatex notebook.tex -quiet" command:
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex)
 restricted write18 enabled.
entering extended mode
(./notebook.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-04-20>
(c:/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(c:/texlive/2022/texmf-dist/tex/latex/base/size11.clo))
(c:/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty
(c:/texlive/2022/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(c:/texlive/2022/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(c:/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
(c:/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex)
) (c:/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
(c:/texlive/2022/texmf-dist/tex/generic/pgf/pgf.revision.tex)))
(c:/texlive/2022/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
(c:/texlive/2022/texmf-dist/tex/latex/graphics/graphicx.sty
(c:/texlive/2022/texmf-dist/tex/latex/graphics/keyval.sty)
(c:/texlive/2022/texmf-dist/tex/latex/graphics/graphics.sty
(c:/texlive/2022/texmf-dist/tex/latex/graphics/trig.sty)
(c:/texlive/2022/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(c:/texlive/2022/texmf-dist/tex/latex/graphics-def/xetex.def)))
(c:/texlive/2022/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
(c:/texlive/2022/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
(c:/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
(c:/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex)
) (c:/texlive/2022/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def
(c:/texlive/2022/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
(c:/texlive/2022/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def))
))
(c:/texlive/2022/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
)) (c:/texlive/2022/texmf-dist/tex/latex/xcolor/xcolor.sty
(c:/texlive/2022/texmf-dist/tex/latex/graphics-cfg/color.cfg))
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.te
x)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric
.code.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.t
ex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.co
de.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex
)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.te
x)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex
)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithm
etics.code.tex)))
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex))
(c:/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfint.code.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.cod
e.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.te
x)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code
.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.c
ode.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex)

(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.co
de.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
))
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code
.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
) (c:/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex)))
 (c:/texlive/2022/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex)
(c:/texlive/2022/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex)
(c:/texlive/2022/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.st
y)
(c:/texlive/2022/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.st
y)) (c:/texlive/2022/texmf-dist/tex/latex/tools/verbatim.sty)
(c:/texlive/2022/texmf-dist/tex/latex/environ/environ.sty
(c:/texlive/2022/texmf-dist/tex/latex/trimspaces/trimspaces.sty))
(c:/texlive/2022/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(c:/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex
Library (tcolorbox): 'tcbbreakable.code.tex' version '5.0.2'
(c:/texlive/2022/texmf-dist/tex/generic/oberdiek/pdfcol.sty
(c:/texlive/2022/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)
(c:/texlive/2022/texmf-dist/tex/generic/infwarerr/infwarerr.sty)
(c:/texlive/2022/texmf-dist/tex/generic/iftex/iftex.sty))))
(c:/texlive/2022/texmf-dist/tex/latex/parskip/parskip.sty
(c:/texlive/2022/texmf-dist/tex/latex/kvoptions/kvoptions.sty
(c:/texlive/2022/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty)))
(c:/texlive/2022/texmf-dist/tex/latex/caption/caption.sty
(c:/texlive/2022/texmf-dist/tex/latex/caption/caption3.sty))
(c:/texlive/2022/texmf-dist/tex/latex/float/float.sty)
(c:/texlive/2022/texmf-dist/tex/latex/tools/enumerate.sty)
(c:/texlive/2022/texmf-dist/tex/latex/geometry/geometry.sty
(c:/texlive/2022/texmf-dist/tex/generic/iftex/ifvtex.sty))
(c:/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(c:/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
(c:/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty))
(c:/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(c:/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty))
(c:/texlive/2022/texmf-dist/tex/latex/amsfonts/amssymb.sty
(c:/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(c:/texlive/2022/texmf-dist/tex/latex/base/textcomp.sty)
(c:/texlive/2022/texmf-dist/tex/latex/upquote/upquote.sty)
(c:/texlive/2022/texmf-dist/tex/latex/eurosym/eurosym.sty)
(c:/texlive/2022/texmf-dist/tex/latex/fontspec/fontspec.sty
(c:/texlive/2022/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(c:/texlive/2022/texmf-dist/tex/latex/l3kernel/expl3.sty
(c:/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-xetex.def)))
(c:/texlive/2022/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(c:/texlive/2022/texmf-dist/tex/latex/base/fontenc.sty)
(c:/texlive/2022/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(c:/texlive/2022/texmf-dist/tex/latex/unicode-math/unicode-math.sty
(c:/texlive/2022/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty
(c:/texlive/2022/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty)
(c:/texlive/2022/texmf-dist/tex/latex/base/fix-cm.sty
(c:/texlive/2022/texmf-dist/tex/latex/base/ts1enc.def))
(c:/texlive/2022/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex)))
(c:/texlive/2022/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty)
(c:/texlive/2022/texmf-dist/tex/latex/grffile/grffile.sty)
(c:/texlive/2022/texmf-dist/tex/latex/adjustbox/adjustbox.sty
(c:/texlive/2022/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(c:/texlive/2022/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(c:/texlive/2022/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
(c:/texlive/2022/texmf-dist/tex/latex/adjustbox/adjcalc.sty)
(c:/texlive/2022/texmf-dist/tex/latex/adjustbox/trimclip.sty
(c:/texlive/2022/texmf-dist/tex/latex/collectbox/collectbox.sty)
(c:/texlive/2022/texmf-dist/tex/latex/adjustbox/tc-xetex.def))
(c:/texlive/2022/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty)
(c:/texlive/2022/texmf-dist/tex/latex/varwidth/varwidth.sty))
(c:/texlive/2022/texmf-dist/tex/latex/hyperref/hyperref.sty
(c:/texlive/2022/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty)
(c:/texlive/2022/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty)
(c:/texlive/2022/texmf-dist/tex/generic/pdfescape/pdfescape.sty)
(c:/texlive/2022/texmf-dist/tex/latex/hycolor/hycolor.sty)
(c:/texlive/2022/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty)
(c:/texlive/2022/texmf-dist/tex/latex/auxhook/auxhook.sty)
(c:/texlive/2022/texmf-dist/tex/latex/hyperref/pd1enc.def)
(c:/texlive/2022/texmf-dist/tex/generic/intcalc/intcalc.sty)
(c:/texlive/2022/texmf-dist/tex/generic/etexcmds/etexcmds.sty)
(c:/texlive/2022/texmf-dist/tex/latex/hyperref/puenc.def)
(c:/texlive/2022/texmf-dist/tex/latex/url/url.sty)
(c:/texlive/2022/texmf-dist/tex/generic/bitset/bitset.sty
(c:/texlive/2022/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty))
(c:/texlive/2022/texmf-dist/tex/latex/base/atbegshi-ltx.sty))
(c:/texlive/2022/texmf-dist/tex/latex/hyperref/hxetex.def
(c:/texlive/2022/texmf-dist/tex/generic/stringenc/stringenc.sty)
(c:/texlive/2022/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty
(c:/texlive/2022/texmf-dist/tex/latex/base/atveryend-ltx.sty)
(c:/texlive/2022/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty)))
(c:/texlive/2022/texmf-dist/tex/latex/titling/titling.sty)
(c:/texlive/2022/texmf-dist/tex/latex/tools/longtable.sty)
(c:/texlive/2022/texmf-dist/tex/latex/booktabs/booktabs.sty)
(c:/texlive/2022/texmf-dist/tex/latex/tools/array.sty)
(c:/texlive/2022/texmf-dist/tex/latex/tools/calc.sty)
(c:/texlive/2022/texmf-dist/tex/latex/enumitem/enumitem.sty)
(c:/texlive/2022/texmf-dist/tex/generic/ulem/ulem.sty)
(c:/texlive/2022/texmf-dist/tex/latex/jknapltx/mathrsfs.sty)
No file notebook.aux.
(c:/texlive/2022/texmf-dist/tex/latex/caption/ltcaption.sty)
*geometry* driver: auto-detecting
*geometry* detected driver: xetex
*geometry* verbose mode - [ preamble ] result:
* driver: xetex
* paper: <default>
* layout: <same size as paper>
* layoutoffset:(h,v)=(0.0pt,0.0pt)
* modes: 
* h-part:(L,W,R)=(72.26999pt, 469.75502pt, 72.26999pt)
* v-part:(T,H,B)=(72.26999pt, 650.43001pt, 72.26999pt)
* paperwidth=614.295pt
* paperheight=794.96999pt
* textwidth=469.75502pt
* textheight=650.43001pt
* oddsidemargin=0.0pt
* evensidemargin=0.0pt
* topmargin=-37.0pt
* headheight=12.0pt
* headsep=25.0pt
* topskip=11.0pt
* footskip=30.0pt
* marginparwidth=59.0pt
* marginparsep=10.0pt
* columnsep=10.0pt
* skipfootins=10.0pt plus 4.0pt minus 2.0pt
* hoffset=0.0pt
* voffset=0.0pt
* mag=1000
* @twocolumnfalse
* @twosidefalse
* @mparswitchfalse
* @reversemarginfalse
* (1in=72.27pt=25.4mm, 1cm=28.453pt)

(c:/texlive/2022/texmf-dist/tex/latex/hyperref/nameref.sty
(c:/texlive/2022/texmf-dist/tex/latex/refcount/refcount.sty)
(c:/texlive/2022/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty))

Package hyperref Warning: Rerun to get /PageLabels entry.

(c:/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd)
(c:/texlive/2022/texmf-dist/tex/latex/amsfonts/umsb.fd)
(c:/texlive/2022/texmf-dist/tex/latex/jknapltx/ursfs.fd)

LaTeX Warning: No author given.


LaTeX Font Warning: Font shape `U/rsfs/m/n' in size <5.475> not available
(Font)              size <5> substituted on input line 406.

! Missing $ inserted.
<inserted text> 
                $
l.415 F^{}{-1}(u)=inf
                          {y in mathbb{R} mid F(x) geq u} $. Thus, for
? 
! Emergency stop.
<inserted text> 
                $
l.415 F^{}{-1}(u)=inf
                          {y in mathbb{R} mid F(x) geq u} $. Thus, for
No pages of output.
Transcript written on notebook.log.

I know it is ultra long, but I had no clue what the problem is.

Please forgive me not using a code block, as if I did, it wont let me post it for it consists of too much codes.

Leave a Comment