[Tex/LaTex] Ignoring alignment for certain lines in an alignat environment


I am having trouble typesetting an optimization problem, and would like to know how to ignore the alignment for a certain line in an alignat environment.

I've currently typeset the optimization problem as:

\min_{\lambda} \quad & \frac{1}{N} \sum_{i = 1}^N{\alpha_i} & + & C_0 \sum_{i = 1}^N{\beta_i} & + & C_1 \sum_{i = 1} ^N{\gamma_i} \\
s.t. \quad & -M\alpha + \epsilon & \leq & \lambda^T X y & \leq & M(1-\alpha) + \epsilon \\ 
     & -\beta \bar{\lambda}  & \leq &  \lambda & \leq & \beta \bar{\lambda} \\ 
     &-\gamma & \leq & \lambda & \leq & \gamma \\ 
     & \lambda \in \mathbb{Z}^P & \quad & \alpha \in \{0,1\}^N  &\quad & \beta, \gamma \in \{0,1\}^P 

However this runs into issues since the bottom line causes weird spacing.

I would appreciate any formulations that can make this mess legible in some way… That said, I think that I can get around this problem if I can just tell the alignat environment to ignore the last line, and also center the contents between each of the & signs.

Best Answer

I wouldn't try aligning the inequalities: the formulas are too different from each other. Here's a possibility:

  \,\frac{1}{N} \sum_{i=1}^N{\alpha_i} +
   C_0 \sum_{i=1}^N{\beta_i} +
   C_1 \sum_{i=1} ^N{\gamma_i}
  &{-}M\alpha + \epsilon \leq \lambda^T X y \leq M(1-\alpha) + \epsilon \\[1ex]
  &{-}\beta \bar{\lambda} \leq \lambda \leq \beta \bar{\lambda} \\[1ex]
  &{-}\gamma \leq \lambda \leq \gamma \\[1ex]
  &\lambda \in \mathbb{Z}^P,\qquad
   \alpha \in \{0,1\}^N, \qquad  \beta, \gamma \in \{0,1\}^P

It's necessary to use {-} because otherwise the minus sign would be detached from the symbol it refers to.

enter image description here

Related Question