1

I am trying to get a hierarchy diagram like this using the Forest package

enter image description here

But, could not managed to get so. I used this code

\documentclass[border=20pt,tikz]{standalone}
\usepackage[edges]{forest}

\forestset{
  direction switch/.style={
    for tree={edge+=thick, font=\sffamily},
    where level>=1{folder, grow'=0}{for children=forked edge},
    where level=3{}{draw},
  },
}
\begin{document}

\begin{forest}
  % forest preamble: determine layout and format of tree
  direction switch
  [Main
  [1.1]
  [1.2]
  [1.3]
  [1.4]
  [2
   [2.1]
   [2.2]
  ]
    [3
   [3.1]
   [3.2]
  ]
    [4
   [4.1]
   [4.2]
  ]
  ]
\end{forest}
\end{document} 

and got instead enter image description here

Thanks in advance for your help.

Your Answer

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

Browse other questions tagged or ask your own question.