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.
[Tex/LaTex] Insert a bibtex reference in a figure caption
captionscitingfloats
Best Answer
The command
\cite
and its close relatives, such as\citet
and\citep
provided by thenatbib
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\protect
ed, again using LaTeX jargon.Thus, write
\protect\cite{xyz}
instead of just\cite{xyz}
. This applies irrespective of whether the\caption
instruction occurs inside afigure
or atable
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.