From: James Lowe Date: Fri, 20 Dec 2013 00:03:22 +0000 (+0000) Subject: Doc: NR improve example of \accepts X-Git-Tag: release/2.19.0-1~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f083dbe9c8743e3a1fc4ce1aea085b114e263d6d;p=lilypond.git Doc: NR improve example of \accepts Issue 3641 Improve example given in NR 5.1.7 --- diff --git a/Documentation/notation/changing-defaults.itely b/Documentation/notation/changing-defaults.itely index cb8edf2c03..39928b6061 100644 --- a/Documentation/notation/changing-defaults.itely +++ b/Documentation/notation/changing-defaults.itely @@ -1342,33 +1342,42 @@ list will be repositioned below the outer context rather than nested within it. The @qq{accepts} list of a context can be changed with the -@code{\accepts} and @code{\denies} commands. @code{\accepts} adds a +@code{\accepts} or @code{\denies} commands. @code{\accepts} adds a context to the @qq{accepts} list and @code{\denies} removes a context -from the list. For example, it would not normally be desirable for -chord names to be nested within a @code{Staff} context, so the -@code{ChordNames} context is not included by default in the @qq{accepts} -list of the @code{Staff} context, but if this were to be required it can -be done: +from the list. + +For example, a square-braced staff group is not usually found within a +curved-braced staff with connecting staff bars, and a @code{GrandStaff} +does not accept a @code{StaffGroup} inside it by default. @lilypond[verbatim,quote] \score { - \new Staff { - c' d' e' f' - \chords { d1:m7 b1:min7.5- } - } + \new GrandStaff << + \new StaffGroup << + \new Staff { c'1 } + \new Staff { d'1 } + >> + \new Staff { \set Staff.instrumentName = bottom f'1 } + >> } @end lilypond +However, by using the @code{\accepts} command, @code{StaffGroup} can be +added to the @code{GrandStaff} context: + @lilypond[verbatim,quote] \score { - \new Staff { - c' d' e' f' - \chords { d1:m7 b1:min7.5- } - } + \new GrandStaff << + \new StaffGroup << + \new Staff { c'1 } + \new Staff { d'1 } + >> + \new Staff { \set Staff.instrumentName = bottom f'1 } + >> \layout { \context { - \Staff - \accepts "ChordNames" + \GrandStaff + \accepts "StaffGroup" } } }