How to Produce Portable PDF Files from LaTeX

Heartfelt thanks to Jason Flinn, Joshua LeVasseur, Barton Massey, and Erez Zadok for their contributions to these instructions.

  • Use dvips to produce a postscript file from your DVI, and then ps2pdf to produce the final PDF. Tools that produce PDF directly from DVI/TEX files don't always do a good job.

  • Check to make sure your installation of ps2pdf invokes ps2pdf14. If not, invoke it explicitly.

  • Be sure to use appropriate fonts. Times Roman is best, and it is included in the usetex-v1.cls package.

  • If you are generating figures as EPS from a Microsoft application:
    • Use portrait orientation. Landscape generates visuals outside the EPS bounding box, which prevents the files from printing in Quark.
    • Force the EPS files embed all fonts, via the Windows printer dialog boxes.

  • Force your gnuplot EPS files to embed fonts, using the fontfile command. Example:
    set terminal postscript eps enhanced "NimbusSanL-Regu" fontfile "uhvr8a.pfb"
    embeds gnuplot's default Helvetica font in the output. The name of the font is NimbusSanL-Regu, and the font file is uhvr8a.pfb. The Nimbus fonts are a family of free fonts distributed with LaTeX. The font file has a line near the top which defines the abbreviated font name:
    /FontName /NimbusSanL-Regu def
    Look for similar lines in other font files if you want to change the font. Some families, for example, the Adobe afm fonts, may be incompatible with gnuplot.

  • Most latex distributions contain a dvips tool that by default formats the postscript file for A4 paper. YTo force dvips to produce a format for U.S. letter style, first try:
    dvips -Ppdf -Pcmz -Pamz -t letter -D 600 -G0
    If that doesn't work, try -G1 instead of -G0:
    dvips -Ppdf -Pcmz -Pamz -t letter -D 600 -G1
    You may just prefer to use pdflatex, which normally does the right thing and avoids the dvi step altogether.

  • dvips may not include bitmapped fonts in the produced PS correctly. If you then produce a PDF file, you may get errors from acroread or xpdf, because it will miss those fonts. When latex formats the round bullets for lists, it uses such a bitmapped font. The solution is to tell dvips to include bitmapped fonts in the PS file, as follows:
    dvips -Pcmz -t letter -o foo.ps foo.dvi

    If you don't use -Pcmz, or you use another -P option, you may find odd font problems in your paper (for example, "f" followed by "i" becomes one character or is replaced with the British Sterling character).

?Need help?


Last changed: 16 March 2006 jel