* color in textext
@ 2005-12-28 12:08 Hans van der Meer
2005-12-28 14:46 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Hans van der Meer @ 2005-12-28 12:08 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: color in textext
2005-12-28 12:08 color in textext Hans van der Meer
@ 2005-12-28 14:46 ` Hans Hagen
2005-12-28 21:25 ` Hans van der Meer
0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2005-12-28 14:46 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: color in textext
2005-12-28 14:46 ` Hans Hagen
@ 2005-12-28 21:25 ` Hans van der Meer
2005-12-28 23:08 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Hans van der Meer @ 2005-12-28 21:25 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: color in textext
2005-12-28 21:25 ` Hans van der Meer
@ 2005-12-28 23:08 ` Hans Hagen
0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2005-12-28 23:08 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-12-28 23:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-28 12:08 color in textext Hans van der Meer
2005-12-28 14:46 ` Hans Hagen
2005-12-28 21:25 ` Hans van der Meer
2005-12-28 23:08 ` Hans Hagen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).