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):
https://github.com/rualark/MGen/blob/master/MGen/configs/ly2/debug/compressing/compressed2.ly
https://github.com/rualark/MGen/blob/master/MGen/configs/ly2/debug/compressing/compressed2.pdf
Mirror: http://lilybin.com/f7wjax/1
Mirror: https://www.hacklily.org/?edit=rualark/sheet-music/overcompressed.ly
2. Adding just one \pageBreak
command fixes everything:
https://github.com/rualark/MGen/blob/master/MGen/configs/ly2/debug/compressing/uncompressed2.ly
https://github.com/rualark/MGen/blob/master/MGen/configs/ly2/debug/compressing/uncompressed2.pdf
Mirror: http://lilybin.com/7xlar8/1
Mirror: https://www.hacklily.org/?edit=rualark/sheet-music/uncompressed.ly
I already did a google search of known issues and visited lilypond documentation with no significant progress so far:
http://lilypond.org/doc/v2.18/Documentation/notation/vertical-spacing http://lilypond.1069038.n5.nabble.com/warning-compressing-over-full-page-by-12-4-staff-spaces-td168716.html
Please help!
\once \override
with the same properties. Why don’t you just use\override
only once in the beginning? If you can navigate through your code, it’s fine, but it can be simplified a lot! And this would help others to understand it. Now, to your question: did you look into vertical positioning in the doc: lilypond.org/doc/v2.18/Documentation/notation/…