lilypond-user
[Top][All Lists]
Advanced

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

Making "empty" titles disappear


From: Br. Samuel Springuel
Subject: Making "empty" titles disappear
Date: Mon, 11 Jun 2018 13:10:11 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

I have a custom book titles whose definition looks like this:

    bookTitleMarkup = \markup { \fontsize #-3 \column {
        \fill-line { \fontsize #6 \fromproperty #'header:title }
        \fill-line {
            \fromproperty #'header:meter
            \concat { "Tune: " \fromproperty #'header:tune }
        }
        \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
        }
    }}

This is defined in a master style file for a project which is then loaded by each score in the project. Ideally all those custom fields would be defined, but in some cases I've either not had the time or been able to fill them all out yet. For most of the fields this is not a problem as the empty field takes up no space in the score. 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"

\paper  {
    bookTitleMarkup = \markup { \fontsize #-3 \column {
        \fill-line { \fontsize #6 \fromproperty #'header:title }
        \fill-line {
            \fromproperty #'header:meter
            \concat { "Tune: " \fromproperty #'header:tune }
        }
        \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 %%%

--
✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝
Br. Samuel, OSB
St. Anselm’s Abbey
Washington, DC
(R. Padraic Springuel)

PAX ☧ ΧΡΙΣΤΟΣ



reply via email to

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