在下面的代码中,我希望最后一个方程编号出现在分割方程的中心线上,如下所示:
你能帮助我吗?
这是我的代码:
\documentclass[11pt]{book}
\usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry}
\usepackage{amsmath,amsthm}
\begin{document}
\begin{align}\label{wnoise}
\begin{bmatrix}
x_{wn}\\
y_{wn}
\end{bmatrix} & =
\left[\begin{matrix}
(L_{1} + \delta r_{3} + r_{3vn})\cos\theta_{1}+\\
(L_{1} + \delta r_{3} + r_{3vn})\sin\theta_{1}-
\end{matrix}
\begin{matrix}
(\delta r_{2} + r_{2vn})\sin\theta_{1}\\
(\delta r_{2} + r_{2vn})\cos\theta_{1}
\end{matrix}\right]
+\begin{bmatrix}
v_{xn}\\
v_{yn}
\end{bmatrix}\\
\begin{bmatrix}
x_{wn}\\
y_{wn}
\end{bmatrix}-
\begin{bmatrix}
v_{xn}\\
v_{yn}
\end{bmatrix} & =
\begin{bmatrix}
\sin\theta_{1} & \cos\theta_{1} \\
-\cos\theta_{1} & \sin\theta_{1}
\end{bmatrix}
{\begin{bmatrix}
\delta r_{2} \\
\delta r_{3}
\end{bmatrix}}+\left[\begin{matrix}
(L_{1} + r_{3vn})\cos\theta_{1} + r_{2vn}\sin\theta_{1}\\
(L_{1} + r_{3vn})\sin\theta_{1} - r_{2vn}\cos\theta_{1}
\end{matrix}\right]\\
\begin{bmatrix}
\delta r_{2} \\
\delta r_{3}
\end{bmatrix} & =
\begin{bmatrix}
\sin\theta_{1} & \cos\theta_{1} \\
-\cos\theta_{1} & \sin\theta_{1}
\end{bmatrix}^{-1}\left(\begin{bmatrix}
x_{wn}\\
y_{wn}
\end{bmatrix} -
\left[\begin{matrix}
(L_{1} + r_{3vn})\cos\theta_{1}+ \\
(L_{1} + r_{3vn})\cos\theta_{1}-
\end{matrix}\right.\right.\nonumber\\
&\hspace{6.2cm}
\left.\left.\begin{matrix}
r_{2vn}\sin\theta_{1}\\
r_{2vn}\cos\theta_{1}
\end{matrix}\right]
- \begin{bmatrix}
v_{xn}\\
v_{yn}
\end{bmatrix}\right)
\end{align}
\end{document}
答案1
我不会将宽矩阵分成两行,而是在乘法处断点,这是一个更自然的断点。
对于不同的休息风格,你可以使用相同的想法。
\documentclass[11pt]{book}
\usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry}
\usepackage{amsmath,amsthm}
\begin{document}
\begin{align}\label{wnoise}
\begin{bmatrix}
x_{wn}\\
y_{wn}
\end{bmatrix} & =
\left[\begin{matrix}
(L_{1} + \delta r_{3} + r_{3vn})\cos\theta_{1}+\\
(L_{1} + \delta r_{3} + r_{3vn})\sin\theta_{1}-
\end{matrix}
\begin{matrix}
(\delta r_{2} + r_{2vn})\sin\theta_{1}\\
(\delta r_{2} + r_{2vn})\cos\theta_{1}
\end{matrix}\right]
+\begin{bmatrix}
v_{xn}\\
v_{yn}
\end{bmatrix}\\
\begin{bmatrix}
x_{wn}\\
y_{wn}
\end{bmatrix}-
\begin{bmatrix}
v_{xn}\\
v_{yn}
\end{bmatrix} & =
\begin{bmatrix}
\sin\theta_{1} & \cos\theta_{1} \\
-\cos\theta_{1} & \sin\theta_{1}
\end{bmatrix}
\begin{bmatrix}
\delta r_{2} \\
\delta r_{3}
\end{bmatrix}+\left[\begin{matrix}
(L_{1} + r_{3vn})\cos\theta_{1} + r_{2vn}\sin\theta_{1}\\
(L_{1} + r_{3vn})\sin\theta_{1} - r_{2vn}\cos\theta_{1}
\end{matrix}\right]\\
\begin{split}
\begin{bmatrix}
\delta r_{2} \\
\delta r_{3}
\end{bmatrix} & =
\begin{bmatrix}
\sin\theta_{1} & \cos\theta_{1} \\
-\cos\theta_{1} & \sin\theta_{1}
\end{bmatrix}^{-1}\cdot{}\\
&\qquad\qquad
\left(
\begin{bmatrix}
x_{wn}\\
y_{wn}
\end{bmatrix} -
\begin{bmatrix}
(L_{1} + r_{3vn})\cos\theta_{1}+r_{2vn}\sin\theta_{1}\\
(L_{1} + r_{3vn})\cos\theta_{1}-r_{2vn}\cos\theta_{1}
\end{bmatrix} -
\begin{bmatrix}
v_{xn}\\
v_{yn}
\end{bmatrix}
\right)
\end{split}
\end{align}
\end{document}
请注意如何split
嵌套align
以便数字垂直位于其中间。
答案2
一些评论:
在里面输入,我不会将同一个单元格的各个部分拆分到不同的
matrix
环境中,因为这样做会弄乱加号和减号周围的间距。对于第三个等式中的换行符,请考虑将换行符插入得更早,即在 2x2(反转)矩阵之后。egreg 的回答中也提到了这一点。
对于第三个方程式,选择这种新的换行方式时,最好将方程式编号留在默认位置,即以第二组项为中心。
\documentclass[11pt]{book}
\usepackage[vmargin=3cm,hmargin=3.2cm,headsep=10pt,a4paper]{geometry}
\usepackage{amsmath,amsthm}
\begin{document}
\begin{align}\label{wnoise}
\begin{bmatrix}
x_{wn}\\
y_{wn}
\end{bmatrix}
&=
\begin{bmatrix}
(L_{1} + \delta r_{3} + r_{3vn})\cos\theta_{1}+
(\delta r_{2} + r_{2vn})\sin\theta_{1}\\
(L_{1} + \delta r_{3} + r_{3vn})\sin\theta_{1}-
(\delta r_{2} + r_{2vn})\cos\theta_{1}
\end{bmatrix}
+ \begin{bmatrix}
v_{xn}\\
v_{yn}
\end{bmatrix}\\
%% 2nd eq.
\begin{bmatrix}
x_{wn}\\
y_{wn}
\end{bmatrix}
- \begin{bmatrix}
v_{xn}\\
v_{yn}
\end{bmatrix}
&=
\begin{bmatrix}
\hfill\sin\theta_{1} & \cos\theta_{1} \\
-\cos\theta_{1} & \sin\theta_{1}
\end{bmatrix}
\begin{bmatrix}
\delta r_{2} \\
\delta r_{3}
\end{bmatrix}+
\begin{bmatrix}
(L_{1} + r_{3vn})\cos\theta_{1} + r_{2vn}\sin\theta_{1}\\
(L_{1} + r_{3vn})\sin\theta_{1} - r_{2vn}\cos\theta_{1}
\end{bmatrix}\\
%% 3rd eq.
\begin{bmatrix}
\delta r_{2} \\
\delta r_{3}
\end{bmatrix}
&=
\begin{bmatrix}
\hfill\sin\theta_{1} & \cos\theta_{1} \\
-\cos\theta_{1} & \sin\theta_{1}
\end{bmatrix}^{-1} \nonumber \\
&\qquad\times\left(
\begin{bmatrix}
x_{wn}\\
y_{wn}
\end{bmatrix} -
\begin{bmatrix}
(L_{1} + r_{3vn})\cos\theta_{1}+r_{2vn}\sin\theta_{1}\\
(L_{1} + r_{3vn})\cos\theta_{1}-r_{2vn}\cos\theta_{1}
\end{bmatrix}
- \begin{bmatrix}
v_{xn}\\
v_{yn}
\end{bmatrix}
\right)
\end{align}
\end{document}