LaTeX forum ⇒ Text FormattingCurved over-head Arrows connecting Numbers

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
HunterDX77M
Posts: 2
Joined: Tue Jun 19, 2012 6:48 pm

Curved over-head Arrows connecting Numbers

Postby HunterDX77M » Sun Jul 22, 2012 2:20 am

Hello all,

I am going to be teach my student about the FOIL method of multiplication. In order to do that, I thought it would be a nice visual helper if I could draw arrows curving from one number to another and I was wondering if that was possible with LaTeX.

For example if I have (a + b)*(c + d), I want to draw an arrow coming out of "a" going over "b" and terminating at "c". Can that be done with LaTeX?

Thanks for any input! :D
WARNING: You are in the presence of a n00b. Stupid questions can and will be asked.

Operating System: Ubuntu Linux 12.04 LTS
Editor/IDE: TexMaker

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
cgnieder
Site Moderator
Posts: 1948
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Sun Jul 22, 2012 2:47 pm

Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Sun Jul 22, 2012 2:53 pm

A soluton with pgf/tikZ.
  1. \documentclass{scrartcl}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{tikz}
  4. \usetikzlibrary{calc,matrix}
  5.  
  6. \begin{document}
  7. \begin{equation}
  8. \begin{tikzpicture}[>=stealth,baseline,anchor=base,inner sep=0pt]
  9. \matrix (foil) [matrix of math nodes,nodes={minimum height=0.5em}] {
  10. ( & a & + & b & ) & \cdot & ( & c & + & d & ) \\
  11. };
  12. \path[->] ($(foil-1-2.north)+(0,1ex)$) edge[red,bend left=45] ($(foil-1-8.north)+(0,1ex)$)
  13. ($(foil-1-2.north)+(0,1ex)$) edge[green,bend left=60] ($(foil-1-10.north)+(0,0.5ex)$)
  14. ($(foil-1-4.north)+(0,0.5ex)$) edge[blue,bend left] ($(foil-1-8.north)+(0,1ex)$)
  15. ($(foil-1-4.north)+(0,0.5ex)$) edge[orange,bend left=45] ($(foil-1-10.north)+(0,0.5ex)$);
  16. \end{tikzpicture}
  17. \end{equation}
  18. \end{document}



Thorsten
Attachments
FOIL.png
The obtained output.
FOIL.png (7.71 KiB) Viewed 2659 times
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 2 guests