Vertical spacing - GNU LilyPond
Description: GNU LilyPond

Next: Vertical spacing of piano staves, Previous: Score layout, Up: Music layout

#### 10.5.4 Vertical spacing

The height of each system is determined automatically. To prevent systems from bumping into each other, some minimum distances are set. By changing these, you can put staves closer together, and thus put more systems onto one page.

Normally staves are stacked vertically. To make staves maintain a distance, their vertical size is padded. This is done with the property `minimum-Y-extent`. When applied to a VerticalAxisGroup, it controls the size of a horizontal line, such as a staff or a line of lyrics. `minimum-Y-extent` takes a pair of numbers, so if you want to make it smaller than its default `#'(-4 . 4)` then you could set

    \override Staff.VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)

This sets the vertical size of the current staff to 3 staff spaces on either side of the center staff line. The value `(-3 . 3)` is interpreted as an interval, where the center line is the 0, so the first number is generally negative. The staff can be made larger at the bottom by setting it to `(-6 . 4)`.

The spacing of staves in a system may also be tuned per system. This is done with the command

    \overrideProperty
    #"Score.NonMusicalPaperColumn"
    #'line-break-system-details
    #'((alignment-extra-space . 15))

at the line break before the system to be changed. The distance `15` is distributed over all staves that have a fixed distance alignment. For example,

The distance for `alignment-extra-space` may also be negative.

To change the amount of space between systems, use `between-system-space`. A score with only one staff is still considered to have systems, so setting `between-system-space` will be much more useful than changing `minimum-Y-extent` of a Staff context.

    \paper {
      between-system-space = 10\mm
    }

If you simply want to tell LilyPond “fit as much as possible onto these pages, then expand to fill any available space on the pages,” then use the following

    \paper {
      between-system-padding = #1
      ragged-bottom=##f
      ragged-last-bottom=##f
    }

The vertical spacing on a page can also be changed for each system individually. Some examples are found in the example file `input/regression//page-spacing.ly`.

When setting `annotate-spacing` in the `\paper` block LilyPond will graphically indicate the dimensions of properties that may be set for page spacing,

    #(set-default-paper-size "a7" 'landscape)
    \paper { annotate-spacing = ##t }
    { c4 }

All units dimensions are measured in staff spaces. The pairs (a,b) are intervals, where a is the lower edge and b the upper edge of the interval.

##### See also

Internals: Vertical alignment of staves is handled by the VerticalAlignment object. The context parameters specifying the vertical extent are described in connection with the Axis_group_engraver.

Example files: `input/regression//page-spacing.ly`, `input/regression//alignment-vertical-spacing.ly`.

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

Other languages: English.
Using automatic language selection.