Re: [NTG-context] Fieldstacks are broken
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 Thanks again. Best regards, Dalyoung
Today's Topics:
1. Re: Fieldstacks are broken (Hans Hagen)
----------------------------------------------------------------------
Message: 1 Date: Mon, 11 Jan 2016 10:53:56 +0100 From: Hans Hagen
To: ntg-context@ntg.nl Subject: Re: [NTG-context] Fieldstacks are broken Message-ID: <56937BB4.1070006@wxs.nl> Content-Type: text/plain; charset=utf-8; format=flowed On 1/10/2016 5:01 PM, Wolfgang Schuster wrote:
Hi Hans,
the fieldstack mechanism doesn’t work anymore.
\setupinteraction[state=start]
\starttext \showframe
\definesymbol[frame-1][\tt 1] \definesymbol[frame-2][\tt 2] \definesymbol[frame-3][\tt 3]
\definefieldstack[frame][frame-1,frame-2,frame-3]
\placeontopofeachother {\framed[strut=no,offset=1ex]{\fieldstack[frame]}} {\goto{Play}[Walk{frame}]}
\stoptext
fixed in next engine update
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
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 -----------------------------------------------------------------
Jeong Dal mailto:haksan@me.com 21. Januar 2016 um 15:55 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{% \unexpanded\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 ‘\'”. \startanimation[menu=yes] \dorecurse{20}{\expanded{\startframe \MyGraphics{\recurselevel} \stopframe}} \stopanimation
Wolfgang
Hi Jeong, I played with your code and indeed it is very nice to use this animation feature (I never succeeded to imbed a movie in a TeX file typeset with Context…). Thanks to Hans and Wolfgang, and you, I can now use such things in my presentations. Just to say something which may be useful, one can also use \dostepwiserecurse as in \startanimation[menu=yes] \dostepwiserecurse{0}{20}{2}{\expanded{\startframe \MyGraphics{\recurselevel} \stopframe}} \stopanimation Best regards: OK
On 21 Jan 2016, at 23:47, Wolfgang Schuster
wrote: Jeong Dal mailto:haksan@me.com 21. Januar 2016 um 15:55 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{% \unexpanded\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 ‘\'”. \startanimation[menu=yes] \dorecurse{20}{\expanded{\startframe \MyGraphics{\recurselevel} \stopframe}} \stopanimation
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 ___________________________________________________________________________________
participants (4)
-
Hans Hagen
-
Jeong Dal
-
Otared Kavian
-
Wolfgang Schuster