Document layout and layers/Presentations/Raw steps module

Unofficial ConTeXt Wiki mirror

Last modified: 2025-01-05

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

Setup

\SetupSteps [...=...,...=...]
Setup global options for generation of steps. Available options:
state
start : enable stepping
stop : disable stepping
reserve
yes : when the item is not active, fill with empty space the area it takes when it is active (see section 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] .

Step block

\StartSteps [sectiontype] [slide title] ... \StopSteps
The basic command pair for steps generation. sectiontype may be any sectioning command, such as chapter , section , subject , etc.

Basic stepping commands

\NextStep
Use this as a separation between two steps.
\AllSteps
Use like \NextStep , but the content appears on every step.

Advanced stepping commands

\OnSteps [ step-list ] [reserve] {...}
Show the content on the specified steps from the comma-separated step list. Use dashes for intervals and ... to denote the first or the last step.
\HighlightSteps [ step-list ] {...}
Highlight content on the specified steps.

Alternate stepping commands

\OnlyStep [ n ] [reserve] {...}
Show content only on the n th step.
\FromStep [ n ] [reserve] {...}
Show content only from the n th step through the last one.
\AfterStep [ n ] [reserve] {...}
Show content only from the n +1 st step through the last one.
\UntilStep [ n ] [reserve] {...}
Show content only from the first step through the n th one.

Other settings

\CurrentStepNumber
Expands to the index (starting at 1) of the step being rendered.
\StepsRegisterNumber[...] and \StepsUnregisterNumber[...]
Registers/unregisters a number so that it remains unchanged on a step set. E.g. if you're using \defineenumeration[Theorem][...] , then use \StepsRegisterNumber[Theorem] .
\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 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

Advanced stepping

The following example illustrates the usage of the advanced stepping commands \OnSteps and \HighlightSteps:

\StartSteps[Advanced stepping (step \CurrentStepNumber)]
  
  \startitemize
  \OnSteps[1-3,5]{\item Steps 1, 2, 3 and 5.}
  \OnSteps[2-...]{\item From step 2.}
  \OnSteps[3]    {\item Step 3.}
  \OnSteps[...-4]{\item Up to step 4.}
  \stopitemize
  
\StopSteps


\StartSteps[Highlighting (step \CurrentStepNumber)]

  \startitemize
  \item \HighlightSteps[1,4]	{Step 1.}
  \item \HighlightSteps[2]	{Step 2.}
  \item \HighlightSteps[3]	{Step 3.}
  \item \HighlightSteps[4]	{Start over from Step 1.}
  \stopitemize
  
\StopSteps

Alternate stepping

The following example illustrates the usage of the alternate 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      [3] {\item This has changed since 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[Equations]

  \placeformula[eq:divu]
  \startformula
    \vec\nabla\cdot\vec u = 0
  \stopformula
  
  \placeformula[eq:NS]
  \startformula
    \frac{D\vec u}{Dt} =
      \OnSteps[2-...][reserve]{-{\red \frac1\rho \vec\nabla p}}
      \OnSteps[3-...][reserve]{+\;{\green \vec g}}
      \OnSteps[4-...][reserve]{+\;{\blue \frac1\rho \vec\nabla\cdot S}}
  \stopformula

  Incompressibility (\in{eq.}[eq:divu]).

  Momentum transport (\in{eq.}[eq:NS]):
  \startitemize
  \OnSteps[2-...]{\item {\red   Pressure gradient}}
  \OnSteps[3-...]{\item {\green	Gravity}}
  \OnSteps[4-...]{\item {\blue	Stress (viscous, turbulent, Maxwell)}}
  \stopitemize

\StopSteps

Development

Most important missing features

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

Slides printing

Some ideas that need more time

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

External Links