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?


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.

  • The gatherenvironment is also from amsmath. – pst Mar 30 '14 at 19:51
  • It was implicit. I add that to my answer. – Bernard Mar 30 '14 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy