lilypond-user
[Top][All Lists]
Advanced

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

Re: custom markup help


From: Damian leGassick
Subject: Re: custom markup help
Date: Sun, 24 May 2015 10:51:01 +0100


On 23 May 2015, at 12:51, Nick Payne wrote:

On 23/05/2015 21:24, Damian leGassick wrote:
\version "2.18.0"


#(define-markup-command (sd layout props sdnum) (markup?)
  #:properties ((baseline-skip 0.5))
  "Put a number with a carat above the note."
  (interpret-markup layout props
    #{\markup \override #`(baseline-skip . ,baseline-skip)
              \column { \small {^ #sdnum }}    #}))


{g^\markup {\sd 3}}

Don't use the name baseline-skip for the baseline-skip value. Change it to something else and it works:

\version "2.18.0"


#(define-markup-command (sd layout props sdnum) (markup?)
 #:properties ((skip 0.5))
 "Put a number with a carat above the note."
 (interpret-markup layout props
   #{\markup \override #`(baseline-skip . ,skip)
             \column { \small {^ #sdnum }}    #}))


{g^\markup {\sd 3}}
<skip.png>_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user

Thanks Nick

it works, but I don't see why my version doesn't

I though that I was setting a property with a default value rather than creating a variable

my assumption is based on the example given at http://www.lilypond.org/doc/v2.18/Documentation/extending/new-markup-command-definition 

#(define-markup-command (double-box layout props text) (markup?)
  #:properties ((inter-box-padding 0.4)
                (box-padding 0.6))
  "Draw a double box around text."
  (interpret-markup layout props
    #{\markup \override #`(box-padding . ,inter-box-padding) \box
              \override #`(box-padding . ,box-padding) \box
              { #text } #}))

\markup \double-box A
\markup \override #'(inter-box-padding . 0.8) \double-box A
\markup \override #'(box-padding . 1.0) \double-box A

Damian

reply via email to

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