问题描述
嗯,这似乎很简单,但我找不到为方程式添加标题的方法.需要标题来解释方程中使用的变量,所以某种类似表格的结构来保持对齐和美观会很棒.
Well, it seems simple enough, but I can't find a way to add a caption to an equation.The caption is needed to explain the variables used in the equation, so some kind of table-like structure to keep it all aligned and pretty would be great.
推荐答案
caption
命令仅限于浮点数:您需要将方程放置在图形或表格环境中(或新的一种浮动环境).例如:
The caption
command is restricted to floats: you will need to place the equation in a figure or table environment (or a new kind of floating environment). For example:
egin{figure}
[ E = m c^2 ]
caption{A famous equation}
end{figure}
浮动的重点是让 LaTeX 确定它们的位置.如果您想让方程式出现在固定位置,请不要使用浮点数.captionof 命令"noreferrer">caption package 可用于在浮动环境之外放置标题.它是这样使用的:
The point of floats is that you let LaTeX determine their placement. If you want to equation to appear in a fixed position, don't use a float. The captionof
command of the caption package can be used to place a caption outside of a floating environment. It is used like this:
[ E = m c^2 ]
captionof{figure}{A famous equation}
如果您的文档有一个条目,这也会为 listoffigures
生成一个条目.
This will also produce an entry for the listoffigures
, if your document has one.
要对齐方程式的各个部分,请查看 eqnarray
环境,或者amsmath 包:对齐、聚集、多行...
To align parts of an equation, take a look at the eqnarray
environment, or some of the environments of the amsmath package: align, gather, multiline,...
这篇关于在 LaTeX 中为方程式添加标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!