From: John Schlomann <[email protected]>
Date: Friday, December 1, 2017 at 1:02 PM
To: <[email protected]>
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'' }

}



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

Reply via email to