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 {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 <pra...@wxs.nl> > To: ntg-context@ntg.nl > Subject: Re: [NTG-context] Fieldstacks are broken > Message-ID: <56937bb4.1070...@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 > - ___ 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 ___
Re: [NTG-context] Fieldstacks are broken
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 - ___ 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 ___
[NTG-context] Fieldstacks are broken
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 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 ___
Re: [NTG-context] Quick slide templates
Hello Kumar. I make my PDF animations so that I first create a single multi-page PDF file whose separate pages are separate animation frames. Then this auxiliary PDF file I put into another PDF file using \ fieldstack. Here's how I prepare a separate animation file. \def\setmyparameter#1#2{% \global\def\myparameter{#2}#1% }% \def\processmyparameters[#1]#2% {\processcommalist[#1]{\setmyparameter{#2}}} \startbuffer [greenbar] \blackrule[width=\myparameter, height=5mm, color=green] \stopbuffer \starttext \processmyparameters[1cm,2cm,3.5cm,4.5cm,8cm,11cm]{ \getbuffer[greenbar]\page} \stoptext Greetings Jaroslav Hajtmar Dne 20.2.2013 10:16, Marco Patzer napsal(a): \newdimen\cnt \starttext \startbuffer [greenbar] \blackrule[width=4cm, height=5mm, color=green] \stopbuffer \dorecurse{10}{%% \blackrule[width=\textwidth] \advance\cnt1cm \hskip\cnt \getbuffer[greenbar]\page} \stoptext ___ 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 ___
Re: [NTG-context] Quick slide templates
On Wed, Feb 20, 2013 at 11:58:24AM +0100, Jaroslav Hajtmar wrote: Hello Kumar. I make my PDF animations so that I first create a single multi-page PDF file whose separate pages are separate animation frames. Then this auxiliary PDF file I put into another PDF file using \ fieldstack. Here's how I prepare a separate animation file. \def\setmyparameter#1#2{% \global\def\myparameter{#2}#1% }% \def\processmyparameters[#1]#2% {\processcommalist[#1]{\setmyparameter{#2}}} \startbuffer [greenbar] \blackrule[width=\myparameter, height=5mm, color=green] \stopbuffer \starttext \processmyparameters[1cm,2cm,3.5cm,4.5cm,8cm,11cm]{ \getbuffer[greenbar]\page} \stoptext Thank you for this solution. I just tried this, and this works well for me as well! Kumar -- Kumar Appaiah ___ 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 ___
Re: [NTG-context] MetaPost Animations
Am 01.01.2013 um 15:30 schrieb Jeong Dal hak...@me.com: Dear Wolfgang, Thank you for the explanation and the correction of the code. It works nicely. It also taught me some other things too. I'd like to ask you one more thing. When you update the animation module, would you please concern the location of the menu? I think that it is better to put it at the bottom center of the animation frame in default? Currently, it is located slightly left from the center. This is a bug in context which adds a space for each symbol in a fieldstack (the mechanism which is used to create the animation and which is documented in the metafun manual). I reported it a few days ago on the dev list and hope Hans will fix it in the next beta. 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 ___
Re: [NTG-context] animation error
Am 06.09.2011 um 16:52 schrieb dalyoung: Dear Wolfgang, In the recent beta, \startanimation \stopanimation is not working. There is a undefined control sequence error at \stopanimation. In the version 2011/08/10, it works fine. Is there anything changed in the recent version? There had been changes in the parameter handler for mkiv. scrn-fld.mkvi: \def\scrn_fieldstack_add#tag#settings#symbol% {\advance\scratchcounter\plusone \edef\currentfieldstackname{#tag:\number\scratchcounter}% - \ifnum\scratchcounter=\@@fdstart\relax + \ifnum\scratchcounter=\fieldcategoryparameter\c!start\relax \definefieldbody[\currentfieldstackname][\c!type=check,\c!values={#symbol,\empty},\c!default={#symbol}]% \else \definefieldbody[\currentfieldstackname][\c!type=check,\c!values={#symbol,\empty},\c!default=]% \fi \setbox\scrn_fieldstack_box\hbox{\symbol[#symbol]}% \setcollector [fieldstack] {\fieldbody [\currentfieldstackname] [\c!option=\v!readonly, \c!width=\wd\scrn_fieldstack_box, \c!height=\ht\scrn_fieldstack_box, \c!depth=\dp\scrn_fieldstack_box, #settings]}} 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 ___
[NTG-context] \fieldstack
Hi, fieldstack based animations result in a broken PDF document. \setupinteraction[state=start] \starttext \definesymbol[one][\tt 1] \definesymbol[two][\tt 2] \definefieldstack[some][one,two] \defineoverlay[some][\overlaybutton{Walk{some}}] \framed[frame=off,background={foreground,some}]{\fieldstack[some]} \stoptext This is LuaTeX, Version beta-0.70.1-2011051908 (rev 4277) 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 ___
Re: [NTG-context] \fieldstack
On 25-6-2011 1:59, Wolfgang Schuster wrote: \setupinteraction[state=start] \starttext \definesymbol[one][\tt 1] \definesymbol[two][\tt 2] \definefieldstack[some][one,two] \defineoverlay[some][\overlaybutton{Walk{some}}] \framed[frame=off,background={foreground,some}]{\fieldstack[some]} \stoptext weird, I'll have a look at it (didn't change something with widgets recently) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] animation module
Dear Wolfgang, Thank you for the reply. Do you use the Adobe Reader? Reader can not open it. It says that the file is damaged. It doesn?t work for me either but i can reproduce it also without the animation module. I just see your mail on fieldstack. Thank you for checking. Have a nice weekend. Best regards, Dalyoung ___ 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 ___
Re: [NTG-context] animation module
On 25-6-2011 2:46, dalyoung wrote: I just see your mail on fieldstack. Thank you for checking. I'll upload a new beta that you can check (some to be tested code was interfering). Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] animation module
Am 25.06.2011 um 14:55 schrieb Hans Hagen: On 25-6-2011 2:46, dalyoung wrote: I just see your mail on fieldstack. Thank you for checking. I'll upload a new beta that you can check (some to be tested code was interfering). The new beta works. 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 ___
Re: [NTG-context] about JS(Walk_Field{})
Dear Wolfgang, Your animation module works really fine. It reduces a lot of work to set the fieldstack. I'd like to ask you a few more small things. 1) Is it possible to set the duration time in the case of autoplay? 2) The location of buttons is leftaligned when [menu=yes]. Is it what you want or I did something wrong? 3) What is the meaning of \start and \stop in animation-1.tex? 4) In your animation-2.tex, the size of buttons can be controlled by setting foregroundstyle. Then, how to apply it to \startanimation? Thank you. Best regards, Dalyoung ___ 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 ___
Re: [NTG-context] about JS(Walk_Field{})
Am 17.05.2011 um 13:16 schrieb Jeong Dalyoung: Dear Wolfgang, Your animation module works really fine. It reduces a lot of work to set the fieldstack. It’s now also part of the minimals. I'd like to ask you a few more small things. 1) Is it possible to set the duration time in the case of autoplay? I’ll add a key to change this. 2) The location of buttons is leftaligned when [menu=yes]. Is it what you want or I did something wrong? Will be fixed. 3) What is the meaning of \start and \stop in animation-1.tex? I added them to keep the \startMPinitializations settings local but they are useless here because \startMPinitializations stores the content in a global register, I’m going to remove them. 4) In your animation-2.tex, the size of buttons can be controlled by setting foregroundstyle. Then, how to apply it to \startanimation? I used animation-2.tex for a draft of the control buttons, they are static images and don’t come from the module itself. Control over the size of the menu etc. is still missing. You can make a list of features you want and i take a look at it. 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 ___
Re: [NTG-context] ntg-context Digest, Vol 83, Issue 56
Dear Hans, There is something wrong with the fieldstack mechanism. fixed in next beta (mismatch between field.value in javascript and rendering key) I updated to the latest beta(5/15) and tested both the Wolfgang's sample and mine. They are working well. Thank you for quick fixing of fieldstack and also for enhancing the sorting of Korean words. Best regards, Dalyoung ___ 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 ___
[NTG-context] about JS(Walk_Field{})
Dear all, I tried the following code for presentation, but not succeeded. It just draw a small circle without frame even frame=on. The word here is colored green but there is no interaction when I click here. Is there anything wrong in the following code? Thank you. Best regards, Dalyoung \setupinteraction[state=start] \startbuffer[a] draw fullcircle scaled 1cm; \stopbuffer \startbuffer[b] draw fullcircle scaled 2cm; \stopbuffer \startbuffer[c] draw fullcircle scaled 3cm; \stopbuffer \definesymbol[step1][{\processMPbuffer[a]}] \definesymbol[step2][{\processMPbuffer[a,b]}] \definesymbol[step3][{\processMPbuffer[a,b,c]}] \definefieldstack [circles] [step1, step2, step3] [frame= on, offset= 3pt,framecolor=darkyellow,rulethickness=1pt] \starttext \placefigure[here][] {To see the animation, please click \goto{here}[JS(Walk_Field{circles})]} {\fieldstack[circles]} \stoptext ___ 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 ___
Re: [NTG-context] about JS(Walk_Field{})
Am 14.05.2011 um 14:26 schrieb Jeong Dalyoung: Dear all, I tried the following code for presentation, but not succeeded. It just draw a small circle without frame even frame=on. The word here is colored green but there is no interaction when I click here There is something wrong with the fieldstack mechanism. \setupinteraction[state=start] \starttext \definesymbol[one][1] \definesymbol[two][2] \definefieldstack[some][one,two] \defineoverlay[some][\overlaybutton{Walk{some}}] \framed[background={foreground,some}]{\fieldstack[some]} \stoptext Your mail reminds me to finish my animation module which makes it simpler to generate such animations, e.g. the above can be written as \startanimation {1} {2} \stopanimation and all the necessary symbols etc. are generated by the environment. 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 ___
Re: [NTG-context] about JS(Walk_Field{})
On 14-5-2011 2:55, Wolfgang Schuster wrote: There is something wrong with the fieldstack mechanism. fixed in next beta (mismatch between field.value in javascript and rendering key) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
[NTG-context] Animations
Hi Hans, this is a feature request regarding fieldstack based animations. Since i want to use fieldstacks in one of my modules i’m looking for a simple to use interface to produce animations, for the moment i create a symbol for each frame and put them together with a fieldstack. For latex there is a package called animate [1] which provides a environment to produce animations with buttons for navigation (just a take a look at the examples in the manual, code is not relevant for us). I wrote now a short dummy module [1] to demonstrate how this could look in context, the first file [1] contains a few example, the environment is inspired by \startoverlay/\stopoverlay but it needs a alternative method to allow loops (look at the third example in this file). The second test file shows which navigation buttons i want for such a module, the are “first frame”, “previous frame”, “play” and “stop” animation, “next frame” and “last frame”. As a alternative one can produce a animation with a overlay button only with a symbol on the first frame to indicate a interactive element. [1] http://ctan.org/tex-archive/macros/latex/contrib/animate/animate.pdf [2] http://bitbucket.org/wolfs/animation/src/tip/files/ [3] http://bitbucket.org/wolfs/animation/src/tip/files/animation-1.tex [4] http://bitbucket.org/wolfs/animation/src/tip/files/animation-2.tex 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 ___
Re: [NTG-context] Animations
On 2-11-2010 9:39, Wolfgang Schuster wrote: Hi Hans, this is a feature request regarding fieldstack based animations. I'll send you something to test. - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] \fieldstack with mkiv
On 13-2-2010 11:45, Peter Münster wrote: \setupinteraction[state=start] \definesymbol[step1][AAA] \definesymbol[step2][BBB] \definefieldstack[test][step1, step2] \starttext \fieldstack[test] Just click \goto{here}[JS(Walk_Field{test})] to walk through the fieldstack! \goto{(restart)}[JS(Set_Field{test, 1})] \stoptext \def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings {\ifcsname fieldstack:#1\endcsname \else \setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}% \fi} \else missing - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] \fieldstack with mkiv
Am 14.02.10 14:32, schrieb Hans Hagen: On 13-2-2010 11:45, Peter Münster wrote: \setupinteraction[state=start] \definesymbol[step1][AAA] \definesymbol[step2][BBB] \definefieldstack[test][step1, step2] \starttext \fieldstack[test] Just click \goto{here}[JS(Walk_Field{test})] to walk through the fieldstack! \goto{(restart)}[JS(Set_Field{test, 1})] \stoptext \def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings {\ifcsname fieldstack:#1\endcsname \else \setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}% \fi} \else missing works but only the first symbol is shown, all others are invisible Wolfgang test.pdf Description: Adobe PDF document test.tex Description: TeX document ___ 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 ___
Re: [NTG-context] \fieldstack with mkiv
On 14-2-2010 17:45, Wolfgang Schuster wrote: Am 14.02.10 14:32, schrieb Hans Hagen: On 13-2-2010 11:45, Peter Münster wrote: \setupinteraction[state=start] \definesymbol[step1][AAA] \definesymbol[step2][BBB] \definefieldstack[test][step1, step2] \starttext \fieldstack[test] Just click \goto{here}[JS(Walk_Field{test})] to walk through the fieldstack! \goto{(restart)}[JS(Set_Field{test, 1})] \stoptext \def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings {\ifcsname fieldstack:#1\endcsname \else \setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}% \fi} \else missing works but only the first symbol is shown, all others are invisible new attempt - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] \fieldstack with mkiv
Am 14.02.10 19:16, schrieb Hans Hagen: new attempt the stepper did now work but why are the symbol names shown on the terminal here is a example from another file with more symbols (the symbols have the names 'go!symbol!...') fonts : using map file: lm-math {/Users/wolf/context/tex/texmf/fonts/map/dvips/lm/lm-math.map} fonts : using map file: lm-rm {/Users/wolf/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}go!symbol!2 go!symbol!3 go!symbol!4 go!symbol!5 go!symbol!6 go!symbol!7 go!symbol!8 go!symbol!9 go!symbol!10 !pages : flushing realpage 1, userpage 1, subpage 1 systems : end file test-go-5 at line 15 system : cont-err loaded 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 ___
Re: [NTG-context] \fieldstack with mkiv
On 14-2-2010 20:12, Wolfgang Schuster wrote: Am 14.02.10 19:16, schrieb Hans Hagen: new attempt the stepper did now work but why are the symbol names shown on the terminal here is a example from another file with more symbols (the symbols have the names 'go!symbol!...') fonts : using map file: lm-math {/Users/wolf/context/tex/texmf/fonts/map/dvips/lm/lm-math.map} fonts : using map file: lm-rm {/Users/wolf/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}go!symbol!2 go!symbol!3 go!symbol!4 go!symbol!5 go!symbol!6 go!symbol!7 go!symbol!8 go!symbol!9 go!symbol!10 !pages : flushing realpage 1, userpage 1, subpage 1 systems : end file test-go-5 at line 15 system : cont-err loaded because i added a print for tracing; i'll remove it - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
[NTG-context] \fieldstack with mkiv
Hello, What is needed to get \fieldstack working in mkiv? The following example works with mkii, but not with mkiv: \setupinteraction[state=start] \definesymbol[step1][AAA] \definesymbol[step2][BBB] \definefieldstack[test][step1, step2] \starttext \fieldstack[test] Just click \goto{here}[JS(Walk_Field{test})] to walk through the fieldstack! \goto{(restart)}[JS(Set_Field{test, 1})] \stoptext TIA for any hints! Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/ ___ 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 ___
Re: [NTG-context] last beta and fieldstacks
Wolfgang Schuster wrote: Hi, the latest beta has a problem with fieldstacks. \setupinteraction[state=start] \definefieldstack[symbollist][symbol1,symbol1][frame=off] \definesymbol[symbol1][1] \definesymbol[symbol2][2] \starttext \fieldstack[symbollist] \stoptext PS: Is it possible to change \ctxlatetua to \ctxlatelua in the MkIV version of \savetwopassdata (core-two.mkiv). PPS: context version: 2008.56.06 19:11 :-) I guess that translates to 2012.08.08 ? Looks like this context version is way ahead of us :) Best wishes, Taco ___ 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 ___
Re: [NTG-context] last beta and fieldstacks
On Sat, Nov 7, 2009 at 7:57 AM, Taco Hoekwater t...@elvenkind.com wrote: Wolfgang Schuster wrote: Hi, the latest beta has a problem with fieldstacks. \setupinteraction[state=start] \definefieldstack[symbollist][symbol1,symbol1][frame=off] \definesymbol[symbol1][1] \definesymbol[symbol2][2] \starttext \fieldstack[symbollist] \stoptext PS: Is it possible to change \ctxlatetua to \ctxlatelua in the MkIV version of \savetwopassdata (core-two.mkiv). PPS: context version: 2008.56.06 19:11 :-) I guess that translates to 2012.08.08 ? Looks like this context version is way ahead of us :) Well ,we all know that Wolfgang is way ahead of us too, so... -- luigi ___ 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 ___
[NTG-context] last beta and fieldstacks
Hi, the latest beta has a problem with fieldstacks. \setupinteraction[state=start] \definefieldstack[symbollist][symbol1,symbol1][frame=off] \definesymbol[symbol1][1] \definesymbol[symbol2][2] \starttext \fieldstack[symbollist] \stoptext PS: Is it possible to change \ctxlatetua to \ctxlatelua in the MkIV version of \savetwopassdata (core-two.mkiv). PPS: context version: 2008.56.06 19:11 :-) 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt-ifying Kile
] \definetabulate[name][name][text] \definetext[name][position][text][text][text] # \definetextbackground \definetextposition[name][settings] # \definetextvariable[settings][???][???] \definetype[name][settings] # \definetypeface \definetyping[file|typing|name][settings] \defineversion[name][numbers] # \defineXMLargument # \defineXMLcommand # \defineXMLenvironment # \defineXMLenvironmentsave # \defineXMLgrouped # \defineXMLgsave # \defineXMLgstore # \defineXMLignore # \defineXMLnested # \defineXMLpickup # \defineXMLprocess # \defineXMLsave # \defineXMLsavecontent # \defineXMLsingular # \defineXMLstore # \defXMLstring \description{text}text \determineheadnumber[section] \determinelistcharacteristics[names][settings] # \digits \disableinteractionmenu[position|name][references] # \disablemode # \doglobal # \dogotopar # \doif # \doifcommon # \doifcommonelse # \doifdefined # \doifdefinedelse # \doifelse # \doifelsenothing # \doifelsevalue # \doiffieldelse # \doifflagged # \doifinset # \doifinsetelse # \doifmode # \doifmodeelse # \doifnextcharelse # \doifnot # \doifnotcommon # \doifnotflagged # \doifnothing # \doifnotinsetelse # \doifnotmode # \doifnotvalue # \doifsomething # \doiftext # \doiftextelse # \doifundefined # \doifundefinedelse # \doifvalue # \doifXMLdata # \doifXMLdataelse # \doifXMLop # \doifXMLparelse # \doloop # \donothing # \dontleavehmode \donttest # \dorecurse # \dostepwiserecurse # \dowithnextbox # \dowithnextboxcontent # \empty \emptylines[number] # \emptytoks # \enablemode # \endstrut \enumeration # \environment # \EQ # \eTABLE # \eTABLEbody # \eTABLEfoot # \eTABLEhead # \eTABLEnext # \eTD # \eTH # \eTR # \exitloop # \expanded \externalfigure[file][settings] \field[name] \fieldstack[name][names][settings] \fillinfield[text]{text} \fillinline[settings] \fillinrules[settings]{text}{text} \fillintext[settings]{text}{text} \fitfield[name] \fixedspaces # \FLOWchart # \flushcollector # \flushlayer # \flushXMLelement \followprofile{text}[text] \followprofileversion{text}[text][text] \followversion{text}[text] \footnote[reference]{text} \footnotetext[reference]{text} \forceblocks[names][names] # \forgetall # \FR \fraction{text}{text} \framed[settings]{text} \framedtext[settings] \from[reference] \getbuffer[name] # \getfiguredimensionsonly # \getmarking[name][options] # \getvalue # \getvariable # \globalletvalue \godown[dimension] \goto{text}{text}[references] \gotobox{text}[references] \graycolor[text] \grid[options] # \gsaveXMLasdata \hairline \head[references] \headnumber[section] \headtext{text} # \hfilll \hideblocks[names][names] \high{text} # \HL \hl[number] # \hpos # \hspace # \ifconditional # \ifdefined # \iftrialtypesetting # \ifundefined \in{text}{text}[reference] # \includeFLOWchart # \includemenu # \increment \indentation \indenting[options] \inframed[settings]{text} \ininner[+|-|low][reference]{text} \inleft[+|-|low][reference]{text} \inline[reference] \inmargin[+|-|low][reference]{text} \inothermargin[+|-|low][reference]{text} \inouter[+|-|low][reference]{text} \inright[+|-|low][reference]{text} \installlanguage[name][options] \interactionbar[settings] \interactionbuttons[settings][names] \item[references] \items[settings]{text} \its[references] \keepblocks[names][all|names] \labeling[reference] \labels[name] \labeltext{text} \language[language code] \leftaligned{text} # \letgvalue # \letvalue \listsymbol[name]{text} # \loadmapfile \loadsorts \loadsynonyms # \localhsize \logfields \lohi[low]{text}{text} \low{text} # \LR \mainlanguage[language code] \mar[references]{text} \marginrule[number]{text} \margintext[+|-|low][reference]{text} \marking[name]{text} \markversion \mathematics{text} \mediaeval{text} \midaligned{text} \mirror{text} \MONTH{text} \month{text} \moveongrid[options] # \MR \name{text} # \NC # \newcounter # \nextbox \nextsection \nocap{text} \noheaderandfooterlines \noindenting \nolist{text} \nomarking{text} \nomoreblocks \nomorefiles \nop \nospace \note[reference] \notopandbottomlines \nowhitespace # \NR \numbers{text} \overbar{text} \overbars{text text} # \overlaybutton # \overlayfigure \overstrike{text} \overstrikes{text text} \packed \page[options] \pagereference[reference] \pagetype[name] \paragraph \part[references]{text} \periods[number] \placebookmarks[names][names|all] \placecombinedlist[name][settings] \placecombinedlist[name][settings] # \placefigure \placefloat[options][references]{text}{text} \placefootnotes[settings] \placeformula[references]{text}$$ $$ # \placelayer \placelegend{text}{text} \placelist[names][settings] \placelistoffloats \placelistofsorts \placelistofsynonyms \placelocalfootnotes[settings] \placelogos[names] \placeongrid[settings{text} \placeontopofeachother{text}{text} \placereferencelist[names] \placeregister[name][settings] \placeregister[settings] \placerule[name] \placesidebyside{text}{text} \placesubformula[references]{text}$$ $$ \placetextvariable[name] # \plusone # \plustwo \position(numbers){text} \positiontext[name]{text} # \prependtoks
[NTG-context] luatex and interaction
hi, every peace of code with interactive elements gives me this error message systems : begin file walkfield at line 5 (./walkfield.tuo) javascript : loading script set fld (r:/tex/texmf-local/tex/context/base/java-fld.tex) ! Undefined control sequence. \dopresetfieldsymbol #1-\checkobjectreferences \doifobjectfoundelse {SYM}{#... \dosetupfield ...tfieldsymbol \@@DriverFieldValue \setbox \scratchbox \hbox ... \dofield ...abel ,\v!frame ,\v!horizontal ][][][]} \iftrialtypesetting \else ... to be read again \egroup \globalcommacommand ...tackedfieldnumber ]\egroup \bgroup \globalprocesscommaitem ...globalcommacommand {#1} \expandafter \globalproces... ... l.43 \smashedvbox{\fieldstack[sequence]} % ? every interactive element should produce this error, but i can also send a test file. best, peter ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] luatex and interaction
Peter Rolf wrote: hi, every peace of code with interactive elements gives me this error message systems : begin file walkfield at line 5 (./walkfield.tuo) javascript : loading script set fld (r:/tex/texmf-local/tex/context/base/java-fld.tex) ! Undefined control sequence. \dopresetfieldsymbol #1-\checkobjectreferences \doifobjectfoundelse {SYM}{#... \dosetupfield ...tfieldsymbol \@@DriverFieldValue \setbox \scratchbox \hbox ... \dofield ...abel ,\v!frame ,\v!horizontal ][][][]} \iftrialtypesetting \else ... to be read again \egroup \globalcommacommand ...tackedfieldnumber ]\egroup \bgroup \globalprocesscommaitem ...globalcommacommand {#1} \expandafter \globalproces... l.43 \smashedvbox{\fieldstack[sequence]} % ? every interactive element should produce this error, but i can also send a test file. % engine=luatex \starttext \setupinteraction[state=start] \chapter[first]{First} test \in{chapter}[second] \chapter[second]{Second} test \in{chapter}[first] \stoptext works ok here; nothing was changed in that code - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] luatex and interaction
Hans Hagen schrieb: Peter Rolf wrote: hi, every peace of code with interactive elements gives me this error message systems : begin file walkfield at line 5 (./walkfield.tuo) javascript : loading script set fld (r:/tex/texmf-local/tex/context/base/java-fld.tex) ! Undefined control sequence. \dopresetfieldsymbol #1-\checkobjectreferences \doifobjectfoundelse {SYM}{#... \dosetupfield ...tfieldsymbol \@@DriverFieldValue \setbox \scratchbox \hbox ... \dofield ...abel ,\v!frame ,\v!horizontal ][][][]} \iftrialtypesetting \else ... to be read again \egroup \globalcommacommand ...tackedfieldnumber ]\egroup \bgroup \globalprocesscommaitem ...globalcommacommand {#1} \expandafter \globalproces... l.43 \smashedvbox{\fieldstack[sequence]} % ? every interactive element should produce this error, but i can also send a test file. % engine=luatex \starttext \setupinteraction[state=start] \chapter[first]{First} test \in{chapter}[second] \chapter[second]{Second} test \in{chapter}[first] \stoptext works ok here; nothing was changed in that code same here. try the attached (old) example. works with pdftex, breaks with luatex. - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ \setupoutput[pdftex] \setupinteraction[state=start] \setupcolors[state=start] \starttext \tracefieldstrue \switchtobodyfont[96pt] \def\FS#1{\framed[width=4cm,height=4cm,strut=no]{\red\bf#1}}% \definesymbol [empty] [] \definesymbol [one] [\FS{1}] \definesymbol [two] [\FS{2}] \definesymbol [three] [\FS{3}] \definesymbol [four][\FS{4}] \definesymbol [five][\FS{5}] \setupfield[interaction] [width=4cm,height=4cm, % frame=off, framecolor=blue, offset=none,% default offset causes different positioning of walk button and fieldstack clickin=JS(Walk_Field{sequence})] \definefield[Walk][check][interaction][empty][empty] \definefieldstack[sequence] [one,two,three,four,five] [frame=off, offset=none,% default offset causes different positioning of walk button and fieldstack ] \defineproperty[interaction][layer][title=interaction, state=start] \vbox{\normaloffinterlineskip \smashedvbox{\fieldstack[sequence]}% % \startproperty[interaction]% \field[Walk] \stopproperty% } \blank[2cm] \showfields \stoptext ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] luatex and interaction
Peter Rolf wrote: Hans Hagen schrieb: Peter Rolf wrote: hi, every peace of code with interactive elements gives me this error message systems : begin file walkfield at line 5 (./walkfield.tuo) javascript : loading script set fld (r:/tex/texmf-local/tex/context/base/java-fld.tex) ! Undefined control sequence. \dopresetfieldsymbol #1-\checkobjectreferences \doifobjectfoundelse {SYM}{#... \dosetupfield ...tfieldsymbol \@@DriverFieldValue \setbox \scratchbox \hbox ... \dofield ...abel ,\v!frame ,\v!horizontal ][][][]} \iftrialtypesetting \else ... to be read again \egroup \globalcommacommand ...tackedfieldnumber ]\egroup \bgroup \globalprocesscommaitem ...globalcommacommand {#1} \expandafter \globalproces... l.43 \smashedvbox{\fieldstack[sequence]} % ? every interactive element should produce this error, but i can also send a test file. % engine=luatex \starttext \setupinteraction[state=start] \chapter[first]{First} test \in{chapter}[second] \chapter[second]{Second} test \in{chapter}[first] \stoptext works ok here; nothing was changed in that code same here. try the attached (old) example. works with pdftex, breaks with luatex. hm, i need a way more minimal example (tracing) can be a bug in luatex too, there are some known things Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] luatex and interaction
Hans Hagen schrieb: Peter Rolf wrote: Hans Hagen schrieb: Peter Rolf wrote: hi, every peace of code with interactive elements gives me this error message systems : begin file walkfield at line 5 (./walkfield.tuo) javascript : loading script set fld (r:/tex/texmf-local/tex/context/base/java-fld.tex) ! Undefined control sequence. \dopresetfieldsymbol #1-\checkobjectreferences \doifobjectfoundelse {SYM}{#... \dosetupfield ...tfieldsymbol \@@DriverFieldValue \setbox \scratchbox \hbox ... \dofield ...abel ,\v!frame ,\v!horizontal ][][][]} \iftrialtypesetting \else ... to be read again \egroup \globalcommacommand ...tackedfieldnumber ]\egroup \bgroup \globalprocesscommaitem ...globalcommacommand {#1} \expandafter \globalproces... l.43 \smashedvbox{\fieldstack[sequence]} % ? every interactive element should produce this error, but i can also send a test file. % engine=luatex \starttext \setupinteraction[state=start] \chapter[first]{First} test \in{chapter}[second] \chapter[second]{Second} test \in{chapter}[first] \stoptext works ok here; nothing was changed in that code same here. try the attached (old) example. works with pdftex, breaks with luatex. hm, i need a way more minimal example (tracing) ok, i will try to create a 'more minimal' example. can be a bug in luatex too, there are some known things Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Weird Fieldstack problem
Hi Aditya, In my situation, I can't use buffer conveniently. So is there an easy way to \includeMPgraphic recurrently? I've tried \newcount\steps repeat the following block several times \advance\steps\plusone \startuseMPgraphics{step\the\steps} . . . % Some random graphics \stopuseMPgraphic % \startuseMPgraphic{aa} \dorecurse{\the\steps} {\includeMPgraphic{step\recurselevel}} \stopuseMPgraphic but, it's not working. On 6/9/07, Aditya Mahajan [EMAIL PROTECTED] wrote: Quoting Zhichu Chen [EMAIL PROTECTED]: Hi Aditya, Actually, they should have the same boundingbox, the first MPdrawing environment draws a line from (0,0) to (2cm,2cm) and the sequence MPdrawing environments just add two lines that are in the previous boundingbox. I know what's happening now. \definesymbol doesn't define a symbol from \getMPdrawing at once. Yes, \definesymbol[a][b] is roughly equal to \def\a{b}, for example \starttext \def\something{aa} \definesymbol[aa][\something] \symbol[aa] \def\something{bb} \symbol[aa] \stoptext This is what is also happening in your case. You need to go back to the definebuffer and processbuffer as suggested in metafun manual. I do not know if it makes sense to have a \edef version of definesymbol. In any case, getting expansion to work with \getMPdrawing is going to be difficult. Aditya ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- Best Regards Chen Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Draw chess board
Hi guys I've modified my module again, then you can click to demostrate a game. The source file is attached and the resulting pdf file is pretty huge so I just upload to my google page (I think there's a bandwidth limitation so I use winrar to compress it): http://zhichu.chen.googlepages.com/sgfstack.rar On 6/11/07, Zhichu Chen [EMAIL PROTECTED] wrote: Hi Mojca, The stones are very very nice now, thank you for your hints. Since I haven't used TikZ before, I have no idea how to handle these events. I'll learn it later and rewrite my module to be more professional :) All I'm thinking now is how to make each step a single symbol so that I could use \fieldstack to demonstrate the game. By the way, I modified my module to do some fieldstack thing, but it gets a weird error. I have no idea what's the error about, it's fine when I'm using MPdrawing environment but it can't output anything when I switch to buffer and use \processMPbuffer. On 6/10/07, Mojca Miklavec [EMAIL PROTECTED] wrote: On 6/6/07, Zhichu Chen wrote: Hi I've tried to write a test file which can only handle ;B[??], ;W[??], AB[??], AW[??] now, and I haven't added the interaction part. But it is a good start. Any suggestions? Wow - that's really, really impressive! You indeed started parsing the strings in plain TeX! I've changed your source slightly, to give you an idea of yet another approach: using TikZ. It's main advantage over metapost might be: - you can draw more fancy stones (see the example - that could be made configurable of course), although teoretically the same could be achived with slightly improved smooth shading mechanism in mptopdf macros - might be easier to backport to (La)TeX - I can imagine your module to be a new, really nice TikZ package/module (that could be used in other flavours of TeX) + some fancy ConTeXt additions (user interface, javascript, ...). The main difference is that you need to store all the variables in TeX, not in metapost, so that part should be rewritten as well (which I didn't do). But simply forget about my stupid comments about (La)TeX for and do it your way now. Mojca (I have some other comments, but it's too early to speak about them, since the module is not ready/complete yet.) On 5/24/07, Zhichu Chen wrote: Hi I love chess games, especially one kind of them which is generally called Go. I know there is some file can store each details in one game: http://www.red-bean.com/sgf/ AFAIK, there is no module available to draw chess in ConTeXt now. I wanna do this by using MetaPost and fieldstack. But I don't know how to tell metapost the details of the sgf file. Can anyone give me a suggestion? BTW, I don't like the name. It's invented by acient Chinese and it's called Weiqi. I think we can call it Siege Chess in English. -- Best Regards Chen ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- Best Regards Chen Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn -- Best Regards Chen Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn sgfstack.tex Description: TeX document ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Draw chess board
Hi Mojca, The stones are very very nice now, thank you for your hints. Since I haven't used TikZ before, I have no idea how to handle these events. I'll learn it later and rewrite my module to be more professional :) All I'm thinking now is how to make each step a single symbol so that I could use \fieldstack to demonstrate the game. By the way, I modified my module to do some fieldstack thing, but it gets a weird error. I have no idea what's the error about, it's fine when I'm using MPdrawing environment but it can't output anything when I switch to buffer and use \processMPbuffer. On 6/10/07, Mojca Miklavec [EMAIL PROTECTED] wrote: On 6/6/07, Zhichu Chen wrote: Hi I've tried to write a test file which can only handle ;B[??], ;W[??], AB[??], AW[??] now, and I haven't added the interaction part. But it is a good start. Any suggestions? Wow - that's really, really impressive! You indeed started parsing the strings in plain TeX! I've changed your source slightly, to give you an idea of yet another approach: using TikZ. It's main advantage over metapost might be: - you can draw more fancy stones (see the example - that could be made configurable of course), although teoretically the same could be achived with slightly improved smooth shading mechanism in mptopdf macros - might be easier to backport to (La)TeX - I can imagine your module to be a new, really nice TikZ package/module (that could be used in other flavours of TeX) + some fancy ConTeXt additions (user interface, javascript, ...). The main difference is that you need to store all the variables in TeX, not in metapost, so that part should be rewritten as well (which I didn't do). But simply forget about my stupid comments about (La)TeX for and do it your way now. Mojca (I have some other comments, but it's too early to speak about them, since the module is not ready/complete yet.) On 5/24/07, Zhichu Chen wrote: Hi I love chess games, especially one kind of them which is generally called Go. I know there is some file can store each details in one game: http://www.red-bean.com/sgf/ AFAIK, there is no module available to draw chess in ConTeXt now. I wanna do this by using MetaPost and fieldstack. But I don't know how to tell metapost the details of the sgf file. Can anyone give me a suggestion? BTW, I don't like the name. It's invented by acient Chinese and it's called Weiqi. I think we can call it Siege Chess in English. -- Best Regards Chen ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- Best Regards Chen Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn sgfstack.tex Description: TeX document ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Draw chess board
On 6/6/07, Zhichu Chen wrote: Hi I've tried to write a test file which can only handle ;B[??], ;W[??], AB[??], AW[??] now, and I haven't added the interaction part. But it is a good start. Any suggestions? Wow - that's really, really impressive! You indeed started parsing the strings in plain TeX! I've changed your source slightly, to give you an idea of yet another approach: using TikZ. It's main advantage over metapost might be: - you can draw more fancy stones (see the example - that could be made configurable of course), although teoretically the same could be achived with slightly improved smooth shading mechanism in mptopdf macros - might be easier to backport to (La)TeX - I can imagine your module to be a new, really nice TikZ package/module (that could be used in other flavours of TeX) + some fancy ConTeXt additions (user interface, javascript, ...). The main difference is that you need to store all the variables in TeX, not in metapost, so that part should be rewritten as well (which I didn't do). But simply forget about my stupid comments about (La)TeX for and do it your way now. Mojca (I have some other comments, but it's too early to speak about them, since the module is not ready/complete yet.) On 5/24/07, Zhichu Chen wrote: Hi I love chess games, especially one kind of them which is generally called Go. I know there is some file can store each details in one game: http://www.red-bean.com/sgf/ AFAIK, there is no module available to draw chess in ConTeXt now. I wanna do this by using MetaPost and fieldstack. But I don't know how to tell metapost the details of the sgf file. Can anyone give me a suggestion? BTW, I don't like the name. It's invented by acient Chinese and it's called Weiqi. I think we can call it Siege Chess in English. -- Best Regards Chen test.tex Description: TeX document ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Weird Fieldstack problem
Hi, I've written the following test file: == \setupcolors[state=start] \setuppagenumbering[state=stop] \setupinteraction [state=start] \starttext \MPdrawingdonetrue \startMPdrawing draw (0,0)--(2cm,2cm); \stopMPdrawing \definesymbol[aa][\getMPdrawing] \startMPdrawing draw (2cm,2cm)--(2cm,0); \stopMPdrawing \definesymbol[bb][\getMPdrawing] \startMPdrawing draw (0,0)--(2cm,0); \stopMPdrawing \definesymbol[cc][\getMPdrawing] \definefieldstack[somemap][aa,bb,cc][height=fit,width=fit,frame=on] \fieldstack[somemap] \goto{here} [JS(Walk_Field{somemap})] \stoptext == It seems that the fieldstack does not work. Is there anything wrong? -- Best Regards Chen Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Weird Fieldstack problem
On Fri, 8 Jun 2007, Zhichu Chen wrote: Hi, I've written the following test file: == \setupcolors[state=start] \setuppagenumbering[state=stop] \setupinteraction [state=start] \starttext \MPdrawingdonetrue \startMPdrawing draw (0,0)--(2cm,2cm); \stopMPdrawing \definesymbol[aa][\getMPdrawing] \startMPdrawing draw (2cm,2cm)--(2cm,0); \stopMPdrawing \definesymbol[bb][\getMPdrawing] \startMPdrawing draw (0,0)--(2cm,0); \stopMPdrawing \definesymbol[cc][\getMPdrawing] \definefieldstack[somemap][aa,bb,cc][height=fit,width=fit,frame=on] \fieldstack[somemap] \goto{here} [JS(Walk_Field{somemap})] \stoptext == It seems that the fieldstack does not work. Is there anything wrong? I haven't tested this, but I think that all elements in the fieldstack should have the same bounding box. Look at the widget manual, where Hans shows how to make sure that all elements have the same bounding box. Aditya ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Weird Fieldstack problem
Hi Aditya, Actually, they should have the same boundingbox, the first MPdrawing environment draws a line from (0,0) to (2cm,2cm) and the sequence MPdrawing environments just add two lines that are in the previous boundingbox. I know what's happening now. \definesymbol doesn't define a symbol from \getMPdrawing at once. On 6/8/07, Aditya Mahajan [EMAIL PROTECTED] wrote: On Fri, 8 Jun 2007, Zhichu Chen wrote: Hi, I've written the following test file: == \setupcolors[state=start] \setuppagenumbering[state=stop] \setupinteraction [state=start] \starttext \MPdrawingdonetrue \startMPdrawing draw (0,0)--(2cm,2cm); \stopMPdrawing \definesymbol[aa][\getMPdrawing] \startMPdrawing draw (2cm,2cm)--(2cm,0); \stopMPdrawing \definesymbol[bb][\getMPdrawing] \startMPdrawing draw (0,0)--(2cm,0); \stopMPdrawing \definesymbol[cc][\getMPdrawing] \definefieldstack[somemap][aa,bb,cc][height=fit,width=fit,frame=on] \fieldstack[somemap] \goto{here} [JS(Walk_Field{somemap})] \stoptext == It seems that the fieldstack does not work. Is there anything wrong? I haven't tested this, but I think that all elements in the fieldstack should have the same bounding box. Look at the widget manual, where Hans shows how to make sure that all elements have the same bounding box. Aditya ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- Best Regards Chen Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Weird Fieldstack problem
Quoting Zhichu Chen [EMAIL PROTECTED]: Hi Aditya, Actually, they should have the same boundingbox, the first MPdrawing environment draws a line from (0,0) to (2cm,2cm) and the sequence MPdrawing environments just add two lines that are in the previous boundingbox. I know what's happening now. \definesymbol doesn't define a symbol from \getMPdrawing at once. Yes, \definesymbol[a][b] is roughly equal to \def\a{b}, for example \starttext \def\something{aa} \definesymbol[aa][\something] \symbol[aa] \def\something{bb} \symbol[aa] \stoptext This is what is also happening in your case. You need to go back to the definebuffer and processbuffer as suggested in metafun manual. I do not know if it makes sense to have a \edef version of definesymbol. In any case, getting expansion to work with \getMPdrawing is going to be difficult. Aditya ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Fwd: Draw chess board
-- Forwarded message -- From: Zhichu Chen [EMAIL PROTECTED] Date: Jun 6, 2007 8:51 AM Subject: Re: [NTG-context] Draw chess board To: Mojca Miklavec [EMAIL PROTECTED] Hi I've tried to write a test file which can only handle ;B[??], ;W[??], AB[??], AW[??] now, and I haven't added the interaction part. But it is a good start. Any suggestions? On 5/26/07, Mojca Miklavec [EMAIL PROTECTED] wrote: On 5/25/07, Zhichu Chen wrote: Hi Mojca I original intention is: First, check the sgf file to decide how many rows and lines should be used. For some instance, there is no need to draw the full 19x19 board, like conversion steps demostration---best choices around the corner of the board. Second, I'd like to take advantage of PDF Javascript to show every step by clicking on some area. Interesting idea! \fieldstack seems to be a good choice. But if I use some script like sgf2mpost, I don't know how to if there is an easy way to determine how many steps does the sgf include. I didn't mean using sgf2mpost script directly, but to use it as a help when creating a new one [in ruby for example]. If I solved the sgf problem, I think I can input a game manually by using sgf syntax That's what I meant. Mojca On 5/25/07, Mojca Miklavec [EMAIL PROTECTED] wrote: On 5/24/07, Zhichu Chen wrote: Thanks Wolfgang The first link is very useful. I will took its idea. I really want to use metapost's scantoken to read sgf file directly, so it can easily be a cross-platform solution. You can use either TeX or metapost to parse sgf file. But you can forget about TeX, I suppose. Metapost is an option if you love challenges, but it's not the only possibility if you're looking for cross-platform solutions. In http://match.stanford.edu/bump/sgf2dg-4.026.tar.gz you have sgf2mpost.c with 1000 lines of pure C code which parses the file and generates metapost output. If I was in your place, I would write a ruby (or lua ;) parser (the file above can help you, but you can probably parse the input in a much more clever efficient way with ruby) + metapost code generator. Then you write a ConTeXt module with \startSGFscript{name} or \startSGFfile or \startSGFgame or \startGOgame the very special format of your game ... \stopSGFscript You write the content into a file (you can also prepare external files and tell ConTeXt which one is the source file), call texmfstart your-great-ruby-script file.sgf, which generates metapost output, and then you include that one in the ConTeXt document. I'm really not sure if parsing SGF files with metapost can bring you anything ... ruby scripts are fully portable, at least in ConTeXt. Mojca On 5/24/07, Wolfgang Schuster [EMAIL PROTECTED] wrote: 2007/5/24, Zhichu Chen [EMAIL PROTECTED]: Hi I love chess games, especially one kind of them which is generally called Go. I know there is some file can store each details in one game: http://www.red-bean.com/sgf/ AFAIK, there is no module available to draw chess in ConTeXt now. I wanna do this by using MetaPost and fieldstack. But I don't know how to tell metapost the details of the sgf file. Can anyone give me a suggestion? BTW, I don't like the name. It's invented by acient Chinese and it's called Weiqi. I think we can call it Siege Chess in English. -- Best Regards Chen Hi Chen, if you mean Go take a look at the following page: http://match.stanford.edu/bump/go.html There are also two packages on CTAN for LaTeX: http://www.ctan.org/tex-archive/help/Catalogue/bytopic.html#gamesgo 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- Best Regards Chen Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl
[NTG-context] Draw chess board
Hi I love chess games, especially one kind of them which is generally called Go. I know there is some file can store each details in one game: http://www.red-bean.com/sgf/ AFAIK, there is no module available to draw chess in ConTeXt now. I wanna do this by using MetaPost and fieldstack. But I don't know how to tell metapost the details of the sgf file. Can anyone give me a suggestion? BTW, I don't like the name. It's invented by acient Chinese and it's called Weiqi. I think we can call it Siege Chess in English. -- Best Regards Chen Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Draw chess board
2007/5/24, Zhichu Chen [EMAIL PROTECTED]: Hi I love chess games, especially one kind of them which is generally called Go. I know there is some file can store each details in one game: http://www.red-bean.com/sgf/ AFAIK, there is no module available to draw chess in ConTeXt now. I wanna do this by using MetaPost and fieldstack. But I don't know how to tell metapost the details of the sgf file. Can anyone give me a suggestion? BTW, I don't like the name. It's invented by acient Chinese and it's called Weiqi. I think we can call it Siege Chess in English. -- Best Regards Chen Hi Chen, if you mean Go take a look at the following page: http://match.stanford.edu/bump/go.html There are also two packages on CTAN for LaTeX: http://www.ctan.org/tex-archive/help/Catalogue/bytopic.html#gamesgo 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Draw chess board
On 5/24/07, Zhichu Chen wrote: Thanks Wolfgang The first link is very useful. I will took its idea. I really want to use metapost's scantoken to read sgf file directly, so it can easily be a cross-platform solution. You can use either TeX or metapost to parse sgf file. But you can forget about TeX, I suppose. Metapost is an option if you love challenges, but it's not the only possibility if you're looking for cross-platform solutions. In http://match.stanford.edu/bump/sgf2dg-4.026.tar.gz you have sgf2mpost.c with 1000 lines of pure C code which parses the file and generates metapost output. If I was in your place, I would write a ruby (or lua ;) parser (the file above can help you, but you can probably parse the input in a much more clever efficient way with ruby) + metapost code generator. Then you write a ConTeXt module with \startSGFscript{name} or \startSGFfile or \startSGFgame or \startGOgame the very special format of your game ... \stopSGFscript You write the content into a file (you can also prepare external files and tell ConTeXt which one is the source file), call texmfstart your-great-ruby-script file.sgf, which generates metapost output, and then you include that one in the ConTeXt document. I'm really not sure if parsing SGF files with metapost can bring you anything ... ruby scripts are fully portable, at least in ConTeXt. Mojca On 5/24/07, Wolfgang Schuster [EMAIL PROTECTED] wrote: 2007/5/24, Zhichu Chen [EMAIL PROTECTED]: Hi I love chess games, especially one kind of them which is generally called Go. I know there is some file can store each details in one game: http://www.red-bean.com/sgf/ AFAIK, there is no module available to draw chess in ConTeXt now. I wanna do this by using MetaPost and fieldstack. But I don't know how to tell metapost the details of the sgf file. Can anyone give me a suggestion? BTW, I don't like the name. It's invented by acient Chinese and it's called Weiqi. I think we can call it Siege Chess in English. -- Best Regards Chen Hi Chen, if you mean Go take a look at the following page: http://match.stanford.edu/bump/go.html There are also two packages on CTAN for LaTeX: http://www.ctan.org/tex-archive/help/Catalogue/bytopic.html#gamesgo 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- Best Regards Chen Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] list ?
Hi Hans, I succeed to do what I want thanks to you (once more ;) ) ! I'll put the resulting presentation online at least at the end of the next week (u3d + layer + custom pre-original + animation with JS and fieldstack + program runs including mplayer runs with linux + ... robotics ?) Renaud Hans Hagen a crit: maybe future version of context will provide more control; for the moment, stick to: \definehead [Topic] [chapter] \definehead [Subject] [section] \newcounter\MyTopicCounter \startsetups MyTopicList \blank \doglobal\increment\MyTopicCounter \doglobal\newcounter\MySubjectCounter \placelist[Topic][criterium=text,after=\setups{MySubjectList}] \stopsetups \startsetups MySubjectList \doglobal\increment\MySubjectCounter \doifelse{\MyTopicCounter}{\MySubjectCounter} { \placelist[Subject] } { % whatever } \stopsetups \starttext \Topic{first} \Subject{one} test \Subject{two} test \setups[MyTopicList] \page \Topic{second} \Subject{alpha} test \Subject{beta} test \setups[MyTopicList] \page \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Any idea about copy or clone fieldstack?
Hi Chen, Zhichu Chen wrote: Hello everyone, I want to display dynamic system time on each page of my presentation. Displaying system time can be manipulated by JavaScript but, a field can be shown only once. So I used clone field and it works very well for me. But when I want to change the font (xxx presents the variable that gets the field): xxx.textFont = font.LucidaBright ; it can be compiled successfully, but when I open it with acrobat reader, there are many errors from javascript console. So I think that JS don't know the font, and I don't know how to embed the font into pdf file and make JS knows it. Have you tried the method described on page 402-403 of the Acrobat JavaScript Scripting Reference (AcroJS.pdf, 27.06.2005)? Search for Use of arbitrary fonts. If I understand it right, all you need is the *right name* of the font (as JS sees/names it). [ Acrobat is required, but the trial version should work. Maybe also Adobe Type Manager Light for the clean installation of a ps font under XP. ] To make sure that all clock relevant types are embeded, you can add something like \smashedhbox{\color[white]\YOURCLOCKFONT 0123456789:} to your document. This is all untested, so don't expect too much... But let me know if it works ;) Then I turned to use field stacks. I use MetaPost to draw some needles and use JS to set_Field the fieldstack to the correct frame. But when I want to display the second clock, it seems that I should write another JS code to control the other fieldstack. So is there some command that clones the fieldstack just like \copyfield? Or how to assign the font of the field as I like? As I know, there is no command that clones a complete fieldstack. This is all a bit confusing without any example code. HTH, Peter Thank you. -- Sincerely yours, Chen Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com http://zhichu.chen.googlepages.com | www.sinap.ac.cn http://www.sinap.ac.cn ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Any idea about copy or clone fieldstack?
Thank you very much Peter On 10/19/06, Peter Rolf [EMAIL PROTECTED] wrote: Hi Chen,Have you tried the method described on page 402-403 of the Acrobat_javascript_ Scripting Reference ( AcroJS.pdf, 27.06.2005)? Search forUse of arbitrary fonts.If I understand it right, all you need is the *right name* of the font(as JS sees/names it).[ Acrobat is required, but the trial version should work. Maybe also Adobe Type Manager Light for the clean installation of a ps font underXP. ]To make sure that all clock relevant types are embeded, you can addsomething like\smashedhbox{\color[white]\YOURCLOCKFONT 0123456789:} to your document.This is all untested, so don't expect too much...But let me know if it works ;)As I know, there is no command that clones a complete fieldstack.This is all a bit confusing without any example code. HTH, Peter___ntg-context mailing listntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context I've only read the AcroJSGuide.pdf, and I thought it's all. Thank you to tell me that there is a more detailed reference. I'll try it now. -- Sincerely yours,ChenZhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] goto framed
Renaud AUBIN wrote: Hi folks ! Consider the working example: \usemodule[pre-original] \starttext \startbuffer[stack1] draw (0,0)--(10cm,10cm); \stopbuffer \startbuffer[stack2] draw (0,10cm)--(10cm,0); \stopbuffer \startbuffer[stack3] draw (0,5cm)--(10cm,5cm); \stopbuffer \definesymbol[step 1][{\processMPbuffer[stack1]}] \definesymbol[step 2][{\processMPbuffer[stack1,stack2]}] \definesymbol[step 3][{\processMPbuffer[stack1,stack2,stack3]}] \definefieldstack [stack] [step 1,step 2,step 3] [frame=off] \defineoverlay[cowbg][{\externalfigure[cow][width=10cm]}] \framed[background=cowbg,frame=off,offset=none,backgroundoffset=0pt]{{\fieldstack[stack]}} \goto{next}[JS(Walk_Field{stack})] \stoptext I naively (as always ? ;) ) tried to make the framed interactive with \goto{\framed[background=cowbg,frame=off,offset=none,backgroundoffset=0pt]{{\fieldstack[stack]}}}[JS(Walk_Field{stack})] but failed in my attempt... Is there a way to solve this problem ? Hi Renaud. How could you have missed this one? ;) http://archive.contextgarden.net/thread/20060422.200921.44436476.en.html#20060422.200921.44436476 The trick is to use a PDF layer for the trigger button (else you get a mess of stacking, interactive areas). Greetings, Peter Renaud ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context \setupoutput[pdftex] \setupinteraction[state=start] \setupcolors[state=start] \starttext \tracefieldstrue \switchtobodyfont[96pt] \def\FS#1{\framed[width=4cm,height=4cm,strut=no]{\red\bf#1}}% \definesymbol [empty] [] \definesymbol [one] [\FS{1}] \definesymbol [two] [\FS{2}] \definesymbol [three] [\FS{3}] \definesymbol [four][\FS{4}] \definesymbol [five][\FS{5}] \setupfield[interaction] [width=4cm,height=4cm, % frame=off, framecolor=blue, offset=none,% default offset causes different positioning of walk button and fieldstack clickin=JS(Walk_Field{sequence})] \definefield[Walk][check][interaction][empty][empty] \definefieldstack[sequence] [one,two,three,four,five] [frame=off, offset=none,% default offset causes different positioning of walk button and fieldstack ] \defineproperty[interaction][layer][title=interaction, state=start] \vbox{\normaloffinterlineskip \smashedvbox{\fieldstack[sequence]}% % \startproperty[interaction]% \field[Walk] \stopproperty% } \blank[2cm] \showfields \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Any idea about copy or clone fieldstack?
Hello everyone, I want to display dynamic system time on each page of my presentation. Displaying system time can be manipulated by _javascript_ but, a field can beshown only once. So I used clone field and it works very well for me. But when I want to change the font (xxx presents the variable that gets thefield): xxx.textFont = font.LucidaBright ; it can be compiled successfully, but when I open it with acrobat reader, there are many errors from _javascript_ console. So I think that JS don't know the font, and I don't know how to embed the font into pdf fileand make JS knows it. Then I turned to use field stacks. I use MetaPost to draw some needles and use JS to set_Field the fieldstack to the correct frame. But when I want to display the second clock, it seems that I should write another JS code to control the other fieldstack. So is there some command that clones the fieldstack just like \copyfield? Or how toassign the font of the field as I like? Thank you. -- Sincerely yours,ChenZhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Fielstack and Layers for Presentation
Hi Renaud, I tried your example code and it is really fun. But you should exchange the buffers with setups to minimize runtime. On my machine it's 4x faster this way. I'll better not imagine, how often you have compiled your example code, before it reached this nice and clean state ;) Renaud AUBIN wrote: Hi all, After several trial-error experiments, I obtained what I want with the attached code. I use only one background for the frames within definesymbol because the use of several background failed (only the last one is eventually displayed). Now, I would like to know if it is possible to obtain a deterministic random-like shapes, i.e. to get always the same shape for Overlay1... What I can think of is to initialize the random seed value of MP (name?) with the same value, every time before you fill a new layer. Another way would be to add the 'random' parameters to your FrameTitle macro. But I don't have much experience with random stuff, so there maybe better ways. Greetings, Peter Renaud PS: Thanks to Peter, Andrea and Hans for the thread absolute positioning of figures ;) \setupcolors[state=start] \usemodule[pre-original] \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][frame=off,background=FunnyFrame] \def\StartFrame{\startFunnyText} \def\StopFrame {\stopFunnyText } \def\FrameTitle#1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}} \setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut{TEST}\hss}} % initialize the text variable \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt(\MPstring{FunnyFrame}) ; a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ; o := BodyFontSize ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a randomized (o/2) ; fill b withcolor .85white ; draw b ; c := center p ; c := b intersectionpoint (c shifted (0,-o)--c shifted(0,o)) ; p := p shifted (c-center p) ; b := (boundingbox p) randomized (o/8) ; fill b withcolor .85white ; draw b ; draw p withcolor black; setbounds currentpicture to a ; \stopuseMPgraphic \starttext \Topic{Stacks \ Layers} \startbuffer[buf1] \FrameTitle{Overlay1} \StartFrame[width=.75\textwidth] This is the first funny frame ! \StopFrame \stopbuffer \startbuffer[buf2] \FrameTitle{Overlay2} \StartFrame[width=.75\textwidth] This is the second funny frame ! \StopFrame \stopbuffer \startbuffer[buf3] \FrameTitle{Overlay3} \StartFrame[width=.75\textwidth] This is the third funny frame ! \StopFrame \stopbuffer \definelayer[layer1][] \definelayer[layer2][] \definelayer[layer3][] \setlayer[layer1][x=.05\textwidth,y=.05\textheight,location=br]{\getbuffer[buf1]} \setlayer[layer2][x=.05\textwidth,y=.05\textheight,location=br]{\getbuffer[buf1]} \setlayer[layer2][x=.1\textwidth,y=.1\textheight,location=br]{\getbuffer[buf2]} \setlayer[layer3][x=.05\textwidth,y=.05\textheight,location=br]{\getbuffer[buf1]} \setlayer[layer3][x=.1\textwidth,y=.1\textheight,location=br]{\getbuffer[buf2]} \setlayer[layer3][x=.15\textwidth,y=.15\textheight,location=br]{\getbuffer[buf3]} \defineoverlay[overlay1][{\placelayer[layer1]}] \defineoverlay[overlay2][{\placelayer[layer2]}] \defineoverlay[overlay3][{\placelayer[layer3]}] \definesymbol[one][{\framed[width=\textwidth,height=.3\textheight,background=overlay1,frame=off]{}}] \definesymbol[two][{\framed[width=\textwidth,height=.3\textheight,background=overlay2, align=right,frame=off]{}}] \definesymbol[three][{\framed[width=\textwidth,height=.3\textheight,background=overlay3, align=right,frame=off]{}}] \definefieldstack[sequence][one,two,three][height=fit,width=fit,frame=off,offset=overlay,clickin=JS(Walk_Field{sequence})] {{\fieldstack[sequence]}} \goto{next}[JS(Walk_Field{sequence})] \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Fielstack and Layers for Presentation
Hi Renaud, Renaud AUBIN wrote: Hi all, I would use fieldstack with \getbuffer and overlays... Why the following code doesn't work ? Is there another way to do that ? \setlayer is breaking the fields here, so that they become normal, inactive content (dunno why). If you remove it, the fields appear... but the positioning is now the problem. For testing I defined the symbols only to be equal to one buffer at a time (not a combination of them). Without this restriction you get really funny positions for them. HTH, Peter TIA Renaud %%% stack.tex \setupcolors[state=start] \usemodule[pre-original] \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][frame=off,background=FunnyFrame] \def\StartFrame{\startFunnyText} \def\StopFrame {\stopFunnyText } \def\FrameTitle#1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}} \setMPtext{FunnyFrame}{} % initialize the text variable \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt(\MPstring{FunnyFrame}) ; a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ; o := BodyFontSize ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a randomized (o/2) ; fill b withcolor .85white ; draw b ; c := center p ; c := b intersectionpoint (c shifted (0,-o)--c shifted(0,o)) ; p := p shifted (c-center p) ; b := (boundingbox p) randomized (o/8) ; fill b withcolor .85white ; draw b ; draw p withcolor black; setbounds currentpicture to a ; \stopuseMPgraphic \definelayer[bglayer][position=yes] \setupbackgrounds[text][background=bglayer] \setuplayer[bglayer][position=no,corner=bottom,height=\paperheight] \starttext \startbuffer[first] \setlayer[bglayer][x=.55\textwidth,y=.9\textheight,location=b]{ \FrameTitle{Knuth} \StartFrame[width=.75\textwidth] \input knuth \StopFrame } \stopbuffer \startbuffer[second] \setlayer[bglayer][x=.625\textwidth,y=.8\textheight,location=b]{ \FrameTitle{Zapf} \StartFrame[width=.75\textwidth] \input zapf \StopFrame } \stopbuffer \startbuffer[third] \setlayer[bglayer][x=.70\textwidth,y=.7\textheight,location=b]{ \FrameTitle{Tufte} \StartFrame[width=.75\textwidth] \input tufte \StopFrame } \stopbuffer \definesymbol[empty][] \definesymbol[one][{\getbuffer[first]}] \definesymbol[two][{\getbuffer[first,second]}] \definesymbol[three][{\getbuffer[first,second,third]}] \Topic{Stacks \ Layers} {\setupbodyfont[12pt] \definefieldstack[sequence] [one,two,three] [frame=off, offset=none, clickin=JS(Walk_Field{sequence})] {\fieldstack[sequence]} \goto{next}[JS(Walk_Field{sequence})] } \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Fielstack and Layers for Presentation
Hi all, After several trial-error experiments, I obtained what I want with the attached code. I use only one background for the frames within definesymbol because the use of several background failed (only the last one is eventually displayed). Now, I would like to know if it is possible to obtain a deterministic random-like shapes, i.e. to get always the same shape for Overlay1... Renaud PS: Thanks to Peter, Andrea and Hans for the thread absolute positioning of figures ;) \setupcolors[state=start] \usemodule[pre-original] \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][frame=off,background=FunnyFrame] \def\StartFrame{\startFunnyText} \def\StopFrame {\stopFunnyText } \def\FrameTitle#1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}} \setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut{TEST}\hss}} % initialize the text variable \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt(\MPstring{FunnyFrame}) ; a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ; o := BodyFontSize ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a randomized (o/2) ; fill b withcolor .85white ; draw b ; c := center p ; c := b intersectionpoint (c shifted (0,-o)--c shifted(0,o)) ; p := p shifted (c-center p) ; b := (boundingbox p) randomized (o/8) ; fill b withcolor .85white ; draw b ; draw p withcolor black; setbounds currentpicture to a ; \stopuseMPgraphic \starttext \Topic{Stacks \ Layers} \startbuffer[buf1] \FrameTitle{Overlay1} \StartFrame[width=.75\textwidth] This is the first funny frame ! \StopFrame \stopbuffer \startbuffer[buf2] \FrameTitle{Overlay2} \StartFrame[width=.75\textwidth] This is the second funny frame ! \StopFrame \stopbuffer \startbuffer[buf3] \FrameTitle{Overlay3} \StartFrame[width=.75\textwidth] This is the third funny frame ! \StopFrame \stopbuffer \definelayer[layer1][] \definelayer[layer2][] \definelayer[layer3][] \setlayer[layer1][x=.05\textwidth,y=.05\textheight,location=br]{\getbuffer[buf1]} \setlayer[layer2][x=.05\textwidth,y=.05\textheight,location=br]{\getbuffer[buf1]} \setlayer[layer2][x=.1\textwidth,y=.1\textheight,location=br]{\getbuffer[buf2]} \setlayer[layer3][x=.05\textwidth,y=.05\textheight,location=br]{\getbuffer[buf1]} \setlayer[layer3][x=.1\textwidth,y=.1\textheight,location=br]{\getbuffer[buf2]} \setlayer[layer3][x=.15\textwidth,y=.15\textheight,location=br]{\getbuffer[buf3]} \defineoverlay[overlay1][{\placelayer[layer1]}] \defineoverlay[overlay2][{\placelayer[layer2]}] \defineoverlay[overlay3][{\placelayer[layer3]}] \definesymbol[one][{\framed[width=\textwidth,height=.3\textheight,background=overlay1,frame=off]{}}] \definesymbol[two][{\framed[width=\textwidth,height=.3\textheight,background=overlay2, align=right,frame=off]{}}] \definesymbol[three][{\framed[width=\textwidth,height=.3\textheight,background=overlay3, align=right,frame=off]{}}] \definefieldstack[sequence][one,two,three][height=fit,width=fit,frame=off,offset=overlay,clickin=JS(Walk_Field{sequence})] {{\fieldstack[sequence]}} \goto{next}[JS(Walk_Field{sequence})] \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Fielstack and Layers for Presentation
Hi all, I would use fieldstack with \getbuffer and overlays... Why the following code doesn't work ? Is there another way to do that ? TIA Renaud %%% stack.tex \setupcolors[state=start] \usemodule[pre-original] \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][frame=off,background=""> \def\StartFrame{\startFunnyText} \def\StopFrame {\stopFunnyText } \def\FrameTitle#1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}} \setMPtext{FunnyFrame}{} % initialize the text variable \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt(\MPstring{FunnyFrame}) ; a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ; o := BodyFontSize ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a randomized (o/2) ; fill b withcolor .85white ; draw b ; c := center p ; c := b intersectionpoint (c shifted (0,-o)--c shifted(0,o)) ; p := p shifted (c-center p) ; b := (boundingbox p) randomized (o/8) ; fill b withcolor .85white ; draw b ; draw p withcolor black; setbounds currentpicture to a ; \stopuseMPgraphic \definelayer[bglayer][position=yes] \setupbackgrounds[text][background=""> \setuplayer[bglayer][position=no,corner=bottom,height=\paperheight] \starttext \startbuffer[first] \setlayer[bglayer][x=.55\textwidth,y=.9\textheight,location=b]{ \FrameTitle{Knuth} \StartFrame[width=.75\textwidth] \input knuth \StopFrame } \stopbuffer \startbuffer[second] \setlayer[bglayer][x=.625\textwidth,y=.8\textheight,location=b]{ \FrameTitle{Zapf} \StartFrame[width=.75\textwidth] \input zapf \StopFrame } \stopbuffer \startbuffer[third] \setlayer[bglayer][x=.70\textwidth,y=.7\textheight,location=b]{ \FrameTitle{Tufte} \StartFrame[width=.75\textwidth] \input tufte \StopFrame } \stopbuffer \definesymbol[empty][] \definesymbol[one][{\getbuffer[first]}] \definesymbol[two][{\getbuffer[first,second]}] \definesymbol[three][{\getbuffer[first,second,third]}] \Topic{Stacks \ Layers} {\setupbodyfont[12pt] \definefieldstack[sequence] [one,two,three] [frame=off, offset=none, clickin=JS(Walk_Field{sequence})] {\fieldstack[sequence]} \goto{next}[JS(Walk_Field{sequence})] } \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Fieldstack Walk
Michal Kvasnička wrote: Good afternoon. Many thanks, this solves the problem -- at least partially. The frames are `walking' now, but new problems appeared. I found that when I set `clickin=...', it is set it automatically to `clickout' as well, so one mouse click runs the JavaScript code twice. So I've set it this way: \definefieldstack[fgolds2] [sgolds1,sgolds2a,sgolds2b,sgolds2c,sgolds2d,sgolds2] [frame=off,option=,clickout=JS(Walk_Field{fgolds3}),clickin=] It's better, but I found that now frames are walking in a strange order. It is rather puzzling, since when it is invoked by \goto{...}[JS(...)], it works well. Moreover, it does different things at AdobeReader 7.x under Linux, and Acrobat 4.x under Windoze. Can you help me to solve it? Took some time, but it works now. What I don't understand, is the strange behaviour of the offset parameter in this case. See attached file. Greets, Peter Many thanks once more. M.K. % interface=en output=pdftex % Time-stamp: Samstag, 22 April 2006 21:53:30; test.tex % \setupinteraction[state=start] \setupcolors[state=start] \starttext \tracefieldstrue \switchtobodyfont[96pt] \def\FS#1{\framed[width=4cm,height=4cm,strut=no]{\red\bf#1}}% \definesymbol [empty] [] \definesymbol [one] [\FS{1}] \definesymbol [two] [\FS{2}] \definesymbol [three] [\FS{3}] \definesymbol [four][\FS{4}] \definesymbol [five][\FS{5}] \setupfield[interaction] [width=4cm,height=4cm, % frame=off, framecolor=blue, offset=none,% default offset causes different positioning of walk button and fieldstack clickin=JS(Walk_Field{sequence})] \definefield[Walk][check][interaction][empty][empty] \definefieldstack[sequence] [one,two,three,four,five] [frame=off, offset=none,% default offset causes different positioning of walk button and fieldstack clickin=JS(Walk_Field{sequence})] \defineproperty[interaction][layer][title=walkfield, state=start] \vbox{\forgetall \nointerlineskip\smashedvbox{\fieldstack[sequence]}% % \startproperty[interaction]% \nointerlineskip\field[Walk] \stopproperty% } \blank[2cm] \showfields \stoptext %%% Local Variables: %%% mode: context %%% TeX-master: %%% End: ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Fieldstack Walk
Thanks Sanjoy for pointing this out. Both problems are still *unfixed* (beta from 17.04). Unfortunately fixing them doesn't solve my problem. I'll try it again later. Maybe I was to tired yesterday to solve this and the error is on my side... Greets, Peter Sanjoy Mahajan wrote: there are still some problems with spurious spaces. Just on the off chance that it's the same problem I had with some section numbers getting an extra space before them (in pdf mode): If you are running pdf(e)tex 1.21, you might need the patch below; then remake the formats. I think (but haven't tried it myself) that pdftex 1.30 wants the original spacings (i.e. don't apply the patch in that case). See http://www.ntg.nl/pipermail/ntg-context/2006/017388.html diff -r f6897ee163d2 -r 5ff7b6430984 tex/context/base/enco-pfr.tex --- a/tex/context/base/enco-pfr.tex Fri Apr 14 14:45:01 2006 -0400 +++ b/tex/context/base/enco-pfr.tex Fri Apr 14 14:51:47 2006 -0400 @@ -188,7 +188,7 @@ \else\ifcsname\pdffontfileresource\endcsname % is there a resource already included \doifsomething\pdffontfileresource - {\pdfobj reserveobjnum {}% + {\pdfobj reserveobjnum{}% \setxvalue\pdffontresource{\the\pdflastobj}% \flushatshipout{\dododoincludepdffontresource{\currentencoding}}}% %\doglobal\appendetoks @@ -216,7 +216,7 @@ {\expandafter\ifx\csname\pdffontresource\endcsname\relax \expandafter\ifx\csname\pdffontfileresource\endcsname\relax\else \doifsomething\pdffontfileresource -{\pdfobj reserveobjnum {}% +{\pdfobj reserveobjnum{}% \setxvalue\pdffontresource{\the\pdflastobj}% \flushatshipout{\dododoincludepdffontresource{\currentencoding}}}% % \doglobal\appendetoks ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Fieldstack Walk
From:Peter Rolf [EMAIL PROTECTED] Both problems are still *unfixed* (beta from 17.04). The one I pointed out doesn't have an obvious solution since (I think) the reserveobjnum spacing change breaks with pdftex 1.30 but is needed with pdftex 1.21. I guess the magic line could be wrapped in a test for pdftexminorversion or something like that (and that wrapped in a test for using pdftex at all). -Sanjoy `Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1. ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Fieldstack Walk
Good morning. I use a fieldstack in my presentation. I'd like to go to the next frame when I click on the figure. I tried this: \definefieldstack[fgolds3] [sgolds1,sgolds3a,sgolds3b,sgolds3c,sgolds3] [frame=off,clickin=JS(Walk_Field{fgolds3})] \definesymbol[sgolds1][{\externalfigure[golds1]}] \definesymbol[sgolds3a][{\externalfigure[golds3a]}] \definesymbol[sgolds3b][{\externalfigure[golds3b]}] \definesymbol[sgolds3c][{\externalfigure[golds3c]}] \definesymbol[sgolds3][{\externalfigure[golds3]}] \placefigure[here]{none}{\fieldstack[fgolds3]} I thought that `clickin=JS(Walk_Field{fgolds3})' makes precisely what I need, but it does not. How can I make it work? With many thanks yours Michal Kvasnicka ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Fieldstack Walk
Michal Kvasnička wrote: Good morning. I use a fieldstack in my presentation. I'd like to go to the next frame when I click on the figure. I tried this: \definefieldstack[fgolds3] [sgolds1,sgolds3a,sgolds3b,sgolds3c,sgolds3] [frame=off,clickin=JS(Walk_Field{fgolds3})] \definesymbol[sgolds1][{\externalfigure[golds1]}] \definesymbol[sgolds3a][{\externalfigure[golds3a]}] \definesymbol[sgolds3b][{\externalfigure[golds3b]}] \definesymbol[sgolds3c][{\externalfigure[golds3c]}] \definesymbol[sgolds3][{\externalfigure[golds3]}] \placefigure[here]{none}{\fieldstack[fgolds3]} just guessing: first define the symbols, then define the fieldstack. Hope that helps, Peter I thought that `clickin=JS(Walk_Field{fgolds3})' makes precisely what I need, but it does not. How can I make it work? With many thanks yours Michal Kvasnicka ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Fieldstack Walk
Hi Michal, Michal Kvasnička wrote: Hi Peter, thank for your answer, but it doesn't help. First, it seems the order is not important in ConTeXt. Second, the fieldstack works well. I can even make it walk with \goto{...}[JS(Walk_Field{fgolds3})]. The only thing that doesn't work is that I can't click on the figure to make it walk. I see :) Can you try the following: \definefieldstack[fgolds3] [sgolds1,sgolds3a,sgolds3b,sgolds3c,sgolds3] [frame=off,option=,clickin=JS(Walk_Field{fgolds3})] ^^ option is readonly as default (see \dodofieldstack in core-fld.tex), so there can be no interaction (if I'm not again completely wrong). Greets, Peter P.S.: don't know why this mail was replied to your mail address and not to ntg-context... Thanks anyway. M.K. I use a fieldstack in my presentation. I'd like to go to the next frame when I click on the figure. I tried this: \definefieldstack[fgolds3] [sgolds1,sgolds3a,sgolds3b,sgolds3c,sgolds3] [frame=off,clickin=JS(Walk_Field{fgolds3})] \definesymbol[sgolds1][{\externalfigure[golds1]}] \definesymbol[sgolds3a][{\externalfigure[golds3a]}] \definesymbol[sgolds3b][{\externalfigure[golds3b]}] \definesymbol[sgolds3c][{\externalfigure[golds3c]}] \definesymbol[sgolds3][{\externalfigure[golds3]}] \placefigure[here]{none}{\fieldstack[fgolds3]} just guessing: first define the symbols, then define the fieldstack. Hope that helps, Peter I thought that `clickin=JS(Walk_Field{fgolds3})' makes precisely what I need, but it does not. How can I make it work? With many thanks yours Michal Kvasnicka ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Fieldstack Walk
Good afternoon. Many thanks, this solves the problem -- at least partially. The frames are `walking' now, but new problems appeared. I found that when I set `clickin=...', it is set it automatically to `clickout' as well, so one mouse click runs the JavaScript code twice. So I've set it this way: \definefieldstack[fgolds2] [sgolds1,sgolds2a,sgolds2b,sgolds2c,sgolds2d,sgolds2] [frame=off,option=,clickout=JS(Walk_Field{fgolds3}),clickin=] It's better, but I found that now frames are walking in a strange order. It is rather puzzling, since when it is invoked by \goto{...}[JS(...)], it works well. Moreover, it does different things at AdobeReader 7.x under Linux, and Acrobat 4.x under Windoze. Can you help me to solve it? Many thanks once more. M.K. ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Fieldstack Walk
Michal Kvasnička wrote: Good afternoon. Many thanks, this solves the problem -- at least partially. The frames are `walking' now, but new problems appeared. I found that when I set `clickin=...', it is set it automatically to `clickout' as well, so one mouse click runs the JavaScript code twice. So I've set it this way: \definefieldstack[fgolds2] [sgolds1,sgolds2a,sgolds2b,sgolds2c,sgolds2d,sgolds2] [frame=off,option=,clickout=JS(Walk_Field{fgolds3}),clickin=] It's better, but I found that now frames are walking in a strange order. It is rather puzzling, since when it is invoked by \goto{...}[JS(...)], it works well. Moreover, it does different things at AdobeReader 7.x under Linux, and Acrobat 4.x under Windoze. Can you help me to solve it? Mhh, looks like you are going new ways with making the fieldstack interactive (maybe not intended?). Sorry, but I can't help you any further in this direction. Another possibility that I can think of is to add an invisible button field (same dimensions) behind a normal fieldstack, that calls JS(Walk_Field...). Should cause no conflicts with the readonly (non interactive) fieldstack [but this is untested!]. You can simply check this with a button beside the fieldstack and if this works ok, you can use \nointerlineskip \smashedvbox{YOUR WALKBUTTON FIELD}% \placefigure[here]{none}{\fieldstack[fgolds3]} to place it under your fieldstack. HTH, Peter Many thanks once more. M.K. ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Fieldstack Walk
Peter Rolf wrote: Michal Kvasnička wrote: Good afternoon. Many thanks, this solves the problem -- at least partially. The frames are `walking' now, but new problems appeared. I found that when I set `clickin=...', it is set it automatically to `clickout' as well, so one mouse click runs the JavaScript code twice. So I've set it this way: \definefieldstack[fgolds2] [sgolds1,sgolds2a,sgolds2b,sgolds2c,sgolds2d,sgolds2] [frame=off,option=,clickout=JS(Walk_Field{fgolds3}),clickin=] It's better, but I found that now frames are walking in a strange order. It is rather puzzling, since when it is invoked by \goto{...}[JS(...)], it works well. Moreover, it does different things at AdobeReader 7.x under Linux, and Acrobat 4.x under Windoze. Can you help me to solve it? Mhh, looks like you are going new ways with making the fieldstack interactive (maybe not intended?). Sorry, but I can't help you any further in this direction. Another possibility that I can think of is to add an invisible button field (same dimensions) behind a normal fieldstack, that calls JS(Walk_Field...). Should cause no conflicts with the readonly (non interactive) fieldstack [but this is untested!]. You can simply check this with a button beside the fieldstack and if this works ok, you can use \nointerlineskip \smashedvbox{YOUR WALKBUTTON FIELD}% \placefigure[here]{none}{\fieldstack[fgolds3]} to place it under your fieldstack. Bad news... I just tested this and it works only as long as you don't stack the button and the fieldstack. The only solution I have found, is to seperate the interaction button into a pdf layer. Things work as desired (you need a context version not older than 2 month), but there are still some problems with spurious spaces. Example is attached. Greets, Peter HTH, Peter Many thanks once more. M.K. ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context % interface=en output=pdftex % Time-stamp: Dienstag, 18 April 2006 23:16:39; test.tex % \setupinteraction[state=start] \setupcolors[state=start] \starttext \switchtobodyfont[ss,32pt] \def\FS#1{\framed[width=4cm,height=4cm]{#1}}% \definesymbol[empty][] \definesymbol[sgolds1][\FS{A}] \definesymbol[sgolds3a][\FS{B}] \definesymbol[sgolds3b][\FS{C}] \definesymbol[sgolds3c][\FS{D}] \definesymbol[sgolds3][\FS{E}] \setupfield[hidden][width=4cm,height=4cm, % frame=off, framecolor=blue, clickin=JS(Walk_Field{fgolds3})] \definefield[Walk][check][hidden][empty][empty] \definefieldstack[fgolds3] [sgolds1,sgolds3a,sgolds3b,sgolds3c,sgolds3] [frame=off,clickin=JS(Walk_Field{fgolds3})] \defineproperty[interaction][layer][title=walkfield, state=start] %\showmakeup % can't get rid of the spurious apaces... \vbox{\forgetall \nointerlineskip \smashedvbox{\fieldstack[fgolds3]}% % \startproperty[interaction]% \nointerlineskip \field[Walk] \stopproperty% } \stoptext %%% Local Variables: %%% mode: context %%% TeX-master: %%% End: ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] widgets in layers (property)
New year, old problem... Hi all, I want to use widgets (tooltip, buttons,..) in some stacked pdf layers. My problem is, that the widgets are somehow not bound to the state of their layer. They are still active, even if the surrounding layer is deactivated. I add a mimimal example (it's best to open the 'Layers' tab in acrobat). The first layer with tooltip is not active, the second one is active, but has no tooltip. Just move the mouse over the text and you can see the tooltip from the deactivated layer one. I have also tried it with a fieldstack, but 'annotations cannot be inside an XForm'. Any hints are welcome. Peter % interface=en output=pdftex % Time-stamp: Freitag, 30 Dezember 2005 13:54:11; test.tex % \setupcolors[state=start] \setupinteraction[state=start] \starttext \def\Stackbox#1{\nointerlineskip\vbox\bgroup\wd#1=\zeropoint\ht#1=\zeropoint\dp#1=\zeropoint \dontleavehmode\noindent\box#1\egroup} \defineproperty[layer1][layer][title={one}, state=stop] \defineproperty[layer2][layer][title={two}, state=start] \newbox\Layerbox \startproperty[layer1] \setbox\Layerbox\vbox{\framed[width=160mm,height=120mm,framecolor=red] {\tooltip{First Layer with tooltip}{widget of layer one is active}}} \Stackbox\Layerbox \stopproperty \startproperty[layer2] \setbox\Layerbox\vbox{\framed[width=160mm,height=120mm,framecolor=green,frameoffset=1pt] {Second Layer without tooltip}} \Stackbox\Layerbox \stopproperty \stoptext %%% Local Variables: %%% mode: context %%% TeX-master: %%% End: ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] widgets in layers (property)
Hi all, I want to use widgets (tooltip, buttons,..) in some stacked pdf layers. My problem is, that the widgets are somehow not bound to the state of their layer. They are still active, even if the surrounding layer is deactivated. I add a mimimal example (it's best to open the 'Layers' tab in acrobat). The first layer with tooltip ist not active, the second one is active, but has no tooltip. Just move the mouse over the text and you can see the tooltip from the deactivated layer one. I have also tried it with a fieldstack, but 'annotations cannot be inside an XForm'. Any hints are welcome. Peter % interface=en output=pdftex % Time-stamp: Freitag, 30 Dezember 2005 13:54:11; test.tex % \setupcolors[state=start] \setupinteraction[state=start] \starttext \def\Stackbox#1{\nointerlineskip\vbox\bgroup\wd#1=\zeropoint\ht#1=\zeropoint\dp#1=\zeropoint \dontleavehmode\noindent\box#1\egroup} \defineproperty[layer1][layer][title={one}, state=stop] \defineproperty[layer2][layer][title={two}, state=start] \newbox\Layerbox \startproperty[layer1] \setbox\Layerbox\vbox{\framed[width=160mm,height=120mm,framecolor=red] {\tooltip{First Layer with tooltip}{widget of layer one is active}}} \Stackbox\Layerbox \stopproperty \startproperty[layer2] \setbox\Layerbox\vbox{\framed[width=160mm,height=120mm,framecolor=green,frameoffset=1pt] {Second Layer without tooltip}} \Stackbox\Layerbox \stopproperty \stoptext %%% Local Variables: %%% mode: context %%% TeX-master: %%% End: ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Re: Animations in ConTeXt
Mojca Miklavec wrote: I don't get it. Examples (animations) on http://www.fi.muni.cz/~xholecek/animations/ compile and work OK with my TeX and Acrobat (Windows XP, Adobe Acrobat Professional 6.0.1). However, the example below doesn't work on my computer. I replaced some lines below with: \starttext \placefigure [here] [fig:animation] {A simple \MetaFun\ animation, click \goto {here} [JS(Rotate_Star)] to start (or stop) or % this line was added as described in MetaFun manual click \goto {here} [JS(Walk_Field{vortex})] for next step} {\fieldstack [vortex]} \stoptext which results in the PDF file attached. (old/buggy?) Acrobat/OS or because of problems in JavaScript? works ok here in acrobat 7 (acrobat has fuzzy ways of initializing js and widgets) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Re: Animations in ConTeXt
Hans Hagen wrote: Mojca Miklavec wrote: I don't get it. Examples (animations) on http://www.fi.muni.cz/~xholecek/animations/ compile and work OK with my TeX and Acrobat (Windows XP, Adobe Acrobat Professional 6.0.1). However, the example below doesn't work on my computer. I replaced some lines below with: \starttext \placefigure [here] [fig:animation] {A simple \MetaFun\ animation, click \goto {here} [JS(Rotate_Star)] to start (or stop) or % this line was added as described in MetaFun manual click \goto {here} [JS(Walk_Field{vortex})] for next step} {\fieldstack [vortex]} \stoptext which results in the PDF file attached. (old/buggy?) Acrobat/OS or because of problems in JavaScript? works ok here in acrobat 7 (acrobat has fuzzy ways of initializing js and widgets) Yes, in the meantime I noticed that too. Acrobat 5 doesn't support those JS stuff at all, but the funny thing is that Acrobat 6 supports only a half of it. I was already running a continuous animation in Acrobat 6 (the one mentioned above), however it was compiled from plain TeX and I don't know how to include the fields in the same way in ConTeXt and how to write the same JS code for them. JS(Rotate_Star) didn't work in Acrobat 6, but I don't want to care about the bugs in Adobe products. They will never be removed (if ever) as soon as the bugs are removed from ConTeXt :) Mojca ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Re: Animations in ConTeXt
I don't get it. Examples (animations) on http://www.fi.muni.cz/~xholecek/animations/ compile and work OK with my TeX and Acrobat (Windows XP, Adobe Acrobat Professional 6.0.1). However, the example below doesn't work on my computer. I replaced some lines below with: \starttext \placefigure [here] [fig:animation] {A simple \MetaFun\ animation, click \goto {here} [JS(Rotate_Star)] to start (or stop) or % this line was added as described in MetaFun manual click \goto {here} [JS(Walk_Field{vortex})] for next step} {\fieldstack [vortex]} \stoptext which results in the PDF file attached. Stepping in JS(Walk_Field{vortex}) works OK, while continuous animation in JS(Rotate_Star) doesn't. Is this because of my (old?) ConTeXt distribution (ver 2005.01.31, fmt 2005.5.16), because of my (old/buggy?) Acrobat/OS or because of problems in JavaScript? Thank you, Mojca Willi Egger wrote: Hi Richard, thanks for this example. I tried it and voilà! Willi Richard Hirsch wrote: Richard Rascher-Friesenhausen asked So again. Is it possible to write something like the above animation packages in ConTeXt (as a module)? If Acrobat can display them, ConTeXt can generate them. Here is a simple example. \setupoutput [pdf] \setupcolors [state=start] \setupinteraction [state=start] \setuppapersize [S6][S6] %% this is just code to get something to animate \startMPinclusions picture thearrow, thestar; drawarrow (origin--up) scaled 10mm withpen pencircle scaled 3pt withcolor .9 red; setbounds currentpicture to (fullcircle scaled 22mm); thearrow:= currentpicture scaled 5; currentpicture:= nullpicture; for angle=0 step 72 until 359: draw thearrow rotated angle; endfor thestar:= currentpicture; currentpicture:= nullpicture \stopMPinclusions \setupMPvariables [drawstar] [rotation=0] \startuniqueMPgraphic{drawstar}{rotation} draw thestar rotated \MPvar{rotation}; \stopuniqueMPgraphic %% now we define some symbols (the frames of the animated sequence) \def\definestarsymbol#1{% \definesymbol [star #1] [\uniqueMPgraphic{drawstar}{rotation=#1}]} \definestarsymbol{0} \definestarsymbol{6} \definestarsymbol{12} \definestarsymbol{18} \definestarsymbol{24} \definestarsymbol{30} \definestarsymbol{36} \definestarsymbol{42} \definestarsymbol{48} \definestarsymbol{54} \definestarsymbol{60} \definestarsymbol{66} %% the frames are put into a fieldstack \definefieldstack [vortex] [star 0, star 6, star 12, star 18, star 24, star 30, star 36, star 42, star 48, star 54, star 60, star 66] %% and this is the JavaScrip code that displays the frames one by one \startJSpreamble MyField used later var current = 1; var delay = 200; % 200 milliseconds var timer; var running = false;% animation currently not running function Advance_Angle ( ) { this.getField(vortex:+current).value = Off; if (++current 12)% number of frames { current = 1; }% loop through frames this.getField(vortex:+current).value = On; } \stopJSpreamble %% we want to control the starting and stopping of the animation \startJScode Rotate_Star uses MyField if (running) { try { app.clearInterval(timer); } catch(except) {}; running = false; } else { timer = app.setInterval(Advance_Angle(),delay); running = true; } \stopJScode \starttext \placefigure [here] [fig:animation] {A simple \MetaFun\ animation, click \goto {here} [JS(Rotate_Star)] to start (or stop)} {\fieldstack [vortex]} \stoptext Best regards, Richard star.pdf Description: Adobe PDF document ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Re: Animations in ConTeXt
Hi Mojca, this is strange, on my installation with Acrobat 7.0.1 under Windows XP both the stepwise and continuous part work properly. Willi Mojca Miklavec wrote: I don't get it. Examples (animations) on http://www.fi.muni.cz/~xholecek/animations/ compile and work OK with my TeX and Acrobat (Windows XP, Adobe Acrobat Professional 6.0.1). However, the example below doesn't work on my computer. I replaced some lines below with: \starttext \placefigure [here] [fig:animation] {A simple \MetaFun\ animation, click \goto {here} [JS(Rotate_Star)] to start (or stop) or % this line was added as described in MetaFun manual click \goto {here} [JS(Walk_Field{vortex})] for next step} {\fieldstack [vortex]} \stoptext which results in the PDF file attached. Stepping in JS(Walk_Field{vortex}) works OK, while continuous animation in JS(Rotate_Star) doesn't. Is this because of my (old?) ConTeXt distribution (ver 2005.01.31, fmt 2005.5.16), because of my (old/buggy?) Acrobat/OS or because of problems in JavaScript? Thank you, Mojca Willi Egger wrote: Hi Richard, thanks for this example. I tried it and voilà! Willi Richard Hirsch wrote: Richard Rascher-Friesenhausen asked So again. Is it possible to write something like the above animation packages in ConTeXt (as a module)? If Acrobat can display them, ConTeXt can generate them. Here is a simple example. \setupoutput [pdf] \setupcolors [state=start] \setupinteraction [state=start] \setuppapersize [S6][S6] %% this is just code to get something to animate \startMPinclusions picture thearrow, thestar; drawarrow (origin--up) scaled 10mm withpen pencircle scaled 3pt withcolor .9 red; setbounds currentpicture to (fullcircle scaled 22mm); thearrow:= currentpicture scaled 5; currentpicture:= nullpicture; for angle=0 step 72 until 359: draw thearrow rotated angle; endfor thestar:= currentpicture; currentpicture:= nullpicture \stopMPinclusions \setupMPvariables [drawstar] [rotation=0] \startuniqueMPgraphic{drawstar}{rotation} draw thestar rotated \MPvar{rotation}; \stopuniqueMPgraphic %% now we define some symbols (the frames of the animated sequence) \def\definestarsymbol#1{% \definesymbol [star #1] [\uniqueMPgraphic{drawstar}{rotation=#1}]} \definestarsymbol{0} \definestarsymbol{6} \definestarsymbol{12} \definestarsymbol{18} \definestarsymbol{24} \definestarsymbol{30} \definestarsymbol{36} \definestarsymbol{42} \definestarsymbol{48} \definestarsymbol{54} \definestarsymbol{60} \definestarsymbol{66} %% the frames are put into a fieldstack \definefieldstack [vortex] [star 0, star 6, star 12, star 18, star 24, star 30, star 36, star 42, star 48, star 54, star 60, star 66] %% and this is the JavaScrip code that displays the frames one by one \startJSpreamble MyField used later var current = 1; var delay = 200; % 200 milliseconds var timer; var running = false;% animation currently not running function Advance_Angle ( ) { this.getField(vortex:+current).value = Off; if (++current 12)% number of frames { current = 1; }% loop through frames this.getField(vortex:+current).value = On; } \stopJSpreamble %% we want to control the starting and stopping of the animation \startJScode Rotate_Star uses MyField if (running) { try { app.clearInterval(timer); } catch(except) {}; running = false; } else { timer = app.setInterval(Advance_Angle(),delay); running = true; } \stopJScode \starttext \placefigure [here] [fig:animation] {A simple \MetaFun\ animation, click \goto {here} [JS(Rotate_Star)] to start (or stop)} {\fieldstack [vortex]} \stoptext Best regards, Richard ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Re: Animations in ConTeXt
On 5/22/05, Richard Hirsch [EMAIL PROTECTED] wrote: Of course you would want to put the symbol definitions and the definition of the fieldstack into a loop. I tried %% \newcount\angle %% \angle=0%\zerocount %% \dorecurse{12} {% %%\number\angle:\qquad %%\definestarsymbol{\the\angle} %%\symbol[star \number\angle]\par %%\advance\angle by 6} and did get the single symbols. I wasn't successful however in putting the symbol list of the fieldstack definition into a loop. Perhaps the ConTeXt gurus can help. I discovered some possible sources of problems, but didn't manage to solve them. I changed this part of code (just for debugging reasons): \startuniqueMPgraphic{drawstar}{rotation} draw thestar rotated \MPvar{rotation}; % this line was added label(\MPvar{rotation}, origin); \stopuniqueMPgraphic Problem N. #1: -- Consider now the following definition: \newcount\angle \angle=0 \definesymbol [star \the\angle] [\uniqueMPgraphic{drawstar}{rotation=\the\angle}] \advance\angle by 6 \definesymbol [star \the\angle] [\uniqueMPgraphic{drawstar}{rotation=\the\angle}] This should define two symbols, \symbol[star 0] and \symbol[star 6]. It did, but rotation=\the\angle resulted in 6 in both cases (the last value), so we get two identical pictures. \the\angle can be replaced manually by 0/6/12/... but that's not the point. Problem N. #2: -- Instead of writing \definestarsymbol{0} \definestarsymbol{6} \definestarsymbol{12} ... I tried to use: \newcount\angle {\angle=0\loop\ifnum\angle67% \definesymbol [star \the\angle] [{\uniqueMPgraphic{drawstar}{rotation=0}}] Defining symbol \the\angle \dots\crlf \advance\angle by 6 \repeat} Because of some unknown reason \symbol[star 0], ... cannot be recalled at all. Can anyone find the reason for problems? I had very similiar problems when trying to add \loop\ifnum...\repeat to the example in http://www.fi.muni.cz/~xholecek/animations/, which is written in plain TeX anyway. Mojca ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Re: Animations in ConTeXt
Hi Richard, thanks for this example. I tried it and voilà! Willi Richard Hirsch wrote: Richard Rascher-Friesenhausen asked So again. Is it possible to write something like the above animation packages in ConTeXt (as a module)? If Acrobat can display them, ConTeXt can generate them. Here is a simple example. \setupoutput [pdf] \setupcolors [state=start] \setupinteraction [state=start] \setuppapersize [S6][S6] %% this is just code to get something to animate \startMPinclusions picture thearrow, thestar; drawarrow (origin--up) scaled 10mm withpen pencircle scaled 3pt withcolor .9 red; setbounds currentpicture to (fullcircle scaled 22mm); thearrow:= currentpicture scaled 5; currentpicture:= nullpicture; for angle=0 step 72 until 359: draw thearrow rotated angle; endfor thestar:= currentpicture; currentpicture:= nullpicture \stopMPinclusions \setupMPvariables [drawstar] [rotation=0] \startuniqueMPgraphic{drawstar}{rotation} draw thestar rotated \MPvar{rotation}; \stopuniqueMPgraphic %% now we define some symbols (the frames of the animated sequence) \def\definestarsymbol#1{% \definesymbol [star #1] [\uniqueMPgraphic{drawstar}{rotation=#1}]} \definestarsymbol{0} \definestarsymbol{6} \definestarsymbol{12} \definestarsymbol{18} \definestarsymbol{24} \definestarsymbol{30} \definestarsymbol{36} \definestarsymbol{42} \definestarsymbol{48} \definestarsymbol{54} \definestarsymbol{60} \definestarsymbol{66} %% the frames are put into a fieldstack \definefieldstack [vortex] [star 0, star 6, star 12, star 18, star 24, star 30, star 36, star 42, star 48, star 54, star 60, star 66] %% and this is the JavaScrip code that displays the frames one by one \startJSpreamble MyField used later var current = 1; var delay = 200; % 200 milliseconds var timer; var running = false;% animation currently not running function Advance_Angle ( ) { this.getField(vortex:+current).value = Off; if (++current 12)% number of frames { current = 1; }% loop through frames this.getField(vortex:+current).value = On; } \stopJSpreamble %% we want to control the starting and stopping of the animation \startJScode Rotate_Star uses MyField if (running) { try { app.clearInterval(timer); } catch(except) {}; running = false; } else { timer = app.setInterval(Advance_Angle(),delay); running = true; } \stopJScode \starttext \placefigure [here] [fig:animation] {A simple \MetaFun\ animation, click \goto {here} [JS(Rotate_Star)] to start (or stop)} {\fieldstack [vortex]} \stoptext Of course you would want to put the symbol definitions and the definition of the fieldstack into a loop. I tried %% \newcount\angle %% \angle=0%\zerocount %% \dorecurse{12} {% %%\number\angle:\qquad %%\definestarsymbol{\the\angle} %%\symbol[star \number\angle]\par %%\advance\angle by 6} and did get the single symbols. I wasn't successful however in putting the symbol list of the fieldstack definition into a loop. Perhaps the ConTeXt gurus can help. Best regards, Richard ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Re: Animations in ConTeXt
Richard Rascher-Friesenhausen asked So again. Is it possible to write something like the above animation packages in ConTeXt (as a module)? If Acrobat can display them, ConTeXt can generate them. Here is a simple example. \setupoutput [pdf] \setupcolors [state=start] \setupinteraction [state=start] \setuppapersize [S6][S6] %% this is just code to get something to animate \startMPinclusions picture thearrow, thestar; drawarrow (origin--up) scaled 10mm withpen pencircle scaled 3pt withcolor .9 red; setbounds currentpicture to (fullcircle scaled 22mm); thearrow:= currentpicture scaled 5; currentpicture:= nullpicture; for angle=0 step 72 until 359: draw thearrow rotated angle; endfor thestar:= currentpicture; currentpicture:= nullpicture \stopMPinclusions \setupMPvariables [drawstar] [rotation=0] \startuniqueMPgraphic{drawstar}{rotation} draw thestar rotated \MPvar{rotation}; \stopuniqueMPgraphic %% now we define some symbols (the frames of the animated sequence) \def\definestarsymbol#1{% \definesymbol [star #1] [\uniqueMPgraphic{drawstar}{rotation=#1}]} \definestarsymbol{0} \definestarsymbol{6} \definestarsymbol{12} \definestarsymbol{18} \definestarsymbol{24} \definestarsymbol{30} \definestarsymbol{36} \definestarsymbol{42} \definestarsymbol{48} \definestarsymbol{54} \definestarsymbol{60} \definestarsymbol{66} %% the frames are put into a fieldstack \definefieldstack [vortex] [star 0, star 6, star 12, star 18, star 24, star 30, star 36, star 42, star 48, star 54, star 60, star 66] %% and this is the JavaScrip code that displays the frames one by one \startJSpreamble MyField used later var current = 1; var delay = 200; % 200 milliseconds var timer; var running = false;% animation currently not running function Advance_Angle ( ) { this.getField(vortex:+current).value = Off; if (++current 12)% number of frames { current = 1; }% loop through frames this.getField(vortex:+current).value = On; } \stopJSpreamble %% we want to control the starting and stopping of the animation \startJScode Rotate_Star uses MyField if (running) { try { app.clearInterval(timer); } catch(except) {}; running = false; } else { timer = app.setInterval(Advance_Angle(),delay); running = true; } \stopJScode \starttext \placefigure [here] [fig:animation] {A simple \MetaFun\ animation, click \goto {here} [JS(Rotate_Star)] to start (or stop)} {\fieldstack [vortex]} \stoptext Of course you would want to put the symbol definitions and the definition of the fieldstack into a loop. I tried %% \newcount\angle %% \angle=0%\zerocount %% \dorecurse{12} {% %%\number\angle:\qquad %%\definestarsymbol{\the\angle} %%\symbol[star \number\angle]\par %%\advance\angle by 6} and did get the single symbols. I wasn't successful however in putting the symbol list of the fieldstack definition into a loop. Perhaps the ConTeXt gurus can help. Best regards, Richard ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Metapost animation
Hans Hagen wrote: Michal Kvasnicka wrote: Hm. Do you quote the Metafun manual, section 13.6? I know this technique. But my question was different: Is it possible to `animate' the fieldstack? In other words, to make it change one figure to another automatically, without clicking anywhere, changing one frame to another each 1/n second to simulate a smoth motion like in a cinema? sure, you can let a javascript toggle the states; however, small steps (1 sec) are not to be trusted in precission, since they also depend on the machine; they also kind of block other actions since there is no concept of animation in pdf (apart from svg, which is poorly implemented/integrated). Another method is demonstrated in the 'dante XV' presentation (runs slightly faster on a mac than on windows); Hans Can someone please post any example of JavaScript code to toggle the states like in either http://www.math.muni.cz/~plch/nkpm/nradanm6.pdf or https://www.pragma-pod.com/present/talks/fifteen.pdf? I produced the graphics as explained in the section 13.6 of the metafun manual, but I would like to press the button only once at the beginning of the animation instead of twenty times. Thank you very much, Mojca Miklavec ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] lost position information with metafun registers
Dear ConTeXt users (and developers), I am very fond of the presentation capabilites of ConTeXt, especially in connection with the Metafun macros. A big hand for the ConTeXt team! Now I want to link some checkboxes to a MPgraphic (a fieldstack actually) and I thought, that the best approach would be via the layer mechanism described in section 5.4 of the Metafun manual. I got the background picture and the checkboxes, but unfortunately the checkboxes were not in the intended positions (saved in register macros) but rather in the top left corner of the image. The same happened when I tried to reproduce the example from the Metafun manual: The texts show up in the top left corner of the boundig box of the circle. \setupcolors[state=start] \setuppapersize [S6][S6] \definelayer[test] \startuseMPgraphic{oeps} path p ; p := fullcircle scaled 6cm ; fill p withcolor .8white ; draw p withpen pencircle scaled 1mm withcolor .625red ; register (somepos-1,0cm,0cm,center currentpicture) ; register (somepos-2,3cm,1cm,(-1cm,-1cm)) ; register (somepos-3,2cm,0cm,(-2cm,2cm)) ; \stopuseMPgraphic \setMPlayer [test] [somepos-1] [location=c] {Does it work all right?} \setMPlayer [test] [somepos-2] {\framed [width=\MPlayerwidth,height=\MPlayerheight, background=color,backgroundcolor=white] {It Works!}} \starttext \getMPlayer [test]{\useMPgraphic{oeps}} \stoptext Does somebody have an idea what might go wrong? Do I miss an important setting or activation? (I am using ConTeXt ver: 2005.01.31 fmt: 2005.4.26 int: english mes: english in connection with tetex 3.0-13 on a linux box.) Or might this rather be a problem with the acrobat reader (version 7.0 on linux but also version 5 on windows)? I also tried to get some debug information via activating testmode (1. running texexec with the --mode=test option and 2. with \getMPlayer [test] [state=start,option=test]{\useMPgraphic{oeps}} in the document.) But I can not find the position information in the logfiles. Any help would be greatly appreciated. Best regards, Richard ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Metapost animation
Michal Kvasnicka wrote: Hm. Do you quote the Metafun manual, section 13.6? I know this technique. But my question was different: Is it possible to `animate' the fieldstack? In other words, to make it change one figure to another automatically, without clicking anywhere, changing one frame to another each 1/n second to simulate a smoth motion like in a cinema? sure, you can let a javascript toggle the states; however, small steps (1 sec) are not to be trusted in precission, since they also depend on the machine; they also kind of block other actions since there is no concept of animation in pdf (apart from svg, which is poorly implemented/integrated). Another method is demonstrated in the 'dante XV' presentation (runs slightly faster on a mac than on windows); Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context