2

I am in hurry and I really need to know how to style the page in memoir class. All the examples in page style such as Rule,empty, headings and Plain doesn't give the combination I need. Plain styles is the closest as it give bottom centered page numbers but without headers. I need both headers and page numbers at bottom centered on every page.

Can anybody please give me solution?

4

Here is a very plain template to set all the headers and footer in memoir. It's taken almost verbatim from the memoir documentation (section 7.3 MAKING HEADERS AND FOOTERS):

enter image description here

\documentclass{memoir}
\usepackage{lipsum}

\makepagestyle{hurried}% Create hurried page style
\makeevenfoot{hurried}% Adjust even footer for hurried page style
  {LEF}% Left even footer
  {CEF}% Center even footer
  {REF}% Right even footer
\makeevenhead{hurried}% Adjust even header for hurried page style
  {LEH}% Left even header
  {CEH}% Center even header
  {REH}% Right even header
\makeoddfoot{hurried}% Adjust odd footer for hurried page style
  {LOF}% Left odd footer
  {COF}% Center odd footer
  {ROF}% Right odd footer
\makeoddhead{hurried}% Adjust odd header for hurried page style
  {LOH}% Left odd header
  {COH}% Center odd header
  {ROH}% Right odd header
\makeheadrule{hurried}{\textwidth}{.4pt}% Header rule width/thickness for hurried page style
\makefootrule{hurried}{\textwidth}{.4pt}{\footruleskip}% Footer rule width/thickness/skip for hurried page style

\pagestyle{hurried}% Set page style to hurried

\begin{document}

\frontmatter
\tableofcontents

\mainmatter

\chapter{A chapter}\lipsum[1-10]
\section{A section}\lipsum[1-10]
\subsection{A subsection}\lipsum[1-10]
\subsubsection{A subsubsection}\lipsum[1-10]

\end{document}

If you don't want to be as extravagant and set everything, you can \copypagestyle from an existing one (like Ruled, ruled, plain, ... any of the ones mentioned in section 7.2 PAGE STYLES).

Note that first pages of chapters in memoir are set in the chapter page style. chapter is not a true page style, but rather an alias for plain. If you wish to change that, first \copypagestyle{chapter}{plain}, making chapter a true page style, then use the above techniques. For example, to get the page number in the center of the first chapter page, use

\copypagestyle{chapter}{plain}% Copy plain page syle to chapter page style
\makeoddfoot{chapter}% Adjust odd footer for chapter page style
  {}% Left odd footer
  {\thepage}% Center odd footer
  {}% Right odd footer
  • Thanks Werner. I could get the page numbers at center bottom using above technique but my header is not coming up now. I am using \chapterstyle{veelo} and it has fist page number on right bottom. Don't know how to fix that. Also what should I use for {LOH} to get the header as chapter title? thanks very much for help. – user51906 May 19 '14 at 2:46
  • @user51906: I've added what you need for the chapter first page. The chapter title will be stored in \leftmark, so you could use \makeoddhead{hurried}{\leftmark}{?}{?}. – Werner May 19 '14 at 5:56
  • Hi Werner, that did fix the first page number to center. But I still don't get the headers right. So this is what I have in preamble – user51906 May 19 '14 at 9:46
  • \chapterstyle{veelo} \usepackage[left=4cm,right=3cm,bottom=2.5cm]{geometry} \copypagestyle{chapter}{plain} \makeoddfoot{chapter} {}{\thepage}{} \makepagestyle{hurried} \makeevenfoot{hurried}{}{\thepage}{} \makeevenhead{hurried}{\leftmark}{}{} \makeoddfoot{hurried}{}{\thepage}{} \makeoddhead{hurried}{\leftmark}{}{} \pagestyle{hurried}% Set page style to hurried – user51906 May 19 '14 at 10:00
  • and I have a thesis.tex that has the structure like this \documentclass[ 12pt, a4paper, oneside]{memoir} %\documentclass[a4paper, oneside, draft]{memoir} \input{preamble} \begin{document} \frontmatter % \maketitle \tableofcontents \listoffigures \listoftables \mainmatter % \include{./chapters/intro} % \include{./chapters/methods} % \include{./chapters/results1} \include{./chapters/conclusions} % \include{./chapters/appendices} % \include{./chapters/supplementary} \backmatter \bibliography{references} \end{document} – user51906 May 19 '14 at 10:02

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.