Files
pandoc/test/command/4558.md
T
Václav Haisman 660898056c LaTeX: Allow repeated longtable captions. (#4623)
Add a `repeat-caption` table class that repeats captions on each page of a
longtable without adding duplicate list-of-tables entries. Preserve the
existing non-repeating default and ignore the class for floating tables.

Closes #4558.
2026-11-07 09:39:35 -08:00

1.4 KiB

% pandoc -f html -t latex
<table class="repeat-caption">
  <caption>Repeated caption.</caption>
  <thead><tr><th>one</th><th>two</th></tr></thead>
  <tbody><tr><td>1</td><td>2</td></tr></tbody>
</table>
^D
\begin{longtable}[]{@{}ll@{}}
\caption{Repeated caption.}\tabularnewline
\toprule\noalign{}
one & two \\
\midrule\noalign{}
\endfirsthead
\caption[]{Repeated caption.}\tabularnewline
\toprule\noalign{}
one & two \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
1 & 2 \\
\end{longtable}
% pandoc -f html -t latex
<table class="repeat-caption">
  <caption>Repeated caption.</caption>
  <tbody><tr><td>one</td><td>two</td></tr></tbody>
</table>
^D
\begin{longtable}[]{@{}ll@{}}
\caption{Repeated caption.}\tabularnewline
\toprule\noalign{}
\endfirsthead
\caption[]{Repeated caption.}\tabularnewline
\toprule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
one & two \\
\end{longtable}
% pandoc -f html -t latex --table-caption-position=below
<table class="repeat-caption">
  <caption>Repeated caption.</caption>
  <thead><tr><th>one</th><th>two</th></tr></thead>
  <tbody><tr><td>1</td><td>2</td></tr></tbody>
</table>
^D
\begin{longtable}[]{@{}ll@{}}
\toprule\noalign{}
one & two \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\tabularnewline
\caption[]{Repeated caption.}
\endfoot
\bottomrule\noalign{}
\tabularnewline
\caption{Repeated caption.}
\endlastfoot
1 & 2 \\
\end{longtable}