9

I'm working in the memoir class using A6. For this format, I want to remove both the word "Chapter" from the default memoir page heading style as well as the chapter number, so that only the chapter title is included in the header. Removing the word "chapter" can be achieved by adding the following after \begin{Document}:

\renewcommand{\chaptername}{}

But the chapter number remains in the page header. I added this command:

\renewcommand\printchapternonum{}

but it had no effect.

What is a quick and easy way to remove the chapter number from the header? I looked at the fancyhdr package and there is conflict with memoir; similarly, I tried changing to scrbook but there were errors (baseline skip already defined).

There has to be a simple way of doing this.

[Later]

Thank you everyone for your helpful answers.

3 Answers 3

5

The proper memoir way of doing this

\addtopsmarks{headings}{}{
  \createmark{chapter}{left}{nonumber}{}{}
}
\pagestyle{headings} % activate changes

there is no need to try to figure out how the internals work or that sort of thing.

You might want to read http://tug.org/pracjourn/2008-2/madsen/

5
  • It would be nice if the \addtopsmarks features were explained also in the manual (they aren't, except for a single example which explains almost nothing).
    – egreg
    Mar 17, 2014 at 8:40
  • Its on page 116. What else is needed? (I agree that the manual is too cluttered with examples and code presentation mixed together.)
    – daleif
    Mar 17, 2014 at 9:30
  • BTW, @egreg were you referring to the link I provided? That is just an article about page styles in memoir it is not meant as a manual.
    – daleif
    Mar 17, 2014 at 9:55
  • The \addtopsmarks feature is really difficult to find in the manual and I find its description too scanty. That said, I upvoted your answer, since it says much more than “look at the manual”. I surely wouldn't have been able to guess at nonumber.
    – egreg
    Mar 17, 2014 at 10:02
  • nonumber is an \createmark 'option' and is explained on page 113 in the memoir manual. Someday I hope to get the time to rewrite the memoir manual, but that is not going to happen anytime soon.
    – daleif
    Mar 17, 2014 at 10:11
2

You can redefine \chaptermark:

\documentclass{memoir}
\usepackage{lipsum}% just to generate text for the example

\makeatletter
\renewcommand\chaptermark[1]{%
  \markboth{\MakeUppercase{#1}}{}
}
\makeatother

\begin{document}

\chapter{Test chapter}
\lipsum[1-10]

\end{document}

An image of the header on page two:

enter image description here

Uppercased text is not really pleasing, so perhaps you could use small caps instead:

\documentclass{memoir}
\usepackage{lipsum}% just to generate text for the example

\makeatletter
\renewcommand\chaptermark[1]{%
  \markboth{\textsc{#1}}{}
}
\makeatother

\begin{document}

\chapter{Test chapter}
\lipsum[1-10]

\end{document}
2

With a twoside style, the \chaptermark command is defined as

> \chaptermark=macro:
#1->\@setclcnt {chapter}{@memmarkcntra}\advance \c@@memmarkcntra \m@ne \markboth 
{\memUChead {\ifnum \c@secnumdepth > \c@@memmarkcntra \if@mainmatter \@nameuse 
{chaptermarksn}{\@chapapp \ \@nameuse {thechapter}. \ }\fi \fi #1}}{}.

It's not easy to find the definition in memoir.cls, because it's modified during processing the class code, so I used \show\chaptermark.

The solution is then easy by looking at the definition of \chaptermarksn which just uses its argument:

\renewcommand{\chaptermarksn}[1]{}

because the chapter tag and number are passed as arguments to it.

Example

\documentclass{memoir}

\renewcommand\chaptermarksn[1]{}

\begin{document}

\tableofcontents*
\chapter{Test Chapter}
\section{Test Section}
\lipsum[1-20]
\end{document}

enter image description here

You must log in to answer this question.

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