emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Moe <mail@christianmoe.com>
To: Jarmo Hurri <jarmo.hurri@iki.fi>
Cc: emacs-orgmode@gnu.org
Subject: Re: Scaling HTML-exported SVG
Date: Sun, 24 Jul 2016 19:09:53 +0200	[thread overview]
Message-ID: <m260rvt126.fsf@christianmoe.com> (raw)
In-Reply-To: <87y44tx1h5.fsf@iki.fi>




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

  reply	other threads:[~2016-07-24 17:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 13:10 Scaling HTML-exported SVG Jarmo Hurri
2016-07-24 17:09 ` Christian Moe [this message]
2016-07-24 17:55   ` Jarmo Hurri
2016-07-24 18:48     ` Jarmo Hurri
2016-07-24 21:26       ` Christian Moe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m260rvt126.fsf@christianmoe.com \
    --to=mail@christianmoe.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jarmo.hurri@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).