[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Question on latex source block

From: Nick Dokos
Subject: Re: [O] Question on latex source block
Date: Mon, 10 Sep 2012 15:07:02 -0400

Richard Stanton <address@hidden> 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:
> [[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

* bar

#+BEGIN_SRC elisp
(add-hook 'org-babel-after-execute-hook (function org-redisplay-inline-images))
--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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]