\setupMPvariables in \startMPpage
All, Why doesn't this work? %output=pdf \startuseMPgraphic{usquare} draw unitsquare scaled 4cm; \stopuseMPgraphic \starttext \startMPpage \useMPgraphic{square} \stopMPpage \stoptext 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
Hi David, without digging into depth, it works if you change MPpage into TEXpage Willi David Arnold wrote:
All,
Why doesn't this work?
%output=pdf
\startuseMPgraphic{usquare} draw unitsquare scaled 4cm; \stopuseMPgraphic
\starttext
\startMPpage \useMPgraphic{square} \stopMPpage
\stoptext
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
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
David Arnold wrote:
All,
Why doesn't this work?
%output=pdf
\startuseMPgraphic{usquare} draw unitsquare scaled 4cm; \stopuseMPgraphic
\starttext
\startMPpage \useMPgraphic{square} \stopMPpage
\stoptext
because you nest a graphic, kind of beginfig(1) beginfig(2) draw unitsquare scaled 4cm; endfig ; endfig ; Hans
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
participants (3)
-
David Arnold
-
Hans Hagen
-
Willi Egger