From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Question on latex source block Date: Mon, 10 Sep 2012 15:07:02 -0400 Message-ID: <4361.1347304022@alphaville.americas.hpqcorp.net> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB9KC-0003Xh-M7 for emacs-orgmode@gnu.org; Mon, 10 Sep 2012 15:07:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TB9K8-0004zz-OR for emacs-orgmode@gnu.org; Mon, 10 Sep 2012 15:07:12 -0400 Received: from g1t0028.austin.hp.com ([15.216.28.35]:19719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB9K8-0004zj-HC for emacs-orgmode@gnu.org; Mon, 10 Sep 2012 15:07:08 -0400 In-Reply-To: Message from Richard Stanton of "Mon, 10 Sep 2012 09:49:57 PDT." 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: Richard Stanton Cc: "emacs-orgmode@gnu.org" , "eric.schulte@gmx.com" Richard Stanton wrote: > Thanks. Things now get a lot further, but I'm still not quite getting what > I was hoping for. In particular, this source: > > #+begin_src latex :file test.png > \frac{1}{2} > #+end_src > > results in this output: > > #+Results: > #+BEGIN_LaTeX > [[file:test.png]] > #+END_LaTeX > > There are two problems here. > > > 1) I'd like the graphic file to be displayed inline in the org file > buffer, so I don't think I want those #+BEGIN_LaTeX ... #+END_LaTeX lines > If you add org-redisplay-inline-images to org-babel-after-execute-hook, that should happen whether or not the #+{BEGIN,END}_LaTeX lines are there (you can get rid of them by using :results raw). This works for me (after I C-c C-c on the second source block): --8<---------------cut here---------------start------------->8--- * foo #+begin_src latex :file frac.png :results raw \( \frac{1}{2} \) #+end_src * bar #+BEGIN_SRC elisp (add-hook 'org-babel-after-execute-hook (function org-redisplay-inline-images)) #+END_SRC --8<---------------cut here---------------end--------------->8--- > 2) There is no file test.png in the current working directory. > That however may be saying that there is a problem with your setup. Is there anything in *Messages* that indicates a problem? Assuming that debug-on-error is not set currently, you might also want to M-x toggle-debug-on-error RET and rerun the code block to see if there is some error that is triggered (sometimes errors are caught using condition-case and are hard to see). Just to be clear, the frac.png (I renamed it to avoid clobbering an unrelated test.png file in my setup) *is* produced in my case. Nick