# Running LaTeX

Last revision August 3, 2004

Two processing steps are needed to transform an input document into a final typeset printout. First, the LaTeX document must be processed by the latex program into a dvi file (which stands for device-independent). Then, the dvi file must be translated into the specific printer language understood by the desired printer (e.g., PostScript). Or the .dvi file can be fed as input to a screen previewing program, such as xdvi to preview on an X Window terminal.

On pangea, there is a single program to do both steps, called texpr. It selects the needed dvi to printer processing depending upon the type of printer desired. Use an option like printer=name to specify the desired output printer by its standard Unix queue name (from the /etc/printcap file). Texpr also obeys your personal default printer set by the PRINTER environment variable.

The default printer, if no option is specified, depends upon the system. On pangea, there is no default printer.

Texpr also needs to know whether you are processing plain TeX or LaTeX (it can handle either one). The simplest way to distinguish is by how you name the file. If the filename ends with the suffix .latex, texpr will assume it is a LaTeX input file. Otherwise texpr assumes it is a TeX input file. Or you can use the -t or -l options to explicitly specify plain TeX or LaTeX, respectively.

For example, you could save the input file for the latex example latexexample.latex and then print it on the HP LaserJet 4050 printer in the Mitchell A65 computer cluster with the command:

texpr printer=a65-laserjet latexexample.latex

You can set your own default options for texpr to use, such as a default printer or default TeX or LaTeX processing options, by setting a TEXPR environment variable in your .login file. See the texpr manual entry (man texpr on pangea) for more information.