GL <
goua...@gmail.com> writes:
> Le 12/04/2018 à 02:14, Donald Arseneau a écrit :
>> GL <
goua...@gmail.com> writes:
>>
>>> Looking carefully at the \output routine,
>>
>> Which \output routine?
>
> I meant the \output routine of the TeX engine (pdfTeX or LuaTeX
> if you prefer).
>
No, the engine does not have an output routine... (Actually it does have
a very simple one built in, but it is only there for if no format gets
loaded.)
The plain TeX format has a still fairly simple output routine, and
maybe that is what you are looking at. It doesn't do any recycling.
The LaTeX output routine is more complex and does recycle material
back to the page contents, but it never touches \holdinginserts, nor
does it do much restoration of marks. It does not use \topmark at
all, but if you wanted to, you should remember the previous \botmark
in a macro in your own output routine, which is the only thing that
will be able to keep track. (That is much simpler than the alternative
which is to throw away a page to get the marks bach in order.
If you use \holdinginserts at all, you should have it on (1) most
of the time, and only set it off (0) when you unbox your recycled
page and you are sure it is the final trip going to \shipout.
> It is not a problem for \topmark since there is only one register to
> save/restore but with eTeX \topmarks i sould look at the allocation
> number of \marks registers in order to save every \botmarks up to
> this allocation number...
Just a loop.
> What is the purpose of \topmarks finally ? To refer to the previous
> page, or to refer to the previous \box255 ???
It is to give context to the \output routine. The way it works gives the
output routine the flexibility to use it as it likes. For example, there
are output routines to only ship out selected pages, which would disrupt
\topmark if it were only updated at \shipout. Yes, the effect could be
emulated using a macro, but any complex output routine needing \topmark
should probably be doing that.
--
Donald Arseneau
as...@triumf.ca