I need to have my sources, for example from image files, in my list of figures.
\documentclass[10pt,a4paper]{article}
\usepackage[list=true]{subcaption}
\usepackage{graphicx}
\usepackage{tocloft}
\setcounter{lofdepth}{2}
\makeatletter
\newcommand{\figsourcefont}{\footnotesize}
\newcommand{\figsource}[1]{%
\addtocontents{lof}{%
{\leftskip\cftfigindent
\advance\leftskip\cftfignumwidth
\rightskip\@tocrmarg
\figsourcefont#1\protect\par}%
}%
}
\makeatother
\begin{document}
test
\begin{figure}[h]
\centering
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{test1.jpg}
\caption{Caption1}
\figsource{Source1}
\end{subfigure}%
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{test1.jpg}
\caption{Caption2}
\figsource{Source2}
\end{subfigure}
\caption{Caption}
\figsource{Source}
\end{figure}
\listoffigures
\end{document}
Which gives me something like this:
Problem:
I need to have the Source-Captions right under the entry, with subfigures It's totally messed up.
What I need:
List of Figures
1 Caption ............................................. 1
URL: http://tex.stackexchange.com
(a) Caption1 ..................................... 2
URL: http://tex.stackexchange.com
(b) Caption2 ..................................... 3
Hope somebody can help me,
thanks,
Best Answer
This may not be perfect in a sense that figure caption is on top. But it has the main feature OP needs.
\subcaptionbox
command is used instead ofsubfigure
environment. Need to compile twice.Code
Update: The OP wishes to put the caption at the bottom. So this is a workaround adding two code snippets, where
\abovecaptionskip
is modified to move the caption to bottom of the image.