[Top][All Lists]

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

Re: Altering page numbers

From: Thomas Morley
Subject: Re: Altering page numbers
Date: Sat, 12 Jan 2019 20:32:58 +0100

Am Sa., 12. Jan. 2019 um 19:37 Uhr schrieb Kieren MacMillan

> \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
          (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].


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


reply via email to

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