At 18:38 -0500 2/11/04, David Munger wrote:
I think the latest Acrobat Reader version for Linux is 5.0.9. I guess this means I should forget about steps. Thanks anyway.
David
Hi David, A few months ago I had to use steps in my presentations, but since I could not use thouroughly s-pre-60.tex (and the examples given in s-pre-61.tex) I ended up writing a few macros which work fine with ConTeXt and the presentation modules. These macros are very elementary and crude, but they work... If I succeed to learn how to use layers smartly as does Hans, I will write these macros again. :-) Below are the macros and some examples. Best regards: OK %%%%%%%%%%%% begin test-step-ok.tex %%K test-step-ok.tex %%K Here we use the plain \TeX\ command \phantom{} in order to have %%K some material appear step by step. %%K The structure is quite simple, but since I am not very %%K familiar with ConTeXt, I cannot write elegant code as does %%K Hans Hagen... %%K %%K An advantage is that the code can be used also in %%K plain TeX, in LaTeX and other macro-packages. %%K \newif\ifSteppingSlide \SteppingSlidetrue %%K this is when you want a step by step presentation %\SteppingSlidefalse %%K this is when you want to print the slides % \newcount\StepsCounter \StepsCounter=0 % \newcount\NumberOfSteps \NumberOfSteps=10 % \newcount\BeforeStepNumber \BeforeStepNumber=0 % %%K StepBetween[number1,number2]{material} will make "material" %%K appear between steps "number1" and "number2" \def\StepBetween[#1,#2]#3{% \ifSteppingSlide \ifnum#1>\StepsCounter \phantom{#3} \else \ifnum#2<\StepsCounter \phantom{#3} \else \relax #3 \fi \fi \else {#3} \fi} % %%K Step{number1}{material} will make "material" %%K appear beginning with step "number1" until "NumberOfSteps" \def\Step#1#2{\StepBetween[#1,\NumberOfSteps]{#2}} % %%K OnlyStep{number1}{material} will make "material" %%K appear only on step "number1" \def\OnlyStep#1#2{\StepBetween[#1,#1]{#2}} % %%K StepBefore{number1}{material} will make "material" %%K appear only on all steps before "number1" \def\StepBefore#1#2{ \global\BeforeStepNumber=#1 \StepBetween[0,\BeforeStepNumber]{#2}} % \long\def\SlideWithSteps#1#2{ \ifSteppingSlide \global\StepsCounter=0 \global\NumberOfSteps=#1 \MakeSteps{#2} \else #2 \fi} % \long\def\MakeSteps#1{\loop #1 \ifnum\StepsCounter<\NumberOfSteps \global\advance\StepsCounter by 1\vfill\eject \repeat \vfill\eject} % %%K This is the end of the macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \endinput %%K Here is a sample of how you can use these macros %%K \starttext \startitemize \SlideWithSteps{8}{ \item Consider the following nonlinear equation: $$\Step{8}{{\partial u \over \partial t}} \Step{1}{-\Delta u + |u|^{p-1}u} \Step{2}{=} \Step{3}{f} \Step{4}{+{\rm div}(g)} \Step{5}{+|\nabla u|{\Step{6}{^2}}}$$ \StepBetween[3,5]{\item This line appears only between steps 3 and 5} \Step{8}{\item The equation may be parabolic.} \StepBefore{4}{\item This line appears only before step 4.} \OnlyStep{4}{\item This line appears only at step 4.} \vfill (Here you see step number \the\StepsCounter) } % end of \SlideWithSteps \stopitemize \page \stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Hi Otared, Thanks a lot for you macros. They do the job pretty well. They remind me of the way Prosper does things. When I have time, I'll try to find out how to Wiki your post. Thanks again! David Otared Kavian wrote :
Hi David,
A few months ago I had to use steps in my presentations, but since I could not use thouroughly s-pre-60.tex (and the examples given in s-pre-61.tex) I ended up writing a few macros which work fine with ConTeXt and the presentation modules. These macros are very elementary and crude, but they work... If I succeed to learn how to use layers smartly as does Hans, I will write these macros again. :-)
Below are the macros and some examples. Best regards: OK %%%%%%%%%%%% begin test-step-ok.tex %%K test-step-ok.tex
%%K Here we use the plain \TeX\ command \phantom{} in order to have %%K some material appear step by step. %%K The structure is quite simple, but since I am not very %%K familiar with ConTeXt, I cannot write elegant code as does %%K Hans Hagen... %%K %%K An advantage is that the code can be used also in %%K plain TeX, in LaTeX and other macro-packages. %%K
\newif\ifSteppingSlide \SteppingSlidetrue %%K this is when you want a step by step presentation %\SteppingSlidefalse %%K this is when you want to print the slides % \newcount\StepsCounter \StepsCounter=0 % \newcount\NumberOfSteps \NumberOfSteps=10 % \newcount\BeforeStepNumber \BeforeStepNumber=0 % %%K StepBetween[number1,number2]{material} will make "material" %%K appear between steps "number1" and "number2" \def\StepBetween[#1,#2]#3{% \ifSteppingSlide \ifnum#1>\StepsCounter \phantom{#3} \else \ifnum#2<\StepsCounter \phantom{#3} \else \relax #3 \fi \fi \else {#3} \fi} % %%K Step{number1}{material} will make "material" %%K appear beginning with step "number1" until "NumberOfSteps" \def\Step#1#2{\StepBetween[#1,\NumberOfSteps]{#2}} % %%K OnlyStep{number1}{material} will make "material" %%K appear only on step "number1" \def\OnlyStep#1#2{\StepBetween[#1,#1]{#2}} % %%K StepBefore{number1}{material} will make "material" %%K appear only on all steps before "number1" \def\StepBefore#1#2{ \global\BeforeStepNumber=#1 \StepBetween[0,\BeforeStepNumber]{#2}} % \long\def\SlideWithSteps#1#2{ \ifSteppingSlide \global\StepsCounter=0 \global\NumberOfSteps=#1 \MakeSteps{#2} \else #2 \fi} % \long\def\MakeSteps#1{\loop #1 \ifnum\StepsCounter<\NumberOfSteps \global\advance\StepsCounter by 1\vfill\eject \repeat \vfill\eject} %
%%K This is the end of the macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \endinput
%%K Here is a sample of how you can use these macros %%K \starttext
\startitemize
\SlideWithSteps{8}{ \item Consider the following nonlinear equation: $$\Step{8}{{\partial u \over \partial t}} \Step{1}{-\Delta u + |u|^{p-1}u} \Step{2}{=} \Step{3}{f} \Step{4}{+{\rm div}(g)} \Step{5}{+|\nabla u|{\Step{6}{^2}}}$$ \StepBetween[3,5]{\item This line appears only between steps 3 and 5} \Step{8}{\item The equation may be parabolic.} \StepBefore{4}{\item This line appears only before step 4.} \OnlyStep{4}{\item This line appears only at step 4.} \vfill (Here you see step number \the\StepsCounter) } % end of \SlideWithSteps
\stopitemize \page
\stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
At 11:42 -0500 3/11/04, David Munger wrote:
Hi Otared,
Thanks a lot for you macros. They do the job pretty well. They remind me of the way Prosper does things. When I have time, I'll try to find out how to Wiki your post. Thanks again!
David
Hi David, I am happy that what I sent you was useful. Indeed I got the idea of the macros after having seen a presentation with Prosper, but since I don't use LaTeX I wrote those macros (I use only Plain TeX and ConTeXt for its beauty...). Thank you for putting the macros on Wiki with contextgarden. If I could improve the macros I'll let the contexters know. Best regards: OK
Hi all, Inspiring from Otared Kavian's code and Han's presentation styles with support for steps, I cooked the following in order to solve the non JavaScript version issue. I post it in case it could be useful to other people. This implementation supports an \{Only|From|Until}Step[n] syntax as well as the simple \NextStep-style one. Otared: Any comments or suggestions? And here is an example of usage: ------------------------------------------- \StartSteps[Slide Title] % the title is passed to % the \Subject macro \startitemize \item Item 1 \OnlyStep[2] {\item (oops!)} \UntilStep[4] {\item Item 2*} \FromStep[4] {\item Item 2} \stopitemize \StopSteps ------------------------------------------- And here is a mixed example: ------------------------------------------- \StartSteps[Navier||Stokes equation] \[ \frac{D\vec u}{Dt} = \FromStep[2][reserve]{-{\red \frac1\rho \vec\nabla p}} \FromStep[3][reserve]{+\;{\green \vec g}} \FromStep[4][reserve]{+\;{\blue \frac1\rho \div S}} \] Momentum transport: \NextStep \item {\red Pressure gradient} \par\NextStep \item {\green Gravity} \par\NextStep \item {\blue Stress (viscous, turbulent, Maxwell)} \StopSteps ------------------------------------------- And here's the code: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % steps for slides %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \unprotect \newif\ifUseSteps \UseStepstrue % \UseStepsfalse \long\def\StartSteps[#1]#2\StopSteps{% \let\steps@number\plusone% \let\steps@counter\plusone% \ifUseSteps% \loop% \let\steps@autocounter\zerocount% \Subject{#1}\par\steps@startstep#2\steps@stopstep% \steps@updatenumber\steps@autocounter% \ifnum\steps@counter<\steps@number% \increment\steps@counter% \repeat% \else% \Subject{#1}\par\steps@startstep#2\steps@stopstep% \fi} \def\NextStep{\steps@stopstep\steps@startstep} \def\OnlyStep[#1]{% \steps@updatenumber#1% \def\steps@cond{\steps@counter=#1}% \dosingleempty\steps@dostep} \def\FromStep[#1]{% \steps@updatenumber#1% \let\steps@tmpcounter\zerocount% \increment(\steps@tmpcounter,#1-1)% \def\steps@cond{\steps@counter>\steps@tmpcounter}% \dosingleempty\steps@dostep} \def\UntilStep[#1]{% \steps@updatenumber#1% \def\steps@cond{\steps@counter<#1}% \dosingleempty\steps@dostep} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % internal macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcounter\steps@counter \newcounter\steps@autocounter \newcounter\steps@number \newcounter\steps@tmpcounter \def\steps@startstep{% \increment\steps@autocounter% \def\steps@hide{no}% \ifUseSteps% \ifnum\steps@autocounter>\steps@counter% \def\steps@hide{yes}% \fi% \fi% \starthidden} \def\steps@stopstep{\stophidden} \def\steps@updatenumber#1{\ifnum\steps@number<#1% \doglobal\let\steps@number\zerocount% \doglobal\increment(\steps@number,#1)\fi} \defineframedtext [step@frame] [offset=overlay,width=broad,height=fit,frame=off] \def\starthidden{\startstep@frame[empty=\steps@hide]} \def\stophidden{\stopstep@frame} \long\def\steps@dostep[#1]#2{% \processallactionsinset [#1] [ reserve=>\let\steps@next=\steps@dostepreserve, \s!default=>\let\steps@next=\steps@dostepnoreserve] \steps@next{#2}} \long\def\steps@dostepreserve#1{% \def\steps@hide{no}% \ifUseSteps% \ifnum\steps@cond\else% \def\steps@hide{yes}% \fi% \fi% \ifmmode\expandafter\mframed\else\expandafter\framed\fi% [empty=\steps@hide,frame=off,offset=overlay]{#1}% \ifmmode\;\fi} \long\def\steps@dostepnoreserve#1{% \def\steps@next{#1\ifmmode\;\fi}% \ifUseSteps% \ifnum\steps@cond\else\def\steps@next{\relax}\fi% \fi\steps@next} \protect
At 3:07 -0500 6/11/04, David Munger wrote:
Hi all,
Inspiring from Otared Kavian's code and Han's presentation styles with support for steps, I cooked the following in order to solve the non JavaScript version issue. I post it in case it could be useful to other people.
This implementation supports an \{Only|From|Until}Step[n] syntax as well as the simple \NextStep-style one.
Otared: Any comments or suggestions?
And here is an example of usage:
------------------------------------------- \StartSteps[Slide Title] % the title is passed to % the \Subject macro
Hi David, Hi all Contexters, Sorry for being late in answering. I just tried to test your code but did not succeed in showing things step by step, even after adding: \def\Subject#1{\centerline{\bf #1}} \setuppapersize [S6][S6] \setupcolors[state=start] and changing the commands \[ and \] (which are probably from a LaTeX background) into \startformula and \stopformula. What I get doesn't show any step, but only one or two pages with several "Slide Title", and the items you had in your example, on it, and one or two pages with "Navier-Stokes equation". Am I missing something? Could you please send me (if necessary off List) a source file of yours which is completely working? Best regards: OK
Otared Kavian wrote :
Hi David, Hi all Contexters,
Sorry for being late in answering.
I just tried to test your code but did not succeed in showing things step by step, even after adding: \def\Subject#1{\centerline{\bf #1}} \setuppapersize [S6][S6] \setupcolors[state=start] and changing the commands \[ and \] (which are probably from a LaTeX background) into \startformula and \stopformula.
What I get doesn't show any step, but only one or two pages with several "Slide Title", and the items you had in your example, on it, and one or two pages with "Navier-Stokes equation".
Am I missing something? Could you please send me (if necessary off List) a source file of yours which is completely working?
Best regards: OK
Oh sorry for not being clear about it. I was assuming that some presentation module would be imported, for instance: \usemodule[pre-original] So probably there lacks a \page command in your \Subject definition. About the \[ and \]: you're right. I was using the amsl module from Giuseppe Bilotta. Thanks for your remarks. :-) So, assuming that the steps code is in a file name t-rsteps.tex, the complete example would be: ---------------------------------------------------------- \usemodule [pre-original] \usemodule [rsteps] \starttext \StartSteps[Slide Title] % the title is passed to % the \Subject macro \startitemize \item Item 1 \OnlyStep[2] {\item (oops!)} \UntilStep[4] {\item Item 2*} \FromStep[4] {\item Item 2} \stopitemize \StopSteps \StartSteps[Navier||Stokes equation] \startformula \frac{D\vec u}{Dt} = \FromStep[2][reserve]{-{\red \frac1\rho \vec\nabla p}} \FromStep[3][reserve]{+\;{\green \vec g}} \FromStep[4][reserve]{+\;{\blue \frac1\rho \vec\nabla\cdot S}} \stopformula Momentum transport: \NextStep \item {\red Pressure gradient} \par\NextStep \item {\green Gravity} \par\NextStep \item {\blue Stress (viscous, turbulent, Maxwell)} \StopSteps \stoptext ----------------------------------------------------------
At 19:57 -0500 7/11/04, David Munger wrote:
Oh sorry for not being clear about it. I was assuming that some presentation module would be imported, for instance: \usemodule[pre-original]
So probably there lacks a \page command in your \Subject definition.
About the \[ and \]: you're right. I was using the amsl module from Giuseppe Bilotta.
Thanks for your remarks. :-)
So, assuming that the steps code is in a file name t-rsteps.tex, the complete example would be:
----------------------------------------------------------
\usemodule [pre-original] \usemodule [rsteps]
Hi David, Thanks for the details. Indeed I get now what is expected from your macros, and as a matter of fact the result is much much better than that of my crude macros... You did a great improvement! So I am going to use yours from now on: thanks again! If I can suggest a possible improvement to the t-rsteps.tex macros, it is the following: When one uses these macros with an automatic numbering such as \placeformula[equation-reference] (see the example below), with each invocation of \page (that is a step) the number increases, and this is an unwanted side result. Would it possible to "freeze" the numbering procedure in such a way that the number doesn't change in each step? (When I was using my macros, I didn't use \placeformula in sildes with steps, but rather an old \leqno from plain TeX). Best regards: OK %%%%%%%%%%%%%%%%%%%%%%% example steps-david-2.tex \usemodule [pre-original] \usemodule [rsteps] \starttext \StartSteps[Slide Title] % the title is passed to % the \Subject macro defined in pre-original \startitemize \FromStep[1] {\item {\bf Lemma. } {\it For any $u,v \in H$, a Hilbert space, we have the following Cauchy-Schwarz inequality\/} \placeformula[Cauchy-Schwarz] \startformula |(u|v)| \leq \Vert u\Vert \cdot \Vert v \Vert. \stopformula} \FromStep[2] {\item {\bf Proof. } Consider $f(t):= (u+tv|u+tv)$ for $t\in {\Bbb C}$.} \FromStep[3]{\item We have $f(t) \geq 0$ for all $t\in {\Bbb C}$.} \stopitemize \StopSteps \stoptext %%%%%%%%%%%%%%%%%% end example steps-david-2.tex
Otared Kavian wrote :
Hi David,
Thanks for the details. Indeed I get now what is expected from your macros, and as a matter of fact the result is much much better than that of my crude macros... You did a great improvement! So I am going to use yours from now on: thanks again!
If I can suggest a possible improvement to the t-rsteps.tex macros, it is the following: When one uses these macros with an automatic numbering such as \placeformula[equation-reference] (see the example below), with each invocation of \page (that is a step) the number increases, and this is an unwanted side result. Would it possible to "freeze" the numbering procedure in such a way that the number doesn't change in each step? (When I was using my macros, I didn't use \placeformula in sildes with steps, but rather an old \leqno from plain TeX).
Excellent idea indeed! Here's the fix. It is obviously not optimal, though it allows for multiple formula numbers on the same slide. Try it with: texexec --pdf --mode=demo t-rsteps Thanks for your advice. David ------------------------------------------------------------ %D \module %D [ file=t-rsteps, %D version=2004.11.08, %D title=\CONTEXT\ User Module, %D subtitle=Raw steps for slides, %D author=David Munger, %D date=\currentdate, %D copyright={David Munger}] % Thanks to Otared Kavian whose work inspired this module, % and who contributed to its development. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % steps for slides %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \unprotect \newif\ifUseSteps \UseStepstrue % \UseStepsfalse \definecolor [highlightcolor] [blue] \long\def\StartSteps[#1]#2\StopSteps{% \begingroup% \let\steps@number\plusone% \let\steps@counter\plusone% \ifUseSteps% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Workaround to make formula numbers "stick" \def\placeformula[##1]{% \incrementnumber[formula]% \expandafter\xdef\csname steps@eqnum##1 \endcsname{\rawnumber[formula]} \expandafter\xdef\csname steps@eqnum \endcsname{\rawnumber[formula]} \dodoubleempty\doplaceformula[##1]} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \loop% \let\steps@autocounter\zerocount% \Subject{#1}\par\steps@startstep#2\steps@stopstep% \steps@updatenumber\steps@autocounter% \ifnum\steps@counter<\steps@number% \increment\steps@counter% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Workaround to make formula numbers "stick" \def\placeformula[####1]{% \setnumber[formula]{\csname steps@eqnum####1\endcsname}% \setfalse\incrementformulanumber% \dodoubleempty\doplaceformula[####1]} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \repeat% \else% \Subject{#1}\par\steps@startstep#2\steps@stopstep% \fi% \endgroup} \def\NextStep{\steps@stopstep\steps@startstep} \def\OnlyStep[#1]{% \steps@updatenumber#1% \def\steps@cond{\steps@counter=#1}% \dosingleempty\steps@dostep} \def\FromStep[#1]{% \steps@updatenumber#1% \let\steps@tmpcounter\zerocount% \increment(\steps@tmpcounter,#1-1)% \def\steps@cond{\steps@counter>\steps@tmpcounter}% \dosingleempty\steps@dostep} \def\AfterStep[#1]{% \steps@updatenumber#1% \def\steps@cond{\steps@counter>#1}% \dosingleempty\steps@dostep} \def\UntilStep[#1]{% \steps@updatenumber#1% \def\steps@cond{\steps@counter<#1}% \dosingleempty\steps@dostep} \def\HighlightStep[#1]#2{% {\UntilStep[#1]{#2}\OnlyStep[#1]{\highlightcolor #2}\AfterStep[#1]{#2}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % internal macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcounter\steps@counter \newcounter\steps@autocounter \newcounter\steps@number \newcounter\steps@tmpcounter \def\steps@startstep{% \increment\steps@autocounter% \def\steps@hide{no}% \ifUseSteps% \ifnum\steps@autocounter>\steps@counter% \def\steps@hide{yes}% \fi% \fi% \starthidden} \def\steps@stopstep{\stophidden} \def\steps@updatenumber#1{\ifnum\steps@number<#1% \doglobal\let\steps@number\zerocount% \doglobal\increment(\steps@number,#1)\fi} \defineframedtext [step@frame] [offset=overlay,width=broad,height=fit,frame=off] \def\starthidden{\startstep@frame[empty=\steps@hide]} \def\stophidden{\stopstep@frame} \long\def\steps@dostep[#1]#2{% \processallactionsinset [#1] [ reserve=>\let\steps@next=\steps@dostepreserve, \s!default=>\let\steps@next=\steps@dostepnoreserve] \steps@next{#2}} \long\def\steps@dostepreserve#1{% \def\steps@hide{no}% \ifUseSteps% \ifnum\steps@cond\else% \def\steps@hide{yes}% \fi% \fi% \ifmmode\expandafter\mframed\else\expandafter\framed\fi% [empty=\steps@hide,frame=off,offset=overlay]{#1}% \ifmmode\;\fi} \long\def\steps@dostepnoreserve#1{% \def\steps@next{#1\ifmmode\;\fi}% \ifUseSteps% \ifnum\steps@cond\else\def\steps@next{\relax}\fi% \fi\steps@next} \protect \doifnotmode{demo}{\endinput} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % usage example %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usemodule [pre-original] \usemodule [rsteps] \starttext \StartSteps[Slide Title] % the title is passed to % the \Subject macro \startitemize \item Item 1 \OnlyStep[2] {\item (oops!)} \UntilStep[4] {\item Item 2*} \FromStep[4] {\item Item 2} \stopitemize \StopSteps \StartSteps[Navier||Stokes equation] \placeformula[eq:incompressibility] \startformula \vec\nabla\cdot\vec u = 0 \stopformula \placeformula[eq:NS] \startformula \frac{D\vec u}{Dt} = \FromStep[2][reserve]{-{\red \frac1\rho \vec\nabla p}} \FromStep[3][reserve]{+\;{\green \vec g}} \FromStep[4][reserve]{+\;{\blue \frac1\rho \vec\nabla\cdot S}} \stopformula Momentum transport: \NextStep \item {\red Pressure gradient} \par\NextStep \item {\green Gravity} \par\NextStep \item {\blue Stress (viscous, turbulent, Maxwell)} \StopSteps \stoptext
At 13:01 -0500 8/11/04, David Munger wrote:
Excellent idea indeed! Here's the fix. It is obviously not optimal, though it allows for multiple formula numbers on the same slide. Try it with: texexec --pdf --mode=demo t-rsteps
Thanks for your advice.
Hi David, I could not get through the example file: here is what I get: %%%%% begin error report: ! Missing number, treated as zero. <to be read again> \steps@eqnumeq:incompressibility \setcounter ...ame #1\endcsname {\the \numexpr (#2 )} \placeformula ...\csname steps@eqnum#1\endcsname } \setfalse \incrementformul... \@@plnbody ...\placeformula [eq:incompressibility] \startformula \vec \nabla... \@@plniterate ->\@@plnbody \expandafter \@@plniterate \else \fi \StartSteps ...y \doplaceformula [####1]} \repeat \else \Subject {#1}\par \s... l.41 \StopSteps ? Process aborted %%%%% end error report I tried also the short example I sent you today, but I get the same result. Is there a transmission error in your file? (I should say that everything is fine if one doesn't have a \placeformula). Finally, if I am not being too demanding, at the end of t-rsteps.tex, in your example of how to use the command (for the user's convenience) could you please incude all the possibilities of using the Step commands? that is instances of: \OnlyStep[1]{\item something} \FromStep[2]{\item something} \AfterStep[3]{\item something} \UntilStep[4]{\item something} \HighlightStep[5]{\item something} \NextStep[1]{\item something} (Actually it seems that there is also a problem with \NextStep) Best regards: OK
Otared Kavian wrote :
Hi David,
I could not get through the example file: here is what I get:
Argh... It's because of the line splits in email. I just put the file on my website: http://cfd.homelinux.org/tex/ Regards, David
At 16:10 -0500 8/11/04, David Munger wrote:
Argh... It's because of the line splits in email. I just put the file on my website:
Hi David and all ConTeXters, I was away from my e-mail so I am late in answering. Thank you for the file you put on your site. Indeed everything works as intended (the \placeformula no longer advances with each step), and I think one may suggest to Hans to include this in future distributions. However, in the spirit of ConTeXters who are always asking for a step(!) towards perfectness, I let you know the following drawbacks of the macros: 1) Somehow the \FromStep[n][reserve] changes the internal mechanism of glue or spaces in displayed formulas. So one needs (as you do in your example) to add \; around operators such as +, -, =. Can one avoid this? 2) When one refers (see example below) with the command (\in[eq:NS]) to an equation which has been introduced with \placeformula[eq:NS] the interaction makes appear the first instance of that formula, which may be incomplete. Could one have a control over this, that is for instance, in this particular case, make appear the completed equation at the end of the slide made with \StartSteps[Navier||Stokes equation]? Best regards: OK %%%% file steps-david-3.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % usage example %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usemodule [pre-original] \usemodule [rsteps] \starttext \StartSteps[Slide Title] % the title is passed to % the \Subject macro \startitemize \item Item 1 \OnlyStep[2] {\item (oops!)} \UntilStep[4] {\item Item 2*} \FromStep[4] {\item Item 2} \HighlightStep[3]{\item Here is another version of Navier-Stokes equation} \stopitemize \StopSteps \StartSteps[Navier||Stokes equation] \placeformula[eq:incompressibility] \startformula \vec\nabla\cdot\vec u = 0 \stopformula \placeformula[eq:NS] \startformula \frac{D\vec u}{Dt} = \FromStep[2][reserve]{-{\red \frac1\rho \vec\nabla p}} \FromStep[3][reserve]{+\;{\green \vec g}} \FromStep[4][reserve]{+\;{\blue \frac1\rho \vec\nabla\cdot S}} \stopformula Momentum transport: \NextStep \item {\red Pressure gradient} \par\NextStep \item {\green Gravity} \par\NextStep \item {\blue Stress (viscous, turbulent, Maxwell)} \StopSteps \StartSteps[Navier Stokes equation] \placeformula[eq:div-nul] \startformula \vec\nabla\cdot\vec u = 0 \stopformula \placeformula[eq:NStokes] \startformula { \partial u \over \partial t} - \Delta u \FromStep[1][reserve]{{\red \; +\; (u\cdot \nabla)u}} \FromStep[2][reserve]{{\green \; +\; \nabla p}} \FromStep[3][reserve]{{\blue \; =\; f(t,x)}} \stopformula Comments: \NextStep \item Nonlinear equation (same is true for equation (\in[eq:NS]) \par\NextStep \item One should add initial conditions \par\NextStep \item and boundary conditions \StopSteps \stoptext %%%%%% end file steps-david-3.tex
Otared Kavian wrote :
Hi David and all ConTeXters,
I was away from my e-mail so I am late in answering. Thank you for the file you put on your site. Indeed everything works as intended (the \placeformula no longer advances with each step), and I think one may suggest to Hans to include this in future distributions.
However, in the spirit of ConTeXters who are always asking for a step(!) towards perfectness, I let you know the following drawbacks of the macros:
1) Somehow the \FromStep[n][reserve] changes the internal mechanism of glue or spaces in displayed formulas. So one needs (as you do in your example) to add \; around operators such as +, -, =. Can one avoid this?
I'm sorry, I'm no TeX/ConTeXt guru and I really have no idea of how to achieve this. I think now we need Hans' help. I have indeed noticed that enclosing an operator between braces breaks the spacing system. Try, for instance: \startformula \vec\nabla\cdot\vec u = 0 \stopformula \startformula \vec\nabla\cdot\vec u {=} 0 \stopformula Unfortunately, using \phatom{=} results in the same broken spacing as second formula.
2) When one refers (see example below) with the command (\in[eq:NS]) to an equation which has been introduced with \placeformula[eq:NS] the interaction makes appear the first instance of that formula, which may be incomplete. Could one have a control over this, that is for instance, in this particular case, make appear the completed equation at the end of the slide made with \StartSteps[Navier||Stokes equation]?
Good point! Here's the fix (file updated on my website): 37c37 < \dodoubleempty\doplaceformula[##1]} ---
\dodoubleempty\doplaceformula}
50c50,54 < \dodoubleempty\doplaceformula[####1]} ---
\ifnum\steps@counter=\steps@number% \def\steps@fnext{\dodoubleempty\doplaceformula[####1]}% \else \def\steps@fnext{\dodoubleempty\doplaceformula}% \fi\steps@fnext}
Now we got rid of the duplicate label warnings. I also added your contribution to the usage example. Thank you. Regards, David
David Munger wrote:
I'm sorry, I'm no TeX/ConTeXt guru and I really have no idea of how to achieve this. I think now we need Hans' help.
I haven't followed the discussion so closely, what is the problem?
Good point! Here's the fix (file updated on my website):
37c37 < \dodoubleempty\doplaceformula[##1]} ---
\dodoubleempty\doplaceformula}
50c50,54 < \dodoubleempty\doplaceformula[####1]} ---
\ifnum\steps@counter=\steps@number% \def\steps@fnext{\dodoubleempty\doplaceformula[####1]}% \else \def\steps@fnext{\dodoubleempty\doplaceformula}% \fi\steps@fnext}
eh ... are you redefining low level macros? Can you give a minimal example of what you're doing? 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 -----------------------------------------------------------------
Hans Hagen wrote :
David Munger wrote:
I'm sorry, I'm no TeX/ConTeXt guru and I really have no idea of how to achieve this. I think now we need Hans' help.
I haven't followed the discussion so closely, what is the problem?
We're trying to implement steps-without-JavaScript for slides. You can get the module here: http://cfd.homelinux.org/tex/ The current problem, in its simplest form, is that using \mframed breaks the spacing. Minimal example: \starttext We aim to get this spacing: \startformula a + b \stopformula but when using: \startformula a \mframed{+ b} \stopformula we get the same broken spacing as in: \startformula a {+ b} \stopformula \stoptext
eh ... are you redefining low level macros?
I'd never dare to... ;-) Just overriding \placeformula within \begingroup/\endgroup to mangle the formula numbers. Thank you, David
At 12:08 -0500 10/11/04, David Munger wrote:
I'm sorry, I'm no TeX/ConTeXt guru and I really have no idea of how to achieve this. I think now we need Hans' help.
I have indeed noticed that enclosing an operator between braces breaks the spacing system. Try, for instance:
Yes you are right! This is a problem with ConTeXt. I am going to post a message for the gurus as you say.
Good point! Here's the fix (file updated on my website):
That's great! Everything works as expected. But let's see, are you sure you are not a guru? I doubt now... Best regards: OK
1) Somehow the \FromStep[n][reserve] changes the internal mechanism of glue or spaces in displayed formulas. So one needs (as you do in your example) to add \; around operators such as +, -, =. Can one avoid this?
Hi Otared, I can give only explanation but in the moment i do not know the automatic solution. Mathematical material are processed in a pieces called atoms. There are 13 different atoms types (ord, op, bin, rel, open, close, punc, ...). Mathematical characters (+, =, ...) have implicit types (bin, rel; in the case) or they can be set explicitly (\mathrel{<}, \mathop{\hbox{sin}}). Spacing in mathematical mode is done according to types of neighbour atoms. TeX can add A) no space B) \mskip\thinmuskip C) \mskip\medmuskip D) \mskip\thickmuskip between atoms if it is surrounded from left or right with ord op close inner D) REL D) ord op open inner ord close inner C) BIN C) ord op close inner PUNCT B) ord op rel open close punct inner ord close inner B) OP B) ord op ord op close B) INNER B) ord open punct inner If no pair is in this table (ord-ord) no space is added. (Read the table as left-pair and right-pair not as triples.) Example: 1+1=2 expands like \mathord{1}\mathbin{+}\mathord{1}\mathrel{=}\mathord{2} and typeset like \mathord{1}\C\mathbin{+}\C\mathord{1}\D\mathrel{=}\D\mathord{2} (abbreviated by \def\B{\mskip\thinmuskip} etc.) But there are some exceptions (e.g. bin is changed to ord if nothing bin op rel open punct BIN rel close punct ). It makes things more difficult. So in your case the math is broken (by steps) into several separates that is why the atom neighbourhood is lost. Example. Our 1+1=2 equation can be split to $1$$+1=2$ and mathbin + changes to ord and we lose space before (beginning of math) and after (will be ord-ord pair). In this trivial example it can be solved by $1$$\mathord{}+1=2$ According to me, mathematical text has to be tuned manually in the normal case; this spacial one is not a exception ;-( Vit Zyka 2. bin 3.
2) When one refers (see example below) with the command (\in[eq:NS]) to an equation which has been introduced with \placeformula[eq:NS] the interaction makes appear the first instance of that formula, which may be incomplete. Could one have a control over this, that is for instance, in this particular case, make appear the completed equation at the end of the slide made with \StartSteps[Navier||Stokes equation]?
Best regards: OK
%%%% file steps-david-3.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % usage example %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usemodule [pre-original] \usemodule [rsteps]
\starttext \StartSteps[Slide Title] % the title is passed to % the \Subject macro
\startitemize \item Item 1 \OnlyStep[2] {\item (oops!)} \UntilStep[4] {\item Item 2*} \FromStep[4] {\item Item 2} \HighlightStep[3]{\item Here is another version of Navier-Stokes equation} \stopitemize
\StopSteps
\StartSteps[Navier||Stokes equation]
\placeformula[eq:incompressibility] \startformula \vec\nabla\cdot\vec u = 0 \stopformula
\placeformula[eq:NS] \startformula \frac{D\vec u}{Dt} = \FromStep[2][reserve]{-{\red \frac1\rho \vec\nabla p}} \FromStep[3][reserve]{+\;{\green \vec g}} \FromStep[4][reserve]{+\;{\blue \frac1\rho \vec\nabla\cdot S}} \stopformula
Momentum transport: \NextStep \item {\red Pressure gradient} \par\NextStep \item {\green Gravity} \par\NextStep \item {\blue Stress (viscous, turbulent, Maxwell)}
\StopSteps
\StartSteps[Navier Stokes equation]
\placeformula[eq:div-nul] \startformula \vec\nabla\cdot\vec u = 0 \stopformula
\placeformula[eq:NStokes] \startformula { \partial u \over \partial t} - \Delta u \FromStep[1][reserve]{{\red \; +\; (u\cdot \nabla)u}} \FromStep[2][reserve]{{\green \; +\; \nabla p}} \FromStep[3][reserve]{{\blue \; =\; f(t,x)}} \stopformula
Comments: \NextStep \item Nonlinear equation (same is true for equation (\in[eq:NS]) \par\NextStep \item One should add initial conditions \par\NextStep \item and boundary conditions
\StopSteps \stoptext %%%%%% end file steps-david-3.tex _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
-- Vít Zýka --- http://typokvitek.com Automatic document typesetting Automaticka sazba dokumentu -- --
At 19:25 +0100 10/11/04, Vit Zyka wrote:
Hi Otared,
I can give only explanation but in the moment i do not know the automatic solution.
Hi Vit, Thank you for your insight. It is right that the same problem appears in Plain TeX, that is a binary operator within a pair of braces seems to loose its "binary" property. I tried the sample file I sent in the thread "bug with glue and spaces in formulas?", with other macros packages and the result is the same. Best regards: OK
participants (4)
-
David Munger
-
Hans Hagen
-
Otared Kavian
-
Vit Zyka