[Tex/LaTex] Combining <+-> with allowframebreaks in beamer

allowframebreaksbeamer

My question is closely related to this question, but slightly different, so that @samcarter's answer to that question doesn't help.

I want to combine the allowframebreaks option with the <+-> option but using the standard way to combine options doesn't achieve this. Here's an MWE. The first frame uses allowframebreaks in the standard way, producing two pages. The second frame tries to combine the two options, implements the \pause command but ignores the allowframebreaks option. Reversing the order of the two options generates an error.

\documentclass{beamer}
\begin{document}
\begin{frame}[allowframebreaks]{Title}
This is a test

\pause
This is a test

\newpage
Page 2
\pause

This is a test

\pause

This is a test
\end{frame}
\begin{frame}[<+->,allowframebreaks]{Title}
This is a test

\pause
This is a test

\newpage
Page 2
\pause

This is a test

\pause

This is a test
\end{frame}
\end{document}

Best Answer

I don't see why you can't use the same technique as in the linked question.

\documentclass{beamer}
\begin{document}
\begin{frame}[<+->]
\frametitle{Title}

    \begin{onlyenv}<-2>
        This is a test1

        \pause

        This is a test2
    \end{onlyenv}

    \begin{onlyenv}<.(2)->
        Page 2 3

        \pause
        \pause  

        This is a test 4

        \pause

        This is a test 5
    \end{onlyenv}

\end{frame}
\end{document}

To add a relevant quote from the beamer user guide:

The use of this option is evil. In a (good) presentation you prepare each slide carefully and think twice before putting something on a certain slide rather than on some different slide. Using the allowframebreaks option invites the creation of horrible, endless presentations that resemble more a “paper projected on the wall” than a presentation. Nevertheless, the option does have its uses. Most noticeably, it can be convenient for automatically splitting bibliographies or long equations.