I want to create citations for my figures, and make the citation only appear in the list of figures as a short citation (if it wasn't cited before then it should be added to the normal \printbibliography
output as well). Generally that works fine.
However in my document if a bibliography entry wasn't cited before in normal text, it won't print the proper citation (nor does it get added to the bibliography), but only the label (?!) of the bibliography entry in bold. I can cite it before in normal text inside a \phantom
enviroment to avoid this, but that's definitely not a nice solution.
In a MWE it works fine... maybe there is something in my document I overlooked, but the common demoninator of all the cases where the label is printed instead of the citation, is the fact that they all are cited for the first time in the document (they also all have the type online
).
\documentclass{article}
\usepackage{graphicx}
\usepackage[backend=biber,style=verbose-ibid,hyperref=false]{biblatex}
\addbibresource{mwe.bib}
\newbibmacro*{shrtcite}{%
\usebibmacro{cite:citepages}%
\iffieldundef{shorthand}
{\usebibmacro{cite:short}}
{\usebibmacro{cite:shorthand}}}
\DeclareCiteCommand{\shrtcite}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{shrtcite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\begin{filecontents}{mwe.bib}
@Book{knuth1986,
Title = {The \TeX book},
Author = {Donald~Ervin Knuth},
Publisher = {Addison-Wesley},
Year = {1986}
}
\end{filecontents}
\begin{document}
\begin{figure}
\centering
\includegraphics[scale=0.2]{example-image-a}
\caption[{\shrtcite[][5]{knuth1986}}]{This is a caption}
\end{figure}
\printbibliography
\listoffigures
\end{document}
It seems rather weird to me, if anyone knows a generally different and better approach to my original goal (citations for figures only appearing in listoffigures), please help me out.