i want to print the source for my used images in the list of figures. So i tried adding the \cite command to the optional paramter of \caption.
This seems to work fine, but if the cited source is not cited anywhere else in the document (as for a wikipedia image for example) then it just prints the citation key instead of the citation itself in the list of figures.
Here is a minimal working example. Uncomment the commented line and it will show the correct citation in the list of figures.
i also attached two images showcasing the 2 results.
if there is any information needed, please comment.
// Edited to clarify the question
\documentclass{article}
\usepackage{filecontents}
\usepackage[demo]{graphicx}
\usepackage{url}
\usepackage[backend=biber,style=authoryear]{biblatex}
\begin{filecontents*}{test.bib}
@misc{test.2016,
author = {{Test Author}},
title = {Test Title},
year = {2016}
}
\end{filecontents*}
\addbibresource{test.bib}
\begin{document}
% Comment out the following line and it breaks
% Test content \cite{test.2016}
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{testimage}
\caption[Source: \cite{test.2016}]{My Caption}
\end{figure}
\listoffigures
\end{document}



\newcommand{\citecaption}[2]{\caption[Source: \cite{#1}]{#2}\phantom{\cite{#1}}\vspace{-0.4cm}}usage:
– Jan Oechsler Sep 29 '16 at 13:58\citecaption{cite.key}{Caption}\nocitebefore or after the\captioncommand. – moewe Sep 29 '16 at 14:12