[Tex/LaTex] Insert title of table of contents into toc

table of contents

I have a little bit of problem. I have to put the title of toc into toc.
I've used the following code to do that and it works for me, kind of.
The problem is in the title is aligned with the titles of the chapters and not with list of figures etc.

{
\makeatletter
\let\@oldstarttoc\@starttoc
\renewcommand{\@starttoc}{%
  \addcontentsline{toc}{chapter}{\protect\numberline{}\contentsname}% Add ToC to ToC
  \@oldstarttoc
}
\tableofcontents
\makeatother
}

Here is the picture of my toc.

enter image description here

My idea is to use the same code for Acknowledgements, Lists of… , Abbreviations etc.
Is it ok to try that or there is an alternative?

Best Answer

Why don't you simply load the package tocbibind that automatically inserts ToC, LoF and LoT into the ToC itself?

MWE:

\documentclass{book}
\usepackage{tocbibind}

\begin{document}

\tableofcontents
\listoftables
\listoffigures
\chapter{test}

\end{document} 

Output

enter image description here

Related Question