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 having a very weird problem. The following example should illustrate it quite right.

\documentclass[a4paper,12pt]{memoir}    
\begin{document}
\frontmatter
  \tableofcontents
  \clearpage
\mainmatter
  \chapter{Chapter 1}
\end{document}

I've compiled it with xelatex but on the table of contents page, it is referencing the table of contents page as Contents, which is the header of that page as well. It does make sense to me to a certain extend. But I'd still like to know how to get rid of the self-reference.

share|improve this question
    
    
add comment

3 Answers

up vote 16 down vote accepted

\KeepFromToc helps in suppressing TOC entries for such \listof commands:

\begin{KeepFromToc}
  \tableofcontents
\end{KeepFromToc}
share|improve this answer
4  
It's a memoir class feature. –  Stefan Kottwitz Feb 12 '11 at 22:21
    
I'll accept this as the answer as it's memoire specific which was my initial problem. It should be noted though that both answers provide a working solution. –  angerman Feb 13 '11 at 9:45
add comment

Thanks to Martin Scharrer, I paid a more attention to the memoir class as the source of the issue.

A closer examination of the memoir README reveals \tableofcontents* as a solution. Seems logical, everything I want to hide gets the star.

share|improve this answer
1  
I was just going to post \tableofcontents* as a solution. (I found it by \show\tableofcontents, NOT be reading the 583 pages-manual.). –  Martin Scharrer Feb 12 '11 at 21:07
add comment

I had a similar problem, but with the article class. Neither of the solutions above work for this class, so after much searching I used the advice of Martin above and searched the article class and found that I can simply not use \tableofcontents, and instead use:

\makeatletter
\@starttoc{toc}
\makeatother

This doesn't create a section for the table of contents, so the problem goes away.

Thought I would post this here in case anyone else has a similar problem.

share|improve this answer
    
This is useful for cases where you don't want the "Contents" header above the TOC. –  Alex Hirzel Sep 9 '12 at 17:24
add comment

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.