I guess there are at least three alternatives for your problem, the four slides in the following example all do the same:
\documentclass{beamer}
\usetheme{Darmstadt}
\begin{document}
\begin{frame}
\begin{itemize}
\item first one
\pause
\item second one
\pause
\item third one
\pause
\item fourth one
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item<1-> first one
\item<2-> second one
\item<3-> third one
\item<4-> fourth one
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item<+-> first one
\item<+-> second one
\item<+-> third one
\item<+-> fourth one
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}[<+->]
\item first one
\item second one
\item third one
\item fourth one
\end{itemize}
\end{frame}
\end{document}
- the first one is you solution
- the second one tells at which slides to appear,
<3->
meaning all starting from the third one
- the third one is used to increase the counter
beamerpause
(=1 at beginning of frame) by one at each encounter
- the fourth one (probably the one you would go for) sets the "increase beamerpause" as a default behaviour for all list items
Edit 1: You can also set the behaviour from the fourth example as general. All frames following \beamerdefaultoverlayspecification{<+->}
will set pauses for every actionenv
environment and every \item
. To be in effect globally, you need to set this outside of a frame, e.g. as the first line after \begin{document}
, before the first frame.
For simulating terminal output you will have to maintain a line buffer. In the example below I am using the sequence data type of LaTeX3 for this purpose. A minipage of given width and number of lines height is used to mimick the terminal window. If the number of lines in the buffer goes past the height of the minipage, the top line in the buffer is removed.

EDIT:
New command \clearbuf
clears the line buffer. Recommended use before first \scroll
in an animateinline
environment and to simulate clear
(screen) shell command.
EDIT 2:
This new version allows for ''multiline'' text as argument to \scroll
. However, line breaks must be explicitly denoted in the argument using a marker string. The default is §§
which is rarely seen on terminals. But any user defined sequence of letters is possible. User defined marker strings must be passed as optional first argument, enclosed between [
and ]
to \scroll
.
EDIT 3:
Note that macros within the text argument of \scroll
are expanded before being added to the line buffer. The reason is to make macros which are called more than once but change their content between calls to \scroll
, such as the line numbers \i
in the example, work correctly.
Use \noexpand
if you want to defer expansion of macros to the time when the whole line buffer is typeset. This is useful for escaping special characters or for text formatting macros (colour, typeface). See the updated example.
\documentclass[dvisvgm]{article}
\pagestyle{empty}
\usepackage{courier}
\usepackage{animate}
\usepackage{expl3}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%commands for simulating terminal in/output
%\scroll[<line separator string>]{<width as TeX dim>}
% {<number of lines>}{terminal text line}
%\clearbuf %clears line buffer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ExplSyntaxOn
\seq_new:N\g_linebuffer_seq
\seq_new:N\g_inputline_seq
\newcommand\scroll[4][§§]{
\seq_set_split:Nnn\g_inputline_seq{#1}{#4}
\seq_map_inline:Nn\g_inputline_seq{
\seq_gput_right:Nx\g_linebuffer_seq{##1}
\int_compare:nT{\seq_count:N\g_linebuffer_seq>#3}{
\seq_gpop_left:NN\g_linebuffer_seq\dummy
}
}
\fbox{\begin{minipage}[t][#3\baselineskip]{#2}
\ttfamily
\seq_map_inline:Nn\g_linebuffer_seq{\mbox{##1}\\}
\end{minipage}}
}
\newcommand\clearbuf{\seq_gclear:N\g_linebuffer_seq}
\ExplSyntaxOff
\begin{document}
\begin{animateinline}[controls,loop]{1}
\scroll{0.9\linewidth}{8}{cat a}
\newframe
\scroll{0.9\linewidth}{8}{cat b}
\newframe
\scroll{0.9\linewidth}{8}{John§§Linda§§Albert§§Francis}
\newframe
\scroll{0.9\linewidth}{8}{ln -s a empty.txt}
\newframe
\scroll{0.9\linewidth}{8}{md5sum empty.txt}
\newframe
\scroll{0.9\linewidth}{8}{d41d8cd98f00b204e9800998ecf8427e empty.txt}
\newframe
\scroll{0.9\linewidth}{8}{md5sum b}
\newframe
\scroll{0.9\linewidth}{8}{88a1d2cf7920275378bebdf438bae941 b}
\newframe
\scroll{0.9\linewidth}{8}{clear}\clearbuf
\newframe
\scroll{0.9\linewidth}{8}{}\clearbuf
\newframe
\multiframe{10}{i=1+1}{
\scroll{0.9\linewidth}{8}{\noexpand\# Line \i}
}
\newframe
\scroll{0.9\linewidth}{8}{clear}\clearbuf
\newframe
\scroll{0.9\linewidth}{8}{}\clearbuf
\end{animateinline}
\begin{animateinline}[controls,loop]{1}
\clearbuf\scroll{0.9\linewidth}{8}{cd /usr/bin}
\newframe
\scroll{0.9\linewidth}{8}{echo \noexpand\$PWD}
\newframe
\scroll{0.9\linewidth}{8}{/usr/bin}
\newframe
\scroll{0.9\linewidth}{8}{ls -l md5sum}
\newframe
\scroll{0.9\linewidth}{8}{%
-rwxr-xr-x 1 root root 30172 Dec 14 2010
\noexpand\bfseries\noexpand\color{red}md5sum
}
\newframe
\scroll{0.9\linewidth}{8}{clear}\clearbuf
\newframe
\scroll{0.9\linewidth}{8}{}\clearbuf
\end{animateinline}
\end{document}
Best Answer
I'm personally only familiar with doing this in Beamer, which uses the
multimedia
package, distributed as part of Beamer itself. (Although it can be used in normal documents as well, independently from the rest of Beamer) The canonical reference on how to use themultimedia
package is the Beamer user's guide, section 14.1, but basically it boils down to using the commandThe placeholder box is some text or other content (could be an image, for example) that determines the size at which the multimedia file is shown.
The multimedia file can be shown either with an external viewer application, which launches when you click on the appropriate part of the PDF file, or directly in the PDF viewer itself. In both cases, though, this functionality is only supported by certain PDF viewers, mostly Adobe Reader. The file types it is able to display depend on the capabilities of the PDF viewer, or if using an external viewer, on which viewer program is being used.
A quick search on CTAN turns up a possible alternative,
media9
(which supersedes the oldmovie15
package). According to the documentation, its main command isand it seems to offer some of the same main features as Beamer's
multimedia
. However, I've never used this one myself so I can't say anything about it that isn't mentioned in the package documentation.