got*_*nes 6 latex mathematical-typesetting
我在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}
Run Code Online (Sandbox Code Playgroud)
这使得pdflatex生气,虽然它会产生PDF.
! Argument of \@caption has an extra }.
<inserted text>
\par
l.9 }
Run Code Online (Sandbox Code Playgroud)
将方程式添加到数字标题的正确方法是什么?
注意:请不要建议只使用$ ... $数学环境; 显示的等式是玩具示例; 我真实的等式更复杂.
另见:
小智 8
使用包"标题":
\begin{figure}
\begin{center}
...
\captionsetup{singlelinecheck=off}
\caption[.]{
\begin{displaymath}
assoc\_meaning(\lambda x_{SBJ}. followed(x,y) \&actor(x) \nonumber \&actor(y),\lambda x_{SBJ}. maintained(x,\nonumber <(dist\_from(y),1))
\end{displaymath}}
\end{center}
\end{figure}
Run Code Online (Sandbox Code Playgroud)
下面的方括号\caption 不是可选的,但让他们断不会引起看起来比任何一个不同的你加入之前的错误\usepackage{caption}和\captionsetup{...}.
我不知道为什么你不想使用这个$ ... $解决方案,因为分数?
如果是这样,您可以使用\dfrac代替\frac.
我会尝试$ \displaystyle \dfrac{1}{2} \cdot \sum_{i=0}^n i$,即使用\displaystyle命令。