[tex-eplain] Bug related to typographical lists
geolsoft at mail.ru
geolsoft at mail.ru
Mon Jul 19 22:00:34 CEST 2004
There seems to be a bug related to typographical lists (\@finli macro).
Description:
When \abovelistpenalty=10000, page break can still occur before the first list
item whenever the first item is passed an optional cross-reference label (i.e.,
when the first item is started by saying `\li[LABEL] ...').
Cause:
\@finli macro writes out label definition into .aux file (via \writeitemxref)
before the first item's paragraph is started.
In the setup described above (the first item is passed a cross-reference label),
we get the following sequence of events:
First, the \abovelistskip with \abovelistpenalty is placed on the vertical list
by \numberedlist. After that, when \@finli gets non-empty \@optionalarg, it
places a \write in the vertical list (via \writeitemxref). Finally, by starting
the paragraph with \printitem, \@finli causes placement of \parskip in the
vertical list.
So this is roughly what we end up with in the vertical list, before the first
item's box:
\vpenalty\abovelistpenalty
\vskip\abovelistskipamount
\write{...}
\parskip
Recall that page may break at a glue if it is preceded by a non-discardable item
(the TeXbook, p.~110). \write is a whatsit, which is non-discardable item,
making page break possible at the \parskip, thus ignoring
\abovelistpenalty=10000.
Solution:
In the \@finli, delay writing out cross-reference label until after the list
item's paragraph is started, i.e., move the three lines
\ifx\@optionalarg\empty \else
\expandafter\writeitemxref\expandafter{\@optionalarg}%
\fi
after \printitem. Will this have any side-effects on existing documents which
use eplain's lists?
Best regards,
Oleg Katsitadze
More information about the tex-eplain
mailing list