Skip to content

Pandoc 3.8.2 - Error producing PDF. ! LaTeX Error: No counter '' defined. #11201

@priiduonu

Description

@priiduonu

When I have a markdown document that contains a table without caption, like:

\listoftables

# testtables

table without caption follows:

| header1 | header2 |
|---------|---------|
| r1c1    | r1c2    |
| r2c1    | r2c2    |

other table with caption follows:

| header1 | header2 |
|---------|---------|
| r1c1    | r1c2    |
| r2c1    | r2c2    |

: table with caption

the following error occurs:

! LaTeX Error: No counter '' defined.

when running

pandoc -s -F pandoc-crossref test.md -o test.tex --pdf-engine=pdflatex

The error also occurs with previous version (3.8.1) and is caused by e13aa5c

The error does not occur without pandoc-crossref (but then it still increases the table counter)!

The solution for avoiding incrementing the table counter in this commit may work fine with newer longtable packages (>= 4.21) as \LTcaptype can be empty. For the rest of us who rely on package versions provided by the distros, the following change should fix it (for use with pandoc-crossref):

  • set up a new "dummy" counter, e.g. \newcounter{none}
  • instead of \def\LTcaptype{} use the new counter \def\LTcaptype{none}

Related issues: #11189, #11141, lierdakil/pandoc-crossref#480

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions