Latex - Inserting a reference in a figure's caption

99封情书 提交于 2019-12-09 04:32:42

问题


In Latex, I want to add a reference in the legend of a figure, like:

\begin{figure}
   ...
   \caption{This is the legend of this figure (reprinted from \cite{something}).}
   ...
\end{figure}

but the citation is not allowed to be placed in the the caption, only in the text. My bibliography is working on any other places of the text.

Any suggestions how to do this?

Thanks


回答1:


Solution found: write \protect\cite{ref} instead of just \cite{ref}

Or even shorter: '{\cite{ref}}'




回答2:


As the accepted answer seems rather hacky (and also didn't work for me) I will post my solution for the problem:

\begin{figure}
  ...
  \caption[Cap for listoffigures]{Cap below figure with cite \cite{source}}
  ...
\end{figure}

This compiles without errors and warnings.



来源:https://stackoverflow.com/questions/4487728/latex-inserting-a-reference-in-a-figures-caption

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!