Creating LaTeX documents

ps2pdf and dvipdf
Creating a PDF file

There are basically two ways to create a PDF file from your document.

1. Convert the DVI to PostScript, and PostScript to PDF

For some purposes, especially to include PostScript graphics (and ``PS tricks'') into the document, it is better to convert the DVI file to PostScript first, then use ps2pdf to convert the PostScript to PDF;
unix>   latex MyDoc.tex                 (creates MyDoc.dvi)
unix>   dvips -Ppdf MyDoc.dvi -o        (creates MyDoc.ps)
unix>   ps2pdf MyDoc.ps                 (creates MyDoc.pdf)
There is a command dvipdf, which actually combines the latter two commands, so the above could be reduced (if you don't need the intermediate PostScript file) to
unix>   latex MyDoc.tex           (creates MyDoc.dvi)
unix>   dvipdf MyDoc.dvi          (creates MyDoc.pdf)
while still allowing PostScript images/tricks.

The negative side of the above methods is that they use ghostscript to interpret and convert the PostScript, and older versions will degrade the quality of the fonts.

2. Convert the DVI directly to PDF: pdflatex

The command pdflatex compiles the LaTeX and immediately converts the result to PDF without using a ghostscript interpreter. It almost always gives better quality results and smaller PDF files.

Another benefit is that you can insert JPEG, PNG and PDF graphics into your document. The negative side of this is that pdflatex will not support some PostScript images or operations. If you want to insert figures, they must be in either PDF, JPEG or PNG format. You can convert your Encapsulated PostScript images to PDF using epstopdf, then include them with the LaTeX macro \includegraphics{}. So, for example, the image included in section 3 must first be converted to PDF, then the inclusion command is \includegraphics{diagram.pdf}. The steps to converting straight to PDF:

unix>  epstopdf diagram.eps            (creates diagram.pdf)
unix>  pdflatex MyDoc.tex              (creates MyDoc.pdf)