Changing context default settings - GNU LilyPond
Description: GNU LilyPond

Next: Defining new contexts, Previous: Layout tunings within contexts, Up: Interpretation contexts

#### 9.2.5 Changing context default settings

The adjustments of the previous subsections (Changing context properties on the fly, Modifying context plug-ins, and Layout tunings within contexts) can also be entered separately from the music in the `\layout` block,

    \layout {
      ...
      \context {
        \Staff

        \set fontSize = #-2
        \override Stem #'thickness = #4.0
        \remove "Time_signature_engraver"
      }
    }

Here `\Staff` takes the existing definition for context `Staff` from the identifier `\Staff`.

The statements

    \set fontSize = #-2
    \override Stem #'thickness = #4.0
    \remove "Time_signature_engraver"

affect all staves in the score. Other contexts can be modified analogously.

The `\set` keyword is optional within the `\layout` block, so

    \context {
      ...
      fontSize = #-2
    }

will also work.

##### Bugs

It is not possible to collect context changes in a variable and apply them to a `\context` definition by referring to that variable.

The `\RemoveEmptyStaffContext` will overwrite your current `\Staff` settings. If you wish to change the defaults for a staff which uses `\RemoveEmptyStaffContext`, you must do so after calling `\RemoveemptyStaffContext`, ie

    \layout {
      \context {
        \RemoveEmptyStaffContext

        \override Stem #'thickness = #4.0
      }
    }

This page is for LilyPond-2.8.8 (stable-branch).

Other languages: English.
Using automatic language selection.