2

I have three items in a beamer slide. They appear one after the other when I press next. My problem is I want the first two items to change color when the third item appears. Please explain how to do this.

2 Answers 2

5

No need to write everything twice, you can simply use \only<>{} to change the colour

\documentclass{beamer}

\begin{document}

\begin{frame}
        \begin{itemize}[<+->]
            \item \only<3>{\color{red}}1
            \item \only<3>{\color{red}}2
            \item 3
        \end{itemize}
\end{frame}

\end{document}  

enter image description here


To address the command about dvipsnames

Since beamer internally already loads the xcolor package you can pass the dvipsnames like this:

\documentclass[xcolor=dvipsnames]{beamer}

\begin{document}

\begin{frame}
        \begin{itemize}[<+->]
            \item \only<3>{\color{Peach}}1
            \item \only<3>{\color{Peach}}2
            \item 3
        \end{itemize}
\end{frame}

\end{document}  
2
  • Thanks a lot, could you please explain how to chose some other color than red? may be RGB or a list of accepted colors? I used \usepackage[dvipsnames]{xcolor} and color Peach, but got errors ): Error: LaTeX Error: Option clash for package xcolor. Error: Package xcolor Error: Undefined color `Peach'
    – MLT
    Commented Jun 6, 2014 at 18:53
  • @MLT: see edit about xcolor option Commented Jun 10, 2014 at 11:02
0

Probably there is a more elegant solution but this one works.

\documentclass{beamer}

\begin{document}

\begin{frame}
\only<1,2>{
\begin{itemize}[<+->]
\item 1
\item 2
\item 
\end{itemize}
}

\only<3->{
\begin{itemize}
\uncover<3->{\item \textcolor{red}{1}}
\uncover<3->{\item \textcolor{blue}{2}}
\uncover<3->{\item 3}
\end{itemize}
}
\end{frame}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .