[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem to code page-numbers
From: |
Thomas Morley |
Subject: |
Re: problem to code page-numbers |
Date: |
Fri, 14 Aug 2015 12:21:17 +0200 |
2015-08-14 12:12 GMT+02:00 Jan-Peter Voigt <address@hidden>:
> 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
I tried all combinations of conditions already including your suggestion.
In my preivious experiences, it is unpredictable how often it is called.
Maybe a different approach is needed.
More in the evening.
Thanks,
Harm
>
>
> 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
>
>
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: problem to code page-numbers, Jan-Peter Voigt, 2015/08/14
- Re: problem to code page-numbers,
Thomas Morley <=