I hope to draw a picture like this:

enter image description here

I find it difficult because

  • Each rectangle is similar in size, with multiple lines of text inside;
  • Some of the upper right corner of the rectangle has some numbers;
  • I can't deal with the four arrows fired from a rectangle IV;
  • Do not know how to locate the rectangle X;
  • I've never drawn this type of graph, no strategy.

Maybe my question violate of the norms of the Forum, but I don't have any other way.

  • 1
    texample.net/tikz/examples/assignment-structure and texample.net/tikz/examples/class-diagram should get you started. --- Prepare a MWE with the best you can do and someone will fill the blanks --- It's not reasonable to ask anyone to type all that text straight on, don't you think? – Rmano Mar 26 '16 at 10:41
  • 2
    Please at leat try to make the code as similar as possible to your problem. Copying and pasting a different thing is not helping anyone... – Rmano Mar 26 '16 at 10:48
  • 1
    I have recently discovered the package forest for drawing trees. The documentation is pretty good and I think it will suit your needs. – Jeroen Mar 26 '16 at 12:50
  • 1
    Would you rather use absolute positioning "at (0,5)" or relative positioning [below=1cm]? – John Kormylo Mar 26 '16 at 16:01
  • 2
    It would help to have an example with content which matched that in your target image!! – cfr Mar 26 '16 at 16:16

Please note that (very nearly almost) all questions should include a minimal example bearing at least some relation to what you are trying to do ;). For example, containing the textual content you are working with and a basic document framework.

Here's one way:

  forked edges,
  my label/.style={%
    tikz+={\node [font=\scriptsize, anchor=south east] at (.north east) {#1};}
  for tree={%
    minimum height=20mm,
    minimum width=30mm,
    l sep'=10mm,
    s sep'=10mm,
  [Introduction\\Sets, my label=1
    [I\\Groups, l sep'=20mm, my label={2,3}
      [II\\Structure\\of Groups, edge path'={(!u.west) |- (.child anchor)}, before computing xy={l'=20mm}]
      [III\\Rings, my label={2,3}
        [IV\\Modules, edge+={densely dashed}, my label={2,3,4}
          [V\\Galois\\Theory, my label={2,5}
            [VI\\Structure\\of Fields, my label=6]
          [VIII\\Commutative\\Rings \&\\Modules, tikz+={\draw [->, densely dashed] (.east) -- (!n.west);}, my label=?]
          [IX\\Structure\\of Rings, my label={8,9,10}]
      [X\\Categories, no edge, before computing xy={l'=20mm}, my label=11]

Forest solution

| improve this answer | |
  • This figure is perfect, unfortunately, I do not understand the code temporarily read, I first mark, hope to be able to read in the future. – poorich Mar 26 '16 at 16:58
  • This is my questioning behavior of lazy behavior, but there is no other way. Thank you for your help. – poorich Mar 26 '16 at 17:00
  • 2
    The trouble is, it is too much to explain the whole thing in a single answer. So when people provide an example and I can see where they are getting stuck, I can write an answer which explains that particular bit. But you have to ask a more specific question for that to be possible because answers here are limited in length (and answerers are limited in time!). You can use my example with Forest's manual, perhaps, and then ask a follow-up question if there's a particular bit you can't figure out. – cfr Mar 26 '16 at 17:04
  • Your help is very effective. I also found a way to solve the problem, but there are defects, can you make it complete? I put the code on floor #2. – poorich Mar 27 '16 at 10:18

I am the presenter of the question. There is an answer that is waiting to be edited, To a large extent, it mimics the answer on the link. Before the answer is flawed, after @cfr enthusiastic guidance, and finally completed.


\tikzset{box/.style={draw, rectangle, thick, text centered, minimum width=\wrrth, minimum height=20mm, align=center}}
\tikzset{line/.style={draw, thick, -latex' }}

\node [box] (O) {Introduction\\ Sets};
\node [box, below=\hrrth of O](I){I\\ Groups};
\node [below=\hrrth of I](Ia){};
\node [box, left=\wrrth of Ia](II){II\\ Structure\\ of Groups};
\node [box, below=\hrrth of I](III){III\\ Rings};
\node [box, below=\hrrth of III](IV){IV\\ Modules};
\coordinate[below=0.5\hrrth of IV](lline){};
\node [box, below=\hrrth of lline, xshift=-1.8\wrrth](V){V\\ Galoi Theory};
\node [box, below=\hrrth of V](VI){VI\\ Structure\\ of Fields};
\node [box, below=\hrrth of lline, xshift=-0.6\wrrth](VII){VII\\ Linear\\ Algebra};
\node [box, below=\hrrth of lline, xshift=0.6\wrrth](VIII){VIII\\ Commutative\\ Rings\\ \& Modules};
\node [box, below=\hrrth of lline, xshift=1.8\wrrth](IX){IX\\ Structure\\ of Rings};
\node [box, right=\wrrth of Ia](X){X\\ Categories};

\path [line] (O) -- (I);
\path [line] (I) -| (II);
\path [line] (I) -- (III);
\path [line,dashed] (III) -- (IV);
\draw [thick] (IV) -- (lline);
\path [line] (lline) -| (V);
\path [line] (lline) -| (VII);
\path [line] (lline) -| (VIII);
\path [line] (lline) -| (IX);
\path [line,dashed] (VIII) -- (IX);
\path [line] (V) -- (VI);

\node [above=0pt of O.north east, anchor=south east, font=\small] {1};
\node [above=0pt of I.north east, anchor=south east, font=\small] {2,3};
\node [above=0pt of III.north east, anchor=south east, font=\small] {2,3};
\node [above=0pt of IV.north east, anchor=south east, font=\small] {2,3,4};
\node [above=0pt of V.north east, anchor=south east, font=\small] {2,5};
\node [above=0pt of VI.north east, anchor=south east, font=\small] {6};
\node [above=0pt of VII.north east, anchor=south east, font=\small] {2,3};
\node [above=0pt of VIII.north east, anchor=south east, font=\small] {7};
\node [above=0pt of IX.north east, anchor=south east, font=\small] {8,9,10};
\node [above=0pt of X.north east, anchor=south east, font=\small] {11};


enter image description here

| improve this answer | |
  • 1
    You can add the numbers either as separate nodes relative to the boxes (the positioning library might help so you can say e.g. \node [above=0pt of I.north east, anchor=south east, font=\small] {<numbers>}; or using the label node option. The way I added the numbers is actually just TikZ code - look at the tikz+ in the my label style which just adds them as nodes in a similar way. – cfr Mar 27 '16 at 10:58
  • I used the first method you taught me to complete the solution. The second method I don't quite understand, if you are interested in describing this method, please edit this solution. Finally, the drawing by TikZ is too excited! – poorich Mar 28 '16 at 6:26
  • 1
    I think that way is easiest, to be honest. label will just add nodes with default options you'll need to override (e.g. distance) so there isn't much to be gained by it. I mentioned it in case you were more familiar with that approach. – cfr Mar 28 '16 at 11:46
  • Looks great! ;) – cfr Mar 28 '16 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.