emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Davison <davison@stats.ox.ac.uk>
To: Graham Smith <myotisone@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] changing size of R graphics in pdf output
Date: Tue, 15 Dec 2009 14:14:58 -0500	[thread overview]
Message-ID: <87aaxkqcb1.fsf@stats.ox.ac.uk> (raw)
In-Reply-To: <2c75873c0912130623h922f307ta4e79845ac082387@mail.gmail.com> (Graham Smith's message of "Sun, 13 Dec 2009 14:23:07 +0000")

Hi Graham,

I think your solution is sensible, and thanks for bringing up these
issues. Perhaps, as you suggest, we should be automatically setting
these attributes in the latex output; we'll get back to you on that.

Regarding the number of copies of the figure in the output, it should
work as follows:

Let's assume you have :exports both or :exports results.

Before running the export, do you have a link to the image *already* in
your org buffer?

If no, then you should just get one copy of the image.

If yes, then, if the link is positioned in such a way that it will get
replaced by the output (no intervening lines between end of source block
and results) then you should get one copy.

But if there are intervening lines between the source block and the
results, then you will get the original image, and a new one created by
the exporter which did not replace the original.

Thus I would do something like this, in which the pdf output is the same
regardless of whether the #+results line and link are in the buffer
before export, and which results in only one copy of the fig in either case.

------------------------------------------------------------------------
#+options toc:nil
#+title: R latex graphics

Text before figure.
#+CAPTION:    Trial boxplots with babel
#+LABEL:      fig:trial boxplots
#+ATTR_LaTeX: width=5cm
#+srcname:Boxplots Summary
#+begin_src R :session BirdData :file BoxplotSummary.pdf :exports both
  Wingcrd <- rnorm(100, 20) ; Tarsus <- rnorm(100, 5) ;
  Head <- rnorm(100, 3) ; Wt <- rnorm(100, 40)
  boxplot(Wingcrd,Tarsus,Head,Wt,names=c("Wingcrd","Tarsus","Head","Wt"))
#+end_src

#+results: Boxplots
[[file:BoxplotSummary.pdf]]

Text after figure.
------------------------------------------------------------------------

Dan


Graham Smith <myotisone@gmail.com> writes:

> OK,  This was all to do with the ordering of the latex code
>
> Below works, includes the R code, but only one plot of the expected size.
>
>
> #+srcname:Boxplots Summary
> #+begin_src R :session BirdData :file BoxplotSummary.pdf :exports both
>  boxplot(Wingcrd,Tarsus,Head,Wt,names=c("Wingcrd","Tarsus","Head","Wt"))
> #+end_src
>
> #+CAPTION:    Trial boxplots with babel
> #+LABEL:      fig:trial boxplots
> #+ATTR_LaTeX: width=10cm
> #+resname: Boxplots
> [[file:BoxplotSummary.pdf]]
>
> I await for someone to tell me how it "should" be done :-)
>
> Graham
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2009-12-15 19:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-12 22:40 [babel] changing size of R graphics in pdf output Graham Smith
2009-12-13  1:45 ` Dan Davison
2009-12-13  7:37   ` Graham Smith
2009-12-13  8:23     ` Graham Smith
2009-12-13 13:12       ` Graham Smith
2009-12-13 13:39         ` Graham Smith
2009-12-13 14:23           ` Graham Smith
2009-12-15 19:14             ` Dan Davison [this message]
2009-12-15 19:51               ` Graham Smith

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=87aaxkqcb1.fsf@stats.ox.ac.uk \
    --to=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=myotisone@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).