tags:

views:

1123

answers:

6

Working with a latex document with eps images as in the example below...

\documentclass[11pt]{paper}
\usepackage[dvips]{graphicx}
\usepackage{fullpage}
\usepackage{hyperref} 
\usepackage{amsmath} 
\DeclareMathSizes{8}{8}{8}{8}

\author{Matt Miller}
\title{my paper}
\begin{document}

\begin{figure}[!ht]
    \begin{center}
    \includegraphics[width=2in] {Figuer.eps}
    \end{center}
    \caption{Figure\label{fig:myFig}}
\end{figure}
\end{document}

When I got to build my latex document the time it takes to build the document increases with time. Are there any tips or tricks to help speed up this process?

latex paper.tex; dvipdf paper.dvi
A: 

As a quick fix, try passing the [draft] option to the graphix package.

doppelfish
+2  A: 

Some additional ideas:

  • try making a simpler figure (e.g. if it's a bitmapped figure, make a lower-resolution one or one with a low-resolution preview)
  • use pdflatex and have the figure be a .jpg, .png, or .pdf source.

I generally take the latter approach (pdflatex).

Mr Fooz
+2  A: 

How big are the eps files? Latex only needs to know the size of the bounding box, which is at the beginning of the file.

dvips (not dvipdf) shouldn't take too much time since it just needs to embed the eps into the postscript file.

dvipdf, on the other hand has to convert the eps into pdf, which is expensive.

A: 

Are you using a DVI previewer or going straight to pdf? If you go all the way to pdf, you'll pay the cost of unencoding and reencoding (I used to have that problem with visio diagrams). However, if you can generate PSs most of the time or work straight with the DVI, the experience would be manageable.

Also, some packages will create .pdf files for you from figures, which you can then embed (I do that on my mac)

Uri
+1  A: 

Indeed, you can use directly

pdflatex paper.tex

Few changes are required.

  1. Convert your graphics from EPS to PDF before running pdflatex. You need to do it only once:

    epstopdf Figuer.eps
    

    If will produce Figuer.pdf which is suitable for pdflatex. In your example dvipdf does it on every build.

  2. In the document use

    \usepackage[pdftex]{graphicx} % not [dvips]
    
  3. And to include graphics, omit the extension:

    \includegraphics[width=2in] {Figuer} % but {Figuer.pdf} works too
    

    It will choose Figuer.pdf when compiled by pdflatex and Figuer.eps when compiled by latex. So the document remains compatible with legacy latex (only remember to chage \usepackage{graphics}).

jetxee
A: 

Reducing the file size of your EPS files might help. Here are some ideas how to do that.

If you have the original image as JPEG, PNG, TIFF, GIF (or any other sampled image), reduce the original file size with whatever tools you have, then convert to EPS using sam2p. sam2p gives you much smaller EPS file sizes than what you get from most popular converters.

If your EPS is vector graphics, convert it to PDF using ps2pdf14 (part of Ghostscript), then convert back to eps using pdftops -eps (part of xpdf). This may reduce the EPS file size a lot.

pts