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 <myotis...@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


_______________________________________________
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 via email to