[texhax] Using .png, .jpg, .gif

Beverley Eyre bev at eyremail.net
Thu Jul 2 05:43:28 CEST 2009


Hi all.

I've been playing with the graphicx package trying to figure out how to 
easily use non-postscript images in a latex doc. I know that I could use 
pdflatex, but then I'd have the inverse problem. I want a universal 
solution.

 I'd like to get \DeclareGraphicsRule to work, but it seems more trouble 
to use than just converting each image file by hand.

For example, if I want to use a .png file:
\DeclareGraphicsExtensions{.png, .eps}
\DeclareGraphicsRule{.png}{eps}{*}{`convert #1}      %% (the last arg 
I've done in many different ways, e.g. {`convert #1 eps:- } )

then, in the body:

\includegraphics[width=1in]{myimage}   %% (which is myimage.png)

I get an error msg telling me that I there is no bounding box. So in 
order to use it, I have to determine the bounding box for the image 
first, and then include that info into one or the other command.   But, 
if I just do:

 > convert myimage.png myimage.eps

on the command line, it converts it without having to know the bounding 
box info. I'm not sure why convert needs the bounding box info in one 
case (latex) but not the other (command line).

So, I'm not really getting the point of \DeclareGraphicsRule since using 
it is much more trouble than converting by hand. Which brings me back to 
my point, is there any easy way to use non-postscript images in a latex 
doc? My best guess at this point is no, and the only way forward is to 
re-write some of the graphicx commands to that they can use the bounding 
box info generated by 'convert' or some other conversion program.

TIA for any help or discussion.

Beverley Eyre


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20090701/2b224b1b/attachment.html>


More information about the texhax mailing list