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?

3 Answers 3


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

  • Thank​ you so much for your help @DJP, now it's all working! Jan 22, 2016 at 15:02
  • Given that `usenames' is obsolete, maybe this (\documentclass[usenames,dvipsnames]{beamer} ) should be changed at en.wikibooks.org/wiki/LaTeX/… ?
    – MycrofD
    Jun 5, 2019 at 9:59
  • Indeed, in the documentation, mirror.utexas.edu/ctan/macros/latex/contrib/xcolor/xcolor.pdf, to use additional color like the one you wanna use, you have to add this option when you load the xcolor package. Check out the section 2.4.2 Additional sets of colors in the document. Simply put, to use it properly, you just need this line when load xcolor package: \usepackage[usenames, dvipsnames]{xcolor}
    – Jason
    Dec 10, 2019 at 7:33

sorry I can't comment as I'm just a noob and I need reputation. I tried out the command in my document and it works perfect. Check the image below.

enter image description here

In my beamer, I had declared something like \documentclass[xcolor=dvipsnames]{beamer} while the document that I use based on tufte declares \usepackage{xcolor} in the .sty file.

Could you try renaming the third line of the code into \usepackage[usenames, dvipsnames]{xcolor} ?

  • Hello @crypto, I am using \documentclass[conference]{IEEEtran} I modified the third from \usepackage[usenames, dvipsnames]{color} to \usepackage{xcolor}, as your suggestion, but I keep getting the same error: Package xcolor Error: Undefined color ForestGreen. Jan 22, 2016 at 14:53
  • 1
    Just a small question. Could you try \usepackage[usenames, dvipsnames]{xcolor}? I don't happen to have an IEEEtran tex file to try it out. Have you installed the package xcolor?
    – crypto
    Jan 22, 2016 at 14:56
  • You're welcome. Thank​ you so much for your help @crypto! Jan 22, 2016 at 15:03

A more general solution may simply be to define the color explicitly.


You must log in to answer this question.

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