RawSteps

From Wiki
Jump to navigation Jump to search

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 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.



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:

  • 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 [1]

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


External Links