[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Displaying typesetting information at compile time
From: |
Richard Shann |
Subject: |
Re: Displaying typesetting information at compile time |
Date: |
Tue, 22 Mar 2022 08:15:53 +0000 |
User-agent: |
Evolution 3.38.3-1 |
On Mon, 2022-03-21 at 17:28 +0100, Jean Abou Samra wrote:
>
>
> Le 21/03/2022 à 17:24, Richard Shann a écrit :
> > On Sun, 2022-03-20 at 20:09 +0100, Jean Abou Samra wrote:
> > >
> > [...] perhaps there is something altogether
> > simpler?
>
>
>
> In that case, just output the info at the end of page-post-process
> instead
> of storing it and retrieving it later.
>
> \version "2.22.2"
>
> \paper {
> page-post-process =
> #(lambda (paper pages)
> (let ((n-systems 0)
> (page-min #f)
> (page-max #f))
> (for-each
> (lambda (page)
> (for-each
> (lambda (line)
> (let ((sys (ly:prob-property line 'system-grob)))
> (if (ly:grob? sys)
> (let ((sys-page (ly:grob-property sys 'page-
> number)))
> (set! n-systems (1+ n-systems))
> (set! page-min (if page-min
> (min page-min sys-page)
> sys-page))
> (set! page-max (if page-max
> (max page-max sys-page)
> sys-page))))))
> (ly:prob-property page 'lines)))
> pages)
> (ly:message "~a systems on ~a pages"
> n-systems
> (1+ (- page-max page-min)))))
> }
>
> \repeat unfold 10 { 1 1 \break }
> \repeat unfold 13 { 1 1 \break }
>
Perfect! Thanks, I should have thought to track down documentation for
page-post-process ...
Richard