I'm trying to reproduce the example on creating a Presentation with LaTeX Beamer – Equations and tikz and the given code throws the following error
Package pgfkeys Error: I do not know the key '/tikz/na'.
The LaTex code is
\documentclass[compress]{beamer}
\usetheme{Warsaw}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes}
\tikzstyle{every picture}+=[remember picture]
\begin{document}
\begin{frame}
\frametitle{Test}
\begin{itemize}
\item Overall mean \tikz[na] \node[coordinate] (s1) {};
\end{itemize}
\tikzstyle{na} = [baseline=-.5ex]
\begin{equation}
y_{ijk} = \tikz[baseline]{ \node[fill=blue!20,anchor=base,rounded corners=2pt]
(d1) {$\mu$}; }
+ \tikz[baseline]{ \node[fill=red!20,anchor=base,rounded corners=2pt]
(d2) {$r_{i}$}; }
+ \tikz[baseline]{ \node[fill=green!20,anchor=base,rounded corners=2pt]
(d3) {$c_{j}$}; }
+ \tikz[baseline]{ \node[fill=yellow!20,anchor=base,rounded corners=2pt]
(d4) {$t_{k}$}; }
+ \epsilon_{ijk}
\end{equation}
\begin{itemize}
\item Effect of row $i$ \tikz[na] \node[coordinate] (s2) {};
\item Effect of column $j$ \tikz[na] \node[coordinate] (s3) {};
\item Effect of treatment $k$ \tikz[na] \node[coordinate] (s4) {};
\end{itemize}
\begin{tikzpicture}[overlay]
\path[->] (s1) edge [bend left] (d1);
\path[->] (s2) edge [bend right] (d2);
\path[->] (s3) edge [out=0, in=-90] (d3);
\path[->] (s4) edge [out=0, in=-90] (d4);
\end{tikzpicture}
\end{frame}
\end{document}
Also my equation is not animated. Any help to fix this error will be highly appreciated. Thanks
Best Answer
If you move the
\tikzstyle{na} = [baseline=-.5ex]
to be in the preamble, then it compiles:Notes:
\tikzset
instead of\tikzstyle
as per: Should \tikzset or \tikzstyle be used to define TikZ styles?Animation:
Since you are using the
beamer
class, the\pause
macro can be used to create the effect of animation across several slides:With this change and two compiles, you should get an 6 page document that I think will do what you are looking for.
Code: