Re: Balanced page turns?
Tina Petzel <[email protected]> Sun, 28 Jun 2026 15:57:56 +0200
| Newsgroups | gmane.comp.gnu.lilypond.general |
|---|---|
| Message-ID | <[email protected]> |
Hello Eric,
> I have a large collection of short scores, most of which fit on one or two
> pages. I'm trying to understand how to control page turns. I've added
> explicit \pageBreak commands to some scores, but I would like to find a way
> for LilyPond to balance the pages when it does automatic page breaking.
> That is, if a score is, say, 9 systems long, I would like to put 5 systems
> on one page and 4 systems on the other page, rather than 8 and 1 as it does
> now if I don't intervene.
Lilypond actually does this by default, but it allows for the last page to be
filled only partially. This is a sensible default for very short scores, since
it avoids e.g. 2 systems being spaced really far apart on one page, but it is
usually something you switch off on longer stuff. So see here:
%%%
\book {
% Systems are spaced more or less evenly across pages,
% but last page may be filled only partially,
% so last system has is on second page
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
}
\book {
% Systems are spaced more or less evenly across pages,
% including last page, so all system are fitted on
% a single page
\paper {
ragged-last-bottom = ##f
}
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
}
\book {
% Increasing number of systems compresses spacing ...
\paper {
ragged-last-bottom = ##f
}
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
}
\book {
% ... until systems are evenly distributed among
% two pages
\paper {
ragged-last-bottom = ##f
}
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
}
\book {
% The compression behaviour is determined by the
% system-system-spacing paper variable. So if
% default compresses too much before spreading
% to two pages we can tweak this:
\paper {
ragged-last-bottom = ##f
% default 8, for distance between scores
score-system-spacing.minimum-distance = 10
% default 8, for distance bewteen systems
% of the same score
system-system-spacing.minimum-distance = 10
}
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
{ 1 1 1 }
}
%%%
Cheers,
Tina
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQS0sdUK2Lu8of48K2+FHhaCPe7BywUCakEoZAAKCRCFHhaCPe7B y7AlAQDlR+fVMxR7+UzoNfa/jiqX9uVADw5v2HN9wCWoND8XPQEAq/3zGD7oGIk2 Wh6FVNJxBJEj7rf+HYKhfYz6M2oOYAA= =4pVi -----END PGP SIGNATURE-----