Article View: net.text
Article #73Separating even and odd pages in TeX.
From: Kathryn Hargreaves
Date: Wed, 13 Nov 1985 01:28
Date: Wed, 13 Nov 1985 01:28
46 lines
2545 bytes
2545 bytes
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
Technical Details
Message-ID:
<10960@ucbvax.BERKELEY.EDU>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!ucbvax!jennyShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!ucbvax!jenny From: jenny@ucbvax.BERKELEY.EDU (Kathryn Hargreaves) Newsgroups: net.text Subject: Separating even and odd pages in TeX. Message-ID: <10960@ucbvax.BERKELEY.EDU> Date: Tue, 12-Nov-85 20:28:58 EST Article-I.D.: ucbvax.10960 Posted: Tue Nov 12 20:28:58 1985 Date-Received: Thu, 14-Nov-85 01:09:44 EST Organization: University of California at Berkeley Lines: 46 Keywords: Two-sided output, TeX output routines, tree saving.