I'm trying to work with inline images (e.g. for plotting data by gnuplot), and have the problem: images always inserted as links by default. I need to do some keypresses to "force" emacs to show actual image inline, instead of just file link.
E.g. I start with gnuplot code:
#+BEGIN_SRC gnuplot :file plot.png
plot sin(x)
#+END_SRC
When I press C-c C-c
on this code block, it runs, and shows me results as link to image file:
#+RESULTS:
[[file:plot.png]]
- If I press
C-c C-x C-v
(org-toggle-inline-images) twice -- link does replaced with inline image - If I run
M-x org-redisplay-inline-images
-- again, link does replaced with image - If I run
(org-display-inline-images t t)
-- again, image is shown
and so on (those options were taken from Emacs org-display-inline-images and Inline images in org-mode questions)
But I don't want to press anything special: I want images to be displayed inline by default. I've found and tried following variables:
(setq org-startup-with-inline-images t)
in.emacs
config#+STARTUP: inlineimages
header(setq org-display-inline-images t)
But neither got me the behavior I want. I'm puzzled -- do I want something so unnatural?
P.S. Im' using GNU Emacs v26.1 on MacOS X, org mode v9.1.9-65, if it matters
P.P.S. Although it seems like a bug in my emacs/orgmode version, and I'm yet to report it, but meanwhile I've found following trick: (add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)
(thanks to ob-ipython authors) -- it fixes issue for me right now. Maybe will be useful for somebody else