4

I want to remove the gap between the figures of different chapters in my table of figures. I have a screenshot here:

enter image description here

Is there some kind of command to disable the gap? I'm not sure what kind of MWE I can give, as its the table of figures in a large document.

3

Here is a solution for book.cls

The gap is introduced by the \chapter command (actually \@chapter`), using

\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%

each time a new chapter is set up, i.e. vertical space (the gap!) is set to the relevant .lof or .lot file.

This can be patched out with \xpatchcmd{}, replacing the commands in \@chapter with 'nothing'.

\documentclass{book}


\usepackage{xpatch}

\makeatletter
\xpatchcmd{\@chapter}{%
  \addtocontents{lof}{\protect\addvspace{10\p@}}%
  \addtocontents{lot}{\protect\addvspace{10\p@}}%
}{}{}{}
\makeatother


\begin{document}

\listoffigures

\chapter{First}
\begin{figure}
\caption{Dummy figure}
\end{figure}

\begin{figure}
\caption{Dummy figure}
\end{figure}

\chapter{Second}
\begin{figure}
\caption{Dummy figure}
\end{figure}


\end{document}

enter image description here

  • I think there is a tocloft based solution too – user31729 Oct 29 '15 at 15:29
2

If you are using a KOMA-Script class (scrbook or srcreprt) you can use the option listof=nochaptergap to disable the gap:

\documentclass[listof=nochaptergap]{scrbook}
\usepackage[ngerman]{babel}
\begin{document}

\listoffigures
\chapter{First}
\captionof{figure}{Eine Abbildung}
\captionof{figure}{Eine zweite Abbildung}

\chapter{Second}
\captionof{figure}{Eine Abbildung im zweiten Kapitel}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.