In the following MWE I want to create a TikZ callout pointing to a node within a node. The outer node is for the highlighting environment \tikzMe the inner node is for the \tikzmark. Somehow I do not achieve that the callout is displayed correctly. Is there a solution?
\documentclass{beamer}
\usepackage{beamerthemeshadow}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{%
shapes.callouts,
shadows
}
\usepackage{xparse}
\tikzset{
invisible/.style={opacity=0,text opacity=0},
visible on/.style={alt=#1{}{invisible}},
alt/.code args={<#1>#2#3}{%
\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path
},
BeamerAlert/.style={alt={#1{fill=red!30,rounded corners}{}},anchor=base,inner sep=1pt}
}
\newcommand<>{\tikzMe}[1]{%
\tikz[baseline]\node[BeamerAlert={#2},anchor=base,text width=9cm] {#1};
}
\NewDocumentCommand{\mycallout}{r<> m m m m m m}{%
\tikz[remember picture, overlay]\node[drop shadow, rounded corners, align=left, fill=#7!30, text width=#4,visible on=<#1>,
draw,rectangle callout,anchor=pointer,callout relative pointer={(#5:#6cm)}]
at (#2) {#3};
}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture,baseline=-0.5ex] \node (#1) {};}
\begin{document}
\begin{frame}
\begin{itemize}
\item Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices.
\item \tikzMe<2>{Nam arcu libero, nonummy \tikzmark{x}eget, consectetuer id, \dots}
\end{itemize}
\end{frame}
\mycallout<3>{x.north}{Hahahahaha!!!}{5cm}{260}{0.7}{red}
\end{document}
NB: This question combines the accepted answers of Explanatory bubbles in beamer and Highlighting in Beamer using TikZ nodes.
\mycalloutas per Explanatory bubbles in beamer doesn't really need the\tikzmark(seem strange said by me :) ): you can also saynonummy\mycallout<3>{0,0}...that in this case is helpful. – Claudio Fiandrino Dec 02 '12 at 18:25