[tex-k] An interesting bug in the \makexref macro of manmac.tex

胡亚捷 (Hu Yajie) 2500418497 at qq.com
Thu Jul 2 16:37:01 CEST 2020


The TeXbook [p. 424] states that

    The \insert [produced by index macros like ^{...}] suppresses hyphenation
    when proofs are being checked; a \kern0pt is therefore emitted to provide
    consistent behavior in the other case.

Well, the behavior is not consistent if you have the habit of putting ^^{...}
between two intersentence spaces (" \ "). Consider the following input file:

\input manmac \def\chapno{18}
\dangerexercise Type the formula $\bf\bar x^{\rm T}Mx={\rm0}\iff x=0$,
using as few keystrokes as possible.  ^^{boldface numbers in math}
\ (The first `0' is roman, the second is bold. The superscript `T' is roman.)

\line{\ninepoint For reference, here is a full line that shows the left and
right margins of the page.}
\end

If proofmode is on, there will be (glue, vertical material, glue) between the
two sentences. Since vertical material is non-discardable, a line break at the
former glue will cause the next line to begin with an unwanted space, and vice
versa. But if proofmode is off, the items will be (glue, kern, glue), and with
luck, the first glue will be chosen as the breakpoint and the following items
will disappear. (If the kern+glue is chosen, the previous line will still end
with an unwanted space.) So the final book may be a bit better than the proof.
(May "\vadjust{}\kern0pt" or "\kern0pt\vadjust{}" ensure consistent behavior?)



More information about the tex-k mailing list.