tkz-linknodes

Présentation

tkz-linknodes.sty arose from a question of Philippe Ivaldi, about Tikz. It was a question of knowing if we could easily create links between the lines of an environment as aligned or still align by indicating the operation made between the two lines. With the Philippe's acute remarks and his active collaboration, I hope I can bring you a useful tool.
The documentation : TKZdoc-linknodes-us.pdf
Le package :tkz-linknodes.sty
Here three examples :
Equation
Equation : [PDF] [TEX]
\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[upright]{fourier}
\usepackage{tkz-linknodes}
\thispagestyle{empty}

\begin{document}

\parindent=0pt

\begin{center}
  \fbox{%
  \begin{minipage}{10cm}
        \begin{NodesList}[margin=2 cm]
       \begin{align}
     3\left(x^2-\frac{2}{3}\right) &= 4                             \AddNode\\
       3x^2-2  &= 4                                                 \AddNode\\
       3x^2    &= 6                                                 \AddNode\\
       \intertext{\hfil isolate the term with the variable \hfil}
        x^2    &= 2                                                 \AddNode\\
 \sqrt{x^2}    &= \sqrt{2}                                          \AddNode\\
      |x|      &= \sqrt{2}                                          \AddNode\\
       x       &= \pm\sqrt{2}                                       \AddNode
         \end{align}
 \LinkNodes{expand}%
 \LinkNodes{$+2$}%
 \LinkNodes{$\div 3$}
 \LinkNodes{$\sqrt{\ldots}$}
 \LinkNodes{$\sqrt{x}=|x|$}
 \LinkNodes{so that}
   \end{NodesList} 
  \end{minipage}}
\end{center}

\end{document}
% Encoding : utf8
% Author   : Alain Matthes (2008)
% Engine   : pdfLaTeX (LaTeX only with pdftex >= 1.40)
% Packages : xkeyval, tikz with arrow library, amsmath, etex, ifthen
% Remark   : needs two compilations

2) System

System
System : [PDF] [TEX]
\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[upright]{fourier}
\usepackage{amsmath,tkz-linknodes}

\thispagestyle{empty}
\begin{document}

% Show how to find the solution of two simultaneous equations.

\begin{minipage}{10cm}
  Solution of two simultaneous equations. The problem is to find the set of all solutions that satisfies both equations. These are called simultaneous equations.
  \displaywidth=.4\linewidth
  \begin{NodesList}[dy=3pt,margin=5cm]
  \[  \displaywidth=.4\linewidth
   \left\{\begin{matrix}
  3x  &+& 4y      &=& 10\\
  2x    &+&   y   &=& 5  \AddNode\\
  \end{matrix}\right. \] 

  \bigskip

  \[\displaywidth=.4\linewidth \left\{\begin{matrix}
  3x  &+& 4y      &=& 10\\
  8x    &+&   4y    &=& 20  \AddNode\\
  \end{matrix}\right. \] 

  \bigskip

  \[\displaywidth=.4\linewidth \left\{\begin{matrix}
  3x  &+& 4y      &=& 10  \\
  5x    &&        &=& 10  \AddNode\\
  \end{matrix}\right. \] 

  \bigskip

  \[\displaywidth=.4\linewidth \left\{\begin{matrix}
  3(2)  &+& 4y      &=& 10\\
  x   &&        &=& 2  \AddNode\\
  \end{matrix}\right. \] 

  \bigskip

  \[\displaywidth=.4\linewidth \left\{\begin{matrix}
  3(2)  &+& 4y      &=& 10\AddNode\\
  x   &&        &=& 2  \\
  \end{matrix}\right. \] 

  \bigskip

  \[\displaywidth=.4\linewidth \left\{\begin{matrix}
  4y      &=& 10-6\AddNode\\
  x         &=& 2  \\
  \end{matrix}\right. \] 

  \bigskip

  \[\displaywidth=.4\linewidth \left\{\begin{matrix}
  y     &=& 1 \AddNode\\
  x         &=& 2  \\
  \end{matrix}\right. \] 


    \LinkNodes{%
        \begin{minipage}{3cm}
           both sides of second equation  are multiplied by 4
           \end{minipage}}
    \LinkNodes{%
        \begin{minipage}{3cm}
        The first equation  is subtracted from  second 
           \end{minipage}}
             \LinkNodes{$\div 5$} 
       \LinkNodes{%
             \begin{minipage}{3cm}
               As a result, $x = 2$, this value is then substituted in the first equation
      \end{minipage}}
           \LinkNodes{%
           \begin{minipage}{3cm}
             $6$ is subtracted from both sides
                 \end{minipage}}
                \LinkNodes{$\div 4$}
  \end{NodesList}
\end{minipage}

The solution is $\{(x=2~;~y=1)\}$
\end{document}
% Encoding : utf8
% Author   : Alain Matthes (2008)
% Engine   : pdfLaTeX (LaTeX only with pdftex >= 1.40)
% Packages : xkeyval, tikz with arrow library, amsmath, etex, ifthen
% Remark   : needs two compilations

3)Quadratic

Quadratic
Quadratic : [PDF] [TEX]
\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[upright]{fourier}
\usepackage{amsmath,tkz-linknodes}

\thispagestyle{empty}
\begin{document}
This example is from  MathMode.pdf of Herbert Vo\ss

\begin{NodesList}[margin=1cm]
  \begin{displaymath}\displaywidth=.2\linewidth
  \begin{aligned} 
  y &= 2x^2 -3x +5                          \AddNode\\
  & \hphantom{= \ 2\left(x^2-\frac{3}{2}\,x\right. }% 
      \textcolor{blue}{% 
        \overbrace{\hphantom{+\left(\frac{3}{4}\right)^2- % 
          \left(\frac{3}{4}\right)^2}}^{=0}}   \\       
  &= 2\left(\textcolor{red}{% 
       \underbrace{% 
           x^2-\frac{3}{2}\,x + \left(\frac{3}{4}\right)^2}% 
   }% 
   \underbrace{% 
        - \left(\frac{3}{4}\right)^2 + \frac{5}{2}}% 
   \right)                                      \AddNode\\
   &= 2\left(\qquad\textcolor{red}{\left(x-\frac{3}{4}\right)^2} 
   \qquad + \ \frac{31}{16}\qquad\right)  \AddNode\\           
y  
   &= 2\left(x\textcolor{cyan}{-\frac{3}{4}}\right)^2\textcolor{blue}{+\frac{31}{8}}\AddNode 
\end{aligned} 
       \end{displaymath}
{%
\tikzset{LabelStyle/.append style = {left,text=red}}
    \LinkNodes{%
    \begin{minipage}{5cm}
      $2x^2 -3x$ is the beginning of an algebraic identity %
       (binomial formula)
      \end{minipage}}
       \LinkNodes{$(a-b)^2=a^2-2ab+b^2$}
       \LinkNodes{after simplication, the result is}%
}
        \end{NodesList}
   

\end{document}
Alain Matthes — al.ma@mac.com — last modification: « 01/03/2009 » with TextMate Hosted by WebFaction.