# Label eqnarray split and align

I've this tex code

\begin{eqnarray}
&\partial_{t}f =D \nabla^{2}f -f (1-f)[(1-s)-(2-s)f]\epsilon          \label{eqn:1}\\ \nonumber
&\\
\text{from which we get}
&\partial_{t}f =- \frac{\delta F}{\delta f} \\  \nonumber
&\\
\text{where f is}
&F=\int dx \big[ \frac{1}{2} D (\partial_{x f^{2}})+ V(f)\big] \\     \nonumber
&\\
\text{and}
& V(f) \equiv \int df f (1-f)[(1-s)-(2-s)f]\epsilon \\ \nonumber
&\\
&\hspace{0.8cm}  \equiv \frac{1}{2}f^{2}-\frac{1}{3}(3- 2s)f^{3}+\frac{1}{4}(2-s)f^{4}
\end{eqnarray}


I would like to have a label for one of these equations; I tried with align and split but I couldn't make them aligned.

• Welcome to TeX SX! 1) Don't use eqnarray, it yields bad spacing, 2) I can't deduce from the above image what you want to align, 3) which line(s) do you want to label? 4) Must all lines be numbered? – Bernard Sep 17 '19 at 14:40

Does one of those options is what you looking for?

\documentclass{article}
\usepackage{mathtools}

\usepackage{lipsum}
\begin{document}
\lipsum[66]
\begin{align}
&&  \partial_{t}f
& = D \nabla^{2}f -f(1-f)[(1-s)-(2-s)f]\epsilon
\label{eqn:1}                   \\
&\text{from which we get}
& \partial_{t}f
& = -\frac{\delta F}{\delta f}                  \\
& \text{where $f$ is}
& F
& = \int dx \big[ \frac{1}{2} D (\partial_{x f^{2}})+ V(f)\big] \\
& \text{and}
& V(f)
&   \equiv \int df f (1-f)[(1-s)-(2-s)f]\epsilon  \\
&&& \equiv \frac{1}{2}f^{2}-\frac{1}{3}(3- 2s)f^{3} + \frac{1}{4}(2-s)f^{4}
\end{align}
or better is to use \verb+\shortintertext{...}+ defined in the package \verb+mathtools+:
\begin{align}
\partial_{t}f
& = D \nabla^{2}f -f(1-f)[(1-s)-(2-s)f]\epsilon
\label{eqn:1}
\shortintertext{from which we get}
\partial_{t}f
& = -\frac{\delta F}{\delta f}
\shortintertext{where $f$ is}
F   & = \int dx \big[ \frac{1}{2} D (\partial_{x f^{2}})+ V(f)\big]
\shortintertext{and}
V(f)& \equiv \int df f (1-f)[(1-s)-(2-s)f]\epsilon          \\
& \equiv \frac{1}{2}f^{2}-\frac{1}{3}(3- 2s)f^{3} + \frac{1}{4}(2-s)f^{4}
\end{align}
\end{document}


• yes thanks! the last one using "use \verb+\shortintertext{...}+" doesn't work, but the previous it's fine :)! – io_gucci Sep 18 '19 at 8:09
• @io_gucci, the second example doesn't work? Do you test my MWE as it is? What error message you receive? – Zarko Sep 18 '19 at 8:17
• the error is : Undefined control sequence. <argument> ...ilon \label{eqn:1} \shortintertext{from which we get} \parti... l.167 \end{align} – io_gucci Sep 18 '19 at 8:38
• @io_gucci, do you have installed mathtools package? I tested my answer again and it works (i upload result obtained with this test). Please test my MWE as it is. If it not works, than you have some mismatch in your LaTeX installation. – Zarko Sep 18 '19 at 9:26
• now it's perfectly working! so sorry I was sure to have that package! dankuwel :D – io_gucci Sep 18 '19 at 13:21