12.7 Images

An image is a link to an image file121 that does not have a description part, for example

./img/cat.jpg

If you wish to define a caption for the image (see Captions) and maybe a label for internal cross-references (see Internal Links), make sure that the link is on a line by itself and precede it with ‘CAPTION’ and ‘NAME’ keywords as follows:

#+CAPTION: This is the caption for the next figure link (or table)
#+NAME:   fig:SED-HR4049
[[./img/a.jpg]]

Such images can be displayed within the buffer with the following command:

C-c C-x C-v (org-toggle-inline-images)

Toggle the inline display of linked images. When called with a prefix argument, also display images that do have a link description. You can ask for inline images to be displayed at startup by configuring the variable org-startup-with-inline-images122.

By default, Org mode displays inline images according to their actual width, but no wider than fill-column characters.

You can customize the displayed image width using org-image-actual-width variable (globally) or ‘ORG-IMAGE-ACTUAL-WIDTH’ property (subtree-level)123. Their value can be the following:

org-image-max-width limits the maximum displayed image width, but only when the image width is not set explicitly. Possible maximum width can be set to:

Org mode can left-align, center or right-align the display of inline images. This setting is controlled (globally) by org-image-align. Only standalone images are affected, corresponding to links with no surrounding text in their paragraph except for whitespace. Its value can be the following:

Inline image alignment can be specified for each link using the ‘#+ATTR.*’ keyword if it matches an alignment specification like:

#+ATTR_HTML: :align center

Org will use the alignment specification from any ‘#+ATTR.*’ keyword, such as ‘#+ATTR_HTML’ or ‘#+ATTR_LATEX’, but ‘#+ATTR_ORG’ (if present) will override the others. For instance, this link

#+ATTR_HTML: :align right
#+ATTR_ORG: :align center
[[/path/to/image/file.png]]

will be displayed centered in Emacs but exported right-aligned to HTML.

When ‘#+ATTR_ORG’ is not set, inline image alignment is also read from the ‘:center’ attribute supported by some export backends (like HTML, LaTeX and Beamer.)

Inline images can also be displayed when cycling the folding state. When custom option org-cycle-inline-images-display is set, the visible inline images under subtree will be displayed automatically.


Footnotes

(121)

What Emacs considers to be an image depends on image-file-name-extensions and image-file-name-regexps.

(122)

The variable org-startup-with-inline-images can be set within a buffer with the ‘STARTUP’ options ‘inlineimages’ and ‘noinlineimages’.

(123)

The width can be customized in Emacs >= 24.1, built with imagemagick support.