home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / DVIPS / EMTEX / DOC / DVIPS / DVIPS.TEX (.txt) < prev    next >
Texinfo Document  |  1993-04-26  |  133KB  |  2,525 lines

  1. %   This document describes how to use dvips.  Macros at top cut and
  2. %   slashed from another document.
  3. \newif\ifgeneric\genericfalse
  4. \ifx\ntmanloaded Y\else\input dvipsmac \fi % uh oh, no macros, give our own.
  5. %   Finally, the document itself.
  6. The \.{dvips} program converts a \TeX\ \.{dvi} file into a PostScript file
  7. for printing or distribution.  Seldom has such a seemingly easy programming
  8. task required so much effort.
  9. % Why use dvips?
  10. \sec{Why Use dvips?}
  11. The \.{dvips} program has a number of features that set it apart from other
  12. PostScript drivers for \TeX.  This rather long section describes the advantages
  13. \^{{\tt dvips}}
  14. \^{PostScript}
  15. of using \.{dvips}, and may be skipped if you are just interested in learning
  16. how to use the program.  Installation is covered in section 14 near the
  17. end of this document.
  18. The \.{dvips} driver generates excellent, standard PostScript, that can be
  19. included in other documents as figures or printed through a variety of
  20. spoolers.  The generated PostScript requires very little printer memory,
  21. so very complex documents with a lot of fonts can easily be printed even
  22. on PostScript printers without much memory, such as the original Apple
  23. LaserWriter.  The PostScript output is also compact, requiring less disk
  24. space to store and making it feasible as a transfer format.
  25. Even those documents that are too complex to print in their entirety
  26. on a particular printer
  27. can be printed, since \.{dvips} will automatically split such documents
  28. \^{memory}
  29. into pieces, reclaiming the printer memory between each piece.
  30. The \.{dvips} program supports graphics in a natural way, allowing PostScript
  31. graphics to be included and automatically scaled and positioned in a variety
  32. of ways.
  33. Printers with resolutions other than 300 dpi are also supported, even if they
  34. have a different resolution in the horizontal and vertical directions.
  35. High resolution output is supported for typesetters, including an option
  36. that compresses the bitmapped fonts so that typesetter virtual memory is
  37. \^{resolution}
  38. not exhausted.  This option also significantly reduces the size of the
  39. PostScript file and decoding in the printer is very fast.
  40. Missing fonts can be automatically generated if \MF\ exists on the system,
  41. or fonts can be converted from \.{gf} to \.{pk} format on demand.
  42. \^{automatic font generation}
  43. If a font cannot be generated, a scaled version of the same font at a
  44. different size can be used instead, although \.{dvips} will complain
  45. loudly about the poor \ae sthetics of the resulting output.
  46. Users will appreciate features such as collated copies and support
  47. for \.{tpic}, \.{psfig}, \.{emtex}, and \.{METAPOST};
  48. \^{{\tt tpic}}
  49. \^{{\tt psfig}}
  50. \^{{\tt emtex}}
  51. \^{{\tt METAPOST}}
  52. system administrators will love the support for multiple printers, each
  53. with their own configuration file, and the ability to pipe the output
  54. directly to a program such as \.{lpr}.
  55. Support for MS-DOS and VMS in addition to UNIX is provided in the
  56. \^{MS-DOS}
  57. \^{UNIX}
  58. \^{VMS}
  59. standard distribution, and porting to other systems is easy.
  60. One of the most important features is the support of virtual fonts, which
  61. add an entirely new level of flexibility to \TeX.  Virtual fonts are used to
  62. give \.{dvips} its excellent PostScript font support, handling all the font
  63. remapping in a natural, portable, elegant, and extensible way.  The \.{dvips}
  64. \^{{\tt afm2tfm}}
  65. driver even comes with its own \.{afm2tfm} program that creates the necessary
  66. virtual fonts and \TeX\ font metric files automatically from the Adobe
  67. font metric files.
  68. Source is provided and freely distributable, so adding a site-specific feature
  69. is possible.  Adding such features is made easier by the highly modular
  70. structure of the program.
  71. There is really no reason to use another driver, and the more people use
  72. \.{dvips}, the less time will be spent fighting with PostScript and the
  73. more time will be available to create beautiful documents.
  74. So if you don't use \.{dvips} on your system, get it today.
  75. \sec{Using dvips}
  76. To use \.{dvips}, simply type
  77. \cmd{localhost> dvips foo}
  78. \noindent
  79. where \.{foo.dvi} is the output of \TeX\ that you want to print.  If \.{dvips}
  80. has been installed correctly, the document should come out of your default
  81. printer.
  82. If you use fonts that have not been used on your system before, they
  83. may be automatically generated; this process can take a few minutes.
  84. The next time that document is printed, these fonts will already exist, so
  85. printing will go much faster.
  86. Many options are available; they are described in a later section.
  87. For a brief summary of available options, just type
  88. \cmd{localhost> dvips}
  89. \sec{Paper Size and Landscape Mode}
  90. Most \TeX\ documents at a particular site are designed to use the
  91. standard paper size (for example, letter size in the United States
  92. or A4 in Europe.)  The \.{dvips} program defaults to these paper
  93. sizes and can be customized for the defaults at each site or on
  94. each printer.
  95. But many documents are designed for other paper sizes.  For instance,
  96. you may want to design a document that has the long edge of the
  97. \^{landscape}
  98. paper horizontal.  This can be useful when typesetting booklets,
  99. brochures, complex tables, or many other documents.  This type of
  100. paper orientation is called landscape orientation (the `normal'
  101. orientation is portrait).
  102. \^{portrait}
  103. Alternatively, a document might be designed for ledger or A3 paper.
  104. Since the intended paper size is a document design decision, and
  105. not a decision that is made at printing time, such information
  106. should be given in the \TeX\ file and not on the \.{dvips}
  107. command line.  For this reason, \.{dvips} supports a \.{papersize}
  108. special.  It is hoped that this special will become standard over
  109. time for \TeX\ previewers and other printer drivers.
  110. The format of the \.{papersize} special is
  111. \cmd{\ttbackslash special\char123papersize=8.5in,11in\char125}
  112. \noindent
  113. where the dimensions given above are for a standard letter sheet.
  114. The first dimension given is the horizontal size of the page, and
  115. the second is the vertical size.  The dimensions supported are
  116. the same as for \TeX; namely, in (inches), cm (centimeters), mm
  117. (millimeters), pt (points), sp (scaled points), bp (big points, the
  118. same as the default PostScript unit), pc (picas), dd (didot points),
  119. and cc (ciceros).
  120. For a landscape document, the \.{papersize} comment would be given as
  121. \cmd{\ttbackslash special\char123papersize=11in,8.5in\char125}
  122. \noindent
  123. An alternate specification of \.{landscape} is to have a special
  124. of the form
  125. \cmd{\ttbackslash special\char123landscape\char125}
  126. \noindent
  127. This is supported for backward compatibility, but it is hoped that
  128. eventually the \.{papersize} comment will dominate.
  129. Of course, using such a command only informs \.{dvips} of the desired
  130. paper size; you must still adjust the \.{hsize} and \.{vsize} in your
  131. \TeX\ document to actually use the full page.
  132. The {\tt papersize} special must occur somewhere on the first page of the
  133. document.
  134. The {\tt dvips} default landscape configuration is presently as though
  135. the paper were rotated ninety degrees counterclockwise; this seems
  136. to be the convention adopted by previewers that the author is
  137. familiar with.  If for some reason you need your landscape orientation
  138. to be rotated clockwise, simply include at the top of your \TeX\ file
  139. or in some included macro file
  140. \cmd{\ttbackslash special\char123! /landplus90 true store\char125}
  141. \noindent
  142. to set this orientation.  Alternatively, you can change the default
  143. value of {\tt landplus90} in the {\tt tex.lpro} file before
  144. compilation, or include a header file that just includes the
  145. definition {\tt /landplus90 true store}.
  146. \sec{Including PostScript Graphics}
  147. Scaling and including PostScript graphics is a breeze---if the PostScript
  148. \^{graphics}
  149. \^{PostScript graphics}
  150. file is correctly formed.  Even if it is not, however, the file can usually
  151. be accommodated with just a little more work.  The most important feature of
  152. a good PostScript file---from the standpoint of including it in another
  153. document---is an accurate bounding box comment.
  154. \sub{The Bounding Box Comment}
  155. Every well-formed PostScript file has a comment describing where on the
  156. \^{bounding box}
  157. page the graphic is located, and how big that graphic is.  This information
  158. is given in terms of the lower left and upper right corners of a box just
  159. enclosing the graphic, and is thus referred to as a bounding box.
  160. These coordinates are given
  161. in PostScript units (there are precisely 72 PostScript units to
  162. the inch) with respect to the lower left corner of the sheet of paper.
  163. To see if a PostScript file has a bounding box comment, just
  164. look at the first few lines of the file.
  165. (PostScript is standard ASCII, so you can use any text editor to do this.)
  166. If within the first few dozen lines there is a line of the form
  167. \cmd{\%\%BoundingBox:\ 0 1 2 3}
  168. \noindent
  169. (with any numbers), chances are very good that the file is Encapsulated
  170. PostScript and will work easily with \.{dvips}.  If the file contains
  171. instead a line like
  172. \cmd{\%\%BoundingBox:\ (atend)}
  173. \noindent
  174. the file is still probably Encapsulated PostScript, but the bounding
  175. box (that \.{dvips} needs to position the graphic) is at the end of the
  176. file and should be moved to the position of the line above.  This can be
  177. done with that same text editor, or with a simple Perl script.
  178. If the document lacks a bounding box altogether, one can easily be added.
  179. Simply print the file.  Now, take a ruler, and make the following measurements.
  180. All measurements should be in PostScript units, so measure it in inches and
  181. multiply by 72.  Alternatively, the {\tt bbfig} program distributed with
  182. {\tt dvips} in the {\tt contrib} directory can be used to automate
  183. this process.
  184. From the left edge of the paper to the leftmost mark on the paper is
  185. {\it llx}, the first number.  From the bottom edge of the paper to the
  186. bottommost mark on the paper is {\it lly}, the second number.  From
  187. the left edge of the paper to the rightmost mark on the paper is
  188. {\it urx}, the third number.  The fourth and final number, {\it ury}, is
  189. the distance from the bottom of the page to the uppermost mark on the
  190. paper.
  191. Now, add a comment of the following form as the second line of the document.
  192. (The first line should already be a line starting with the two
  193. characters `{\tt \%!}'; if it is not, the file probably isn't PostScript.)
  194. \cmd{\%\%BoundingBox:\ {\it llx lly urx ury}}
  195. \noindent
  196. Or, if you don't want to modify the file, you can simply write these
  197. numbers down in a convenient place and use them when you import the
  198. graphic.
  199. If the document does not have such a bounding box, or if the bounding box
  200. is given at the end of the document, please complain to the authors of the
  201. software package that generated the file; without such a line, including
  202. PostScript graphics can be tedious.
  203. \sub{Using the EPSF Macros}
  204. Now you are ready to include the graphic into a \TeX\ file.  Simply add to
  205. \^{{\tt epsf} macros}
  206. the top of your \TeX\ file a line like
  207. \cmd{\ttbackslash input epsf}
  208. \noindent
  209. (or, if your document is in La\TeX\ or Sli\TeX, add the \.{epsf} style
  210. option, as was done to the following line).
  211. \cmd{\ttbackslash documentstyle[12pt,epsf]\char123article\char125}
  212. \noindent
  213. This only needs to be done once, no matter how many figures you plan to
  214. include.  Now, at the point you want to include the file, enter a line
  215. such as
  216. \cmd{\ttbackslash epsffile\char123foo.ps\char125}
  217. \noindent
  218. If you are using La\TeX\ or Sli\TeX, you may need to add a
  219. \.{\ttbackslash leavevmode} command immediately before the
  220. \^{{\tt leavevmode}}
  221. \.{\ttbackslash epsffile} command to get certain environments to work
  222. correctly.  If your file did not (or does not currently) have a bounding
  223. box comment, you should supply those numbers you wrote down as in the
  224. following example:
  225. \cmd{\ttbackslash epsffile[100 100 500 500]\char123foo.ps\char125}
  226. \noindent
  227. (in the same order they would have been in a normal bounding box comment).
  228. Now, save your changes and run \TeX\ and \.{dvips}; the output should
  229. have your graphic positioned at precisely the point you indicated, with the
  230. proper amount of space reserved.
  231. The effect of the \.{\ttbackslash epsffile} macro is to typeset the figure
  232. as a \TeX\ \.{\ttbackslash vbox} at the point of the page that the command
  233. is executed.  By default, the graphic will have its
  234. `natural' width (namely, the width of its bounding box).
  235. The \TeX\ box will have depth zero and a `natural' height.
  236. The graphic will be scaled by any \.{dvi} magnification in effect at the
  237. \^{magnification}
  238. time.
  239. Any PostScript graphics included by any method in this document (except
  240. \^{{\tt bop-hook}}
  241. \.{bop-hook} and its ilk) are scaled by the current \.{dvi} magnification.
  242. For graphics included with \.{\ttbackslash epsffile} where the size is given
  243. in \TeX\
  244. dimensions, this scaling will produce the correct, or expected, results.
  245. For compatibility with old PostScript drivers, it is possible to turn
  246. \^{{\tt magscale}}
  247. this scaling off with the following \TeX\ command:
  248. \cmd{\ttbackslash special\char123! /magscale false def\char125}
  249. \noindent
  250. Use of this command is not recommended because it will make the
  251. \.{\ttbackslash epsffile} graphics the wrong size if global
  252. magnification is used
  253. in a \.{dvi} document, and it will cause any PostScript graphics to
  254. appear improperly scaled and out of position if a \.{dvi} to \.{dvi}
  255. program is used to scale or otherwise modify the document.
  256. You can enlarge or reduce the figure by putting
  257. \cmd{\ttbackslash epsfxsize=<dimen>}
  258. \noindent
  259. right before the call to \.{\ttbackslash epsffile}.
  260. Then the width of the \TeX\ box will be \.{<dimen>} and its
  261. height will be scaled proportionately.  Alternatively you can force the
  262. \^{{\tt epsfxsize}}
  263. vertical size to a particular size with
  264. \cmd{\ttbackslash epsfysize=<dimen>}
  265. \noindent
  266. in which case the height will be set and the width will be scaled
  267. proportionally.  If you set both, the aspect ratio of the included
  268. graphic will be distorted but both size specifications will be
  269. honored.
  270. By default, clipping is disabled for included EPSF images.  This is
  271. because clipping to the bounding box dimensions often cuts off a
  272. small portion of the figure, due to slightly inaccurate bounding
  273. box arguments.  The problem might be subtle; lines around the boundary
  274. of the image might be half their intended width, or the tops or
  275. bottoms of some text annotations might be sliced off.  If you want to
  276. turn clipping on, just use the command
  277. \cmd{\ttbackslash epsfclipon}
  278. \noindent
  279. and to turn clipping back off, use
  280. \cmd{\ttbackslash epsfclipoff}
  281. A more general facility for sizing is available by defining the
  282. \.{\ttbackslash epsfsize} macro.   You can redefine this macro
  283. \^{{\tt epsfsize}}
  284. to do almost anything.  This \TeX\ macro is passed two parameters
  285. by \.{\ttbackslash epsffile}.  The first parameter is the natural
  286. horizontal size of
  287. the PostScript graphic, and the second parameter is the natural vertical
  288. size.  This macro is responsible for returning the desired horizontal size of
  289. the graph (the same as assigning \.{\ttbackslash epsfxsize} above).
  290. In the definitions given below, only the body is given; it should be inserted
  291. \cmd{\ttbackslash def\ttbackslash epsfsize\#1\#2\char123{\it body}\/\char125}
  292. \noindent
  293. Some common definitions are:
  294. {\options
  295. \.{\ttbackslash epsfxsize}
  296. This definition (the default) enables the default features listed above,
  297. by setting \.{\ttbackslash epsfxsize} to the same value it had before
  298. the macro was called.
  299. \.{0pt}
  300. This definition forces natural sizes for all graphics by setting the width to
  301. zero, which turns on horizontal scaling.
  302. \.{\#1}
  303. This forces natural sizes too, by returning the first parameter only
  304. (the natural width) and setting the width to it.
  305. \.{\ttbackslash hsize}
  306. This forces all graphics to be scaled so they are as wide as the current
  307. horizontal size.  (In La\TeX, use \.{\ttbackslash textwidth} instead
  308. of \.{\ttbackslash hsize}.)
  309. \.{0.5\#1}
  310. This scales all figures to half of their natural size.
  311. \.{\ttbackslash ifdim\#1>\ttbackslash hsize\ttbackslash hsize\ttbackslash
  312. else\#1\ttbackslash fi}
  313. This keeps graphics at their natural size, unless the width would be wider
  314. than the current \.{\ttbackslash hsize}, in which case the graphic is
  315. scaled down to \.{\ttbackslash hsize}.\par}
  316. If you want \TeX\ to report the size of the figure as a message
  317. on your terminal when it processes each figure, give the command
  318. \cmd{\ttbackslash epsfverbosetrue}
  319. \sub{Header Files}
  320. Often in order to get a particular graphic file to work, a certain header
  321. \^{header}
  322. file might need to be sent first.  Sometimes this is even desirable, since
  323. the size of the header macros can dominate the size of certain PostScript
  324. graphics files.  The \.{dvips} program provides support for this with the
  325. \.{header=} special command.  For instance, to ensure that \.{foo.ps}
  326. gets downloaded as part of the header material, the following command
  327. should be added to the \TeX\ file:
  328. \cmd{\ttbackslash special\char123header=foo.ps\char125}
  329. \noindent
  330. The dictionary stack will be at the \.{userdict} level when these header
  331. files are included.
  332. For these and all other header files (including the headers required
  333. by \.{dvips} itself and any downloaded fonts), the printer VM budget is
  334. debited by some value.  If the header file has, in its first 1024 bytes,
  335. a line of the form
  336. \cmd{\%\%VMusage: {\it min} {\it max}}
  337. \noindent
  338. then the maximum value is used.  If it doesn't, then the total size of
  339. the header file in bytes is used as an approximation of the memory
  340. requirements.
  341. \sub{Literal PostScript}
  342. For simple graphics, or just for experimentation, literal PostScript
  343. \^{literal PostScript}
  344. graphics can be included.  Simply use a special command that starts with
  345. a double quote ({\tt"}).
  346. For instance, the following (simple) graphic:
  347. \vskip\baselineskip
  348. \vbox to 100bp{\vss % a bp is the same as a PostScript unit
  349. \special{" newpath 0 0 moveto 100 100 lineto 394 0 lineto
  350. closepath gsave 0.8 setgray fill grestore stroke}}
  351. \noindent
  352. was created by typing:
  353. \cmd{\ttbackslash vbox to 100bp\char123\ttbackslash vss
  354.  \% a bp is the same as a PostScript unit\\
  355. \ttbackslash special\char123" newpath 0 0 moveto 100 100 lineto 394 0 lineto\\
  356. closepath gsave 0.8 setgray fill grestore stroke\char125\char125}
  357. \noindent
  358. (Note that you are responsible for leaving space for such literal graphics.)
  359. Literal graphics are discouraged because of their nonportability.
  360. \sub{Literal Headers}
  361. Similarly, you can define your own macros for use in such literal graphics
  362. through the use of literal macros.  Literal macros are defined just like
  363. literal graphics, only you begin the special with an exclamation point
  364. instead of a double quote.  These literal macros are included as part of the
  365. header material in a special dictionary called \.{SDict}.  This dictionary
  366. \^{{\tt SDict}}
  367. is the first one on the PostScript dictionary stack when any PostScript
  368. graphic is included, whether by literal inclusion or through the
  369. \.{\ttbackslash epsffile} macros.
  370. \sub{Other Graphics Support}
  371. There are other ways to include graphics with \.{dvips}.  One is to use an
  372. \^{obsolete}
  373. existing package, such as \.{emtex}, \.{psfig}, \.{tpic}, or \.{METAPOST},
  374. all supported by \.{dvips}.
  375. Other facilities are available for historical reasons, but their use is
  376. discouraged, in hope that some `sane' form of PostScript inclusion shall
  377. become standard.  Note that the main advantage of the
  378. \.{\ttbackslash epsffile} macros
  379. is that they can be adapted for whatever form of special eventually becomes
  380. standard, and thus only minor modifications to that one file need to be
  381. made, rather than revising an entire library of \TeX\ documents.
  382. Most of these specials use a flexible key and value scheme:
  383. \cmd{\ttbackslash special\char123psfile=filename.ps[key=value]*\char125}
  384. \noindent
  385. This will download the PostScript file called \.{filename.ps}
  386. such that the current point will be the origin of the PostScript
  387. \^{{\tt psfile}}
  388. coordinate system.  The optional key/value assignments allow you
  389. to specify transformations on the PostScript.
  390. The possible keys are:\vskip\baselineskip
  391. \centerline{\vbox{\halign{\tt#\hfil\quad&#\hfil\cr
  392. hoffset    &The horizontal offset (default 0)\cr
  393. voffset    &The vertical offset (default 0)\cr
  394. hsize    &The horizontal clipping size (default 612)\cr
  395. vsize    &The vertical clipping size (default 792)\cr
  396. hscale    &The horizontal scaling factor (default 100)\cr
  397. vscale    &The vertical scaling factor (default 100)\cr
  398. angle    &The rotation (default 0)\cr
  399. clip    &Enable clipping to the bounding box\cr}}}
  400. The dimension parameters are all given in PostScript units.
  401. The \.{hscale} and \.{vscale} are given in non-dimensioned percentage
  402. units, and the rotation value is specified in degrees.
  403. \cmd{\ttbackslash special\char123psfile=foo.ps hoffset=72 hscale=90
  404. vscale=90\char125}
  405. \noindent
  406. will shift the graphics produced by file \.{foo.ps} right by one inch
  407. and will draw it at 0.9 times normal size.
  408. Offsets are given relative to the point of the special command, and are
  409. unaffected by scaling or rotation.  Rotation is counterclockwise about the
  410. origin.  The order of operations is to rotate the figure,
  411. scale it, then offset it.
  412. For compatibility with older PostScript drivers, it is possible to change
  413. the units that \.{hscale} and \.{vscale} are given in.  This can be
  414. done by redefining \.{@scaleunit}
  415. \^{{\tt scaleunit}}
  416. in \.{SDict}
  417. \^{{\tt SDict}}
  418. by a \TeX\ command such as
  419. \cmd{\ttbackslash special\char123! /@scaleunit 1 def\char125}
  420. \noindent
  421. The \.{@scaleunit} variable, which is by default 100, is what \.{hscale}
  422. and \.{vscale} are divided by to yield an absolute scale factor.
  423. All of the methods for including graphics we have described
  424. so far enclose the graphic in
  425. a PostScript save/restore pair, guaranteeing that the figure will have
  426. no effect on the rest of the document.
  427. Another type of special command allows literal PostScript instructions to be
  428. inserted without
  429. enclosing them in this protective shield; users of this feature
  430. are supposed to understand what they are doing (and they shouldn't change
  431. the PostScript graphics state unless they are willing to take the
  432. consequences).  This command can take many forms, because it has had a
  433. tortuous history; any of the following will work:
  434. \cmd{\ttbackslash special\char123ps:{\it text}\char125\\
  435. \ttbackslash special\char123ps::{\it text}\char125\\
  436. \ttbackslash special\char123ps::[begin]{\it text}\char125\\
  437. \ttbackslash special\char123ps::[end]{\it text}\char125}
  438. \noindent
  439. (with longer forms taking precedence over shorter forms, when they are used).
  440. Note that {\tt ps::} and {\tt ps::[end]} do not do any positioning, so
  441. they can be used to continue PostScript literals started with {\tt ps:}
  442. or {\tt ps::[begin]}.  There is also the command
  443. \cmd{\ttbackslash special\char123ps:\ plotfile filename\char125}
  444. \noindent
  445. which will copy the commands from \.{filename}
  446. verbatim into the output (but omitting lines that begin with \%).
  447. An example of the proper use of literal specials can be found in the file
  448. \.{rotate.tex} which makes it easy to typeset text turned 90 degrees.
  449. To finish off this section, the following examples are presented without
  450. explanation:
  451. {\vskip0pt\parskip=0pt\begverb{`\$}
  452. \def\rotninety{\special{ps:currentpoint currentpoint translate 90
  453. rotate neg exch neg exch translate}}\font\huge=cmbx10 at 14.4truept
  454. \setbox0=\hbox to0pt{\huge A\hss}\vskip16truept\centerline{\copy0
  455. \special{ps:gsave}\rotninety\copy0\rotninety\copy0\rotninety
  456. \box0\special{ps:grestore}}\vskip16truept$endverb}
  457. \smallskip
  458. {\def\rotninety{\special{ps:currentpoint currentpoint translate 90
  459. rotate neg exch neg exch translate}}\font\huge=cmbx10 at 14.4truept
  460. \setbox0=\hbox to0pt{\huge A\hss}\vskip16truept\centerline{\copy0
  461. \special{ps:gsave}\rotninety\copy0\rotninety\copy0\rotninety
  462. \box0\special{ps:grestore}}\vskip16truept}
  463. \smallskip
  464. {\vskip0pt\parskip=0pt\begverb{`\$}
  465. \vbox to 2truein{\special{ps:gsave 0.3 setgray}\hrule height 2in
  466. width\hsize\vskip-2in\special{ps:grestore}\font\big=cminch\big
  467. \vss\special{ps:gsave 1 setgray}\vbox to 0pt{\vskip2pt
  468. \line{\hss\hskip4pt NEAT\hss}\vss}\special{ps:0 setgray}%
  469. \hbox{\raise2pt\line{\hss NEAT\hss}\special{ps:grestore}}\vss}$endverb}
  470. \smallskip
  471. \vbox to 2truein{\special{ps:gsave 0.3 setgray}\hrule height 2in
  472. width\hsize\vskip-2in\special{ps:grestore}\font\big=cminch\big
  473. \vss\special{ps:gsave 1 setgray}\vbox to 0pt{\vskip2pt
  474. \line{\hss\hskip4pt NEAT\hss}\vss}\special{ps:0 setgray}%
  475. \hbox{\raise2pt\line{\hss NEAT\hss}\special{ps:grestore}}\vss}
  476. Some caveats are in order when using the above forms.  Make sure that
  477. each \.{gsave} on a page is matched with a \.{grestore} on the same
  478. page.  Do not use \.{save} or \.{restore}.  Use of these macros can
  479. interact with the PostScript generated by \.{dvips} if care is not
  480. taken; try to understand what the above macros are doing before
  481. writing your own.  The \.{\ttbackslash rotninety} macro especially has
  482. a useful trick that appears again and again.
  483. \sub{Dynamic Creation of PostScript Graphics Files}
  484. PostScript is an excellent page description language---but it does
  485. tend to be rather verbose.  Compressing PostScript graphics files can
  486. often reduce them by more than a factor of five.  For this reason,
  487. if the filename parameter to one of the graphics inclusion techniques
  488. starts with a backtick ({\tt`}), the filename is instead interpreted
  489. as a command to execute that will send the actual file to standard
  490. output.  Thus,
  491. \cmd{\ttbackslash special\char123psfile="`zcat foo.ps.Z"\char125}
  492. \noindent
  493. will include the uncompressed version of \.{foo.ps}.  Since such a
  494. command is not accessible to \TeX, if you use this facility with
  495. the \.{EPSF} macros, you need to supply the bounding box parameter
  496. yourself, as in
  497. \cmd{\ttbackslash epsffile[72 72 540 720]\char123
  498.    "`zcat screendump.ps.Z"\char125}
  499. \noindent
  500. to include \.{screendump.ps}.  Of course, the commands to be executed can
  501. be anything, including using a file conversion utility such as \.{tek2ps}
  502. or whatever is appropriate.
  503. This extension is not portable to other \.{dvi2ps} programs.  Yet.
  504. \sec{Using PostScript Fonts}
  505. Thanks to Donald~E.~Knuth,
  506. \^{Knuth, Donald E.}
  507. the \.{dvips} driver now supports PostScript fonts
  508. \^{PostScript fonts}
  509. through the virtual font capability.
  510. PostScript fonts are (or should be) accompanied by a font metric file
  511. such as \.{Times-Roman.afm},
  512. which describes characteristics of a font called Times-Roman.
  513. \^{{\tt afm}}
  514. To use such fonts with \TeX, we need \.{tfm} files that contain similar
  515. \^{{\tt tfm}}
  516. information. These can be generated from \.{afm} files
  517. by running the program \.{afm2tfm}, supplied with \.{dvips}.
  518. \^{{\tt afm2tfm}}
  519. This program also creates virtual fonts with which you can use normal
  520. plain \TeX\ conventions.
  521. Note that non-resident downloaded PostScript fonts tend to use a
  522. great deal of printer virtual memory.  PostScript printers typically
  523. have between 130,000 and 400,000 bytes of available virtual memory;
  524. each downloaded font will require approximately 30,000 bytes of
  525. that.  For many applications, bitmapped fonts work much better,
  526. even at typesetter resolutions (with the \.{-Z} option.)
  527. Even resident PostScript fonts can take a fair amount of memory,
  528. but less with this release of \.{dvips} than previously.  Also,
  529. bitmapped fonts tend to image faster than PostScript fonts.
  530. \sub{The afm2tfm Program}
  531. The \.{afm2tfm} program can convert an Adobe \.{afm} file into a `raw'
  532. \TeX\ \.{tfm} file with the command
  533. \cmd{localhost> afm2tfm Times-Roman rptmr}
  534. \noindent
  535. (You should run this from in a directory where \.{Times-Roman.afm} resides.)
  536. The output file \.{rptmr.tfm} is `raw' because it does no character remapping;
  537. it simply converts the character information on a one-to-one basis to \TeX\
  538. characters {\it with the same code}. The name \.{rptmr} stands for
  539. Resident PostScript Times Roman; section~6 below explains more about
  540. a proposed scheme for font names.
  541. In the following examples, we will use the font Times-Roman to
  542. illustrate the conversion process.  For the standard 35 LaserWriter
  543. fonts, however, it is highly recommended that you use the supplied
  544. \.{tfm} and \.{vf} files that come with \.{dvips} (usually in a
  545. file called \.{dvipslib.tar.Z}), as these files contain some additional
  546. changes that make them work better with \TeX\ than they otherwise
  547. would.
  548. PostScript fonts have a different encoding scheme from that of plain
  549. \TeX. Although both schemes are based on ASCII, special characters such as
  550. ligatures and accents are handled quite differently. Therefore we obtain
  551. \^{ligature}
  552. \^{accents}
  553. \^{virtual fonts}
  554. best results by using a `virtual font' interface, which makes \TeX\ act
  555. as if the PostScript font had a standard \TeX\ encoding. Such a virtual
  556. font can be obtained, for example, by the command
  557. \cmd{localhost> afm2tfm Times-Roman -v ptmr rptmr}
  558. \noindent
  559. This produces two outputs, namely the `virtual property list' file
  560. \.{ptmr.vpl}, and the \TeX\ font metric file \.{rptmr.tfm}.
  561. The latter file describes an `actual font' on which the virtual font is based.
  562. To use the font in \TeX, you should first run
  563. \cmd{localhost> vptovf ptmr.vpl ptmr.vf ptmr.tfm}
  564. \noindent
  565. and then install the virtual font file \.{ptmr.vf} in the virtual font
  566. directory (by default, \.{/usr/lib/tex/fonts/vf}) and install \.{ptmr.tfm}
  567. and \.{rptmr.tfm} in the directory for \TeX\ font metrics (by default,
  568. \.{/usr/lib/tex/fonts/tfm}).  (This probably has already been done for you for
  569. the most common PostScript fonts.)
  570. You can also make more complex virtual fonts by editing
  571. \.{ptmr.vpl} before running \.{vptovf}; such editing might add the uppercase
  572. Greek characters in the standard \TeX\ positions, for instance.
  573. Once this has been done, you're all set. You can use
  574. code like this in \TeX\ henceforth:
  575. \cmd{\ttbackslash font\ttbackslash myfont=ptmr at 10pt\\
  576. \ttbackslash myfont Hello, I am being typeset in Times-Roman.}
  577. Note that there are two fonts, one actual (`rptmr',
  578. which is analogous to a raw piece of hardware) and one virtual
  579. (`ptmr', which has typesetting know-how added). You could also say
  580. \cmd{\ttbackslash font\ttbackslash TR=rptmr at 10pt}
  581. \noindent
  582. and typeset directly with that, but then you would have no ligatures
  583. \^{ligature}
  584. or kerning, and you would have to use Adobe
  585. \^{kerning}
  586. character positions for special letters like \AE. The virtual font
  587. called \.{ptmr} not only has ligatures and kerning, and most of the
  588. standard accent conventions of \TeX, it also has a few additional
  589. features not present in the Computer Modern fonts. For example, it
  590. includes all the Adobe characters (such as the Polish ogonek and the
  591. French guillemots).  The only things you lose from ordinary \TeX\ text
  592. fonts are the dotless j (which can be hacked into the VPL file with
  593. literal PostScript specials if you have the patience) and uppercase
  594. Greek letters (which just don't exist unless you buy them separately).
  595. Experts may refer to Donald E.~Knuth article in {\it TUGboat} v. 11,
  596. no. 1, Apr. 1990, pp. 13--23.  ``Virtual Fonts: More Fun for Grand
  597. Wizards.''
  598. When \.{dvips} goes to use a font, it first checks to see if it is one of
  599. the fonts listed in a file called \.{psfonts.map}.  If it is mentioned in
  600. \^{{\tt psfonts.map}}
  601. that file, then it is assumed that the font is a resident PostScript font
  602. and can be found with the PostScript \.{findfont} operator.  This file
  603. resides by default in {\tt /usr/lib/tex/ps}, and consists of a single font
  604. per line.  Note that only the raw PostScript font names should be listed
  605. in this file; the \.{vf} fonts should not be, since they are automatically
  606. mapped to the raw PostScript fonts by the virtual font machinery.
  607. The supplied \.{psfonts.map} file defines the most common PostScript fonts.
  608. As much as possible, the PostScript fonts follow plain \TeX\ conventions
  609. for accents.  The two exceptions to this are the Hungarian umlaut (which
  610. is at position {\tt 0x7D} in {\tt cmr10}, but position {\tt 0xCD} in
  611. {\tt ptmr}) and the dot accent (at positions {\tt 0x5F} and {\tt 0xC7},
  612. respectively).  In order to use these accents with PostScript fonts or in
  613. math mode when {\tt \char92 textfont0} is a PostScript font, you will need
  614. to use the following definitions.  Note that these definitions will not work
  615. with normal \TeX\ fonts for the relevant accents; note also that these
  616. definitions are already part of the distributed \.{psfonts.sty}.
  617. In addition, the \.{\char92 AA} that is used to typeset the \AA\ character
  618. must be modified as shown.
  619. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  620. \def\H#1{{\accent"CD #1}}\def\.#1{{\accent"C7 #1}}
  621. \def\dot{\mathaccent"70C7 }
  622. \newdimen\aadimen
  623. \def\AA{\leavevmode\setbox0\hbox{h}\aadimen\ht0
  624.   \advance\aadimen-1ex\setbox0\hbox{A}\rlap{\raise.67\aadimen
  625.   \hbox to \wd0{\hss\char'27\hss}}A}$endverb}
  626. These PostScript fonts can be scaled to any size.  Go wild!
  627. Note, however, that using PostScript fonts does
  628. use up a great deal of the printer's virtual memory and it does take time.
  629. \^{memory}
  630. You may find downloading the Computer Modern bitmapped fonts to be
  631. faster than using the built-in PostScript fonts.
  632. \sub{Changing a Font's Encoding}
  633. The \.{afm2tfm} program also allows you to specify a different encoding
  634. for a PostScript font.  This should only be done by wizards.
  635. This can be done at two levels.
  636. You can specify a different output encoding with \.{-o}. This only
  637. applies when you are building a virtual font, and it tells \.{afm2tfm}
  638. to attempt to remap the font to match the output encoding as closely
  639. as possible.  In such an output encoding, you can also specify
  640. ligature pairs and kerning information that will be used in addition
  641. to the information in the \.{afm} file.  This will be the most common
  642. re-encoding required, since the only thing that changes is the \.{vf}
  643. file (and its associated \.{tfm} file) and since most everything you
  644. would want to do can be done with this method.
  645. You can also specify a different PostScript encoding with \.{-p}.  This
  646. option affects the generation of both the raw \.{tfm} file and the
  647. virtual \.{vf} and \.{tfm} files, and it also requires that the
  648. encoding file be available to be downloaded as part of every
  649. PostScript document produced that uses this font.  But this is the
  650. only way to access characters in a PostScript font that are neither
  651. encoded in the \.{afm} file nor built from other characters
  652. (constructed characters.)  For instance, \.{Times-Roman} contains the
  653. extra characters \.{registered} and \.{thorn} (among others) that
  654. can only be accessed through such a PostScript reencoding.  Any ligature
  655. or kern information specified in the PostScript encoding is ignored by
  656. \.{afm2tfm}.
  657. The format of the encoding files is simple---it is precisely the same
  658. format that is used to define an encoding vector in PostScript!  For
  659. this reason, the same file can be used as a PostScript or \TeX\
  660. encoding file for \.{afm2tfm} as well as downloaded to the printer as
  661. part of a document that uses a reencoded font.
  662. The specific format that \.{afm2tfm} accepts is one of the following
  663. form:
  664. {\vskip0pt\parskip=0pt\begverb{`\\}
  665. % comments are mostly ignored; more on this later
  666. /MyEncoding [ /Alpha /Beta /Gamma /Delta ...
  667.      /A /B ... /Z % exactly 256 entries, each with a / at the front
  668.      /wfooaccent /xfooaccent /yfooaccent /zfooaccent ] def
  669. \endverb}
  670. Comments, which start with a percent sign and continue until the
  671. end of the current line, are mostly ignored.  The first `word' of
  672. the file must start with a forward slash (a PostScript literal
  673. name) and is used as the name of the encoding.  The next word must
  674. be an open bracket.  Following that must be precisely 256 character
  675. names; use {\tt /.notdef} for any that you do not want to define.
  676. Finally, there must be a close bracket.  The final token is usually
  677. {\tt def}, but this is not enforced.  Note that all names are
  678. case sensitive.
  679. Any ligature or kern information is given in the comments.  As each
  680. comment is encountered, it is examined.  If the first word after the
  681. percent sign is {\tt LIGKERN}, exactly, then the entire rest of the
  682. line is parsed for ligature and kern information.  This ligature and
  683. kern information is given in groups of words, each group of which must
  684. be terminated by a semicolon (with a space before and after it, unless
  685. it occurs on the end of a line.)
  686. In these {\tt LIGKERN} statements, three types of information may be
  687. specified.  These three types are ligature pairs, kerns to remove or
  688. ignore, and the character value of this font's boundary character.
  689. Which of the types the particular set of words corresponds to is
  690. automatically determined by the allowable syntax.
  691. Throughout the {\tt LIGKERN} section, the boundary character is
  692. specified as {\tt ||}.
  693. To set the boundary character value, a command such as
  694. {\tt || = 39 ;} must be used.
  695. To indicate a kern to remove, give the names of the two characters
  696. (without the leading slash) separated by {\tt \char123\char125}, as in
  697. {\tt one \char123\char125\ one ;}.  This is similar to the way you
  698. might use {\tt \char123\char125} in a \TeX\ file to turn off ligatures
  699. or kerns at a particular location.  Either or both of the character
  700. names can be given as {\tt *}, which is a wild card matching any
  701. character; thus, all kerns can be removed with {\tt *
  702. \char123\char125\ * ;}.
  703. To specify a ligature, specify the names of the pair of characters,
  704. followed by the ligature `operation' (as in \MF), followed by the
  705. replacing character name.  Either (but not both) of the first two
  706. characters can be {\tt ||} to indicate a word boundary.
  707. Normally the `operation' is {\tt =:}
  708. meaning that both characters are removed and replaced by the
  709. third character, but by adding {\tt |} characters on either side of
  710. the {\tt =:}, you can specify which of the two leading characters to
  711. retain.  In addition, by suffixing the ligature operation with one
  712. or two {\tt >} signs, you can indicate that the ligature scanning
  713. operation should skip that many characters before proceeding.  This
  714. works just like in \MF.  A typical ligature might be specified with
  715. {\tt ff i =:{} ffi ;}.  A more convoluted ligature is
  716. {\tt one one |=:|>> exclam ;} which indicates that every pair of
  717. adjacent {\tt 1}'s should be separated by an exclamation point,
  718. and then two of the resulting characters should be skipped over
  719. before continuing searching for ligatures and kerns.  You cannot
  720. give more {\tt >}'s in an ligature operation as you did {\tt |},
  721. so there are a total of eight possible ligature operations:
  722. \cmd{=: |=: |=:> =:| =:|> |=:| |=:|> |=:|>>}
  723. \noindent
  724. The default set of ligatures and kerns built in to \.{afm2tfm} can
  725. be specified with:
  726. {\vskip0pt\parskip=0pt\begverb{`\\}
  727. % LIGKERN space l =: lslash ; space L =: Lslash ;
  728. % LIGKERN question quoteleft =: questiondown ;
  729. % LIGKERN exclam quoteleft =: exclamdown ;
  730. % LIGKERN hyphen hyphen =: endash ; endash hyphen =: emdash ;
  731. % LIGKERN quoteleft quoteleft =: quotedblleft ;
  732. % LIGKERN quoteright quoteright =: quotedblright ;
  733. % LIGKERN space {} * ; * {} space ; zero {} * ; * {} zero ;
  734. % LIGKERN one {} * ; * {} one ; two {} * ; * {} two ;
  735. % LIGKERN three {} * ; * {} three ; four {} * ; * {} four ;
  736. % LIGKERN five {} * ; * {} five ; six {} * ; * {} six ;
  737. % LIGKERN seven {} * ; * {} seven ; eight {} * ; * {} eight ;
  738. % LIGKERN nine {} * ; * {} nine ;
  739. \endverb}
  740. \sub{Special Effects}
  741. Special effects are also obtainable, with commands such as
  742. \cmd{localhost> afm2tfm Times-Roman -s .167 -v ptmro rptmro}
  743. \noindent
  744. which create \.{ptmro.vpl} and \.{rptmro.tfm}.
  745. To use this, proceed as above but put the line
  746. \cmd{rptmro Times-Roman ".167 SlantFont"}
  747. \noindent
  748. into \.{psfonts.map}.  Then \.{rptmro} (our name for an obliqued Times)
  749. will act as if it were a
  750. \^{{\tt psfonts.map}}
  751. resident font, although it is actually constructed from Times-Roman
  752. by PostScript hackery.   (This oblique version of Times-Roman is obtained
  753. by slanting everything 1/6 to the right.)
  754. Similarly, you can get an expanded font by
  755. \cmd{localhost> afm2tfm Times-Roman -e 1.2 -v ptmrre rptmrre}
  756. \noindent
  757. and by recording the pseudo-resident font
  758. \cmd{rptmrre Times-Roman "1.2 ExtendFont"}
  759. \noindent
  760. in \.{psfonts.map}.
  761. You can also create a small caps font with a command such as
  762. \cmd{localhost> afm2tfm Times-Roman -V ptmrc rptmr}
  763. \noindent
  764. This is done strictly with a virtual font, however.  In addition,
  765. the font on which the small caps font is based (in this case
  766. {\tt rptmr} may already be created and installed, in which case no
  767. additional {\tt psfonts.map} entry is needed.
  768. In any case, you must give the appropriate name of the font that
  769. is not small caps as the base name (last parameter) to {\tt afm2tfm}.
  770. For instance, if you create a slanted small caps font, you must
  771. give the base name of the raw slanted font as that last parameter,
  772. not the base name of the unslanted font.
  773. By default, the {\tt -V} option uses a font scaled to 80\% for
  774. lower case.  If you specify the {\tt -c} option, you can change
  775. this scaling.
  776. If you change the PostScript encoding of a font, you must specify the
  777. input file as a header file, as well as give a reencoding
  778. command.  For instance, let us say we are using Times-Roman
  779. reencoded according to the encoding {\tt MyEncoding} (stored
  780. in the file {\tt myenc.enc}) as {\tt rptmrx}.  In this case,
  781. our {\tt psfonts.map} entry would look like
  782. \cmd{rptmrx Times-Roman "MyEncoding ReEncodeFont" <myenc.enc}
  783. The \.{afm2tfm} program prints out the precise line you need to
  784. add to \.{psfonts.map} to use that font, assuming the font is
  785. resident in the printer; if the font is not resident, you must
  786. add the header command to download the font yourself.  Note that
  787. each identical line only needs to be specified once in the
  788. {\tt psfonts.map} file, even though many different fonts (small
  789. caps variants, or ones with different output encodings) may be
  790. based on it.
  791. The command line switches to \.{afm2tfm} are:
  792. {\options
  793. \.{-e {\it ratio}}
  794. All characters are stretched horizontally by the stated ratio;
  795. \^{expanded fonts}
  796. if it is less than 1.0, you get a condensed font.
  797. \.{-c {\it scale}}
  798. If this option is given when creating a small caps font
  799. (with {\tt -V}), then the scaling for the `lower'
  800. case will be changed from the default 0.8 to the fraction
  801. given here.
  802. \.{-O}
  803. This option forces all character designations in the resultant
  804. {\tt vpl} file be given as octal values; this is useful for
  805. symbol or other special-purpose fonts where character names such
  806. as `A' have no meaning.
  807. \.{-p {\it file}}
  808. This specifies a file to use for the PostScript encoding of the
  809. font.  Note that this file must also be mentioned as a header
  810. file for the font in {\tt psfonts.map}, and that ligature
  811. and kern information in this file is ignored.
  812. \.{-s {\it slant}}
  813. All characters are slanted to the right by the stated slant;
  814. \^{slanted fonts}
  815. if it is negative, the letters slope to the left (or they might be
  816. upright if you start with an italic font).
  817. \.{-t {\it file}}
  818. This specifies a file to use for the target \TeX\ encoding of the
  819. font.  Ligature and kern information may also be specified in this
  820. file; the file is not needed once the \.{vf} file has been created.
  821. \.{-T {\it file}}
  822. This option specifies that {\it file} is to be used for both
  823. the PostScript and target \TeX\ encodings of the font.
  824. \.{-v {\it file}}
  825. Generate a virtual property list \.{vpl} file as well as a \.{tfm} file.
  826. \.{-V {\it file}}
  827. Same as \.{-v}, but the virtual font generated is a small caps font obtained
  828. by scaling uppercase letters by 0.8 to typeset lowercase. This font
  829. handles accented letters and retains proper kerning.\par}
  830. \sub{Non-Resident PostScript Fonts}
  831. If you want to use a non-printer-resident PostScript font for which you have
  832. a \.{pfb} or \.{pfa} file (an Adobe Type 1 font program),
  833. you can make it act like
  834. \^{{\tt pfb}}
  835. a resident font by putting a `{\tt <}' sign
  836. and the name of the \.{pfb} or \.{pfa} file just after the font name in the
  837. \.{psfonts.map}
  838. \^{{\tt psfonts.map}}
  839. file entry. For example,
  840. \cmd{rpstrn StoneInformal <StoneInformal.pfb}
  841. \noindent
  842. will cause \.{dvips} to include \.{StoneInformal.pfb} in your document as if
  843. it were a header file, whenever the pseudo-resident font StoneInformal is
  844. used in a document.   Similarly, you can generate transformed fonts and
  845. include lines like
  846. \cmd{rpstrc StoneInformal <StoneInformal.pfb ".8 ExtendFont"}
  847. \noindent
  848. in \.{psfonts.map}, in which case \.{StoneInformal.pfb} will be loaded
  849. whenever StoneInformal-Condensed is used. (Each header file is loaded
  850. at most once per PostScript file. The \.{pfb} files should be
  851. installed in the \.{dvips} header directory [usually {\tt
  852. /usr/lib/tex/ps}] with the other header files.)
  853. If you are using a {\tt pfb} file that has different PostScript
  854. encodings, you would need to
  855. multiple header files for that font in {\tt psfonts.map}.  If, for instance,
  856. {\tt StoneInformal} was both non-resident and you wanted to reencode
  857. it in PostScript with {\tt MyEncoding} stored in {\tt myenc.enc}, a line
  858. such as
  859. \vskip\baselineskip
  860. \centerline{\tt rpstrnx StoneInformal "MyEncoding ReEncodeFont" <myenc.enc
  861. <StoneInformal.pfb}
  862. When using such files, \.{dvips} is smart enough to unpack the standard
  863. binary \.{pfb} format into ASCII so there is no need to perform this
  864. conversion yourself.  In addition, it will scan the font to determine
  865. its memory usage, as it would for any header file.
  866. \sub{Font Aliases}
  867. Some systems don't handle files with long names well---MS-DOS is
  868. \^{MS-DOS}
  869. a notable example.  For this reason, \.{dvips} will accept an alias for such
  870. fonts.  Such an alias should be the first word in the \.{psfonts.map}
  871. line.  For instance, if we wanted the name \.{rptmr} to be used for the
  872. raw \.{Times-Roman} since our computer can't handle long names or,
  873. alternatively, we want to follow the standard naming conventions, we would use
  874. the following line in our
  875. \.{psfonts.map} file:
  876. \cmd{rptmr Times-Roman}
  877. \noindent
  878. The \.{tfm} file must have the name \.{rptmr.tfm}.
  879. \^{{\tt tfm}}
  880. The distribution file \.{adobe} contains a list of the short names that
  881. should be used for most Adobe fonts currently available.  Please reference
  882. this file when installing a new font and use the standard name.
  883. The parsing of the \.{psfonts.map}
  884. \^{{\tt psfonts.map}}
  885. file should be explained to eliminate all confusion.  If a line is
  886. empty or begins with a space, asterisk, semicolon, or hash mark, it is
  887. ignored.  Each remaining line is separated into words, where words are
  888. separated by spaces or tabs.  If a word begins with a double quote, it
  889. extends until the next double quote or the end of the line.  If a word
  890. starts with a less than character, it is treated as a font header file
  891. (or a downloaded PostScript font).  There can be more than one such
  892. header for a given font.  If a word starts with a double quote, it is
  893. a special instruction for generating that font.  Otherwise it is a
  894. name.  The first such name is always the name \TeX\ uses for the font
  895. and is also the name of the raw \.{tfm} file.  If there is another
  896. name word, that name is used as the PostScript name; if there is only
  897. one name word, it is used for both the \TeX\ name and the PostScript
  898. name.
  899. Note that \.{dvips} no longer registers the full PostScript name if an
  900. alias is given, so the single line
  901. \cmd{rptmr Times-Roman}
  902. \noindent
  903. would only allow \.{dvips} to find the \.{rptmr} font and not the
  904. \.{Times-Roman} font.
  905. \sec{Font Naming Conventions}
  906. {\def\journal#1{{\sl #1}}
  907. \def\table{\vbox\bgroup
  908. \vskip\parskip\halign\bgroup\strut\indent\tt ##\hfil\quad
  909.     &\vtop{%
  910.        \advance\hsize by -\parindent % The \indent in the first column.
  911.        \advance\hsize by -1em        % The \quad.
  912.        % One table has two-letter abbreviations.
  913.        \advance\hsize by -2\fontdimen7\tentt
  914.        \rm\noindent ##}\hfil
  915.     \cr}
  916. \def\setuphsize{%
  917.        \advance\hsize by -\parindent % The \indent in the first column.
  918.        \divide\hsize by 2            % double column
  919.        \advance\hsize by -1.5em      % The 3 \quads divided by 2.
  920.        % One table has two-letter abbreviations.
  921.        \advance\hsize by -2\fontdimen7\tentt}
  922. \def\dtable{\vbox\bgroup\vskip\parskip\halign\bgroup\strut
  923.     \indent##&\tt ##\hfil\quad
  924.     &\vtop{\setuphsize\rm\noindent ##}\hfil&\quad\tt ##\hfil\quad
  925.     &\vtop{\setuphsize\rm\noindent ##}\hfil\cr}
  926. \def\endtable{%
  927.   \egroup\egroup % End the \halign.
  928.   \smallskip % I don't know what kind of space you want, but it needs
  929.              %  something here.
  930. \def\entry#1#2{#1\cr}
  931. \def\mitem{\item{$\bullet$}}
  932. \def\\{\hfil\break}
  933. This section of the manual has been written by Karl Berry and
  934. specifies a standard for naming fonts for \TeX.  This standard has
  935. been adopted in \.{dvips}, and it is recommended that it be followed
  936. where possible.
  937. As more typeface families become available for use with \TeX, the need
  938. for a consistent, rational naming scheme for the font filenames
  939. concomitantly grows. Some (electronic) discussion has gone into the
  940. following proposal; I felt it was appropriate now to bring it before a
  941. wider community.  In some respects, it follows and simplifies
  942. Mittelbach and Sch\"opf's article in \journal{TUGboat}, volume~11,
  943. number~2 (June 1990).
  944. Here are some facts about fonts that went into the hopper when creating
  945. this proposal:
  946. \mitem \TeX\ runs on virtually all computers, under almost as many operating
  947. systems, all with their own idea of how files should be named.  Any
  948. proposal regarding filenames, therefore, must cater to the lowest common
  949. denominator.  That seems to be eight characters in length, not counting any
  950. extension, and with case being insignificant.  Characters other
  951. than letters and numerals are probably unusable.
  952. \mitem Most typefaces are offered by several vendors.  The version
  953. offered by vendor~A is not compatible with that of vendor~B.
  954. \mitem Typefaces typically come in different weights (hairline to extra
  955. heavy), different expansions (ultra condensed to wide), and an
  956. open-ended range of variants (italic, sans serif, typewriter,
  957. shadow,~$\ldots$).  No accepted standards exist for any of these
  958. qualities, nor are any standards ever likely to gain acceptance.
  959. \mitem The Computer Modern typeface family preserves traditional typesetting
  960. practice in at least one important respect: different sizes of the same
  961. font are not scaled linearly.  This is in contrast to most commercial fonts
  962. available.
  963. Here is how I propose to divide up the eight characters:
  964. \cmd{FTTWVEDD}
  965. \noindent
  966. where
  967. \mitem \.{F} represents the foundry that produced the font, and is omitted
  968. if there isn't one.
  969. \mitem \.{TT} represents the typeface name.
  970. \mitem \.W represents the weight.
  971. \mitem \.V represents the variant, and is omitted if both it and the
  972. expansion are ``normal''.
  973. \mitem \.E represents the expansion, and is omitted if it is ``normal''.
  974. \mitem \.{DD} represents the design size, and is omitted if the font is
  975. linearly scaled from a single {\tt tfm} file.
  976. See the section on virtual fonts (towards the end) for an exception to
  977. the above.
  978. The weight, variant, and expansion are probably all best taken from the
  979. original source of the typeface, instead of trying to relate them to
  980. some external standard.
  981. Before giving the lists of abbreviations, let me point out two problems,
  982. to neither of which I have a good solution.  1)~Assuming that only the
  983. English letters are used, two letters is enough for only 676 typeface
  984. families (even assuming we want to use all possible combinations, which
  985. is doubtful).  There are many more than 676 typeface families in the
  986. world.  2)~Fonts with design sizes over 100$\,$pt are not common, but
  987. neither are they unheard of.
  988. On to the specifics of the lists.  If you adopt this proposal at your
  989. own installation, and find that you have fonts with some property I
  990. missed, please write to me (see the end of the article for various
  991. addresses), so I can update the lists.  You can get the
  992. most up-to-date version of these lists electronically, by anonymous ftp
  993. from the host \.{ftp.cs.umb.edu}.  I will also send them to you by
  994. electronic mail, if necessary.
  995. I give the letters in lowercase, which is preferred on systems where
  996. case is significant.  Most lists are in alphabetical order by the
  997. abbreviations.
  998. \sub{Foundry}
  999. This is the current list of foundries.
  1000. \table
  1001. a&Autologic\cr
  1002. b&Bitstream\cr
  1003. c&Agfa-Compugraphic\cr
  1004. g&Free Software Foundation ({\tt g} for GNU)\cr
  1005. h&Bigelow \& Holmes (with apologies to Chuck)\cr
  1006. i&International Typeface Corporation\cr
  1007. p&Adobe ({\tt p} for PostScript)\cr
  1008. r&reserved for use with virtual fonts; see below\cr
  1009. s&Sun\cr
  1010. \endtable
  1011. \sub{Typeface Families}
  1012. The list of typefaces is:
  1013. \dtable
  1014. &ad&Adobe Garamond&go&Goudy Oldstyle\cr
  1015. &ag&Avant Garde&gs&Gill Sans\cr
  1016. &ao&Antique Olive&jo&Joanna\cr
  1017. &at&American Typewriter&lc&Lucida\cr
  1018. &bb&Bembo<&Lutetia\cr
  1019. &bd&Bodoni&nc&New Century Schoolbook\cr
  1020. &bg&Benguiat&op&Optima\cr
  1021. &bk&Bookman&pl&Palatino\cr
  1022. &bl&Balloon&pp&Perpetua\cr
  1023. &bv&Baskerville&rw&Rockwell\cr
  1024. &bw&Broadway&st&Stone\cr
  1025. &cb&Cooper Black&sy&Symbol\cr
  1026. &cl&Cloister&tm&Times\cr
  1027. &cr&Courier&un&Univers\cr
  1028. &cn&Century&uy&University\cr
  1029. &cs&Century Schoolbook&zc&Zapf Chancery\cr
  1030. &hv&Helvetica&zd&Zapf Dingbats\cr
  1031. &gm&Garamond&&\cr
  1032. \endtable
  1033. \sub{Weight}
  1034. This is a list of the possible weights,
  1035. roughly in order from lightest to heaviest.
  1036. \dtable
  1037. &a&hairline&d&demi\cr
  1038. &t&thin&s&semi\cr
  1039. &i&extra light&b&bold\cr
  1040. &l&light&x&extra bold\cr
  1041. &k&book&h&heavy\cr
  1042. &r®ular&c&black\cr
  1043. &m&medium&u&ultra\cr
  1044. \endtable
  1045. \sub{Variants}
  1046. The variants are:
  1047. \dtable
  1048. &a&alternate&n&informal\cr
  1049. &b&bright&o&oblique (i.e., slanted)\cr
  1050. &c&small caps&r&normal (roman or sans)\cr
  1051. &e&engraved&s&sans serif\cr
  1052. &g&grooved (as in the IBM logo)&t&typewriter\cr
  1053. &h&shadow&u&unslanted italic\cr
  1054. &i&(text) italic&x&expert\cr
  1055. &l&outline&&\cr
  1056. \endtable
  1057. If the variant is {\tt r}, and the expansion is also normal, both the
  1058. variant and the expansion are omitted.  When the normal version of the
  1059. typeface is sans serif (e.g., Helvetica), \.{r} should be used,
  1060. not \.{s}.  Use \.{s} only when the typeface family
  1061. has both serif and sans serif variants.  The ``alternate'' variant
  1062. (\.{a}) is used by some Adobe fonts that have spiffy swashes and
  1063. additional ligatures.
  1064. The ``expert'' variant (\.{x}) is also used by some Adobe
  1065. fonts with oldstyle figures and small caps.
  1066. Some fonts have multiple variants; Stone Informal Italic, for example.
  1067. The only reasonable approach to these is to list all the letters for all
  1068. the variants, choosing one to end with that is not also an expansion
  1069. letter.  Of course, it is possible that the name will become too
  1070. long if you do this, but $\ldots$ well, I'm open to suggestions.  It's
  1071. also possible the name will be ambiguous, if some new letter is used for
  1072. expansions in the future.  You can avoid this problem by adding the
  1073. expansion \.{r} (if it doesn't make the name too long), and
  1074. never using \.{r} for the last variant.
  1075. \sub{Expansion}
  1076. This is a list of the possible expansions, in order from narrowest to
  1077. widest.
  1078. \dtable
  1079. &o&extra condensed&x&extended (by hand)\cr
  1080. &c&condensed (by hand)&e&expanded (automatic)\cr
  1081. &n&narrow (automatic)&w&wide\cr
  1082. &r&\multispan3{regular, normal, medium (usually omitted)\hfil}\cr
  1083. \endtable
  1084. Expansion of fonts is sometimes done automatically (as in PostScript
  1085. {\bf scale}), and sometimes done by humans.  I chose `narrow' and
  1086. `expanded' to imply the former, and `condensed' and `extended' to imply
  1087. the latter, as I believe this reflects common usage.
  1088. \sub{Naming Virtual Fonts}
  1089. In concert with releasing \TeX~3.0 and \MF~2.0, Don Knuth wrote two new
  1090. utility programs: \.{VFtoVP} and \.{VPtoVF}, which convert
  1091. to and from ``virtual'' fonts.  Virtual fonts provide a general
  1092. interface between the writers of \TeX\ macros and font suppliers.
  1093. In general, therefore, it is impossible to come up with a general scheme
  1094. for naming virtual fonts, since each virtual font is an individual
  1095. creation, possibly bringing together many unrelated fonts.
  1096. Nevertheless, one common case is to use virtual fonts to map \TeX's
  1097. default accent and other character code conventions onto a
  1098. vendor-supplied font.  For example, \.{dvips}
  1099. does this for fonts given in the PostScript ``standard encoding''.
  1100. In this case, each font consists of a ``virtual'' \.{tfm} file, which is
  1101. what \TeX\ uses, a ``raw'' \.{tfm} file, which corresponds to the actual
  1102. device font, and a \.{vf} file, which describes the relationship between the
  1103. This adds another dimension to the space of font names, namely,
  1104. ``virtualness'' (or rather, ``rawness'', since it is the virtual \.{tfm}
  1105. files that the users want to see).  But we have already used up all
  1106. eight characters in the font names.
  1107. The best solution I have been able to think of is this: prepend
  1108. \.{r} to the raw \.{tfm} files; the virtual \.{tfm} files should be
  1109. named with the usual foundry prefix.  For example, the virtual
  1110. Times-Roman tfm file is named \.{ptmr}, as usual; the raw Times-Roman
  1111. \.{tfm} file is named \.{rptmr}.  To prevent intolerable confusion, I
  1112. promise never to give a foundry the letter \.{r}.
  1113. This scheme will work only as long as the virtualized fonts do not have
  1114. design sizes; if they do, another foundry letter will have to be
  1115. allocated, it seems to me.
  1116. A pox upon the houses of those who decided on fixed-length filenames!
  1117. \sub{Examples}
  1118. In closing, I will give two examples.  First, the fonts in the Univers
  1119. typeface family were assigned numbers by its designer, Adrien Frutiger. 
  1120. (You can see the scheme on, for example, page~29 of {\sl The Art of
  1121. Typo.icon.ography}, by Martin Solomon.)  Naturally, we want to give
  1122. them names.
  1123. \vskip\baselineskip\vbox{%
  1124. \halign to\hsize{\hskip20pt\tt #\hfil\space&#\hfil\quad\tabskip=0pt plus 1in
  1125. &\tt #\hfil\space\tabskip=0pt&#\hfil\cr
  1126. unl&45 (light)&unmro&59 (medium extra condensed)\cr
  1127. unli&46 (light italic)&undrx&63 (demibold extended)\cr
  1128. unlrc&47 (light condensed)&und&65 (demibold)\cr
  1129. unlic&48 (light condensed italic)&undi&66 (demibold italic)\cr
  1130. unlro&49 (light extra condensed)&undrc&67 (demibold condensed)\cr
  1131. unmrx&53 (medium extended)&undic&68 (demibold condensed italic)\cr
  1132. unm&55 (medium)&unbrx&73 (bold extended)\cr
  1133. unmi&56 (medium italic)&unb&75 (bold)\cr
  1134. unmrc&57 (medium condensed)&unbi&76 (bold italic)\cr
  1135. unmic&58 (medium condensed italic)&unxrx&83 (extra bold extended)\cr}}
  1136. Second, here are names for the standard PostScript fonts and their variants:
  1137. Fonts marked by an asterisk do not require using virtual fonts; the raw
  1138. fonts can be used directly because no remapping is necessary; every
  1139. character is encoded.
  1140. \vskip\baselineskip\vbox
  1141. {\font\small=cmr8\def\mark{${}^*$}\def\smallcaps{{\small(Small Caps)}}
  1142. \hyphenation{Post-Script}
  1143. \halign to\hsize{\hskip20pt\tt #\hfil\space&#\hfil\quad\tabskip=0pt plus 1in
  1144. &\tt #\hfil\space\tabskip=0pt&#\hfil\cr
  1145. pagk  &AvantGarde-Book&pncri &NewCenturySchlbk-Italic\cr
  1146. pagkc &AvantGarde-Book {\smallcaps}&pncr  &NewCenturySchlbk\cr
  1147. pagko &AvantGarde-BookOblique&pncrc &NewCenturySchlbk {\smallcaps}\cr
  1148. pagd  &AvantGarde-Demi&pplb  &Palatino-Bold\cr
  1149. pagdo &AvantGarde-DemiOblique&pplbi &Palatino-BoldItalic\cr
  1150. pbkd  &Bookman-Demi&pplbu &Palatino-BoldUnslanted\cr
  1151. pbkdi &Bookman-DemiItalic&pplrrn&Palatino-Narrow\cr
  1152. pbkl  &Bookman-Light&pplrre&Palatino-Expanded\cr
  1153. pbkli &Bookman-LightItalic&pplri &Palatino-Italic\cr
  1154. pbklc &Bookman-Light {\smallcaps}&pplr  &Palatino\cr
  1155. pcrb  &Courier-Bold&pplro &Palatino-Oblique\cr
  1156. pcrbo &Courier-BoldOblique&pplru &Palatino-Unslanted\cr
  1157. pcrro &Courier-Oblique&pplrc &Palatino {\smallcaps}\cr
  1158. pcrr  &Courier&psyr  &Symbol\mark\cr
  1159. phvb  &Helvetica-Bold&psyro &Symbol-Oblique\mark\cr
  1160. phvbo &Helvetica-BoldOblique&ptmb  &Times-Bold\cr
  1161. phvro &Helvetica-Oblique&ptmbi &Times-BoldItalic\cr
  1162. phvr  &Helvetica&ptmrrn&Times-Narrow\cr
  1163. phvrc &Helvetica {\smallcaps}&ptmrre&Times-Expanded\cr
  1164. phvbrn&Helvetica-Narrow-Bold&ptmri &Times-Italic\cr
  1165. phvbon&Helvetica-Narrow-BoldOblique&ptmro &Times-Oblique\cr
  1166. phvron&Helvetica-Narrow-Oblique&ptmr  &Times-Roman\cr
  1167. phvrrn&Helvetica-Narrow&ptmrc &Times-Roman {\smallcaps}\cr
  1168. pncb  &NewCenturySchlbk-Bold&pzcmi &ZapfChancery-MediumItalic\cr
  1169. pncbi &NewCenturySchlbk-BoldItalic&pzdr  &ZapfDingbats\mark\cr}}
  1170. Please contact Karl Berry if you have any comments or additions.  Karl
  1171. can be reached at \.{karl@cs.umb.edu}, or at 135 Center Hill Road,
  1172. Plymouth, MA~~02360.\par}
  1173. \sec{Command Line Options}
  1174. The \.{dvips} driver has a plethora of command line options.  Reading
  1175. through this section will give a good idea of the capabilities of the
  1176. driver.
  1177. Many of the parameterless options listed here can be turned off by
  1178. immediately suffixing
  1179. the option with a zero (0); for instance, to turn off page reversal if it is
  1180. turned on by default, use \.{-r0}.  The options that can be turned off in
  1181. this way are \.a, \.f, \.k, \.i, \.m, \.q, \.r, \.s, \.E, \.F, \.K, \.M, \.N,
  1182. \.U, and \.Z.
  1183. This is a handy summary of the options; it is printed out when you run
  1184. \.{dvips} with no arguments.
  1185. {\vskip0pt\parskip=0pt\begverb{`\\}
  1186.      Usage: dvips [options] filename[.dvi]
  1187.  a*  Conserve memory, not time      y # Multiply by dvi magnification
  1188.  b # Page copies, for posters e.g.  A   Print only odd (TeX) pages
  1189.  c # Uncollated copies              B   Print only even (TeX) pages
  1190.  d # Debugging                      C # Collated copies
  1191.  e # Maxdrift value                 D # Resolution
  1192.  f*  Run as filter                  E*  Try to create EPSF
  1193.  h f Add header file                F*  Send control-D at end
  1194.  i*  Separate file per section      K*  Pull comments from inclusions
  1195.  k*  Print crop marks               M*  Don't make fonts
  1196.  l # Last page                      N*  No structured comments
  1197.  m*  Manual feed                    O c Set/change paper offset
  1198.  n # Maximum number of pages        P s Load config.$s
  1199.  o f Output file                    R   Run securely
  1200.  p # First page                     S # Max section size in pages
  1201.  q*  Run quietly                    T c Specify desired page size
  1202.  r*  Reverse order of pages         U*  Disable string param trick
  1203.  s*  Enclose output in save/restore X # Horizontal resolution
  1204.  t s Paper format                   Y # Vertical resolution
  1205.  x # Override dvi magnification     Z*  Compress bitmap fonts
  1206.      # = number   f = file   s = string  * = suffix, `0' to turn off
  1207.      c = comma-separated dimension pair (e.g., 3.2in,-32.1cm)
  1208. \endverb}
  1209. {\options
  1210. \def\o#1 #2:{{\tt #1} {\it #2}:}
  1211. \def\O#1:{{\tt #1}:}
  1212. \O-a:  Conserve memory by making three passes over the \.{dvi} file
  1213. instead of two and only loading those characters actually used.
  1214. Generally only useful on machines with a very limited amount of
  1215. memory, like some PCs.
  1216. \o-b num: Generate {\it num} copies of each page, but duplicating the
  1217. page body rather than using the {\tt\#numcopies} option.  This can be
  1218. useful in conjunction with a header file setting {\tt\char92bop-hook}
  1219. to do color separations or other neat tricks.
  1220. \o-c num: Generate {\it num} copies of every page, by using
  1221. PostScript's \.{\#copies} feature.
  1222. \^{copies}
  1223. Default is 1. (For collated copies, see the \.{-C} option below.)
  1224. \o-d num:  Set the debug flags.  This is intended only for emergencies
  1225. or for unusual fact-finding expeditions; it will work only if
  1226. \^{debug}
  1227. \.{dvips} has been compiled with the \.{DEBUG} option.
  1228. The source file \.{debug.h} indicates what the values of
  1229. {\it num} can be, or see section 15 of this manual.
  1230. Use a value of $-1$ for maximum output.
  1231. \o-e num:
  1232. Make sure that each character is placed at most this many pixels from its
  1233. `true' resolution-independent
  1234. position on the page. The default value of this parameter
  1235. is resolution dependent (it is the number
  1236. of entries in the list [100, 200, 300, 400, 500, 600, 800, 1000, 1200, 1600,
  1237. 2000, 2400, 2800, 3200, $\ldots\,$] that are less than or equal to the
  1238. \^{maxdrift}
  1239. resolution in dots per inch). Allowing individual
  1240. characters to `drift' from their correctly rounded positions
  1241. by a few pixels, while regaining the true position at the beginning of
  1242. each new word, improves the spacing of letters in words.
  1243. \O-f: Run as a filter.
  1244. \^{filter}
  1245. Read the \.{dvi} file from standard input and write the PostScript to
  1246. standard output.  The standard input must be seekable, so it cannot
  1247. be a pipe.  If you must use a pipe, write a shell script that copies
  1248. the pipe output to a temporary file and then points \.{dvips} at this file.
  1249. This option also disables the automatic reading of the \.{PRINTER}
  1250. environment variable, and turns off the automatic sending of control D
  1251. if it was turned on with the \.{-F} option or in the configuration file;
  1252. use \.{-F} after this option if you want both.
  1253. \o-h name:
  1254. Prepend file {\it name}
  1255. \^{header}
  1256. as an additional header file. (However, if the name is simply `\.-',
  1257. suppress all header files from the output.)  This header file
  1258. gets added to the PostScript \.{userdict}.
  1259. \O-i: Make each section be a separate file.  Under certain circumstances,
  1260. \.{dvips} will split the document up into `sections' to be processed
  1261. independently; this is most often done for memory reasons.  Using this
  1262. option tells \.{dvips} to place each section into a separate file; the
  1263. new file names are created replacing the suffix of the supplied output
  1264. file name by a three-digit sequence number.
  1265. This option is most often used in
  1266. conjunction with the \.{-S} option which sets the maximum section length
  1267. in pages.  For instance, some phototypesetters cannot print more than
  1268. ten or so consecutive pages before running out of steam; these options
  1269. can be used to automatically split a book into ten-page sections, each
  1270. to its own file.
  1271. \O-k:  Print crop marks.  This option increases the paper size
  1272. (which should be specified, either with a paper size special or
  1273. with the {\tt -T} option) by a half inch in each dimension.  It
  1274. translates each page by a quarter inch and draws cross-style
  1275. crop marks.  It is mostly useful with typesetters that can set
  1276. the page size automatically.
  1277. \o-l num:
  1278. \^{pages}
  1279. The last page printed will be the first one numbered {\it num.}
  1280. Default is the last page in the document.  If the {\it num} is
  1281. prefixed by an equals sign, then it (and any argument to the
  1282. {\tt -p} option) is treated as a sequence number, rather than
  1283. a value to compare with {\tt \char92 count0} values.  Thus,
  1284. using {\tt -l =9} will end with the ninth page of the document,
  1285. no matter what the pages are actually numbered.
  1286. \O-m:  Specify manual feed for printer.
  1287. \^{manual feed}
  1288. \o-n num:
  1289. At most {\it num} pages will be printed. Default is 100000.
  1290. \^{pages}
  1291. \o-o name:  The output will be sent to file {\it name.}
  1292. \^{output}
  1293. If no file name is given, the default name is \.{{\it file}.ps} where
  1294. the \.{dvi} file was called \.{{\it file}.dvi};
  1295. if this option isn't given, any default in the configuration file is used.
  1296. If the first character of the supplied output file name is an
  1297. exclamation mark, then
  1298. the remainder will be used as an argument to \.{popen}; thus, specifying
  1299. \.{!lpr} as the output file will automatically queue the file for printing.
  1300. This option also disables the automatic reading of the \.{PRINTER}
  1301. environment variable, and turns off the automatic sending of control D
  1302. if it was turned on with the \.{-F} option or in the configuration file;
  1303. use \.{-F} after this option if you want both.
  1304. \o-p num:
  1305. \^{pages}
  1306. The first page printed will be the first one numbered {\it num.}
  1307. Default is the first page in the document.  If the {\it num} is
  1308. prefixed by an equals sign, then it (and any argument to the {\tt -l}
  1309. option) is treated as a sequence number, rather than a value to
  1310. compare with {\tt \char92 count0} values.  Thus, using {\tt -p =3}
  1311. will start with the third page of the document, no matter what the
  1312. pages are actually numbered.  Another form of page selection is
  1313. available by using {\tt -pp} followed by a comma-separated list of
  1314. pages or page-ranges, where the page ranges are colon-separated pairs
  1315. of numbers.  Thus, you can print pages 3--10, 21, and 73--92 with the
  1316. option {\tt -pp 3:10,21,73:92}.
  1317. \O-q: Run in quiet mode.
  1318. Don't chatter about pages converted, etc.; report nothing but errors to
  1319. \^{quiet}
  1320. standard error.
  1321. \O-r:
  1322. Stack pages in reverse order.  Normally, page 1 will be printed first.
  1323. \^{reverse}
  1324. \O-s:
  1325. Causes the entire global output to be enclosed in a save/restore pair.
  1326. This causes the file to not be truly conformant, and is thus not recommended,
  1327. but is useful if you are driving the printer directly and don't care too
  1328. much about the portability of the output.
  1329. \o-t papertype:
  1330. \^{paper type}
  1331. \^{mode}
  1332. \^{letter}
  1333. \^{legal}
  1334. \^{ledger}
  1335. \^{a4}
  1336. \^{a3}
  1337. \^{landscape}
  1338. This sets the paper type to {\it papertype}.  The {\it papertype} should
  1339. be defined in one of the configuration files, along with the appropriate
  1340. code to select it.  See the documentation for \.@ in the configuration
  1341. file option descriptions.  You can also specify
  1342. \.{-t landscape}, which rotates a document by 90 degrees.
  1343. To rotate a document whose size is not letter, you can use the 
  1344. \.{-t} option twice, once for the page size, and once for \.{landscape}.
  1345. The upper left corner of each page in
  1346. the \.{dvi} file is placed one inch from the left and one inch from the top.
  1347. Use of this option is highly dependent on the configuration file.
  1348. Note that executing the {\tt letter} or {\tt a4} or other PostScript
  1349. operators cause the document to be nonconforming and can cause it not
  1350. to print on certain printers, so the default paper size should not
  1351. execute such an operator if at all possible.
  1352. \o-x num:
  1353. Set the magnification ratio to {\it num}/1000. Overrides the magnification
  1354. \^{magnification}
  1355. specified in the \.{dvi} file.  Must be between 10 and 100000.  It is
  1356. recommended that you use standard magstep values (1095, 1200, 1440, 1728,
  1357. 2074, 2488, 2986, and so on) to help reduce the total number of \.{PK}
  1358. files generated.
  1359. \O-A:
  1360. This option prints only the odd pages.  This option uses the \TeX\
  1361. page numbering rather than the sequence page numbers.
  1362. \O-B:
  1363. This option prints only the even pages.  This option uses the \TeX\
  1364. page numbering rather than the sequence page numbers.
  1365. \o-C num:
  1366. Create {\it num}
  1367. \^{copies}
  1368. copies, but collated (by replicating the data in the PostScript file).
  1369. Slower than the \.{-c} option, but easier on the hands, and faster than
  1370. resubmitting the same PostScript file multiple times.
  1371. \o-D num:
  1372. Set the resolution in dpi (dots per inch) to {\it num.}
  1373. \^{resolution}
  1374. This affects the choice of bitmap fonts that are loaded and also the positioning
  1375. of letters in resident PostScript fonts. Must be between 10 and 10000.
  1376. This affects both the horizontal and vertical resolution.  If a high resolution
  1377. (something greater than 400 dpi, say) is selected, the \.{-Z} flag should
  1378. probably also be used.
  1379. \O-E:
  1380. Makes \.{dvips} attempt to generate an EPSF file with a tight bounding
  1381. box.  This only works on one-page files, and it only looks at marks made
  1382. by characters and rules, not by any included graphics.  In addition, it
  1383. gets the glyph metrics from the {\tt tfm} file, so characters that
  1384. lie outside their enclosing {\tt tfm} box may confuse it.  In addition,
  1385. the bounding box might be a bit too loose if the character glyph has
  1386. significant left or right side bearings.  Nonetheless, this option works
  1387. well for creating small EPSF files for equations or tables or the like.
  1388. (Note, of course, that {\tt dvips} output is resolution dependent and
  1389. thus does not make very good EPSF files, especially if the images are
  1390. to be scaled; use these EPSF files with a great deal of care.)
  1391. \O-F:
  1392. Causes Control-D (ASCII code 4) to be appended as the very last character
  1393. of the PostScript file.  This is useful when \.{dvips}
  1394. \^{EOF}
  1395. \^{control-D}
  1396. is driving the printer directly instead of working through a spooler,
  1397. as is common on extremely small systems.  Otherwise, it is not recommended.
  1398. \O-K:
  1399. This option causes comments in included PostScript graphics, font files,
  1400. and headers to be removed.  This is sometimes necessary to get around bugs
  1401. in spoolers or PostScript post-processing programs.  Specifically, the
  1402. \.{\%\%Page} comments, when left in, often cause difficulties.
  1403. Use of this flag can cause some included graphics to fail, since the
  1404. PostScript header macros from some software packages read portions of
  1405. the input stream line by line, searching for a particular comment.
  1406. This option has been turned on by default because PostScript previewers
  1407. and spoolers still have problems with the structuring conventions.
  1408. \O-M:
  1409. Turns off the automatic font generation facility.  If any fonts are
  1410. missing, commands to generate the fonts are appended to the file
  1411. {\tt missfont.log} in the current directory; this file can then be
  1412. executed and deleted to create the missing fonts.
  1413. \O-N:
  1414. Turns off structured comments; this might be necessary on some systems
  1415. \^{structured comments}
  1416. that try to interpret PostScript comments in weird ways, or on some
  1417. PostScript printers.  Old versions of TranScript in particular cannot
  1418. handle modern Encapsulated PostScript.
  1419. \o-O offset:
  1420. Move the origin by a certain amount.  The {\it offset} is a comma-separated
  1421. pair of dimensions, such as \.{.1in,-.3cm} (in the same syntax used in
  1422. the \.{papersize} special).   The origin of the page is shifted from the
  1423. default position (of one inch down, one inch to the right from the upper
  1424. left corner of the paper) by this amount.
  1425. \o-P printername:
  1426. Sets up the output for the appropriate printer.  This is implemented
  1427. by reading in \.{config.{\it printername}}, which can then set the output pipe
  1428. (as in, \.{o !lpr -Pprintername}) as well as the font paths and any other
  1429. \^{{\tt config.ps}}
  1430. defaults for that printer only.  It is recommended that all standard
  1431. defaults go in the one master {\tt config.ps}
  1432. file and only things that vary
  1433. printer to printer go in the \.{config.{\it printername}}
  1434. files.  Note that {\tt config.ps}
  1435. is read before \.{config.{\it printername}}.
  1436. In addition, another file called \.{\tilde/.dvipsrc}
  1437. is searched for immediately after \.{config.ps};
  1438. this file is intended for user defaults.  If no \.{-P} command is
  1439. given, the environment variable \.{PRINTER} is checked.  If that
  1440. variable exists, and a corresponding configuration
  1441. file exists, that configuration file is read in.
  1442. \o-S num:
  1443. Set the maximum number of pages in each `section'.  This option is most
  1444. commonly used with the \.{-i} option; see that documentation above for more
  1445. information.
  1446. \O-T offset:
  1447. Set the paper size to the given pair of dimensions.  This option takes
  1448. its arguments in the same style as {\tt -O}.  It overrides any paper
  1449. size special in the {\tt dvi} file.
  1450. \O-U:
  1451. Disable a PostScript virtual memory saving optimization that stores the
  1452. character metric information in the same string that is used to store
  1453. the bitmap information.  This is only necessary when driving the Xerox
  1454. 4045 PostScript interpreter.  It is caused by a bug in that interpreter
  1455. that results in `garbage' on the bottom of each character.  Not
  1456. recommended unless you must drive this printer.
  1457. \o-X num:
  1458. Set the horizontal resolution in dots per inch to {\it num.}
  1459. \^{resolution}
  1460. \o-Y num:
  1461. Set the vertical resolution in dots per inch to {\it num.}
  1462. \^{resolution}
  1463. \O-Z:
  1464. Causes bitmapped fonts to be compressed before they are downloaded,
  1465. \^{compression}
  1466. thereby reducing the size of the PostScript font-downloading information.
  1467. Especially useful at high resolutions or when very large fonts are
  1468. used.  Will slow down printing somewhat, especially on early 68000-based
  1469. PostScript printers.\par}
  1470. \sec{Configuration File Searching}
  1471. The \.{dvips} program has a system of loading configuration files such that
  1472. \^{{\tt config.ps}}
  1473. certain parameters can be set globally across the system, others can be set
  1474. per-printer basis, and yet others can be set by the user.  When \.{dvips}
  1475. starts up, first the global \.{config.ps} file is searched for and loaded.
  1476. This file is looked for along the path for configuration files, which is by
  1477. default \.{.:/usr/lib/tex/ps}.
  1478. After this master configuration file is loaded, a file by the name of
  1479. \.{.dvipsrc} is loaded from the current user's home directory, if such
  1480. a file exists.  This file is loaded in exactly the same way as the global
  1481. configuration file, and it can override any options set in the global
  1482. file.
  1483. Then the command line is read and parsed.  If the \.{-P} option is
  1484. encountered, at that point in the command line a configuration file
  1485. for that printer is read in.  Thus, the printer configuration file can
  1486. override anything in the global or user configuration file, and it can
  1487. also override anything seen in the command line up to the point that the
  1488. \.{-P} option was encountered.
  1489. After the command line has been completely scanned, if there was no
  1490. \.{-P} option selected, and also the \.{-o} and \.{-f} command line
  1491. options were not used, a \.{PRINTER} environment variable is
  1492. searched for.  If this variable exists, and a configuration file for
  1493. the printer mentioned in it exists, this configuration file is
  1494. loaded last of all.
  1495. Note that because the printer-specific configuration files are read
  1496. after the user's configuration file, the user's \.{.dvipsrc}
  1497. cannot override things in
  1498. the printer configuration files.  On the other hand, the configuration path
  1499. usually includes the current directory, and can be set to include the
  1500. user's home directory (or any other directory of the user), so the user can
  1501. always provide personalized printer-specific configuration files that will
  1502. be found before the system global ones.
  1503. If your printer uses a different resolution than 300 dpi,
  1504. make sure that you
  1505. have given a \MF\ mode as well as a resolution in the printer
  1506. configuration file.  Also make sure that \MF\ knows about the mode,
  1507. by entering it into your local \.{mode\_def} file (typically
  1508. \.{waits.mf}; \.{amiga.mf} on the Amiga, \.{next.mf} on the NeXT)
  1509. and recreating the \.{plain.base} file for \MF, including the
  1510. \.{mode\_def} file.  (Another good mode definition file is
  1511. {\tt modes.mf} by Karl Berry, which is available from
  1512. {\tt ftp.cs.umb.edu} in {\tt pub/tex/modes.mf}.)
  1513. The most common problem in generating fonts
  1514. with \MF\ is that
  1515. \^{{\tt mode\_def}}
  1516. \^{{\tt plain.base}}
  1517. \^{\MF}
  1518. this file with the mode definitions is not included when creating
  1519. the \.{plain.base} file.
  1520. \sec{Configuration File Options}
  1521. Most of the configuration file options are similar to the command line
  1522. options, but there are a few new ones.
  1523. Again, many may be turned off by suffixing the letter with a zero (0).
  1524. These options are \.a, \.f, \.q, \.r, \.I, \.K, \.N, \.U, and \.Z.
  1525. Within a configuration file, any empty line or line starting with a space,
  1526. asterisk, equal sign, or a pound sign is ignored.
  1527. {\options
  1528. \def\o#1 #2:{{\tt #1} {\it #2\/}:}
  1529. \def\O#1:{{\tt #1}:}
  1530. \o @ name hsize vsize: This option is used to set the paper size defaults
  1531. and options for the particular printer this configuration file
  1532. describes.  There are three formats for this option.  If the option is
  1533. specified on a line by itself, with no parameters, it instructs
  1534. \.{dvips} to discard all other paper size information (possibly from
  1535. another configuration file) and start fresh.  If three parameters
  1536. are given, as above, with the first parameter being a name and the second
  1537. and third being a dimension (as in 8.5in or 3.2cc, just like in the
  1538. \.{papersize} special), then the option is interpreted as starting a new
  1539. paper size description, where {\it name} is the name and {\it hsize} and
  1540. {\it vsize} describe the horizontal and vertical size of the sheet of
  1541. paper, respectively.  If both {\it hsize} and {\it vsize} are equal to
  1542. zero (although you must still specify units!\null) then any page size will
  1543. match it.  If the \.@ character is immediately followed by a
  1544. \.+ sign, then the remainder of the line (after skipping any leading
  1545. blanks) is treated as PostScript code to send to the printer to select
  1546. that particular paper size.  After all that, if the first character of
  1547. the line is an exclamation point, then the line is put in the initial
  1548. comments section of the final output file; else, it is put in the setup
  1549. section of the output file.  For instance, a subset of the paper size
  1550. information supplied in the default \.{config.ps} looks like
  1551. {\parindent=40pt\cmd{@ letterSize 8.5in 11in\\
  1552. @ letter 8.5in 11in\\
  1553. @+ \%\%BeginPaperSize: Letter\\
  1554. @+ letter\\
  1555. @+ \%\%EndPaperSize\\
  1556. @ legal 8.5in 14in\\
  1557. @+ ! \%\%DocumentPaperSizes: Legal\\
  1558. @+ \%\%BeginPaperSize: Legal\\
  1559. @+ legal\\
  1560. @+ \%\%EndPaperSize}}
  1561. \noindent
  1562. Note that you can even include structured comments in the configuration
  1563. file!  When \.{dvips} has a paper format name given on the command line,
  1564. it looks for a match by the {\it name}; when it has a \.{papersize}
  1565. special, it looks for a match by dimensions.  The first match found (in
  1566. the order the paper size information is found in the configuration file)
  1567. is used.  If nothing matches, a warning is printed and the first paper
  1568. size given is used, so the first paper size should always be the default.
  1569. The dimensions must match
  1570. within a quarter of an inch.  Landscape mode for all of the paper sizes
  1571. are automatically supported.  If your printer has a command to set a
  1572. special paper size, then give dimensions of \.{0in 0in}; the PostScript
  1573. code that sets the paper size can refer to the dimensions the user
  1574. requested as \.{\ttbackslash hsize} and \.{\ttbackslash vsize};
  1575. these will be macros defined in
  1576. the PostScript that return the requested size in default PostScript
  1577. units.  Note that virtually all of the PostScript commands you use
  1578. here are device dependent and degrade the portability of the file; that
  1579. is why the default first paper size entry should not send any PostScript
  1580. commands down (although a structured comment or two would be okay).
  1581. Also, some printers want {\tt BeginPaperSize} comments and paper size
  1582. setting commands; others (such as the NeXT) want {\tt PaperSize} comments
  1583. and they will handle setting the paper size.  There is no solution I
  1584. could find that works for both (except maybe specifying both).
  1585. See the supplied {\tt config.ps} file for a more realistic
  1586. example.
  1587. \O a:  Conserve memory by making three passes over the \.{dvi} file
  1588. instead of two and only loading those characters actually used.
  1589. Generally only useful on machines with a very limited amount of
  1590. memory, like some PCs.
  1591. \o b num: Generate {\it num} copies of each page, but duplicating the
  1592. page body rather than using PostScript's {\tt\#copies}.  This can be
  1593. useful in conjunction with a header file setting {\tt\char92bop-hook}
  1594. to do color separations or other neat tricks.
  1595. \o e num:
  1596. Set the maximum drift parameter to {\it num} dots (pixels) as explained above.
  1597. \^{maxdrift}
  1598. \O f:  Run as a filter by default.
  1599. \^{filter}
  1600. \o h name:
  1601. Add {\it name} as a PostScript header file to be downloaded at the beginning.
  1602. \^{header}
  1603. \o i num:
  1604. Make each section be a separate file, and set the maximum number of pages
  1605. in a given file to {\it num}.  Under certain circumstances,
  1606. \.{dvips} will split the document into `sections' to be processed
  1607. independently; this is most often done for memory reasons.  Using this
  1608. option tells \.{dvips} to place each section into a separate file; the
  1609. new file names are created by replacing the suffix of the supplied output
  1610. file name with a three-digit sequence number.
  1611. This is essentially a combination of the
  1612. command line options \.{-i} and \.{-S}; see the documentation for these
  1613. options for more information.
  1614. \o m num:  The value {\it num} is the virtual memory available for fonts
  1615. and strings in the printer.
  1616. \^{memory}
  1617. Default is 180000.  This value must be accurate if memory conservation and
  1618. document splitting is to work correctly.  To determine this value, send the
  1619. following file to the printer:
  1620. {\parindent=40pt\cmd{\%! Hey, we're PostScript\\
  1621. /Times-Roman findfont 30 scalefont setfont 144 432 moveto\\
  1622. vmstatus exch sub 40 string cvs show pop showpage}}
  1623. \noindent
  1624. Note that the number returned by this file is the total memory free;
  1625. it is often a good idea to tell \.{dvips} that the printer has somewhat
  1626. less memory.  This is because many programs download permanent macros
  1627. that can reduce the memory in the printer.  In general, a memory size
  1628. of about \.{300000} is plenty, since \.{dvips} can automatically split
  1629. a document if required.  It is unfortunate that PostScript printers with
  1630. much less virtual memory still exist.
  1631. Some systems or printers can dynamically increase the memory available
  1632. to a PostScript interpreter, in which case this file might return a
  1633. ridiculously low number; the NeXT computer is such a machine.  For these
  1634. systems, a value of one million works well.
  1635. \o o name:
  1636. \^{output}
  1637. The default output file is set to {\it name}.  As above, it can be a pipe.
  1638. Useful in printer-specific configuration files to redirect the output to
  1639. a particular printer queue.
  1640. \o p name:
  1641. The file to examine for PostScript font aliases is {\it name}.  It
  1642. defaults to {\tt psfonts.map}.  This option allows different printers
  1643. to use different resident fonts.  If the name starts with a `{\tt +}'
  1644. character, then the rest of the name (after any leading spaces) is used
  1645. as an additional map file; thus, it is possible to have local map files
  1646. pointed to by local configuration files that append to the global
  1647. map file.
  1648. \O q:  Run in quiet mode by default.
  1649. \^{quiet}
  1650. \O r:  Reverse the order of pages by default.
  1651. \^{reverse}
  1652. \O s:
  1653. Enclose the entire document in a global save/restore pair by default.
  1654. Not recommended, but useful in some environments; this breaks the
  1655. conformance of the document to the Adobe PostScript structuring
  1656. conventions.
  1657. \o D num:
  1658. Set the vertical and horizontal resolution to {\it num}
  1659. \^{resolution}
  1660. dots per inch.  Useful in printer-specific configuration files.
  1661. \o E command:
  1662. Execute the system command listed, for example as a UNIX shell command.
  1663. Execution takes place immediately, while the configuration file is
  1664. being read. This option can be used to insert the current date into a
  1665. header file, for instance, as explained at the end
  1666. of section~13.  Possibly dangerous; in many
  1667. installations it may be disabled, in which case a warning message will
  1668. be printed if the option is used.
  1669. \o H path:
  1670. The (colon-separated) path to search for PostScript header 
  1671. \^{header}
  1672. files is {\it path}.
  1673. \O I:
  1674. Ignore the {\tt PRINTER} environment variable.
  1675. \O K:
  1676. Filter comments out of included PostScript files; see the description
  1677. above for more information.
  1678. \o M mode: Set {\it mode}
  1679. as the \MF\ mode to be used when generating fonts.  This is
  1680. \^{{\tt MakeTeXPK}}
  1681. \^{{\MF}}
  1682. passed along to \.{MakeTeXPK} and overrides mode derivation from the
  1683. base resolution.
  1684. \O N:  Disable PostScript comments by default.
  1685. \o O offset:
  1686. Move the origin by a certain amount.  The {\it offset} is a comma-separated
  1687. pair of dimensions, such as \.{.1in,-.3cm} (in the same syntax as used in
  1688. the \.{papersize} special).   The origin of the page is shifted from the
  1689. default position (of one inch down, one inch to the right from the upper
  1690. left corner of the paper) by this amount.
  1691. \o P path:  The (colon-separated) path to search for bitmap \.{pk}
  1692. font files is
  1693. {\it path}.  The \.{TEXPKS} environment variable will override this.
  1694. \^{{\tt TEXPKS}}
  1695. \^{{\tt pk}}
  1696. If a \.{\%} character is found in {\it path},
  1697. the following substitutions will be made, and then a search will
  1698. be made for the resulting filenames.
  1699. A \.{\%f} is replaced by the font name.
  1700. A \.{\%b} is replaced by the output device horizontal resolution dots per inch.
  1701. A \.{\%d} is replaced by the font size in dots per inch.
  1702. A \.{\%p} is replaced by the font family; this is always \.{pk}.
  1703. A \.{\%m} is replaced by the font mode; this is the mode given
  1704. in the \.{M} option.
  1705. Note that, for each path element, if it contains a percent sign, you
  1706. must give the full file name, including path, rather than just the
  1707. directory name; a path element such as {\tt /fonts/\%b} will try to
  1708. open {\tt /fonts/300} when looking for {\tt cmr10.329pk}, for
  1709. instance, and this may not be what is intended; {\tt /fonts/\%b/\%f.\%dpk}
  1710. is needed.  If a path element does not contain a percent sign, there
  1711. is no need to specify the entire file name (because you can't, unless
  1712. you list all possible specific font names!).
  1713. \o R num num $\ldots\,$:
  1714. Sets up a list of default resolutions to search for \.{pk} fonts, if the
  1715. \^{{\tt pk}}
  1716. requested size is not available.  The output will then scale the font
  1717. found using PostScript scaling to the requested size.  Note that the
  1718. resultant output will be ugly, and thus a warning is issued.  To turn
  1719. this off, use a line with just the \.{R} and no numbers.
  1720. \o S path:  The path to search for special illustrations
  1721. (Encapsulated PostScript files or psfiles) is {\it path}.
  1722. \^{{\tt TEXINPUTS}}
  1723. The \.{TEXINPUTS} environment variable will override this.
  1724. \o T path: The path to search for the \.{tfm} files is
  1725. {\it path}.  The \.{TEXFONTS} environment variable will override this.
  1726. \^{{\tt TEXFONTS}}
  1727. This path is used for resident fonts and fonts that can't otherwise be found.
  1728. It's usually best to make it identical to the path used by \TeX.
  1729. \O U:  Turns off a memory-saving optimization; this is necessary for the
  1730. Xerox 4045 printer, but not recommended otherwise.  See the description
  1731. above for more information.
  1732. \o V path:  The path to search for virtual font \.{vf} files is
  1733. \^{{\tt vf}}
  1734. \^{virtual fonts}
  1735. {\it path}.
  1736. This may be device-dependent if you use virtual fonts to simulate
  1737. actual fonts on different devices.
  1738. \o W string:
  1739. Sends {\it string} to stderr, if a parameter is given; otherwise it cancels
  1740. another previous  message.
  1741. This is useful in the default configuration file if you want to require
  1742. the user to specify a printer, for instance, or if you want to notify
  1743. the user that the resultant output has special characteristics.
  1744. \o X num:
  1745. \^{resolution}
  1746. Set the horizontal resolution to {\it num} dots per inch.
  1747. \o Y num:
  1748. \^{resolution}
  1749. Set the vertical resolution to {\it num} dots per inch.
  1750. \O Z:  Compress all downloaded fonts by default, as above.\par}
  1751. \sec{Automatic Font Generation}
  1752. One major problem with \TeX\ and the Computer Modern fonts is the huge
  1753. amount of disk space a full set of high resolution fonts can take.  The
  1754. \.{dvips} program solves this problem by creating fonts on demand, so only
  1755. those fonts that are actually used are stored on disk.  At a typical site,
  1756. less than one-fifth of the full set of Computer Modern fonts are used over
  1757. a long period, so this saves a great deal of disk space.
  1758. Furthermore, the addition of dynamic font generation allows fonts to be
  1759. used at any size, including typesetter resolutions and extremely huge
  1760. banner sizes.  Nothing special needs to be done; the fonts will be
  1761. automatically created and installed as needed.
  1762. The downside is that it does take a certain amount of time to create a new
  1763. font if it has never been used before.  But once a font is created, it
  1764. will exist on disk, and the next time that document is printed it will print
  1765. very quickly.
  1766. It is the \.{MakeTeXPK} shell script that is responsible for making these
  1767. \^{{\tt MakeTeXPK}}
  1768. fonts.  The \.{MakeTeXPK} script supplied invokes \MF\ to create the font and
  1769. then copies the resultant \.{pk} file to a world-writable font cache area.
  1770. \.{MakeTeXPK} can be customized to do other things to get the font.  For
  1771. instance, if you are installing \.{dvips} to replace (or run alongside)
  1772. an existing PostScript driver, and that driver demands \.{gf} fonts, you
  1773. can easily modify \.{MakeTeXPK} to invoke \.{gftopk} to convert the
  1774. \.{gf} files to \.{pk} files for \.{dvips}.  This provides the same space
  1775. savings listed above.
  1776. Because \.{dvips} (and thus \.{MakeTeXPK}) is run by a wide variety of users,
  1777. there must be a system-wide place to put the cached font files.  In order
  1778. for everyone to be able to supply fonts, the directory must be world
  1779. writable.  If your system administrator considers this a security hole,
  1780. \.{MakeTeXPK} can write to \.{/tmp/pk} or some such directory, and
  1781. periodically the cached fonts can be moved to a more general system area.
  1782. Note that the cache directory must exist on the \.{pk} file search path
  1783. in order for \.{MakeTeXPK} to work.
  1784. \sec{Path Interpretation}
  1785. The \.{dvips} program needs to read a wide variety of files from a large
  1786. set of directories.  It uses a set of paths to do this.  The actual
  1787. paths are listed in the next section; this section describes how the
  1788. paths are interpreted.
  1789. All path variables are names of directories (path elements),
  1790. separated by colons.
  1791. Each path element can be either the literal name of a directory or one
  1792. of the \.{\tilde} forms common under UNIX.  If a path element is a single tilde,
  1793. \^{UNIX}
  1794. it is replaced by the contents of the environment variable \.{HOME}, which
  1795. \^{{\tt HOME}}
  1796. is normally set to the user's home directory.  If the path element is
  1797. a tilde followed by anything, the part after the tilde is interpreted as
  1798. a user name, and his home directory is fetched from the system password
  1799. file and used as the real path element.
  1800. Where environment variables can override paths, an additional path
  1801. element form is allowed.  If a path element is the empty string, it
  1802. is replaced with the system defaults.  Thus, to
  1803. search the user's home directory, followed by the system
  1804. default paths, assuming the current shell is \.{csh},
  1805. the following command would be used:
  1806. \cmd{setenv TEXINPUTS \tilde:}
  1807. \noindent
  1808. This is a path of two elements.  The first is the user's home directory.
  1809. The second path element is the empty string, indicating that
  1810. the system defaults should be searched.
  1811. The `system defaults' as defined here means the strings set in the
  1812. \.{Makefile} before compilation, rather than any defaults set in
  1813. \.{config.ps} or printer-specific configuration files.  This is to
  1814. prevent path blowup, where more and more directories are added to the
  1815. path by each level of configuration file.
  1816. \sec{Environment Variables}
  1817. The \.{dvips} program reads a certain set of environment variables to
  1818. configure its operation.  The path variables are read after all
  1819. configuration files are read, so they override values in the configuration
  1820. files.  (The \.{TEXCONFIG} variable, of course, is read before the
  1821. configuration files.)  The rest are read as needed.
  1822. Note that all defaults supplied here are just as supplied in the
  1823. provided {\tt Makefile}; they will almost certainly have been changed
  1824. during installation at your particular site.
  1825. \descenv HOME,{\rm no default}
  1826.   This environment variable is automatically set by the shell and is
  1827. used to replace any occurrences of \.{\tilde} in a path.
  1828. \descenv MAKETEXPK,{MakeTeXPK \%n \%d \%b \%m}
  1829. This environment variable sets the command to be executed to create
  1830. a missing font.  A \%n is replaced by the base name of the font to
  1831. be created (such as \.{cmr10}); a \%d is replaced by the resultant
  1832. horizontal resolution of the font; a \%b is replaced by the
  1833. horizontal resolution at which \.{dvips} is currently generating
  1834. output, and any \%m is replaced by a string that \MF\ can use as
  1835. the right hand side of an assignment to \.{mag} to create the
  1836. desired font at the proper resolution.  If a mode for \MF\ is set in
  1837. a configuration file, that is automatically appended to the command
  1838. before execution.  Note that these substitutions are different than
  1839. the ones performed on PK paths.
  1840. \descenv DVIPSHEADERS,{.:/usr/lib/tex/ps}
  1841.   This environment variable determines where to search for header
  1842. files such as {\tt tex.pro}, font files, arguments to the
  1843. {\tt -h} option, and such files.
  1844. \descenv PRINTER,{\rm no default}
  1845.   This environment variable is read to determine which default printer
  1846. configuration file to read in.  Note that it is the responsibility of
  1847. the configuration file to send output to the proper print queue, if such
  1848. functionality is desired.
  1849. \descenv TEXFONTS,{/LocalLibrary/Fonts/TeXFonts/tfm:/usr/lib/tex/fonts/tfm}
  1850.   This is where \.{tfm} files are searched for.  A \.{tfm} file only
  1851. \^{{\tt tfm}}
  1852. needs to be loaded if the font is a resident (PostScript) font or if
  1853. for some reason no \.{pk} file could be found.
  1854. \descenv TEXPKS,{/LocalLibrary/Fonts/TeXFonts/pk:/usr/lib/tex/fonts/pk}
  1855. This environment variable is a path on which to search for \.{pk} fonts.
  1856. Certain substitutions are performed if a percent sign is found anywhere
  1857. \^{{\tt pk}}
  1858. in the path.  See the description of the {\tt P} configuration file
  1859. option for more information.
  1860. \descenv TEXINPUTS,{.:..:/usr/lib/tex/inputs}
  1861.   This environment variable is used to find PostScript figures when they
  1862. are included.
  1863. \descenv TEXCONFIG,{.:/usr/lib/tex/ps}
  1864.   This environment variable sets the directories to search for configuration
  1865. files, including the system-wide one.  Using this single environment variable
  1866. and the appropriate configuration files, it is possible to set up the program
  1867. for any environment.  (The other path environment variables can thus be
  1868. redundant.)
  1869. \descenv VFFONTS,{.:/usr/lib/tex/fonts/vf}
  1870.   This environment variable sets where \.{dvips} looks for virtual fonts.
  1871. A correct virtual font path is essential if PostScript fonts are to be
  1872. used.
  1873. \sec{Other Bells And Whistles}
  1874. For special effects, if any of the macros
  1875. \.{bop-hook}, \.{eop-hook}, \.{start-hook}, or \.{end-hook}
  1876. \^{{\tt bop-hook}}
  1877. \^{{\tt eop-hook}}
  1878. \^{{\tt start-hook}}
  1879. \^{{\tt end-hook}}
  1880. are defined in the PostScript \.{userdict}, they will be executed at the
  1881. beginning of a page, end of a page, start of the document, and end of
  1882. a document, respectively.
  1883. When these macros are executed, the default PostScript coordinate system
  1884. and origin
  1885. is in effect.  Such macros can be defined in headers added by the
  1886. \.{-h} option or the \.{header=}
  1887. special, and might be useful for writing, for instance, DRAFT across the
  1888. entire page, or, with the aid of a shell script, dating the document.
  1889. These macros are executed outside of the save/restore context of the
  1890. individual pages, so it is possible for them to accumulate information,
  1891. but if a document must be divided into sections because of memory
  1892. constraints, such added information will be lost across section breaks.
  1893. The two arguments to {\tt bop-hook} are the \TeX\ page number and
  1894. the sequence number of the page
  1895. in the file; the first page gets zero, the second one, etc.
  1896. The arguments to {\tt start-hook} are hsize, vsize, mag, hdpi, vdpi,
  1897. and the name of the \.{dvi} input file. The procedures
  1898. must leave these parameters on the stack.
  1899. The other hooks are not (currently)
  1900. given parameters, although this may change in the future.
  1901. As an example of what can be done, the following special will write
  1902. a light DRAFT across each page in the document:
  1903. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1904. \special{!userdict begin /bop-hook{gsave 200 30 translate
  1905. 65 rotate /Times-Roman findfont 216 scalefont setfont
  1906. 0 0 moveto 0.7 setgray (DRAFT) show grestore}def end}$endverb}
  1907. Note that using \.{bop-hook} or \.{eop-hook} in any way that preserves
  1908. information across pages will break compliance with the Adobe document
  1909. structuring conventions, so if you use any such tricks, it is recommended
  1910. that you also use the \.{-N} option to turn off structured comments.
  1911. Several of the above tricks can be used nicely together, and it is not
  1912. necessary that a `printer configuration file' be used only to set
  1913. printer defaults.  For instance, you might have a file \.{config.dated}
  1914. that contains just the two lines
  1915. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1916. E echo /bop-hook \{save /Times-Roman findfont 7 scalefont setfont \
  1917.                   72 756 moveto \(`date`\) show restore\} def >.date
  1918. h .date$endverb}
  1919. \noindent(with no newline following \.{setfont}); then the command-line option
  1920. \.{-Pdated} to \.{dvips} will print current date and time on the top
  1921. of each page of output.
  1922. Note that multiple \.{-P} options can be used.
  1923. \ifgeneric\else
  1924. \sec{MS-DOS}
  1925. The MS-DOS version of \.{dvips} differs from UNIX in the following ways.
  1926. \^{MS-DOS}
  1927. \item{$\bullet$} Path separators are \.{;} not \.{:}.
  1928. \item{$\bullet$} Directory separators are \.{\ttbackslash} not \.{/}.
  1929. \item{$\bullet$} The user's initialization file is \.{dvips.ini}
  1930.   not \.{.dvipsrc}.
  1931. \item{$\bullet$} Pipes to printers are not supported.  
  1932.   Output must go to a file.
  1933. \item{$\bullet$} \.{MakeTeXPk} is a batch file.  
  1934.   Since MS-DOS has insufficient memory to run both \.{dvips} and \MF\ 
  1935.   at the same time, this batch file will typically write out a set of 
  1936.   commands for running \MF\ later.  
  1937.   The \.{maketexp.bat} supplied writes out an \.{mfjob} file for em\TeX.
  1938. \item{$\bullet$} \.{dvidrv} from em\TeX\ can be used
  1939.   to automatically make fonts as follows:
  1940. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1941.     dvidrv dvips file.dvi $endverb}
  1942.   \.{dvidrv} sets an option \.{-pj=mfjobfile} for \.{dvips}, where 
  1943.   \.{mfjobfile} is the name of a temporary \.{mfjob} file.
  1944.   If there are missing fonts, \.{dvips} will write this \.{mfjob} file
  1945.   and then ask:
  1946. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1947.     Exit to make missing fonts now (y/n)? $endverb}
  1948.   If you answer yes, \.{dvips} exits with errorlevel 8 which tells 
  1949.   \.{dvidrv} to call \.{mfjob} to make the fonts, and then to call 
  1950.   \.{dvips} again.
  1951.   For this to work, \.{dvidrv}, \.{dvips}, \.{mfjob} and \.{mf} 
  1952.   must be located in the \.{PATH}, and the environment variables for 
  1953.   \.{mfjob} and \.{mf} set correctly.  
  1954.   A font mode must be set with the '\.{M}' option in \.{config.ps}.
  1955.   If the \.{-pj} option is set, dvips will not call \.{MakeTeXPk.bat}.
  1956. \item{$\bullet$} Limited em\TeX\ specials.  The following ones are supported:
  1957. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1958. \special{em:message xxx}
  1959. \special{em:point n}
  1960. \special{em:line a[h|v|p],b[h|v|p] [,width]}
  1961. \special{em:linewidth width}
  1962. \special{em:moveto}
  1963. \special{em:lineto}
  1964. \special{em:graph xxx[,width[,height]]} $endverb}
  1965. \item{}
  1966.   The line cut parameters \.{[h|v|p]} of the
  1967.   \.{\ttbackslash special{\char123}em:line ...{\char125}} command are ignored.
  1968.   Lines are ended with a rounded cap.
  1969.   A maximum of 1613 different point numbers are permitted on each page.
  1970.   The \.{\ttbackslash special{\char123}em:graph xxx{\char125}} 
  1971.   supports \.{PCX}, \.{MSP1}, \.{MSP2} and \.{BMP} files.
  1972.   The graph file may be scaled by giving an optional 
  1973.   width and height (expressed in the same way as \TeX\ dimensions).
  1974.   An example:
  1975. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1976.   \special{em:graph scrdump.pcx,100mm,75mm} $endverb}
  1977. The program \.{dvips} can use em\TeX\ font libraries created with the 
  1978. em\TeX\ \.{fontlib /2} option.
  1979. If a \.{pxl} font is found within a font library, \.{dvips} will complain,
  1980. and then ignore the \.{pxl} font.
  1981. The font library names and directory names can be specified with 
  1982. this configuration file option.
  1983. {\options
  1984. \def\o#1 #2:{{\tt #1} {\it #2}:}
  1985. \def\O#1:{{\tt #1}:}
  1986. \o L path:  The list of \.{fli} font libraries to search for bitmap \.{pk}
  1987.   font files is {\it path}.  
  1988. \^{{\tt fli}}
  1989.   Fonts are sought first in these libraries and then as single files.
  1990.   Font libraries can be created with em\TeX 's \.{fontlib}; the usual
  1991.   extension is \.{fli}.  Directories as well as file names can be 
  1992.   entered here, the files will be searched for in all these directories.
  1993.   A directory name must have trailing directory separator
  1994.   (\.{/} for UNIX, \.{\ttbackslash} for MS-DOS). \par }
  1995. \sec{OS/2}
  1996. The OS/2 version of \.{dvips} differs from UNIX in the following ways.
  1997. \^{OS/2}
  1998. \item{$\bullet$} Path separators are \.{;} not \.{:}.
  1999. \item{$\bullet$} Directory separators are \.{\ttbackslash} not \.{/}.
  2000. \item{$\bullet$} The user's initialization file is \.{dvips.ini}
  2001.   not \.{.dvipsrc}.
  2002. \item{$\bullet$} Printer configuration files are called \.{<priner-name>.cfg},
  2003.   not \.{config.<priner-name>}.
  2004. \item{$\bullet$} The environment variable defining the search patch to tfm files
  2005.   is called \.{TEXTFM}, not \.{TEXFONTS}.
  2006. \item{$\bullet$} \.{MakeTeXPk} is a \.{.cmd} file called \.{MakeTeXP.cmd}.
  2007.   It writes out an \.{mfjob} file for em\TeX\ and calles \.{mfjob}.
  2008. \item{$\bullet$} \.{dvidrv} from em\TeX\ can be used
  2009.   to automatically make fonts as follows:
  2010. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  2011.     dvidrv dvips file.dvi $endverb}
  2012.   \.{dvidrv} sets an option \.{-pj=mfjobfile} for \.{dvips}, where 
  2013.   \.{mfjobfile} is the name of a temporary \.{mfjob} file.
  2014.   If there are missing fonts, \.{dvips} will write this \.{mfjob} file
  2015.   and then ask:
  2016. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  2017.     Exit to make missing fonts now (y/n)? $endverb}
  2018.   If you answer yes, \.{dvips} exits with errorlevel 8 which tells 
  2019.   \.{dvidrv} to call \.{mfjob} to make the fonts, and then to call 
  2020.   \.{dvips} again.
  2021.   For this to work, \.{dvidrv}, \.{dvips}, \.{mfjob} and \.{mf} 
  2022.   must be located in the \.{PATH}, and the environment variables for 
  2023.   \.{mfjob} and \.{mf} set correctly.  
  2024.   A font mode must be set with the '\.{M}' option in \.{config.ps}.
  2025.   If the \.{-pj} option is set, dvips will not call \.{MakeTeXPk.bat}.
  2026. \item{$\bullet$} Limited em\TeX\ specials.  The following ones are supported:
  2027. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  2028. \special{em:message xxx}
  2029. \special{em:point n}
  2030. \special{em:line a[h|v|p],b[h|v|p] [,width]}
  2031. \special{em:linewidth width}
  2032. \special{em:moveto}
  2033. \special{em:lineto}
  2034. \special{em:graph xxx[,width[,height]]} $endverb}
  2035. \item{}
  2036.   The line cut parameters \.{[h|v|p]} of the
  2037.   \.{\ttbackslash special{\char123}em:line ...{\char125}} command are ignored.
  2038.   Lines are ended with a rounded cap.
  2039.   A maximum of 1613 different point numbers are permitted on each page.
  2040.   The \.{\ttbackslash special{\char123}em:graph xxx{\char125}} 
  2041.   supports \.{PCX}, \.{MSP1}, \.{MSP2} and \.{BMP} files.
  2042.   The graph file may be scaled by giving an optional 
  2043.   width and height (expressed in the same way as \TeX\ dimensions).
  2044.   An example:
  2045. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  2046.   \special{em:graph scrdump.pcx,100mm,75mm} $endverb}
  2047. The program \.{dvips} can use em\TeX\ font libraries created with the 
  2048. em\TeX\ \.{fontlib /2} option.
  2049. If a \.{pxl} font is found within a font library, \.{dvips} will complain,
  2050. and then ignore the \.{pxl} font.
  2051. The font library names and directory names can be specified with 
  2052. this configuration file option.
  2053. {\options
  2054. \def\o#1 #2:{{\tt #1} {\it #2}:}
  2055. \def\O#1:{{\tt #1}:}
  2056. \o L path:  The list of \.{fli} font libraries to search for bitmap \.{pk}
  2057.   font files is {\it path}.  
  2058. \^{{\tt fli}}
  2059.   Fonts are sought first in these libraries and then as single files.
  2060.   Font libraries can be created with em\TeX 's \.{fontlib}; the usual
  2061.   extension is \.{fli}.  Directories as well as file names can be 
  2062.   entered here, the files will be searched for in all these directories.
  2063.   A directory name must have trailing directory separator
  2064.   (\.{/} for UNIX, \.{\ttbackslash} for OS/2). \par }
  2065. \sec{Installation}
  2066. If \.{dvips} has not already been installed on your system, the
  2067. \^{installation}
  2068. following steps are all that are needed.
  2069. First update the \.{Makefile}---in particular, the paths.  Everything
  2070. concerning \.{dvips} can be adjusted in the \.{Makefile}.  Make sure
  2071. you set key parameters such as the default resolution, and make sure
  2072. that the path given for packed pixel files is correct.
  2073. Next, check the file name definitions in \.{MakeTeXPK}.  If you don't
  2074. \^{{\tt MakeTeXPK}}
  2075. have \MF\ installed, you cannot use \.{MakeTeXPK} to automatically
  2076. generate the fonts; you can, however, modify it to generate \.{pk}
  2077. fonts from \.{gf} fonts if you don't have a full set of \.{pk} fonts
  2078. but do have a set of \.{gf} fonts.  If you don't have that, you should
  2079. probably not install \.{MakeTeXPK} at all; this will disable automatic
  2080. font generation.
  2081. Now, check the configuration parameters in \.{config.ps}.  You should
  2082. also update the default resolution here.  This file is the
  2083. system-wide configuration file that will be automatically installed.
  2084. If you are unsure how much memory your PostScript printer has, print the
  2085. following file:
  2086. \cmd{\%! Hey, we're PostScript\\
  2087. /Times-Roman findfont 30 scalefont setfont 144 432 moveto\\
  2088. vmstatus exch sub 40 string cvs show pop showpage}
  2089. \noindent
  2090. Note that the number returned by this file is the total memory free;
  2091. it is often a good idea to tell \.{dvips} that the printer has somewhat
  2092. less memory.  This is because many programs download permanent macros
  2093. that can reduce the memory in the printer.  In general, a memory size
  2094. of about \.{300000} is plenty, since \.{dvips} can automatically split
  2095. a document if required.  It is unfortunate that PostScript printers with
  2096. much less virtual memory still exist.
  2097. Some systems or printers can dynamically increase the memory available
  2098. to a PostScript interpreter; for these systems, a value of one million
  2099. works well.
  2100. Next, run \.{make}.  Everything should compile smoothly.  You may need
  2101. to adjust the compiler options in the \.{Makefile} if something goes
  2102. amiss.
  2103. Once everything is compiled, run \.{make} \.{install}.  After this is done,
  2104. you may want to create a configuration file for each PostScript printer
  2105. at your site.
  2106. If the font caching is considered a security hole, make the `cache'
  2107. directory be something like \.{/tmp/pks}, and \.{cron} a job to move the
  2108. good \.{pk} files into the real directory.  Or simply disable this
  2109. feature by not installing \.{MakeTeXPK}.
  2110. Don't forget to install the new \.{vf} files and \.{tfm} files.  Note
  2111. that the \.{tfm} files distributed with earlier (pre-5.471) versions
  2112. of \.{dvips}, and all versions of other PostScript drivers, are different.
  2113. A test program called \.{test.tex} is provided, so you can easily check
  2114. that the most important parts of \.{dvips} have been installed properly.
  2115. \sec{Diagnosing Problems}
  2116. You've gone through all the trouble of installing \.{dvips}, carefully
  2117. read all the instructions in this manual, and still can't get something
  2118. to work.  This is all too common, and is usually caused by some broken
  2119. PostScript application out there.  The following sections provide some
  2120. helpful hints if you find yourself in such a situation.
  2121. In all cases, you should attempt to find the smallest file that causes
  2122. the problem.  This will not only make debugging easier, it will also
  2123. reduce the number of possible interactions among different parts of the
  2124. system.
  2125. \sub{Debug Options}
  2126. The \.{-d} flag to \.{dvips} is very useful for helping to track down
  2127. certain errors.  The parameter to this flag is an integer that tells
  2128. what errors are currently being tracked.  To track a certain class of
  2129. debug messages, simply provide the appropriate number given below;
  2130. if you wish to track multiple classes, sum the numbers of the classes
  2131. you wish to track.  The classes are:
  2132. $$\vbox{\halign{\hfil #\quad&#\hfil\cr
  2133. 1&specials\cr2&paths\cr4&fonts\cr8&pages\cr16&headers\cr
  2134. 32&font compression\cr64&files\cr
  2135. 128&memory\cr}}$$
  2136. \sub{No Output At All}
  2137. If you are not getting any output at all, even from the simplest
  2138. one-character file (for instance, \.{\char92~\char92 bye}),
  2139. then something is very wrong.  Practically any file sent to a
  2140. PostScript laser printer should generate some output, at the very
  2141. least a page detailing what error occurred, if any.  Talk to your
  2142. system administrator about downloading a PostScript error handler.
  2143. (Adobe distributes a good one called \.{ehandler.ps}.)
  2144. It is possible, especially if you are using non-Adobe PostScript,
  2145. that your PostScript interpreter is broken.  Even then it should
  2146. generate an error message.  I've tried to work around as many bugs
  2147. as possible in common non-Adobe PostScript interpreters, but I'm
  2148. sure I've missed a few.
  2149. If \.{dvips} gives any strange error messages, or compilation on your
  2150. machine generated a lot of warnings, perhaps the \.{dvips} program
  2151. itself is broken.  Carefully check the types in \.{dvips.h} and
  2152. the declarations in the \.{Makefile}, and try using the debug options
  2153. to determine where the error occurred.
  2154. It is possible your spooler is broken and is misinterpreting the
  2155. structured comments.  Try the \.{-N} flag to turn off
  2156. structured comments and see what happens.
  2157. \sub{Output Too Small or Inverted}
  2158. If some documents come out inverted or too small, your spooler is not
  2159. supplying an end of job indicator at the end of each file.  (This happens
  2160. a lot on small machines that don't have spoolers.)  You can
  2161. force \.{dvips} to do this with the \.{-F} flag, but note that this
  2162. generates files with a binary character (control-D) in them.  You can
  2163. also try using the \.{-s} flag to enclose the entire job in a save/restore
  2164. pair.
  2165. \sub{Error Messages From Printer}
  2166. If your printer returns error messages, the error message gives very
  2167. good information on what might be going wrong.  One of the most common
  2168. error messages is \.{bop undefined}.  This is caused by old versions
  2169. of Transcript and other spoolers that do not properly parse the setup
  2170. section of the PostScript.  To fix this, turn off structured comments
  2171. with the \.{-N} option, but make sure you get your spooling software
  2172. updated.  You might also try turning off comments on included files
  2173. with the \.{-K} option; many spoolers cannot deal with nested
  2174. documents.
  2175. Another error message is \.{VM exhausted}.  (Some printers indicate
  2176. this error by locking up; others quietly reset.)  This is caused by telling
  2177. \.{dvips} that the printer has more memory than it actually does, and
  2178. then printing a complicated document.  To fix this, try lowering the
  2179. parameter to \.{m} in the configuration file; use the debug option
  2180. to make sure you adjust the correct file.
  2181. Other errors may indicate that the graphics you are trying to include
  2182. don't nest properly in other PostScript documents, or any of a number of
  2183. other possibilities.  Try the output on a QMS PS-810 or other Adobe
  2184. PostScript printer; it might be a problem with the printer itself.
  2185. \sub{400 DPI Is Used Instead Of 300 DPI}
  2186. This common error is caused by not editing the \.{config.ps} file to
  2187. reflect the correct resolution for your site.  You can use the debug flags
  2188. (\.{-d64}) to see what files are actually being read.
  2189. \sub{Long Documents Fail To Print}
  2190. This is usually caused by incorrectly specifying the amount of memory
  2191. the printer has in \.{config.ps}; see the description above.
  2192. \sub{Including Graphics Fails}
  2193. The reasons why graphics inclusions fail are too numerous to mention.
  2194. The most common problem is an incorrect bounding box; read the section
  2195. on bounding boxes and check your PostScript file.  Complain very loudly
  2196. to whoever wrote the software that generated the file if the bounding
  2197. box is indeed incorrect.
  2198. Another possible problem is that the figure you are trying to include
  2199. does not nest properly; there are certain rules PostScript applications
  2200. should follow when generating files to be included.  The \.{dvips}
  2201. program includes work-arounds for such errors in Adobe Illustrator and
  2202. other programs, but there are certainly applications that haven't
  2203. been tested.
  2204. One possible thing to try is the \.{-K} flag, to strip the comments from
  2205. an included figure.  This might be necessary if the PostScript spooling
  2206. software does not read the structuring comments correctly.  Use of this
  2207. flag will break graphics from some applications, though, since some
  2208. applications read the PostScript file from the input stream looking for
  2209. a particular comment.
  2210. Any application which generates graphics output containing raw binary
  2211. (not hex) will probably fail with \.{dvips}.
  2212. \sub{Can't Find Font Files}
  2213. If \.{dvips} complains that it cannot find certain font files, it is
  2214. possible that the paths haven't been set up correctly for your system.
  2215. Use the debug flags to determine precisely what fonts are being looked
  2216. for and make sure these match where the fonts are located on your system.
  2217. \sub{Can't Generate Fonts}
  2218. This happens a lot if either \.{MakeTeXPK} hasn't been properly edited
  2219. and installed, or if the local installation of \MF\ isn't correct.
  2220. If \.{MakeTeXPK} isn't properly edited or isn't installed, an error
  2221. such as \.{MakeTeXPK not found} will be printed on the console.  The
  2222. fix is to talk to the person who installed \.{dvips} and have them fix
  2223. this.
  2224. If \MF\ isn't found when \.{MakeTeXPK} is running, make sure it is installed
  2225. on your system.  The person who installed \TeX\ should be able to install
  2226. \MF\ easily.
  2227. If \MF\ runs but generates fonts that are too large (and prints out the
  2228. name of each character as well as just a character number), then your
  2229. \MF\ base file probably hasn't been made properly.  To make a proper
  2230. \.{plain.base}, assuming the local mode definitions are contained in
  2231. \.{local.mf} (on the NeXT, \.{next.mf}; on the Amiga, \.{amiga.mf}),
  2232. type the following command (assuming \.{csh} under UNIX):
  2233. \cmd{localhost> inimf "plain; input local; dump"}
  2234. \noindent
  2235. Now, copy the \.{plain.base} file from the current directory to where
  2236. the base files are stored on your system.
  2237. Note that a preloaded \.{cmbase.base} should never be used when creating
  2238. fonts, and a program such as \.{cmmf} should never exist on the system.
  2239. The macros defined in \.{cmbase} will break fonts that do not use
  2240. \.{cmbase}; such fonts include the La\TeX\ fonts.  Loading the \.{cmbase}
  2241. macros when they are needed is done automatically and takes less than a
  2242. second---an insignificant fraction of the total run time of \MF\ for a
  2243. font, especially when the possibility of generating incorrect fonts is
  2244. taken into account.  If you create the La\TeX\ font {\tt circle10},
  2245. for instance, with the \.{cmbase} macros loaded, the characters will
  2246. have incorrect widths.
  2247. \sec{Using Color with dvips}
  2248. This new feature of \.{dvips} is somewhat experimental so your
  2249. experiences and comments are welcome.  Initially added by Jim Hafner,
  2250. IBM Research, {\tt hafner@almaden.ibm.com}, the color support has
  2251. gone through many changes by Tomas Rokicki.  Besides the changes to the
  2252. source code itself, there are additional
  2253. \TeX\ macro files: \.{colordvi.tex} and \.{blackdvi.tex}.  There are also
  2254. \.{.sty} versions of these files that can be used with La\TeX\ and
  2255. other similar macro packages.  This feature adds one-pass multi-color
  2256. printing of \TeX\ documents on any color PostScript device.
  2257. In this section we describe the use of color from the document
  2258. preparer's point of view and then add some simple instructions on
  2259. installation for the system administrator.
  2260. \sub{The Macro Files}
  2261. All the color macro commands are defined in \.{colordvi.tex} (or
  2262. \.{colordvi.sty}).  To access these macros simply add to the top of your
  2263. \TeX\ file the command
  2264. \cmd{\ttbackslash input colordvi}
  2265. \noindent
  2266. or, if your document uses style files like La\TeX, add the \.{colordvi}
  2267. style option as in 
  2268. \cmd{\ttbackslash documentstyle[12pt,colordvi]\char123article\char125}
  2269. There are basically two kinds of color macros, ones for local color
  2270. changes to, say, a few words or even one symbol and one for global
  2271. color changes.  Note that all the color names use a mixed case scheme.
  2272. There are 68 predefined colors, with names taken primarily from the
  2273. Crayola crayon box of 64 colors, and one pair of macros for the user
  2274. to set his own color pattern.  More on this extra feature later. You
  2275. can browse the file \.{colordvi.tex} for a list of the predefined colors.
  2276. The comments in this file also show a rough correspondence between the
  2277. crayon names and PANTONEs.
  2278. A local color command is in the form
  2279. \cmd{\ttbackslash ColorName\char123this will print in color\char125}
  2280. \noindent
  2281. Here \.{ColorName} is the name of a predefined color. As this example
  2282. shows, this type of command takes one argument which is the text that
  2283. is to print in the selected color.  This can be used for nested color
  2284. changes since it restores the original color state when it completes.
  2285. For example, suppose you were writing in green and want to switch
  2286. temporarily to red, then blue, back to red and restore green.  Here is
  2287. one way that you can do this:
  2288. \cmd{This text is green but here we are \ttbackslash Red\char123switching 
  2289. to red, \\
  2290. \ttbackslash Blue\char123nesting blue\char125, recovering the 
  2291. red\char125\ and back to \\
  2292. original green.}
  2293. \noindent
  2294. In principle there is no limit to the nesting level, but it is not
  2295. advisable to nest too deep lest you lose track of the color history.
  2296. The global color command has the form
  2297. \cmd{\ttbackslash textColorName}
  2298. \noindent 
  2299. This macro takes no arguments and immediately changes the default
  2300. color from that point on to the specified color. This of course can be
  2301. overriden globally by another such command or locally by local color
  2302. commands. For example, expanding on the example above, we might have
  2303. \cmd{\ttbackslash textGreen \\
  2304. This text is green but here we are \ttbackslash Red\char123switching 
  2305. to red, \\
  2306. \ttbackslash Blue\char123nesting blue\char125, recovering the 
  2307. red\char125\ and back to \\
  2308. original green.\\
  2309. \ttbackslash textCyan \\
  2310. The text from here on will be cyan unless \\
  2311. \ttbackslash Yellow\char123locally changed to yellow\char125. Now we
  2312. are back to cyan.} 
  2313. The color commands will even work in math mode and across math mode
  2314. boundaries.  This means that if you have a color before going into
  2315. math mode, the mathematics will be set in that color as well.  More
  2316. importantly however, in alignment environments like \.{\ttbackslash
  2317. halign}, \.{tabular} or \.{eqnarray}, local color commands cannot
  2318. extend beyond the alignment characters.
  2319. Because local color commands respect only some environment and
  2320. delimiter changes besides their own, care must be taken in setting
  2321. their scope.  It is best not to have then stretch too far.
  2322. At the present time there are no macros for color environments in
  2323. La\TeX\ which might have a larger range.  This is primarily to keep
  2324. the \TeX\ and La\TeX\ use compatible. 
  2325. \sub{User Definable Colors}
  2326. There are two ways for the user to specify colors not already defined.
  2327. For local changes, there is the command \.{\ttbackslash Color} which
  2328. takes two arguments.  The first argument is a quadruple of numbers
  2329. between zero and one and specifies the intensity of cyan, magenta,
  2330. yellow and black (CMYK) in that order.  The second argument is the
  2331. text that should appear in the given color.  For example, suppose you
  2332. want the words ``this color is pretty'' to appear in a color which is
  2333. 50\% cyan, 85\% magenta, 40\% yellow and 20\% black.  You would use
  2334. the command
  2335. \cmd{\ttbackslash Color\char123{.5 .85 .4 .2}\char125\char123 this
  2336. color is pretty\char125}
  2337. For global color changes, there is a command \.{\ttbackslash
  2338. textColor} which takes one argument, the CMYK quadruple of relative
  2339. color intensities.  For example, if you want the default color to be
  2340. as above, then the command
  2341. \cmd{\ttbackslash textColor\char123{.5 .85 .4 .2}\char125 \\
  2342. The text from now on will be this pretty color} 
  2343. \noindent
  2344. will do the trick.
  2345. Making a global color change in the midst of nested local colors is
  2346. highly discouraged.  Consequently, \.{dvips} will give you warning
  2347. message and do its best to recover by discarding the current color
  2348. history.
  2349. \sub{Subtleties in Using Color}
  2350. These color macros are defined by use of specialized \.{\ttbackslash
  2351. special} keywords.  As such, they are put in the \.{.dvi} file only as
  2352. explicit message strings to the driver.  The (unpleasant)
  2353. result is that certain unprotected regions of the text can have
  2354. unwanted color side effects.  For example, if a color region is split
  2355. by \TeX\ across a page boundary, then the footers of the current page
  2356. (e.g., the page number) and the headers of the next page can inherit
  2357. that color.  To avoid this effect globally, users should make sure
  2358. that these special regions of the text are defined with their own
  2359. local color commands.  For example in \TeX, to protect the header and
  2360. footer, use 
  2361. \cmd{\ttbackslash headline\char123\ttbackslash Black\char123 My
  2362. Header\char125\char125 \\
  2363. \ttbackslash footline\char123\ttbackslash Black\char123 \ttbackslash
  2364. hss\ttbackslash tenrm\ttbackslash folio\ttbackslash hss\char125\char125} 
  2365. This warning also applies to figures and other insertions, so be
  2366. careful!
  2367. Of course, in La\TeX, this is much more difficult to do because of the
  2368. complexity of the macros that control these regions.  This is
  2369. unfortunate, but is somehow inevitable because \TeX\ and La\TeX\ were
  2370. not written with color in mind.
  2371. Even when writing your own macros, much care must be taken.  The
  2372. color macros that `colorize' a portion of the text work by prefixing
  2373. the text with a special command to turn the color on and postfixing it
  2374. with a different special command to restore the original color.
  2375. It is often useful to insure that \TeX\ is in horizontal mode before
  2376. the first special command is issued; this can be done by prefixing the
  2377. color command with {\tt\char92 leavevmode}.
  2378. \sub{Printing in Black/White, after Colorizing}
  2379. If you have a \TeX\ or La\TeX\ document written with color macros and
  2380. you want to print it in black and white there are two options.  On all
  2381. (good) PostScript devices, printing a color file will print in
  2382. corresponding grey-levels.  This is useful since in this way you can
  2383. get a rough idea of where the colors are changing without using
  2384. expensive color printing devices.  The second option is to replace the
  2385. call to input \.{colordvi.tex} with \.{blackdvi.tex} (and similarly for the
  2386. \.{.sty} files).  So in the above example, replacing the word
  2387. \.{colordvi} with \.{blackdvi} suffices.  This file defines the color macros
  2388. as no-ops, and so will produce normal black/white printing.  By this
  2389. simple mechanism, the user can switch to all black/white printing
  2390. without having to ferret out the color commands.  Also, some device
  2391. drivers, particularly non-PostScript ones like screen previewers, will
  2392. simply ignore the color commands and so print in normal black/white.
  2393. Hopefully, in the future screen previewers for color displays will be
  2394. compatible with some form of color support.
  2395. \sub{Configuring dvips for Color Devices}
  2396. To configure dvips for a particular color device you need to fine tune
  2397. the color parameters to match your device's color rendition.  To do
  2398. this, you will need a PANTONE chart for your device.  The header file
  2399. \.{color.lpro} shows a (rough) correspondence between the Crayola
  2400. crayon names and the PANTONE numbers and also defines default CMYK
  2401. values for each of the colors.  Note that these colors must be defined
  2402. in CMYK terms and not RGB as \.{dvips} outputs PostScript color
  2403. commands in CMYK.  This header file also defines (if they are not
  2404. known to the interpreter) the PostScript commands \.{setcmykcolor} and
  2405. \.{currentcmykcolor} in terms of a RGB equivalent so if your device
  2406. only understands RGB, there should be no problem.
  2407. The parameters set in this file were determined by comparing the
  2408. PANTONE chart of a Tektronics PHASER printer with the actual Crayola
  2409. Crayons.  Because these were defined for a particular device, the
  2410. actual color rendition on your device may be very different.  There
  2411. are two ways to adjust this.  One is to use the PANTONE chart for your
  2412. device to rewrite \.{color.lpro} prior to compilation and
  2413. installation.  A better alternative, which supports multiple devices,
  2414. is to add a header file option in the configuration file for each
  2415. device that defines, in \.{userdict}, the color parameters for those
  2416. colors that need redefining.
  2417. For example, if you need to change the parameters defining
  2418. \.{Goldenrod} (approximately PANTONE 109) for your device
  2419. \.{mycolordev}, do the following.  In the PANTONE chart for your
  2420. device, find the CMYK values for PANTONE 109.  Let's say they are
  2421. \.{\char123\ 0 0.10 0.75 0.03 \char125}. Then create a header file
  2422. named \.{mycolordev.pro} with the commands
  2423. \cmd{userdict begin \\
  2424. /Goldenrod \char123\ 0 0.10 0.75 0.03 setcmykcolor\char125\ bind def}
  2425. \noindent
  2426. Finally, in \.{config.mycolordev} add the line 
  2427. \cmd{h mycolordev.pro}
  2428. \noindent
  2429. This will then define \.{Goldenrod} in your device's CMYK values in
  2430. \.{userdict} which is checked before defining it in \.{TeXdict} by
  2431. \.{color.pro}.
  2432. This mechanism, together with additions to \.{colordvi.tex} and
  2433. \.{blackdvi.tex} (and the \.{.sty} files), can also be used to predefine
  2434. other colors for your users.
  2435. \sub{Protecting Regions From Spurious Colors}
  2436. Because color is defined via \TeX's {\tt\ttbackslash special} command,
  2437. it cannot be sensitive to the output routine or certain regions of the
  2438. page like the header and footer.  Consequently, these regions need to
  2439. be protected from spurious color changes (particularly when local
  2440. colors spread across page breaks).
  2441. Users need to be aware of the possibility of certain regions getting
  2442. unwanted or unpredicted colors.  Headers and footers are most
  2443. worrisome so style designers who want to use color should keep this in
  2444. mind.
  2445. One particular region of text that gets spurious color effects is
  2446. labels in list environments.  For instance, because of the way list
  2447. items are defined in standard La\TeX, the bullet for items that
  2448. start with a different color also gets drawn in that color.
  2449. To give the user a simple mechanism to solve this problem (and other
  2450. unforeseen effects of this type) one other special macro is
  2451. automatically defined.  This macro is called {\tt\ttbackslash
  2452. globalColor}.  It is actually a {\it local\/} color macro and so takes
  2453. a single argument.  But the color effect it produces is always the
  2454. same as that set by the {\it last\/} {\tt\ttbackslash textColor} or
  2455. {\tt\ttbackslash textColorName} command.  In effect, when a
  2456. {\tt\ttbackslash textColorName} command is called, {\tt\ttbackslash
  2457. globalColor} gets a new definition equivalent to the local
  2458. {\tt\ttbackslash ColorName} macro.  For example, when the default is
  2459. black, {\tt\ttbackslash globalColor=\ttbackslash Black} and when
  2460. {\tt\ttbackslash textGreen} appears, {\tt\ttbackslash
  2461. globalColor=\ttbackslash Green}.  This special macro can then be used
  2462. to protect sensitive regions of the text.
  2463. For example, in La\TeX\ files, one might make sure that the header and
  2464. footers have {\tt\ttbackslash globalColor} wrapping their contents.
  2465. In this way, they will inherit the current active root (unnested)
  2466. color state.
  2467. \sub{Color Support Details}
  2468. To support color, \.{dvips} recognizes a certain set of specials.
  2469. These specials all start with the keyword \.{color} or the keyword
  2470. \.{background}.
  2471. We will describe \.{background} first, since it is the simplest.
  2472. The \.{background} keyword must be followed by a color specification.
  2473. That color specification is used as a fill color for the background.
  2474. The last \.{background} special on a page is the one that gets issued,
  2475. and it gets issued at the very beginning of the page, before any
  2476. text or specials are sent.  (This is possible because the prescan
  2477. phase of \.{dvips} notices all of the color specials so that the
  2478. appropriate information can be written out during the second phase.)
  2479. Ahh, but what is a color specification?  It is one of three things.
  2480. First, it might be a PostScript procedure as defined in a PostScript header
  2481. file.  The \.{color.pro} file defines 64 of these, including
  2482. \.{Maroon}.  This PostScript procedure must set the current color to be
  2483. some value; in this case, \.{Maroon} is defined as
  2484. \.{0 0.87 0.68 0.32 setcmykcolor}.
  2485. The second possibility is the name of a color model (initially, one of
  2486. \.{rgb}, \.{hsb}, \.{cmyk}, or \.{gray}) followed by the appropriate
  2487. number of parameters.  When \.{dvips} encounters such a macro, it sends
  2488. out the parameters first, followed by the string created by prefixing
  2489. \.{TeXcolor} to the color model.  Thus, the color specification
  2490. \.{rgb 0.3 0.4 0.5} would generate the PostScript code \.{0.3 0.4 0.5
  2491. TeXrgbcolor}.  Note that the case of zero arguments is disallowed, as
  2492. that is handled by the single keyword case above (where no changes to
  2493. the name are made before it is sent to the PostScript file.)
  2494. The third and final type of color specification is a double quote followed
  2495. by any sequence of PostScript.  The double quote is stripped from the
  2496. output.  For instance, the color specification \.{"AggiePattern setpattern}
  2497. will set the `color' to the Aggie logo pattern (assuming such exists.)
  2498. So those are the three types of color specifications.  The same type of
  2499. specifications are used by both the {\tt background} special and the
  2500. {\tt color} special.  The {\tt color} special itself has three forms.
  2501. The first is just {\tt color} followed by a color specification.  In
  2502. this case, the current global color is set to that color; the color stack
  2503. must be empty when such a command is executed.
  2504. The second form is {\tt color push} followed by a color specification.
  2505. This saves the current color on the color stack and sets the color
  2506. to be that given by the color specification.  This is the most common
  2507. way to set a color.
  2508. The final version of the {\tt color} special is just {\tt color pop},
  2509. with no color specification; this says to pop the color last pushed
  2510. on the color stack from the color stack and set the current color to
  2511. be that color.
  2512. The {\tt dvips} program correctly handles these color specials
  2513. across pages, even when the pages are repeated or reversed.
  2514. These color specials can be used for things such as patterns or
  2515. screens as well as simple colors.  However, note that in the
  2516. PostScript, only one `color specification' can be active at a
  2517. time.  For instance, at the beginning of a page, only the
  2518. bottommost entry on the color stack is sent; also, when a color
  2519. is `popped', all that is done is that the color specification
  2520. from the previous stack entry is sent.  No \.{gsave} or \.{grestore}
  2521. is used.  This means that you cannot easily mix usage of the 
  2522. {\tt color} specials for screens and colors, just one or the other.
  2523. This may be addressed in the future by adding support for
  2524. different `categories' of color-like state.
  2525.