X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Fconsistently-left-aligned-bar-numbers.ly;fp=Documentation%2Fsnippets%2Fconsistently-left-aligned-bar-numbers.ly;h=46e86777edef84af77a71fca8e6c1d21e6cdc9f6;hb=32a34dcef0c0041c6d62677487a380b5c8b85712;hp=0000000000000000000000000000000000000000;hpb=f41973ff763d5972a85995b6d40c864281ec6714;p=lilypond.git diff --git a/Documentation/snippets/consistently-left-aligned-bar-numbers.ly b/Documentation/snippets/consistently-left-aligned-bar-numbers.ly new file mode 100644 index 0000000000..46e86777ed --- /dev/null +++ b/Documentation/snippets/consistently-left-aligned-bar-numbers.ly @@ -0,0 +1,55 @@ +%% DO NOT EDIT this file manually; it is automatically +%% generated from LSR http://lsr.dsi.unimi.it +%% Make any changes in LSR itself, or in Documentation/snippets/new/ , +%% and then run scripts/auxiliar/makelsr.py +%% +%% This file is in the public domain. +\version "2.16.0" + +\header { + lsrtags = "rhythms" + + texidoc = " +When left aligning bar numbers, overlapping problems may occur with +Staves brackets. The snippet solves this by keeping right aligned the +first bar number following line breaks. + +" + doctitle = "Consistently left aligned bar numbers" +} % begin verbatim + +consistentlyLeftAlignedBarNumbers = { + \override Score.BarNumber #'break-visibility = #end-of-line-invisible + \override Score.BarNumber #'self-alignment-X = + #(lambda (grob) + (let ((break-dir (ly:item-break-dir grob))) + (if (= break-dir RIGHT) RIGHT LEFT))) +} + +\new ChoirStaff << + \new Staff { + \relative c' { + \set Score.barNumberVisibility = #(every-nth-bar-number-visible 3) + \bar "" + \consistentlyLeftAlignedBarNumbers + + \set Score.currentBarNumber = #112 + \repeat unfold 8 { R1 } + \break + \repeat unfold 9 { R1 } + \break + \repeat unfold 7 { R1 } + } + } + \new Staff { + \relative c' { + \repeat unfold 24 { R1 } + } + } +>> + +\layout { + indent = #0 + ragged-right = ##t + ragged-last = ##t +}