Teaching with Technology Collaboratory

# Converting LaTeX Documents to PDF

The standard latex program takes in LaTeX documents and produce a DVI (DeVice Independent) file, which must then be converted to a device dependent format by a driver such as dvips.

The CCC systems have a related program - pdflatex - which works like the standard latex but which produces a PDF file instead of DVI. A benefit of this is that pdflatex uses the PostScript Type 1 (Outline) fonts by default, for high-quality print output.

If you have graphics included in your document, some work has to be done to make them compatible with pdflatex. Regular latex uses Encapsulated PostScript (EPS) for included graphics, but pdflatex does not. pdflatex does, however, allow graphics in PNG [Link to: http://www.libpng.org/pub/png/] format. The convert utility, a part of the ImageMagick [Link to: http://www.imagemagick.org/script/index.php] suite, is installed on the CCC systems, and can convert EPS graphics to PNG:

convert wpi-logo.ps wpi-logo.png

Graphics are included in LaTeX documents by first loading the graphicx package:

\documentclass{article}
\usepackage{graphicx}

\begin{document}

At the point where you want the graphic to be, declare the graphic using the includegraphics command:

\includegraphics{wpi-logo}

If you leave off the file extension (.ps, .png) in declaring the name of the graphic, then latex and pdflatex will pick whichever version of the graphic suits its need best, allowing you to process a single version of the document using either program without changes.

There is also a pdftex program, which does the same thing as pdflatex, but is an analogue to the regular tex Plain TeX processing program.