我在 LaTeX 中有一个带有标题的图形,我需要在其中添加一个公式(equation*
或displaymath
环境)。例如:
\documentclass[12pt]{article}
\begin{document}
\begin{figure}[tbph]
\begin{center}
%...
\end{center}
\caption{As you can see
\begin{displaymath}4 \ne 5\end{displaymath}
}
\label{fig:somefig}
\end{figure}
\end{document}
这让 pdflatex 很生气,尽管它会生成 PDF。
! Argument of \@caption has an extra }.
<inserted text>
\par
l.9 }
将方程式添加到图形标题的正确方法是什么?
注意:请不要建议简单地使用$ ... $
数学环境;所示方程是一个玩具示例;我的真实方程式要复杂得多。
另见:
- 在 LaTeX 中为方程式添加标题(与此问题相反)