[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] org-babel src block generated graphics included twice if CAPTION
From: |
Nick Dokos |
Subject: |
Re: [O] org-babel src block generated graphics included twice if CAPTION is added |
Date: |
Sun, 17 Mar 2013 18:21:29 -0400 |
Li Bowen <address@hidden> wrote:
> Hi,
>
> If #+CAPTION is added, the figure will be included in the exported pdf
> file twice.
>
> #+begin_src R :exports both :results graphics :file img.pdf
> hist(rnorm(100))
> #+end_src
>
> #+CAPTION: Some description
> #+RESULTS:
> [[file:img.pdf]
>
> Many thanks.
>
I think the problem is that the code block does not "see" the previously
produced #RESULTS: (because of the intervening #CAPTION:), so when run
again it adds another #RESULTS: section.
I think the best way to deal with problems like this is to name your code blocks
(and results blocks).
Try the following:
--8<---------------cut here---------------start------------->8---
#+name: foo
#+begin_src R :exports both :results graphics :file img.pdf
hist(rnorm(100))
#+end_src
#+CAPTION: Some description
#+RESULTS: foo
[[file:img.pdf]]
--8<---------------cut here---------------end--------------->8---
Does it solve the problem?
Nick