General ⇒ Color-Headlines
Color-Headlines
I want to change the color of my headlines. Are there any packages or do I have to renew some commands?
Hope you could me.
Aurora
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Re: Color-Headlines
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Color-Headlines
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- pumpkinegan
- Posts: 91
- Joined: Thu May 03, 2007 10:29 pm
Color-Headlines
Code: Select all
\usepackage{color}
\usepackage{titlesec}
\definecolor{webgreen}{rgb}{0,0.75,0}
\definecolor{webred}{rgb}{0.75,0,0}
\titleformat{\chapter}[display]
{\color{webred}\normalfont\huge\bfseries}{\chaptertitlename\
\thechapter}{20pt}{\Huge}
\titleformat{\section}
{\color{webgreen}\normalfont\Large\bfseries}{\thesection}{1em}{}
\begin{document}
\chapter{A chapter}
\section{A section}
\blindtext
Re: Color-Headlines
It works like expected.
The only thing is that the headlines now needs more space than before.
Is there an option where I can set the vertical padding of the headlines?
Color-Headlines
Color-Headlines
There is a related topic called "Color-headlines" but i changed the title because it was not describing the issue properly (to my taste).
The issue is: how to get the section, subsection, subsubsection and paragraph headings to be blue.
One of the solutions what was suggested was to use the titletoc package. My problem is that I use minitoc to get a toc at each chapter, and it's incompatible with titlesec/titletoc packages...
On the web, someone suggested to have a .sty file with a fancy latex command containing @ and #6 etc.
Is there a more straightforward solution ?
I use TexnicCenter on Windows.
Thanks,
Marie.
- Stefan Kottwitz
- Site Admin
- Posts: 10361
- Joined: Mon Mar 10, 2008 9:44 pm
Color-Headlines
in my opinion it would be better to open a new topic instead of capturing an very old topic.
But now we are here.

If you use KOMA-Script the solution could be very simple, just one line:
Code: Select all
\addtokomafont{sectioning}{\color{blue}}
Stefan