[Tex/LaTex] Trying to generate a Table of Contents for a Thesis

table of contents

The class file I'm using has this code inside the Table of Contents section. The problem with it is it doesn't conform to the university thesis requirements that the sections be indented inside the Table of Contents. For example I would like the Table of Contents to look more like this example:

Format ToC for thesis

Everything else is okay except for this indentation issue. I was wondering if I could get some help changing this code to fix this issue.

So here is my code which I have also pasted at this link here

http://www.texpaste.com/n/nv5i42qf

% TABLEOFCONTENTS
%  In thesis class, \tableofcontents, \listoffigures, etc. are always
%  set in single-column style.  @restonecol


\def\tableofcontents{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  \fi\chapter*{\bf Table of Contents\@mkboth{}{}\addcontentsline{toc}{chapter}{Table of Contents}}
 \@starttoc{toc}\if@restonecol\twocolumn\fi} %added \bf to print Table of Contents in bold on pg 2006nm


\def\l@part#1#2{\addpenalty{-\@highpenalty}
   \addvspace{2.25em plus 1pt}  % space above part line
   \begingroup
   \@tempdima 3em         % width of box holding part number, used by
     \parindent \z@ \rightskip \@pnumwidth             %% \numberline
     \parfillskip -\@pnumwidth
     {%\large \bfseries          % set line in \large boldface 2006nm
     \leavevmode          % TeX command to enter horizontal mode.
     #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
     \nobreak             % Never break after part entry
   \endgroup}


\def\l@chapter#1#2{\pagebreak[3]
   \vskip 1.0em plus 1pt  % space above chapter line
   \@tempdima 1.5em       % width of box holding chapter number
   \begingroup
     \parindent \z@ \rightskip \@pnumwidth
     \parfillskip -\@pnumwidth
     %\bfseries                  % Boldface removed. 2006nm
     \leavevmode          % TeX command to enter horizontal mode.
     #1\hfil \hbox to\@pnumwidth{\hss #2}\par
   \endgroup}

\def\l@chapter{\@dottedtocline{0}{1.5em}{2.3em}}  %added this line 2006nm
\def\l@section{\@dottedtocline{1}{1.5em}{2.3em}} %changed 1 to 0 2006nm
\def\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
\def\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
\def\l@paragraph{\@dottedtocline{4}{10em}{5em}}
\def\l@subparagraph{\@dottedtocline{5}{12em}{6em}}

% LIST OF FIGURES AND ILLUSTRATIONS
%
\def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  \fi\chapter*{\bf{List of Figures and Illustrations}\markboth
   {}{}\addcontentsline{toc}{chapter}{List of Figures}}%(NM 2005 added List of Figures to TOC)
   \@starttoc{lof}\if@restonecol\twocolumn
  \fi}

\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}

% LIST OF TABLES
%
\def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  \fi\chapter*{\bf{List of Tables}\markboth
   {}{}\addcontentsline{toc}{chapter}{List of Tables}}%(NM 2005 added List of Tables to TOC)
   \@starttoc{lot}\if@restonecol\twocolumn
  \fi}

\let\l@table\l@figure

% List of Symbols, Abbreviations and Nomenclature
%
\def\listofsymbols{\input{symbols} \clearpage}
\def\addsymbol #1: #2{$#1$ \> \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \   \parbox{5in}{#2}\\}
\def\newnot#1{\label{#1}}



%    ****************************************
%    *             BIBLIOGRAPHY             *
%    ****************************************
%
% The thebibliography environment executes the following commands:
%
%  \def\newblock{\hskip .11em plus .33em minus -.07em} --
%      Defines the `closed' format, where the blocks (major units of
%      information) of an entry run together.
%
%  \sloppy  -- Used because it's rather hard to do line breaks in
%      bibliographies,
%
%  \sfcode`\.=1000\relax --
%      Causes a `.' (period) not toproduce an end-of-sentence space.

\def\thebibliography#1{\altchapter{Bibliography}\list
  {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \usecounter{enumi}}
    \def\newblock{\hskip .11em plus .33em minus -.07em}
    \sloppy
    \sfcode`\.=1000\relax}

\let\endthebibliography=\endlist

% \def\@biblabel#1{[#1]\hfill}  % Produces the label for a \bibitem[...]
                                % command.
% \def\@cite#1{[#1]}            % Produces the output of the \cite command.

Best Answer

Control horizontal spacing in the TOC entries:

 \makeatletter
 \renewcommand*\l@section{\@dottedtocline{1}{0em}{1.8em}}
 \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.0em}}
 \renewcommand*\l@subsubsection{\@dottedtocline{3}{4.3em}{3.0em}}
 \makeatother

The first argument (with 1, 2, and 3) indicates section (1), subsection (2) or subsubsection (3). The second argument indicates the indent from the left and the third the separation between the number and the text.

If you want to modify them directly in a class file, then no need to wrap the commands with \makeatletter ... \makeatother