正如我的代码所示,我使用了 eqnarray,但得到了两个数字。所以我尝试了该方法这里通过使用方程式和数组来代替。但我收到错误消息:“包数组错误:非法前缀标记 (\max):使用了 `c'。”和“额外的对齐标签已更改为 \cr。”
至于第二个错误,我检查了这但还是很困惑。该链接中的错误示例在各行中“&”的数量不同,但我的代码没有这样的问题。
我的代码如下。
\documentclass[notitlepage, 12pt]{amsart}
\usepackage{amsthm, amsmath, amsaddr, amssymb, graphicx, dsfont,}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator{\ima}{Im}
\newcommand{\namedthm}[2]{\theoremstyle{plain}
\newtheorem*{thm#1}{Theorem #1}\begin{thm#1}#2\end{thm#1}}
\usepackage{float}
\usepackage{tabularx}
\usepackage{array, makecell}
\NewExpandableDocumentCommand\mcc{O{1}m}%
{\multicolumn{#1}{c}{#2}}
\begin{document}
\begin{eqnarray}
\max\{0, \alpha_g-\beta_g\} \leq d_g \leq \min\{\alpha_g, 1-\beta_g\} &&\quad \mbox{ and } \\
\quad \max\{0, \alpha_b-\beta_b\} \leq d_b \leq \min\{\alpha_b, 1-\beta_b\}.&&
\end{eqnarray}\bigskip
\begin{equation}
\begin{array}
\max\{0, \alpha_g-\beta_g\} \leq d_g \leq \min\{\alpha_g, 1-\beta_g\} &&\quad \mbox{ and } \\
\quad \max\{0, \alpha_b-\beta_b\} \leq d_b \leq \min\{\alpha_b, 1-\beta_b\}.&&
\quad \max\{0, \alpha_b-\beta_b\} \leq d_b \leq \min\{\alpha_b, 1-\beta_b\}.
\end{array}
\end{equation}
\end{document}
答案1
我不太确定这是不是你想要的。如果不是,你可以用图片来说明你想要的效果。这将有助于我们更好地沟通。
\documentclass{amsart}
\begin{document}
\begin{equation}
\begin{array}{ll}
\max\{0, \alpha_g-\beta_g\} \leq d_g \leq \min\{\alpha_g, 1-\beta_g\} & \text{and} \\
\max\{0, \alpha_b-\beta_b\} \leq d_b \leq \min\{\alpha_b, 1-\beta_b\}. & \\
\end{array}
\end{equation}
\begin{equation}
\begin{array}{ll}
\max\{0, \alpha_g-\beta_g\} \leq d_g \leq \min\{\alpha_g, 1-\beta_g\} & \text{and} \\
\max\{0, \alpha_b-\beta_b\} \leq d_b \leq \min\{\alpha_b, 1-\beta_b\} & \text{and} \\
\max\{0, \alpha_b-\beta_b\} \leq d_b \leq \min\{\alpha_b, 1-\beta_b\}. & \\
\end{array}
\end{equation}
\end{document}
答案2
我建议您使用环境split
或环境aligned
内的环境equation
。这样,材料将以显示样式的数学模式排版,并且您将获得比使用环境array
默认提供的更大的行距。
\documentclass[notitlepage, 12pt]{amsart}
\begin{document}
\begin{equation}
\begin{split}
\max\{0, \alpha_g-\beta_g\} & \leq d_g \leq \min\{\alpha_g, 1-\beta_g\} , \text{ and} \\
\max\{0, \alpha_b-\beta_b\} & \leq d_b \leq \min\{\alpha_b, 1-\beta_b\} \,.
\end{split}
\end{equation}
\begin{equation}
\begin{aligned}
\max\{0, \alpha_g-\beta_g\} & \leq d_g \leq \min\{\alpha_g, 1-\beta_g\} , \\
\max\{0, \alpha_b-\beta_b\} & \leq d_b \leq \min\{\alpha_b, 1-\beta_b\}, \text{ and} \\
\max\{0, \alpha_b-\beta_b\} & \leq d_b \leq \min\{\alpha_b, 1-\beta_b\}\,.
\end{aligned}
\end{equation}
\end{document}