Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

What´s the best way to explain every equality? With arrows like in

enter image description here

Anything similar to this enter image description here

share|improve this question
    
See texample.net/tikz/examples/beamer-arrows. –  Jubobs Jun 3 '13 at 10:15
    
+1 for adding information about the question using the SO page of the question itself! –  Bakuriu Jun 3 '13 at 16:25
add comment

3 Answers

I can suggest three possibilities.

\documentclass{article}
\usepackage{amsmath}

% for the first solution
\usepackage{mathtools}
\newcommand{\equalexpl}[1]{%
  \underset{\substack{\uparrow\\\mathrlap{\text{\hspace{-1em}#1}}}}{=}}


\begin{document}

\begin{align*}
f(ax+by) 
&\equalexpl{because $f(u+v)=f(u)+f(v)$}
  f(ax) + f(by) \\
&\equalexpl{because $f(cu)=cf(u)$}
 af(x) + bf(y)\\
\end{align*}

\begin{alignat*}{2}
f(ax+by)
&= f(ax) + f(by)\qquad &&\text{because $f(u+v)=f(u)+f(v)$} \\
&= af(x) + bf(y)\qquad &&\text{because $f(cu)=cf(u)$}
\end{alignat*}

\begin{align*}
&f(ax+by)\overset{(1)}{=} f(ax) + f(by) \overset{(2)}{=} af(x) + bf(y)\\[2ex]
&\text{(1) because $f(u+v)=f(u)+f(v)$} \\
&\text{(2) because $f(cu)=cf(u)$}
\end{align*}

\end{document}

enter image description here

share|improve this answer
    
egreg Thank you. Good solution I like your propose –  Mika Ike Jun 3 '13 at 13:08
add comment

Here's a solution using TikZ:

\documentclass{article}
\usepackage{tikz}

\newcounter{mybox}
\newcommand\tikzmark[1]{%
\tikz[remember picture,overlay] \node[inner xsep=0pt] (#1) {};
}
\newcommand\ColorBox[2][]{%
\stepcounter{mybox}%
\node[draw=red!70!black,fill=red!20,align=left,#1] (box\themybox) {#2};
}

\begin{document}

\[
a(b + c) \tikzmark{a}= ab+ac \tikzmark{b}= ba+ca.
\]
\begin{tikzpicture}[remember picture,overlay]
\ColorBox[xshift=3cm]{by distributivity}
\draw[red!70!black,->] (box1) -| ([xshift=7.5pt]a.south west);
\ColorBox[xshift=10cm,fill=blue!30,draw=blue]{by commutativity}
\draw[blue,->] (box2) -| ([xshift=7.5pt]b.south west);
\end{tikzpicture}

\end{document}

enter image description here

\ColorBox has one optional argument to control options for the \node used to draw the box, and a mandatory argument for the explanatory text. The associated node is automatically named box<number>. Using \tikzmark you mark any element that will be the end of the arrow and then you can draw the arrow with a standard \draw command.

share|improve this answer
    
\usetikzlibrary{tikzmark} –  Andrew Stacey Jun 3 '13 at 16:46
add comment

If I understand your referenced image properly

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{array}{lll}
f(ax+by) &= f(ax) + f(by) &= a f(x) + b f(y)\\
&\uparrow &\uparrow \\
& \textrm{because } f(x+\mu) = f(x) + f(\mu) 
&\textrm{because }f(z\lambda) = z f(\lambda) \\
\end{array}
\]

\end{document}

enter image description here

share|improve this answer
    
Steven B. Segletes I like. I adjust to my TEX files. Thank you –  Mika Ike Jun 3 '13 at 13:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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