Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
7  
You should use the equation or align, etc, environments. By the way, you should never use $$ $$ for displayed equations but rather \[ \]. –  Corentin Feb 15 '13 at 19:37
add comment

2 Answers 2

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

enter image description here

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}
share|improve this answer
    
Thank you very much ! :) –  yoanab Feb 15 '13 at 19:57
2  
Why is there a \, space at the beginning of the aligned environment? might be interesting if one notices the different spacing before y = mx + b and the aligned blocks. –  Qrrbrbirlbel Feb 16 '13 at 16:31
add comment

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
\begin{equation}\label{eq:pythagoras}
a^2 + b^2 = c^2 .
\end{equation}
%  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}

enter image description here

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*"

share|improve this answer
4  
+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 –  cmhughes Feb 15 '13 at 19:55
    
Thanks a lot ! :) –  yoanab Feb 15 '13 at 19:57
    
@cmhughes Added the % and will remember to do that in my own documents from now on. –  Ethan Bolker 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. –  Qrrbrbirlbel 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). –  Toscho Mar 16 '13 at 20:16
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.