rolfn / xltabular

LaTeX package which combines longtable and tabularx.
Other
10 stars 3 forks source link

xltabular breaks table numbering of longtable #23

Open u-fischer opened 1 week ago

u-fischer commented 1 week ago

Without xltabular the numbering is fine:

\documentclass{book}
%\usepackage{xltabular}
\usepackage{longtable}
\begin{document}
\begin{longtable}{c}
\caption{caption}
\endfirsthead
xxx\\xxx
xxx\\xxx
\end{longtable}
\end{document}

image

If xltabular is loaded (in a current texlive 2024) the counter is increased:

image

u-fischer commented 1 week ago

repeating my comment from https://github.com/davidcarlisle/dpctex/issues/57: it seems to work if one revert to the default caption definition of longtable (I also ran a short test with hyperref and that looks fine too):

\documentclass{book}
\usepackage{xltabular}
\makeatletter
\def\LT@caption{%
  \noalign\bgroup
    \@ifnextchar[{\egroup\LT@c@ption\@firstofone}\LT@capti@n}
\makeatother
\begin{document}
\begin{longtable}{c}
\caption{caption}
\endfirsthead
xxx\\xxx
xxx\\xxx
\end{longtable}
\end{document}
hvoss49 commented 1 week ago

Es wäre sinnvoller, wenn David xltabular komplett in longtable einbauen würde. Dann gäbe es weniger Probleme. Wir werden den Patch von David wieder rückgängig machen. Er hat andere Probleme. Danach geht dann obiges.