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