我用 tikz 包画了一棵树,但是箭头穿过了节点。有没有什么开关可以防止这种情况发生?
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{graphdrawing}
\usetikzlibrary{graphs}
\usegdlibrary{trees}
\begin{document}
\begin{tikzpicture}[>=stealth, every node/.style={circle, draw, minimum size=0.75cm}]
\graph [tree layout, grow=down, fresh nodes, level distance=2cm, sibling distance=0.5cm]
{
0x01 -> {
0x10 -> { 0x01 },
0x19 -> { 0x01 },
0x1a -> { 0x01 , 0x11 , 0x18 , 0x1a , 0x1b },
0x1b -> { 0x01 , 0x11 , 0x18 , 0x1a , 0x1b },
0x85 -> { 0x01 },
0x87 -> { 0x01 },
0x8d -> { 0x01 },
0x8f -> { 0x01 },
0xa3 -> { 0x01 },
0xaf -> { 0x01 }
}
};
\end{tikzpicture}
\end{document}
答案1
只有重新排序节点并使用\footnotesize
字体才能实现这一点。修改后的代码如下:
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{graphdrawing}
\usetikzlibrary{graphs}
\usegdlibrary{trees}
\begin{document}
\begin{tikzpicture}[>=stealth, every node/.style={circle, draw, minimum size=0.75cm,inner sep=0in}]\footnotesize
\graph [tree layout, grow=down, fresh nodes, level distance=2cm, sibling distance=0.5cm]
{
0x01 -> {0x1a -> { 0x01 , 0x11 , 0x18 , 0x1a , 0x1b },
0x10 -> { 0x01 },
0x19 -> { 0x01 },
0x85 -> { 0x01 },
0x87 -> { 0x01 },
0x8d -> { 0x01 },
0x8f -> { 0x01 },
0xa3 -> { 0x01 },
0xaf -> { 0x01 },
0x1b -> { 0x01 , 0x11 , 0x18 , 0x1a , 0x1b }
}
};
\end{tikzpicture}
\end{document}
编译后LuaLaTeX
得到:
.... 我稍后会上传图片。该网站目前无法上传。抱歉。
嗯...就是这个: