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.

please refer to the answer of how to draw a process flow figure? Now I what to change all arrows look like \leadsto in latex, you are refer to the picture
enter image description here I can not find it in the manual, would someone know how to do it? Please help me.

 \documentclass[a4paper,12pt]{article}
    \usepackage{tikz}
    \usetikzlibrary{trees}

    \tikzset{level 1/.style={level distance=1.5cm, sibling distance=3.5cm}}
    \tikzset{level 2/.style={level distance=1.5cm, sibling distance=2cm}}

    \tikzset{bag/.style={text width=20em, text centered,yshift=-0.2cm}}

    \begin{document}
    \begin{tikzpicture}[grow=down, -stealth]
    \node[bag]{$(B)$} 
        child{ edge from parent node[right]{t}; \node[bag]{$(Rgood)$}
                child{ edge from parent node[right]{and}; \node[bag]{$(and)$}
                        child[missing]
                        child{ edge from parent node[right=0.1cm]{it}; \node[bag]{$(path1)$}}
                        child{ edge from parent node[right=0.1cm]{else}; \node[bag]{$(path2)$}}
                }
        };
    \end{tikzpicture}

    \end{document}
share|improve this question

1 Answer 1

up vote 6 down vote accepted

You can add option edge from parent to specify a style for the edges of the tree, and use decorations to get that "wavy" line:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{trees,decorations.pathmorphing}

\tikzset{level 1/.style={level distance=1.5cm, sibling distance=3.5cm}}
\tikzset{level 2/.style={level distance=1.5cm, sibling distance=2cm}}
\tikzset{bag/.style={text width=20em, text centered,yshift=-0.2cm}}

\begin{tikzpicture}[grow=down, -stealth,
    edge from parent/.style={draw,decorate,decoration={snake, post=lineto, post length=3mm}}]
    \node[bag]{$(B)$}
        child{ edge from parent node[right]{t}; \node[bag]{$(Rgood)$}
            child{ edge from parent node[right]{and}; \node[bag]{$(and)$}
                child[missing]
                child{ edge from parent node[right=0.1cm]{it}; \node[bag]{$(path1)$}}
                child{ edge from parent node[right=0.1cm]{else}; \node[bag]{$(path2)$}}
        }};
\end{tikzpicture}

result

share|improve this answer
    
thanks, however, what's wrong with my code, i add the style, but it doesn't work. Please refer to tex.stackexchange.com/questions/67079/… –  sweetyBaby Aug 14 '12 at 11:37

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.