9

I'm trying to make a table of contents for a beamer presentation, and I want to have the outline show up for every section except the first. Right now I'm using:

\AtBeginSection[] {
  \begin{frame}[t]
    \frametitle{Overview}
      \tableofcontents[sectionstyle=show/shaded,hideothersubsections]
  \end{frame}
} 

Normally I can do this using \section*, but that makes it not show up in the table of contents at all. Is there a way to have it do the table of contents after every section, but skip the first one and still have the first section in the table of contents?

1 Answer 1

9

Use a conditional based on the section counter to decide whether to include the table of contents frame. Here, I use the \ifnumcomp macro from etoolbox

\usepackage{etoolbox}

\AtBeginSection[] {
\ifnumcomp{\value{section}}{=}{1}{}
  {
  \begin{frame}[t]
    \frametitle{Overview}
      \tableofcontents[sectionstyle=show/shaded,hideothersubsections]
  \end{frame}
  }
} 

If the section number is 1, then the first (empty) set of braces will be used. Otherwise the second set of braces (with the frame in it) will be used.

3
  • Works beautifully, thanks for the quick answer!
    – Adam
    Commented Aug 18, 2011 at 14:02
  • How about multiple sections to block? e.g.: section 2 and section 3? Or section 1 and section 3?
    – math
    Commented Oct 8, 2014 at 6:40
  • @math: \ifinlist from etoolbox can handle that.
    – Ken Bloom
    Commented Jul 5, 2016 at 2:30

You must log in to answer this question.

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