lilypond-user
[Top][All Lists]
Advanced

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

RE: Header fields in custom footer


From: Andrew Bernard
Subject: RE: Header fields in custom footer
Date: Fri, 25 Nov 2016 10:20:17 +1100

Hi Joram,

As mentioned in my previous post, you have to use the function in LSR 467,
or something similar. This function makes header variables available outside
the header block. If you don't use it, you can't easily see them.

Andrew

== snip

\version "2.19.51"

#(define-markup-command (markupWithHeader layout props markup) (markup?)
   "Interpret the given markup with the header fields added to the props.
This way, one can re-use the same functions (using fromproperty 
#'header:field) in the header block and as top-level markup."
   (let* (
           ;; TODO: If we are inside a score, add the score's local header
block, too!
           ;; Currently, I only use the global header block, stored in
$defaultheader
           (scopes (list $defaultheader))
           (alists (map ly:module->alist scopes))
           (prefixed-alist
            (map (lambda (alist)
                   (map (lambda (entry)
                          (cons
                           (string->symbol (string-append "header:"
                                             (symbol->string
                                              (car entry))))
                           (cdr entry)))
                     alist))
              alists))
           (props (append prefixed-alist
                    props
                    (layout-extract-page-properties layout))))
     (interpret-markup layout props markup)))

\header {
  composer = "Mozart"
}

\paper {
  oddFooterMarkup = \markup \markupWithHeader { "Composer: " \fromproperty
#'header:composer }
}

{
  c'4
}

== snip





reply via email to

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