# Aligning equal signs such that the line is already aligned

I have an align question. Essentially the following code:

\begin{align}
\nonumber & \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_1)\right)\exp(-\mu-1) + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_2)\right)\exp(-\mu-1) \\
\nonumber & \cdots + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_k)\right)\exp(-\mu-1)  = 1 \\
\nonumber &  \sum_{i=1}^k \exp\left(-\sum_{t=1}^T \lambda_t f_t(x_i) \right)  = \exp(\mu+1) \\
&  \exp(-\mu-1)  = \frac{1}{\displaystyle{\sum_{i=1}^k} \exp\left(-\displaystyle{\sum_{t=1}^T} \lambda_t f_t(x_i) \right)}
\end{align}


Produces the following:

However I would like to have the equal signs in line 2, 3 and 4 all aligned, how can I do this? (Line 2 is a continuation of line 1).

-
Use the & right before the = to get the = aligned. However, how do you want the first line to be aligned? – Qrrbrbirlbel Apr 30 '13 at 17:47
I would like the first line and second line to stay as they are, then align the equal signs. – TrueTears Apr 30 '13 at 17:50

Some ideas:

## Code

\documentclass{article}
\usepackage{mathtools}
\begin{document}
$$\begin{split} \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_1)\right)\exp(-\mu-1) & + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_2)\right)\exp(-\mu-1) \\ \cdots + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_k)\right)\exp(-\mu-1) & = 1 \\ \sum_{i=1}^k \exp\left(-\sum_{t=1}^T \lambda_t f_t(x_i) \right) & = \exp(\mu+1) \\ \exp(-\mu-1) & = \frac{1}{\displaystyle{\sum_{i=1}^k} \exp\left(-\displaystyle{\sum_{t=1}^T} \lambda_t f_t(x_i) \right)} \end{split}$$

\begin{alignat}{6}
\mathrlap{\exp\left(-\sum_{t=1}^T\lambda_t f_t(x_1)\right)\exp(-\mu-1)  + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_2)\right)\exp(-\mu-1)} \nonumber\\
&&\dots + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_k)\right)\exp(-\mu-1)  & = 1 \nonumber\\
&&\sum_{i=1}^k \exp\left(-\sum_{t=1}^T \lambda_t f_t(x_i) \right) & = \exp(\mu+1) \nonumber\\
&&\exp(-\mu-1) & = \frac{1}{\displaystyle{\sum_{i=1}^k} \exp\left(-\displaystyle{\sum_{t=1}^T} \lambda_t f_t(x_i) \right)}
\end{alignat}

\begin{multline}
\exp\left(-\sum_{t=1}^T\lambda_t f_t(x_1)\right)\exp(-\mu-1) + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_2)\right)\exp(-\mu-1) \\
\begin{aligned}
\cdots + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_k)\right)\exp(-\mu-1)  & = 1 \\
\sum_{i=1}^k \exp\left(-\sum_{t=1}^T \lambda_t f_t(x_i) \right) & = \exp(\mu+1) \\
\exp(-\mu-1) & = \frac{1}{\displaystyle{\sum_{i=1}^k} \exp\left(-\displaystyle{\sum_{t=1}^T} \lambda_t f_t(x_i) \right)}
\end{aligned}
\end{multline}
\end{document}


## Output

-

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{multline}
\exp\left(-\sum_{t=1}^T\lambda_t f_t(x_1)\right)\exp(-\mu-1) + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_2)\right)\exp(-\mu-1) \\
\begin{aligned}
\cdots + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_k)\right)\exp(-\mu-1)  &= 1 \\
\sum_{i=1}^k \exp\left(-\sum_{t=1}^T \lambda_t f_t(x_i) \right)  &= \exp(\mu+1) \\
\exp(-\mu-1)  &= \frac{1}{\displaystyle{\sum_{i=1}^k} \exp\left(-\displaystyle{\sum_{t=1}^T} \lambda_t f_t(x_i) \right)}
\end{aligned}
\end{multline}
\end{document}


-

\documentclass[preview,border=12pt]{standalone}
\usepackage{amsmath}
\begin{document}
\begin{gather}
\exp\left(-\sum_{t=1}^T\lambda_t f_t(x_1)\right)\exp(-\mu-1) + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_2)\right)\exp(-\mu-1) \notag\\
\begin{aligned}
\cdots + \exp\left(-\sum_{t=1}^T\lambda_t f_t(x_k)\right)\exp(-\mu-1)  &= 1 \\
\sum_{i=1}^k \exp\left(-\sum_{t=1}^T \lambda_t f_t(x_i) \right)  &= \exp(\mu+1) \\
\exp(-\mu-1)  &= \frac{1}{\displaystyle{\sum_{i=1}^k} \exp\left(-\displaystyle{\sum_{t=1}^T} \lambda_t f_t(x_i) \right)}
\end{aligned}
\end{gather}
\end{document}

-