I would like to have a new TikZ node appear behind the previous one. For instance in beamer presentations for highlighting parts of code.
I can do this if I place the \node before the new node and give it a hardcoded overlay number, but I'd rather keep the <+> overlay specification.
Of course any suggestions for a better way to do this are also welcome!
An example of what I'm trying to achieve:
\documentclass{beamer}
\usepackage{tikz,fancyvrb}
\usetikzlibrary{shapes,positioning}
\begin{document}
\begin{frame}[fragile]
\begin{tikzpicture}
\draw<2->[fill=blue!50] (-0.5\linewidth,-1em) rectangle (0.5\linewidth,1em);
\node {
\begin{minipage}{\linewidth}
\begin{Verbatim}
Please note this line!
\end{Verbatim}
\end{minipage}
};
\end{tikzpicture}
\end{frame}
\end{document}
EDIT: example for using layers
\documentclass{beamer}
\usepackage{tikz,fancyvrb}
\usetikzlibrary{shapes,positioning,backgrounds}
\begin{document}
\begin{frame}[fragile]
\begin{tikzpicture}
\node<+-> at (0,0){
\begin{minipage}{\linewidth}
\VerbatimInput{queries/example.xquery}
\end{minipage}
};
\begin{pgfonlayer}{background}
\draw<+->[fill=blue!50] (-0.5\linewidth,-1em) rectangle (0.5\linewidth,1em);
\end{pgfonlayer}
\end{tikzpicture}
\end{frame}
\end{document}