12

I'm writing a beamer presentation that should be divided into several parts, each of them contains sections, subsections, etc.

This code (without \part commands) works fine and it generates TOC correctly:

\documentclass{beamer}

\title{Title}
\subtitle{Subtitle}
\author{Author Of Presentation}


\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\tableofcontents
\end{frame}

%\part{Part 1}
%\frame{\partpage}

\section{Section 1}

\begin{frame}
Section 1
\end{frame}

\subsection{Subsection 1.1}

\begin{frame}
Subsection 1.1
\end{frame}

\subsection{Subsection 1.2}

\begin{frame}
Subsection 1.2
\end{frame}

\section{Section 2}

\begin{frame}
Section 2
\end{frame}

%\part{Part 2}
%\frame{\partpage}

\section{Section 3}

\begin{frame}
Section 3
\end{frame}

\subsection{Subsection 3.1}

\begin{frame}
Subsection 3.1
\end{frame}

\subsection{Subsection 3.2}

\begin{frame}
Subsection 3.2
\end{frame}

\section{Section 4}

\begin{frame}
Section 4
\end{frame}

\end{document}

but when I uncomment the \parts commands and the \frame{\partpage} commands I get an empty TOC.

What should I change to visualize a correct TOC? I would like to achieve the following result in the TOC (no subsections and deeper level):

Part I

+++ Section 1

+++ Section 2

Part II

+++ Section 3

+++ Section 4

2
  • 2
    Either add your \tableofcontents slide to the current part, or use the [part=N] optional parameter to get the ToC for a given part. Beamer manual, section 10.5. To get your exact effect, you'll need multiple \tableofcontents commands on one slide. May 3, 2015 at 18:10
  • 1
    That makes the \tableofcontents command pretty useless in my opinion. Jan 29, 2018 at 11:06

1 Answer 1

11

For later reference, the \tableofcontents command in beamer only lists entries for the current part. The optional parameter [part=N] will list the entries for part N. This is documented in section 10.5 of the beamer manual.

\documentclass{beamer}

\title{Title}
\subtitle{Subtitle}
\author{Author Of Presentation}

\newcommand{\makepart}[1]{ % For convenience
\part{Title of part #1} \frame{\partpage}
\section{Section} \begin{frame} Section \end{frame}
\subsection{Subsection} \begin{frame} Subsection \end{frame}
\subsection{Subsection} \begin{frame} Subsection \end{frame}
\section{Section} \begin{frame} Section \end{frame}
}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
Part I:
\tableofcontents[part=1]
Part II:
\tableofcontents[part=2]
\end{frame}

\makepart{1}

\makepart{2}

\end{document}

enter image description here

You must log in to answer this question.