From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarmo Hurri Subject: Re: Scaling HTML-exported SVG Date: Sun, 24 Jul 2016 21:48:12 +0300 Message-ID: <878twqq3df.fsf@iki.fi> References: <87y44tx1h5.fsf@iki.fi> <87y44qdipu.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRORs-0001mu-Sr for emacs-orgmode@gnu.org; Sun, 24 Jul 2016 14:48:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRORp-00074h-1P for emacs-orgmode@gnu.org; Sun, 24 Jul 2016 14:48:24 -0400 Received: from plane.gmane.org ([80.91.229.3]:51664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRORo-00074A-QF for emacs-orgmode@gnu.org; Sun, 24 Jul 2016 14:48:20 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bRORn-0000pP-Gt for emacs-orgmode@gnu.org; Sun, 24 Jul 2016 20:48:19 +0200 Received: from 82-181-168-52.bb.dnainternet.fi ([82.181.168.52]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 Jul 2016 20:48:19 +0200 Received: from jarmo.hurri by 82-181-168-52.bb.dnainternet.fi with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 Jul 2016 20:48:19 +0200 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: emacs-orgmode@gnu.org Jarmo Hurri writes: > Christian Moe writes: >> #+html_head_extra: >> >> #+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. Did some tests. The method you suggested above - setting id - works (all tests done in Chrome). But setting id-values is cumbersome, because you need to do it for every file. It is also possible to set a CSS class similarly, that is, modifying your example above, #+html_head_extra: #+attr_html: :class svgfig [[path/to/image.svg]] This also works and is better, because then it is possible to set a common class for all SVG figures, and handle them with a single CSS rule. Better, but not yet perfect, because I still need to add a attr_html to every SVG figure. But there seems to be a way around this. With the last approach the generated HTML looks something like Why don't we just set a common class for all SVG-images in an HTML export by default? Then we could still use an to embed it, and control its size from CSS. It seems to me that this solves the problem, and requires an extremely small change. Jarmo