lilypond-user
[Top][All Lists]
Advanced

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

Re: problem to code page-numbers


From: Jan-Peter Voigt
Subject: Re: problem to code page-numbers
Date: Fri, 14 Aug 2015 12:12:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0

Hi Harm,

the markup-code in the footer and header is called several times for each page. I can't tell you why and how often, (but I think it should be 3 times ;) ) but you might keep track of the processed page.
So you might check, if you checked the current page.

Cheers,
Jan-Peter

Am 14.08.2015 um 12:01 schrieb Thomas Morley:
Hi,

I'm trying to put out a \book, affecting the page-numbers in a certain way.
Ofcourse this should happen under certain conditions.

Look at the minimal example below.
All I try to affect is the `counter', if the page is the last of the bookpart.
I had expected that the counter would get up to 3 (starting at 1 and
two bookparts having a last page)
Instead it goes up to 9.

No idea why it's called nine times.

\version "2.19.24"

#(define counter 1)

#(define (test layout props arg)

     (if (chain-assoc-get 'page:is-bookpart-last-page props #f)
         (set! counter (1+ counter)))

     (newline) (format #t "I'm called ~a. time" counter)

     (interpret-markup layout props arg))

\paper {
   print-first-page-number = ##t
   oddHeaderMarkup = \markup
   \fill-line { \on-the-fly #test \fromproperty #'page:page-number-string }
   evenHeaderMarkup = \markup
   \fill-line { \on-the-fly #test \fromproperty #'page:page-number-string }
}

\book {
   \bookpart { \repeat unfold 3 { d''1 \pageBreak } }
   \bookpart { \repeat unfold 4 { e''1 \pageBreak } }
}


Any hints?




Cheers,
   Harm

_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user




reply via email to

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