我刚刚发现\noalign
可以将数字改为底部。但通常人们希望它出现在中间。如果我注释\noalign{choose $\overline{\vec{x}}^{n-1}$ with $\mathcal{F}(\overline{\vec{x}}^{n-1} )\le\min(\vec{F}({\vec{x}'}^{n-1}),\vec{F}(\vec{x}'))$}\\
,数字的位置就没问题。如何将数字保持在正确的位置并使用\noalign
?
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\left\{
\begin{align}
\vec{x}&=\vec{x}^{n-1}+\alpha(\vec{u}-\vec{x}^{n-1})\\
\overline{\vec{y}}&=\vec{y}+\alpha(\nabla\mathcal{F}(\vec{x})-\vec{y})\\
\overline{\gamma}&=\gamma+\alpha(\mathcal{F}(\vec{x})-\avg{\nabla{F}(\vec{x}),\vec{x}}-\gamma)\\
{\vec{x}'}^{n-1}&=\argmin\limits_{\vec{z}\in\bra{\vec{x},\vec{x}^{n-1}}}\mathcal{F}(\vec{z})\\
{\gamma'}^{n-1}&=\overline{\gamma}-\mathcal{F}({\vec{x'}^{n-1}})\\
\vec{u}'&=\mathcal{U}({{\gamma'}^{n-1}},\overline{\vec{y}})\\
\vec{x}'&=\vec{x}^{n-1}+\alpha(\vec{u}'-\vec{x}^{n-1})\\
\noalign{choose $\overline{\vec{x}}^{n-1}$ with $\mathcal{F}(\overline{\vec{x}}^{n-1} )\le\min(\vec{F}({\vec{x}'}^{n-1}),\vec{F}(\vec{x}'))$}\\
\overline{\gamma}^n&=\overline{\gamma}-\mathcal{F}(\overline{\vec{x}}^{n-1})\\
\overline{\vec{u}}&=\mathcal{U}(\overline{\gamma}^n,\overline{\vec{y}})\\
\overline{\eta}&=\mathcal{E}(\overline{\gamma}^n,\overline{\vec{y}})\\
\vec{x}^n&=\overline{\vec{x}}^{n-1}\\
\end{align}
\right.
\end{equation}
\end{document}
答案1
主要错误是align
不能在数学模式下使用。我还猜测了你未定义的命令的定义,并修复了双下标错误。
\noalign
不是在文档中使用的用户级命令。通常情况下,align
您可以使用\intertext
,但在这里,aligned
我只使用了\rlap
。
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator\avg{avg}
\DeclareMathOperator\argmin{argmin}
\newcommand\bra[1]{\langle#1\rangle}
\begin{document}
\begin{equation}
\left\{
\begin{aligned}
\vec{x}&=\vec{x}^{n-1}+\alpha(\vec{u}-\vec{x}^{n-1})\\
\overline{\vec{y}}&=\vec{y}+\alpha(\nabla\mathcal{F}(\vec{x})-\vec{y})\\
\overline{\gamma}&=\gamma+\alpha(\mathcal{F}(\vec{x})-\avg{\nabla{F}(\vec{x}),\vec{x}}-\gamma)\\
{\vec{x}'{}}^{n-1}&=\argmin\limits_{\vec{z}\in\bra{\vec{x},\vec{x}^{n-1}}}\mathcal{F}(\vec{z})\\
{\gamma'}^{n-1}&=\overline{\gamma}-\mathcal{F}({\vec{x'}^{n-1}})\\
\vec{u}'&=\mathcal{U}({{\gamma'}^{n-1}},\overline{\vec{y}})\\
\vec{x}'&=\vec{x}^{n-1}+\alpha(\vec{u}'-\vec{x}^{n-1})\\
\rlap{\hspace{-2em}choose $\overline{\vec{x}}^{n-1}$ with $\mathcal{F}(\overline{\vec{x}}^{n-1} )\le
\min(\vec{F}({\vec{x}'{}}^{n-1}),\vec{F}(\vec{x}'))$}\\
\overline{\gamma}^n&=\overline{\gamma}-\mathcal{F}(\overline{\vec{x}}^{n-1})\\
\overline{\vec{u}}&=\mathcal{U}(\overline{\gamma}^n,\overline{\vec{y}})\\
\overline{\eta}&=\mathcal{E}(\overline{\gamma}^n,\overline{\vec{y}})\\
\vec{x}^n&=\overline{\vec{x}}^{n-1}\\
\end{aligned}
\right.
\end{equation}
\end{document}