[metapost] Different colours in a label
Mojca Miklavec
mojca.miklavec.lists at gmail.com
Sat Nov 10 12:19:12 CET 2007
On 11/10/07, Pétiard François wrote:
> Hello
>
> I want to typeset a label like that :
>
> E=Q(i)
>
> where E is in blue and i is in red.
>
> The command :
>
> label(btex $\color{blue}E\color{black}=Q(\color{red}i\color{black})$
> etex,z0);
>
> does'nt work : all the label is in black.
>
> How can I make ?
That's because "btex/etex" labels are processed with plain TeX (unless
you have switched to LaTeX explicitely) which doesn't know that it
should turn the color on. You probably need to add something like
verbatimtex ... \usepackage{color} etex
at the beginning (no idea how to do the same in plain TeX) since the
separate (La)TeX run doesn't include any special packages by default.
Another approach is depicted here as a complete example in metafun (to
be processed with texexec) - since I forgot most of what I have ever
known about LaTeX:
\setupcolors[state=start]
\starttext
\startMPpage
% metapost code goes here
label(\sometxt{$\color[blue]{E}=Q(\color[red]{i})$}, origin);
\stopMPpage
\stoptext
Mojca
More information about the metapost
mailing list