1

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?

1

1 Answer 1

2
\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

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.