答案1
使用从 TeXexamples 窃取的代码...以下内容可以作为您制作所需树的起点:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows,trees}
\begin{document}
\begin{tikzpicture}[
every node/.style = {draw, rounded corners=3pt, semithick, drop shadow},
ROOT/.style = {top color=green!60!blue, bottom color=blue!60!green,
inner sep=2mm, text=white, font=\bfseries},
L1/.style = {fill=blue!20},
L2/.style = {fill=orange!30},
L3/.style = {fill=green!30, grow=down, xshift=1em, anchor=west,
edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}},
edge from parent/.style = {draw, thick},
LD/.style = {level distance=#1ex},
LD1/.style = {level distance=6ex},
LD2/.style = {level distance=12ex},
LD3/.style = {level distance=18ex},
level 1/.style = {sibling distance=32mm}
]
% Parents
\node[ROOT] {root}
[edge from parent fork down]
child{node[L2] {AAA AAA AAA}
child[L3,LD1] {node[L3] {A1}}
child[L3,LD2] {node[L3] {A2}}
child[L3,LD3] {node[L3] {A3}}
}
child{node[L2] {BB BB BB BB}
child[L3,LD1] {node[L3] {B1}}
child[L3,LD2] {node[L3] {B2}}
}
child {node[L2] {C CC CCC}
child[L3,LD1] {node[L3] {C1}}
child[L3,LD2] {node[L3] {C2 C2 C2}
child[L3,LD1] {node[L3,fill=red!30] {C1}}
child[L3,LD2] {node[L3,fill=red!30] {C2}}
}
child[L3,LD=30] {node[L3] {C2 C2 C2}}
};
\end{tikzpicture}
\end{document}
节点中的真实文本以及节点数量不应该太难改变和添加。