[Tex/LaTex] Remove TOC before just one section (Beamer)

beamertable of contents

I have a Beamer presentation, in which I use the \AtBeginSection command to specify that I want to show the overview of the presentation with the current item highlighted. However, in one single case, I don't want to.

I know I could just insert the overview frame before every single slide except this one, but I'd prefer if there was a nicer way to do this, like with a \NotAtThisBeginSection command…

Best Answer

Here's a minimal working example based on the code posted at SO:

\documentclass{beamer}

% BEGIN OF CODE POSTED AT SO
\RequirePackage{ifthen} % package required

\newboolean{sectiontoc}
\setboolean{sectiontoc}{true} % default to true

\AtBeginSection[]
{
  \ifthenelse{\boolean{sectiontoc}}{
    \begin{frame}<beamer>{Gliederung}
      \tableofcontents[currentsection]
    \end{frame}
  }
}

\newcommand{\toclesssection}[1]{
  \setboolean{sectiontoc}{false}
  \section{#1}
  \setboolean{sectiontoc}{true}
}
% END OF CODE POSTED AT SO

\begin{document}

\section{First}

\begin{frame}{First}
Some text.
\end{frame}

\toclesssection{Second}

\begin{frame}{Second}
Some text.
\end{frame}

\end{document}