Circuitikzでスイッチを描画するにはどうすればよいですか?



How Can I Draw Switch Circuitikz



解決:

このような?

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



スイッチ記号を使用してspdt(を参照)Circuitikzパッケージのドキュメント、108ページ)およびデフォルトを使用(アメリカ)回路図のスタイル:

 documentclass [border = 3.141592mm] {standalone}  usepackage {circuitikz}  begin {document}  begin {circuitikz}  node [spdt、rotate = 90](sw){};  draw(sw.in)to [L = {$(L、r)$}] ++(0、-2)to [R = $ R $] ++(0、-2)座標(aux1)( sw.out 2)node [above] {(2)}から[short] ++(+ 1,0)|-(aux1)(sw.out 1)node [above] {(1)}から[short] ++(-1,0)座標(aux2)から[vsource、a = $ E $](aux2 | -aux1)から[short](aux1);  end {circuitikz}  end {document}

にとってヨーロピアンスタイル、追加する必要がありますCircuitikzオプションヨーロッパ:



 begin {circuitikz} [ヨーロッパ]

この場合の結果は次のとおりです。

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

ただし、両方のスタイルを組み合わせたい場合、MWEは次のようになります。



 documentclass [border = 3.141592mm] {standalone}  usepackage {circuitikz}  begin {document}  begin {circuitikz}  node [spdt、rotate = 90](sw){};  draw(sw.in)to [L = {$(L、r)$}] ++(0、-2)to [R = $ R $、european] ++(0、-2)座標(aux1 )(sw.out 2)node [above] {(2)} to [short] ++(+ 1,0)|-(aux1)(sw.out 1)node [above] {(1)} to [ short] ++(-1,0)座標(aux2)から[vsource、a = $ E $](aux2 | -aux1)から[short](aux1);  end {circuitikz}  end {document}

生成するもの:

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


また、ラベルの場合、$:$ {(L、r)} $の内側に中括弧を追加する必要があります。そうしないと、パーサーが混乱します。それは最終的にあなたに与えます:

 documentclass [border = 3.141592mm] {standalone}  usepackage {circuitikz}  begin {document}  begin {circuitikz}  node [spdt、rotate = 90](sw){};  draw(sw.in)to [L = $ {(L、r)} $] ++(0、-2)to [R = $ R $、european] ++(0、-2)座標(aux1 )(sw.out 2)node [above] {(2)} to [short] ++(+ 1,0)|-(aux1)(sw.out 1)node [above] {(1)} to [ short] ++(-1,0)座標(aux2)から[vsource、a = $ E $](aux2 | -aux1)から[short](aux1);  end {circuitikz}  end {document} `` ` 

これが私の貢献です

 documentclass [border = 2mm] {standalone}  usepackage [european、かわいいインダクタ] {circuitikz}  begin {document}  begin {circuitikz}  node [spdt、rotate = 90](inter){};  draw(inter.in)to [L、l =  mbox {$(L、r)$}] ++(0、-2)to [R、l = $ R $] ++(0、-2 )座標(aux1)(inter.out 2)node [above] {(2)} to [short] ++(+ 1,0)|-(aux1)(inter.out 1)node [above] {(1 )}から[short] ++(-1,0)座標(aux2)から[vsource、a = $ E $](aux2 | -aux1)から[short](aux1);  end {circuitikz}  end {document}

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

使った mboxは、ダイポールL、rの詳細を書き込みます。

ヨーロッパ人なので、オプションを挿入しますヨーロッパ人を直接circuitikzパッケージに入れます。一方、Zarkoが示すように、オプションも追加する必要がありますインダクターとして黒い長方形を取得することを避けるためのかわいいインダクター。