! Package amsmath Error: \displaybreak cannot be applied here.
See the amsmath package documentation for explanation.
Type H <return> for immediate help.
...
l.636 ...right.\end{array}\displaybreak[0]
why \displaybreak cannot be applied here? I want to make (1)and
(2)etc. to two column, so other packages, such as split, align didn't
work. So array is required here. Thanks for any suggestions.
> ! Package amsmath Error: \displaybreak cannot be applied here.
...
> l.636 ...right.\end{array}\displaybreak[0]
>
> why \displaybreak cannot be applied here? I want to make (1)and
> (2)etc. to two column, so other packages, such as split, align didn't
> work. So array is required here.
If you must use "array", then you will have to be content with the
limitations of array. One of the limitations: It wraps an unbreakable
box around the entire contents.
A couple of other comments:
> $${\allowdisplaybreaks\begin{array}{ll}
> \begin{array}{rl}
The notation $$ ... $$ is not documented anywhere in the LaTeX book as a
supported way of writing displayed equations. For example, if you use
that notation the fleqn option does not work.
Also, in math mode, "{...}" creates an unbreakable box around the contents.
So even if array allowed page breaks, the wrapper
{\allowdisplaybreaks ... }
still would prevent it. Better would be something like
\begin{allowdisplaybreaks}%
\begin{gather*}
...
\end{gather*}
\end{allowdisplaybreaks}%
But I think your best bet is to use the amsmath environment "flalign*".
It is not precisely designed for this sort of two-column list but if you
do the equation numbers "by hand" it is not very much extra work.
And it allows page breaking (if \allowdisplaybreaks is used as shown).
------------------------------------------------------------------------
\documentclass{article}
\usepackage{amsmath}
\newcommand{\mynumber}{%
\refstepcounter{equation}%
(\theequation)%
}
\newenvironment{mathlist2}{%
\subequations
\renewcommand{\theequation}{\arabic{equation}}%
\allowdisplaybreaks
}{%
}
\begin{document}
\noindent
Beginning a two-column list of displayed formulas:
\begin{mathlist2}
\begin{flalign*}
&\begin{aligned}
\mynumber\quad
\max z &= x_1 + 2x_2 \\
\text{s.t.}&\begin{cases}
2x_1 - 3x_2 \le 6\\
x_1 + 2x_2 \le 10\\
x_1 ,x_2 \ge 0\end{cases}
\end{aligned}
&&
\begin{aligned}
\mynumber\quad
\min z &= 5x_1 + 4x_2 \\
\text{s.t.}&\begin{cases}
6x_1+5x_2\ge 18\\
2x_1 + 7x_2 \ge 16\\
x_1 ,x_2 \ge 0
\end{cases}
\end{aligned}
\\
&\begin{aligned}
\mynumber\quad
\max z &= 2x_1 - 4x_2 + 3x_3\\
\text{s.t.}&\begin{cases}
x_1 - 3x_2 + 2x_3 \le 12\\
2x_2 + x_3 \ge 10\\
x_1-2x_3=15\\
x_1 \ge 0,x_2 \le 0,x_3~ \text{no constraint}
\end{cases}
\end{aligned}
&&
\begin{aligned}
\mynumber\quad
\min z &=\sum\limits_{i = 1}^m {\sum\limits_{j = 1}^n {c_{ij}
x_{ij} } }\\
\text{s.t.}&\begin{cases}
\sum\limits_{i = 1}^m
{x_{ij} = b_j (j
= 1, \cdots ,n)}\\
\sum\limits_{j = 1}^n {x_{ij} = a_i (i = 1, \cdots ,m)}
\end{cases}
\end{aligned}
\\
&\begin{aligned}
\mynumber\quad
\max cx &
\begin{cases} Ax=b\\ x \ge a
\end{cases}
\end{aligned}
&&
\begin{aligned}
\mynumber\quad
\max cx &
\begin{cases}
Ax=b \\
1 \le x \le u\end{cases}
\end{aligned}
\\
&\begin{aligned}
\mynumber\quad
\min z&=\sum\limits_{i = 1}^m \sum\limits_{j = 1}^n
c_{ij}x_{ij}\\
&\begin{cases}
\sum\limits_{j = 1}^n x_{ij} = a_i \quad(i = 1, \cdots ,m) \\
\sum\limits_{i = 1}^m x_{ij} = b_j \quad(j = 1, \cdots ,n) \\
x_{ij} \ge 0 (i = 1, \cdots ,m;j = 1, \cdots n) \\
\end{cases}
\end{aligned}
&&
\begin{aligned}
\mynumber\quad
\max z&=\sum\limits_{j = 1}^n c_{j}x_{j} \\
&\begin{cases}
\sum\limits_{j = 1}^n a_{ij} x_j \le b_i & (i = 1, \cdots ,m_1 < m)
\\
\sum\limits_{j = 1}^n a_{ij} x_j = b_i & (i = m_1 + 1, \cdots ,m) \\
x_j \ge 0& (j = 1, \cdots ,n_1 < n) \\
x_j \text{no constraint}&(j = n_1 + 1, \cdots ,n) \\
\end{cases}
\end{aligned}
\end{flalign*}
\end{mathlist2}
And then
some following text to check what the vertical spacing looks like.
\end{document}