I am trying to swap code blocks as animation. But I cannot put verbatim inside \onslide or \visible.
I tried using a savebox, the problem is the second code blockis typesetted below the first one. I want the code blocks to show in same location.
My code:
\documentclass{beamer}
\usepackage{fancyvrb}
\begin{document}
\begin{frame}[fragile]{Object}
\begin{center}
\onslide<2>{
\begin{Verbatim}[frame=single, fontsize=\fontsize{7pt}{8pt}\selectfont]
class int(object)
| int(x[, base]) -> integer
|
| Convert a string or number to an integer, if possible. A floating point
| argument will be truncated towards zero (this does not include a string
| representation of a floating point number!) When converting a string, use
| the optional base. It is an error to supply a base when converting a
| non-string. If base is zero, the proper base is guessed based on the
| string content. If the argument is outside the integer range a
| long object will be returned instead.
\end{Verbatim}
}
\onslide<3>{
\begin{Verbatim}[frame=single, fontsize=\fontsize{7pt}{8pt}\selectfont]
class int(object)
| int(x[, base]) -> integer
|
\end{Verbatim}
}
\end{center}
\end{frame}
\end{document}
Beamer'ssemiverbatimenvironment instead offancyvrb'sVerbatim? Beamer andverbatimreportedly don't play nice with each other; see http://stackoverflow.com/questions/1396631/latex-semiverbatim-and-fancyvrb and http://tex.stackexchange.com/questions/18073/beamer-and-verbatim-sync. – jub0bs Mar 01 '13 at 11:59listingswith blocks: see my answer to Using \only on a block - beamer. – Claudio Fiandrino Mar 01 '13 at 12:42semiverbatimcannot be put insideonslide. – ATOzTOA Mar 01 '13 at 13:05\begin{frame} \onslide<2>{ \begin{semiverbatim} jsudfhsdfhsdf \end{semiverbatim} } \end{frame}– jub0bs Mar 01 '13 at 13:10