我的 MWE:
\documentclass{report}
\usepackage{amsmath}
\begin{document}
\begin{align}
y &= a \\
=& -2c_1\bar{z}_1^2 + 2\bar{z}_1\bar{z}_2 + 2\bar{z}_2 \left ( -\bar{z}_1 -c_2z_2 - \frac{3\epsilon}{2}\bar{z}_2 -\sigma_{2,1}\cos(x_1)\Delta x_1 \notag \right. \\
\left. &- \sigma_{2,2}\Delta x_2 -\sigma_{2,3} \Delta u +c_2 \chi_2 \vphantom{\frac{1}{1}} \right ) - 2\gamma \sigma_{2,1}^2\cos^2(x_1) \Delta x_1^2 - \gamma \sigma_{2,2}^2 \Delta x_2^2 - 2\gamma \sigma_{2,3}^2 \Delta u^2
\end{align}
\end{document}
我收到的错误:
Extra }, or forgotten \right.
预期结果:
答案1
如果您只希望代码可编译,\left.
则应移至下一栏。但为了获得正确的外观,还需要进行许多额外的更改。第二个示例中有一些建议。
\documentclass{report}
\usepackage{amsmath}
\begin{document}
\begin{align}
y &= a \\
=& -2c_1\bar{z}_1^2 + 2\bar{z}_1\bar{z}_2 + 2\bar{z}_2 \left (
-\bar{z}_1 -c_2z_2 - \frac{3\epsilon}{2}\bar{z}_2 -\sigma_{2,1}\cos(x_1)\Delta x_1 \notag
\right. \\
&\left.- \sigma_{2,2}\Delta x_2 -\sigma_{2,3} \Delta u +c_2 \chi_2 \vphantom{\frac{1}{1}} \right ) - 2\gamma \sigma_{2,1}^2\cos^2(x_1) \Delta x_1^2 - \gamma \sigma_{2,2}^2 \Delta x_2^2 - 2\gamma \sigma_{2,3}^2 \Delta u^2
\end{align}
\begin{align}
y &= a \notag\\
& = -2c_1\bar{z}_1^2 + 2\bar{z}_1\bar{z}_2 \notag\\
& {}+ 2\bar{z}_2 \left (
-\bar{z}_1 -c_2z_2 - \frac{3\epsilon}{2}\bar{z}_2 -\sigma_{2,1}\cos(x_1)\Delta x_1 - \sigma_{2,2}\Delta x_2 -\sigma_{2,3} \Delta u +c_2 \chi_2 \vphantom{\frac{1}{1}} \right )\notag\\
& - 2\gamma \sigma_{2,1}^2\cos^2(x_1) \Delta x_1^2 - \gamma \sigma_{2,2}^2 \Delta x_2^2 - 2\gamma \sigma_{2,3}^2 \Delta u^2
\end{align}
\end{document}
答案2
正如其他人已经指出的那样,您收到的错误消息是因为指令\left.
和\right)
被对齐字符分隔&
。在将\left.
指令移动到后字符&
将消除立即的错误,但方程的布局仍然不太好。特别是,和产生的自动调整大小的括号\left
太大\right
,最终在视觉上主导了整个方程组。我认为你最好使用\Bigl(
和\Bigr
,即不是使用自动大小的括号。
将方程式分成三行而不是两行可能效果会更好。
\documentclass{report}
\usepackage{amsmath}
\begin{document}
\begin{align}
y &= a \notag\\
&= -2c_1\bar{z}_1^2 + 2\bar{z}_1\bar{z}_2 + 2\bar{z}_2 \Bigl( -\bar{z}_1 -c_2z_2 - \frac{3\epsilon}{2}\bar{z}_2 -\sigma_{2,1}\cos(x_1)\Delta x_1 \notag \\
&\qquad- \sigma_{2,2}\Delta x_2 -\sigma_{2,3} \Delta u +c_2 \chi_2 \vphantom{\frac{1}{1}} \Bigr) - 2\gamma \sigma_{2,1}^2\cos^2(x_1) \Delta x_1^2 \notag\\
&\qquad- \gamma \sigma_{2,2}^2 \Delta x_2^2 - 2\gamma \sigma_{2,3}^2 \Delta u^2
\end{align}
\end{document}