如何调整circuitikz节点名称的定位

如何调整circuitikz节点名称的定位

我正在尝试构建一个小型二叉树拓扑,但​​我看到节点标签与电路本身重叠。

\begin{circuitikz} \draw (0,0)
    (3.5,4) node[not port, rotate = 270] (s1c1) {s1c1}

    (1,2) node[not port, rotate = 270] (s2c1) {s2c1}
    (6,2) node[not port, rotate = 270] (s2c2) {s2c2}

    (0,0) node[not port, rotate = 270] (s3c1) {s3c1}
    (2,0) node[not port, rotate = 270] (s3c2) {s3c2}
    (5,0) node[not port, rotate = 270] (s3c3) {s3c3}
    (7,0) node[not port, rotate = 270] (s3c4) {s3c4}
    (s1c1.out) -| (s2c1.in)
    (s1c1.out) -| (s2c2.in)

    (s2c1.out) -| (s3c1.in)
    (s2c1.out) -| (s3c2.in)
    (s2c2.out) -| (s3c3.in)
    (s2c2.out) -| (s3c4.in)

    (s3c1.out) -- (s3c2.out)
    (s3c2.out) -- (s3c3.out)
    (s3c3.out) -- (s3c4.out)

    ;
\end{circuitikz}

如何清晰地放置文字?

答案1

我会使用label节点的属性。我手动调整了标签及其间距。请阅读tikz文档以了解如何进行进一步微调。

\documentclass[tikz]{standalone}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz} \draw (0,0)
    (3.5,4) node[not port, rotate = 270, label={[centered,yshift=4pt,rotate=270] {\small s1c1}}] (s1c1) {}

    (1,2) node[not port, rotate = 270,label={[centered,yshift=4pt,rotate=270] {\small s2c1}}] (s2c1) {}
    (6,2) node[not port, rotate = 270,label={[centered,yshift=4pt,rotate=270] {\small s2c2}}] (s2c2) {}

    (0,0) node[not port, rotate = 270,label={[centered,yshift=4pt,rotate=270] {\small s3c1}}] (s3c1) {}
    (2,0) node[not port, rotate = 270,label={[centered,yshift=4pt,rotate=270] {\small s3c2}}] (s3c2) {}
    (5,0) node[not port, rotate = 270,label={[centered,yshift=4pt,rotate=270] {\small s3c3}}] (s3c3) {}
    (7,0) node[not port, rotate = 270,label={[centered,yshift=4pt,rotate=270] {\small s3c4}}] (s3c4) {}
    (s1c1.out) -| (s2c1.in)
    (s1c1.out) -| (s2c2.in)

    (s2c1.out) -| (s3c1.in)
    (s2c1.out) -| (s3c2.in)
    (s2c2.out) -| (s3c3.in)
    (s2c2.out) -| (s3c4.in)
    ;
\end{circuitikz}
\end{document}

制作

在此处输入图片描述

相关内容