## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

# Chapter 8. Printing

The emphasis in this book so far has been on getting TeX to process a document that contains all the desired typographic elements without error. The result of this effort is a DVI file.

The next step is translating the DVI file into a printed document. That is the focus of this chapter. Usually, you want to preview a document before you print it, but in many ways previewers are just a special kind of printer. The two do differ significantly, however, so we will discuss them separately. (Chapter 9, Chapter 9, describes previewers.)

This chapter explores the issues related to printing a DVI file. There are sections concerning the printing of fonts, the printing of pictures and figures, and descriptions of several kinds of drivers you can use to print TeX documents.

## Printing Fonts

If you have a TFM file for a font, you can use that font in TeX. In fact, you can use that font at an arbitrary magnification in TeX, which means that you can use Courier at 13.4pt as easily as Computer Modern Roman at 10pt. Unfortunately, this ease of use does not imply that the resulting DVI file will be easy to print. It doesn't even imply that it will be possible to print the document. For example, if you request Courier at 13.4pt, but it is available in your printer only at 10pt and 12pt (and you have no other source for Courier), there is no way to print your document without distortion.

This section discusses the issues involved in getting the desired fonts to print from your DVI file. Both bitmapped and scalable fonts are considered, as well as fonts built into the printer. You will also gain a better understanding of why some documents do not print, and learn alternatives that may enable you to print your documents.

Every font can be classified in two broad, independent ways: internal versus external, and scalable versus bitmapped. Each class of fonts has some advantages and some unique problems. In general, there are more restrictions on built-in fonts than on external fonts, and more restrictions on bitmapped fonts than on scalable fonts.

### Built-in Fonts

Built-in fonts, whether scalable or bitmapped, pose two problems. First, you must obtain the appropriate TFM files. Usually, the metric information has to be supplied by the vendor and then translated into TeX TFM format using a conversion tool. No vendor that I am aware of distributes TeX metric information directly. The section called “the section called “Expressing Design Size in TeX”” in Chapter 5, Chapter 5, describes several options for obtaining metric information for built-in fonts.

The second problem is that the DVI driver you are using must “know” somehow that the TFM file corresponds to one of the printer's internal fonts. When the DVI driver examines the DVI file, the only information available about each font is the name of the TFM file that describes its metrics. The most common way DVI drivers handle this problem is with a font translation file or a font substitution file.

#### Font substitution in emTeX

emTeX's DVI driver reads a user-specified font substitution file before processing the DVI file. A line like the following in the font substitution file informs the dvihplj driver that lpr1610u is an internal font and describes the LaserJet control sequence required to select it:

lpr1610u 300 => pcl: 10U s0P s16.66H s8.5V s0S s0B s0T

Other substitutions are also possible. For example, if you work with documents that come from other systems that allow long filenames, you can substitute the long names for shorter filenames that are legal under MS-DOS. The following line in a font substitution file tells emTeX that the font “tmsrmn” should be used anywhere that a DVI file uses the font “Times-Roman”:

Times-Roman -> tmsrmn

You can use even more sophisticated substitutions, including pattern matching, for example. Consult The {emTeX} DVI Driver Manual [em:dvidrv] for more information.

#### Font substitution in\dvips

The dvips program, which translates DVI files into PostScript, also reads a font substitution file before processing a DVI file. In addition to identifying which fonts are built into the printer, the substitution file can also instruct dvips to download PostScript fonts that are not resident in your printer if they are used in a document.

dvips has a system-wide font substitution file called psfonts.map. This file is distributed with dvips and can be customized by your system administrator. You can tell dvips to load a personal font substitution file by using the p command in dvips's initialization file (called .dvipsrc in your home directory on unix systems). Consult the dvips documentation for more information about setting up an initialization file.

The following lines in a font substitution file indicate that the font grbk (which is the name of the TFM file) corresponds to the built-in printer font Garamond-Book. The TFM file hlvcd corresponds to the printer font Helvetica-Condensed. Helvetica-Condensed is not built into the printer but is stored in the file /home/walsh/fonts/helvcd.pfb. If hlvcd is used in a document, dvips will download helvcd.pfb automatically when it converts the document.

grbk   Garamond-Book
hlvcd  Helvetica-Condensed </home/walsh/fonts/helvcd.pfb

#### Font substitution in other drivers

Other DVI drivers, particularly those written for operating environments like Microsoft Windows that provide a standard interface to printers, may leave the distinction between built-in and external fonts up to the operating environment. If this is the case, you must use the tools provided by the operating system to support the printers and fonts that you require.

If your DVI driver does use a font substitution file, make sure that the translations specified actually exist. The DVI driver cannot practically determine if the font you have specified as built into the printer really exists or not. If it doesn't, you won't get the output you expect, and the DVI driver will not be able to diagnose the problem.

The most significant disadvantage of using built-in fonts is that they are not usually available for on-screen previewing of your document. Some form of font substitution has to be employed to preview a document. Sometimes this reduces the utility of on-screen previewing. Chapter 9, Chapter 9, discusses this issue in more detail.

### External Fonts

External fonts, those that aren't built into the printer, pose a different set of problems. First, they have to be available to the DVI driver, and they have to be represented in a manner that the DVI driver understands. For the vast majority of DVI drivers, this means that the fonts must be stored in files on your hard disk in PK format. The PK files contain a compressed, bitmapped rendering of the font at a particular resolution. For more information about PK files and other bitmapped-font issues, see “the section called “Built-in Fonts”” later in this chapter.

Most DVI drivers locate fonts by searching in the directories contained in an environment variable or in some system-dependent locations.

Once the fonts are available, the DVI driver has two options for using them: it can download them to the printer, or it can send them as bitmapped graphic images. Most laser printers can accept downloadable fonts, although they may require additional memory to accept large numbers of fonts. In either case, the printable files are generally larger and print more slowly than documents that use the printer's built-in fonts. Of course, using external fonts does give you far more flexibility than using only built-in fonts.

Unlike a missing internal font, if you attempt to use an external font that is not available, your DVI driver will be able to detect the problem and may be able to substitute another font or compensate in some other way.

Increasing Printing Speed

How can you increase printing speed if you frequently print, on a laser printer, documents that use a small number of external fonts (for example, several sizes of Computer Modern)? A handy trick is to download the fonts manually and then tell the DVI driver that the fonts are built-in.

Suppose you use the 7pt, 10pt, and 12pt sizes of Computer Modern Roman, and the 12pt and 14pt sizes of Computer Modern Bold Extended in most of your documents. If you are printing on an HP LaserJet printer with emTeX's dvihplj, you could convert the relevant PK files into HP LaserJet softfonts with PKtoSFP (see the discussion of bitmapped fonts in the next section to determine which PK files are relevant). Then download them to the printer every morning with a utility like Sfload. Sfload is part of the Sfware package. (Disclaimer: I wrote Sfware so I'm partial to it. There are many other programs that can download softfonts.) In the font-substitution file for dvihplj, simply indicate that those fonts are built-in, and dvihplj will no longer download them for each document. This can significantly decrease the amount of data that must be sent to the printer for each document.

Beware, however, that if you fail to download the fonts, you will get very badly garbled output when you print a document.

### Bitmapped Fonts

Each character in a bitmapped font is represented by a rectangular array of dots. Some of the dots in this array are “on,” and some are “off.” When the dots are printed very close together, they provide the illusion of a solid character. Bitmapped fonts are common in the TeX community because all of the fonts created by MetaFont are printed in bitmapped form.

The notion of magnification discussed in the section called “the section called “What TeX Needs To Know”” in Chapter 5 is interpreted as an issue of resolution when dealing with bitmapped fonts.

Resolution is used in a slightly counter-intuitive way by DVI drivers. Generally, resolution is described as a feature of a device that affects the appearance of images printed on that device and not their size. For example, in comparing two drawings in which one was printed on 150dpi dot-matrix printer and the other was printed on a 300dpi laser printer, I might say, “the laser printed page looks better because it was printed at a higher resolution.”

That's true, but what isn't usually stated explicitly is that the comparison is between a 150dpi drawing rendered at 150dpi and a 300dpi drawing rendered at 300dpi. This is the situation shown in Figure 8.1 where a 4dpi image is printed at 4dpi next to an 8dpi image printed at 8dpi.

Figure 8.1. Resolution of the bitmap and the device changed simultaneously

\input{ft-resch.fig}

What if the resolution of the printer were held constant? That's the situation shown in Figure 8.2. The 4dpi image printed at 4dpi is shown next to the 8dpi image printed at 4dpi. The result is that the size of the image is doubled.

Figure 8.2. Resolution of the bitmap changed while device held constant

\input{ft-sizch.fig}

This is the technique that DVI drivers use to print a larger magnification of the same font; they print a version of the font designed for a correspondingly higher-resolution device. The same technique is used to print at smaller magnifications.

Most DVI drivers use bitmapped fonts stored in PK files. The PK format is a highly compressed binary format.[99] Two other bitmapped font formats (sometimes accepted by DVI drivers) are associated with TeX: GF and PXL files. The GF format is a very flat, uncompressed bitmap format produced by several utility programs, including MetaFont. The GFtoPK program converts GF files into PK files. The PXL format is an uncompressed bitmap format; it has been superseded by the PK format (which achieves better compression) and is completely obsolete. If you still have PXL files, you should convert them to PK format with the PXtoPK utility. If you are using a DVI driver that still requires PXL files, you should find out about an upgrade; the program is obsolete.

The fact that DVI drivers use different resolutions of the same font file to obtain different magnifications introduces a naming problem. How can the DVI driver distinguish between cmr12.pk at 300dpi and cmr12.pk at 360dpi (or any other resolution)?

On unix systems, this problem is usually resolved by putting the resolution in the filename in front of the extension pk. For example, cmr12.300pk is cmr12 at 300dpi while cmr12.360pk is cmr12 at 360dpi.

On many other systems, where the operating system imposes limits on the length of filenames, a solution is achieved by storing the fonts in different subdirectories. On MS-DOS, for example, the 300dpi version of cmr12 might be stored in \bs texfonts\bs 300dpi\bs cmr12.pk while the 360dpi version is stored in \bs texfonts\bs 360dpi\bs cmr12.pk.

In either case, you should obey the conventions specified by your DVI driver to assure that the DVI driver can find the fonts. One common solution to the problem of finding fonts is to use an environment variable to list the directories where PK files occur. For example, on a unix system, the environment variable TEXPKS might hold a list of directories separated by colons:[100]

TEXPKS=/usr/local/lib/tex/fonts:/usr/local/lib/tex/fonts/pk: /usr/local/lib/mf/fonts:/usr/local/lib/mf/fonts/pk

Under MS-DOS, the environment variable DVIDRVFONTS might hold a list of directories separated by semicolons:

DVIDRVFONTS=C:\TEXFONTS;C:\MYFONTS

The format of the environment variable and how it is created or modified is determined by the operating environment that you are using. The name of the environment variable differs according to the DVI driver.

To recap, TeX works with magnifications of abstract, scalable measurements; DVI drivers work with resolutions of fixed, bitmapped images.

To convert a magnification into a resolution, multiply the resolution of your output device by the magnification. A font at a magnification of 120\% on a 300dpi laser printer has a resolution of 360dpi.

To convert a resolution into a magnification, divide the font resolution by the resolution of the printer. A 420dpi font on a 300dpi laser printer has a magnification of 140\%.

### Scalable Fonts

Although scalable fonts used to be very uncommon, the proliferation of PostScript printers and products like Adobe Type Manager (not to mention built-in support for TrueType fonts in Apple System 7.0 and Microsoft Windows 3.1) have made these fonts very common. It is important to remember that scalable fonts are ultimately converted into bitmapped fonts. All printers eventually treat the page as a very large bitmap and either do or do not deposit a small amount of ink in each position in the bitmap.

Most DVI drivers leave the work of performing this rasterization to someone else. If you are not using a PostScript printer, you probably rely on some other piece of software to do the work. Adobe Type Manager and built-in support for TrueType are the most common software solutions. Some printers, like the LaserJet III, have built-in scalable fonts as well, even though they are not PostScript printers.

### Font Printing Pitfalls

Sometimes you need a font at a size that is not available. Because scalable fonts are available at any size, this is a problem only with bitmapped fonts. Remember that MetaFont creates bitmapped fonts, but they can be scaled because the MF source for the font is not a bitmap. You can't scale the PK file, but you can generate a new PK file at the size you need. In order to do this, you must have MetaFont installed, and you must have the MF source for the font. Chapter 11, Chapter 11, describes how to create a MetaFont font at any size.

If the font isn't a MetaFont font, or you don't have the MF source, you may still be able to scale the font. However, you should be aware before you try that the result may be unacceptable. Scaling bitmapped fonts causes ugly, jagged edges if the font is scaled larger, and loss of detail if it is scaled smaller. Small changes in size are sometimes manageable.

The dvips driver will scale bitmapped fonts if it cannot find or build the requested font. Alternatively, the sffx program can scale HP LaserJet softfonts. I don't know of any other scaling options.

Non-scalable fonts that are built into the printer cannot be scaled at all. If you need to have a built-in font at an unavailable size, you will have to substitute another font in place of the built-in one.

## Printing Pictures and Figures

Pictures and figures are frequently the least portable elements of a document. Chapter 6, Chapter 6, describes many of the options that are available for including pictures and figures in a document.

If the method used is supported by the DVI driver and printer that you use, pictures and figures are transparently printed. They are even less difficult to print than fonts. On the other hand, if you are attempting to print a document which incorporates pictures and figures using a method not supported by your DVI driver or printer, it may be exceptionally difficult to print the document.

### Unsolvable Problems

DVI files are not always “complete” with respect to pictures and figures. Many documents use \special commands to access DVI driver or printer-specific features in order to include pictures and figures. These \specials may have just the name of an external file that contains the graphic image to be included. For example, using the emTeX drivers, I can include a bitmapped graphic image with the command \special\verb|{em:graph spslogo}|. When emTeX's DVI drivers process this command, the graphic image in the file spslogo.pcx is included in the output. If I transmit this DVI file to another computer but forget to transmit the file spslogo.pcx, there is no way to print the DVI file with the SPS logo.

At first, it may seem that a good solution to the problem described above would be to include the actual data for the image in the \special command. But to do that, TeX would have to process the image data, defeating the purpose of the \special mechanism. The \special mechanism is better because it is open ended---it can handle new types of graphics, for example, without changing TeX.

The second, essentially unsolvable, problem involves DVI files containing \special commands that have embedded data. For example, one set of picture drawing \special commands are the tpic \specials. If your DVI driver does not understand these commands, there is no practical way to extract them from the DVI file in order to convert them into a format your DVI driver understands. There may not even be a practical way of extracting them from the TeX document to construct a printable image. You simply can't print that document with the tpic figures intact.

### Solvable Problems

If you have a document that includes an external picture or figure using a method that your DVI driver or printer does not understand, and you have the file that contains the graphic image and the TeX source for the document, you may be able to print it.

The section called “the section called “Manipulating Images”” in Chapter 6, lists a wide variety of picture conversion tools that may allow you to convert the image into a printable form. For example, if the document in question uses a \special command to include a PCX graphic image, but your DVI driver only understands the Macintosh PICT format, you could use the PBMplus utilities to convert the PCX image into PICT format.

A conversion that might frequently be necessary if you work on both PostScript and non-PostScript printers is conversion from encapsulated PostScript to a bitmap format. This is a translation that Ghostscript or some other PostScript interpreter can perform.

### Pictures Using Only TeX

Device-independent pictures created using only TeX pose no particular printing problems. These include the LaTeX picture environment, as well as the PiCTeX and XYPic macro packages.

### MetaFont Figures

Pictures created with MetaFont (using MFPic, Fig2MF, or MetaFont directly) are really MetaFont fonts. As a result, they can be created for almost any raster output device.[101] As long as MetaFont is available and the figures aren't too large, they pose no problems. Very large images may break some DVI drivers or may not be printable on some output devices.

### Scalable Images

Scalable formats, primarily PostScript and HPGL, are difficult to convert to other printing technologies. However, the Ghostscript program is one option for PostScript figures, and hp2xx can convert a subset of HPGL commands into other formats.

### Bitmap Images

Bitmap images are generally the easiest to convert from one format to another, but there is another issue that is more difficult to deal with---resolution. Printing a bitmap image at 1200dpi if the original is only 300dpi is not easy.

## Selected Drivers

Table 8.1 lists a number of common DVI drivers used to print TeX documents (as opposed to previewing them). These drivers are discussed in more detail in this section. The list of drivers described here is nowhere near complete. The presence or absence of a particular driver from this list is not intended as a reflection on the quality of the driver. I tried to select a representative set of free and commercial drivers. Drivers for other printers usually offer similar features.

Table 8.1. Common DVI Drivers

### emTeX Drivers

The emTeX distribution includes three DVI drivers: dvihplj for printing on HP LaserJet, DeskJet, PaintJet, QuietJet printers (as well as the Kyocera laser printer), dvidot for printing on a wide variety of dot-matrix printers, and dvipcx for translating DVI files into PCX graphics images (for faxing, for example). The printers that dvidot supports are listed below. If your dot-matrix printer isn't listed, detailed instructions in the emTeX documentation will probably allow you to construct an appropriate parameter file.

 Apple Imagewriter IBM Proprinter 4202 C.ITOH 8510A IBM Proprinter 4207 Canon Bubble Jet BJ-10e IBM Proprinter 4208 EPSON FX and RX series NEC P6, Panasonic KX-P1124 EPSON LQ series NEC P7 IBM Proprinter 4201 Tandy DMP-130

All of the emTeX drivers support several \special commands for including bitmapped graphics and lines at any angle.

The Computer Modern fonts in PK format occupy several directories and considerable space on disk. To minimize the impact of keeping several magnifications of fonts around, the emTeX drivers introduced the concept of font libraries. Font libraries are single files that contain many, many PK fonts. The fonts distributed with emTeX are distributed in font library format. The fontlib program, distributed with emTeX, allows you to create and maintain font libraries of your own.

The emTeX drivers support automatic font generation starting with version 1.4S. This is accomplished by a second program, dvidrv, that runs the DVI driver and then MFjob, if required, to build the fonts. The relationship between these components is shown in Figure 8.3.

Figure 8.3. Previewing and printing with emTeX

FIXME:

Starting with version 1.4t,[102] emTeX's dvihplj supports 600dpi fonts (for the LaserJet 4 series) and built-in printer fonts.

The following list of features highlights some of the capabilities of the emTeX drivers:

• Printing of a range of pages
• Printing of multiple copies (with or without collating)
• Reverse ordering of pages
• Selection of duplex printing
• Ability to scale PK files to the requested size if an appropriate PK file is unavailable. This may result in poorer output quality due to distortion, but that's not emTeX's fault.
• Extremely flexible support for printing booklets and “n-up” arrangements of pages
• Selection of paper size and dimensions (margins, etc.)
• Transformations (rotation by a multiple of 90 degrees)
• Changes in magnification and resolution of output
• Support for font libraries
• Support for font compression in printers with that feature
• Ability to download each page as a large bitmap (to overcome font limitations in some printers)
• Support for automatic font generation

### dvilj2

dvilj2 is a free driver for the HP LaserJet Series II printer. It is part of the dvi2xx distribution, which also includes drivers for the HP LaserJet Series IIP and III printers, as well as a driver for the IBM 3812 page printer.

### dvips

dvips is one of the most popular PostScript DVI drivers. It is available for unix, MS-DOS, and OS/2 platforms. It may also be available on other platforms because the source code is freely available. dvips supports a wide range of \special commands for controlling the PostScript output, including pictures and figures and raw PostScript code.

The following list of features highlights some of dvips's capabilities:

• Inclusion of printer-specific prologue files
• Support for compressed PostScript pictures and figures
• Automatic creation of pseudo-bold and pseudo-italic fonts
• Ability to run as a filter
• Automatic splitting of documents into sections to prevent out-of-memory errors on the printer
• Printing of crop marks
• Printing of a range of pages (by physical sheet or TeX page number)
• Selection of manual-feed on the printer
• Limit on number of output pages
• Reverse order of pages
• Selection of paper type
• Changes in magnification of the output
• Printing of odd/even pages only
• Printing of multiple copies (with or without collating)
• Stripping of comments (to avoid printer/spooler bugs)
• Moving of printed image left/right or up/down page
• Compression of fonts before downloading

An option to the dvips driver can be used to indicate which printer the output is destined for. This allows many printer-specific options (resolution, paper sizes, etc.) to be specified in a configuration file, removing from the user the burden of remembering them.

Automatic font generation is supported by dvips, as described above. dvipsk, a modified version of dvips, also supports a font-searching mechanism that greatly simplifies the task of specifying which directories contain font files. If any directory specification in the font path ends with two slashes, dvips searches that directory and all of its subdirectories for the font files. This allows you to create a font directory structure like the one shown here:

/usr/local/lib/tex/fonts/supplier
/usr/local/lib/tex/fonts/supplier/typeface
/usr/local/lib/tex/fonts/supplier/typeface/src
/usr/local/lib/tex/fonts/supplier/typeface/tfm
/usr/local/lib/tex/fonts/supplier/typeface/vf
/usr/local/lib/tex/fonts/supplier/typeface/vpl
/usr/local/lib/tex/fonts/supplier/typeface/glyphs
/usr/local/lib/tex/fonts/supplier/typeface/glyphs/pk

This arrangement is advantageous because it organizes your fonts and simplifies maintenance of the directories that contain them. If /usr/local/lib/tex/fonts// is in the font search path, dvips will search through all of the font directories for the files that it needs. For example, it might find the TFM file for cmr10 in /usr/local/lib/tex/fonts/free/cm/tfm. The directory /usr/local/lib/tex/fonts/adobe/garamond/glyphs/type1 is the location for the PostScript source of the Garamond-Italic font.

The dvips distribution includes the afm2tfm program for creating TeX font metrics from Adobe AFM files. This version of afm2tfm can perform several useful tasks such as automatically creating appropriate virtual fonts (for mapping TeX font encodings to PostScript encodings) or changing the encoding of the PostScript font.

### DVILASER/HP

ArborText's \dvilaserhp DVI driver translates TeX DVI files into a format that can be printed on HP LaserJet printers. These drivers are available for both MS-DOS and supported unix workstations. The following discussion is based on experiences with \dvilaserhp version 5.3.3, the MS-DOS implementation of ArborText's HP LaserJet driver.

\dvilaserhp functions in the way you would expect, generating LaserJet printable documents from TeX DVI files. It also has many special features. Some of the more interesting features are summarized below. \dvilaserhp can print documents using PK files, HP LaserJet softfonts, and built-in fonts (including fonts from cartridges).

ArborText supplies a complete set of Computer Modern fonts in PK format. Recent releases of \dvilaserhp can use the virtual fonts introduced in TeX version 3.0.

ArborText's \dvilaserhp DVI driver provides the following features:

• Selectable number of copies
• Optional reverse ordering of pages
• Selectable manual-feed
• Portrait or landscape orientation
• Selectable page size
• Ability to scale PK files to the requested size if an appropriate PK file is unavailable. This may result in poorer output quality due to distortion, but that's not \dvilaserhp's fault.[103]
• Page movement and reordering options (for printing multiple pages on a single sheet of paper, for example)
• Configurable font substitution
• Support for LaserJet “overlays.” \dvilaserhp recognizes \special commands for inserting raw HP LaserJet format documents and inserting HP LaserJet overlays[104]
• An interactive mode (useful for printing only selected pages from a document without re-running \dvilaserhp many times or when many options are going to be used)
• Selectable paper tray

Many other utilities come with \dvilaserhp; they are summarized in Table 8.2. \index{VPtoVF}{\def\x{${}^1$}

Table 8.2. Other \protect\dvilaserhp Utilities

 \bf Utility \bf Description \it aftovp Converts VPL from AFM file \it gftopk\,\x Converts GF files into PK files \it hpformat A print formatter for ASCII files \it packpxl Creates packed (byte-aligned) PXL file \it painthp Converts MacPaint files into HP LaserJet format \it pcltopk\,\x Converts HP LaserJet softfonts into PK/TFM file \it pktopx\,\x Converts PK files into PXL files \it pxtopk\,\x Converts PXL files into PK files \it spr A serial-line print spooler \it tftovp Converts VPL from TFM file \it unpkpxl Creates standard, word-aligned PXL file \it vftovp\,\x Converts VF files into VPL files \it vptovf\,\,\x Converts VPL files into VF files

ArborText recently released DVILASER/HP3 drivers for the HP LaserJet III and IV printers. In addition to the features described above, DVILASER/HP3 supports more complex documents, compressed font downloading, 600dpi and duplex printing, paper tray and output bin selection, and the ability to include TIFF images via a \special command.

### DVILASER/PS

ArborText's \dvilaserps DVI driver translates TeX DVI files into PostScript. These drivers are available for both MS-DOS and supported unix workstations. The following discussion is based on experiences with \dvilaserps version 6.3.5, the MS-DOS implementation of ArborText's PostScript driver.

PostScript DVI drivers are more flexible than many other DVI drivers because PostScript is a very powerful page description language. Some of \dvilaserps's more interesting features are summarized below. \dvilaserps can print documents using PK files, downloadable PostScript fonts, and built-in fonts. ArborText supplies TFM files for many built-in PostScript fonts. Recent releases of \dvilaserps can use the virtual fonts introduced in TeX version 3.0.

ArborText's \dvilaserps DVI driver provides the following features:

• Options for loading custom PostScript prologue code
• Ability to be used as a filter (sends PostScript code to standard output)
• Selectable number of copies
• Optional reverse ordering of pages
• Portrait or landscape orientation
• Selectable page size
• Ability to scale PK files to the requested size if an appropriate PK file is unavailable. This may result in poorer output quality due to distortion, but that's not \dvilaserps's fault.
• Page movement and reordering options (for printing multiple pages on a single sheet of paper, for example)
• Selectable paper tray
• Configurable font substitution
• Support for LaserJet “overlays”
• An interactive mode (useful for printing only selected pages from a document without re-running \dvilaserps many times or when many options are going to be used)
• Ability to download PK files permanently, speeding printing of future documents
• Document, page, or encapsulated PostScript document structuring options
• Optional clipping of characters that fall outside the normally printable page area

Many other utilities come with \dvilaserps. They are summarized in Table 8.3.

Table 8.3. Other \protect\dvilaserps Utilities

 \bf Utility \bf Description \it afmtopl Converts AFM files into unmapped PL files \it afmtoplm Converts AFM files into mapped PL files\y \it aftovp Converts VPL from AFM file \it gftopk\,\x Converts GF files into PK files \it packpxl Creates packed (byte-aligned) PXL file \it pktopx\,\x Converts PK files into PXL files \it pltotf\,\,\x Converts PL files into TFM files \it psformat A print formatter for ASCII files \it pxtopk\,\x Converts PXL files into PK files \it spr A serial-line print spooler \it tftopl\,\x Converts TFM files into PL files \it tftovp Converts VPL from TFM file \it unpkpxl Creates standard, word-aligned PXL file \it vftovp\,\x Converts VF files into VPL files \it vptovf\,\,\x Converts VPL files into VF files \multicolumn{2}{l}{ ${}^1$\vrule height11pt width0pt\tiny A standard, or otherwise freely available, utility.}

\dvilaserps recognizes \special commands for inserting raw PostScript files and commands, encapsulated PostScript files, and automatic page overlays (which can be selectively enabled and disabled). Other \special commands allow you to set most of the \dvilaserps command-line options directly in the document, rotate any TeX “box” to any angle, and print change bars. For LaTeX users, ArborText includes a plug-in replacement for LaTeX's picture environments that uses PostScript instead of special fonts to draw each figure.

### PTI Laser/HP and PTI Jet

PTI Laser/HP and PTI Jet are distributed together by Personal TeX, Inc. PTI Laser/HP is an HP LaserJet driver. PTI Jet is a DeskJet driver. The PTI Jet driver works with a standard DeskJet printer; no additional options or memory are required. The PTI Laser/HP driver is for HP LaserJet II and III series printers. A separate program, PTI Laser/HP4, is sold for LaserJet 4 series printers (to support 600dpi fonts, for example).

The following features are available in these drivers:

• Support for font substitution
• Support for built-in fonts
• Printing multiple copies of each page
• Setting page size
• Printing in landscape mode
• Selecting magnification
• Ability to print a range of pages (by physical sheet or TeX page number)
• Reversing order of pages
• Ability to move the page image left/right or up/down the page
• Support for 256 character fonts

PTI Laser/HP offers the following additional features, which are not supported by PTI Jet:

• Ability to reserve printer font ID numbers
• A utility program, sftopk, for converting HP LaserJet softfonts into TeX PK fonts
• Support for directly including HP LaserJet printer commands via the \special mechanism in TeX

### PTI Laser/PS

PTI Laser/PS is Personal TeX's PostScript DVI driver. In addition to the DVI driver, the PTI Laser/PS package includes utilities for spooling output to a serially-connected printer and converting AFM files into TFM files.

Some of PTI Laser/PS's more interesting options are summarized below.

• Ability to select different printer resolutions
• Selectable number of copies
• Configurable font substitution
• Selectable page size
• An interactive mode for selecting options and reacting to errors (characters that fall off the page, missing fonts, etc.)
• Portrait or landscape orientation
• Selectable TeX magnification
• Option files for storing frequently used options.
• Selectable output filename
• Options to select individual pages or ranges of pages by TeX page number or physical sheet number
• Optional reverse ordering of pages
• Adjustable page offset (adjusts the position of the printed page on the physical page)
• Support for 256-character fonts
• Special support for the eccentricities of the Apple LaserWriter printer

PTI Laser/PS recognizes a \special command for inserting raw PostScript files into the printed document. The horizontal and vertical size of the inserted image can be changed.

### dvipsone

dvipsone is a commercial PostScript driver for MS-DOS distributed by Y&Y Inc. It produces PostScript output from a TeX DVI file. dvipsone is designed for a “bitmap-free” environment. This makes dvipsone almost unique among DVI drivers because it cannot use standard PK fonts. To use dvipsone, you must have PostScript fonts for every font that you use (or the font must be built into the printer).[105] Y&Y sells a complete set of Computer Modern fonts in Adobe Type 1 format.

dvipsone has a rich set of features:

• Printing multiple DVI files with a single command
• Printing pages in reverse order
• Printing only odd or even pages
• Ability to force output to conform to EPS standards
• Assumption that all requested fonts are printer-resident
• Insertion of verbatim PostScript
• Printing a range of pages
• Resizing of the output
• Rotation of output by arbitrary angle
• Shifting output left/right or up/down
• Printing arbitrary number of copies
• Selection of paper type (letter, landscape, legal, etc.)
• Insertion of user-specified PostScript prologue
• Conservation of memory by downloading partial fonts
• Remapping of the font encoding on-the-fly
• Support for ten different styles of \special commands for including encapsulated PostScript images

Perhaps the most interesting feature of the dvipsone driver is its ability to download partial PostScript fonts. Y&Y claim that partial font downloading is a feature unique to dvipsone. A moderately complex TeX document may use twenty or more fonts and each font is typically between 20K and 30K. This means that the DVI driver downloads roughly 500K of font data for the document. In addition to requiring considerable printer memory, all that font data increases the amount of time that it takes to send your document to the printer. The partial font downloading feature of dvipsone means that only the characters that are actually used in your document are sent to the printer. The ability to download partial fonts can result in a substantially smaller PostScript file.

Several other utilities are distributed with dvipsone. They are summarized in Table 8.4.

Table 8.4. Other dvipsone Utilities

 \bf Utility \bf Description download Robust font-downloading program for PostScript fonts afmtotfm\,\x Converts AFM files into TFM files tfmtoafm Converts TFM files into AFM files pfatopfb\,\x Convert PFA files into PFB files pfbtopfa\,\x Convert PFB files into PFA files twoup Reorders pages in a PostScript file pktops Provides access to PK fonts for dvipsone

[99] {For a complete, detailed description of the PK and GF formats, consult The GF to PK Processor [mfware:gftopk].}

[100] {A backslash is used here to escape the end of the first line. This is a standard way to continue a line in most unix shells. Naturally, you can simply enter it as one line in your editor, if you prefer.}

[101] {Because figures are frequently much larger than individual characters, MetaFont may have difficulty with large figures at very high resolutions.}

[102] {In alpha-testing at the time of this writing.}

[103] {The scaling uses the next larger-sized PK file, and ArborText claims that this results in good quality over a large range of point sizes without providing PK files for every exact size.}

[104] {Consult your HP LaserJet reference manual for more information about overlays.}

[105] {The dvipsone distribution includes a utility which can convert PK fonts into bitmapped PostScript fonts. This program translates a PK file into an Adobe Type 3 font. Once in Type 3 format, dvipsone can use the font. Using Type 3 fonts created in this way adds resolution-dependence to your PostScript file.}

## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

No credit card required