bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lilypond-book fails when using Latex macros in options


From: David Kastrup
Subject: Re: lilypond-book fails when using Latex macros in options
Date: Thu, 11 Sep 2014 13:45:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

John Szwast <address@hidden> writes:

Newsgroups: gmane.comp.gnu.lilypond.bugs
Subject: Re: lilypond-book fails when using Latex macros in options
Organization: Organization?!?
From: David Kastrup <address@hidden>
Gcc: nnfolder+archive:sent.2014-09
--text follows this line--
John Szwast <address@hidden> writes:

> I want to specify a lilypond environment option with a Latex macro, but 
> lilypond-book fails when I try.
>
> \documentclass{article}
> \newcommand\staffsize{14}
> \begin{document}
> %     \begin[staffsize=14]{lilypond}  % This works
>       \begin[staffsize=\staffsize]{lilypond}  % This doesn't
>       \end{lilypond}
> \end{document}

I think that this is a misunderstanding about how Lilypond-book works.
Environments like \begin{lilypond}...\end{lilypond} are not interpreted
by LaTeX.  Instead, lilypond-book extracts those "environments" into
files of their own, runs LilyPond on them, takes the resulting graphics,
creates a .tex file where the \begin{lilypond}...\end{lilypond} macros
have been replaced by graphics inclusion commands, and _then_ runs LaTeX
for the first time.  Yes, it _will_ run LaTeX one time previously on
what amounts to a pretty empty document in order to figure out some
things like \linewidth.

But it would be pretty tricky for it to figure out that it has to _also_
find things like \staffsize.

This kind of "let LaTeX do its jobs for dimensions" would be exacerbated
by LaTeX and LilyPond having entirely different ideas of cm and \cm.
Indeed, LilyPond complains if you are using cm, and LaTeX does not know
\cm.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]