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
    Are you talking about headings or headers? Because that is a significant difference. – Thorsten Donig Dec 13 '13 at 8:33
  • I've edited the question. – Andrey Sokolov Dec 13 '13 at 22:39
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}
  • I'm using memoir 2009/09/21 v1.61803398b and I get ! Undefined control sequence. l.11 \clearmark {section} – Andrey Sokolov Dec 13 '13 at 22:39
  • Then update, you are way way behind. Sounds like some older Linux? – daleif Dec 14 '13 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. – Andrey Sokolov Jan 23 '14 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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.