# How to not have an equation in the first line using the align environment?

Here is my code:

 \begin{align*}
(a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|}
&=(a-bx-by)e^{-\frac{1}{4}((x-y)^2+(x+y)^2)(1+c)+\frac{1}{2}(1-c)(x+y)(y-x)}\\
&=(a-bx-by)e^{-(x^2+cy^2)} \\
&=f(x,y).
\end{align*}


I have a long equation. My question is as follows: I want to isolate the expression

 (a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|}


on the first line so that I don't have an equation on the first line and I want this expression left justified with the other lines (that have the equal sign). How can I do this?

-
You should consider accepting one of the answers. –  Svend Tveskæg Jan 18 '14 at 17:55

You can also use \MoveEqLeft from the mathtools package:

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{align*}
\MoveEqLeft (a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|}\\
&= (a-bx-by)e^{-\frac{1}{4}((x-y)^2+(x+y)^2)(1+c)+\frac{1}{2}(1-c)(x+y)(y-x)}\\
&= (a-bx-by)e^{-(x^2+cy^2)}\\
&= f(x,y).
\end{align*}

\end{document}


giving the same output at egreg's solution.

-
+1 very nice and clean! –  kiss my armpit Jan 18 '14 at 1:26
\documentclass{article}

\usepackage{amsmath}

\begin{document}

You have:

\begin{align*}
(a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|}
&=(a-bx-by)e^{-\frac{1}{4}((x-y)^2+(x+y)^2)(1+c)+\frac{1}{2}(1-c)(x+y)(y-x)}\\
&=(a-bx-by)e^{-(x^2+cy^2)} \\
&=f(x,y).
\end{align*}

You want to:

\begin{align*}
&(a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|} \\
&=(a-bx-by)e^{-\frac{1}{4}((x-y)^2+(x+y)^2)(1+c)+\frac{1}{2}(1-c)(x+y)(y-x)}\\
&=(a-bx-by)e^{-(x^2+cy^2)} \\
&=f(x,y).
\end{align*}

But probably better is:

\begin{align*}
&(a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|} \\
\end{align*}

\end{document}


-
@Manuel See my answer. :) –  Svend Tveskæg Jan 18 '14 at 1:32
@Manuel No problem. :) It's also quite late in Denmark, so I'll go to sleep now. –  Svend Tveskæg Jan 18 '14 at 1:47
I think it would be easier than putting &\qquad= in all following lines, as in the "better" solution above, to put a single \qquad in the LHS in the first line and back up over it: \begin{align*}\qquad&\kern-2em(a-bu)... and then just the usual &= in the following lines. –  Marc van Leeuwen Jan 18 '14 at 9:25

The easiest way is to enclose the first line in \lefteqn that gives it zero width and then add a spacing. Beware that if the formula in the first line is too long, it will spill in the margin without any warning.

\documentclass{article}

\usepackage{amsmath}

\begin{document}

Here's an example
\begin{align*}
\lefteqn{(a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|}}
&=(a-bx-by)e^{-\frac{1}{4}((x-y)^2+(x+y)^2)(1+c)+\frac{1}{2}(1-c)(x+y)(y-x)}\\
&=(a-bx-by)e^{-(x^2+cy^2)} \\
&=f(x,y).
\end{align*}

\end{document}


Change \qquad to any other spacing you'd like; I suggest not remove this spacing, because it will give more clues to the readers for understanding what's going on. In a chain of equalities, the initial expression should always start at the left of the derived expressions.

-

What about this? Do you like it? Note the use of \phantom, suggested by @Harish.

\begin{multline*}
(a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|} =\\
(a-bx-by)e^{-\frac{1}{4}((x-y)^2+(x+y)^2)(1+c)+\frac{1}{2}(1-c)(x+y)(y-x)}=\\
(a-bx-by)e^{-(x^2+cy^2)} = f(x,y).
\end{multline*}

\begin{align*}  %% note the use of \phantom, suggested by Harish
&\phantom{{}={}} (a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|} \\
&=(a-bx-by)e^{-\frac{1}{4}((x-y)^2+(x+y)^2)(1+c)+\frac{1}{2}(1-c)(x+y)(y-x)}\\
&=(a-bx-by)e^{-(x^2+cy^2)} \\
&=f(x,y).
\end{align*}


-
@SvendTveskæg, I agree. But we try to satisfy his/her wishes. lol –  Sigur Jan 18 '14 at 0:37

A beautiful and useful approach!

\documentclass[preview,border=12pt,12pt]{standalone}% change this line back to \documentclass{article}
\usepackage{mathtools}

\begin{document}
It is the Code Mocker's equation
\begin{multline*}
\hspace{3cm} (a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|}\\
\!
\begin{aligned}
&=(a-bx-by)e^{-\frac{1}{4}((x-y)^2+(x+y)^2)(1+c)+\frac{1}{2}(1-c)(x+y)(y-x)}\\
&=(a-bx-by)e^{-(x^2+cy^2)} \\
&=f(x,y)
\end{aligned}
\end{multline*}
where $f(x,y)$ is nothing.
\end{document}


-