问题描述
嗯,这似乎很简单,但是我找不到一种为公式添加标题的方法.需要使用标题来解释方程式中使用的变量,因此使表保持一致和美观的某种表状结构将是很好的.
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:
\begin{figure}
\[ E = m c^2 \]
\caption{A famous equation}
\end{figure}
浮点数是让LaTeX确定其位置.如果要使方程式显示在固定位置,请不要使用浮点数. 字幕包的\captionof
命令可用于在浮动环境之外放置字幕.它的用法是这样的:
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中为方程式添加标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!