From 6cc7758079b738d9b8279a8e763d66ba48c1f5cc Mon Sep 17 00:00:00 2001 From: Mark Polesky Date: Sat, 4 Dec 2010 14:12:36 -0800 Subject: [PATCH] Doc: NR 4: Clean up examples. --- Documentation/notation/spacing.itely | 95 ++++++++++++++++------------ 1 file changed, 53 insertions(+), 42 deletions(-) diff --git a/Documentation/notation/spacing.itely b/Documentation/notation/spacing.itely index af03cc74a3..6c8cd40898 100644 --- a/Documentation/notation/spacing.itely +++ b/Documentation/notation/spacing.itely @@ -1015,14 +1015,14 @@ Here is an example @code{\layout} block: @example \layout @{ - indent = 2.0\cm + indent = 2\cm \context @{ \StaffGroup \override StaffGrouper #'staff-staff-spacing #space = #8 @} \context @{ \Voice - \override TextScript #'padding = #1.0 + \override TextScript #'padding = #1 \override Glissando #'thickness = #3 @} @} @@ -1061,9 +1061,9 @@ fonts accordingly. To set the staff size individually for each score, use @example \score@{ - ... - \layout@{ - #(layout-set-staff-size 15) + @dots{} + \layout @{ + #(layout-set-staff-size 15) @} @} @end example @@ -1198,9 +1198,9 @@ but affects only the last line of the piece. @example \layout @{ -indent = #0 -line-width = #150 -ragged-last = ##t + indent = 0\mm + line-width = 150\mm + ragged-last = ##t @} @end example @@ -1215,10 +1215,12 @@ cause the following 28 measures (assuming 4/4 time) to be broken every 4 measures, and only there: @example -<< \repeat unfold 7 @{ - s1 \noBreak s1 \noBreak - s1 \noBreak s1 \break @} - @emph{the real music} +<< + \repeat unfold 7 @{ + s1 \noBreak s1 \noBreak + s1 \noBreak s1 \break + @} + @{ @var{the actual music@dots{}} @} >> @end example @@ -1304,8 +1306,8 @@ provides three algorithms for computing page breaks, but the value can be changed in the @code{\paper} block: @example -\paper@{ - #(define page-breaking ly:page-turn-breaking) +\paper @{ + page-breaking = #ly:page-turn-breaking @} @end example @@ -1326,7 +1328,7 @@ book parts. \paper @{ %% In a part consisting mostly of text, %% ly:minimal-breaking may be preferred - #(define page-breaking ly:minimal-breaking) + page-breaking = #ly:minimal-breaking @} \markup @{ @dots{} @} @dots{} @@ -1472,7 +1474,7 @@ too slow or memory demanding, or a lot of texts. It is enabled using: @example \paper @{ - #(define page-breaking ly:minimal-breaking) + page-breaking = #ly:minimal-breaking @} @end example @@ -1505,17 +1507,19 @@ page breaks at explicit @code{\pageBreak} commands and nowhere else. ragged-bottom = ##t } +music = \relative c'' { c8 c c c } + \score { \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 } - } + \repeat unfold 2 { \music } \break + \repeat unfold 4 { \music } \break + \repeat unfold 6 { \music } \break + \repeat unfold 8 { \music } \pageBreak + \repeat unfold 8 { \music } \break + \repeat unfold 6 { \music } \break + \repeat unfold 4 { \music } \break + \repeat unfold 2 { \music } + } \layout { \context { \Score @@ -1538,11 +1542,12 @@ Snippets: Line- and page-breaking information usually appears within note entry directly. @example +music = \relative c'' @{ c4 c c c @} + \score @{ \new Staff @{ - \repeat unfold 2 @{ c'4 c'4 c'4 c'4 @} - \break - \repeat unfold 3 @{ c'4 c'4 c'4 c'4 @} + \repeat unfold 2 @{ \music @} \break + \repeat unfold 3 @{ \music @} @} @} @end example @@ -1556,6 +1561,8 @@ contains only skips together with @code{\break}, @code{pageBreak} and other breaking layout information. @lilypond[quote,verbatim] +music = \relative c'' { c4 c c c } + \score { \new Staff << \new Voice { @@ -1565,10 +1572,10 @@ breaking layout information. 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 } + \repeat unfold 2 { \music } + \repeat unfold 3 { \music } + \repeat unfold 6 { \music } + \repeat unfold 5 { \music } } >> } @@ -1579,6 +1586,8 @@ This pattern becomes especially helpful when overriding @code{NonMusicalPaperColumnGrob}, as explained in @ref{Vertical spacing}. @lilypond[quote,verbatim] +music = \relative c'' { c4 c c c } + \score { \new Staff << \new Voice { @@ -1599,10 +1608,10 @@ This pattern becomes especially helpful when overriding 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 } + \repeat unfold 2 { \music } + \repeat unfold 3 { \music } + \repeat unfold 6 { \music } + \repeat unfold 5 { \music } } >> } @@ -2211,13 +2220,15 @@ example @code{NonMusicalPaperColumn} overrides with the special #'line-break-system-details #'((Y-offset . 40)) \overrideProperty NonMusicalPaperColumn - #'line-break-system-details #'((X-offset . 20) (Y-offset . 40)) + #'line-break-system-details #'((X-offset . 20) + (Y-offset . 40)) \overrideProperty NonMusicalPaperColumn #'line-break-system-details #'((alignment-distances . (15))) \overrideProperty NonMusicalPaperColumn - #'line-break-system-details #'((X-offset . 20) (Y-offset . 40) + #'line-break-system-details #'((X-offset . 20) + (Y-offset . 40) (alignment-distances . (15))) @end example @@ -2227,7 +2238,7 @@ by looking at an example that includes no overrides at all. @c \book { } is required in these examples to ensure the spacing @c overrides can be seen between systems. -np -@lilypond[quote] +@lilypond[verbatim,quote,staffsize=16] \header { tagline = ##f } \paper { left-margin = 0\mm } \book { @@ -2260,7 +2271,7 @@ the vertical startpoint of each system explicitly, we can set the @code{Y-offset} pair in the @code{line-break-system-details} attribute of the @code{NonMusicalPaperColumn} grob: -@lilypond[quote] +@lilypond[verbatim,quote,staffsize=16] \header { tagline = ##f } \paper { left-margin = 0\mm } \book { @@ -2298,7 +2309,7 @@ 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] +@lilypond[verbatim,quote,staffsize=16] \header { tagline = ##f } \paper { left-margin = 0\mm } \book { @@ -2339,7 +2350,7 @@ additional spacing parameters (including, for example, a corresponding every system and every staff. Finally, note that @code{alignment-distances} specifies the vertical positioning of staves but not of staff groups. -@lilypond[quote] +@lilypond[verbatim,quote,staffsize=16] \header { tagline = ##f } \paper { left-margin = 0\mm } \book { -- 2.39.2