[Tex/LaTex] Highlight some words of a beamer

beamerhighlighting

If I want to highlight some words of following frame:

\begin{frame}
\frametitle{Paragraphs of Text}
Sed iaculis dapibus gravida. Morbi sed tortor erat, nec interdum arcu. Sed id lorem       lectus. Quisque viverra augue id sem ornare non aliquam nibh tristique. Aenean in ligula nisl. Nulla sed tellus ipsum. Donec vestibulum ligula non lorem vulputate fermentum accumsan neque mollis.\\~\\

Sed diam enim, sagittis nec condimentum sit amet, ullamcorper sit amet libero. Aliquam vel dui orci, a porta odio. Nullam id suscipit ipsum. Aenean lobortis commodo sem, ut commodo leo gravida vitae. Pellentesque vehicula ante iaculis arcu pretium rutrum eget sit amet purus. Integer ornare nulla quis neque ultrices lobortis. Vestibulum ultrices tincidunt libero, quis commodo erat ullamcorper id.
\end{frame}

what should I do?

Best Answer

You can use \alert{foo} to highlight a short portion of text. For longer paragraphs the alertenv environment is more apt (though \alert{} does not complain when fed an argument containing a new paragraph); use it as follows

\begin{alertenv}
  foo and indeed bar
\end{alertenv}

The MWE

\documentclass{beamer}

\begin{document}
\begin{frame}
  \frametitle{Quite Some Text}
  The following short text will be \alert{highlighted with \texttt{alert}}, while this is not.  

  \begin{alertenv}
    We can highlight entire paragraphs with the \texttt{alertenv} environment.

    See, that was a paragraph.
  \end{alertenv}

  Note though that \alert{\texttt{alert} does not complain when fed a paragraph.

  See, a new paragraph.}
\end{frame}
\end{document}

yields enter image description here