Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aligning multiple equations in MathJax

Tags:

mathjax

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
like image 390
2 revs Avatar asked Aug 23 '18 02:08

2 revs


Video Answer


1 Answers

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 the horizontal positions of = will be equal for all lines.

If you do not need such horizontal alignment, then you can use gathered environment instead of aligned environment without &.

like image 158
Naetmul Avatar answered Sep 20 '22 14:09

Naetmul