General ⇒ increase space between table number and caption
increase space between table number and caption
I used \listoftables to generate the list of tables in my document. However, I noticed that for the tables with 2-digit table number like 10.21 (10 is the chapter number and 21 the number of table), the table caption is very close to the table number like 10.21This is a table. This doesn't happen when the table number is 1-digit like 10.2 This is another table. Since it's generated automatically, how to increase the space between the table number and table caption for the table with 2-digit table number?
Cheers,
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
increase space between table number and caption
Best regards
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: increase space between table number and caption
\newcommand*{\l@table}{\@dottedtocline{1}{1.5em}{3em}}. I don't know how to change concretely.
I also had a look at the forum by searing \listoftables
http://www.latex-community.org/forum/se ... es&fid[]=5
but didn't find a solution.
By the way, why does it happen to the list of tables and not list of figures?
thanks
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
increase space between table number and caption
You can't just use this line in your code. You have to group it by two special commands.carol wrote:I had a look at the manual. Whatever I use generates error, for example
\newcommand*{\l@table}{\@dottedtocline{1}{1.5em}{3em}}. I don't know how to change concretely. […]
Code: Select all
\makeatletter
\newcommand*{\l@table}{\@dottedtocline{1}{1.5em}{3em}}
\makeatother
Wrong search parameter. You should have searched for "tocloft". Here's an example that makes use of the package.carol wrote:[…] I also had a look at the forum by searing \listoftables
http://www.latex-community.org/forum/se ... es&fid[]=5
but didn't find a solution. […]
Code: Select all
\documentclass[11pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont={bf,sf},tableposition=top]{caption}
\usepackage{tocloft}
% Formatting the lists (tocloft)
\setlength{\cftfignumwidth}{3em} % Modify number width in LoF
\setlength{\cfttabnumwidth}{3em} % Modify number width in LoT
\begin{document}
\setcounter{chapter}{9}
\listoffigures
\listoftables
\chapter{Dummy Chapter}
\setcounter{section}{9}
\setcounter{figure}{9}
\setcounter{table}{9}
\section{Dummy Section}
\begin{figure}[!ht]
\centering
\rule{6.4cm}{3.6cm}
\caption{Dummy figure}\label{fig:dummy}
\end{figure}
\begin{table}[!ht]
\caption{Dummy table}\label{tab:dummy}
\centering
\rule{6.4cm}{3.6cm}
\end{table}
\end{document}
Comment the lines that modify the number width in the LoF and LoT and you will see that it affects both.carol wrote:[…] By the way, why does it happen to the list of tables and not list of figures? […]
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: increase space between table number and caption
\usepackage{tocloft}
\setlength{\cfttabnumwidth}{3em}
before \begin{document}
I get the following message
/usr/share/texmf/tex/latex/tocloft/tocloft.sty:608:Command \c@lofdepth already defined. \newcounter{lofdepth}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
increase space between table number and caption
But in this case you have the luck that this error message is very common and occurs in combination with the subfigure or subfig package (whereby at least the first one is considered obsolete and the second one isn't maintained anymore and causes problems with hyperref). Add an option when loading the package.
Code: Select all
\usepackage[subfigure]{tocloft}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10