Assuming that Lilypond is (La)TeX in disguise, every single entity on the final page should be an invisible box with its respective content.

Is it possible to display every of these boxes? Ideally with a global command and not by redefining every item I used.

The reason I want to do this, is that sometimes it only needs a single minor change and Lilypond aggressively puts one single system on a second page instead of fitting everything on one page. And this change did not even affect the total height of the system it belongs to. (Can not replicate it since I went too far along with this particular piece now.)

And I would like to see, why Lilypond decides to do that, or why the existing space isn't properly used.


I realised that my PDF-viewer (SumatraPDF) can highlight the "real" boxes and I see now, how big certain items are and which ones cause problems. I won't know though, why the box I marked in the image below is so much bigger than necessary, but at least I know from where to continue.

(The smaller colourful boxes are the result of the skyline-debugging option. Thanks to @user86318)

Box needlessly big

  • 2
    I don't know whether this can be done (I doubt it), but: 1) Lilypond is definitely not LaTeX in disguise; 2) if you want to force your score to one page, just put page-count = #1 into your \paper block.
    – Ramillies
    Apr 9, 2022 at 18:35
  • That would be my last option, but I would rather micromanage the little things that cause that. page-count feels so... violent.
    – Peder
    Apr 10, 2022 at 11:09

2 Answers 2


I have no idea what Sumatra is displaying (and attempts to run it result in an error on my OS), but it definitely doesn't look like something LilyPond is using for spacing. For most types of spacing, LilyPond uses skylines. For a few types of spacing, it uses plain boxes.

On the other hand, skylines are not the source of decisions for page breaking. See, when computing page breaks, LilyPond has not yet spaced the music horizontally, so it doesn't have the outlines. It could have them if it first did line breaking, then decided how many systems to cram on each page, but in reality, it uses a method that tries to optimize line breaking and page breaking simultaneously. What LilyPond actually uses is so-called "pure" estimations of the system's height between two given points. Since there are no outlines, that stuff is based on extents. If you are unlucky and there are a high note on the lower staff and a low note on the higher staff, LilyPond will reserve enough space for the possibility of a collision, even if you would not think they might collide. To have an idea of how LilyPond estimated system heights, compile your file with \paper { annotate-spacing = ##t } and observe the "extent estimates".


Try calling lilypond with the command line option -ddebug-skylines .

  • That's an interesting feature, but it seems like the boxes in reality are bigger than LilyPond indicates by using the skylines-option. See the edit of my initial question for details.
    – Peder
    Apr 10, 2022 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.