4 texidoc = "Context modifications can be stored into a variable as a
5 \with object. They can be later inserted into another \with block."
8 % Some sample modifications to be inserted into a \with block later on
10 \remove "Time_signature_engraver"
11 \consists "Ambitus_engraver"
12 \override StaffSymbol.line-count = 4
18 \remove "Mark_engraver"
19 \remove "Staff_collecting_engraver"
23 \consists "Mark_engraver"
24 \consists "Staff_collecting_engraver"
29 music = \relative { \key fis \minor c''1 d e }
32 \override Score.RehearsalMark.self-alignment-X = #LEFT
33 \override Score.RehearsalMark.font-size = #-2
35 \new Staff { \mark \markup { No modifications } \music }
37 \remove "Time_signature_engraver"
38 \consists "Ambitus_engraver"
39 \override StaffSymbol.line-count = 4
42 \markup { "Remove time sig, add ambitus, set staff to 4 lines" }
44 % Some context modifications manually written in a \with block
45 \new Staff \with \ctxmod {
46 \mark \markup { "The same mods using a variable" } \music
48 % The same mods as direct value of \with
49 \new Staff \with { \ctxmod } {
50 \mark \markup { "The same mods using a variable and \with" }
53 % Mods before a context mod in a with block are working:
55 \remove "Clef_engraver"
59 \markup { "Remove clef and use variable to add other changes as above" }
62 % Mods before and after a context mod in a with block are working:
64 \remove "Clef_engraver"
66 \remove "Key_engraver"
67 } { \mark \markup { "Also remove clef and key engravers" } \music }
68 % Mods can be inserted instead of a \with block (i.e. \with is not required)
69 \new Staff \ctxmod { \mark \markup { "The same mods as staff 2" } \music }
70 \new Staff { \mark \markup { "Back to default" } \music }