![](https://secure.gravatar.com/avatar/58128ef2fa853eca7f2503a152c340ae.jpg?s=120&d=mm&r=g)
I'm trying to play with colors in textext inclusions: \setupcolors[state=start] \setupMPpage[offset=2mm] \startuseMPgraphic{test} label(textext("\color[green]{XYZ}"), (0,0)); \stopuseMPgraphic \starttext \forceMPTEXgraphictrue \startMPpage \includeMPgraphic{test} \stopMPpage \stoptext This label does not appear in green, although the intermediate files contain: % figure 1 : texpictures[1] := btex \color [green]{XYZ} etex ; Is it possible that \setupcolors[state=start] is not communicated? If so, how and where should this be done? \setupcolors[state=start] cannot be put inside the textext as it is a preamble thing (tried it) (note: although one could do: "label(textext("XYZ"), (0,0) withcolor green;" this interferes with other macro operations I want to perform) yours sincerely, dr. H. van der Meer
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
Hans van der Meer wrote:
I'm trying to play with colors in textext inclusions:
\setupcolors[state=start] \setupMPpage[offset=2mm] \startuseMPgraphic{test} label(textext("\color[green]{XYZ}"), (0,0)); \stopuseMPgraphic \starttext \forceMPTEXgraphictrue \startMPpage \includeMPgraphic{test} \stopMPpage \stoptext
This label does not appear in green, although the intermediate files contain: % figure 1 : texpictures[1] := btex \color [green]{XYZ} etex ;
Is it possible that \setupcolors[state=start] is not communicated?
indeed, \startMPenvironment \setupcolors[state=start] \stopMPenvironment if you want to share settings between the tex and mp runs: \startMPenvironment[global] \setupcolors[state=start] \stopMPenvironment Hans
![](https://secure.gravatar.com/avatar/58128ef2fa853eca7f2503a152c340ae.jpg?s=120&d=mm&r=g)
I'm sorry, I ran it in a few variations, but neither does work here: \setupcolors[state=start] \startMPenvironment % both with and without: [global] \setupcolors[state=start] \stopMPenvironment \setupMPpage[offset=2mm] \startuseMPgraphic{test} label(textext("\color[green]{XYZ}"), (0,0)); % returns black XYZ on execute label(textext("\startcolor[red]{XYZ}\stopcolor"), (0,20)); % returns "unknown" on execute \stopuseMPgraphic \starttext \forceMPTEXgraphictrue \startMPpage \includeMPgraphic{test} \stopMPpage \stoptext I tried to run this on context-live but there got both outputs to "unknown". yours sincerely, dr. H. van der Meer On Dec 28, 2005, at 15:46, Hans Hagen wrote:
Hans van der Meer wrote:
Is it possible that \setupcolors[state=start] is not communicated?
indeed,
\startMPenvironment \setupcolors[state=start] \stopMPenvironment
if you want to share settings between the tex and mp runs:
\startMPenvironment[global] \setupcolors[state=start] \stopMPenvironment
Hans _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
Hans van der Meer wrote:
I'm sorry, I ran it in a few variations, but neither does work here:
ah .. all those users who want to stress this tex-mp game to the limits ... keep in mind that tex in mp is actually a hack! your unknown will go away when you redefine the color commands to be unexpandable \unexpanded\def\startcolor {\ifincolor \expandafter\doglobalstartcolor \else \expandafter\noglobalstartcolor \fi} \unexpanded\def\stopcolor {\ifincolor \doglobalstopcolor \else \noglobalstopcolor \fi}
\setupcolors[state=start] \startMPenvironment % both with and without: [global] \setupcolors[state=start] \stopMPenvironment \setupMPpage[offset=2mm] \startuseMPgraphic{test} label(textext("\color[green]{XYZ}"), (0,0)); % returns black XYZ on execute label(textext("\startcolor[red]{XYZ}\stopcolor"), (0,20)); % returns "unknown" on execute \stopuseMPgraphic \starttext \forceMPTEXgraphictrue \startMPpage \includeMPgraphic{test} \stopMPpage \stoptext
I tried to run this on context-live but there got both outputs to "unknown".
color itself ... mp only reads back the character (+ some rule) data, nothing else, so color needs to be applied at another level (there is some limited and therefore useless special support) so, the best i can give you is: % output=pdf \unexpanded\def\startcolor {\ifincolor \expandafter\doglobalstartcolor \else \expandafter\noglobalstartcolor \fi} \unexpanded\def\stopcolor {\ifincolor \doglobalstopcolor \else \noglobalstopcolor \fi} \setupcolors[state=start] \startMPenvironment % both with and without: [global] % only font and macro defs make sense here \stopMPenvironment \setupMPpage[offset=2mm] \startuseMPgraphic{test} draw thelabel(textext("XYZ"), (0,0)) withcolor \MPcolor{green} ; draw thelabel(textext("XYZ"), (0,20)) withcolor \MPcolor{red} ; \stopuseMPgraphic \starttext \forceMPTEXgraphictrue \startMPpage \includeMPgraphic{test} \stopMPpage \stoptext
participants (2)
-
Hans Hagen
-
Hans van der Meer