Converting Documents to PDF in the Math Department Linux System

If you are using TeX/LaTeX, you get your documents in dvi format, which can easily be printed or converted to PostScript with dvips. There are various ways of producing a PDF file from a dvi or PostScript source, but they do not always produce the best quality.
  1. Use pdftex or pdflatex instead of tex or latex on your source TeX/LaTeX file. For instance, the following command will produce a filename.pdf file instead of the usual filename.dvi file from a latex source file filename.tex:
                pdflatex filename.tex
    
    If the file is in plain TeX, use:
                pdftex filename.tex
    

    If the document has figures inserted as PostScript files, you can follow the previous procedure, but first the figures must be converted to PDF, PNG or JPEG format, and the TeX/LaTeX file must contain the appropriate commands to insert files with the right format. For the details on how to include graphics, look at

    Including graphics in LaTeX/PDF documents

  2. An alternative is to use TeX/LaTeX in the usual way to produce a DVI file, then use dvips (with the -Ppdf flag) to convert the DVI file into PostScript, and finally convert the PostScript to PDF with pstill:
         latex filename.tex
         dvips -Ppdf -o filename.ps filename.dvi
         pstill -o filename.pdf filename.ps
    

  3. If various documents share some references it might be inconvenient to write them as separate TeX/LaTeX files. In that case, write them together as a single document, process it to produce a single DVI file, then convert it into PDF with dvipdfm. The document can be split into its different parts at the same time by selecting ranges of pages with the -s flag of dvipdfm:
         dvipdfm -s <n1>-<n2> -o filename.pdf filename.dvi
    
    where <n1>-<n2> represents the range of pages, e.g., 7-12 means pages 7 through 12.

  4. Another solution to produce various separate PDF documents from a single source is to produce a PostScript file as above
         latex filename.tex
         dvips -Ppdf -o filename.ps filename.dvi
    
    then divide the PostScript file into separate files selecting pages with psselect
         dvipdfm -s <n1>-<n2> filename.ps foo.ps
    
    and finally convert each PostScript file into PDF
         pstill -o foo.pdf foo.ps
    

  5. Finally, the subject of how to combine various separate documents into a single PDF file is addressed here:
    How do I merge several PostScript/PDF documents into a single PDF document?


Miguel A. Lerma, 5/6/2005


 
Department Search: