[Tex/LaTex] set a maximum width and height for an image


I would like to define a maximum height and a maximum width for an image at same time. I suppose there must be a package to do this, but actually I'm unable to find it…

Best Answer

You can use the keepaspectratio key and define your graphics as:


The MWE is as follows:


enter image description here

Experiment with images with different aspect ratios to see the effect.