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 have some trouble with the page numbers printed in the table of contents. I am writing a text in book class. In my text, I first print a table of contents with the commands

\frontmatter
\tableofcontents

Since I wanted to add a list of figures and a list of tables that would appear in the table of contents, I wrote the following commands.

\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
\addcontentsline{toc}{chapter}{List of Tables}
\listoftables

The list of figures is on page v and the list of tables is on page vii. However, they appear in the table of contents as being on pages iii and vi respectively (which makes really no sense because the tables are at distance 2 and not 3). I tried to compile several times to see if the problem would fix itself but it does not.

Is there a mistake in my line codes? Or is it a known bug?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

Your first \addcontentsline is executed immediately after the the end of the ToC's contents; only then \listoffigures adds a page break (or, in the case of book' s default twoside option, a break to the next odd page). Solution: add \cleardoublepage before \addcontentsline.

\cleardoublepage
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
\cleardoublepage
\addcontentsline{toc}{chapter}{List of Tables}
\listoftables
share|improve this answer

Check out the tocbibind package. It will automatically add things like lists of figures to the table of contents.

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.