I have a document using article class (please not ask me why don't use report class). The article has TOC, LOF, LOT and Nomenclature.
The MWE:
\documentclass[12pt,a4paper,twoside] {article}
\usepackage{color}
\usepackage{subfigure}
\usepackage[nottoc]{tocbibind}
\usepackage[intoc]{nomencl}
\makenomenclature
\usepackage{kpfonts} %[uprightRoman, uprightgreeks]
\usepackage[T1]{fontenc}
\usepackage[subfigure]{tocloft}
\setlength\cftbeforefigskip{1 ex} % list of figures
\setlength\cftbeforetabskip{1 ex} % list of tables
\setlength\cftbeforesecskip{1 em} % spacing before sec title
\setlength\cftaftertoctitleskip{1.8 em}
\setlength\cftbeforetoctitleskip{4 cm}
\setlength{\nomitemsep}{0.5 ex}
\usepackage{titlesec}
\titleformat{\subsection} {\large \bfseries \color{RoyalBlue}} {\thesubsection}{1 ex}{}
\titleformat{\subsubsection} {\normalsize \bfseries \color{RoyalBlue}} {\thesubsubsection}{1 ex}{} %\slshape
\setcounter{tocdepth}{3} % table of content depth
\definecolor{RoyalBlue}{RGB}{0, 35, 102}
\begin{document}
Hello, world!
\tableofcontents
\listoffigures
\listoftables
\printnomenclature[2 cm]
\section{Introduction}
\section{DEM}
\subsection{Math model}
\subsubsection{Particle collision}
\nomenclature{DEM}{Distinct Element Method}
\end{document}
The color of section headings and Nomenclature is changed as expected. However the color of Contents and List of Figures etc. remains black.
Having looked through article.cls, I tried
\renewcommand\tableofcontents{%
\section*{\contentsname
\@mkboth{%
\MakeUppercase \textcolor{RoyalBlue} {\contentsname} }{\MakeUppercase \textcolor{RoyalBlue}\contentsname}}%
\@starttoc{toc}%
}
However, it turned out not working. By the way, I used tocloft to define the LOF, LOT entries spacing, don't know whether it has some side-effect.
So how to figure this out?
Edit 1: Found out the problem lies with: \usepackage[subfigure]{tocloft} . But I need these packages! Or should I redefine the spacing without the tocloft package?

! Undefined control sequence. <argument> \undefinedpagestyle. Instead ofsubfigure, try thesubfigpackage, it is usually seen as superior. Most important however, loadtocloftafter subfigure. – mafp Jan 21 at 23:55subfigurebeforetocloftdoes not work. I suspecttocloftredefines the default commands\contentsnameand\tableofcontents. – KOF Jan 22 at 0:24