ジャイレータはポート間の水平方向の分離を追加します

ジャイレータはポート間の水平方向の分離を追加します

ジャイレーターの 2 つの円の間に水平方向のスペースを追加する方法はありますか?

\documentclass{article}
\usepackage[english]{babel}
\usepackage[]{circuitikz}

\begin{document}
\begin{circuitikz} 
\draw(0,0) 
    node[gyrator] (G) {}
 (G.A1) node[anchor=east] {A1}
 (G.A2) node[anchor=east] {A2}
 (G.B1) node[anchor=west] {B1}
 (G.B2) node[anchor=west] {B2}
 (G.base) node{};
\end{circuitikz}
\end{document}

ここに画像の説明を入力してください

ここに画像の説明を入力してください これを描きたい

答え1

で定義されているコンポーネントのプロパティを変更できますpgfcircquadpoles.tex。これは、1cm のスペースを追加する例です。変数は、\Spaceスペースを増やすために定義されています。コツは、コンポーネントの右側の部分を だけ右にシフトすることです\Space

ここに画像の説明を入力してください

\documentclass{standalone}
\usepackage[english]{babel}
\usepackage[]{circuitikz}

\def\Space{1cm}

\makeatletter
\pgfcircdeclarequadpole{gyrator}{

    \def\stretto{.4}

    \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}

    \pgfpathmoveto{\pgfpoint{\Space+\pgf@circ@res@right}{\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint{\Space+\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint{\Space+\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
    \pgfpathlineto{\pgfpoint{\Space+\pgf@circ@res@right}{\pgf@circ@res@down}}

    \pgfusepath{draw}

    \pgfsetlinewidth{2\pgflinewidth}
    \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}}
    \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down}

    \pgfpathmoveto{\pgfpoint{\Space+\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}}
    \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down}
    \pgfusepath{draw}

}{}
\makeatother




\begin{document}
\begin{circuitikz} 
\draw(0,0) 
    node[gyrator] (G) {}
 (G.A1) node[anchor=east] {A1}
 (G.A2) node[anchor=east] {A2}
 (G.B1) node[anchor=west,xshift=\Space] {B1}
 (G.B2) node[anchor=west,xshift=\Space] {B2}
 (G.base) node{};
\end{circuitikz}
\end{document}

関連情報