等點之間的空間 Circuitikz

等點之間的空間 Circuitikz
\documentclass[tikz]{standalone}
\usepackage{circuitikz}
\begin{document}
    \begin{circuitikz}[european, scale=1]
        \draw
            (0,0) node[ocirc]{} --
            ++(right:1) node(point1){} to [R, l=$R$]
            ++(down:2) node(point2){} --
            ++(left:1) node[ocirc]{}
            (node cs:name=point1) node[circ]{} --
            ++(right:2) to [C, l=$C$]
            ++(down:2) --
            (node cs:name=point2) node[circ]{}
        ;
    \end{circuitikz}
\end{document}

point1為什麼(定義)和(用法)之間有空格point1

程式碼輸出

答案1

不想讓這個問題得不到解答。

除了評論建議之外point1.center,還將point2.center發揮作用。我的研究還發現了另外兩種替代方案來縮小差距,因此將其作為答案發布。

  1. 上面評論裡說了。

新發現

  1. 使用顯式座標。
  2. node將定義更改為coordinate定義。

在此輸入影像描述

程式碼

\documentclass[tikz]{standalone}
\usepackage{circuitikz}
\begin{document}
    \begin{circuitikz}[european, scale=1]
        \draw
            (0,0) node[ocirc]{} --
            ++(right:1) node(point1){} to [R, l=$R$]
            ++(down:2)  node(point2){} --
            ++(left:1) node[ocirc]{}
            (point1.center) node[circ]{} --      % use point1.center instead
            ++(right:2) to [C, l=$C$]
            ++(down:2) --
            (point2.center) node[circ]{}         % use point2.center instead
        ;
    \end{circuitikz}

    \begin{circuitikz}[european,scale=1]
        \draw
            (0,0) node[ocirc]{} --
            ++(right:1) node(point1){} to [R, l=$R$]
            ++(down:2)  node(point2){} --
            ++(left:1) node[ocirc]{}
           (1,0) node[circ]{} --                 % explicit coordinate
            ++(right:2) to [C, l=$C$]
            ++(down:2) --
           (1,-2) node[circ]{}                   % explicit coordinate
        ;
    \end{circuitikz}

    \begin{circuitikz}[european,scale=1]
        \draw
            (0,0) node[ocirc]{} --
            ++(right:1)  coordinate(point1){} to [R, l=$R$]  % use coordinate instead
            ++(down:2)   coordinate(point2){} --             % use coordinate instead
            ++(left:1) node[ocirc]{}
            (node cs:name=point1) node[circ]{} --
            ++(right:2) to [C, l=$C$]
            ++(down:2)--
            (node cs:name=point2) node[circ]{}{}
        ;
    \end{circuitikz}
\end{document}

相關內容