I'm trying to write a book in LaTeX with scrbook
class. I'm not that experienced in typography with TeX, nevertheless I would like to give my chapter-headings a special style. I found a very nice style here: http://www.bradleymedia.org/latex-chapter-headings.
I was able to reproduce the style in my document, but I couldn't add some coloring and spacing I would like the header to have. My question is now, how to add a specific color to the "chapter", the chapter number, the line on the right side and the chapter title?
The code I would like to use for this is: (I hope this minimal example works :D)
\documentclass[a4paper]{scrbook}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\title{Your Paper}
\author{You}
\usepackage{titlesec}
\usepackage{graphics}
\titleformat{\chapter}[display]
{\normalfont\Large\raggedleft}
{\MakeUppercase{\chaptertitlename}%
\rlap{ \resizebox{!}{1.2cm}{\thechapter} \color{blue}\rule{15cm}{1.2cm} } }
{10pt}{\Huge}
\titlespacing*{\chapter}{0pt}{30pt}{20pt}
\begin{document}
\chapter{Test-chapter}
\end{document}
As you can see I found an option to change the color of the line on the left. But I don't know how to change the color of the other elements in this header.
(Another small problem: A warning-message occurs when I use titlesec
with KOMA scrbook
).
Thanks to everyone who an help me to solve this problem!
Best Answer
Here is a suggestion without
titlesec
. Note, that the code needs KOMA-Script version 3.15 or newer.With an older KOMA-Script Version you can try the following code to get a similar result.