I've this tex code

&\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
& 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}

the output is :

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.

  • 3
    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?


&&  \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}
or better is to use \verb+\shortintertext{...}+ defined in the package \verb+mathtools+:
    & = D \nabla^{2}f -f(1-f)[(1-s)-(2-s)f]\epsilon
\shortintertext{from which we get}
    & = -\frac{\delta F}{\delta f}                 
\shortintertext{where $f$ is}
F   & = \int dx \big[ \frac{1}{2} D (\partial_{x f^{2}})+ V(f)\big]
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}

enter image description here

  • 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
  • 1
    @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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.