I want to define newcomands to minimize the following code:
\documentclass{beamer}
\usepackage{mathtools,tikz,lmodern, xparse}
\usetikzlibrary{shapes.geometric, arrows, matrix, positioning, shapes.callouts,shadows,shapes,chains, shapes.misc}
\tikzset{>=stealth}
\usepackage{amsmath} %For align environement
\usepackage{color}% to define the next colors
\definecolor{airforceblue}{rgb}{0.36, 0.54, 0.66}
\definecolor{alizarin}{rgb}{0.82, 0.1, 0.26}
\definecolor{white}{rgb}{1.0, 1.0, 1.0}
\definecolor{blue(munsell)}{rgb}{0.0, 0.5, 0.69}
\begin{document}
\begin{frame}{Quantum corrections to gauge interactions}
\begin{align*}
F(\Phi)= \only<1>{\begin{tikzpicture}[remember picture, note/.style={rounded rectangle, fill=blue}]\node[rounded rectangle, draw, fill=blue!20](Alpha){$\alpha$};
\end{tikzpicture}}\only<2->{\alpha} X
+\only<2>{\begin{tikzpicture}[remember picture, note/.style={rounded rectangle, fill=blue}]\node[rounded rectangle, draw, fill=blue!20](gPhi){$g(\Phi)$};
\end{tikzpicture}}\only<1,3->{g(\Phi)}
\end{align*}
\begin{tikzpicture}[remember picture,
note/.style={rectangle callout,rounded corners, fill=blue}]
\only<1>{\node [note=blue!50, opacity=.5, overlay,
callout absolute pointer={(Alpha.south)}] at (4,-0.3) {CommentI};}
\only<2>{\node [note=blue!50, opacity=.5, overlay,
callout absolute pointer={(gPhi.south)}] at (7,-0.3) {CommentII};}
\end{tikzpicture}
\end{frame}
\end{document}
I tried :
\documentclass{beamer}
\usepackage{mathtools,tikz,lmodern, xparse}
\usetikzlibrary{shapes.geometric, arrows, matrix, positioning, shapes.callouts,shadows,shapes,chains, shapes.misc}
\tikzset{>=stealth}
\usepackage{amsmath} %For align environement
\usepackage{color}% to define the next colors
\definecolor{airforceblue}{rgb}{0.36, 0.54, 0.66}
\definecolor{alizarin}{rgb}{0.82, 0.1, 0.26}
\definecolor{white}{rgb}{1.0, 1.0, 1.0}
\definecolor{blue(munsell)}{rgb}{0.0, 0.5, 0.69}
\NewDocumentCommand{\rect}{ m m m m m}{\begin{tikzpicture}[remember picture, note/.style={rounded rectangle,rounded corners}]
\node[rounded rectangle, draw, fill=#1!#2](#3){#4};\end{tikzpicture}}
\newcommand{\mycallout}[9]{\begin{tikzpicture}[remember picture, note/.style={rectangle callout,rounded corners}]
\node [note=#3!#4, opacity=.5, overlay,
callout absolute pointer={(#5)}] at (#7,#8) {#9};
\end{tikzpicture}}
\begin{document}
\begin{frame}{Quantum corrections to gauge interactions}
\begin{align*}
F(\Phi)= \only<1>{\rect{blue}{20}{Alpha}{$\alpha$}}\only<2->{\alpha} X
+\only<2>{\rect{blue}{20}{gPhi}{$g(\Phi)$}}\only<1,3->{g(\Phi)}
\end{align*}
\only<1>{\mycallout{blue}{50}{Alpha.south}{4}{0.3} {CommentI}}
\only<2>{\mycallout{blue}{50}{gPhi.south}{7}{-0.3} {CommentII}}
\end{frame}
\end{document}
But it gives me the error File ended while scanning use of \frame.. Another problem, which I want to fix, is the shift of $\alpha$ and ${g(\Phi)}$ due to the tikz box.
}, (ii) I guess, that there (and in line before) is missed\mycallout, but I'm not sure, (iii) why you need 9 parameters for\mycalloutbut use then only 6? etc – Zarko Jan 11 '16 at 16:05\mycalloutand a}... – Mohamed Vall Jan 11 '16 at 16:18