[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Scaling HTML-exported SVG
From: |
Christian Moe |
Subject: |
Re: [O] Scaling HTML-exported SVG |
Date: |
Sun, 24 Jul 2016 19:09:53 +0200 |
User-agent: |
mu4e 0.9.17; emacs 24.5.1 |
Jarmo Hurri writes:
> Greetings.
>
> 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>
(Suggested an answer on another thread. For completeness:)
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.).
Yours,
Christian