There several types of graphics files. In no particular order .jpeg .eps .pdf .png .tif .jif (and no doubt others). Some work with latex, dvips and some work with pdflatex. How am I supposed to know which?
Just to confuse matters, metapost produces .eps but I can use these with pdflatex as long as I put in a four line incantation.
Can anyone explain this?
Best Answer
Formats that work with LaTeX (
dvi
mode, usingdvips
):eps
Formats that work with LaTeX (
dvi
mode, usingdvipdfm
(x
)):pdf
png
jpeg
eps
Formats that work with pdfLaTeX (
pdf
mode):eps
(*)pdf
png
jpeg
jbig2
LuaTeX can also read
jpeg 2000
The reason for this way of working is that in
dvi
mode TeX simply leaves a space for the graphics.eps
are included in the output bydvips
.pdfLaTeX includes graphics directly in the
pdf
, using the features available in that format. Thepdf
format can include otherpdfs
(no surprise),png
,jpeg
,jpeg2000
andjbig2
graphics. Although pdfTeX can't incorporateeps
files directly, the set up in a modern TeX system will automatically convert them topdf
, and thus they are supported in practice.XeTeX always uses the
xdvipdfmx
driver so has the same outcomes as usingdvipdfmx
with a classical DVI-based route.Note that the LaTeX
graphics
package and associated helper code will search automatically for appropriate file extensions. As a result the extension should be omitted when including a graphic, for examplefor a file
foo.eps
. With a recent TeX system this will allow e.g. pdfLaTeX to auto-convert and.eps
file to PDF format and find it 'auto-magically'.