Latex 中 amsmath 和方程式的错误

Latex 中 amsmath 和方程式的错误

我是第一次在这个网站上写作,所以如果我写得不对,请多多包涵。所以我试着在 Latex 中输入这个方程,

方程

我使用 MathType 编写了它并获取了它的乳胶代码,这里,

\[\left[ \begin{matrix}
   \cos \varphi  & \sin \varphi   \\
   -\sin \varphi \ \  & \cos \varphi \   \\
\end{matrix} \right]\ \left[ \begin{align}
  & x \\ 
 & y \\ 
\end{align} \right]=\left[ \begin{align}
  & 0 \\ 
 & P \\ 
\end{align} \right]+\left[ \begin{matrix}
   \cos {{\theta }_{1}} & \sin {{\theta }_{1}}  \\
   -\sin {{\theta }_{1}}\ \  & \cos {{\theta }_{1}}\   \\
\end{matrix} \right]\left( \left[ \begin{align}
  & 0 \\ 
 & M \\ 
\end{align} \right]+\left[ \begin{matrix}
   \cos {{\theta }_{2}} & \sin {{\theta }_{2}}  \\
   -\sin {{\theta }_{2}}\ \  & \cos {{\theta }_{2}}\   \\
\end{matrix} \right]\left[ \begin{align}
  & 0 \\ 
 & D \\ 
\end{align} \right] \right)\]

然而,当我在 Overleaf 上输入它时,出现以下错误:

Package amsmath Error: Erroneous nesting of equation structures;

(amsmath)                trying to recover with `aligned'.

See the amsmath package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.378 \end{align}
                  \right]=\left[ \begin{align}
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.



Package amsmath Error: Erroneous nesting of equation structures;

(amsmath)                trying to recover with `aligned'.

See the amsmath package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.381 \end{align}
                  \right]+\left[ \begin{matrix}
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.



Package amsmath Error: Erroneous nesting of equation structures;

(amsmath)                trying to recover with `aligned'.

See the amsmath package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.387 \end{align}
                  \right]+\left[ \begin{matrix}
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.



Package amsmath Error: Erroneous nesting of equation structures;

(amsmath)                trying to recover with `aligned'.

See the amsmath package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.393 \end{align}
                  \right] \right)\]
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

Thank you for your help in advance.

答案1

如果它输出错误的代码,我不确定使用 MathType 这样的工具是否方便。

经过一些练习,你就能直接输入代码了。这是一个可用的版本。

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\begin{bmatrix}
   \cos \varphi  & \sin \varphi \\
   -\sin \varphi & \cos \varphi
\end{bmatrix}
\begin{bmatrix} x \\ y \end{bmatrix}
=
\begin{bmatrix} 0 \\ P \end{bmatrix}
+
\begin{bmatrix}
   \cos \theta_{1} & \sin \theta_{1}  \\
   -\sin \theta_{1} & \cos \theta_{1}
\end{bmatrix}
\left(
  \begin{bmatrix} 0 \\ M \end{bmatrix}
  +
  \begin{bmatrix}
   \cos \theta_{2} & \sin \theta_{2}  \\
   -\sin \theta_{2} & \cos \theta_{2}
  \end{bmatrix}
  \begin{bmatrix} 0 \\ D \end{bmatrix}
\right)
\]

\end{document}

如您所见,没有“反斜杠空格”和无用的括号。对于括号分隔的矩阵,使用bmatrix。它完全等同于

\left[\begin{matrix}
... matrix rows ...
\end{matrix}\right]

但毫无疑问

\begin{bmatrix}
... matrix rows ...
\end{bmatrix}

代码更简单、更清晰。

在此处输入图片描述

为了解决过满问题,在这种情况下标准方法是使用multline*

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{multline*}
\begin{bmatrix}
   \cos \varphi  & \sin \varphi \\
   -\sin \varphi & \cos \varphi
\end{bmatrix}
\begin{bmatrix} x \\ y \end{bmatrix}
\\
=
\begin{bmatrix} 0 \\ P \end{bmatrix}
+
\begin{bmatrix}
   \cos \theta_{1} & \sin \theta_{1}  \\
   -\sin \theta_{1} & \cos \theta_{1}
\end{bmatrix}
\left(
  \begin{bmatrix} 0 \\ M \end{bmatrix}
  +
  \begin{bmatrix}
   \cos \theta_{2} & \sin \theta_{2}  \\
   -\sin \theta_{2} & \cos \theta_{2}  \\
  \end{bmatrix}
  \begin{bmatrix} 0 \\ D \end{bmatrix}
\right)
\end{multline*}

\end{document}

在此处输入图片描述

相关内容