Text FormattingRemove space before the lists (bibliography, LoF, LoT, ToC)

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
cdrueda
Posts: 5
Joined: Wed Apr 21, 2010 12:21 am

Remove space before the lists (bibliography, LoF, LoT, ToC)

Post by cdrueda »

Hi!
How can I remove the space before the "References" or "Bibliography" heading using the book documentclass? Also, I need to to the same thing for the "Contents", "List of Figures" and "List of Tables" headings.

Thank you!

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

Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Remove space before the lists (bibliography, LoF, LoT, ToC)

Post by Stefan Kottwitz »

Hi cdrueda,

these headings are like chapter headings and can be adjusted using the titlesec package, have a look at its documentation. Use the commands \titleformat and \titlespacing.

Stefan
LaTeX.org admin
cdrueda
Posts: 5
Joined: Wed Apr 21, 2010 12:21 am

Re: Remove space before the lists (bibliography, LoF, LoT, T

Post by cdrueda »

Thank you, but I still don't get it.

This is the way I formatted the Chapter titles:

\titleformat{\chapter}[display]
{\bfseries\Huge}
{%
\vskip-3em
% \titlerule
\filright
\Large\chaptertitlename\
\Large\thechapter}
{0mm}
{\filright}

the \vskip command does the job for the chapter. However, I don't know how to do the same thing for toc, lof, loc, and bibliography. Please help me out here, it's for my thesis.

Thanks!
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Remove space before the lists (bibliography, LoF, LoT, ToC)

Post by gmedina »

Hi,

it's better to control the spacing before and after the sectional units' titles with \titlespacing, and not with \titleformat. Take a look at the following example:

Code: Select all

\documentclass{book}
\usepackage{titlesec}

\titleformat{\chapter}[display]
  {\bfseries\Huge}
  {\filright\Large\chaptertitlename\ \thechapter}
  {0mm}{\filright}
\titlespacing*{\chapter}
  {0pt}{-10pt}{40pt}

\begin{document}
\tableofcontents
\chapter{Test chapter}
test
\end{document}
Changing the second argument you can obtain the desired vertical spacing before the chapter titles.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
cdrueda
Posts: 5
Joined: Wed Apr 21, 2010 12:21 am

Re: Remove space before the lists (bibliography, LoF, LoT, T

Post by cdrueda »

Thank you!

But this takes care of the chapter titles only. I need to remove the space above the lof, lot, and bibliography titles.

Thank you!
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Remove space before the lists (bibliography, LoF, LoT, ToC)

Post by gmedina »

cdrueda wrote:...But this takes care of the chapter titles only. I need to remove the space above the lof, lot, and bibliography titles...
As Stefan_K mentioned, the book document class internally builds the ToC, LoF, LoT and Bibliography titles by using \capther*, so the \titlespacing command do affects them.

Take a look at the following example:

Code: Select all

\documentclass{book}
\usepackage{titlesec}

\titleformat{\chapter}[display]
  {\bfseries\Huge}
  {\filright\Large\chaptertitlename\ \thechapter}
  {0mm}{\filright}
\titlespacing*{\chapter}
  {0pt}{-10pt}{40pt}

\begin{document}
{
\titlespacing*{\chapter}
  {0pt}{-80pt}{40pt}
\tableofcontents
\listoffigures
}

\chapter{Test chapter}
test

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply