From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: [latex export/babel] pass arguments to \includegraphics from code blocks Date: Mon, 22 Apr 2019 15:13:49 -0400 Message-ID: <87sgu997ki.fsf@alphaville.usersys.redhat.com> References: <7c368b05-1572-6e47-8557-2f096cc7b979@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([209.51.188.92]:52181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIeO8-0005In-G0 for emacs-orgmode@gnu.org; Mon, 22 Apr 2019 15:14:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIeO7-0000U0-HO for emacs-orgmode@gnu.org; Mon, 22 Apr 2019 15:14:00 -0400 Received: from [195.159.176.226] (port=48250 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hIeO7-0000TT-AE for emacs-orgmode@gnu.org; Mon, 22 Apr 2019 15:13:59 -0400 Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hIeO4-000Rt7-Un for emacs-orgmode@gnu.org; Mon, 22 Apr 2019 21:13:56 +0200 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: emacs-orgmode@gnu.org Jakob Schöttl 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=""} > { a b c } > #+END_SRC > > > When doing a latex export the result is: > > \begin{center} > \includegraphics[width=.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=""} { a b c } #+END_SRC #+ATTR_LATEX: :width 4cm #+CAPTION: xxx #+RESULTS: [[file:test.png]] --8<---------------cut here---------------end--------------->8--- -- Nick "There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors." -Martin Fowler