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.

In the example below I'd like to have angled edges which just go vertically and horizontally. My aim is to get the edges like in this image (the rounded edges are not a must) BPMN image:

Here is my minimal working example:

\documentclass{article}

\usepackage{tikz}

\usetikzlibrary{arrows,positioning, shapes.symbols,shapes.callouts,patterns}


\begin{document}
\begin{tikzpicture}[
    pre/.style={<-,shorten <=1pt,>=stealth',semithick},
    post/.style={->,shorten >=1pt,>=stealth',semithick}
    ]

\node[draw](start){start};

\node[draw, right=of start] (split) {+}
            edge[pre](start);

\node[draw, right=of split](pricedb){PriceDB}
    edge[pre](split);

\node[draw, below=of pricedb](stockdb){StockDB}
    edge[pre](split);

\node[draw, above=of pricedb](orderpage){OrderPage}
    edge[pre](split);   

\node[draw,right=of pricedb](join){+}
    edge[pre](pricedb)
    edge[pre](stockdb)
    edge[pre](orderpage);

\node[draw, right=of join](invoice){invoiceservice}
    edge[pre](join);

\node(silent)[right=of invoice]{}
    edge[<-,shorten <=1pt,>=stealth',semithick, dashed](invoice);
\end{tikzpicture}
\end{document}
share|improve this question

2 Answers 2

up vote 6 down vote accepted

with draw it's simple

\documentclass{article}

\usepackage{tikz}

\usetikzlibrary{arrows,positioning, shapes.symbols,shapes.callouts,patterns}


\begin{document}
\begin{tikzpicture}[
    pre/.style={=stealth',semithick},
    post/.style={->,shorten >=1pt,>=stealth',semithick}
    ]

\node[draw](start){start};

\node[draw, right=of start] (split) {+}
            edge[pre](start);

\node[draw, right=of split](pricedb){PriceDB}
    edge[pre](split);

\node[draw, below=of pricedb](stockdb){StockDB};
\node[draw, above=of pricedb](orderpage){OrderPage};   
\node[draw,right=of pricedb](join){+}
    edge[pre](pricedb);
\node[draw, right=of join](invoice){invoiceservice}
    edge[pre](join);

 \draw[post,rounded corners=5pt] (orderpage)-|(join)  ;   
 \draw[post,rounded corners=5pt] (stockdb)-|(join)  ;   
 \draw[post,rounded corners=5pt] (split) |- (orderpage);
  \draw[post,rounded corners=5pt] (split) |- (stockdb);

\node(silent)[right=of invoice]{}
    edge[=stealth',semithick, dashed](invoice);
\end{tikzpicture}
\end{document}

liens

share|improve this answer

Actually you can do that with edge instead of \draw: Just add

\tikzset{
    -|/.style={to path={-| (\tikztotarget)}},
    |-/.style={to path={|- (\tikztotarget)}},
}

somewhere, then you can use edge[-|] and edge[|-]. (Of course you can replace them with other names like “hv” or “vh” for “horizontal-vertical” etc, if you still want to use the -|/|- arrow heads somewhere.)

Your code will then look like this:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes.symbols,shapes.callouts,patterns}


\begin{document}    
\tikzset{
    -|/.style={to path={-| (\tikztotarget)}},
    |-/.style={to path={|- (\tikztotarget)}},
}

\begin{tikzpicture}[
        pre/.style={<-,shorten <=1pt,>=stealth',semithick},
        post/.style={->,shorten >=1pt,>=stealth',semithick}
    ]

    \node[draw](start){start};

    \node[draw, right=of start] (split) {+}
        edge[pre](start);

    \node[draw, right=of split](pricedb){PriceDB}
        edge[pre](split);

    \node[draw, below=of pricedb](stockdb){StockDB}
        edge[pre,-|](split);

    \node[draw, above=of pricedb](orderpage){OrderPage}
        edge[pre,-|](split);

    \node[draw,right=of pricedb](join){+}
        edge[pre](pricedb)
        edge[pre,|-](stockdb)
        edge[pre,|-](orderpage);

    \node[draw, right=of join](invoice){invoiceservice}
        edge[pre](join);

    \node(silent)[right=of invoice]{}
        edge[<-,shorten <=1pt,>=stealth',semithick, dashed](invoice);
\end{tikzpicture}
\end{document}
share|improve this answer

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.