看起来很简单,但我找不到一种方法来为方程添加标题。 需要标题来解释方程中使用的变量,因此保持所有内容对齐和美观的表格结构将会很好。
看起来很简单,但我找不到一种方法来为方程添加标题。 需要标题来解释方程中使用的变量,因此保持所有内容对齐和美观的表格结构将会很好。
\caption
命令只能用于浮动体:您需要将方程式放置在一个图形或表格环境中(或者是一种新的浮动环境)。例如:
\begin{figure}
\[ E = m c^2 \]
\caption{A famous equation}
\end{figure}
\captionof
命令可用于将标题放置在非浮动环境之外。使用方法如下:\[ E = m c^2 \]
\captionof{figure}{A famous equation}
\listoffigures
的话。eqnarray
环境 或者 amsmath 包的一些环境:align、gather、multiline 等等。\listoffigures
中添加一个不需要的条目是这种方法的致命缺陷。 - WolfLink就像Gonzalo Medina在论坛帖子中所述,第三种方法可能是:
\documentclass{article}
\usepackage{caption}
\DeclareCaptionType{equ}[][]
%\captionsetup[equ]{labelformat=empty}
\begin{document}
Some text
\begin{equ}[!ht]
\begin{equation}
a=b+c
\end{equation}
\caption{Caption of the equation}
\end{equ}
Some other text
\end{document}
caption
包中使用的命令的更多细节: 这里。caption*
代替caption
:\caption*{公式5:我的文本}
- MattS你可能需要查看http://tug.ctan.org/tex-archive/macros/latex/contrib/float/,它允许您使用\newfloat
定义新的浮动体。
我这么说是因为标题通常应用于浮动体上。
直接编写的方程(使用$ ... $
、$$ ... $$
、begin{equation}...
)是行内对象,不支持\caption
。
可以在\begin{document}
之前使用以下片段实现此目的。
\usepackage{float}
\usepackage{aliascnt}
\newaliascnt{eqfloat}{equation}
\newfloat{eqfloat}{h}{eqflts}
\floatname{eqfloat}{Equation}
\newcommand*{\ORGeqfloat}{}
\let\ORGeqfloat\eqfloat
\def\eqfloat{%
\let\ORIGINALcaption\caption
\def\caption{%
\addtocounter{equation}{-1}%
\ORIGINALcaption
}%
\ORGeqfloat
}
在添加方程时,请使用类似于以下的内容
\begin{eqfloat}
\begin{equation}
f( x ) = ax + b
\label{eq:linear}
\end{equation}
\caption{Caption goes here}
\end{eqfloat}