home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fonts 1 / freshfonts1.bin / bbs / programs / amiga / pastex13.lha / DVIPS / dvips5519.lha / dvips / dvips.tex (.txt) < prev    next >
Texinfo Document  |  1993-07-08  |  134KB  |  2,533 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. \.{-u}
  825. This option indicates that \.{afm2tfm} should use only those
  826. characters that are required by the output encoding, and no
  827. others.  Normally, \.{afm2tfm}
  828. tries to include both characters that fit the output encoding
  829. and any additional characters that might exist in the font.
  830. This option forbids those additional characters from being
  831. added.
  832. \.{-v {\it file}}
  833. Generate a virtual property list \.{vpl} file as well as a \.{tfm} file.
  834. \.{-V {\it file}}
  835. Same as \.{-v}, but the virtual font generated is a small caps font obtained
  836. by scaling uppercase letters by 0.8 to typeset lowercase. This font
  837. handles accented letters and retains proper kerning.\par}
  838. \sub{Non-Resident PostScript Fonts}
  839. If you want to use a non-printer-resident PostScript font for which you have
  840. a \.{pfb} or \.{pfa} file (an Adobe Type 1 font program),
  841. you can make it act like
  842. \^{{\tt pfb}}
  843. a resident font by putting a `{\tt <}' sign
  844. and the name of the \.{pfb} or \.{pfa} file just after the font name in the
  845. \.{psfonts.map}
  846. \^{{\tt psfonts.map}}
  847. file entry. For example,
  848. \cmd{rpstrn StoneInformal <StoneInformal.pfb}
  849. \noindent
  850. will cause \.{dvips} to include \.{StoneInformal.pfb} in your document as if
  851. it were a header file, whenever the pseudo-resident font StoneInformal is
  852. used in a document.   Similarly, you can generate transformed fonts and
  853. include lines like
  854. \cmd{rpstrc StoneInformal <StoneInformal.pfb ".8 ExtendFont"}
  855. \noindent
  856. in \.{psfonts.map}, in which case \.{StoneInformal.pfb} will be loaded
  857. whenever StoneInformal-Condensed is used. (Each header file is loaded
  858. at most once per PostScript file. The \.{pfb} files should be
  859. installed in the \.{dvips} header directory [usually {\tt
  860. /usr/lib/tex/ps}] with the other header files.)
  861. If you are using a {\tt pfb} file that has different PostScript
  862. encodings, you would need to
  863. multiple header files for that font in {\tt psfonts.map}.  If, for instance,
  864. {\tt StoneInformal} was both non-resident and you wanted to reencode
  865. it in PostScript with {\tt MyEncoding} stored in {\tt myenc.enc}, a line
  866. such as
  867. \vskip\baselineskip
  868. \centerline{\tt rpstrnx StoneInformal "MyEncoding ReEncodeFont" <myenc.enc
  869. <StoneInformal.pfb}
  870. When using such files, \.{dvips} is smart enough to unpack the standard
  871. binary \.{pfb} format into ASCII so there is no need to perform this
  872. conversion yourself.  In addition, it will scan the font to determine
  873. its memory usage, as it would for any header file.
  874. \sub{Font Aliases}
  875. Some systems don't handle files with long names well---MS-DOS is
  876. \^{MS-DOS}
  877. a notable example.  For this reason, \.{dvips} will accept an alias for such
  878. fonts.  Such an alias should be the first word in the \.{psfonts.map}
  879. line.  For instance, if we wanted the name \.{rptmr} to be used for the
  880. raw \.{Times-Roman} since our computer can't handle long names or,
  881. alternatively, we want to follow the standard naming conventions, we would use
  882. the following line in our
  883. \.{psfonts.map} file:
  884. \cmd{rptmr Times-Roman}
  885. \noindent
  886. The \.{tfm} file must have the name \.{rptmr.tfm}.
  887. \^{{\tt tfm}}
  888. The distribution file \.{adobe} contains a list of the short names that
  889. should be used for most Adobe fonts currently available.  Please reference
  890. this file when installing a new font and use the standard name.
  891. The parsing of the \.{psfonts.map}
  892. \^{{\tt psfonts.map}}
  893. file should be explained to eliminate all confusion.  If a line is
  894. empty or begins with a space, asterisk, semicolon, or hash mark, it is
  895. ignored.  Each remaining line is separated into words, where words are
  896. separated by spaces or tabs.  If a word begins with a double quote, it
  897. extends until the next double quote or the end of the line.  If a word
  898. starts with a less than character, it is treated as a font header file
  899. (or a downloaded PostScript font).  There can be more than one such
  900. header for a given font.  If a word starts with a double quote, it is
  901. a special instruction for generating that font.  Otherwise it is a
  902. name.  The first such name is always the name \TeX\ uses for the font
  903. and is also the name of the raw \.{tfm} file.  If there is another
  904. name word, that name is used as the PostScript name; if there is only
  905. one name word, it is used for both the \TeX\ name and the PostScript
  906. name.
  907. Note that \.{dvips} no longer registers the full PostScript name if an
  908. alias is given, so the single line
  909. \cmd{rptmr Times-Roman}
  910. \noindent
  911. would only allow \.{dvips} to find the \.{rptmr} font and not the
  912. \.{Times-Roman} font.
  913. \sec{Font Naming Conventions}
  914. {\def\journal#1{{\sl #1}}
  915. \def\table{\vbox\bgroup
  916. \vskip\parskip\halign\bgroup\strut\indent\tt ##\hfil\quad
  917.     &\vtop{%
  918.        \advance\hsize by -\parindent % The \indent in the first column.
  919.        \advance\hsize by -1em        % The \quad.
  920.        % One table has two-letter abbreviations.
  921.        \advance\hsize by -2\fontdimen7\tentt
  922.        \rm\noindent ##}\hfil
  923.     \cr}
  924. \def\setuphsize{%
  925.        \advance\hsize by -\parindent % The \indent in the first column.
  926.        \divide\hsize by 2            % double column
  927.        \advance\hsize by -1.5em      % The 3 \quads divided by 2.
  928.        % One table has two-letter abbreviations.
  929.        \advance\hsize by -2\fontdimen7\tentt}
  930. \def\dtable{\vbox\bgroup\vskip\parskip\halign\bgroup\strut
  931.     \indent##&\tt ##\hfil\quad
  932.     &\vtop{\setuphsize\rm\noindent ##}\hfil&\quad\tt ##\hfil\quad
  933.     &\vtop{\setuphsize\rm\noindent ##}\hfil\cr}
  934. \def\endtable{%
  935.   \egroup\egroup % End the \halign.
  936.   \smallskip % I don't know what kind of space you want, but it needs
  937.              %  something here.
  938. \def\entry#1#2{#1\cr}
  939. \def\mitem{\item{$\bullet$}}
  940. \def\\{\hfil\break}
  941. This section of the manual has been written by Karl Berry and
  942. specifies a standard for naming fonts for \TeX.  This standard has
  943. been adopted in \.{dvips}, and it is recommended that it be followed
  944. where possible.
  945. As more typeface families become available for use with \TeX, the need
  946. for a consistent, rational naming scheme for the font filenames
  947. concomitantly grows. Some (electronic) discussion has gone into the
  948. following proposal; I felt it was appropriate now to bring it before a
  949. wider community.  In some respects, it follows and simplifies
  950. Mittelbach and Sch\"opf's article in \journal{TUGboat}, volume~11,
  951. number~2 (June 1990).
  952. Here are some facts about fonts that went into the hopper when creating
  953. this proposal:
  954. \mitem \TeX\ runs on virtually all computers, under almost as many operating
  955. systems, all with their own idea of how files should be named.  Any
  956. proposal regarding filenames, therefore, must cater to the lowest common
  957. denominator.  That seems to be eight characters in length, not counting any
  958. extension, and with case being insignificant.  Characters other
  959. than letters and numerals are probably unusable.
  960. \mitem Most typefaces are offered by several vendors.  The version
  961. offered by vendor~A is not compatible with that of vendor~B.
  962. \mitem Typefaces typically come in different weights (hairline to extra
  963. heavy), different expansions (ultra condensed to wide), and an
  964. open-ended range of variants (italic, sans serif, typewriter,
  965. shadow,~$\ldots$).  No accepted standards exist for any of these
  966. qualities, nor are any standards ever likely to gain acceptance.
  967. \mitem The Computer Modern typeface family preserves traditional typesetting
  968. practice in at least one important respect: different sizes of the same
  969. font are not scaled linearly.  This is in contrast to most commercial fonts
  970. available.
  971. Here is how I propose to divide up the eight characters:
  972. \cmd{FTTWVEDD}
  973. \noindent
  974. where
  975. \mitem \.{F} represents the foundry that produced the font, and is omitted
  976. if there isn't one.
  977. \mitem \.{TT} represents the typeface name.
  978. \mitem \.W represents the weight.
  979. \mitem \.V represents the variant, and is omitted if both it and the
  980. expansion are ``normal''.
  981. \mitem \.E represents the expansion, and is omitted if it is ``normal''.
  982. \mitem \.{DD} represents the design size, and is omitted if the font is
  983. linearly scaled from a single {\tt tfm} file.
  984. See the section on virtual fonts (towards the end) for an exception to
  985. the above.
  986. The weight, variant, and expansion are probably all best taken from the
  987. original source of the typeface, instead of trying to relate them to
  988. some external standard.
  989. Before giving the lists of abbreviations, let me point out two problems,
  990. to neither of which I have a good solution.  1)~Assuming that only the
  991. English letters are used, two letters is enough for only 676 typeface
  992. families (even assuming we want to use all possible combinations, which
  993. is doubtful).  There are many more than 676 typeface families in the
  994. world.  2)~Fonts with design sizes over 100$\,$pt are not common, but
  995. neither are they unheard of.
  996. On to the specifics of the lists.  If you adopt this proposal at your
  997. own installation, and find that you have fonts with some property I
  998. missed, please write to me (see the end of the article for various
  999. addresses), so I can update the lists.  You can get the
  1000. most up-to-date version of these lists electronically, by anonymous ftp
  1001. from the host \.{ftp.cs.umb.edu}.  I will also send them to you by
  1002. electronic mail, if necessary.
  1003. I give the letters in lowercase, which is preferred on systems where
  1004. case is significant.  Most lists are in alphabetical order by the
  1005. abbreviations.
  1006. \sub{Foundry}
  1007. This is the current list of foundries.
  1008. \table
  1009. a&Autologic\cr
  1010. b&Bitstream\cr
  1011. c&Agfa-Compugraphic\cr
  1012. g&Free Software Foundation ({\tt g} for GNU)\cr
  1013. h&Bigelow \& Holmes (with apologies to Chuck)\cr
  1014. i&International Typeface Corporation\cr
  1015. p&Adobe ({\tt p} for PostScript)\cr
  1016. r&reserved for use with virtual fonts; see below\cr
  1017. s&Sun\cr
  1018. \endtable
  1019. \sub{Typeface Families}
  1020. The list of typefaces is:
  1021. \dtable
  1022. &ad&Adobe Garamond&go&Goudy Oldstyle\cr
  1023. &ag&Avant Garde&gs&Gill Sans\cr
  1024. &ao&Antique Olive&jo&Joanna\cr
  1025. &at&American Typewriter&lc&Lucida\cr
  1026. &bb&Bembo<&Lutetia\cr
  1027. &bd&Bodoni&nc&New Century Schoolbook\cr
  1028. &bg&Benguiat&op&Optima\cr
  1029. &bk&Bookman&pl&Palatino\cr
  1030. &bl&Balloon&pp&Perpetua\cr
  1031. &bv&Baskerville&rw&Rockwell\cr
  1032. &bw&Broadway&st&Stone\cr
  1033. &cb&Cooper Black&sy&Symbol\cr
  1034. &cl&Cloister&tm&Times\cr
  1035. &cr&Courier&un&Univers\cr
  1036. &cn&Century&uy&University\cr
  1037. &cs&Century Schoolbook&zc&Zapf Chancery\cr
  1038. &hv&Helvetica&zd&Zapf Dingbats\cr
  1039. &gm&Garamond&&\cr
  1040. \endtable
  1041. \sub{Weight}
  1042. This is a list of the possible weights,
  1043. roughly in order from lightest to heaviest.
  1044. \dtable
  1045. &a&hairline&d&demi\cr
  1046. &t&thin&s&semi\cr
  1047. &i&extra light&b&bold\cr
  1048. &l&light&x&extra bold\cr
  1049. &k&book&h&heavy\cr
  1050. &r®ular&c&black\cr
  1051. &m&medium&u&ultra\cr
  1052. \endtable
  1053. \sub{Variants}
  1054. The variants are:
  1055. \dtable
  1056. &a&alternate&n&informal\cr
  1057. &b&bright&o&oblique (i.e., slanted)\cr
  1058. &c&small caps&r&normal (roman or sans)\cr
  1059. &e&engraved&s&sans serif\cr
  1060. &g&grooved (as in the IBM logo)&t&typewriter\cr
  1061. &h&shadow&u&unslanted italic\cr
  1062. &i&(text) italic&x&expert\cr
  1063. &l&outline&&\cr
  1064. \endtable
  1065. If the variant is {\tt r}, and the expansion is also normal, both the
  1066. variant and the expansion are omitted.  When the normal version of the
  1067. typeface is sans serif (e.g., Helvetica), \.{r} should be used,
  1068. not \.{s}.  Use \.{s} only when the typeface family
  1069. has both serif and sans serif variants.  The ``alternate'' variant
  1070. (\.{a}) is used by some Adobe fonts that have spiffy swashes and
  1071. additional ligatures.
  1072. The ``expert'' variant (\.{x}) is also used by some Adobe
  1073. fonts with oldstyle figures and small caps.
  1074. Some fonts have multiple variants; Stone Informal Italic, for example.
  1075. The only reasonable approach to these is to list all the letters for all
  1076. the variants, choosing one to end with that is not also an expansion
  1077. letter.  Of course, it is possible that the name will become too
  1078. long if you do this, but $\ldots$ well, I'm open to suggestions.  It's
  1079. also possible the name will be ambiguous, if some new letter is used for
  1080. expansions in the future.  You can avoid this problem by adding the
  1081. expansion \.{r} (if it doesn't make the name too long), and
  1082. never using \.{r} for the last variant.
  1083. \sub{Expansion}
  1084. This is a list of the possible expansions, in order from narrowest to
  1085. widest.
  1086. \dtable
  1087. &o&extra condensed&x&extended (by hand)\cr
  1088. &c&condensed (by hand)&e&expanded (automatic)\cr
  1089. &n&narrow (automatic)&w&wide\cr
  1090. &r&\multispan3{regular, normal, medium (usually omitted)\hfil}\cr
  1091. \endtable
  1092. Expansion of fonts is sometimes done automatically (as in PostScript
  1093. {\bf scale}), and sometimes done by humans.  I chose `narrow' and
  1094. `expanded' to imply the former, and `condensed' and `extended' to imply
  1095. the latter, as I believe this reflects common usage.
  1096. \sub{Naming Virtual Fonts}
  1097. In concert with releasing \TeX~3.0 and \MF~2.0, Don Knuth wrote two new
  1098. utility programs: \.{VFtoVP} and \.{VPtoVF}, which convert
  1099. to and from ``virtual'' fonts.  Virtual fonts provide a general
  1100. interface between the writers of \TeX\ macros and font suppliers.
  1101. In general, therefore, it is impossible to come up with a general scheme
  1102. for naming virtual fonts, since each virtual font is an individual
  1103. creation, possibly bringing together many unrelated fonts.
  1104. Nevertheless, one common case is to use virtual fonts to map \TeX's
  1105. default accent and other character code conventions onto a
  1106. vendor-supplied font.  For example, \.{dvips}
  1107. does this for fonts given in the PostScript ``standard encoding''.
  1108. In this case, each font consists of a ``virtual'' \.{tfm} file, which is
  1109. what \TeX\ uses, a ``raw'' \.{tfm} file, which corresponds to the actual
  1110. device font, and a \.{vf} file, which describes the relationship between the
  1111. This adds another dimension to the space of font names, namely,
  1112. ``virtualness'' (or rather, ``rawness'', since it is the virtual \.{tfm}
  1113. files that the users want to see).  But we have already used up all
  1114. eight characters in the font names.
  1115. The best solution I have been able to think of is this: prepend
  1116. \.{r} to the raw \.{tfm} files; the virtual \.{tfm} files should be
  1117. named with the usual foundry prefix.  For example, the virtual
  1118. Times-Roman tfm file is named \.{ptmr}, as usual; the raw Times-Roman
  1119. \.{tfm} file is named \.{rptmr}.  To prevent intolerable confusion, I
  1120. promise never to give a foundry the letter \.{r}.
  1121. This scheme will work only as long as the virtualized fonts do not have
  1122. design sizes; if they do, another foundry letter will have to be
  1123. allocated, it seems to me.
  1124. A pox upon the houses of those who decided on fixed-length filenames!
  1125. \sub{Examples}
  1126. In closing, I will give two examples.  First, the fonts in the Univers
  1127. typeface family were assigned numbers by its designer, Adrien Frutiger. 
  1128. (You can see the scheme on, for example, page~29 of {\sl The Art of
  1129. Typo.icon.ography}, by Martin Solomon.)  Naturally, we want to give
  1130. them names.
  1131. \vskip\baselineskip\vbox{%
  1132. \halign to\hsize{\hskip20pt\tt #\hfil\space&#\hfil\quad\tabskip=0pt plus 1in
  1133. &\tt #\hfil\space\tabskip=0pt&#\hfil\cr
  1134. unl&45 (light)&unmro&59 (medium extra condensed)\cr
  1135. unli&46 (light italic)&undrx&63 (demibold extended)\cr
  1136. unlrc&47 (light condensed)&und&65 (demibold)\cr
  1137. unlic&48 (light condensed italic)&undi&66 (demibold italic)\cr
  1138. unlro&49 (light extra condensed)&undrc&67 (demibold condensed)\cr
  1139. unmrx&53 (medium extended)&undic&68 (demibold condensed italic)\cr
  1140. unm&55 (medium)&unbrx&73 (bold extended)\cr
  1141. unmi&56 (medium italic)&unb&75 (bold)\cr
  1142. unmrc&57 (medium condensed)&unbi&76 (bold italic)\cr
  1143. unmic&58 (medium condensed italic)&unxrx&83 (extra bold extended)\cr}}
  1144. Second, here are names for the standard PostScript fonts and their variants:
  1145. Fonts marked by an asterisk do not require using virtual fonts; the raw
  1146. fonts can be used directly because no remapping is necessary; every
  1147. character is encoded.
  1148. \vskip\baselineskip\vbox
  1149. {\font\small=cmr8\def\mark{${}^*$}\def\smallcaps{{\small(Small Caps)}}
  1150. \hyphenation{Post-Script}
  1151. \halign to\hsize{\hskip20pt\tt #\hfil\space&#\hfil\quad\tabskip=0pt plus 1in
  1152. &\tt #\hfil\space\tabskip=0pt&#\hfil\cr
  1153. pagk  &AvantGarde-Book&pncri &NewCenturySchlbk-Italic\cr
  1154. pagkc &AvantGarde-Book {\smallcaps}&pncr  &NewCenturySchlbk\cr
  1155. pagko &AvantGarde-BookOblique&pncrc &NewCenturySchlbk {\smallcaps}\cr
  1156. pagd  &AvantGarde-Demi&pplb  &Palatino-Bold\cr
  1157. pagdo &AvantGarde-DemiOblique&pplbi &Palatino-BoldItalic\cr
  1158. pbkd  &Bookman-Demi&pplbu &Palatino-BoldUnslanted\cr
  1159. pbkdi &Bookman-DemiItalic&pplrrn&Palatino-Narrow\cr
  1160. pbkl  &Bookman-Light&pplrre&Palatino-Expanded\cr
  1161. pbkli &Bookman-LightItalic&pplri &Palatino-Italic\cr
  1162. pbklc &Bookman-Light {\smallcaps}&pplr  &Palatino\cr
  1163. pcrb  &Courier-Bold&pplro &Palatino-Oblique\cr
  1164. pcrbo &Courier-BoldOblique&pplru &Palatino-Unslanted\cr
  1165. pcrro &Courier-Oblique&pplrc &Palatino {\smallcaps}\cr
  1166. pcrr  &Courier&psyr  &Symbol\mark\cr
  1167. phvb  &Helvetica-Bold&psyro &Symbol-Oblique\mark\cr
  1168. phvbo &Helvetica-BoldOblique&ptmb  &Times-Bold\cr
  1169. phvro &Helvetica-Oblique&ptmbi &Times-BoldItalic\cr
  1170. phvr  &Helvetica&ptmrrn&Times-Narrow\cr
  1171. phvrc &Helvetica {\smallcaps}&ptmrre&Times-Expanded\cr
  1172. phvbrn&Helvetica-Narrow-Bold&ptmri &Times-Italic\cr
  1173. phvbon&Helvetica-Narrow-BoldOblique&ptmro &Times-Oblique\cr
  1174. phvron&Helvetica-Narrow-Oblique&ptmr  &Times-Roman\cr
  1175. phvrrn&Helvetica-Narrow&ptmrc &Times-Roman {\smallcaps}\cr
  1176. pncb  &NewCenturySchlbk-Bold&pzcmi &ZapfChancery-MediumItalic\cr
  1177. pncbi &NewCenturySchlbk-BoldItalic&pzdr  &ZapfDingbats\mark\cr}}
  1178. Please contact Karl Berry if you have any comments or additions.  Karl
  1179. can be reached at \.{karl@cs.umb.edu}, or at 135 Center Hill Road,
  1180. Plymouth, MA~~02360.\par}
  1181. \sec{Command Line Options}
  1182. The \.{dvips} driver has a plethora of command line options.  Reading
  1183. through this section will give a good idea of the capabilities of the
  1184. driver.
  1185. Many of the parameterless options listed here can be turned off by
  1186. immediately suffixing
  1187. the option with a zero (0); for instance, to turn off page reversal if it is
  1188. turned on by default, use \.{-r0}.  The options that can be turned off in
  1189. this way are \.a, \.f, \.k, \.i, \.m, \.q, \.r, \.s, \.E, \.F, \.K, \.M, \.N,
  1190. \.U, and \.Z.
  1191. This is a handy summary of the options; it is printed out when you run
  1192. \.{dvips} with no arguments.
  1193. {\vskip0pt\parskip=0pt\begverb{`\\}
  1194.      Usage: dvips [options] filename[.dvi]
  1195.  a*  Conserve memory, not time      y # Multiply by dvi magnification
  1196.  b # Page copies, for posters e.g.  A   Print only odd (TeX) pages
  1197.  c # Uncollated copies              B   Print only even (TeX) pages
  1198.  d # Debugging                      C # Collated copies
  1199.  e # Maxdrift value                 D # Resolution
  1200.  f*  Run as filter                  E*  Try to create EPSF
  1201.  h f Add header file                F*  Send control-D at end
  1202.  i*  Separate file per section      K*  Pull comments from inclusions
  1203.  k*  Print crop marks               M*  Don't make fonts
  1204.  l # Last page                      N*  No structured comments
  1205.  m*  Manual feed                    O c Set/change paper offset
  1206.  n # Maximum number of pages        P s Load config.$s
  1207.  o f Output file                    R   Run securely
  1208.  p # First page                     S # Max section size in pages
  1209.  q*  Run quietly                    T c Specify desired page size
  1210.  r*  Reverse order of pages         U*  Disable string param trick
  1211.  s*  Enclose output in save/restore X # Horizontal resolution
  1212.  t s Paper format                   Y # Vertical resolution
  1213.  x # Override dvi magnification     Z*  Compress bitmap fonts
  1214.      # = number   f = file   s = string  * = suffix, `0' to turn off
  1215.      c = comma-separated dimension pair (e.g., 3.2in,-32.1cm)
  1216. \endverb}
  1217. {\options
  1218. \def\o#1 #2:{{\tt #1} {\it #2}:}
  1219. \def\O#1:{{\tt #1}:}
  1220. \O-a:  Conserve memory by making three passes over the \.{dvi} file
  1221. instead of two and only loading those characters actually used.
  1222. Generally only useful on machines with a very limited amount of
  1223. memory, like some PCs.
  1224. \o-b num: Generate {\it num} copies of each page, but duplicating the
  1225. page body rather than using the {\tt\#numcopies} option.  This can be
  1226. useful in conjunction with a header file setting {\tt\char92bop-hook}
  1227. to do color separations or other neat tricks.
  1228. \o-c num: Generate {\it num} copies of every page, by using
  1229. PostScript's \.{\#copies} feature.
  1230. \^{copies}
  1231. Default is 1. (For collated copies, see the \.{-C} option below.)
  1232. \o-d num:  Set the debug flags.  This is intended only for emergencies
  1233. or for unusual fact-finding expeditions; it will work only if
  1234. \^{debug}
  1235. \.{dvips} has been compiled with the \.{DEBUG} option.
  1236. The source file \.{debug.h} indicates what the values of
  1237. {\it num} can be, or see section 15 of this manual.
  1238. Use a value of $-1$ for maximum output.
  1239. \o-e num:
  1240. Make sure that each character is placed at most this many pixels from its
  1241. `true' resolution-independent
  1242. position on the page. The default value of this parameter
  1243. is resolution dependent (it is the number
  1244. of entries in the list [100, 200, 300, 400, 500, 600, 800, 1000, 1200, 1600,
  1245. 2000, 2400, 2800, 3200, $\ldots\,$] that are less than or equal to the
  1246. \^{maxdrift}
  1247. resolution in dots per inch). Allowing individual
  1248. characters to `drift' from their correctly rounded positions
  1249. by a few pixels, while regaining the true position at the beginning of
  1250. each new word, improves the spacing of letters in words.
  1251. \O-f: Run as a filter.
  1252. \^{filter}
  1253. Read the \.{dvi} file from standard input and write the PostScript to
  1254. standard output.  The standard input must be seekable, so it cannot
  1255. be a pipe.  If you must use a pipe, write a shell script that copies
  1256. the pipe output to a temporary file and then points \.{dvips} at this file.
  1257. This option also disables the automatic reading of the \.{PRINTER}
  1258. environment variable, and turns off the automatic sending of control D
  1259. if it was turned on with the \.{-F} option or in the configuration file;
  1260. use \.{-F} after this option if you want both.
  1261. \o-h name:
  1262. Prepend file {\it name}
  1263. \^{header}
  1264. as an additional header file. (However, if the name is simply `\.-',
  1265. suppress all header files from the output.)  This header file
  1266. gets added to the PostScript \.{userdict}.
  1267. \O-i: Make each section be a separate file.  Under certain circumstances,
  1268. \.{dvips} will split the document up into `sections' to be processed
  1269. independently; this is most often done for memory reasons.  Using this
  1270. option tells \.{dvips} to place each section into a separate file; the
  1271. new file names are created replacing the suffix of the supplied output
  1272. file name by a three-digit sequence number.
  1273. This option is most often used in
  1274. conjunction with the \.{-S} option which sets the maximum section length
  1275. in pages.  For instance, some phototypesetters cannot print more than
  1276. ten or so consecutive pages before running out of steam; these options
  1277. can be used to automatically split a book into ten-page sections, each
  1278. to its own file.
  1279. \O-k:  Print crop marks.  This option increases the paper size
  1280. (which should be specified, either with a paper size special or
  1281. with the {\tt -T} option) by a half inch in each dimension.  It
  1282. translates each page by a quarter inch and draws cross-style
  1283. crop marks.  It is mostly useful with typesetters that can set
  1284. the page size automatically.
  1285. \o-l num:
  1286. \^{pages}
  1287. The last page printed will be the first one numbered {\it num.}
  1288. Default is the last page in the document.  If the {\it num} is
  1289. prefixed by an equals sign, then it (and any argument to the
  1290. {\tt -p} option) is treated as a sequence number, rather than
  1291. a value to compare with {\tt \char92 count0} values.  Thus,
  1292. using {\tt -l =9} will end with the ninth page of the document,
  1293. no matter what the pages are actually numbered.
  1294. \O-m:  Specify manual feed for printer.
  1295. \^{manual feed}
  1296. \o-n num:
  1297. At most {\it num} pages will be printed. Default is 100000.
  1298. \^{pages}
  1299. \o-o name:  The output will be sent to file {\it name.}
  1300. \^{output}
  1301. If no file name is given, the default name is \.{{\it file}.ps} where
  1302. the \.{dvi} file was called \.{{\it file}.dvi};
  1303. if this option isn't given, any default in the configuration file is used.
  1304. If the first character of the supplied output file name is an
  1305. exclamation mark, then
  1306. the remainder will be used as an argument to \.{popen}; thus, specifying
  1307. \.{!lpr} as the output file will automatically queue the file for printing.
  1308. This option also disables the automatic reading of the \.{PRINTER}
  1309. environment variable, and turns off the automatic sending of control D
  1310. if it was turned on with the \.{-F} option or in the configuration file;
  1311. use \.{-F} after this option if you want both.
  1312. \o-p num:
  1313. \^{pages}
  1314. The first page printed will be the first one numbered {\it num.}
  1315. Default is the first page in the document.  If the {\it num} is
  1316. prefixed by an equals sign, then it (and any argument to the {\tt -l}
  1317. option) is treated as a sequence number, rather than a value to
  1318. compare with {\tt \char92 count0} values.  Thus, using {\tt -p =3}
  1319. will start with the third page of the document, no matter what the
  1320. pages are actually numbered.  Another form of page selection is
  1321. available by using {\tt -pp} followed by a comma-separated list of
  1322. pages or page-ranges, where the page ranges are colon-separated pairs
  1323. of numbers.  Thus, you can print pages 3--10, 21, and 73--92 with the
  1324. option {\tt -pp 3:10,21,73:92}.
  1325. \O-q: Run in quiet mode.
  1326. Don't chatter about pages converted, etc.; report nothing but errors to
  1327. \^{quiet}
  1328. standard error.
  1329. \O-r:
  1330. Stack pages in reverse order.  Normally, page 1 will be printed first.
  1331. \^{reverse}
  1332. \O-s:
  1333. Causes the entire global output to be enclosed in a save/restore pair.
  1334. This causes the file to not be truly conformant, and is thus not recommended,
  1335. but is useful if you are driving the printer directly and don't care too
  1336. much about the portability of the output.
  1337. \o-t papertype:
  1338. \^{paper type}
  1339. \^{mode}
  1340. \^{letter}
  1341. \^{legal}
  1342. \^{ledger}
  1343. \^{a4}
  1344. \^{a3}
  1345. \^{landscape}
  1346. This sets the paper type to {\it papertype}.  The {\it papertype} should
  1347. be defined in one of the configuration files, along with the appropriate
  1348. code to select it.  See the documentation for \.@ in the configuration
  1349. file option descriptions.  You can also specify
  1350. \.{-t landscape}, which rotates a document by 90 degrees.
  1351. To rotate a document whose size is not letter, you can use the 
  1352. \.{-t} option twice, once for the page size, and once for \.{landscape}.
  1353. The upper left corner of each page in
  1354. the \.{dvi} file is placed one inch from the left and one inch from the top.
  1355. Use of this option is highly dependent on the configuration file.
  1356. Note that executing the {\tt letter} or {\tt a4} or other PostScript
  1357. operators cause the document to be nonconforming and can cause it not
  1358. to print on certain printers, so the default paper size should not
  1359. execute such an operator if at all possible.
  1360. \o-x num:
  1361. Set the magnification ratio to {\it num}/1000. Overrides the magnification
  1362. \^{magnification}
  1363. specified in the \.{dvi} file.  Must be between 10 and 100000.  It is
  1364. recommended that you use standard magstep values (1095, 1200, 1440, 1728,
  1365. 2074, 2488, 2986, and so on) to help reduce the total number of \.{PK}
  1366. files generated.
  1367. \O-A:
  1368. This option prints only the odd pages.  This option uses the \TeX\
  1369. page numbering rather than the sequence page numbers.
  1370. \O-B:
  1371. This option prints only the even pages.  This option uses the \TeX\
  1372. page numbering rather than the sequence page numbers.
  1373. \o-C num:
  1374. Create {\it num}
  1375. \^{copies}
  1376. copies, but collated (by replicating the data in the PostScript file).
  1377. Slower than the \.{-c} option, but easier on the hands, and faster than
  1378. resubmitting the same PostScript file multiple times.
  1379. \o-D num:
  1380. Set the resolution in dpi (dots per inch) to {\it num.}
  1381. \^{resolution}
  1382. This affects the choice of bitmap fonts that are loaded and also the positioning
  1383. of letters in resident PostScript fonts. Must be between 10 and 10000.
  1384. This affects both the horizontal and vertical resolution.  If a high resolution
  1385. (something greater than 400 dpi, say) is selected, the \.{-Z} flag should
  1386. probably also be used.
  1387. \O-E:
  1388. Makes \.{dvips} attempt to generate an EPSF file with a tight bounding
  1389. box.  This only works on one-page files, and it only looks at marks made
  1390. by characters and rules, not by any included graphics.  In addition, it
  1391. gets the glyph metrics from the {\tt tfm} file, so characters that
  1392. lie outside their enclosing {\tt tfm} box may confuse it.  In addition,
  1393. the bounding box might be a bit too loose if the character glyph has
  1394. significant left or right side bearings.  Nonetheless, this option works
  1395. well for creating small EPSF files for equations or tables or the like.
  1396. (Note, of course, that {\tt dvips} output is resolution dependent and
  1397. thus does not make very good EPSF files, especially if the images are
  1398. to be scaled; use these EPSF files with a great deal of care.)
  1399. \O-F:
  1400. Causes Control-D (ASCII code 4) to be appended as the very last character
  1401. of the PostScript file.  This is useful when \.{dvips}
  1402. \^{EOF}
  1403. \^{control-D}
  1404. is driving the printer directly instead of working through a spooler,
  1405. as is common on extremely small systems.  Otherwise, it is not recommended.
  1406. \O-K:
  1407. This option causes comments in included PostScript graphics, font files,
  1408. and headers to be removed.  This is sometimes necessary to get around bugs
  1409. in spoolers or PostScript post-processing programs.  Specifically, the
  1410. \.{\%\%Page} comments, when left in, often cause difficulties.
  1411. Use of this flag can cause some included graphics to fail, since the
  1412. PostScript header macros from some software packages read portions of
  1413. the input stream line by line, searching for a particular comment.
  1414. This option has been turned on by default because PostScript previewers
  1415. and spoolers still have problems with the structuring conventions.
  1416. \O-M:
  1417. Turns off the automatic font generation facility.  If any fonts are
  1418. missing, commands to generate the fonts are appended to the file
  1419. {\tt missfont.log} in the current directory; this file can then be
  1420. executed and deleted to create the missing fonts.
  1421. \O-N:
  1422. Turns off structured comments; this might be necessary on some systems
  1423. \^{structured comments}
  1424. that try to interpret PostScript comments in weird ways, or on some
  1425. PostScript printers.  Old versions of TranScript in particular cannot
  1426. handle modern Encapsulated PostScript.
  1427. \o-O offset:
  1428. Move the origin by a certain amount.  The {\it offset} is a comma-separated
  1429. pair of dimensions, such as \.{.1in,-.3cm} (in the same syntax used in
  1430. the \.{papersize} special).   The origin of the page is shifted from the
  1431. default position (of one inch down, one inch to the right from the upper
  1432. left corner of the paper) by this amount.
  1433. \o-P printername:
  1434. Sets up the output for the appropriate printer.  This is implemented
  1435. by reading in \.{config.{\it printername}}, which can then set the output pipe
  1436. (as in, \.{o !lpr -Pprintername}) as well as the font paths and any other
  1437. \^{{\tt config.ps}}
  1438. defaults for that printer only.  It is recommended that all standard
  1439. defaults go in the one master {\tt config.ps}
  1440. file and only things that vary
  1441. printer to printer go in the \.{config.{\it printername}}
  1442. files.  Note that {\tt config.ps}
  1443. is read before \.{config.{\it printername}}.
  1444. In addition, another file called \.{\tilde/.dvipsrc}
  1445. is searched for immediately after \.{config.ps};
  1446. this file is intended for user defaults.  If no \.{-P} command is
  1447. given, the environment variable \.{PRINTER} is checked.  If that
  1448. variable exists, and a corresponding configuration
  1449. file exists, that configuration file is read in.
  1450. \o-S num:
  1451. Set the maximum number of pages in each `section'.  This option is most
  1452. commonly used with the \.{-i} option; see that documentation above for more
  1453. information.
  1454. \O-T offset:
  1455. Set the paper size to the given pair of dimensions.  This option takes
  1456. its arguments in the same style as {\tt -O}.  It overrides any paper
  1457. size special in the {\tt dvi} file.
  1458. \O-U:
  1459. Disable a PostScript virtual memory saving optimization that stores the
  1460. character metric information in the same string that is used to store
  1461. the bitmap information.  This is only necessary when driving the Xerox
  1462. 4045 PostScript interpreter.  It is caused by a bug in that interpreter
  1463. that results in `garbage' on the bottom of each character.  Not
  1464. recommended unless you must drive this printer.
  1465. \o-X num:
  1466. Set the horizontal resolution in dots per inch to {\it num.}
  1467. \^{resolution}
  1468. \o-Y num:
  1469. Set the vertical resolution in dots per inch to {\it num.}
  1470. \^{resolution}
  1471. \O-Z:
  1472. Causes bitmapped fonts to be compressed before they are downloaded,
  1473. \^{compression}
  1474. thereby reducing the size of the PostScript font-downloading information.
  1475. Especially useful at high resolutions or when very large fonts are
  1476. used.  Will slow down printing somewhat, especially on early 68000-based
  1477. PostScript printers.\par}
  1478. \sec{Configuration File Searching}
  1479. The \.{dvips} program has a system of loading configuration files such that
  1480. \^{{\tt config.ps}}
  1481. certain parameters can be set globally across the system, others can be set
  1482. per-printer basis, and yet others can be set by the user.  When \.{dvips}
  1483. starts up, first the global \.{config.ps} file is searched for and loaded.
  1484. This file is looked for along the path for configuration files, which is by
  1485. default \.{.:/usr/lib/tex/ps}.
  1486. After this master configuration file is loaded, a file by the name of
  1487. \.{.dvipsrc} is loaded from the current user's home directory, if such
  1488. a file exists.  This file is loaded in exactly the same way as the global
  1489. configuration file, and it can override any options set in the global
  1490. file.
  1491. Then the command line is read and parsed.  If the \.{-P} option is
  1492. encountered, at that point in the command line a configuration file
  1493. for that printer is read in.  Thus, the printer configuration file can
  1494. override anything in the global or user configuration file, and it can
  1495. also override anything seen in the command line up to the point that the
  1496. \.{-P} option was encountered.
  1497. After the command line has been completely scanned, if there was no
  1498. \.{-P} option selected, and also the \.{-o} and \.{-f} command line
  1499. options were not used, a \.{PRINTER} environment variable is
  1500. searched for.  If this variable exists, and a configuration file for
  1501. the printer mentioned in it exists, this configuration file is
  1502. loaded last of all.
  1503. Note that because the printer-specific configuration files are read
  1504. after the user's configuration file, the user's \.{.dvipsrc}
  1505. cannot override things in
  1506. the printer configuration files.  On the other hand, the configuration path
  1507. usually includes the current directory, and can be set to include the
  1508. user's home directory (or any other directory of the user), so the user can
  1509. always provide personalized printer-specific configuration files that will
  1510. be found before the system global ones.
  1511. If your printer uses a different resolution than 300 dpi,
  1512. make sure that you
  1513. have given a \MF\ mode as well as a resolution in the printer
  1514. configuration file.  Also make sure that \MF\ knows about the mode,
  1515. by entering it into your local \.{mode\_def} file (typically
  1516. \.{waits.mf}; \.{amiga.mf} on the Amiga, \.{next.mf} on the NeXT)
  1517. and recreating the \.{plain.base} file for \MF, including the
  1518. \.{mode\_def} file.  (Another good mode definition file is
  1519. {\tt modes.mf} by Karl Berry, which is available from
  1520. {\tt ftp.cs.umb.edu} in {\tt pub/tex/modes.mf}.)
  1521. The most common problem in generating fonts
  1522. with \MF\ is that
  1523. \^{{\tt mode\_def}}
  1524. \^{{\tt plain.base}}
  1525. \^{\MF}
  1526. this file with the mode definitions is not included when creating
  1527. the \.{plain.base} file.
  1528. \sec{Configuration File Options}
  1529. Most of the configuration file options are similar to the command line
  1530. options, but there are a few new ones.
  1531. Again, many may be turned off by suffixing the letter with a zero (0).
  1532. These options are \.a, \.f, \.q, \.r, \.I, \.K, \.N, \.U, and \.Z.
  1533. Within a configuration file, any empty line or line starting with a space,
  1534. asterisk, equal sign, or a pound sign is ignored.
  1535. {\options
  1536. \def\o#1 #2:{{\tt #1} {\it #2\/}:}
  1537. \def\O#1:{{\tt #1}:}
  1538. \o @ name hsize vsize: This option is used to set the paper size defaults
  1539. and options for the particular printer this configuration file
  1540. describes.  There are three formats for this option.  If the option is
  1541. specified on a line by itself, with no parameters, it instructs
  1542. \.{dvips} to discard all other paper size information (possibly from
  1543. another configuration file) and start fresh.  If three parameters
  1544. are given, as above, with the first parameter being a name and the second
  1545. and third being a dimension (as in 8.5in or 3.2cc, just like in the
  1546. \.{papersize} special), then the option is interpreted as starting a new
  1547. paper size description, where {\it name} is the name and {\it hsize} and
  1548. {\it vsize} describe the horizontal and vertical size of the sheet of
  1549. paper, respectively.  If both {\it hsize} and {\it vsize} are equal to
  1550. zero (although you must still specify units!\null) then any page size will
  1551. match it.  If the \.@ character is immediately followed by a
  1552. \.+ sign, then the remainder of the line (after skipping any leading
  1553. blanks) is treated as PostScript code to send to the printer to select
  1554. that particular paper size.  After all that, if the first character of
  1555. the line is an exclamation point, then the line is put in the initial
  1556. comments section of the final output file; else, it is put in the setup
  1557. section of the output file.  For instance, a subset of the paper size
  1558. information supplied in the default \.{config.ps} looks like
  1559. {\parindent=40pt\cmd{@ letterSize 8.5in 11in\\
  1560. @ letter 8.5in 11in\\
  1561. @+ \%\%BeginPaperSize: Letter\\
  1562. @+ letter\\
  1563. @+ \%\%EndPaperSize\\
  1564. @ legal 8.5in 14in\\
  1565. @+ ! \%\%DocumentPaperSizes: Legal\\
  1566. @+ \%\%BeginPaperSize: Legal\\
  1567. @+ legal\\
  1568. @+ \%\%EndPaperSize}}
  1569. \noindent
  1570. Note that you can even include structured comments in the configuration
  1571. file!  When \.{dvips} has a paper format name given on the command line,
  1572. it looks for a match by the {\it name}; when it has a \.{papersize}
  1573. special, it looks for a match by dimensions.  The first match found (in
  1574. the order the paper size information is found in the configuration file)
  1575. is used.  If nothing matches, a warning is printed and the first paper
  1576. size given is used, so the first paper size should always be the default.
  1577. The dimensions must match
  1578. within a quarter of an inch.  Landscape mode for all of the paper sizes
  1579. are automatically supported.  If your printer has a command to set a
  1580. special paper size, then give dimensions of \.{0in 0in}; the PostScript
  1581. code that sets the paper size can refer to the dimensions the user
  1582. requested as \.{\ttbackslash hsize} and \.{\ttbackslash vsize};
  1583. these will be macros defined in
  1584. the PostScript that return the requested size in default PostScript
  1585. units.  Note that virtually all of the PostScript commands you use
  1586. here are device dependent and degrade the portability of the file; that
  1587. is why the default first paper size entry should not send any PostScript
  1588. commands down (although a structured comment or two would be okay).
  1589. Also, some printers want {\tt BeginPaperSize} comments and paper size
  1590. setting commands; others (such as the NeXT) want {\tt PaperSize} comments
  1591. and they will handle setting the paper size.  There is no solution I
  1592. could find that works for both (except maybe specifying both).
  1593. See the supplied {\tt config.ps} file for a more realistic
  1594. example.
  1595. \O a:  Conserve memory by making three passes over the \.{dvi} file
  1596. instead of two and only loading those characters actually used.
  1597. Generally only useful on machines with a very limited amount of
  1598. memory, like some PCs.
  1599. \o b num: Generate {\it num} copies of each page, but duplicating the
  1600. page body rather than using PostScript's {\tt\#copies}.  This can be
  1601. useful in conjunction with a header file setting {\tt\char92bop-hook}
  1602. to do color separations or other neat tricks.
  1603. \o e num:
  1604. Set the maximum drift parameter to {\it num} dots (pixels) as explained above.
  1605. \^{maxdrift}
  1606. \O f:  Run as a filter by default.
  1607. \^{filter}
  1608. \o h name:
  1609. Add {\it name} as a PostScript header file to be downloaded at the beginning.
  1610. \^{header}
  1611. \o i num:
  1612. Make each section be a separate file, and set the maximum number of pages
  1613. in a given file to {\it num}.  Under certain circumstances,
  1614. \.{dvips} will split the document into `sections' to be processed
  1615. independently; this is most often done for memory reasons.  Using this
  1616. option tells \.{dvips} to place each section into a separate file; the
  1617. new file names are created by replacing the suffix of the supplied output
  1618. file name with a three-digit sequence number.
  1619. This is essentially a combination of the
  1620. command line options \.{-i} and \.{-S}; see the documentation for these
  1621. options for more information.
  1622. \o m num:  The value {\it num} is the virtual memory available for fonts
  1623. and strings in the printer.
  1624. \^{memory}
  1625. Default is 180000.  This value must be accurate if memory conservation and
  1626. document splitting is to work correctly.  To determine this value, send the
  1627. following file to the printer:
  1628. {\parindent=40pt\cmd{\%! Hey, we're PostScript\\
  1629. /Times-Roman findfont 30 scalefont setfont 144 432 moveto\\
  1630. vmstatus exch sub 40 string cvs show pop showpage}}
  1631. \noindent
  1632. Note that the number returned by this file is the total memory free;
  1633. it is often a good idea to tell \.{dvips} that the printer has somewhat
  1634. less memory.  This is because many programs download permanent macros
  1635. that can reduce the memory in the printer.  In general, a memory size
  1636. of about \.{300000} is plenty, since \.{dvips} can automatically split
  1637. a document if required.  It is unfortunate that PostScript printers with
  1638. much less virtual memory still exist.
  1639. Some systems or printers can dynamically increase the memory available
  1640. to a PostScript interpreter, in which case this file might return a
  1641. ridiculously low number; the NeXT computer is such a machine.  For these
  1642. systems, a value of one million works well.
  1643. \o o name:
  1644. \^{output}
  1645. The default output file is set to {\it name}.  As above, it can be a pipe.
  1646. Useful in printer-specific configuration files to redirect the output to
  1647. a particular printer queue.
  1648. \o p name:
  1649. The file to examine for PostScript font aliases is {\it name}.  It
  1650. defaults to {\tt psfonts.map}.  This option allows different printers
  1651. to use different resident fonts.  If the name starts with a `{\tt +}'
  1652. character, then the rest of the name (after any leading spaces) is used
  1653. as an additional map file; thus, it is possible to have local map files
  1654. pointed to by local configuration files that append to the global
  1655. map file.
  1656. \O q:  Run in quiet mode by default.
  1657. \^{quiet}
  1658. \O r:  Reverse the order of pages by default.
  1659. \^{reverse}
  1660. \O s:
  1661. Enclose the entire document in a global save/restore pair by default.
  1662. Not recommended, but useful in some environments; this breaks the
  1663. conformance of the document to the Adobe PostScript structuring
  1664. conventions.
  1665. \o D num:
  1666. Set the vertical and horizontal resolution to {\it num}
  1667. \^{resolution}
  1668. dots per inch.  Useful in printer-specific configuration files.
  1669. \o E command:
  1670. Execute the system command listed, for example as a UNIX shell command.
  1671. Execution takes place immediately, while the configuration file is
  1672. being read. This option can be used to insert the current date into a
  1673. header file, for instance, as explained at the end
  1674. of section~13.  Possibly dangerous; in many
  1675. installations it may be disabled, in which case a warning message will
  1676. be printed if the option is used.
  1677. \o H path:
  1678. The (colon-separated) path to search for PostScript header 
  1679. \^{header}
  1680. files is {\it path}.
  1681. \O I:
  1682. Ignore the {\tt PRINTER} environment variable.
  1683. \O K:
  1684. Filter comments out of included PostScript files; see the description
  1685. above for more information.
  1686. \o M mode: Set {\it mode}
  1687. as the \MF\ mode to be used when generating fonts.  This is
  1688. \^{{\tt MakeTeXPK}}
  1689. \^{{\MF}}
  1690. passed along to \.{MakeTeXPK} and overrides mode derivation from the
  1691. base resolution.
  1692. \O N:  Disable PostScript comments by default.
  1693. \o O offset:
  1694. Move the origin by a certain amount.  The {\it offset} is a comma-separated
  1695. pair of dimensions, such as \.{.1in,-.3cm} (in the same syntax as used in
  1696. the \.{papersize} special).   The origin of the page is shifted from the
  1697. default position (of one inch down, one inch to the right from the upper
  1698. left corner of the paper) by this amount.
  1699. \o P path:  The (colon-separated) path to search for bitmap \.{pk}
  1700. font files is
  1701. {\it path}.  The \.{TEXPKS} environment variable will override this.
  1702. \^{{\tt TEXPKS}}
  1703. \^{{\tt pk}}
  1704. If a \.{\%} character is found in {\it path},
  1705. the following substitutions will be made, and then a search will
  1706. be made for the resulting filenames.
  1707. A \.{\%f} is replaced by the font name.
  1708. A \.{\%b} is replaced by the output device horizontal resolution dots per inch.
  1709. A \.{\%d} is replaced by the font size in dots per inch.
  1710. A \.{\%p} is replaced by the font family; this is always \.{pk}.
  1711. A \.{\%m} is replaced by the font mode; this is the mode given
  1712. in the \.{M} option.
  1713. Note that, for each path element, if it contains a percent sign, you
  1714. must give the full file name, including path, rather than just the
  1715. directory name; a path element such as {\tt /fonts/\%b} will try to
  1716. open {\tt /fonts/300} when looking for {\tt cmr10.329pk}, for
  1717. instance, and this may not be what is intended; {\tt /fonts/\%b/\%f.\%dpk}
  1718. is needed.  If a path element does not contain a percent sign, there
  1719. is no need to specify the entire file name (because you can't, unless
  1720. you list all possible specific font names!).
  1721. \o R num num $\ldots\,$:
  1722. Sets up a list of default resolutions to search for \.{pk} fonts, if the
  1723. \^{{\tt pk}}
  1724. requested size is not available.  The output will then scale the font
  1725. found using PostScript scaling to the requested size.  Note that the
  1726. resultant output will be ugly, and thus a warning is issued.  To turn
  1727. this off, use a line with just the \.{R} and no numbers.
  1728. \o S path:  The path to search for special illustrations
  1729. (Encapsulated PostScript files or psfiles) is {\it path}.
  1730. \^{{\tt TEXINPUTS}}
  1731. The \.{TEXINPUTS} environment variable will override this.
  1732. \o T path: The path to search for the \.{tfm} files is
  1733. {\it path}.  The \.{TEXFONTS} environment variable will override this.
  1734. \^{{\tt TEXFONTS}}
  1735. This path is used for resident fonts and fonts that can't otherwise be found.
  1736. It's usually best to make it identical to the path used by \TeX.
  1737. \O U:  Turns off a memory-saving optimization; this is necessary for the
  1738. Xerox 4045 printer, but not recommended otherwise.  See the description
  1739. above for more information.
  1740. \o V path:  The path to search for virtual font \.{vf} files is
  1741. \^{{\tt vf}}
  1742. \^{virtual fonts}
  1743. {\it path}.
  1744. This may be device-dependent if you use virtual fonts to simulate
  1745. actual fonts on different devices.
  1746. \o W string:
  1747. Sends {\it string} to stderr, if a parameter is given; otherwise it cancels
  1748. another previous  message.
  1749. This is useful in the default configuration file if you want to require
  1750. the user to specify a printer, for instance, or if you want to notify
  1751. the user that the resultant output has special characteristics.
  1752. \o X num:
  1753. \^{resolution}
  1754. Set the horizontal resolution to {\it num} dots per inch.
  1755. \o Y num:
  1756. \^{resolution}
  1757. Set the vertical resolution to {\it num} dots per inch.
  1758. \O Z:  Compress all downloaded fonts by default, as above.\par}
  1759. \sec{Automatic Font Generation}
  1760. One major problem with \TeX\ and the Computer Modern fonts is the huge
  1761. amount of disk space a full set of high resolution fonts can take.  The
  1762. \.{dvips} program solves this problem by creating fonts on demand, so only
  1763. those fonts that are actually used are stored on disk.  At a typical site,
  1764. less than one-fifth of the full set of Computer Modern fonts are used over
  1765. a long period, so this saves a great deal of disk space.
  1766. Furthermore, the addition of dynamic font generation allows fonts to be
  1767. used at any size, including typesetter resolutions and extremely huge
  1768. banner sizes.  Nothing special needs to be done; the fonts will be
  1769. automatically created and installed as needed.
  1770. The downside is that it does take a certain amount of time to create a new
  1771. font if it has never been used before.  But once a font is created, it
  1772. will exist on disk, and the next time that document is printed it will print
  1773. very quickly.
  1774. It is the \.{MakeTeXPK} shell script that is responsible for making these
  1775. \^{{\tt MakeTeXPK}}
  1776. fonts.  The \.{MakeTeXPK} script supplied invokes \MF\ to create the font and
  1777. then copies the resultant \.{pk} file to a world-writable font cache area.
  1778. \.{MakeTeXPK} can be customized to do other things to get the font.  For
  1779. instance, if you are installing \.{dvips} to replace (or run alongside)
  1780. an existing PostScript driver, and that driver demands \.{gf} fonts, you
  1781. can easily modify \.{MakeTeXPK} to invoke \.{gftopk} to convert the
  1782. \.{gf} files to \.{pk} files for \.{dvips}.  This provides the same space
  1783. savings listed above.
  1784. Because \.{dvips} (and thus \.{MakeTeXPK}) is run by a wide variety of users,
  1785. there must be a system-wide place to put the cached font files.  In order
  1786. for everyone to be able to supply fonts, the directory must be world
  1787. writable.  If your system administrator considers this a security hole,
  1788. \.{MakeTeXPK} can write to \.{/tmp/pk} or some such directory, and
  1789. periodically the cached fonts can be moved to a more general system area.
  1790. Note that the cache directory must exist on the \.{pk} file search path
  1791. in order for \.{MakeTeXPK} to work.
  1792. \sec{Path Interpretation}
  1793. The \.{dvips} program needs to read a wide variety of files from a large
  1794. set of directories.  It uses a set of paths to do this.  The actual
  1795. paths are listed in the next section; this section describes how the
  1796. paths are interpreted.
  1797. All path variables are names of directories (path elements),
  1798. separated by colons.
  1799. Each path element can be either the literal name of a directory or one
  1800. of the \.{\tilde} forms common under UNIX.  If a path element is a single tilde,
  1801. \^{UNIX}
  1802. it is replaced by the contents of the environment variable \.{HOME}, which
  1803. \^{{\tt HOME}}
  1804. is normally set to the user's home directory.  If the path element is
  1805. a tilde followed by anything, the part after the tilde is interpreted as
  1806. a user name, and his home directory is fetched from the system password
  1807. file and used as the real path element.
  1808. Where environment variables can override paths, an additional path
  1809. element form is allowed.  If a path element is the empty string, it
  1810. is replaced with the system defaults.  Thus, to
  1811. search the user's home directory, followed by the system
  1812. default paths, assuming the current shell is \.{csh},
  1813. the following command would be used:
  1814. \cmd{setenv TEXINPUTS \tilde:}
  1815. \noindent
  1816. This is a path of two elements.  The first is the user's home directory.
  1817. The second path element is the empty string, indicating that
  1818. the system defaults should be searched.
  1819. The `system defaults' as defined here means the strings set in the
  1820. \.{Makefile} before compilation, rather than any defaults set in
  1821. \.{config.ps} or printer-specific configuration files.  This is to
  1822. prevent path blowup, where more and more directories are added to the
  1823. path by each level of configuration file.
  1824. \sec{Environment Variables}
  1825. The \.{dvips} program reads a certain set of environment variables to
  1826. configure its operation.  The path variables are read after all
  1827. configuration files are read, so they override values in the configuration
  1828. files.  (The \.{TEXCONFIG} variable, of course, is read before the
  1829. configuration files.)  The rest are read as needed.
  1830. Note that all defaults supplied here are just as supplied in the
  1831. provided {\tt Makefile}; they will almost certainly have been changed
  1832. during installation at your particular site.
  1833. \descenv HOME,{\rm no default}
  1834.   This environment variable is automatically set by the shell and is
  1835. used to replace any occurrences of \.{\tilde} in a path.
  1836. \descenv MAKETEXPK,{MakeTeXPK \%n \%d \%b \%m}
  1837. This environment variable sets the command to be executed to create
  1838. a missing font.  A \%n is replaced by the base name of the font to
  1839. be created (such as \.{cmr10}); a \%d is replaced by the resultant
  1840. horizontal resolution of the font; a \%b is replaced by the
  1841. horizontal resolution at which \.{dvips} is currently generating
  1842. output, and any \%m is replaced by a string that \MF\ can use as
  1843. the right hand side of an assignment to \.{mag} to create the
  1844. desired font at the proper resolution.  If a mode for \MF\ is set in
  1845. a configuration file, that is automatically appended to the command
  1846. before execution.  Note that these substitutions are different than
  1847. the ones performed on PK paths.
  1848. \descenv DVIPSHEADERS,{.:/usr/lib/tex/ps}
  1849.   This environment variable determines where to search for header
  1850. files such as {\tt tex.pro}, font files, arguments to the
  1851. {\tt -h} option, and such files.
  1852. \descenv PRINTER,{\rm no default}
  1853.   This environment variable is read to determine which default printer
  1854. configuration file to read in.  Note that it is the responsibility of
  1855. the configuration file to send output to the proper print queue, if such
  1856. functionality is desired.
  1857. \descenv TEXFONTS,{/LocalLibrary/Fonts/TeXFonts/tfm:/usr/lib/tex/fonts/tfm}
  1858.   This is where \.{tfm} files are searched for.  A \.{tfm} file only
  1859. \^{{\tt tfm}}
  1860. needs to be loaded if the font is a resident (PostScript) font or if
  1861. for some reason no \.{pk} file could be found.
  1862. \descenv TEXPKS,{/LocalLibrary/Fonts/TeXFonts/pk:/usr/lib/tex/fonts/pk}
  1863. This environment variable is a path on which to search for \.{pk} fonts.
  1864. Certain substitutions are performed if a percent sign is found anywhere
  1865. \^{{\tt pk}}
  1866. in the path.  See the description of the {\tt P} configuration file
  1867. option for more information.
  1868. \descenv TEXINPUTS,{.:..:/usr/lib/tex/inputs}
  1869.   This environment variable is used to find PostScript figures when they
  1870. are included.
  1871. \descenv TEXCONFIG,{.:/usr/lib/tex/ps}
  1872.   This environment variable sets the directories to search for configuration
  1873. files, including the system-wide one.  Using this single environment variable
  1874. and the appropriate configuration files, it is possible to set up the program
  1875. for any environment.  (The other path environment variables can thus be
  1876. redundant.)
  1877. \descenv VFFONTS,{.:/usr/lib/tex/fonts/vf}
  1878.   This environment variable sets where \.{dvips} looks for virtual fonts.
  1879. A correct virtual font path is essential if PostScript fonts are to be
  1880. used.
  1881. \sec{Other Bells And Whistles}
  1882. For special effects, if any of the macros
  1883. \.{bop-hook}, \.{eop-hook}, \.{start-hook}, or \.{end-hook}
  1884. \^{{\tt bop-hook}}
  1885. \^{{\tt eop-hook}}
  1886. \^{{\tt start-hook}}
  1887. \^{{\tt end-hook}}
  1888. are defined in the PostScript \.{userdict}, they will be executed at the
  1889. beginning of a page, end of a page, start of the document, and end of
  1890. a document, respectively.
  1891. When these macros are executed, the default PostScript coordinate system
  1892. and origin
  1893. is in effect.  Such macros can be defined in headers added by the
  1894. \.{-h} option or the \.{header=}
  1895. special, and might be useful for writing, for instance, DRAFT across the
  1896. entire page, or, with the aid of a shell script, dating the document.
  1897. These macros are executed outside of the save/restore context of the
  1898. individual pages, so it is possible for them to accumulate information,
  1899. but if a document must be divided into sections because of memory
  1900. constraints, such added information will be lost across section breaks.
  1901. The two arguments to {\tt bop-hook} are the \TeX\ page number and
  1902. the sequence number of the page
  1903. in the file; the first page gets zero, the second one, etc.
  1904. The arguments to {\tt start-hook} are hsize, vsize, mag, hdpi, vdpi,
  1905. and the name of the \.{dvi} input file. The procedures
  1906. must leave these parameters on the stack.
  1907. The other hooks are not (currently)
  1908. given parameters, although this may change in the future.
  1909. As an example of what can be done, the following special will write
  1910. a light DRAFT across each page in the document:
  1911. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1912. \special{!userdict begin /bop-hook{gsave 200 30 translate
  1913. 65 rotate /Times-Roman findfont 216 scalefont setfont
  1914. 0 0 moveto 0.7 setgray (DRAFT) show grestore}def end}$endverb}
  1915. Note that using \.{bop-hook} or \.{eop-hook} in any way that preserves
  1916. information across pages will break compliance with the Adobe document
  1917. structuring conventions, so if you use any such tricks, it is recommended
  1918. that you also use the \.{-N} option to turn off structured comments.
  1919. Several of the above tricks can be used nicely together, and it is not
  1920. necessary that a `printer configuration file' be used only to set
  1921. printer defaults.  For instance, you might have a file \.{config.dated}
  1922. that contains just the two lines
  1923. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1924. E echo /bop-hook \{save /Times-Roman findfont 7 scalefont setfont \
  1925.                   72 756 moveto \(`date`\) show restore\} def >.date
  1926. h .date$endverb}
  1927. \noindent(with no newline following \.{setfont}); then the command-line option
  1928. \.{-Pdated} to \.{dvips} will print current date and time on the top
  1929. of each page of output.
  1930. Note that multiple \.{-P} options can be used.
  1931. \ifgeneric\else
  1932. \sec{MS-DOS}
  1933. The MS-DOS version of \.{dvips} differs from UNIX in the following ways.
  1934. \^{MS-DOS}
  1935. \item{$\bullet$} Path separators are \.{;} not \.{:}.
  1936. \item{$\bullet$} Directory separators are \.{\ttbackslash} not \.{/}.
  1937. \item{$\bullet$} The user's initialization file is \.{dvips.ini}
  1938.   not \.{.dvipsrc}.
  1939. \item{$\bullet$} Pipes to printers are not supported.  
  1940.   Output must go to a file.
  1941. \item{$\bullet$} \.{MakeTeXPk} is a batch file.  
  1942.   Since MS-DOS has insufficient memory to run both \.{dvips} and \MF\ 
  1943.   at the same time, this batch file will typically write out a set of 
  1944.   commands for running \MF\ later.  
  1945.   The \.{maketexp.bat} supplied writes out an \.{mfjob} file for em\TeX.
  1946. \item{$\bullet$} \.{dvidrv} from em\TeX\ can be used
  1947.   to automatically make fonts as follows:
  1948. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1949.     dvidrv dvips file.dvi $endverb}
  1950.   \.{dvidrv} sets an option \.{-pj=mfjobfile} for \.{dvips}, where 
  1951.   \.{mfjobfile} is the name of a temporary \.{mfjob} file.
  1952.   If there are missing fonts, \.{dvips} will write this \.{mfjob} file
  1953.   and then ask:
  1954. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1955.     Exit to make missing fonts now (y/n)? $endverb}
  1956.   If you answer yes, \.{dvips} exits with errorlevel 8 which tells 
  1957.   \.{dvidrv} to call \.{mfjob} to make the fonts, and then to call 
  1958.   \.{dvips} again.
  1959.   For this to work, \.{dvidrv}, \.{dvips}, \.{mfjob} and \.{mf} 
  1960.   must be located in the \.{PATH}, and the environment variables for 
  1961.   \.{mfjob} and \.{mf} set correctly.  
  1962.   A font mode must be set with the '\.{M}' option in \.{config.ps}.
  1963.   If the \.{-pj} option is set, dvips will not call \.{MakeTeXPk.bat}.
  1964. \item{$\bullet$} Limited em\TeX\ specials.  The following ones are supported:
  1965. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1966. \special{em:message xxx}
  1967. \special{em:point n}
  1968. \special{em:line a[h|v|p],b[h|v|p] [,width]}
  1969. \special{em:linewidth width}
  1970. \special{em:moveto}
  1971. \special{em:lineto}
  1972. \special{em:graph xxx[,width[,height]]} $endverb}
  1973. \item{}
  1974.   The line cut parameters \.{[h|v|p]} of the
  1975.   \.{\ttbackslash special{\char123}em:line ...{\char125}} command are ignored.
  1976.   Lines are ended with a rounded cap.
  1977.   A maximum of 1613 different point numbers are permitted on each page.
  1978.   The \.{\ttbackslash special{\char123}em:graph xxx{\char125}} 
  1979.   supports \.{PCX}, \.{MSP1}, \.{MSP2} and \.{BMP} files.
  1980.   The graph file may be scaled by giving an optional 
  1981.   width and height (expressed in the same way as \TeX\ dimensions).
  1982.   An example:
  1983. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  1984.   \special{em:graph scrdump.pcx,100mm,75mm} $endverb}
  1985. The program \.{dvips} can use em\TeX\ font libraries created with the 
  1986. em\TeX\ \.{fontlib /2} option.
  1987. If a \.{pxl} font is found within a font library, \.{dvips} will complain,
  1988. and then ignore the \.{pxl} font.
  1989. The font library names and directory names can be specified with 
  1990. this configuration file option.
  1991. {\options
  1992. \def\o#1 #2:{{\tt #1} {\it #2}:}
  1993. \def\O#1:{{\tt #1}:}
  1994. \o L path:  The list of \.{fli} font libraries to search for bitmap \.{pk}
  1995.   font files is {\it path}.  
  1996. \^{{\tt fli}}
  1997.   Fonts are sought first in these libraries and then as single files.
  1998.   Font libraries can be created with em\TeX 's \.{fontlib}; the usual
  1999.   extension is \.{fli}.  Directories as well as file names can be 
  2000.   entered here, the files will be searched for in all these directories.
  2001.   A directory name must have trailing directory separator
  2002.   (\.{/} for UNIX, \.{\ttbackslash} for MS-DOS). \par }
  2003. \sec{OS/2}
  2004. The OS/2 version of \.{dvips} differs from UNIX in the following ways.
  2005. \^{OS/2}
  2006. \item{$\bullet$} Path separators are \.{;} not \.{:}.
  2007. \item{$\bullet$} Directory separators are \.{\ttbackslash} not \.{/}.
  2008. \item{$\bullet$} The user's initialization file is \.{dvips.ini}
  2009.   not \.{.dvipsrc}.
  2010. \item{$\bullet$} Printer configuration files are called \.{<printer-name>.cfg},
  2011.   not \.{config.<printer-name>}.
  2012. \item{$\bullet$} The environment variable defining the search patch to tfm files
  2013.   is called \.{TEXTFM}, not \.{TEXFONTS}.
  2014. \item{$\bullet$} \.{MakeTeXPk} is a \.{.cmd} file called \.{MakeTeXP.cmd}.
  2015.   It writes out an \.{mfjob} file for em\TeX\ and calles \.{mfjob}.
  2016. \item{$\bullet$} \.{dvidrv} from em\TeX\ can be used
  2017.   to automatically make fonts as follows:
  2018. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  2019.     dvidrv dvips file.dvi $endverb}
  2020.   \.{dvidrv} sets an option \.{-pj=mfjobfile} for \.{dvips}, where 
  2021.   \.{mfjobfile} is the name of a temporary \.{mfjob} file.
  2022.   If there are missing fonts, \.{dvips} will write this \.{mfjob} file
  2023.   and then ask:
  2024. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  2025.     Exit to make missing fonts now (y/n)? $endverb}
  2026.   If you answer yes, \.{dvips} exits with errorlevel 8 which tells 
  2027.   \.{dvidrv} to call \.{mfjob} to make the fonts, and then to call 
  2028.   \.{dvips} again.
  2029.   For this to work, \.{dvidrv}, \.{dvips}, \.{mfjob} and \.{mf} 
  2030.   must be located in the \.{PATH}, and the environment variables for 
  2031.   \.{mfjob} and \.{mf} set correctly.  
  2032.   A font mode must be set with the '\.{M}' option in \.{config.ps}.
  2033.   If the \.{-pj} option is set, dvips will not call \.{MakeTeXPk.bat}.
  2034. \item{$\bullet$} Limited em\TeX\ specials.  The following ones are supported:
  2035. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  2036. \special{em:message xxx}
  2037. \special{em:point n}
  2038. \special{em:line a[h|v|p],b[h|v|p] [,width]}
  2039. \special{em:linewidth width}
  2040. \special{em:moveto}
  2041. \special{em:lineto}
  2042. \special{em:graph xxx[,width[,height]]} $endverb}
  2043. \item{}
  2044.   The line cut parameters \.{[h|v|p]} of the
  2045.   \.{\ttbackslash special{\char123}em:line ...{\char125}} command are ignored.
  2046.   Lines are ended with a rounded cap.
  2047.   A maximum of 1613 different point numbers are permitted on each page.
  2048.   The \.{\ttbackslash special{\char123}em:graph xxx{\char125}} 
  2049.   supports \.{PCX}, \.{MSP1}, \.{MSP2} and \.{BMP} files.
  2050.   The graph file may be scaled by giving an optional 
  2051.   width and height (expressed in the same way as \TeX\ dimensions).
  2052.   An example:
  2053. {\vskip0pt\parskip=0pt\leftskip=20pt\begverb{`\$}
  2054.   \special{em:graph scrdump.pcx,100mm,75mm} $endverb}
  2055. The program \.{dvips} can use em\TeX\ font libraries created with the 
  2056. em\TeX\ \.{fontlib /2} option.
  2057. If a \.{pxl} font is found within a font library, \.{dvips} will complain,
  2058. and then ignore the \.{pxl} font.
  2059. The font library names and directory names can be specified with 
  2060. this configuration file option.
  2061. {\options
  2062. \def\o#1 #2:{{\tt #1} {\it #2}:}
  2063. \def\O#1:{{\tt #1}:}
  2064. \o L path:  The list of \.{fli} font libraries to search for bitmap \.{pk}
  2065.   font files is {\it path}.  
  2066. \^{{\tt fli}}
  2067.   Fonts are sought first in these libraries and then as single files.
  2068.   Font libraries can be created with em\TeX 's \.{fontlib}; the usual
  2069.   extension is \.{fli}.  Directories as well as file names can be 
  2070.   entered here, the files will be searched for in all these directories.
  2071.   A directory name must have trailing directory separator
  2072.   (\.{/} for UNIX, \.{\ttbackslash} for OS/2). \par }
  2073. \sec{Installation}
  2074. If \.{dvips} has not already been installed on your system, the
  2075. \^{installation}
  2076. following steps are all that are needed.
  2077. First update the \.{Makefile}---in particular, the paths.  Everything
  2078. concerning \.{dvips} can be adjusted in the \.{Makefile}.  Make sure
  2079. you set key parameters such as the default resolution, and make sure
  2080. that the path given for packed pixel files is correct.
  2081. Next, check the file name definitions in \.{MakeTeXPK}.  If you don't
  2082. \^{{\tt MakeTeXPK}}
  2083. have \MF\ installed, you cannot use \.{MakeTeXPK} to automatically
  2084. generate the fonts; you can, however, modify it to generate \.{pk}
  2085. fonts from \.{gf} fonts if you don't have a full set of \.{pk} fonts
  2086. but do have a set of \.{gf} fonts.  If you don't have that, you should
  2087. probably not install \.{MakeTeXPK} at all; this will disable automatic
  2088. font generation.
  2089. Now, check the configuration parameters in \.{config.ps}.  You should
  2090. also update the default resolution here.  This file is the
  2091. system-wide configuration file that will be automatically installed.
  2092. If you are unsure how much memory your PostScript printer has, print the
  2093. following file:
  2094. \cmd{\%! Hey, we're PostScript\\
  2095. /Times-Roman findfont 30 scalefont setfont 144 432 moveto\\
  2096. vmstatus exch sub 40 string cvs show pop showpage}
  2097. \noindent
  2098. Note that the number returned by this file is the total memory free;
  2099. it is often a good idea to tell \.{dvips} that the printer has somewhat
  2100. less memory.  This is because many programs download permanent macros
  2101. that can reduce the memory in the printer.  In general, a memory size
  2102. of about \.{300000} is plenty, since \.{dvips} can automatically split
  2103. a document if required.  It is unfortunate that PostScript printers with
  2104. much less virtual memory still exist.
  2105. Some systems or printers can dynamically increase the memory available
  2106. to a PostScript interpreter; for these systems, a value of one million
  2107. works well.
  2108. Next, run \.{make}.  Everything should compile smoothly.  You may need
  2109. to adjust the compiler options in the \.{Makefile} if something goes
  2110. amiss.
  2111. Once everything is compiled, run \.{make} \.{install}.  After this is done,
  2112. you may want to create a configuration file for each PostScript printer
  2113. at your site.
  2114. If the font caching is considered a security hole, make the `cache'
  2115. directory be something like \.{/tmp/pks}, and \.{cron} a job to move the
  2116. good \.{pk} files into the real directory.  Or simply disable this
  2117. feature by not installing \.{MakeTeXPK}.
  2118. Don't forget to install the new \.{vf} files and \.{tfm} files.  Note
  2119. that the \.{tfm} files distributed with earlier (pre-5.471) versions
  2120. of \.{dvips}, and all versions of other PostScript drivers, are different.
  2121. A test program called \.{test.tex} is provided, so you can easily check
  2122. that the most important parts of \.{dvips} have been installed properly.
  2123. \sec{Diagnosing Problems}
  2124. You've gone through all the trouble of installing \.{dvips}, carefully
  2125. read all the instructions in this manual, and still can't get something
  2126. to work.  This is all too common, and is usually caused by some broken
  2127. PostScript application out there.  The following sections provide some
  2128. helpful hints if you find yourself in such a situation.
  2129. In all cases, you should attempt to find the smallest file that causes
  2130. the problem.  This will not only make debugging easier, it will also
  2131. reduce the number of possible interactions among different parts of the
  2132. system.
  2133. \sub{Debug Options}
  2134. The \.{-d} flag to \.{dvips} is very useful for helping to track down
  2135. certain errors.  The parameter to this flag is an integer that tells
  2136. what errors are currently being tracked.  To track a certain class of
  2137. debug messages, simply provide the appropriate number given below;
  2138. if you wish to track multiple classes, sum the numbers of the classes
  2139. you wish to track.  The classes are:
  2140. $$\vbox{\halign{\hfil #\quad&#\hfil\cr
  2141. 1&specials\cr2&paths\cr4&fonts\cr8&pages\cr16&headers\cr
  2142. 32&font compression\cr64&files\cr
  2143. 128&memory\cr}}$$
  2144. \sub{No Output At All}
  2145. If you are not getting any output at all, even from the simplest
  2146. one-character file (for instance, \.{\char92~\char92 bye}),
  2147. then something is very wrong.  Practically any file sent to a
  2148. PostScript laser printer should generate some output, at the very
  2149. least a page detailing what error occurred, if any.  Talk to your
  2150. system administrator about downloading a PostScript error handler.
  2151. (Adobe distributes a good one called \.{ehandler.ps}.)
  2152. It is possible, especially if you are using non-Adobe PostScript,
  2153. that your PostScript interpreter is broken.  Even then it should
  2154. generate an error message.  I've tried to work around as many bugs
  2155. as possible in common non-Adobe PostScript interpreters, but I'm
  2156. sure I've missed a few.
  2157. If \.{dvips} gives any strange error messages, or compilation on your
  2158. machine generated a lot of warnings, perhaps the \.{dvips} program
  2159. itself is broken.  Carefully check the types in \.{dvips.h} and
  2160. the declarations in the \.{Makefile}, and try using the debug options
  2161. to determine where the error occurred.
  2162. It is possible your spooler is broken and is misinterpreting the
  2163. structured comments.  Try the \.{-N} flag to turn off
  2164. structured comments and see what happens.
  2165. \sub{Output Too Small or Inverted}
  2166. If some documents come out inverted or too small, your spooler is not
  2167. supplying an end of job indicator at the end of each file.  (This happens
  2168. a lot on small machines that don't have spoolers.)  You can
  2169. force \.{dvips} to do this with the \.{-F} flag, but note that this
  2170. generates files with a binary character (control-D) in them.  You can
  2171. also try using the \.{-s} flag to enclose the entire job in a save/restore
  2172. pair.
  2173. \sub{Error Messages From Printer}
  2174. If your printer returns error messages, the error message gives very
  2175. good information on what might be going wrong.  One of the most common
  2176. error messages is \.{bop undefined}.  This is caused by old versions
  2177. of Transcript and other spoolers that do not properly parse the setup
  2178. section of the PostScript.  To fix this, turn off structured comments
  2179. with the \.{-N} option, but make sure you get your spooling software
  2180. updated.  You might also try turning off comments on included files
  2181. with the \.{-K} option; many spoolers cannot deal with nested
  2182. documents.
  2183. Another error message is \.{VM exhausted}.  (Some printers indicate
  2184. this error by locking up; others quietly reset.)  This is caused by telling
  2185. \.{dvips} that the printer has more memory than it actually does, and
  2186. then printing a complicated document.  To fix this, try lowering the
  2187. parameter to \.{m} in the configuration file; use the debug option
  2188. to make sure you adjust the correct file.
  2189. Other errors may indicate that the graphics you are trying to include
  2190. don't nest properly in other PostScript documents, or any of a number of
  2191. other possibilities.  Try the output on a QMS PS-810 or other Adobe
  2192. PostScript printer; it might be a problem with the printer itself.
  2193. \sub{400 DPI Is Used Instead Of 300 DPI}
  2194. This common error is caused by not editing the \.{config.ps} file to
  2195. reflect the correct resolution for your site.  You can use the debug flags
  2196. (\.{-d64}) to see what files are actually being read.
  2197. \sub{Long Documents Fail To Print}
  2198. This is usually caused by incorrectly specifying the amount of memory
  2199. the printer has in \.{config.ps}; see the description above.
  2200. \sub{Including Graphics Fails}
  2201. The reasons why graphics inclusions fail are too numerous to mention.
  2202. The most common problem is an incorrect bounding box; read the section
  2203. on bounding boxes and check your PostScript file.  Complain very loudly
  2204. to whoever wrote the software that generated the file if the bounding
  2205. box is indeed incorrect.
  2206. Another possible problem is that the figure you are trying to include
  2207. does not nest properly; there are certain rules PostScript applications
  2208. should follow when generating files to be included.  The \.{dvips}
  2209. program includes work-arounds for such errors in Adobe Illustrator and
  2210. other programs, but there are certainly applications that haven't
  2211. been tested.
  2212. One possible thing to try is the \.{-K} flag, to strip the comments from
  2213. an included figure.  This might be necessary if the PostScript spooling
  2214. software does not read the structuring comments correctly.  Use of this
  2215. flag will break graphics from some applications, though, since some
  2216. applications read the PostScript file from the input stream looking for
  2217. a particular comment.
  2218. Any application which generates graphics output containing raw binary
  2219. (not hex) will probably fail with \.{dvips}.
  2220. \sub{Can't Find Font Files}
  2221. If \.{dvips} complains that it cannot find certain font files, it is
  2222. possible that the paths haven't been set up correctly for your system.
  2223. Use the debug flags to determine precisely what fonts are being looked
  2224. for and make sure these match where the fonts are located on your system.
  2225. \sub{Can't Generate Fonts}
  2226. This happens a lot if either \.{MakeTeXPK} hasn't been properly edited
  2227. and installed, or if the local installation of \MF\ isn't correct.
  2228. If \.{MakeTeXPK} isn't properly edited or isn't installed, an error
  2229. such as \.{MakeTeXPK not found} will be printed on the console.  The
  2230. fix is to talk to the person who installed \.{dvips} and have them fix
  2231. this.
  2232. If \MF\ isn't found when \.{MakeTeXPK} is running, make sure it is installed
  2233. on your system.  The person who installed \TeX\ should be able to install
  2234. \MF\ easily.
  2235. If \MF\ runs but generates fonts that are too large (and prints out the
  2236. name of each character as well as just a character number), then your
  2237. \MF\ base file probably hasn't been made properly.  To make a proper
  2238. \.{plain.base}, assuming the local mode definitions are contained in
  2239. \.{local.mf} (on the NeXT, \.{next.mf}; on the Amiga, \.{amiga.mf}),
  2240. type the following command (assuming \.{csh} under UNIX):
  2241. \cmd{localhost> inimf "plain; input local; dump"}
  2242. \noindent
  2243. Now, copy the \.{plain.base} file from the current directory to where
  2244. the base files are stored on your system.
  2245. Note that a preloaded \.{cmbase.base} should never be used when creating
  2246. fonts, and a program such as \.{cmmf} should never exist on the system.
  2247. The macros defined in \.{cmbase} will break fonts that do not use
  2248. \.{cmbase}; such fonts include the La\TeX\ fonts.  Loading the \.{cmbase}
  2249. macros when they are needed is done automatically and takes less than a
  2250. second---an insignificant fraction of the total run time of \MF\ for a
  2251. font, especially when the possibility of generating incorrect fonts is
  2252. taken into account.  If you create the La\TeX\ font {\tt circle10},
  2253. for instance, with the \.{cmbase} macros loaded, the characters will
  2254. have incorrect widths.
  2255. \sec{Using Color with dvips}
  2256. This new feature of \.{dvips} is somewhat experimental so your
  2257. experiences and comments are welcome.  Initially added by Jim Hafner,
  2258. IBM Research, {\tt hafner@almaden.ibm.com}, the color support has
  2259. gone through many changes by Tomas Rokicki.  Besides the changes to the
  2260. source code itself, there are additional
  2261. \TeX\ macro files: \.{colordvi.tex} and \.{blackdvi.tex}.  There are also
  2262. \.{.sty} versions of these files that can be used with La\TeX\ and
  2263. other similar macro packages.  This feature adds one-pass multi-color
  2264. printing of \TeX\ documents on any color PostScript device.
  2265. In this section we describe the use of color from the document
  2266. preparer's point of view and then add some simple instructions on
  2267. installation for the system administrator.
  2268. \sub{The Macro Files}
  2269. All the color macro commands are defined in \.{colordvi.tex} (or
  2270. \.{colordvi.sty}).  To access these macros simply add to the top of your
  2271. \TeX\ file the command
  2272. \cmd{\ttbackslash input colordvi}
  2273. \noindent
  2274. or, if your document uses style files like La\TeX, add the \.{colordvi}
  2275. style option as in 
  2276. \cmd{\ttbackslash documentstyle[12pt,colordvi]\char123article\char125}
  2277. There are basically two kinds of color macros, ones for local color
  2278. changes to, say, a few words or even one symbol and one for global
  2279. color changes.  Note that all the color names use a mixed case scheme.
  2280. There are 68 predefined colors, with names taken primarily from the
  2281. Crayola crayon box of 64 colors, and one pair of macros for the user
  2282. to set his own color pattern.  More on this extra feature later. You
  2283. can browse the file \.{colordvi.tex} for a list of the predefined colors.
  2284. The comments in this file also show a rough correspondence between the
  2285. crayon names and PANTONEs.
  2286. A local color command is in the form
  2287. \cmd{\ttbackslash ColorName\char123this will print in color\char125}
  2288. \noindent
  2289. Here \.{ColorName} is the name of a predefined color. As this example
  2290. shows, this type of command takes one argument which is the text that
  2291. is to print in the selected color.  This can be used for nested color
  2292. changes since it restores the original color state when it completes.
  2293. For example, suppose you were writing in green and want to switch
  2294. temporarily to red, then blue, back to red and restore green.  Here is
  2295. one way that you can do this:
  2296. \cmd{This text is green but here we are \ttbackslash Red\char123switching 
  2297. to red, \\
  2298. \ttbackslash Blue\char123nesting blue\char125, recovering the 
  2299. red\char125\ and back to \\
  2300. original green.}
  2301. \noindent
  2302. In principle there is no limit to the nesting level, but it is not
  2303. advisable to nest too deep lest you lose track of the color history.
  2304. The global color command has the form
  2305. \cmd{\ttbackslash textColorName}
  2306. \noindent 
  2307. This macro takes no arguments and immediately changes the default
  2308. color from that point on to the specified color. This of course can be
  2309. overriden globally by another such command or locally by local color
  2310. commands. For example, expanding on the example above, we might have
  2311. \cmd{\ttbackslash textGreen \\
  2312. This text is green but here we are \ttbackslash Red\char123switching 
  2313. to red, \\
  2314. \ttbackslash Blue\char123nesting blue\char125, recovering the 
  2315. red\char125\ and back to \\
  2316. original green.\\
  2317. \ttbackslash textCyan \\
  2318. The text from here on will be cyan unless \\
  2319. \ttbackslash Yellow\char123locally changed to yellow\char125. Now we
  2320. are back to cyan.} 
  2321. The color commands will even work in math mode and across math mode
  2322. boundaries.  This means that if you have a color before going into
  2323. math mode, the mathematics will be set in that color as well.  More
  2324. importantly however, in alignment environments like \.{\ttbackslash
  2325. halign}, \.{tabular} or \.{eqnarray}, local color commands cannot
  2326. extend beyond the alignment characters.
  2327. Because local color commands respect only some environment and
  2328. delimiter changes besides their own, care must be taken in setting
  2329. their scope.  It is best not to have then stretch too far.
  2330. At the present time there are no macros for color environments in
  2331. La\TeX\ which might have a larger range.  This is primarily to keep
  2332. the \TeX\ and La\TeX\ use compatible. 
  2333. \sub{User Definable Colors}
  2334. There are two ways for the user to specify colors not already defined.
  2335. For local changes, there is the command \.{\ttbackslash Color} which
  2336. takes two arguments.  The first argument is a quadruple of numbers
  2337. between zero and one and specifies the intensity of cyan, magenta,
  2338. yellow and black (CMYK) in that order.  The second argument is the
  2339. text that should appear in the given color.  For example, suppose you
  2340. want the words ``this color is pretty'' to appear in a color which is
  2341. 50\% cyan, 85\% magenta, 40\% yellow and 20\% black.  You would use
  2342. the command
  2343. \cmd{\ttbackslash Color\char123{.5 .85 .4 .2}\char125\char123 this
  2344. color is pretty\char125}
  2345. For global color changes, there is a command \.{\ttbackslash
  2346. textColor} which takes one argument, the CMYK quadruple of relative
  2347. color intensities.  For example, if you want the default color to be
  2348. as above, then the command
  2349. \cmd{\ttbackslash textColor\char123{.5 .85 .4 .2}\char125 \\
  2350. The text from now on will be this pretty color} 
  2351. \noindent
  2352. will do the trick.
  2353. Making a global color change in the midst of nested local colors is
  2354. highly discouraged.  Consequently, \.{dvips} will give you warning
  2355. message and do its best to recover by discarding the current color
  2356. history.
  2357. \sub{Subtleties in Using Color}
  2358. These color macros are defined by use of specialized \.{\ttbackslash
  2359. special} keywords.  As such, they are put in the \.{.dvi} file only as
  2360. explicit message strings to the driver.  The (unpleasant)
  2361. result is that certain unprotected regions of the text can have
  2362. unwanted color side effects.  For example, if a color region is split
  2363. by \TeX\ across a page boundary, then the footers of the current page
  2364. (e.g., the page number) and the headers of the next page can inherit
  2365. that color.  To avoid this effect globally, users should make sure
  2366. that these special regions of the text are defined with their own
  2367. local color commands.  For example in \TeX, to protect the header and
  2368. footer, use 
  2369. \cmd{\ttbackslash headline\char123\ttbackslash Black\char123 My
  2370. Header\char125\char125 \\
  2371. \ttbackslash footline\char123\ttbackslash Black\char123 \ttbackslash
  2372. hss\ttbackslash tenrm\ttbackslash folio\ttbackslash hss\char125\char125} 
  2373. This warning also applies to figures and other insertions, so be
  2374. careful!
  2375. Of course, in La\TeX, this is much more difficult to do because of the
  2376. complexity of the macros that control these regions.  This is
  2377. unfortunate, but is somehow inevitable because \TeX\ and La\TeX\ were
  2378. not written with color in mind.
  2379. Even when writing your own macros, much care must be taken.  The
  2380. color macros that `colorize' a portion of the text work by prefixing
  2381. the text with a special command to turn the color on and postfixing it
  2382. with a different special command to restore the original color.
  2383. It is often useful to insure that \TeX\ is in horizontal mode before
  2384. the first special command is issued; this can be done by prefixing the
  2385. color command with {\tt\char92 leavevmode}.
  2386. \sub{Printing in Black/White, after Colorizing}
  2387. If you have a \TeX\ or La\TeX\ document written with color macros and
  2388. you want to print it in black and white there are two options.  On all
  2389. (good) PostScript devices, printing a color file will print in
  2390. corresponding grey-levels.  This is useful since in this way you can
  2391. get a rough idea of where the colors are changing without using
  2392. expensive color printing devices.  The second option is to replace the
  2393. call to input \.{colordvi.tex} with \.{blackdvi.tex} (and similarly for the
  2394. \.{.sty} files).  So in the above example, replacing the word
  2395. \.{colordvi} with \.{blackdvi} suffices.  This file defines the color macros
  2396. as no-ops, and so will produce normal black/white printing.  By this
  2397. simple mechanism, the user can switch to all black/white printing
  2398. without having to ferret out the color commands.  Also, some device
  2399. drivers, particularly non-PostScript ones like screen previewers, will
  2400. simply ignore the color commands and so print in normal black/white.
  2401. Hopefully, in the future screen previewers for color displays will be
  2402. compatible with some form of color support.
  2403. \sub{Configuring dvips for Color Devices}
  2404. To configure dvips for a particular color device you need to fine tune
  2405. the color parameters to match your device's color rendition.  To do
  2406. this, you will need a PANTONE chart for your device.  The header file
  2407. \.{color.lpro} shows a (rough) correspondence between the Crayola
  2408. crayon names and the PANTONE numbers and also defines default CMYK
  2409. values for each of the colors.  Note that these colors must be defined
  2410. in CMYK terms and not RGB as \.{dvips} outputs PostScript color
  2411. commands in CMYK.  This header file also defines (if they are not
  2412. known to the interpreter) the PostScript commands \.{setcmykcolor} and
  2413. \.{currentcmykcolor} in terms of a RGB equivalent so if your device
  2414. only understands RGB, there should be no problem.
  2415. The parameters set in this file were determined by comparing the
  2416. PANTONE chart of a Tektronics PHASER printer with the actual Crayola
  2417. Crayons.  Because these were defined for a particular device, the
  2418. actual color rendition on your device may be very different.  There
  2419. are two ways to adjust this.  One is to use the PANTONE chart for your
  2420. device to rewrite \.{color.lpro} prior to compilation and
  2421. installation.  A better alternative, which supports multiple devices,
  2422. is to add a header file option in the configuration file for each
  2423. device that defines, in \.{userdict}, the color parameters for those
  2424. colors that need redefining.
  2425. For example, if you need to change the parameters defining
  2426. \.{Goldenrod} (approximately PANTONE 109) for your device
  2427. \.{mycolordev}, do the following.  In the PANTONE chart for your
  2428. device, find the CMYK values for PANTONE 109.  Let's say they are
  2429. \.{\char123\ 0 0.10 0.75 0.03 \char125}. Then create a header file
  2430. named \.{mycolordev.pro} with the commands
  2431. \cmd{userdict begin \\
  2432. /Goldenrod \char123\ 0 0.10 0.75 0.03 setcmykcolor\char125\ bind def}
  2433. \noindent
  2434. Finally, in \.{config.mycolordev} add the line 
  2435. \cmd{h mycolordev.pro}
  2436. \noindent
  2437. This will then define \.{Goldenrod} in your device's CMYK values in
  2438. \.{userdict} which is checked before defining it in \.{TeXdict} by
  2439. \.{color.pro}.
  2440. This mechanism, together with additions to \.{colordvi.tex} and
  2441. \.{blackdvi.tex} (and the \.{.sty} files), can also be used to predefine
  2442. other colors for your users.
  2443. \sub{Protecting Regions From Spurious Colors}
  2444. Because color is defined via \TeX's {\tt\ttbackslash special} command,
  2445. it cannot be sensitive to the output routine or certain regions of the
  2446. page like the header and footer.  Consequently, these regions need to
  2447. be protected from spurious color changes (particularly when local
  2448. colors spread across page breaks).
  2449. Users need to be aware of the possibility of certain regions getting
  2450. unwanted or unpredicted colors.  Headers and footers are most
  2451. worrisome so style designers who want to use color should keep this in
  2452. mind.
  2453. One particular region of text that gets spurious color effects is
  2454. labels in list environments.  For instance, because of the way list
  2455. items are defined in standard La\TeX, the bullet for items that
  2456. start with a different color also gets drawn in that color.
  2457. To give the user a simple mechanism to solve this problem (and other
  2458. unforeseen effects of this type) one other special macro is
  2459. automatically defined.  This macro is called {\tt\ttbackslash
  2460. globalColor}.  It is actually a {\it local\/} color macro and so takes
  2461. a single argument.  But the color effect it produces is always the
  2462. same as that set by the {\it last\/} {\tt\ttbackslash textColor} or
  2463. {\tt\ttbackslash textColorName} command.  In effect, when a
  2464. {\tt\ttbackslash textColorName} command is called, {\tt\ttbackslash
  2465. globalColor} gets a new definition equivalent to the local
  2466. {\tt\ttbackslash ColorName} macro.  For example, when the default is
  2467. black, {\tt\ttbackslash globalColor=\ttbackslash Black} and when
  2468. {\tt\ttbackslash textGreen} appears, {\tt\ttbackslash
  2469. globalColor=\ttbackslash Green}.  This special macro can then be used
  2470. to protect sensitive regions of the text.
  2471. For example, in La\TeX\ files, one might make sure that the header and
  2472. footers have {\tt\ttbackslash globalColor} wrapping their contents.
  2473. In this way, they will inherit the current active root (unnested)
  2474. color state.
  2475. \sub{Color Support Details}
  2476. To support color, \.{dvips} recognizes a certain set of specials.
  2477. These specials all start with the keyword \.{color} or the keyword
  2478. \.{background}.
  2479. We will describe \.{background} first, since it is the simplest.
  2480. The \.{background} keyword must be followed by a color specification.
  2481. That color specification is used as a fill color for the background.
  2482. The last \.{background} special on a page is the one that gets issued,
  2483. and it gets issued at the very beginning of the page, before any
  2484. text or specials are sent.  (This is possible because the prescan
  2485. phase of \.{dvips} notices all of the color specials so that the
  2486. appropriate information can be written out during the second phase.)
  2487. Ahh, but what is a color specification?  It is one of three things.
  2488. First, it might be a PostScript procedure as defined in a PostScript header
  2489. file.  The \.{color.pro} file defines 64 of these, including
  2490. \.{Maroon}.  This PostScript procedure must set the current color to be
  2491. some value; in this case, \.{Maroon} is defined as
  2492. \.{0 0.87 0.68 0.32 setcmykcolor}.
  2493. The second possibility is the name of a color model (initially, one of
  2494. \.{rgb}, \.{hsb}, \.{cmyk}, or \.{gray}) followed by the appropriate
  2495. number of parameters.  When \.{dvips} encounters such a macro, it sends
  2496. out the parameters first, followed by the string created by prefixing
  2497. \.{TeXcolor} to the color model.  Thus, the color specification
  2498. \.{rgb 0.3 0.4 0.5} would generate the PostScript code \.{0.3 0.4 0.5
  2499. TeXrgbcolor}.  Note that the case of zero arguments is disallowed, as
  2500. that is handled by the single keyword case above (where no changes to
  2501. the name are made before it is sent to the PostScript file.)
  2502. The third and final type of color specification is a double quote followed
  2503. by any sequence of PostScript.  The double quote is stripped from the
  2504. output.  For instance, the color specification \.{"AggiePattern setpattern}
  2505. will set the `color' to the Aggie logo pattern (assuming such exists.)
  2506. So those are the three types of color specifications.  The same type of
  2507. specifications are used by both the {\tt background} special and the
  2508. {\tt color} special.  The {\tt color} special itself has three forms.
  2509. The first is just {\tt color} followed by a color specification.  In
  2510. this case, the current global color is set to that color; the color stack
  2511. must be empty when such a command is executed.
  2512. The second form is {\tt color push} followed by a color specification.
  2513. This saves the current color on the color stack and sets the color
  2514. to be that given by the color specification.  This is the most common
  2515. way to set a color.
  2516. The final version of the {\tt color} special is just {\tt color pop},
  2517. with no color specification; this says to pop the color last pushed
  2518. on the color stack from the color stack and set the current color to
  2519. be that color.
  2520. The {\tt dvips} program correctly handles these color specials
  2521. across pages, even when the pages are repeated or reversed.
  2522. These color specials can be used for things such as patterns or
  2523. screens as well as simple colors.  However, note that in the
  2524. PostScript, only one `color specification' can be active at a
  2525. time.  For instance, at the beginning of a page, only the
  2526. bottommost entry on the color stack is sent; also, when a color
  2527. is `popped', all that is done is that the color specification
  2528. from the previous stack entry is sent.  No \.{gsave} or \.{grestore}
  2529. is used.  This means that you cannot easily mix usage of the 
  2530. {\tt color} specials for screens and colors, just one or the other.
  2531. This may be addressed in the future by adding support for
  2532. different `categories' of color-like state.
  2533.