Text FormattingFix horizontal Spacing in LoF, LoT in 'book' class

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
maja z
Posts: 18
Joined: Mon May 18, 2009 8:53 pm

Fix horizontal Spacing in LoF, LoT in 'book' class

Post by maja z »

Hi!
I've got a list of figures and list of tables, both of which go into double digits (i.e. Table 13.10), and this (I think) causes the LOT, LOF to look very ugly and bunched up. I don't know if they operate as tables (?) but essentially I need the first column (the one that has the 10.11, 10.12 numbers in it) to be a bit wider, so as to not be touching the table/figure titles. Sorry I cannot provide a minimal example, but if someone could point me to how to adjust these widths or the separator I would be very grateful!
Thanks!
m.

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

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

Fix horizontal Spacing in LoF, LoT in 'book' class

Post by localghost »

maja z wrote:[…] Sorry I cannot provide a minimal example, […]
A minimal example is always possible. Regarding your problem, try the tocloft package to adjust the space reserved for the float numbers.

Code: Select all

\documentclass[11pt,a4paper]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tocloft}

\addtolength{\cftfignumwidth}{1em}
\addtolength{\cfttabnumwidth}{1em}

\begin{document}
  \listoffigures
  \listoftables

  \chapter{Foo}

    \begin{figure}[!ht]
      \centering
      \rule{6.4cm}{3.6cm}
      \caption{Dummy figure}\label{fig:dummy}
    \end{figure}

    \begin{table}[!ht]
      \centering
      \rule{6.4cm}{3.6cm}
      \caption{Dummy table}\label{tab:dummy}
    \end{table}
\end{document}
For the present this should be enough for entries in form of "xx.xx" for both LoF and LoT. For higher numbers the corresponding values can easily be increased.


Thorsten
Post Reply