Skip to content

pandoc > 3.8 gives error for Markdown Table Cell Notebook Export to PDF and nbconvert ( but pandoc < 3.8.1 works fine) #2243

@fortunewalla

Description

@fortunewalla

Tried different Google solutions & also updated texlive, latex-recommended, nbconvert, etc... but only downgrading pandoc to 3.8 worked.

The markdown table code in a jupyter notebook cell marked as markdown

| Header 1 | Header 2 | Header 3 |
| -- | -- | -- |
| Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 |
| Row 2 Col 1 | Row 2 Col 2 | Row 2 Col 3 |

Jupyter versions

$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.37.0
ipykernel        : 7.1.0
ipywidgets       : 8.1.8
jupyter_client   : 8.6.3
jupyter_core     : 5.9.1
jupyter_server   : 2.17.0
jupyterlab       : 4.4.10
nbclient         : 0.10.2
nbconvert        : 7.16.6
nbformat         : 5.10.4
notebook         : 7.4.7
qtconsole        : 5.7.0
traitlets        : 5.14.3

Installing with mamba install pandoc

$ pandoc --version
pandoc 3.8.2.1
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /home/linux/.local/share/pandoc

Using pandoc ver 3.8.2.1 with Notebook --> Export to PDF

[I 2025-11-05 03:56:17.768 ServerApp] Saving file at /jpy.ipynb
[I 2025-11-05 03:56:24.303 ServerApp] Writing 21158 bytes to notebook.tex
[I 2025-11-05 03:56:24.319 ServerApp] Building PDF
[I 2025-11-05 03:56:24.338 ServerApp] Running xelatex 3 times: ['xelatex', 'notebook.tex', '-quiet']
[C 2025-11-05 03:56:28.978 ServerApp] xelatex failed: ['xelatex', 'notebook.tex', '-quiet']
    b"This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023/Debian) (preloaded format=xelatex)\n restricted \\write18 enabled.\nentering extended mode\n(./notebook.tex\nLaTeX2e <2023-11-01> patch level 1\nL3 programming layer <2024-01-22>\n(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls\nDocument Class: article 2023/05/17 v1.4n Standard LaTeX document 

.....
......
......


* (1in=72.27pt=25.4mm, 1cm=28.453pt)


    Package hyperref Warning: Rerun to get /PageLabels entry.

    (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd)
    (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd)
    (/usr/share/texlive/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 416.


    ! LaTeX Error: No counter 'none' defined.

    See the LaTeX manual or LaTeX Companion for explanation.
    Type  H <return>  for immediate help.
     ...

    l.433 \begin{longtable}[]{@{}lll@{}}

    ?
    ! Emergency stop.
     ...

    l.433 \begin{longtable}[]{@{}lll@{}}

    No pages of output.
    Transcript written on notebook.log.

Using pandoc ver 3.8.2.1 with nbconvert CLI

$ jupyter nbconvert jpy.ipynb --to pdf
[NbConvertApp] Converting notebook ujutest.ipynb to pdf
[NbConvertApp] Writing 21158 bytes to notebook.tex
[NbConvertApp] Building PDF
[NbConvertApp] Running xelatex 3 times: ['xelatex', 'notebook.tex', '-quiet']
[NbConvertApp] CRITICAL | xelatex failed: ['xelatex', 'notebook.tex', '-quiet']
b"This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023/Debian) (preloaded format=xelatex)\n restricted \\write18 enabled.\nentering extended mode\n(./notebook.tex\nLaTeX2e <2023-11-01> patch level 1\nL3 programming layer <2024-01-22>\n(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls\nDocument Class: article 2023/05/17 v1.4n Standard LaTeX document class

....
....
....

* (1in=72.27pt=25.4mm, 1cm=28.453pt)


Package hyperref Warning: Rerun to get /PageLabels entry.

(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd)
(/usr/share/texlive/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 416.


! LaTeX Error: No counter 'none' defined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.433 \begin{longtable}[]{@{}lll@{}}

?
! Emergency stop.
 ...

l.433 \begin{longtable}[]{@{}lll@{}}

No pages of output.
Transcript written on notebook.log.

Downgrading from 3.8.2.1 to 3.8

$ mamba install "pandoc<3.8.1"
conda-forge/linux-64                                        Using cache
conda-forge/noarch                                          Using cache

Pinned packages:

  - python=3.10


Transaction

  Prefix: /home/linux/miniforge3/envs/jup

  Updating specs:

   - pandoc<3.8.1


  Package   Version  Build       Channel           Size
─────────────────────────────────────────────────────────
  Downgrade:
─────────────────────────────────────────────────────────

  - pandoc  3.8.2.1  ha770c72_0  conda-forge     Cached
  + pandoc      3.8  ha770c72_0  conda-forge     Cached

  Summary:

  Downgrade: 1 packages

  Total download: 0 B

─────────────────────────────────────────────────────────


Confirm changes: [Y/n]

Transaction starting
Unlinking pandoc-3.8.2.1-ha770c72_0
Linking pandoc-3.8-ha770c72_0

Transaction finished

After Downgrading to pandoc ver 3.8 , nbconvert

$ jupyter nbconvert jpy.ipynb --to pdf
[NbConvertApp] Converting notebook jpy.ipynb to pdf
[NbConvertApp] Writing 20470 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 7938 bytes to jpy.pdf
$ xpdf jpy.pdf

After Downgrading to pandoc ver 3.8, Jupyter Notebook Export to PDF

[W 2025-11-05 12:55:01.484 ServerApp] The websocket_ping_timeout (90000) cannot be longer than the websocket_ping_interval (30000).
    Setting websocket_ping_timeout=30000
[I 2025-11-05 12:55:01.491 ServerApp] Connecting to kernel 575f157b-9e99-4e55-a3f5-ee4365b1aeb6.
[I 2025-11-05 12:55:01.497 ServerApp] Connecting to kernel 575f157b-9e99-4e55-a3f5-ee4365b1aeb6.
[I 2025-11-05 12:55:07.828 ServerApp] Writing 20470 bytes to notebook.tex
[I 2025-11-05 12:55:07.828 ServerApp] Building PDF
[I 2025-11-05 12:55:07.828 ServerApp] Running xelatex 3 times: ['xelatex', 'notebook.tex', '-quiet']
[I 2025-11-05 12:55:11.851 ServerApp] Running bibtex 1 time: ['bibtex', 'notebook']
[W 2025-11-05 12:55:11.862 ServerApp] bibtex had problems, most likely because there were no citations
[I 2025-11-05 12:55:11.862 ServerApp] PDF successfully created
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions