ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: displaying lines of formulas one by one
@ 2011-05-14  1:11 Jeong Dalyoung
  2011-05-14  3:40 ` Wolfgang Schuster
  2011-05-14  7:08 ` Otared Kavian
  0 siblings, 2 replies; 6+ messages in thread
From: Jeong Dalyoung @ 2011-05-14  1:11 UTC (permalink / raw)
  To: ntg-context

Dear Wolfgang and Otared,

Thank you for the reply.

I have used \setupinteraction[state=start] and open with Adobe Reader already. 

\StartSteps worked well in \startitemize and \startcombination. For example,

\StartSteps
\startitemize
\item $T(n) =$ \FlushStep
\blank[5*big]
\item $T(n) =$ \FlushStep
\stopitemize
\StopSteps
...

\StartSteps
\placefigure[none][]{}
{\startcombination[3*1]
{\externalfigure[TriNo60][width=.3\makeupwidth]}{\FlushStep}
{\externalfigure[TriNo90][width=.3\makeupwidth]}{\FlushStep}
{\externalfigure[TriNoDbl][width=.3\makeupwidth]}{\FlushStep}
\stopcombination}
\startformula
T(n) = n(n+1) \over 2
\stopformula
\FlushStep
\StopSteps

But I couldn't make it work with lines of formulas. I think that it is not working with \NC, \NR structure.

I'll try t-rsteps and thank you for the file. It is another good way to make slides.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: displaying lines of formulas one by one
  2011-05-14  1:11 displaying lines of formulas one by one Jeong Dalyoung
@ 2011-05-14  3:40 ` Wolfgang Schuster
  2011-05-14  7:08 ` Otared Kavian
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2011-05-14  3:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]


Am 14.05.2011 um 03:11 schrieb Jeong Dalyoung:

> But I couldn't make it work with lines of formulas. I think that it is not working with \NC, \NR structure.

That’s weird because it works for me with the example you sent.

\usemodule[pre-60] 

\setupinteraction[state=start]

\starttext 

\StartSteps 
\startformula\startalign 
\NC T(4) \NC = T(3) + 4          \NR\FlushStep
\NC      \NC= T(2) + 3 + 4       \NR\FlushStep 
\NC      \NC= T(1) + 2 + 3 + 4   \NR\FlushStep 
\NC      \NC= 1 + 2 + 3 + 4 = 10 \NR\FlushStep 
\stopalign\stopformula 
\StopSteps 

\stoptext

Wolfgang

[-- Attachment #2: test.pdf --]
[-- Type: application/pdf, Size: 10628 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: displaying lines of formulas one by one
  2011-05-14  1:11 displaying lines of formulas one by one Jeong Dalyoung
  2011-05-14  3:40 ` Wolfgang Schuster
@ 2011-05-14  7:08 ` Otared Kavian
  1 sibling, 0 replies; 6+ messages in thread
From: Otared Kavian @ 2011-05-14  7:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 347 bytes --]

Dear Jeong,

I tested again your example file with mkiv and got the correct result (see the attached file). As Wolfgang says in his answer, it is weird that the \FlushStep command doesn't work for you: are you using mkiv? I should add that in mkii, the part of your example with \startcombination does not work correctly.

Best regards: OK


[-- Attachment #2: steps-formula-1.pdf --]
[-- Type: application/pdf, Size: 16119 bytes --]

[-- Attachment #3: Type: text/plain, Size: 1591 bytes --]



On 14 mai 2011, at 03:11, Jeong Dalyoung wrote:

> Dear Wolfgang and Otared,
> 
> Thank you for the reply.
> 
> I have used \setupinteraction[state=start] and open with Adobe Reader already. 
> 
> \StartSteps worked well in \startitemize and \startcombination. For example,
> 
> \StartSteps
> \startitemize
> \item $T(n) =$ \FlushStep
> \blank[5*big]
> \item $T(n) =$ \FlushStep
> \stopitemize
> \StopSteps
> ...
> 
> \StartSteps
> \placefigure[none][]{}
> {\startcombination[3*1]
> {\externalfigure[TriNo60][width=.3\makeupwidth]}{\FlushStep}
> {\externalfigure[TriNo90][width=.3\makeupwidth]}{\FlushStep}
> {\externalfigure[TriNoDbl][width=.3\makeupwidth]}{\FlushStep}
> \stopcombination}
> \startformula
> T(n) = n(n+1) \over 2
> \stopformula
> \FlushStep
> \StopSteps
> 
> But I couldn't make it work with lines of formulas. I think that it is not working with \NC, \NR structure.
> 
> I'll try t-rsteps and thank you for the file. It is another good way to make slides.
> 
> 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
> ___________________________________________________________________________________



[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: displaying lines of formulas one by one
  2011-05-13  0:13 Jeong Dalyoung
  2011-05-13  2:44 ` Wolfgang Schuster
@ 2011-05-13  6:50 ` Otared Kavian
  1 sibling, 0 replies; 6+ messages in thread
From: Otared Kavian @ 2011-05-13  6:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1158 bytes --]

Hi Jeong,

If you are interested in using the commands defined in the old t-rsteps.tex for showing formulas or text step by step, below is an example I use (it works with mkii and mkiv). The input file I  use can be found here
	http://dl.dropbox.com/u/4316076/t-rsteps-ok.tex
but I attach it also to this message. 
The old « raw steps » is handy when one may need to go backward in the steps or when you want to show, say, the third line of your formula before the second line, but it has the disadvantage of creating one page per step.

\starttext

\setuppapersize[S6][S6]
\setuppagenumbering[state=stop]
\input t-rsteps-ok.tex
\setupinteraction[state=start] 
% uncomment the following when not needing teps
% \UseStepsfalse
% when using \UseStepstrue, we redefine \placeformula...
\ifx\UseStepstrue{\def\placeformula[#1]{\PlaceFormula[#1]}}\fi

\StartSteps[Formula with steps]

\startformula
\startalign
\Step{1}{\NC T(4) \NC = T(3) + 4 \NR} 
\Step{2}{\NC \NC= T(2) + 3 + 4 \NR}
\Step{3}{\NC \NC= T(1) + 2 + 3 + 4 \NR}
\Step{4}{\NC \NC= 1 + 2 + 3 + 4 = 10 \NR}
\stopalign
\stopformula
\StopSteps
\stoptext

Best regards: OK

[-- Attachment #2: t-rsteps-ok.tex --]
[-- Type: application/octet-stream, Size: 5944 bytes --]

%D \module
%D   [      file=t-rsteps,
%D        version=2004.11.10,
%D          title=\CONTEXT\ User Module,
%D       subtitle=Raw steps for slides,
%D         author=David Munger,
%D           date=\currentdate,
%D      copyright={David Munger}]

%D Thanks to Otared Kavian whose work inspired this module,
%D and who contributed to its development.

%%D Changed \Subject to \Title (OK, December 13, 2004)

\def\Title[#1]{\start%
\page\switchtobodyfont[palatino,24pt]\centerline{#1}\bigskip\stop }

\def\Step#1#2{\FromStep[#1]{#2}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \loop%
      \let\steps@autocounter\zerocount%
      \Title[#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%
	\ifnum\steps@counter=\steps@number%
	  \def\steps@fnext{\dodoubleempty\doplaceformula[####1]}%
	\else
	  \def\steps@fnext{\dodoubleempty\doplaceformula}%
	\fi\steps@fnext}
      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \repeat%
  \else%
    \Title[#1]\par\steps@startstep#2\steps@stopstep%
  \fi%
  \endgroup}

\def\NextStep{\steps@stopstep\steps@startstep}

\def\OnlyStep[#1]{%
  \relax
  \steps@updatenumber#1%
  \def\steps@cond{\steps@counter=#1}%
  \dosingleempty\steps@dostep}

\def\FromStep[#1]{%
  \relax
  \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]{%
  \relax
  \steps@updatenumber#1%
  \def\steps@cond{\steps@counter>#1}%
  \dosingleempty\steps@dostep}

\def\UntilStep[#1]{%
  \relax
  \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
% partly contributed by: Otared Kavian
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usemodule [pre-original]
%\usemodule [rsteps]

\starttext
\StartSteps[Slide Title]           % the title is passed to
                                   % the \Title 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

[-- Attachment #3: Type: text/plain, Size: 1348 bytes --]


On 13 mai 2011, at 02:13, Jeong Dalyoung wrote:

> Dear all,
> 
> I'd like to show the following formula line  by line in a presentation,
> For example, 
> \startformula\startalign
> \NC T(4) \NC = T(3) + 4 \NR
> \NC \NC= T(2) + 3 + 4 \NR
> \NC \NC= T(1) + 2 + 3 + 4 \NR
> \NC \NC= 1 + 2 + 3 + 4 = 10 \NR
> \stopalign\stopformula
> 
> 
> I tried to use \StartSteps and \StopSteps but not succeed.
> 
> \starttext
> \usemodule[pre-60]
> 
> \StartSteps
> \startformula\startalign
> \NC T(4) \NC = T(3) + 4 \NR\FlushStep %(nor \FlushStep\NR)
> \NC \NC= T(2) + 3 + 4 \NR\FlushStep
> \NC \NC= T(1) + 2 + 3 + 4 \NR\FlushStep
> \NC \NC= 1 + 2 + 3 + 4 = 10 \NR\FlushStep
> \stopalign\stopformula
> \StopSteps
> 
> \stoptext
> 
> Is there a way to do so?
> 
> 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
> ___________________________________________________________________________________



[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: displaying lines of formulas one by one
  2011-05-13  0:13 Jeong Dalyoung
@ 2011-05-13  2:44 ` Wolfgang Schuster
  2011-05-13  6:50 ` Otared Kavian
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2011-05-13  2:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 13.05.2011 um 02:13 schrieb Jeong Dalyoung:

> Dear all,
> 
> I'd like to show the following formula line  by line in a presentation,
> For example, 
> \startformula\startalign
> \NC T(4) \NC = T(3) + 4 \NR
> \NC \NC= T(2) + 3 + 4 \NR
> \NC \NC= T(1) + 2 + 3 + 4 \NR
> \NC \NC= 1 + 2 + 3 + 4 = 10 \NR
> \stopalign\stopformula
> 
> 
> I tried to use \StartSteps and \StopSteps but not succeed.
> 
> \starttext
> \usemodule[pre-60]
> 
> \StartSteps
> \startformula\startalign
> \NC T(4) \NC = T(3) + 4 \NR\FlushStep %(nor \FlushStep\NR)
> \NC \NC= T(2) + 3 + 4 \NR\FlushStep
> \NC \NC= T(1) + 2 + 3 + 4 \NR\FlushStep
> \NC \NC= 1 + 2 + 3 + 4 = 10 \NR\FlushStep
> \stopalign\stopformula
> \StopSteps
> 
> \stoptext
> 
> Is there a way to do so?

Add \setupinteraction[state=start] to your document and open it with Adobe Reader.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* displaying lines of formulas one by one
@ 2011-05-13  0:13 Jeong Dalyoung
  2011-05-13  2:44 ` Wolfgang Schuster
  2011-05-13  6:50 ` Otared Kavian
  0 siblings, 2 replies; 6+ messages in thread
From: Jeong Dalyoung @ 2011-05-13  0:13 UTC (permalink / raw)
  To: ntg-context

Dear all,

I'd like to show the following formula line  by line in a presentation,
For example, 
\startformula\startalign
\NC T(4) \NC = T(3) + 4 \NR
\NC \NC= T(2) + 3 + 4 \NR
\NC \NC= T(1) + 2 + 3 + 4 \NR
\NC \NC= 1 + 2 + 3 + 4 = 10 \NR
\stopalign\stopformula


I tried to use \StartSteps and \StopSteps but not succeed.

\starttext
\usemodule[pre-60]

\StartSteps
\startformula\startalign
\NC T(4) \NC = T(3) + 4 \NR\FlushStep %(nor \FlushStep\NR)
\NC \NC= T(2) + 3 + 4 \NR\FlushStep
\NC \NC= T(1) + 2 + 3 + 4 \NR\FlushStep
\NC \NC= 1 + 2 + 3 + 4 = 10 \NR\FlushStep
\stopalign\stopformula
\StopSteps

\stoptext

Is there a way to do so?

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-14  7:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-14  1:11 displaying lines of formulas one by one Jeong Dalyoung
2011-05-14  3:40 ` Wolfgang Schuster
2011-05-14  7:08 ` Otared Kavian
  -- strict thread matches above, loose matches on Subject: below --
2011-05-13  0:13 Jeong Dalyoung
2011-05-13  2:44 ` Wolfgang Schuster
2011-05-13  6:50 ` Otared Kavian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).