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

Herbert Schulz herbs at wideopenwest.com
Mon Mar 16 01:31:41 CET 2009

On Mar 15, 2009, at 5:16 PM, Ramón M. Figueroa-Centeno wrote:

> Aloha,
> 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.
> 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.
> 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?
> Thanks,
> Ramón


Don't include the .tif extension in the file name in the  
\includegraphics. The graphicx package will look for the pdf, jpg or  
png first and then go on from there. As a general rule I don't use  
extensions within \includegraphics commands.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)

More information about the macostex-archives mailing list