做优化的同学可能会碰到排列形如
max *******
s.t. ***** = *
***** > ***
...
的格式
既要要求 max 和 s.t. 对齐 又要令约束式的 = > 等符号对齐!
下面几个代码以供参考:
\begin{align*}
&\max\quad z=\sum\limits_{i=1}^m c_i x_i\\
& \begin{array}{[email protected]{\quad}[email protected]{}[email protected]{\quad}l}
s.t.&\sum\limits_{j=1}^m a_{ij} x_j&\leq b_i, &i=1,2,3\ldots,n\\
&x_j&\geq110, &i=1,2,3\ldots,n \\
&x_j&\geq10, &i=1,2,3\ldots,n \\
&x_j&\geq0, &i=1,2,3\ldots,n \\
& x_j&\geq0, &i=1,2,3\ldots,n \\
\end{array} .
\end{align*}
效果:
\begin{align*}
&\max\,\, z=\sum_{j=1}^n c_jx_j\\
&s.t.\quad
\begin{cases}
\sum\limits_{j=1}^n a_{ij}x_j \leq b_i & (i=1,2,3,\cdots, m), \\
x_j \geq 0 & (j=1,2,3,\cdots,n).
\end{cases}
\end{align*}
\begin{equation*}
\begin{split}
&\max \,\, z=\sum_{j=1}^nc_jx_j\\
&s.t.\quad \left\{\begin{array}{lc}
\sum_{j=1}^na_{ij}x_j\leq b_j,\quad & (i=1,2,\cdots,m)\\
x_j\geq 0,\quad & (j=1,2,\cdots,n) \end{array}\right.
\end{split}
\end{equation*}
\begin{align*}
&\max\,\,z=\sum\limits_{j=1}^nc_jx_j\\
&s.t.\begin{cases}\sum_{j=1}^na_{ij}x_j\leq b_i&(i=1,2,\cdots,m)\\
x_j\geq0&(j=1,2,\cdots,n)\end{cases}\\
\end{align*}
from: http://blog.sina.com.cn/s/blog_6850cf720101a9kk.html