I have a rather lengthy table of contents for a presentation. Beamer is not compressing the vertical space between TOC entries, but instead running the last item off the bottom of the output! Is there a way to control this spacing?

I have tried


with the setspace package, but I don't think this is compatible with Beamer.

5 Answers 5


I don't know why it works, but if you put your \tableofcontents inside a minipage environment, the space between lines is reduced:

  • 1
    You may wish to use a minipage width that is a little more relative (as opposed to absolute), like \textwidth.
    – Werner
    Feb 9, 2012 at 5:58

Before writing this answer I've tested beamer and could insert 18 sections (without subsections) into a frame with default theme. So I'm not sure if last beamer version is already shrinking table of contents. In any case, some years ago I solved this problem changing tableofcontents definitions. What I did was extract next lines from beamer/base/beamerbasetoc.sty

      \advance\beamer@tempcount by\beamer@sectionadjust%
              \beamer@tocact{\ifnum\c@section=#1\beamer@toc@cs\else\beamer@toc@os\fi}    {section in toc}}}%

and paste into my main presentation file \begin{document} (don't forget \makeatletter and \makeatother) and change \vskip1.5em with \vskip0.5em. That's all.

  • I'm sorry, but I'm not anywhere near an expert. I don't know much about \makeatletter and \makeatother, except that I see them used in definitions. Can you explain?
    – Kristen
    Apr 10, 2011 at 1:09
  • 1
    @Kristen: @ is an special character in a tex file but a regular letter in sty or cls files. So when you insert some code from a class or style file into a tex file you must use \makeatletter before the code and \makeatother after it. Otherway you will hava errors. A better answer can be found in TeX FAQ: tex.ac.uk/cgi-bin/texfaq2html?label=atsigns.
    – Ignasi
    Apr 10, 2011 at 19:01

In Beamer version 3.10, tableofcontents is not correctly adjusted when using hideothersubsections. Also, squeeze does not work in tableofcontents. Shrink works, but makes small font sizes and too big spaces between them.

The best solution I have found is to define the size in the corresponding template, and specify a smaller size before the \tableofcontents:

\defbeamertemplate*{section in toc}{my theme}
{\leavevmode\leftskip=0.5em\large{\usebeamercolor[fg]{titlelike}\inserttocsectionnumber.} \inserttocsection\par}

\defbeamertemplate*{subsection in toc}{my theme}
{\leavevmode\leftskip=2em\normalsize{\usebeamercolor[fg]{titlelike}\inserttocsectionnumber.\inserttocsubsectionnumber.} \inserttocsubsection\par}

\defbeamertemplate*{subsubsection in toc}{my theme}
{\leavevmode\leftskip=3.5em\normalsize\usebeamerfont{subsection in toc}\usebeamerfont{subsubsection in toc}\inserttocsubsubsection\par}


Based on minipage answer, you can try:


In the beamer manual, look at the frame options shrink and squeeze.

The explanation for shrink is somewhat long, so I am not going to paste it here, but basically, it shrinks the text on a frame so it will actually fit to the frame. The squeeze option causes all vertical spaces in the text to be squeezed together as much as possible. Currently, this just causes the vertical space in enumerations or itemizations to be reduced to zero.

I am not sure it will work with TOC, but you can try it.

  • 3
    I guess this does not work with the TOC, because I am seeing no effect. Too bad; this would have been perfect.
    – Kristen
    Apr 10, 2011 at 0:54

You must log in to answer this question.

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