[Tex/LaTex] beamer two columns figure and formula

beamertwo-column

I am trying to do a beamer slide with two columns, one with an image and the other with a matrix more or less big. The code that I have is the following

\begin{frame}{Frame}
  \frametitle{Minimal grid example}
  \begin{columns}
    \column{0.4\textwidth}
      \includegraphics[scale=0.2]{image.pdf}
      \column{0.4\textwidth}
      \begin{equation}
        \begin{pmatrix}
          0 && 0 && 1 && 0 && 0 && 0 && 0 && 0 \\
          0 && 0 && 0 && 0 && 0 && 1 && 0 && 0 \\
          t && -r^* && 0 && 0 && 0 && 0 && 0 && 0 \\
          0 && 0 && 0 && 0 && 0 && 0 && 0 && 1 \\
          0 && 0 && 0 && 0 && 0 && 0 && 1 && 0 \\
          r && t* && 0 && 0 && 0 && 0 && 0 && 0 \\
          0 && 0 && 0 && 0 && 1 && 0 && 0 && 0 \\
          0 && 0 && 0 && 1 && 0 && 0 && 0 && 0
        \end{pmatrix}.
      \end{equation}
 \end{columns}
\end{frame}

but for some reason, the matrix is stretched to fill the whole right
column. How can I manipulate the size of the formula?

Best Answer

\documentclass[demo]{beamer}
\usepackage{mathtools}

\begin{document}
\begin{frame}{Frame}
  \frametitle{Minimal grid example}
  \begin{columns}
    \column{0.5\textwidth}
    \centering
      \includegraphics[width=\linewidth]{image.pdf}
      \column{0.5\textwidth}
      \setlength\arraycolsep{3pt}
      \begin{equation}
        \begin{pmatrix}
          0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
          0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
          t & -r^* & 0 & 0 & 0 & 0 & 0 & 0 \\
          0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
          0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\
          r & t* & 0 & 0 & 0 & 0 & 0 & 0 \\
          0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
          0 & 0 & 0 & 1 & 0 & 0 & 0 & 0
        \end{pmatrix}.
      \end{equation}
 \end{columns}
\end{frame}
\end{document}

enter image description here I made three changes:

  • replace && with & (I don't understand of purpose of double ampersands, you only cross limit of normal matrix size -- 10 columns)
  • reduce column separation in matrix
  • change size of columns
Related Question