[Tex/LaTex] How to Align The Steps to Solve a Simple Algebraic Equation with MathJax?

mathjax

I am 14, and working on depicting the steps to solve a simple algebraic equation like this: 2x – 3 = 7 with MathJax.

However, I want to align the required steps as depicted below:

Steps to solve two-step equation.

My question, therefore is how could I do this with MathJax? I tried using the Amsmath package, but couldn't get anywhere.

I need this because I am building an Android app, and I lose image quality with pictures like this.

Thank you.

Best Answer

Here is a possible code.

\begin{alignat}{2}
2x&-3&={}&7\\
&\color{red}{{}+3}&\color{red}{{}+{}}&\color{red}{3}\\
\color{blue}{\frac{\color{black}{2x}}{2}}&&={}&\color{blue}{\frac{\color{black}{10}}{2}}\\
x&&={}&\phantom{0}5
\end{alignat}
Related Question