# Remove TOC before just one section (Beamer)

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...

-
This SO thread, latex beamer: prevent showing the TOC at one occation, might be helpful. –  chl May 18 '11 at 10:20
@chi: Thanks! It was exactly what I was looking for! However, I think that information should really be here on this site as well. If you wish, answer this question with the information from that post, and I'll give you the rep. for finding it. =) –  Tomas Lycken May 19 '11 at 0:01

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}

-