2

I'm trying to define a pagestyle with the document title in the even-heading and the title of the current book section in the odd-heading, but have been unable to get it to work. The even-heading is correct, but the odd-heading only displays the page number. Here is my test document:

\documentclass[twoside]{memoir}
\usepackage{lipsum}

\title{Generic Document}
\makepagestyle{xHeadings}
\clearmark{chapter}

\makepsmarks{xHeadings}{%
\nouppercaseheads
\createmark{book}{both}{nonumber}{}{}
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}}

\makeevenhead{xHeadings}{\thepage}{\textsc{\thetitle}}{}
\makeoddhead{xHeadings}{}{\textsc{\rightmark}}{\thepage}

\begin{document}
\pagestyle{xHeadings}

\book{Alpha}
\chapter{Able}
\lipsum[1-20]

\book{Beta}
\lipsum[21-40]
\end{document}

Interestingly, if I use \part{...} instead of \book{...} and change \createmark{book}... to \createmark{part}... everything works as expected.

1 Answer 1

1

Like with most sectioning commands, there is a mark associated with \book, called \bookpagemark. It's default setting is similar to \@gobble as it just prints/does nothing with its argument. You can change this to \rightmark, which will set it for the odd-side pages:

enter image description here

\documentclass[twoside]{memoir}
\usepackage{lipsum}

\title{Generic Document}
\makepagestyle{xHeadings}
\clearmark{chapter}

\makepsmarks{xHeadings}{%
  \nouppercaseheads
  \createmark{book}{both}{nonumber}{}{}
  \createplainmark{toc}{both}{\contentsname}
  \createplainmark{lof}{both}{\listfigurename}
  \createplainmark{lot}{both}{\listtablename}
  \createplainmark{bib}{both}{\bibname}
  \createplainmark{index}{both}{\indexname}
  \createplainmark{glossary}{both}{\glossaryname}}

\makeevenhead{xHeadings}{\thepage}{\textsc{\thetitle}}{}
\makeoddhead{xHeadings}{}{\textsc{\rightmark}}{\thepage}
\renewcommand{\bookpagemark}{\markright}% Mark \book on odd pages

\begin{document}
\pagestyle{xHeadings}

\makeatother

\book{Alpha}
\chapter{Able}
\lipsum[1-20]

\book{Beta}
\lipsum[21-40]
\end{document}
1
  • That worked. Was able to remove all xHeadings stuff and pare it down to \makeevenhead{myheadings}{\thepage}{\textsc{\thetitle}}{} \makeoddhead{myheadings}{}{\textsc{\rightmark}}{\thepage} \renewcommand{\bookpagemark}{\markright}
    – MND
    Jul 19, 2016 at 23:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .