我用了$ jupyter nbconvert HW2_solutions.ipynb——to pdf但是它只将第一页转换为 PDF。我该如何修复?
以下是完整的日志:
$ jupyter nbconvert HW2_solutions.ipynb --to pdf
[NbConvertApp] Converting notebook HW2_solutions.ipynb to pdf
[NbConvertApp] Support files will be in HW2_solutions_files/
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Writing 84900 bytes to notebook.tex
[NbConvertApp] Building PDF
[NbConvertApp] Running xelatex 3 times: ['xelatex', 'notebook.tex']
[NbConvertApp] CRITICAL | xelatex failed: ['xelatex', 'notebook.tex']
This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./notebook.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/size11.clo))
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/lm/t1lmr.fd))
(/usr/local/texlive/2020/texmf-dist/tex/latex/psnfss/mathpazo.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-def/xetex.def)))
(/usr/local/texlive/2020/texmf-dist/tex/latex/caption/caption.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/caption/caption3.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/adjustbox/adjustbox.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2020/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
(/usr/local/texlive/2020/texmf-dist/tex/latex/adjustbox/adjcalc.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/adjustbox/trimclip.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/collectbox/collectbox.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/adjustbox/tc-xetex.def))
(/usr/local/texlive/2020/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/varwidth/varwidth.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/color.cfg))
(/usr/local/texlive/2020/texmf-dist/tex/latex/tools/enumerate.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/iftex/ifvtex.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/iftex/iftex.sty)))
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/textcomp.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/upquote/upquote.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/eurosym/eurosym.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/ucs/ucs.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/ucs/data/uni-global.def))
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/inputenc.sty
Package inputenc Warning: inputenc package ignored with utf8 based engines.
) (/usr/local/texlive/2020/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/grffile/grffile.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/pdftexcmds/pdftexcmds.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/infwarerr/infwarerr.sty))
(/usr/local/texlive/2020/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/pdfescape/pdfescape.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/hycolor/hycolor.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/auxhook/auxhook.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/kvoptions/kvoptions.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/local/texlive/2020/texmf-dist/tex/generic/intcalc/intcalc.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/etexcmds/etexcmds.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/url/url.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/bitset/bitset.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty))
(/usr/local/texlive/2020/texmf-dist/tex/generic/atbegshi/atbegshi.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/hxetex.def
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/puenc.def)
(/usr/local/texlive/2020/texmf-dist/tex/generic/stringenc/stringenc.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/atveryend/atveryend.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty
))) (/usr/local/texlive/2020/texmf-dist/tex/latex/tools/longtable.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/booktabs/booktabs.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/enumitem/enumitem.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/ulem/ulem.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-xdvipdfmx.def
)
No file notebook.aux.
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/ts1cmr.fd)
(/usr/local/texlive/2020/texmf-dist/tex/latex/psnfss/t1ppl.fd)
(/usr/local/texlive/2020/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
* \skip\footins=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)
(/usr/local/texlive/2020/texmf-dist/tex/latex/ucs/ucsencs.def)
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/refcount/refcount.sty)
(/usr/local/texlive/2020/texmf-dist/tex/generic/gettitlestring/gettitlestring.s
ty))
Package hyperref Warning: Rerun to get /PageLabels entry.
(/usr/local/texlive/2020/texmf-dist/tex/latex/psnfss/ot1ppl.fd)
(/usr/local/texlive/2020/texmf-dist/tex/latex/psnfss/omlzplm.fd)
(/usr/local/texlive/2020/texmf-dist/tex/latex/psnfss/omszplm.fd)
(/usr/local/texlive/2020/texmf-dist/tex/latex/psnfss/omxzplm.fd)
(/usr/local/texlive/2020/texmf-dist/tex/latex/psnfss/ot1zplm.fd)
LaTeX Warning: No \author given.
(/usr/local/texlive/2020/texmf-dist/tex/generic/stringenc/se-ascii-print.def)
(/usr/local/texlive/2020/texmf-dist/tex/latex/psnfss/ts1ppl.fd)
(/usr/local/texlive/2020/texmf-dist/tex/latex/lm/t1lmtt.fd)
(/usr/local/texlive/2020/texmf-dist/tex/latex/psnfss/ufplmbb.fd) [1]
! Missing $ inserted.
<inserted text>
$
l.372 1 - \$XNOR(1,1) = 1 \implies
w\_1+w\_2+w\_3 \textgreater{}0 \$
?
! Emergency stop.
<inserted text>
$
l.372 1 - \$XNOR(1,1) = 1 \implies
w\_1+w\_2+w\_3 \textgreater{}0 \$
Output written on notebook.pdf (1 page).
Transcript written on notebook.log.
[NbConvertApp] PDF successfully created
[NbConvertApp] Writing 25857 bytes to HW2_solutions.pdf
答案1
$ jupyter nbconvert HW2.ipynb --to latex
$ pdflatex HW2.tex
对我有用。