Source:
Better solution to display the Distributive Property
Question:
When i came across the answer given by Peter Grill,
i am very interesting to know that how we can extend(modify) this codes for this type of multiplication (a+b)(c+d)=ac+ad+bc+bd
I mean how can we draws arrows between the parts of these two brackets.
I tried lot at my best level but couldn't find the appropriate corrections.
CODE:
\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}
\LARGE
\[\tikzmark{MarkA}(a+b)(c\tikzmark{MarkB}+d\tikzmark{MarkC})=ac+ad+bc+bd \DrawBox{OrangeRed,distance=1cm,in=110,shorten >=10pt}{Cerulean,out=115,in=70,distance=1.5cm}\]
\end{document}
