Sometimes lilypond tries to use less pages for more music, which is not always wanted. This can be easily fixed by manually adding
\pageBreak , but sometimes an automatic solution is needed.
When vertical compression happens, lilypond log shows something like this:
warning: compressing over-full page by 36.9 staff-spaces warning: page 4 has been compressed
In my particular situation lilypond script is generated by MusicXML analysis program and no manual tweaking of positions or pagebreaks is possible, because we do not know what music user can upload.
How can compression be totally disabled or limited, so that Lilypond would have to add page breaks? Automatic solution is required, which does not include manually tweaking positions of elements and pagebreaks.
Sorry for posting such a big example, but many elements are needed so that page is not enough any more. Here is an example of automatically generated score:
1. Automatic line breaking leads to vertically over-compressing first page (text lines are too close to each other, numbers inside score collide with text spanners):
2. Adding just one
\pageBreak command fixes everything:
I already did a google search of known issues and visited lilypond documentation with no significant progress so far: