[net.text] Separating even and odd pages in TeX.

jenny@ucbvax.BERKELEY.EDU (Kathryn Hargreaves) (11/13/85)

I would like to split the output from TeX into two dvi files --
one for even pages, one for odd. (I am not worrying about
non-consecutive page numbers; handling the simple case is
enough.) I see three possibilities:

1. Have TeX \shipout to two different files. This seems to be
the optimal solution, as no further processing is required.
Unfortunately, it doesn't seem possible to do this, that each
job has exactly one .dvi file. Is this true?

2. Suppress output for even pages on the first run, save the
resulting .dvi file, and suppress odd pages for the second.
This seems like it should be easy, as all I should have to do
is rewrite the output routine to throw away the appropriate
pages. For instance, if I change the webmac macros to:
\def\normaloutput#1#2#3{
\ifodd\pageno
   \onormaloutput{#1}{#2}{#3}
\else
   ????? % Throw away even pages.
\fi
}
and rename the old \normaloutput to \onormaloutput, all
should be fine. Well, in place of the ????, I have tried
several things:
\setbox0 = \box255
\setbox255 = \hbox{}
\setbox255 = \nullbox    % Where \nullbox has been allocated with \newbox.
and other slight variations. In all cases, I got one of two
results:  either TeX would complain that \box255 wasn't empty
(as in the second and third cases) or when I printed the result,
I would get the even page that was supposedly thrown away
printed on top of (or underneath?) the next odd page (in the
first.). That is, pages 2 and 3 would be printed on the same
piece of paper.

3. Modify dvitype or some other dvi reading program to take
the output from a normal run of TeX and split it up into two
files. This would no doubt not be hard, but it seems that I
shouldn't have to be writing any external programs to
accomplish this, so I haven't tried it yet.

Comments, answers, questions?

jenny@ucbvax.uucp   ucbvax!jenny   jenny@ucbvax.edu
jenny%ucbvax@berkeley.edu