I currently have the following output:
I want to align the equals signs even after the bit of text. Is there a nice way to do this besides having one big align block and putting the text inside it? (The code is below if needed.)
We have
\begin{align}
\mathbb{E}X &= \sum_{k=0}^\infty k\mathbb{P}(k)\
&=\sum_{k=0}^\infty k\frac{\lambda}{k!}e^{-\lambda}\
&=\lambda e^{\lambda}\sum_{k=0}^\infty k\frac{1}{k!}\
&=\lambda e^{\lambda}\sum_{k=1}^\infty (k-1)\frac{1}{(k-1)!}.
\end{align}
Performing the change of variable $j=k-1$ we then get
\begin{align}
&=\lambda e^{\lambda}\sum_{j=0}^\infty j\frac{1}{j!}\
&=\lambda e^{-\lambda}e^\lambda\
&=\lambda.
\end{align}
Edit: Also please ignore the typos in the equation itself, I just hastily copied down an example :)


\intertextis for. Beware: never leave a blank line before a math display. – egreg Sep 29 '22 at 09:40