From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Controlling image width and placement in Beamer export Date: Tue, 26 Nov 2013 09:08:37 -0600 Message-ID: References: <87haazb79c.fsf@syk.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlKFj-0007xU-P0 for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 10:08:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlKFi-0002th-Iw for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 10:08:39 -0500 Received: from mail-oa0-x231.google.com ([2607:f8b0:4003:c02::231]:58836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlKFi-0002sj-EG for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 10:08:38 -0500 Received: by mail-oa0-f49.google.com with SMTP id i4so6026411oah.8 for ; Tue, 26 Nov 2013 07:08:37 -0800 (PST) In-Reply-To: <87haazb79c.fsf@syk.fi> 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: Jarmo Hurri Cc: emacs-orgmode On Tue, Nov 26, 2013 at 7:51 AM, Jarmo Hurri wrote: > > Greetings. > > I needed to create an Asymptote-generated centered image with a smaller > width than the default .9\linewidth in a Beamer export. After trial and > error I ended with the method shown below. In particular, to my surprise > an > > #+ATTR_LATEX: :width 5cm > > _above_ the #+BEGIN_SRC did not work, so I had to place the line above > #+RESULTS: > > Is the following the best way to do this, or is there a more concise > method? > > # --------------------------------------------------------------- > #+BEGIN_SRC asymptote :file triangle.pdf > size (8cm, 0); > pair A = (0, 0), B = (4, 1), C = (3, 2); > draw (A -- B -- C -- cycle); > #+END_SRC > > #+LATEX: \begin{center} > #+ATTR_LATEX: :width 5cm > #+RESULTS: > [[file:triangle.pdf]] > #+LATEX: \end{center} > # --------------------------------------------------------------- > Oh, and not that it matters, but I typically do: #+begin_center #+ATTR_LATEX: :width 5cm #+RESULTS: [[file:triangle.pdf]] #+end_center Theoretically, more flexible for different types of exports. Even if you're only doing LaTeX, it's still less characters to type :) John > All the best, > > Jarmo > >