I have to prepare a beamer presentation, but depending on the audience, during the presentation I might decide to skip some material. Is there a way to do this without having to skip quickly through the slides? I seem to remember that there was a command, but I forgot what it was and anyway I never succeeded in having it work. Thanks for your help!
[Tex/LaTex] How to jump to a slide in a beamer presentation
beamer
Related Solutions
I guess there are at least three alternatives for your problem, the four slides in the following example all do the same:
\documentclass{beamer}
\usetheme{Darmstadt}
\begin{document}
\begin{frame}
\begin{itemize}
\item first one
\pause
\item second one
\pause
\item third one
\pause
\item fourth one
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item<1-> first one
\item<2-> second one
\item<3-> third one
\item<4-> fourth one
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item<+-> first one
\item<+-> second one
\item<+-> third one
\item<+-> fourth one
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}[<+->]
\item first one
\item second one
\item third one
\item fourth one
\end{itemize}
\end{frame}
\end{document}
- the first one is you solution
- the second one tells at which slides to appear,
<3->
meaning all starting from the third one - the third one is used to increase the counter
beamerpause
(=1 at beginning of frame) by one at each encounter - the fourth one (probably the one you would go for) sets the "increase beamerpause" as a default behaviour for all list items
Edit 1: You can also set the behaviour from the fourth example as general. All frames following \beamerdefaultoverlayspecification{<+->}
will set pauses for every actionenv
environment and every \item
. To be in effect globally, you need to set this outside of a frame, e.g. as the first line after \begin{document}
, before the first frame.
This is a really nice question!
This is a start of a solution highly inspired by Werner's comment and with few limitations. They are due to the fact that the solution is on top of Beamer. For such a reason I mark it community wiki and every body can improve it (and there's lot of room).
It provides a simple user interface with the aim of
- creating tags for the differentiating version(s);
- deciding which version(s) output.
The first task is provided by the keys
create new version
create multiple versions
and the names are quite clear. To decide which frames output, exploit:
compile version
compile frames
to select a subset of frames within one versioncompile generic frames
to select frames from different versions.
As said, the mechanism is pretty much described in Werner's comment: creating a new version simply means that a new counter (or more) is instantiated and updated each time a frame is tagged that way. Compiling versions is traduced behind the scenes with the creation of a list that is passed to \includeonlyframes
. So far so good.
Let us see now limits and week points of the approach. Tagging frames in the aforementioned way without going really underneath Beamer, requires a bit of trickery, namely a new environment. For the purpose, a sebframe
environment has been defined which accepts an optional argument with the following syntax
<tag>-<list of beamer options>
The character -
is used to split the tag from other Beamer options; incidentally, this misses up with fragile
.
The mwe. It is commented and take it as a proof of concept: a few things can be improved as comments point out.
\documentclass{beamer}
\usepackage{lmodern} % https://tex.stackexchange.com/a/58088/13304
\usepackage{mwe} % for dummy image
\newcommand{\enlarge}{\centering\scalebox{13}}% Just for this example
% = = = = = = = = = = = = = = = = = = = = = = = =
% core of the solution
\usepackage{pgffor,pgfkeys,xstring}
\newcommand{\deflistframes}[1]{
\gdef\listframes{}% global list
\foreach \x[count=\xi] in {#1}{\global\let\maxitems\xi}% count the max number of items
\foreach \x[count=\xi] in {#1}{
\ifnum\xi=\maxitems
\xdef\listframes{\listframes \vers\x}
\else
\xdef\listframes{\listframes \vers\x,}
\fi
}
}
\newcommand{\defcustomlistframes}[1]{
\gdef\listframes{}% global list
\foreach \x[count=\xi] in {#1}{\global\let\maxitems\xi}% count the max number of items
\foreach \x[count=\xi] in {#1}{
\ifnum\xi=\maxitems
\xdef\listframes{\listframes \x}
\else
\xdef\listframes{\listframes \x,}
\fi
}
}
\makeatletter
% https://tex.stackexchange.com/a/74890/13304
\newcommand{\defversion}[1]{\@namedef{vers#1}{}}
\makeatother
% test for multiple versions compilation
\newif\ifmultipleversion
\multipleversionfalse
\pgfkeys{/seb-beamer/.cd,
create new version/.code={\gdef\vers{#1}\newcounter{#1}},
create multiple versions/.code={%
\gdef\listofversions{}
\foreach \v in {#1}{%
\defversion{\v}
\newcounter{\v}
\xdef\listofversions{\listofversions \v,}
}%
\multipleversiontrue
},
compile version/.code={% version-based: need to store in .aux a
% "total frame" counter per version (incremented in custom enviroment)
% and use it as final value (hard-coded here for simplicity)
\deflistframes{1,...,1000}
% list of frames in output
\expandafter\includeonlyframes\expandafter{\listframes}%
},
compile frames/.code={% this should be version-based -> second argument (TBA)
\deflistframes{#1}
% for the list
\expandafter\includeonlyframes\expandafter{\listframes}%
},
compile generic frames/.code={% generic for multi version compilations
\defcustomlistframes{#1}
% list of frames in output
\expandafter\includeonlyframes\expandafter{\listframes}%
},
}
\makeatletter
% see: https://tex.stackexchange.com/a/132411/13304
\newenvironment{sebframe}[1][]{
% cut the string to separate version from other options
\StrCut{#1}{-}\compvers\opt
\edef\seboptions{\opt}
\def\mylabel{}
\ifmultipleversion
\@ifundefined{c@\compvers}{}{% test if the counter is undefined
\stepcounter{\compvers}
% increment here the counter total frames per version
\edef\mylabel{label=\compvers\the\value{\compvers}}
}
\else
\IfStrEq{\vers}{\compvers}{% true
\stepcounter{\compvers}
% increment here the counter total frames per version
\edef\mylabel{label=\compvers\the\value{\compvers}}
}{% false
\edef\mylabel{}
}
\fi
\begingroup\edef\x{\endgroup\noexpand\begin{frame}[\mylabel,\seboptions]}\x}{\end{frame}}
\makeatother
\newcommand{\SebCompileOptions}[1]{%
\pgfkeys{/seb-beamer/.cd,#1}
}
% = = = = = = = = = = = = = = = = = = = = = = = =
% user interface
%\SebCompileOptions{create new version=A, compile version=A}
%\SebCompileOptions{%
% create multiple versions={A,B},
% compile generic frames={A1,A3,B1,B2,C3}
%}
\SebCompileOptions{create new version=C, compile frames={1,3}}
\begin{document}
\begin{sebframe}[A-t,allowframebreaks]
\frametitle{Version A}
\enlarge{A1}
\end{sebframe}
\begin{sebframe}[B]
\frametitle{Version B}
\enlarge{B1}
\end{sebframe}
\begin{sebframe}[C]
\frametitle{Version C}
\enlarge{C1}
\end{sebframe}
\begin{sebframe}[A]
\frametitle{Version A}
\enlarge{A2}
\end{sebframe}
\begin{sebframe}[B]
\frametitle{Version B}
\enlarge{B2}
\end{sebframe}
\begin{sebframe}[C]
\frametitle{Version C}
\enlarge{C2}
\end{sebframe}
\begin{frame}
\frametitle{Version B or C}
\enlarge{BC}
\end{frame}
\begin{sebframe}[A-t,b,containsverbatim]% just to point out that passing multiple beamer options works (unless fragile)
\frametitle{Version A}
\enlarge{A3}
\end{sebframe}
\begin{sebframe}[C]
\frametitle{Version C}
\enlarge{C3}
\vskip1ex
\includegraphics<2>[scale=0.5]{example-image}
\end{sebframe}
\begin{sebframe}[A]
\frametitle{Version A}
\enlarge{A4}
\end{sebframe}
\begin{frame}[fragile,label=A5]% add manually a label: displayed only in A version though
\frametitle{Version A \& B \& C}
\enlarge{ABC}
\end{frame}
\end{document}
As we selected:
\SebCompileOptions{create new version=A, compile version=A}
the output is:
By selecting
\SebCompileOptions{create new version=C, compile frames={1,3}}
Notice that overleyed-aware commands still work and frame C2 is not displayed. Let us try
\SebCompileOptions{%
create multiple versions={A,B},
compile generic frames={A1,A3,B1,B2,C3}
}
which produces:
As expected, since version C is not defined, the frame C3 is not displayed. The order in which one provides the list does not affect the order of appaearance in the PDF: only page numbers counts for that.
Best Answer
Beamer offers a variety of navigation buttons for such purposes. Together with the
\hyperlink
command they can be used to conveniently jump to other slides or frames.For more examples, please see section
11.1 Adding Hyperlinks and Buttons
from the beamer user guide.