![多个 tikz 链对齐](https://linux22.com/image/397814/%E5%A4%9A%E4%B8%AA%20tikz%20%E9%93%BE%E5%AF%B9%E9%BD%90.png)
我想显示这个结果:
这是我的代码:
\begin{tikzpicture}
\begin{scope}[start chain=1 going below, start chain=2 going right, start chain=3 going right]
\node[on chain=1] (a) {a};
\node[on chain=1] (b) {b};
\node[on chain=1] (c) {c};
\chainin (a);
\node[on chain=2] (d) {d};
\node[continue chain=going below,on chain=2] (e) {e};
\node[on chain=2] (f) {f};
\chainin (d);
\node[on chain=3] (g) {g};
\node[continue chain=going below,on chain=3] (h) {h};
\node[on chain=3] (i) {i};
\end{scope}
\end{tikzpicture}
这是代码的结果:
请问这个编码的正确方法是什么?
答案1
可能的解决方案之一是:
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{chains, positioning}
\begin{document}
\begin{tikzpicture}[
node distance = 8mm,
start chain = going right,
every node/.append style = {on chain}
]
\node (a) {a};
\node (b) {b};
\node (c) {c};
\node[below=of a] (d) {d};
\node (e) {e};
\node (f) {f};
\node[below=of d] (g) {g};
\node (h) {h};
\node (i) {i};
\end{tikzpicture}
\end{document}