# How to change \headsepline color in KOMA-Scriptclasses

At the moment I am working on a rather big project in which I typeset a lecture note for a professor of mine. I want to use the headsepline the KOMA Script Class offers, but I want it to have the same color as the headlinecolor I defined by adding

\renewcommand{\headfont}{\color{schrift}\normalfont\slshape}


Is there a solution for this with KOMA Script means or do I have to define it myself (in a way I don't know as I don't really know how to do such things at all)?

Example:

\documentclass[oneside, twocolumn=false, 12pt, headsepline=true]{scrbook}
\usepackage[ngerman]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{delarray, graphicx, url, fancybox, calc, cancel, caption, mathtools, amsmath, amssymb, wrapfig, subcaption, floatrow, amsthm, lipsum}
\usepackage[usenames,dvipsnames]{color}
\usepackage[margin={0.08\paperwidth,0.10\paperheight}, heightrounded]{geometry}

\usepackage[onlytext]{MinionPro}

\parindent 0pt
\parskip 6pt

\hypersetup{
}

\makeatletter
\renewcommand{\l@section}{\@dottedtocline{1}{1.5em}{2.6em}}
\renewcommand{\l@subsection}{\@dottedtocline{2}{4.0em}{3.6em}}
\renewcommand{\l@subsubsection}{\@dottedtocline{3}{7.4em}{4.5em}}
\makeatother

\fboxrule0pt

\definecolor{rahmen}{RGB}{0,73,114}
\definecolor{grund}{RGB}{238,241,251}
\definecolor{schrift}{RGB}{0,73,114}

\captionsetup{format=plain, labelfont={color=rahmen,bf}}

%\usepackage[nomath]{kpfonts}

\SetSymbolFont{letters}{normal}{OML}{cmbr}{m}{it}
\SetSymbolFont{operators}{normal}{OT1}{cmbr}{m}{n}
\SetSymbolFont{symbols}{normal}{OMS}{cmbr}{m}{n}

\DeclareMathAlphabet{\mathbf} {OT1}{cmbr}{bx}{n}

\setkomafont{disposition}{\color{schrift}\bfseries}

\renewcommand{\labelitemi}{-}
\renewcommand{\labelitemii}{$\cdot$}
\renewcommand{\labelitemiii}{$\circ$}
\renewcommand{\labelitemiv}{$\bullet$}

\captionsetup{format=plain, labelfont={color=schrift,bf}}

\allowdisplaybreaks

\newcommand{\defeq}{\vcentcolon=}
\newcommand{\eqdef}{=\vcentcolon}

\hfuzz 100pt

\begin{document}

\chapter{This is just some test chapter}

\lipsum[1]
\lipsum[2]
\lipsum[3]
\lipsum[4]
\lipsum[5]
\lipsum[6]

\lipsum[7]

\end{document}


My problem is this output which I want to be in matching color

The option [headlinesep] added to the KOMA Script class I am using adds a horizontal bar between header and the body of the page.

There has been help in the comments I should just use the \scrlayer-scrpage Style, as it offered all the functions I have been looking for. But it appeared, that there more errors to cope with - I'll post my test document code here. Everything that is important allready is in the code

\documentclass[twoside=false, twocolumn=false, 12pt, ngerman, headsepline=true]{scrbook}
\usepackage[ngerman]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{delarray, graphicx, url, fancybox, calc, cancel, caption, amssymb, amsmath, mathtools, wrapfig, floatrow, amsthm, scrlayer-scrpage, lipsum}
\usepackage[usenames,dvipsnames]{color}

\usepackage[margin={0.08\paperwidth,0.10\paperheight}, heightrounded]{geometry}

\usepackage[frenchmath]{MinionPro}

\parindent 0pt
\parskip 6pt
%\baselinestretch

%\usepackage[nomath]{kpfonts}
%\SetSymbolFont{letters}{normal}{OML}{cmbr}{m}{it}
%\SetSymbolFont{operators}{normal}{OT1}{cmbr}{m}{n}
%\SetSymbolFont{symbols}{normal}{OMS}{cmbr}{m}{n}
%\DeclareMathAlphabet{\mathbf} {OT1}{cmbr}{bx}{n}

\setkomafont{disposition}{\color{schrift}\bfseries}

\renewcommand{\labelitemi}{-}
\renewcommand{\labelitemii}{$\cdot$}
\renewcommand{\labelitemiii}{$\circ$}
\renewcommand{\labelitemiv}{$\bullet$}

\fboxrule0pt

\definecolor{rahmen}{RGB}{0,73,114}
\definecolor{grund}{RGB}{238,241,251}
\definecolor{schrift}{RGB}{0,73,114}

\captionsetup{format=plain, labelfont={color=rahmen,bf}}

\newcommand{\defeq}{\vcentcolon=}
\newcommand{\eqdef}{=\vcentcolon}

\hfuzz 40pt

\renewcommand{\thefigure}{\arabic{chapter}.\arabic{section}.\arabic{subsection}}

\renewcommand{\figurename}{Aufgabe}}

\parskip 6pt
\parindent 0pt

\makeatletter
\let\stdl@section\l@section
\renewcommand*{\l@section}[2]{%
\stdl@section{\textcolor{black}{#1}}{\textcolor{black}{#2}}}
\let\stdl@subsection\l@subsection
\renewcommand*{\l@subsection}[2]{%
\stdl@subsection{\textcolor{schrift}{#1}}{\textcolor{black}{#2}}}
\makeatother

{}{\pagemark}{}

\allowdisplaybreaks

\begin{document}

\chapter{This is just some testing chapter}

\lipsum[1]
\lipsum[2]
\lipsum[3]
\lipsum[4]
\lipsum[5]
\lipsum[6]
\lipsum[7]

\paragraph{Error Prompt 1}

\begin{verbatim}
Package scrlayer-scrpage Warning: Command \deftripstyle is deprecate.
(scrlayer-scrpage) You should replace it by \deftriplepagestyle,
(scrlayer-scrpage) e.g., on input line 64.
\end{verbatim}

But when I do as the error prompt is telling me, it says the command was undefined.

\end{document}


It now prints the headsepline in the color I desired but the defined pagestyle doesn't work which is why I cant adjust the thickness of the headsepline even though it is shown exactly like this in the KOMA Manual.. Please help me, I have no clue whats going on there! I hope anyone here knows how to deal with the errors because I am completely lost.

The Code produces this:

• \newcommand{\generalheadcolor}{schrift} and use \generalheadcolor in both cases? – user31729 Aug 22 '14 at 12:41
• Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Aug 22 '14 at 12:41
• @ Christian Hupfer I am sorry for having not added an example, I thought there might have been somebody out there who knew the problem - but after thinking about it its of course the better solution because everyone can have a look at the problem now without having to read manuals to see what I mean. – Friedrich Aug 22 '14 at 12:54
• Well, thanks for MWE. As far as I know, the KOMA classes do not store the colours for particular elements of the layout commands. – user31729 Aug 22 '14 at 12:57
• If you design your headers and footers using KOMA-Script's scrlayer-scrpage then you could use \setkomafont{headsepline}{\color{whatever}} – cgnieder Aug 22 '14 at 14:53

I took the liberty to write up an answer, making your very large example into a minimal one. As @cgnieder stated in the comments, package scrlayer-scrpage defines an interface for defining page headers and footer; mostly compatible with scrpage2. Mostly, what does that mean? You received a warning, telling you that the command deftripstyle is deprecated. True, it is. But it gives you an alternative, and looking into the KOMA-documentation reveals: You can just change the command name. But using this is not recommended any more and is just there for compatibility reasons.

Is there any reason for making the document look like the standard W0rd stuff? You should also consider using the class scrreprt. @cgnieder made you aware of some other oddities in the comments.

\documentclass{scrreprt}
\usepackage{blindtext}
\usepackage{xcolor}
\newcommand{\versiondate}{\today}
\deftriplepagestyle{draftpages}[5pt]