Text FormattingHelp with \tableofcontents and \listoffigures heading format

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
bhosp
Posts: 1
Joined: Wed Nov 10, 2010 6:07 pm

Help with \tableofcontents and \listoffigures heading format

Post by bhosp »

I need to change the format of the headings created by \tableofcontents ("Contents") and \listoffigures ("List of Figures") to be centered, bold-face, normal-size text. I also want to remove the leading vspace these macros create (between the heading and the top margin). How do I do this?

(Please help! My university library won't accept my dissertation if I can't make it conform to their style guide! :shock: )

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

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Help with \tableofcontents and \listoffigures heading format

Post by meho_r »

Welcome to the forum. Please, start with this.

Meanwhile, here's a blind example using titlesec:

Code: Select all

\documentclass{book}

\usepackage[english]{babel}
\usepackage{blindtext}

\usepackage{titlesec}

\begin{document}

{% don’t forget this curly brace 

\titleformat{\chapter}
	{\normalfont\bfseries\filcenter}% global formatting (number and text)
	{}% formatting the chapter number
	{0pt}% distance between the number and text of chapter
	{}% optional code preceding typesetting of chapter
	
\titlespacing{\chapter}
	{0pt}% left margin
	{0pt}% vertical space before title
	{0pt}% vertical space after title

\tableofcontents
\listoffigures

}% don’t forget this curly brace


\begin{figure}\centering
\rule{3cm}{1ex}
\caption{A figure}
\end{figure}

\Blinddocument

\end{document}
Post Reply