# Option clash for package color. \RequirePackage

I'm very new to LaTeX, and I'm having a problem which seems to originate from the following lines of code.

\RequirePackage[usenames]{color}
\RequirePackage{fancyhdr}
\RequirePackage{nomencl}
\RequirePackage{titlesec}
\RequirePackage{titletoc}
\RequirePackage{url}
\urlstyle{tt}


Option clash for package color. \RequirePackage error ocurred at line \RequirePackage{fancyhdr}. Any idea?

Corresponding log output is this:

l.73 \RequirePackage
{fancyhdr}
[]
There has now been an attempt to load it with options
[usenames]
,usenames
to your \documentclass declaration may fix this.
Try typing  <return>  to proceed.

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – jubobs Dec 6 '13 at 10:48
• A side note (probably not a solution to your problem, but important nonetheless): you wrote that you were new to LaTeX, but you use \RequirePackage, which is most commonly used only in class files (.cls) or packages (.sty); the common way to load a package in a .tex file is with \usepackage. Did you mean to use \usepackage instead of \RequirePackage? – jubobs Dec 6 '13 at 10:54

fancyhdr has nothing to do with the problem. Some package you load earlier already loads color without the usenames option.

The error message shows \RequirePackage, because this command scans for a possible optional argument; the complete syntax is

\RequirePackage[<options>]{<package>}[<YY>/<MM>/<DD>]


So when processing your command, LaTeX absorbs \RequirePackage[usenames]{color} and examines the next token in order to see if it is [. Since it isn't, it processes the call and stops because of the error; the error message shows the last token read by TeX.

The error message clearly says what is wrong and what should be done to fix it. Try changing the \documentclass declaration to something similar to

\documentclass[11pt,a4paper,usenames]{article}


The exact declaration will vary but essentially adding the option usenames should fix the issue.