22

Is there a way to align multiple equations so the equators are underneath each other using MathJax?

For example:
 2x - 4 = 6
     2x = 10
      x = 5
bmt24
  • 259
  • 1
  • 3
  • 6

1 Answers1

45

Use the aligned environment and the & symbol.

e.g.

$$\begin{aligned} 2x - 4 &= 6 \\ 2x &= 10 \\ x &= 5 \end{aligned}$$

I inserted & in front of = of each line so that the horizontal positions of =s will be the same for all the lines.

If you do not need such horizontal alignment, you can use gathered environment instead of aligned environment without &. It will horizontally center all the lines.

Naetmul
  • 14,544
  • 8
  • 57
  • 81