Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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)

share|improve this question
1  
For an example using TikZ (similar to Daniel's answer) take a look at my answer to tex.stackexchange.com/questions/5423/… –  Andrew Stacey May 23 '11 at 8:15
add comment

3 Answers

up vote 9 down vote accepted

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}

example

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

share|improve this answer
    
... but if you use my solution in conjunction with Comic Sans MS then I shall refuse to answer any of your questions ever again. –  Andrew Stacey 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. –  Andrew Stacey May 24 '11 at 7:14
add comment

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}
\usetikzlibrary{shadows}

%**
% \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}
share|improve this answer
    
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
add comment

Try fancytooltips and ocgtools packages. There're full examples in the document directory.

share|improve this answer
1  
These are cool packages, which, however, have the issue that they are built on PDF features (optional content groups, JavaScript support) that are supported by very few PDF viewers only. (That is, Adobe Reader, but even with Adobe Reader it is not guaranteed to work on all OS platforms). If the slides are for presentation only, this is less of an issue -- the presenter should have control over the PDF viewer in action. However, is somebody else should be able to make use of them, I would consider this as a downer. In the Mac/Linux world, for instance, Adobe Reader is not used that frequently. –  Daniel May 23 '11 at 10:46
    
@Daniel: Yes, they need pdfTeX, JavaScript and PDF layers. Anyhow, this is the way we get pop-up effect, and Adobe Reader certainly render PDF right. It's a shame that many PDF readers other than Adobe's only support PDF 1.4 features. –  Leo Liu May 23 '11 at 14:16
3  
You might call it a shame, I wouldn't! It saves us from sitting through presentations with these pop-ups flying all over the place. If they have to be in the static PDF then it's much more likely that the presenter won't put them in, which is a Good Thing as far as I'm concerned! –  Andrew Stacey May 23 '11 at 20:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.