# How to only change the colour of the item symbol of an alerted item?

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}

• It may not be optimal, but \item<+-| alert@+-> \textcolor{black}{CCCCC} would do. Aug 30 '17 at 14:35
• Does the solution have to be automatic? Otherwise \color{black}CCCCC might be a workaround. Aug 30 '17 at 14:35
• Thanks, @Steven and @samcarter, \color{black} is what I am currently using as a workaround. Of course, an automatic solution would be desirable. Aug 30 '17 at 14:54

## 1 Answer

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}


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}


• Great Idea! May I suggest \AtBeginEnvironment{itemize}{\renewenvironment{alertenv}{\only{\setbeamercolor{itemize item}{fg=red}}}{}}? This will leave the \alert command usable for the rest of the document. Aug 30 '17 at 21:25
• @samcarter added this to my answer. Thanks.
– Mike
Aug 30 '17 at 21:53
• @samcarter Thanks for the edit. Just updated beamer.
– Mike
Aug 30 '17 at 22:10