Hi,

I recently managed to set up LilyDev.
I think (hope) the patch below is of some use.
Of course I'm an absolutly newbie with this sort of work. It would be
nice if some could explain the next steps how to handle this patch (or
point me to the relevant CG-Chapter).

%%%%%%%%%%%%%%%%%%%%%%%%%

>From 33d0972db16358a688cb9978da6f71826576554e Mon Sep 17 00:00:00 2001
From: Harm <[email protected]>
Date: Thu, 28 Jun 2012 12:02:40 +0200
Subject: [PATCH] which-page

It's possible to add a markup to a footer/header of a specified page,
using (which-page <page-number>).
Multiple settings are possible.
---
 ly/titling-init.ly |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/ly/titling-init.ly b/ly/titling-init.ly
index f6daacd..9f3c644 100644
--- a/ly/titling-init.ly
+++ b/ly/titling-init.ly
@@ -101,6 +101,11 @@ book last one."
       (interpret-markup layout props arg)
       empty-stencil))

+#(define ((which-page nmbr) layout props arg)
+ (if (= (chain-assoc-get 'page:page-number props 0) nmbr)
+   (interpret-markup layout props arg)
+   empty-stencil))
+
 %% Bookpart first page and last page predicates
 #(define (part-first-page layout props arg)
   (if (= (chain-assoc-get 'page:page-number props -1)
-- 
1.7.0.4

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% example

\version "2.15.41"

someText =
\markup \column {
       \vspace #1
       "Some text"
       "Some text"
       "Some text"
       \vspace #1
}

someOtherText =
\markup \column {
       \vspace #1
       "some other text"
       "some other text"
       "some other text"
       \vspace #4
}

\paper {
    oddHeaderMarkup = ##f
    evenHeaderMarkup = ##f
    oddFooterMarkup = \markup \fill-line {
            \center-column {
                \on-the-fly #(which-page 2)
                       \someText
                \on-the-fly #last-page
                       \someOtherText
                \on-the-fly #last-page
                       \fromproperty #'header:tagline
                \on-the-fly #not-first-page
                       \fromproperty #'page:page-number-string
            }
    }

    evenFooterMarkup = \oddFooterMarkup
}

pagebreaks = {
       s1*2 \pageBreak
       s1*3 \pageBreak
       s1*2 \pageBreak
}

mus = \relative c' {
       \repeat unfold 9 { c1 \break }
       \bar "|."
}

\score {
       \new ChoirStaff <<
         \new Staff { << \pagebreaks \mus >> }
         \new Staff { \clef alto \mus }
         \new Staff { \clef tenor \mus }
         \new Staff { \clef bass \mus }
       >>
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Cheers,
  Harm

_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to