Using TeX to Create pdf Files

To generate PDF files from TeX, use the package "pdftex". Documentation can be found in one of the directories


(depending on whether you are using a Solaris or Linux system, respectively). For most latex, amstex, or tex files, you can produce a pdf file just by prepending pdf to the name of the command; e.g.,

pdflatex filename
pdfamstex filename
pdftex filename

you can then open the new file inside Adobe Acrobat Reader with the command:

acroread filename.pdf

If for any reason pdflatex fails to work (e.g., it complains about some font that you are using, or it cannot include a PostScript figure), there is an alternative way of creating pdf files:

latex filename
dvips -Pwww -o filename
ps2pdf filename.pdf

There is a way to include encapsulated PostScript (.eps) files when using pdflatex: you must convert them to pdf first:

epstopdf file.eps

Other image formats are also supported.

One other way to convert postscript files to pdf is to use ImageMagick's convert command:

convert file.pdf

Graphics Files and pdftex

Usually, pdftex will accept any input that tex will (and likewise for pdflatex and latex), but an exception is the handling of graphics files. Pdftex will only accept graphics files in pdf, jpeg, png, and mps (Metapost) formats. Graphics in other formats need to be converted to an acceptable format.

For example, if a LaTeX file pdftest.tex referred to a file pdftestfig.eps in Encapsulated PostScript format, you could create a dvi file in the normal way:

latex pdftest

but to create a pdf file requires an extra step to convert the eps file to pdf format:

epstopdf pdftestfig.eps
pdflatex pdftest

The epstopdf command only needs to be executed once (per figure) initially, plus once every time the figure changes.

Having latex refer to one type of file and pdflatex refer to a different file type requires a little trickery within the tex file. Sample pdftest.tex and pdftestfig.eps files are available to illustrate how to do this.

Metapost output is accepted by both (la)tex and pdf(la)tex. Unfortunately, if it contains text, it is not accepted by xdvi.

NSF FastLane

The NSF FastLane system now accepts files in many formats, including pdf, PostScript, and dvi. For best results, though, use pdftex or pdflatex to produce a pdf file.

In the recent past, FastLane refused to accept pdf files produced in the newest version of the pdf format, but this restriction is no longer in place, and the oldpdf(la)tex command is no longer necessary.

Last updated 7 July 2003