From 6975cb171317ca91ee950d98a8fbc8ee062da818 Mon Sep 17 00:00:00 2001 From: tux Date: Wed, 22 Nov 2023 16:48:44 +0100 Subject: [PATCH] einheitliche ref und stanza Formatierung --- basic_format_and_style_settings.ly | 10 +++++++++- verses_with_chords.ly | 10 +++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/basic_format_and_style_settings.ly b/basic_format_and_style_settings.ly index 03f802c..6def934 100644 --- a/basic_format_and_style_settings.ly +++ b/basic_format_and_style_settings.ly @@ -97,4 +97,12 @@ schwarzkopf = % hübsche Wiederholungszeichen für den Liedtext repStart = "𝄆" -repStop = "𝄇" \ No newline at end of file +repStop = "𝄇" + +stanzaFormat = "~a." +stanza = + #(define-music-function (parser location stanzanumber) (number?) + #{ \set stanza = #(ly:format stanzaFormat stanzanumber) #}) + +refString = "Ref.:" +ref = { \set stanza = \refString } diff --git a/verses_with_chords.ly b/verses_with_chords.ly index bed84e5..eaef1b3 100644 --- a/verses_with_chords.ly +++ b/verses_with_chords.ly @@ -88,18 +88,18 @@ )) #(define-markup-command (stanza-raw layout props arg) - (markup?) + (string-or-music?) (let ((verselayout (chain-assoc-get 'verselayout props generalLayout))) (interpret-markup layout props (if (and (string? arg) (string-null? arg)) " " #{\markup - \score { \new Lyrics { \lyricmode { \set stanza = #arg "" } } \layout { \verselayout } } + \score { \new Lyrics { \lyricmode { #(if (ly:music? arg) arg #{ \set stanza = #arg #}) "" } } \layout { \verselayout } } #} )))) #(define-markup-command (stanza layout props arg) - (markup?) + (string-or-music?) (interpret-markup layout props (make-size-box-to-box-markup #f #t (make-stanza-raw-markup arg) (make-stanza-raw-markup "x")))) @@ -119,7 +119,7 @@ 1 "\n" 2)))))) % Kompletten Vers mit Akkorden -#(define-markup-command (chordverse layout props stanza verse) (markup? string?) +#(define-markup-command (chordverse layout props stanza verse) (string-or-music? string?) #:properties ((intraverse-vspace 0)(custom-verse-breaks '())) "Vers mit Akkorden" (let* ((fromto (chain-assoc-get 'transposition props #f)) @@ -137,7 +137,7 @@ )))) % Kompletter Vers aus dem Akkorde entfernt werden -#(define-markup-command (nochordverse layout props stanza verse) (markup? string?) +#(define-markup-command (nochordverse layout props stanza verse) (string-or-music? string?) #:properties ((intraverse-vspace 0)(custom-verse-breaks '())) "Vers ohne Akkorde" (interpret-markup layout props