When using \externalfigure with height and maxwidth at the same time maxwidth is not honored:

\externalfigure[#6][height=4cm, maxwidth=2cm, orientation=0]

gives an image of 4cm height and whatever width that yield.

Is it possible to ensure that an image is scaled proportionally so that it has a given height or a lower height when required to fit a maximum width?

  • with scale=100000 instead of width=10cm this works. thx
    – DrSvanHay
    Jun 10, 2020 at 8:25

1 Answer 1


If you want to scale to the smaller of the desired height and width while keeping the aspect ratio, you have to choose the options as such:


This is also documented in the Garden at https://wiki.contextgarden.net/Command/useexternalfigure

If both width and height are set, the factor is important:
none: image is deformed accordingly
max: aspect ratio is kept, the image is scaled to the bigger (oversized) variant
fit: aspect ratio is kept, the image is scaled to the smaller (fitted) variant


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .