Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a caption to an equation in LaTeX

Tags:

latex

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.

like image 985
Farinha Avatar asked Sep 29 '08 16:09

Farinha


People also ask

How do you insert an equation caption in Word?

Select the object (table, equation, figure, or another object) that you want to add a caption to. On the References tab, in the Captions group, click Insert Caption. In the Label list, select the label that best describes the object, such as a figure or equation.


1 Answers

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} 

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} 

This will also produce an entry for the \listoffigures, if your document has one.

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,...

like image 125
Bruno De Fraine Avatar answered Oct 05 '22 18:10

Bruno De Fraine