2

In the following optimization problem:

\begin{align}
\text{Minimize} \quad
& \sum_{j=1}^{n} c_j x_j \\
\text{s.t.} \quad
& \sum_{j=1}^{n} f_{ij} x_j \geq 1 \quad i = 1 \ldots m \\
& \sum_{j=1}^{n} g_{kj} x_j \leq h_k \quad k = 1 \ldots K \\
& x_j \in \left \{ 0,1 \right \}
\end{align}

I would like to align

i = 1 \ldots m
k = 1 \ldots K

so they are similar to this:

enter image description here

I'm using \quad as a suggestion from ChatGPT. Any advice here will be extremely welcome and valuable.

I A
  • 21

1 Answers1

2

You can specify the alignment via &.

Personally, I would not use any \quad but you may add them. In addition, I added commas. But these are just my recommendations. You might also want to have a look on https://ctan.org/pkg/lshort.

See also https://tex.stackexchange.com/a/31956/128553 for a different numbering scheme within the cases environment.

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align} \text{Minimize } & \sum_{j=1}^{n} c_j x_j \ \text{s.t. } & \sum_{j=1}^{n} f_{ij} x_j \geq 1, & i = 1, \ldots, m, \ & \sum_{j=1}^{n} g_{kj} x_j \leq h_k, & k = 1, \ldots, K, \ & x_j \in \left { 0, 1 \right }. \end{align}

\begin{align} \text{Minimize } & \sum_{j=1}^{n} c_j x_j \ \text{s.t. } & \begin{cases} \displaystyle \sum_{j=1}^{n} f_{ij} x_j \geq 1, & i = 1, \ldots, m, \ \displaystyle \sum_{j=1}^{n} g_{kj} x_j \leq h_k, & k = 1, \ldots, K, \ \displaystyle x_j \in \left { 0, 1 \right }. \end{cases} \end{align}

\begin{align} \text{Minimize } & \sum_{j=1}^{n} c_j x_j \ \text{s.t. } & \begin{cases} \sum_{j=1}^{n} f_{ij} x_j \geq 1, & i &= 1, \ldots, m, \ \sum_{j=1}^{n} g_{kj} x_j \leq h_k, & k &= 1, \ldots, K, \ x_j \in \left { 0, 1 \right }. \end{cases} \end{align}

\end{document}

enter image description here

CampanIgnis
  • 4,624