4

I am currently trying to format the expression

\documentclass{report}
\usepackage{mathtools}
\usepackage{amsmath}

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

\begin{document}

\begin{align}
    \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&
    \end{aligned}\right.
\end{align}

\end{document}

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!

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

2 Answers 2

8

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.

\documentclass{article}
\usepackage{amsmath,bm}

\newcommand{\cchi}{\mathord{\mathop{\bm{\chi}}}}

\begin{document}

\begin{align}
\max\eta_D(\mathbf{J}_{\cchi_{k,l}}) &\in (0,1]
\\
\text{subject to }
  &\left\{\begin{aligned}
        &\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 } 
  &\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
  \end{aligned}\right.
\end{align}

\end{document}

enter image description here

1
  • 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, 2020 at 9:54
3

With dcases and nccmath for medium size fractions:

\documentclass{article}
\usepackage{nccmath, mathtools}
\usepackage{bm}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\newcommand{\bchi}{\mathord{\mathop{\bm{\chi}}}}
\begin{document}
    \begin{align}
\max{\eta_D\left(\mathbf{J}_{\bchi_{k,l}}\right)} 
    & \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               \\
            \end{dcases}\\
\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
        \end{dcases}
    \end{align}
\end{document}

enter image description here

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .