]> git.donarmstrong.com Git - lilypond.git/blob - input/new/aligning-and-centering-instrument-names.ly
Merge master into nested-bookparts
[lilypond.git] / input / new / aligning-and-centering-instrument-names.ly
1 \version "2.11.61"
2
3 \header {
4   lsrtags = "text, paper-and-layout, titles"
5   texidoc = "The horizontal alignment of instrument names is tweaked
6 by changing the @code{Staff.InstrumentName #'self-alignment-X} property.
7 The @code{\\layout} variables @code{indent} and @code{short-indent}
8 define the space in which the instrument names are aligned before the
9 first and the following systems, respectively."
10   doctitle = "Aligning and centering instrument names"
11 }
12
13 \paper {
14   left-margin = 3\cm
15 }
16
17 \score {
18   \new StaffGroup <<
19     \new Staff {
20       \override Staff.InstrumentName #'self-alignment-X = #LEFT
21       \set Staff.instrumentName = \markup \left-column {
22         "Left aligned"
23         "instrument name"
24       }
25       \set Staff.shortInstrumentName = #"Left"
26       c''1
27       \break
28       c''1
29     }
30     \new Staff {
31       \override Staff.InstrumentName #'self-alignment-X = #CENTER
32       \set Staff.instrumentName = \markup \center-column {
33         Centered
34         "instrument name"
35       }
36       \set Staff.shortInstrumentName = #"Centered"
37       g'1
38       g'1
39     }
40     \new Staff {
41       \override Staff.InstrumentName #'self-alignment-X = #RIGHT
42       \set Staff.instrumentName = \markup \right-column {
43         "Right aligned"
44         "instrument name"
45       }
46       \set Staff.shortInstrumentName = #"Right"
47       e'1
48       e'1
49     }
50   >>
51   \layout {
52     ragged-right = ##t
53     indent = 4\cm
54     short-indent = 2\cm
55   }
56 }