2

I have the following template for a book using memoir:

\documentclass[a5paper, 14pt]{memoir}

\usepackage{lipsum}  

\begin{document}

\frontmatter

\chapter*{Nothing}
\chapter*{Nothing}

\clearpage


\begin{KeepFromToc}
  \tableofcontents
\end{KeepFromToc}

\chapter{0-One}
\lipsum[2-10]

\chapter{1-Two}
\lipsum[2-10]

\mainmatter

\chapter{One}
\lipsum[2-10]
\chapter{Two}
\lipsum[2-10]

\end{document}

The first entry in the ToC is "0-One", which starts at page V in the above MWE. However, I'd like for the Roman numerals to start right after the ToC with I, i.e., "0-One" should be I and not V.

Is it possible to do this using memoir?

2 Answers 2

3

You can add a second \frontmatter command, which will reset the numbering. You also don't need the KeepFromToc for the \tableofcontents; just use \tableofcontents*. To remove the numbering entirely from the initial pages, you can alias the chapter pagestyle to empty, and then restore it after the table of contents.

\documentclass[a5paper, 14pt]{memoir}

\usepackage{lipsum}  

\begin{document}

\frontmatter
\aliaspagestyle{chapter}{empty}
\chapter*{Nothing}
\chapter*{Nothing}

\clearpage
\tableofcontents*
\clearpage
\aliaspagestyle{chapter}{plain}
\frontmatter
\chapter{0-One}
\lipsum[2-10]

\chapter{1-Two}
\lipsum[2-10]

\mainmatter

\chapter{One}
\lipsum[2-10]
\chapter{Two}
\lipsum[2-10]

\end{document}

output of code

8
  • Nice, thanks. The first 4 pages have numbers i-iv though, after which it resets to i. Is there a way to remove the numbers for the first 4 pages entirely?
    – BillyJean
    Oct 29, 2017 at 19:40
  • 1
    @BillyJean - Use \pagestyle{empty} for the page(s) for which page numbers shouldn't be printed (along with \thispagestyle{empty} on pages with chapter-level headers). Use \pagestyle{plain} to restart "normal" page numbering.
    – Mico
    Oct 29, 2017 at 19:42
  • @Mico Thanks. I tried that, but I don't see any effect of \pagestyle{empty}. I am placing it both before and after the first frontmatter
    – BillyJean
    Oct 29, 2017 at 19:45
  • 1
    @BillyJean - Did you insert \pagestyle{empty} immediately after \frontmatter, along with \thispagestyle{empty} immediately after each and every \chapter* and \chapter directive?
    – Mico
    Oct 29, 2017 at 19:47
  • 1
    @Mico There's a simpler way to do this. (See edit.)
    – Alan Munn
    Oct 29, 2017 at 19:50
2

I suggest using \pagenumbering{alph} for the part before \frontmatter (you'll know why when you'll add hyperref). With a group, the changes made to the page styles will be forgotten as soon as the group ends.

\documentclass[a5paper, 14pt]{memoir}

\usepackage{lipsum}  

\begin{document}

\pagenumbering{alph}

\begingroup
\pagestyle{empty}
\aliaspagestyle{chapter}{empty}

\chapter*{Nothing}
\chapter*{Nothing}

\endgroup

\frontmatter
\pagestyle{headings}
\aliaspagestyle{chapter}{plain}

\tableofcontents*

\chapter{0-One}
\lipsum[2-10]

\chapter{1-Two}
\lipsum[2-10]

\mainmatter

\chapter{One}
\lipsum[2-10]
\chapter{Two}
\lipsum[2-10]

\end{document}

Explanation

With page numbering roman or arabic, hyperref would be in trouble, because more than one page would get the same internal reference, which is built using the page number. Any other page numbering model will do, so also Roman or Alph would do. Alternatively, one might renew the definition of \thepage adding a prefix to the arabic number.

The group, that's not generally advisable for normal chapters, will keep the redefinitions of the page style local. In these “prechapters” you'll probably have material pertaining to the bureaucracy of your institution, such as committee names and declarations, so no cross-reference or other things that could impact on memory. At \endgroup, the redefinitions will vanish, thus not requiring to reinstate the normal page styles that you may define at will in the document preamble.

3
  • Damn you hyperref. :)
    – Alan Munn
    Oct 29, 2017 at 20:27
  • Although it might be helpful to explain exactly what the problem is.
    – Alan Munn
    Oct 29, 2017 at 20:35
  • @AlanMunn Added
    – egreg
    Oct 29, 2017 at 21:04

You must log in to answer this question.

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