From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Weirdness re: inclusion of figures Date: Wed, 15 Feb 2012 23:44:09 -0500 Message-ID: <11922.1329367449@alphaville> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxtCY-0000oy-3I for emacs-orgmode@gnu.org; Wed, 15 Feb 2012 23:44:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxtCW-0003wA-Ph for emacs-orgmode@gnu.org; Wed, 15 Feb 2012 23:44:14 -0500 Received: from g4t0016.houston.hp.com ([15.201.24.19]:27432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxtCW-0003vz-Kg for emacs-orgmode@gnu.org; Wed, 15 Feb 2012 23:44:12 -0500 In-Reply-To: Message from Paul Magwene of "Wed, 15 Feb 2012 22:42:38 EST." 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: Paul Magwene Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Paul Magwene wrote: > Hi All, > > I'm trying to get up to speed with org-mode and babel for doing > reproducible computational research. I'm just starting to play around > with simple examples, and I'm baffled by the following. > > This first example, when exported to HTML or LaTeX produces the > expected result -- a simply code block with one embedded figure. > > # Example 1. > > This is my R example: > > #+begin_src R :file z.png :results output graphics > plot(matrix(rnorm(100), ncol=2), type="l") > #+end_src > > Some intervening text... > > #+results: > [[file:z.png]] > > > However, this almost identical example, minus the intervening text > between the code and the results, doesn't include the figure: > > # Example 2 > > This is my R example: > > #+begin_src R :file z.png :results output graphics > plot(matrix(rnorm(100), ncol=2), type="l") > #+end_src > > #+results: > [[file:z.png]] > > > What gives here? Do I always need to have intervening text between the > source code and results in order to get a figure in the exported > document? > You need an :exports both header: #+begin_src R :file z.png :results output graphics :exports both plot(matrix(rnorm(100), ncol=2), type="l") #+end_src I don't know how or why the intervening text affects anything, but it just smells like a red herring to me... Nick :-)