1

In slide 2, I want to put a "text" (not "node") "Hello" (as mentioned in the code) to the left of the node "O.D.E soln". Not able to do that

\documentclass{beamer} 

\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage{tikz}
\usetikzlibrary{calc}

\usepackage{verbatim}
\usetikzlibrary{arrows,shapes}
\usetheme{AnnArbor}

\begin{document}

\begin{frame}
  \frametitle{Intuition: Continued...}
  \tikzstyle{format} = [draw, thin, fill=blue!20]
  \begin{itemize}
  \item<1-> Recall the proof of tracking lemma  
    \begin{tikzpicture}[auto,>=latex', thick]
      \path[use as bounding box] (-5,0.5) rectangle (10,-2);
\only<1>{
      \path[->]<1-> node[format] (link) {Algorithm};
}
\only<2->{ 
     % Want to put "Hello" to the left of the node "O.D.E soln" 
      \path[->]<2-> node[format, below of=link] (incl) {O.D.E soln.:};
}
    \end{tikzpicture}
  \item<3->  Solution
  \end{itemize}
\end{frame}

\end{document}
RIchard Williams
  • 1,219
  • 3
  • 14
  • 18

1 Answers1

1

The 'ODE-soln' node you have named incl. You can place a \node to the left of it with

\node[left=of incl] {Hello};

which requires \usetikzlibrary{positioning}. \node is a shorthand for \path node.

Below is a complete example. I also changed below of= to below=of, because of what is described in Difference between "right of=" and "right=of" in PGF/TikZ, and I changed from \tikzstyle{name}=[<options>] to \tikzset{name/.style={<options>}} as the latter is recommended. Finally, your two existing nodes I changed to \node[format] {...};.

\documentclass{beamer} 

\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage{tikz}
\usetikzlibrary{calc,positioning,arrows,shapes}

\usetheme{AnnArbor}

\begin{document}

\begin{frame}
  \frametitle{Intuition: Continued...}
  \tikzset{format/.style={draw, thin, fill=blue!20}}
  \begin{itemize}
  \item<1-> Recall the proof of tracking lemma  
    \begin{tikzpicture}[auto,>=latex', thick]
      \path[use as bounding box] (-5,0.5) rectangle (10,-2);
\only<1>{
      \node[format] (link) {Algorithm};
}
\only<2->{ 
     % Want to put "Hello" to the left of the node "O.D.E soln" 
      \node[format, below=of link] (incl) {O.D.E soln.:};
      \node[left=of incl] {Hello};
}
    \end{tikzpicture}
  \item<3->  Solution
  \end{itemize}
\end{frame}

\end{document}
Torbjørn T.
  • 206,688