> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/zh-tw/te-ding-ling-yu/07-circuitikz-package.md).

# CircuiTikz 套件

## 簡介

本文說明了 [CircuiTikz 套件](https://ctan.org/pkg/circuitikz?lang=en) 的基本用法，該套件提供一組用於排版電路與電子網路的巨集。若要使用此套件，必須在

```latex
\usepackage{circuitikz}
```

寫入你的 LaTeX 文件前言區。接著即可使用環境 `circuitikz` 來使用 TikZ 語法排版圖表。CircuiTikz 包含數個 *節點* 可搭配標準 TikZ 語法使用的節點；下列範例使用一個名為 `variable cute inductor`:

```latex
\documentclass{article}
\usepackage{circuitikz}
\begin{document}
\begin{center}
\begin{circuitikz}
\draw (0,0) to[ variable cute inductor ] (2,0);
\end{circuitikz}
\end{center}
\end{document}
```

[在 Overleaf 中開啟這個範例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=First+example+using+circuitikz\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bcircuitikz%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bcenter%7D%0A%5Cbegin%7Bcircuitikz%7D%0A%5Cdraw+%280%2C0%29+to%5B+variable+cute+inductor+%5D+%282%2C0%29%3B+%0A%5Cend%7Bcircuitikz%7D%0A%5Cend%7Bcenter%7D%0A%5Cend%7Bdocument%7D)

此範例會產生以下輸出：

![OLV2circuitikz1.png](/files/49d2a15675888ffac29e03bc984c3746cc13aecc)

## 一個可運作的範例

如前所述，要繪製電路網路圖，你可以使用標準的 TikZ 語法，如下方這個更複雜的範例所示：

```latex
\documentclass{article}
\usepackage{circuitikz}
\begin{document}
\begin{center}
\begin{circuitikz}[american voltages]
\draw
  (0,0) to [short, *-] (6,0)
  to [V, l_=$\mathrm{j}{\omega}_m \underline{\psi}^s_R$] (6,2)
  to [R, l_=$R_R$] (6,4)
  to [short, i_=$\underline{i}^s_R$] (5,4)
  (0,0) to [open, v^>=$\underline{u}^s_s$] (0,4)
  to [short, *- ,i=$\underline{i}^s_s$] (1,4)
  to [R, l=$R_s$] (3,4)
  to [L, l=$L_{\sigma}$] (5,4)
  to [short, i_=$\underline{i}^s_M$] (5,3)
  to [L, l_=$L_M$] (5,0);
\end{circuitikz}
\end{center}
\end{document}
```

[在 Overleaf 中開啟這個範例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=More+advanced+example+using+circuitikz\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bcircuitikz%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bcenter%7D%0A%5Cbegin%7Bcircuitikz%7D%5Bamerican+voltages%5D%0A%5Cdraw%0A++%280%2C0%29+to+%5Bshort%2C+%2A-%5D+%286%2C0%29%0A++to+%5BV%2C+l_%3D%24%5Cmathrm%7Bj%7D%7B%5Comega%7D_m+%5Cunderline%7B%5Cpsi%7D%5Es_R%24%5D+%286%2C2%29+%0A++to+%5BR%2C+l_%3D%24R_R%24%5D+%286%2C4%29+%0A++to+%5Bshort%2C+i_%3D%24%5Cunderline%7Bi%7D%5Es_R%24%5D+%285%2C4%29+%0A++%280%2C0%29+to+%5Bopen%2C+v%5E%3E%3D%24%5Cunderline%7Bu%7D%5Es_s%24%5D+%280%2C4%29+%0A++to+%5Bshort%2C+%2A-+%2Ci%3D%24%5Cunderline%7Bi%7D%5Es_s%24%5D+%281%2C4%29+%0A++to+%5BR%2C+l%3D%24R_s%24%5D+%283%2C4%29%0A++to+%5BL%2C+l%3D%24L_%7B%5Csigma%7D%24%5D+%285%2C4%29+%0A++to+%5Bshort%2C+i_%3D%24%5Cunderline%7Bi%7D%5Es_M%24%5D+%285%2C3%29+%0A++to+%5BL%2C+l_%3D%24L_M%24%5D+%285%2C0%29%3B+%0A%5Cend%7Bcircuitikz%7D%0A%5Cend%7Bcenter%7D%0A%5Cend%7Bdocument%7D)

此範例會產生以下輸出：

![OLV2circuitikz2.png](/files/4e6d229f48f8692249efe134ab98a2c865bfc44e)

這些節點 `short`, `V`, `R` 和 `左` 在此處介紹，但還有很多——其中一些列在下一節中。

## 部分節點類型清單

下方列出 CircuiTikz 提供的一些元件，以及你可直接在 Overleaf 中開啟以產生表格的連結。請參閱 [該 **circuitikz** 套件說明文件](http://mirrors.ctan.org/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf) 以取得其他節點類型。

### 單極

![OVL2monopoles.png](/files/b838f5cfc17e755ee2802d5b1179adcd0dda8bae)

[在 Overleaf 中開啟這個 `circuitikz` **單極** 節點表。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Monopole+nodes+for+circuitikz\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bgeometry%7D%0A%5Cgeometry%7Blandscape%2C+textwidth%3D27cm%7D%0A%5Cusepackage%7Bcircuitikz%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cnewcommand%7B%5Cthiscirc%7D%5B1%5D%7B%25%0A%5Ctexttt%7B%231%7D%5Ckern5pt%5Chfill%0A%5Cbegin%7Bcircuitikz%7D%25%0A%5Cdraw+%280%2C0%29+node%5B+%231+%5D+%7B%7D%3B%25%282%2C0%29%3B+%0A%5Cend%7Bcircuitikz%7D%25%0A%7B%5Chspace%7B5mm%7D%7D%25%0A%7D%0A%0A%5Crenewcommand%7B%5Carraystretch%7D%7B2%7D%0A%5Cbegin%7Bcenter%7D%0A%5Cbegin%7Btabular%7D%7Blll%7D+%0A%5Cthiscirc%7Bground%7D+%26+%5Cthiscirc%7Bsground%7D+%26+%5Cthiscirc%7Bnground%7D%5C%5C%0A%5Cthiscirc%7Brground%7D+%26+%5Cthiscirc%7Bpground%7D+%26+%5Cthiscirc%7Bcground%7D%5C%5C%0A%5Cthiscirc%7Btlinestub%7D+%26+%5Cthiscirc%7Bantenna%7D+%26+%5Cthiscirc%7Brxantenna%7D%5C%5C%0A%5Cend%7Btabular%7D%0A%5Cend%7Bcenter%7D%0A%0A%5Cend%7Bdocument%7D)

### 雙極

![OVL2bipoles.png](/files/01c085530545229546bda7ded7b973ec61d40af6)

[在 Overleaf 中開啟這個 `circuitikz` **雙極** 節點表。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Bipole+nodes+for+circuitikz\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bgeometry%7D%0A%5Cgeometry%7Blandscape%2C+textwidth%3D27cm%7D%0A%5Cusepackage%7Bcircuitikz%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cnewcommand%7B%5Cbipole%7D%5B1%5D%7B%25%0A%5Ctexttt%7B%231%7D%5Ckern5pt+%5Chfill%0A%5Cbegin%7Bcircuitikz%7D%25%0A%5Cdraw+%280%2C0%29+to%5B+%231+%5D+%282%2C0%29%3B+%0A%5Cend%7Bcircuitikz%7D%25%0A%5Chspace%7B5mm%7D%25%0A%7D%0A%0A%5Crenewcommand%7B%5Carraystretch%7D%7B3%7D%0A%5Cbegin%7Bcenter%7D%0A%5Cbegin%7Btabular%7D%7Blll%7D+%0A%5Cbipole%7Bammeter%7D+%26+%5Cbipole%7Bvoltmeter%7D+%26+%5Cbipole%7Bshort%7D%5C%5C%0A%5Cbipole%7Bopen%7D+%26+%5Cbipole%7Blamp%7D+%26+%5Cbipole%7Bgeneric%7D%5C%5C%0A%5Cbipole%7Btgeneric%7D+%26+%5Cbipole%7Bageneric%7D+%26+%5Cbipole%7Bfullgeneric%7D%5C%5C%0A%5Cbipole%7Btfullgeneric%7D+%26+%5Cbipole%7Bmemristor%7D+%26+%5Cbipole%7Bamerican+resistor%7D%5C%5C%0A%5Cbipole%7BvR%7D+%26+%5Cbipole%7Bamerican+potentiometer%7D+%26+%5Cbipole%7Beuropean+resistor%7D%5C%5C%0A%5Cbipole%7Beuropean+resistor%7D+%26+%5Cbipole%7Beuropean+potentiometer%7D+%26+%5Cbipole%7Bvaristor%7D%5C%5C%0A%5Cbipole%7Bphotoresistor%7D+%26+%5Cbipole%7Bthermocouple%7D+%26+%5Cbipole%7Bthermistor%7D%5C%5C%0A%5Cbipole%7Bthermistor+ntc%7D+%26+%5Cbipole%7Bfuse%7D+%26+%5Cbipole%7Bafuse%7D%5C%5C%0A%5Cbipole%7Bbattery%7D+%26+%5Cbipole%7Bbattery1%7D+%26+%5Cbipole%7Beuropean+voltage+source%7D%5C%5C%0A%5Cbipole%7Bamerican+voltage+source%7D+%26+%5Cbipole%7Beuropean+current+source%7D+%26+%5Cbipole%7Bamerican+current+source%7D%5C%5C%0A%5Cend%7Btabular%7D%0A%5Cend%7Bcenter%7D%0A%0A%5Cend%7Bdocument%7D)

### 二極體

![OVL2diodes.png](/files/e3016f99749086a8a490510fa62e8bb1ce1afdf0)

[在 Overleaf 中開啟這個 `circuitikz` **二極體** 節點表。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Diode+nodes+for+circuitikz\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bgeometry%7D%0A%5Cgeometry%7Blandscape%2C+textwidth%3D27cm%7D%0A%5Cusepackage%7Bcircuitikz%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cnewcommand%7B%5Cbipole%7D%5B1%5D%7B%25%0A%5Ctexttt%7B%231%7D%5Ckern5pt+%5Chfill%0A%5Cbegin%7Bcircuitikz%7D%25%0A%5Cdraw+%280%2C0%29+to%5B+%231+%5D+%282%2C0%29%3B+%0A%5Cend%7Bcircuitikz%7D%25%0A%5Chspace%7B5mm%7D%25%0A%7D%0A%0A%5Crenewcommand%7B%5Carraystretch%7D%7B3%7D%0A%5Cbegin%7Bcenter%7D%0A%5Cbegin%7Btabular%7D%7Blll%7D+%0A%5Cbipole%7Bempty+diode%7D+%26+%5Cbipole%7Bempty+Schottky+diode%7D+%26+%5Cbipole%7Bempty+Zener+diode%7D%5C%5C%0A%5Cbipole%7Bempty+tunnel+diode%7D+%26+%5Cbipole%7Bphotodiode%7D+%26+%5Cbipole%7Bempty+diode%7D%5C%5C%0A%5Cbipole%7Bempty+varcap%7D+%26+%5Cbipole%7Bfull+diode%7D+%26+%5Cbipole%7Bfull+Schottky+diode%7D%5C%5C%0A%5Cbipole%7Bfull+Zener+diode%7D+%26+%5Cbipole%7Bfull+tunnel+diode%7D+%26+%5Cbipole%7Bfull+photodiode%7D%5C%5C%0A%5Cbipole%7Bfull+led%7D+%26+%5Cbipole%7Bfull+varcap%7D+%26+%5Cbipole%7Bsquid%7D%5C%5C%0A%5Cbipole%7Bbarrier%7D+%26+%26+%5C%5C%0A%5Cend%7Btabular%7D%0A%5Cend%7Bcenter%7D%0A%0A%5Cend%7Bdocument%7D)

### 動態雙極

![OVL2dynamicalbipoles.png](/files/fe94daa7850db0a7b49a72c3fc351735ec131ab7)

[在 Overleaf 中開啟這個 `circuitikz` **動態雙極** 節點表。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Dynamical+bipole+nodes+for+circuitikz\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bgeometry%7D%0A%5Cgeometry%7Blandscape%2C+textwidth%3D27cm%7D%0A%5Cusepackage%7Bcircuitikz%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cnewcommand%7B%5Cbipole%7D%5B1%5D%7B%25%0A%5Ctexttt%7B%231%7D%5Ckern5pt+%5Chfill%0A%5Cbegin%7Bcircuitikz%7D%25%0A%5Cdraw+%280%2C0%29+to%5B+%231+%5D+%282%2C0%29%3B+%0A%5Cend%7Bcircuitikz%7D%25%0A%5Chspace%7B5mm%7D%25%0A%7D%0A%0A%5Crenewcommand%7B%5Carraystretch%7D%7B3%7D%0A%5Cbegin%7Bcenter%7D%0A%5Cbegin%7Btabular%7D%7Blll%7D+%0A%5Cbipole%7Bcapacitor%7D+%26+%5Cbipole%7Bpolar+capacitor%7D+%26+%5Cbipole%7Bvariable+capacitor%7D%5C%5C%0A%5Cbipole%7Bcute+inductor%7D+%26+%5Cbipole%7Bvariable+cute+inductor%7D+%26+%5Cbipole%7Bamerican+inductor%7D%5C%5C%0A%5Cbipole%7Bvariable+american+inductor%7D+%26+%5Cbipole%7Beuropean+inductor%7D+%26+%5Cbipole%7Bvariable+european+inductor%7D%5C%5C%0A%5Cbipole%7Btransmission+line%7D+%26+%5Cbipole%7Bvsourcesin%7D+%26+%5Cbipole%7Bisourcesin%7D%5C%5C%0A%5Cbipole%7Bclosing+switch%7D+%26+%5Cbipole%7Bopening+switch%7D+%26+%5Cbipole%7Bpush+button%7D%5C%5C%0A%5Cend%7Btabular%7D%0A%5Cend%7Bcenter%7D%0A%0A%5Cend%7Bdocument%7D)

## 延伸閱讀

詳情請見：

* [TikZ 指南](/latex/zh-tw/tu-biao-yu-biao-ge/05-tikz-package.md)
* [插入圖片](/latex/zh-tw/geng-duo-zhu-ti/27-inserting-images.md)
* [圖片與表格的定位](/latex/zh-tw/tu-biao-yu-biao-ge/02-positioning-images-and-tables.md)
* [表格與圖形清單](/latex/zh-tw/tu-biao-yu-biao-ge/03-lists-of-tables-and-figures.md)
* [在 LaTeX 中使用顏色](/latex/zh-tw/ge-shi-hua/13-using-colors-in-latex.md)
* [LaTeX 中的長度](/latex/zh-tw/ge-shi-hua/01-lengths-in-latex.md)
* [該 **circuitikz** 套件說明文件](http://mirrors.ctan.org/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/zh-tw/te-ding-ling-yu/07-circuitikz-package.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
