Hallo Hans,
the following example is a cooked down version of something I found on the net. Compiling this
%------------------------------------------------ \setupcolors[state=start]
\forceMPTEXcheck{LABEL}
\startMPinclusions vardef LABEL@\#(expr s, p)= label@\#(textext("% \framed[width=1.5cm]{" & s & "}"),p) enddef ; \stopMPinclusions
I could not get this to work either. Something has changed in the MPinclusions parsing, maybe? (Putting the definition in a separate mp file prevents the error, of course)
hm, i'll have a look, but in mkiv there will be no such checks supported anyway
Have you had a look? Wolfgang
Wolfgang Werners-Lucchini wrote:
Hallo Hans,
the following example is a cooked down version of something I found on the net. Compiling this
%------------------------------------------------ \setupcolors[state=start]
\forceMPTEXcheck{LABEL}
\startMPinclusions vardef LABEL@\#(expr s, p)= label@\#(textext("% \framed[width=1.5cm]{" & s & "}"),p) enddef ; \stopMPinclusions I could not get this to work either. Something has changed in the MPinclusions parsing, maybe? (Putting the definition in a separate mp file prevents the error, of course) hm, i'll have a look, but in mkiv there will be no such checks supported anyway
Have you had a look?
\setupcolors[state=start] \forceMPTEXcheck{LABEL} \startMPinclusions vardef LABEL@\#(expr s, p)= label@\#(textext("\framed[width=1.5cm]{xxx" & s & "xx}"),p) enddef ; \stopMPinclusions \startMPpage LABEL("oeps",origin) ; \stopMPpage works ok on my machine using pdftex but luatex gives an unknown (have to look into it) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Thu, 10 Apr 2008, Hans Hagen wrote:
works ok on my machine using pdftex but luatex gives an unknown (have to look into it)
Another test case, I ran into today. \setupcolors[state=start,textcolor=red] \starttext \startMPcode draw fullcircle scaled 2cm withcolor \MPcolor{\@@themaintextcolor} ; \stopMPcode \stoptext Works with MKII and fails with MKIV (03.11.2008 not tested with the new version). Aditya
On Thu, Apr 10, 2008 at 11:41 PM, Aditya Mahajan wrote:
On Thu, 10 Apr 2008, Hans Hagen wrote:
works ok on my machine using pdftex but luatex gives an unknown (have to look into it)
Another test case, I ran into today.
\setupcolors[state=start,textcolor=red]
\starttext
\startMPcode draw fullcircle scaled 2cm withcolor \MPcolor{\@@themaintextcolor} ;
Do you mean \MPcolor{currentcolor}?
\stopMPcode \stoptext
Mojca
On Fri, 11 Apr 2008, Mojca Miklavec wrote:
On Thu, Apr 10, 2008 at 11:41 PM, Aditya Mahajan wrote:
On Thu, 10 Apr 2008, Hans Hagen wrote:
works ok on my machine using pdftex but luatex gives an unknown (have to look into it)
Another test case, I ran into today.
\setupcolors[state=start,textcolor=red]
\starttext
\startMPcode draw fullcircle scaled 2cm withcolor \MPcolor{\@@themaintextcolor} ;
Do you mean \MPcolor{currentcolor}?
Hangs head in shame :(. I need to learn how to read the sources correctly. Of course, currentcolor is much better than \@@themaintextcolor. I just did not know that it existed. Aditya
On Fri, Apr 11, 2008 at 12:23 AM, Aditya Mahajan wrote:
On Fri, 11 Apr 2008, Mojca Miklavec wrote:
On Thu, Apr 10, 2008 at 11:41 PM, Aditya Mahajan wrote:
On Thu, 10 Apr 2008, Hans Hagen wrote:
works ok on my machine using pdftex but luatex gives an unknown (have to look into it)
Another test case, I ran into today.
\setupcolors[state=start,textcolor=red]
\starttext
\startMPcode draw fullcircle scaled 2cm withcolor \MPcolor{\@@themaintextcolor} ;
Do you mean \MPcolor{currentcolor}?
Hangs head in shame :(. I need to learn how to read the sources correctly.
Of course, currentcolor is much better than \@@themaintextcolor. I just did not know that it existed.
Well ... I knew accidentally (since I have requested it). It's mentioned in \sometxt MyWay, but that's rather well hidden as well. Mojca
Mojca Miklavec wrote:
On Fri, Apr 11, 2008 at 12:23 AM, Aditya Mahajan wrote:
On Fri, 11 Apr 2008, Mojca Miklavec wrote:
On Thu, Apr 10, 2008 at 11:41 PM, Aditya Mahajan wrote:
On Thu, 10 Apr 2008, Hans Hagen wrote:
works ok on my machine using pdftex but luatex gives an unknown (have to look into it)
Another test case, I ran into today.
\setupcolors[state=start,textcolor=red]
\starttext
\startMPcode draw fullcircle scaled 2cm withcolor \MPcolor{\@@themaintextcolor} ;
Do you mean \MPcolor{currentcolor}?
Hangs head in shame :(. I need to learn how to read the sources correctly.
Of course, currentcolor is much better than \@@themaintextcolor. I just did not know that it existed.
Well ... I knew accidentally (since I have requested it). It's mentioned in \sometxt MyWay, but that's rather well hidden as well.
you just kept it secret ... i made 'currentcolor' for you -) anyhow ... using commands with @@ in it is usually a bad idea \unprotect \startMPcode draw fullcircle scaled 2cm withcolor \MPcolor{\@@themaintextcolor} ; \stopMPcode \protect might have worked ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Fri, Apr 11, 2008 at 9:44 AM, Hans Hagen wrote:
Mojca Miklavec wrote:
On Fri, Apr 11, 2008 at 12:23 AM, Aditya Mahajan wrote:
On Fri, 11 Apr 2008, Mojca Miklavec wrote:
On Thu, Apr 10, 2008 at 11:41 PM, Aditya Mahajan wrote:
On Thu, 10 Apr 2008, Hans Hagen wrote:
works ok on my machine using pdftex but luatex gives an unknown (have to look into it)
Another test case, I ran into today.
\setupcolors[state=start,textcolor=red]
\starttext
\startMPcode draw fullcircle scaled 2cm withcolor \MPcolor{\@@themaintextcolor} ;
Do you mean \MPcolor{currentcolor}?
Hangs head in shame :(. I need to learn how to read the sources correctly.
Of course, currentcolor is much better than \@@themaintextcolor. I just did not know that it existed.
Well ... I knew accidentally (since I have requested it). It's mentioned in \sometxt MyWay, but that's rather well hidden as well.
you just kept it secret ... i made 'currentcolor' for you -)
I know. MyWay about \sometxt mentions currentcolor, but it's kind of tricky enough to find the proper manual with the needed information when one is looking for it. Using \sometxt instead of btex ... etex would be much more efficient as well, it has not been a secret, but I have no idea how to best proliferate that information.
anyhow ... using commands with @@ in it is usually a bad idea
\unprotect
\startMPcode draw fullcircle scaled 2cm withcolor \MPcolor{\@@themaintextcolor} ; \stopMPcode \protect
might have worked
PS: Before "currentcolor" was there, the circle would have come out red without having to use \MPcolor :-) You just had "bad luck" with it :-) Mojca
Mojca Miklavec wrote:
I know. MyWay about \sometxt mentions currentcolor, but it's kind of tricky enough to find the proper manual with the needed information when one is looking for it. Using \sometxt instead of btex ... etex would be much more efficient as well, it has not been a secret, but I have no idea how to best proliferate that information.
you can use btex .. etex in graphics because they are replaced by calls to textext (mp macro) which works ok
PS: Before "currentcolor" was there, the circle would have come out red without having to use \MPcolor :-) You just had "bad luck" with it :-)
nothing to do with luck ... only with *you* wanting to use mp coloring with tex boxes -) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (4)
-
Aditya Mahajan
-
Hans Hagen
-
Mojca Miklavec
-
Wolfgang Werners-Lucchini