[NTG-context] Fieldstacks are broken

Hans Hagen pragma at wxs.nl
Thu Jan 21 16:16:23 CET 2016


On 1/21/2016 3:55 PM, Jeong Dal wrote:
> Thanks Hans, Wolfgang, Luigi
>
> The new beta with Luatex 0.88 makes \fieldstacks and \startanimation work.
> The following example of Wolfgang is now working well.
>
> \def\MyGraphics#1{%
> \startMPcode
> path p,q;
> p:=fullcircle scaled 72;
> L:=length p;
> N:=20;
> q:=subpath (0,#1/N*L) of p;
> draw q withcolor red;
> fill fullcircle scaled 3 shifted point length q of q withcolor blue;
> setbounds currentpicture to unitsquare shifted (-0.5,-0.5) scaled 75;
> \stopMPcode}
> \usemodule[animation]
> \setupinteraction[state=start]
>
> \starttext
> \startanimation[menu=yes]
> {\MyGraphics {5}}
> {\MyGraphics {10}}
> {\MyGraphics {15}}
> {\MyGraphics {20}}
> \stopanimation
>
> \stoptext
>
> One more question. Is there any convenient way to list \MyGraphics{#1}?
> I tried \dorecurse, but it just display figures one by one.  I also
> tried lua, but it stops with the error message  “unexpected symbol near
> ‘\'”.
>
> \dorecurse{20}
> {{\MyGraphics {\recurselevel}}
>
> \startluacode
> for i = 1, 20 do
> context(“{\\MyGraphics <smb://MyGraphics>{i}}”)
> end
> \stopluacode

\dorecurse{20} {\dontleavehmode\ruledhbox{\MyGraphics{#1}}\allowbreak}

\page

\startluacode
for i = 1, 20 do
	context.dontleavehmode()
	context.MyGraphics(i)
     context.allowbreak()
end
\stopluacode



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list