Difference between revisions of "SlideWithSteps"

From Wiki
Jump to navigation Jump to search
(\eject doesn't work in MKIV)
Line 1: Line 1:
< [[Main Page]] | [[Presentations]] >
These macros were written by Otared Kavian:
These macros were written by Otared Kavian:
Line 123: Line 121:

Latest revision as of 15:29, 8 June 2020

These macros were written by Otared Kavian: [[1]]

Please see the [Raw steps module] on the author's side (this page hasn't been updated yet).


\SlideWithSteps{n}{... slide content ...}n - the overall number of steps on this slide
\Step{n}{... content ...}content appears on step n
\StepBefore{n}{... content ...}content disappears on step n
\OnlyStep{n}{... content ...}content appears on step n only
\StepBetween[n,m]{... content ...}content appears between steps n and m only
Other CommandsDescription
\the\StepCounterstep number
\SteppingSlidetruefor screen presentations
\SteppingSlidefalsefor printed material (full content on one page)

See the following example as a reference.


%%%%%%%%%%%% 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 An advantage is that the code can be used also in
%%K plain TeX, in LaTeX and other macro-packages.

\SteppingSlidetrue   %%K this is when you want a step by step presentation
%\SteppingSlidefalse %%K this is when you want to print the slides
%%K StepBetween[number1,number2]{material} will make "material"
%%K appear between steps "number1" and "number2"
 \ifnum#1>\StepsCounter \phantom{#3}
    \ifnum#2<\StepsCounter \phantom{#3}
      \else \relax #3
  \else {#3}
%%K Step{number1}{material} will make "material"
%%K appear beginning with step "number1" until "NumberOfSteps"
%%K OnlyStep{number1}{material} will make "material"
%%K appear only on step "number1"
%%K StepBefore{number1}{material} will make "material"
%%K appear only on all steps before "number1"
\else #2
\long\def\MakeSteps#1{\loop #1
\global\advance\StepsCounter by 1\vfill\page

%%K This is the end of the macros

% \endinput

%%K Here is a sample of how you can use these macros


\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