lilypond-user
[Top][All Lists]
Advanced

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

RE: Problem with conditionals in \layout


From: John Schlomann
Subject: RE: Problem with conditionals in \layout
Date: Fri, 1 Dec 2017 20:39:48 -0600

I had tried that previously, and again just now just to be sure. I still get the same error. I simply moved the two lines

 

  \conditionalTimeSignature

  \conditionalBarNumbers

 

to just above the \score block. Removing the ‘if’ statements works fine, but of course that defeats the purpose of this code.

 

Am I still doing something wrong here?

 

From: Carl Sorensen [mailto:address@hidden
Sent: Friday, December 01, 2017 5:32 PM
To: John Schlomann; address@hidden
Subject: Re: Problem with conditionals in \layout

 

 

 

From: John Schlomann <address@hidden>
Date: Friday, December 1, 2017 at 1:02 PM
To: <address@hidden>
Subject: Problem with conditionals in layout

 

I’m have a problem including conditionals in a \layout block. The following code results in error, “syntax error, unexpected OUTPUT_DEF_IDENTIFIER”.

 

The problem is that you are nesting layout blocks with this code, which is not allowed.  According to the Notation Reference 4.2.1 you can have multiple layout blocks as top-level expressions, and they will all apply.  So move your variables \conditional* above the \score{} block:

                                         

\version "2.18.2"

 

#(define conditionalTimeSignature

  (if #t

   #{

     \layout { \context { \Staff \remove "Time_signature_engraver" } }

   #}

  )

)

 

#(define conditionalBarNumbers

  (if #t

    #{

      \layout { \context { \Score \remove "Bar_number_engraver" } }

    #}

  )

)

 

       \conditionalTimeSignature

       \conditionalBarNumbers

 

\score {

  { c' e' g' c'' }

}

 

 

 


reply via email to

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