[next] [tail] [up]

6.1 TeX dvi-drivers 

4TeX supports a variety of output devices. There are separate print or preview programs for separate groups of output devices:
for dot-matrix printers and bitmapped output such as pcx picture files (e.g., for fax machines).
for LaserJet, DeskJet and other PCL printers.
for PostScript printers. This print program will be described in Section 6.2.
for printing PostScript output on non PostScript printers or the screen (previewing). This program will be described in Sections 6.2.6 and 6.2.5.
for color DeskJet printers. This print program will be described in Section 6.3.
for printing or previewing on non graphic/ascii output devices. It simply emulates the page layout as if you were using a type writer.
is not a print but a preview program; we describe it here because it is very similar in structure to the print programs. See Section 6.1.6 on how to operate DviScr interactively.
for previeving colored output for DeskJet color printers. This program will be described in Section 6.3.1.
is a Windows previewer program that can also be used to print. See Section 6.4 for a detailed description.

All these programs take a .dvi-file generated by a TeX-compiler as input. We refer to them collectively as DVI-drivers.

The programs DviDot, DviHPlj and DviScr are part of the emTeX package written by Eberhard Mattes and share similar interfaces. These programs exist in two versions: one standard, and one that needs a mathematical coprocessor. The latter will run only on machines equipped with a 80x87 coprocessor, and they will run a little faster. These programs have a `7' appended to their file name, e.g., dvidot7.exe. 4TeX will use the coprocessor versions automatically if it detects a coprocessor in your computer.
DviScrs is an alternative to DviScr that uses less memory at the expense of performance. This program is especially handy if DviScr issues out of memory errors due to loading many (high resolution) fonts.
DviHPlj3 is a 32 bits version of DviHPlj which runs faster and can print larger pages (e.g., A3) at high resolutions (up to 1200 dpi).
Dvi2tty was written by S. Lindahl and extended by M. Mol. It is used only for quick viewing/printing dvi files and thus has a much more primitive interface.
DviPS was written by T. Rockiki.
The color DeskJet drivers were written by F. Sowa.
Ghostscript was written by Alladin Software Inc.
The Windows previewer GSview that uses Ghostscript as its `rendering engine' was written by Russell Lang.
DviWin was written by H. Sendoukas.

6.1.1 Fonts 

Whereas the TeX-compiler only needs to know the font metrics, the preview and/or print programs usually require bitmaps of each character of each font used, and must be told where to find these.

Fontfiles .pk can be organized into font libraries .fli, which can be read directly by print and preview programs. The program FontLib (see Section 4.7) manages font libraries.

The CD-rom version of 4TeX does not use font libraries to store bitmapped fonts because not all of the supported DVI-drivers can read font libraries: so far only the emTeX drivers and DviPS can. The current version of the color DeskJet dvi drivers are even more limited. They can only read bitmapped fonts from one directory tree (e.g., ?:\emtex\texfonts\deskjet) and its subdirectories. All other fonts you need should be accessible from the current directory.

There are no separate screenfonts; the emTeX previewer uses printer bitmaps (.pk files) of any resolution.

6.1.2 EmTeX DVI-drivers command line 

A few comments before we embark on the description of the command line:

The syntax is
DVIxxx [parameter file] <input file> [output file] [options]
where DVIxxx is the print or preview program of choice; if necessary with drive and/or directory specification.

[parameter file] (e.g., fx80.dot) is required only for DviDot.

<input file> is a required parameter. An extension .dvi is assumed if none is given.

[output file] is normally prn; for DviScr, it should be omitted. A filename can be entered instead of prn. The resulting file (e.g., mytext.lj) can be copied to a printer in a separate step by the dos command

Options may occur anywhere on the command line, except that for DviDot they should not precede [parameter file]. The options include: Above, `#' stands for a number, possibly followed by a dimension indicator (e.g., inches: in or millimeters: mm); `xxx' for any text string. The option may be separated from its parameter by either =, :, := or by nothing at all; a space in between is not allowed. Examples: /b1, /b:1, /b=1 and /b:=1 are all legal.

dvihplj-specific parameters: if you use e.g. a LaserJet 4M that has a lot of extra memory, printing will be more efficient if DviHPlj is told about it by the addition of a parameter /om6000. Make sure you never specify more memory than is available in your target printer--better be on the safe side. For LaserJets, the default is 384. For DeskJets, the memory parameter is ignored; a memory cartridge won't do you any good as far as DviHPlj is concerned.

Page-dimension parameters: /h# and /w# are best put in a response file; see below. Note that page dimensions are only used to determine how much of the page can be printed; a wrong page height won't result in `creeping' pages since formfeeds are used to move to a new page.

Resolution parameters: a LaserJet II/III or DeskJet requires /r=300. An ordinary Epson or IBM compatible 9-pin dot-matrix printer such as most inexpensive Star printers requires resolution parameters /rx=240 and /ry=216. Resolution parameters are also best put in a response file. Remember to set the /rf parameter identical to /r if you want to make use of the automatic font generation features.

Font libraries: a LaserJet or DeskJet would require
This is shorthand for
An Epson-compatible printer would require

6.1.3 Response files 

Even with font libraries, it is not practical to enter all font files on the command line. Therefore, response files are used which contain names of font libraries and other options. An option @<filename> on the command line causes the DVI-driver to read options and parameters from <filename> before processing the remainder of the command line.

emTeX expects to find response files you refer to to be located in a subdirectory called data directly beneath the path indicated by the environment variable EMTEXDIR, e.g., ?:\emtex\data. However, if you supply a path with the response file name (e.g., c:\texfiles\ownprt\myprint.cnf in stead of just myprint.cnf) it will read the file you specified.

Since the previewer DviScr uses printer fonts, it makes sense for response files to be usable for both printing and previewing.

An example response file for a LaserJet (lines starting with % are comments):
 % A4 paper size
 % printer resolution in Dots Per Inch
 % font libraries
With such a response file, named e.g., dvi.cnf, a file mytext.dvi could be previewed by entering

and printed on a LaserJet with For DeskJet users: A response file for a Star or Epson-compatible 9-pin printer:
 % 12" tractor paper
 % printer resolution x and y
Commands for previewing and printing for Star printer users: The first argument, fx80.dot, is the parameter file required for Epson-compatible 9-pins dot-matrix printers.

6.1.4 Environment variables 

Before scanning the command line, options will be read from environment variables; first from DVIDRV, next from an environment variable named after the DVI-driver (e.g., DviScr or DviHPlj, e.g., given environment variables

command lines for previewing and printing a file mytext.dvi can be simplified to Options in environment variables can be overruled by options on the command line, or in response files: if options conflict, the option processed last will override options processed earlier.

6.1.5 The 4TeX response files 

The examples above will work just fine if you set up your own system. However, the 4TeX response files *.cnf are a lot more complex. The principal reason is that they must be shared by many users, who may not have the same directory-setup. They also support some options not described above. In this section, we shall explain the additional options and syntactical constructs used in these response files.

Here comes ?:\emtex\data\hplj.cnf, the 4TeX response file for printing on a LaserJet II or III:

 % hplj.cnf
and now fx.cnf, the response file for Epson FX80-compatible printers:
 % fx.cnf (240x216 DPI using FX fonts)
The following options were not described in the previous section and can be found in the documentation of the DVI-drivers:

.tfm (TeX Font Metric) files. If the DVI-driver can't find a font, a .tfm file for that font may help the DVI-driver to improvise and generate some output.
DVI-file. This option can be used to let the DVI-driver search some additional directories.
font files; for fonts which are not stored in libraries.
graphic files.
font substitution file.
path and filename format for virtual fonts.
horizontal font resolution; required if you want missing fonts to be automatically generated.
vertical font resolution.
graphics resolution.
font scaling.
Metafont mode. Note that the .cnf files do not specify /fm. 4TeX will add this parameter dynamically in case automatic font generation is required (see Section 6.5.3).
maximum drift.

Note also the use of environment variables. Here, they start with `$' and end with `:', e.g., $TEXDVI:. The DVI-driver will replace such an environment variable by its values plus a backslash. If the environment variable is not set, an empty string will be used. In this context, environment variables (or, more accurately, their values) may not contain the characters `{', `}' or `$'. See the 4TeX configuration file texuser.<os> in the ?:\emtex\btm subdirectory or in your own work directory for a description of the environment variables. If you want to print a complete list of the environment variables used by 4TeX, enter a dos command

from the 4TeX main menu.

Environment variables are not the only variables that can be used in the specification of a file or group of files. The 4TeX response files also use:

As an example, consider the line
If Dvixxx had been called with mytext[.dvi] as input file, then Dvixxx would look for mytext[.dvi] in the current directory2 and in the directories specified in the environment variables TEXDVI and DVIDRVINPUT.

6.1.6 Interactive operation of DviScr and DviScrs 

The following are the more important keyboard commands when you are previewing with DviScr and DviScrs:

6.1.7 Font substitution 

Whenever the emTeX DVI-drivers cannot find a font file they will consult a font substitution file. In this file fonts can be remapped to other fonts or other magnifications.

A font substitution file usually has two parts: one part that states which fonts are always substituted by others, another part that states what fonts are substituted only in case a font cannot be found.

As an example we show a font substitution file for the Laserjet III:
 gray*        -> graylj*
 MTEX *       -> mtex *
 MTSY *       -> mtsy *
 MTMI *       -> mtmi *
 pcti* *      -> plti* *
 pcsl* *      -> plsl* *
 pcr* *       -> plr* *
 * 328        -> * 329
 * *          -> * * /w
 * *          -> rptmr * /r
The first lines tells DviHPlj to always substitute graylj* for gray* for any magnification.

$b means that the first part is finished.

The second part states that for all fonts of resolution 328 dpi the 329 dpi fonts can be used. In case no font file at all is available, but the font metric file is, then all characters will be left blank (the /w parameter). I even no font metric file is available, the font file rptmr (Times Roman) will be used, but all characters will be printed as black rectangles (the /r parameter).

[next] [front] [up]