Skip to content

\mathscr in Markdown/MathJax cell cause PDF via LaTeX to fail export #9216

@wtadler

Description

@wtadler

This bug took forever to track down. In my Markdown/MathJax cells, if I have any instance of \mathscr, as in \mathscr{N}, PDF export will fail with 500: Internal Server Error: nbconvert failed: PDF creating failed. I should note that it renders just fine in the browser.

I don't know if this is an ipython bug, or pdflatex, or something else. Here's the log:

[I 11:39:37.196 NotebookApp] Running pdflatex 3 times: [u'pdflatex', u'notebook.tex']
[C 11:39:37.631 NotebookApp] pdflatex failed: [u'pdflatex', u'notebook.tex']
    This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    (./notebook.tex
    LaTeX2e <2015/01/01>
    Babel <3.9l> and hyphenation patterns for 79 languages loaded.
    (/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls
    Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
    (/usr/local/texlive/2015/texmf-dist/tex/latex/base/size10.clo))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphicx.sty
    (/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/keyval.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphics.sty
    (/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/trig.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/graphics.cfg)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/pdftex-def/pdftex.def
    (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/adjustbox.sty
    (/usr/local/texlive/2015/texmf-dist/tex/latex/xkeyval/xkeyval.sty
    (/usr/local/texlive/2015/texmf-dist/tex/generic/xkeyval/xkeyval.tex
    (/usr/local/texlive/2015/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/adjcalc.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/trimclip.sty
    (/usr/local/texlive/2015/texmf-dist/tex/latex/collectbox/collectbox.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/tc-pdftex.def))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/varwidth/varwidth.sty))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/color.sty
    (/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/color.cfg))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/tools/enumerate.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/geometry/geometry.sty
    (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsmath.sty
    For additional information on amsmath, use the '?' option.
    (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amstext.sty
    (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsgen.sty))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsbsy.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsopn.sty))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amssymb.sty
    (/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/eurosym/eurosym.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/ucs/ucs.sty
    (/usr/local/texlive/2015/texmf-dist/tex/latex/ucs/data/uni-global.def))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/base/inputenc.sty
    (/usr/local/texlive/2015/texmf-dist/tex/latex/ucs/utf8x.def))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
    Style option: 'fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix
    <2008/02/07> (tvz))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/grffile.sty
    (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/kvoptions.sty
    (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
    (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/etexcmds.sty
    (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifluatex.sty))))
    (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/hyperref.sty
    (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
    (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/auxhook.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/pd1enc.def)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/hyperref.cfg)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/url/url.sty))

    Package hyperref Message: Driver (autodetected): hpdftex.

    (/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/hpdftex.def
    (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))
    (/usr/local/texlive/2015/texmf-dist/tex/latex/tools/longtable.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/booktabs/booktabs.sty)
    (./notebook.aux)
    (/usr/local/texlive/2015/texmf-dist/tex/context/base/supp-pdf.mkii
    [Loading MPS to PDF converter (version 2006.09.02).]
    ) (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
    (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/grfext.sty)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
    *geometry* driver: auto-detecting
    *geometry* detected driver: pdftex

    Package geometry Warning: The marginal notes overrun the paper.
         Add 3.73001pt and more to the right margin.

    *geometry* verbose mode - [ preamble ] result:
    * driver: pdftex
    * 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=10.0pt
    * \footskip=30.0pt
    * \marginparwidth=65.0pt
    * \marginparsep=11.0pt
    * \columnsep=10.0pt
    * \skip\footins=9.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/2015/texmf-dist/tex/latex/ucs/ucsencs.def)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/nameref.sty
    (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
    (./notebook.out) (./notebook.out)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/umsa.fd)
    (/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/umsb.fd)

    LaTeX Warning: No \author given.

    [1{/usr/local/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
    [2] [3] [4] [5] <output_26_0.pdf, id=163, 403.5075pt x 283.0575pt>
    <use output_26_0.pdf>
    Underfull \hbox (badness 10000) in paragraph at lines 556--557

    [6 <./output_26_0.pdf>]
    Underfull \hbox (badness 10000) in paragraph at lines 576--576
    []\OT1/cmr/bx/n/10 2. Im-ple-ment com-pute[]regularized[]square[]loss[]gradient
     [and com-
    [7] <output_31_0.pdf, id=241, 403.5075pt x 283.0575pt> <use output_31_0.pdf>
    [8]
    Underfull \hbox (badness 10000) in paragraph at lines 673--674

    <output_33_0.pdf, id=246, 395.4775pt x 275.0275pt> <use output_33_0.pdf>
    [9 <./output_31_0.pdf>]
    Underfull \hbox (badness 10000) in paragraph at lines 708--709

    [10 <./output_33_0.pdf>] [11]
    <output_39_0.pdf, id=373, 403.5075pt x 283.0575pt> <use output_39_0.pdf>
    Underfull \hbox (badness 10000) in paragraph at lines 822--823

    <output_40_0.pdf, id=374, 398.48875pt x 275.0275pt> <use output_40_0.pdf>
    [12 <./output_39_0.pdf>]
    Underfull \hbox (badness 10000) in paragraph at lines 835--836

    <output_42_0.pdf, id=447, 406.51875pt x 283.0575pt> <use output_42_0.pdf>
    [13 <./output_40_0.pdf>]
    Underfull \hbox (badness 10000) in paragraph at lines 861--862

    [14 <./output_42_0.pdf>]
    ! Undefined control sequence.
    l.914     \(\mathscr
                        {N}\)
    ?
    ! Emergency stop.
    l.914     \(\mathscr
                        {N}\)
    !  ==> Fatal error occurred, no output PDF file produced!
    Transcript written on notebook.log.

[W 11:39:37.635 NotebookApp] 500 GET /nbconvert/pdf/hw1.ipynb?download=true (::1): nbconvert failed: PDF creating failed
[E 11:39:37.665 NotebookApp] Exception in exception handler
    Traceback (most recent call last):
      File "//anaconda/lib/python2.7/site-packages/tornado/web.py", line 1450, in _execute
        self._handle_request_exception(e)
      File "//anaconda/lib/python2.7/site-packages/tornado/web.py", line 1502, in _handle_request_exception
        self.send_error(e.status_code, exc_info=sys.exc_info())
      File "//anaconda/lib/python2.7/site-packages/tornado/web.py", line 978, in send_error
        self.finish()
      File "//anaconda/lib/python2.7/site-packages/tornado/web.py", line 934, in finish
        self._log()
      File "//anaconda/lib/python2.7/site-packages/tornado/web.py", line 1474, in _log
        self.application.log_request(self)
      File "//anaconda/lib/python2.7/site-packages/tornado/web.py", line 1936, in log_request
        self.settings["log_function"](handler)
      File "//anaconda/lib/python2.7/site-packages/notebook/log.py", line 46, in log_request
        log_method(json.dumps(request.headers, indent=2))
      File "//anaconda/lib/python2.7/json/__init__.py", line 251, in dumps
        sort_keys=sort_keys, **kw).encode(obj)
      File "//anaconda/lib/python2.7/json/encoder.py", line 209, in encode
        chunks = list(chunks)
      File "//anaconda/lib/python2.7/json/encoder.py", line 442, in _iterencode
        o = _default(o)
      File "//anaconda/lib/python2.7/json/encoder.py", line 184, in default
        raise TypeError(repr(o) + " is not JSON serializable")
    TypeError: <tornado.httputil.HTTPHeaders object at 0x1047fd950> is not JSON serializable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions