\documentclass[tikz, crop, border=5pt]{standalone} \usetikzlibrary{positioning,backgrounds,fit} \usepackage{forest} \usepackage{fontspec,xltxtra,xunicode} %STYLE_BEGIN% % English Fonts \setmainfont[BoldFont={Fira Sans}]{Fira Sans Light} % 中文字体 \usepackage{xeCJK} \setCJKmainfont[BoldFont=Source Han Sans SC Medium]{Source Han Sans SC Normal} \xeCJKsetup{CJKecglue = {\hskip 0pt plus 0.08\baselineskip}, xCJKecglue = {false}} \punctstyle{plain} \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} %STYLE_END% % Avoid using xcolor dvipsnames % https://en.wikibooks.org/wiki/LaTeX/Colors % https://www.color-hex.com/ \definecolor{black}{RGB}{26,25,25} \definecolor{grey}{RGB}{129,130,132} \definecolor{red}{RGB}{188,36,46} \definecolor{brown}{RGB}{121,37,0} \definecolor{green}{RGB}{32,128,108} \definecolor{purple}{RGB}{160,90,150} \definecolor{blue}{RGB}{0,103,149} % MidnightBlue % Upper case colors for backgrounds % https://coolors.co/palette/fbf8cc-fde4cf-ffcfd2-f1c0e8-cfbaf0-a3c4f3-90dbf4-8eecf5-98f5e1-b9fbc0 \definecolor{LemonChiffon}{RGB}{251, 248, 204} \definecolor{ChampagnePink}{RGB}{253, 228, 207} \definecolor{TeaRose}{RGB}{255, 207, 210} \definecolor{PinkLavender}{RGB}{241, 192, 232} \definecolor{Mauve}{RGB}{207, 186, 240} \definecolor{JordyBlue}{RGB}{163, 196, 243} \definecolor{NonPhotoBlue}{RGB}{144, 219, 244} \definecolor{ElectricBlue}{RGB}{142, 236, 245} \definecolor{Aquamarine}{RGB}{152, 245, 225} \definecolor{Celadon}{RGB}{185, 251, 192} \tikzset{ comment/.append style={label={[font=\small]0:#1}}, } \forestset{ /tikz/label position=below left, /tikz/label distance=.1em, dot/.style={tikz+={\fill[fill=#1] (.child anchor) circle[radius=2pt];}}, dot/.default=black, bar/.style={tikz+={\draw[color=#1,line width=2pt] let \p1 = (!u.parent anchor), \p2 = (.child anchor) in ($(\x1, \y2 - 0.5em)!0.5!(\x2, \y2)$) -- ($(\x1, \y2 + 0.5em)!0.5!(\x2, \y2)$);}}, bar/.default=black, rec/.style={tikz+={\scoped[on background layer]{ \node[draw=none, fill=#1, rectangle, fit to=tree, inner sep=-2pt, ] {};} }}, rec/.default=Thistle, } \begin{document} \begin{forest} where n children=0{tier=word}{}, for tree={ s sep=-4pt, % make siblings closer grow=0, % 0 degrees is to the right reversed, % tree_direction align=left, parent anchor=east, child anchor=west, anchor=west, edge path={ \noexpand\path[draw, grey, line width=1pt, \forestoption{edge}] (!u.parent anchor) |- (.child anchor)\forestoption{edge label}; }, before typesetting nodes={ if content={}{shape=coordinate}{} }, } [, tier=5, [, tier=4, [, dot, label={Eukaryota}, tier=3, [, dot, label={Sar}, tier=2, [, dot, label={Alveolata}, tier=1, [{Dinophyceae}, comment={2864 class}, tier=0,] [{Apicomplexa}, comment={5794 phylum}, tier=0,] [{Ciliophora}, comment={5878 phylum}, tier=0,] ] [, dot, label={Ochrophyta}, tier=1, [{Chrysophyceae}, comment={2825 class}, tier=0,] [{Bacillariophyta}, comment={2836 phylum}, tier=0,] [{Phaeophyceae}, comment={2870 class}, tier=0,] ] ] [{Cryptophyceae}, comment={3027 class}, tier=0,] [{Rhodophyta}, comment={2763 phylum}, tier=0,] [, dot, label={Euglenozoa}, tier=1, [{Euglenida}, comment={3035 class}, tier=0,] [{Kinetoplastea}, comment={5653 class}, tier=0,] ] [{Haptophyta}, comment={2830 phylum}, tier=0,] [{Chlorophyta}, comment={3041 phylum}, tier=0,] ] [{Cyanobacteriota}, comment={1117 phylum}, tier=0,] ] ] %FOREST_END% \end{forest} \end{document}