# include many unnumbered section in the TOC with correct page reference

I am trying to include more than one unnumbered section in the TOC of my thesis. I used \chapter*{Summary} and \chapter*{Samenvatting} to define the unnumbered sections and \addcontentsline{toc}{chapter}{Summary} and \addcontentsline{toc}{chapter}{Samenvatting} to add them to the TOC. Summary starts at page 1...and it comes correct in the TOC, but Samenvatting starts at page 3 and in the TOC it appears again page 1. Here is my document:

\documentclass[10pt,b5paper,openright,twoside]{book}
\usepackage{graphicx}
\usepackage[width=170.00mm, height=240.00mm, left=2.0cm, right=2.00cm, top=2.2 cm, bottom=1.80cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{textcomp}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{rotating}
\usepackage{lscape}
\usepackage{tabularx}
\usepackage{hyperref}
\usepackage{natbib}
\usepackage{wrapfig}
\usepackage{epigraph}
\usepackage[font={small},labelfont={bf}]{caption} %to set caption font small and with bold label
\captionsetup[table]{skip=5pt} %to add space below table caption
\renewcommand{\arraystretch}{1.2} % to increase row heigth in tables

\makeatletter % to set the layout of the chapters header
\vspace*{60\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
%\huge\bfseries \@chapapp\space \thechapter
\huge\bfseries \thechapter.\space%
%\par\nobreak
%\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
\huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\makeatother

\fancyhf{} %clear the header and the footer before you define your own
\fancyfoot[RO]{\thepage} %footer in odd pages on the right
\fancyfoot[LE]{\thepage} %footer in even pages on the left

\renewcommand\bibname{{{\tiny } }References} %change bibliography to References

\author{Elisa Calignano}
\title{Elisa tesi}

\begin{document}

\frontmatter %the text between \frontmatter and \mainmatter will be numbered with roman numbers
\renewcommand{\headrulewidth}{0pt} %set the thickness of the header line in the frontmatter at 0

\clearpage %in order to remove page numbers from the title page
\thispagestyle{empty}

\include{titlepage}

\clearpage %in order to remove page numbers from the empy page before the tabel of contents
\thispagestyle{empty}

\tableofcontents
\setcounter{secnumdepth}{3} %to number subsections

\mainmatter

\renewcommand{\headrulewidth}{0.5 pt}%set the thickness of the header line in the mainmatter at 0.5

\include{summary}
\include{samenvatting}
\include{chapter1}
\include{chapter2}
\include{chapter3}
\include{chapter4C}
\include{chapter5}
\include{chapter6}

\listoffigures

\listoftables

\bibliographystyle{apalike2}

\bibliography{Myref}

\backmatter
\include{author}
\include{acknowledgments}

\end{document}

• (1) Welcome. (2) You might want to edit this MWE, as we of course do not have those chapters that are suppose to be included. Also the \addcontentsline stuff belongs at the text it refers to, not right before the TOC. – daleif Jul 24 '15 at 14:53
• did you try to interchange the contentsline and chapter commands? – Bort Jul 24 '15 at 14:53
• I tried to interchange the \addcontentsline and chapter as suggested by Bort...it worked once...but not the second time – Elisa Jul 24 '15 at 15:11
• Without all the missing files, we cannot test your not-so-minimal also-not-working example. One point: it you want to get the page right you should put the \addtocontentsline AFTER the \section command, just in case the page breaks between the two. – John Kormylo Jul 24 '15 at 16:22

\chapter* effectively issues \cleardoublepage to ensure that the new chapter starts on its own page and that that is an odd (right-hand) page. So, when you say,

\addcontentsline{toc}{chapter}{Summary}% to add the summary to the table of contents witouth number
\include{summary}
\include{samenvatting}


what happens?

First, an addition is made to the .toc file including a reference to the current page. This is for the Summary entry.

Next, LaTeX checks whether there is anything on the current page and whether the current page is a right-hand page. Since there is nothing here and it is a right-hand page, LaTeX goes ahead and starts the chapter which you begin with \chapter*{Summary} on the current page. Since this matches the entry in the .toc file, all is well.

When it has finished typesetting the summary, the next instruction tells it to add an entry to the .toc file for Samenvatting. Again, it adds the reference to the current page.

Now, it finds the \chapter*{Samenvatting} so it checks whether there is anything on the current page. There is. There is all this Summary stuff. So, it clears the page and starts a new one. Now it checks if this is a right-hand page. It is not. We are on a left-hand page now. So, it clears another page and starts a new one. Now we are on a page which is empty and right-hand, so it starts the Samenvatting chapter. So now we are on page 3, but the entry in the .toc file was issued when we were still on page 1.

To avoid this, add the contents line immediately after issuing \chapter*. In this case, that's presumably in the included files we don't have. In summary.tex:

\chapter*{Summary}

In samenvatting.tex:
\chapter*{Samenvatting}