# how to draw part of the picture to be line and the other part to be the “\leadsto” symbol

Please refer to the answer of how to draw arrow that looks like the symbol "\leadsto" in latex? in the picture all lines are changed to the \leadsto:

Now i want to keep the connector between "b" and "Rgood" be the line like"->", so how to change the code ? since the style edge from parent/.style={draw,decorate,decoration={snake, post=lineto, post length=3mm}}] is for the whole picture.

-
Downvote: I don't think it is good to ask a chain of follow-up questions, each referring to the last one. This is not a forum thread, it is exhausting to dig all other questions up. I believe that questions are preferred, which can be understood by means of just their own description, whereas a reference might clarify some details or provide an interesting comparison. Also the title appears to not describe what is wanted here very precisely. – IARI Aug 14 '12 at 21:31

You can simply put the leadsto-like decoration into styles which allows you to manually apply them to exactly the arcs you want.

This version with the edge from parent preceeding the actual node is a bit of a hack to achieve the edge-labels. The edge appears to be inserted again for the nodes, so i had to add edge from parent[draw=none] after each node.

Unless someone better knows an elegant solution that uses the tree library and its automatic growth, personally i would refrain from this and prefer placing the nodes and connecting them with edges manually.

\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{document}
\begin{tikzpicture}[grow=down, -stealth,
\node[bag]{$(B)$}
child {edge from parent node[right]{t}; \node[bag]{$(Rgood)$} edge from parent[draw=none]
child{ edge from parent[leadsto] node[right]{and}; \node[bag]{$(and)$} edge from parent[draw=none]
child[missing]
child{ edge from parent[leadsto] node[right=0.1cm]{it}; \node[bag]{$(path1)$} edge from parent[draw=none]}
child{ edge from parent[leadsto] node[right=0.1cm]{else}; \node[bag]{$(path2)$} edge from parent[draw=none]}
}};
\end{tikzpicture}
\end{document}


Is this result what you want?

-
Yes, got it, thanks very much – sweetyBaby Aug 15 '12 at 4:03