davidcarlisle / dpctex

Assorted TeX packages
93 stars 30 forks source link

tabulary incorrectly accounts for b and p columns #38

Closed davidcarlisle closed 2 months ago

davidcarlisle commented 1 year ago

The following example shows tabulary is over-wide if p is used (but m works)

\documentclass{article}
\usepackage{tabulary}
\def\x{one two three four five six seven eight nine ten }
\def\xy{Red \x. Green \x\x. Blue\x. }
\def\xyz{\xy\xy}
\begin{document}

\noindent
\begin{tabulary}{\textwidth}{p{5cm}LL}
\xyz&\xyz&\xyz\\
1&2&3  
\end{tabulary}

\noindent
\begin{tabulary}{\textwidth}{m{5cm}LL}
\xyz&\xyz&\xyz\\
1&2&3  
\end{tabulary}
\end{document}

A user suggests

275c275
<   \ifnum\@chnum<4
---
 >   \ifnum\@chnum<6
369c369
<   \ifnum\@chnum<4
---
 >   \ifnum\@chnum<6

Which looks eminently plausible, although this code hasn't changed in any substantial way since last century...

Recording here. More analysis required on what the real intention was (although the current behaviour is clearly wrong)