0

List of Tables in my thesis

I am simply using commands (below is the command I used) to generate a List of Tables in my thesis. After the 99th table, the text and number of tables are overlapping each other, which doesn't seem neat and nice(see image). Can I do something to change it? Like, have some space between the number and text?

\addcontentsline{toc}{chapter}{List of Tables}
\listoftables
yo'
  • 51,322
  • I believe these are the same symptoms and same solution as in https://tex.stackexchange.com/a/546935/11002 (There might be better questions about this, but the one I link was suggested in the "Related" column on the right) – yo' Aug 20 '21 at 14:03

2 Answers2

2

You don't specify what your document class is, which is a vital part of the information here. As a general practice, you will want to provide a complete minimal example that shows the problem. In your case, you could get the very high table number by having a document with

 ...
 \appendix
 \chapter{An appendix}
 \setcounter{table}{100}
 \begin{table}
 \caption{A caption}
 No need to put an actual table here
 \end{table}

I'm going to assume that you're using report or something based on it¹, in which case, the problem is that by default, 2.3em of space is reserved for the number in the table of contents for table numbers, which is fine for most documents. You, however, are writing an exceptional document with more than 99 tables in one chapter.

You'll need to add a patch to the private LaTeX command \l@table to fix this. By default, it will execute:

 \@dottedtocline{1}{1.5em}{2.3em}

The 1 is the depth in the hierarchy (0=chapter, 1=section/table/figure, 2=subsection, etc.), 1.5em is the indent and the 2.3em is the width of the space reserved for numbers.

We can modify the definition by writing:

\makeatletter
\RenewDocumentCommand{\l@figure}{} % ❶
   {\@dottedtocline{1}{1.5em}{2.8em}}
\makeatother

If you're stuck using an old version of LaTeX (before October 2020), replace the line marked ❶ with

\renewcommand*{\l@figure}

  1. What I suggest may not work for all document classes or if you (or your document class) are using some special package for formatting the table of contents.
Don Hosek
  • 14,078
1

Use the tocloft package and its \cfttabnumwidth macro which sets the space for table caption numbers.

\documentclass{report} % or whatever class you are using
\usepackage{tocloft}
\setlength{\cfttabnumwidth}{3in} % an enormous space for table caption numbers
% the rest of your preamble
\begin{document}
\listoftables
% the rest of your document

Read the manual for more information.

Peter Wilson
  • 28,066