3

In my code below, I wanted the last equation number to appear at the center line of the split equation, like this:

enter image description here

Can you assist me with this?

Here is my code:

\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}

2 Answers 2

5

I would not split the wide matrix across two lines, but break at the multiplication, which is a more natural break point.

You can use the same idea for the different break style.

\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}

Note how split is nested in align in order to have the number vertically in the middle of it.

enter image description here

0
1

Some comments:

  • In the input, I would not split parts of one and the same cell across different matrix environments, as doing so messes up the spacing around plus and minus symbols.

  • For the line break in the third equation, do consider inserting the line break earlier, i.e., right after the 2x2 (inverted) matrix. This point is also made in egreg's answer.

  • With this new choice of line break for the third equation, the equation number is best left where it is by default, i.e., centered on the second group of terms.

enter image description here

\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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .