You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\hline adds a horizontal rule, nothing more. And \firsthline and \lasthline should behave the same. (I’m using an older format LaTeX2e <2019-10-01> patch level 3, but the current issue still stands)
Minimal example showing the bug
\RequirePackage{latexbug} % <--should be always the first line (see CONTRIBUTING)!\documentclass{article}
\usepackage{array}
\begin{document}
\setbox0=\hbox{%\begin{tabular}{@{}c@{}c@{}}
\hline
&\null\hskip10pt\relax\null\\
\hline\end{tabular}%
}%\copy0 %
With \verb|\hline|.\\
Actual width (in sp unit):
\number\wd0 \\% as expected
Expected:
1st column 0\,sp +
2nd column 1\,sp (guard) + 655360\,sp (content).
\medskip\setbox0=\hbox{%\begin{tabular}{@{}c@{}c@{}}
\firsthline
&\null\hskip10pt\relax\null\\
\hline\end{tabular}%
}%\copy0 %
With \verb|\firsthline|.\\
Actual width (in sp unit):
\number\wd0 \ ???\\
This turns out to be
\verb|2*\tabcolsep| (\the\numexpr\tabcolsep*2\relax\,sp) +
1\,sp + 1\,sp + 655360\,sp.
\medskip
There are two problems:
(1)~\verb|\firsthline| should suppress \verb|\tabcolsep| on two sides;
(2)~\verb|\firsthline| should NOT produce any extra guard (1\,sp).
\end{document}
Brief outline of the bug
\hline
adds a horizontal rule, nothing more. And\firsthline
and\lasthline
should behave the same. (I’m using an older formatLaTeX2e <2019-10-01> patch level 3
, but the current issue still stands)Minimal example showing the bug
Log file (required) and possibly PDF file
first-last-hline.log
Proposed fixes
The fixes are straightforward: Use
@{}
to suppress unintentional\tabcolsep
, and use\unskip
to cancel the 1sp guard.Therefore,
latex2e/required/tools/array.dtx
Lines 2921 to 2922 in 59b3e83
becomes
Furthermore,
latex2e/required/tools/array.dtx
Line 2962 in 59b3e83
becomes
The text was updated successfully, but these errors were encountered: