passing arguments to \processMPbuffer
Dear all, For \startuseMPgraphic, there is a way to do that (found in metafun book) as following: \startuseMPgraphic{Labels}{s, t} numeric u; u:= 1cm; for i=0 upto 7: label (textext("$v_{" & decimal (i) & "}$" ), \MPvar{s}[origin,3u*dir(30*i)]) ; label (textext("$v_{" & decimal (i) & "}$" ), \MPvar{t}[origin,3u*dir(30*i)]) ; endfor; \stopuseMPgraphic \starttext \placefigure[][]{} {\useMPgraphic{ColoringFace::Labeling}{s=0.8, t=1.3}} \stoptext Is there a way to the same job for \processMPbuffer instead of .5 and .7 in buffer? \startbuffer[Labels]%{s, t} numeric u; u:= 1cm; for i=0 upto 7: label (textext("$v_{" & decimal (i) & "}$" ), .5[origin,3u*dir(30*i)]) ; label (textext("$v_{" & decimal (i) & "}$" ), .7[origin,3u*dir(30*i)]) ; endfor; \stopbuffer \starttext \processMPbuffer[Labels]%% ?{s, t}? \stoptext Thank you. Best regards, Dalyoung
Am 21.04.2014 um 15:46 schrieb Jeong Dal
Dear all,
For \startuseMPgraphic, there is a way to do that (found in metafun book) as following:
\startuseMPgraphic{Labels}{s, t} numeric u; u:= 1cm;
for i=0 upto 7: label (textext("$v_{" & decimal (i) & "}$" ), \MPvar{s}[origin,3u*dir(30*i)]) ; label (textext("$v_{" & decimal (i) & "}$" ), \MPvar{t}[origin,3u*dir(30*i)]) ; endfor; \stopuseMPgraphic
\starttext \placefigure[][]{} {\useMPgraphic{ColoringFace::Labeling}{s=0.8, t=1.3}} \stoptext
Is there a way to the same job for \processMPbuffer instead of .5 and .7 in buffer?
\startbuffer[Labels]%{s, t} numeric u; u:= 1cm; for i=0 upto 7: label (textext("$v_{" & decimal (i) & "}$" ), .5[origin,3u*dir(30*i)]) ; label (textext("$v_{" & decimal (i) & "}$" ), .7[origin,3u*dir(30*i)]) ; endfor; \stopbuffer
\starttext \processMPbuffer[Labels]%% ?{s, t}? \stoptext
You can’t pass variables with the buffer command but a direct setup and access of them is possible: \startbuffer[Labels] numeric u; u:= 1cm; for i=0 upto 7: label (textext("$v_{" & decimal (i) & "}$" ), \MPrawvar{Labels}{s}[origin,3u*dir(30*i)]) ; label (textext("$v_{" & decimal (i) & "}$" ), \MPrawvar{Labels}{t}[origin,3u*dir(30*i)]) ; endfor; \stopbuffer \starttext \setupMPvariables[Labels][s=0.8, t=1.3] \processMPbuffer [Labels] \stoptext Wolfgang
participants (2)
-
Jeong Dal
-
Wolfgang Schuster