James Clarke & Notes

Generating EPS files from JPEGs

How to create Encapsulated Postscript (eps) files from jpeg (.jpg) images and include them within a LaTeX document.

jpeg2ps is a nice little utility that converts jpegs to eps files (surprisingly enough). This is very handy for people on Windows platforms that need to create Encapsulated Postscript (eps) files with bounding boxes from jpeg images. The generated eps file can be inserted into LaTeX documents easily.

The utility is easy to use:

$ jpeg2ps sample.jpg > sample.eps
is all that is required to convert the jpeg.

To place the resulting eps into a LaTeX document:

begin{figure}[hbp]
    begin{center}
        includegraphics[width=0.5textwidth]{sample}
        caption{This is some image}
    end{center}
end{figure}

This, of course, relies on the graphicx package being loaded. This is done in the preamble using:

usepackage[dvips]{graphicx}

Using jpeg2ps was the best method I found for inserting images/figures/graphics into LaTeX documents under Windows. Using other methods, such as epstool, generated bounding box errors when compiling the LaTeX document.

Update 2003-11-18

Since switching to Mac OS X I have been using the unix version of jpeg2ps. It compiles fine under OS X. Simply download the unix version and do:

$ make
$ sudo make install