I wish to draw a complex work flow using tikz 2.0 because I tried to update the tikz to 2.1, there are many problems. The work work flow is described as follows:
I have tried to draw it by locating the rectangles using coordinator, however it is very hard to make it precise, is there any simpler and better way? Thanks!
the code I tried is

2 Answers
2

Disclaimer

Just after writing this whole answer, I read Alain Matthes' one and realized that the question was about tikz 2.0. I overlooked this requirement so my answer is probably not useful for the OP. But I decided to leave here anyway because it illustrates some techniques which can be useful to other readers.

Original answer

You should use positioning library in order to get rid of absolute coordinates, and fit library to draw nodes around other nodes. Let's build your example step by step:

First, nodes a, b, c, and d can be positioned relatively each other the following way:

Now, using fit again, we draw the box around all of this. But there is a problem, since I presume you want that box of the same size than the one which contains e and f (to be drawn later). A workaround can be to give it a minimum height, and use the same amount for both boxes. This minimum height is found by trial and error, and this is why I don't like very much this part...

Finally, using the same techniques again, you can position nodes e and f relative to c, and fit a box of a minimum height around them. In order to get a proper alignment of the right box with the left one, I had to insert a "invisible" diamond on top of e:

thanks, it helps a lot, anther question, how to move the labe h1 at the top of the rectangle? it seems very near to the box
–
sweetyBabyFeb 14 '13 at 9:23

@sweetyBaby You can move the label=90:hl option to the node diamond aux, which is an invisible node at top of e.
–
JLDiazFeb 14 '13 at 9:27

@sweetyBaby or, for fine grained positioning you can remove the option label=90:hl and manually place the text below the top border of the rectangle, with \node[below=2mm of right part.north] {hl};
–
JLDiazFeb 14 '13 at 9:29

thanks, if I want to add label "test" besides the arrow that connects box "a" and "b", I tried "\draw[->] (a) -- (b){test};" but it doesn't work
–
sweetyBabyFeb 14 '13 at 11:17

@sweetyBaby you can only typeset text inside a node (or a label option which is a shortcut for a node). But you can add nodes to a line. You have to specify the position inside the line (eg: midway) and the position of the text with respect the line (eg: left). In summary: \draw[->] (a)--(b) node[midway, left] {test};
–
JLDiazFeb 14 '13 at 16:12

It's not easy to work with pgf 2.0 because I forgot a lot of things. It's possible to use the calc library with pgf 2.00 but here I used an old method to build the picture. If this code works for you, You can get a better code with some helps.