Node:Defining contexts, Next:, Previous:Context evaluation, Up:Interpretation context



Defining contexts

The most common way to create a new context definition is by extending an existing one. An existing context from the paper block is copied by referencing a context identifier:

     \paper {
       \translator {
         context-identifier
       }
     }
     

Every predefined context has a standard identifier. For example, the Staff context can be referred to as \StaffContext.

The context can then be modified by setting or changing properties, e.g.

     \translator {
       \StaffContext
       Stem \set #'thickness = #2.0
       defaultBarType = #"||"
     }
     
These assignments happen before interpretation starts, so a \property command will override any predefined settings.

Bugs

It is not possible to collect multiple property assignments in a variable, and apply to one \translator definition by referencing that variable.


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

Report errors to <bug-lilypond@gnu.org>.