5

My MWE:

\documentclass[]{report}

\usepackage{amsmath}

    \begin{document}

    \begin{align}
    \dot{V} =&\, \frac{1}{\gamma_{2,1}}\sigma_{2,1} \dot{\sigma}_{2,1} + \frac{1}{\gamma_{2,2}}\sigma_{2,2} \dot{\sigma}_{2,2} + \frac{1}{\gamma_{2,3}}\sigma_{2,3} \dot{\sigma}_{2,3} \notag \\
     =& - \left [\sigma_{2,1}^2 \sin^2(x_1) + \sigma_{2,2}^2 x_2^2 + \sigma_{2,3}^2 u^2 + 2\sigma_{2,1}\sigma_{2,2}\sin(x_1)x_2 + 2 \sigma_{2,1}\sigma_{2,3}\sin(x_1)u \right. \notag \\
    & \left. + 2 \sigma_{2,2}\sigma_{2,3}x_2 u \vphantom{\sigma_{2,1}^2} \right ] \notag \\
    \end{align}

    \end{document}

The result:

enter image description here

What I want:

enter image description here

1
  • Insert \quad or \qquad after the final &
    – Thruston
    Oct 24, 2014 at 15:23

1 Answer 1

4

Use & \phantom{{}= - \bigl[}. Also, you should use &= instead of =&. Further, use \bigl[ and \bigr] instead of \left[ and right]. This doesn't need to be balanced like \left.. Also the \\ in the last line shouldn't be used. In the last line, use {}+{} so that the spacing around + is correct.

\documentclass[]{report}

\usepackage{amsmath}

\begin{document}

\begin{align}
\dot{V} &= \frac{1}{\gamma_{2,1}}\sigma_{2,1} \dot{σ}_{2,1} + \frac{1}{\gamma_{2,2}}\sigma_{2,2} \dot{σ}_{2,2} + \frac{1}{\gamma_{2,3}}\sigma_{2,3} \dot{σ}_{2,3} \notag \\
 &= {}-{} \bigl[\sigma_{2,1}^2 \sin^2(x_1) + \sigma_{2,2}^2 x_2^2 + \sigma_{2,3}^2 u^2 + 2\sigma_{2,1}\sigma_{2,2}\sin(x_1)x_2 + 2 \sigma_{2,1}\sigma_{2,3}\sin(x_1)u  \notag \\
& \phantom{{}= - \bigl[} {}+{} 2 \sigma_{2,2}\sigma_{2,3}x_2 u \vphantom{\sigma_{2,1}^2} \bigr] \notag   %% no \\ here
\end{align}

\end{document}

enter image description here

Here is another version with shorter second line as recommended by egreg.

\documentclass[]{report}

\usepackage{amsmath}

\begin{document}

\begin{align}
\dot{V} &= \frac{1}{\gamma_{2,1}}\sigma_{2,1} \dot{σ}_{2,1} + \frac{1}{\gamma_{2,2}}\sigma_{2,2} \dot{σ}_{2,2} + \frac{1}{\gamma_{2,3}}\sigma_{2,3} \dot{σ}_{2,3} \notag \\
 &= {}-{} \bigl[\sigma_{2,1}^2 \sin^2(x_1) + \sigma_{2,2}^2 x_2^2 + \sigma_{2,3}^2 u^2 + 2\sigma_{2,1}\sigma_{2,2}\sin(x_1)x_2  \notag \\
& \phantom{{}= - \bigl[} {}+{}  2 \sigma_{2,1}\sigma_{2,3}\sin(x_1)u + 2 \sigma_{2,2}\sigma_{2,3}x_2 u \vphantom{\sigma_{2,1}^2} \bigr] \notag   %% no \\ here
\end{align}

\end{document}

enter image description here

8
  • The last line + is a unary operator, I would convert it to a binary operator; even if there's nothing before on that line, there is in the expression.
    – Manuel
    Oct 24, 2014 at 15:37
  • @Manuel I missed that one. Thanks for noting and corrected.
    – user11232
    Oct 24, 2014 at 15:40
  • 1
    not sure why you've used a \phantom at the beginning of the third line when \qquad would probably do as well; if it's really meant to line up the plus just inside the opening bracket, then repeating the string from the previous line, as \phantom{{}= - \bigl[}, would be more appropriate. Oct 24, 2014 at 15:47
  • As barbara says, I think in case you are not trying to align anything, then \quad or \qquad is enough. But that's just a “matter of taste” :)
    – Manuel
    Oct 24, 2014 at 15:54
  • what i think has happened here is that the change to get a unary minus in the second line was not back-edited into the code; that's why the extra space when you use the code i quoted in my comment. if that's really the case, then please fix the code that's shown. Oct 24, 2014 at 15:56

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.