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 arrow that looks like the symbol "\leadsto" in latex? in the picture all lines are changed to the \leadsto:

enter image description here

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.

share|improve this question
    
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

1 Answer 1

up vote 1 down vote accepted

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,
    leadsto/.style={draw,decorate,decoration={snake, post=lineto, post length=3mm}}]
    \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?

share|improve this answer
    
Yes, got it, thanks very much –  sweetyBaby Aug 15 '12 at 4:03

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.