10

I'm trying to figure out why there are warnings for 125pt case of AT&T table example in TeXbook. While trying to understand the meaning of these warnings, I came across p.302 of TeXbook, that says:

For example, suppose you say ‘\tabskip=0pt plus10pt \halign to200pt{&#\hfil\cr...\cr}’, and suppose that the aligned material turns out to make two columns of widths 50 pt and 60 pt, respectively. Then you get the following message:

Underfull \hbox (badness 2698) in alignment at lines 11--18
[] []
\hbox(0.0+0.0)x200.0, glue set 3.0
.\glue(\tabskip) 0.0 plus 10.0
.\unsetbox(0.0+0.0)x50.0
.\glue(\tabskip) 0.0 plus 10.0
.\unsetbox(0.0+0.0)x60.0
.\glue(\tabskip) 0.0 plus 10.0

Let's construct a complete example:

\tabskip=0pt plus10pt \halign to200pt{&#\hfil\cr
  \hbox to50pt{}&\hbox to60pt{}\cr}
\end

The log from this example does not match the TeXbook: the last line is

.\glue 0.0 plus 10.0

Can anybody construct an example that log will match TeXbook? This would help to understand how to interpret warning messages for alignments.

3
  • Seems like it's a bug in TeX The Program, because the last glue is \tabskip glue, and thus should be marked as such. Jan 10, 2020 at 7:47
  • I can't see why the final tabskip is not marked as such, worth raising with Karl Berry (acting as Knuth's filter for bug reports these days) Jan 10, 2020 at 9:08
  • If you mean the Overfull \hbox (4.37805pt too wide) in alignment warning in the AT&T example note the examples are set using \font\ninerm=cmr9 \ninerm not in cmr10 Jan 10, 2020 at 9:44

1 Answer 1

10

I suspect this is a bug.

If I modify your test slightly to

\showboxdepth3
\showboxbreadth100
\tracingoutput1
\tracingonline1

\tabskip=0pt plus10pt \halign to200pt{&#\hfil\cr
  \hbox to50pt{}&\hbox to60pt{}\cr}

\bye

Then the final tabskip is not marked as such in the underfull message:

Underfull \hbox (badness 2698) in alignment at lines 7--8
 [] [] 

\hbox(0.0+0.0)x200.0, glue set 3.0
.\glue(\tabskip) 0.0 plus 10.0
.\unsetbox(0.0+0.0)x50.0
.\glue(\tabskip) 0.0 plus 10.0
.\unsetbox(0.0+0.0)x60.0
.\glue 0.0 plus 10.0

But it is marked as such in the final set box in the shipped out page:

.\vbox(643.20255+0.0)x200.0, glue set 633.20255fill
..\glue(\topskip) 10.0
..\hbox(0.0+0.0)x200.0, glue set 3.0
...\glue(\tabskip) 0.0 plus 10.0
...\hbox(0.0+0.0)x50.0 []
...\glue(\tabskip) 0.0 plus 10.0
...\hbox(0.0+0.0)x60.0 []
...\glue(\tabskip) 0.0 plus 10.0
..\glue 0.0 plus 1.0fill

You can get the output shown for the unset alignment by adding a final unused column to the \halign preamble:

\showboxdepth3
\showboxbreadth100
\tracingoutput1
\tracingonline1

\tabskip=0pt plus10pt \halign to200pt{&#\hfil&#\cr
  \hbox to50pt{}&\hbox to60pt{}\cr}

\bye

produces the documented underfull warning:

Underfull \hbox (badness 2698) in alignment at lines 7--8
 [] [] 

\hbox(0.0+0.0)x200.0, glue set 3.0
.\glue(\tabskip) 0.0 plus 10.0
.\unsetbox(0.0+0.0)x50.0
.\glue(\tabskip) 0.0 plus 10.0
.\unsetbox(0.0+0.0)x60.0
.\glue(\tabskip) 0.0 plus 10.0
8
  • I see it, but I can hardly believe it: so, the listing on page 302 of The TeXbook would be an artifact, and not the result of an actual TeX run? Should we think that Knuth invented details like the input line numbers where the alignment occurs? Or perhaps, this bug was introduced in some version of TeX released after The TeXbook had been written?
    – GuM
    Jan 12, 2020 at 11:39
  • So, the fix must be done somewhere in the code that implements "a handy feature that helps a lot in cases like this" (p.241 of TeXbook)? Because if we do not use the starting &, all is OK. (like in your example (where repetition is not done) and in explicit #\hfil&#\hfil\cr) Jan 13, 2020 at 8:05
  • @IgorLiferenko somewhere in the section of tex.web that starts @* \[37] Alignment. It's sort of a miracle whenever \.{\\halign} and \.{\\valign} work, because they cut across so many of the control structures of \TeX. :-) I did have a look to see if I could trace this code but got a bit lost and decided to simply recommend you push it to DEK for consideration, which I gather you have done. Jan 13, 2020 at 10:11
  • 4
    I fixed it. @x link(p):=new_glue(glue_ptr(cur_loop)); @y link(p):=new_glue(glue_ptr(cur_loop)); subtype(link(p)):=tab_skip_code+1 @z Jan 14, 2020 at 5:40
  • @IgorLiferenko excellent! Did you report that back? Jan 14, 2020 at 7:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .