2

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. the taxonomy diagram as per the attached picture

6

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}

enter image description here

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.