On Tue, Nov 26, 2013 at 7:51 AM, Jarmo Hurri <jarmo.hu...@syk.fi> 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 > >