]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/spacing.itely
Issue 4422/5: Run scripts/auxiliar/update-with-convert-ly.sh
[lilypond.git] / Documentation / notation / spacing.itely
index e90d71a45f9b52460f8b6f7c875ca5bb4b70783f..db9f9ff3c1e1e6b21364dc607e91703f55b48da6 100644 (file)
@@ -8,7 +8,7 @@
     Guide, node Updating translation committishes..
 @end ignore
 
-@c \version "2.19.12"
+@c \version "2.19.22"
 
 @ignore
 GDP TODO list
@@ -634,14 +634,27 @@ Also see @code{check-consistency}.
 @item line-width
 @funindex line-width
 
-The horizontal extent of the staff lines in unindented, non-ragged
-systems, equal to
+When specified in a @code{\paper} block this defines the horizontal
+extent available for the staff lines in un-indented systems.  If left
+unspecified, the paper's @code{line-width} is determined from
 @code{(paper-width@tie{}@minus{}@tie{}left-margin@tie{}@minus{}@tie{}right-margin)}
-when unset.  If @code{line-width} is set, and both
-@code{left-margin} and @code{right-margin} are unset, then the
+If the paper's @code{line-width} is specified, and both
+@code{left-margin} and @code{right-margin} are not, then the
 margins will be updated to center the systems on the page
-automatically.  Also see @code{check-consistency}.  This variable
-can also be set in a @code{\layout} block.
+automatically.  Also see @code{check-consistency}.
+
+@code{line-width}s for individual scores can be specified in the
+scores' @code{\layout} blocks.  These values control the width of the
+lines produced on a score-by-score basis.  If @code{line-width} is not
+specified for a score, it defaults to the paper's @code{line-width}.
+Setting a score's @code{line-width} has no effect on the paper margins.
+Staff lines, of a length determined by the score's @code{line-width},
+are left-aligned within the paper area defined by the paper's
+@code{line-width}.  If the score and paper @code{line-width}s are equal,
+the staff lines will extend exactly from the left margin to the right
+margin, but if the score's @code{line-width} is greater than the
+paper's @code{line-width} the staff lines will run over into the right
+margin.
 
 @item left-margin
 @funindex left-margin
@@ -674,12 +687,12 @@ and the systems are consequently centered on the page.  Also see
 @item check-consistency
 @funindex check-consistency
 
-If set to true, print a warning if @code{left-margin},
-@code{line-width}, and @code{right-margin} do not exactly add up
-to @code{paper-width}, and replace each of these (except
-@code{paper-width}) with its default value (scaled to the paper
-size if necessary).  If set to false, ignore any inconsistencies
-and allow systems to run off the edge of the page.
+If this is true (the default value), print a warning if
+@code{left-margin}, @code{line-width}, and @code{right-margin} do not
+exactly add up to @code{paper-width}, and replace each of these
+(except @code{paper-width}) with their default values (scaled to the
+paper size if necessary).  If set to false, ignore any
+inconsistencies and allow systems to run off the edge of the page.
 
 @item ragged-right
 @funindex ragged-right
@@ -786,16 +799,21 @@ separators) are shifted to the right.  Default: @code{0.0\mm}.
 
 The level of indentation for the first system in a score.  If the
 paper size is modified, this dimension's default value is scaled
-accordingly.  This variable can also be set in a @code{\layout}
-block.
+accordingly.  The space within @code{line-width} available for
+the first system is reduced by this amount.  @code{indent} may also
+be specified in @code{\layout} blocks to set indents on a
+score-by-score basis.
 
 @item short-indent
 @funindex short-indent
 
 The level of indentation for all systems in a score besides the
 first system.  If the paper size is modified, this dimension's
-default value is scaled accordingly.  This variable can also be
-set in a @code{\layout} block.
+default value is scaled accordingly.  The space within
+@code{line-width} available for systems other than the first is
+reduced by this amount.  @code{short-indent} may also be specified in
+@code{\layout} blocks to set short indents on a score-by-score
+basis.
 
 @end table
 
@@ -991,6 +1009,14 @@ If set to true, a page number is printed on the first page.
 
 If set to false, page numbers are not printed.
 
+@cindex page numbers in roman numerals
+@item page-number-type
+@funindex page-number-type
+
+The type of numerals used for page numbers.  Choices include
+@code{roman-lower}, @code{roman-upper} and @code{arabic}.
+Default: @code{'arabic}.
+
 @end table
 
 @seealso
@@ -1041,7 +1067,7 @@ sensible default, for example:
     tagline = ##f
   }
   \score {
-    \relative c'' { c1 \break c1 \break c1 }
+    \relative { c''1 \break c1 \break c1 }
   }
 }
 @end lilypond
@@ -1096,8 +1122,10 @@ The @code{layout-set-staff-size} function is discussed in the next
 section, @ref{Setting the staff size}.  Context modifications are
 discussed in a separate chapter; see
 @ref{Modifying context plug-ins} and
-@ref{Changing context default settings}.  The @code{\paper}
-variables that can appear in a @code{\layout} block are:
+@ref{Changing context default settings}.
+
+The @code{\paper} variables that can appear in a @code{\layout}
+block, with default values taken from the @code{\paper} block are:
 
 @itemize
 
@@ -1357,14 +1385,19 @@ staff lines.
 @menu
 * Line breaking::
 * Page breaking::
-* Explicit breaks::
 @end menu
 
 
 @node Line breaking
 @subsection Line breaking
 
-@cindex line breaks
+@funindex \break
+@funindex \noBreak
+@funindex \autoBreaksOff
+@funindex \autoBreaksOn
+@funindex \autoLineBreaksOff
+@funindex \autoLineBreaksOn
+@cindex manual line breaks
 @cindex breaking lines
 
 Line breaks are normally determined automatically.  They are
@@ -1401,9 +1434,9 @@ with the music:
 @lilypond[quote,ragged-right,verbatim]
 \new Voice \with {
   \remove "Forbid_line_break_engraver"
-} \relative c'' {
+} \relative {
   <<
-    { c2. \tuplet 3/2 { c4 c c } c2. | }
+    { c''2. \tuplet 3/2 { c4 c c } c2. | }
     { s1 | \break s1 | }
   >>
 }
@@ -1422,6 +1455,18 @@ c8 c] c2. |
 The @code{\noBreak} command forbids a line break at the bar line
 where it is inserted.
 
+Within a score, automatic line breaking is prevented within music
+lying between @code{\autoLineBreaksOff} and @code{\autoLineBreaksOn}
+commands.  If automatic page breaks should also be prevented, the
+commands @code{\autoBreaksOff} and @code{\autoBreaksOn} should be
+used.  Manual breaks are unaffected by these commands.  Note that
+inhibiting automatic line breaks may cause music to run over the
+right margin if it cannot all be contained within one line.
+
+Automatic line breaks (but not page breaks) may be enabled at single
+bar lines by using @code{\once \autoLineBreaksOn} at a bar line.
+This identifies a permitted rather than a forced line break.
+
 The most basic settings influencing line spacing are @code{indent}
 and @code{line-width}.  They are set in the @code{\layout} block.
 They control the indentation of the first line of music, and the
@@ -1466,12 +1511,19 @@ broken every 4 measures, and only there:
 
 
 @predefined
-@funindex \break
 @code{\break},
-@funindex \noBreak
-@code{\noBreak}.
+@code{\noBreak},
+@code{\autoBreaksOff},
+@code{\autoBreaksOn},
+@code{\autoLineBreaksOff},
+@code{\autoLineBreaksOn}.
 @endpredefined
 
+@snippets
+
+@lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
+{using-an-extra-voice-for-breaks.ly}
+
 @seealso
 Notation Reference:
 @ref{paper variables for line breaking}
@@ -1483,6 +1535,12 @@ Snippets:
 Internals Reference:
 @rinternals{LineBreakEvent}.
 
+@knownissues
+
+Placing @code{\autoLineBreaksOff} or @code{\autoBreaksOff} before
+any music will cause error messages to appear.  Always place these
+commands after some music.
+
 
 @node Page breaking
 @subsection Page breaking
@@ -1502,16 +1560,26 @@ how to modify them.
 @node Manual page breaking
 @unnumberedsubsubsec Manual page breaking
 
+@funindex \pageBreak
+@funindex \noPageBreak
+@funindex \autoPageBreaksOn
+@funindex \autoPageBreaksOff
+@cindex page breaking, manual
+
 The default page breaking may be overridden by inserting
 @code{\pageBreak} or @code{\noPageBreak} commands.  These commands
 are analogous to @code{\break} and @code{\noBreak}.  They should
 be inserted at a bar line.  These commands force and forbid a
-page-break from happening.  Of course, the @code{\pageBreak}
-command also forces a line break.
+page-break from happening at that bar line.  Of course, the
+@code{\pageBreak} command also forces a line break.
 
 The @code{\pageBreak} and @code{\noPageBreak} commands may also be
 inserted at top-level, between scores and top-level markups.
 
+Within a score, automatic page breaks are prevented within music
+lying between @code{\autoPageBreaksOff} and @code{\autoPageBreaksOn}
+commands.  Manual page breaks are unaffected by these commands.
+
 There are also analogous settings to @code{ragged-right} and
 @code{ragged-last} which have the same effect on vertical spacing.
 If @code{ragged-bottom} is set to @code{#t} the systems will not
@@ -1569,10 +1637,10 @@ functions may also be used in different book parts.
 
 
 @predefined
-@funindex \pageBreak
 @code{\pageBreak},
-@funindex \noPageBreak
-@code{\noPageBreak}.
+@code{\noPageBreak},
+@code{\autoPageBreaksOn},
+@code{\autoPageBreaksOff}.
 @endpredefined
 
 @seealso
@@ -1582,6 +1650,13 @@ Notation Reference:
 Snippets:
 @rlsr{Spacing}.
 
+@knownissues
+
+The @code{\once} prefix is ineffective with @code{\autoPageBreaksOn}
+and @code{\autoPageBreaksOff}.  If auto page breaking is off and is
+then turned on to permit a page break, it must remain on for a few
+bars (the precise number of bars depends on the score) before being
+turned off, else the opportunity to break the page will not be taken.
 
 @node Optimal page breaking
 @unnumberedsubsubsec Optimal page breaking
@@ -1732,59 +1807,6 @@ Use only one @code{Page_turn_engraver} per score.  If there are
 more, they will interfere with each other.
 
 
-@node Explicit breaks
-@subsection Explicit breaks
-
-There are cases when manual @code{\break} or @code{\pageBreak}
-commands are ignored by LilyPond.  There are two commands to
-override this behavior:
-
-@example
-\override NonMusicalPaperColumn.line-break-permission = ##f
-\override NonMusicalPaperColumn.page-break-permission = ##f
-@end example
-
-If @code{line-break-permission} is set to @code{##f}, all line
-breaks must be explicitly inserted with a @code{\break} command.
-Likewise, if @code{page-break-permission} is set to @code{##f},
-all page breaks must be explicitly inserted with a
-@code{\pageBreak} command.
-
-@lilypond[quote,verbatim]
-\paper {
-  indent = #0
-  ragged-right = ##t
-  ragged-bottom = ##t
-}
-
-music = \relative c'' { c8 c c c }
-
-\score {
-  \new Staff {
-    \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
-      \override NonMusicalPaperColumn.line-break-permission = ##f
-      \override NonMusicalPaperColumn.page-break-permission = ##f
-    }
-  }
-}
-@end lilypond
-
-@snippets
-
-@lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
-{using-an-extra-voice-for-breaks.ly}
-
 @seealso
 Notation Reference:
 @ref{Vertical spacing}.
@@ -1927,7 +1949,7 @@ lowerCaseChords = \with {
 }
 labelContext =
 #(define-music-function
-     (parser location context)
+     (context)
      (string?)
      #{ s1*0^\markup { \upright {\typewriter #context } } #})
 
@@ -2441,7 +2463,7 @@ by looking at an example that includes no overrides at all.
 This score isolates line- and page-breaking information in a dedicated
 voice.  This technique of creating a breaks voice will help keep layout
 separate from music entry as our example becomes more complicated.
-See @ref{Explicit breaks}.
+See @ref{Breaks}.
 
 Explicit @code{\breaks} evenly divide the music into six measures per
 line.  Vertical spacing results from LilyPond's defaults.  To set
@@ -2717,8 +2739,7 @@ The most common shortest duration is determined as follows: in every
 measure, the shortest duration is determined.  The most common shortest
 duration is taken as the basis for the spacing, with the stipulation
 that this shortest duration should always be equal to or shorter than
-an 8th note.  The shortest duration is printed when you run
-@code{lilypond} with the @option{--verbose} option.
+an 8th note.
 
 These durations may also be customized.  If you set the
 @code{common-shortest-duration} in @rinternals{SpacingSpanner}, then
@@ -2857,8 +2878,8 @@ than @code{1 16}.
 
 @lilypond[verbatim,line-width=12\cm]
 \score {
-  \relative c'' {
-    g4 e e2 | f4 d d2 | c4 d e f | g4 g g2 |
+  \relative {
+    g'4 e e2 | f4 d d2 | c4 d e f | g4 g g2 |
     g4 e e2 | f4 d d2 | c4 e g g | c,1 |
     d4 d d d | d4 e f2 | e4 e e e | e4 f g2 |
     g4 e e2 | f4 d d2 | c4 e g g | c,1 |
@@ -2868,8 +2889,8 @@ than @code{1 16}.
 
 @lilypond[verbatim,line-width=12\cm]
 \score {
-  \relative c'' {
-    g4 e e2 | f4 d d2 | c4 d e f | g4 g g2 |
+  \relative {
+    g'4 e e2 | f4 d d2 | c4 d e f | g4 g g2 |
     g4 e e2 | f4 d d2 | c4 e g g | c,1 |
     d4 d d d | d4 e f2 | e4 e e e | e4 f g2 |
     g4 e e2 | f4 d d2 | c4 e g g | c,1 |
@@ -3462,8 +3483,8 @@ example illustrates the default spacing:
 
 @lilypond[verbatim,quote]
 \score {
-  \relative c'' {
-    g4 e e2 |
+  \relative {
+    g'4 e e2 |
     f4 d d2 |
     c4 d e f |
     g4 g g2 |
@@ -3480,8 +3501,8 @@ duration longer, a @q{squeezing} effect occurs:
 
 @lilypond[verbatim,quote]
 \score {
-  \relative c'' {
-    g4 e e2 |
+  \relative {
+    g'4 e e2 |
     f4 d d2 |
     c4 d e f |
     g4 g g2 |