![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
27 Dec
2005
27 Dec
'05
9:58 p.m.
David Arnold wrote:
Why doesn't this work?
%output=pdf
\startuseMPgraphic{usquare} draw unitsquare scaled \MPvar{u}; \stopuseMPgraphic
\starttext
\startMPpage \setupMPvariables[usquare][u=4cm] \includeMPgraphic{usquare} \stopMPpage
\stoptext
because (1) after startMPpage metapost code is expected (or something like \includeMPgraphic{...} that expands to mp code (2) when the setup is moved outside the startMPpage, contex does not know what vars to preset however, this works (MPrawvar is undocumented, yet) \startuseMPgraphic{usquare} draw unitsquare scaled \MPrawvar{usquare}{u}; \stopuseMPgraphic \starttext \setupMPvariables[usquare][u=4cm] \startMPpage \includeMPgraphic{usquare} \stopMPpage \stoptext