From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: images rendering after execution? Date: Wed, 18 Nov 2015 18:19:31 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzC0r-0003sk-Qs for emacs-orgmode@gnu.org; Wed, 18 Nov 2015 18:19:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzC0m-0001A8-Sr for emacs-orgmode@gnu.org; Wed, 18 Nov 2015 18:19:41 -0500 Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]:32915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzC0m-0001A4-O5 for emacs-orgmode@gnu.org; Wed, 18 Nov 2015 18:19:36 -0500 Received: by qkas77 with SMTP id s77so20317397qka.0 for ; Wed, 18 Nov 2015 15:19:36 -0800 (PST) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tom Cc: emacs-orgmode@gnu.org 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