lilypond-user
[Top][All Lists]
Advanced

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

Re: conditional \when-property


From: Kieren MacMillan
Subject: Re: conditional \when-property
Date: Tue, 30 Jul 2013 20:15:47 -0400

Hi all,

Found the correct solution (I think):

#(define-markup-command (when-property layout props symbol markp) (symbol? 
markup?)
 (if (chain-assoc-get symbol props)
     (interpret-markup layout props markp)
     (ly:make-stencil '() empty-interval empty-interval)))

At least that *seems* to do the right thing — if I've set myself up for 
disaster, I'd appreciate being corrected.  =)

Thanks,
Kieren.

On 2013-Jul-30, at 19:25, Kieren MacMillan <address@hidden> wrote:

> Hello all,
> 
> This \when-property function (whence I found it, I can't remember) clearly 
> doesn't work as expected:
> 
> \version "2.17"
> 
> #(define-markup-command (when-property layout props symbol markp) (symbol? 
> markup?)
>  (if (chain-assoc-get symbol props)
>      (interpret-markup layout props markp)
>      (ly:make-stencil '()  '(1 . -1) '(1 . -1))))
> 
> \paper {
>  scoreTitleMarkup = \markup \column {
>    \when-property #'header:foo { \fromproperty #'header:foo }
>    \when-property #'header:bar { \fromproperty #'header:bar }
>    \when-property #'header:foo { \fromproperty #'header:foo }
>    \when-property #'header:bar { \fromproperty #'header:bar }
>    \when-property #'header:foo { \fromproperty #'header:foo }
>    \when-property #'header:bar { \fromproperty #'header:bar }
>    \when-property #'header:foo { \fromproperty #'header:foo }
>    \when-property #'header:bar { \fromproperty #'header:bar }
>    \fromproperty #'header:title
>  }
> }
> 
> \header {
>  title = TEST
> }
> 
> \score {
>  \relative c' { c1 }
> }
> 
> How can it be made truly conditional (so that the titling line/item takes up 
> no vertical space if the property is null)?
> 
> Thanks,
> Kieren.
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 




reply via email to

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