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%
[EMAIL PROTECTED]
[EMAIL PROTECTED]
\ifUseSteps%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Workaround to make formula numbers "stick"
\def\placeformula[##1]{%
\incrementnumber[formula]%
\expandafter\xdef\csname [EMAIL PROTECTED]
\endcsname{\rawnumber[formula]}
\expandafter\xdef\csname [EMAIL PROTECTED]
\endcsname{\rawnumber[formula]}
\dodoubleempty\doplaceformula[##1]}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\loop%
[EMAIL PROTECTED]
[EMAIL PROTECTED]@stopstep%
[EMAIL PROTECTED]@autocounter%
[EMAIL PROTECTED]<[EMAIL PROTECTED]
[EMAIL PROTECTED]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Workaround to make formula numbers "stick"
\def\placeformula[####1]{%
\setnumber[formula]{\csname [EMAIL PROTECTED]
\setfalse\incrementformulanumber%
\dodoubleempty\doplaceformula[####1]}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\repeat%
\else%
[EMAIL PROTECTED]@stopstep%
\fi%
\endgroup}
[EMAIL PROTECTED]@startstep}
\def\OnlyStep[#1]{%
[EMAIL PROTECTED]
[EMAIL PROTECTED]@counter=#1}%
[EMAIL PROTECTED]
\def\FromStep[#1]{%
[EMAIL PROTECTED]
[EMAIL PROTECTED]
\increment([EMAIL PROTECTED],#1-1)%
[EMAIL PROTECTED]@counter>[EMAIL PROTECTED]
[EMAIL PROTECTED]
\def\AfterStep[#1]{%
[EMAIL PROTECTED]
[EMAIL PROTECTED]@counter>#1}%
[EMAIL PROTECTED]
\def\UntilStep[#1]{%
[EMAIL PROTECTED]
[EMAIL PROTECTED]@counter<#1}%
[EMAIL PROTECTED]
\def\HighlightStep[#1]#2{%
{\UntilStep[#1]{#2}\OnlyStep[#1]{\highlightcolor
#2}\AfterStep[#1]{#2}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% internal macros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
\ifUseSteps%
[EMAIL PROTECTED]>[EMAIL PROTECTED]
[EMAIL PROTECTED]
\fi%
\fi%
\starthidden}
[EMAIL PROTECTED]
[EMAIL PROTECTED]@number<#1%
[EMAIL PROTECTED]
\doglobal\increment([EMAIL PROTECTED],#1)\fi}
\defineframedtext
[EMAIL PROTECTED]
[offset=overlay,width=broad,height=fit,frame=off]
[EMAIL PROTECTED]@hide]}
[EMAIL PROTECTED]
[EMAIL PROTECTED]
\processallactionsinset
[#1]
[ reserve=>[EMAIL PROTECTED]@dostepreserve,
\s!default=>[EMAIL PROTECTED]@dostepnoreserve]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
\ifUseSteps%
[EMAIL PROTECTED]
[EMAIL PROTECTED]
\fi%
\fi%
\ifmmode\expandafter\mframed\else\expandafter\framed\fi%
[EMAIL PROTECTED],frame=off,offset=overlay]{#1}%
\ifmmode\;\fi}
[EMAIL PROTECTED]
[EMAIL PROTECTED];\fi}%
\ifUseSteps%
[EMAIL PROTECTED]@next{\relax}\fi%
[EMAIL PROTECTED]
\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
_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context