2

On p.235 of TeXbook it is said:

TeX reads an entire \halign{...} specification into its memory before typesetting anything, and it keeps track of the maximum width of each column, assuming that each column is set without stretching or shrinking the glue. Then it goes back and puts every entry into a box, setting the glue so that each box has the maximum column width.

In the first example badness is exceeded, but no warning is issued. In the second example entries are left-justified by default - why? And again, why no underfull warning is given?

\halign{\indent#&\quad#\cr
Horizontal lists&Chapter 14\cr
Vertical lists&Chapter 15\cr
Math lists&Chapter 17\cr}

\bigskip

\halign{\indent#&\quad#\cr
Horizontal&Chapter 14\cr
Vertical&Chapter 15\cr
Math&Chapter 17\cr}

\end
  • In the second one there is no glue to stretch, so everything stays where it is. – Henri Menke Jan 15 at 5:44
  • You probably won't get around reading the relevant parts of tex.web: github.com/TeX-Live/texlive-source/blob/… – Henri Menke Jan 15 at 5:55
  • @HenriMenke So, such behavior is "by definition". Where in TeXbook is it defined then? – Igor Liferenko Jan 15 at 6:53
  • 1
    Specifically, see §810 of the program. Note some similarity to §657–§660, but without any underfull/overfull reporting. – ShreevatsaR Jan 15 at 8:19
  • 2
    @IgorLiferenko \hbox to 1000pt{hello world} does contain glue, and the rules for its setting are described p. 77. OTOH, \hbox to 1000pt{hello} does not, and I don't know if the TeXbook describes how this case is handled. Experimentation suggests that in such a case, the box has the prescribed width and the contents is typeset flush left inside the box. – frougon Jan 16 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.