P J <[email protected]> writes:

> Sorry if this is a silly question... but I am struggling with the
> \replace function.
>
> Let's take this example:
>
> -----------
>
> \markup \replace #'(("100" . "hundred")
>                     ("dpi" . "dots per inch")) "A 100 dpi."
>
> -----------
>
> What code should I use if rather than replacing "100" with "hundred" I
> want, say, to replace "100" with a markup, for instance:
>
> \markup \concat { "1" \translate-scaled #' (-0.5 . 0) "00" }
>
> I have not been able to figure this out!

You'd use

\markup \replace #`(("100" . ,#{ \markup \concat { "1" \translate-scaled
#'(-0.5 . 0) "00" } #}) ("dpi" . "dots per inch")) "A 100 dpi."

if it were supported, which it isn't.  Text replacements are purely
string-to-string at the moment.  Logically that should not be required
since the replacements happen in the course of creating a stencil from a
string in ly:text-interface::interpret-string which has all the
information it needs to also properly interpret markups.

But it would make for quite trickier code paths.

-- 
David Kastrup

Reply via email to