This question has been asked several times but not in the same context as mine.
I have a beamer presentation with an initial table of contents frame for which I hide the subsections with the following code:
\begin{frame}{Outline of talk}
\setcounter{tocdepth}{1}
\tableofcontents
\end{frame}
\setcounter{tocdepth}{2}
In addition, I have a highlighted table of contents before each section, using the following code:
\AtBeginSection[]
{
\begin{frame}[noframenumbering]
\frametitle{Table of Contents}
\tableofcontents[currentsection]
\end{frame}
}
My question: how to hide the subsections for all except the highlighted section in this at begin section slides.