# Revealing parts of an array in beamer

I'm making a beamer presentation that involves a lot of arrays. I want to be able to put an array on one slide; then as I progress through the frame I want to be able to make some parts of the array bold/put them in boxes, etc; step by step.

Currently I have multiple arrays on one frame and am uncovering each on in turn. However this does not keep the image in the same place. Ideally I'd like to be able to superimpose (or overlay) the images so I can reveal some numbers in the array becoming bold, etc.

You can use a number of different overlay specification macros to alternative between what's displayed on a slide. Below I've used \only<num>{<stuff>}:

\documentclass{beamer}

\usepackage{eqparbox}

\begin{document}

% Original unaltered frame
\begin{frame}
Original unaltered frame:
$\left[ \begin{array}{*{4}{c}} a & b & c & d \\ 1 & 2 & 3 & 4 \\ e & f & g & h \\ 5 & 6 & 7 & 8 \end{array} \right]$
\end{frame}

% Updated frame with slide-variations
\begin{frame}
Updated frame with slide-variations:
$\left[ \begin{array}{*{4}{c}} a & b & c & d \\ 1 & 2 & 3 & 4 \\ e & f & \only<1>{\eqmakebox[var]{g}} \only<2>{\eqmakebox[var]{\mathbf{g}}} \only<3>{\smash{\eqmakebox[var]{\fbox{g}}}} & h \\ 5 & 6 & 7 & 8 \end{array} \right]$
\end{frame}

\end{document}


I've also incorporated the use of eqparbox that sets its contents in a box of similar width based on a \eqmakebox[<tag>]. Since your content may differ in size (width and/or height) from one slide to the next (by adding \fbox or \mathbf or whatever), this might be useful.