By default, headers and footers span only the width of the text body, but I need them to span the width of the margin notes and the main text. The closest I've been able to get is the following, using the headwidth
and paperwidth
options.
\documentclass[a4paper,oneside]{article}
\usepackage{mwe}
\usepackage[margin=2cm,marginparwidth=4cm,includemp,reversemp]{geometry}
\usepackage[headwidth=paper, footwidth=paper]{scrlayer-scrpage}
\ihead{left header}
\chead{centre header}
\ohead{right header}
\ifoot{left footer}
\cfoot{centre footer}
\ofoot{right footer}
\begin{document}
\section{Some text}
\blindtext
\marginpar{This is a margin note}
\section{Some more text}
\blindtext
\end{document}
Now the header is properly left-aligned with the margin notes column. However, the "right header" runs off the edge of the page. Clearly I need to set the headwidth to something like marginwidth + marginparsep + textwidth. However, I can't find anything about how to do this in the KOMA-Script manual (at least the English language version, scrguide-en.pdf
).
I'm open to a solution with or without scrlayer-scrpage
. I would prefer to avoid manually placing the header elements (e.g. using textpos
) because I think it will be more difficult for others to maintain the code.