1\version "2.19.48"
2\header {
3  lsrtags = "contexts-and-engravers, staff-notation"
4  texidoc = "
5Using @code{MarkLine} contexts (such as in
6@uref{http://lsr.di.unimi.it/LSR/Item?id=1010, LSR1010}) in a
7Frenched score can be problematic if all the staves between two
8@code{MarkLine}s are removed in one system. The
9@code{Keep_alive_together_engraver} can be used within each
10@code{StaffGroup} to keep the @code{MarkLine} alive only as long
11as the other staves in the group stay alive.
12"
13  doctitle = "Using marklines in a Frenched score"
14}
15bars = {
16  \tempo "Allegro" 4=120
17  s1*2
18  \repeat unfold 5 { \mark \default s1*2 }
19  \bar "||"
20  \tempo "Adagio" 4=40
21  s1*2
22  \repeat unfold 8 { \mark \default s1*2 }
23  \bar "|."
24}
25winds = \repeat unfold 120 { c''4 }
26trumpet = { \repeat unfold 8 g'2 R1*16 \repeat unfold 4 g'2 R1*8 }
27trombone = { \repeat unfold 4 c'1 R1*8 d'1 R1*17 }
28strings = \repeat unfold 240 { c''8 }
29
30#(set-global-staff-size 16)
31\paper {
32  systems-per-page = 5
33  ragged-last-bottom = ##f
34}
35
36\layout {
37  indent = 15\mm
38  short-indent = 5\mm
39  \context {
40    \name MarkLine
41    \type Engraver_group
42    \consists Output_property_engraver
43    \consists Axis_group_engraver
44    \consists Mark_engraver
45    \consists Metronome_mark_engraver
46    \override VerticalAxisGroup.remove-empty = ##t
47    \override VerticalAxisGroup.remove-layer = #'any
48    \override VerticalAxisGroup.staff-affinity = #DOWN
49    \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.basic-distance = 1
50    keepAliveInterfaces = #'()
51  }
52  \context {
53    \Staff
54    \override VerticalAxisGroup.remove-empty = ##t
55    \override VerticalAxisGroup.remove-layer = ##f
56  }
57  \context {
58    \StaffGroup
59    \accepts MarkLine
60    \consists Keep_alive_together_engraver
61  }
62  \context {
63    \Score
64    \remove Mark_engraver
65    \remove Metronome_mark_engraver
66  }
67}
68
69\score {
70  <<
71    \new StaffGroup = "winds" \with {
72      instrumentName = "Winds"
73      shortInstrumentName = "Winds"
74    } <<
75      \new MarkLine \bars
76      \new Staff \winds
77    >>
78    \new StaffGroup = "brass" <<
79      \new MarkLine \bars
80      \new Staff = "trumpet" \with {
81        instrumentName = "Trumpet"
82        shortInstrumentName = "Tpt"
83      } \trumpet
84      \new Staff = "trombone" \with {
85        instrumentName = "Trombone"
86        shortInstrumentName = "Tbn"
87      } \trombone
88    >>
89    \new StaffGroup = "strings" \with {
90      instrumentName = "Strings"
91      shortInstrumentName = "Strings"
92    } <<
93      \new MarkLine \bars
94      \new Staff = "strings" { \strings }
95    >>
96  >>
97}
98