emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] [babel] changing size of R graphics in pdf output


From: Dan Davison
Subject: Re: [Orgmode] [babel] changing size of R graphics in pdf output
Date: Tue, 15 Dec 2009 14:14:58 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

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 <address@hidden> 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

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