# How to resize matrix equation in beamer?

How do I resize this equation to get it to fit? I've googled for examples with no luck.

--Bob

\documentclass[11pt]{beamer}
\usetheme{Warsaw}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\begin{document}

\begin{frame}
\frametitle{LU Factorization of A}
$$\mathbf{LU} = \begin{pmatrix} \nonumber \gamma_1 \\ -1 & \gamma_2 \\ & -1 & \gamma_3 \\ & & \ddots & \ddots \\ & & & -1 & \gamma_{N-2} \\ & & & & -1 & \gamma_{N-1} \\ \end{pmatrix} \begin{pmatrix} 1 & \delta_1 \\ & 1 & \delta_2 \\ & & 1 & \delta_3 \\ & & & \ddots & \ddots \\ & & & & 1 & \delta_{N-2} \\ & & & & & 1 \end{pmatrix}$$
which is represented as
\begin{align} \label{eqn:nonlinear2term}
\gamma_1 &= 2+r  \nonumber \\
\gamma_i &= 2+r-1/\gamma_{i-1},  \hspace{2mm} i=2, \dots ,N-1.
\end{align}
\end{frame}

\end{document}


You can use \resizebox to scale the equation. Remember to re-enter math mode after it.

\documentclass[11pt]{beamer}
\usetheme{Warsaw}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\begin{document}

\begin{frame}
\frametitle{LU Factorization of A}
$$\resizebox{\textwidth}{!}{\displaystyle \mathbf{LU} = \begin{pmatrix} \nonumber \gamma_1 \\ -1 & \gamma_2 \\ & -1 & \gamma_3 \\ & & \ddots & \ddots \\ & & & -1 & \gamma_{N-2} \\ & & & & -1 & \gamma_{N-1} \\ \end{pmatrix} \begin{pmatrix} 1 & \delta_1 \\ & 1 & \delta_2 \\ & & 1 & \delta_3 \\ & & & \ddots & \ddots \\ & & & & 1 & \delta_{N-2} \\ & & & & & 1 \end{pmatrix} }$$
which is represented as
\begin{align} \label{eqn:nonlinear2term}
\gamma_1 &= 2+r  \nonumber \\
\gamma_i &= 2+r-1/\gamma_{i-1},  \hspace{2mm} i=2, \dots ,N-1.
\end{align}
\end{frame}

\end{document}


You also can play with arraycolsep:

\documentclass[11pt]{beamer}
\usetheme{Warsaw}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\begin{document}

\begin{frame}
\frametitle{LU Factorization of A}
$$\setlength\arraycolsep{3.25pt} \mathbf{LU} = \begin{pmatrix} \nonumber \gamma_1 \\ -1 & \gamma_2 \\ & -1 & \gamma_3 \\ & & \ddots & \ddots \\ & & & -1 & \gamma_{N-2} \\ & & & & -1 & \gamma_{N-1} \\ \end{pmatrix} \begin{pmatrix} 1 & \delta_1 \\ & 1 & \delta_2 \\ & & 1 & \delta_3 \\ & & & \ddots & \ddots \\ & & & & 1 & \delta_{N-2} \\ & & & & & 1 \end{pmatrix}$$
which is represented as
\begin{align} \label{eqn:nonlinear2term}
\gamma_1 &= 2+r \nonumber \\
\gamma_i &= 2+r-1/\gamma_{i-1}, \hspace{2mm} i=2, \dots ,N-1.
\end{align}
\end{frame}

\begin{frame}
\frametitle{LU Factorization of A}
$$\resizebox{\textwidth}{!}{\displaystyle \mathbf{LU} = \begin{pmatrix} \nonumber \gamma_1 \\ -1 & \gamma_2 \\ & -1 & \gamma_3 \\ & & \ddots & \ddots \\ & & & -1 & \gamma_{N-2} \\ & & & & -1 & \gamma_{N-1} \\ \end{pmatrix} \begin{pmatrix} 1 & \delta_1 \\ & 1 & \delta_2 \\ & & 1 & \delta_3 \\ & & & \ddots & \ddots \\ & & & & 1 & \delta_{N-2} \\ & & & & & 1 \end{pmatrix} }$$
which is represented as
\begin{align} \label{eqn:nonlinear2term}
\gamma_1 &= 2+r \nonumber \\
\gamma_i &= 2+r-1/\gamma_{i-1}, \hspace{2mm} i=2, \dots ,N-1.
\end{align}
\end{frame}

\end{document}