From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Stanton Subject: Re: Question on latex source block Date: Mon, 10 Sep 2012 13:43:02 -0700 Message-ID: References: <4361.1347304022@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBApA-0007TO-Vx for emacs-orgmode@gnu.org; Mon, 10 Sep 2012 16:43:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBAp7-0005J5-6J for emacs-orgmode@gnu.org; Mon, 10 Sep 2012 16:43:16 -0400 Received: from gateway-a.haas.berkeley.edu ([128.32.222.29]:37627) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBAp7-0005Iy-0n for emacs-orgmode@gnu.org; Mon, 10 Sep 2012 16:43:13 -0400 In-Reply-To: <4361.1347304022@alphaville.americas.hpqcorp.net> Content-Language: en-US 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: "nicholas.dokos@hp.com" Cc: "emacs-orgmode@gnu.org" , "eric.schulte@gmx.com" On 9/10/12 12:07 PM, "Nick Dokos" wrote: >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: >>=20 >> #+begin_src latex :file test.png >> \frac{1}{2} >> #+end_src >>=20 >> results in this output: >>=20 >> #+Results: >> #+BEGIN_LaTeX >> [[file:test.png]] >> #+END_LaTeX >>=20 >> There are two problems here. >>=20 >>=20 >> 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 >>=20 > >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. >>=20 > >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 The *Messages* buffer did indeed show something: "Failed to create dvi file from /var/folders/zf/bgjm4tvs3wv_6q7_6z3b2nx00000gn/T/orgtex64181Q3t.tex" Checking the log file in that directory, I saw squawking about missing "$" signs around the mathematical expression. Adding these, so the block now reads #+begin_src latex :file test.png :results raw $\frac{1}{2}$ #+end_src it now compiles and displays perfectly. Thanks!