[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem controlling page numbers in bookparts
From: |
Kieren MacMillan |
Subject: |
Re: Problem controlling page numbers in bookparts |
Date: |
Wed, 26 Oct 2016 19:21:26 -0400 |
Hi all,
>> I'm trying to control the page numbering for bookparts in a score.
>> In particular I want each bookpart start with page #1 and omit it
>> on the first page. Therefor I'm adding a paper block inside bookpart
>> and set
>> first-page-number = #1
>> print-first-page-number = ##f
>> (see the attached example)
>>
>> Unfortunately the second page is numbered 2 and visible, i.e. both
>> settings seem to have no effect.
>>
>> What am I doing wrong here?
>
> The possibility to set starting page-numbers for bookparts is
> frequently requested, but not yet done.
Is the following not sufficient?
#(define-markup-command (bookpart-page-number layout props) ()
(let ((first-page-number (ly:output-def-lookup layout 'first-page-number))
(page-number (chain-assoc-get 'page:page-number props 0)))
(interpret-markup layout props (format "~a" (1+ (- page-number
first-page-number))))))
I use it all the time — along with some conditionals around it — and that’s
sufficient for my needs. It doesn’t allow setting the the page-number
arbitrarily, but I use it whenever I need the pages in each bookpart to start
at 1 and number sequentially from there.
Hope this helps!
Kieren.
p.s. Of course, it would be great to have a much more robust and flexible
numbering system… so maybe Harm’s code is a good beginning in that direction.
________________________________
Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: address@hidden