Jump to content

How to add text marks at the end of a line

From LilyPond wiki
Revision as of 23:32, 21 November 2025 by Lemzwerg (talk | contribs) (New category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

By default, rehearsal marks specified at the end of a line are printed at the beginning of the next line (even if it is the end of the piece, in such case the mark isn't printed at all). To avoid this, override the #'break-visibility property of the RehearsalMark object, like in the following snippet.

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=287

\layout {
 ragged-right = ##t 
}

\relative g' {
  g4 g g g | g g g g | g g g g |
  \break
  \override Score.RehearsalMark.break-visibility = #begin-of-line-invisible
  \mark "D.C. al Fine"
  g4 g g g | g g g g | g g g g | g g g g |
}