使用时\cite 命令 页码在里面简短标题表格或图形以及命令\listoftables
,我不断收到以下一组错误消息:
./Test_Bibtex.lot:3: Argument of \blx@citeargs@i has an extra }.
<inserted text>
\par
l.3 ...{\ignorespaces Short caption (\cite [5}}{1}
Runaway argument?
5
./Test_Bibtex.lot:3: Paragraph ended before \blx@citeargs@i was complete.
<to be read again>
\par
l.3 ...{\ignorespaces Short caption (\cite [5}}{1}
很明显,.lot 文件中的页码解析似乎存在问题。
在这里您可以看到一个 MWE,其中第一个\caption
命令由于包含页码而产生错误,而第二个命令(带注释)则正常工作:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Geertz:1973,
Address = {New York},
Author = {Geertz, Clifford},
Date-Added = {2013-08-09 17:17:10 +0000},
Date-Modified = {2013-08-09 17:18:06 +0000},
Publisher = {Basic Books},
Title = {The Interpretation of Cultures. Selected essays},
Year = {1973}}
\end{filecontents}
\usepackage[style=authoryear, useprefix=true, language=english]{biblatex}
\bibliography{\jobname}
\begin{document}
\listoftables
\begin{table}[hbtp]
\centering
\begin{tabular}{ll}
\hline
w&x\\
\hline
y&z\\
\hline\\
\end{tabular}
\caption[Short caption (\cite[5]{Geertz:1973})]{A longish caption of the table, inspired by \textcite[5]{Geertz:1973}} % creates the problem, due to the page number
%\caption[Short caption (\cite{Geertz:1973})]{A longish caption of the table, inspired by \textcite{Geertz:1973}} % works, as there is no page number
\end{table}
\end{document}
关于如何实现这个功能有什么建议吗?
先感谢您!
托马斯
答案1
当在另一个命令的可选参数中使用带有可选参数的命令时,必须]
通过将内部命令括起来来保护{...}
内部命令,以便 TeX 不会认为它结束了外部参数(TeX 不会像检查那样检查此类[..]
括号的嵌套{..}
)
\caption[Short caption ({\cite[5]{Geertz:1973}})]{A longish caption ...}
还有很多类似的问题: