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
  • 2
    Are you talking about headings or headers? Because that is a significant difference. Commented Dec 13, 2013 at 8:33
  • I've edited the question. Commented Dec 13, 2013 at 22:39

2 Answers 2

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}
3
  • I'm using memoir 2009/09/21 v1.61803398b and I get ! Undefined control sequence. l.11 \clearmark {section} Commented Dec 13, 2013 at 22:39
  • Then update, you are way way behind. Sounds like some older Linux?
    – daleif
    Commented Dec 14, 2013 at 0:43
  • How do I move the page number to the middle of the footer? I tried using \pagestyle{ruled} but it messed up the header. Commented Jan 23, 2014 at 7:00
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}

You must log in to answer this question.

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