On Mon, 2016-11-07 at 17:56 +0100, David Kastrup wrote:
> David Sumbler <da...@aeolia.co.uk> writes:
> 
> > 
> > I had the following lines in the main file of my current Lilypond
> > project:
> > 
> > \book {
> >   \bookOutputName "../firstCello"
> >     partName = "Cello 1"
> >     \include "frontcover.ily"
> >     \bookpart { %music...
> > 
> > The file "frontcover.ily" contains a \bookpart block which prints a
> > front cover with title, composer etc. - these are defined
> > elsewhere.
> >  But it needs one more variable, viz. 'partName'.
> > 
> > I discovered that Lilypond will not accept a variable definition in
> > Lilypond format in the position I have put it: at the top level of
> > a
> > \book block.  Nor will it accept it in a \bookpart block.  But at a
> > higher or a lower level, it will.
> > 
> > This seems a bit weird (to say the least), in view of the fact that
> > by
> > replacing the line 
> >     partName = "Cello 1"
> > with the Scheme form
> >     #(define partName "Cello 1")
> > everything works as intended.
> > 
> > Is there any useful reason why a variable cannot be defined in
> > Lilypond
> > format in these contexts?
> Because they would not be local to these contexts?  Have you tried
> putting them into a \header block?

I had not tried a \header block, but I have now!

Putting a \header block inside the \book block or the \bookpart block
does mean that that assignment of the variable no longer produces an
error.  Unfortunately the variable is not recognized by the following
\markup section within the bookpart, and I get an "unknown escaped
string" error.

David

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

Reply via email to