I have several long figure titles which span over multiple lines in the list of figures. How can I remove the indentation of the first line? I tried \setlength{\cftfignumwidth}{6 em}
but this changes the spacing for all lines of the entry. (see below – NB. I would like to keep the full titles and so using a short title is not an option)
MWE:
\documentclass[a4paper, 12pt]{report}
\usepackage[titles]{tocloft}
\setlength{\cftfignumwidth}{6 em}
\setlength{\cftfigindent}{0 em} % remove indentation from figures in lof
\renewcommand{\cftfigfont}{\footnotesize{Fig. }}
\renewcommand\cftfigpagefont{\footnotesize}
\begin{document}
\tableofcontents
\addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures
\newpage
\begin{figure}[h!]
\caption{This figure has an extremely long title spanning more than one line in the list of figures}
\end{figure}
\begin{figure}[h!]
\caption{This figure has a short title}
\end{figure}
\end{document}
Best Answer
The command
\cftfigfont
is intended for defining the format of the entry, not for adding material. Replace the corresponding line bythen the list of figures looks as intended:
Note that you have to precede the
\addcontentsline
for the list of figures by a\clearpage
command, otherwise the toc entry for the list of figures will show the wrong page number.