Next: , Previous: Modifying context plug-ins, Up: Interpretation contexts


5.1.4 Changing context default settings

The adjustments of the previous subsections ( The set command, Modifying context plug-ins, and Overview of modifying properties) 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"
  }
}

The \Staff command brings in the existing definition of the staff context so that it can be modified.

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.

Known issues and warnings

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
  }
}

TODO: add \with in here.

This page is for LilyPond-2.11.58 (development-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.

Your suggestions for the documentation are welcome.

Other languages: français, español.