7

I am using memoir and there is a problem with the headers. I see section titles in the headers but I only want to see chapter titles regardless of section titles in the chapter. My tex file is included below. What I want is to have "Short chapter title" appear in the header of all pages in Chapter 1, but instead I get section and subsection titles from file chapter1.tex. How can I fix that?

\documentclass[11pt,a4paper,oldfontcommands]{memoir}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{psfrag}
\usepackage{color}

\OnehalfSpacing

\begin{document}

\chapter[Short chapter title]{Long chapter title}
\input{chapter1.tex}

\bibliography{b} 
\bibliographystyle{acm} 

\end{document}

2 Answers2

4

memoir provides some fairly convenient commands for setting these. Firsly, you can remove the sections in the headers via

\clearmark{section}

Secondly, the command \createmark{chapter}... will set headings changing at each chapter. To get the standard style of chapter heading on each page write

\makeatletter
\createmark{chapter}{both}{shownumber}{\@chapapp\ }{. \ }
\makeatother

The \makeatletter / \makeatother combination is required as one of the commands contains the @ sign.

Sample output

\documentclass[11pt,a4paper]{memoir}

\usepackage{lipsum} %for dummy text

\OnehalfSpacing

\clearmark{section}
\makeatletter
\createmark{chapter}{both}{shownumber}{\@chapapp\ }{. \ }
\makeatother

\begin{document}

\chapter[Short chapter title]{Long chapter title}
\lipsum[1]

\section{A section}
\label{sec:section}

\lipsum[2-20]

\end{document}
Andrew Swann
  • 95,762
0

An alternative solution using ruled page style, with page numbers in the footers.

\documentclass[11pt,a4paper]{memoir}
\usepackage{lipsum} %for dummy text
\OnehalfSpacing

\makeevenhead{ruled}{\leftmark}{}{}
\makeoddhead{ruled}{}{}{\leftmark}
\makeevenfoot{ruled}{}{\thepage}{}
\makeoddfoot{ruled}{}{\thepage}{}

\begin{document}
\pagestyle{ruled}

\chapter[Short chapter title]{Long chapter title}
\lipsum[1]

\section{A section}
\label{sec:section}

\lipsum[2-20]

\end{document}