First of all: Many thanks for sharing such a great work! This extension is fantastic!
However, I faced the problem that some of my figures had an overhang in the generated PDF (because they were too big), so I found it quite handy to have an option to adjust the figure's width with regard to the available width in the target document. I didn't find such functionality, so I implemented it :)
I hope you find it useful as well! I think with :xscale:, it is pretty easy to adjust the width in an intuitive manner. Would be cool to see that propagating to upstream, and eventually a new release on PiPy :)
Cheers,
Christian
Here is the essence:
:xscale: expects an integer between 0 and 100, signifying a percentage to scale the image relative to the content width
For the latex target, the content width is \columnwidth
For the html target, the width attribute of <img> is
set to the percentage given in the option, which scales the image
to the width of the surrounding container
No input validation, the user is expected to know what she does
The aspect ratio is preserved
Successfully tested for latexpdf (single- and two-column) and
html output
Hey there,
First of all: Many thanks for sharing such a great work! This extension is fantastic!
However, I faced the problem that some of my figures had an overhang in the generated PDF (because they were too big), so I found it quite handy to have an option to adjust the figure's width with regard to the available width in the target document. I didn't find such functionality, so I implemented it :)
I hope you find it useful as well! I think with
:xscale:
, it is pretty easy to adjust the width in an intuitive manner. Would be cool to see that propagating to upstream, and eventually a new release on PiPy :)Cheers, Christian
Here is the essence:
:xscale:
expects an integer between 0 and 100, signifying a percentage to scale the image relative to the content widthlatex
target, the content width is\columnwidth
html
target, thewidth
attribute of<img>
is set to the percentage given in the option, which scales the image to the width of the surrounding containerlatexpdf
(single- and two-column) andhtml
output