2

Simple Inline Images In Org-Mode

 1 year ago
source link: https://www.bytedude.com/simple-inline-images-in-org-mode/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Recently I wanted to display some inline images in org-mode. I couldn’t find a simple explanation for how to do it online, so I’m writing my own. I’ll keep it short.

org-download was the prevailing recommendation that I found. However, that package is not recommended for use by this author. It is confusing, hard to configure, and abandoned by the maintainer.

It turns out that you don’t need any fancy packages to accomplish this, just two lines of configuration.

Configuration

First, add these lines to your config file:

;; Inline images.
org-startup-with-inline-images t
org-image-actual-width nil

The first line will load existing inline images when you open an org file. (When you add inline images later, you’ll still have to run M-x org-redisplay-inline-images or reload the file.)

The second line allows you to specify your own width for images, so that they don’t take up the whole screen.

Adding Images

To add an image, just use this format in your org file:

[[./images/horses.jpeg]]

The path between the brackets is relative to your org file.

Run M-x org-redisplay-inline-images (or just reload the file) and you should see this:

What the?!
What the?!

It’s way too big! Try this instead:

#+ATTR_ORG: :width 300
[[./images/horses.jpeg]]

Now it works:

These Icelandic horses were kindly pet by the author.
These Icelandic horses were kindly pet by the author.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK