I am currently trying to format the expression


\DeclareRobustCommand*{\maxin}[0]{_{\boldsymbol{\raisebox{1.55pt}{$\scriptstyle\chi$}} \raisebox{0.565pt}{$\scriptstyle\in$} \Omega}}


    \max{\eta_D\left(\mathbf{J}_{\boldsymbol{\chia}_{k,l}}\right)} &\in (0,1]\\
    \text{subject to } &\left\{\begin{aligned}
        &\alpha_{12}^j &\le \dfrac{\pi}{6}\\
        &\alpha_{23}^j&\le \dfrac{\pi}{6}\\
        &\max\maxin\left|\beta_1^j\right| &\le \dfrac{\pi}{12} \\
        &\max\maxin\left|\beta_2^j\right| &\le \dfrac{\pi}{12} \\
        &\max\maxin\left|\beta_3^j\right| &\le \dfrac{\pi}{12}\\
        &\min\maxin\left(\mathcal{D}_{\omega^j}\right) &>0 \\    
    \end{aligned} \right.\\
    \text{bounded by } &\left\{\begin{aligned}
        -\dfrac{1}{12}\pi &\le \varphi_1 &\le \dfrac{1}{12}\pi\\
        -\dfrac{1}{12}\pi &\le  \varphi_2&\le \dfrac{1}{12}\pi\\
        0 &\le \Theta_1     &\le \dfrac{8}{45}\pi\\
        0 &\le \Theta_2 &\le \dfrac{8}{45}\pi\\
        0 &\le \Theta_3 &\le \dfrac{23}{180}\pi\\
        (\varphi_1^j, \Theta_1^j) &\ne (\varphi_2^j,\Theta_2^j)& \ne (0,\Theta_3^j)\\
        \varphi_2^j &\ne 0&


enter image description here

However, the aligned environment doesn't produce a result that is actually aligned. How do I fix this? Furthermore, it would be neat to horizontally align the pi terms, is that somehow possible to do?

Thanks in advance!

  • Please make your code compilable by adding the documentclass as well as the relevant packages.
    – leandriis
    Jan 16 '20 at 7:48
  • 3
    &&\le instead of &\le should solve the alignment issue.
    – leandriis
    Jan 16 '20 at 7:52

I'm not sure there's anything to align, except for the two big braces. Don't force alignment to objects that aren't related to one another.




\max\eta_D(\mathbf{J}_{\cchi_{k,l}}) &\in (0,1]
\text{subject to }
        &\alpha_{12}^j \le \dfrac{\pi}{6}\\
        &\alpha_{23}^j \le \dfrac{\pi}{6}\\
        &\!\max_{\cchi\in\Omega}|\beta_1^j| \le \dfrac{\pi}{12} \\
        &\!\max_{\cchi\in\Omega}|\beta_2^j| \le \dfrac{\pi}{12} \\
        &\!\max_{\cchi\in\Omega}|\beta_3^j| \le \dfrac{\pi}{12} \\
        &\!\min_{\cchi\in\Omega}(\mathcal{D}_{\omega^j}) >0
  \end{aligned} \right.
\text{bounded by } 
        &{-}\dfrac{1}{12}\pi \le \varphi_1 \le \dfrac{1}{12}\pi\\
        &{-}\dfrac{1}{12}\pi \le \varphi_2 \le \dfrac{1}{12}\pi\\
        &0 \le \Theta_1 \le \dfrac{8}{45}\pi\\
        &0 \le \Theta_2 \le \dfrac{8}{45}\pi\\
        &0 \le \Theta_3 \le \dfrac{23}{180}\pi\\
        &(\varphi_1^j, \Theta_1^j) \ne (\varphi_2^j,\Theta_2^j) \ne (0,\Theta_3^j)\\
        &\varphi_2^j \ne 0


enter image description here

  • But wouldn't it look cleaner to align, for example, the $\frac{8}{45}\pi$ and $\frac{23}{180}\pi$ terms? Or the $\le$ terms and with the $<$?
    – Skydiver
    Jan 16 '20 at 9:54

With dcases and nccmath for medium size fractions:

\usepackage{nccmath, mathtools}
    & \in (0,1] \\
\text{subject to} 
        &   \begin{dcases}
            \alpha_{12}^j   \le \mfrac{\pi}{6}       \\
            \alpha_{23}^j   \le \mfrac{\pi}{6}       \\
            \max_{\bchi\in\Omega}\abs{\beta_1^j}   \le \mfrac{\pi}{12}   \\
            \max_{\bchi\in\Omega}{\abs{\beta_2^j}} \le \mfrac{\pi}{12}   \\
            \max_{\bchi\in\Omega}{\abs{\beta_3^j}} \le \mfrac{\pi}{12}   \\
\min_{\bchi\in\Omega}\bigl(\mathcal{D}_{\omega^j}\bigr) >0               \\
\text{bounded by} 
        & \begin{dcases}
            -\mfrac{1}{12}\pi \le \varphi_1 \le \mfrac{1}{12}\pi\\ 
            -\mfrac{1}{12}\pi \le \varphi_2 \le \mfrac{1}{12}\pi\\ 
            0 \le \Theta_1 \le \mfrac{8}{45}\pi                 \\ 
            0 \le \Theta_2 \le \mfrac{8}{45}\pi                 \\
            0 \le \Theta_3 \le \mfrac{23}{180}\pi               \\
(\varphi_1^j,\Theta_1^j) \ne (\varphi_2^j,\Theta_2^j) \ne (0,\Theta_3^j)\\
            \varphi_2^j \ne 0

enter image description here

  • This is a really neat suggestion, using mfrac already looks way cleaner. Thanks!
    – Skydiver
    Jan 16 '20 at 9:58

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.