Am 21.04.2014 um 15:46 schrieb Jeong Dal <hak...@me.com>:

> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to