[Tex/LaTex] Using AtBeginSection and againframe to make custom section transitions

beameroverlayssectioning

I am trying to make a custom slide to use as an inter-sectional slide in order to replace the more typical code:

\AtBeginSection{
    \begin{frame}[c,plain,noframenumbering]
        \frametitle{Agenda}
        \tableofcontents[currentsection,hideothersubsections]
    \end{frame}
}

I have created a frame and labeled it Overview. Then, I want to do the following:

\AtBeginSection{
    \againframe<2|handout:2>{Overview}
}

Before each \section, I redefine some variables in order to modify my overview slide as appropriate for the current section. All of this works great.

The problem I am running into, however, is I need for the overlay number (in this case, 2) to auto-increment each time \AtBeginSection is invoked so as to prevent Beamer from giving me an error about a multiply defined overlay.

In short: How do I get \againframe<#>{SlideLabel} to automatically increment to the last overlay state, plus one (i.e., # = end + 1).

Edit:
Here is an MWE of what I am trying to do. Compiling this results in the error, "LaTeX Warning: Label `Overview<2>' multiply defined.

\documentclass[11pt,t]{beamer}
\usepackage{lmodern}
\begin{document}

\begin{frame}[label=Overview]
    \frametitle{Overview Slide}
    \begin{itemize}
        \item Section 1
        \item Section 2
    \end{itemize}
\end{frame}

\AtBeginSection{
    \againframe<2|handout:2>{Overview}
}

\section{Section 1}
\begin{frame}
    \frametitle{Body slide 1}
    \begin{itemize}
        \item Some body text
    \end{itemize}
\end{frame}

\section{section 2}
\begin{frame}
    \frametitle{Body slide 2}
    \begin{itemize}
        \item Some body text
    \end{itemize}
\end{frame}

\end{document}

Best Answer

If I understood your intent correctly, you could use a user defined counter and increase it at every section to avoid the label duplication:

\documentclass[11pt,t]{beamer}
\usepackage{lmodern}

\newcounter{mycount}

\AtBeginSection{\stepcounter{mycount}%
    \againframe<\themycount|handout:\themycount>{Overview}
}

\begin{document}

\begin{frame}<\themycount>[label=Overview]
    \frametitle{Overview Slide}
    \begin{itemize}
        \item Section 1
        \item Section 2
    \end{itemize}
\end{frame}

\section{Section 1}
\begin{frame}
    \frametitle{Body slide 1}
    \begin{itemize}
        \item Some body text
    \end{itemize}
\end{frame}

\section{section 2}
\begin{frame}
    \frametitle{Body slide 2}
    \begin{itemize}
        \item Some body text
    \end{itemize}
\end{frame}

\end{document}
Related Question