* ob-lilypond and LaTeX floats/captions
@ 2016-02-26 15:20 James Harkins
2016-02-26 21:58 ` Nicolas Goaziou
0 siblings, 1 reply; 3+ messages in thread
From: James Harkins @ 2016-02-26 15:20 UTC (permalink / raw)
To: orgmode
[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]
Especially looking for users of ob-lilypond:
I currently have a few LilyPond source code blocks that are working quite well as inline graphics (exported to LaTeX), e.g.:
#+BEGIN_SRC lilypond :exports results :noweb yes :file ex1.eps
...
#+END_SRC
When I export, it (correctly) asks if I want to evaluate the source block, and the export (correctly) includes the line:
\includegraphics[width=.9\linewidth]{ex1.eps}
So far, so good.
Now, I would like to make the results a floating figure, with a caption and a #+name reference. So I added the following to the above block:
#+name: ex1
#+caption: One possible form of "seed" material to start the performance.
#+BEGIN_SRC lilypond :exports results :noweb yes :file ex1.eps
...
#+END_SRC
... but the #+name is not converted into a label, and the #+caption is also ignored.
My question, then, is: What is needed to get ob-lilypond to support LaTeX floats and captions? (I have a sneaky feeling it isn't trivial, but it's worth asking in any case.)
hjh
[-- Attachment #2: Type: text/html, Size: 1089 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ob-lilypond and LaTeX floats/captions
2016-02-26 15:20 ob-lilypond and LaTeX floats/captions James Harkins
@ 2016-02-26 21:58 ` Nicolas Goaziou
2016-02-27 0:42 ` James Harkins
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2016-02-26 21:58 UTC (permalink / raw)
To: James Harkins; +Cc: orgmode
Hello,
"James Harkins" <jamshark70@qq.com> writes:
> I currently have a few LilyPond source code blocks that are working quite well as inline graphics (exported to LaTeX), e.g.:
>
> #+BEGIN_SRC lilypond :exports results :noweb yes :file ex1.eps
> ...
> #+END_SRC
>
> When I export, it (correctly) asks if I want to evaluate the source block, and the export (correctly) includes the line:
>
> \includegraphics[width=.9\linewidth]{ex1.eps}
>
> So far, so good.
>
> Now, I would like to make the results a floating figure, with a caption and a #+name reference. So I added the following to the above block:
>
> #+name: ex1
> #+caption: One possible form of "seed" material to start the performance.
> #+BEGIN_SRC lilypond :exports results :noweb yes :file ex1.eps
> ...
> #+END_SRC
>
> ... but the #+name is not converted into a label, and the #+caption is also ignored.
>
> My question, then, is: What is needed to get ob-lilypond to support
> LaTeX floats and captions? (I have a sneaky feeling it isn't trivial,
> but it's worth asking in any case.)
You are applying the name and caption to the source block, which is
removed (:exports results), not to the results of the source block. So,
you need to generate the results first, or at least put a RESULTS
keyword below, and apply the name and caption to it.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ob-lilypond and LaTeX floats/captions
2016-02-26 21:58 ` Nicolas Goaziou
@ 2016-02-27 0:42 ` James Harkins
0 siblings, 0 replies; 3+ messages in thread
From: James Harkins @ 2016-02-27 0:42 UTC (permalink / raw)
To: Nicolas Goaziou; +Cc: orgmode
On February 27, 2016 5:57:01 AM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> > My question, then, is: What is needed to get ob-lilypond to support
> > LaTeX floats and captions? (I have a sneaky feeling it isn't trivial,
> > but it's worth asking in any case.)
>
> You are applying the name and caption to the source block, which is
> removed (:exports results), not to the results of the source block. So,
> you need to generate the results first, or at least put a RESULTS
> keyword below, and apply the name and caption to it.
A-ha. Thank you. So, "What is needed to get ob-lilypond to support LaTeX
floats and captions" is to RTFM ;)
I have often exported source code to LaTeX listings, but only infrequently
exported results. So I wasn't clear on the mechanism. Now that you explain
it, it makes perfect sense: the properties belong to an entity that I asked
it not to export.
Thanks again - I can take it from here.
(PS This project is a write-up of an improvisational composition -- a lot
of text description of the procedure, with some examples in musical
notation along the way. It blows my mind that I can write the lilypond
scores directly into the org document, and it all renders with C-c C-e l p.
org-mode FTW! Again!)
hjh
Sent with AquaMail for Android
http://www.aqua-mail.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-27 0:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-26 15:20 ob-lilypond and LaTeX floats/captions James Harkins
2016-02-26 21:58 ` Nicolas Goaziou
2016-02-27 0:42 ` James Harkins
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).