[Tex/LaTex] Customizing Beamer’s Table of Contents

beamertable of contents

I used the following standard beamer code to create a table of contents at the beginning of each subsection:

\AtBeginSubsection[]
{
    \begin{frame}{Outline}
        \tableofcontents[currentsection,currentsubsection]
    \end{frame}
}

However, I want to customize the ToC of some subsections; something like:

IF \subsectionname != "…" Then it's OK to show the standard ToC.

How can I do this?

Best Answer

For specific subsections you may modify the behavior before they start: you could change \AtBeginSubsection locally. This means you could change that, for a subsection, but keep this change local by enclosing it within a group. For example, disabling \AtBeginSubsection and thus the subsection TOC:

\begingroup
\AtBeginSubsection{}
\subsection{No TOC}
\begin{frame}
...
\end{frame}
\endgroup
\subsection{Here's a TOC}

After the group ended, the globally by \AtBeginSubsection defined macro returns being active. The following subsections will show the TOC - I tested it.

This works because \AtBeginSubsection uses \def to redefine internal macros, which works local, thus visible only inside a group, in contrary to \gdef.

Related Question