6

Using memoir class on a (lengthy) document, I want to customise headers, however (having spent several hours of trial and error) I'm presently stumped when it comes to the nuances required. Can anyone point me in the right direction?

I enclose my MWE. The customised page style ('mpd') provides:

  • an even page header of 'Chapter (number, name etc)' and
  • an odd page header of 'Section'.

I want to

  • switch the 'Chapter (etc)' to the odd page and
  • make the even page header show the document (book) title.

There does not seem to be any reference to document title within Memoir Page Styles, which I have consulted widely in my efforts. Yet it seems like something that should be readily achievable?

Many thanks for any input offered.

\documentclass[a5paper]{memoir}
\usepackage{lipsum}
                            %   ------------------------    
                            %   new style: mpd
                            %   copied from headings style
                            %   with no caps in headers 
\copypagestyle{mpd}{myheadings}     
\addtopsmarks{mpd}{\nouppercaseheads}
    {\createmark{chapter}{left}{shownumber}{\chaptername \space}{ : }
     \createmark{section}{right}{nonumber}{}{}
    }%
\makeoddhead{mpd}{\slshape\rightmark}{}{}
\makeevenhead{mpd}{}{}{\slshape\leftmark}
\makeevenfoot{mpd}{\thepage}{}{\itshape{republished under licence}}
\makeoddfoot{mpd}{\itshape{www.domain.info}}{}{\thepage}    
\pagestyle{mpd} 

\begin{document}    
\tableofcontents*
\pagestyle{mpd}
\mainmatter

\chapter{Introduction}
\label{introduction}
    \section{Section 1}
    \label{section1}
        \lipsum[1]      
        \lipsum[2]      
        \lipsum[3]      
        \lipsum[4]      
        \lipsum[5]      
        \lipsum[1]      
        \lipsum[2]      
        \lipsum[3]      
        \lipsum[4]      
        \lipsum[5]      
        \lipsum[1]      
        \lipsum[2]      
        \lipsum[3]      
        \lipsum[4]      
        \lipsum[5]      
\end{document}
                            %   ------------------------    
  • \makeoddhead{mpd}{\slshape\leftmark}{}{} \makeevenhead{mpd}{}{}{\slshape\mytitle} \def\mytitle{The title} – Gonzalo Medina Aug 11 '14 at 16:37
  • Super. Thank you (again!), @GonzaloMedina. Felt it had to be simple %) – johnbrc Aug 11 '14 at 16:41
5

Use \leftmark for the odd head; store the title in \mytitle and use it for the even head:

\makeoddhead{mpd}{\slshape\leftmark}{}{} 
\makeevenhead{mpd}{}{}{\slshape\mytitle} 
\def\mytitle{The title}

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.