]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/spacing.itely
Doc: update doc for page-breaking-between-system-spacing.
[lilypond.git] / Documentation / notation / spacing.itely
index f00b437bb29f076dbd53904337fcdbcf6854ba65..90d71289d466265c2fec1029726b5fd0033f5b09 100644 (file)
@@ -4,7 +4,8 @@
     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
 
     When revising a translation, copy the HEAD committish of the
-    version that you are working on.  See TRANSLATION for details.
+    version that you are working on.  For details, see the Contributors'
+    Guide, node Updating translation committishes..
 @end ignore
 
 @c \version "2.12.0"
@@ -221,6 +222,13 @@ the application of @var{minimum-distance} (whereas the height of a
 staff is crucial for @var{padding}).
 @end itemize
 
+For example, the default is:
+
+@example
+after-title-spacing = #'((space . 2) (padding . 0.5))
+@end example
+
+
 If a page has a ragged bottom, @var{space} is not stretched. In particular, the
 resulting distance on such a page is the largest of
 @itemize @bullet
@@ -270,12 +278,6 @@ baseline of the last top-level markup) to the bottom of the
 printable area (ie. the top of the bottom margin).
 See @var{after-title-spacing}.
 
-@item foot-separation
-@funindex foot-separation
-
-Distance between the bottom-most music system and the page
-footer.  Default: @code{4\mm}.
-
 @item top-title-spacing
 @funindex top-title-spacing
 
@@ -559,7 +561,7 @@ increased by one.  Default: @code{##f}.
 
 @ignore
 
-FIXME: this variable is used, but I don't know what it does. -pm
+TODO: this variable is used, but I don't know what it does. -pm
 @item blank-after-score-page-force
 @funindex blank-after-score-page-force
 
@@ -605,13 +607,14 @@ may cause pages to be overfilled if it is made too large. This is
 currently supported only by the @code{ly:optimal-breaking} algorithm.
 Default: unset.
 
-@item page-breaking-between-system-padding
-@funindex page-breaking-between-system-padding
+@item page-breaking-between-system-spacing
+@funindex page-breaking-between-system-spacing
 
 Tricks the page breaker into thinking that
-@code{between-system-padding} is set to something different than
-it really is.  For example, if this variable is set to something
-substantially larger than @code{between-system-padding}, then the
+@code{between-system-spacing} is set to something different than
+it really is.  For example, if
+@code{page-breaking-between-system-spacing #'padding} is set to something
+substantially larger than @code{between-system-spacing #'padding}, then the
 page-breaker will put fewer systems on each page.  Default: unset.
 
 @item page-count
@@ -709,7 +712,7 @@ default,  for example
 #(set-default-paper-size "a6" 'landscape)
 \book {
   \score {
-    \relative { c1 \break c1 }
+    \relative c' { c1 \break c1 }
   }
   \paper {
     system-separator-markup = \slashSeparator
@@ -733,6 +736,9 @@ Default: unset.
 @item two-sided
 @funindex two-sided
 
+@cindex gutter
+@cindex binding gutter
+
 If set to true, use @code{inner-margin}, @code{outer-margin} and
 @code{binding-offset} to determine margins depending on whether
 the page number is odd or even.  This overrides @code{left-margin}
@@ -1446,18 +1452,21 @@ defaults to @code{space - minimum-distance}.
   % Since space is small and there is no minimum-distance, the distance
   % between this staff and the next will be determined by padding.
   \new Staff \with {
-    \override VerticalAxisGroup #'next-staff-spacing = #'((space . 1) (padding . 1))
+    \override VerticalAxisGroup #'next-staff-spacing =
+      #'((space . 1) (padding . 1))
   }
   { \clef bass c, }
   % Since space is small and nothing sticks out very far, the distance
   % between this staff and the next will be determined by minimum-distance.
   \new Staff \with {
-    \override VerticalAxisGroup #'next-staff-spacing = #'((space . 1) (minimum-distance . 12))
+    \override VerticalAxisGroup #'next-staff-spacing =
+      #'((space . 1) (minimum-distance . 12))
   }
   { \clef bass c, }
   % By setting padding to a negative value, staves can be made to collide.
   \new Staff \with {
-    \override VerticalAxisGroup #'next-staff-spacing = #'((space . 4) (padding . -10))
+    \override VerticalAxisGroup #'next-staff-spacing =
+      #'((space . 4) (padding . -10))
   }
   { \clef bass c, }
   \new Staff { \clef bass c, }
@@ -1522,26 +1531,6 @@ a number (@code{#f}, for example) will cause that line to be treated
 like a staff.  Conversely, setting @var{staff-affinity} for a staff will
 cause it to be treated like a non-staff.
 
-@c FIXME: is it possible to have @example inside @warning?
-@c @warning{ Adjacent non-staff lines should have non-increasing
-@c @var{staff-affinity} from top-to-bottom.  For example, the behavior of
-@c @example
-@c <<
-@c   \new Staff c
-@c   \new Lyrics \with @{ \override VerticalAxisGroup #'staff-affinity = #DOWN @}
-@c   \new Lyrics \with @{ \override VerticalAxisGroup #'staff-affinity = #UP @}
-@c   \new Staff c
-@c >>
-@c @end example
-@c is undefined.
-@c }
-
-@warning{A non-staff line at the bottom of a system should have
-@var{staff-affinity} set to @code{UP}.  Similarly, a non-staff
-line at the top of a system should have @var{staff-affinity} set
-to @code{DOWN}.
-}
-
 Non-staff lines admit three properties to control their spacing.  Each
 of the these properties is an alist of the same format as
 @var{next-staff-spacing}, above.
@@ -1570,19 +1559,29 @@ to which it does not belong.
 \layout {
   \context {
     \Lyrics
-    % By default, Lyrics are placed close together. Here, we allow them to be stretched
-    % more widely.
-    \override VerticalAxisGroup #'inter-loose-line-spacing #'stretchability = #1000
+    % By default, Lyrics are placed close together. Here, we allow them to
+    % be stretched more widely.
+    \override VerticalAxisGroup
+      #'inter-loose-line-spacing #'stretchability = #1000
   }
 }
 
 \new StaffGroup
 <<
-  \new Staff \with { \override VerticalAxisGroup #'next-staff-spacing = #'((space . 30)) } c'1
-  \new Lyrics \with { \override VerticalAxisGroup #'staff-affinity = #UP } \lyricmode { up }
-  \new Lyrics \with { \override VerticalAxisGroup #'staff-affinity = #CENTER } \lyricmode { center }
-  \new Lyrics \with { \override VerticalAxisGroup #'staff-affinity = #DOWN } \lyricmode { down }
-  \new Staff c'1
+  \new Staff \with {
+    \override VerticalAxisGroup #'next-staff-spacing = #'((space . 30)) }
+    { c'1 }
+  \new Lyrics \with {
+    \override VerticalAxisGroup #'staff-affinity = #UP }
+    \lyricmode { up }
+  \new Lyrics \with {
+    \override VerticalAxisGroup #'staff-affinity = #CENTER }
+    \lyricmode { center }
+  \new Lyrics \with {
+    \override VerticalAxisGroup #'staff-affinity = #DOWN }
+    \lyricmode { down }
+  \new Staff
+    { c'1 }
 >>
 @end lilypond
 
@@ -1598,58 +1597,49 @@ Internals Reference:
 @rinternals{VerticalAlignment},
 @rinternals{Axis_group_engraver}.
 
-
-@node Vertical spacing between systems
-@subsection Vertical spacing between systems
-
-Space between systems are controlled by four @code{\paper} variables,
-
+@knownissues
+Adjacent non-staff lines should have non-increasing
+@var{staff-affinity} from top-to-bottom.  For example, the behavior of
 @example
-\paper @{
-  between-system-space = 1.5\cm
-  between-system-padding = #1
-  ragged-bottom=##f
-  ragged-last-bottom=##f
-@}
+<<
+  \new Staff c
+  \new Lyrics \with @{ \override VerticalAxisGroup #'staff-affinity = #DOWN @}
+  \new Lyrics \with @{ \override VerticalAxisGroup #'staff-affinity = #UP @}
+  \new Staff c
+>>
 @end example
+is undefined.
 
-When only a couple of flat systems are placed on a page, the resulting
-vertical spacing may be non-elegant: one system at the top of the page,
-and the other at the bottom, with a huge gap between them.  To avoid this
-situation, the space added between the systems can be limited.  This
-feature is activated by setting to @code{#t} the
-@code{page-limit-inter-system-space} variable in the @code{\paper}
-block.  The paper variable @code{page-limit-inter-system-space-factor}
-determines how much the space can be increased: for instance, the value
-@code{1.3} means that the space can be 30% larger than what it would be
-on a ragged-bottom page.
-
-In the following example, if the inter system space were not limited,
-the second system of page 1 would be placed at the page bottom.  By
-activating the space limitation, the second system is placed closer to
-the first one.  By setting @code{page-limit-inter-system-space-factor} to
-@code{1}, the spacing would the same as on a ragged-bottom page, like
-the last one.
+A non-staff line at the bottom of a system should have
+@var{staff-affinity} set to @code{UP}.  Similarly, a non-staff
+line at the top of a system should have @var{staff-affinity} set
+to @code{DOWN}.
 
-@lilypond[verbatim]
-#(set-default-paper-size "a6")
-\book {
-  \paper {
-    page-limit-inter-system-space = ##t
-    page-limit-inter-system-space-factor = 1.3
-
-    oddFooterMarkup = \markup "page bottom"
-    evenFooterMarkup = \markup "page bottom"
-    oddHeaderMarkup = \markup \fill-line {
-      "page top" \fromproperty #'page:page-number-string }
-    evenHeaderMarkup = \markup \fill-line {
-      "page top" \fromproperty #'page:page-number-string }
-  }
-  \new Staff << \repeat unfold 4 { g'4 g' g' g' \break }
-                { s1*2 \pageBreak } >>
-}
-@end lilypond
+@node Vertical spacing between systems
+@subsection Vertical spacing between systems
 
+The mechanisms that control spacing between systems are similar to those
+that control spacing between staves within a system (see
+@ref{Vertical spacing inside a system}).  The main difference is that
+the variables to control spacing between systems are set in the
+@code{\paper} block, rather than as grob properties.  These paper block
+variables are @var{between-system-spacing},
+@var{between-scores-system-spacing}, @var{after-title-spacing},
+@var{before-title-spacing}, @var{between-title-spacing},
+@var{top-system-spacing}, @var{top-title-spacing} and
+@var{bottom-system-spacing}.  Note that these variables ignore non-staff
+lines.  For example, @var{between-system-spacing} controls the spacing
+from the middle staff line of the bottom staff from one system to
+the middle staff line of the top staff of the next system, whether
+or not there are lyrics below the upper system.
+See @ref{Vertical dimensions} for a description of each of these
+variables.
+
+There are two more @code{\paper} block variables that affect vertical
+spacing: if @var{ragged-bottom} is set to @code{##t} then no pages will
+be stretched (which means that neither the space between systems nor the
+space within systems will be stretched). If @var{ragged-last-bottom}
+is set to @code{##t} then the last page will not be stretched.
 
 @seealso
 Snippets:
@@ -1671,14 +1661,12 @@ It is possible to approach vertical spacing in a different way using
 vertical positions on the page.
 
 @code{NonMusicalPaperColumn #'line-break-system-details} accepts an associative
-list of five different settings:
+list of three different settings:
 
 @itemize
 @item @code{X-offset}
 @item @code{Y-offset}
-@item @code{alignment-offsets}
-@item @code{alignment-extra-space}
-@item @code{fixed-alignment-extra-space}
+@item @code{alignment-distances}
 @end itemize
 
 Grob overrides, including the overrides for @code{NonMusicalPaperColumn}
@@ -1709,11 +1697,11 @@ example @code{NonMusicalPaperColumn} overrides with the special
   #'line-break-system-details #'((X-offset . 20) (Y-offset . 40))
 
 \overrideProperty NonMusicalPaperColumn
-  #'line-break-system-details #'((alignment-offsets . (0 -15)))
+  #'line-break-system-details #'((alignment-distances . (15)))
 
 \overrideProperty NonMusicalPaperColumn
   #'line-break-system-details #'((X-offset . 20) (Y-offset . 40)
-                                 (alignment-offsets . (0 -15)))
+                                 (alignment-distances . (15)))
 @end example
 
 To understand how each of these different settings work, we begin
@@ -1789,8 +1777,8 @@ too, that the @code{Y-offset} property here determines the exact vertical
 position on the page at which each new system will render.
 
 Now that we have set the vertical startpoint of each system
-explicitly, we can also set the vertical startpoint of each staff
-within each system manually.  We do this using the @code{alignment-offsets}
+explicitly, we can also set the vertical distances between staves
+within each system manually.  We do this using the @code{alignment-distances}
 subproperty of @code{line-break-system-details}.
 
 @lilypond[quote]
@@ -1803,15 +1791,15 @@ subproperty of @code{line-break-system-details}.
         \new Voice {
           \overrideProperty #"Score.NonMusicalPaperColumn"
             #'line-break-system-details #'((Y-offset . 20)
-                                           (alignment-offsets . (0 -15)))
+                                           (alignment-distances . (15)))
           s1*5 \break
           \overrideProperty #"Score.NonMusicalPaperColumn"
             #'line-break-system-details #'((Y-offset . 60)
-                                           (alignment-offsets . (0 -15)))
+                                           (alignment-distances . (15)))
           s1*5 \break
           \overrideProperty #"Score.NonMusicalPaperColumn"
             #'line-break-system-details #'((Y-offset . 100)
-                                           (alignment-offsets . (0 -15)))
+                                           (alignment-distances . (15)))
           s1*5 \break
         }
         \new Voice { \repeat unfold 15 { c'4 c' c' c' } }
@@ -1830,8 +1818,8 @@ Note that here we assign two different values to the
 @code{line-break-system-details} attribute alist accepts many
 additional spacing parameters (including, for example, a corresponding
 @code{X-offset} pair), we need only set the @code{Y-offset} and
-@code{alignment-offsets} pairs to control the vertical startpoint of
-every system and every staff.  Finally, note that @code{alignment-offsets}
+@code{alignment-distances} pairs to control the vertical startpoint of
+every system and every staff.  Finally, note that @code{alignment-distances}
 specifies the vertical positioning of staves but not of staff groups.
 
 @lilypond[quote]
@@ -1844,15 +1832,15 @@ specifies the vertical positioning of staves but not of staff groups.
         \new Voice {
           \overrideProperty #"Score.NonMusicalPaperColumn"
             #'line-break-system-details #'((Y-offset . 0)
-                                           (alignment-offsets . (0 -30 -40)))
+                                           (alignment-distances . (30 10)))
           s1*5 \break
           \overrideProperty #"Score.NonMusicalPaperColumn"
             #'line-break-system-details #'((Y-offset . 60)
-                                           (alignment-offsets . (0 -10 -20)))
+                                           (alignment-distances . (10 10)))
           s1*5 \break
           \overrideProperty #"Score.NonMusicalPaperColumn"
             #'line-break-system-details #'((Y-offset . 100)
-                                           (alignment-offsets . (0 -10 -40)))
+                                           (alignment-distances . (10 30)))
           s1*5 \break
         }
         \new Voice { \repeat unfold 15 { c'4 c' c' c' } }
@@ -1869,10 +1857,11 @@ specifies the vertical positioning of staves but not of staff groups.
 Some points to consider:
 
 @itemize
-@item When using @code{alignment-offsets}, lyrics count as a staff.
+@item When using @code{alignment-distances}, lyrics and other non-staff lines
+do not count as a staff.
 
 @item The units of the numbers passed to @code{X-offset},
-@code{Y-offset} and @code{alignment-offsets} are interpreted as multiples
+@code{Y-offset} and @code{alignment-distances} are interpreted as multiples
 of the distance between adjacent staff lines.  Positive values move staves
 and lyrics up, negative values move staves and lyrics down.
 
@@ -2053,18 +2042,16 @@ c2 c4. c8 c4. c16[ c] c4. c8 c8 c8 c4 c4 c4
 @end lilypond
 
 
-In the introduction
-FIXME FIXME FIXME
-@c (see @rlearning{Engraving}),
-it was explained that stem
-directions influence spacing.  This is controlled with the
+In the @emph{Essay on automated music engraving}, it was explained
+that stem directions influence spacing (see @ressay{Optical
+spacing}).  This is controlled with the
 @code{stem-spacing-correction} property in the
 @rinternals{NoteSpacing}, object.  These are generated for every
 @rinternals{Voice} context.  The @code{StaffSpacing} object
-(generated in @rinternals{Staff} context) contains the same property
-for controlling the stem/bar line spacing.  The following example shows
-these corrections, once with default settings, and once with
-exaggerated corrections:
+(generated in @rinternals{Staff} context) contains the same
+property for controlling the stem/bar line spacing.  The following
+example shows these corrections, once with default settings, and
+once with exaggerated corrections:
 
 @lilypond[quote,ragged-right]
 {
@@ -2715,8 +2702,7 @@ there is no blank space at the bottom of the page.
 
 @example
 \paper @{
-  between-system-padding = #0.1
-  between-system-space = #0.1
+  between-system-spacing = #'((padding . 0) (space . 0.1))
   ragged-last-bottom = ##f
   ragged-bottom = ##f
 @}