# How to correct the pagenumber of a \section* in the ToC?

In my book I have two starred sections into a starred chapter. When I include the chapter in ToC with

\addcontentsline{toc}{chapter}{Chapter title}


the displayed pagenumber is correct. When I do the same for the first section of that chapter everything is ok (because the are in the same page)

\addcontentsline{toc}{section}{First Section title}


but when I do it for the second starred section

\addcontentsline{toc}{section}{Second Section title}


its pagenumber in the Toc is displayed wrong (it's displayed the same page as the chapter and first section).

How can I correct the pagenumber of that second starred secion in the ToC?

I'm using the book class.

EDIT:

This a MWE

\documentclass[letterpaper]{book}
\usepackage[spanish]{babel}
\usepackage{tocloft}

\begin{document}
\tableofcontents
\chapter{First chapter}
\section{Section Zero}
\chapter*{Second Chapter}
\section*{First Section}
\newpage

And it works!!!!! The problem is that it doesn't work if I add the chapters by \include instead of \chapter
• The \addcontentsline macro should be after \section*, not before... – user31729 Sep 21 '17 at 15:52
• @Fabio: Placing \addcontentsline before \chapter* or \section* does not make sense. It will have to be after. – Werner Sep 21 '17 at 16:28
• @Fabio -- if you use \include, it will always start a new page. that is why, when \addcontentsline is in the \included file the page number for a chapter will be correct. even so, the \addcontentsline should always come after the \chapter (or \section, etc.) line so that it can't be separated by a page break from the heading that is to appear in the toc. – barbara beeton Sep 22 '17 at 0:32