我找不到任何能容纳与下图相同数量数据的 Tikz 模板。我也没有找到相同类型的模板。我正在尝试查找是否有其他替代方案或相同类型的模板。
答案1
你可以通过减少级别和兄弟距离、使用较小的字体等来使内容更紧凑,但forest
可以很好地打包内容。edge path
改编自Gonzalo Medina 的回答。
\documentclass[tikz,border=5pt]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={
grow=east,
parent anchor=south east,
child anchor=south west,
align=center,
l sep+=10pt,
% path is based on Gonzalo Medina's answer
% ref: https://tex.stackexchange.com/questions/176591/typesetting-genealogical-trees/176649#176649
edge path={
\noexpand\path [draw, rounded corners=5pt, \forestoption{edge}] (!u.parent anchor) [out=0, in=180] to (.child anchor)\forestoption{edge label} -- (.south east);
},
for root={
ellipse,
draw,
parent anchor=east,
},
}
[some root\\node
[child\\node
[grandchild\\node
[great-grandchild\\node
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
]
[great-grandchild\\node
]
]
[grandchild\\node
[great-grandchild\\node
[great-great grandchild node]
[great-great grandchild node]
]
[great-grandchild\\node
]
]
]
[, calign with current
[child\\node
[grandchild\\node
[great-grandchild\\node
]
[great-grandchild\\node
]
]
[grandchild\\node
[great-grandchild\\node
]
[great-grandchild\\node
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
]
[great-grandchild\\node
]
]
]
]
[child\\node
[grandchild\\node
[great-grandchild\\node
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
]
[great-grandchild\\node
]
]
[grandchild\\node
[great-grandchild\\node
]
[great-grandchild\\node
[great-great grandchild node]
[great-great grandchild node]
]
]
]
]
\end{forest}
\end{document}
收紧措施:
\begin{forest}
for tree={
grow=east,
parent anchor=south east,
child anchor=south west,
anchor=south,
align=center,
l sep+=2.5pt,
s sep+=-5pt,
inner sep=0pt,
outer sep=0pt,
% path is based on Gonzalo Medina's answer
% ref: https://tex.stackexchange.com/questions/176591/typesetting-genealogical-trees/176649#176649
edge path={
\noexpand\path [draw, rounded corners=5pt, \forestoption{edge}] (!u.parent anchor) [out=0, in=180] to (.child anchor)\forestoption{edge label} -- (.south east);
},
for root={
ellipse,
draw,
parent anchor=east,
},
}
[some root\\node
[child\\node
[grandchild\\node
[great-grandchild\\node
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
]
[great-grandchild\\node
]
]
[grandchild\\node
[great-grandchild\\node
[great-great grandchild node]
[great-great grandchild node]
]
[great-grandchild\\node
]
]
]
[, calign with current edge
[child\\node
[grandchild\\node
[great-grandchild\\node
]
[great-grandchild\\node
]
]
[grandchild\\node
[great-grandchild\\node
]
[great-grandchild\\node
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
]
[great-grandchild\\node
]
]
]
]
[child\\node
[grandchild\\node
[great-grandchild\\node
[great-great grandchild node]
[great-great grandchild node]
[great-great grandchild node]
]
[great-grandchild\\node
]
]
[grandchild\\node
[great-grandchild\\node
]
[great-grandchild\\node
[great-great grandchild node]
[great-great grandchild node]
]
]
]
]
\end{forest}
\end{document}