5

I would like to change the color of an \item in a list and I would like the item to look like a regular item.

\begin{itemize}
\item item one
\reditem item two
\item item three
\end{itemize}

and have "item two" be red and leave the font color of everything else alone?

I've looked and my google-fu is weak.

Mensch
  • 65,388

1 Answers1

5

Using \specialitems you can switch between different styles:

enter image description here

\documentclass{article}
\usepackage{xcolor}% http://ctan.org/pkg/xcolor
\newcommand{\specialitems}{%
  \let\olditem\item% Store old \item in \olditem
  \newcommand{\reditem}{\olditem\leavevmode\color{red}}%
  \renewcommand{\item}{\color{black}\olditem\leavevmode}%
}
\begin{document}
\begin{itemize}
\specialitems
\item item one
\reditem item two
\item item three
\end{itemize}
\end{document}​

Of course, you could also make your own specialitemize environment that does the same:

\newenvironment{specialitemize}
  {\itemize\specialitems}% \begin{specialitemize}
  {\enditemize}% \end{specialitemize}

Now you can use

\begin{specialitemize}
\item item one
\reditem item two
\item item three
\end{specialitemize}
Werner
  • 603,163