[comp.text] Splitting DVI Files

c60a-2di@e260-2b.berkeley.edu (The Cybermat Rider) (01/02/89)

I've written a Perl script that takes a Postscript file generated from a
.dvi file via dvi2ps and splits it into two files containing odd- and
even-numbered pages respectively.  This is to facilitate printing
double-sided pages on a LaserWriter.

However, I've found that printing the split-files is a REAL headache.  It
occasionally works well, but often enough, I either get NOTHING AT ALL or
just 1 page!  (Before anyone mentions it, the Postscript prolog and trailer
from the original are present in each split-file.

Does anyone know how to split a TeX file into odd and even pages (a) at the
Postscript level and/or (b) at the DVI level?  (I'm not asking how to to it
at the TeX level coz I often don't have access to the document sources.)
Better still, does anyone have any code that does this?

Thanks very much in advance for any info!

----------------------------------------------------------------------------
Adrian Ho a.k.a. The Cybermat Rider	  University of California, Berkeley
c60a-2di@web.berkeley.edu
Disclaimer:  Nobody takes me seriously, so is it really necessary?

mrd@sun.soe.clarkson.edu (Michael DeCorte) (01/03/89)

Actually this is not a trivial program (but not *that* hard either).
You can get from the Clarkson archive 2 things that will do what you 
want.
if you mail the below message to the archive-server@sun.soe.clarkson.edu
it will give you what you want.

help
index
send tex-programs dvidvi
send tex-style select.dvi
path c60a-2di@e260-2b.berkeley.edu 


The stuff is also available via anonymous ftp.

--

Michael DeCorte // (315)265-2439 // P.O. Box 652, Potsdam, NY 13676
Internet: mrd@sun.soe.clarkson.edu  // Bitnet:   mrd@clutx.bitnet        
---------------------------------------------------------------------------
Clarkson Archive Server // commands = help, index, send, path
archive-server@sun.soe.clarkson.edu
archive-server%sun.soe.clarkson.edu@omnigate.bitnet
dumb1!dumb2!dumb3!smart!sun.soe.clarkson.edu!archive-server
---------------------------------------------------------------------------

debra@alice.UUCP (Paul De Bra) (01/03/89)

In article <18669@agate.BERKELEY.EDU> c60a-2di@e260-2b.berkeley.edu (The Cybermat Rider) writes:
>...
>Does anyone know how to split a TeX file into odd and even pages (a) at the
>Postscript level and/or (b) at the DVI level?  ...

At the dvi-level this is rather easy: the dvi2ps program has a piece of
code that is easy to find and which is used to handle the -f and -t options
(from some page or to some page). This is easily extended to select even
or odd numbered pages. You could add options to dvi2ps to do that, so it
may be of more general use too.

Paul.
-- 
------------------------------------------------------
|debra@research.att.com   | uunet!research!debra     |
------------------------------------------------------

drh@notecnirp.Princeton.EDU (Dave Hanson) (01/03/89)

In article <18669@agate.BERKELEY.EDU> c60a-2di@e260-2b.berkeley.edu (The Cybermat Rider) writes:
>
>Does anyone know how to split a TeX file into odd and even pages (a) at the
>Postscript level and/or (b) at the DVI level? 

i have a program, dvipages, that extracts pages (perhaps with repeats)
from a .dvi file and generates a new .dvi file. it's used
for doing even/odd extraction, etc.
a shar(1) file containing dvipages.c and dvipages.1 is
available as pub/dvipages.shar for anonymous ftp from princeton.edu.
i can also mail a copy if necessary.

dave hanson

piet@ruuinf (Piet van Oostrum) (01/03/89)

In article <18669@agate.BERKELEY.EDU>, c60a-2di@e260-2b (The Cybermat Rider) writes:
`
`Does anyone know how to split a TeX file into odd and even pages (a) at the
`Postscript level and/or (b) at the DVI level?  (I'm not asking how to to it
`at the TeX level coz I often don't have access to the document sources.)
`Better still, does anyone have any code that does this?
`
There is a program 'dviselect' on the Unix TeX tape that allows you to
select pages from a dvi file. It wouldn't be hard to make an option to
select only the even or the odd ones, in case you don't want to type in
alll the numbers.

My own dvi2ps program also has the option of only printing selected pages,
but then again, you have to specify them all (also easy to enhance).
-- 
Piet van Oostrum, Dept of Computer Science, University of Utrecht
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands
Telephone: +31-30-531806        UUCP: ...!mcvax!hp4nl!ruuinf!piet