2

I'm writing a cumulative dissertation in scrbook in which I have to embed multiple publications in PDF. This works all right with includepdf, but I thought it would be nice to keep the header and/or footer information in place, to make it easier for the readers to figure out where they are. I used the standard "headings" page style to get the chapter/section information in the header and the page number centered in the footer. This is a problem for the PDF, though, because the page number is printer on top of the publication's footer, rendering both unreadable. Therefore, I tried to get both chapter title and page number into the header. I ended up defining my own style, and it works nicely, but for some reason there is suddenly a page number in the footer of the first page in a new chapter - which normally should be plain. Can you tell me how that happened?

Here's my MWE:

\documentclass[a4paper, twoside, BCOR=15mm, 11pt, numbers=noenddot, DIV=12]{scrbook}

\usepackage[english]{babel}

% changing headers and footers
\usepackage[automark,headsepline]{scrpage2}
\defpagestyle{mystyle}{%
    (0pt, 0pt)
    {\headmark\hfill\pagemark}
    {\pagemark\hfill\headmark}
    {\pagemark\hfill\headmark}
    (\textwidth, 0.5pt)
}{%
    {\hfill}{\hfill}{\hfill}
}
\pagestyle{mystyle}
\usepackage{blindtext}

\begin{document}

\blinddocument

\end{document}
3

Chapter pages use pagestyle plain as default. So you have to change this pagestyle too. Additionally you can use the predefined style scrheadings.

\documentclass[BCOR=15mm, numbers=noenddot, DIV=12]{scrbook}
\usepackage[english]{babel}

% changing headers and footers
\usepackage[automark,headsepline]{scrpage2}
\pagestyle{scrheadings}
\clearscrheadfoot% removes the default content of header and footer
\setheadsepline{.5pt}
\ohead{\headmark}
\ihead[\pagemark]{\pagemark}

\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}

If there should be no page number on the chapter page remove the optional argument of \ihead.


Note that scrpage2 is outdated. I would recommend to use its successor scrlayer-scrpage:

\documentclass[BCOR=15mm, numbers=noenddot, DIV=12]{scrbook}
\usepackage[english]{babel}

% changing headers and footers
\usepackage[automark,headsepline=.5pt]{scrlayer-scrpage}
\clearpairofpagestyles% removes the default content of header and footer
\ohead{\headmark}
\ihead*{\pagemark}

\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}

If there should be no page number on the chapter page use \ihead{\pagemark} instead the starred version.

1
  • Thank you, that works! I had tried an approach with scrheadings as well, with the same problem - that must have been the optional argument I didn't understand. Mar 25 '16 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.