\input texinfo @c -*-texinfo-*-
@setfilename dviman
@settitle dviman
@comment ***************************************************************
@comment * In GNU EMACS, do M-X texinfo-format-buffer and then C-X C-S *
@comment * to save info file.  The default texinfo mode fill-column    *
@comment * of 75 is rather too long for good readability; it is        *
@comment * desirable to reduce it, which can be done by defining a     *
@comment * texinfo-mode-hook as follows:                               *
@comment * (setq texinfo-mode-hook '(lambda () (setq fill-column 65))) *
@comment * Unfortunately, it is not possible to define this in the     *
@comment * local variables section at the end of this file; it can be  *
@comment * copied into and executed in the *scratch* buffer (C-X E).   *
@comment * If you like this change, add it to your .emacs file.        *
@comment ***************************************************************
@comment <BEEBE.TEX.DVI.DOC>DVIMAN.TEXINFO.76, 12-Oct-87 14:18:10, Edit by BEEBE
@comment Revised to bring into agreement with dvi.1l (Unix troff man
@comment page file), with a couple of new features and drivers, and some
@comment rearrangement of the -x and -y option sections.
@comment <BEEBE.TEX.DVI.DOC>DVIMAN.LTX.60, 22-Dec-86 12:24:43, Edit by BEEBE
@comment Added DVIIMP and updated DVIBIT description (new section SCREEN CONTROL)
@comment <BEEBE.TEX.DVI.DOC>DVIMAN.LTX.36, 13-Oct-86 15:53:26, Edit by BEEBE
@comment Add -d32 truncated text option
@comment <BEEBE.TEX.DVI.DOC>DVIMAN.TEXINFO.20, 17-Sep-86 14:40:30, Edit by BEEBE
@comment Converted from LaTeX to TeXinfo form
@comment <BEEBE.TEX.DVI.DOC>DVIMAN.LTX.34, 16-Sep-86 00:09:53, Edit by BEEBE
@comment Add description of page number step size in -o#:#:# option, and
@comment new -z option for automatic output spooling on TOPS-20.
@comment <BEEBE.TEX.DVI.NEW>DVIMAN.LTX.27, 12-Sep-86 18:36:27, Edit by BEEBE
@comment Put options in alphabetical order (one was out), and add IBM PC
@comment caveat section
@comment <BEEBE.TEX.DVI.DOC>DVIMAN.LTX.19,  9-Sep-86 17:13:23, Edit by BEEBE
@comment Update -d# description to define possible settings
@comment <BEEBE.TEX.DVI.DOC>DVIMAN.LTX.14, 27-Aug-86 16:40:17, Edit by BEEBE
@comment Unix-style ``man'' pages for DVI driver family; adapted from DVI.HLP

@titlepage
@center @titlefont{DVIxxx}
@sp 1
@center Display @TeX{} DVI Files on Assorted Output Devices
@sp 2
@center Nelson H.F. Beebe
@sp 2
@center [21-Oct-87]
@end titlepage

@node top, top, top, (DIR)

@menu
* name::		Driver name
* synopsis::            Summary of the DVI family
* description::         Everything you wanted to know, but@dots{}
* devices-supported::   What output devices are supported
* options::             Command line options
* sample-execution::    How to run the drivers
* font-substitution::   Providing for run-time font substitution
* screen-control::      Screen control for DVIBIT
* specials::            @TeX{} \special commands
* environment-variables::       Telling the drivers where to find things
* IBM-PC-Caveats::      What to watch out for on the IBM PC
* files::               List of files used by the drivers
* see-also::            Pointers to other documentation
* bugs::                This should be an empty section
* authors::             Who gets credit for all this work
@end menu

@node name, synopsis, authors, top
@unnumberedsec{NAME}
DVIxxx --- TeX DVI to device xxx translator family

@node synopsis, description, name, top
@unnumberedsec{SYNOPSIS}
@b{
dvixxx [-a] [-b] [-c#] [-d#] [-e@i{VAR=value}] [-f@i{fontsubfile}]
       [-l] [-m#] [-o#] [-o#:#] [-o#:#:#] [-p] [-q] [-r#] [-s#] [-v]
       [-x#@i{units}] [-y#@i{units}] [-z] dvifile1 [ dvifile2] @dots{}
}

@i{xxx} = output device identifier suffix (see below)

@node description, devices-supported, synopsis, top
@unnumberedsec{DESCRIPTION}
Several @TeX{} DVI translators are available.  They all expect
the name of the DVI file on the command line, and the extension
@file{.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
@iftex
@footnote{Unix is a trademark of AT@&T Bell Laboratories.
PC-DOS is a trademark of IBM Corporation. @TeX{} is a trademark
of the American Mathematical Society. TOPS-20, VAX, and VMS
are trademarks of Digital Equipment Corporation.}
@end iftex
@i{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 @file{dvialw}
instead of @file{DVIALW}.@refill

For all except DVIBIT (which is intended for interactive
display), the output file will be given the name of the
@file{.dvi} file, but extension @file{.dvi-xxx}, where @file{xxx}
is the three-character mnemonic for the translator program.  If
long extensions are not supported, then @file{.xxx} is used.  For
DVIBIT, output is on @file{stdout} which defaults to the
terminal; it may be redirected in the usual Unix fashion by
@file{>filename} on the command line (e.g. @code{dvibit foo
>foo.out}).

As each @file{.dvi} file is processed, a list of errors is printed
on the standard error unit @file{stderr}; this list is also saved
in a file with extension @file{.dvi-err}, or if long extensions
are not supported by the host, then extension @file{.err} is
used.  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 carriage return; after the
last page, the string @samp{[OK]} is printed, followed by a
carriage return.  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.
@code{dvixxx foo &foo.err}), or the @t{-q} option can be given to
suppress it.@refill

These drivers are written in C, and with C preprocessor
conditional compilation features, are all derived from one
master set of files, so that there is substantial code
sharing among them.  Host machine and output device
dependencies are parametrized to allow easy movement to new
hosts and new output devices.  Implementations now exist on
Gould UNIX, Hewlett-Packard UNIX, PC DOS, TOPS-20, VAX UNIX,
and VAX VMS, with others in progress.

@node devices-supported, options, description, top
@unnumberedsec{DEVICES SUPPORTED}
The available translators are as follows:

@table @asis
@item DVIALW
PostScript (Apple LaserWriter)
@item DVIBIT
Version 3.10 BBN BitGraph terminal
@item DVICAN
Canon LBP-8 A2 laser printer
@item DVIGD
Golden Dawn Golden Laser 100 printer
@item DVIIMP
Imagen imPRESS-language laser printer family
@item DVIJEP
Hewlett-Packard Laser Jet Plus
@item DVIJET
Hewlett-Packard Laser Jet
@item DVIL3P
DEC LN03 Plus laser printer
@item DVIL75
DEC LA75 144 dpi printer
@item DVIM72
Apple Imagewriter 72 dpi printer
@item DVIMAC
Apple Imagewriter 144 dpi printer
@item DVIMPI
MPI Sprinter 72 dpi printer
@item DVIO72
OKIDATA Pacemark 2410 72 dpi printer
@item DVIOKI
OKIDATA Pacemark 2410 144 dpi printer
@item DVIPRX
Printronix 60h  x  72v dpi printer
@item DVITOS
Toshiba P-1351 180 dpi printer
@item DVITYP or DVITYPE
DVI Translator for human-readable output
@end table

@node options, sample-execution, devices-supported, top
@unnumberedsec{OPTIONS}
The order of command options and DVI file names is @i{not}
significant; all switch values apply to all DVI files.  DVI files
are processed in order from left to right.

Letter case is @i{ignored} in option switches: @t{-A}
and  @t{-a} are equivalent.@refill

@table @asis
@item @t{-a}
Implement virtual font caching, if possible.  When a font
file is opened, a buffer is allocated to contain the entire
file, and the file is then read with one system call.  This
is important primarily on networked file systems, where the
many random-access calls in the font file for small amounts
of data entail substantial network overhead.  With the entire
file cached in local memory, this overhead is removed.  The
additional memory required for the font file buffers amounts
to 100K to 200K bytes (assuming the compact @t{.PK} font
file format), which is not excessive.  If memory cannot be
allocated for a font file, then normal buffering of small
blocks is used.  A trace option (@t{-d64}) is provided to
monitor the font caching; see below.@refill

@item @t{-b}
Backwards order printing from the default.  For example,
laser printers using the Canon engine print normally receive
pages in reverse order because they stack printed side up.
Some have page handling mechanisms that stack them face down,
and in such a case @t{-b} will ensure that they come out in
order 1, 2, @dots{} instead of @i{n}, @i{n-1}, @i{n-2},
@dots{}@refill

@item @t{-c#}
Print @t{#} copies of each output page.  Page copies are
printed consecutively; this does @i{not} give multiple
collated copies of the entire job.@refill

@item @t{-d#}
Produce debugging output on @file{stderr} if a non-zero
value is given.  Multiple @t{-d} switches may be
specified, and one may also add values of the following
possible options to obtain the switch value:@refill

@table @asis
@item 1
(DVIJET only) print page bitmap in hexadecimal;
@item 2
display page coordinates and metrics of each output
character, and print each character bitmap in
hexadecimal;
@item 4
(DVIJEP only) display updated page coordinate of each
character after each call to @code{fixpos()};
@item 8
print filename and open mode of each @i{successful} file
opening;
@item 16
print filename and open mode of each @i{unsuccessful}
file opening;
@item 32
show discarded off-page text;
@item 64
trace virtual font caching;
@item 128
trace character setting (@i{lots} of output).
@end table

@noindent
For example, either @t{-d8 -d16} or @t{-d24} will trace all
attempted file openings.@refill

@item @t{-eVAR=value}
Define an environment variable on the command line (see the
later section @i{Environment Variables}).  The acceptable
values for @file{VAR} are @file{DVIHELP}, @file{FONTLIST},
@file{TEXFONTS}, and @file{TEXINPUTS}.  Under normal use of
the translators, these can be set by TOPS-20 and VAX
VMS @code{define VAR: value} commands, or by Unix
@samp{csh} @code{setenv VAR value} or @samp{sh}
@code{VAR=value} commands.  When the translator is invoked by
another program, such as a print spooler, on some systems it
may not be possible to set a particular value of an
environment variable for the subprocess, so this option gets
around this limitation.  On most Unix systems, it should be
possible to use the call @code{system("VAR=value; dvixxx
filename")}.@refill

@item @t{-ffontsubfile}
Define an alternate font substitution file which is to be
used instead of the default ones (see below).@refill

@item @t{-l}
Inhibit logging.

@item @t{-m#}
Reset magnification to @t{#}.  The default for low resolution
printers is @t{-m603}, corresponding to 1/1.2**5
magnification of 300-dot/inch fonts.  By @TeX{} conventions,
magnification 1000 corresponds to a 200-dot/inch output
device.  The default magnification is always adjusted
according to the output device resolution in order to give a
normal page size, so this parameter should rarely be
required.  Legal values are int((1000 or 1440 or 1500) x
1.2**{k/2}) (k = -16@dots{}16); other values will be set to
the nearest in this family.  Not all fonts will be available
in this wide range, and most installations will probably have
only a half dozen or so magnifications.@refill

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,
@t{-m-0.5} selects a smaller size, and @t{-m2} selects a
size 1.44 times larger than normal.@refill

@item @t{-o#} or @t{-o#:#} or @t{-o#:#:#}
Specify a page number, or range of page numbers, to be
selected for output.  In the third form, the last number is
the page number step size; it is normally 1.  This option may
be specified any number of times.  If it is not specified,
then all pages will be printed.  Pages are numbered in order
1, 2, 3, @dots{} in the file, but any page number recorded
by @TeX{} on the printed page will in general be different.
Negative page numbers count backward; -1 is the last page in
the document, -2 the second last page, and so on.@refill

As pages are selected for printing, @samp{[#@{#@}} will be
printed on @file{stderr}, where the first @samp{#} is the
page number in the file, and the second @samp{#} is a string
of values of the @TeX{} counters, @samp{\count0} through
@samp{\count9}, separated by dots, with trailing zero
counters dropped.  @samp{\count0} usually records the printed
page number.  When the page is completely output, a closing
@t{]} will be printed on @file{stderr}.  Any error messages
from processing of that page will therefore occur between the
square brackets.  For example, @t{-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.@refill

Pages are processed in the order found in the DVI file;
there is intentionally no attempt made to sort them
according the @samp{\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 @t{-b} option can be used
to reverse this order.  For example, some
Hewlett-Packard Laser Jet Plus printers are equipped
with a page flipper which stacks output face down; for
these, the @t{-b} option will ensure that the pages come
out in the expected order.@refill

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 @t{-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 @i{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 @t{-b -o2:9999:2} would then
print pages 2, 4, @dots{}, on the backs of pages 1, 3,
@dots{}; note the @t{-b} option to get backwards order on the
second run.@refill

There is a bug in Microsoft C's @t{sscanf()} on the IBM PC;
it does not correctly parse input on the format
@t{"%d:%d:%d"} in @t{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
@t{-o17:}@: instead of @t{-o17}.@refill

@item @t{-p}
Inhibit font preloading.  This may produce output a few
seconds earlier when all pages are output, but should have
negligible effect on the execution time, and consequently,
should normally not be specified.  When individual pages are
being printed with the @t{-o#} option, preloading is
necessary (and will be forced) to ensure that all fonts are
defined before they are referenced.@refill

@item @t{-q}
Quiet mode.  Status displays to @file{stderr} are suppressed,
unless warning or error messages are issued.  For interactive
devices (DVIBIT), warning messages are suppressed.@refill

@item @t{-r#}
(Device = HP Laser Jet only).  Specify the Laser Jet output
resolution in dots per inch.  @t{#} must be one of 75, 100,
150, or 300.  The actual plot file is identical in each case;
only the size on the output page is changed, because the
resolution change is effected by printing 1 x 1, 2 x 2, 3 x
3, or 4 x 4 pixel blocks.@refill

@item @t{-r}
(Device = Golden Laser 100 only).  Select run-length encoding
of the output file.  This reduces disk space typically by 10%
to 40%, but increases host CPU time for the preparation of
the output file.@refill

@item @t{-r}
(Device = Apple ImageWriter only).  Select run-length
encoding of the output file.@refill

@item @t{-r}
(Device = Toshiba P-1351 only).  Select run-length encoding
of the output file.  This reduces disk space typically by 10%
to 40%, but increases host CPU time for the preparation of
the output file, and because of poor logic in the printer,
may double the print time!  The print quality is also
substantially worse, so this option is generally @i{not}
recommended.@refill

@item @t{-s#}
(Device = Apple LaserWriter only).  Force characters larger
than @t{#} pixels wide or high to be reloaded each time they
are required.  The Version 23.0 PostScript interpreter has
a bug which manifests itself in fatal @samp{VM error}
messages when large characters are sent.  A reasonable
default value has been set for this which should normally
avoid the problem.  Specifying @t{-s0} will cause reloading
of every character each time it is used.@refill

@item @t{-v}
(Device = Apple LaserWriter only).  Force reloading of all
required fonts at start of each page.@refill

@item @t{-x#}@i{units}
The @t{-x} options specify the left margin of the @TeX{} page
on the output page in any of the indicated units.  Letter
case is not significant in the units field, which must @i{not}
be separated from the number by any space.  @t{#} may be
fractional.  For example, @t{-x1.0in}, @t{-x2.54cm},
@t{-x72.27pt}, and @t{-x6.0225pc} all specify a one-inch left
margin.  Negative values are permissible, and may be used to
shift the output page left (possibly truncating it on the
left) in order to display a wide @TeX{} page.@refill

The @i{units} field is mandatory, and may be one of

@table @asis
@item @t{bp}
big point (1in = 72bp)
@item @t{cc}
cicero (1cc = 12dd)
@item @t{cm}
centimeter (1in = 2.54cm)
@item @t{dd}
didot point (1157dd = 1238pt)
@item @t{in}
inch
@item @t{mm}
millimeter (10mm = 1cm)
@item @t{pc}
pica (1pc = 12pt)
@item @t{pt}
point (72.27pt = 1in)
@item @t{sp}
scaled point (65536sp = 1pt)
@end table

@item @t{-y#}@i{units}
The @t{-y} options specify the top margin of the @TeX{} page
on the output page in any of the indicated units.  Letter
case is not significant in the unit field, which must @i{not}
be separated from the number by any space.  @t{#} may be
fractional.  For example, @t{-y1.0in}, @t{-y2.54cm},
@t{-y72.27pt}, and @t{-y6.0225pc} all specify a one-inch top
margin.  Negative values are permissible, and may be used to
shift the output page up (possibly truncating it on the top)
in order to display a long @TeX{} page.@refill


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
@t{-x1in -y1in}; these values are assumed unless
overridden.@refill

@item @t{-z}
(TOPS-20 or 4.xBSD Unix only).  For each DVI file
processed, type in an EXEC command @code{DVISPOOL:
dvifilename} (on Unix, @code{DVISPOOL dvifilename}) followed
by a newline; the user may then define @code{DVISPOOL:}@: (or
@code{DVISPOOL}) to be a program which sends the translation
of the DVI file to the appropriate output spooler.@refill
@end table

@node sample-execution, font-substitution, options, top
@unnumberedsec{SAMPLE EXECUTION}
Here is a sample execution of La@TeX{} and DVIALW extracted from
a TOPS-20 PHOTO log:

@example
La@TeX{} 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]
@end example

@noindent
When the TOPS-20 version of @TeX{} finishes execution, it
normally simulates terminal input of a line of the form

@example
TeXspool: dvifile
@end example

@noindent
without supplying a final carriage return.  The default value of
the logical name @file{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
@file{.dvi} file worth printing.  If you like, you can redefine
@file{TeXspool:}@: to point to your favorite DVI translator, for
example,

@example
define TeXspool: sys:dvialw.exe
@end example

@noindent
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 @ctrl{U} or @ctrl{C}.

A sample invocation of DVITYPE is as follows:

@example
@@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
' TeX output 1986.06.20:1039'
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...
@end example

@node font-substitution, screen-control, sample-execution, top
@unnumberedsec{FONT SUBSTITUTION}

If no @t{-ffontsubfile} option is given, and font substitution is
required, if the current DVI file is @file{foo.dvi}, then the
files @file{foo.sub}, @file{texfonts.sub}, and
@file{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 @t{-f}
option allows all of these to be overridden.@refill

Font substitution lines have the form:

@example
% comment
oldname.oldmag  ->      subname.submag  % comment
oldname oldmag  ->      subname submag  % comment
oldname         ->      subname         % comment
@end example

@noindent
Examples are:

@example
% These provide replacements for some LaTeX invisible fonts:
iamr10 1500     ->      amr10 1500      % comment
iamr10.1500     ->      amr10.1500      % comment
iamssb8         ->      amssb8          % comment
@end example

@noindent
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.

@node screen-control, specials, font-substitution, top
@unnumberedsec{SCREEN CONTROL}

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 (@samp{-o}) and page
origin (@t{-x} and @t{-y}) switches, work normally.  In order to
avoid unnecessary waste of screen space, you probably will want
to specify @t{-x0in} and @t{-y0in} to remove the default one-inch
left and top margins.  The @t{-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

@itemize @bullet
@item
redisplay of the current page, possibly shifting it up,
down, left, or right, to see more of it, or to restore a
display trashed by an unexpected system message or
transmission line error;
@item
continuation to the next page in the page list selected
by default or by the @t{-o} option;
@item
backing up to the previous page (useful if you overshoot);
@item
display of an arbitrary page by typing its sequence number;
@item
termination of execution.
@end itemize

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.

@table @asis
@item @b{D}
Move the display down by 1/8 of screen size.

@item @b{U}
Move the display up by 1/8 of screen size.

@item @b{L}
Move the display left by 1/8 of screen size.

@item @b{R}
Move the display right by 1/8 of screen size.

@item @b{d} or @b{Ctl-N} or @b{down-arrow}
Move the display down by 1/64 of screen size.

@item @b{u} or @b{Ctl-P} or @b{up-arrow}
Move the display up by 1/64 of screen size.

@item @b{l} or @b{Ctl-B} or @b{left-arrow}
Move the display left by 1/64 of screen size.

@item @b{r} or @b{Ctl-F} or @b{right-arrow}
Move the display right by 1/64 of screen size.

@item @b{.} or @b{Ctl-L}
Redisplay current page.

@item @b{@@}
Redisplay current page with @i{startup} page
positioning.@refill

@item @b{CARET} or @b{BACKSPACE}
Redisplay previous page.

@item @b{nnn}
@b{nnn} is a digit string; DELETE/RUBOUT and BACKSPACE keys
correct typing errors in it.  Move to @b{nnn}-th page, where
document pages are numbered 1, 2, @dots{}.  The @TeX{}
page numbers are displayed in the status window. This is a
recursive display; if you respond at end-of-page with a
@i{next-page} command, display will revert to the page
sequence you were viewing when you first issued the @b{nnn}
command.@refill

@item @b{SPACE} or @b{RETURN} or @b{Ctl-V}
Display next page.

@item @b{Q} or @b{q} or @b{X} or @b{x}
Quit or exit.  The screen will be cleared and the terminal
restored to its normal font and emulation mode.@refill

@item @b{Z}
Zoom up one magstep (1.2 times larger) from current
size.@refill

@item @b{z}
Zoom down one magstep (1.2 times smaller) from current
size.@refill

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 (@t{-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.@refill

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.@refill
@end table

@node specials, environment-variables, screen-control, top
@unnumberedsec{SPECIALS}

The @TeX{} @samp{\special@{@}} command is intended to allow the
specification in a @file{.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{} @samp{\special@{@}} command is expected to look like one
of the following:

@example
\special@{overlay filename@}          % absolute positioning
\special@{include filename@}          % relative positioning
\special@{insert filename@}           % relative positioning
@end example

@noindent
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

@example
%%BoundingBox: llx lly urx ury
@end example

@noindent
specifying the bounding  box lower-left and upper-right
coordinates in standard PostScript units (1/72 inch).
Alternatively, if the comment

@example
%%BoundingBox: (atend)
@end example

@noindent
is found in the file,   the last 1000 characters of the file will
be searched to find a comment of the form:

@example
%%BoundingBox: llx lly urx ury
@end example

@noindent
If the PostScript file cannot be opened, or the
@samp{\special@{@}} command string cannot be recognized, or for
relative positioning, the bounding box cannot be determined, a
warning message is issued and the @samp{\special@{@}} command is
ignored.@refill

Otherwise, the section of the PostScript file between the
comment lines

@example
%begin(plot)
%end(plot)
@end example

@noindent
is copied to the output file surrounded by

@example
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
@end example

@noindent
Plot files produced by PLOT79 have all the expected commands in
them to allow their use in @TeX{} @samp{\special@{@}} commands.
The two PLOT79 parameters which influence the size of the plot
are

@itemize @bullet
@item
the device size specified in the call to SETSZ(); it defaults
to 11in if SETSZ is not called.@refill
@item
the device space specified in the call to SETDS2() or
SETDS3(); it defaults in the CORE system to the unit square,
but if the PLOT79 framing routines are called, they will
reset the device space to a horizontal or vertical frame in
proportions of the local standard paper size (1 : 8.5/11 in
the USA).@refill
@end itemize

@noindent
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) @t{*} 5in = 3.8636in high, so a @TeX{} manuscript
requiring the plot could have the following commands at the start
of a new paragraph:

@example
\special@{include plotfilename@}
\vspace*@{3.9in@}
@end example

@node environment-variables, IBM-PC-Caveats, specials, top
@unnumberedsec{ENVIRONMENT VARIABLES}

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 @i{must} be entirely in upper-case, since that is
conventional on Unix systems.  The names currently recognized are
as follows:@refill

@table @asis
@item DVIHELP
This variable defines an alternate help string which is typed
when the user makes an input error.  It should direct the
user to additional documentation.  For example, on TOPS-20,
it might be @samp{try HELP DVI or XINFO DVI}.@refill

@item FONTLIST
Normally, the drivers are prepared to search first for
@file{.pk}, then @file{.gf}, then @file{.pxl} font files.
This variable can be used to change this search order, or
remove one or more of the possibilities.  It is expected to
contain at least one of the strings @samp{PK}, @samp{GF}, or
@samp{PXL}, possibly separated by arbitrary punctuation and
other text.  This flexibility is necessary because some
operating systems expect environment variables to conform to
some syntax, such as that of a file name.  Letter case is
@i{not} significant.  Some acceptable strings are
@samp{PXL-then-PK-then-GF}, @samp{pk.gf},
@samp{use-only-PXL-fonts}, and @samp{PXL/GF/PK}.@refill

@item TERM
This variable is used only for DVIBIT; if it does not
evaluate to either @t{bitgraph} or @t{bg}, DVIBIT will refuse
to run.  On Unix, this is the conventional way of defining
terminal types with the TERMCAP or TERMINFO systems.
This variable is ignored on VAX VMS, since the VMS C
library sets it to a value which can never be
@t{bitgraph} or @t{bg}.@refill

@item TEXFONTS
This defines the directory path for finding font files.  Its
value is @i{prepended} to the name of a @TeX{} font to get a
full file specification.  A typical value in Unix for
@file{TEXFONTS} would be @file{/usr/local/lib/tex/fonts/}.
On TOPS-20, font @i{cmr10} on a 300-dot/inch device might
correspond to the files @file{texfonts:cmr10.300gf},
@file{texfonts:cmr10.300pk}, or
@file{texfonts:cmr10.1500pxl}.@refill

@item TEXINPUTS
This defines the directory path for finding files which are
not in the current working directory.  It is @i{prepended} to
file names.  A typical value in Unix would be
@t{/usr/local/lib/tex/macros/}.@refill
@end table

@node IBM-PC-Caveats, files, environment-variables, top
@unnumberedsec{IBM PC Caveats}
The latest version of the drivers has been compiled with
Microsoft C Version 4.0.  With Version 3.0, some @file{.dvi}
files experienced a fatal ``@i{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 @t{MAXOPEN} set in @file{machdefs.h}.  You
need to increase the limits by entering the lines

@example
FILES=10
BUFFERS=10
@end example

@noindent
in the @file{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 @t{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 @file{config.sys} file, or the settings of
@t{FILES} and @t{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 ``@i{unable to open .err file}''.  Use of the @t{-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 @code{NO87}, for example

@example
set NO87=no-8087-available
@end example

@noindent
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 PC XT, the translators run twice (!) as slowly when
@code{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.

@node files, see-also, IBM-PC-Caveats, top
@unnumberedsec{FILES}
The values of @file{texinputs:}@: and @file{texfonts:}@: below are
system-dependent.  On Unix systems, typical values are
@file{/usr/local/lib/tex/macros/} and
@file{/usr/local/lib/tex/fonts/}.

@table @asis
@item @file{*.dvi}
@TeX{} DeVice Independent output file
@item @file{*.dvi-err}
@TeX{} DVIxxx translator error log
@item @file{*.err}
@TeX{} DVIxxx translator error log when long extensions are
not available @refill
@item @file{*.dvi-xxx}
@TeX{} DVIxxx translator output file
@item @file{*.xxx}
@TeX{} DVIxxx translator output file when long extensions are
not available @refill
@item @file{*.sub}
DVI file-specific font substitution file
@item @file{DVISPOOL}
Environment variable (4.xBSD Unix only) defining program or
shell script which sends translation of DVI file to the
appropriate output spooler @refill
@item @file{DVISPOOL:}
Logical name (TOPS-20 only) defining program which sends
translation of DVI file to the appropriate output spooler @refill
@item @file{texfonts.sub}
Job-wide font substitution file
@item @file{texfonts:*.*pxl}
@TeX{} default font rasters
@item @file{texfonts:*.*gf}
@TeX{} default font rasters
@item @file{texfonts:*.*pk}
@TeX{} default font rasters
@item @file{texinputs:dvialw.ps}
PostScript header file containing standard macro
definitions prefixed to PostScript output from DVIALW @refill
@item @file{texinputs:texfonts.sub}
System-wide font substitution file
@end table

@node see-also, bugs, files, top
@unnumberedsec{SEE ALSO}

dvitype(1), latex(1), tex(1), tr2tex(1), @i{Local La@TeX{}
Guide}, @i{A @TeX{} DVI Driver Family}

@node bugs, authors, see-also, top
@unnumberedsec{BUGS}

Bugs in either the software or its documentation
should be reported by electronic or postal mail to

@display
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)
@end display

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.

@node authors, name, bugs, top
@unnumberedsec{AUTHORS}

David Fuchs at Stanford University wrote DVITYPE in @samp{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 as well as easy
identification of host- and device-dependent sections, plus
support for @file{.pk} and @file{.gf} compact font files, was
carried out at the University of Utah by Nelson H.F.  Beebe.  He
also wrote the documents @i{A @TeX{} DVI Driver Family} and
@i{Using La@TeX{} at the University of Utah College of Science
DEC-20}.  The first describes all of these drivers in detail, and
the second is the @i{Local La@TeX{} Guide}.@refill

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.
@bye
@comment Set fill-column automatically to @refill produces
@comment consistent paragraph line widths.  The default of 75
@comment chars is so long that it reduces readability.
@comment Local Variables:
@comment fill-column: 65
@comment End: