16

Is there any reason why I should use equation when I align seems to produce the same output?

The reason I am asking is that I like solving math using LaTeX. Sometimes I write a single equation using the equation environment, but later realise I need to include more equations aligned to the first in that same environment. Then I need to change the

\begin{equation}
\end{equation}

to

\begin{align}
\end{align}

and include the &s as appropriate.

I am thinking then: why not always use align, maybe even including the & before the equal sign, just in case I need to include more stuff there later? If they behave the same, and one is more flexible, why use the other at all? Or are there differences and reasons why I should avoid using align when there is a single equation?

The Amplitwist
  • 71
  • 1
  • 18
Vivi
  • 26,953
  • 31
  • 77
  • 79

1 Answers1

15

Say you want to split equations, then you need to use equation+split and align can't be used with split.

EDIT: This MWE shows why align can not be used to split an equation and split should be used.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
%-------------------------------------------------
We use \verb|split| with \verb|\equation| environment to split this equation:
%=============================
\begin{equation}\label{eq:grscope4}
  \begin{split}
      \Delta p_{x} &= \left[ {\left( {\frac{h}{\lambda }\sin \alpha } \right)
                         - \left( { - \frac{h}{\lambda }\sin \alpha } \right)} \right]
                         + \left( {\frac{h}{\lambda }\sin \alpha } \right)\\[4pt]
                   & \phantom{==} - \left( {\frac{h}{\lambda }\sin \alpha } \right)
 \end{split}
\end{equation}
%=============================
The number comes at the center of two equation.

We use \verb|align| to split the equation now:
%=============================
\begin{align}
\Delta p_{x} &= \left[ {\left( {\frac{h}{\lambda }\sin \alpha } \right)
                         - \left( { - \frac{h}{\lambda }\sin \alpha } \right)} \right]
                         + \left( {\frac{h}{\lambda }\sin \alpha } \right)\\[4pt]
                   & \phantom{==} - \left( {\frac{h}{\lambda }\sin \alpha } \right)
\end{align}
%=============================
We get two numbers. To suppress one of them we say \verb|\nonumber|,
see the difference below:
%=============================
\begin{align}
\Delta p_{x} &=  \left[ {\left( {\frac{h}{\lambda }\sin \alpha } \right)
                         - \left( { - \frac{h}{\lambda }\sin \alpha } \right)} \right]
                         + \left( {\frac{h}{\lambda }\sin \alpha } \right)\\[4pt]
                    & \phantom{==} - \left( {\frac{h}{\lambda }\sin \alpha } \right) \nonumber
\end{align}
%=============================
The \verb|\nonumber| is not effective in the first line where we wanted to suppress the number. 
Instead it works in the last line only. Hence equation numbering becomes a mess.
%-------------------------------------------------
\end{document}

enter image description here

If the equation has to be split in more than two lines this situation worsens further if one is using align.

Conclusion equation can not be completely sacrificed for align.

  • 1
    I had never heard of equation+split. I will look it up... – Vivi Mar 27 '12 at 01:56
  • 1
    It seems to me the main issue is spacing. It makes a big difference to use equation instead of align, as explained in the duplicate question linked above. – Vivi Mar 27 '12 at 02:03
  • @Vivi That is true. since it is discussed in the link, I did not mention. I will try to provide a MWE for split later today. –  Mar 27 '12 at 02:10
  • the question is going to be closed as a duplicate, and in any case I googled and I think I understand (you can get one number in the center when using split) – Vivi Mar 27 '12 at 02:34
  • 2
    @Vivi: The amsmath documentation has some nice examples on how to use split and other environments. I actually use it more than align these days, and you can use multiple splits in one equation, allowing some quite elaborate stuff. – qubyte Mar 27 '12 at 03:01
  • @Vivi, That is right. I think now it is clear. –  Mar 27 '12 at 03:56
  • 1
    @Vivi, See the MWE. –  Mar 27 '12 at 04:27
  • My first use of split today :) – Vivi Apr 02 '12 at 05:13
  • @Harish Kumar: Nice answer - unfortunately the question is closed. Will you copy it to http://tex.stackexchange.com/questions/321/align-vs-equation , where no one else has made that point. – hpekristiansen Dec 14 '12 at 06:25
  • @Hans-PeterE.Kristiansen: Thanks for the kind words. I have added a link to the question you mentioned. :-) –  Dec 14 '12 at 13:04
  • @GarbageCollector Just wanted to push things little towards right so that - comes after the bracket. Only personal taste. –  Jan 28 '13 at 13:55
  • you can use \notag instead and the number will come out correctly in the align environment – daaxix Aug 12 '14 at 18:49
  • 1
    You can do the same trick using align + aligned. – João Victor Bateli Romão Jun 14 '18 at 14:35
  • Why do you say that align doesn't work with split? The documentation clearly states that it does. – Y.T. Apr 08 '23 at 04:17