I'm facing a problem, for which I can't find a solution in any of the forums. Maybe one of you guys can help...

For a project, I need one page with images, that all are there in a specific size and ratio of width/length. This page will be reused within the project several times. Now, the problem is, that obviously the images do not always have the same ratio of width&length as do those spaces they should fit in.

What we would like to do, since this is a "layout" page that is reused, is to:

  1. List item
  2. Define the boxes/spaces/dimensions of the image (as part of a whole layout, but anyway this is no problem to do).
  3. One we want to insert an image, this image should be scaled down to e.g. the width of this box (no problem to do), but then with currently, either the height is changed, or we loose the ratio of the image.

Therefore we would like to have a third step: 3. Auto-trimming/cropping the part of the image that are out of the box, so the image fits inside. And that kind of where we struggle for all images except those that are an exact square (but this is useless, because most image spaces will not be exact squares).

We are aware of the Photobook document style, but as this is only one (repeated) page in a Hugh document we would rather have a different solution.

Thanks a lot in advance for your help!

  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – albert Aug 10 at 10:38
  • scale the image then surround it with cropbox command variants are defined in several packages, eg the adjustbox package can do this (you'd need to check its syntax) – David Carlisle Aug 10 at 10:51

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.