Graphics, Figures & Tablesresult of keepaspectratio?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
tjacobs
Posts: 1
Joined: Tue Dec 14, 2010 3:58 am

result of keepaspectratio?

Post by tjacobs »

I am using the \includegraphics command to load images. Some images are portrait orientation and some are landscape, so I am using the width, height, and keepaspectratio arguments to keep the image within the text area:
\includegraphics[width=\textwidth, height=\textheight, keepaspectratio=true]{image_name}

Can I somehow get return values so I know what the resulting image width and height are? If yes, then how can I use the values in conditional logic within my tex document? Specifically, if the image is portrait and the scaled width is less than some percentage (say 60%) of \textwidth, then I would like to create a minipage to hold the image, then another minipage to hold some text. The result would be image on the left and text on the right (or vise versa).

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply