You do need to tell beamer
what you want to appear in each frame of the handout
version. You can use \onslide
specifications to do this so that you do not need to modify the existing overlay specifications at all. (I'm not sure this is what you want - probably not.)
The following code modifies your MWE so that, in presentation
mode, there would actually be 10 slides within the frame. These are then placed on slides 1 or 2 of the handout
. This is a waste of code: if you only want to show slide 5 and slide 10, you do not need two \againframe
but only one. But, anyway, with the two:
\documentclass[handout]{beamer}
\begin{document}
\begin{frame}<1-| handout:0>[label=foo]{My only frame}
\begin{enumerate}[<+->]% or whatever you like for presentation mode
\onslide<1-| handout:1-2>
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\onslide<1-| handout:2>
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\end{enumerate}
\end{frame}
\againframe<0| handout:1>{foo}
\againframe<0| handout:2>{foo}
\end{document}
More efficiently with only one repeat:
\documentclass[handout]{beamer}
\begin{document}
\begin{frame}<1-| handout:1>[label=foo]{My only frame}
\begin{enumerate}[<+->]% or whatever you like for presentation mode
\onslide<1-| handout:1-2>
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\onslide<1-| handout:2>
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\end{enumerate}
\end{frame}
\againframe<0| handout:2>{foo}
\end{document}
I'm not sure how this could apply to article
mode since then there are no frames or slides.
Some of the code added by the template does nowt except causing errors so far as I can tell. Other parts do try to do something, but not in the right way. This means they cause errors and potentially make no difference, depending on what TeX does in response to the errors.
Let's see what it does...
\setbeamerfont{section title}{parent=title}
What is the default?
\setbeamerfont{section title}{size=\Large,parent=title}
OK. So this sets the section title in the same size font as the title of the presentation, rather than switching to \Large
. This is OK if you want this.
\setbeamercolor{section title}{parent=titlelike}
What's the default?
\setbeamercolor{section title}{parent=titlelike}
So the code from the template does nothing. It is, however, harmless. It is just pointless.
\defbeamertemplate*{section page}{default}[1][]
{
\centering
\begin{beamercolorbox}[sep=8pt,center,#1]{section title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
}
What's the default?
\defbeamertemplate*{section page}{default}[1][]
{
\begingroup
\centering
{\usebeamerfont{section name}\usebeamercolor[fg]{section name}\sectionname~\insertsectionnumber}
\vskip1em\par
\begin{beamercolorbox}[sep=12pt,center,#1]{part title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
\endgroup
}
So the template omits any title defined by \part{}
, if there is one, reduces the separation and eliminates the Section <Number>
from above the section title. So this tries to do something. However, it does it in the wrong way and causes errors. Moreover, the errors mean that Beamer at least partially ignores the changes it tries to implement:
If you want these changes, do it effectively and avoid the errors:
\defbeamertemplate*{section page}{mine}[1][]
{
\centering
\begin{beamercolorbox}[sep=8pt,center,#1]{section title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
}
\usebeamertemplate{mine}
But do note that the template makes no attempt to alter the subsection title pages:
So your presentation will be somewhat inconsistently formatted - perhaps that's part of the design.
\newcommand*{\sectionpage}{\usebeamertemplate*{section page}}
Here's the default:
\def\sectionpage{\usebeamertemplate*{section page}}
So, this code creates a new command with the same name as an existing command, which doesn't work as it causes an error, but which would do precisely the same as the original if it did work. Brilliant.
De-templated code:
\documentclass{beamer}
\usecolortheme{crane}
\newcommand{\comment}[1]{}
\begin{document}
\title{Practical introduction to Agda}
\begin{frame}
\titlepage
\end{frame}
\section{Cooking without an Arga}
\begin{frame}
\sectionpage
\end{frame}
\subsection{The gas cooker}
\begin{frame}
\subsectionpage
\end{frame}
\end{document}
De-templated output:
Corrected templated code:
\setbeamerfont{section title}{parent=title}
\defbeamertemplate*{section page}{mine}[1][]
{
\centering
\begin{beamercolorbox}[sep=8pt,center,#1]{section title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
}
\usebeamertemplate{mine}
\newcommand{\comment}[1]{}
Corrected (technically - not aesthetically) templated output:
Best Answer
The effect of
\defbeamertemplate
is to install (beamer
's jargon) the option specified in<predefined option>
for the template whose name is<element name>
. The command has the following (simplified) syntax:Since
itemize item
with predefined optiontriangle
has already been installed (for example, inbeamerbaseauxtemplates.sty
andbeamerinnerthemedefault.sty
), your attempt obviously produces an error.To prevent this, you can use another string for the predefined option
and then
A compete example:
The resulting lists:
If you use the starred version then, besides setting the predefined template option,
\setbeamertemplate
is immediately used for this option. Sois equivalent to
Look at the following example
The result:
Another option, if you want to overwrite the original installment of an element is to first undefine the conflicting command. For example, when you use
the command
\beamer@@tmpop@itemize item@triangle
(notice the space in the name) gets internally defined using \newcommand (that's why simply trying to do anotherwill trigger an error). You can prevent the error by undefining the command: