lilypond-user
[Top][All Lists]
Advanced

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

Re: Extracting header fields for use by e.g. LaTeX?


From: Bernard Hurley
Subject: Re: Extracting header fields for use by e.g. LaTeX?
Date: Mon, 28 Nov 2005 02:15:33 +0000

If you have a song book with 20 songs, it would be nice if you could
define  \preLilyPondExample _once_ and then include the songs with
\lilypondfile. That way they would all be handled identically. You could
add and delete songs at will. Also you could change the way they are
handled by changing the macro \preLilyPondExample. The problem at
present is that lilypond-book does not generate a macro with a parameter
so there is no way to get hold of the .title file in the generated latex
code except by adding it by hand. You would also have to work out which
file you need - it's not obvious -look at the generated latex. So I
think the problem is most easily solved by changing llypond-book.

The way it would work is:

lilypond-book would have an extra option (-M or --mparam, say). If used
it would cause lilypond-book to generate a call to \preLilyPondExample
with an extra parameter, which would have the value of the base name of
the snippet file. So for instance if you were writing:

\section {title-of-song-1}
\lilypondfile {song1}
\section {title-of-song-2}
\lilypondfile {song2}
....
....
\section {title-of-song-n}
\lilypondfile {songn}

You could instead code:

\newcommand {\preLilyPondExample}[1]{\section {\protect\input #1.title }}

and then

\lilypondfile {song1}
\lilypondfile {song2}
....
....
\lilypondfile {songn}

Bernard

On Sun, 2005-11-27 at 18:19 -0500, Laura Conrad wrote:
> >>>>> "BH" == Bernard Hurley <address@hidden> writes:
> 
>     BH> Notice:
>     BH> 1] The files lily-1915112629-systems.tex and lily-1915112629.title 
> both
>     BH> start with "lily-1915112629" so this prefix must be available to
>     BH> lilypond-book when it generates this code.
> 
> This seems a little baroque (in the bad sense) to me.  Why not just
> run "lilypond -H title test.ly" and get test.title, which you can then
> include quite easily?
> 
-- 
Bernard Hurley <address@hidden>




reply via email to

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