On 20/02/2026 12:27, Simon Albrecht wrote:
I like having a horizontal line separating the footers from the score. However, I don’t know how to hide that line when the footer is empty (see working example below).

I thought maybe I could adapt the \first-visible markup command, but I couldn’t get far with that (how to access the header fields in the markup command definition?).

Could someone give me a pointer please, or has someone got a solution for this kind of issue?


I think this will answer your question.

\version "2.25.29"

#(define (separator layout props arg)
  (if (or (chain-assoc-get 'header:copyright props)
          (chain-assoc-get 'header:tagline props))
    (interpret-markup layout props arg)
    empty-stencil))

\header {
% copyright = "Copyright is mine!"
  tagline = ##f
% tagline = "Special tagline"
}

\paper {
  oddFooterMarkup = \markup \center-column {
    %% how to make the following horizontal line conditional on whether the
    %% following header fields aren’t empty?
    \on-the-fly \separator \override #'(span-factor . 1/3) \draw-hline
    %% Copyright header field only on first page in each bookpart.
    \if \on-first-page-of-part \fill-line {
      \fromproperty #'header:copyright
    }
    %% Tagline only on last page in each book.
    \if \on-last-page \fill-line {
      \fromproperty #'header:tagline
    }
  }
}

\markup "[insert Public Domain content here]"

--
Timothy Lanfear, Bristol, UK.

Reply via email to