### 4.6.2 Changing spacing

The output of `annotate-spacing` reveals vertical dimensions in great detail. For details about modifying margins and other layout variables, see Page layout.

Other than margins, there are a few other options to save space:

- Force systems to move as close together as possible (to fit as many systems as possible onto a page) while being spaced so that there is no blank space at the bottom of the page.

  >     \paper {
  >       system-system-spacing = #'((basic-distance . 0.1) (padding . 0))
  >       ragged-last-bottom = ##f
  >       ragged-bottom = ##f
  >     }

- Force the number of systems. This can help in two ways. Just setting a value, even the same value as the number of systems being typeset by default, will sometimes cause more systems to be fitted onto each page, as an estimation step is then bypassed, giving a more accurate fit to each page. Also, forcing an actual reduction in the number of systems may save a further page. For example, if the default layout has 11 systems, the following assignment will force a layout with 10 systems.

  >     \paper {
  >       system-count = #10
  >     }

- Force the number of pages. For example, the following assignment will force a layout with 2 pages.

  >     \paper {
  >       page-count = #2
  >     }

- Avoid (or reduce) objects that increase the vertical size of a system. For example, volta repeats (or alternate repeats) require extra space. If these repeats are spread over two systems, they will take up more space than one system with the volta repeats and another system without. For example, dynamics that ‘stick out’ of a system can be moved closer to the staff:

  >     e4 c g\f c
  >     e4 c g-\tweak X-offset #-2.7 \f c

- Alter the horizontal spacing via `SpacingSpanner`. For more details, see Changing horizontal spacing. The following example illustrates the default spacing:

  >     \score {
  >       \relative c'' {
  >         g4 e e2 |
  >         f4 d d2 |
  >         c4 d e f |
  >         g4 g g2 |
  >         g4 e e2 |
  >       }
  >     }

  The next example modifies `common-shortest-duration` from a value of `1/4` to `1/2`. The quarter note is the most common and shortest duration in this example, so by making this duration longer, a ‘squeezing’ effect occurs:

  >     \score {
  >       \relative c'' {
  >         g4 e e2 |
  >         f4 d d2 |
  >         c4 d e f |
  >         g4 g g2 |
  >         g4 e e2 |
  >       }
  >       \layout {
  >         \context {
  >           \Score
  >           \override SpacingSpanner.common-shortest-duration =
  >             #(ly:make-moment 1/2)
  >         }
  >       }
  >     }

  The `common-shortest-duration` property cannot be modified dynamically, so it must always be placed in a `\context` block so that it applies to the whole score.

#### See also

Notation Reference: Page layout, Changing horizontal spacing.

Snippets: Spacing.

其他语言：deutsch, español, français, italiano, 日本語。
About automatic language selection.

#### LilyPond — Notation Reference v2.18.2 (稳定分支).