[Tex/LaTex] Table of contents for thesis

table of contents

I am writing my thesis and will prefer my table of contents to appear like Table Of Contents centered and not Contents aligned to the left. If U use \tableofcontents it appears to the left.

The other question is how do I take away chapters from my table of content so that it appears like this

                        Table of Contents
Chapter
1 General information
  1.1 data
  1.2 good
2 Background
  2.1 yes
  2.2 hello

in that other
can any body come to aid?
thanks

Best Answer

I recommend you take a look at the tocloft package. It provides lots of commands to modify the table of contents (and the list of figures, the list of tables, and similar lists).

The following MWE illustrates the usage of the package, using some of the criteria outlined in your posting:

\documentclass{book}
\usepackage{tocloft}
\renewcommand\contentsname{Table of Contents}
\renewcommand{\cfttoctitlefont}{\hfill\large\bfseries}
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand\cftchapfont{\mdseries} % default: \bfseries
\cftpagenumbersoff{chapter} % suppress mention of page numbers for chapters, etc
\cftpagenumbersoff{section}
\cftpagenumbersoff{subsection}

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\addtocontents{toc}{\protect{\mdseries Chapter\par}} % insert the "Chapter" header line
\chapter{General information}
\section{Data}
\section{Good}
\chapter{Background}
\section{Yes}
\section{No}
\end{document}

enter image description here