# Page styles with Koma instead of titlesec

I usually set up my page style titlesec along the lines of

\documentclass{scrartcl}
\usepackage[pagestyles]{titlesec}
\newpagestyle{mypagestyle}{
\setfoot{Some Static Info}{Author}{Other Static Info}
}
\pagestyle{mypagestyle}


But now I read that there are Incompatibilities between KOMA-Script and titlesec. Although I did not notice those incompatibilities, I am a little concerned.

Is there a way to define the page style without using titlesec, but still keep it as clear and powerful?

• Very interesting question. – jpayansomet Feb 11 '14 at 12:39
• »KOMA-Script« has its own package »scrlayer-scrpage« (or the older »scrpage2«) to set up page styles. It is preferable over any other package here since it cooperates best with the classes from »KOMA-Script«. The package has its own chapter in the user guide. – Thorsten Donig Feb 11 '14 at 16:17

This is an approach that should get you started. The details can be found in Chapter 6 of the »KOMA-Script« user guide.

\documentclass[headinclude=on]{scrartcl}
\usepackage[T1]{fontenc}

\automark{section}
\ifoot{Some Static Info}
\cfoot{Author}
\ofoot{Other Static Info}

\usepackage{blindtext}

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

• As always, the »blindtext« package is only for creating the dummy document to make the page style visible. It is not part of the solution. – Thorsten Donig Feb 11 '14 at 17:33
• The information for the document title and the author could be taken from the corresponding commands for \maketitle (if desired). – Thorsten Donig Feb 11 '14 at 17:33
• This only works with Koma script v3.12 or later, i.e. starting with TeXLive2013. I am on TeXLive2012, but replacing scrlayer-scrpage with scrpage2 seems to work. – bodo Feb 12 '14 at 11:00

The commands \sethead and \setfoot from package titlesec or its component titleps map to several scrlayer-scrpage commands, e.g.:

\newcommand\sethead[3]{\ihead{#1}\chead{#2}\ohead{#3}}
\newcommand\setfoot[3]{\ifoot{#1}\cfoot{#2}\ofoot{#3}}


The \headrule command should be similar to this:

\KOMAoption{headsepline}{0.4pt}

• The definition of a new command makes sense if this command is used used very often in the document, but not for the once used setup of the page style. – Thorsten Donig Feb 11 '14 at 17:31
• That’s right, of course. I just wanted to show the different concepts by example. Nevertheless, one could define such commands in a custom .sty to avoid learning new things, I guess. Actually, I first tried to reimplement all of titleps with KOMA-Script macros, but at some point gave up. – Crissov Feb 12 '14 at 9:28