Hi all,
Sometime ago a few of us (including me) bothered Hans in order to
obtain from him a step by step presentation command. He cooked up
very quickly the macros contained in "s-pre-50.tex", and that was
enough for most of the things.
However when one uses more sophisticated styles, the overlays in
"s-pre-50.tex" do not work quite good.
I wrote a few macros in plain TeX and used them in ConTeXt in order
to have step by step presentations with the styles "s-pre-xx.tex".
(For those who know the "Prosper" macro packages for LaTeX, I got
actually my inspiration from "prosper").
I admit that someone can write better and more elegant macros using
the hidden power of ConTeXt, but at this point I am unable to do
this...
So could anyone try the following macros and tell if the steps are
satisfactory for them?
Thanks: Otared K.
%%%% Beginning of the macros
%%K s-pre-steps.tex
%%K
%%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
%%K Otared Kavian
%%K last modified March 1, 2004
%%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{number}{material} will make "material"
%%K appear beginning with step "number" until "NumberOfSteps"
\def\Step#1#2{\StepBetween[#1,\NumberOfSteps]{#2}}
%
%%K OnlyStep{number}{material} will make "material"
%%K appear only on step "number"
\def\OnlyStep#1#2{\StepBetween[#1,#1]{#2}}
%
%%K StepBefore{number}{material} will make "material"
%%K appear only on all steps before "number"
\def\StepBefore#1#2{
\global\BeforeStepNumber=#1\global\advance\BeforeStepNumber by -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
%%K End of the macros "s-pre-steps.tex"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%K Here is an example to test the above macros
% \input s-pre-steps.tex
\usemodule[pre-general]
%%K I tried the macros for step by step presentation
%%K with the following styles:
\input s-pre-04.tex
%\input s-pre-09.tex
%\input s-pre-16.tex
%\input s-pre-19.tex
%\setupbodyfont[ss, 14.4pt] %% because I can't use other fonts
%% due to a local problem on my Mac OS X, I guess
\starttext
\TitlePage {A simple presentation}
\Topics {Today's talk}
\Topic {First item}
\input knuth
\Topic {Second item}
\input tufte
\Subject {A subitem}
\input knuth
\Subject {Another subitem}
\input tufte
\Subject {Here are some steps}
In the next slide we show some material appearing step by step.
The macros can also be used in other packages, particularly in plain \TeX.
\page
\SlideWithSteps{7}{
\startitemize
\item Consider the following nonlinear equation:
$$\Step{7}{{\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}}}$$
\StepBefore{6}{\item This line appears only before step 6.}
\OnlyStep{6}{\item The term in $|\nabla u|$ may be quadratic.}
\StepBetween[3,5]{\item This line appears only between steps 3 and 5}
\Step{7}{\item The equation may be parabolic.}
\OnlyStep{4}{\item Watch out\dots{} this line appears only at step 4.}
\stopitemize
% \vfill (Here you see step number \the\StepsCounter,
%% if you uncomment the line above
} % end of \SlideWithSteps
\stoptext