Urs Liska <li...@openlilylib.org> writes: > Hi all, > > I have regularly struggled to get this to work, and now I think there > should be an additional example in Extending, 2.4 and/or 2.5. > > The description in 2.5 explains how to define a markup function that > can be used as > > { > c' \markup \double-box "Some text" > } > > This makes sense, as "double-box" is a natural name for a style > applied to a markup. However, pretty often one may want to have > "standalone" markup commands that can be used like e.g. > > { > c'1 \player "Perc. 1" d' player "Perc. 2 > } > > While it's perfectly possible to use "\markup \player" here too it's > often relevant to semantically encode elements just like you encode > \mark or \fermata.
Which are not markup at all. They can only be used in music. > It took me some time to figure out that \double-box can be written and > used like > > doubleBox = > #(define-event-function (text) (markup?) > (make-music 'TextScriptEvent 'text > (markup #:override '(box-padding . 0.4) #:box > #:override '(box-padding . 0.6) #:box text))) > > \relative { > c'1 \doubleBox "Implicitly Neutral" > c -\doubleBox "Explicitly neutral" > c ^\doubleBox Above > c _\doubleBox Below > } doubleBox = -\markup \override #'(box-padding . 0.4) \box \override #'(box-padding . 0.6) \box \etc There you go. -- David Kastrup _______________________________________________ bug-lilypond mailing list bug-lilypond@gnu.org https://lists.gnu.org/mailman/listinfo/bug-lilypond