1
0
2024-06-21 09:19:32 +02:00

73 lines
1.8 KiB
TeX

%c reated by phylo-tree from test.forest
\documentclass[tikz, crop, border=5pt]{standalone}
\usepackage{forest}
\usepackage{fontspec,xltxtra,xunicode}
% English Fonts
\setmainfont[BoldFont={Fira Sans}]{Fira Sans Light}
% 中文字体
\usepackage{xeCJK}
\setCJKmainfont[BoldFont=Hiragino Sans GB W6]{Hiragino Sans GB W3}
\xeCJKsetup{CJKecglue = {\hskip 0pt plus 0.08\baselineskip}, xCJKecglue = {false}}
\punctstyle{plain}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\definecolor{red}{RGB}{188,36,46}
\definecolor{black}{RGB}{26,25,25}
\definecolor{grey}{RGB}{129,130,132}
\definecolor{green}{RGB}{32,128,108}
\definecolor{purple}{RGB}{160,90,150}
\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,
}
\begin{document}
\begin{forest}
where n children=0{tier=word}{},
for tree={
s sep=-0.1em, % 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}{}
},
}
[
[a]
[
[b]
[b
[c]
[c
[d]
[d]
]
]
]
]
\end{forest}
\end{document}