Following this question I asked a few years ago, I'm looking for a way to find the width of the largest picture (in width) in my document.
Typically, this requires a for loop and some TeX programming. Since my compilation process already includes 3 parsing steps (required to compute the last page number and bibliography items with biber), this isn't really a problem for me if this requires yet another one. If I can rely on an existing compilation pass, that would be even greater though.
Any idea how I can write this parser? My solution would have to use some regexes and manual parsing using Python, but I would like to avoid to require yet another engine.
Why this parser? Let me explain what I want by an example.
a full screen screenshot displayed with
\includegraphicswith a with specified by
another screenshot taken on the same computer, but cropped to a specific size (e.g. to only have a specific dialog or a subset of the first image to focus on something specific).
The idea is to get the size of the first picture to be able to determine the ratio I need to specify to the second picture (how to compute it in the
\includegraphics statement? do we have support for some mathematics computation in this context?).
In this use case, the first picture is the one one, but I would like to be able to specify the pictures kept to determine which one is the largest (in width, with a special tag for example).
As you can see, the way the pictures are presented here above in this question are incorrect. I want the second picture representing only the dialog from the first image to be the same size as it is in the first image. Typically, this is what I want (screenshot taken on LibreOffice Writer):
As you can see the dialog in the second image has the same width size as the first image (I don't know if we can call dpi in this context).