Christian Moe <m...@christianmoe.com> writes: > Jarmo Hurri writes: >> Does anyone have any idea of how to scale an SVG figure produced by Org >> (Asymptote)? The exported HTML is >> >> <div class="figure"> >> <p><object type="image/svg+xml" data="pisteita-koordinaatistossa.svg" > >> Sorry, your browser does not support SVG.</object> >> </p> >> </div> > > You can scale the SVG by scaling the <object> element's container, > i.e. the <div> with class "figure". Setting attributes on the image > link with #+attr_html as usual should work, because they are passed to > the figure container rather than to the <object>. > > Either: > > #+attr_html: :width 200px > [[path/to/image.svg]] > > > or: > > #+html_head_extra: <style>#svgfig {width: 200px; }</style> > > #+attr_html: :id svgfig > [[path/to/image.svg]] > > For this to work, the SVG needs to be written to be scalable (with > viewport set etc.).
(Also addressed this in the other thread; also here for completeness.) But this means scaling on a file-by-file basis, which is very inconvenient for any larger projects. Jarmo