All figures in my org-mode file are 3-inch wide (at 72 dpi) SVG figures. Here is an example.

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
    width="236" height="92"
    viewBox="0 0 236 92"
        <path d="M 10 10 L 226 10 L 226 82 L 10 82 z"
            fill="none" stroke="blue" stroke-width="2" />

When I refer—using an empty .emacs—to the SVG figure above in org-mode using

culpa qui officia deserunt mollit anim id est laborum.


Sed ut perspiciatis unde omnis iste natus error sit voluptatem

I get (thanks to a delightful new feature in EmacsForMacOSX) the SVG figure inlined in the body of the text,

SVG inline in text

I can increase the size of each figure individually by writing

#+ATTR_ORG: :width 100

If all my figures are the same width and I'd like to increase them by the same factor, how do I increase through one setting the width/size of all inline SVG figures?

  • See the answer here. Furthermore, you can use Ctrl+Mouse-Wheel on the image. Mar 29, 2023 at 21:02
  • @dalanicolai The solution you point to does not work on my side (with a .emacs containing just the line suggested). Varying the number in #+ATTR_ORG: :width 500 and killing/reloading the buffer reloads with the same image size, for both PNG and SVG. Ctrl+Mouse-Wheel works, of course, but that just magnifies the already scan-converted (rasterized) SVG image. If there are small details, they do not become any clearer.
    – Sam7919
    Mar 29, 2023 at 22:14
  • The #+ATTR line goes into the Org mode file, right above the link, with no empty lines between them. It does not go into your init file.
    – NickD
    Mar 30, 2023 at 1:06
  • @NickD I see. The #+ATTR doesn't just appear once per file (at the top). It needs to precede each figure. Edited that answer to clarify. (Yes, it's clear that the setq line is the one that goes in the .emacs file.)
    – Sam7919
    Mar 30, 2023 at 1:59
  • @NickD That made the question redundant. Since there is still a feature missing, I updated the question, both to remove the duplication and to seek a better ("DRY") solution.
    – Sam7919
    Mar 30, 2023 at 2:06

1 Answer 1


I am not aware of an 'out of the box' solution. However, it is very easy to create one. Images in org mode are created via the function org--create-inline-image, where it gets passed a scaling of 1. So by simply creating a (buffer local) variable, and redefining that function to use the value of that variable as follows, we can set the scaling per org buffer:

(defvar-local org-image-scaling-factor 2.0)

(with-eval-after-load 'org
  (defun org--create-inline-image (file width)
    "Create image located at FILE, or return nil.
WIDTH is the width of the image.  The image may not be created
according to the value of `org-display-remote-inline-images'."
    (let* ((remote? (file-remote-p file))
        (pcase org-display-remote-inline-images
              ((guard (not remote?)) file)
              (`download (with-temp-buffer
               (set-buffer-multibyte nil)
               (insert-file-contents-literally file)
              (`cache (let ((revert-without-query '(".")))
            (with-current-buffer (find-file-noselect file)
              (`skip nil)
               (message "Invalid value of `org-display-remote-inline-images': %S"
      (when file-or-data
    (create-image file-or-data
              (and (image-type-available-p 'imagemagick)
              :width width :scale org-image-scaling-factor)))))

Add the above to your init file, evaluate, and try again. You can configure the scaling per buffer by adjusting the buffer local value.

You might also like to create a feature request at org-mode (if it does not already exist), where you could point them to this solution.

Of course, this solution scales all image types, but it is simple to add logic to limit the scaling to certain image types. Also, it scales the images with the #+ATTR_ORG: :width ... attribute, this could also be easily prevented, if you'd prefer so.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.