tikz
我正在尝试使用和绘制一个简单的依赖关系图lualatex
。我不明白为什么结果超出页面范围...以下是代码和结果:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs, graphdrawing}
\usegdlibrary{trees}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\tikz[nodes={text depth=.2em, draw, fill=white}, rounded corners]
\graph[tree layout, grow=down] {
"Rule Manager"->{
"Module Base"->{
"Communicator"
},
"Log Data"->{
"Communicator",
"ODB Oracle"
},
"Rule Manager Status"->{
"Status Base",
"Rule Base"
},
"Rules"->{
"Rule Base",
"Profiles"->{
"Message"->{
"Communicator",
"Interface SOAP",
"ODB Utils"
},
"Profile Base"
}
},
"Threadpool"
};
};
\end{tikzpicture}
\end{figure}
\end{document}
更新:图像的宽度不大于页面宽度。添加更多节点,将其进一步向右推:
答案1
您\tikz
在环境中的命令tikzpicture
是错误的。您应该使用其中之一,但不能同时使用两者。直接将选项添加到环境中,您应该没问题:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs, graphdrawing}
\usegdlibrary{trees}
\begin{document}
\begin{figure}
\begin{tikzpicture}[nodes={text depth=.2em, draw, fill=white}, rounded corners]
\graph[tree layout, grow=down] {
"Rule Manager"->{
"Module Base"->{
"Communicator"
},
"Log Data"->{
"Communicator",
"ODB Oracle"
},
"Rule Manager Status"->{
"Status Base",
"Rule Base"
},
"Rules"->{
"Rule Base",
"Profiles"->{
"Message"->{
"Communicator",
"Interface SOAP",
"ODB Utils"
},
"Profile Base"
}
},
"Threadpool"
};
};
\end{tikzpicture}
\end{figure}
\end{document}