On Mon, 23 Sep 2024, David Sumbler wrote:

> Is there a way that I can take *total* control of page breaking?

I don't have a solution to offer but will comment that this is an issue I
also ran into recently while trying to engrave parts for piano four hands.
These are usually printed on alternating pages - secondo on the left
(verso, even-numbered) pages and primo on the right (recto, odd-numbered)
so that each performer has their own music in front of them while playing.
And it's pretty important for the page breaks to be in the same places for
both, even if those page breaks are not optimal for either, because they
need to agree on when to turn the page.  This factor means that the music
on one side or the other will often be stretched or compressed.

Ideally, for visual appearance, there should also be the same number of
systems on the two sides as well.  If one performer has seven grand staves
and the other has three (because playing a smaller number of longer
notes), it doesn't look good and it feels like someone's being treated
unfairly - even though there is no strong reason to need the same number
of systems from one two-page spread to the next, only between the two
sides of a single two-page spread.  And it's not particularly necessary
for the line breaks to match between the two sides, only the page breaks
and number of systems on facing pages.

I found it helped to add manual line breaks on one side or the other, as
well as the manual page breaks.  This constrained the breaking algorithm a
bit and made it less likely to add extra page breaks.  Sometimes there's
just one line that really needs to be more compressed than Lilypond wants,
and if you can force that line's layout with manual breaks at its
beginning and end, this is enough to prevent Lilypond from deciding to
space out the entire page's content and add an extra page break.  But
that's far from a complete solution, and it required a lot of trial and
error.  Lilypond's automatic extra breaks often seemed to happen by
surprise just when I had *almost* gotten something else the way I wanted.

Getting the pages into the right order, with correct page numbers,
presents additional challenges for piano four hands music with Lilypond.
I ended up using external scripts and utilities to engrave a bunch of
different versions of each part with different starting page numbers, and
then select single pages from the different versions to put together into
a final PDF file which would have the desired sequence of pages and page
numbers.  Being able to do that was only possible with the page breaks in
predictable places, and it required a lot of trial and error and will
probably break if I change any of the musical content.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca                 People before tribes.
https://ansuz.sooke.bc.ca/

Reply via email to