emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* images rendering after execution?
@ 2015-11-18 17:56 Tom
  2015-11-18 23:19 ` John Kitchin
  0 siblings, 1 reply; 2+ messages in thread
From: Tom @ 2015-11-18 17:56 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 662 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: images rendering after execution?
  2015-11-18 17:56 images rendering after execution? Tom
@ 2015-11-18 23:19 ` John Kitchin
  0 siblings, 0 replies; 2+ messages in thread
From: John Kitchin @ 2015-11-18 23:19 UTC (permalink / raw)
  To: Tom; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-18 23:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18 17:56 images rendering after execution? Tom
2015-11-18 23:19 ` John Kitchin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).