# Aligning Multiline Matrix Equations

I need to align two equations, one of which spans two lines.

I've tried the solution here, but this isn't for matrix equations, and it doesn't seem to work with these.

My minimized code is:

\begin{align}           %start alignment between state and observation equation
%State Equation
\begin{split}           %split the observation equation in two so it fits on the page
\begin{bmatrix}
a\\
b\\
c
\end{bmatrix}
&=                    %This & is to align the state and observation equation
\begin{bmatrix}
a&b\\
b&c\\
d&e
\end{bmatrix}
&                        %This & is to align the splitted state equation
\begin{bmatrix}
a\\
b\\
c
\end{bmatrix}\\           %This \\is to split the state equation
+
\begin{bmatrix}
a&b\\
b&c\\
c&d
\end{bmatrix}
\begin{bmatrix}
a\\
b\\
c\\
\end{bmatrix} +
\begin{bmatrix}
a\\
b
\end{bmatrix}
&a                         %This & is to align the splitted state equation
\end{split} \\             %This \\ is to split the state and observation equation
%Observation Equation
a &=                       %This & is to align the state and observation equation
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
a\\
b
\end{bmatrix}
\end{align}


I've minimized the code slightly in the above example for readability. But my actual output looks like this:

Annoyingly equation 5.17 (The state equation) splits into 3 instead of into 2 so it fits on the page. I also get the error Extra alignment tab has been changed to \cr.

How do I get it so equation 5.17 is split into two, and also equation 5.17 and 5.18 are aligned?

Desired look

But with less space between the two parts of the state equation (5.17)

• What should the desired look like? :P – Alenanno May 18 '15 at 11:44

The split is redundant to the align. Simply use \notag to avoid putting an equation number on any particular line.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{align}           %start alignment between state and observation equation
%State Equation
%\begin{split}           %split the observation equation in two so it fits on the page
\begin{bmatrix}
a\\
b\\
c
\end{bmatrix}
&=                    %This & is to align the state and observation equation
\begin{bmatrix}
a&b\\
b&c\\
d&e
\end{bmatrix}
\begin{bmatrix}
a\\
b\\
c
\end{bmatrix} \notag \\ %split here
\begin{bmatrix}
a&b\\
b&c\\
c&d
\end{bmatrix}
\begin{bmatrix}
a\\
b\\
c\\
\end{bmatrix} +
\begin{bmatrix}
a\\
b
\end{bmatrix} a
\\             %This \\ is to split the state and observation equation
%Observation Equation
a &=                       %This & is to align the state and observation equation
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
a\\
b
\end{bmatrix}
\end{align}

\end{document}


• Does \notag completely remove the number, or does it just not display it? i.e, will this mess up the ordering of the other equations? – Blue7 May 18 '15 at 13:11
• The number is neither used, displayed nor incremented. \label will not work on \notag, nor will it appear in a list of equations. – John Kormylo May 18 '15 at 15:09

You can try with

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align}
\begin{split}
\begin{bmatrix}
a\\ b\\ c
\end{bmatrix}&=\begin{bmatrix}
a & b & c \\ e & f & g \\ h & i & j
\end{bmatrix}\begin{bmatrix}
ab \\ cd \\ ef
\end{bmatrix} \\
&\phantom{aaaaaa}+\begin{bmatrix}
a & b \\ c & d \\ e & f
\end{bmatrix}\begin{bmatrix}
ab \\ cd \\ ef
\end{bmatrix}+\begin{bmatrix}
a \\ b
\end{bmatrix}X
\end{split}\\
Y&=\begin{bmatrix}
a & b
\end{bmatrix}\begin{bmatrix}
c \\ d
\end{bmatrix}
\end{align}

\end{document}


• Perfect! Thank you so much! Can I just ask, apart from the use of the phantom a, how is this different from the code I gave in the question? I can see that yours works and mine doesn't, but I cant see why. – Blue7 May 18 '15 at 12:44
• Well, your code makes error in online compiler :v ... I just create a new code. In your code there are & after second bmatrix, because that the third matrix appear out of place ... – juanuni May 18 '15 at 13:10
• You can mark my response like solution :v ... – juanuni May 18 '15 at 13:17