LaTeX:在标题中引用 [ ] 参数

发布于 2024-11-03 15:46:24 字数 701 浏览 13 评论 0原文

我需要“图表列表”中列出的图像来源。 为此,我想在标题参数中引用:

这有效:

\caption[Plan,\protect\cite{damluji1992}]{Plan}

这也有效,但我需要在标题参数中使用它,如下一个示例:

\cite[p.156]{damluji1992}

我需要这个不起作用:

\caption[Plan,\protect\cite[p.156]{damluji1992}]{Plan}

它给了我错误“Argument of \ HAR@dcite 有一个额外的}。” 在 *.lof 文件中,相应的行如下所示:

\contentsline {figure}{\numberline {2}{\ignorespaces Plan, \cite [S.156}}{5}{figure.caption.4}

-> { } 中的引用参数丢失!

如果没有 [ ] 中的 cite 参数,它看起来像这样:

\contentsline {figure}{\numberline {2}{\ignorespaces Plan, \cite {damluji1992}}}{5}{figure.caption.4}

I need the source of images listed in the "list of figures".
To do this I want to cite inside the caption argument:

This works:

\caption[Plan,\protect\cite{damluji1992}]{Plan}

This works too but i need it in the caption argument like in the next example:

\cite[p.156]{damluji1992}

I need this which doesn't work:

\caption[Plan,\protect\cite[p.156]{damluji1992}]{Plan}

it gives me the error "Argument of \HAR@dcite has an extra }."
In the *.lof file the corresponding line looks like this:

\contentsline {figure}{\numberline {2}{\ignorespaces Plan, \cite [S.156}}{5}{figure.caption.4}

-> the cite argument in { } is missing!

Without the cite argument in [ ] it looks like this:

\contentsline {figure}{\numberline {2}{\ignorespaces Plan, \cite {damluji1992}}}{5}{figure.caption.4}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

昔日梦未散 2024-11-10 15:46:25

我偶然发现这个页面有同样的问题,然后在 http://www.latex-community.org/forum/viewtopic.php?f=50&t=6225

解决方案:将大括号放在 cite 命令周围:

{\cite[Theorem~2]{mEtAl}}

这是必要的原因是您在另一个可选 [] 参数内有一个可选 [] 参数。

I stumbled on this page with the same question and then found the answer at http://www.latex-community.org/forum/viewtopic.php?f=50&t=6225

The solution: put curly braces around the cite command:

{\cite[Theorem~2]{mEtAl}}

The reason this is necessary is that you have an optional [] argument inside another optional [] argument.

梦境 2024-11-10 15:46:25

在序言中:

\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

In preamble:

\usepackage{caption}[2011/11/10]

\newcommand{\figsource}[1]{%
  \addtocounter{figure}{-1}
  \captionlistentry{source: #1}
 }

in document:

\begin{figure} 
  \includegraphics...
  \caption{whatever}
  \figsource{whatever-source}
\end{figure}

produces:

List of Figures

1.1 whatever . . . . . . . . 29

1.1 whatever-source: . . . . 29

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文