hello lilyponders,

I've been using lilypond-book for the first time. love it!

There's one thing that I'd like to have though. I'd love to be able to
define macros in a similar way as in latex. Is this possible?

>From what I've read in the documentation, lilypond-book only knows to look
for \begin{lilypond} and \lilypond{ }, so no macros can be defined *for
lilypond-book* inside the latex file. If you try to do this, lilypond-book
ignores them and then latex tries to interpret them and fails.

So i wrote a little parser that looks for a lilypond delimiter, specifically
\lily{ [music] } and replaces that for whatever i define in my parser, for
example

\begin[staffsize=12]{lilypond}
\include "bookstyle.ly"
[music]
\end{lilypond}

Now compiling a lilypond-book becomes a three step process:
1. parse book.tex to find \lily{ } and replace with arbitrary lilypond stuff
2. run lilypond-book on book.tex
3. run latex on book.tex

So if there is no way of doing this in lilypond-book, would anyone else be
interested in integrating something like this in the core lilypond-book
code? would it be useful for others?

best,

victor
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to