+Note that the spacing mechanisms discussed in this section only
+control the vertical spacing of staves and non-staff lines within
+individual systems. The vertical spacing between separate
+systems, scores, markups, and margins is controlled by
+@code{\paper} variables, which are discussed in
+@ref{Flexible vertical dimensions}.
+
+@menu
+* Within-system spacing properties::
+* Spacing of ungrouped staves::
+* Spacing of grouped staves::
+* Spacing of non-staff lines::
+@end menu
+
+
+@node Within-system spacing properties
+@unnumberedsubsubsec Within-system spacing properties
+
+The within-system vertical spacing mechanisms are controlled by
+two sets of grob properties. The first set is associated with the
+@code{VerticalAxisGroup} grob, which is created by all staves and
+non-staff lines. The second set is associated with the
+@code{StaffGrouper} grob, which can be created by staff-groups,
+but only if explicitly called. These properties are described
+individually at the end of this section.
+
+Except for the @code{staff-affinity} property (of the
+@code{VerticalAxisGroup} grob), each of these grob properties is
+stored as an alist (association list), and each uses the same
+alist structure as the @code{\paper} spacing variables discussed
+in @ref{Flexible vertical dimensions}.
+
+The @emph{reference point} for a staff is the vertical center of
+its @code{StaffSymbol} (i.e. the middle line if @code{line-count}
+is odd; the middle space if @code{line-count} is even).
+
+The reference points for individual non-staff lines are given in
+the following table:
+
+@multitable {Non-staff line} {Reference point}
+@headitem Non-staff line @tab Reference point
+@item @code{ChordNames} @tab baseline
+@item @code{NoteNames} @tab baseline
+@item @code{Lyrics} @tab baseline
+@item @code{Dynamics} @tab vertical center
+@item @code{FiguredBass} @tab highest point
+@item @code{FretBoards} @tab top line
+@end multitable
+
+In the following image, horizontal lines indicate the positions
+of these reference points:
+
+@lilypond[quote,noragged-right,line-width=110\mm]
+#(define zero-space '((padding . -inf.0) (space . 0)))
+
+alignToZero = \with {
+ \override VerticalAxisGroup #'inter-staff-spacing = #zero-space
+ \override VerticalAxisGroup #'inter-loose-line-spacing = #zero-space
+}
+lowerCaseChords = \with {
+ chordNameLowercaseMinor = ##t
+}
+staffAffinityDown = \with {
+ \override VerticalAxisGroup #'staff-affinity = #DOWN
+}
+labelContext =
+#(define-music-function
+ (parser location context)
+ (string?)
+ #{ s1*0^\markup { \typewriter $context } #})
+
+\layout {
+ \context { \Dynamics \alignToZero }
+ \context { \FiguredBass \alignToZero }
+ \context { \Lyrics \alignToZero }
+ \context { \NoteNames \alignToZero }
+ \context { \ChordNames \alignToZero \lowerCaseChords }
+ \context { \FretBoards \alignToZero \staffAffinityDown }
+ \context { \Score
+ \override BarLine #'stencil = ##f
+ \override DynamicText #'self-alignment-X = #-1
+ \override FretBoard #'X-offset = #1.75
+ \override TextScript #'minimum-Y-extent = #'(-2 . 3)
+ \override TimeSignature #'stencil = ##f
+ }
+}
+
+%% These contexts have reference points at the baseline:
+%% ChordNames, NoteNames, and Lyrics
+<<
+ \new ChordNames { \chords { g1:m } }
+ \new NoteNames { s1 | g1 | }
+ \new RhythmicStaff {
+ \set RhythmicStaff.instrumentName = #"baseline "
+ \textLengthOn
+ \labelContext "ChordNames" s1 |
+ \labelContext "NoteNames" s1 |
+ \labelContext "Lyrics" s1 |
+ }
+ \new Lyrics { \lyrics { \skip 1*2 | ghijk1 | } }
+>>
+
+%% The reference point for Dynamics is its vertical center
+<<
+ \new RhythmicStaff {
+ \set RhythmicStaff.instrumentName = #"vertical center "
+ \labelContext "Dynamics" s1*3
+ }
+ \new Dynamics { s2\mp s\fp }
+>>
+
+%% The reference point for FiguredBass is its highest point
+<<
+ \new RhythmicStaff {
+ \set RhythmicStaff.instrumentName = #"highest point "
+ \labelContext "FiguredBass" s1
+ }
+ \new FiguredBass { \figuremode { <6 5>1 } }
+>>
+
+%% The reference point for FretBoards is the top line
+\include "predefined-guitar-fretboards.ly"
+<<
+ \new FretBoards { \chordmode { e1 } }
+ \new RhythmicStaff {
+ \set RhythmicStaff.instrumentName = #"top line "
+ \labelContext "FretBoards " s1
+ }
+>>
+@end lilypond
+
+Specific methods for modifying alists are discussed in
+@ref{Modifying alists}. Grob properties should be adjusted with
+an @code{\override} inside a @code{\score} or @code{\layout}
+block, and not inside a @code{\paper} block.
+
+The following example demonstrates the two ways these alists can
+be modified. The first declaration updates one key-value
+individually, and the second completely re-defines the property:
+
+@example
+\new Staff \with @{
+ \override VerticalAxisGroup #'next-staff-spacing #'space = #10
+@} @{ @dots{} @}
+
+\new Staff \with @{
+ \override VerticalAxisGroup #'next-staff-spacing =
+ #'((padding . 1)
+ (space . 10)
+ (minimum-distance . 9)
+ (stretchability . 10))
+@} @{ @dots{} @}
+@end example
+
+To change any spacing settings globally, put them in the
+@code{\layout} block:
+
+@example
+\layout @{
+ \context @{
+ \Staff
+ \override VerticalAxisGroup #'next-staff-spacing #'space = #10
+ @}
+@}
+@end example
+
+The global defaults for the following grob properties are defined
+in @file{scm/define-grobs.scm}:
+