Using MiKTeX you have to use the recommended graphics format depending on the engine you are using.
So, if you are using latex—mostly at a queue latex→dvips→pstopdf—you can only use EPS, PCX, BMP, MSP, PICT or PNTG, all of them with different file extensions and sometimes with additional endings. EPS is the most recommended file format with latex→dvips, because the dimensions of EPS may be detected by
graphics/graphicx itself. For the other file formats you need additional bb-files with the dimensions or to use option
If you are using pdflatex with direct PDF output, you can only use PDF, JPEG, PNG and MPS. (Note: MPS is a subtype of EPS generated by
MetaPost and needs parts of
ConTeXt to be installed.)
With TeX Live since 2010, support for on-the-fly conversion of EPS to PDF has been added. This should be activated out if the box. The conversion consists in three parts:
graphics.cfg file, that supports file extensions
.eps even, if pdflatex with direct pdf output is used.
- LaTeX package epstopdf, that uses shell escapes to convert eps to pdf on the fly using repstopdf.
texmf.cnf with settings
shell_escpape = p and
shell_escape_commands = repstopdf.
Because of this, you may use EPS with pdflatex and direct PDF output, if you are using TeX Live since 2010.
With MiKTeX you may use on-the-fly conversion, too. In this case you have to load LaTeX package
epstopdf on your own (see the manual for more information) and you have to set command line option
--enable-write18 at call of
pdflatex. If you call
pdflatex from within a LaTeX editor, have a look at the editor or the profile settings and the editor manual to find out, where you may add this command line option.
You may test the on-the-fly conversion using:
%%BoundingBox:100 100 172 172
100 100 moveto
72 72 rlineto
72 neg 0 rlineto
72 72 neg rlineto
100 100 moveto
You are using pdf\LaTeX. If you see the picture, on-the-fly conversion does work!
You need to use pdflatex to test the on-the-fly conversion! You may see the
original eps file without conversion now:
Instead of using on-the-fly conversion you may simply convert every EPS to PDF using epstopdf. In this case you may remove extra white space around the picture using pdfcrop.
Note, that sometimes the conversion to PDF results in PDFs with bad Bounding Box. In this case, you should search for
%%PageBoundingBox at the PS file and copy the four dimensions at this line to the line
%%BoundingBox at the begin or end of the file (replacing the values you'd find there). On-the-fly conversion will be use these new values at next run of pdflatex. If you are using manual conversion, don't forget to do it again.
To convert PDF to EPS the usage of
pdftops --eps is recommended. This is a command line utility from xpdf. Note, that this is available not only for Linux, but for Windows too. Alternative you may use
pdf2ps, a ghostscript command line utility. But the results may be not a good as the results of