[Tex/LaTex] How to include page margin into header and footer in memoir

header-footermarginparmarginsmemoir

I wonder how I can achieve the following two things:

  1. I want to have defined page margins for the use of \marginpar notes and comments. The problem is that, although I use memoir with twoside option the oddside outer margin and the evenside outer margin differ. I want the outer margins to be exactly the same on both, odd and even pages (for example to have 6 cm outer margins and 2 cm inner margins).

  2. I would like to extend the header and footer to include the outer margin (both marginsep and marginwidth). As I understand the handbook this could be done using the companion pagestyle, but I prefer the default chapter style (i.e. its font, style, shape, no rule, etc.). How can I modify the chapter pagestyle to make header and footer extend into the margin area? Btw.: I did try to modify headwidth by playing with the companionstyle definition from the memoir handbook. But I had no success:

I tried this:

\setlength{\headwidth}{\textwidth}
 \addtolength{\headwidth}{\marginparsep}
 \addtolength{\headwidth}{\marginparwidth}

 \copypagestyle{chapter}{plain}
 \makerunningwidth{chapter}{\headwidth} 

Here is a MWE. I tried to shorten it a bit.

\documentclass[12pt,foliopaper,twoside]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{kantlipsum}
\usepackage{tikz}


%*****************Margins and MarginNotes******************

\setmarginnotes{10pt}{5cm}{6pt}
\setlength{\textwidth}{0.9\textwidth}
\let\oldmarginpar\marginpar
\renewcommand\marginpar[1]{\-\oldmarginpar[\footnotesize #1]%
{\raggedright\footnotesize #1}}

%*******************Header & Footer***********************
 \nouppercaseheads 
%***********************Document*******************
\author{Author}
\date{\today}
\title{\textbf{Title}}

\begin{document}

\maketitle

\chapter{Chapter 1}

\kant[12]
\marginpar{The reader should be careful to observe that the objects in space and time are the clue to the discovery of, certainly, our a priori knowledge, by means of analytic unity.}
\kant[8]
\marginpar{The reader should be careful to observe that the objects in space and time are the clue to the discovery of, certainly, our a priori knowledge, by means of analytic unity.}
\kant[7]\marginpar{The reader should be careful to observe that the objects in space and time are the clue to the discovery of, certainly, our a priori knowledge, by means of analytic unity.}
\section{Section 1}
\kant[7]


\chapterstyle{default}
\newpage

\printindex
\end{document}

Best Answer

I used the geometry to properly set the margin sizes (6 outer, 2 inner). Remember the \headwidth must come after the geometry margins definition. As pointed by daleif it's much easier and cleaner to do it with memoir companion style. If you want the first chapter page to have same style just add \aliaspagestyle{chapter}{companion} after the \pagestyle. Screenshot in Adobe Acrobat: memoir companion wide header

\documentclass[12pt,foliopaper,twoside]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{kantlipsum}
\usepackage{tikz}

%*****************Margins and MarginNotes******************

\usepackage[outer=6cm, inner=2cm, heightrounded, marginparwidth=4cm, marginparsep=1cm]{geometry}

%*******************Header & Footer***********************

\setlength{\headwidth}{\textwidth}
\addtolength{\headwidth}{\marginparsep}
\addtolength{\headwidth}{\marginparwidth}

 \nouppercaseheads 
%***********************Document*******************
\author{Author}
\date{\today}
\title{\textbf{Title}}

\pagestyle{companion}

\begin{document}

\maketitle
\chapter{Chapter 1}
\kant[12]
\marginpar{The reader should be careful to observe that the objects in space and time are the clue to the discovery of, certainly, our a priori knowledge, by means of analytic unity.}
\kant[8]
\marginpar{The reader should be careful to observe that the objects in space and time are the clue to the discovery of, certainly, our a priori knowledge, by means of analytic unity.}
\kant[7]\marginpar{The reader should be careful to observe that the objects in space and time are the clue to the discovery of, certainly, our a priori knowledge, by means of analytic unity.}
\section{Section 1}
\kant[7]
\marginpar{The reader should be careful to observe that the objects in space and time are the clue to the discovery of, certainly, our a priori knowledge, by means of analytic unity.}
\chapterstyle{default}
\newpage

\printindex
\end{document}
Related Question