[texhax] Alignments and Knuth's uncertainty principle ...

Donald Arseneau asnd at triumf.ca
Wed Jan 28 00:09:54 CET 2009

Philip TAYLOR <P.Taylor at Rhul.Ac.Uk> writes:

> Donald Arseneau wrote:
>  > This situation does lead to surprising behavior that looks
>  > buggy at first.  TeX gives the smallest feasible width to
>  > that unconstrained column, and that width is likely
>  > *negative*.
> Many thanks for your observations, Donald.  I take it
> that a column width can become negative (in the
> scenario that we are discussing) only if the overall
> width of the alignment is constrained (is this the
> case ?).

No, the width can be negative in natural-width \halign if 
a column has no singleton cells, but cannot be merged 
with another column due to overlapping spans.

> get the idea).  The problem was that the name spanning
> columns 1 and 2 caused column 2 to grow in width, whereas
> I had (very naively) thought that column 2 would take
> the width of half an "=" minus the width of an "|",
> leaving column 1 to grow as necessary in order to
> accommodate the name.

So this is a different matter, and it sounds like there are
individual entries in each column.

> Unless I am missing something very obvious, 

This case *is* covered explicitly in The TeXbook.  In my
old copy it is a paragraph on page 245: "...sometimes they
produce undesirable effects... all the excess width is
allocated to the third [final] column."  Knuth recommends
\hidewidth to help, but it isn't terribly useful.
An old standby automatic solution is a finite shrinkable 
\tabskip, if you are using {tabular*} ot \halign to{} 
to force a specific overall width.

> seem to me that \haligns could be considerably more
> powerful 

They are very primitive.  Browsers render html tables much
more powerfully.  In TeX, further features must be built 
with tricky macros.  See tabularx/tabulary packages for 

Donald Arseneau                          asnd at triumf.ca

More information about the texhax mailing list