]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/consistently-left-aligned-bar-numbers.ly
Merge remote-tracking branch 'origin/master' into translation
[lilypond.git] / Documentation / snippets / consistently-left-aligned-bar-numbers.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.17.6"
8
9 \header {
10   lsrtags = "rhythms"
11
12   texidoc = "
13 When left aligning bar numbers, overlapping problems may occur with
14 Staves brackets. The snippet solves this by keeping right aligned the
15 first bar number following line breaks.
16
17 "
18   doctitle = "Consistently left aligned bar numbers"
19 } % begin verbatim
20
21 consistentlyLeftAlignedBarNumbers = {
22   \override Score.BarNumber.break-visibility = #end-of-line-invisible
23   \override Score.BarNumber.self-alignment-X =
24     #(lambda (grob)
25        (let ((break-dir (ly:item-break-dir grob)))
26          (if (= break-dir RIGHT) RIGHT LEFT)))
27 }
28
29 \new ChoirStaff <<
30   \new Staff {
31     \relative c' {
32       \set Score.barNumberVisibility = #(every-nth-bar-number-visible 3)
33       \bar ""
34       \consistentlyLeftAlignedBarNumbers
35
36       \set Score.currentBarNumber = #112
37       \repeat unfold 8 { R1 }
38       \break
39       \repeat unfold 9 { R1 }
40       \break
41       \repeat unfold 7 { R1 }
42     }
43   }
44   \new Staff {
45     \relative c' {
46       \repeat unfold 24 { R1 }
47     }
48   }
49 >>
50
51 \layout {
52   indent = #0
53   ragged-right = ##t
54   ragged-last = ##t
55 }