[Tex/LaTex] How to place a running header and a footer to the page with chapter/section heading

header-footerkoma-scriptscrpage2sectioning

Some people wants to remove running headers and footers from the pages, where a chapter or a section is begining. But I'd like to stay it in place. How can I make it? (I use KOMA-Script (scrbook) and scrpage2.)

Best Answer

If you use scrpage2 and its scrheadings pagestyle, pages that were formerly assigned the plain style (e.g. chapter starting pages) will now be assigned scrplain. The header/footer commands of scrpage2 feature an optional argument that controls the scrplain style.

A possible source of confusion is that commands like \ohead[\headmark]{\headmark} may still produce an empty heading on chapter starting pages because \headmark itself may be empty (e.g. because it refers to \rightmark in twoside documents). Using e.g. \leftmark should produce non-empty "starting" headings.

\documentclass{scrbook}

\usepackage[automark]{scrpage2}
\pagestyle{scrheadings}
\clearscrheadfoot% Dump header/footer content
% \ohead[\headmark]{\headmark}% Will produce empty "starting" heading
\ohead[\leftmark]{\leftmark}
\ofoot[\pagemark]{\pagemark}

\usepackage{blindtext}

\begin{document}

\blinddocument

\end{document}

(The blindtext package is only used to add some dummy text to the example.)