# Example: Tkz-linknodes examples

Published 2009-05-11 | Author: Alain Matthes

Demonstration of the tkz-linknodes package, a package that makes it easy to link elements in an amsmath align or aligned environment.

Download as: [PDF] [TEX]  •  [Open in Overleaf]

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de. En français: TeXnique.fr.

% Author: Alain Matthes (http://altermundus.com/)
\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[upright]{fourier}
\usepackage{tikz}
\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{$+2$}%
\LinkNodes{$\div 3$}
\LinkNodes{$\sqrt{\ldots}$}
\LinkNodes{$\sqrt{x}=|x|$}
\end{NodesList}
\end{minipage}}
\end{center}

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}}%
y
\end{aligned}
\end{displaymath}
{%
\tikzset{LabelStyle/.append style = {left,text=red}}
\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}