嗯,这似乎很简单,但我找不到一种方法来为方程添加标题.需要使用标题来解释方程中使用的变量,所以某些类似于表格的结构使它们保持一致并且非常漂亮.
Bru*_*ine 45
该\caption命令仅限于浮点数:您需要将等式放在图形或表格环境(或新的浮动环境)中.例如:
\begin{figure}
\[ E = m c^2 \]
\caption{A famous equation}
\end{figure}
Run Code Online (Sandbox Code Playgroud)
花车的重点是让LaTeX确定它们的位置.如果要使方程出现在固定位置,请不要使用浮点数.标题包的\captionof命令可用于在浮动环境之外放置标题.它是这样使用的:
\[ E = m c^2 \]
\captionof{figure}{A famous equation}
Run Code Online (Sandbox Code Playgroud)
\listoffigures如果您的文档有一个条目,这也将生成一个条目.
要对齐等式的各个部分,请查看eqnarray环境或amsmath包的某些环境:对齐,聚集,多行,......
Mat*_*gro 10
正如在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}
Run Code Online (Sandbox Code Playgroud)
上面代码的输出截图:
你可能想看一下 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
}
Run Code Online (Sandbox Code Playgroud)
并且在添加等式时使用类似的东西
\begin{eqfloat}
\begin{equation}
f( x ) = ax + b
\label{eq:linear}
\end{equation}
\caption{Caption goes here}
\end{eqfloat}
Run Code Online (Sandbox Code Playgroud)