Jump to content

Vertically aligning stanza numbers of different staves: Difference between revisions

From LilyPond wiki
No edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
It can happen that stanza numbers don't align vertically if the verses are attached to different staves. To fix that, override the <code>self-alignment-X</code> property of the <code>LyricText</code> grob.
It can happen that stanza numbers don't align vertically if the verses are attached to different staves. To fix that, override the <code>self-alignment-X</code> property of the <code>LyricText</code> grob.


<lilypond version="2.24" full>
<lilypond version="2.24">
\markup { default behavior }
\markup { default behavior }


Line 44: Line 44:
   }
   }
>>
>>
\paper { tagline = ##f }
</lilypond>
</lilypond>


[[Category:Tweaks and overrides]]
[[Category:Vocal music]]
[[Category:Vocal music]]
[[Category:Tweaks and overrides]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]][[Category:Snippet]]
[[Category:Snippet]]

Latest revision as of 06:19, 13 December 2025

It can happen that stanza numbers don't align vertically if the verses are attached to different staves. To fix that, override the self-alignment-X property of the LyricText grob.

\version "2.24"

\markup { default behavior }

<<
  \new Staff { b b b b }
  \lyrics {
    \set stanza = "3."
    a a a a
  }

  \new Staff { b b b b }
  \lyrics {
    \set stanza = "1."
    aaaaaaaaaa a a a
  }
  \lyrics {
    \set stanza = "2."
    a a a a
  }
>>

\markup \vspace #1
\markup {
  using \typewriter "self-alignment-X = #LEFT" }

<<
  \new Staff { b b b b }
  \new Lyrics \lyricmode {
    \set stanza = "3."
    a a a a
  }

  \new Staff { b b b b }
  \new Lyrics \lyricmode {
    \set stanza = "1."
    \once \override LyricText.self-alignment-X = #LEFT
    aaaaaaaaaa a a a
  }
  \new Lyrics \lyricmode {
    \set stanza = "2."
    a a a a
  }
>>