Hi Kenneth,
Am 31.12.22 um 11:26 schrieb Kenneth Flak:
Is there a way to alias a command in lilypond? F.x. I would like to substite
`\markup \rN` with simply `\rn`. Defining `rn` as a variable doesn't work, so
what are the ways?
Usually it does actually work:
\version "2.24.0"
something = \trill
{
a'4\something
}
The problem is that \rN (I assume you refer to David Nalesnik's roman
numeral library) is a markup function, and these are special. If you
want to have a shorthand for situations where you use \markup \rN ... in
music (or lyrics), you can do:
rN = #(define-scheme-function (arg) (markup?) (markup #:rN arg))
For example:
\version "2.24.0"
% Some arbitrary definition of rN as a markup command
#(define-markup-command (rN layout props arg) (markup?)
(interpret-markup layout props
#{ \markup { \huge \italic #arg } #}))
rN = #(define-scheme-function (arg) (markup?) (markup #:rN arg))
{
a'-\rN Text
}
\new Lyrics \lyricmode {
\rN test
}
I'm not 100% sure if there might be some disaster lurking if you (like
me) take the exact name of the markup function for the shorthand; if you
want to be on the safe side, just take a different name (like rn, as you
proposed).
Lukas