[texhax] Retrieve graphics measurments

Marshall Feldman marsh at uri.edu
Fri Jul 9 16:51:01 CEST 2010


I am a very new LaTeX user. I've searched all over and cannot find this 
information. My question is, how does one retrieve the dimensions of an 
inserted graphic?

Here's more explanation. For my first LaTeX project, I decided to create 
customized local letterhead. I'm almost done.

But I'm using the graphix package to insert logos and such in the header 
and footer. In general, I specify the image's width and let LaTeX set 
the height using the aspect ratio. Even using \height or the calc 
package's \heightof commands, LaTeX does not return the correct height 
of the inserted graphic. (For example, with an aspect ratio of 0.5, a 
graphic 2 inches wide should be 1 inch high, but these commands yield 
numbers much smaller.) Yet I've read that all LaTeX does is calculate 
the space the graphic needs, so it must have this information. It is 
hard to believe since such information unavailable because it is 
essential for custom page layouts.

Right now I enter graphic dimensions manually, messing with such things 
as bounding boxes and viewports. There must be an easier way. What is it?

     Marsh Feldman

More information about the texhax mailing list