1

I've tried to use the forest package to make a 'hierarchical block diagram' like this. hierarchical block diagram

It seemed that my effort can never meet my goal. I also tried Visio, and it didn't work well. So I came back to Latex and need advice from you guys. Thank you so much.

Thanks a lot Mr. bibra. I put your code into mine, and the result looked like this: enter image description here

The branches are not orthogonal as yours. Could you give me a hint or more information? Still one more question, can this 'tree diagram' be saved as a figure or which form should it appear in my work so I can reference it any where?

@ js bibra I think I found what's wrong with my tex code. In the preamble, before the line

\usepackage[edges]{forest}

I accidentally added the following line (which could happened any time before I post this question and was looking for a solution on line)

\usepackage[linguistics]{forest}

Everything is OK if I remove this line. Thank you so much again @js bibra.

4
  • 1
    How close did you get with the forest package? Could you post that attempt? Even if it doesn't compile, it would give us a starting point.
    – Teepeemm
    Oct 30 '20 at 15:17
  • @T.M. please have alook at the answer below
    – js bibra
    Oct 30 '20 at 17:09
  • you can adapt the package FAST enseignement.allais.eu/page-latex
    – rpapa
    Oct 30 '20 at 18:55
  • @T.M. request to accept the answer if it meets the requirement by clicking the green tick mark on left side of the answer -- a green tick will appear once you accept the answer
    – js bibra
    Nov 7 '20 at 16:24
7

This should point you in the right direction -- I have not filled up the exact text

Level 0 is the root level or origin and so on -- the code is self-explanatory

enter image description here

\documentclass[border=10pt]{standalone}
\usepackage[edges]{forest}

\begin{document}
\begin{forest}
        for tree={
            grow'=east,
            anchor=west,
            node options={draw, thick, font=\sffamily, align=center, },
            edge={semithick},
            forked edges,
            l sep=4mm,
            s sep=2mm,
            fork sep = 2mm,           % new, distance from parent to branching point
            where level=0{rotate=90, anchor=center, fill=blue!20}{}, % new
            where level=1{s sep=1mm,fill=blue!20}{}, % new
             where level=2{s sep=1mm,draw=none}{},
              where level=3{s sep=1mm,draw=none}{},
%            where level=2{}{rotate=90, anchor=center} % new
%where n children={11}{rotate=90, anchor=center}{},
%where n children={2}{rotate=90, anchor=center, fill=blue!20}{},
%where n children=6{rotate=90, anchor=center}{},
%where n children=8{rotate=90, anchor=center}{},
        },
        [Mother branch,
        [Text
        [Text]
        [Text]
        [Text]
        [Text]
        [Text]
        ]
        [Text
        [Text[Text][Text]]
        [Text ]
        [Text]
        ]
        [Text]
        [Text]
        [Text]
        [Text]
        ]
    \end{forest}
\end{document}
2
  • Thank a lot @js bibra. After removing \usepackage[linguistics]{forest} in my preamble, everything is OK.
    – T. M.
    Oct 31 '20 at 9:15
  • @T.M. request to accept the answer if it meets the requirement by clicking the green tick mark on left side of the answer
    – js bibra
    Oct 31 '20 at 13:32

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.