Difference between revisions of "RawSteps"

From Wiki
Jump to navigation Jump to search
m (suggestion for space reservation)
(added link to code to be included for dash processing)
Line 171: Line 171:
 
   \endgroup}
 
   \endgroup}
 
</texcode>
 
</texcode>
 +
and the rest of code on [[Inside_ConTeXt#Processing_lists_of_values]]
 
* I don't like the \StartSteps[SubjectName] definition - it doesn't offer enough flexibility. For example, I would like some slides to start with \Title, some with \Subject, ... Also, if I wrote \setuphead[Subject][number=yes], than the subject number was higher on each new slide ... I just noted that I was probably wrong as I saw the \StartSteps[Title][Title name 2] example above.
 
* I don't like the \StartSteps[SubjectName] definition - it doesn't offer enough flexibility. For example, I would like some slides to start with \Title, some with \Subject, ... Also, if I wrote \setuphead[Subject][number=yes], than the subject number was higher on each new slide ... I just noted that I was probably wrong as I saw the \StartSteps[Title][Title name 2] example above.
 
* I tried to number the formulas once. I probably did that wrong, but I remember that it was not numbered properly
 
* I tried to number the formulas once. I probably did that wrong, but I remember that it was not numbered properly

Revision as of 21:17, 4 July 2005

The [raw steps module] allows one to create multi-step slides in presentation without requiring JavaScript. This is achieved by spanning the steps of a slide over multiple document pages.

Commands

\SetupSteps [...=...,...=...]
Setup global options for generation of steps. Available options:
reserve
yes: when the item is not active, fill with empty space the area it takes when it is active (see section RawSteps#Reserving space)
no: when the item is not active, simply skip its generation
defaultsection
Subject, subject, chapter, ...
To disable sectioning commands, set \SetupSteps[defaultsection=page].
\StartSteps [sectiontype] [slide title] ... \StopSteps
The basic command pair for steps generation. sectiontype may be any sectioning command, such as chapter, section, subject, etc.
\NextStep
Use this as a separation between two steps.
\OnlyStep [n] [reserve] {...}
Show content only on the nth step.
\FromStep [n] [reserve] {...}
Show content only from the nth step through the last one.
\AfterStep [n] [reserve] {...}
Show content only from the n+1st step through the last one.
\UntilStep [n] [reserve] {...}
Show content only from the first step through the nth one.
\HighlightStep [n] {...}
Highlight content on the nth step.



Other settings

\UseStepstrue and \UseStepsfalse
Enable or disable generation of steps.
\definecolor [highlightcolor] [blue]
Color specification for the \HighlightStep command.


Page numbers

The module supports subpage numbers. To number pages in a format such as: 1/4, 2a/4, 2b/4, 2c/4, 3a/4, 3b/4, 4/4, use the following code to generate page numbers:

\pagenumber{\characters\subpagenumber}/\lastpagenumber


Usage examples

Preamble

The following preamble enables page numbering as shown in RawSteps#Page numbers in an interaction menu:

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

% interaction menu example:
% page number with alphabetic subpage number
\startinteractionmenu[bottom]
  \placelist[chapter] [alternative=bottom,criterium=all,pagenumber=no]
  \\
  \pagenumber{\characters\subpagenumber}/\lastpagenumber
\stopinteractionmenu

% setup example (default)
\SetupSteps[defaultsection=Subject,reserve=no]


Sectioning

The following illustrates different usage schemes of the \StartSteps ... \StopSteps pair:

\StartSteps[Topic][Topic Title]
  This is a topic slide.
  \NextStep
  Another step.
\StopSteps

\StartSteps[Subject][Subject Title 1]
  This is a subject slide.
  \NextStep
  Another step.
\StopSteps

\StartSteps[Subject Title 2]
  This is a subject (defaultsection) slide as well.
  \NextStep
  Another step.
\StopSteps

\StartSteps
  This slide comprises no section command.
  \NextStep
  Another step.
\StopSteps


Fancy stepping

The following example illustrates the usage of the fancier stepping commands \OnlyStep, \UntilStep, \FromStep, and \HighlightStep:

\StartSteps[Slide Title]

  \startitemize
    \item This will always appear.
    \OnlyStep      [2] {\item This appears only on step 2.}
    \UntilStep     [4] {\item This will change on step 4.}
    \FromStep      [4] {\item This has changed since step 4.}
    \HighlightStep [3] {\item This will be highlighted on step 3.}
  \stopitemize
  
\StopSteps


Reserving space

The reserve keyword makes the item appear as empty space when it is not active instead of not generating the item at all. It is particularly useful in typesetting equations, as shown by the following example:

\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

Development

Most important missing features

Some ideas are liseted about what should be done to improve the module:

  • Remove the bug of numbers >10 [1]
  • Fix the \starttyping bug [2]
  • Write \OnSteps macro to accept input like \OnSteps[1-3,5,7-9,13-last]. A part of it is (thanks to Taco!) already here, now only a dash still has to be implemented properly. On the basis of this, FromStep,AfterStep,UntilStep can be rewritten to use the \OnSteps mechanism. Well it would be much better to omit them, but I don't know how much care has to be taken for the "backward compatibility", it's no harm if they are left there.
\def\OnSteps[#1]#2%
  {\begingroup
   \def\processitem##1{\OnlyStep[##1]{#2}}%
   \processcommalist[#1]\processitem
   \endgroup}

and the rest of code on Inside_ConTeXt#Processing_lists_of_values

  • I don't like the \StartSteps[SubjectName] definition - it doesn't offer enough flexibility. For example, I would like some slides to start with \Title, some with \Subject, ... Also, if I wrote \setuphead[Subject][number=yes], than the subject number was higher on each new slide ... I just noted that I was probably wrong as I saw the \StartSteps[Title][Title name 2] example above.
  • I tried to number the formulas once. I probably did that wrong, but I remember that it was not numbered properly
  • Enable \OnlyStep[reserve] also for text mode, not only for math
  • Space reservation could be achieved with a 100% transparent text color....
  • Fix some spacing problems [3]
  • Fancy (tunable) page numbering (perhaps it is already there)
  • \completecontent has to list each chapter/section/title/subject/... only once

Slides printing

  • implement a sort of "page marking", so that someone can write \PrintThisSlide or \PrintSlides[1-3,5,7-9,13-last] (maybe Select[This]Slide sound better), than only the pages with this "mark" are selected out of the whole document and can be used to be printed out (we have to add some switch to select if we want a presentation or a print-out version of slides)
  • connect this with Hans's commands to compose more pages on one sheet of paper (for example to make 2*2, 2*4, ... latouts to be printed)
  • in a similar manner, add a possibility to add comments, that, again, are only printed next to the slide if some kind of \printmode and \setupSlideComments[state=on] is selected

Some ideas that need more time

These ideas probablt need some more time and are not crucial at the time.

  • Enable a sort of switch that would do the same kind of stepping, but with JavaScript instead of raw steps