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

                                          

\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" } }

    #}

  )

)

 

\score {

  { c' e' g' c'' }

 

  \layout {

   \conditionalTimeSignature

    \conditionalBarNumbers

  }

}

 

If I remove either of the lines from \layout, it compiles without error and
functions as expected. I've tried a number of variations, including putting
the two lines outside the \score block. I either get compile errors or no
errors but code that appears to do nothing.

 

Any advice? Thank you.

 

John

 

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to