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.

I'm fairly new to Beamer and stuck with this problem of two tikzpictures lying above two minipages. i want tikz1 to be displayed on slide 2 of the frame and tikz2 on the next slide (3). However they seem to take up space despite of the overlay argument. I've tried \only and \visible, but they too don't seem to work properly. When i move them, in some way the underlying minipages are moved and don't stay in the same place (which is what I desire)

With \onslide, moving one of the tikzpictures results in having the underlying elements all moved in the same way for all the slides.

With \only only the underlying elements of the current slide will be messed up, the other ones are not moved.

\visible seems to behave like \onslide. But none of the above leave the minipages in the place where I want them to be.

\documentclass[xcolor=dvipsnames]{beamer} 
\usecolortheme[named=Goldenrod]{structure} 
\usetheme[height=7mm]{Rochester} 

\usepackage{tikz}
\usetikzlibrary{shapes}

\begin{document}
\begin{frame}
\frametitle{A title}

\begin{minipage}[t]{0.5\linewidth}
\begin{exampleblock}{}
\begin{enumerate}
\setbeamercovered{transparent}
  \item \uncover<1,3>{This cake is amazing and I am looking forward to eating it!}
  \item \uncover<1,2,3>{A friend prepared this cake yesterday.}
  \end{enumerate}
\end{exampleblock}
\end{minipage}
\hspace{1cm}
\begin{minipage}[t]{0.3\linewidth}
\begin{exampleblock}{}
\begin{enumerate}
  \item \uncover<3>{n.a.}
  \item \uncover<2,3>{cake}
  \end{enumerate}
\end{exampleblock}
\end{minipage}


\onslide<2>{
\vspace*{-6.5cm}
\hspace*{7cm}
\begin{tikzpicture}[overlay][remember picture]
    \node[align=center, ellipse callout, draw, callout relative pointer={(155:1cm)}, fill=yellow!30] (hallo) {some text};
        \end{tikzpicture}}

\onslide<3>{
\vspace*{-2cm}
\hspace*{7cm}
\begin{tikzpicture}[overlay][remember picture]
    \node[align=center, ellipse callout, draw, callout relative pointer={(155:1cm)}, fill=yellow!30] (hallo) {some text};
        \end{tikzpicture}}

\end{frame}
\end{document}
share|improve this question
1  
Welcome to TeX.SX! It's not necessary to sign your questions (as there is already a box with your username below it) or to begin them with a greeting. –  Jubobs May 8 '13 at 21:08
    
Can you please explain where exactly do you want the callouts to appear? From your description, I thought you wanted them above the minipages, but seing cmhughes's answer I am not so sure now. –  Gonzalo Medina May 8 '13 at 21:55
    
Yea, they should appear above the minipages (or columns now) at changing positions and not take up space and not move the underlying contents. –  Jonathan May 9 '13 at 9:46

2 Answers 2

up vote 4 down vote accepted

I think I would use columns for this, as they are overlay aware. In addition, you can use the tried and tested tikzmark idea (now available as a package) and used on this site in many, many examples :)

animation

I have \usetikzlibrary{calc} to bump the nodes around a bit- you can tweak as you see necessary.

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass[xcolor=dvipsnames]{beamer} 
\usecolortheme[named=Goldenrod]{structure} 
\usetheme[height=7mm]{Rochester} 

\usepackage{tikz}
% tikzmark command, for shading over items
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\usetikzlibrary{shapes}
\usetikzlibrary{calc}

\begin{document}
\begin{frame}
\frametitle{A title}

\begin{columns}
    \begin{column}[t]{0.5\linewidth}
        \begin{exampleblock}{}
            \begin{enumerate}
                \setbeamercovered{transparent}
                \item \uncover<1,3>{This cake is amazing and I am looking forward to eating it!}
                \item \uncover<1,2,3>{A friend prepared this cake yesterday.}
            \end{enumerate}
        \end{exampleblock}
    \end{column}
    \hspace{1cm}
    \begin{column}[t]{0.3\linewidth}
        \begin{exampleblock}{}
            \begin{enumerate}
                \item \tikzmark{firstmark}\uncover<3>{n.a.} 
                \item \tikzmark{secondmark}\uncover<2,3>{cake}
            \end{enumerate}
        \end{exampleblock}
    \end{column}
\end{columns}


\onslide<2>{
    \tikz[overlay,remember picture]\node[align=center, ellipse callout, draw, callout relative pointer={(155:1cm)}, fill=yellow!30] (hallo) at ($(firstmark)+(2,-1)$) {first bubble}; }

\onslide<3>{
    \tikz[overlay,remember picture]\node[align=center, ellipse callout, draw, callout relative pointer={(155:1cm)}, fill=yellow!30] (hallo) at ($(secondmark)+(2,-1)$) {hello world}; }



\end{frame}
\end{document}
share|improve this answer
    
Now that I see your code, I think I didn't understand the desired position for the callouts. –  Gonzalo Medina May 8 '13 at 21:47
    
That works out for me! Even though the callouts still behaved weirdly at some points, bumping each other around. But in the end it seems to be stable now. The main problem might have been the minipages or the h- and v-spaces that cause the mess up. The tikzmark command works good! –  Jonathan May 9 '13 at 9:32
    
And overlay aware therefore means that the columns as opposed to the minipages will not be affected by the movement of things on top of them? –  Jonathan May 9 '13 at 9:48
    
@Jonathan yes, that's what I meant by overlay aware :) –  cmhughes May 9 '13 at 15:43

There's no need (at least in this example code) to use remember picture, overlay. You can simply use the fact that \node is overlay aware:

\documentclass[xcolor=dvipsnames]{beamer} 
\usecolortheme[named=Goldenrod]{structure} 
\usetheme[height=7mm]{Rochester} 

\usepackage{tikz}
\usetikzlibrary{shapes}

\begin{document}

\begin{frame}
\frametitle{A title}

\begin{tikzpicture}[overlay,every node/.style={align=center, ellipse callout, draw, callout relative pointer={(155:1cm)}, fill=yellow!30}]
    \node<2> at (.5\textwidth,0) (hallo) {some text};
    \node<3> at (.5\textwidth,0) (hallo) {some other text};
\end{tikzpicture}

\begin{minipage}[t]{0.5\linewidth}
\begin{exampleblock}{}
\begin{enumerate}
  \setbeamercovered{transparent}
  \item \uncover<1,3>{This cake is amazing and I am looking forward to eating it!}
  \item \uncover<1,2,3>{A friend prepared this cake yesterday.}
  \end{enumerate}
\end{exampleblock}
\end{minipage}\hspace{1cm}
\begin{minipage}[t]{0.3\linewidth}
\begin{exampleblock}{}
\begin{enumerate}
  \item \uncover<3>{n.a.}
  \item \uncover<2,3>{cake}
  \end{enumerate}
\end{exampleblock}
\end{minipage}
\end{frame}

\end{document}

enter image description here

share|improve this answer

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.