lilypond-user
[Top][All Lists]
Advanced

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

Re: page footer and (on-page ...) in combination with \label


From: Jay Anderson
Subject: Re: page footer and (on-page ...) in combination with \label
Date: Sun, 20 Jan 2013 22:40:31 -0700

On Sun, Jan 20, 2013 at 1:53 PM, Marc Hohl <address@hidden> wrote:
> For one specific page I have to remove the footer completely.
> I set
>
> \label #'emptypage

Can the page without a footer be in a book-part of its own? That would
be too simple so I'm assuming not.

Below is adapted from some help I got a while back to move the hymn
number to the outside of the page depending if the page is even or
odd. In this case it blanks the footer when the current page is the
same as the page number for the label (you can't reuse the same label
on multiple pages).

\version "2.17.10"

#(define-markup-command (empty-with-label layout props sym markup)
(symbol? markup?)
  (let* ((stencil (interpret-markup layout props markup))
         (x-ext (ly:stencil-extent stencil X))
         (y-ext (ly:stencil-extent stencil Y)))
    (ly:make-stencil
     `(delay-stencil-evaluation
       ,(delay (ly:stencil-expr
                 (let* ((curr-page (chain-assoc-get 'page:page-number props -1))
                        (table (ly:output-def-lookup layout 'label-page-table))
                        (page-number (if (list? table)
                                         (assoc-get sym table)
                                         #f)))
                   (if (= page-number curr-page)
                     empty-stencil
                     (interpret-markup layout props markup))))))
     x-ext
     y-ext)))

\paper
{
  oddFooterMarkup = \markup {\empty-with-label #'emptypage \fill-line
{"footer"} }
  evenFooterMarkup = #oddFooterMarkup
}

\bookpart
{
  \markup "A"
  \pageBreak

  \markup "B"
  \pageBreak

  \label #'emptypage
  \markup "C"
  \pageBreak

  \markup "D"
  \pageBreak
}

-----Jay



reply via email to

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