On 11/09/14 12:45, David Kastrup wrote: > John Szwast <[email protected]> writes: > > Newsgroups: gmane.comp.gnu.lilypond.bugs > Subject: Re: lilypond-book fails when using Latex macros in options > Organization: Organization?!? > From: David Kastrup <[email protected]> > Gcc: nnfolder+archive:sent.2014-09 > --text follows this line-- > John Szwast <[email protected]> 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. >
I created http://code.google.com/p/lilypond/issues/detail?id=4136 for an enhancement to the documentation. James _______________________________________________ bug-lilypond mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-lilypond
