%% DO NOT EDIT this file manually; it was automatically
%% generated from the LilyPond Wiki
%% (https://wiki.lilypond.community).
%%
%% Make any changes in the Wiki itself, or in
%% `Documentation/snippets/new/`, then run
%% `scripts/auxiliar/makelsr.pl`.
%%
%% This file is in the public domain.

\version "2.24.0"

\header {
  categories = "Rhythms"

  texidoc = "
The default alignment of bar numbers depends on its position: at the
beginning of a staff, bar numbers are right-aligned; at all other
positions, they are left-aligned. Using Scheme function
@code{break-alignment-list}, this can be changed; the three arguments
of this function are the alignment for end-of-line, middle-of-line, and
start-of-line position (in this order).
"

  doctitle = "Aligning bar numbers"
} % begin verbatim


\relative c' {
  \set Score.currentBarNumber = 111
  \override Score.BarNumber.break-visibility = #all-visible
  % Increase the size of the bar number by 2
  \override Score.BarNumber.font-size = 2
  % Print a bar number every second measure
  \set Score.barNumberVisibility = #(every-nth-bar-number-visible 2)

  c1 | c1 | c1 | \break
  c1 | c1 | c1 | \break

  \override Score.BarNumber.self-alignment-X =
    #(break-alignment-list CENTER RIGHT CENTER)
  c1 | c1 | c1 | \break
  c1 | c1 | c1 |
}

\paper {
  line-width = 70\mm
}
