I can see many image formats in orgmode, but not SVG.

I get the error Invalid image type 'svg' when I run org-display-inline-images.

It should be possible given this question exists: https://www.reddit.com/r/emacs/comments/2o21gf/orgmode_svg_rendering/

I didn't see an obvious package to install, or other way to fix this.

EDIT: This is on Mac OS X 10.9.5, Emacs 24.4.1 (installed via homebrew), Org 8.3.2. (image-type-available-p 'svg) returns nil.

  • 7
    Emacs handles this differently depending upon the OS, and depending upon the libraries available at the time of building Emacs and the libraries available subsequent to building Emacs. What OS and what version of Emacs are you using, and where did you download the Emacs version if you did not build it from scratch? Evaluate in a *Scratch* buffer (image-type-available-p 'svg) or just type M-x eval-expression RET (image-type-available-p 'svg) RET and see whether the answer is t? If the answer is nil, then you don't have svg support presently available -- i.e., time for plan B. – lawlist Oct 21 '15 at 1:59
  • This is on Mac OS X 10.9.5, Emacs 24.4.1 (I believe via homebrew), Org 8.3.2. Sadly, that function call returns nil. – avv Oct 21 '15 at 7:32
  • 2
    If by homebrew, I think you must have compiled it yourself? The solution might be as simple as installing libsvg (presumably also available in homebrew) and then recompiling emacs. The configure script should take care of the rest. – Harald Hanche-Olsen Oct 21 '15 at 12:48
  • 2
    Great! I used which emacs and brew info emacs to confirm that I installed via homebrew, and it was missing librsvg, so I used brew to install librsvg. That said, I'm a little worried about re-compiling emacs right now, given deadlines and the potential for that to take longer than expected when something else breaks. But I'll try that soon, especially if I can figure out a way to make sure I can easily return to the old setup if need be (is it just a matter of backing up the emacs binary? or might homebrew change/update a number of binaries and other files?). – avv Oct 21 '15 at 17:52
  • 1
    Is this still a problem? Maybe the OP can post a progress report as an answer. FWIW, I tried it with current upstream emacs (GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.13) of 2020-04-23) and current org mode (Org mode version 9.3.6 (release_9.3.6-506-gdcb562 @ /home/nick/elisp/org-mode/lisp/)), built with librsvg-2.0 on Fedora 31, and svg works fine. – NickD Apr 25 '20 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.