1

I have an incrementally uncovered itemized list (code below).

How can I prevent the text of the 3rd item from being dyed in the alert colour? I would like to just have the item symbol's colour changed.

\documentclass{beamer}

\begin{document}
\begin{frame}{Items}
  \begin{itemize}[<+->]
    \item A
    \item B
    \item<+-| alert@+-> CCCCC
    \item D
  \end{itemize}
\end{frame}

\end{document}
AlexG
  • 54,894

1 Answers1

2

You can define your own action environment or redefine the alert action.

\documentclass{beamer}
% defining new action environment
\newenvironment{checkenv}{\only{\setbeamercolor{itemize item}{fg=green}}}{}
% redefining alert action
\renewenvironment{alertenv}{\only{\setbeamercolor{itemize item}{fg=red}}}{}

\begin{document}
\begin{frame}{Items}
  \begin{itemize}[<+->]
    \item A
    \item<+-| check@+-> B
    \item<+-| alert@+-> CCCCC
    \item D
  \end{itemize}
\end{frame}

\end{document}

enter image description here

Edit: as suggested by samcarter

Simply redefining the alert action as shown above will basically disable the \alert command. With the etoolbox package \AtBeginEnvironment can be used to only change it for the itemize environment. But of course, \alert won't work inside the environment.

\documentclass{beamer}
\usepackage{etoolbox}% not necessary with up-to-date beamer versions
% defining new action environment
\newenvironment{checkenv}{\only{\setbeamercolor{itemize item}{fg=green}}}{}
% redefining alert action only for itemize
\AtBeginEnvironment{itemize}{%
\renewenvironment{alertenv}{\only{\setbeamercolor{itemize item}{fg=red}}}{}}

\begin{document}
\begin{frame}{Items}
  Alert working outside itemize, \alert{before}
  \begin{itemize}[<+->]
    \item A alert \alert{not working} inside itemize
    \item<+-| check@+-> B
    \item<+-| alert@+-> CCCCC
    \item D
  \end{itemize}
  and \alert{after} it.
\end{frame}

\end{document}

enter image description here

Mike
  • 8,664