我正在尝试从 Till Tantau 演示文稿中重现 TikZ 树(请参阅此 .pdf 的第 33 页)
我的代码如下:
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{trees}
\begin{document}
\begin{tikzpicture}[edge from parent fork down, edge from parent/.style={black,thick,draw}]
\node[inner node]{}
child { node {bacteria} }
child { node[inner node] {}
child { node {plants} }
child { node[inner node] {}
child { node[inner node] {}
child { node {fish} }
child { node[inner node] {}
child { node {mammals} }
child { node {birds} }
}
}
child { node[inner node] {}
child { node {dragonflies} }
child { node {beetles} }
}
}
};
\end{tikzpicture}
\end{document}
node[inner node] {}
对于上述代码中的六个调用,我每次都会得到以下类型的六个错误:
! Package pgfkeys Error: I do not know the key '/tikz/inner node' and I am goin
g to ignore it. Perhaps you misspelled it.
See the pgfkeys package documentation for explanation.
Type H <return> for immediate help.
...
l.11 \node[inner node]
{}
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.
我在PGF 手册。欢迎任何帮助!
答案1
我认为 Till Tantau 的呈现方式并没有真正定义风格inner node
。我感觉他只是想说明人们可以提供“某种选择”。
你可以写
\begin{tikzpicture}[....,inner node/.style={fill,black,circle}]
以某种方式定义它。我尝试重现一些填充点,试试这是否是您想要的。如果不是,您可能需要尝试使用 tikz 选项。