2

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

\begin{equation}
\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}
\end{equation}

Thanks in advance for the help

1
  • you must have amsmath loaded, for pmatrix so use multline not equation Commented Jan 15, 2017 at 15:45

2 Answers 2

2

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}

\begin{equation}
\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}
\end{equation}
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}

enter image description here

1
  • 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
    – Marco C
    Commented Jan 15, 2017 at 16:07
1

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}
\begin{equation}
\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{equation}
\end{fleqn}
     \end{document} 

enter image description here

You must log in to answer this question.

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