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

colorincompatibilitypackage-options

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

\usepackage{color}
\usepackage[table,xcdraw]{xcolor}
\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:

\ricardo{text....}

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:

\documentclass[11pt]{article}
\usepackage[dvipsnames,table,xcdraw]{xcolor}
\newcommand{\ricardo}[1]{\colorbox{ForestGreen}{\color{white}   \textsf{\textbf{Ricardo}}} \textcolor{ForestGreen}{#1}}
\begin{document}
\ricardo{This should work.}
\end{document}

and the resulting output compiles without a problem:

enter image description here