2

For my lecture, I often use tikz to illustrate concepts graphically.

There is usually a lot of information in the graph, and the tikz includes different illustrations on separate frames. In the handout mode however, everything is collapsed into one, making it illegible.

How can I maintain the handout mode for "typical" slides, but temporarily switch to having a separate page per overlay for a specific slide?

Here is a MWE. The issue is that both parts of the tikzpicture are printed on top of each other. The solution given here suggests replacing each by <X|handout:X>. That would work in this particular context, but is tedious for slides that have many separate overlays (and I also use the transparency mode, so I'd really have to repeat it twice)

\documentclass[handout]{beamer}
\usepackage{tikz}

\begin{document}
    \begin{frame}
    \begin{itemize}[<+->]
    \item Show all of this
    \item at once
    \item in the handout.
    \end{itemize}
    \end{frame}

    \begin{frame}
    % \begin{animatedhandout} % see below
    \centering
    \begin{tikzpicture}
        \only<1>{\draw (-1,-1) rectangle (1,1) (1,0) node[anchor=west] {Info 1};}
        \only<2>{\draw (0,0) circle (1) (1,0) node[anchor=west] {Info 2};}
    \end{tikzpicture}
    % \end{animatedhandout}
    \end{frame}

    \begin{frame}
    \begin{itemize}[<+->]
    \item Again, this should 
    \item all be shown at once
    \item in the handout.
    \end{itemize}
    \end{frame}
\end{document}

I was thinking of defining a command

\newcommand<>{\onlyev}[1]{
  \only<#2 | handout:#2 | tran:#2 >{#1}
}

that is printed only on the specified slide in every mode ("only everywhere"). The issue is that argument #2 already includes the pointy braces, so \onlyev<7>{hello} would expand to

```\only<<7> | handout:<7> | tran:<7> >{hello}```` which does not have the desired effect. If anyone can help me strip the < and > symbol from my argument, I could use this approach.

Alternatively, I've tried to define an environment animatedhandout which I could call inside a frame to temporarily switch to beamer mode based on this answer.

\makeatletter 
\newenvironment{animatedhandout}{
    \begingroup
    \gdef\beamer@currentmode{beamer}
    }{%
    \endgroup
}
\makeatother

Unfortunately, this does not seem to switch back to handout mode after the slide (it also messes up the centering for some reason).

1

1 Answer 1

4

As shown in my comment beamer \againframe showing full frame without any/ with all overlays , use \def instead of \gdef if you only want to make the changes inside of a group and not globally:

\documentclass[handout]{beamer}
\usepackage{tikz}

\makeatletter 
\newenvironment{animatedhandout}{%
    \begingroup
    \def\beamer@currentmode{beamer}%
    }{%
    \endgroup
}
\makeatother

\begin{document}
    \begin{frame}
    \begin{itemize}[<+->]
    \item Show all of this
    \item at once
    \item in the handout.
    \end{itemize}
    \end{frame}

    \begin{frame}
     \begin{animatedhandout} % see below
     \centering
     \begin{tikzpicture}
        \only<1>{\draw (-1,-1) rectangle (1,1) (1,0) node[anchor=west] {Info 1};}
        \only<2>{\draw (0,0) circle (1) (1,0) node[anchor=west] {Info 2};}
     \end{tikzpicture}\par
     \end{animatedhandout}
    \end{frame}

    \begin{frame}
    \begin{itemize}[<+->]
    \item Again, this should 
    \item all be shown at once
    \item in the handout.
    \end{itemize}
    \end{frame}
\end{document}

enter image description here

3
  • oh, I didn't catch the gdef becoming def....
    – mimuller
    Commented Apr 9 at 9:49
  • Neat, I could've used this while I was still in the business :) Commented Apr 9 at 20:42
  • 1
    @AndrasDeak Just build a time machine, go back and use this approach :) Commented Apr 9 at 20:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .