Generating "good" PDF files from LaTeX
The topic of converting LaTeX documents into PDF (Portable Document Format) documents has become increasingly important. PDF files, when properly created, can be viewed and printed from almost every computer platform available (Unix, Windows, MacOS, etc). This feature makes it very useful for distributing class handouts (e.g, lecture notes, howework assignments and solutions), scientific papers (e.g. the Duke Statistics Discussion Paper series), and in fact any document that needs to look "good" on many computing platforms.
In the past, the most compelling use was submitting grant proposals via the National Science Foundation (NSF) FastLane system. In fact, much of the information that follows has been gleaned from the FastLane User Guide section on Creating FastLane PDF Files. However, the NSF now recommends that TeX/LaTeX users submit DVI files and associated PostScript figures. For details, see the FastLane User Guide section on Using TeX and LaTeX.
Generating a PDF document from TeX/LaTeX sources
There are two different ways of generating pdf files from (La)TeX sources: traditional method of creating a postscript file and converting it to a pdf document (a process known as distilling), or using pdftex/pdflatex to generate a pdf directly from your tex/latex source.
The traditional way
- Create the dvi file by the usual means (TeX/LaTeX).
latex file.tex
- Create a PostScript file from the DVI file using dvips
and the "pdf" printer configuration. This will generate
a PostScript file using Type1 fonts, avoiding the bitmapped
(Type3) fonts.
dvips -Ppdf -o file.ps file.dvi
- Convert the PostScript file to a PDF file which
has all of the requisite fonts embedded in the document to
ensure portability and printability.
ps2pdf file.ps
If you are not using a departmental machine, you should add the following flags when using ps2pdf to make sure all the fonts are embedded.ps2pdf -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true file.ps
Using pdftex/pdflatex
In most cases, all you should need to do is
pdftex file.texfor TeX sources, or
pdflatex file.texfor LaTeX sources; however, you do need to verify that you have generated a working PDF file (view with acroread). There are some known bugs (see the man page) which will result in an invalid PDF file.
Verifying that your PDF document is "good"
To verify that your PDF document contains only embedded Type1 fonts, view it using Adobe Acrobat Reader:
acroread file.pdfGo to the File > Document Info > Fonts menu and verify that the fonts are embedded and that they are Type1.