[Tex/LaTex] Combination of \alert and \pause for beamer class

beamer

I'm preparing a presentation where i want paragraphs to be hidden, if they weren't mentionet yet. Therefore I'm using a

\pause

between paragraphs. In addition i'd like to highlight the latest paragraph. Therefore I'm using

\alert<+>{here comes a paragraph}

The result then is,

\alert<+>{here comes a paragraph} \pause
\alert<+>{here comes another paragraph} \pause
\alert<+>{three is the magic number} \pause

which means that i need to press the next-page-button two times, when I need to jump to the next paragraph. Is there a posibility to combine alert an pause without needing two keypresses?

Best Answer

You can say \alert<1> to have the text alerted on page 1. Then you get

\documentclass{beamer}
\begin{document}
\begin{frame}
  \frametitle{Test}
  \alert<1>{here comes a paragraph} \pause

  \alert<2>{here comes another paragraph} \pause

  \alert<3>{three is the magic number} %\pause
\end{frame}
\end{document}

I commented the last \pause since it will generate one more page without any alerts.

An alternative is to use an itemize with no bullets. Then you can set the alerts for each uncovered item,

\begin{frame}
  \frametitle{Test}
  \begin{itemize}[<alert@+|+->]
  \item[] here comes a paragraph
  \item[] here comes another paragraph
  \item[] three is the magic number
  \end{itemize}
\end{frame}

This will add a space to left of the paragraph. To get rid of that one can use list instead, but that does not seem to be supported by beamer so the alert and step functionallity has to be set onthe items.

  \begin{list}{}{%
      \leftmargin=0pt
      \labelwidth=0pt
      \labelsep=0pt
    }
  \item<alert@+|+-> here comes a paragraph
  \item<alert@+|+-> here comes another paragraph
  \item<alert@+|+-> three is the magic number
  \end{list}

If it is something used a lot it can be put in an environment with the paragraphs as a command

\newenvironment{MyList}{%
  \begin{list}{}{%
      \leftmargin=0pt
      \labelwidth=0pt
      \labelsep=0pt
    }}
  {\end{list}}
\newcommand\MyItem{\item<alert@+|+->}
\begin{frame}
  \frametitle{Test 4}
  \begin{MyList}
  \MyItem here comes a paragraph
  \MyItem here comes another paragraph
  \MyItem three is the magic number
  \end{MyList}
\end{frame}

All alternatives give more or less the same result (there is some more space to the left in the second version):

enter image description here