lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with a 2-argument markup command definition


From: David Kastrup
Subject: Re: Help with a 2-argument markup command definition
Date: Sat, 19 Nov 2011 16:07:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Robert Schmaus <address@hidden> writes:

> Hi everyone,
>
> I'm trying to define a 2-argument markup command. the definition below
> doesn't work, I get all sorts of errors when I call either
> \jcStack{"x"}{"y"}
> or
> \jcStack "x" "y"
> or
> \jcStack #"x" #"y"
>
>
>
> #(define-markup-command (jcStack layout props jcHi jcLo) (markup? markup?)
>     (interpret-markup layout props
>       (markup #:smaller jcHi #:larger jcLo )
>     )
>   )
>
>
> does anyone know what's my mistake here? and which one of the function
> calls above would be the correct ones?

The last variant will likely not start working until a recently proposed
change of mine gets in.  The second variant would be fine, the first
possibly not.

Your mistake simply is that the markup macro accepts a markup, and you
feed it two arguments.  You either need to create a markup-list command
(and let it create a list of two markups), or you create a single
line-markup from the two markups you have.  Or use concat or other ways
of combining the two markups into one.

If you don't want to think about all those intricacies, you can just
side-step the issue of the internals, and use

#(define-markup-command (jcStack layout props jcHi jcLo) (markup? markup?)
    (interpret-markup layout props
      #{ \markup { \smaller $jcHi \larger $jcLo } #}
    )
  )

and then \markup will by itself be smart enough to create a \line-markup
around the given markup list.

-- 
David Kastrup




reply via email to

[Prev in Thread] Current Thread [Next in Thread]