support für römische Zahlen in den Strophen

This commit is contained in:
Christoph Wagner 2024-06-29 19:18:05 +02:00
parent e388559f23
commit c4bfc17b89
2 changed files with 11 additions and 2 deletions

View File

@ -95,8 +95,16 @@ schwarzkopf =
\override NoteHead.color = #grey
#})
romanStanza =
#(define-music-function (parser location) ()
#{ \override StanzaNumber.style = #'roman #})
stanza =
#(define-music-function (parser location stanzanumber) (number?)
#{ \set stanza = #(ly:format stanzaFormat stanzanumber) #})
#(define-music-function (parser location stanzanumber) (number?)
(make-apply-context
(lambda (context)
(let* ((stanzastyle (ly:assoc-get 'style (ly:context-grob-definition context 'StanzaNumber)))
(formattedStanzaNumber (format #f (if (eq? stanzastyle 'roman) romanStanzaFormat stanzaFormat) stanzanumber)))
(ly:context-set-property! context 'stanza formattedStanzaNumber)))))
ref = { \set stanza = \refString }

View File

@ -15,6 +15,7 @@ songTocColumns = 3
globalSize = 15
lyricSize = 1.6
stanzaFormat = "~a."
romanStanzaFormat = "~@r."
refString = "Ref.:"
% hübsche Wiederholungszeichen für den Liedtext
repStart = "𝄆"