From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/16990 Path: main.gmane.org!not-for-mail From: David Munger Newsgroups: gmane.comp.tex.context Subject: Re: \presentationstep Date: Mon, 08 Nov 2004 13:01:31 -0500 Message-ID: <1099936891.9341.7.camel@m51.ASTRO.UMontreal.CA> References: <1099728440.7428.19.camel@tempete.lac.qc.ca> <1099875456.24313.8.camel@tempete.lac.qc.ca> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1099936984 24261 80.91.229.6 (8 Nov 2004 18:03:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Nov 2004 18:03:04 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Nov 08 19:02:44 2004 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CRDql-00051f-00 for ; Mon, 08 Nov 2004 19:02:44 +0100 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E7A33127BB; Mon, 8 Nov 2004 19:02:42 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11382-09; Mon, 8 Nov 2004 19:02:40 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 72530127A6; Mon, 8 Nov 2004 19:02:39 +0100 (CET) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id EFCE0127A6 for ; Mon, 8 Nov 2004 19:02:37 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11540-04 for ; Mon, 8 Nov 2004 19:02:37 +0100 (CET) Original-Received: from puma.DIT.UMontreal.CA (unknown [132.204.246.22]) by ronja.ntg.nl (Postfix) with ESMTP id 750231277C for ; Mon, 8 Nov 2004 19:02:36 +0100 (CET) Original-Received: from pruche.dit.umontreal.ca(132.204.246.22) by puma.DIT.UMontreal.CA via csmap id 80927b28_31b0_11d9_9e35_0002b3da0f4e_28749; Mon, 08 Nov 2004 13:03:32 -0500 (EST) Original-Received: from puma.DIT.UMontreal.CA (venus.ASTRO.UMontreal.CA [132.204.60.21]) by pruche.DIT.UMontreal.CA (8.13.1/8.13.1) with ESMTP id iA8I2YAT023562 for ; Mon, 8 Nov 2004 13:02:35 -0500 Original-Received: from venus.astro.umontreal.ca(132.204.60.21) by puma.DIT.UMontreal.CA via csmap id 7fa0233c_31b0_11d9_80fb_0002b3da0f4e_28739; Mon, 08 Nov 2004 13:03:31 -0500 (EST) Original-Received: from m51.ASTRO.UMontreal.CA (m51 [132.204.60.184]) by venus.ASTRO.UMontreal.CA (8.10.2+Sun/8.8.8) with ESMTP id iA8I2Fl22491 for ; Mon, 8 Nov 2004 13:02:17 -0500 (EST) Original-To: mailing list for ConTeXt users In-Reply-To: X-Mailer: Evolution 2.0.2 X-Astro_UdeM-MailScanner-Information: Please contact the ISP for more information X-Astro_UdeM-MailScanner: Found to be clean X-Astro_UdeM-MailScanner-SpamCheck: not spam, SpamAssassin (score=0, required 4) X-NAI-Spam-Score: 0.0 X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:16990 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:16990 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