dvixxx - TeX DVI to device xxx translator family
dvixxx
[-a]
[-b]
[-c#]
[-d#]
[-eVAR=value]...
[-ffontsubfile]
[-l]
[-m#]
[-o#]...
[-o#:#]...
[-o#:#:#]...
[-p]
[-q]
[-r#]
[-s#]
[-v]
[-x#units]
[-y#units]
[-z]
dvifile1
[ dvifile2]...
xxx = output device identifier suffix (see below)
Several TeX DVI translators are available. They all expect the name of the DVI file on the command line, and the extension .dvi can always be omitted. As illustrated below, they issue a one-line identifier message and, if no command line arguments are given, type a Unix-style usage message. Some of them may have additional help files. On case-sensitive file systems, file names may be expected to be entirely in lower case, so you should type dvialw instead of DVIALW.
For all except dvibit, which is intended for interactive display, the output file will be given the name of the .dvi file, but with suffix .dvi-xxx, where xxx is the three-character mnemonic for the translator program. If long filenames are not supported, then .xxx is used. For dvibit, output is on stdout, which defaults to the terminal; it may be redirected in the usual Unix fashion by >filename on the command line (e.g. dvibit foo >foo.out).
As each .dvi file is processed, a list of errors is printed on the standard error unit, stderr; this list is also saved in a file with suffix .dvi-err (or .err, if long filenames are not supported). This file is not created if there are no errors. As each page is printed, the physical page number and the TeX page number(s) are printed without a following character return; after the last page, the string ``[OK]'' is printed, followed by a newline. This gives a convenient progress report to the terminal. If it is not wanted, then the error output can be redirected into a file (possibly the null device) (e.g. dvixxx foo &foo.err), or the -q (quiet) option can be given to suppress it.
The available translators are as follows:
The order of command options and DVI file names is not significant; all switch values apply to all DVI files. DVI files are processed in order from left to right.
Letter case is ignored in option switches: -A and -a are equivalent.
Magnification values less than 25 are taken to be a TeX magstep parameter which is applied to the standard magnification for that device. For example, -m-0.5 selects a smaller size, and -m2 selects a size 1.44 times larger than normal.
As pages are selected for printing, [#{#} will be printed on stderr, where the first # is the sequential page number in the file, and the second # is a string of values of the TeX counters, \count0 through \count9, separated by dots, with trailing zero counters dropped. \count0 usually records the printed page number. When the page is completely output, a closing ] will be printed on stderr. Any error messages from processing of that page will therefore occur between the square brackets. For example, -o1:3 -o12 -o17:23 -o-3:-1 would select pages 1, 2, 3, 12, 17, 18, 19, 20, 21, 22, and 23, plus the last three pages.
Pages are processed in the order found in the DVI file; there is intentionally no attempt made to sort them according to the \count0 values, since different macro packages may use this counter for different purposes, and in the case of floating tables and figures, the pages may not be in order anyway.
Pages will always be printed in an order appropriate for the device so that the first document page occurs first face up in the document stack; the -b option can be used to reverse this order. For example, some Hewlett-Packard LaserJet Plus printers are equipped with a page flipper which stacks output face down; for these, the -b option will ensure that the pages come out in the expected order.
Specification of a page number step size is useful for producing duplex (two-sided) printing. For example, with laser printers using the Canon LBP-CX engine, the first run could specify -o1:9999:2, which would stack output face up, beginning with the last page, and ending with page 1 on top. The printed pages can then be reinserted in the input tray face up, page 1 on the top, exactly as they were found in the output tray, with the top of the page in the tray closest to the end which is inserted first into the printer. A second run with -b -o2:9999:2 would then print pages 2, 4, ..., on the backs of pages 1, 3, ...; note the -b option to get backwards order on the second run.
There is a bug in Microsoft C's sscanf() on the IBM PC; it does not correctly parse input on the format "%d:%d:%d" in option() for the page number switch. It correctly returns the numbers, but instead of returning the number of such items parsed, it returns -1, which should only happen if none are parsed. A work around seems to be to supply a trailing colon on the switch, so that you write -o17: instead of -o17.
The units field is mandatory, and may be one of
By decree of the Stanford TeX Project, the default TeX page origin is always 1 inch over and down from the top-left page corner, even when non-American paper sizes are used. This corresponds to the switch settings -x1in -y1in; these values are assumed unless overridden.
Here is a sample execution of LaTeX and DVIALW extracted from a TOPS-20 PHOTO log:
@latex biblio.ltx This is TeX, Tops-20 Version 1.1 (preloaded format=lplain 84.9.29) (APS:<BEEBE.PLOT79.DOCUMENTATION>BIBLIO.LTX.28 LaTeX Version 2.06a - Release 7 July 84 (APS:<TEX.LATEX>REPORT.STY.2 Document Style 'report'. Version 0.91 - released 25 June 1984 (APS:<TEX.LATEX>REP11.STY.2)) (APS:<BEEBE.PLOT79.DOCUMENTATION>MYBIBLIO.STY.1 Mybibliography environment style - Version 0.0 - 15-May-86) (APS:<BEEBE.PLOT79.DOCUMENTATION>BIBLIO.AUX.12) [0] (APS:<BEEBE.PLOT79.DOCUMENTATION>BIBLIO1.LTX.3 [1] [2] [3] [4] [5]) [6] (APS:<BEEBE.PLOT79.DOCUMENTATION>BIBLIO.AUX.13) (see the transcript file for additional information) Output written on APS:<BEEBE.PLOT79.DOCUMENTATION>BIBLIO.DVI.1 (7 pages, 13960 bytes). Transcript written on APS:<BEEBE.PLOT79.DOCUMENTATION>BIBLIO.LST.1. @dvialw -x0.3in -y0.2in biblio bt:example [TeX82 DVI Translator Version 2.0 for PostScript [Apple LaserWriter laser printer]] [Input from DVI file biblio.dvi] [Output on file biblio.dvi-alw] [7 pages] [1500 magnification] [7{6}] [6{5}] [5{4}] [4{3}] [3{2}] [2{1}] [1{0}] [OK] [Input from DVI file bt:example.dvi] [Output on file bt:example.dvi-alw] [1 pages] [1500 magnification] [1{1}] [OK]
When the TOPS-20 version of TeX finishes execution, it normally simulates terminal input of a line of the form
TeXspool: dvifile
without supplying a final carriage return. The default value of the logical name TeXspool: points to a dummy program which does nothing, so if you just type a carriage return yourself, the line is effectively ignored. This is reasonable in that it usually takes several trips through TeX before you have a .dvi file worth printing. If you like, you can redefine TeXspool: to point to your favorite DVI translator, for example,
define TeXspool: sys:dvialw.exe
Then when you type a carriage return when TeX finishes, it will run the translator immediately, saving you a line of typing. If you do not want the translator to run, just cancel the line by typing Ctl-U or Ctl-C.
A sample invocation of DVITYPE is as follows:
@dvitype DVIFILE : story.dvi OUTPUT : tty: This is DVItype, Tops-20 Version 2.8 Output level (default=3, ? for help): Starting page (default=*): Maximum number of pages (default=1000000): Assumed device resolution in pixels per inch (default=300/1): New magnification (default=0 to keep the old one): Options selected: Starting page = * Maximum number of pages = 1000000 Output level = 3 (the works) Resolution = 300.00000000 pixels per inch numerator/denominator=25400000/473628672 magnification=1000; 0.00006334 pixels per DVI unit Postamble starts at byte 569. maxv=43725786, maxh=30785863, maxstackdepth=3, totalpages=1 Font 33: amsl10---loaded at size 655360 DVI units Font 23: ambx10---loaded at size 655360 DVI units ...and so on...
If no -ffontsubfile option is given, and font substitution is required, if the current DVI file is foo.dvi, then the files foo.sub, texfonts.sub, and texinputs:texfonts.sub will be tried in order. The first two will be found on the current directory, and the last is the system default. This gives the option of document-specific, user-specific, and system-specific substitutions, and the -f option allows all of these to be overridden.
Font substitution lines have the form:
% comment oldname.oldmag -> subname.submag % comment oldname oldmag -> subname submag % comment oldname -> subname % comment
Examples are:
% These provide replacements for some LaTeX invisible fonts: iamr10 1500 -> amr10 1500 % comment iamr10.1500 -> amr10.1500 % comment iamssb8 -> amssb8 % comment
The first two forms request substitution of a particular font and magnification. The third form substitutes an entire font family; the closest available magnification to the required one will be used. Any dots in the non-comment portion will be converted to spaces, and therefore, cannot be part of a name field.
The first matching substitution will be selected, so magnification-specific substitutions should be given first, before family substitutions.
Comments are introduced by percent and continue to end-of-line, just as for TeX. One whitespace character is equivalent to any amount of whitespace. Whitespace and comments are optional.
At present, dvibit is the only family member which supports interactive viewing of the TeX output. The following description therefore applies only to it, but the functionality should be adhered to in any new interactive device drivers.
All switches, including the page selection (-o) and page origin (-x and -y) switches, work normally. In order to avoid unnecessary waste of screen space, you probably will want to specify -x0in and -y0in to remove the default one-inch left and top margins. The -q option is probably also advisable to avoid warning messages, such as from font substitutions.
At beginning of page, a command and status menu is displayed at the top of the screen. When the end-of-page command is reached in the DVI file, or as soon as keyboard input is available, the driver will enter the end-of-page routine. Any keyboard input command is then read and acted upon; unrecognized input is discarded with a warning beep. The advantage of checking for keyboard input during the main DVI reading loop is that unwanted display can be avoided. This is valuable if you are repositioning the page, or skimming a document. The EMACS text editor uses much the same display algorithm---do nothing more to the screen if a user command will probably invalidate it anyway.
The input can select
Although the menu on the top line displays only a subset of the possible commands, a number of synonyms are provided for user convenience. In particular, arrow keys in VT52 and VT100 modes are recognized, as are EMACS control-character commands to move the cursor or page display. Commands are provided for both coarse and fine adjustment of page position.
Here is the current command list. Input is immediate; no terminating carriage return is necessary. Consequently, typing error correction is supported only for the digit string command; it ends at the first non-digit typed.
It is likely that some font magnifications will be unavailable for zooming, so do not be alarmed if some characters are displayed as blanks when you do this. You can use the font substitution mechanism (-f option above) to work around this, or you can ask your font administrator to generate the required magnifications. When font substitution happens because of an unavailable magnification, characters of an incorrect size are used with the spacing required for the font which TeX used, so output is likely to look peculiar.
To avoid exhausting the terminal's font memory, larger characters as sent as raster bitmaps each time they are used, rather than as downloaded fonts, making the screen display much slower. The size limit is large enough that this should not be necessary except at large magnifications.
The TeX \special{} command is intended to allow the specification in a .tex file of a request to the DVI driver, usually for the insertion of graphical material at that point in the document. It is currently implemented only for dvialw; other drivers will simply issue a warning message.
The TeX \special{} command is expected to look like one of the following:
\special{overlay filename} % absolute positioning \special{include filename} % relative positioning \special{insert filename} % relative positioning
In the first case, the PostScript file to be included will be mapped onto the page at precisely the coordinates it specifies. In the other two cases, the upper-left corner of the bounding box will be placed at the current point. The PostScript file must then contain (usually near the start) a comment of the form
%%BoundingBox: llx lly urx ury
specifying the bounding box lower-left and upper-right coordinates in standard PostScript units (1/72 inch). Alternatively, if the comment
%%BoundingBox: (atend)
is found in the file, the last 1000 characters of the file will be searched to find a comment of the form:
%%BoundingBox: llx lly urx ury
If the PostScript file cannot be opened, or the \special{} command string cannot be recognized, or for relative positioning, the bounding box cannot be determined, a warning message is issued and the \special command is ignored.
Otherwise, the section of the PostScript file between the comment lines
%begin(plot) %end(plot)
is copied to the output file surrounded by
save 300 72 div 300 72 div scale % revert to standard 1/72 inch units % if relative positioning, then % (xcp(in 1/72in)-llx) (ycp(in 1/72in)-ury) translate ...PostScript file contents... restore
Plot files produced by PLOT79 have all the expected commands in them to allow their use in TeX \special{} commands. The two PLOT79 parameters which influence the size of the plot are
For example, if a device size of 5in is specified for a standard horizontal frame, the bounding box will be declared to be 5in wide and (8.5/11)*5in = 3.8636in high, so a TeX manuscript requiring the plot could have the following commands at the start of a new paragraph:
\special{include plotfilename} \vspace*{3.9in}
The behavior of the DVI translators can be influenced by definition of logical names on TOPS-20 and VAX VMS, or environment variables in Unix and PC DOS. Compiled-in internal defaults will be provided for any of these which are not defined. They must be entirely in upper-case, since that is conventional on Unix systems. The names currently recognized are as follows:
The latest version of the drivers has been compiled with Microsoft C Version 4.0. With Version 3.0, some .dvi files experienced a fatal floating-point stack overflow error both with and without a floating-point coprocessor; this can only be due to code generation errors, and it disappeared with Version 4.0.
PC DOS by default has only a small number of available open files, and this number is not adequate for the drivers with the value of five for MAXOPEN set in machdefs.h. You need to increase the limits by entering the lines
FILES=10 BUFFERS=10
in the config.sys file in the boot directory, then reboot the system to have the new values take effect. Larger values are of course possible, though FILES=20 is the limit with current versions of PC DOS. Run-time performance can be quite sensitive to these settings, so you may wish to experiment.
If there is no config.sys file, or the settings of FILES and BUFFERS are too small, you will find the disk whirring madly while the driver attempts to open font files with neighboring magnifications, and then it will finally die with a message unable to open .err file. Use of the -d24 option may be useful in tracking how many files can successfully be opened.
The drivers have been loaded with the default Microsoft floating-point library; the compiler generates calls to library routines which test a flag initialized at startup time which indicates the presence or absence of the floating-point coprocessor chip. If it is available, the library routines will automatically use it. You can force the chip to be ignored by defining an arbitrary non-empty string value for the environment variable NO87, for example
set NO87=no-8087-available
When the DVI translator runs, the value of this variable should be typed on the screen as the first output line. On a Leading Edge PC, this typeout does not appear, for unknown reasons. On a 4.77MHz IBM PC XT, the translators run twice (!) as slowly when NO87 is defined.
The reason that you might need to know this is that the method employed by the library routines for detecting the presence or absence of an 8087 (or 80287) chip is not infallible, thanks to design flaws of some PC's and possibly also the Intel chips. It is conceivable that the library might think a coprocessor chip is present, when in fact it is not, and the first floating-point instruction executed would hang the machine.
The values of texinputs: and texfonts: below are system-dependent. On Unix systems, typical values are /usr/local/lib/tex/macros/ and /usr/local/lib/tex/fonts/.
dvitype(1), latex(1), tex(1), tr2tex(1), Local LaTeX Guide, A TeX DVI Driver Family.
Bugs in either the software or its documentation should be reported by electronic or postal mail to
Nelson H.F. Beebe Center for Scientific Computation 220 South Physics Building University of Utah Salt Lake City, UT 84112 USA Tel: (801) 581-5254 EMAIL: Beebe@Science.Utah.Edu (Internet)
An active electronic mailing list for news about the DVI driver family development is maintained by the author at the above net address. Send requests there if you wish to be on it.
David Fuchs at Stanford University wrote dvitype in web and defined the DVI file format.
Mark Senn at Purdue University wrote a preliminary version of the BBN BitGraph driver in C, using dvitype as a model. Stephan v. Bechtolsheim and Bob Brown at Purdue, Robert Wells at BBN, and Jim Schaad and Richard Furuta at the University of Washington, improved it.
Contributions for PostScript devices came from Neal Holtz at Carleton University. Simon Barnes of Schlumberger Cambridge Research Ltd., and Robin Rohlicek at BBN provided useful additions to the BBN BitGraph driver which have been generalized and incorporated in Version 2.07.
The transformation to about a dozen other device drivers, the massive code rearrangement for many new features and easy identification of host- and device-dependent sections, plus support for .pk and .gf compact font files, was carried out at the University of Utah by Nelson H.F. Beebe. He also wrote the documents A TeX DVI Driver Family and Using LaTeX at the University of Utah College of Science DEC-20. The first describes all of these drivers in detail, and the second is the Local LaTeX Guide.
Lon Willett at Utah adapted dvijep to make dviimp for the Imagen laser printer family.
John Sauter adapted one of the low-resolution printer drivers to produce dvil75 for the DEC LA75 printer, and dvil3p for the DEC LN03 Plus laser printer.
Norman Naugle and colleagues at Texas A&M implemented the family on several new systems.