From: Trevor Daniels Date: Wed, 13 Aug 2008 11:17:07 +0000 (+0100) Subject: GDP LM 3.3.4 Explaining \context X-Git-Tag: release/2.11.56-1~2^2~14^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=aace57bf14a645214181b9664a87f921369bf273;p=lilypond.git GDP LM 3.3.4 Explaining \context Limited to just setting context properties --- diff --git a/Documentation/user/fundamental.itely b/Documentation/user/fundamental.itely index c406a0e863..ecd591cfc8 100644 --- a/Documentation/user/fundamental.itely +++ b/Documentation/user/fundamental.itely @@ -199,10 +199,6 @@ block, but a @code{\layout} block outside of a @code{\score} block (and thus in a @code{\book} block, either explicitly or implicitly) will affect every @code{\score} in that @code{\book}. -Every @code{\context} block will affect the named context (e.g., -@code{\StaffGroup}) throughout the block (@code{\score} or -@code{\book}) in which it appears. - For details see @ruser{Multiple scores in a book}. @cindex variables @@ -1923,6 +1919,7 @@ should be enclosed in double quotation signs, as above, although we shall see later that text can actually be specified in a much more general way by using the very powerful @code{markup} command. +@unnumberedsubsubsec Setting context properties with @code{\with} @funindex \with @cindex context properties, setting with \with @@ -1965,6 +1962,44 @@ value of the font size. If it is later changed with @code{\set}, this new default value may be restored with the @code{\unset fontSize} command. +@unnumberedsubsubsec Setting context properties with @code{\context} + +The values of context properties may be set in @emph{all} contexts +of a particular type, such as all @code{Staff} contexts, with a single +command. The context type is identified by using its +type name, like @code{Staff}, prefixed by a back-slash: @code{\Staff}. +The statement which sets the property value is the same as that in a +@code{\with} block, introduced above. It is placed in a +@code{\context} block within a @code{\layout} block. Each +@code{\context} block will affect all contexts of the type specified +throughout the @code{\score} or @code{\book} block in which the +@code{\layout} block appears. Here is a example to show the format: + +@lilypond[verbatim,quote] +\score { + \new Staff { + \relative c'' { + cis4 e d ces + } + } + \layout { + \context { + \Staff + extraNatural = ##t + } + } +} +@end lilypond + +@noindent +Context properties set in this way may be overridden for particular +instances of contexts by statements in a @code{\with} block, and by +@code{\set} commands embedded in music statements. + +More information about changing context properties can be found in +the Notation Reference -- see +@ruser{Changing context default settings}. + @node Adding and removing engravers @subsection Adding and removing engravers @@ -2100,12 +2135,6 @@ staff in a four-staff score, we could write } @end lilypond -@noindent -The values of context properties may also be set -for all contexts of a particular type by including the -@code{\set} command in a @code{\context} block in the -same way. - @node Extending the templates @section Extending the templates