答案1
您必须向节点添加文本选项,例如align=center
。
输出:
代码:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{trees}
\begin{document}
\begin{tikzpicture}[align=center] %[mytree]
\node (top) {DP}
child {node {D\\the}}
child {node {NP}
child {node {Adj\\brown}}
child {node {NP\\dog}}};
\end{tikzpicture}
\end{document}