# Direc­tory tex-archive/dviware/dvidvi

Anyone may freely use, modify, and/or distribute this file, without limitation.

Here's a little hack I threw together for those doing pagination
tricks.  Any improvements are appreciated.  Enjoy!
The dvidvi program converts a dvi file into another dvi file,
with perhaps certain changes.  Invocation is

dvidvi param infile outfile

What are the parameters?  The 'easy' paramaters are the following:

-f n     page n is first page selected
-l n     page n is last page selected
-n n     select at most n pages. Notice that n is the number of pages
selected, independently of the number of pages actually
contained in a sheet
-i { n1..n2 | n1 }[,...]
include pages (ranges allowed). When this option is
used, ONLY the specified pages are selected. However,
we can exclude from these pages with the option -x
-x { n1..n2 | n1 }[,...]
exclude pages (ranges allowed)
-q       work in quiet mode, that is do not print in the screen
messages of how the work is being done.
-r       reverse the order of the pages.

The page numbers for the above options -f -l -i and -x can be specified
in different ways.

1) If a number n is given, it is interpreted as the n'th page from the
begining of the .dvi file. Of course, this number is independent of the
page number assigned by TeX.

2) TeX page numbers are those who are actually written in the page;
these page numbers can be modified, for example, by using the TeX commands
A TeX page number can be specified by preceding the number n with the
character @. Thus, if you specify -f @25 -l @30 you select the pages
between 25 and 30, these numbers being those assigned by TeX.

3) However, several pages can have the same TeX page number in a .dvi file.
For example, the introductory pages in a book are numbered i, ii, and so on
until the first chapter begins and then, the pages are numbered 1, 2, etc.
In this case, the pages numbered i and 1 in the .dvi file have the same TeX
page number. If you want to select for example the second occurrence of the
page numbered 1, you can specify a page number as (@2)1. Thus @1 is equivalent
to (@1)1. For example, if you specify -f (@2)1 -l(@2)10 you select the pages
between 1 and 10 of the first chapter, not the introductory pages between
i and x.

There is another parameter that tells dvidvi how you want to change page
layout and specifications. This is the -m parameter.

The number preceding the colon is the modulo value.  Everything
will be done in chunks of pages this big.  If there is no colon, than the
default value is assumed to be one.  The last chunk of pages is padded
with as many blank pages as necessary.

Following the colon is a comma-separated list of page numbers.
These page numbers are with respect to the current chunk of pages, and
must lie in the range zero to the modulo value less one.  If a negative
sign precedes the number, then the page is taken from the mirror chunk;
if there are m chunks, then the mirror chunk of chunk n is the chunk
numbered m-n-1.  Put simply, it is the chunk numbered the same, only
from the end.  This can be used to reverse pages.  If no number is
given, the page number defaults to 1.

Following each page number is an optional offset value in
parenthesis, which consists of a pair of comma-separated dimensions.
Each dimension is a decimal number with an optional unit of measure.
The default unit of measure is inches, or the last unit of measure
used.  All units are in true dimensions.  Allowable units of measure
are the same that TeX allows:  in, mm, cm, pt, pc, dd, and cc.

Simple enough, eh?  Okay, let's do some simple things.

-m -      Reverses the order of the pages.  This time, both the modulo and
the page number are defaulted.

-m 2:0    Selects the first, third, fifth, etc. pages from the file.  Print
this one after printing the next, taking the paper out of the
feed tray and reinserting it into the paper feed.

-m 2:-1   Selects the second, fourth, etc. pages, and writes them in reverse
order.
-m 4:-1,2(4.25in,0in)
-m 4:-3,0(4.25in,0in)
Useful for printing a little booklet, four pages to a sheet,
double-sided, for stapling in the middle.  Print the first one,
put the stack back into the printer upside down, and print the
second.  The `in' specifications are superfluous.
-m ,(1pt,1)
blurry with this option, you may want to send enemies letters
printed like this.  *Long* letters.
-m 4:0(5.5in,4.25),3(0,4.25)
-m 4:1(0in,4.25),2(5.5,4.25)
Print a four-page card on one sheet.  Print the first, rotate
the paper 180 degrees and feed it again.  (PostScript people
can do funny tricks with PostScript so this isn't necessary.)

Enjoy; this is an early release, so make suggestions, improvements,
and I'll get back to you with a better version later.

======================================================================

CTAN SOURCE TREE INFORMATION

This CTAN source tree has been automatically extracted from the texk
Subversion repository at svn://tug.org/texlive/trunk/Build/source/texk/.

It is not possible to use the supplied configure script.
In fact, if you call it; you will be told as such.

This dviljk source can only be compiled in a texk build environment.
http://www.tug.org/texlive/svn/.

It all boils down to a Subversion checkout of
svn://tug.org/texlive/trunk/Build/source
This will be the source tree that you can use for compilation. The
CTAN directory is there for archival and informational purpose.

For your convenience, the original configure script from the texk
source tree is available in this directory as configure.texk.

For the CTAN team,

Joachim Schrod <jschrod@acm.org>

Name Notes
ac
tests

## Files

Name Size Date Notes
ChangeLog 3587 2014-06-18 13:56
Makefile.am 730 2014-06-18 13:56
Makefile.in 42482 2014-06-18 13:56
a5bookle.bat 1794 2006-01-17 22:41
a5bookle.com 1764 2006-01-17 22:41
a5bookle.hlp 957 2006-01-17 22:41
a5test.tex 497 2006-01-17 22:41
aclocal.m4 43886 2013-12-25 16:37
build.com 138 2006-01-17 22:41
config.h.in 4883 2014-10-28 11:51
configure 710 2007-07-03 12:56
configure.ac 758 2013-07-02 08:58
configure.texk 504969 2014-12-08 09:31
doubside.bat 1093 2006-01-17 22:41
doubside.com 1298 2006-01-17 22:41
doubside.hlp 725 2006-01-17 22:41
dvidvi.1 5008 2011-02-04 17:59
dvidvi.c 35454 2013-06-28 15:27
dvidvi.kohm-patch 4785 2006-01-17 22:41
dvidvi.test 296 2011-09-29 14:07
dvisamp.tex 1490 2006-01-17 22:41

Down­load the con­tents of this pack­age in one zip archive (166.4k).

## dvidvi – Con­vert one DVI file into an­other

The out­put DVI file's con­tents are spec­i­fied by page se­lec­tion com­mands; se­ries of pages and page num­ber ranges may be spec­i­fied, as well as in­clu­sions and ex­clu­sions.

 Pack­age De­tails dvidvi Ver­sion 1.0 Li­cense Free li­cense not oth­er­wise listed, or more than one free li­cense ap­plies Copy­right 1988-2011 Rad­i­cal Eye Soft­ware Main­tainer Tom Ro­kickiEste­ban Zi­manyi Con­tained in TeXlive as dvidvi Topics DVI pro­ces­sor