| 1 |
dvidvi 1.0, Copyright (C) 1988-2011, Radical Eye Software |
| 2 |
Anyone may freely use, modify, and/or distribute this file, without limitation. |
| 3 |
|
| 4 |
Here's a little hack I threw together for those doing pagination |
| 5 |
tricks. Any improvements are appreciated. Enjoy! |
| 6 |
The dvidvi program converts a dvi file into another dvi file, |
| 7 |
with perhaps certain changes. Invocation is |
| 8 |
|
| 9 |
dvidvi param infile outfile |
| 10 |
|
| 11 |
What are the parameters? The 'easy' paramaters are the following: |
| 12 |
|
| 13 |
-f n page n is first page selected |
| 14 |
-l n page n is last page selected |
| 15 |
-n n select at most n pages. Notice that n is the number of pages |
| 16 |
selected, independently of the number of pages actually |
| 17 |
contained in a sheet |
| 18 |
-i { n1..n2 | n1 }[,...] |
| 19 |
include pages (ranges allowed). When this option is |
| 20 |
used, ONLY the specified pages are selected. However, |
| 21 |
we can exclude from these pages with the option -x |
| 22 |
-x { n1..n2 | n1 }[,...] |
| 23 |
exclude pages (ranges allowed) |
| 24 |
-q work in quiet mode, that is do not print in the screen |
| 25 |
messages of how the work is being done. |
| 26 |
-r reverse the order of the pages. |
| 27 |
|
| 28 |
The page numbers for the above options -f -l -i and -x can be specified |
| 29 |
in different ways. |
| 30 |
|
| 31 |
1) If a number n is given, it is interpreted as the n'th page from the |
| 32 |
begining of the .dvi file. Of course, this number is independent of the |
| 33 |
page number assigned by TeX. |
| 34 |
|
| 35 |
2) TeX page numbers are those who are actually written in the page; |
| 36 |
these page numbers can be modified, for example, by using the TeX commands |
| 37 |
\pagenumbering, \setcounter{page}{n}, and \addtocounter{page}{n}. |
| 38 |
A TeX page number can be specified by preceding the number n with the |
| 39 |
character @. Thus, if you specify -f @25 -l @30 you select the pages |
| 40 |
between 25 and 30, these numbers being those assigned by TeX. |
| 41 |
|
| 42 |
3) However, several pages can have the same TeX page number in a .dvi file. |
| 43 |
For example, the introductory pages in a book are numbered i, ii, and so on |
| 44 |
until the first chapter begins and then, the pages are numbered 1, 2, etc. |
| 45 |
In this case, the pages numbered i and 1 in the .dvi file have the same TeX |
| 46 |
page number. If you want to select for example the second occurrence of the |
| 47 |
page numbered 1, you can specify a page number as (@2)1. Thus @1 is equivalent |
| 48 |
to (@1)1. For example, if you specify -f (@2)1 -l(@2)10 you select the pages |
| 49 |
between 1 and 10 of the first chapter, not the introductory pages between |
| 50 |
i and x. |
| 51 |
|
| 52 |
There is another parameter that tells dvidvi how you want to change page |
| 53 |
layout and specifications. This is the -m parameter. |
| 54 |
|
| 55 |
The number preceding the colon is the modulo value. Everything |
| 56 |
will be done in chunks of pages this big. If there is no colon, than the |
| 57 |
default value is assumed to be one. The last chunk of pages is padded |
| 58 |
with as many blank pages as necessary. |
| 59 |
|
| 60 |
Following the colon is a comma-separated list of page numbers. |
| 61 |
These page numbers are with respect to the current chunk of pages, and |
| 62 |
must lie in the range zero to the modulo value less one. If a negative |
| 63 |
sign precedes the number, then the page is taken from the mirror chunk; |
| 64 |
if there are m chunks, then the mirror chunk of chunk n is the chunk |
| 65 |
numbered m-n-1. Put simply, it is the chunk numbered the same, only |
| 66 |
from the end. This can be used to reverse pages. If no number is |
| 67 |
given, the page number defaults to 1. |
| 68 |
|
| 69 |
Following each page number is an optional offset value in |
| 70 |
parenthesis, which consists of a pair of comma-separated dimensions. |
| 71 |
Each dimension is a decimal number with an optional unit of measure. |
| 72 |
The default unit of measure is inches, or the last unit of measure |
| 73 |
used. All units are in true dimensions. Allowable units of measure |
| 74 |
are the same that TeX allows: in, mm, cm, pt, pc, dd, and cc. |
| 75 |
|
| 76 |
Simple enough, eh? Okay, let's do some simple things. |
| 77 |
|
| 78 |
-m - Reverses the order of the pages. This time, both the modulo and |
| 79 |
the page number are defaulted. |
| 80 |
|
| 81 |
-m 2:0 Selects the first, third, fifth, etc. pages from the file. Print |
| 82 |
this one after printing the next, taking the paper out of the |
| 83 |
feed tray and reinserting it into the paper feed. |
| 84 |
|
| 85 |
-m 2:-1 Selects the second, fourth, etc. pages, and writes them in reverse |
| 86 |
order. |
| 87 |
-m 4:-1,2(4.25in,0in) |
| 88 |
-m 4:-3,0(4.25in,0in) |
| 89 |
Useful for printing a little booklet, four pages to a sheet, |
| 90 |
double-sided, for stapling in the middle. Print the first one, |
| 91 |
put the stack back into the printer upside down, and print the |
| 92 |
second. The `in' specifications are superfluous. |
| 93 |
-m ,(1pt,1) |
| 94 |
Scare your system administrator! Actually, things are so |
| 95 |
blurry with this option, you may want to send enemies letters |
| 96 |
printed like this. *Long* letters. |
| 97 |
-m 4:0(5.5in,4.25),3(0,4.25) |
| 98 |
-m 4:1(0in,4.25),2(5.5,4.25) |
| 99 |
Print a four-page card on one sheet. Print the first, rotate |
| 100 |
the paper 180 degrees and feed it again. (PostScript people |
| 101 |
can do funny tricks with PostScript so this isn't necessary.) |
| 102 |
|
| 103 |
Enjoy; this is an early release, so make suggestions, improvements, |
| 104 |
and I'll get back to you with a better version later. |
| 105 |
|