Page LayoutVertical White Space above TOC Heading

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Lucinda
Posts: 1
Joined: Wed Mar 23, 2011 1:31 pm

Vertical White Space above TOC Heading

Post by Lucinda »

I'm new to Latex and am writing a thesis with a page limit. I have to adhere to strict margin, font size and double line spacing guidelines so would like to remove the large amount of white space above the title in the table of contents and Bibliography. I have managed to remove it above the Chapter Headings with the package titlesec. Also is there a way of reducing the spacing between items in the TOC?

Any help would be greatly appreciated.
Thanks

Here is the code I am using:
%Thesis main file
%paper and font size
\documentclass[a4paper,11pt]{report}
%set margins
\usepackage[a4paper]{geometry}
\geometry{top=2cm, bottom=2cm, left=2cm, right=2cm}
%line spacing
\linespread{1.6}
%page number
\pagestyle{plain}

\usepackage[compact]{titlesec}
\newcommand{\bigrule}{\titlerule[0.1mm]}
\titleformat{\chapter}[display]
{\bfseries\Huge}
{%
\vskip-2cm
\titlerule
\filright
\Large\chaptertitlename\
\Large\thechapter}
{0mm}
{\filright}
[\vspace{0.1mm} \bigrule]
\titlespacing{\section}{1pt}{*1}{*1}
\titlespacing{\subsection}{0pt}{*0}{*0}
\titlespacing{\subsubsection}{0pt}{*0}{*0}
%titles
\title{x}
\author{x}
\date{2010-2011}

%document sections
\begin{document}
\maketitle
%table of contents
\tableofcontents{1}
%Chapters
\include{Introduction}

%Bibliography
\bibliographystyle{plain}
\bibliography{Bibliography}


\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

zryw
Posts: 5
Joined: Sun Mar 20, 2011 1:58 pm

Re: Vertical White Space above TOC Heading

Post by zryw »

\begin{spacing}{0.8}
\tableofcontents
\end{spacing}

Greetings
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Vertical White Space above TOC Heading

Post by localghost »

Lucinda wrote:[…] I have to adhere to strict margin, font size and double line spacing guidelines so would like to remove the large amount of white space above the title in the table of contents and Bibliography. […]
You can do this by the titlesec package that you are already using (see code below).
Lucinda wrote:[…] Also is there a way of reducing the spacing between items in the TOC? […]
The setspace package offers mechanism for increased line spacing that work much better than your method (see code below).

Code: Select all

\documentclass[11pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage{setspace}
\usepackage[compact]{titlesec}
\usepackage{blindtext}

\titleformat{\chapter}[display]
{\singlespacing\bfseries\Huge}
{\titlerule\filright\Large\chaptertitlename\ \Large\thechapter}
{0pt}
{\filright}
[\titlerule]
\titlespacing*{\chapter}{0pt}{0pt}{*2}

\pagestyle{plain}

\title{The Title}
\author{The Author}

\begin{document}
  \maketitle

  \tableofcontents

  \doublespacing
  \Blinddocument
  \begin{thebibliography}{9}
    \item Bibliography Item
  \end{thebibliography}
\end{document}
The blindtext is only for creating dummy text thus not part of the solution.


Best regards and welcome to the board
Thorsten
Post Reply