[Tex/LaTex] Insert a bibtex reference in a figure caption

captionscitingfloats

I want to add some citation references to a figure caption in a way that only the reference number appears in the caption [Ref number], for example. I also want to know if it is applicable in table captions as well.

Best Answer

The command \cite and its close relatives, such as \citet and \citep provided by the natbib package are "fragile", in the LaTeX-specific sense of the word. If a \cite instruction needs to occur in the argument of a \caption instruction (and other directives with "moving arguments"), it needs to be \protected, again using LaTeX jargon.

Thus, write \protect\cite{xyz} instead of just \cite{xyz}. This applies irrespective of whether the \caption instruction occurs inside a figure or a table instruction.

Incidentally, the format of the citation call-out -- numeric, authoryear, or whatever -- is determined by the bibliography style and any citation management package you may be loading.