答案1
这可以通过森林来实现。请理解,我没有心情从您的屏幕截图中输入所有这些项目。
\documentclass{article}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={parent anchor=south,calign=fixed edge angles,
grow=south,
if={n==1}{child anchor=east}{child anchor=west},
l sep=0.5em,
s sep=1em,
edge path={
\noexpand\path [draw, \forestoption{edge}]
(!u.south) |- (.child anchor)\forestoption{edge label};
},
before typesetting nodes={ % from https://tex.stackexchange.com/a/342056/121799
for tree={
content/.wrap value={\strut #1},
}
}
}
[science,anchor=center
[experiment]
[theory
[duck]
[koala]
]
]
\end{forest}
\end{document}
如果你真的想堵住树,这里有一个方法。
\documentclass{article}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={parent anchor=south,calign=fixed edge angles,
grow=south,
inner ysep=0pt,
if={n==1}{child anchor=east}{child anchor=west},
l=0mm,
l sep=1mm,
s sep=0.5em,
edge path={
\noexpand\path [draw, \forestoption{edge}]
(!u.south) |- (.child anchor)\forestoption{edge label};
},
before typesetting nodes={ % from https://tex.stackexchange.com/a/342056/121799
for tree={
content/.wrap value={\strut #1},
}
}
}
[science,anchor=center
[experiment]
[theory
[duck]
[koala]
]
]
\end{forest}
\end{document}