Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion to PDF fails with particular Markdown table #1536

Closed
sgdecker opened this issue Mar 26, 2021 · 4 comments
Closed

Conversion to PDF fails with particular Markdown table #1536

sgdecker opened this issue Mar 26, 2021 · 4 comments
Labels
format:LaTeX pertains to exporting to the LaTeX format

Comments

@sgdecker
Copy link

Attempting to generate a PDF from JupyterLab (or jupyter nbconvert at the command line) fails. I've narrowed it down to a cell containing a Markdown table.

To reproduce, open the attached notebook file in JupyterLab, and attempt to export to PDF.

This file demonstrates the error:
Bug.txt

Nbconvert version: 6.0.7

The error message is:


500 : Internal Server Error

The error was:

nbconvert failed: PDF creating failed, captured latex output:
Failed to run "['xelatex', 'notebook.tex', '-quiet']" command:
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-07-17>
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/base/size11.clo))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfutil-c
ommon.tex
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfutil-c
ommon-lists.tex))
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfutil-l
atex.def (/home/decker/local/texlive/2020/texmf-dist/tex/latex/ms/everyshi.sty)
)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfrcs.co
de.tex
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/pgf.revision.tex)))

(/home/decker/local/texlive/2020/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.st
y (/home/decker/local/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/graphics/graphics.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
) (/home/decker/local/texlive/2020/texmf-dist/tex/latex/graphics-def/xetex.def)
))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.st
y
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.
code.tex
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfkeys.c
ode.tex
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfkeysfi
ltered.code.tex))
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-
xetex.def
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-
dvipdfmx.def
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-
common-pdf.def))))
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsyss
oftpath.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsysp
rotocol.code.tex))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/xcolor/xcolor.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/color.cfg))
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.
code.tex
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmath.code.t
ex
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathcalc.co
de.tex
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathutil.co
de.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathparser.
code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctio
ns.code.tex
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctio
ns.basic.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctio
ns.trigonometric.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctio
ns.random.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctio
ns.comparison.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctio
ns.base.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctio
ns.round.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctio
ns.misc.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctio
ns.integerarithmetics.code.tex)))
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfloat.c
ode.tex))
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfint.code.te
x)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorep
oints.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorep
athconstruct.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorep
athusage.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcores
copes.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreg
raphicstate.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoret
ransformations.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreq
uick.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreo
bjects.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorep
athprocessing.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorea
rrows.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcores
hade.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorei
mage.code.tex
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoree
xternal.code.tex))
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorel
ayers.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoret
ransparency.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorep
atterns.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorer
df.code.tex)))
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/modules/pgfmodulesh
apes.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pgf/modules/pgfmodulepl
ot.code.tex)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/pgf/compatibility/pgfcomp
-version-0-65.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/pgf/compatibility/pgfcomp
-version-1-18.sty))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/tools/verbatim.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/environ/environ.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/trimspaces/trimspaces.sty
)) (/home/decker/local/texlive/2020/texmf-dist/tex/latex/etoolbox/etoolbox.sty)

(/home/decker/local/texlive/2020/texmf-dist/tex/latex/tcolorbox/tcbbreakable.co
de.tex
Library (tcolorbox): 'tcbbreakable.code.tex' version '4.42'
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/oberdiek/pdfcol.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/infwarerr/infwarerr.sty
) (/home/decker/local/texlive/2020/texmf-dist/tex/generic/iftex/iftex.sty))))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/parskip/parskip.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/kvoptions/kvoptions.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty
))) (/home/decker/local/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec.sty

(/home/decker/local/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse.
sty (/home/decker/local/texlive/2020/texmf-dist/tex/latex/l3kernel/expl3.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-xdvip
dfmx.def))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse-
generic.tex))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec-xetex.s
ty (/home/decker/local/texlive/2020/texmf-dist/tex/latex/base/fontenc.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/caption/caption.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/caption/caption3.sty))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/float/float.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/tools/enumerate.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/geometry/geometry.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/iftex/ifvtex.sty))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/base/textcomp.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/upquote/upquote.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/eurosym/eurosym.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/ucs/ucs.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/ucs/data/uni-global.def))
 (/home/decker/local/texlive/2020/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/grffile/grffile.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/adjustbox/adjustbox.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
 (/home/decker/local/texlive/2020/texmf-dist/tex/latex/adjustbox/adjcalc.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/adjustbox/trimclip.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/collectbox/collectbox.sty
) (/home/decker/local/texlive/2020/texmf-dist/tex/latex/adjustbox/tc-xetex.def)
)) (/home/decker/local/texlive/2020/texmf-dist/tex/latex/hyperref/hyperref.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.s
ty)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/kvdefinekeys/kvdefineke
ys.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/pdfescape/pdfescape.sty
) (/home/decker/local/texlive/2020/texmf-dist/tex/latex/hycolor/hycolor.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/letltxmacro/letltxmacro.s
ty) (/home/decker/local/texlive/2020/texmf-dist/tex/latex/auxhook/auxhook.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/intcalc/intcalc.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/etexcmds/etexcmds.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/url/url.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/bitset/bitset.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/bigintcalc/bigintcalc.s
ty))
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/atbegshi/atbegshi.sty))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/hyperref/hxetex.def
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/hyperref/puenc.def)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/stringenc/stringenc.sty
)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/rerunfilecheck/rerunfilec
heck.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/atveryend/atveryend.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/uniquecounter/uniquecou
nter.sty)))
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/titling/titling.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/tools/longtable.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/booktabs/booktabs.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/enumitem/enumitem.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/ulem/ulem.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/jknapltx/mathrsfs.sty)
No file notebook.aux.
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/base/ts1cmr.fd)
ABD: EveryShipout initializing macros
(/home/decker/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)

(/home/decker/local/texlive/2020/texmf-dist/tex/latex/ucs/ucsencs.def)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/hyperref/nameref.sty
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/refcount/refcount.sty)
(/home/decker/local/texlive/2020/texmf-dist/tex/generic/gettitlestring/gettitle
string.sty))

Package hyperref Warning: Rerun to get /PageLabels entry.

(/home/decker/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsb.fd)
(/home/decker/local/texlive/2020/texmf-dist/tex/latex/jknapltx/ursfs.fd)

LaTeX Warning: No \author given.


(/home/decker/local/texlive/2020/texmf-dist/tex/generic/stringenc/se-ascii-prin
t.def)
! Undefined control sequence.
<argument> @{} >{\raggedright \arraybackslash 
                                              }p{(\columnwidth - 2\tabcolsep...
l.387 ...mnwidth - 2\tabcolsep) * \real{0.77}}@{}}
                                                  
? 
! Emergency stop.
<argument> @{} >{\raggedright \arraybackslash 
                                              }p{(\columnwidth - 2\tabcolsep...
l.387 ...mnwidth - 2\tabcolsep) * \real{0.77}}@{}}
                                                  
No pages of output.
Transcript written on notebook.log.

@t-makaro
Copy link
Contributor

I could have sworn that there was an earlier issue about this but I cannot find it. Anyways, one of our dependencies (pandoc) is super picky with the format of tables. If the spacing isn't just right, then it will fail.

@t-makaro t-makaro added the format:LaTeX pertains to exporting to the LaTeX format label Aug 12, 2021
@fortierq
Copy link
Contributor

fortierq commented Sep 8, 2021

I have the same problem, but it works for small tables.
When the table is medium/big, minipage are used in the .tex and cause an error (even with perfect markdown tables).
This is only happening for recent pandoc version.

Left with pandoc 2.5 (working) / right with pandoc 2.14.1 (not working) :
nbconvert_table

@cgevans
Copy link
Contributor

cgevans commented Dec 7, 2021

This problem occurs with recent versions of pandoc because pandoc now requires the calc and array packages. Adding \usepackage{array} to the template will resolve this error, at which point there will be an error from the lack of calc. Adding both should resolve the problem. Calc is brought up by #1566.

cgevans added a commit to cgevans/nbconvert that referenced this issue Dec 7, 2021
Pandoc >= 2.11.1 requires the calc package, and pandoc >= 2.11.3
requires the array package, for larger tables (taken from git blame
for pandoc's templates).  This commits adds the two packages in
an order similar to that in pandoc's templates.
ivanov pushed a commit that referenced this issue Dec 9, 2021
Pandoc >= 2.11.1 requires the calc package, and pandoc >= 2.11.3
requires the array package, for larger tables (taken from git blame
for pandoc's templates).  This commits adds the two packages in
an order similar to that in pandoc's templates.
@ivanov
Copy link
Member

ivanov commented Dec 9, 2021

closed by #1686

@ivanov ivanov closed this as completed Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format:LaTeX pertains to exporting to the LaTeX format
Projects
None yet
Development

No branches or pull requests

5 participants