1

I am using memoir class for preparing a document. Here raises a problem with page numbering. For problem demonstration, consider the following MWE.

\documentclass{memoir}
\usepackage{lipsum}

\begin{document}

\frontmatter
\tableofcontents
\chapter{\centering Author Intro}
\lipsum[1-2]
\chapter{\centering Review committee}
\lipsum[1-2]
\chapter{\centering Preface}
\lipsum[1-5]

\mainmatter
\chapter{Intro}
\lipsum[3]
\section{Sec1}
\lipsum[3]
\chapter{Chap2}
\lipsum[3]
\section{Sec1}
\lipsum[3]
\chapter{Chap3}
\lipsum[3]
\section{Sec1}
\lipsum[3]
\chapter{Chap4}
\lipsum[3]
\section{Sec1}
\lipsum[3]
\end{document}

I want the page numbers in the frontmatter not to show in header or footer. But they should continue the page counting. The page counter should start from the very beginning of the document. Now, it starts from 1 in \mainmatterexcluding \frontmatter. Thats means it resets. I don't want that.

I restated my query:

The \mainmatter page numbers should consider the \frontmatter pages. It should not be reset to 0/1. But the \frontmatter pages should not show any numbering, should be empty.

Thanks.

Note : I find a partial solution here: Italic roman page numbering in frontmatter Though it is not working accurately for me.

11
  • First of you should not define \thepage to nothing, use the empty page style. \mainmatter always resets the page counter to 0 because \frontmatter typesets it in roman numerals. Use \mainmatter* to not have this reset. Additionally I would not use \chapter{\centering Preface} as it gives an inconsistent design.
    – daleif
    Commented Dec 14, 2021 at 10:23
  • @daleif What is a good solution for \chapter{\centering Preface}?
    – mmr
    Commented Dec 14, 2021 at 10:34
  • @daleif is this \def\thepage{\empty}?
    – mmr
    Commented Dec 14, 2021 at 10:35
  • @daleif \mainmatter* removes the page number.
    – mmr
    Commented Dec 14, 2021 at 10:38
  • Yes because you deleted the posibility of even printing the page number by that redefintiion. BTW: normal users should never use \def. Pagestyles are issues using \pagestyle{name} (affect the next page onward) and \thispagestyle{name} onl;y currnet page.
    – daleif
    Commented Dec 14, 2021 at 11:03

1 Answer 1

1

Here is my solution to my interpretation of your requirements.

\documentclass{memoir}
\usepackage{kantlipsum}

% hooks to be executed inside the toc
\cftinsertcode{A}{\cftpagenumbersoff{chapter}}
\cftinsertcode{B}{\cftpagenumberson{chapter}}

\makechapterstyle{centerstyle}{%
  % default style plus
  \renewcommand*\chaptitlefont{\normalfont\Huge\bfseries\centering}
}


\begin{document}

% no roman nums
\frontmatter*

% add hook to toc
\cftinserthook{toc}{A}
% no page numbers
\pagestyle{empty}
% no page numbers on chapter pages
\aliaspagestyle{chapter}{empty}
\chapterstyle{centerstyle}

\tableofcontents*

\chapter{Author Intro}
\kant[1-2]
\chapter{Review committee}
\kant[1-2]
\chapter{Preface}
\kant[1-5]


% mainmatter, don't touch numbering
\mainmatter*

% bring back the normal page style
\pagestyle{headings}
% bring back the normal chapter page style
\aliaspagestyle{chapter}{plain}
% add another hook, to revert the first one
\cftinserthook{toc}{B}

\chapterstyle{default}


\chapter{Intro}
\kant[3]
\section{Sec1}
\kant[3-9]
\chapter{Chap2}
\kant[3]
\section{Sec1}
\kant[3-8]
\chapter{Chap3}
\kant[3]
\section{Sec1}
\kant[3-7]
\chapter{Chap4}
\kant[3]
\section{Sec1}
\kant[3]
\end{document}

You must log in to answer this question.

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