If the document has no graphics, the DVI version can be produced with latex, and the PDF version with pdflatex:
If the document does have graphics, then a solution is to produce a PostScript version with dvips (taking care of using the -Ppdf flag) and to distill it later with the Acrobat Distiller. In our system both operations can be done in one step by using the dvi2pdf command:latex filename.tex pdflatex filename.tex
However this has several drawbacks. The Acrobat Distiller is a commercial program, so it costs money to purchase and upgrade (we have been using a "frozen" version purchased several years ago). Also in some situations it may give problems with fonts. So it is a good idea to have an alternative based on free software only. A possibility is to use the dvipdfm command (included in the RedHat distribution of Linux):dvi2pdf filename.dvi
Another alternative (which we discuss below) is to to include graphics in a way that both latex and pdflatex can manage.dvipdfm filename.dvi
Graphics can be produced in various formats. For inclusion in a DVI file by latex they must be in EPS (Encapsulated PostScript) format. Unfortunately EPS files cannot be included in PDF documents with pdflatex, they must be either in PDF format or in one of various graphic formats such as PNG or JPEG. The way graphics are usually included are also different: latex uses the \psfig command (and the psfig or epsfig package), and pdflatex uses \pdfimage. There is however a command that can be processed by both latex and pdflatex: \includegraphics from the graphics package - with added options if the graphicx package is used.
So assume that you have a figure in an EPS file foo.ps and want to include it in a LaTeX file filename.tex to be processed by both latex and pdflatex. Do the following:
That produces foo.pdf. You may also convert your EPS file to PNG or some other graphic format if you wish:epstopdf foo.ps
Keep both files, the original foo.ps and the new foo.pdf (or foo.png, etc.) together in the working directory, since both will be needed.convert foo.ps foo.png
The following example illustrates the use of the graphicx package and the \includegraphics command:
\documentclass{article} \usepackage{graphicx} \begin{document} Some text... \begin{figure}[htb] \begin{center} \includegraphics[height=1in,width=1in,angle=-90]{foo} \caption{This is a figure.} \end{center} \end{figure} More text... \end{document}
The syntax of the \includegraphics command is as follows:
where parameters is a comma-separated list of any of the following: bb=llx lly urx ury (bounding box), width=h_length, height=v_length, angle=angle, scale=factor, clip=true/false, draft=true/false.\includegraphics[parameters]{filename}
Miguel A. Lerma, 7/25/2001