# A beamer fade out-fade in effect?

In some of my slides, especially the technical ones, I would like to keep the bottom of the previous slide, preferably somewhat faded, as the bottom of the next slide as I start introducing new material so that readers could keep in sight the flow of ideas and notations. In a sense, like when one writes on the blackboard. Ànd erases one line at a time...

For instance, something like an automated version of the following...

\documentclass[xcolor=dvipsnames,professionalfonts]{beamer}
\usepackage{xcolor}
\begin{document}
\begin{frame}
This is an important theorem due to Euler:

\pause
\bigskip
\begin{block}{Theorem}
If $n$ and $a$ are coprime positive integers, then
$$a^{\varphi (n)} \equiv 1 \pmod{n}$$
where $\varphi(n)$ is Euler's totient function
\end{block}
\end{frame}
\begin{frame}
There is a direct proof: Let $R = \{x_1, x_2, ..., x_{\varphi(n)}\}$ be a reduced residue system
(mod $n$) and let $a$ be any integer coprime to $n$. The proof hinges on the fundamental fact that
multiplication by $a$ permutes the $x_i$:

\only<1>{
\textcolor{lightgray}{\begin{block}{Theorem}
\textcolor{lightgray}{If $n$ and $a$ are coprime positive integers, then
$$a^{\varphi (n)} \equiv 1 \pmod{n}$$
where $\varphi(n)$ is Euler's totient function}
\end{block}}}
\only<2>{
in other words if $ax_j ≡ ax_k (\pmod n)$ then $j = k$. That is, the sets $R$ and $aR = \{ax_1, ax_2, ..., ax_{\varpi(n)}\}$,
considered as sets of congruence classes $(\pmod n)$, are identical
so the product of all the numbers in $R$ is congruent $(\pmod n)$ to the product of all the numbers in $aR$:
$$\prod_{i=1}^{\varphi(n)} x_i \equiv \prod_{i=1}^{\varphi(n)} ax_i \equiv a^{\varphi(n)}\prod_{i=1}^{\varphi(n)} x_i \pmod{n},$$
and using the cancellation law to cancel the $x_i$'s gives Euler's theorem:
$$a^{\varphi(n)}\equiv 1 \pmod{n}.$$}
\end{frame}
\end{document}

• Do you just mean something as simple as \pause or more complex thing? Like temporal – Johannes_B Sep 6 '14 at 13:19
• I think you can achieve the desired effect with the beamer overlays specs but a possible solution would be relative to the actual content of your slide, so you need to post a minimal working example (MWE) to work with. Anyway, welcome to TeX.SX! – Nico Boni Sep 6 '14 at 13:19

## 1 Answer

Some points:

• You can use \usebackgroundtemplate and pdfpages to insert slides as background.
• to indicate the pervious slide, \beamer@startpageofframe is useful.
• use mdframed and tikz to block the pervious slide.
• Since it is dangerous to insert a pdf into itself, I created two files 199832-main.tex and 199832-material.pdf. They are almost identical except that in 199832-material.pdf the line begins with \usebackgroundtemplate is commented out.

So the 10th pages are as follows:  Here is the code

\documentclass[t]{beamer}
\usetheme{Berkeley}
\beamertemplatenavigationsymbolsempty

\usepackage{pdfpages}
\usepackage[hidealllines=true,backgroundcolor=white,framemethod=tikz]{mdframed}
\newmdenv[settings={\tikzset{every picture/.style={opacity=0.95}}}]{mymdframed}

\begin{document}

\begin{frame}\begin{mymdframed}
\only<+->{AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA \\ AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA \\}
\only<+->{AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA \\ AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA \\}
\only<+->{AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA \\ AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA \\}
\only<+->{AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA \\ AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA \\}
\end{mymdframed}\end{frame}

\makeatletter
\newcount\my@frameendprev
\usebackgroundtemplate{\vbox{\my@frameendprev\beamer@startpageofframe\advance\my@frameendprev by-1\includepdf[pages={\the\my@frameendprev}]{199832-material.pdf}}}
\makeatother

\begin{frame}\begin{mymdframed}
\only<+->{BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB \\ BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB \\}
\only<+->{BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB \\ BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB \\}
\only<+->{BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB \\ BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB \\}
\only<+->{BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB \\ BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB \\}
\end{mymdframed}\end{frame}

\begin{frame}\begin{mymdframed}
\only<+->{CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC \\ CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC \\}
\only<+->{CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC \\ CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC \\}
\only<+->{CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC \\ CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC \\}
\only<+->{CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC \\ CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC \\}
\end{mymdframed}\end{frame}

\begin{frame}\begin{mymdframed}
\only<+->{DDDDDDDD DDDDDDDD DDDDDDDD DDDDDDDD \\ DDDDDDDD DDDDDDDD DDDDDDDD DDDDDDDD \\}
\only<+->{DDDDDDDD DDDDDDDD DDDDDDDD DDDDDDDD \\ DDDDDDDD DDDDDDDD DDDDDDDD DDDDDDDD \\}
\only<+->{DDDDDDDD DDDDDDDD DDDDDDDD DDDDDDDD \\ DDDDDDDD DDDDDDDD DDDDDDDD DDDDDDDD \\}
\only<+->{DDDDDDDD DDDDDDDD DDDDDDDD DDDDDDDD \\ DDDDDDDD DDDDDDDD DDDDDDDD DDDDDDDD \\}
\end{mymdframed}\end{frame}

\end{document}