Using: pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013)
When using the \tableofcontents
in beamer
, using the theme Berkeley
, with the option [hidesubsections]
, [hideothersubsections]
and the options to hide subsections, it renders the TOC wrongly. It introduces too much space to separate the section names.
The aim is to have a slide before each beginning of a section, with the ToC highlighting the current section and showing its subsections.
Given the following Minimal not Working Example(MnWE):
\documentclass[]{beamer}
\usetheme{Berkeley}
\begin{document}
\AtBeginSection[]{
\frame{
\tableofcontents[currentsection,hideothersubsections]
}
}
\begin{frame}
\tableofcontents[hidesubsections]
\end{frame}
\begin{frame}
\tableofcontents[currenthideallsubsections]
\end{frame}
\begin{frame}
\tableofcontents
\end{frame}
\section{section 1}
\subsection{subsection1}
\begin{frame}
subsection1
\end{frame}
\subsection{subsection2}
\begin{frame}
subsection1
\end{frame}
\section{section 2}
\subsection{subsection1}
\begin{frame}
subsection1
\end{frame}
\subsection{subsection2}
\begin{frame}
subsection1
\end{frame}
\section{section 3}hidesubsections
\begin{frame}
subsection1
\end{frame}
\section{section 4}
\begin{frame}
subsection1
\end{frame}
\section{section 5}
\begin{frame}
subsection1
\end{frame}
\section{section 6}
\begin{frame}
subsection1
\end{frame}
\section{section 7}
\begin{frame}
subsection1
\end{frame}
\section{section 8}
\begin{frame}
subsection1
\end{frame}
\end{document}
It will show the following images for the first, and third slide. The second is the same as the first:
The TOC with hidesubsections option and displayed wrongly, too many space to separate section names:
The TOC without hidesubsections option, displayed correctly:
Best Answer
This is the updated answer:
The internal command \beamer@sectionintoc (defined in the file beamerbasetoc.sty) controls how the section entries will be typeset in the ToC; it issues a \vskip1.5em that adds vertical spacing between section entries. With the help of the etoolbox package you can easily patch the command to add less vertical spacing.
I think this should probably be the right answer.