[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re:markup? and number?
From: |
Kevin Patrick Barry |
Subject: |
Re:markup? and number? |
Date: |
Tue, 4 Feb 2014 15:07:33 +0000 |
> Can you please post what you have achieved so far? It's hard to guess
> without seeing your code.
>
> Marc
Sorry for the slow reply. A small example of what I am trying follows:
#(define-markup-command (sus layout props args) (markup-list?)
(interpret-markup layout props
#{
\markup \concat {
\fontsize #-2 \number #(car args)
\raise #0.7 \draw-line #(cons (cddr args) 0)
\fontsize #-2 \number #(cadr args)
}
#}
))
This will produce an error since the \draw-line function needs a
number? and not a markup? If I change the data type to a list of
numbers instead of a list of markups I end up with the opposite
problem (i.e. the \draw-line is ok but not the other parts of the
function). I can work around this by specifying three arguments
separately, like this:
#(define-markup-command (sus layout props arga argb argc) (markup?
markup? number?)
(interpret-markup layout props
#{
\markup \concat {
\fontsize #-2 \number #arga
\raise #0.7 \draw-line #(cons argc 0)
\fontsize #-2 \number #argb
}
#}
))
But this makes the input in the file look a bit strange, and I want to
extend this function so that I will be able to draw columns of figures
as well.
Maybe I'm going about this all the wrong way?
Thank you in advance,
Kevin
- markup? and number?, Kevin Patrick Barry, 2014/02/03
- Re:markup? and number?,
Kevin Patrick Barry <=