I'm preparing some Unix training material and I'd like to show some vertically scrolling text of the commands as if simulating text entry in a terminal. My idea was to split the frame into 2 columns, with the left column showing commands to be entered and the right column having the explanation.
I haven't got past the first part of a scrolling text (vertical marquee text). I've tried the animate package and it only overlays the earlier text. This is what I tried
\documentclass{beamer}
\usepackage{tikz}
\usepackage{animate}
\begin{document}
\begin{frame}
\frametitle{MD5SUM}
\begin{animateinline}[autoplay,loop]{1}
cat a
\newframe
cat b
\newframe
md5sum a
\end{animateinline}
\end{frame}
\end{document}
Now beamer has those overlay specifications but I don't think any one of them is suitable for scrolling text. I don't want to hit enter everytime to uncover the next command, just play the command sequences at a specified rate.
Alternately, is there a better way to achieve this? All the animations are going to be text with probably no images.
UPDATE: With Alexander's answer, I tried to use it with Beamer with mixed results.
I've prepared a minimal example where the previous animateinline text is coming through to the next slide. Can anyone tell me, what exactly is going on and where I'm incorrect?
\documentclass{beamer}
\usepackage{beamerthemeWarsaw}
\usepackage{animate}
\usepackage{expl3}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%command for simulating terminal in/output
%\scroll{<width as TeX dim>}{<number of lines>}{terminal text line}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ExplSyntaxOn
\seq_new:N\g_linebuffer_seq
\newcommand\scroll[3]{
\ttfamily
\seq_gput_right:Nx\g_linebuffer_seq{#3}
\int_compare:nT{\seq_length:N\g_linebuffer_seq>#2}{
\seq_gpop_left:NN\g_linebuffer_seq\dummy
}
\fbox{\begin{minipage}[t][#2\baselineskip]{#1}
\seq_map_inline:Nn\g_linebuffer_seq{\mbox{##1}\\}
\end{minipage}}
}
\ExplSyntaxOff
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Random records}
How do you randomly select, say 1000 records from a large file? Use
the \verb|shuf| command
\begin{animateinline}[autoplay,loop]{1}
\scroll{0.8\linewidth}{10}{ cat a}%
\newframe
\scroll{0.8\linewidth}{10}{clear}
\end{animateinline}
%
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Checking for Duplicate Files}
How do you quickly check whether 2 files are the same? Use the
\verb|md5sum| command.
\begin{animateinline}[autoplay,loop]{1}
\scroll{0.8\linewidth}{8}{\# echo 1 2 3 > a}
\newframe
\scroll{0.8\linewidth}{8}{clear}
\end{animateinline}
\end{frame}
\end{document}