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 1cm; \stopuseMPgraphic \useMPgraphic{test} \stoptext
It stops with the error "Use of \p!compareprocessaction doesn't match its definition."
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 = 'unitcircle' } tex.sprint(known[#1] or 'unitsquare')}} I don't know of a simple solution for mkii. Best wishes, Taco