how to set header font color in Latex – Education Career Blog

Is it possible to change the header font color in Latex?

,

You could have a look at the `sectsty` package.

The secsty package provides a set of commands for changing the fount 1 used for the various sectional headings in the standard LATEX 2ε document classes

From the manual:

Make sure you include the package in your document by saying in your
document preamble:

`\usepackage{sectsty}`

You will then have some new commands available. For example:

`\allsectionsfont{\sffamily}`

will give you sanserif for all sectional headings.

,

If you want to change the section heading’s font color all at once, then you need to re-define the startsection command.

The following link has a detailed description of customizing sectiong headings’ font color,

I have copy pasted the relevant code that needs to be inserted into the preamble,

``````\renewcommand\section{%
\@startsection{section}{1}{\[email protected]}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\color{RoyalBlue}\sffamily\Large\bfseries}}
\renewcommand\subsection{%
\@startsection{subsection}{2}{\[email protected]}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\color{RoyalBlue}\sffamily\large\bfseries}}
``````

Also, you must remember to import the color package

``````\usepackage{color}
``````