使用 Tikz 连接子节点

使用 Tikz 连接子节点

我的 Tex 代码:

\begin{tikzpicture}[text width=4.5cm, sibling distance = 15em, level distance = 4em, align= flush center,
level 1/.style={level distance=18em},
    level 2/.style={level distance=12em},
    ]]

\node{Society}
    child { node {Legal Functional System}
        child { node {Organizational System}
            child {node {Courts}
            }
        }
    }
    child { node {Economic Functional System}
        child { node {Organizational System}
            child { node {Financial Institutions}
            }
        }   
    }
    child { node {Political Functional System}
        child {node {Organizational System}
            child {node {Legislature}
            }
        }   
    }
;
\end{tikzpicture}

如何创建连接以显示第 3 级子节点之间的链接?即CourtsFinancial InstitutionsLegislature是链接的吗?

答案1

像这样?

在此处输入图片描述

\begin{tikzpicture}[minimum width=45mm, 
                    sibling distance = 15em, 
                    level distance = 4em, 
                    align= flush center,
level 1/.style={level distance=18em},
level 2/.style={level distance=12em},
level 3/.style={level distance=12em,minimum width=22mm},
                    ]

\node{Society}
    child { node {Legal Functional System}
        child { node {Organizational System}
            child {node (court) {Courts}
            }
        }
    }
    child { node {Economic Functional System}
        child { node {Organizational System}
            child { node (fi) {Financial Institutions}
            }
        }
    }
    child { node {Political Functional System}
        child {node {Organizational System}
            child {node (leg) {Legislature}
            }
        }
    };
\draw (court) -- (fi) -- (leg);
\end{tikzpicture}

相关内容