# Why is my list of figures all on one line?

Today I got the idea that I need a list of "things" in my document. I don't have any figures so I planned to use the list of figures feature. Here is the MWE:

\documentclass[letterpaper,11pt,pagesize=pdftex,openright,headings=twolinechapter,chapterprefix=true]{scrbook}

\begin{document}

\frontmatter

\mainmatter

\backmatter

\listoffigures

\end{document}


When I process the document, I get a list of figures that looks like this:

No line returns. I can't figure out what I am doing wrong. All the examples I have seen from various sources have a nice numbered list with the page numbers tabbed to the right ... which is pretty much exactly what I would like.

I have another problem that in my real document something is putting addvspace, but because there is not end of the paragraph, LaTeX complains about the addvspace when not between paragraphs. I think if I can fix the above, then this problem with addvspace will go away.

• The second argument of the \addcontentsline macro should be figure. Try \addcontentsline{lof}{figure}{/api/FOO}.
– GuM
Nov 15 '17 at 20:14
• You probably want to use \addcontents, unless you want the page number at the end of each line. Nov 15 '17 at 20:18
• @GuM changing to figure worked. Kormylo the addcontents give me "not defined". Nov 15 '17 at 20:27
• Oops, \addtocontents. Nov 15 '17 at 21:54

The second argument of the \addcontentsline macro should be figure. For example, this code

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly
% declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.

\begin{document}

\listoffigures

\end{document}


produces this output:

• Thanks for the answer. And may I add .... the documentation and error messages are ABYSMAL. Nov 15 '17 at 20:28
• @AgilePro: In what sense, “abysmal”? What documentation are you reading?
– GuM
Nov 15 '17 at 20:31
• See source2e.pdf from CTAN. Nov 15 '17 at 21:55
• @JohnKormylo: I assume you are referring to the comments that accompany the definition of the \addcontentsline macro; well, they are terse, but exact.
– GuM
Nov 15 '17 at 22:01

tocloft is a package which allows to decide list of ... aspect, but also allows an easy declaration of new table of whatever. Following its documentation I've managed to do following example:

\documentclass[letterpaper, 11pt, pagesize=pdftex, openright, headings=twolinechapter, chapterprefix=true]{scrbook}

\usepackage{tocloft}