Re: Summary of actual page count and stave count on each page?

David Wright <[email protected]>
Newsgroups gmane.comp.gnu.lilypond.general
Message-ID <[email protected]>
On Sun 14 Jun 2026 at 09:30:11 (-0700), Eric Benson wrote:
> Is there any way to get LilyPond to report some actual data about how many
> pages it has produced and how many staves are on each page? I am using
> explicit page breaks in my scores and would like to know if LilyPond has
> inserted any automatically generated page breaks. It would help me choose
> my own page breaks if I had some better feedback about what it has done.
> The message
> 
> Fitting music on 1 or 2 pages...
> 
> tells me something, and by my observation almost always means 2 pages, but
> it would be nice to get the true number at the very end. The other related
> bit is knowing about "widows and orphans", i.e. stray single staves pushed
> onto a different page from the rest of the score. When I discover these I
> try to rearrange my explicit page breaks to reduce the incidence.
> 
> My project has grown to the point where simple visual inspection is no
> longer effective. I need some kind of automation to show me when a single
> page score has spilled onto a second page. I can use a PDF library with a
> Python script as a post-process, but that's a big hammer to wield and I
> can't get much more than just an accurate page count with it.

I think my scripts are fairly typical in using:

  local Thepagecount="$(pdfinfo "$1" | awk '{if ( /^Pages:/ ) printf ( "%s", $2 )}')"

I don't know whether the rest of pdfinfo's output satisfies
your need for more than the page count.

Cheers,
David.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.