# How to switch of headsepline in KOMA Script for selfdefined pagestyle

I have a document where I want to have the headsepline on in general but switch it off for chapters. The following MWE works but the used option \setheadsepline{0ex} is deprecated.

\documentclass[a4paper,11pt,twoside]{scrbook}
\usepackage{blindtext}

\renewcommand*\chapterpagestyle{chapter}

\begin{document}
\blinddocument
\end{document}

The log says:

Package scrlayer-scrpage Warning: Command deprecated!
(scrlayer-scrpage)                Usage of \setheadtopline', \setheadsepline',

(scrlayer-scrpage)                \setfootsepline', and \setfootbotline'
(scrlayer-scrpage)                became deprecated with scrlayer-scrpage.
(scrlayer-scrpage)                You should use KOMA-Script options
(scrlayer-scrpage)                headsepline', headtopline', footsepline',
(scrlayer-scrpage)                or footbotline' with values
(scrlayer-scrpage)                <line thickness>:<line length>' to setup
(scrlayer-scrpage)                the line length and thickness, and
(scrlayer-scrpage)                setup the colour on input line 23.

I also found hints in the documentation that I can use the option headsepline=false to switch it off for a pagestyle. But where do I pass that option?

• You are thinking too complicated i think and use the wrong interface (the one for experienced users). Use \cehead[useful text]{center even} and \cohead[useless text]{center odd}. Avoid the generation f a new page style/ Sep 6, 2016 at 8:47
• You can use \KOMAoption{headsepline}{false} instead of the current line, that sets the width to zero and generates the warning. Sep 6, 2016 at 8:48
• Thank you for your answer. I generate new pagestyles because in my actual document I want different styles for the toc, chapters and "normal" pages. Thus I have three styles and the interface you suggested seems to only support two. Sep 6, 2016 at 9:03

You can use \KOMAoptions in the definition

\documentclass[a4paper,11pt,twoside]{scrbook}
\usepackage{blindtext}

}

\renewcommand*\chapterpagestyle{chapter}

\begin{document}
\blinddocument
\end{document}

But I'm not sure if declaring a new paired pagestyle is the way to go. Why don't you redefine the plain style?

• Thanks! I'm also not sure if paired pagestyles is the way to go. :D I had another look at the manual. Seems like I didn't understand their potential yet. I will look more closely into this in the future. Sep 6, 2016 at 9:25
• Could you please indicate how to redefine plain style? I am straggling with KOMA-Script documentation since yesterday to reimplement what i had implemented with fancyhdr. KOMA-Script documentation is amazing: it does not contain a single usage example of \newpagestyle, neither of \newpairofpagestyles. Mar 6, 2020 at 17:44

If you need different styles for TOC, chapter pages and normal pages, you can also use the plain style for your chapter pages with

and change the header and footer in TOC by

\clearpage
\KOMAoptions{plainfootsepline=false}%
%
\rohead[right on odd toc start page]{right odd in toc}%
}
\AfterStartingTOC[toc]{\clearpage}

Example:

\documentclass[a4paper,11pt,twoside]{scrbook}
\usepackage[
manualmark,
footsepline,
plainfootsepline% added to get a footline on plain pages
]{scrlayer-scrpage}
\usepackage{blindtext}
\usepackage{microtype}

\clearpage
\KOMAoptions{plainfootsepline=false}%
%
\rohead[right on odd toc start page]{right odd in toc}%
}
\AfterStartingTOC[toc]{\clearpage}

\begin{document}
\Blindtext
\tableofcontents
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument
\end{document}

You could also use something like