[OS X TeX] Automatic Conversion of Graphics?

Brian Powell powellb at gmail.com
Tue Jan 25 23:35:03 EST 2005


Greetings, I am using Gerben's pdflatex distribution and have a
question regarding automatic conversion of graphics files.

I am using PDF figures for everything, at least 600x600 dpi for print
quality; however, the final PDF document is ~16MB in size. I would
like to be able to create a "screen" version also. I include my
figures via:

 \includegraphics[...]{fig.pdf}

If I add at the beginning

\DeclareGraphicsExtensions{.png}

it will automatically look for "fig.png" which is great; however, I
would like to convert the PDF to a PNG on the fly. I added the
following line:

\DeclareGraphicsRule{.pdf}{png}{.png}{`convert -density 72x72 #1
`dirname #1`/`basename #1 .pdf`.png}

However, I get an error: "Error:
/usr/local/teTeX/bin/powerpc-apple-darwin-current/pdflatex (file
fig.png): cannot find image file"

Is there a way to create the rule such that when it comes across the
PDF figure, it will convert it to a 72x72 PNG (as my rule above does)
automatically and include it? The great advantage to this is that I
can comment out the \DeclareGraphicsExtensions and \...Rule so that I
get the normal high-resolution document or I can leave them
uncommented to get a small, screen-resolution version.

I couldn't find anything in the FAQ to indicate what I am doing wrong.

Thank you.

-- 
Cheers,
Brian
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list