emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Paul Magwene <pmmagic@gmail.com>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: Weirdness re: inclusion of figures
Date: Wed, 15 Feb 2012 23:44:09 -0500	[thread overview]
Message-ID: <11922.1329367449@alphaville> (raw)
In-Reply-To: Message from Paul Magwene <pmmagic@gmail.com> of "Wed, 15 Feb 2012 22:42:38 EST." <CABoaWcW4gsBt60sezCWMakKhag+p9OEb_uU4Soz4-Ug1ryBROw@mail.gmail.com>

Paul Magwene <pmmagic@gmail.com> 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 :-)

  parent reply	other threads:[~2012-02-16  4:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16  3:42 Weirdness re: inclusion of figures Paul Magwene
2012-02-16  3:45 ` Paul
2012-02-16  4:44 ` Nick Dokos [this message]
2012-02-16 12:59 ` Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11922.1329367449@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=pmmagic@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).