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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Michael Haynie
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.




_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

patch-altbook (3K) Download Attachment
lilypondSystemMacros.tex (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patch for lilypond-book to support separate titling and indexing in LaTeX

Han-Wen Nienhuys-2


Hello Michael,

thanks for your patch!

Michael Haynie schreef:

> 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.

> 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}).

I think the file should be generated/copied to the output directory.
Since files in that directory are surely seen by latex, it's a safe choice.

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

No problem.

> 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.

Please do; I'm still a bit in doubt whether the header file should be
part of LilyPond proper or an add-on. In any event, it should use lily
style naming, eg.

   lilypond-latex-system-macros.tex

also, detailed information on making a book with using should probably
be in a separate document, since that process is in a large part
external to lily.


--

Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen

LilyPond Software Design
  -- Code for Music Notation
http://www.lilypond-design.com



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel