# Split matrix over two lines

I am having troubles in splitting the following equation over two lines - it is too long to fit in one line.

Ideally, I would like to split it between

\end{pmatrix}=
%%% split here
\begin{pmatrix}


I tried both the split and the multiline environment but they do not seems to work with this particular case. Here the code

$$\label{eq:varcov} var \begin{bmatrix} y_{11} \\ y_{12} \\ y_{13} \\ y_{2} \\ y_{31} \\ y_{32} \end{bmatrix}= \\ \begin{pmatrix} \Sigma_1 & & \\ & \Sigma_2 & \\ & & \Sigma_3 \end{pmatrix}= % split here \begin{pmatrix} \sigma_B^2 + \sigma_W^2 + V_{11}^2 & \sigma_B^2 & \sigma_B^2 & & & \\ \sigma_B^2 & \sigma_B^2 + \sigma_W^2 + V_{12}^2 & \sigma_B^2 & & & \\ \sigma_B^2 & \sigma_B^2 & \sigma_B^2 + \sigma_W^2 + V_{13}^2 & & & \\ & & & \sigma_B^2 + \sigma_W^2 + V_{2}^2 & & \\ & & & & \sigma_B^2 + \sigma_W^2 + V_{31}^2 & \sigma_B^2 \\ & & & & \sigma_B^2 & \sigma_B^2 + \sigma_W^2 + V_{32}^2 \\ \end{pmatrix}$$


Thanks in advance for the help

• you must have amsmath loaded, for pmatrix so use multline not equation Jan 15 '17 at 15:45

There's no way that big matrix would fit on a page. But it's the purpose of symbol that of representing something else.

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\var}{var} % ??

\begin{document}

$$\label{eq:varcov} \var \begin{bmatrix} y_{11} \\ y_{12} \\ y_{13} \\ y_{2} \\ y_{31} \\ y_{32} \end{bmatrix}= \begin{pmatrix} \Sigma_1 & & \\ & \Sigma_2 & \\ & & \Sigma_3 \end{pmatrix}$$
where
\begin{align*}
\Sigma_1&=
\begin{pmatrix}
\sigma_B^2 + \sigma_W^2 + V_{11}^2 & \sigma_B^2 & \sigma_B^2 \\
\sigma_B^2 & \sigma_B^2 + \sigma_W^2 + V_{12}^2  & \sigma_B^2 \\
\sigma_B^2 & \sigma_B^2 & \sigma_B^2 + \sigma_W^2 + V_{13}^2
\end{pmatrix}
\\[2ex]
\Sigma_2&=\sigma_B^2 + \sigma_W^2 + V_{2}^2
\\[2ex]
\Sigma_3&=
\begin{pmatrix}
\sigma_B^2 + \sigma_W^2 + V_{31}^2  & \sigma_B^2 \\
\sigma_B^2  &   \sigma_B^2 + \sigma_W^2 + V_{32}^2
\end{pmatrix}
\end{align*}

\end{document}


• Thanks for the answer. You are right, even splitting it up (I used multline), the last matrix was too wide to fit. I guess I will go for a different approach such as the one you proposed. Thank you for your help, much appreciated Jan 15 '17 at 16:07

I propose to use the aligned environment together with the \fleqnenvironment and the \medmath command from nccmath:

    \documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{mathtools}
\usepackage{nccmath}
\DeclareMathOperator{\var}{Var}

\begin{document}

\begin{fleqn}
\label{eq:varcov} \begin{aligned} \var & \begin{bmatrix} y_{11} \\ y_{12} \\ y_{13} \\ y_{2} \\ y_{31} \\ y_{32} \end{bmatrix}= \begin{pmatrix} \Sigma_1 & & \\ & \Sigma_2 & \\ & & \Sigma_3 \end{pmatrix}=\\ % split here & \medmath{\setlength{\arraycolsep}{2pt}\renewcommand\arraystretch{1.5} \begin{pmatrix} \cramped{\sigma_B^2 + \sigma_W^2 + V_{11}^2} & \sigma_B^2 & \sigma_B^2 & & & \\ \sigma_B^2 & \sigma_B^2 + \sigma_W^2 + V_{12}^2 & \sigma_B^2 & & & \\ \sigma_B^2 & \sigma_B^2 & \sigma_B^2 + \sigma_W^2 + V_{13}^2 & & & \\ & & & \sigma_B^2 + \sigma_W^2 + V_{2}^2 & & \\ & & & & \sigma_B^2 + \sigma_W^2 + V_{31}^2 & \sigma_B^2 \\ & & & & \sigma_B^2 & \sigma_B^2 + \sigma_W^2 + V_{32}^2 \\ \end{pmatrix}} \end{aligned}
\end{fleqn}
\end{document}