I want to change the item text color in Beamer.
I checked the Beamer User Guide and found the \color<>[]{}
command in page 80.
\color<2-3>[rgb]{1,0,0} This text is red on slides 2 and 3, otherwise black.
Then I found an example which uses this command in the enumerate
environment in the tutorial (page 15).
\begin{enumerate}[A]
\item<2-5> James Madison
\item<3-5> Harry Truman
\item<4-> \color<6>[rgb]{0,0.6,0}Abraham Lincoln
\item<5-5> Calvin Coolidge
\end{enumerate}
I then try a minimal example as follows (the example is also publicly available at ShareLatex. It is read-write allowed. So you are free to modify it.):
\documentclass[a4paper]{beamer}
\begin{document}
\begin{frame}
\begin{itemize}
\item \color<2>[rgb]{1,0,1}{text1}
\begin{itemize}
\item text11
\end{itemize}
\item text2
\begin{itemize}
\item text21
\end{itemize}
\item text3
\end{itemize}
\end{frame}
\end{document}
On the first slide, it is OK:
On the second slide (\color<2>[rgb]{1,0,1}{text1}
), all the three outer itemized texts (i.e., text1, text2, and text3) become red as shown in the following image. However, I only want to change the color of the first itemized text (i.e., text1 here).
Therefore, my question is:
- How to change the color of a single itemized text (i.e., text1 here) using the command
\color<>[]{}
?- If the command is not feasible (why?), then what are the alternative approaches?
\begin{itemize}[<+->]
\item {\color<2>[rgb]{1,0,1}{text1}}
.[<+->]
.\textcolor
which colors the text in its argument to confine the effect to it