35

I've been trying to figure out a way to easily reduce the space/gap from the top of the page to the table of contents title, as in to reduce the vertical space before the table of contents begins.

Below is my MWE:

\documentclass[final,a4paper,11pt]{report}

%%% Packages %%%
\usepackage[hidelinks,breaklinks]{hyperref} % hyperref for linking references for pdf
\usepackage{tocloft}    % tocloft for table of contents style
\usepackage[compact]{titlesec}  % titlesec for title section layout

% Format the title for chapters
\titleformat{\chapter}[hang]{\huge\bfseries}{\thechapter.}{1em}{}
\titlespacing*{\chapter}{0pt}{-3em}{1.1\parskip}
\titlelabel{\thetitle\quad}

% Begin document
\begin{document}

\tableofcontents
\addtocontents{toc}{\vskip-40pt} % this is to reduce the gap for the first table of contents entry

\clearpage

\chapter{Introduction}
\section{Background}
Need to reduce the space before the Contents title, was able to reduce the space before chapter fine.
\end{document}

How does the report class handle the table of contents? It doesn't seem to be a chapter, else it would have moved up when I changed the chapter spacing?

1
  • By default report uses unnumbered chapters for TOC, LOF and LOT. But package tocloft changes the format of these titles. To avoid this set option titles for package tocloft.
    – esdd
    May 16, 2019 at 10:15

2 Answers 2

37

I figured it out by using the \usepackage{tocloft} package:

\setlength{\cftbeforetoctitleskip}{-3em}

Which didn't work before since I forgot to change Z to toc: \cftbeforeZtitleskip to \cftbeforetoctitleskip

I believe Z can be changed to other things, other than 'toc'

2
  • Very good answer, it helped me a lot. Thanks...
    – user16399
    Jul 8, 2012 at 22:35
  • 3
    Note: you need \usepackage{tocloft}
    – Blaztix
    Sep 24, 2019 at 23:52
1

If you load package tocloft, the formatting of the TOC title changes. The same happens for LOF and LOT. To avoid this behavior set package option titles:

\usepackage[titles]{tocloft}% <- option titles added!

Then TOC, LOF and LOT titles will be unnumbered chapter titles with the same layout as in the document.

Example:

\documentclass[a4paper,11pt]{report}
\usepackage[titles]{tocloft}% <- option titles added!
\usepackage[compact]{titlesec}
\usepackage[hidelinks,breaklinks]{hyperref}

% Format the title for chapters
\titleformat{\chapter}[hang]{\huge\bfseries}{\thechapter.}{1em}{}
\titlespacing*{\chapter}{0pt}{-3em}{1.1\parskip}
\titlelabel{\thetitle\quad}

\begin{document}
\tableofcontents
\chapter{Introduction}
\section{Background}
Need to reduce the space before the Contents title, was able to reduce the space before chapter fine.
\end{document}

Result:

with \usepackage[titles]{tocloft}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .