Aligning text marks to notes: Difference between revisions
Appearance
Created page with "By default, <code>TextMark</code> objects are aligned to the left edge of the staff. They can be aligned to the first note of the line instead by setting the <code>non-musical</code> property to false. <lilypond version="2.24"> \paper { indent = #0 ragged-right = ##t } { \textMark "mark a" c'1 | \break \override Score.TextMark.non-musical = ##f \textMark "mark b" c' | } </lilypond>" |
mNo edit summary |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
By default, <code>TextMark</code> objects are aligned to the left edge of the staff. They can be aligned to | By default, <code>TextMark</code> objects are aligned to so-called <code>NonMusicalPaperColumn</code> grobs, like the left edge of the staff or a bar line. They can be aligned to a note instead by setting the <code>non-musical</code> property to <code>#f</code>. | ||
<lilypond version="2.24"> | <lilypond version="2.24"> | ||
\ | \layout { | ||
line-length = 80\mm | |||
} | } | ||
{ | { | ||
\textMark "mark a" | \textMark "mark a" c'1 | | ||
c'1 | | \textMark "mark b" c'1 | | ||
\break | \break | ||
\override Score.TextMark.non-musical = ##f | \override Score.TextMark.non-musical = ##f | ||
\textMark "mark | \textMark "mark c" c'1 | | ||
c' | | \textMark "mark d" c'1 | | ||
} | } | ||
</lilypond> | </lilypond> | ||
[[Category:Really simple]] | |||
[[Category:Tweaks and overrides]] | |||
[[Category:Text]] | |||
[[Category:Included in the official documentation]] | |||
[[Category:Snippet]] | |||
Latest revision as of 05:36, 24 December 2025
By default, TextMark objects are aligned to so-called NonMusicalPaperColumn grobs, like the left edge of the staff or a bar line. They can be aligned to a note instead by setting the non-musical property to #f.
\version "2.24"
\layout {
line-length = 80\mm
}
{
\textMark "mark a" c'1 |
\textMark "mark b" c'1 |
\break
\override Score.TextMark.non-musical = ##f
\textMark "mark c" c'1 |
\textMark "mark d" c'1 |
}