I'm a little uncomfortable with the graph of a taxonomy. I never used tikZ or Forest and found it very difficult to understand in a short time. I have to draw the taxonomy graph that follows. Can anyone please help me in this diagram with the latex code? I'm going to be very appreciative. Thank you.
1 Answer
Use forest
. I added a key nplet
that helps to avoid repetition by inserting a series of numbered items automatically.
\documentclass{article}
\usepackage[edges]{forest}
\usepackage{geometry}
\forestset{nplet/.style n args={2}{%
repeat={#2}{append={[#1_{\pgfmathparse{n}\pgfmathresult},math content,draw,text width=1.55em,forked edges]}}}}
\begin{document}
\begin{forest}
forked edges,
for tree={grow'=0,draw,math content,if={level()==1}{s sep+=-1ex}{}}
[P
[L_{21},nplet={C}{12}
]
[L_{22},nplet={D}{6}
]
[L_{23},nplet={E}{7}
]
[L_{24},nplet={F}{2}
]
[L_{25},nplet={G}{1}
]
]
\end{forest}
\end{document}