LaTeXML icon indicating copy to clipboard operation
LaTeXML copied to clipboard

LaTeXML ignores repeated options to \includegraphics instead of accumulating them

Open xworld21 opened this issue 4 months ago • 0 comments

LaTeXML overwrites values while parsing the transform string, e.g. https://github.com/brucemiller/LaTeXML/blob/8ec3559626d9b52af03b8ad175779a8852004a23/lib/LaTeXML/Util/Image.pm#L164

However, the graphicx package simply reads each option as it goes, and applies each transformation in sequence. For instance, the lines

  \includegraphics[page=5,scale=0.5,scale=0.5]{image}
  \includegraphics[page=5,scale=0.25]{image}

produces the same result.

I guess this is a compromise due to how image_graphicx_complex is implemented. A much better way would be to convert transforms to matrices, multiply them, then pass a single affine transformation to ImageMagick. That should simplify the code a lot.

xworld21 avatar Nov 01 '25 13:11 xworld21