next up previous
Next: latex2html: creating html from Up: Creating various file formats Previous: Creating various file formats


Creating good PDF files from Latex

Creating a pdf file from Latex source is much trickier than it ought to be. You have to make certain that both the text and the mathematical symbols show up clearly on screen and that they work on Windows machines and print out from Windows machines. If you're converting from ps to pdf the key issue is getting the fonts right. Here are some options for going from Latex to pdf:

  1. The following should deal with the text and font issues, and seems to give good representation of the mathematical fonts. However, I have found that creating a pdf file in this way does not give mathematical symbols that project well for presentations because the lines in the letters are far too thin. This is solved to some extent by making all the mathematical symbols bold.

    1. in the Latex preamble, include the line \usepackage{times} (I'm not completely sure this is necessary.)
    2. >latex file.tex
    3. >dvips -Ppdf -G0 file.dvi
    4. Either

      1. >ps2pdf file.ps file.pdf
      2. >convert file.ps file.pdf
    5. Now check that only Type-1 fonts are included in the pdf file. To do this open the pdf file using Acrobat (this may only work on Windows). Click on "file" -> "Document Properties" -> "Fonts" and make sure there are only Type-1 fonts. If there are other fonts (like Type-3), they might come from graphics files imported into the document. I don't understand the technicalities, but pdf files with only Type-1 fonts seem to display on-screen and print much better.
  2. Convert directly from Latex to pdf using pdflatex. For more (in the sense of both quantity and quality) details on using pdflatex, check out Tim Hoar's site at NCAR's Geophysical Statistics Project. For presentations, pdflatex does a better job with the thickness of the mathematical symbols than the route above in going through the dvi and ps file to get to pdf, but it's still not great, and if you make the symbols bold, then you get about the same results as using the approach above with bold mathematical symbols.

    1. The main issue is in incorporating figures. pdflatex can't incorporate ps files or use pstricks. Instead, if your figures are from R, create the pdf files directly in Ror convert your figures: convert any ps figures to pdf or jpg; to get the figure size right, you may need to crop the figure:

      1. for a jpg figure you can do this with xv
      2. for a pdf figure, convert the ps file to eps >ps2epsi file.ps, so that it has a bounding box and then do >epstopdf file.epsi
    2. include \usepackage[pdftex]{graphics} in the Latex preamble
      also, I think that also using \usepackage{times} gives more clear text for presentations because it seems to be bolder than is otherwise the case
    3. include the figure using \includegraphics{file.pdf} or \includegraphics{file.jpg}
    4. compile the Latex directly into pdf without sojourning in dvi- or ps-land: >pdflatex file.tex
  3. If you're not satisfied with either solution above, you can delve more deeply in the gory details of the fonts. On the CMU stat system (and presumably others), this issue with the fonts seems to be largely solved using approach #1 above.


next up previous
Next: latex2html: creating html from Up: Creating various file formats Previous: Creating various file formats
Chris Paciorek 2004-02-19