Am Sa., 12. Jan. 2019 um 19:37 Uhr schrieb Kieren MacMillan
<[email protected]>:
> %%% SNIPPET BEGINS
> \version "2.19.80"
>
> #(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))))))
[...]
> Evidently, the choice of page number formatting (e.g., roman) doesn’t work,
> because the bookpart-page-number function assumes/hardcodes the format…
You could go for:
#(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
(number-format
(ly:output-def-lookup layout 'page-number-type)
(1+ (- page-number first-page-number))))))
> but otherwise, I prefer this solution, as it is (to my eye) a more natural
> way of coding book parts [with individual numbering].
Agreed
>
> I’m going to take the challenge to up my Scheme-fu, by trying to tackle the
> improvement of the bookpart-page-number function to handle different
> formatting as giving in \paper variables.
>
> Related: Lily’s entire page-numbering system needs a re-look, so that
> multi-part, multi-format, maybe-number-reset-but-maybe-not documents can be
> handled elegantly and with minimal user coding (such as additional functions
> like yours and mine).
Though, what about the table-of-content?
Right now I've not a good idea what should be printed if several
bookparts have equal page-numbers.
Cheers,
Harm
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user