14

Let's suppose I have a long TOC in beamer, which LaTeX expands to two (or more) slides thanks to the allowframebreaks option.

\documentclass[12pt]{beamer}
\usetheme{madrid}
\usepackage[american]{babel}
\usepackage[utf8]{inputenx}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\title{List of Donald Duck universe characters}
\author{Walt Disney}

\begin{document}

\section{Main characters}
\subsection{Donald Duck}
\subsection{Daisy Duck}
\subsection{Huey, Dewey, and Louie}
\subsection{Scrooge McDuck}
\subsection{Ludwig Von Drake}

\section{Relatives}
\subsection{Duck family (Disney)}
\subsection{Clan McDuck}

\section{Duck characters}
\subsection{Umperio Bogarto}
\subsection{Bum Bum Ghigno}
\subsection{Magica De Spell}
\subsection{Evroniani}
\subsection{Flintheart Glomgold}
\subsection{Gloria}
\subsection{Gotrocks}
\subsection{Grand Mogul}
\subsection{Mata Harrier}
\subsection{Brigitta MacBridge}

\begin{frame}[allowframebreaks]{Donald Duck universe characters}
\tableofcontents
\end{frame}

\end{document}

The first slide is filled to its maximum extend, and the rest goes (top-aligned) on the second slide. However, I'd like to fine tune it such that section 1&2 are shown on slide 1, whereas section 3 (including all its subsections) goes to slide 2. Of course, the text on both slides should be vertically centered, not top aligned. I would also like to preserve the automatic title numbering on the subsequent slides, i.e., I, II, III.

I know about \framebreak, but have no idea where to put it!? \tableofcontents[hideothersubsections] as suggested here does not seem to do the trick either.

winkmal
  • 845

4 Answers4

16

My suggestion is avoid split the ToC in several frames. Alternatives:

1) Start only showing the sections (without subsections):

\begin{frame}{ToC}
\setcounter{tocdepth}{1}
\tableofcontents
% \setcounter{tocdepth}{2} % allow subsequent ToCs *with* subsections  
\end{frame}

... or shorter:

\begin{frame}{ToC}
\tableofcontents[hideallsubsections]
\end{frame}

mwe1

Simplicity is power in a presentation.

2) Not incompatible with the previos point, show the ToC starting each section, but highliting the current section and optionally showing the subsections of this section only:

% In the preamble!!
\AtBeginSection
{\begin{frame}{ToC}
\tableofcontents[currentsection,hideothersubsections]
\end{frame}}
\begin{document}

And set tocdepth counter to 2 if yo left the frame of point 1!

mwe2

In some cases (e.g. showing the 3th section) this is not enough because there are 10 subsections. Then these are my suggestions:

a) Do not show any subsections (maintain tocdepth in 1). Still simplicity is power.

b) Redesign the structure, if possible, making fewer subsections.

c) Use multicolumns, e.g.:

% In the preamble!!
\usepackage{multicol}
\AtBeginSection
{\begin{frame}{ToC}
\begin{multicols}{2}
\tableofcontents[currentsection,hideothersubsections]
\end{multicols}
\end{frame}}
\begin{document}

mwe3

d) Remove the shadow sections, show only the Toc of the actual section with \tableofcontents[sectionstyle=show/hide,subsectionstyle=show/show/hide]:

mwe4

Fran
  • 80,769
  • 1
    The specific answer to my specific question is @samcarter's, that's why I'm awarding him the "Correct answer" tick. However, your answer is also very helpful and I will definitely keep it in mind as my presentation evolves. – winkmal Feb 07 '17 at 12:40
12
\documentclass[12pt]{beamer}
\usetheme{Madrid}
\usepackage[american]{babel}
\usepackage[utf8]{inputenx}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\title{List of Donald Duck universe characters}
\author{Walt Disney}

\begin{document}

\section{Main characters}
\subsection{Donald Duck}
\subsection{Daisy Duck}
\subsection{Huey, Dewey, and Louie}
\subsection{Scrooge McDuck}
\subsection{Ludwig Von Drake}

\section{Relatives}
\subsection{Duck family (Disney)}
\subsection{Clan McDuck}

\section{Duck characters}
\subsection{Umperio Bogarto}
\subsection{Bum Bum Ghigno}
\subsection{Magica De Spell}
\subsection{Evroniani}
\subsection{Flintheart Glomgold}
\subsection{Gloria}
\subsection{Gotrocks}
\subsection{Grand Mogul}
\subsection{Mata Harrier}
\subsection{Brigitta MacBridge}

\begin{frame}[allowframebreaks]{Donald Duck universe characters}
  \tableofcontents[sections={1-2}]
    \framebreak
  \tableofcontents[sections={3}]
\end{frame}

\end{document}
7

You can specify as option which section to show:

\tableofcontents[sections={1-3}]

So you can manually specify which section to show in each frame:

\begin{frame}{Outline}
  \tableofcontents[sections={1-3}]
\end{frame}
\begin{frame}
   \tableofcontents[sections={4-5}]
\end{frame}
Jean
  • 171
  • 2
  • This works in principle. However, the frame titles are not numbered correctly anymore. WIth the allowframebreaks option, I get I, II, III etc. Now, I get <title> on each slide. – winkmal Feb 01 '17 at 10:04
0
\section*{Outline}
\begin{frame}{Agenda}
\begin{columns}[onlytextwidth]
\column{0.5\textwidth}
\tableofcontents[sections = 1-2]
\column{0.5\textwidth}
\tableofcontents[sections = 3-4]
\end{columns}
\end{frame}

\section{Executive Summary}
\subsection{Vision and Objectives}
\subsection{Current Needs and Status}
\subsection{Approaches}
\subsection{Review}
\section{The 5 W's and the H}
\subsection{What?}
\subsection{Why?}
\subsection{Where?}
\subsection{When?}
\subsection{Who?}
\section{Examples}

Produces this output:

enter image description here

  • 1
    Welcome to TeX.SE! As usual here -- can you please make your given code snippet for the answer to be compilable? Then we can do a fast proof ... – Mensch Jul 30 '19 at 15:49