From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Centering R babel plots in LaTeX/Beamer export? Date: Mon, 09 Jul 2012 17:26:44 -0400 Message-ID: <6351.1341869204@alphaville> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoLTl-00029J-DX for emacs-orgmode@gnu.org; Mon, 09 Jul 2012 17:26:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoLTj-0002oZ-Mu for emacs-orgmode@gnu.org; Mon, 09 Jul 2012 17:26:48 -0400 Received: from g4t0014.houston.hp.com ([15.201.24.17]:18900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoLTj-0002o9-GE for emacs-orgmode@gnu.org; Mon, 09 Jul 2012 17:26:47 -0400 In-Reply-To: Message from John Hendy of "Mon, 09 Jul 2012 12:18:14 CDT." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Hendy Cc: emacs-orgmode John Hendy wrote: > I'm exporting a Beamer presentation with R babel blocks and my plots > are not centered. This should be a reproducible example: > > ----- > #+startup: beamer > #+latex_class: beamer > #+options: toc:nil latex:t tex:t > #+latex_class_options: [presentation,bigger] > #+beamer_frame_level: 1 > > * plot > > #+header: :width 8 :height 6 > #+begin_src R :exports results :results output graphics :file file.pdf > x <- c(1:10) > y <- x^2 > plot(x,y) > #+end_src > ----- > > I tried putting #+begin_center and #+end_center around the block, but > it changes the LaTeX export to wrapping my R block in > \begin/\end{verbatim}. > > Worg ob-R-doc has a :pagecentre option, but says it defaults to true, > so I'm not sure that's my fix. > This is pretty much brute-force, but seems to work: --8<---------------cut here---------------start------------->8--- #+startup: beamer #+latex_class: beamer #+options: toc:nil latex:t tex:t #+latex_class_options: [presentation,bigger] #+beamer_frame_level: 1 * plot #+header: :width 8 :height 6 #+name: foo #+begin_src R :exports results :results output graphics :file file.pdf :pagecentre true x <- c(1:10) y <- x^2 plot(x,y) #+end_src #+LATEX: \begin{center} #+RESULTS: foo [[file:file.pdf]] #+LATEX: \end{center} --8<---------------cut here---------------end--------------->8--- Nick