lilypond-devel
[Top][All Lists]
Advanced

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

Patch for lilypond-book to support separate titling and indexing in LaTe


From: Michael Haynie
Subject: Patch for lilypond-book to support separate titling and indexing in LaTeX
Date: Sun, 9 Apr 2006 17:10:51 -0400

Greetings;

I've been working on a largish collection of hymns for the last several years. The collection includes lead sheets, piano scoring, and orchestral arrangements, and a hymnal. There are now several thousand files in the source base. As you might imagine, automation is really important to my sanity <G>. To support that, I've modified lilypond-book to help me with the construction of the hymnal. This patch allows me to set up titling and indexing in LaTeX (which it does very well), while allowing Lilypond to engrave the music. So: the patch makes it possible to automatically construct a fairly elaborate hymnal type work, but at the cost of making installation a little more difficult.

There don't appear to be viable alternatives to LaTeX for this sort of effort, at this time. For example, XML processors all seem to need some clever backend for producing printed matter, which nearly always turns out to be some TeX derivative. DTP packages don't work for my purposes because of the need to quickly rearrange the order of music to improve pagination (It's bad news to have a song start on an odd page and wrap to an even page -- singers then have to flip back and forth. It's much better to have songs start on even pages or fit on one page.)


The patch has two parts: A patch to lilypond-book.py which changes the code that lilypond generates to include lilypond systems. In particular, the patch allows one to include only the second and subsequent systems, a particular system, or all systems (as before).

Also attached is a collection of LaTeX macros that do the work of including the lilypond music systems, optionally constructing a title block, and optionally constructing TOC, and a title index. The means for constructing an author index, metrical index, key index, and so on, are now also available (but not included).

To be discussed:

LaTeX Macro Handling:

The patch requires lilypond-book users to include the macro file by placing the following in the input source file:
    \input lilypondSystemMacros.tex
They must also have that file in the search path for LaTeX.

Would it be better to generate the macros in the source directory and automatically generate the input statement? (I think this might be hard to do, but I see that we do something similar with \usepackage{graphics}).


Titling:

The lilypond invocation is modified to include '-H all' by default. Agreed?


Field Markup:

The patch doesn't handle translation of markup commands from the lilypond notations to equivalent LaTeX commands. On the one hand, plain fields makes the indexing task much simpler. On the other hand, copyrights are harder to get right. I'm willing to consider suggestions on ways to approach this type of translation. One might write a translator in scheme, or one might use an external program to transform the input. If one were clever enough, one might even manage the translation in LaTeX (shudder :).


Documentation:
I'd be happy to contribute a writeup on using this scheme to either the documentation, or the snippet repository. What would you prefer? I can give detailed instructions on the whole process from arranging the pages to to constructing the indexing automatically, to constructing the signatures for binding.

Thanks for your consideration.

Attachment: patch-altbook
Description: Binary data

Attachment: lilypondSystemMacros.tex
Description: TeX document



reply via email to

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