David Kastrup wrote:
>
> Michael Hendry <hendry.mich...@gmail.com> writes:
>
>>> Ok, tags work with music, not with books. Here is what I would suggest:
>>>
>>> ConcertBook =
>>> \book {
>>> ...
>>> }
>>>
>>> and then you can at a later point of time say
>>>
>>> \ConcertBook
>>>
>>> and can comment that line out or not. Assigning #f to ConcertBook when
>>> a command line option is set is a bit trickier, but still reasonably
>>> easy.
>>>
>> That sounds good, but when I tried it I got...
>>
>> michael@Linley6:~/indigo/workspace/TestTag$ lilypond score.ly
>> GNU LilyPond 2.14.2
>> Processing `score.ly'
>> Parsing...
>> score.ly:92:0: error: syntax error, unexpected BOOK_IDENTIFIER
>>
>> \ConcertBook
>
> Pffft. Taking a look at the LilyPond grammar (it is also in an appendix
> in the notation manual), it turns out that you have to write
>
> \book { \ConcertBook }
>
> here. Turns out that a book identifier can be used in both \bookpart
> and \book. That's a bit more for outcommenting and it becomes harder to
> use this conditionally.
>
> --
> David Kastrup
>
>
>
It's an odd way of doing things, effectively having to enclose a \book with
a \book. Not only that, but it doesn't work correctly in terms of naming the
output files.
If I compile:
\book { \GuitarBook }
\book { \ConcertBook }
\book { \TrumpetBook }
\book { \AltoBook }
I get the correct information in the output files, but the filenames are...
TestTag (alto).pdf
TestTag (alto)-1.pdf
TestTag (alto)-2.pdf
TestTag (alto)-3.pdf
...although the definition of GuitarBook includes '\bookOutputName "TestTag
(gtr)"', and so on for the other parts.
If I switch the order around...
\book { \AltoBook }
\book { \GuitarBook }
\book { \ConcertBook }
\book { \TrumpetBook }
The names all include "(alto)", as before, but the contents are
TestTag (alto).pdf - Alto Part
TestTag (alto)-1.pdf - Guitar Part
TestTag (alto)-2.pdf - Concert Part
TestTag (alto)-3.pdf - Trumpet Part
It looks as though \bookOutputName is treated as a global variable, even
though it's defined inside a \book {} which is itself defined within a
variable's assignment statement.
--
View this message in context:
http://old.nabble.com/Is-there-an-equivalent-of--define-...--ifndef-...--endif-in-lilypond--tp33346188p33357401.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user