[Tex/LaTex] Source of Image in List of Figures

captionssubcaptiontable of contentstocloft

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:
MWE

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 of subfigure environment. Need to compile twice.

enter image description here

Code

\documentclass[10pt,a4paper]{article}
\usepackage[list=true]{subcaption}
\usepackage[demo]{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}[hbt]
\centering
 {\caption{Caption}
    \figsource{Source}}
       \subcaptionbox{Caption1}
{\includegraphics[width=0.4\textwidth]{test1.jpg}}
        \figsource{Source1}
\subcaptionbox{Caption2}
{ \includegraphics[width=0.4\textwidth]{test1.jpg}}
        \figsource{Source2}
\end{figure}
\listoffigures
\end{document}

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.

enter image description here

\documentclass[10pt,a4paper]{article}
\usepackage[list=true]{subcaption}
\usepackage[demo]{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}
This is a test and put the caption down below the image. 

\begin{figure}[hbt]
\vspace{4cm}                            % new addon
\addtolength\abovecaptionskip{-5cm}     % new addon
\centering
 {\caption{Caption}
    \figsource{Source}}
       \subcaptionbox{Caption1}
{\includegraphics[width=0.4\textwidth]{test1.jpg}}
        \figsource{Source1}
\subcaptionbox{Caption2}
{ \includegraphics[width=0.4\textwidth]{test1.jpg}}
        \figsource{Source2}
\end{figure}
\listoffigures
\end{document}