latex - Circuit diagrams in Latex | Circuit diagrams in Latex using Circuitikz - latex tutorial
Explain Circuit diagrams in Latex
- While Tikz provides several features and packages to generate diagrams and all sorts of other drawings, it unfortunately lacks a good package to layout electric circuits.
- Using the package circuitikz we can simply solve this problem.
- It extends provides a new environment circuitikz in which we can easily draw our circuits in no time.
Sample Code:
Output:
The above code will create the following circuit diagram in our document:
- The circuit will be drawn in the same way as a path in tikz, but we specify special options for the elements:
- Starting at (0,0) we will draw a voltage source specifying the [V,v=$U_q$] options to the coordinates (0,2), where V chooses the symbol for a voltage source and the v=$U_q$ draws the voltage arrow next to it. Then we proceed to the resistor:
- We first must draw a short circuit from (0,2) to (2,2) and then put the resistor symbol on the path from (2,2) to (2,0) note that this time the label of the element must be specified directly (R=$R_1$).
- A list of all available elements for circuits is available in the circuitikz manual.
- we want to add an inductor parallel to the Resistor.
- The easiest way is to add a new draw command like this:
Sample Code:
Output:
After compilation we'd get the following circuit diagram:
Sample Code:
Adding a capacitor next to it, is just as simple:
Output:
This would give us the following diagram:
- The circuitikz manual provides examples of all symbols and functions and can also be used for further reference.