Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using the memoir class for a thesis, and want no page numbering of the front matter including the TOC. Have followed the answer to Table of contents with page style empty which does remove the page numbering of the first page of the TOC. My TOC is three pages long, and the last 2 pages still has a heading with roman page numbering. Minimal example below here:

\documentclass[danish,12pt,a4paper,oneside,openany]{memoir}
\AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}} 

\begin{document}
  \frontmatter
  \pagestyle{empty}
  \include{frontmatter/titlepage}
  \include{frontmatter/abstract}
  \tableofcontents*
  \pagestyle{headings}

  \mainmatter
  ...       
share|improve this question
1  
Put the \pagestyle{empty} command before \frontmatter. –  Alan Munn Aug 5 '11 at 11:27
    
Gave it a try but does not cause any change in output. –  Jannick Aug 5 '11 at 13:03
    
Did you delete your .aux files and rerun latex twice? –  Alan Munn Aug 5 '11 at 13:08
    
Did now, still same result. I also tried adding a \AtEndDocument.. which strangely enough removed the header from the 2nd page of the TOC bot not the third. I'm using pdflatex from MikTek if it makes any difference. –  Jannick Aug 5 '11 at 15:19
    
Try putting \clearpage after the \tableofcontents* command. –  Alan Munn Aug 5 '11 at 15:39

1 Answer 1

up vote 6 down vote accepted

Because memoir doesn't automatically start contents lists on a new page, you need to issue \clearpage commands to make sure that the page style gets associated correctly. Headers and footers are added after the page content is produced, so the \clearpage is necessary. The standard document classes incorporate \clearpage into some of these commands, but memoir chooses not to.

\documentclass[danish,12pt,a4paper,oneside,openany]{memoir}
\AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}} 

\begin{document}
\pagestyle{empty}
\frontmatter
\include{frontmatter/titlepage}
\include{frontmatter/abstract}
\tableofcontents*
\clearpage % TOC will now have the previous pagestyle setting
\pagestyle{headings}

\mainmatter
  ...
\end{document}  
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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