How do I reproduce this in latex?

Removing the preview mode as in \documentclass[varwidth,12pt,margin=3mm]{standalone} should do the job. Whence, you could use this:

\documentclass[varwidth,12pt,margin=3mm]{standalone}

\usepackage{newtxtext}
\usepackage{newtxmath}
\usepackage{color}
\pagecolor{yellow}

\begin{document}

\begin{center}
Animation Test
\vspace{6pt}

\textbf{\huge 1}
\end{center}

\end{document}

You can do this very easily using standalone and adjustbox. Use the stack key to stack the text and number, the margin key for the margin and the bgcolor key for the background color. The \struts are for the correct lineskip.

\documentclass[12pt]{standalone}

\usepackage{newtxtext}
\usepackage{newtxmath}
\usepackage{xcolor}
\usepackage{adjustbox}

\begin{document}
\adjustbox{stack,margin=3mm,bgcolor=yellow}{%
    Animation Test\strut\\[6pt]
    \huge\bfseries 1\strut}%
\end{document}

enter image description here


With this solution you could also add an animation with different background colors:

\documentclass[12pt,multi=PAGE]{standalone}

\usepackage{newtxtext}
\usepackage{newtxmath}
\usepackage{xcolor}
\usepackage{adjustbox}
\usepackage{tikz}
\begin{document}
\foreach \n in {1,...,10} {%
\begin{PAGE}%
\adjustbox{stack,margin=3mm,bgcolor=yellow!\the\numexpr10*\n\relax}{%
    Animation Test\strut\\[6pt]
    \huge\bfseries \n\strut}%
\end{PAGE}%
}%  
\end{document}

enter image description here