[Top][All Lists]

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

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

From: Daniel Johnson
Subject: Re: first-page-number parameter is not being recognized
Date: Thu, 28 Sep 2006 15:07:20 -0700 (PDT)
User-agent: SquirrelMail/1.4.6

> 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)
  "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.

reply via email to

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