[Tex/LaTex] Scale down a array contained in an equation – beamer

arraysbeamerequationsscaling

I have an array inside an equation in a beamer presentation. I tried scaling it down using resizebox but it gives me error :

\begin{equation}
\label{eq:recursive}
\resizebox{\linewidth}{!}{
R_{k+1}(a,b) =
\left\{ \begin{array}{rl}
1 & \mbox{if } a=b \\
0 &  \mbox{if } I(a)=\phi \mbox{ or } I(b)=\phi \\
\frac{C}{|I(a)||I(b)|}\sum_{i=1}^{|I(a)|}\sum_{j=1}^{|I(b)|} R_k(I_i(a),I_j(b)) & \mbox{otherwise } \\
\end{array}\right.
}
\end{equation}

any suggestions?

Best Answer

If you really need numbering, you can do like

\documentclass{beamer}
\usepackage{mathtools}
\begin{document}
\begin{frame}
\frametitle{Big formula}

\begin{equation}
\label{eq:recursive}
\resizebox{.9\textwidth}{!}{$\displaystyle % restart math mode!
R_{k+1}(a,b) =
\begin{dcases}
1 & \text{if $a=b$} \\
0 & \text{if $I(a)=\phi$ or $I(b)=\phi$} \\
\frac{C}{|I(a)|\,|I(b)|}
  \sum_{i=1}^{|I(a)|}
  \sum_{j=1}^{|I(b)|} R_k(I_i(a),I_j(b)) & \text{otherwise}
\end{dcases}
$} % end math mode and close the box to be resized
\end{equation}
\end{frame}
\end{document}

Note that I used dcases provided by mathtools, which gains some horizontal space as the limits are typeset above and below the summation sign. Alternatively, you can type

\documentclass{beamer}

\begin{document}
\begin{frame}
\frametitle{Big formula}

\begin{equation}
\label{eq:recursive}
\resizebox{.9\textwidth}{!}{$\displaystyle % restart math mode
R_{k+1}(a,b) =
\begin{cases}
1 & \text{if $a=b$} \\
0 & \text{if $I(a)=\phi$ or $I(b)=\phi$} \\
\frac{C}{|I(a)|\,|I(b)|}
  \sum\limits_{i=1}^{|I(a)|}
  \sum\limits_{j=1}^{|I(b)|} R_k(I_i(a),I_j(b)) & \text{otherwise}
\end{cases}
$} % end math mode and close the box to be resized
\end{equation}
\end{frame}
\end{document}

This will use smaller summation signs.

enter image description here

Notes.

  1. The cases (or dcases) environment is more convenient than using array.

  2. For the conditions, it's better to use \text and switch to math mode inside it, rather than using clumsy \mbox commands with spaces.