# [Tex/LaTex] KOMAoptions{headsepline = true, footsepline = true} change geometry settings

I am using tex(-based techniques) for the first time. Currently I am writing my doctoral thesis via pdflatex and encounter an annoying problem:

My university predetermines very strict page geometry properties and I was able to implement them via the geometry package. So far so good. I'm using KOMA-script class scrbook and when I add header- and footerseplines (for decorative purposes), the geometry is dramatically changed. I used the layout package to show the layout and its values.

The head-/footseplines are optional, so I could just remove them, but maybe somebody knows how to fix this problem? I would really appreciate it. Thank you!

Below is my minimal working example:

%Preamble
%Fonts % Babel
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
%Lipsum for dummy text
\usepackage{lipsum}
%Layout package for page layout
\usepackage{layout}
%
%geometry package
\usepackage[ paper=a4paper, layout=a4paper, top=25mm, bottom=20mm, left=30mm, right=30mm, marginparsep=5mm, marginparwidth=20mm, head=12.5mm, foot=12.5mm pdftex]{geometry}
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\KOMAoptions{headsepline = true, footsepline = true}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%Begin document
\begin{document}
%Dummy text
\lipsum
%Show layout
\layout
%End document
\end{document}


There was a bug regarding the option footsepline in KOMA-Script version 3.12 and 3.13, see www.komascript.de/release3.13 (German). Update your KOMA-Script to version 3.15.

If that is not possible - for example Overleaf still uses version 3.12 - change the order in your preambel to

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\KOMAoptions{headsepline = true, footsepline = true}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%geometry package
\usepackage[ paper=a4paper, layout=a4paper, top=25mm, bottom=20mm, left=30mm, right=30mm, marginparsep=5mm, marginparwidth=20mm, head=12.5mm, foot=12.5mm]{geometry}


Or use headsepline and footsepline as class options

\documentclass[...,headsepline,footsepline]{scrbook}
\usepackage[...]{geometry}


Note, there is a command \KOMAScriptVersion to print the used version number in the document.

Additionally there is a missing comma between the geometry options foot=12.5mm and pdftex in your MWE. Note, that you can remove pdftex because this option is not needed anyway.