[Tex/LaTex] Aligning bmatrix-matrices next to each other

horizontal alignmentmatrices

I have this code:

\[
    \begin{bmatrix}
    Pagerank&Sidnummer\\
    0.068945&2\\
    0.068945&3\\
    0.076517&1\\
    0.076517&4\\
    0.11536&7\\
    0.11536&8\\
    0.11536&6\\
    0.11536&5\\
    0.14069&9\\
    0.14069&12\\
    0.16501&14\\
    0.33015&13\\
    0.33015&15\\
    0.56601&10\\
    0.56601&11\\
    \end{bmatrix}
\]
\[
    \begin{bmatrix}
    Pagerank&Sidnummer\\
    0.076517&1\\
    0.068945&2\\
    0.068945&3\\
    0.076517&4\\
    0.11536&5\\
    0.11536&6\\
    0.11536&7\\
    0.11536&8\\
    0.14069&9\\
    0.56601&10\\
    0.56601&11\\
    0.14069&12\\
    0.33015&13\\
    0.16501&14\\
    0.33015&15\\
    \end{bmatrix}
\]

And individually the matrices are correct. But I don't like the way they display on the screen. The second matrix is placed beneath the first one. I want them to share the horizontal space and lay next to each other. Is this possible?

Best Answer

Place them inside the same displayed environment:

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}

\begin{document}

\[
    \begin{bmatrix}
    \textrm{Pagerank} & \textrm{Sidnummer}\\
    0.068945&2\\
    0.068945&3\\
    0.076517&1\\
    0.076517&4\\
    0.11536&7\\
    0.11536&8\\
    0.11536&6\\
    0.11536&5\\
    0.14069&9\\
    0.14069&12\\
    0.16501&14\\
    0.33015&13\\
    0.33015&15\\
    0.56601&10\\
    0.56601&11\\
    \end{bmatrix}%\hspace*{20pt} % to increase the horizontal space
%
    \begin{bmatrix}
    \textrm{Pagerank} & \textrm{Sidnummer}\\
    0.076517&1\\
    0.068945&2\\
    0.068945&3\\
    0.076517&4\\
    0.11536&5\\
    0.11536&6\\
    0.11536&7\\
    0.11536&8\\
    0.14069&9\\
    0.56601&10\\
    0.56601&11\\
    0.14069&12\\
    0.33015&13\\
    0.16501&14\\
    0.33015&15\\
    \end{bmatrix}
\]

\end{document}

Note that I used the \textrm command to change the font for the text part. You can use \hspace to increase the horizontal separation between the matrices (commented out in my example).