I'm using Memoir for a book, and I am having some difficulty with the headers. I obviously need to change something, but I can't figure out where to make the change.
I want a numbered chapter name.
What I want for the (recto) header is:
Chaptername................Pagenum
and for the verso:
Pagenum.....................Title
Answer
here is a solution using the fancyhdr package. I think the command you've been looking for so desperately is \leftmark which already contains the chapter counter and its actual name.
\documentclass[english]{memoir}
\usepackage{babel,blindtext}
\let\footruleskip\relax % for compatibility of memoir and fancyhdr
\let\rm\rmfamily % for compatibility of memoir and blindtext (demo only)
\usepackage{fancyhdr}
\author{Me}
\title{Some Title}
\pagestyle{fancy}
\fancyhead[LE,RO]{\thepage}
\fancyhead[LO]{\leftmark}
\fancyhead[RE]{\thetitle}
\begin{document}
\maketitle
\blinddocument
\blinddocument
\end{document}
Other way
No need for using the fancyhdr package, memoir can do it, (and maybe even simpler ^^ )
% The following code have been found in Peter Wilsons Memoir manual in chapter 7 (page127)
\makepagestyle{YourPagestyleName} % Create a new pagestyle
% Following code to edit the pagestyle
\makepsmarks{YourPagestyleName}{%
\nouppercaseheads
% This is where we specify what \leftmark and \rightmark contains
\createmark{chapter}{both}{shownumber}{}{\space}
\createmark{section}{right}{shownumber}{}{\space}
% Change "shownumber" to "nonumber" if you don't want
% the chapter/section number displayed at the header.
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}}
% Might want to keep those, see the manual for further information.
% The following is where you tweek your header
\makeevenhead{YourPagestyleName}{% % For verso pages
\normalfont\bfseries\thepage}{}{\normalfont\bfseries\leftmark}
\makeoddhead{YourPagestyleName}{% % For recto pages
\normalfont\bfseries\rightmark}{}{\normalfont\bfseries\thepage}
% Activate your new pagestyle
\pagestyle{YourPagestyleName}
No hay comentarios:
Publicar un comentario