Please note that while there is an existing question titled "How do I get the exact dimension of a picture in LaTeX?", that question is actually asking something different.
I have a document that contains several high-resolution png images, included as usual with commands like
\includegraphics[width=0.85\columnwidth]{landscape2.png}
within figure environments. However, my publisher is asking me for a version where each image is at "no more than 300 dpi, scaled at 100%".
This means, I think, that I have to manually resize all my images. I would like the document to look the same afterwards, so to do that I need to know exactly how much LaTeX is scaling them, or equivalently, the exact dimensions of the image as it appears in my document. That is, I need to know the numerical value of 0.85\columnwidth
in inches, and if possible the height of the image in inches as well.
How can I find this out? I tried \showthe\columnwidth
, but this gives the following extremely informative error message:
?
Is it possible to print the exact dimensions of an image, or the scaling ratio used, to the console?
\setbox1=\hbox{\includegraphics[..]{...}}
. Then\showthe\wd1
will print thew
id
th to the terminal, while\showthe\ht1
will print theh
eight
. If you want to display these in your document, use\the\wd1
and\the\ht1
. The lengths will be inpt
s. For printing in other lengths, see theprintlen
package (or see How do I get the exact dimension of a picture in LaTeX?).printlen
for getting the image lengths and printing them within your document using the desired dimension. I don't see the difference... anyone else?<example-image.png, id=1, 401.5pt x 301.125pt> File: example-image.png Graphic file (type png) <use example-image.png> Package pdftex.def Info: example-image.png used on input line 5. (pdftex.def) Requested size: 401.49901pt x 301.12425pt.
Gives you both the original size of the image and the size it will be in the output