I'd like to make a slide in beamer with a few equations that labels the parts of the last equation shown. I'm doing this with overlays so one equation is added at a time, and only that last equation shows is labeled.
In one approach I've tried, the position of the labels changes each time I compile the file. Specifically, the labels move something like \vspace{0.05cm} upward or \vspace{-0.05cm} downward each time I compile, depending on whether the label is above or below the equation. I want these labels to stop moving on their own. Compile the file about 20 times and you'll see a huge change.
I am also having the problem sometimes that the equation is not all aligned. In the following example, the "Max" is not aligned with the rest of the equation.
\documentclass[professionalfonts, smaller]{beamer}
\usetheme{CambridgeUS}
\usepackage{tikz}
\usepackage{iwona}
\usepackage{amsmath}
\usepackage{mathtools}
\usetikzlibrary{arrows,shapes}
\DeclareMathOperator*{\Max}{Max}
\begin{document}
\tikzstyle{every picture}+=[remember picture]
\everymath{\displaystyle}
\begin{frame}
\frametitle{Slide Title}
\tikzstyle{na} = [baseline=-.5ex]
\vspace{1cm}
\hspace{0.0cm} Comment on x \tikz[na] \node[coordinate] (n1) {};
\hspace{1.25cm} \tikz[na] \node[coordinate] (n2) {}; Comment on p(x)
\vspace{0.0cm}
\begin{equation*}
\hspace{-4.5cm}
\tikz[overlay, remember picture, baseline]{
\node[anchor=base](t1){$\Max\limits_x$};
}
\tikz[overlay, remember picture, baseline]{
\node[anchor=base, right of=t1, node distance=30pt](t2){$L(x) =$};
}
\tikz[overlay, remember picture, baseline)]{
\node[anchor=base, right of=t2, node distance=35pt](t3){$p(x) +$};
}
\tikz[overlay, remember picture, baseline)]{
\node[anchor=base, right of=t3, node distance=29pt](t4){$\gamma d(x)$};
}
\end{equation*}
\vspace{0.4cm}
\hspace{0cm} Comment on L(x) \tikz[na]\node [coordinate] (n3) {}; \hspace{1.5cm} Comment on \tikz[na]\node [coordinate] (n4) {}; d(x)
\begin{tikzpicture}[overlay]
\path[->](n1) edge [bend left] (t1);
\path[->](n2) edge [bend right] (t3);
\path[->](n3) edge [bend right] (t2);
\path[->](n4) edge [bend right] (t4);
\end{tikzpicture}
\end{frame}
\end{document}

t1's placement depends ont1's baseline, and so on. So TikZ is constantly recalculating. Indeed,latexmkgives up recompiling, suspecting an infinite loop. – Matthew Leingang Feb 8 '12 at 15:37anchor=basekey. – Matthew Leingang Feb 8 '12 at 16:13