“方程结构嵌套错误”消息 - 我看不出出了什么问题?

“方程结构嵌套错误”消息 - 我看不出出了什么问题?

我在 Texmaker 中有以下方程组:

\begin{equation}
\begin{align}
\begin{split}
  a(t_{n+1}) \cos \varphi_{n+1} = a(t_{n}) \cos \varphi_{n} + \sqrt{2E_{n}}(t_{n+1} - t_{n}) \cos( \alpha_{n}+ \theta{_n}),
\\
b(t_{n+1})\sin \varphi_{n+1} \left(1+ \delta \sin^{2} \varphi_{n+1} \right) = b(t_{n})\sin \varphi_{n} \left(1+ \delta \sin^{2} \varphi_{n} \right) + \sqrt{2E_{n}}(t_{n+1}-t_{n}) \sin (\alpha_{n} + \theta_{n}),
 \\
 \theta_{n} + \alpha_{n} + \theta^{*}_{n+1} - \alpha_{n+1} = 0,
 \\
 \sqrt{2E_{n+1}}\cos \theta_{n+1} = \sqrt{2E_{n}}\cos\theta^{*}_{n+1},
 \\
 \sqrt{2E_{n+1}}\sin\theta_{n+1} = \sqrt{2E_{n}}\sin\theta^{*}_{n+1}-2u(\varphi_{n+1}, t_{n+1}).
\end{split}
\end{align}
\label{system}
\end{equation}

当我编译时,出现以下错误消息:“包 amsmath 错误:方程结构嵌套错误;(amsmath)尝试使用aligned... 进行恢复。”但是,我仍然可以生成正常的 PDF 文件。

如果有人能指出如何纠正此错误,我将不胜感激。我已经安装了 amsmath 包。

答案1

你不应该嵌套alignequation环境align就足够了:

\documentclass[]{article}

\usepackage{amsmath}

\begin{document}

\begin{align}
\begin{split}
  a(t_{n+1}) \cos \varphi_{n+1} = a(t_{n}) \cos \varphi_{n} + \sqrt{2E_{n}}(t_{n+1} - t_{n}) \cos( \alpha_{n}+ \theta{_n}),
\\
b(t_{n+1})\sin \varphi_{n+1} \left(1+ \delta \sin^{2} \varphi_{n+1} \right) = b(t_{n})\sin \varphi_{n} \left(1+ \delta \sin^{2} \varphi_{n} \right) + \sqrt{2E_{n}}(t_{n+1}-t_{n}) \sin (\alpha_{n} + \theta_{n}),
 \\
 \theta_{n} + \alpha_{n} + \theta^{*}_{n+1} - \alpha_{n+1} = 0,
 \\
 \sqrt{2E_{n+1}}\cos \theta_{n+1} = \sqrt{2E_{n}}\cos\theta^{*}_{n+1},
 \\
 \sqrt{2E_{n+1}}\sin\theta_{n+1} = \sqrt{2E_{n}}\sin\theta^{*}_{n+1}-2u(\varphi_{n+1}, t_{n+1}).
\end{split}
\label{system}
\end{align}
\end{document}

这可以编译(但在我看来,很糟糕)。

我认为水平对齐看起来更好:

\documentclass[]{article}

\usepackage{amsmath}
\usepackage[margin=1cm]{geometry}

\begin{document}
Without alignment:
\begin{align}
\begin{split}
  a(t_{n+1}) \cos \varphi_{n+1} = a(t_{n}) \cos \varphi_{n} + \sqrt{2E_{n}}(t_{n+1} - t_{n}) \cos( \alpha_{n}+ \theta{_n}),
\\
b(t_{n+1})\sin \varphi_{n+1} \left(1+ \delta \sin^{2} \varphi_{n+1} \right) = b(t_{n})\sin \varphi_{n} \left(1+ \delta \sin^{2} \varphi_{n} \right) + \sqrt{2E_{n}}(t_{n+1}-t_{n}) \sin (\alpha_{n} + \theta_{n}),
 \\
 \theta_{n} + \alpha_{n} + \theta^{*}_{n+1} - \alpha_{n+1} = 0,
 \\
 \sqrt{2E_{n+1}}\cos \theta_{n+1} = \sqrt{2E_{n}}\cos\theta^{*}_{n+1},
 \\
 \sqrt{2E_{n+1}}\sin\theta_{n+1} = \sqrt{2E_{n}}\sin\theta^{*}_{n+1}-2u(\varphi_{n+1}, t_{n+1}).
\end{split}
\label{system}
\end{align}

With alignment:
\begin{align}
\begin{split}
  a(t_{n+1}) \cos \varphi_{n+1} &= a(t_{n}) \cos \varphi_{n} + \sqrt{2E_{n}}(t_{n+1} - t_{n}) \cos( \alpha_{n}+ \theta{_n}),
\\
b(t_{n+1})\sin \varphi_{n+1} \left(1+ \delta \sin^{2} \varphi_{n+1} \right) &= b(t_{n})\sin \varphi_{n} \left(1+ \delta \sin^{2} \varphi_{n} \right) + \sqrt{2E_{n}}(t_{n+1}-t_{n}) \sin (\alpha_{n} + \theta_{n}),
 \\
 \theta_{n} + \alpha_{n} + \theta^{*}_{n+1} - \alpha_{n+1} &= 0,
 \\
 \sqrt{2E_{n+1}}\cos \theta_{n+1} &= \sqrt{2E_{n}}\cos\theta^{*}_{n+1},
 \\
 \sqrt{2E_{n+1}}\sin\theta_{n+1} &= \sqrt{2E_{n}}\sin\theta^{*}_{n+1}-2u(\varphi_{n+1}, t_{n+1}).
\end{split}
\label{system2}
\end{align}
\end{document}

在此处输入图片描述

答案2

align已经将您置于数学模式,因此请删除冗余equation环境。我还将 移到了\label里面align

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{amsmath}
\begin{document}
%\begin{equation}
\begin{align}
\begin{split}
  a(t_{n+1}) \cos \varphi_{n+1} = a(t_{n}) \cos \varphi_{n} + \sqrt{2E_{n}}(t_{n+1} - t_{n}) \cos( \alpha_{n}+ \theta{_n}),
\\
b(t_{n+1})\sin \varphi_{n+1} \left(1+ \delta \sin^{2} \varphi_{n+1} \right) = b(t_{n})\sin \varphi_{n} \left(1+ \delta \sin^{2} \varphi_{n} \right) + \sqrt{2E_{n}}(t_{n+1}-t_{n}) \sin (\alpha_{n} + \theta_{n}),
 \\
 \theta_{n} + \alpha_{n} + \theta^{*}_{n+1} - \alpha_{n+1} = 0,
 \\
 \sqrt{2E_{n+1}}\cos \theta_{n+1} = \sqrt{2E_{n}}\cos\theta^{*}_{n+1},
 \\
 \sqrt{2E_{n+1}}\sin\theta_{n+1} = \sqrt{2E_{n}}\sin\theta^{*}_{n+1}-2u(\varphi_{n+1}, t_{n+1}).
\end{split}
\label{system}
\end{align}
%\end{equation}
\end{document}

在此处输入图片描述

或者,您可以保留equation环境,并更改alignaligned

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{aligned}
\begin{split}
  a(t_{n+1}) \cos \varphi_{n+1} = a(t_{n}) \cos \varphi_{n} + \sqrt{2E_{n}}(t_{n+1} - t_{n}) \cos( \alpha_{n}+ \theta{_n}),
\\
b(t_{n+1})\sin \varphi_{n+1} \left(1+ \delta \sin^{2} \varphi_{n+1} \right) = b(t_{n})\sin \varphi_{n} \left(1+ \delta \sin^{2} \varphi_{n} \right) + \sqrt{2E_{n}}(t_{n+1}-t_{n}) \sin (\alpha_{n} + \theta_{n}),
 \\
 \theta_{n} + \alpha_{n} + \theta^{*}_{n+1} - \alpha_{n+1} = 0,
 \\
 \sqrt{2E_{n+1}}\cos \theta_{n+1} = \sqrt{2E_{n}}\cos\theta^{*}_{n+1},
 \\
 \sqrt{2E_{n+1}}\sin\theta_{n+1} = \sqrt{2E_{n}}\sin\theta^{*}_{n+1}-2u(\varphi_{n+1}, t_{n+1}).
\end{split}
\label{system}
\end{aligned}
\end{equation}
\end{document}

答案3

您不必嵌套align equation。如果您想要一个公式编号,请嵌套alignedsplit,但不能同时嵌套 ,并使用&作为对齐点。我建议三种可能的布局:要么使用aligned,第二行很长,用 分割multlinedmathtools要么gathered使用multlined(无对齐点),或者aligned使用 但 作为第二行:

    \documentclass{article}
\usepackage[showframe]{geometry}
    \usepackage{mathtools, nccmath}

    \begin{document}

\begin{equation}
\begin{aligned}
 a(t_{n+1}) \cos \varphi_{n+1} & = a(t_{n}) \cos \varphi_{n} + \sqrt{2E_{n}}(t_{n+1} - t_{n}) \cos( \alpha_{n}+ \theta_{n}), \\ b(t_{n+1})\sin \varphi_{n+1} \left(1+ \delta \sin^{2} \varphi_{n+1} \right) & = \begin{multlined}[t] b(t_{n})\sin \varphi_{n} \left(1+ \delta \sin^{2} \varphi_{n} \right) \\+ \sqrt{2E_{n}}(t_{n+1}-t_{n}) \sin (\alpha_{n} + \theta_{n}),\end{multlined} \\%
  \theta_{n} + \alpha_{n} + \theta^{}_{n+1} - \alpha_{n+1} & = 0, \\%
   \sqrt{2E_{n+1}}\cos \theta_{n+1} & = \sqrt{2E_{n}}\cos\theta^{}_{n+1}, \\%
   \sqrt{2E_{n+1}}\sin\theta_{n+1} & = \sqrt{2E_{n}}\sin\theta^{*}_{n+1}-2u(\varphi_{n+1}, t_{n+1}).
 \end{aligned}\label{system}
 \end{equation}
\bigskip
\begin{equation}
\begin{gathered}
 a(t_{n+1}) \cos \varphi_{n+1} = a(t_{n}) \cos \varphi_{n} + \sqrt{2E_{n}}(t_{n+1} - t_{n}) \cos( \alpha_{n}+ \theta_{n}), \\ b(t_{n+1})\sin \varphi_{n+1} \left(1+ \delta \sin^{2} \varphi_{n+1} \right) = \begin{multlined}[t] b(t_{n})\sin \varphi_{n} \left(1+ \delta \sin^{2} \varphi_{n} \right) \\+ \sqrt{2E_{n}}(t_{n+1}-t_{n}) \sin (\alpha_{n} + \theta_{n}),\end{multlined} \\%
  \theta_{n} + \alpha_{n} + \theta^{}_{n+1} - \alpha_{n+1} = 0, \\%
   \sqrt{2E_{n+1}}\cos \theta_{n+1} = \sqrt{2E_{n}}\cos\theta^{}_{n+1}, \\%
   \sqrt{2E_{n+1}}\sin\theta_{n+1}= \sqrt{2E_{n}}\sin\theta^{*}_{n+1}-2u(\varphi_{n+1}, t_{n+1}).
 \end{gathered}\label{system}
 \end{equation}
\bigskip
 \begin{equation}
\begin{aligned}
 a(t_{n+1}) \cos \varphi_{n+1} & = a(t_{n}) \cos \varphi_{n} + \sqrt{2E_{n}}(t_{n+1} - t_{n}) \cos( \alpha_{n}+ \theta_{n}), \\ %
\MoveEqLeft[2]\mathclap{b(t_{n+1})\sin \varphi_{n+1} \left(1+ \delta \sin^{2} \varphi_{n+1} \right) = b(t_{n})\sin \varphi_{n} \left(1+ \delta \sin^{2} \varphi_{n} \right) \mathrlap{+ \sqrt{2E_{n}}(t_{n+1}-t_{n}) \sin (\alpha_{n} + \theta_{n}),}} \\%
    \theta_{n} + \alpha_{n} + \theta^{}_{n+1} - \alpha_{n+1} & = 0, \\%
     \sqrt{2E_{n+1}}\cos \theta_{n+1} & = \sqrt{2E_{n}}\cos\theta^{}_{n+1}, \\%
     \sqrt{2E_{n+1}}\sin\theta_{n+1} & = \sqrt{2E_{n}}\sin\theta^{*}_{n+1}-2u(\varphi_{n+1}, t_{n+1}).
 \end{aligned}\label{system}
 \end{equation}

    \end{document} 

在此处输入图片描述

相关内容