From: "Jakob Schöttl" <jschoett@gmail.com>
To: Nick Dokos <ndokos@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [latex export/babel] pass arguments to \includegraphics from code blocks
Date: Mon, 22 Apr 2019 22:33:13 +0200 [thread overview]
Message-ID: <b9a1457a-5d48-6efc-8c6c-247b0afb4e52@gmail.com> (raw)
In-Reply-To: <87sgu997ki.fsf@alphaville.usersys.redhat.com>
Am 22.04.19 um 21:13 schrieb Nick Dokos:
> Jakob Schöttl <jschoett@gmail.com> 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---
>
Thank you, Nick! That's perfect.
prev parent reply other threads:[~2019-04-22 20:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-22 17:46 [latex export/babel] pass arguments to \includegraphics from code blocks Jakob Schöttl
2019-04-22 19:13 ` Nick Dokos
2019-04-22 20:33 ` Jakob Schöttl [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b9a1457a-5d48-6efc-8c6c-247b0afb4e52@gmail.com \
--to=jschoett@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=ndokos@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).