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 want that latex always puts a number behind an equation that I created with $$ $$, but not when I did it with $ $. Is this possible?

share|improve this question
3  
Use \begin{equation} ... \end{equation} instead of the outdated $$ ... $$ and LaTeX will do just what you want. See tex.stackexchange.com/questions/503/why-is-preferable-to and tex.stackexchange.com/questions/98397/enumerate-formulas/… –  Ethan Bolker Mar 30 at 15:18
    
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  Andrew Swann Mar 30 at 15:36
2  
Note that $ ... $ creates inline rather than displaystyle formulas. You'll therefore never get a numbered, display-style equation anyway if you use $ ... $. For more information on how to create unnumbered and numbered displaystyle equations, see the answers to the posting What are the differences between $$, [, align, equation and displaymath? –  Mico Mar 30 at 16:18
    
I see you deleted your other question. I was about to post an answer that you may find interesting, but can't do it since one can't post answers to deleted postings. If you want, send me an email at "loretan.mico@gmail.com" and I'll write back with the answer. I will delete this comment in a little while. –  Mico Aug 16 at 22:18

1 Answer 1

up vote 9 down vote accepted

You should not use $$ $$ with LaTeX: it's a plainTeX command, and you have incorrect vertical spacings; it's replaced with \[ \]. If you want numbers with displayed equations, use \begin{equation} \end{equation} for just one equation, and, from the amsmath package, \begin{gather} \end{gather} for a group of centred displayed equations.

If you want several equations with one alignment point, use \begin{align} \end{align}, also from amsmath. You'll find the description of other equation environments in the ams documentation (alignat, flalign, multline, &c.).

Between successive equations in all these environments, you can put some text with the \intertext command, or the \shortintertext command from the mathtools package if you find vertical spacing for these short pieces of text is too big.

Incidentally, if you load mathtools, you don't have to load amsmath since it loads and extends amsmath.

share|improve this answer
    
The gatherenvironment is also from amsmath. –  pst Mar 30 at 19:51
    
It was implicit. I add that to my answer. –  Bernard Mar 30 at 20:23

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.