Documentation about Emacs' Graphics Support

SVG Support

SVG Logo

"Out of the box" Support

Since Emacs version ‑tbf‑, Emacs can display Scalable Vector Graphics (SVG) files out of the box. Using C-C C-C, you can switch between showing the graphics and showing the underlying SVG file. For the latter ‑ as SVG is pure XML ‑ the nXML mode is used. nXML mode allows you to edit the SVG file as you normally would edit any XML file.


As I write this, I use Emacs version 25.1.1 under MS Windows 10 Pro 21H2. I have observed the following issues, when viewing SVG content in Emacs:

Create and Manipulate SVG Files Using ELISP and svg.el

The ELISP package svg.el is part of standard Emacs since version 26.1. svg.el is due to Lars Magne Ingebrigtsen and Felix Klee.

The main purpose of svg.el is to programmatically create and manipulate SVG files using Emacs LISP.

In year 2014, Lars published the video It show Emacs LISP code and below SVG file content, that changes in real-time (or may be after a key stroke). See also

Regards the LISP functions, that svg.el provides, see


The following grey circle SVG graphics was created using ELISP:

‑ Text before image is in a separate paragraph ‑

testSVG.el.svg ‑ Text immediately after image is in the same paragraph that contains the SVG ‑

The ELISP source code had been embedded in an org-mode document like so:

‑ Text before image is in a separate paragraph ‑
#+BEGIN_SRC emacs-lisp :exports results :results link file :file testSVG.el.svg
    (let ((svg (svg-create 200 200 :stroke-width 5 :stroke "green")))
      (svg-circle svg 100 100 50 :fill-color "gray" )
        (svg-print svg)
‑ Text immediately after image is in the same paragraph that contains the SVG ‑

Hence the SVG graphics can be changed by changing the ELISP source code. Note the :exports results setting: it suppresses the export of the ELISP source code when exporting to HTML code. The default is to show the ELISP code in the export.

Draw SVG Using the Easy Draw package

The purpose of the Easy Draws package is to create and edit SVG in Emacs by using the mouse and the keyboard and draw on a canvas directly in Emacs. Please see more detail here.

Draw SVG Using canvas-mode

Similarely to Easy Draw, there is canvas-mode due to Anand Tamariya. He published under an extended version of, that adds canvas-mode. Anand proposed in to have canvas-mode added to the built-in svg.el.

Last change: 2023-11-14
© 2002-2024 Dr. Thomas Redelberger redetho(a‍t)

Close menu