# Enumerate formulas

I'm writing a math paper in LaTeX and for math formulas I'm just using $$math formula$$. Is is possible to numerate formulas? Or do I have to you use some specific commands such as align?

For inline math use $...$ (or $$...$$). For display math style equations, if you use aligned then alignment with enumerate's \item works better:

## Code:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{enumerate}
\item \begin{aligned}[t] E &= mc^2 \\ F & = ma \end{aligned}
\item \begin{aligned}[t] E &= mc^2 \\ F & = ma \end{aligned}
\end{enumerate}
\end{document}


Vanilla displayed equation idioms:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

The \verb|equation| environment creates numbered formulas you can
label and refer to elsewhere:
%  this commented blank line prevents start of a new paragraph
$$\label{eq:pythagoras} a^2 + b^2 = c^2 .$$
%  this commented blank line prevents start of a new paragraph
Equation~\ref{eq:pythagoras} is the heart of the Pythagorean theorem.

Use the \verb|\eqref| macro to put parentheses around equation
references: \eqref{eq:pythagoras}.

For equations with no numbers, use \verb|equation*|:
%
\begin{equation*}
2 + 2 = 4 .
\end{equation*}

For multiline formulas, use \verb|align| or \verb|align*|:
%
\begin{align}
e^{i\pi} & = \cos(\pi) + i\sin(\pi) \notag \\
& = -1 .
\end{align}

\end{document}


Edit: TeX will complain if it sees a blank line before the \end of one of these environments. Debugging that error message is difficult since you tend to think that TeX automatically does the right thing with white space. See "File ended while scanning use of \align*"

• +1 I think this is what the OP was asking for. Just one edit needed- never put blank lines before a displayed equation, it throws the spacing off. Either remove them, or put in a comment symbol Feb 15 '13 at 19:55
• @cmhughes Added the % and will remember to do that in my own documents from now on. Feb 15 '13 at 20:06
• @EthanBolker To complete cmhughes’ statement: Use blank lines if you want to start a new paragraph (blank lines after displayed math is only correct if it ends a paragraph). Do not use blank lines to structure your input. Feb 16 '13 at 1:21
• You mean: "Do not use blank lines to format your source file." Of course, the input (in the sense of content) should be structured in paragraphs and therefore needs blank lines (or \pars). Mar 16 '13 at 20:16
• @Kusavil Search for "numberwithin" at en.wikibooks.org/wiki/LaTeX/Advanced_Mathematics Jan 25 '18 at 19:23