Re: [NTG-context] processaction inside MP graphic

2010-05-13 Thread Taco Hoekwater
Vianney le Clément wrote: Hello, I'm having some trouble with a macro using \processaction inside a metapost graphic. Here is a minimal example. \def\Shape#1% {\processaction[#1] [square=unitsquare, circle=unitcircle]} \starttext \startuseMPgraphic{test} fill \Shape{square} scaled

Re: [NTG-context] processaction inside MP graphic

2010-05-13 Thread Vianney le Clément
On Thu, May 13, 2010 at 09:30, Taco Hoekwater t...@elvenkind.com wrote: Like many of the more complex commands, \processaction does not expand totally. If you are using mkiv, you could define \Shape like this: \def\Shape#1%  {\directlua{     local known = {square = 'unitsquare', circle =

Re: [NTG-context] processaction inside MP graphic

2010-05-13 Thread luigi scarso
2010/5/13 Vianney le Clément vleclem...@gmail.com: On Thu, May 13, 2010 at 09:30, Taco Hoekwater t...@elvenkind.com wrote: Like many of the more complex commands, \processaction does not expand totally. If you are using mkiv, you could define \Shape like this: \def\Shape#1%  {\directlua{  

Re: [NTG-context] processaction inside MP graphic

2010-05-13 Thread Hans Hagen
On 13-5-2010 11:13, luigi scarso wrote: \setevalue{square}{unitsquare} \setevalue{circle}{unitcircle} \starttext \startuseMPgraphic{test} fill \getvalue{square} scaled 1cm; \stopuseMPgraphic \useMPgraphic{test} \stoptext or \setevalue{mynamespace:square}{unitsquare}

Re: [NTG-context] processaction inside MP graphic

2010-05-13 Thread Vianney le Clément
\getparameters[Shape][square={unitsquare },                     circle={unitcircle }] \starttext \startuseMPgraphic{test} fill \Shapesquare  scaled 1cm; \stopuseMPgraphic \useMPgraphic{test} \stoptext This one's very nice. Thanks. Vianney

Re: [NTG-context] processaction inside MP graphic

2010-05-13 Thread luigi scarso
2010/5/13 Vianney le Clément vleclem...@gmail.com: \getparameters[Shape][square={unitsquare },                     circle={unitcircle }] \starttext \startuseMPgraphic{test} fill \Shapesquare  scaled 1cm; \stopuseMPgraphic \useMPgraphic{test} \stoptext This one's very nice. Thanks.

Re: [NTG-context] processaction inside MP graphic

2010-05-13 Thread Vianney le Clément
becareful at the spaces at the end, ie \getparameters[Shape][square={unitsquare},                    circle={unitcircle}] doesn't work. That's logical, because \Shapesquare eats the spaces following it. In my case, I define my macros like \getparameters[Shape:] [square=unitsquare,

[NTG-context] processaction inside MP graphic

2010-05-12 Thread Vianney le Clément
Hello, I'm having some trouble with a macro using \processaction inside a metapost graphic. Here is a minimal example. \def\Shape#1% {\processaction[#1] [square=unitsquare, circle=unitcircle]} \starttext \startuseMPgraphic{test} fill \Shape{square} scaled 1cm; \stopuseMPgraphic