Ja, es ist das alte Problem, aber mit einem neuen Lösungsansatz.
Durch eine eigene Stencil-Funktion habe ich ein »line breaking rehearsal mark« erzeugt.
Es deckt nur den speziellen Fall ab, beim dem zwei Texte (oder Markups) angegeben werden,
beim Zeilenumbruch der erste rechtsbündig am Zeilenende, und am Zeilenanfang der zweite linksbündig.
Sollte kein Zeilenumbruch sein, die beiden Texte links und rechts von einem »mittig angeordneten Spalt«, also ingesamt je nach Länge der Einzeltexte asymmetrisch.
%tested: \version "2.12.3
%tested: \version "2.14.2"
%tested: \version "2.16.0"
\version "2.17.15"
#(define-public (string-or-markup-or-boolean? e)
(or (string? e) (markup? e) (boolean? e)))
#(define (double-rehearsalmark-stencil grob)
(let*
((grobs-event (ly:grob-property grob 'cause '()))
(left-label (ly:event-property grobs-event 'left-label))
(right-label (ly:event-property grobs-event 'right-label))
(gap (ly:grob-property grob 'gap 1.4)))
(case (ly:item-break-dir grob)
((-1)
(if (boolean? left-label) empty-stencil
(grob-interpret-markup grob left-label)))
((1)
(if (boolean? right-label) empty-stencil
(grob-interpret-markup grob right-label)))
(else
(if (boolean? left-label)
(grob-interpret-markup grob right-label)
(if (boolean? right-label)
(grob-interpret-markup grob left-label)
(ly:stencil-add
(ly:stencil-translate
(grob-interpret-markup grob left-label)
(cons (* -0.5 gap) 0.0))
(ly:stencil-translate
(grob-interpret-markup grob right-label)
(cons (* 0.5 gap) 0.0)))))))))
doubleMark =
#(define-music-function
(parser location left-string right-string)
(string-or-markup-or-boolean? string-or-markup-or-boolean?)
(if (and (boolean? left-string) (boolean? right-string))
(ly:warning "~a \\doubleMark - at least one string or markup required" location))
(make-music 'SequentialMusic
'elements (list
(make-music 'ContextSpeccedMusic
'context-type 'Score
'element
(make-music 'OverrideProperty
'symbol 'RehearsalMark
'grob-value double-rehearsalmark-stencil
'grob-property-path (list 'stencil)
'pop-first #t
'once #t))
(make-music 'ContextSpeccedMusic
'context-type 'Score
'element
(make-music 'OverrideProperty
'symbol 'RehearsalMark
'grob-value #f
'grob-property-path (list 'self-alignment-X)
'pop-first #t
'once #t))
(make-music 'ContextSpeccedMusic
'context-type 'Score
'element
(make-music 'OverrideProperty
'symbol 'RehearsalMark
'grob-value `#(,(not (boolean? left-string))
#t
,(not (boolean? right-string)))
'grob-property-path (list 'break-visibility)
'pop-first #t
'once #t))
(make-music 'MarkEvent
'label #f
'left-label (if (boolean? left-string) #f
(make-right-align-markup
(if (string? left-string)
(make-simple-markup left-string)
left-string)))
'right-label (if (boolean? right-string) #f
(make-left-align-markup
(if (string? right-string)
(make-simple-markup right-string)
right-string)))
'origin location))))
{
c''1
\once \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
\mark
\markup { \musicglyph #"scripts.coda" }
c''
\doubleMark
\markup { "D.C. al " \raise #1.0 \musicglyph #"scripts.coda" }
"CODA"
\break
c''
\doubleMark
"Fine"
##f
c''
\doubleMark
"CODA da capo al Fine"
##f
\bar "|."
}Ich habe noch nicht versucht, ob die Music-Sequenz (\once \override ... \mark) z. Bsp. mittels tweaks zu einem einzigen Music-Event zusammengefasst werden kann.
Die eigentliche Fage ist aber, ob jemand großen Bedarf für eine allgemeinere Implementierung hat? Mit mehr Formatierungsmöglichkeiten, eventuell unter Einbeziehung einer \default-Marke in der Mitte?
Arnold