2

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)

enter image description here

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}
2
  • consider \usepackage{tocbibind} to get rid off the \addcontentsline there
    – user31729
    Jan 2, 2017 at 13:24
  • I have added a note to my answer regarding this \addcontentsline: you have to add a \clearpage command before, since otherwise the \addcontentsline will be executed on the page of the \tableofcontents, but \listoffigures will start a new page.
    – gernot
    Jan 2, 2017 at 13:31

1 Answer 1

2

The command \cftfigfont is intended for defining the format of the entry, not for adding material. Replace the corresponding line by

\renewcommand\cftfigfont{\footnotesize}
\renewcommand\cftfigpresnum{Fig. }

then the list of figures looks as intended:

enter image description here

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.

\documentclass[a4paper, 12pt]{report}

\usepackage[titles]{tocloft}

\setlength{\cftfignumwidth}{6 em}
\setlength{\cftfigindent}{0 em}  % remove indentation from figures in lof
\renewcommand\cftfigfont{\footnotesize}
\renewcommand\cftfigpresnum{Fig. }
\renewcommand\cftfigpagefont{\footnotesize}

\begin{document}

\tableofcontents

\clearpage
\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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .