[英]LaTeX: cite with [ ] argument in caption
我需要“数字列表”中列出的图像来源。 为此,我想在标题参数中引用:
这有效:
\caption[Plan,\protect\cite{damluji1992}]{Plan}
这也有效,但我需要在标题参数中使用它,如下例所示:
\cite[p.156]{damluji1992}
我需要这个不起作用:
\caption[Plan,\protect\cite[p.156]{damluji1992}]{Plan}
它给了我错误“\HAR@dcite 的参数有一个额外的}。” 在 *.lof 文件中,对应的行如下所示:
\contentsline {figure}{\numberline {2}{\ignorespaces Plan, \cite [S.156}}{5}{figure.caption.4}
-> { } 中的 cite 参数丢失!
如果没有 [ ] 中的 cite 参数,它看起来像这样:
\contentsline {figure}{\numberline {2}{\ignorespaces Plan, \cite {damluji1992}}}{5}{figure.caption.4}
我在这个页面上偶然发现了同样的问题,然后在http://www.latex-community.org/forum/viewtopic.php?f=50&t=6225找到了答案
解决方案:在 cite 命令周围加上花括号:
{\cite[Theorem~2]{mEtAl}}
这是必要的原因是您在另一个可选 [] 参数中有一个可选 [] 参数。
在序言中:
\usepackage{caption}[2011/11/10]
\newcommand{\figsource}[1]{%
\addtocounter{figure}{-1}
\captionlistentry{source: #1}
}
在文档中:
\begin{figure}
\includegraphics...
\caption{whatever}
\figsource{whatever-source}
\end{figure}
产生:
图列表
1.1 随便。 . . . . . . . 29
1.1 任何来源:. . . . 29
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.