[OS X TeX] Is there a better alternative to \DeclareGraphicsExtensions ?

Daniel Becker daniel.becker at uni-rostock.de
Mon Mar 16 09:27:27 CET 2009

Am 15.03.2009 um 23:16 schrieb Ramón M. Figueroa-Centeno:

> To include TIFF files in a document the TeXShop manual suggests we  
> do the
> following:
> \documentclass{article}
> \usepackage{graphicx}
> \usepackage{epstopdf}
> \DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `basename  
> #1 .tif`.png}
> \begin{document}
> \includegraphics{Hello.tif}
> \end{document}
> That converts all the TIFFs into PNGs (I'm using pdfTeX).
> That is very nice, but it does the conversion on every run, which is
> unnecessary as we alreday have the PNGs.
> A fix is then to change "\includegraphics{Hello.tif}" to
> "\includegraphics{Hello}". From then on the PNGs are used.

Hm - but when you change the .tif-file, there will be not conversion  
to .png, unlike what epstopdf.sty (or epspdfconversion) does.

> A better fix is to use \DeclareGraphicsExtensions:
> 1. In the preamble put "\DeclareGraphicsExtensions{.png,.tif}" The  
> order
> matters, PNGs are given preference over TIFFs. If you are using  
> other kinds
> of Graphics files then all their extensions must be placed here, one  
> for
> each kind of document we are using).
> 2. Do not specify the suffix when including files, e.g.,
> "\includegraphics{Hello}"
> With EPS files we do not have this problem. The epstopdf package  
> will handle
> things transparently for us; we just don't specify the suffix from  
> the very
> beginning, and on the first pass the EPS files get converted to PDFs.

... and updated if necessary
> So my question is: is there a better way of doing things so that  
> TIFFs get
> treated like EPS files are? Instead of replacing the list of  
> extensions that
> graphicx knows, is there a way to append to it?

Why isn't your solution not just fine?

Unfortunately, from

"Each use of \DeclareGraphicsExtensions overwrites all previous  
definitions. It is not possible to add an extension to an existing  


... thinking about extending epspdfconversion.sty to allow more  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4647 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20090316/3becc7cc/attachment.bin>

More information about the macostex-archives mailing list