[Tex/LaTex] Change Colour on Chapter/Section headings {Lyx}

colorlyx

I am using Lyx and Layout report for my thesis.
I would like to change the colour of chapters sections and subsections (only the headings) from black to blue.

I attach a screenshot in order to understand what colours i am trying to achieve only on headings (Chapter /section and subsection )

Also is it possible to change the colour of table of contents to blue ? (again only the heading)

Best Answer

You can use the package sectsty to do change the headings, and xcolor to get the colour definitions.

For example, add to your preamble (Document --> Settings --> LaTeX preamble) the following:

\usepackage{xcolor}
\usepackage{sectsty}
\chapterfont{\color{blue}}  % sets colour of chapters
\sectionfont{\color{cyan}}  % sets colour of sections

enter image description here

You can use colours predefined in xcolor (see manual), or define your own, e.g.

\definecolor{MyBlue}{rgb}{0.1,0.1,1}

Put such definitions in the preamble as well.