嗯,看起来很简单,但我找不到一种方法来为方程添加标题。 需要使用标题来解释等式中使用的变量,所以某种类似于表格的结构使它们保持一致并且非常漂亮。

有帮助吗?

解决方案

\ caption 命令仅限于浮点数:您需要将等式放在图形或表格环境(或新的浮动环境)中。例如:

\begin{figure}
\[ E = m c^2 \]
\caption{A famous equation}
\end{figure}

花车的重点是你让LaTeX确定它们的位置。如果要使方程出现在固定位置,请不要使用浮点数。 \ captionof 命令“nofollow noreferrer”>“标题包”可用于在浮动环境之外放置标题。它的使用方式如下:

\[ E = m c^2 \]
\captionof{figure}{A famous equation}

如果您的文档有一个条目,这也会产生 \ listoffigures 的条目。

要对齐等式的某些部分,请查看 eqnarray 环境,或 amsmath 包:对齐,聚集,多行,......

其他提示

您可能需要查看 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}

与Gonzalo Medina的论坛帖子一样,第三种方式可能是:

caption 包中使用的命令的更多详细信息:这里

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top