Skip to content

JSXGraph visualizations: tabs and incremental

To support exercises (where you can ask the user to solve certain problems and then check the solution), you can use simple tabs and incremental environments.

\begin{visualization}{jsxviz}
...
\text{Solve the following problems and then click on Answer}
\text{a) Calculate something}
\text{b) Calculate something else}
\text{c) Calculate something else again}


\begin{tabs}{0}% tabs environment, the second argument defines which tab should be displayed on default, 0 means all tabs are hidden
  \tab{Answer}
  \text{\textbf{a)result for a}}
  \text{\textbf{b)result for b}}
  \text{\textbf{c)result for c}}

  \tab{Solution for a}

  \begin{incremental}{1} % incremental environment, step 1 is displayed on default
    \step %creates a step
    \text{line 1 in step1}
    \text{line 2 in step1}
    % more lines ...

    \step % begin step 2
    \text{line 1 in step2}
    % more lines ...
  \end{incremental}

  \tab{Solution for b}
    ...
  \tab{Solution for c}
  ... 
\end{tabs}
...
\end{visualization}