[metapost] Re: [metafont] [question about metapost]How to make color text in boxes?

Hartmut Henkel hartmut_henkel at gmx.de
Sun Jan 23 15:43:07 CET 2005


On Sun, 23 Jan 2005, Laurence Finston wrote:

> On Sun, 23 Jan 2005, Hartmut Henkel wrote:
>
> > > I think if it works for `label', it ought to work for `dotlabel', too.
> >
> > somehow these are not compatible (no idea why), but this does:
> >
>
> [...]
>
> Thanks.  This is the first I've heard about `image'.  I found the
> documentation in _Drawing Graphs with MetaPost_.
>
> This is what _A User's Manual for MetaPost_ has to say:
>  "[...] the dotlabel statement.  This is exactly like the label statement
> except that it adds a dot at the indicated coordinates."

so this sentence is not quite true.

> Therefore, the difference in their behavior in this case seems like a
> bug to me.

But one can't change it without breaking the totally frozen fm/mp
dotlabel. Following would look more orthogonal, but it's impossible to
change...

vardef thedotlabel@#(expr s,z) =
  image(
    label@#(s,z);
    interim linecap:=rounded;
    draw z withpen pencircle scaled dotlabeldiam;
  )
enddef;

def dotlabel = draw thedotlabel enddef;

beginfig(1);
dotlabel(btex $A$ etex, origin) withcolor red;
label(btex $A$ etex, (10mm,10mm)) withcolor blue;
draw thedotlabel(btex $A$ etex, (20mm,20mm)) withcolor red;
draw thelabel(btex $A$ etex, (30mm,30mm)) withcolor blue;
endfig;
end;

> Do you know about this already, Taco?

Regards, Hartmut





More information about the metapost mailing list