How to Get Thumbnails in a List of Figures

graphicstable of contents

To be honest, I'm not sure if I really want this because I can't imagine how exactly it would look. But maybe someone is interested in this, too, or even has already written code to achieve this: it might be practical or interesting to have small thumbnail previews of a figure in the list of figures next to the caption.

This has already been briefly discussed here List of figures: source below image caption? but without any result so if anybody wants to give it a shot or has already done so: yay! 🙂


See Heiko's answer for an example image of how this might look.

Best Answer

Macro \addtocontents allows something to put into the list of figures:

\begin{figure}
  \includegraphics{myimage}
  \caption{My figure caption}
  \addtocontents{lof}{%
    \protect\centerline{%
      \protect\includegraphics[width=.25\linewidth]{myimage}%
    }%
  }%
\end{figure}

Variant with vertically centered image between number of figure and caption text:

\documentclass{article}
\usepackage{graphicx}
\newlength{\lofthumbsize}
\setlength{\lofthumbsize}{2em}

\newif\iflofimage
\DeclareRobustCommand*{\lofimage}[2][]{%
  \iflofimage
    $\vcenter to \lofthumbsize{\vss%
      \hbox to \lofthumbsize{\hss\includegraphics[{width=\lofthumbsize,height=\lofthumbsize,keepaspectratio=true,#1}]{#2}\hss}%
    \vss}$%
    \quad
  \fi
  \ignorespaces
}
\begin{document}
\lofimagetrue
\listoffigures
\lofimagefalse
\begin{figure}
  \caption{\lofimage{foo}Hello World}
\end{figure}
\begin{figure}
  \caption{\lofimage{bar}Foobar}
\end{figure}
\end{document}

This looks like this:

example list of figures