]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/spacing.itely
Merge branch 'lilypond/translation'
[lilypond.git] / Documentation / notation / spacing.itely
index e4ed57b75a7356712d6118cb74fa94dd86eb2eec..e235c50a4ea6935d1e13e1cb4c6c00a0971ee412 100644 (file)
@@ -8,7 +8,7 @@
     Guide, node Updating translation committishes..
 @end ignore
 
-@c \version "2.12.0"
+@c \version "2.13.36"
 
 @ignore
 GDP TODO list
@@ -37,11 +37,11 @@ distance between
 staff lines accordingly."
 
 Actually I found, that the @internalsref{StaffSymbol} at line 481
-sends to an uncomplete
-documentation. The property staff-space is not explained here. I
+sends to an incomplete
+documentation.  The property staff-space is not explained here.  I
 thought Y-extent might be of
 help, but it is in turn explained by x-space which again is
-missing from the list. Who has the
+missing from the list.  Who has the
 knowledge to fix this?
 
 
@@ -173,6 +173,8 @@ Snippets:
 @node Page formatting
 @subsection Page formatting
 
+@funindex \paper
+
 Margins, headers, and footers and other layout variables are
 automatically set according to the paper size.
 
@@ -194,129 +196,202 @@ may be altered.
 @node Vertical dimensions
 @unnumberedsubsubsec Vertical dimensions
 
-These variables are used to set different vertical dimensions on a
-page:
 
-@funindex \paper
+@subsubheading Fixed vertical dimensions
 
 @table @code
+@item paper-height
+@funindex paper-height
+
+The height of the page.  Default: the height of the current paper
+size.  For details, see @ref{Paper size}.
+
+@item top-margin
+@funindex top-margin
+
+The margin between the top of the page and the top of the
+printable area.  Default: @code{5\mm}.
+
+@item bottom-margin
+@funindex bottom-margin
+
+The margin between the bottom of the printable area and the bottom
+of the page.  Default: @code{6\mm}.
+
+@end table
+
+
+@subsubheading Flexible vertical dimensions
+
+In most cases, it is preferable for the vertical distances between
+certain items (such as margins, titles, systems, and separate
+scores) to be flexible, so that they stretch and compress nicely
+according to each situation.  A number of @code{\paper} variables
+(listed below) are available to fine-tune the stretching behavior
+of these dimensions.
+
+Each of these variables is an associative list containing four
+@emph{keys}:
+
+@itemize
+@item @code{padding} -- the minimum required amount of
+unobstructed vertical whitespace between two items.  This can be
+thought of as the minimum height of an unobstructed (invisible)
+rectangle that extends from the leftmost to the rightmost point of
+the combined items.
+
+@item @code{space} -- the default vertical distance between the
+@emph{reference points} of the two items, when no collisions would
+result, and no stretching or compressing is in effect.  The
+reference point of a title or markup is its highest point, and the
+reference point of a system is the middle line of the nearest
+staff.  Values for @code{space} that are less than either
+@code{padding} or @code{minimum-distance} are not meaningful,
+since the resulting space will never be less than either
+@code{padding} or @code{minimum-distance}.
+
+@item @code{minimum-distance} -- the minimum required vertical
+distance between the reference points of the two items, when
+compressing is in effect.  Values for @code{minimum-distance} that
+are less than @code{padding} are not meaningful, since the
+resulting space will never be less than @code{padding.}
+
+@item @code{stretchability} -- the stretchable space's propensity
+to stretch.  If zero, the space will not stretch (unless
+collisions would result).  When positive, the significance of a
+particular dimension's @code{stretchability} value lies only in
+its relation to the @code{stretchability} values of the other
+dimensions.  For example, if one dimension has twice the
+@code{stretchability} of another, it will stretch twice as easily.
+Values should be non-negative and finite.  The value @code{+inf.0}
+triggers a @code{programming_error} and is ignored, but
+@code{1.0e7} can be used for an almost infinitely stretchable
+spring.  If unset, the default value is set to @code{space}.  Note
+that the stretchable space's propensity to @emph{compress} cannot
+be directly set by the user and is equal to
+(@code{space}@tie{}@minus{}@tie{}@code{minimum-distance}).
 
-@item after-title-spacing
-@funindex after-title-spacing
-
-Specifies how to calculate the space between a title (or top-level markup)
-and the system that follows it.  This is an associative list with five
-components:
-@itemize @bullet
-@item @var{space} -- the amount of stretchable space between the baseline
-of a title and the center of the staff that follows it;
-@item @var{padding} -- the minimum amount of whitespace that must be
-present between a title and the staff that follows it;
-@item @var{stretchability} -- the ease with which the stretchable
-space increases when a page is stretched.
-If this is zero, the distance to the next staff will not stretch at all;
-@item @var{minimum-distance} -- the minimum distance to place between
-the baseline of a title and the center of the staff that follows it. This differs
-from @var{padding} in that the height of a staff has no effect on
-the application of @var{minimum-distance} (whereas the height of a
-staff is crucial for @var{padding}).
 @end itemize
 
-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
-@item @var{space},
-@item @var{minimum-distance}, and
-@item @var{padding} plus the smallest distance necessary to eliminate overlap.
+If a page has a ragged bottom, the resulting distance is the
+largest of:
+
+@itemize
+@item @code{space},
+@item @code{minimum-distance}, and
+@item @code{padding} plus the smallest distance necessary to
+eliminate collisions.
 @end itemize
 
-@item before-title-spacing
-@funindex before-title-spacing
+A single key for a flexible vertical dimension variable can be set
+like this:
 
-Specifies the spacing between a system and the title (or top-level markup) that
-follows it.
-The distances are measured from the center of the last staff in the system to
-the baseline of the title that follows it.  See @var{after-title-spacing}.
+@example
+\paper @{
+  markup-system-spacing #'space = #5
+@}
+@end example
 
-@item between-scores-system-spacing
-@funindex between-scores-system-spacing
+Multiple keys for a single variable can be set simultaneously like
+this:
 
-Specifies the spacing between two systems if they are in different scores, but
-there is no title between them. See @var{after-title-spacing}.
+@example
+\paper @{
+  last-bottom-spacing =
+    #'((padding . 1)
+       (space . 1)
+       (minimum-distance . 0)
+       (stretchability . 5))
+@}
+@end example
 
-@item between-system-spacing
-@funindex between-system-spacing
+The names of the flexible vertical dimension variables follow the
+format @code{@var{upper}-@var{lower}-spacing}, where
+@code{@var{upper}} and @code{@var{lower}} are the items to be
+spaced.  Each distance is measured between the reference points of
+the two items: the reference point of a title or markup is its
+highest point, and the reference point of a system is the middle
+line of the nearest staff.  Note that in these variable names, the
+term @q{@code{markup}} refers to both @i{title markups}
+(@code{bookTitleMarkup} or @code{scoreTitleMarkup}) and
+@i{top-level markups} (see @ref{File structure}).
 
-Specifies the spacing between the center of the bottom staff of one system
-and the center of the top staff of the following system.  See @var{after-title-spacing}.
+The flexible vertical dimension variables are:
 
-@item between-title-spacing
-@funindex between-title-spacing
 
-Specifies the spacing between two titles (or top-level markups).
-The distances are measured from the baseline of the first title to the baseline
-of the second.  See @var{after-title-spacing}.
+@table @code
 
-@item bottom-margin
-@funindex bottom-margin
+@item markup-system-spacing
+@funindex markup-system-spacing
 
-The margin between footer and bottom of the page.  Default:
-@code{6\mm}.
+the distance between a (title or top-level) markup and the system
+that follows it.
 
-@item bottom-system-spacing
-@funindex bottom-system-spacing
+@item score-markup-spacing
+@funindex score-markup-spacing
 
-Specifies the spacing from the center of the last staff (or the
-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}.
+the distance between the last system of a score and the (title or
+top-level) markup that follows it.
 
-@item top-title-spacing
-@funindex top-title-spacing
+@item score-system-spacing
+@funindex score-system-spacing
 
-Specifies the spacing from the top of the printable area (ie.
-the bottom of the top margin) to the baseline of the title.
-See @var{after-title-spacing}.
+the distance between the last system of a score and the first
+system of the score that follows it, when no (title or top-level)
+markup exists between them.
 
-@item top-system-spacing
-@funindex top-system-spacing
+@item system-system-spacing
+@funindex system-system-spacing
 
-Specifies the spacing from the top of the printable area (ie.
-the bottom of the top margin) to the center of the first staff.
-This only takes effect if there is no title at the top of the
-page (in which case @var{top-title-spacing} is used instead).
-See @var{after-title-spacing}.
+the distance between two systems in the same score.
 
-@item paper-height
-@funindex paper-height
+@item markup-markup-spacing
+@funindex markup-markup-spacing
 
-The height of the page.  Default: the height of the current paper
-size.  For details, see @ref{Paper size}.
+the distance between two (title or top-level) markups.
 
-@item top-margin
-@funindex top-margin
+@item last-bottom-spacing
+@funindex last-bottom-spacing
+
+the distance from the last system or top-level markup on a page to
+the bottom of the printable area (i.e. the top of the bottom
+margin).
+
+@item top-system-spacing
+@funindex top-system-spacing
+
+the distance from the top of the printable area (i.e. the bottom
+of the top margin) to the first system on a page, when there is no
+(title or top-level) markup between the two.
 
-The margin between header and top of the page.  Default:
-@code{5\mm}.
+@item top-markup-spacing
+@funindex top-markup-spacing
+
+the distance from the top of the printable area (i.e. the bottom
+of the top margin) to the first (title or top-level) markup on a
+page, when there is no system between the two.
 
 @end table
 
 
 @snippets
 
-The header and footer are created by the functions make-footer and
-make-header, defined in \paper.  The default implementations are in
-ly/paper-defaults.ly and ly/titling-init.ly.
+The header and footer are created by the functions
+@code{make-footer} and @code{make-header}, defined in
+@code{\paper}.  The default implementations are in
+@file{ly/paper-defaults.ly} and @file{ly/titling-init.ly}.
 
-The page layout itself is done by two functions in the \paper block,
-page-music-height and page-make-stencil.  The former tells the
-line-breaking algorithm how much space can be spent on a page, the
-latter creates the actual page given the system to put on it.
+The page layout itself is done by two functions in the
+@code{\paper} block, @code{page-music-height} and
+@code{page-make-stencil}.  The former tells the line-breaking
+algorithm how much space can be spent on a page, the latter
+creates the actual page given the system to put on it.
 
-You can define paper block values in Scheme.  In that case mm, in, pt,
-and cm are variables defined in paper-defaults.ly with values in
-millimeters.  That is why the value 2 cm must be multiplied in the
-example
+You can define @code{\paper} block values in Scheme.  In that case
+@code{mm}, @code{in}, @code{pt}, and @code{cm} are variables
+defined in @file{paper-defaults.ly} with values in millimeters.
+That is why the value @w{@code{2 cm}} must be multiplied in the
+example:
 
 @example
 \paper @{
@@ -353,29 +428,6 @@ This second example centers page numbers at the bottom of every page.
 @}
 @end example
 
-You can also define these values in Scheme.  In that case @code{mm},
-@code{in}, @code{pt}, and @code{cm} are variables defined in
-@file{paper@/-defaults@/-init@/.ly} with values in millimeters.  That is why the
-value must be multiplied in the example
-
-@example
-\paper @{
-  #(define bottom-margin (* 2 cm))
-@}
-@end example
-
-The header and footer are created by the functions @code{make-footer}
-and @code{make-header}, defined in @code{\paper}.  The default
-implementations are in @file{ly/@/paper@/-defaults@/-init@/.ly} and
-@file{ly/@/titling@/-init@/.ly}.
-
-The page layout itself is done by two functions in the
-@code{\paper} block, @code{page-music-height} and
-@code{page-make-stencil}.  The former tells the line-breaking algorithm
-how much space can be spent on a page, the latter creates the actual
-page given the system to put on it.
-
-
 @seealso
 Notation Reference:
 @ref{Vertical spacing between systems}.
@@ -459,7 +511,7 @@ first system.  Default: @code{0}.
 
 @end table
 
-If some values are not set, defaults will be taken. Their exact
+If some values are not set, defaults will be taken.  Their exact
 value is adjusted, depending on the paper size specified.  Currently,
 the following values are affected by this scaling:
 
@@ -580,7 +632,7 @@ never consider blank pages in the middle of a score.  Default:
 @funindex check-consistency
 
 If set to true, check whether @code{left-margin}, @code{right-margin} and
-@code{line-width} fit each other. Also make sure that their combination
+@code{line-width} fit each other.  Also make sure that their combination
 does not exceed the available @code{paper-width}.  Default: @code{##t}.
 
 @item first-page-number
@@ -590,23 +642,28 @@ The value of the page number on the first page.  Default:
 @code{#1}.
 
 @item max-systems-per-page
-The maximum number of systems that will be placed on a page. This
+@funindex max-systems-per-page
+
+The maximum number of systems that will be placed on a page.  This
 is currently supported only by the @code{ly:optimal-breaking} algorithm.
 Default: unset.
 
 @item min-systems-per-page
-The minimum number of systems that will be placed on a page. This
-may cause pages to be overfilled if it is made too large. This is
+@funindex min-systems-per-page
+
+The minimum number of systems that will be placed on a page.  This
+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-system-system-spacing
+@funindex page-breaking-system-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{system-system-spacing} is set to something different than
+it really is.  For example, if
+@code{page-breaking-system-system-spacing #'padding} is set to something
+substantially larger than @code{system-system-spacing #'padding}, then the
 page-breaker will put fewer systems on each page.  Default: unset.
 
 @item page-count
@@ -922,11 +979,11 @@ Snippets:
 @cindex line breaks
 @cindex breaking lines
 
-Line breaks are normally determined automatically. They are chosen
+Line breaks are normally determined automatically.  They are chosen
 so that lines look neither cramped nor loose, and consecutive
 lines have similar density.  Occasionally you might want to
 override the automatic breaks; you can do this by specifying
-@code{\break}. This will force a line break at this point.  However,
+@code{\break}.  This will force a line break at this point.  However,
 line breaks can only occur at the end of @q{complete} bars, i.e.,
 where there are no notes or tuplets left @q{hanging} over the bar
 line.  If you want to have a line break where there is no bar line,
@@ -938,13 +995,13 @@ The opposite command, @code{\noBreak}, forbids a line break at the
 bar line where it is inserted.
 
 The most basic settings influencing line spacing are @code{indent}
-and @code{line-width}. They are set in the @code{\layout} block.
+and @code{line-width}.  They are set in the @code{\layout} block.
 They control the indentation of the first line of music, and the
 lengths of the lines.
 
 If @code{ragged-right} is set to true in the @code{\layout} block,
 then systems end at their natural horizontal length, instead of
-being spread horizontally to fill the whole line. This is useful
+being spread horizontally to fill the whole line.  This is useful
 for short fragments, and for checking how tight the natural
 spacing is.
 
@@ -1082,7 +1139,7 @@ book parts.
   @}
   \paper @{
      %% In a part consisting mostly of text,
-     %% ly:minimal-breaking may be prefered
+     %% ly:minimal-breaking may be preferred
      #(define page-breaking ly:minimal-breaking)
   @}
   \markup @{ @dots{} @}
@@ -1263,19 +1320,21 @@ page breaks at explicit @code{\pageBreak} commands and nowhere else.
 }
 
 \score {
-  \new Score \with {
-    \override NonMusicalPaperColumn #'line-break-permission = ##f
-    \override NonMusicalPaperColumn #'page-break-permission = ##f
-  } {
-    \new Staff {
-      \repeat unfold 2 { c'8 c'8 c'8 c'8 } \break
-      \repeat unfold 4 { c'8 c'8 c'8 c'8 } \break
-      \repeat unfold 6 { c'8 c'8 c'8 c'8 } \break
-      \repeat unfold 8 { c'8 c'8 c'8 c'8 } \pageBreak
-      \repeat unfold 8 { c'8 c'8 c'8 c'8 } \break
-      \repeat unfold 6 { c'8 c'8 c'8 c'8 } \break
-      \repeat unfold 4 { c'8 c'8 c'8 c'8 } \break
-      \repeat unfold 2 { c'8 c'8 c'8 c'8 }
+  \new Staff {
+    \repeat unfold 2 { c'8 c'8 c'8 c'8 } \break
+    \repeat unfold 4 { c'8 c'8 c'8 c'8 } \break
+    \repeat unfold 6 { c'8 c'8 c'8 c'8 } \break
+    \repeat unfold 8 { c'8 c'8 c'8 c'8 } \pageBreak
+    \repeat unfold 8 { c'8 c'8 c'8 c'8 } \break
+    \repeat unfold 6 { c'8 c'8 c'8 c'8 } \break
+    \repeat unfold 4 { c'8 c'8 c'8 c'8 } \break
+    \repeat unfold 2 { c'8 c'8 c'8 c'8 }
+    }
+  \layout {
+    \context {
+      \Score
+      \override NonMusicalPaperColumn #'line-break-permission = ##f
+      \override NonMusicalPaperColumn #'page-break-permission = ##f
     }
   }
 }
@@ -1293,7 +1352,7 @@ Snippets:
 Line- and page-breaking information usually appears within note entry directly.
 
 @example
-\new Score @{
+\score @{
   \new Staff @{
     \repeat unfold 2 @{ c'4 c'4 c'4 c'4 @}
     \break
@@ -1311,20 +1370,20 @@ contains only skips together with @code{\break}, @code{pageBreak} and other
 breaking layout information.
 
 @lilypond[quote,verbatim]
-\new Score {
+\score {
   \new Staff <<
-     \new Voice {
-        s1 * 2 \break
-        s1 * 3 \break
-        s1 * 6 \break
-        s1 * 5 \break
-     }
-     \new Voice {
-        \repeat unfold 2 { c'4 c'4 c'4 c'4 }
-        \repeat unfold 3 { c'4 c'4 c'4 c'4 }
-        \repeat unfold 6 { c'4 c'4 c'4 c'4 }
-        \repeat unfold 5 { c'4 c'4 c'4 c'4 }
-     }
+    \new Voice {
+      s1 * 2 \break
+      s1 * 3 \break
+      s1 * 6 \break
+      s1 * 5 \break
+    }
+    \new Voice {
+      \repeat unfold 2 { c'4 c'4 c'4 c'4 }
+      \repeat unfold 3 { c'4 c'4 c'4 c'4 }
+      \repeat unfold 6 { c'4 c'4 c'4 c'4 }
+      \repeat unfold 5 { c'4 c'4 c'4 c'4 }
+    }
   >>
 }
 @end lilypond
@@ -1334,32 +1393,31 @@ This pattern becomes especially helpful when overriding
 @code{NonMusicalPaperColumnGrob}, as explained in @ref{Vertical spacing}.
 
 @lilypond[quote,verbatim]
-\new Score {
+\score {
   \new Staff <<
-     \new Voice {
-
-        \overrideProperty "Score.NonMusicalPaperColumn"
+    \new Voice {
+      \overrideProperty "Score.NonMusicalPaperColumn"
         #'line-break-system-details #'((Y-offset . 0))
-        s1 * 2 \break
+      s1 * 2 \break
 
-        \overrideProperty "Score.NonMusicalPaperColumn"
+      \overrideProperty "Score.NonMusicalPaperColumn"
         #'line-break-system-details #'((Y-offset . 35))
-        s1 * 3 \break
+      s1 * 3 \break
 
-        \overrideProperty "Score.NonMusicalPaperColumn"
+      \overrideProperty "Score.NonMusicalPaperColumn"
         #'line-break-system-details #'((Y-offset . 70))
-        s1 * 6 \break
+      s1 * 6 \break
 
-        \overrideProperty "Score.NonMusicalPaperColumn"
+      \overrideProperty "Score.NonMusicalPaperColumn"
         #'line-break-system-details #'((Y-offset . 105))
-        s1 * 5 \break
-     }
-     \new Voice {
-        \repeat unfold 2 { c'4 c'4 c'4 c'4 }
-        \repeat unfold 3 { c'4 c'4 c'4 c'4 }
-        \repeat unfold 6 { c'4 c'4 c'4 c'4 }
-        \repeat unfold 5 { c'4 c'4 c'4 c'4 }
-     }
+      s1 * 5 \break
+    }
+    \new Voice {
+      \repeat unfold 2 { c'4 c'4 c'4 c'4 }
+      \repeat unfold 3 { c'4 c'4 c'4 c'4 }
+      \repeat unfold 6 { c'4 c'4 c'4 c'4 }
+      \repeat unfold 5 { c'4 c'4 c'4 c'4 }
+    }
   >>
 }
 @end lilypond
@@ -1551,7 +1609,7 @@ to which it does not belong.
 \layout {
   \context {
     \Lyrics
-    % By default, Lyrics are placed close together. Here, we allow them to
+    % By default, Lyrics are placed close together.  Here, we allow them to
     % be stretched more widely.
     \override VerticalAxisGroup
       #'inter-loose-line-spacing #'stretchability = #1000
@@ -1615,12 +1673,12 @@ 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
+variables are @var{system-system-spacing},
+@var{score-system-spacing}, @var{markup-system-spacing},
+@var{score-markup-spacing}, @var{markup-markup-spacing},
+@var{top-system-spacing}, @var{top-markup-spacing} and
+@var{last-bottom-spacing}.  Note that these variables ignore non-staff
+lines.  For example, @var{system-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.
@@ -1630,7 +1688,7 @@ 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}
+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
@@ -1930,7 +1988,7 @@ c^"This text is placed close to the previous text"
 By default, outside-staff objects are placed only to avoid
 a horizontal collision with previously-positioned grobs.  This
 can lead to situations in which objects are placed very close to each
-other horizontally.  The vertical spacing between staffs can
+other horizontally.  The vertical spacing between staves can
 also be set so that outside staff objects are interleaved.
 Setting @code{outside-staff-horizontal-padding}
 causes an object to be offset vertically so that such a situation
@@ -2048,11 +2106,11 @@ once with exaggerated corrections:
 @lilypond[quote,ragged-right]
 {
   c'4 e''4 e'4 b'4 |
-  b'4 e''4 b'4 e''4|
+  b'4 e''4 b'4 e''4 |
   \override Staff.NoteSpacing #'stem-spacing-correction = #1.5
   \override Staff.StaffSpacing #'stem-spacing-correction = #1.5
   c'4 e''4 e'4 b'4 |
-  b'4 e''4 b'4 e''4|
+  b'4 e''4 b'4 e''4 |
 }
 @end lilypond
 
@@ -2149,7 +2207,7 @@ than @code{1 16}.
     \context {
       \Score
       \override SpacingSpanner
-                #'base-shortest-duration = #(ly:make-moment 1 16)
+        #'base-shortest-duration = #(ly:make-moment 1 16)
     }
   }
 }
@@ -2164,23 +2222,29 @@ such symbols and force uniform equal-duration spacing, use
 @code{Score.SpacingSpanner #'uniform-stretching}.  This
 property can only be changed at the beginning of a score,
 
-@lilypond[quote,ragged-right,relative=2,fragment,verbatim]
-\new Score \with {
-  \override SpacingSpanner #'uniform-stretching = ##t
-} <<
-  \new Staff{
-    \times 4/5 {
-      c8 c8 c8 c8 c8
+@lilypond[quote,ragged-right,verbatim]
+\score {
+  <<
+    \new Staff {
+      \times 4/5 {
+        c8 c8 c8 c8 c8
+      }
+      c8 c8 c8 c8
     }
-    c8 c8 c8 c8
-  }
-  \new Staff{
-    c8 c8 c8 c8
-    \times 4/5 {
-      c8 c8 c8 c8 c8
+    \new Staff {
+      c8 c8 c8 c8
+      \times 4/5 {
+        c8 c8 c8 c8 c8
+      }
+    }
+  >>
+  \layout {
+    \context {
+      \Score
+      \override SpacingSpanner #'uniform-stretching = ##t
     }
   }
->>
+}
 @end lilypond
 
 When @code{strict-note-spacing} is set, notes are spaced without
@@ -2280,15 +2344,17 @@ We start with the following one-measure example, which uses classical
 spacing with ragged-right turned on.
 
 @lilypond[quote,verbatim,ragged-right]
-\new Score <<
-  \new RhythmicStaff {
-    c'2
-    c'16 c'16 c'16 c'16
-    \times 4/5 {
-      c'16 c'16 c'16 c'16 c'16
+\score {
+  <<
+    \new RhythmicStaff {
+      c'2
+      c'16 c'16 c'16 c'16
+      \times 4/5 {
+        c'16 c'16 c'16 c'16 c'16
+      }
     }
-  }
->>
+  >>
+}
 @end lilypond
 
 Notice that the half note which begins the measure takes up far less
@@ -2307,17 +2373,23 @@ turn proportional notation on with the proportionalNotationDuration
 setting.
 
 @lilypond[quote,verbatim,ragged-right]
-\new Score \with {
-  proportionalNotationDuration = #(ly:make-moment 1 20)
-} <<
-  \new RhythmicStaff {
-    c'2
-    c'16 c'16 c'16 c'16
-    \times 4/5 {
-      c'16 c'16 c'16 c'16 c'16
+\score {
+  <<
+    \new RhythmicStaff {
+      c'2
+      c'16 c'16 c'16 c'16
+      \times 4/5 {
+        c'16 c'16 c'16 c'16 c'16
+      }
+    }
+  >>
+ \layout {
+    \context {
+      \Score
+      proportionalNotationDuration = #(ly:make-moment 1 20)
     }
   }
->>
+}
 @end lilypond
 
 The half note at the beginning of the measure and the faster notes in
@@ -2325,72 +2397,90 @@ the second half of the measure now occupy equal amounts of horizontal
 space.  We could place a measured timeline or graphic above or below
 this example.
 
-The @code{proportionalNotationDuration} setting is a context setting that
-lives in @code{Score}.  Recall that context settings appear in one of
-three locations in our input file -- in a @code{\with} block, in a
-@code{\context} block, or directly in music entry
-preceded by the @code{\set} command.  As with all
-context settings, users can pick which of the three different
-locations they would like to set @code{proportionalNotationDuration}.
+The @code{proportionalNotationDuration} setting is a context setting
+that lives in @code{Score}.  Remember that context settings can appear
+in one of three locations within our input file -- in a @code{\with}
+block, in a @code{\context} block, or directly in music entry preceded
+by the @code{\set} command.  As with all context settings, users can
+pick which of the three different locations they would like to
+set @code{proportionalNotationDuration} in to.
 
 The @code{proportionalNotationDuration} setting takes a single argument,
-which is the reference duration against which all music will be
-spaced.  The LilyPond Scheme function make-moment takes two arguments
+which is the reference duration against that all music will be spaced.
+The LilyPond Scheme function @code{make-moment} takes two arguments
 -- a numerator and denominator which together express some fraction of
-a whole note.  The call @code{#(ly:make-moment 1 20)} therefore produces a
-reference duration of a twentieth note.  The values
+a whole note.  The call @code{#(ly:make-moment 1 20)} therefore produces
+a reference duration of a twentieth note.  Values such as
 @code{#(ly:make-moment 1 16)}, @code{#(ly:make-moment 1 8)}, and
 @code{#(ly:make-moment 3 97)} are all possible as well.
 
 How do we select the right reference duration to pass to
-@code{proportionalNotationDuration}?  Usually by a process of trial and error,
-beginning with a duration close to the fastest (or smallest) duration
-in the piece.  Smaller reference durations space music loosely; larger
-reference durations space music tightly.
+@code{proportionalNotationDuration}?  Usually by a process of trial
+and error, beginning with a duration close to the fastest (or smallest)
+duration in the piece.  Smaller reference durations space music loosely;
+larger reference durations space music tightly.
 
 @lilypond[quote,verbatim,ragged-right]
-\new Score \with {
-  proportionalNotationDuration = #(ly:make-moment 1 8)
-} <<
-  \new RhythmicStaff {
-    c'2
-    c'16 c'16 c'16 c'16
-    \times 4/5 {
-      c'16 c'16 c'16 c'16 c'16
+\score {
+  <<
+    \new RhythmicStaff {
+      c'2
+      c'16 c'16 c'16 c'16
+      \times 4/5 {
+        c'16 c'16 c'16 c'16 c'16
+      }
+    }
+  >>
+  \layout {
+    \context {
+      \Score
+      proportionalNotationDuration = #(ly:make-moment 1 8)
     }
   }
->>
+}
 
-\new Score \with {
-  proportionalNotationDuration = #(ly:make-moment 1 16)
-} <<
-  \new RhythmicStaff {
-    c'2
-    c'16 c'16 c'16 c'16
-    \times 4/5 {
-      c'16 c'16 c'16 c'16 c'16
+\score {
+  <<
+    \new RhythmicStaff {
+      c'2
+      c'16 c'16 c'16 c'16
+      \times 4/5 {
+        c'16 c'16 c'16 c'16 c'16
+      }
+    }
+  >>
+  \layout {
+    \context {
+      \Score
+      proportionalNotationDuration = #(ly:make-moment 1 16)
     }
   }
->>
+}
 
-\new Score \with {
-  proportionalNotationDuration = #(ly:make-moment 1 32)
-} <<
-  \new RhythmicStaff {
-    c'2
-    c'16 c'16 c'16 c'16
-    \times 4/5 {
-      c'16 c'16 c'16 c'16 c'16
+\score {
+  <<
+    \new RhythmicStaff {
+      c'2
+      c'16 c'16 c'16 c'16
+      \times 4/5 {
+        c'16 c'16 c'16 c'16 c'16
+      }
+    }
+  >>
+  \layout {
+    \context {
+      \Score
+      proportionalNotationDuration = #(ly:make-moment 1 32)
     }
   }
->>
+}
 @end lilypond
 
 Note that too large a reference duration -- such as the eighth note,
 above -- spaces music too tightly and can cause note head collisions.
-Note also that proportional notation in general takes up more
-horizontal space that does classical spacing.  Proportional spacing
-provides rhythmic clarity at the expense of horizontal space.
+Also that proportional notation in general takes up more horizontal
+space than classical spacing.  Proportional spacing provides rhythmic
+clarity at the expense of horizontal space.
 
 Next we examine how to optimally space overlapping tuplets.
 
@@ -2399,71 +2489,84 @@ classical spacing, when we add a second staff with a different type of
 tuplet.
 
 @lilypond[quote,verbatim,ragged-right]
-\new Score <<
-  \new RhythmicStaff {
-    c'2
-    c'16 c'16 c'16 c'16
-    \times 4/5 {
-      c'16 c'16 c'16 c'16 c'16
+\score {
+  <<
+    \new RhythmicStaff {
+      c'2
+      c'16 c'16 c'16 c'16
+      \times 4/5 {
+        c'16 c'16 c'16 c'16 c'16
+      }
     }
-  }
-  \new RhythmicStaff {
-    \times 8/9 {
-      c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8
+    \new RhythmicStaff {
+      \times 8/9 {
+        c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8
+      }
     }
-  }
->>
+  >>
+}
 @end lilypond
 
-The spacing is bad because the evenly notes of the bottom staff do not
-stretch uniformly.  Classical engraving includes very few complex
+The spacing is bad because the evenly spaced notes of the bottom staff
+do not stretch uniformly.  Classical engravings include very few complex
 triplets and so classical engraving rules can generate this type of
-result.  Setting @code{proportionalNotationDuration} remedies this
-situation considerably.
+result.  Setting @code{proportionalNotationDuration} fixes this.
 
 @lilypond[quote,verbatim,ragged-right]
-\new Score \with {
-  proportionalNotationDuration = #(ly:make-moment 1 20)
-} <<
-  \new RhythmicStaff {
-    c'2
-    c'16 c'16 c'16 c'16
-    \times 4/5 {
-      c'16 c'16 c'16 c'16 c'16
+\score {
+  <<
+    \new RhythmicStaff {
+      c'2
+      c'16 c'16 c'16 c'16
+      \times 4/5 {
+        c'16 c'16 c'16 c'16 c'16
+      }
     }
-  }
-  \new RhythmicStaff {
-    \times 8/9 {
-      c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8
+    \new RhythmicStaff {
+      \times 8/9 {
+        c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8
+      }
+    }
+  >>
+  \layout {
+    \context {
+      \Score
+      proportionalNotationDuration = #(ly:make-moment 1 20)
     }
   }
->>
+}
 @end lilypond
 
 But if we look very carefully we can see that notes of the second half
-of the 9-tuplet space ever so slightly more widely than do the notes
+of the 9-tuplet space ever so slightly more widely than the notes
 of the first half of the 9-tuplet.  To ensure uniform stretching, we
 turn on @code{uniform-stretching}, which is a property of
 @code{SpacingSpanner}.
 
 @lilypond[quote,verbatim,ragged-right]
-\new Score \with {
-  proportionalNotationDuration = #(ly:make-moment 1 20)
-  \override SpacingSpanner #'uniform-stretching = ##t
-} <<
-  \new RhythmicStaff {
-    c'2
-    c'16 c'16 c'16 c'16
-    \times 4/5 {
-      c'16 c'16 c'16 c'16 c'16
+\score {
+  <<
+    \new RhythmicStaff {
+      c'2
+      c'16 c'16 c'16 c'16
+      \times 4/5 {
+        c'16 c'16 c'16 c'16 c'16
+      }
     }
-  }
-  \new RhythmicStaff {
-    \times 8/9 {
-      c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8
+    \new RhythmicStaff {
+      \times 8/9 {
+        c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8
+      }
+    }
+  >>
+  \layout {
+    \context {
+      \Score
+      proportionalNotationDuration = #(ly:make-moment 1 20)
+      \override SpacingSpanner #'uniform-stretching = ##t
     }
   }
->>
+}
 @end lilypond
 
 Our two-staff example now spaces exactly, our rhythmic
@@ -2472,14 +2575,14 @@ timeline or graphic if we want.
 
 Note that the LilyPond's proportional notation package expects
 that all proportional scores set the SpacingSpanner's
-'uniform-stretching attribute to ##t. Setting
+'uniform-stretching attribute to ##t.  Setting
 proportionalNotationDuration without also setting the
 SpacingSpanner's 'uniform-stretching attribute to ##t will, for
 example, cause Skips to consume an incorrect amount of horizontal
 space.
 
 The SpacingSpanner is an abstract grob that lives in the Score
-context. As with our settings of proportionalNotationDuration,
+context.  As with our settings of proportionalNotationDuration,
 overrides to the SpacingSpanner can occur in any of three
 different places in our input file – in the Score \with block, in
 a Score \context block, or in note entry directly.
@@ -2570,14 +2673,14 @@ property of @code{SpacingSpanner}.  Compare the two scores below:
 @end lilypond
 
 Both scores are proportional, but the spacing in the first score
-is too loose because of the clef change. The spacing of the second
+is too loose because of the clef change.  The spacing of the second
 score remains strict, however, because strict-note-spacing is
 turned on.  Turning on strict-note-spacing causes the width of
 time signatures, key signatures, clefs and accidentals to play no
 part in the spacing algorithm.
 
 In addition to the settings given here, there are other settings
-that frequently appear in proportional scores. These include:
+that frequently appear in proportional scores.  These include:
 
 @itemize
 @item @code{\override SpacingSpanner #'strict-grace-spacing = ##t}
@@ -2646,7 +2749,7 @@ All layout dimensions are displayed in staff-spaces, regardless
 of the units specified in the @code{\paper} or @code{\layout} block.
 In the above example, @code{paper-height} has a value of 59.75
 @code{staff-spaces}, and the @code{staff-size} is 20 points (the
-default value). Note that:
+default value).  Note that:
 
 @multitable {1 staff-space} {staff-size)/4 * (25.4/72.27) mm}
 
@@ -2662,7 +2765,7 @@ default value). Note that:
 
 @noindent
 In this case, one @code{staff-space} is approximately equal to
-1.757mm. Thus the @code{paper-height} measurement of 59.75
+1.757mm.  Thus the @code{paper-height} measurement of 59.75
 @code{staff-spaces} is equivalent to 105 millimeters, the height
 of @code{a6} paper in landscape orientation.  The pairs
 (@var{a},@var{b}) are intervals, where @var{a} is the lower
@@ -2694,7 +2797,7 @@ there is no blank space at the bottom of the page.
 
 @example
 \paper @{
-  between-system-spacing = #'((padding . 0) (space . 0.1))
+  system-system-spacing = #'((padding . 0) (space . 0.1))
   ragged-last-bottom = ##f
   ragged-bottom = ##f
 @}
@@ -2706,7 +2809,7 @@ 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
+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.
 
@@ -2726,8 +2829,7 @@ a system can be moved closer to the staff:
 
 @lilypond[verbatim,quote,relative=1]
 e4 c g\f c
-\override DynamicText #'extra-offset = #'( -2.2 . 2.0)
-e4 c g\f c
+e4 c g-\tweak #'X-offset #-2.7 -\tweak #'Y-offset #2.5 \f c
 @end lilypond
 
 @item