I use this in my init files:

;; refresh images after running a block
(defun org-refresh-images ()
  "Refreshes images displayed inline."
  (interactive)
  (org-remove-inline-images)
  (org-display-inline-images))

(add-hook 'org-babel-after-execute-hook
          (lambda () (org-refresh-images)))

it refreshes images each time I run a block.

Tom writes:

> I know I can insert an image with something like:
>
> #+begin_src python :session :results file
> savefig('test.png')
> 'test.png'
> #+end_src
>
> #+RESULTS:
> [[file:test.png]]
>
> However, even when I choose to display images inline, the output from a
> computation like this will always be rendered as a link; only after
> toggling image display twice will the image render inline.
>
> Is there some option that always renders images returned by source code
> blocks inline immediately? None of the options I found in the documentation
> seemed to work.
>
> Thanks,
> Tom

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

Reply via email to