From bd6ccd111fae54fb943d457b39485e0a588cb5af Mon Sep 17 00:00:00 2001 From: Thomas Morley Date: Sun, 30 Aug 2015 13:10:52 +0200 Subject: [PATCH] Implement new markup-command overlay issue 4580 Allows for \markup \overlay { a list } --- scm/define-markup-commands.scm | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 505ca246c7..8d15ac9e29 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -1740,11 +1740,7 @@ the line width, where @var{X} is the number of staff spaces. Print two markups on top of each other. Note: @code{\\combine} cannot take a list of markups enclosed in -curly braces as an argument; the follow example will not compile: - -@example -\\combine @{ a list @} -@end example +curly braces as an argument; for this purpose use @code{\\overlay} instead. @lilypond[verbatim,quote] \\markup { @@ -1759,6 +1755,27 @@ curly braces as an argument; the follow example will not compile: (s2 (interpret-markup layout props arg2))) (ly:stencil-add s1 s2))) +(define-markup-command (overlay layout props args) + (markup-list?) + #:category align + " +@cindex merging text + +Takes a list of markups combining them. + +@lilypond[verbatim,quote] +\\markup { + \\fontsize #5 + \\override #'(thickness . 2) + \\overlay { + \\draw-line #'(0 . 4) + \\arrow-head #Y #DOWN ##f + \\translate #'(0 . 4)\\arrow-head #Y #UP ##f + } +} +@end lilypond" + (apply ly:stencil-add (interpret-markup-list layout props args))) + ;; ;; TODO: should extract baseline-skip from each argument somehow.. ;; -- 2.39.2