[Tex/LaTex] How to use pause and overprint together

beameroverlayspause

I want the items of a list (using itemize) to appear one after the other.
I can use pause for the same and it works.

Now at the end of the list, I want to highlight only one of the items.

I thought I can use overprint with the list in the first part and the highlighted entry in the second part.

Here is the code for what I have tried.

\documentclass{beamer}


\begin{document}

\begin{frame}{Test Frame}
\begin{overprint}

\onslide<1>
\pause
\begin{itemize}
\item First line \pause
\item Second line \pause
\item Third line \pause
\end{itemize}

\onslide<2>
\pause
\begin{itemize}
\item \textcolor{blue}{First line}
\item Second line
\item Third line
\end{itemize}

\end{overprint}
\end{frame}

\end{document}

However, it gives me a compilation error:

! Extra }, or forgotten \endgroup.
\endminipage ...pagefalse \color@endgroup \egroup 
                                                  \expandafter \@iiiparbox \...
l.26 \end{frame}

! Class beamer Error: Overprints may not overlap.

I know of this work arounds:
1. Remove pauses (but i REALLY want them in there!)
2. Move the highlighted entry to the next frame — which means create a new frame.

How can I achieve this without creating a new frame?

Best Answer

If I understood you correctly, you don't really need overprint nor manual \pauses. SImply use the overlay specification [<+->] for itemize, so that each item is successively uncovered, and an \only specification to add the color:

\documentclass{beamer}

\begin{document}

\begin{frame}{Test Frame}

\begin{itemize}[<+->]
\item \only<3>{\color{blue}}First line
\item Second line
\item Third line
\end{itemize}

\end{frame}

\end{document}

enter image description here