1

My MWE:

\documentclass{report}
\usepackage{amsmath}

\begin{document}

\begin{align}
&u = \frac{1}{\theta_{2,3}} \left [ -z_1 - \left ( c_2 + \frac{\epsilon}{2} \right )z_2 - \theta_{2,1}\sin(x_1) - \hat{\theta}_{2,2}x_2 + \dot{\alpha}_1 \right ] \\ 
&\dot{\xi}_{2,2} = - \frac{\partial \beta_2}{\partial x_2}\left [ \theta_{2,1}\sin(x_1)+\left ( \xi_{2,2}  + \beta_2(x_2) \right ) x_2 + \theta_{2,3}u \right ]  \\
&\hat{\theta}_{2,2} = \xi_{2,2} + \beta_2(x_2) \\
&\beta_2 =  \frac{\gamma}{2}x_2^2 
\end{align}

\end{document}

The result: enter image description here

What I want: enter image description here

That is, next to the left alignment, I want to align the equal signs of equations (2) to (4).

Pietair
  • 1,731
  • align always aligns with the left-hand side aligned to the right before the sign of relation. you'd be better off using alignat, for which you need to explicitly indicate where you want spacing. – barbara beeton Aug 06 '14 at 17:21

1 Answers1

4

If you want two alignment points for the last three equations, you can use the alignat environment, combined with \mathrlap command, defined in mathtools (which loadsamsmath`):

\documentclass{report}
\usepackage{mathtools}

\begin{document}

\begin{alignat}{2}
&u \mathrlap{{}=\frac{1}{\theta_{2,3}} \left [ -z_1 - \left ( c_2 + \frac{\epsilon}{2} \right )z_2 - \theta_{2,1}\sin(x_1) - \hat{\theta}_{2,2}x_2 + \dot{\alpha}_1 \right ]} \\
&\dot{\xi}_{2,2} &&= - \frac{\partial \beta_2}{\partial x_2}\left [ \theta_{2,1}\sin(x_1)+\left ( \xi_{2,2}  + \beta_2(x_2) \right ) x_2 + \theta_{2,3}u \right ]  \\
 & \hat{\theta}_{2,2} & &= \xi_{2,2} + \beta_2(x_2) \\
&\beta_2 &&= \frac{\gamma}{2}x_2^2
\end{alignat}

\end{document} 

enter image description here

Bernard
  • 271,350
  • Why do you use \begin{alignat}{3}? It is not enough with \begin{alignat}{2}? – skpblack Aug 06 '14 at 18:05
  • I forgot to go back to 2. I always do that to have the possibility to add an ampersand or two if required on testing. I'll reset the correct value at once.You're right, it might be confusing. – Bernard Aug 06 '14 at 18:08