[texhax] output routine question: index "continued" lines
Stan
texforeverything at att.net
Mon Jun 7 16:49:55 CEST 2010
Thanks for the info, and the example. I think I've made a macro that does
(almost) what I want. I'd greatly appreciate any comments you have,
especially about possible shortcomings. One thing I know it fails to do
is deal properly with the spacing between the added "!" lines and the
lines of text.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vsize=24pt%just two lines per page for this example
\newif\iflineadded% conditional to test whether ! has been added already
\output={%
\iflineadded
% if already added, do nothing
\else
\setbox255=\vbox{!\unvbox255}
\global\lineaddedtrue
\fi
\ifdim\ht255>\pagegoal% if \box255 too high
\unvbox255% send contents back to page builder
\else
\shipout\box255
\global\lineaddedfalse
\fi
}
Now is the time
for all good men
to come to the aid
of the party.
\bye
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
On Mon, 07 Jun 2010 03:34:43 -0500, Philip Taylor (Webmaster, Ret'd)
<P.Taylor at rhul.ac.uk> wrote:
>
>
> Stan wrote:
>> I'm trying to set up a basic output routine that will handle automatic
>> insertion of "continued" lines at the top of pages where appropriate.
>
> Let me address your final example first (I have to leave shortly) --
>
>> All of my attempts have resulted in the same type of error that results,
>> for example, from changing
>>
>> \output={\plainoutput}
>>
>> to
>>
>> \output={\plainoutput!}
>>
>> In other words, pages were ejected until some limitation was hit. (In my
>> case, I got a "TeX capacity exceeded, sorry [main memory size=2500000]"
>> message.)
>
> Because every time \output is threaded, it tries to append
> a shriek marker to the current page; you would want to
> look into the guts of \plainoutput to see how you could
> intercalate additional material without causing this
> infinite loop. A simple example is as follows; this
> shews the simplest output routine, followed by one that
> append a single line containing "!".
>
> \output = {\shipout \box 255 }
> Now is the time \eject
> for all good men \eject
> to come to the aid \eject
> of the party.
> \end
>
> \output = {\setbox 255 = \vbox {\unvbox 255 \centerline {!}}\shipout
> \box 255 }
> Now is the time \eject
> for all good men \eject
> to come to the aid \eject
> of the party.
> \end
More information about the texhax
mailing list