# Multiline equation with specific indentation style

I have a multiline equation of the following type:

$$\begin{split} f(x,y) & =a\\ & =b\\ & +c\\ & +d. \end{split}$$


But the output I would like to have is as follows:

 f(x,y) = a
= b
+ c
+ d


That is, the lines continuing the sum shall have additional indentation, that is, the +'s shall not be directly below the "=". Whatever I tried didn't work as intended. Do you have any suggestions as of how to accomplish this?

-

A simple solution with \phantom command:

$$\begin{split} f(x,y) & =a\\ & =b\\ &\phantom{=}\, +c\\ &\phantom{=}\, +d. \end{split}$$


gives:

This is the better looking alignment, in my opinion. Anyway, you can adjust it with spacing commands. For example, the following code

$$\begin{split} f(x,y) & =a\\ & =b\\ &\phantom{=}\, +c\\ &\quad +d\\ &\phantom{=}\; +e. \end{split}$$


produces:

As you can see, a little spacing is added in consecutive lines.

-
I typically use \quad with is roughly of the size of \phantom{=}. – Bruno Le Floch Jul 10 '13 at 0:15

You can just "flip around" the use of the alignment character &:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
$$\begin{split} f(x,y) & =a \\ & =b \\ & +c \\ & +d. \end{split}$$

$$\begin{split} f(x,y) ={}& a\\ ={}& b \\ & {}+c \\ & {}+d. \end{split}$$
\end{document}


The additional empty groups {} ensure the correct spacing around binary operators/relations. If you wish the alignment of the +s to be more aligned with the RHS of the equations above, you could also use:

$$\begin{split} f(x,y) ={}& a\\ ={}& b \\ & \mskip-\medmuskip +c \\ & \mskip-\medmuskip +d. \end{split}$$


which removes the space around the binary operator +.

-

While @Werner's answer works well for your particular case, if you actually need two (or more) explicit lines of alignment, you can use the alignedat environment:

\documentclass{report}
\usepackage{amsmath}
\begin{document}
\begin{alignedat}{2} f(x) & ={} && a \\ & ={} && b \\ & && + c \\ & && + d. \end{alignedat}
\end{document}


(I do not include the picture, since the result is exactly the same as in Werner's answer; the trick with \mskip/\medmuskip can be applied as well).

-