[Tex/LaTex] How to include table of contents into a table of contents

table of contents

I would like to know how to include table of contents into a table of contents….

I have an example of how to spoof it into the toc – using \phantomsection – but it seems like when i have a long document the link goes a bit wrong – ie. it links to a couple of pages before…..

\phantomsection
\addcontentsline{toc}{chapter}{Contents}
\tableofcontents

Example:

\documentclass[12pt, a4paper, twoside]{book}
\usepackage[english]{babel}
\usepackage{amsfonts,dsfont}
\usepackage[final]{pdfpages}
\usepackage{hyperref} 

%----------------------------------------------------------------------------------
\begin{document}
\pagenumbering{roman} 
%----------------------------------------------------------------------------------

%----------------------------------------------------------------------------------
\thispagestyle{empty}
\begin{titlepage}
{\Large
\begin{center}
{\bf XXXXXXXXXXXXXXX}
\end{center}
}
\end{titlepage}
%----------------------------------------------------------------------------------

\phantomsection
\addcontentsline{toc}{chapter}{Contents}
\tableofcontents


\phantomsection
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

\phantomsection
\addcontentsline{toc}{chapter}{List of Tables}
\listoftables

%----------------------------------------------------------------------------------

\newpage
\setcounter{page}{1}
\pagenumbering{arabic}

\chapter{XXXXX}
\label{chXXXXX}

\section{Introduction}\label{chXXXXX_Intro}
BLAH BLAH BLAH. 

%----------------------------------------------------------------------------------

%--------------------
\setboolean{@twoside}{false}
\end{document}

Best Answer

Ok.... Superfast answer\comment from Gonzalo Medina

Instead of using \phantomsection \addcontentsline{toc}{chapter}{Contents} you can load the tocbibind package. – Gonzalo Medina 3 mins ago


Example becomes:

\documentclass[12pt, a4paper, twoside]{book}
\usepackage[english]{babel}
\usepackage{amsfonts,dsfont}
\usepackage[final]{pdfpages}
\usepackage{hyperref}

\usepackage{tocbibind}


%----------------------------------------------------------------------------------
\begin{document}
\pagenumbering{roman}
%----------------------------------------------------------------------------------

%----------------------------------------------------------------------------------
\thispagestyle{empty}
\begin{titlepage}
{\Large
\begin{center}
{\bf XXXXXXXXXXXXXXX}
\end{center}
}
\end{titlepage}
%----------------------------------------------------------------------------------

\tableofcontents
\listoffigures
\listoftables

%----------------------------------------------------------------------------------

\newpage
\setcounter{page}{1}
\pagenumbering{arabic}

\chapter{XXXXX}
\label{chXXXXX}

\section{Introduction}\label{chXXXXX_Intro}
BLAH BLAH BLAH.

%----------------------------------------------------------------------------------

%--------------------
\setboolean{@twoside}{false}
\end{document} 
Related Question