1

I have four equations and the second one is not aligned with the others. I have tried 'aligned' in the code below but it doesn't work as expected.

    \begin{equation}
    \begin{aligned}
    \min_{w} \quad & \frac{\mu_{s_i}^Tw - r_f}{\sqrt{w^T\sum_{s_i} w}} 
     + \gamma w^T w\\
    \textrm{s.t.} \quad & 1^T w = 1\\
    & 0 \leq w_i \leq 0.5 \quad & \textrm{i = 1,2,..,7}   \\
    \end{aligned}
    \end{equation}
\begin{equation}
\begin{aligned}
\max_{w} \quad & \mu_{s_i}^Tw + \gamma w^T w\\
\textrm{s.t.} \quad & \sqrt{w^T\sum_{s_i} w} = \sigma_{s_i}\\
  & 1^T w = 1\\
  & 0 \leq w_i \leq 0.5 \quad & \textrm{i = 1,2,..,7}   \\
\end{aligned}
\end{equation}


\begin{equation}
\begin{aligned}
\min_{w} \quad & \sqrt{w^T\sum_{s_i} w} + \gamma w^T w\\
\textrm{s.t.} \quad & \mu_{s_i}^Tw = R_{s_i}\\
  & 1^T w = 1\\
  & 0 \leq w_i \leq 0.5 \quad & \textrm{i = 1,2,..,7}   \\
\end{aligned}
\end{equation}


\begin{equation}
\begin{aligned}
\min_{w} \quad & \sqrt{w^T\sum_{s_i} w} + \gamma w^T w\\
\textrm{s.t.} \quad & 1^T w = 1\\
  & 0 \leq w_i \leq 0.5 \quad & \textrm{i = 1,2,..,7}   \\
\end{aligned}
\end{equation}

Here is the screen shot:

enter image description here

NYRAHHH
  • 121
  • 1
    Welcome to TSE. –  Aug 07 '20 at 04:52
  • 4
    What exactly are you asking? Equations are centered, your equations does not have the same width and thus are not "aligned" when compared to each other. Btw use \dots for the ... part – daleif Aug 07 '20 at 05:09

1 Answers1

2

Your equations are completely distinct and are not grouped in one environment. eqs 15, 17, 18 are aligned properly by chance because their widths are equal. here is a simple example (also there are many tricks and ways for doing this):

\begin{align}
&\begin{aligned}
\min_{w} \quad & \frac{\mu_{s_i}^Tw - r_f}{\sqrt{w^T\sum_{s_i} w}} 
+ \gamma w^T w\\
\textrm{s.t.} \quad & 1^T w = 1\\
& 0 \leq w_i \leq 0.5 \quad & \textrm{i = 1,2,..,7}   \\
\end{aligned}\\
&\begin{aligned}
\max_{w} \quad & \mu_{s_i}^Tw + \gamma w^T w\\
\textrm{s.t.} \quad & \sqrt{w^T\sum_{s_i} w} = \sigma_{s_i}\\
& 1^T w = 1\\
& 0 \leq w_i \leq 0.5 \quad & \textrm{i = 1,2,..,7}   \\
\end{aligned}
\end{align}

enter image description here

Bernard
  • 271,350