I encountered the following problem: I am using \textcolor to gray out parts of an enumeration. The enumeration symbols should appear gray as well, i.e. the \textcolor must enclose the \item. However, this always fails for the first item in an enumeration. It gives me a compilation error ("Something is wrong, maybe a missing item"). How can I fix this?
Here is a minimum example:
\documentclass [a4paper,parskip,11pt]{scrreprt}
\usepackage{xcolor}
\begin{document}
\newcommand{\gray}[1]{\textcolor{gray}{#1}}
\begin{enumerate}
%\gray{\item item 1}%fails with "missing item"
\item \gray{item 1} %works
\gray{\item item 2} %works, because it is the second item
\end{enumerate}
\end{document}
Best Answer
It's quite simple with
enumitem
, using thebefore=
key: