2

The MathJax JavaScript library contains a command that lets you create LaTeX slideshows, namely the \toggle command.

I would find it incredibly useful to produce the same effect in a PDF file, most prominently to consecutively draw complicated commutative diagrams. Hence, my questions:

  1. Can modern PDF documents contain slideshow elements of some kind?
  2. If so, is there a LaTeX package that allows me to create this effect in a PDF document?

Edit: By popular request, here's an example:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Toggle Math</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="Toggle Math">
        <meta name="author" content="Jesko">
        <script type="text/x-mathjax-config">
        MathJax.Hub.Config({
            tex2jax: {
                inlineMath:  [['$',  '$'  ]],
                displayMath: [['\\[','\\]'], ['$$','$$']],
                processEscapes: true
            },
            TeX: { 
                equationNumbers: { autoNumber: "AMS" },
                extensions: ["AMSmath.js", "AMSsymbols.js","action.js" ]
            } 
        });
        </script>        
        <script type="text/javascript"
          src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
        </script>
    </head>

    <body>
    <script type="math/tex">

      \toggle{x=1}{x=2}{x=3}\endtoggle

    </script>
    </body>
</html>

Just put that in a .html file and check it out.

1 Answers1

2

The code below reproduces your html example as a PDF. Use Adobe Reader for display.

\documentclass{article}
\usepackage{animate}

\begin{document}
\begin{animateinline}[step]{1}
  \strut$x=1$
\newframe
  \strut$x=2$
\newframe
  \strut$x=3$
\end{animateinline}
\end{document}
AlexG
  • 54,894
  • Perfect. I wish I had more than one upvote. Thanks! – Jesko Hüttenhain Jan 10 '13 at 12:17
  • @Jesko Thanks! Note that you will have to put multiline text into parboxes, preferably into minipages, and that all frames should place their text into minipages of same horizontal and vertical dimensions. Otherwise the text may be distorted. Thus, \begin{minipage}[t|c|b][<height>]{<width>} ... \end{minipage} – AlexG Jan 10 '13 at 12:49