I met one problem with TableOfContent. The indent of the first level is not correct. For example, Chapter 1 Introduction is overlap. I guess it is the problem of \numwidth. But how to solve it. Please help. Thanks.

NEW: TikZ book now 40% off at Amazon.com for a short time.
Code: Select all
\documentclass{book}
\usepackage{tocloft}
\newlength\mylength
\settowidth\mylength{Chapter\hspace*{1em}}
\addtolength\cftchapnumwidth{\mylength}
\renewcommand\cftchappresnum{Chapter }
\begin{document}
\tableofcontents
\clearpage
\chapter{Test chapter}
\end{document}
Code: Select all
Figure 1.2 This is a table with
a long caption ......... 2
Code: Select all
Figure 1.2 This is a table with
a long caption .... 2
Code: Select all
\addtolength\cftfignumwidth{}
\cftsetindents{figure}{}{}
Code: Select all
\documentclass{article}
\usepackage{tocloft}
\renewcommand{\cfttabfont}{Table }
\begin{document}
\listoftables
\begin{table}
\begin{tabular}{l}
\textbf{Header of the table}\\
TEST \\
\end{tabular}
\caption{Some long, very long test text which should span at least one line in the list of tables}
\end{table}
\end{document}
Code: Select all
\documentclass{article}
\usepackage{tocloft}
\newlength\mylength
\settowidth\mylength{Table}
\addtolength\cfttabnumwidth{\mylength}
\renewcommand\cfttabpresnum{Table }
\begin{document}
\listoftables
\begin{table}[!ht]
\centering
\rule{4cm}{3cm}% to simulate a table
\caption{Some long, very long test text which should span at least one line in the list of tables}
\label{tab:test}
\end{table}
\end{document}
Code: Select all
\renewcommand\cfttabpresnum{Table } % Works the way I wanted
\renewcommand{\cfttabfont}{Table } % Does not work the way I wanted
You're welcome.oyvindhauge wrote:Thanks a lot for your help.
NEW: TikZ book now 40% off at Amazon.com for a short time.