# Animation with LaTeX Tables [duplicate]

I am trying to create an image in LaTeX that shows a table auto-filling itself, such as the four tables shown below. I've seen some posts about animating pictures, but I haven't seen anything about compiling "slides" together into an image. The four slides are below.

\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}

\begin{document}

\begin{tabular}{|c|c|}
\hline
1 & \\
\hline
&
\hline
\end{tabular}

\begin{tabular}{|c|c|}
\hline
1 & 2\\
\hline
& \\
\hline
\end{tabular}

\begin{tabular}{|c|c|}
\hline
1 & 2\\
\hline
3 & \\
\hline
\end{tabular}

\begin{tabular}{|c|c|}
\hline
1 & 2\\
\hline
3 & 4\\
\hline
\end{tabular}

\end{document}


This produces the tables, but I don't know how to make them into one image. How do I combine them?

## marked as duplicate by Werner tables StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jul 16 '15 at 20:59

• I'd hazard a guess that you could facilitate the animate-package (mirrors.ibiblio.org/CTAN/macros/latex/contrib/animate/… 5 - The user interface -- Quote regarding the animateline: Even ordinary textual material may be animated in this way.) – Richard Jul 16 '15 at 20:22
• You want to make an animated GIF? – Werner Jul 16 '15 at 20:24
• @Werner Yes I do. – Arcturus Jul 16 '15 at 20:32
• @Eridan: You can use the following as a guide: Animations in LaTeX I typically use ImageMagick's convert to make an animated GIF out of a multi-page PDF. – Werner Jul 16 '15 at 20:37
• Thanks, @Werner I'd seen that page, but it looked like it was tikzpicture-specific. Now I see it's not. – Arcturus Jul 16 '15 at 21:04

The following code produces a table that fills itself:

\documentclass[12pt]{standalone}
\usepackage{amsmath,amssymb}
\usepackage{animate}
\usepackage{xcolor}

\begin{document}

\begin{animateinline}[autoplay,loop]{1}
\begin{tabular}{|c|c|}\hline
1 &{\color{white}2} \\\hline
& \\\hline
\end{tabular}
\newframe
\begin{tabular}{|c|c|}\hline
1 & 2\\\hline
& \\\hline
\end{tabular}
\newframe
\begin{tabular}{|c|c|}\hline
1 & 2\\\hline
3 & \\\hline
\end{tabular}
\newframe
\begin{tabular}{|c|c|}\hline
1 & 2\\\hline
3 & 4\\\hline
\end{tabular}
\end{animateinline}
\end{document}


I took the liberty to also add the xcolor package and adding a white 2 to the first table. That way the table doesn't change it's form. The only way I was able to see the animation was the usage of the Adobe PDF reader.

Frames:

Cheers

• If you want the table to grow on click, put option step to the animateinline environment. – AlexG Jul 17 '15 at 6:46