# aligning split equation

I am new to Latex ;) I split my equation like this:

$$\begin{split} \tilde{m}=P\tilde{M} \\ \quad = K(R^1R^2R^3t) \begin{pmatrix} X \\ Y \\ 0 \\ 1 \end{pmatrix} \\ \quad= K(R^1R^2t)\begin{pmatrix} X \\ Y \\ 1 \end{pmatrix} \\ \quad= H \begin{pmatrix} X \\ Y \\ 1 \end{pmatrix} \end{split}$$


which gives me this:

but, actually, I want it to be aligned like this:

How do I align them so it looks like the right side is always aligned? Thanks

-

## 1 Answer

You just need to set an ampersand as alignment marker before the equal sign:

$$\begin{split} \tilde{m}&= P\tilde{M} \\ &= K(R^1R^2R^3t) \begin{pmatrix} X \\ Y \\ 0 \\ 1 \end{pmatrix} \\ &= K(R^1R^2t)\begin{pmatrix} X \\ Y \\ 1 \end{pmatrix} \\ &= H \begin{pmatrix} X \\ Y \\ 1 \end{pmatrix} \end{split}$$

-