2008-09-29 99 views
38

好吧,它似乎很简单,但我找不到方法为方程添加标题。 标题是需要解释方程中使用的变量,所以某种类似桌子的结构,以保持它的所有对齐和漂亮会很好。在LaTeX中为方程添加标题

+0

通过等式,你的意思是一个定理吗? – dmckee 2008-09-29 16:36:30

回答

38

\caption命令只限于花车:你需要的地方数字或表格环境中的等式(或新的浮动环境)。例如:

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

浮点的问题是你让LaTeX决定它们的位置。如果你想方程出现在一个固定的位置,不要使用浮动。 caption package\captionof命令可用于在浮动环境之外放置标题。它是这样使用:

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

这也将产生的\listoffigures项时,如果您的文档有一个。

要对齐的方程部分,看一看的eqnarray environment,或一些amsmath包的环境:对齐,收集,多行...

8

你可能想看看http://tug.ctan.org/tex-archive/macros/latex/contrib/float/,它允许您使用​​

定义新的花车我这样说是因为字幕通常适用于浮动。

直线前进方程(用$ ... $,$$ ... $$,begin{equation}...编写的方程)是不支持\caption的内嵌对象。

这是可以做到用以下snippet之前\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} 
0

在本forum post by 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中使用的命令的:here