[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Outliner markup command
From: |
Thomas Morley |
Subject: |
Re: Outliner markup command |
Date: |
Tue, 12 Jan 2016 21:24:23 +0100 |
2016-01-12 15:37 GMT+01:00 Pierre Perol-Schneider
<address@hidden>:
> Hi,
>
> Yesterday night I thought about rewriting this snippet:
> http://lsr.di.unimi.it/LSR/Item?id=890 using the new whiteout 'outline'
> override and finally discovered a funny side effect:
>
> \version "2.19.35"
> #(set-default-paper-size "a6")
>
> #(define-markup-command (outliner layout props outln-width outln-clr
> text-clr text)
> (number? string? string? markup?)
> "Draw a colored ouline around a colored text."
> (interpret-markup layout props
> (markup
> (#:combine
> (#:override
> (cons 'style 'outline)
> (#:override
> (cons 'thickness outln-width)
> (#:whiteout
> (#:with-color
> (x11-color outln-clr)
> text))))
> (#:with-color
> (x11-color text-clr)
> text)))))
I've always found it a little so-so, to define custom markup-commands
only combining a personal choice of preexisting markup-commands.
Wouldn't it be better to let it do by a scheme-function?
Though, you can't further reuse it in another markup like:
\version "2.19.36"
foo = #(define-scheme-function ()() #{ \markup "bla" #})
\markup \line { "xy" \foo }
Returns an error.
You would need to make some detour:
%% Two possebilities to get the _result_ of `foo'
buzz = \foo
\markup \line { "xy" \buzz }
\markup \line { "xy" ##{ \foo #} }
Any chance to directly insert the result of a scheme-function in a
newly created markup?
(David cc-ed)
Thanks,
Harm