[Tex/LaTex] Package xcolor Error: Undefined color `ForestGreen’


I am using the following packages in my files Latex sources:

\usepackage[usenames, dvipsnames]{color}

\newcommand{\ricardo}[1]{\colorbox{ForestGreen}{\color{white}\textsf{\textbf{Ricardo}}} \textcolor{ForestGreen}{#1}}

And to mark my notes in the text, I use the command:


How should I do to make Latex display my notes correctly?

Best Answer

The xcolor package is an extension of the color package, so I don't understand why you loaded the color package twice along with the xcolor package. Moreover, according to page 7 of the xcolor documentation usenames is obsolete. I cleaned up the code to this:

\newcommand{\ricardo}[1]{\colorbox{ForestGreen}{\color{white}   \textsf{\textbf{Ricardo}}} \textcolor{ForestGreen}{#1}}
\ricardo{This should work.}

and the resulting output compiles without a problem:

enter image description here