quarto-dev / quarto-dev/quarto-cli

Markdown table in PDF gets incorrect renderings due to longtable usage by Pandoc

Open
#13,095 2 comments 0 reactions 1 assignee View on GitHub

@cderv is already working on this.

Since Jul 17, 2025.

bug crossref latex tables
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/13063

---
format: pdf
keep-tex: true
---

| a | b |
|---|---|
| 1 | 2 |


| a | b |
|---|---|
| 1 | 2 |

: Caption {#tbl-test}

Counter gets incremented

Image

Because longtable is used by the first table

\begin{document}


\begin{longtable}[]{@{}ll@{}}
\toprule\noalign{}
a & b \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
1 & 2 \\
\end{longtable}

\begin{longtable}[]{@{}ll@{}}
\caption{Caption}\label{tbl-test}\tabularnewline
\toprule\noalign{}
a & b \\
\midrule\noalign{}
\endfirsthead
\toprule\noalign{}
a & b \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
1 & 2 \\
\end{longtable}




\end{document} 

It seems we missed something in our tests - the documents are compiling, but the counter fix is not working.

This could also be related to a change in LaTeX package - more complex to know.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.