0

I have markup extension to create custom linked markup. The function is, shown below:

(define-markup-command (refer layout props ts) (number?)
   (interpret-markup layout props
                     (markup #:with-url (format #f "~a&t=~a" baseURL ts) "ref")))

This works fine when invoked by a music function inside a score. I was hoping to be able to include linked text inside standard markup — not inside a score.

I had assumed that I could simply do:

\markup \refer 2 4

But that produced error messages.

What am I not understanding?

1

1 Answer 1

1

In your markup function, you declare only one argument, but then you apparently try to call it with two arguments. I assume this is an oversight you made while creating a minimal example.

Other than that, the basic problem is that markup syntax is different from normal syntax. In music, if you write 4, it means the duration of a fourth note, but \markup 4 actually prints the number “4”. In markup mode, numbers are not recognized specially, they are interpreted as strings. Therefore, to pass a number to a markup command, you have to use Scheme explicitly, by prefixing the number with a # character.

1
  • Ahh - perfect. And yes, the one number vs two was just because of a revision. Thanks for the simple resolution.
    – Ken Ledeen
    Apr 26 at 0:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.