[texhax] Semantics of \botmark (bug or interpretation?)
David Allsopp
dra27 at cantab.net
Mon Jun 27 20:45:00 CEST 2005
I hope that I'm emailing the right people about this. My query concerns the
exact meaning of the statement on Page 258 of the TeXbook which states "When
there is no mark on a page, all three are equal to the previous \botmark".
My interpretation (and the usual semantics that you get) is that this means
that if there is no mark on the page, then you get the last \mark that was
encountered in the document so far. The enclosed TeX file demonstrates this
in a rather contrived manner.
The document is set-up to contain a mark (called ONE) on the first page.
This page is immediately \shipout'd. The second page then starts with a mark
(called TWO). \output is then called and, naturally, \botmark is TWO. I then
insert 25cm of vskip at the top of the page and unvbox the output. The
effect of this is to push the mark to what will become the third page.
\output is then called again.
At this point, I would interpret "previous \botmark" to mean the \botmark
that was encountered when \output processed page 1. However, what you get is
the \botmark when \output was last called (so TWO instead of ONE). Is this
the intended behaviour? If it is, then I would suggest that it isn't very
consistent with the general behaviour of the \mark system! The lists shown
in the logfile show that \mark{TWO} is indeed not present in \box255 on the
third call to \output so the last \mark that was encountered was ONE.
Any comments or corrections much appreciated. The workaround for my code is
to insert a \mark at the top of the page that restores the correct value of
\botmark from the last \shipout'd page (the line in this example is shown
commented out). The behaviour I expect from TeX presumably would not be hard
to construct in general: all that is required is for TeX to store away the
value of \botmark every time a \shipout is made. Then if the scan of \box255
reveals that there are no \mark's in it, TeX can set \botmark (and
\firstmark and \topmark) to the saved value.
Regards,
David
PS. Not too surprisingly, the example is completely contrived but the
situation did arise in a quite genuine application that's tricky to solve
any other way.
PPS. For what it's worth, I'm running TeX 3.141592 under Windows XP SP1
using MiKTeX 2.4. I can't imagine that this behaviour of TeX would vary,
though!
-------------------------------------------------------------
David Allsopp
Address: 692 King's College
Cambridge, Cambs
CB2 1ST
United Kingdom
Tel : +44 (0)845 838 5578
Mobile : +44 (0)7764 480234
Email : dra27 at cantab.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Output.tex
Type: application/octet-stream
Size: 1138 bytes
Desc: not available
Url : http://tug.org/pipermail/texhax/attachments/20050627/26e41694/Output.obj
More information about the texhax
mailing list