From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [babel] changing size of R graphics in pdf output Date: Tue, 15 Dec 2009 14:14:58 -0500 Message-ID: <87aaxkqcb1.fsf@stats.ox.ac.uk> References: <2c75873c0912121440w1452f36fjdb41a01cef811354@mail.gmail.com> <87tyvv1wb6.fsf@stats.ox.ac.uk> <2c75873c0912122337l5d6c7625r74effca7bd8b0d88@mail.gmail.com> <2c75873c0912130023m2cee2f1ao534c8525f7fa1eb0@mail.gmail.com> <2c75873c0912130512w1c90b709q97c964086f3e8870@mail.gmail.com> <2c75873c0912130539v2ab18e40m32ed76c17e9ba813@mail.gmail.com> <2c75873c0912130623h922f307ta4e79845ac082387@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKcrT-0002Lq-I8 for emacs-orgmode@gnu.org; Tue, 15 Dec 2009 14:15:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKcrP-0002JU-4f for emacs-orgmode@gnu.org; Tue, 15 Dec 2009 14:15:07 -0500 Received: from [199.232.76.173] (port=41189 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKcrO-0002J7-S9 for emacs-orgmode@gnu.org; Tue, 15 Dec 2009 14:15:02 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:45408) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKcrO-0006m3-CE for emacs-orgmode@gnu.org; Tue, 15 Dec 2009 14:15:02 -0500 In-Reply-To: <2c75873c0912130623h922f307ta4e79845ac082387@mail.gmail.com> (Graham Smith's message of "Sun, 13 Dec 2009 14:23:07 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Graham Smith Cc: emacs-orgmode@gnu.org 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 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