Trying to apply the solution provided for the question How to draw arrows between parts of an equation to show the Math Distributive Property (Multiplication)? I have found a major problem as is shown in my example below:
\documentclass{article}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,shapes}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\newcommand{\DrawBox}[2]{%
\begin{tikzpicture}[overlay,remember picture]
\draw[->,shorten >=5pt,shorten <=5pt,out=70,in=130,distance=0.5cm,#1] (MarkA.north) to (MarkC.north);
\draw[->,shorten >=5pt,shorten <=5pt,out=50,in=140,distance=0.3cm,#2] (MarkA.north) to (MarkB.north);
\end{tikzpicture}
}
\begin{document}
\[\tikzmark{MarkA}a(b\tikzmark{MarkB}+c\tikzmark{MarkC})=ab+ac \DrawBox{OrangeRed}{Cerulean}\]
\begin{align*}
-(2x+5)&=(-\tikzmark{MarkA}1)(2x\tikzmark{MarkB}+5\tikzmark{MarkC})\DrawBox{OrangeRed}{Cerulean}\\
&=(-1)(2x)+(-1)(5)\\
&=-2x+(-5)\\
&=-2x-5
\end{align*}
\end{document}
This gives:

To start with I don't like how the arrows leave and enter the node. I would like to able to control the height of the arc. Secondly, the arrow is not pointing correctly above the right node. I understand the command is not set to take the character and let it act as a node like in Jakes answer. This is a downfall.
Next, even when I tried Jakes method, there can only be one source but several targets. How can one define several sources. I like Peter Grill's answer since one can define several tikzmark's. This is very useful but in terms of appearance it is not the best. The color scheme I have chosen I wish to maintain standard but the other parameters I mentioned above I would like to be able to customize.
Hence, the arcs must be a suitable height (maybe let TikZ do the calculations) for this and that there can be several sources and targets without defining new \tikzmarks. Its somewhat a combination of both answers.
EDIT
I think that I am understanding the \tikzmark command but here is my major problem that can be avoided if the mathmode characters are selected as nodes as Jakes answer does.
This is the example where I see the most problem (probably its just my lack of understanding of TikZ and nodes.)
\documentclass[letterpaper]{article}
\usepackage{amsmath,amssymb}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,shapes}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\newcommand{\DrawBox}[2]{%
\begin{tikzpicture}[overlay,remember picture]
\node[xshift=0.85cm,yshift=0.65cm] (MarkExp) {\footnotesize Exponent};
\node[xshift=-0.85cm,yshift=-0.35cm] (MarkBase) {\footnotesize Base};
\draw[->,shorten >=6pt,out=180,in=90,#1] (MarkExp.west) to ([xshift=-2.5pt]MarktoExp.north);
\draw[->,out=0,in=270,#2] (MarkBase.east) to ([xshift=2.5pt,yshift=2pt]MarktoBase.south);
\end{tikzpicture}
}
\begin{document}
$\tikzmark{MarktoBase}2^3\tikzmark{MarktoExp}$\DrawBox{OrangeRed}{Cerulean}
\end{document}

I feel that in my solution above, I have forced the arrows to fit what I want even though it does the job. I sincerely believe there is a better method to achieve the same output as above.


in,outangles to suit. Normally I provide an optional#1so that those settings can be passed in as a parameter but in this case it appears that I did not do that. – Peter Grill Jun 21 '12 at 22:50