davidcarlisle / dpctex

Assorted TeX packages
93 stars 30 forks source link

Wrong line width in long table #53

Closed hvoss49 closed 1 month ago

hvoss49 commented 1 month ago

I used longtable and booktabs. For some reason I wanted only normal lines instead of the\toprule etc commands. I used

\let\toprule\hline
\let\midrule\hline
\let\bottomrule\hline

for a short test. The lines of the first and last column now filled the complete text width. Is this the intended behaviour with up-to-date TL2024?

Bildschirmfoto 2024-06-27 um 21 05 44

\documentclass{article}

\usepackage{longtable}
%\usepackage{booktabs}

\let\toprule\hline
\let\midrule\hline
\let\bottomrule\hline

\begin{document}

\begin{longtable}{l|c|r} 
\caption{Multipage table.}\label{tab:table1}\\\toprule 
\emph{Value 1} & {\emph{Value 2}} & \emph{Value 3}\\
$\alpha$ & $\beta$ & {$\gamma$} \\\midrule
\endfirsthead                 
\toprule
\emph{Value 1} & {\emph{Value 2}} & \emph{Value 3}\\
$\alpha$ & $\beta$ & {$\gamma$} \\\midrule
\endhead                      
\midrule 
\multicolumn{3}{r}{Fortsetzung $\rightarrow$}\\ 
\endfoot 
\bottomrule
\endlastfoot 
1 & 1110.1 & a\\  2 & 10.1 & b\\  3 & 23.113231 & c\\  1 & 1110.1 & a\\  2 & 
10.1 & b\\  3 & 23.113231 & c\\
1 & 1110.1 & a\\  2 & 10.1 & b\\  3 & 23.113231 & c\\  1 & 1110.1 & a\\  2 & 
10.1 & b\\  3 & 23.113231 & c\\
\end{longtable}

Changing all to \hline instead of the \let commands works fine.

davidcarlisle commented 1 month ago

that can't work: you are defining the booktabs commands to be the versions for tabular not longtable. you would need to use \def (or \renewcommand) not \let so that they expanded to the definition of \hline current at that point.