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.

I'm very, very new to TiKZ.

I'd like to make the (very crude) following diagram with TiKZ:

   Start
     |
     | Process 1
     |
    / \
   /   \
  /     \
Item   Item
         |
         | Process 2
         |
        / \
       /   \
      /     \
    Item    Item

And while Section 18 of the TiKZ manual has been very useful for making the diagram above without the Process labels, I can't find anything on how to add the labels where I want.

Here's my MWE:

\documentclass[10pt, tikz]{standalone}
\begin{document}
\begin{tikzpicture}
  \node {start}
    child {
      child {
        node {item 1}
      }
      child {
        node {item 2}
        child {
          child {
            node {item 3}
          }
          child {
            node {item 4}
          }
        }
      }
    };
\end{tikzpicture}
\end{document}

Or should I be taking a different approach to create this diagram?

mwe output

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You need to add the edge from parent nodes at the end of a child.

Code

\documentclass[10pt, tikz]{standalone}
\begin{document}
\begin{tikzpicture}[auto]
  \node {start}
    child {
      child { node {item 1} }
      child { node {item 2}
        child {
          child { node {item 3} }
          child { node {item 4} }
          edge from parent node {Process 2}
        }
      }
      edge from parent node {Process 1}
    };
\end{tikzpicture}
\end{document}

Output

enter image description here

share|improve this answer
    
I saw your comment and got it to work, but I'm glad you made an answer. :) –  user2473 Feb 14 '13 at 22:38
add comment

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.