From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Randby Subject: Re: Request: change SVG embedding in exported HTML Date: Sat, 23 Jul 2016 16:50:51 -0400 Message-ID: <5c2f153b-05ad-c4b5-6384-e3e204a8f201@gmail.com> References: <87oa5oqzvr.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR3sz-0000y1-2j for emacs-orgmode@gnu.org; Sat, 23 Jul 2016 16:51:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR3su-0006v4-51 for emacs-orgmode@gnu.org; Sat, 23 Jul 2016 16:51:00 -0400 Received: from mail-io0-x234.google.com ([2607:f8b0:4001:c06::234]:33166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR3st-0006uz-VM for emacs-orgmode@gnu.org; Sat, 23 Jul 2016 16:50:56 -0400 Received: by mail-io0-x234.google.com with SMTP id 38so132701781iol.0 for ; Sat, 23 Jul 2016 13:50:55 -0700 (PDT) In-Reply-To: <87oa5oqzvr.fsf@iki.fi> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Jarmo Hurri , emacs-orgmode@gnu.org On 07/23/2016 08:53 AM, Jarmo Hurri wrote: > > Greetings. > > Request: An SVG file embedded in exported HTML should be embedded using > the tag instead of . I second this request. Right now, I use HTML code for SVG images, and I'd rather use Org markup instead. Scott Randby > > Short reasoning: The displayed size of the SVG image can not be > controlled from outside the SVG file when embedded using , but > size can be controlled when embedded using . > > Here is the longer explanation. > > The HTML exporter currently embeds SVG as an object. Here is an example > of the HTML produced by the exporter: > >
>

> Sorry, your browser does not support SVG. >

>
> > I have in the past couple of days found out that there is a serious > disadvantage to this: the displayed size of the resulting web page image > can not be controlled in any reasonable manner; see, for example > > https://css-tricks.com/scale-svg/ > > However, the size _can_ be controlled if embedding is done with an > . For example, the exported code above could be > >
> >
> > I have included 'class="org-svg"' above so that embedded SVG images can > then be distinguished from other images in CSS files. For example, the > following CSS then sets the width of SVG images to be 80% of the width > of the viewport. > > .org-svg > { > width: 80vw; > } > > Current embedding using has a nice textual fallback property > for browsers not capable of SVG (I have no idea if this support is > necessary nowadays). If need be, such fallback could also be added to > embedding using . See > > http://www.w3schools.com/jsref/event_onerror.asp > > Jarmo > > >