I know how to change the colour of a section name using for example
\section{\color{Red} Foobar}
but that still leaves the section number in black. Is there any way to change the colour of the numbers of the sections, subsections, etc?
colornumberingsectioning
I know how to change the colour of a section name using for example
\section{\color{Red} Foobar}
but that still leaves the section number in black. Is there any way to change the colour of the numbers of the sections, subsections, etc?
Best Answer
I'm sure there is some package that does this, but the simplest way is to redefine the
\thesection
command:or if you also want the chapter number:
Similar commands work for
\thechapter
,\thesubsection
, etc.EDIT: A maybe unintended side effect of this is that it also color every reference to the section. To just change it in the section header you can use
In any case you might want to have a look at section 2.2 of the LaTeX Companion and the
titlesec
package.