[Tex/LaTex] How to remove vertical spacing of ToC title without tocloft

table of contents

I'm trying to control the vertical spacing of my table contents title, however I'm getting into overflow issues because I'm loading both tocloft and titletoc. I found a similar case, but just removing tocloft just won't do as I need to remove the spacing between the title and the entries.

custom TOC text overflow

Overflow!

Here's a MWE:

\documentclass[12pt]{report}

    \usepackage{tabto}

    \usepackage{tocloft}
        \setlength\cftaftertoctitleskip{0pt}

    \usepackage{titletoc}
        \titlecontents{chapter}% <section-type>
            [0pt]% <left>
            {\vspace{1em}}% <above-code>
            {\MakeUppercase \chaptername\ \thecontentslabel \tabto{1.25in} \MakeUppercase}% <numbered-entry-format>
            {}% <numberless-entry-format>
            {\titlerule*[5pt]{.}\contentspage}% <filler-page-format>

        \titlecontents{section}% <section-type>
            [0pt]% <left>
            {\vspace{0.5em}}% <above-code>
            {\tabto{0.5in} \thecontentslabel \tabto{1.25in}}% <numbered-entry-format>
            {}% <numberless-entry-format>
            {\titlerule*[5pt]{.}\contentspage}% <filler-page-format>

        \titlecontents{subsection}% <section-type>
            [0pt]% <left>
            {}% <above-code>
            {\tabto{1.25in} \thecontentslabel \tabto{2.0in}}% <numbered-entry-format>
            {}% <numberless-entry-format>
            {\titlerule*[5pt]{.}\contentspage}% <filler-page-format>

\begin{document}
    \tableofcontents

    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
\end{document}

Best Answer

Instead of using tocloft, you can patch the \tableofcontents command to insert some negative vertical spacing after the heading as follows:

\usepackage{etoolbox}
\patchcmd{\tableofcontents}{\@starttoc}{\vspace{-1cm}\@starttoc}{}{}

This reduces the space by 1cm. The removal of the tocloft package, means that the overflow problem disappears.

Sample output

\documentclass[12pt]{report}

    \usepackage{tabto}

    \usepackage{titletoc}
        \titlecontents{chapter}% <section-type>
            [0pt]% <left>
            {\vspace{1em}}% <above-code>
            {\MakeUppercase \chaptername\ \thecontentslabel \tabto{1.25in} \MakeUppercase}% <numbered-entry-format>
            {}% <numberless-entry-format>
            {\titlerule*[5pt]{.}\contentspage}% <filler-page-format>

        \titlecontents{section}% <section-type>
            [0pt]% <left>
            {\vspace{0.5em}}% <above-code>
            {\tabto{0.5in} \thecontentslabel \tabto{1.25in}}% <numbered-entry-format>
            {}% <numberless-entry-format>
            {\titlerule*[5pt]{.}\contentspage}% <filler-page-format>

        \titlecontents{subsection}% <section-type>
            [0pt]% <left>
            {}% <above-code>
            {\tabto{1.25in} \thecontentslabel \tabto{2.0in}}% <numbered-entry-format>
            {}% <numberless-entry-format>
            {\titlerule*[5pt]{.}\contentspage}% <filler-page-format>

\usepackage{etoolbox}
\patchcmd{\tableofcontents}{\@starttoc}{\vspace{-1cm}\@starttoc}{}{}

\begin{document}


    \tableofcontents

    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
    \chapter{A Chapter}
        \section{A Section}
            \subsection{A Sub-Section}
\end{document}
Related Question