Go to the first, previous, next, last section, table of contents.


6. Invoking dvips

The dvips driver has a plethora of command line options. Reading through this section will give a good idea of the capabilities of the driver.

Many of the parameterless options listed here can be turned off by immediately suffixing the option with a zero (0); for instance, to turn off page reversal if it is turned on by default, use `-r0'. The options that can be turned off in this way are `a', `f', `k', `i', `m', `q', `r', `s', `E', `F', `K', `M', `N', `U', and `Z'.

This is a handy summary of the options; it is printed out when you run dvips with no arguments.

This is dvipsk version Copyright 1986, 1993 Radical Eye Software
     Usage: dvips [options] filename[.dvi]
 a*  Conserve memory, not time      y # Multiply by dvi magnification
 b # Page copies, for posters e.g.  A   Print only odd (TeX) pages
 c # Uncollated copies              B   Print only even (TeX) pages
 d # Debugging                      C # Collated copies
 e # Maxdrift value                 D # Resolution
 f*  Run as filter                  E*  Try to create EPSF
 h f Add header file                F*  Send control-D at end
 i*  Separate file per section      K*  Pull comments from inclusions
 k*  Print crop marks               M*  Don't make fonts
 l # Last page                      N*  No structured comments
 m*  Manual feed                    O c Set/change paper offset
 n # Maximum number of pages        P s Load config.$s
 o f Output file                    R   Run securely
 p # First page                     S # Max section size in pages
 q*  Run quietly                    T c Specify desired page size
 r*  Reverse order of pages         U*  Disable string param trick
 s*  Enclose output in save/restore V*  Send downloadable PS fonts as PK
 t s Paper format                   X # Horizontal resolution
 x # Override dvi magnification     Y # Vertical resolution
                                    Z*  Compress bitmap fonts
 pp #-# First-last page
     # = number   f = file   s = string  * = suffix, `0' to turn off
     c = comma-separated dimension pair (e.g., 3.2in,-32.1cm)
`-'
Ask for additional options from standard input.
`-a'
Conserve memory by making three passes over the `dvi' file instead of two and only loading those characters actually used. Generally only useful on machines with a very limited amount of memory, like some PCs.
`-c num'
Generate num copies of every page. Default is 1. (For collated copies, see the `-C' option below.)
`-b num'
Generate num copies of each page, but duplicating the page body rather than using the `#numcopies' option. This can be useful in conjunction with a header file setting `\bop-hook' to do color separations or other neat tricks.
`-d num'
Set the debug flags. This is intended only for emergencies or for unusual fact-finding expeditions; it will work only if dvips has been compiled with the `DEBUG' option. See section 13.1 Debug Options, for the possible values of num. Use a value of `-1', and specify the option first, for maximum output.
`-e num'
Make sure that each character is placed at most this many pixels from its `true' resolution-independent position on the page. The default value of this parameter is resolution dependent (it is the number of entries in the list [100, 200, 300, 400, 500, 600, 800, 1000, 1200, 1600, 2000, 2400, 2800, 3200, ...] that are less than or equal to the resolution in dots per inch). Allowing individual characters to `drift' from their correctly rounded positions by a few pixels, while regaining the true position at the beginning of each new word, improves the spacing of letters in words.
`-f'
Run as a filter. Read the `dvi' file from standard input and write the PostScript to standard output. The standard input must be seekable, so it cannot be a pipe. If you must use a pipe, write a shell script that copies the pipe output to a temporary file and then points dvips at this file. This option also disables the automatic reading of the `PRINTER' environment variable; use `-P$PRINTER' after the `-f' to read it anyway. It also turns off the automatic sending of control D if it was turned on with the `-F' option or in the configuration file; use `-F' after the `-f' to send it anyway.
`-h name'
Prepend file name as an additional header file. (However, if the name is simply `-', suppress all header files from the output.) This header file gets added to the PostScript `userdict'.
`-i'
Make each section be a separate file. Under certain circumstances, dvips will split the document up into `sections' to be processed independently; this is most often done for memory reasons. Using this option tells dvips to place each section into a separate file; the new file names are created replacing the suffix of the supplied output file name by a three-digit sequence number. This option is most often used in conjunction with the `-S' option which sets the maximum section length in pages. For instance, some phototypesetters cannot print more than ten or so consecutive pages before running out of steam; these options can be used to automatically split a book into ten-page sections, each to its own file.
`-k'
Print crop marks. This option increases the paper size (which should be specified, either with a paper size special or with the `-T' option) by a half inch in each dimension. It translates each page by a quarter inch and draws cross-style crop marks. It is mostly useful with typesetters that can set the page size automatically.
`-l num'
The last page printed will be the first one numbered num. Default is the last page in the document. If the num is prefixed by an equals sign, then it (and any argument to the `-p' option) is treated as a sequence number, rather than a value to compare with `\count0' values. Thus, using `-l =9' will end with the ninth page of the document, no matter what the pages are actually numbered.
`-m'
Specify manual feed for printer.
`-mode mode'
Use mode as the Metafont device name for path searching and generating fonts. This overrides any value from configuration files. With the default paths, explicitly specifying the mode also makes the program assume the fonts are in a subdirectory named mode. See section `TeX directory structure' in Kpathsearch library. If Metafont seems not to understand the mode name, see section 13.8 Unable to Generate Fonts.
`-n num'
At most num pages will be printed. Default is 100000.
`-o name'
The output will be sent to file name. If no file name is given, the default name is `file.ps' where the `dvi' file was called `file.dvi'; if this option isn't given, any default in the configuration file is used. If the first character of the supplied output file name is `!' or `|', then the remainder will be used as an argument to `popen'; thus, specifying `|lpr' as the output file will automatically queue the file for printing as usual. This option also disables the automatic reading of the `PRINTER' environment variable, and turns off the automatic sending of control D. See the `-f' option for how to override this.
`-p num'
The first page printed will be the first one numbered num. Default is the first page in the document. If the num is prefixed by an equals sign, then it (and any argument to the `-l' option) is treated as a sequence number, rather than a value to compare with `\count0' values. Thus, using `-p =3' will start with the third page of the document, no matter what the pages are actually numbered.
`-pp first-last'
Print pages first through last; equivalent to `-p first -l last'. The `-' range separator can also be a `:'.
`-q'
Run quietly. Don't chatter about pages converted, etc.; report nothing but errors to standard error.
`-r'
Stack pages in reverse order. Normally, page 1 will be printed first.
`-s'
Causes the entire global output to be enclosed in a save/restore pair. This causes the file to not be truly conformant, and is thus not recommended, but is useful if you are driving the printer directly and don't care too much about the portability of the output.
`-t papertype'
This sets the paper type to papertype. The papertype should be defined in one of the configuration files, along with the appropriate code to select it. See the documentation for `@'in the configuration file option descriptions. You can also specify `-t landscape', which rotates a document by 90 degrees. To rotate a document whose size is not letter, you can use the `-t' option twice, once for the page size, and once for `landscape'. The upper left corner of each page in the `dvi' file is placed one inch from the left and one inch from the top. Use of this option is highly dependent on the configuration file. Note that executing the `letter' or `a4' or other PostScript operators cause the document to be nonconforming and can cause it not to print on certain printers, so the default paper size should not execute such an operator if at all possible.
`-x num'
Set the magnification ratio to num/1000. Overrides the magnification specified in the `dvi' file. Must be between 10 and 100000. It is recommended that you use standard magstep values (1095, 1200, 1440, 1728, 2074, 2488, 2986, and so on) to help reduce the total number of PK files generated.
`-A'
This option prints only the odd pages. This option uses the \TeX\ page numbering rather than the sequence page numbers.
`-B'
This option prints only the even pages. This option uses the \TeX\ page numbering rather than the sequence page numbers.
`-C num'
Create num copies, but collated (by replicating the data in the PostScript file). Slower than the `-c' option, but easier on the hands, and faster than resubmitting the same PostScript file multiple times.
`-D num'
Set the resolution in dpi (dots per inch) to num. This affects the choice of bitmap fonts that are loaded and also the positioning of letters in resident PostScript fonts. Must be between 10 and 10000. This affects both the horizontal and vertical resolution. If a high resolution (something greater than 400 dpi, say) is selected, the `-Z' flag should probably also be used.
`-E'
Makes dvips attempt to generate an EPSF file with a tight bounding box. This only works on one-page files, and it only looks at marks made by characters and rules, not by any included graphics. In addition, it gets the glyph metrics from the `tfm' file, so characters that lie outside their enclosing `tfm' box may confuse it. In addition, the bounding box might be a bit too loose if the character glyph has significant left or right side bearings. Nonetheless, this option works well for creating small EPSF files for equations or tables or the like. (Of course, `dvips' output is resolution dependent and thus does not make very good EPSF files, especially if the images are to be scaled; use these EPSF files with a great deal of care.)
`-F'
Causes Control-D (ASCII code 4) to be appended as the very last character of the PostScript file. This is useful when dvips is driving the printer directly instead of working through a spooler, as is common on extremely small systems. Otherwise, it is not recommended.
`-K'
This option causes comments in included PostScript graphics, font files, and headers to be removed. This is sometimes necessary to get around bugs in spoolers or PostScript post-processing programs. Specifically, the `%%Page' comments, when left in, often cause difficulties. Use of this flag can cause some included graphics to fail, since the PostScript header macros from some software packages read portions of the input stream line by line, searching for a particular comment. This option has been turned off by default because PostScript previewers and spoolers have been getting better.
`-M'
Turns off the automatic font generation facility. If any fonts are missing, commands to generate the fonts are appended to the file `missfont.log' in the current directory; this file can then be executed to create the missing fonts.
`-N'
Turns off structured comments; this might be necessary on some systems that try to interpret PostScript comments in weird ways, or on some PostScript printers. Old versions of TranScript in particular cannot handle modern Encapsulated PostScript.
`-O offset'
Move the origin by a certain amount. The offset is a comma-separated pair of dimensions, such as `.1in,-.3cm' (in the same syntax used in the `papersize' special). The origin of the page is shifted from the default position (of one inch down, one inch to the right from the upper left corner of the paper) by this amount.
`-P printername'
Sets up the output for the appropriate printer. This is implemented by reading in `config.printername', which can then set the output pipe (as in, `o !lpr -Pprintername') as well as the font paths and any other defaults for that printer only. It is recommended that all standard defaults go in the one master `config.ps' file and only things that vary printer to printer go in the `config.printername' files. Note that `config.ps' is read before `config.printername'. In addition, another file called `~/.dvipsrc' is searched for immediately after `config.ps'; this file is intended for user defaults. If no `-P' command is given, the environment variable `PRINTER' is checked. If that variable exists, and a corresponding configuration file exists, that configuration file is read in.
`-R'
Run securely. This disables command execution in `\special' (via ``') and config files (via the `E' option), pipes as output files, and opening of any absolute filenames.
`-S num'
Set the maximum number of pages in each `section'. This option is most commonly used with the `-i' option; see that documentation above for more information.
`-T offset'
Set the paper size to the given pair of dimensions. This option takes its arguments in the same style as `-O'. It overrides any paper size special in the `dvi' file.
`-U'
Disable a PostScript virtual memory saving optimization that stores the character metric information in the same string that is used to store the bitmap information. This is only necessary when driving the Xerox 4045 PostScript interpreter. It is caused by a bug in that interpreter that results in `garbage' on the bottom of each character. Not recommended unless you must drive this printer.
`-V'
Download non-resident PostScript fonts as bitmaps. This requires use of mtpk or pstopk or some combination of the two in order to generate the required bitmap fonts; neither of these programs are supplied with Dvips.
`-X num'
Set the horizontal resolution in dots per inch to num.
`-Y num'
Set the vertical resolution in dots per inch to num.
`-Z'
Causes bitmapped fonts to be compressed before they are downloaded, thereby reducing the size of the PostScript font-downloading information. Especially useful at high resolutions or when very large fonts are used. Will slow down printing somewhat, especially on early 68000-based PostScript printers.


Go to the first, previous, next, last section, table of contents.