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: Marc Hohl
Subject: Re: page footer and (on-page ...) in combination with \label
Date: Mon, 21 Jan 2013 10:36:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

Am 21.01.2013 06:40, schrieb Jay Anderson:
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.
Correct.

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
}
Thanks a lot, that is exactly what I need!

Regards,

Marc




reply via email to

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