3

i would like to add some colored-lines to my documentation and i while searching through the www i found this post here: Colored horizontal line between two text

According to this, i would ask you, how i could add these lines to my headline and footline so it would look like the painted version below...

Image removed after solved...

My layout file looks like this:

    % Seitenränder -----------------------------------------------------------------
\setlength{\topskip}{\ht\strutbox} % behebt Warnung von geometry
\geometry{a4paper,left=20mm,right=20mm,top=25mm,bottom=35mm}

\usepackage[
    automark, % Kapitelangaben in Kopfzeile automatisch erstellen
    headsepline, % Trennlinie unter Kopfzeile
    ilines % Trennlinie linksbündig ausrichten
]{scrpage2}

% Kopf- und Fußzeilen ----------------------------------------------------------
\pagestyle{scrheadings}
\renewcommand{\titlepagestyle}{scrheadings}
\clearscrheadfoot

% Kopfzeile
\renewcommand{\headfont}{\normalfont} % Schriftform der Kopfzeile
\ihead{\large{\textsc{\titel}}\\ \small{\untertitel} \\[2ex] \textit{\headmark}}
\chead{}
\ohead{\includegraphics[scale=0.4]{\logo}}
\setlength{\headheight}{15mm} % Höhe der Kopfzeile
%\setheadwidth[0pt]{textwithmarginpar} % Kopfzeile über den Text hinaus verbreitern (falls Logo den Text überdeckt) 

% Fußzeile
\ifoot{\copyright\ \autor}
\cfoot{}
\ofoot{\pagemark}

\onehalfspacing % Zeilenabstand 1,5 Zeilen
\frenchspacing % erzeugt ein wenig mehr Platz hinter einem Punkt 

% Schusterjungen vermeiden
\clubpenalty = 10000
\widowpenalty = 10000 
\displaywidowpenalty = 10000

% Quellcode-Ausgabe formatieren
\lstset{numbers=left, numberstyle=\tiny, numbersep=5pt, breaklines=true}
\lstset{emph={square}, emphstyle=\color{red}, emph={[2]root,base}, emphstyle={[2]\color{blue}}}

\counterwithout{footnote}{section} % Fußnoten fortlaufend durchnummerieren
\setcounter{tocdepth}{\subsubsectionlevel} % im Inhaltsverzeichnis werden die Kapitel bis zum Level der subsubsection übernommen
\setcounter{secnumdepth}{\subsubsectionlevel} % Kapitel bis zum Level der subsubsection werden nummeriert

% Aufzählungen anpassen
\renewcommand{\labelenumi}{\arabic{enumi}.}
\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}.}
\renewcommand{\labelenumiii}{\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}}

% Tabellenfärbung:
\definecolor{heading}{rgb}{0.64,0.78,0.86}
\definecolor{odd}{rgb}{0.9,0.9,0.9}
\definecolor{ww-lightblue}{RGB}{73, 111, 185}
\definecolor{ww-darkblue}{RGB}{22, 59, 124}
\definecolor{ww-orange}{RGB}{248, 147, 36}
3
  • 1
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Jan 15, 2015 at 12:09
  • (1) welcome, (2) please provide the code as a fully compilable example, then there is less work to those wanting to help. We cannot see for example which document class you are using.
    – daleif
    Jan 15, 2015 at 12:09
  • The project is separated in many files so i'm not abled to provide you the hole code...
    – regetskcob
    Jan 15, 2015 at 12:13

1 Answer 1

8

Here's what you can do.

Load the scrlayer-scrpage package (instead of scrpage2 which is not recommended anymore) and define the thickness of the lines with, for example

\usepackage[automark,headsepline=3pt,footsepline=3pt]{scrlayer-scrpage}

Then add the color to the font used to typeset them, with, for example

\addtokomafont{headsepline}{\color{blue}}
\addtokomafont{footsepline}{\color{orange}}

MWE

\documentclass{scrbook}

\usepackage{lipsum} % only for the example

\usepackage{xcolor}

\usepackage[automark,headsepline=3pt,footsepline=3pt]{scrlayer-scrpage}

\addtokomafont{headsepline}{\color{blue}}
\addtokomafont{footsepline}{\color{orange}}

\pagestyle{scrheadings}

\begin{document}

\chapter{Test}

\lipsum[1-5]

\section{A section}

\lipsum[1-5]

\end{document} 

Output

enter image description here

1
  • Support for scrpage2 dropped completely, it is officially obsolete.
    – Johannes_B
    Jan 15, 2015 at 12:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .