[Tex/LaTex] how to include a preview of next slide in Beamer’s speaker notes

beamernotes

The default style for Beamer's speaker notes includes a little thumbnail of the current slide. Is there anything I can do to get a thumbnail of the next slide?

(I don't need to see the current slide, as it's being displayed on the projector; seeing a preview of the next slide would avoid the unpleasant phenomenon in which a speaker (i.e., me) is surprised by what happens when he or she clicks forward…)

For extra credit: how can I make that thumbnail bigger?

Best Answer

Perhaps this will give you something of what you seek. The commands/environments introduced are

\previewmode[T or F] turns on or off preview mode (current default is on)

\begin{sframe}...\end{sframe} to save, but not immediately display, a frame. Note that frames need to be saved in order for their preview to function. In essence, this replaces the use of the {frame} environment.

\reciteframe[frame #] will recite the next frame or, alternately, a frame # specified by the optional argument. Used when beamer parameters need to be reset between frames. The status of \previewmode will determine whether the next slide preview is included.

\reciteframes will recite all the frames, start to finish. Used when no beamer parameters need resetting in the middle of the presentation. The status of \previewmode will determine whether the next slide preview is included.

\savedframe[scale]{frame #} This provides user access to previously saved frames, so that a scaled version of a previously saved frame can be used as actual content (thus to be seen by the audience) in the current frame. Based on my answer at Snapshot like macro for entire beamer frame?.

The way I envision these routines being used is for a presentation to be prepared using sframes, and displayed in preview mode. The user then saves this output file as the preview PDF. He/she then resets a single line prior to the \reciteframe(s) macro to the effect of \previewmode[F], and recompiles. This PDF output is now the version for the audience. During the presentation, there are two PC's, with the presenter looking at the preview-version PDF, while the operator advances the audience PDF in sync.

In addition to these macros, there are several parameters

\def\defaultpreviewscale{.3}% CAN SET THIS AS DESIRED FOR SCALE OF PREVIEW

\def\insetHalignment{r}

\def\insetValignment{t}

\def\insetHoffset{-22pt}

\def\insetVoffset{1pt}

that can be set to determine the size and location of the preview.

\documentclass{beamer}
\def\defaultpreviewscale{.3}% CAN SET THIS AS DESIRED FOR SCALE OF PREVIEW
\def\insetHalignment{r}
\def\insetValignment{t}
\def\insetHoffset{-22pt}
\def\insetVoffset{1pt}
%
\usepackage{stackengine,ifthen}
\newcounter{frametotal}
\newcounter{frameindex}
% sframe ENVIRONMENT USED TO SAVE FRAMES in \saveframebox[INDEX]
\newenvironment{sframe}%
{\stepcounter{frametotal}%
 \expandafter\newsavebox\expandafter{%
   \csname saveframebox\romannumeral\theframetotal\endcsname}%
 \setbox0=\vbox\bgroup\begin{frame}%
}
{\end{frame}\leavevmode\unskip\setbox0=\lastbox\egroup%
 \global\sbox{\csname saveframebox\romannumeral\theframetotal\endcsname}{\box0}%
}
% WHILE USED FOR PREVIEW MODE, \savedframe[scale]{frame #} CAN ALSO BE USED
% TO RECALL PRIOR FRAMES
\newcommand\savedframe[2][\defaultpreviewscale]{\fboxsep=0pt%
    \fbox{\scalebox{#1}{\hspace{1cm}{\usebox{%
      \csname saveframebox\romannumeral#2\endcsname}\hspace{1cm}}}}%
}
% WILL RECITE ALL sframes, USING PREVIEW MODE IF [P] IS THE OPTIONAL ARGUMENT
\newcommand\reciteframes{%
  \setcounter{frameindex}{0}%
  \whiledo{\value{frameindex}<\numexpr\value{frametotal}-1\relax}{%
    \stepcounter{frameindex}%
    \begin{frame}
      \previewinset{\insetHalignment}{\insetHoffset}{\insetValignment}{\insetVoffset}%
        {\savedframe[\defaultpreviewscale]{\numexpr\value{frameindex}+1\relax}}%
        {\usebox{\csname saveframebox\romannumeral\theframeindex\endcsname}}%
    \end{frame}
  }%
  \begin{frame}
  \usebox{\csname saveframebox\romannumeral\theframetotal\endcsname}%
  \end{frame}
}% WILL RECITE ONE frames, USING PREVIEW MODE IF [P] IS THE OPTIONAL ARGUMENT
\newcommand\reciteframe[1][\numexpr\theframeindex+1\relax]{%
  \setcounter{frameindex}{#1}%
  \ifnum\value{frameindex}<\numexpr\value{frametotal}\relax{%
    \begin{frame}
      \previewinset{\insetHalignment}{\insetHoffset}{\insetValignment}{\insetVoffset}%
        {\savedframe[\defaultpreviewscale]{\numexpr\value{frameindex}+1\relax}}%
        {\usebox{\csname saveframebox\romannumeral\theframeindex\endcsname}}%
    \end{frame}
  }\else%
  \begin{frame}
  \usebox{\csname saveframebox\romannumeral\theframetotal\endcsname}%
  \end{frame}
  \fi
}
% ALLOW PREVIEW MODE TO BE TURNED ON [T] OPTION OR OFF [F]
\newcommand\previewmode[1][T]{%
  \ifx T#1\let\previewinset\stackinset\else\renewcommand\previewinset[6]{##6}\fi
}
\previewmode% DEFAULT MODE PREVIEW, OR ELSE SET AS \previewmode[F]
\begin{document}
\begin{sframe}{1st frame}
Blah blah for the first frame\par
A preview of my next frame is in the upper right
\end{sframe}

\begin{sframe}{2nd Frame}
frame text from the second frame.  I will now begin an itemized list.  And we begin:%
\begin{itemize}
\item AAA
\item BBB
\item CCC
\end{itemize}
\bigskip
And here is the prior frame \#1: \smash{\savedframe[.25]{1}}
\end{sframe}

\begin{sframe}{3rd Frame}
This is my third frame:%
\begin{itemize}
\item Green Eggs
\item Ham
\item Sam
\item I am
\end{itemize}
\end{sframe}

% CAN INVOKE 1 FRAME AT A TIME, CHANGING beamer PARAMETERS AS YOU GO
\setbeamercolor{background canvas}{bg=violet!15}
\reciteframe
\setbeamercolor{background canvas}{bg=yellow!50}
\reciteframe
\setbeamercolor{background canvas}{bg=blue!10}
\reciteframe[3]% OR YOU CAN ALTERNATELY REQUEST THE FRAME NUMBER
% OR YOU CAN RECITE ALL FRAMES AT ONCE, IN PREVIEW MODE
\reciteframes
% OR YOU CAN RECITE ALL FRAMES WITHOUT PREVIEW MODE
\previewmode[F]
\reciteframes
\end{document}

Below is a sample of a frame in preview mode. It shows frame 2 as the slide, with the frame 3 preview in the upper right corner. In addition, the same routines can be employed within a frame, in the form of \savedframe[scale]{frame index} to show a prior frame (to the audience, not just the speaker), as is done here where frame 1 review is part of frame 2's content.

While the preview allows overlap with the slide content (bad), it does not change the spacing of the underlying slide (good). It is up to the user to configure the size and location of the preview to avoid a problem.

enter image description here

Here's a montage of the frames from the MWE. In the first row, the 3 saved frames are recited one at a time (successive \reciteframe), so that changes like color can be made to the slides, if necessary. The first row is done in preview mode, with the previews in the upper right corner. The last frame of the set shows no preview.

The second row is the 3-slide presentation regurgitated all at once (\reciteframes). Because it is all at once, beamer parameters like color cannot be reset in the middle. The second row is done in preview mode.

The third row is also regurgitated all at once. However, previewmode has been turned off, so one does not see the previews in the upper right corner. This is the version for the audience to see.

enter image description here

Related Question