LaTeX 绘制二叉树
forest
forest 是专门为树结构设计的 LaTeX 宏包,语法简洁,适合复杂树形结构:
Preamble:
\usepackage{forest}
Body:
\begin{forest}
[A
[B
[D]
[E]
]
[C
[F]
[G]
]
]
\end{forest}

TikZ
TikZ 是 LaTeX 中最经典的绘图工具。
Preamble:
\usepackage{tikz}
Body:
\begin{tikzpicture}
\node {A}
child {node {B}
child {node {D}}
child {node {E}}
}
child {node {C}
child {node {F}}
child {node {G}}
};
\end{tikzpicture}


浙公网安备 33010602011771号