From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Jakob_Sch=c3=b6ttl?= Subject: Re: [latex export/babel] pass arguments to \includegraphics from code blocks Date: Mon, 22 Apr 2019 22:33:13 +0200 Message-ID: References: <7c368b05-1572-6e47-8557-2f096cc7b979@gmail.com> <87sgu997ki.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:39788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIfpQ-0002oO-FA for emacs-orgmode@gnu.org; Mon, 22 Apr 2019 16:46:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIfcs-0003yQ-2b for emacs-orgmode@gnu.org; Mon, 22 Apr 2019 16:33:18 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:41916) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIfcr-0003xk-SV for emacs-orgmode@gnu.org; Mon, 22 Apr 2019 16:33:18 -0400 Received: by mail-wr1-x434.google.com with SMTP id c12so10992689wrt.8 for ; Mon, 22 Apr 2019 13:33:17 -0700 (PDT) In-Reply-To: <87sgu997ki.fsf@alphaville.usersys.redhat.com> Content-Language: de-DE 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" To: Nick Dokos , emacs-orgmode@gnu.org Am 22.04.19 um 21:13 schrieb Nick Dokos: > Jakob Sch=C3=B6ttl writes: >> Hi, I want to use code blocks to generate and include images of sheet = music: >> >> #+BEGIN_SRC lilypond :file test.png :exports results >> \header{tagline=3D""} >> { a b c } >> #+END_SRC >> >> >> When doing a latex export the result is: >> >> \begin{center} >> \includegraphics[width=3D.9\linewidth]{test.png} >> \end{center} >> >> Is there a way to specify the arguments for \includegraphics? For >> example I want to change the display width. >> >> Putting these lines above the code block have no effect: >> >> #+ATTR_LATEX: :width 4cm >> >> #+CAPTION: xxx >> >> Maybe this requires a change in ob-lilypond.el to introduce new header= >> arguments for the source block? >> > What I do in such cases is evaluate the block and then add the caption = and > attribute line above the #+RESULTS line: > > --8<---------------cut here---------------start------------->8--- > #+BEGIN_SRC lilypond :file test.png :exports results > \header{tagline=3D""} > { a b c } > #+END_SRC > > > #+ATTR_LATEX: :width 4cm > #+CAPTION: xxx > #+RESULTS: > [[file:test.png]] > --8<---------------cut here---------------end--------------->8--- > Thank you, Nick! That's perfect.