[Tex/LaTex] Fading out slides in latex-beamer with the option “handout” produces empty slides

beameroverlays

I want to fade out some slides with overlays in the handout of my latex-beamer-presentation. When I use following code, slide one appears in the handout as a empty slide (only with heading). How can I avoid this?

\only<1| handout:0>{Test}  
\only<2| handout:2>{\includegraphics[width=.6\textwidth]{foo.jpg}}

Best Answer

In handout mode, beamer tries to combine all steps of an animation into one sline. If you explicitly give <handout:xxx> overlay specs, this does add frames in handout mode. To constrain this, just pass an additional overlay spec (<handout:2>) to the frame environment:

\begin{frame}<handout:2>[t]{Frame}
  \only<1| handout:0>{Test}  
  \only<2| handout:2>{\includegraphics[width=.6\textwidth]{foo.jpg}}
\end{frame}

If you have complex frames with many overlay specifications, it can become a bit tedious to specify them twice – especially, if you don't know in the beginning, which parts of the animation should become distinct slides in handout mode. In such cases, I usually specify all overlays as <all:xxx>, so that each step of an animation would also be there in handout mode and just constrain them by the frame's overlay specification:

\begin{frame}<handout:2>[t]{Frame}
  \only<all:1>{Test}  
  \only<all:2>{\includegraphics[width=.6\textwidth]{foo.jpg}}
\end{frame}

Complete MWE:

\documentclass[handout,draft]{beamer}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\begin{document}

\begin{frame}<handout:2>[t]{Frame}
  \only<1| handout:0>{Test}  
  \only<2| handout:2>{\includegraphics[width=.6\textwidth]{foo.jpg}}
\end{frame}

\begin{frame}<handout:2>[t]{Frame}
  \only<all:1>{Test}  
  \only<all:2>{\includegraphics[width=.6\textwidth]{foo.jpg}}
\end{frame}

\end{document}