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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to start a book in LaTeX, and I have a preface, which is in the frontmatter of the book. Unfortunately, it keeps showing 'Contents' in the header after the table of contents.

Basically, what I want is for it to show 'Contents' in the first two pages of the front matter (the pages actually devoted to the table of contents), and then the chapter title in the headings after that.

My main document:

\documentclass[12pt]{book}

\begin{document}
\frontmatter
\title{A Book}
\author{Jwir3}

\maketitle

\tableofcontents
\include{preface}

\mainmatter

\end{document}

My preface.tex document (included):

\cleardoublepage
\addcontentsline{toc}{section}{Preface}

\chapter*{Preface}

Blah blah blah.. rambling for a couple of pages...
share|improve this question
up vote 10 down vote accepted

Don't use \chapter* but \chapter. Since you are using \frontmatter every thing will be taken care of and no chapter number will be used.

\documentclass[12pt]{book}

\begin{document}
\frontmatter
\title{A Book}
\author{Jwir3}

\maketitle


\tableofcontents
\cleardoublepage
%\addcontentsline{toc}{section}{Preface}

\chapter{Preface} %% <----------here

Blah blah blah.. rambling for a couple of pages...

\mainmatter

\end{document}
share|improve this answer
    
Perfect, thanks. – jwir3 Dec 22 '12 at 23:58

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.