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