bug-lilypond
[Top][All Lists]
Advanced

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

Re: first-page-number parameter is not being recognized


From: Rick Hansen (aka RickH)
Subject: Re: first-page-number parameter is not being recognized
Date: Thu, 28 Sep 2006 18:20:00 -0700 (PDT)

I thought of that but thought it would fail because if your offset number is
an odd number it messes up the even/odd checking.  adding an even number
offset value still retains the even/odd-ness of the original number, an odd
offset would invert even/odd-ness.  But I guess it's fixed now anyway.



Daniel Johnson-2 wrote:
> 
>>
>> Thanks Joe,
>>
>> Also anyone using an on-the-fly expression that expects #first-page to be
>> true on the first page will also fail if they set first-page-number
>> themselves.  Because #first-page is determined by comparing the page
>> counter
>> value to first-page-number.  If the user is asking for a different
>> first-page-number then the #first-page boolean winds up being unreliable.
>> I
>> thought I was going crazy when my copyrights did not print when I was
>> clearly checking this expression to set the footer:
>>
>>       \on-the-fly #first-page {
>>          \fill-line {
>>             { \hspace #0 }
>>             { \teeny "copyright" }
>>             { \bold \fromproperty #'page:page-number-string }
>>          }
>>       }
>>
>> And #first-page was evaluating to false on the first page, because I was
>> also setting first-page-number = #4.  A case of one bug creating another
>> bug
>> I guess, so I had to remove my first-page-number = #4 setting, but still
>> need my song to begin with page 4.
>>
>> I would hope that page first of a 1 page score would evaluate as follows:
>>
>> #first-page = true AND #last-page = true
>>
>> And that multi-page scores would evaluate as follows:
>>
>> page first
>> #first-page = true AND #last-page = false
>> page n
>> #first-page = false AND #last-page = false
>> page last
>> #first-page = false AND #last-page = true
>>
>>
>> All regardless if the user selected a different starting offset page
>> number.
>>
>> In my case the #first-page boolean would have became true on page 4 I
>> guess,
>> but there was not enough music to get that far.
>>
>> thanks
>> Rick
> 
> A very hackish workaround for this is to default your first-page-number to
> 1, and then include the following Scheme function:
> 
> #(define-markup-command (page-number-plus-offset layout props offset)
> (number?)
>   "Add an offset to the page number, and produce a stencil."
>   (let* ((m (chain-assoc-get 'page:page-number props)))
>    (interpret-markup layout props (number->string(+ m offset)))))
> 
> Now in your header/footer markup, instead of using \fromproperty
> #'page:page-number-string, use \page-number-plus-offset #3. This will
> output 3 + the real page number, making your first page 4.
> 
> Of course, this means that if you want your first page to be an even page,
> your odd(Header|Footer)Markup will need to apply to even pages, and vice
> versa. Obviously this is a very ugly hack and should only be used if you
> cannot wait for the next (fixed) version of Lilypond.
> 
> 
> 
> 
> _______________________________________________
> bug-lilypond mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-lilypond
> 
> 

-- 
View this message in context: 
http://www.nabble.com/first-page-number-parameter-is-not-being-recognized-tf2347489.html#a6557870
Sent from the Gnu - Lilypond - Bugs mailing list archive at Nabble.com.





reply via email to

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