-
Notifications
You must be signed in to change notification settings - Fork 604
Open
Description
π Bug Report: nbconvert 7.x generates invalid LaTeX (none counter missing)
Summary
nbconvert (7.16.6) generates LaTeX files that include references to a counter named none, but the counter is never defined.
This causes LaTeX PDF compilation to fail with:
! LaTeX Error: No counter 'none' defined.
The error occurs systematically when Pandas DataFrames are present in the notebook.
π Steps to Reproduce
1. Create a new test.ipynb with one cell:
import pandas as pd
pd.DataFrame({"A":[1,2], "B":[3,4]})
### 2. Run:
jupyter nbconvert --to pdf test.ipynb
### 3. Inspect the generated .tex file:
It contains:
\refstepcounter{none}
but no definition for this counter.
β Actual Behavior
LaTeX compilation fails with:
! LaTeX Error: No counter 'none' defined.
l.xxx \refstepcounter{none}
β
Expected Behavior
nbconvert should either:
avoid emitting \refstepcounter{none},
or
ensure the counter is defined:
\newcounter{none}
π Environment
nbconvert 7.16.6
Pandoc 3.8.3
Python 3.13.11
TeX MiKTeX
OS Windows 11
β Workaround
Editing the resulting .tex file and adding:
\newcounter{none}
fixes the compilation failure.
π Additional Notes
This did not occur in nbconvert 6.x
Likely related to changes in Pandoc 3.xβs LaTeX writer
Appears when Pandas HTML tables are converted to LaTeX via Pandoc
The counter none seems to be a placeholder generated by Pandoc but not defined by nbconvert
If useful, I can also attach:
- the generated .tex file
- the log output from LaTeX
- a minimal notebook (test.ipynb)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels