1

I guess this is a dublicate. In the following MWE I want the frame Table of Contents contain only the sections. But the TOC should pop out at the begining of each section with the subsections that the currect section contains. The current section and its subsections should be highlighted. How is it possible that?

\documentclass[hyperref={pdfpagelabels=false}]{beamer}
\usepackage{lmodern}
\usetheme{Antibes}
\title{Beamer Class Usetheme Antibes}  
\author{Sascha Frank} 
\date{\today} 
\begin{document}
%\logo{\includegraphics[scale=0.14]{logo-SF}}
\begin{frame}
\titlepage
\end{frame} 


\begin{frame}
\frametitle{Table of contents}
\tableofcontents
\end{frame} 


\section{Section no.1} 
\begin{frame}
\frametitle{frame title} 
Each frame should have a title.
\end{frame}
\subsection{Subsection no.1.1  }
\begin{frame}
Without title somethink is missing. 
\end{frame}


\section{Section no. 2} 
\subsection{Lists I}
\begin{frame}
\frametitle{unnumbered lists}
\begin{itemize}
\item Introduction to  \LaTeX{}  
\item Course 2 
\item Termpapers and presentations with \LaTeX{}  
\item Beamer class
\end{itemize} 
\end{frame}

\begin{frame}\frametitle{lists with single pauses}
\begin{itemize}
\item Introduction to  \LaTeX{}  \pause 
\item Course 2 \pause 
\item Termpapers and presentations with \LaTeX{}  \pause 
\item Beamer class
\end{itemize} 
\end{frame}

\begin{frame}\frametitle{lists with pause}
\begin{itemize}[<+->]
\item Introduction to  \LaTeX{}  
\item Course 2
\item Termpapers and presentations with \LaTeX{}  
\item Beamer class
\end{itemize} 
\end{frame}



\subsection{Lists II}
\begin{frame}\frametitle{numbered lists}
\begin{enumerate}
\item Introduction to  \LaTeX{}   
\item Course 2 
\item Termpapers and presentations with \LaTeX{}  
\item Beamer class
\end{enumerate}
\end{frame}

\begin{frame}
\frametitle{numbered lists with single pauses}
\begin{enumerate}
\item Introduction to  \LaTeX{}  \pause 
\item Course 2 \pause 
\item Termpapers and presentations with \LaTeX{}  \pause 
\item Beamer class
\end{enumerate}
\end{frame}

\begin{frame}
\frametitle{numbered lists with pause}
\begin{enumerate}[<+->]
\item Introduction to  \LaTeX{}  
\item Course 2
\item Termpapers and presentations with \LaTeX{}  
\item Beamer class
\end{enumerate}
\end{frame}

\end{document}

1 Answer 1

2

In Section 10.5 Adding a Table of Contents of the beamer user guide, you can find all the available options for the table of contents.

To show only the sections:

\tableofcontents[hidesubsections]

To highlight the current section and show the subsections of the current section:

\tableofcontents[currentsection, subsectionstyle=show/show/hide]

Full MWE:

\documentclass[hyperref={pdfpagelabels=false}]{beamer}
\usepackage{lmodern}
\usetheme{Antibes}
\title{Beamer Class Usetheme Antibes}  
\author{Sascha Frank} 
\date{\today} 

\AtBeginSection{%
\begin{frame}
    \tableofcontents[currentsection, subsectionstyle=show/show/hide]
\end{frame}
}


\begin{document}
%\logo{\includegraphics[scale=0.14]{logo-SF}}
\begin{frame}
\titlepage
\end{frame} 


\begin{frame}
\frametitle{Table of contents}
\tableofcontents[hidesubsections]
\end{frame} 


\section{Section no.1} 
\begin{frame}
\frametitle{frame title} 
Each frame should have a title.
\end{frame}
\subsection{Subsection no.1.1  }
\begin{frame}
Without title somethink is missing. 
\end{frame}


\section{Section no. 2} 
\subsection{Lists I}
\begin{frame}
\frametitle{unnumbered lists}
\begin{itemize}
\item Introduction to  \LaTeX{}  
\item Course 2 
\item Termpapers and presentations with \LaTeX{}  
\item Beamer class
\end{itemize} 
\end{frame}

\begin{frame}\frametitle{lists with single pauses}
\begin{itemize}
\item Introduction to  \LaTeX{}  \pause 
\item Course 2 \pause 
\item Termpapers and presentations with \LaTeX{}  \pause 
\item Beamer class
\end{itemize} 
\end{frame}

\begin{frame}\frametitle{lists with pause}
\begin{itemize}[<+->]
\item Introduction to  \LaTeX{}  
\item Course 2
\item Termpapers and presentations with \LaTeX{}  
\item Beamer class
\end{itemize} 
\end{frame}



\subsection{Lists II}
\begin{frame}\frametitle{numbered lists}
\begin{enumerate}
\item Introduction to  \LaTeX{}   
\item Course 2 
\item Termpapers and presentations with \LaTeX{}  
\item Beamer class
\end{enumerate}
\end{frame}

\begin{frame}
\frametitle{numbered lists with single pauses}
\begin{enumerate}
\item Introduction to  \LaTeX{}  \pause 
\item Course 2 \pause 
\item Termpapers and presentations with \LaTeX{}  \pause 
\item Beamer class
\end{enumerate}
\end{frame}

\begin{frame}
\frametitle{numbered lists with pause}
\begin{enumerate}[<+->]
\item Introduction to  \LaTeX{}  
\item Course 2
\item Termpapers and presentations with \LaTeX{}  
\item Beamer class
\end{enumerate}
\end{frame}

\end{document}
4
  • Note the squared bracket: it should be \AtBeginSection[]{% \begin{frame} \tableofcontents[currentsection, subsectionstyle=show/show/hide] \end{frame} }
    – DavideL
    Commented Sep 19, 2023 at 8:34
  • @DavideL The square bracket is optional. If you want a different behaviour for starred sections, you can use it. Otherwise this is valid syntax as well. Commented Sep 19, 2023 at 8:37
  • I thought so too, but I got an error trying to compile without it
    – DavideL
    Commented Sep 19, 2023 at 9:48
  • 1
    @DavideL This can happen if you use a starred section inside a frame, e.g. if you use \printbibliography from biblatex. Generally it works fine, the code from the answer compiles without error. Commented Sep 19, 2023 at 9:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .