lilypond-user
[Top][All Lists]
Advanced

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

Re: Making "empty" titles disappear


From: Kieren MacMillan
Subject: Re: Making "empty" titles disappear
Date: Mon, 11 Jun 2018 13:23:04 -0400

Hello!

> The problem is for `tune` or `poet` header field which also have labels 
> attached to them.  In those cases, I get the labels "Tune: " and "Lyrics: " 
> still appearing in the score.  Ideally I'd like those labels to disappear 
> when their associated field is empty.  Is there a way to make that happen?

%%% BEGIN snippet %%%
\version "2.19.53"

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

\paper  {
   bookTitleMarkup = \markup { \fontsize #-3 \column {
       \fill-line { \fontsize #6 \fromproperty #'header:title }
       \when-property #'header:tune \fill-line {
           \fromproperty #'header:meter
           \concat { "Tune: " \fromproperty #'header:tune }
       }
       \when-property #'header:lyrics \fill-line {
           \concat { "Lyrics: " \fromproperty #'header:poet }
           \fromproperty #'header:composer
       }
       \fill-line {
           \override #'(line-width . 30) \wordwrap-field #'header:poet_copyright
           \override #'(line-width . 30) \wordwrap-field #'header:tune_copyright
       }
   }}
}

\new Staff {
   c'
}

%%% END snippet %%%

Hope that helps!
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: address@hidden




reply via email to

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