I'm writing a paper where I'm trying to repurpose the list of figures as a figure legends section. I'd like each figure to have something like "Figure X: Title" at the bottom, with list of figures entries containing "Figure X: Title", followed by the legend on a new line.
I've almost got what I want using the tocloft package with the following:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{lipsum}
\usepackage[titles]{tocloft}
\addtocontents{lof}{\cftpagenumbersoff{figure}}
\renewcommand\listfigurename{Figure Legends}
\renewcommand\cftfigpresnum{\bfseries Figure }
\renewcommand\cftfigaftersnum{\bfseries :}
\renewcommand\cftfigaftersnumb{\\}
\renewcommand{\cftdotsep}{\cftnodots}
\setlength\cftbeforefigskip{12pt}
\begin{document}
\lipsum[1]
\begin{figure}[ht]
\centering \includegraphics{image1}
\caption[Normally a much longer legend for the first figure.]{Title for first fig}
\end{figure}
\lipsum[2]
\clearpage
\listoffigures
\end{document}
Note that I've put the legend in the "short" caption and the title in the "long" caption. The one thing I haven't managed to figure out is how to have both the "short" and "long" captions in the list of figures.
I considered using the cftXaftersnum command to include the short caption as a variable, but I'm not sure how to go about doing this.
UPDATE:
The answer is brilliant, but I neglected to point out one additional requirement: I need doublecaption to cooperate with subfigures. I have one figure with two subfigures, and the counter gets double-incremented. Here's an example using the solution:
\documentclass{article}
\usepackage{amsmath}
\usepackage[demo]{graphicx}
\usepackage{lipsum}
\usepackage{subcaption}
\usepackage[titles]{tocloft}
\addtocontents{lof}{\cftpagenumbersoff{figure}}
\renewcommand\listfigurename{Figure Legends}
\renewcommand\cftfigpresnum{\bfseries Figure }
\renewcommand\cftfigaftersnum{\bfseries : }
\renewcommand{\cftdotsep}{\cftnodots}
\setlength\cftbeforefigskip{12pt}
\newlength\mylength
\settowidth\mylength{\cftfigpresnum}
\addtolength\cftfignumwidth{\mylength}
\makeatletter
\def\doublecaption{%
\ifx\@captype\@undefined
\@latex@error{\noexpand\caption outside float}\@ehd
\expandafter\@gobble
\else
\refstepcounter\@captype
\expandafter\@firstofone
\fi
{\@dblarg{\@doublecaption\@captype}}%
}
\long\def\@doublecaption#1[#2]#3{%
\par
\addcontentsline{\csname ext@#1\endcsname}{#1}%
{\protect\numberline{\csname the#1\endcsname}{\ignorespaces #3\newline#2}}%
\begingroup
\@parboxrestore
\if@minipage
\@setminipage
\fi
\normalsize
\@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
\endgroup}
\makeatother
\begin{document}
\lipsum[1]
\begin{figure}[ht]
\centering \includegraphics{image1}
\doublecaption[Normally a much longer legend for the first figure.]{Title for first fig}
\end{figure}
\lipsum[2]
\begin{figure}[ht]
\centering
\begin{subfigure}{0.45\textwidth}
\includegraphics{image2}
\caption{Case one}
\end{subfigure}
\begin{subfigure}{0.45\textwidth}
\includegraphics{image3}
\caption{Case two}
\end{subfigure}
\doublecaption[Not very long legend for fig with subfigs.]{Title for fig with subfigs}
\end{figure}
\lipsum[3]
\clearpage
\listoffigures
\end{document}
I can see in the doublecaption definition that the counter is incremented by:
\refstepcounter\@captype
I guess the subcaption package must do something to prevent double-incrementing counters, but I'm not sure how to do this. I can always just explicitly decrement the list counter after the subfigures, but before the figure's doublecaption, but I suspect there's a better way?