0

With memoir, how do I change the following source so that the word "Chapter does not appear in the header on even-numbered pages?

That is, where I now get

Chapter 1. The Fall of Humpty-Dumpty

I will get instead:

1. The Fall of Humpty-Dumpty

Source:

\documentclass{memoir}

\usepackage{textcase}

\copypagestyle{chapter}{plain}
\makeoddfoot{chapter}{}{\sffamily\thepage}{}

\makeheadrule {headings}{\textwidth}{\normalrulethickness}

\nouppercaseheads

\newcommand{\mainheads}{%
  \makeevenhead{headings}{\bfseries\sffamily\thepage}{}{\bfseries\sffamily \leftmark}%
  \makeoddhead{headings}{\bfseries\sffamily\rightmark}{}{\bfseries\sffamily\thepage}%
}
\usepackage{lipsum}

\begin{document}

\mainmatter
\mainheads

\chapter{The Fall of \NoCaseChange{Humpty-Dumpty}}

\section{The Wall}

\lipsum[1-15]

\section{The \NoCaseChange{King's} horses}

\end{document}

Here's what I have now for even-numbered headers:

Unwanted Chapter in even-numbered page headers

Note that the odd-numbered headers already omit "Section", as desired:

Even-numbered page headers OK

8
  • You need to run \pagestyle{headings} after you issue \nouppercaseheads otherwise it does nothing. To remove the prefix look up \addtopsmarks and use its last of three arguments to redefine what chapter sends to the header
    – daleif
    Oct 9, 2019 at 6:11
  • 1
    Erh you set the header with \MakeUppercase and complain why \nouppercaseheads does not work? What exactly did you expect? Please update your question and explain what exactly it is you want to do.
    – daleif
    Oct 9, 2019 at 7:33
  • Remocing the chapter prefix can be done via \addtopsmarks{headings}{}{ \createmark{chapter}{left}{shownumber}{}{. \ } } \pagestyle{headings}
    – daleif
    Oct 9, 2019 at 7:35
  • @daleif: I do not have any pagestyle named headings here; the pagestyle is chapter.
    – murray
    Oct 9, 2019 at 14:13
  • @daleif: Oops, that \MakeUppercase was left over from a different attempt where I had meant to try MakeTextLowercase. I'm editing my question to fix that
    – murray
    Oct 9, 2019 at 14:16

1 Answer 1

1

Add

\addtopsmarks{headings}{}{ 
  \createmark{chapter}{left}{shownumber}{}{. \ } 
} 
\pagestyle{headings} 

Remember the last line to have the changes merged into the page styles currently in use

4
  • Where, exactly should the \pagestyle{headings}, which is for main matter, go in the source? In my actual, book-length document, I will be changing the headings style for front matter, main matter, and back matter.
    – murray
    Oct 9, 2019 at 18:27
  • @murray you could add it to your mainheads, but I don't really see any need to have three different pagestyles, that just looks odd
    – daleif
    Oct 9, 2019 at 19:51
  • In fact, the index will have different headers; the preface, table of contents, bibiliography, and other backmatter will have a different kind of header (same head rule as main page style and same position of page number, but just the word "Preface", "Contents", "Bibliography", etc., at the right of verso and at the left of recto).
    – murray
    Oct 10, 2019 at 0:40
  • @murray you don't need special pagestyles for that, done right it will be added to the headers automatically
    – daleif
    Oct 10, 2019 at 4:11

You must log in to answer this question.

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