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.

This is a MWE of my code:

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows}

\mode<presentation> {
\usetheme{Frankfurt}
\usecolortheme{dolphin}
}

\begin{document}

\begin{frame}

\begin{columns}[c]

\column{.7\textwidth}
\only<1>{
  \begin{tikzpicture}
    \node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=0.9\textwidth]{fig.png}};
  \end{tikzpicture}
}
\only<2>{
  \begin{tikzpicture}
    \node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=0.9\textwidth]{fig.png}};
    \draw[green,thick,rounded corners] (4.8,5.2) ellipse (0.28 and 1.5);
    \draw[->, line width=2pt, -triangle 60] (6.3,5.2) -- (5.2,5.2);
  \end{tikzpicture}
}
\only<3>{
  \begin{tikzpicture}
    \node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=0.9\textwidth]{fig.png}};
    \draw[green,thick,rounded corners] (5.8,3) ellipse (0.28 and 1.5);
    \draw[->, line width=2pt, -triangle 60] (7.1,3) -- (6.1,3);
  \end{tikzpicture}
}

\column{.35\textwidth}
\vspace{-1.cm}
\setbeamercolor{normal text}{fg=gray,bg=}
\setbeamercolor{alerted text}{fg=black,bg=}
\usebeamercolor{normal text}
\begin{itemize}
\item \alert<+>{Some text goes here sdsdf sdfsdfsdfsdf.}\\[4ex]
\item \alert<+>{Some more text here sdfdsf.}\\[4ex]
\item \alert<+>{And some text here.}
\end{itemize}

\end{columns}

\end{frame}

\end{document}

This creates three slides with the same image:

enter image description here enter image description here enter image description here

It might not be noticeable when seen separate but the grey square does not maintain a fixed position within the slides. How do I get it to stop moving around?

Here's the grey square I use: enter image description here

share|improve this question
1  
You might have a look to the answer of Beamer: problematic use of \visible and \only in combination with TikZ to draw a graph: it contains references to understand and solve the problem. –  Claudio Fiandrino Mar 12 '13 at 13:27
    
Thanks Claudio, I followed that answer and wrapped the code around an overlayarea environment and it worked. Want to make that into an answer so I can mark it as accepted? –  Gabriel Mar 12 '13 at 13:35
    
Well someone already provided an answer that also works. –  Gabriel Mar 12 '13 at 13:37
    
Perhaps also worth looking at tex.stackexchange.com/q/18704/86 –  Andrew Stacey Mar 12 '13 at 13:46
    
@AndrewStacey: a pointer to that question is also present in the link I added :) I think for the OP all the references given there are of help to understand the problem. –  Claudio Fiandrino Mar 12 '13 at 14:08
add comment

1 Answer

up vote 3 down vote accepted

As pointed out by Claudio, you should use \visible instead of \only if you don't want things to move around from one slide to the next:

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows}

\mode<presentation> {
\usetheme{Frankfurt}
\usecolortheme{dolphin}
}


\begin{document}

\begin{frame}

\begin{columns}[c]

\column{.7\textwidth}
  \begin{tikzpicture}
    \node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=0.9\textwidth]{fig.png}};
    \visible<2>{
        \draw[green,thick,rounded corners] (4.8,5.2) ellipse (0.28 and 1.5);
        \draw[->, line width=2pt, -triangle 60] (6.3,5.2) -- (5.2,5.2);
    }
    \visible<3>{
        \draw[green,thick,rounded corners] (5.8,3) ellipse (0.28 and 1.5);
        \draw[->, line width=2pt, -triangle 60] (7.1,3) -- (6.1,3);
    }
  \end{tikzpicture}


\column{.35\textwidth}
\vspace{-1.cm}
\setbeamercolor{normal text}{fg=gray,bg=}
\setbeamercolor{alerted text}{fg=black,bg=}
\usebeamercolor{normal text}
\begin{itemize}
\item \alert<+>{Some text goes here sdsdf sdfsdfsdfsdf.}\\[4ex]
\item \alert<+>{Some more text here sdfdsf.}\\[4ex]
\item \alert<+>{And some text here.}
\end{itemize}

\end{columns}

\end{frame}

\end{document}
share|improve this answer
    
Thanks, that worked great! –  Gabriel Mar 12 '13 at 13:39
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.