2

I trying to explain the orders of multiplication of algebraic expression. With MWE and \usepackage{tikz-dependency}, I failed to produce what I want though:

   $\begin{aligned}[t]          
 (a+b)^{2}&=\begin{dependency} [theme = simple]
   \begin{deptext}
      (\&a+\&b)(\&a+\&b)
  \end{deptext}
 \depedge{1}{3}{1}
 \depedge{1}{4}{2}
\depedge{2}{3}{3}
\depedge{2}{4}{4}
 \end{dependency}
  \\&=a^2+ab+ba+b^2
\\&=a^2+2ab+b^2
 \end{aligned} $
4

I don't know what you want of course, but this works at least:

\documentclass{article}
\usepackage{amsmath,tikz-dependency}

\begin{document}
  \[
\begin{aligned}[t]          
   (a+b)^{2}&=
    \begin{dependency}[theme = simple,baseline=-3pt]
    \begin{deptext}[inner xsep=0pt,column sep=0pt,nodes={inner sep=0pt}]
      $($\&$a$\&${}+{}$\&$b$\&$)($\&$a$\&${}+{}$\&$b$\&$)$ \\
    \end{deptext}
    \depedge{1}{6}{1}
    \depedge{1}{8}{2}
    \depedge{4}{6}{3}
    \depedge{4}{8}{4}
  \end{dependency}
  \\&=a^2+ab+ba+b^2
  \\&=a^2+2ab+b^2
\end{aligned}
\]
\end{document}

enter image description here

  • 1
    This is exactly what I want. Dollars here are that very important!!! – Panha Mar 20 '16 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.