# Can I use Beamer's \alert<x>{…} inside fancyvrb Verbatim with overlay?

I would like to use Beamer's \alert<x>{...} command inside of a Verbatim environment (from the fancyvrb package) to highlight the text. I've found that when the \alert command is inside the Verbatim, it just highlights the text, but doesn't do any overlays.

Can I use the overlay feature of \alert inside a Verbatim environment?

Note: I don't want to use a semiverbatim environment because I want to put a frame around the text. A minimal working example is copied below. It does not do what I'd like it to.

\documentclass{beamer}
\usepackage{fancyvrb}

\begin{document}

\begin{frame}[fragile]{Testing}

\begin{Verbatim}[commandchars=\\\{\},fontsize=\scriptsize,frame=single]
1.423930+0 8.164981+5 1.257190+02834 3  2  545
1.900300-1 \alert<2>{8.184120+5 3.506000-7}2834 3  2  546
2.307450-2 8.192910+5 2.396970-12834 3  2  547
\end{Verbatim}
\end{frame}

\end{document}


-

The following may be a viable work-around:

\documentclass{beamer}% http://ctan.org/pkg/beamer
\let\Tiny\tiny% http://tex.stackexchange.com/q/58087/5764
\usepackage{fancyvrb}% http://ctan.org/pkg/fancyvrb

\if\relax\detokenize{#1}\relax% http://tex.stackexchange.com/q/53068/5764
\else
\fi}

\begin{document}
\begin{frame}[fragile]{Testing}

Slide \alt<1>{1}{2}\ldots

\begin{Verbatim}[commandchars=\\\{\},fontsize=\scriptsize,frame=single]
1.423930+0 8.164981+5 1.257190+02834 3  2  545
1.900300-1 \alert[2]{8.184120+5 3.506000-7}2834 3  2  546
2.307450-2 8.192910+5 2.396970-12834 3  2  547
\end{Verbatim}
\end{frame}

\end{document}


The \alert macro is first stored in \oldalert in order to preserve the overlay specification interface (requiring the use of <.>). Then it is redefined to capture an optional (overlay) and mandatory (stuff to alert) argument in a more traditional way. That is, the interface \alert<.>{..} is updated to reflect \alert[.]{..} which fancyvrb seems to cope with better.

A simpler definition may be to only use

\let\oldalert\alert

which assumes you'll always specify an overlay and renews the interface to \alert{.}{..}.