Taking THIS question one step further, and given the dialogue with Christian Hupfer following THIS question, the following code is a minimum example of what I have done so far in oder to condense many adjacent similar plots into a single line in the list of figures.
In the below, what was originally 12 lines, is now reduced to 1 line, with the figure number replaced by a range of numbers, and similarly for the page numbers. The hyperlink points to the first image in the series.
Things to bear in mind, are the increased width required in the numberline, and also, the additional right margin required to accommodate a range of page numbers (bit over twice the width ordinarily required).
I would like to know if there is a better way to do this, in order to replace the use of the addtocontents
macro used inside the custom addfigurerange
macro used below.
Additional functionality which would be awesome, would be to append to the line item a count of the number of images in the range like for example, the below entry could become: Plots at temperatures of 1400 -- 300K (12x Figures). This is of course trivial to do manually, but it would be great if the count could be automated as part of the macro.
\documentclass{memoir}
\usepackage{hyperref}
\usepackage{pgffor}
\usepackage{caption}
\usepackage[demo]{graphicx}
\setpnumwidth{10mm}
\setrmarg{12mm}
\makeatletter
\renewcommand*\l@figure{\@dottedtocline{1}{1em}{6em}}
\makeatother
%% First argument is the line to add to the LOF,
%% 2nd and 3rd arguments are the start and finish labels in the range
\newcommand\addfigurerange[3]{%
\addtocontents{lof}{
\protect\contentsline
{figure}
{\numberline{\getrefnumber{#2} -- \getrefnumber{#3}}{\ignorespaces #1}}
{\getpagerefnumber{#2} -- \getpagerefnumber{#3}}
{\getrefbykeydefault{#2}{anchor}{}}%
}%
}
\begin{document}
\listoffigures
\clearpage
\chapter{First Chapter}
\foreach \x in {1400, 1300, 1200, 1100, 1000, 900, 800, 700, 600, 500, 400, 300}{
\begin{figure}[p]
\captionsetup{list=no}%
\includegraphics[width=\linewidth,height=10cm]{dummy}
\caption{Some Plot at a Temperature of \x{}K}\label{fig:\x}
\end{figure}
}
\addfigurerange{Plots at temperatures of 1400 -- 300K}{fig:1400}{fig:300}
\end{document}
This produces the following result.
\documentclass
and also\setpnumwidth
undefined.