I want to set the header with the page number and the chapter number on the even pages and the chapter title and the page number on the odd pages. That is, as is shown in this image:
Here is as far as I've gotten. This gives me the chapter title in the right place, but not the chapter number.
\documentclass[10pt]{memoir}
\usepackage{lipsum}
\makepagestyle{myheadings}
\makepsmarks {myheadings}{
\nouppercaseheads
\createmark {chapter} {left} {nonumber}{\@chapapp\ }{. \ }
%\createmark {chapter} {right} {notitle}{\@chapapp\ }{ }
\createplainmark {toc} {both} {\contentsname}
\createplainmark {lof} {both} {\listfigurename}
\createplainmark {lot} {both} {\listtablename}
\createplainmark {bib} {both} {\bibname}
\createplainmark {index} {both} {\indexname}
\createplainmark {glossary} {both} {\glossaryname}
}
\makeoddhead{myheadings}{\footnotesize\sffamily\leftmark}{}{\footnotesize\sffamily\thepage}
\makeevenhead{myheadings}{\footnotesize\sffamily\thepage}{}{\footnotesize\sffamily\rightmark}
\pagestyle{myheadings}
\begin{document}
\chapter{Chapter title}
\section{Introduction}
\lipsum[1-5]
\section{Section title}
\lipsum[6-10]
\end{document}
I have been trying to include something like this: \createmark {chapter} {right} {notitle}{\@chapapp\ }{ }
, but that hasn't worked.
I've also tried \makeevenhead{myheadings}{\footnotesize\sffamily\thepage}{}{\footnotesize\sffamily{Chapter~\thechapter}}
. That works for most of the book, but not for the toc, preface, and appendices (which become Chapter 0, Chapter A, and Chapter B in the header).
\createmark
interface as it is only made for cases where we write the same thing to either the left, right or both marks. Here you want to write different things to the left and right marks meaning you'll have to code\chaptermark
manually using\markboth