5

What is the best way to change the color of the entire table of contents. I saw a lot of tutorials but it's complicated for me (I am a beginner).

1
  • Very simply: load the xcolor package (with options svgnames and x11names, if your want to call colours by their names rather than their rgb or cmyk codes) and write in the body of your document: {\color{your_best_loved_colour}\tableofcontents}.
    – Bernard
    Commented Apr 19, 2014 at 11:55

1 Answer 1

5

If I understand your objective correctly, you wish to change the color that's used for all elements of the Table of Contents; these include, presumably, the title of the ToC.

To do so, you could load the xcolor package and insert the instruction \color{blue} -- or whatever color you wish to apply -- before \tableofcontents. To limit the scope of the \color instruction, encase it and the material it's supposed to apply to in a set of \begingroup and \endgroup statements.

enter image description here

\documentclass{article}
\usepackage{xcolor} %% http://www.ctan.org/pkg/xcolor
\begin{document}
\begingroup % start a TeX group
\color{blue}% or whatever color you wish to use
\tableofcontents
\endgroup   % end of TeX group

\section{A}
\section{B}
\end{document}

You must log in to answer this question.

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