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.

I'd like to connect two cells from different tables using arrows. How can this be achieved?

enter link description here

share|improve this question
1  
Are there any restrictions in terms of the packages you're allowed (or want to) use? For example, this is easy-peasy using tikz. –  Werner Jun 22 '12 at 21:54
    
no restrictions, i haven't used tikz, is it possible to animate when drawing with tikz?, i am using beamer. –  GandhaBaccha Jun 22 '12 at 22:05

1 Answer 1

up vote 10 down vote accepted

Here are a couple of different ways to do this with TikZ:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart,matrix,positioning}
\begin{document}
\begin{tikzpicture}
\node[rectangle split, rectangle split parts=3,draw,inner sep=1ex] (A) at (0,1)
{minus\nodepart{two}times\nodepart{three}transpose};

\node[rectangle split, rectangle split parts=5,draw,inner sep=1ex] (B) at (3,1)
{mmul\nodepart{two}mmuli\nodepart{three}sub\nodepart{four}subi\nodepart{five}transpose};
\draw[->] (A.text east) -- (B.three west);
\draw[->] (A.text east) -- (B.four west);
\draw[->] (A.two east) -- (B.text west);
\draw[->] (A.two east) -- (B.two west);
\draw[->] (A.three east) -- (B.five west);
\node (C) [below=of A]{Matrix Class};
\node[below= .5cm of B,text width=2cm,align=center]{Double Matrix\\ Class};
\end{tikzpicture}

\bigskip
\begin{tikzpicture}
\matrix (A) [matrix of nodes,nodes={draw, minimum size=.65cm, text width=2cm,align=center}] at (0,1)
{
minus\\
times\\
transpose\\
};
\matrix (B) [matrix of nodes,nodes={draw, minimum size=.65cm, text width=2cm,align=center}] at (4,1)
{
mmul\\
mmuli\\
sub\\
subi\\
transpose\\
};

\draw[->] (A-1-1.east) -- (B-3-1.west);
\draw[->] (A-1-1.east) -- (B-4-1.west);
\draw[->] (A-2-1.east) -- (B-1-1.west);
\draw[->] (A-2-1.east) -- (B-2-1.west);
\draw[->] (A-3-1.east) -- (B-5-1.west);

\node (C) [below=of A]{Matrix Class};
\node[below= .25cm of B,text width=2cm,align=center]{Double Matrix\\ Class};
\end{tikzpicture}

\end{document}

output of code

share|improve this answer
    
thanks a lot it's exactly what i want, can you refer me to any good tutorials for learning this stuff? –  GandhaBaccha Jun 22 '12 at 22:55
1  
@user895657 The TikZ manual (written by the same person who developed Beamer) has lots of good tutorials. There are also plenty of great examples of all sorts of TikZ solutions ranging from simple to extraordinary here on the site. –  Alan Munn Jun 22 '12 at 23:29
    
@AlanMunn How can I put the arrow on the "north" or top of the table and connect it to the top of the next table? –  kolonel Jan 30 at 19:01
    
@kolonel I'm not quite sure what you want. Do you want an arrow between the top of the 'minus' in the first table and the 'minus' in the second table? –  Alan Munn Jan 30 at 21:54

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.