emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Request: change SVG embedding in exported HTML


From: Jarmo Hurri
Subject: Re: [O] Request: change SVG embedding in exported HTML
Date: Sun, 24 Jul 2016 20:51:17 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Christian Moe <address@hidden> writes:

> I disagree. A switch to <img> for SVG export (1) is not necessary for
> scaling, and (2) would disable other useful features that are
> presently available out of the box.
>
> (1) It *is* a bit easier to scale SVG with <img> in HTML. But you
> *can* scale SVG with <object> by putting the <object> in a container
> <div> and scaling the container width and height.

The current version of Org wraps the SVG image in a <div> of class
figure, but at least setting the width of this class in a CSS produces
no scaling effect (tested with Chrome and Safari).

> This is actually simple with Org, which natively wraps the <object> in
> a <div class="figure"> tag, and passes any attributes to the latter.
> To scale an arbitrary image.svg e.g. to 100px width, try:
>
>   #+attr_html: :width 100px
>   [[path/to/image.svg]]
>
> Alternatively, you can use #+attr_html to set an id on the figure
> <div>, and style it with CSS.

But if you need to set an id, then you will also have to do scaling on a
file-by-file basis. Or? If this is so, then scaling would be a _lot_
easier using <img>.

Do we need to / could we add an option to HTML export? Either export all
SVG files with <object> or <img>.

Jarmo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]