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 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

1 Answer 1

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.