# Split equation using alignat*

Consider the following MWE

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{2}
(b_{t+1}) &:\quad &  \left(\frac{\beta}{1 + \gamma}\right)
E_{t}\left\{\lambda_{t+1}\left(1 + r_{t+1}^{f}\right)\right\} &= \lambda_{t}\\
(\lambda_{t}) &:\quad &  w_{t}l_{t}^{s} + r_{t}^{k}k_{t} + (1 +
r_{t}^{f})b_{t} & = c_{t} + (1 + \gamma)(k_{t+1} + b_{t+1}) - (1 -\delta)k_{t}
+ \phi_{K}\left[\frac{k_{t+1} }{k_{t}} - 1\right]^{2}
\end{alignat*}
\end{document}


which produces:

I would like to split the second equation at -(1-\delta)k_{t} ... so that (this part) starts just below (k_{t+1} + b_{t+1}). How can I achieve that?

## 3 Answers

Create a new line:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{2}
(b_{t+1}) &:\quad &
\left(\frac{\beta}{1 + \gamma}\right)
E_{t}\left\{\lambda_{t+1}\left(1 + r_{t+1}^{f}\right)\right\}
&= \lambda_{t}\\
(\lambda_{t}) &:\quad &
w_{t}l_{t}^{s} + r_{t}^{k}k_{t} + (1 + r_{t}^{f})b_{t}
&= c_{t} + (1 + \gamma)(k_{t+1} + b_{t+1}) \\
&&& \qquad{}-(1 -\delta)k_{t} + \phi_{K}\left[\frac{k_{t+1} }{k_{t}} - 1\right]^{2}
\end{alignat*}
\end{document}


If you want the alignment you'd like, add an alignment point:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{3}
(b_{t+1}) &:\quad &
\left(\frac{\beta}{1 + \gamma}\right)
E_{t}\left\{\lambda_{t+1}\left(1 + r_{t+1}^{f}\right)\right\}
&= \lambda_{t}\\
(\lambda_{t}) &:\quad &
w_{t}l_{t}^{s} + r_{t}^{k}k_{t} + (1 + r_{t}^{f})b_{t}
&= c_{t} &&+ (1 + \gamma)(k_{t+1} + b_{t+1}) \\
&&&&&-(1 -\delta)k_{t} + \phi_{K}\left[\frac{k_{t+1} }{k_{t}} - 1\right]^{2}
\end{alignat*}
\end{document}


A different possibility might be avoiding the awkward alignment between the equals signs:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
(b_{t+1}) &:\quad
\left(\frac{\beta}{1 + \gamma}\right)
E_{t}\left\{\lambda_{t+1}\left(1 + r_{t+1}^{f}\right)\right\}
=\lambda_{t}\\
(\lambda_{t}) &:\quad
w_{t}l_{t}^{s} + r_{t}^{k}k_{t} + (1 + r_{t}^{f})b_{t} \\
&\quad\qquad= c_{t} + (1 + \gamma)(k_{t+1} + b_{t+1})
-(1 -\delta)k_{t} + \phi_{K}\left[\frac{k_{t+1} }{k_{t}} - 1\right]^{2}
\end{align*}

\end{document}


This alternative could be useful in case you want to number those equations, because it allows split:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
(b_{t+1}) &:\quad
\left(\frac{\beta}{1 + \gamma}\right)
E_{t}\left\{\lambda_{t+1}\left(1 + r_{t+1}^{f}\right)\right\}
=\lambda_{t}\\
\begin{split}
(\lambda_{t}) &:\quad
w_{t}l_{t}^{s} + r_{t}^{k}k_{t} + (1 + r_{t}^{f})b_{t} \\
&\quad\qquad= c_{t} + (1 + \gamma)(k_{t+1} + b_{t+1})
-(1 -\delta)k_{t} + \phi_{K}\left[\frac{k_{t+1} }{k_{t}} - 1\right]^{2}
\end{split}
\end{align}

\end{document}


Use a double ampersand for the new align column and it works:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\newcommand{\negphantom}[1]{\settowidth{\dimen0}{#1}\hspace*{-\dimen0}}
\begin{alignat*}{3}
(b_{t+1}) &:\quad &  \left(\frac{\beta}{1 + \gamma}\right)
E_{t}\left\{\lambda_{t+1}\left(1 + r_{t+1}^{f}\right)\right\} &= \lambda_{t}\,\\
(\lambda_{t}) &:\quad &  w_{t}l_{t}^{s} + r_{t}^{k}k_{t} + (1 +
r_{t}^{f})b_{t} & = c_{t} + (1 + \gamma)\negphantom{$-$}&&(k_{t+1} + b_{t+1})\\
& & & &-& (1 -\delta)k_{t}
+ \phi_{K}\left[\frac{k_{t+1} }{k_{t}} - 1\right]^{2}
\end{alignat*}
\end{document}


The issue is that normally, the ampersands alternate alignment like rlrlrl... - but a double ampersand will cause a repetition, in this case ll.

What does a double ampersand (&&) mean in LaTeX?

EDIT: I made a mistake the first time. To make the parentheses line up, move the last double ampersand before the minus sign and use \hspace{1.95cm} to fill in the gap. If someone has a better way of right-aligning the minus sign, I'd love to know. Putting the minus sign between the two ampersands aligns the parentheses, but places a gap of the size of the minus sign between the two factors above. This is one of those times that I wish there was a negative hphantom command.

EDIT 2: I found a negphantom command online (not the first time I've looked, let me tell you). I updated the code, though not the image, since it's only off by a fraction of a millimeter.

I'd probably just do this

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{alignat*}{3}
(b_{t+1}) &:\quad & \left(\frac{\beta}{1 + \gamma}\right)
E_{t}\left\{\lambda_{t+1}\left(1 + r_{t+1}^{f}\right)\right\} &=
\lambda_{t}
\\
(\lambda_{t}) &:\quad & w_{t}l_{t}^{s} + r_{t}^{k}k_{t} + (1 +
r_{t}^{f})b_{t} & = c_{t} + (1 + \gamma)&&(k_{t+1} + b_{t+1})
\\
&&&&\mathllap{-}&(1
-\delta)k_{t} + \phi_{K}\left[\frac{k_{t+1} }{k_{t}} - 1\right]^{2}
\end{alignat*}
\end{document}