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.
\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
\begin{tikzpicture}
\draw (0,2.5) node[minimum height=1cm,minimum width=3cm,draw] (A) {A};
\draw (5,0) node[minimum height=1cm,minimum width=3cm,draw] (B){B};
\draw (5,1.5) node[minimum height=1cm,minimum width=3cm,draw] (C) {C};
\draw (5,3) node[minimum height=1cm,minimum width=3cm,draw] (D) {D};
\draw (5,4.5) node[minimum height=1cm,minimum width=3cm,draw] (E) {E};

\draw[-latex] (A.east) |- (B.west);
\draw[-latex] (A.east) |- (C.west);
\draw[-latex] (A.east) |- (D.west);
\draw[-latex] (A.east) |- (E.west);
\end{tikzpicture}

\end{document}

With Stefan's help I manage to draw the lines that travel straight and make 90 turn. The output of that solution is on the left side of the attached image. My goal is to produce result as shown on the right side of the image. I already asked similar question earlier, check here Tikz Drawing Arrow between nodes alt text

share|improve this question

2 Answers 2

up vote 9 down vote accepted

One way would be to add a stage at the start of the arrows that goes horizontally for a bit:

\draw[-latex] (A.east) -- ++(1,0) |- (B.west);

(adjust the 1 to get the length you want).

This does mean that the first part of the line would get drawn 4 times. It may not show (I don't know). To avoid that, you could draw it only the once; thus the later lines would be:

\draw[-latex] (A.east) ++(1,0) |- (C.west);

An alternative would be to put a coordinate node at that point:

\draw (A.east) -- ++(1,0) coordinate (div);
\draw[-latex] (div) |- (B.west);
\draw[-latex] (div) |- (C.west);
share|improve this answer

You can create a new command with an intermediate point

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows}

\newcommand{\myline}[2]{
\path(#1.east) --(#2.west)  coordinate[pos=0.4](mid);
\draw[-latex] (#1.east) -| (mid) |- (#2.west);
}
\begin{document}
\begin{tikzpicture}
\draw (0,2.5) node[minimum height=1cm,minimum width=3cm,draw] (A) {A};
\draw (5,0) node[minimum height=1cm,minimum width=3cm,draw] (B){B};
\draw (5,1.5) node[minimum height=1cm,minimum width=3cm,draw] (C) {C};
\draw (5,3) node[minimum height=1cm,minimum width=3cm,draw] (D) {D};
\draw (5,4.5) node[minimum height=1cm,minimum width=3cm,draw] (E) {E};

\myline{A}{E}
\myline{A}{D}
\myline{A}{C}
\myline{A}{B}

\end{tikzpicture}

\end{document}

line with intermediate point

share|improve this answer
    
The best way to mark code here is to select it and press the {} button (or Ctrl-K), rather than by enclosing it in <pre>...</pre> –  egreg Mar 24 '12 at 19:11
1  
every node/.style ={minimum height=1cm,minimum width=3cm,draw} would be nice too ! –  Alain Matthes Mar 24 '12 at 19:23

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.