I'm trying to make a tree of a corporate structure starting at some owner, and ending with a single company. This means that all lines start at a single node, and all ends at a single node.
This thread helped me to where I am: LaTeX: how to make a horizontal tree that is closed at the end (forest), but I end up with lines through my nodes. As I will be doing this repetitively (many different corporate structures) I'm looking for a structural solution.
\documentclass{standalone}
\usepackage{forest}
\forestset{
default preamble={
for tree={rectangle, draw, text width = 2cm, grow=0 }
}
}
\begin{document}
\begin{forest}
[Company 4, name =E0
[Company 3
[Company 2, name = E1]
]
[Company 5, name = E2]
[Company 8
[Company 7, name=E3]
[Company 10, name = E4]
]
]
\node[draw] (EndNode) at ($(E3.east) + (2,0)$){Company 1};
\foreach \num in {0,1,2,3, 4}{
\draw (E\num.east) -- (EndNode.west);
}
\end{forest}
\end{document}
Minor other issue on the side : how to center the text within these boxes?