13

How can I reduce the spacing between the items of my table of contents in my beamer presentation?

Here is my currient LaTeX code:

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage{lmodern}der pdf
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\title[Short title]{My very long title that doesn't fit into the footer}
\author{Me}
\date{\today}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{footline}[frame number]
\usetheme{CambridgeUS}

\AtBeginSection[]
{
\begin{frame}
\frametitle{Outline}
\tableofcontents[currentsection, hideothersubsections]
\end{frame}
}

\begin{document}

\maketitle
\clearpage

\begin{frame}
\frametitle{Outline}
\tableofcontents[hideothersubsections]
\end{frame}


\section{Intro}
\begin{frame}
\frametitle{Welcome}
...
\end{frame}

\section{Topic 1}
\begin{frame}
\frametitle{Topic 1}
...
\end{frame}

\section{Topic 2}
\begin{frame}
\frametitle{Topic 2}
...
\end{frame}

\subsection{Red}
\begin{frame}
\frametitle{Red}
...
\end{frame}

\subsection{Green}
\begin{frame}
\frametitle{Green}
...
\end{frame}

\subsection{Blue}
\begin{frame}
\frametitle{Blue}
...
\end{frame}

\section{Topic 3}
\begin{frame}
\frametitle{Topic 3}
...
\end{frame}

\section{Topic 4}
\begin{frame}
\frametitle{Topic 4}
...
\end{frame}

\section{Topic 5}
\begin{frame}
\frametitle{Topic 5}
...
\end{frame}

\section{The end}
\begin{frame}
\frametitle{The end}
End of file :-)
\end{frame}

\end{document}

See page 7 the point "The end" is missing. I need that one.

21

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. A little example:

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{etoolbox}

\makeatletter
\patchcmd{\beamer@sectionintoc}{\vskip1.5em}{\vskip0.5em}{}{}
\makeatother

\title[Short Title]{My very long title that doesn't fix into the footer}
\author{Me}
\date{\today}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{footline}[frame number]
\usetheme{CambridgeUS}

\AtBeginSection[]
{
\begin{frame}
\frametitle{Outline}
\tableofcontents[currentsection, hideothersubsections]
\end{frame}
}

\begin{document}

\maketitle
\clearpage

\begin{frame}
\frametitle{Outline}
\tableofcontents[hideothersubsections]
\end{frame}


\section{Intro}
\begin{frame}
\frametitle{Welcome}
...
\end{frame}

\section{Topic 1}
\begin{frame}
\frametitle{Topic 1}
...
\end{frame}

\section{Topic 2}
\begin{frame}
\frametitle{Topic 2}
...
\end{frame}

\subsection{Red}
\begin{frame}
\frametitle{Red}
...
\end{frame}

\subsection{Green}
\begin{frame}
\frametitle{Green}
...
\end{frame}

\subsection{Blue}
\begin{frame}
\frametitle{Blue}
...
\end{frame}

\section{Topic 3}
\begin{frame}
\frametitle{Topic 3}
...
\end{frame}

\section{Topic 4}
\begin{frame}
\frametitle{Topic 4}
...
\end{frame}

\section{Topic 5}
\begin{frame}
\frametitle{Topic 5}
...
\end{frame}

\section{The end}
\begin{frame}
\frametitle{The end}
End of file :-)
\end{frame}

\end{document}
| improve this answer | |
  • This works nice with the toc at the beginning of the presentation, but not with the toc such as it is shown between sections (with all section titles greyed out except for the current one). Any idea why? – Guido Vanden Wyngaerd Mar 28 '18 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.