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.

It's my first post, I've been using LaTeX for some time now but frankly I'm still a rookie.

But this question is more about TikZ than about LaTeX:

I want to draw somehting like this, set of parallel arrows to represent a bus in the digital system, does anybody know to accomplish it?

want to draw this

share|improve this question

1 Answer 1

up vote 6 down vote accepted

HTH!

The result:

Bus of arrows between nodes

And the code:

\documentclass [tikz] {standalone}

\usetikzlibrary{shapes.geometric}
\usetikzlibrary{calc}

\newcounter{mynodes}

% node, begin anchor, end anchor, name
\newcommand{\makepoints}[4]{
    \foreach \k in {1, ..., \points}
    {
        \pgfmathsetmacro{\dist}{\k * (1 / (\points + 1))}
        \coordinate (#1 #4 \k) at ($(#1.#2)!\dist!(#1.#3)$);
    }
}

\begin{document}
    \begin{tikzpicture}

        % number of arrows between nodes
        \pgfmathtruncatemacro{\points}{5}

        % square 1
        \node [draw, minimum size = 2cm] (square 1) {};
        \makepoints{square 1}{south west}{south east}{bottom}

        % square 2
        \node [draw, minimum size = 2cm] (square 2) at (0, -4cm) {};
        \makepoints{square 2}{north west}{north east}{top}

        % arrows
        \foreach \i in {1, ..., \points} {
            \draw [->] (square 1 bottom \i) -- (square 2 top \i);
        }

    \end{tikzpicture}
\end{document}
share|improve this answer
    
Awesome, thanks, what about node nesting ? –  Mapedd Oct 18 '12 at 13:18
    
    
I think you just need to draw a node (large box) around the other nodes (boxes inside). You can read in the manual about the fit library also, if you are looking for a more elegant solution. –  tecepe Oct 18 '12 at 13:59
    
Thanks for help, i will look after those soultions :D –  Mapedd Oct 19 '12 at 9:06

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.