0

I would liuke to draw the following diagram using TikZ package

note that i would prefer the box to be flexible in such a way that it can contain the text and we can add much box of subtitle as much as we can counter

enter image description here

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[auto] 
\end{tikzpicture}

\end{document}
Educ
  • 4,362
  • 3
    Have you searched the site for similar diagrams? There are plenty. This is simple to do with [tag:forest]. – Alan Munn Dec 10 '16 at 15:56
  • is the box of forest would be flexible for long long text – Educ Dec 10 '16 at 15:57
  • @Educ, please be specific, what do you mean by flexible? What is the desired flexibility? forest can handle a lot of customization... A few examples can be seen here,here and here – Guilherme Zanotelli Dec 10 '16 at 16:03
  • what i want for flexibility : (details box) be can contains very long long text , for (subtitle box ) contains tow raw of text (L1 // L2) – Educ Dec 10 '16 at 16:33
  • 1
    Your question leaves all the effort to our community, even typing the essentials of a TeX document such as \documentclass{} \begin{document} etc. As it is, most of our users will be very reluctant to touch your question, and you are left to the mercy of our procrastination team who are very few in number and very picky about selecting questions. You can improve your question by adding a minimal working example (MWE) that more users can copy/paste onto their systems to work on. If no hero takes the challenge we might have to close your question. http://meta.tex.stackexchange.com/questions/4267/ – Dr. Manuel Kuehner Dec 10 '16 at 17:49
  • okay i see i 'll improve my questions btw i miss professor Gonzalo Medina – Educ Dec 10 '16 at 17:55

2 Answers2

6

This can be done with Tikz.

enter image description here

\documentclass[border={10pt}]{standalone}

\usepackage{tikz}
\usetikzlibrary{positioning,arrows}

\begin{document}

\begin{tikzpicture}
    [%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        node distance=1cm,
        box1/.style={rectangle,draw,fill=gray!10, very thick,
                      minimum width=3cm, minimum height=1cm},
        box2/.style={align=left,rectangle,draw,fill=gray!10, very thick,
                      minimum width=3cm, minimum height=4cm}, 
        line/.style={-latex,very thick} 
    ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\node[box1]             (A) {Title};
\node[box1, below=of A] (B) {subtitle};
\node[box1, left=of B ] (C) {subtitle};
\node[box1, right=of B] (D) {subtitle};
\node[box2, below=of B] (E) {Detials about \\ subject};
\node[box2, below=of C] (F) {Detials about \\ subject};
\node[box2, below=of D] (G) {Detials about \\ subject};

\draw[line] (A.west)  -| (C.north);
\draw[line] (A.south) -| (B.north);
\draw[line] (A.east)  -| (D.north);
\draw[line] (C.south) -- (F.north);
\draw[line] (B.south) -- (E.north);
\draw[line] (D.south) -- (G.north);
\end{tikzpicture}

\end{document}
CroCo
  • 5,902
6

I don't think I ought to answer do-it-for-mes. Although I'm answering anyway because I like drawing trees, I may be less sympathetic to questions about my code, requests for amendments and so on. If I answer a do-it-for-me, it is not to be helpful, but only for me. Don't expect that to change if you ask for further help in comments.

Very simple in Forest.

\documentclass[tikz,border=10pt]{standalone}
\usepackage[edges]{forest}
\usepackage{kantlipsum}
\begin{document}
\begin{forest}
  where level=1{
    align=left,
  }{
    if level=2{
      text width=50mm
    }{}
  },
  for tree={
    draw,
    tier/.option=level,
  },
  forked edges,
  [Title
    [Subtitle
      [{\kant[1]}]
    ]
    [Longer\\Subtitle
      [{\kant[2]}]
    ]
    [Subtitle
      [{\kant[3]}]
    ]
  ]
\end{forest}
\end{document}

Forest solution

If you read the manual, you can change the paths from the root to its children so that they stick out of the sides, if you wish. This and all further adjustments and refinements are left as exercises for the reader.

For example, a few minor adjustments to the tree's preamble let you produce much fancier effects, without altering the specification of the tree itself at all.

fancier version

fancier version in colour

cfr
  • 198,882