Previous: Explicit staff and system positioning, Up: Vertical spacing


11.4.5 Two-pass vertical spacing

In order to automatically stretch systems so that they should fill the space left on a page, a two-pass technique can be used:

  1. In the first pass, the amount of vertical space used to increase the height of each system is computed and dumped to a file.
  2. In the second pass, spacing inside the systems are stretched according to the data in the page layout file.

The ragged-bottom property adds space between systems, while the two-pass technique adds space between staffs inside a system.

To allow this behaviour, a tweak-key variable has to be set in each score \layout block, and the tweaks included in each score music, using the \scoreTweak music function.

     
     %% include the generated page layout file:
     \includePageLayoutFile
     
     \score {
       \new StaffGroup <<
         \new Staff <<
           %% Include this score tweaks:
           \scoreTweak "scoreA"
           { \clef french c''1 \break c''1 } 
         >>
         \new Staff { \clef soprano g'1 g'1 }
         \new Staff { \clef mezzosoprano e'1 e'1 }
         \new Staff { \clef alto g1 g1 }
         \new Staff { \clef bass c1 c1 }
       >>
       \header {
         piece = "Score with tweaks"
       }
       %% Define how to name the tweaks for this score:
       \layout { #(define tweak-key "scoreA") }
     }

For the first pass, the dump-tweaks option should be set to generate the page layout file.

lilypond -b null -d dump-tweaks <file>.ly
lilypond <file>.ly


Previous: Explicit staff and system positioning, Up: Vertical spacing

This page is for LilyPond-2.10.33 (stable-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.