TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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">
        <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">
            tex2jax: {
                inlineMath:  [['$',  '$'  ]],
                displayMath: [['\\[','\\]'], ['$$','$$']],
                processEscapes: true
            TeX: { 
                equationNumbers: { autoNumber: "AMS" },
                extensions: ["AMSmath.js", "AMSsymbols.js","action.js" ]
        <script type="text/javascript"

    <script type="math/tex">



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

share|improve this question
Can you give an MWE to play with? – hpesoj626 Jan 10 '13 at 1:28
Sure, I added one. – Jesko Hüttenhain Jan 10 '13 at 7:59
Sounds like a presentation: look at beamer or powerdot: see Which package to use for presentations ? Beamer, Prosper, or Other. In beamer what you describe is called an 'overlay action', and generates one PDF page per 'effect'. – Joseph Wright Jan 10 '13 at 8:07
I'm assuming that 'change page' is acceptable to alter the display: you can also define clickable areas in PDF files to create internal links, but usually changing page suffices. – Joseph Wright Jan 10 '13 at 8:09
No, that's not what I want at all. I am picturing a commutative diagram inside a proof, with text above and below it, and I simply click inside the PDF to slideshow through it. I am well-aware that I can create slideshows with beamer, but that's not what I am looking for. In particular, 'change page' is not really a solution =/. – Jesko Hüttenhain Jan 10 '13 at 8:46
up vote 2 down vote accepted

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


share|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.