On Fri, Oct 24, 2008 at 2:15 PM, Aditya Mahajan
On Fri, 24 Oct 2008, Wolfgang Schuster wrote:
Hi all,
what is the best method to format MetaPost labels in MkII with \doattributes.
\startMPenvironment[global]
\setupcolors[state=start]
\def\labelstyle{bold} \def\labelcolor{red} \stopMPenvironment
This gives you only bold label.
\starttext \startMPcode label(textext("\doattributes{label}{style}{color}{Label}"),origin) ; \stopMPcode \stoptext
Tex colors do not work inside textext. Try
label(textext("\startcolor[red] red \stopcolor"), origin) ;
One way to get around this is to use \sometxt.
label(\sometxt{\doattributes{label}{style}{color}{Label}},(5cm,0)) ;
But then you have to be careful about the differences between \sometxt in MKII and MKIV (which I need to summarize on the wiki).
Here is a new example where I can't even use \sometxt. \setupcolors[state=start] \def\labelstyle{bold} \def\labelcolor{red} \starttext \resetMPdrawing \startMPdrawing label(textext("\doattributes{label}{style}{color}{Label}"),origin) ; label(\sometxt{\doattributes{label}{style}{color}{Label}},origin) ; \stopMPdrawing \MPdrawingdonetrue \getMPdrawing \stoptext Wolfgang