[Tex/LaTex] Format ToC for thesis

formattingtable of contentstitlesec

I apologize for the unspecified and broad question but I have no way to be specific. I'm looking to generate the TOC and List of Figure, List of Table according to the format required by my school.

enter image description here

enter image description here

I have been trying with titlesec but I can't get some details working. Specifically the followings:

  • no bold-face;

  • The line 'CHAPTER Page' has to appear on every page of the ToC. Same with the line 'Figure Page' for the LoF and 'TABLE Page' for the LoT;

  • Single spacing between chapter and its section but double spacing between chapters

  • If the title is more than one line long, it should follow the format in Figure 2.1, i.e there are spaces before 1884

Best Answer

Here's a possible solution.

  1. I used the titletoc and tocloft packages to customize the ToC, LoF and LoT titles and entries as required. Firther customization might be required for the titles, but this might depend on the general layout for the chapter titles and this information was not provided in the question.
  2. The tocbibind packge was used to automatically include the LoF and the LoT in the table of contents.
  3. The afterpage package can be used to produce the corresponding headings in every page of the ToC, the LoF and the LoT; since these lists typically span few pages, one can use

    \addtocontents{toc}{\protect\afterpage{tocheading}}
    \addtocontents{lof}{\protect\afterpage{lofheading}}
    \addtocontents{lot}{\protect\afterpage{lotheading}}
    

    respectively, in the appropriate locations in the body of the document.

  4. I used the book document class (instead of using report) to profit from the \frontmatter, \mainmatter (and \backmatter) commands.

The code:

\documentclass{book}
\usepackage{titletoc}
\usepackage{tocloft}
\usepackage[nottoc]{tocbibind}
\usepackage{afterpage}

% Change the name of the ToC
\AtBeginDocument{%
\renewcommand\contentsname{Table of Contents}}

% Headings for every page of ToC, LoF and Lot
\newcommand\tocheading{\par\bigskip\MakeUppercase{\chaptername}\hfill Page\par}
\newcommand\lofheading{\par\bigskip\figurename\hfill Page\par}
\newcommand\lotheading{\par\bigskip\MakeUppercase{\tablename}\hfill Page\par}

% Centering titles for the ToC, Lof and Lot
\renewcommand{\cfttoctitlefont}{\hfill\normalfont\MakeUppercase}
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand{\cftloftitlefont}{\hfill\normalfont\MakeUppercase}
\renewcommand{\cftafterloftitle}{\hfill}
\renewcommand{\cftlottitlefont}{\hfill\normalfont\MakeUppercase}
\renewcommand{\cftafterlottitle}{\hfill}

% Chapter entries formatting for frontmatter chapters
\newcommand\frontmatterchaptoc{%
\titlecontents{chapter}
  [1.5em]{\addvspace{\baselineskip}}
  {\contentslabel{1.5em}\MakeUppercase}
  {\hspace*{-1.5em}\MakeUppercase}
  {\titlerule*[1pc]{.}\contentspage}
}

% Chapter entries formatting for mainmatter chapters
\newcommand\mainmatterchaptoc{%
\titlecontents{chapter}
  [5em]{\addvspace{\baselineskip}}
  {\contentslabel{3em}\hspace*{-1em}\MakeUppercase}
  {\MakeUppercase}
  {\titlerule*[1pc]{.}\contentspage}
}

% Section, subsection, table and figure entries formatting
\titlecontents{section}
  [7em]{}{\hspace{-1em}}{}{\titlerule*[1pc]{.}\contentspage}
\titlecontents{subsection}
  [7.5em]{}{\hspace{-1em}}{}{\titlerule*[1pc]{.}\contentspage}
\titlecontents{figure}
  [5em]{}
  {\contentslabel{3em}\hspace*{-1em}}{}
  {\titlerule*[1pc]{.}\contentspage}
\titlecontents{table}
  [5em]{}
  {\contentslabel{3em}\hspace*{-1em}}{}
  {\titlerule*[1pc]{.}\contentspage}

\begin{document}

\frontmatter
\frontmatterchaptoc % activation of chapter entries formatting in the frontmatter

\chapter{Acknowledgements}

\cleardoublepage
\tableofcontents
\cleardoublepage
\addtocontents{lof}{\lofheading}% add heading to the first page in LoF
\listoffigures
\cleardoublepage
\addtocontents{lot}{\lotheading}% add heading to the first page in LoT
\listoftables
\cleardoublepage

\mainmatter
\addtocontents{toc}{\tocheading}% add heading to the first page in ToC, after frontmatter entries

\mainmatterchaptoc% activation of chapter entries formatting in the mainmatter

\chapter{Introduction}
\section{Section One One}
\begin{figure}
\centering
A
\caption{Test figure one}
\label{fig:test}
\end{figure}
\chapter{Policy divergence and traditional research}
\section{Section Two One}
\begin{figure}
\centering
A
\caption{William Adolphe Bouguereau, \emph{Youth of Bacchus}  (initial sketch), 1884}
\label{fig:wab}
\end{figure}
\subsection{Section Two One One}

\end{document}

An image of the obtained ToC:

enter image description here

an Image of the obtained LoF:

enter image description here

Related Question