[tex-live] bug in TeX ?

Zdenek Wagner zdenek.wagner at gmail.com
Thu Apr 17 19:22:58 CEST 2008

2008/4/17, Barbara Beeton <bnb at ams.org>:
> elie,
>  i am don knuth's bug collector.
>  i have retrieved the files, and will send
>  them through the required vetting procedure.
>     It looks like I have found a bug in TeX : here are the files :
>     http://norgz.info/bug.zip
>     The two files gregorio-good.tex and gregorio-bad.tex differ only in one
>     \showthe, and yet the result is different...
>     If it is not a bug can you explain my mistake, and if it is a bug where can
>     I report it ?
>     At the beginning I thought it was only a bug in omega, aleph and luaTeX, so
>     I reported it on luatex (http://tracker.luatex.org/view.php?id=26) with the
>     help of Arthur Reutenauer, but after removing all luaTeX and omega specific
>     parts, it looks like the bug is also in TeX...
>     Thank you in advance,
>     --
>     Elie
> i must inform you that the periodic update
>  cycle has just been completed, and the next
>  review isn't scheduled to take place until
>  2013.  this information is posted on knuth's
>  web site, at
>   http://www-cs-faculty.stanford.edu/~knuth/abcde.html
>  i'll inform you of the results as soon as the
>  vetting has been completed.
As Taco wrote, this is not a bug. As written in the TeXbook, the
syntactic rule for a number requires full expansion and reading the
number ends when a space is encountered or at a token which cannot be
expanded further and cannot be a part of a number. Removing the
percent sign adds a space coming from the endline character. Some 15
years ago a very similar example was given in a TeX related mailing
list. The author of the message wanted to demonstrate that placing
percent signs at the end of all lines may be harmful.

Proper spacing and sometimes protecting by \relax is important.
Consoder the following short example:

Now\hskip 0pt plus 1fil later\hskip 0pt plus 1fil sooner.


You have 3 words that seem to be separated by 1fil and you get another
1fil from \parfillskip. You might assume that you get equal spaces
between the words and the same space will appear after the end of
sequence. However, this is not true. Tne word "Now" will be placed at
the beginning of the line after the space of \parindent and
"atersooner." will be placed at the end of the line. You also see that
"l" disappeared. The reason of  this beaviour is that "fil", "fill",
adn "filll" allow spaces in te middle of the word, so the above line
is interpreted as:

Now\hskip 0pt plus 1fill ater\hskip 0pt plus 1fil sooner.

Of course, fill has a precedence, so all fil's are effectivelly
removed. If you want equal spaces, you must insert \relax between fil
and later. This is described somewhere in the TeXbook too. That's why
macro writers put \relax after numbers and dimensions because they
never know what the users put after the macro.

>                                                                 -- bb

Zdeněk Wagner

More information about the tex-live mailing list