# Pop-up effect in beamer?

The elements in a beamer presentation are all neatly laid out so that they do not overlap each other.

Is there a way, e.g. an overlay-specification, that allows to have a box or note or speech-bubble occurring that is positioned over the other elements of the slide? (Maybe similar to a tool-tip)

-
For an example using TikZ (similar to Daniel's answer) take a look at my answer to tex.stackexchange.com/questions/5423/… –  Loop Space May 23 '11 at 8:15

If you want to draw the overlay in TikZ, you don't need any additional package to do absolute positioning. Simply adding the options [overlay,remember picture] will let you position the image absolutely on the frame (you will need to compile twice to get correct positioning). The special node (current page) is a rectangle node that simply spans the whole page, allowing for easy access to various places in the page. With \pgftransformshift{\pgfpointanchor{current page}{center}} you can choose a coordinate system such that (0,0) is in the center of the page.

Here is an example (compile with xelatex or lualatex to get the font).

\documentclass{beamer}
\usepackage{tikz,lipsum,fontspec}
\usetikzlibrary{shapes.callouts,decorations.pathmorphing}
\newfontfamily\comic{Comic Sans MS}

\begin{document}
\begin{frame}
\lipsum[1]
\begin{tikzpicture}[overlay,remember picture]
\pgftransformshift{\pgfpointanchor{current page}{center}}
\node[
ellipse callout,
draw=red,
ultra thick,
fill=yellow,
decoration=zigzag,
decorate,
callout relative pointer=(315:2cm),
font=\Huge\comic,
text width=0.6\textwidth,
align=center,
anchor=center
] at (0,0) {Presentations without speech bubbles are BORING!};
\end{tikzpicture}
\end{frame}
\end{document}


You can of course combine this with Andrew's solution to “how to open a temporary comics-like balloon in a beamer slide?”.

-
... but if you use my solution in conjunction with Comic Sans MS then I shall refuse to answer any of your questions ever again. –  Loop Space May 23 '11 at 20:24
@Andrew: The worst thing is that I now have Comic Sans installed on my Linux system. –  Caramdir May 23 '11 at 20:37
No, the worst thing is that you've admitted it in public. –  Loop Space May 24 '11 at 7:14

Basically there are two issues to solve:

1. How to get stuff atop of the ordinary content at an arbitrary postion.
2. How to draw a callout box there.

For (1), the beamer documentation recommends the textpos package, which provides (with the options [absolute, overlay] the necessary means to put "something" at an absolute position over every other content.

For (2) there are many, many options. I personally prefer some snippets of TikZ-code to typeset the boxes, which gives me enough flexibility to influence the typesetting in specific situations.

Putting it all togetherm my usual setup is as follows:

\documentclass{beamer}
\usepackage[absolute,overlay]{textpos}
\usepackage{tikz}

%**
% \PutAt<overlay spec>[<box width>]{(<x>, <y>)}{<content>}
%
% real absolute positioning of <content> on a slide, if content is a figure,
% minipage or whatever kind of LR-box, the <box width> argument may be omitted
%
%
% implementation notes:
%   - based on   \usepackage[absolute,overlay]{textpos}
%   - NOT combinable with any beamer feature that is based on pgfpages
%     (such as dual-screen support, built-in 2up handouts, etc.), as textpos
%     and pgfpates interfere at the shippout-level.
%

\newcommand<>{\PutAt}[3][0pt]{%
{\only#4{\begin{textblock*}{#1}#2%
#3
\end{textblock*}}}%
}

%**
% \ShowPutAtGrid
%
% draws a helpful grid on the current slide to figure <x> and <y> parameters for \PutAt
%
\newcommand{\ShowPutAtGrid}{
\begin{textblock*}{128mm}(0cm,0cm)
\tikz[color=red!20!white]\draw[very thin, step=5mm] (0mm,0mm) grid (130mm,100mm);
\end{textblock*}
\begin{textblock*}{128mm}(0cm,0cm)
\begin{tikzpicture}[color=red]
\draw[step=1cm] (0,0mm) grid (130mm,100mm);
\foreach \n in {0,...,12}
\draw[xshift=.5mm,yshift=-1.5mm, inner sep=0pt, anchor=west] (\n,10) node {\scriptsize{\textbf{\n}}};
\foreach \n in {1,...,9}
\draw[xshift=.5mm,yshift=-1.5mm, inner sep=0pt, anchor=west] (0,10-\n) node {\scriptsize{\textbf{\n}}};
\end{tikzpicture}
\end{textblock*}
}

%**
% \NormalBox<overlay spec>[tikz picture/node options]{<content>}
%
% draws content boxed in a nice box
%
\newcommand<>{\NormalBox}[2][]{%
\only#3{\tikz[#1, every node/.style={shape=rectangle,draw,fill=white, drop shadow, #1}]\node []{#2};}
}
%**
% \OrangeBox<overlay spec>[tikz picture/node options]{<content>}
%
% draws content boxed in an orange call-out box
%
\newcommand<>{\OrangeBox}[2][]{%
\onslide#3{\NormalBox[fill=orange!30,draw=black!30,rounded corners=4pt,#1]{#2}}%
}

\begin{document}

\begin{frame}{My frame}
\begin{itemize}
\item Foo
\item Bar
\item Baz
\end{itemize}
\PutAt<+>{(2cm,2cm)}{
\NormalBox[text width=4cm, font=\footnotesize]{A absolute positioned overlay box}
}
\PutAt<+>{(5cm,4cm)}{
\OrangeBox[text width=4cm, font=\footnotesize]{A more callout-like orange box that provides some really helpfull content}
}
\end{frame}

\begin{frame}{My frame}
\begin{itemize}
\item Foo
\item Bar
\item Baz
\end{itemize}
\PutAt{(2cm,2cm)}{
\NormalBox[text width=4cm, font=\footnotesize]{A absolute positioned overlay box}
}
\PutAt{(5cm,4cm)}{
\OrangeBox[text width=4cm, font=\footnotesize]{A more callout-like orange box that provides some really helpfull content}
}
\ShowPutAtGrid
\end{frame}

\end{document}

-
I think you mean textpos rather than textcomp above; might be worth correcting to avoid confusion. –  prettygully May 23 '11 at 9:48
@prettygully: Whops, thanks for the hint -- fixed. –  Daniel May 23 '11 at 10:40
Try fancytooltips and ocgtools packages. There're full examples in the document directory.