How to make a compact beautiful PostScript or PDF file from a TeX file

(Japanese version)
There are lots of PostScript and PDF documents generated from TeX files in the Internet, but many of them assume a fixed resolution of an output device and produce dirty results if they are displayed on a monitor or printed by a printer of different resolution. In particular, it is well-known that the Adobe Acrobat Reader displays resolution-dependent (bitmap) fonts very poorly. Their sizes are also large compared to their original DVI files. The reason of those phenomena is that a PostScript or PDF file converted from a TeX one contains lots of bitmap fonts. I explain how to
• reduce the size of fonts information,
• and include outline fonts instead of bitmap ones
in a PostScript or PDF file with LaTeX2e and Dvipsk. Since we often make PDF files from PS files, I start on PS files. (A well-written explanation on the same topic can be found in the "PostScript and TeX" section of TeX FAQ.)

How to reduce the size of fonts data included in a PostScript

TeX uses the Computer Modern fonts designed by Donald E. Knuth, and a PostScript file converted from a TeX one usually contains the Computer Modern fonts in bitmap format. On the other hand, almost all printers have the PostScript fonts called
Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, Symbol, Times-Bold, Times-BoldItalic, Times-Italic, and Times-Roman.
If we use those fonts in TeX, we do not have to embed fonts into the PostScript file. So it becomes smaller. They can be used as follows:
1. Install the LaTeX2e package PSNFSS. Follow instructions in macros/latex/required/psnfss/00readme.txt in the Comprehensive TeX Archive Network (CTAN).
2. Place \usepackage{times,mathptmx} into a TeX file.
3. If you use the mathptmx package and the \mathcal command, you have to install the rsfs fonts as follows. \mathcal uses the rsfs fonts.
1. Get all *.pfb files in the directory fonts/rsfs/ps-type1/hoekwater in CTAN and move them to a directory pointed by the variable T1FONTS in texmf.cnf.
2. Generate TFM files from *.afm files in fonts/rsfs/ps-type1/hoekwater/afm using afm2tfm, or from *.mf files in fonts/rsfs. Move all *.tfm into a directory pointed by the variable TFMFONTS in texmf.cnf.
Even if you have done the setup above, a few Computer Modern fonts are embedded.

The mathptmx package does not provide bold face math italic fonts. Thus we cannot use \boldmath, \boldsymbol, etc. If you put either of the following lines
\DeclareMathAlphabet{\bm}{OT1}{ptm}{b}{it}, or
\DeclareMathAlphabet{\bm}{OML}{cmm}{b}{it},
then $\bm{x}$ produces the bold version of $x$.

Subscripts are positioned unnaturally below by mathptmx.sty (in PSNFSS 8.1 and earlier releases) in comparison to mathptm.sty or the CM fonts. The reason for this phenomenon is that \fontdimen5 in zptmcm7y.tfm is too small. More details are found at http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=psnfss/3279.

How to make compact beautiful PDF files

There are the 4 methods producing a PDF file from a TeX input on a UNIX environment.
1. Produce a PostScript file then convert it into the PDF format by Adobe Acrobat. If you make a PostScript by the method above then you get a PDF file containing a few outline fonts, i.e., a compact beautiful PDF file.
2. Produce a PostScript file then convert it into the PDF format by Ghostscript. Ghostscript before version 6 cannot embed outline fonts in a PDF file and it converts any fonts into bitmap format. So the resulting PDF is resolution-dependent if you use old versions.
3. Produce a PDF file directly with the PDF(La)TeX. PDFTeX can embed outline fonts.
4. dvipdfm convert DVI files into PDF files. But I have not used it and I don't know the detail of dvipdfm.
A PDF file can contain hyperlinks. hyperref.sty can convert \ref, \lable, table of contents, index, etc. of LaTeX into hyperlinks in PDF. It works both PDFLaTeX and normal LaTeX. hyperref.sty can be obtained from macros/latex/contrib/supported/hyperref in CTAN. You also need macros/latex/contrib/other/misc/url.sty.

A PDF file can be compressed with the LZW algorithm. But by the Unisys threat, Ghostscript and PDFTeX seem unable to compress PDF files with the LZW algorithm. Instead of the LZW algorithm, they compress PDF files with the Deflate algorithm, which is usually better than the LZW algorithm.

TeX Resources on the Web on the TeX Users Group web page. That is a comprehensive list.

Ryutaroh Matsumoto