3

I am writing some lecture notes in Econometrics and I want your advice on how to insert some vertical space between two matrices so the result will be easier to follow.

Here is the minimal example:

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

\begin{align*}
Var(u) &= E(uu') = \\
&= E
\begin{bmatrix}
u_1 u_1' & u_1 u_2' & \cdots & u_1 u_M' \\
u_2 u_1' & u_2 u_2' & \cdots & u_2 u_M' \\
\vdots & & \ddots & \vdots \\
u_M u_1' & u_M u_2' & \cdots & u_M u_M '
\end{bmatrix}
=
\begin{bmatrix}
\sigma_{11} I & \sigma_{12} I  & \cdots & \sigma_{1M} I \\
\sigma_{12} I & \sigma_{22} I  & \cdots & \sigma_{2M} I \\
\vdots &  & \ddots & \vdots\\
\sigma_{1n} I & \sigma_{2M} I & \cdots & \sigma_{MM} I
\end{bmatrix} \\
&= 
\begin{pmatrix}
\sigma_{11} & \sigma_{12} & \cdots & \sigma_{1M} \\
\sigma_{12} & \sigma_{22} & \cdots & \sigma_{2M} \\
\vdots &  & \ddots & \vdots \\
\sigma_{1M} & \sigma_{2M} & \cdots & \sigma_{MM}
\end{pmatrix} \otimes I_T
\end{align*}

\end{document}
  • 2
    You can use \[10pt] or so. (that should be a double backslash) – John Kormylo Mar 10 '14 at 21:18
  • @JohnKormylo using that command just before `\begin{pmatrix}' does not seem to do the job for me. What exactly do you mean? Thanks in advance. – Pantelis Kazakis Mar 10 '14 at 21:33
  • Should the term \otimes I_T really be typeset as a subscript to the preceding matrix? – Mico Mar 15 '14 at 9:00
  • @MIco No, it is a Kronecker product. – Pantelis Kazakis Mar 15 '14 at 23:49
2

To illustrate @JohnKormylo's comment, you would need to put it in place of the \\ you have already. Changing your MWE (for a gap of 10pt):

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

\begin{align*}
Var(u) &= E(uu') = \\
&= E
\begin{bmatrix}
u_1 u_1' & u_1 u_2' & \cdots & u_1 u_M' \\
u_2 u_1' & u_2 u_2' & \cdots & u_2 u_M' \\
\vdots & & \ddots & \vdots \\
u_M u_1' & u_M u_2' & \cdots & u_M u_M '
\end{bmatrix}
=
\begin{bmatrix}
\sigma_{11} I & \sigma_{12} I  & \cdots & \sigma_{1M} I \\
\sigma_{12} I & \sigma_{22} I  & \cdots & \sigma_{2M} I \\
\vdots &  & \ddots & \vdots\\
\sigma_{1n} I & \sigma_{2M} I & \cdots & \sigma_{MM} I
\end{bmatrix} \\[10pt]  %%%%%%%%%%%%%%%%% Change this for different spacing
&= 
\begin{pmatrix}
\sigma_{11} & \sigma_{12} & \cdots & \sigma_{1M} \\
\sigma_{12} & \sigma_{22} & \cdots & \sigma_{2M} \\
\vdots &  & \ddots & \vdots \\
\sigma_{1M} & \sigma_{2M} & \cdots & \sigma_{MM}
\end{pmatrix}_{\otimes I_T}
\end{align*}

\end{document}\documentclass[]{article}

\begin{document}

\title{Title}
\author{Author}
\date{Today}
\maketitle

Content

\end{document}

equations with space

1

You can add space by changing the \\ after \end{bmatrix} into \\[1em], where 1em can be any length. In your example:

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

\begin{align*}
Var(u) &= E(uu') = \\[1em]
&= E
\begin{bmatrix}
u_1 u_1' & u_1 u_2' & \cdots & u_1 u_M' \\
u_2 u_1' & u_2 u_2' & \cdots & u_2 u_M' \\
\vdots & & \ddots & \vdots \\
u_M u_1' & u_M u_2' & \cdots & u_M u_M '
\end{bmatrix}
=
\begin{bmatrix}
\sigma_{11} I & \sigma_{12} I  & \cdots & \sigma_{1M} I \\
\sigma_{12} I & \sigma_{22} I  & \cdots & \sigma_{2M} I \\
\vdots &  & \ddots & \vdots\\
\sigma_{1n} I & \sigma_{2M} I & \cdots & \sigma_{MM} I
\end{bmatrix} \\[1em]
&= 
\begin{pmatrix}
\sigma_{11} & \sigma_{12} & \cdots & \sigma_{1M} \\
\sigma_{12} & \sigma_{22} & \cdots & \sigma_{2M} \\
\vdots &  & \ddots & \vdots \\
\sigma_{1M} & \sigma_{2M} & \cdots & \sigma_{MM}
\end{pmatrix}_{\otimes I_T}
\end{align*}

\end{document}
0

Here is how I will do it:

\documentclass{article}

\usepackage{mathtools}
\DeclareMathOperator*{\Var}{Var}


\begin{document}

\begin{align*}
\Var(u)
&= E(uu') \\[1ex]
&= E {\mkern -4mu}
\begin{bmatrix}
  u_{1}u_{1}' & u_{1}u_{2}' & \cdots & u_{1}u_{M}' \\
  u_{2}u_{1}' & u_{2}u_{2}' & \cdots & u_{2}u_{M}' \\
  \vdots      &             & \ddots & \vdots      \\
  u_{M}u_{1}' & u_{M}u_{2}' & \cdots & u_{M}u_{M}'
\end{bmatrix} \\[1ex]
&= {\mkern -6mu}
\begin{bmatrix}
  \sigma_{11}I & \sigma_{12}I & \cdots & \sigma_{1M}I \\
  \sigma_{12}I & \sigma_{22}I & \cdots & \sigma_{2M}I \\
  \vdots       &              & \ddots & \vdots       \\
  \sigma_{1M}I & \sigma_{2M}I & \cdots & \sigma_{MM}I
\end{bmatrix} \\[1ex]
&= {\mkern -6mu}
\begin{pmatrix}
  \sigma_{11} & \sigma_{12} & \cdots & \sigma_{1M} \\
  \sigma_{12} & \sigma_{22} & \cdots & \sigma_{2M} \\
  \vdots      &             & \ddots & \vdots      \\
  \sigma_{1M} & \sigma_{2M} & \cdots & \sigma_{MM}
\end{pmatrix}_{\mkern -4mu \otimes I_{T}}
\end{align*}

\end{document}

output

Note the horizontal spacing improvements using \mkern.

P.S. I think it doesn't look good with two matrices on the same line in this case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.