[Top][All Lists]

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

lilypond-book macros/variables

From: v!ictor address@hidden
Subject: lilypond-book macros/variables
Date: Tue, 28 Aug 2007 12:01:27 -0400

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

\include ""

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?



reply via email to

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