4

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

\documentclass{scrartcl}
\usepackage[pagestyles]{titlesec}
\newpagestyle{mypagestyle}{
  \headrule
  \sethead{Document Title}{\sectiontitle}{\pagename\space\thepage}
  \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?

2
  • Very interesting question. Commented Feb 11, 2014 at 12:39
  • 2
    »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. Commented Feb 11, 2014 at 16:17

2 Answers 2

7

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}

\usepackage[automark,headsepline,footsepline]{scrlayer-scrpage}
\automark{section}
\ihead{Document Title}
\chead{\headmark}
\ohead{Page\enspace\pagemark}
\ifoot{Some Static Info}
\cfoot{Author}
\ofoot{Other Static Info}
\pagestyle{scrheadings}

\setkomafont{pageheadfoot}{\normalfont}

\usepackage{blindtext}

\begin{document}
  \blinddocument
\end{document}
3
  • 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. Commented Feb 11, 2014 at 17:33
  • The information for the document title and the author could be taken from the corresponding commands for \maketitle (if desired). Commented Feb 11, 2014 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
    Commented Feb 12, 2014 at 11:00
1

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}
2
  • 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. Commented Feb 11, 2014 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
    Commented Feb 12, 2014 at 9:28

You must log in to answer this question.

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