[tex-k] potential errata in The TeXbook and TeX: The Program, Jubilee editions

Karl Berry karl at freefriends.org
Tue Oct 31 20:48:11 CET 2023


Hi Eran - back on your report from August 2022 (sorry).

    *page 297:* The index for "remainder" should link to section 104
    ("remainder, scaled") instead of 543 (different "remainder" from
    font-metric file)

Agreed. Added at
https://tug.org/texmfbug/newbug.html#B297remainder.

    *page 470, section 1127:* First line of align_error - should it
    check for abs(align_state) > 1 instead of > 2? Since I assume you
    want align_state to become zero by adding a single open or close
    brace. I'm probably wrong.

Here is DRF's analysis, concluding that no change is warranted. The fact
that it's in the trip test is pretty persuasive.

Let me know if questions/problems/changes ... --thanks, karl.


Date: Mon, 16 Oct 2023 20:36:49 +0000 (UTC)
From: David Fuchs
To: Karl Berry
Subject: B470: align_state

OK, I'm going to go a little out on a limb on the align_state business,
but I don't have high confidence level. Consider a basic alignment:

\halign{\indent#\hfil&\hskip 1em#\hfil\cr
A&B\cr
CC&dd\cr
EEEE&F\cr}

Works fine.  Now, let's trigger align_error by changing "CC" to "C{C"
which results in the expected "Missing } inserted" when TeX gets to the
& (and then recovers OK with the default fix).  Good.  Now let's change
to "C{{C" which gives a similar result, except that we get the "Missing
} inserted" error twice, as you would expect.  Also good. 

But when we change to "C{{{C" we instead get the "Misplaced alignment
tab character &" error message.

My best guess is that the idea was that if you left out a closing brace
by accident (so align_state is 1), or mis-typed a closing brace as an
opening brace (so align_state is 2), it was deemed to be most likely
that you had a simple case of messed up braces, and deserved a message
that points in that direction.

But if you're deeper than that into levels of unclosed left braces,
something way worse might well be going on, and the warning should be
more along the lines of indicating that you're deep in the weeds and not
anywhere near an alignment (maybe you thought you were even out of
it). And in such a situation, if you only got a zillion "Missing }
inserted" messages, you may not quite have enough clues that it's due to
alignment stuff (even though the Help text helps), and the more direct
"Misplaced alignment tab character &" is more to the point.

So, I don't know if that's the actual motivation for the test to be
">2" and maybe there's a better explanation.  Somehow I don't think is a
mistake, though; the trip test does hit it.  -drf


More information about the tex-k mailing list.