Am 16.04.10 14:51, schrieb Troy Henderson:
If I have two different \startMPcode ... \stopMPcode sections, is there a way (perhaps it does this by default) to have the variables stored in the first block available in the second block? In pure MetaPost, I can do
numeric a:=4; beginfig(1); label(decimal(a),origin); endfig; beginfig(2); label(decimal(a),origin); endfig; end
and both figures have the value of 'a' available to them because 'a' was defined before each figure. What is the ConTeXt way of doing this?
\starttext \startluacode local a = 0 for i=1,10 do a = a + 1 context.startMPpage() -- context('label("%d",origin);',a) context('label(textext("%d"),origin);',a) context.stopMPpage() end \stopluacode \stoptext Wolfgang