From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/14844 Path: main.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: A (not so good) solution for presentations by steps Date: Mon, 1 Mar 2004 18:19:44 +0100 Sender: ntg-context-admin@ntg.nl Message-ID: Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Trace: sea.gmane.org 1078161792 26046 80.91.224.253 (1 Mar 2004 17:23:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 1 Mar 2004 17:23:12 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Mon Mar 01 18:23:04 2004 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Axr8B-0004bV-00 for ; Mon, 01 Mar 2004 18:23:03 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 7B64810B68; Mon, 1 Mar 2004 18:20:54 +0100 (MET) Original-Received: from mwinf0303.wanadoo.fr (smtp3.wanadoo.fr [193.252.22.28]) by ref.ntg.nl (Postfix) with ESMTP id 10D9B10B5B for ; Mon, 1 Mar 2004 18:17:42 +0100 (MET) Original-Received: from [80.9.75.186] (APh-Aug-101-1-6-186.w81-248.abo.wanadoo.fr [81.248.195.186]) by mwinf0303.wanadoo.fr (SMTP Server) with ESMTP id D6D9D500096E for ; Mon, 1 Mar 2004 18:19:47 +0100 (CET) X-Sender: otared@pop.wanadoo.fr Original-To: ntg-context@ntg.nl Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:14844 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:14844 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