\usepackage[siunitx]{circuitikz} and place schematics inside a \begin{circuitikz}...\end{circuitikz} environment. circuitikz loads tikz and (with the [siunitx] option) siunitx automatically. Two-terminal components sit along \draw paths via to[component, options], and multi-terminal devices such as op-amps, transistors, and logic gates are placed as named nodes and wired through their pin anchors.
First circuit: RC low-pass filter
Each\draw chain connects coordinates with components (sV for AC voltage source, R for resistor, C for capacitor), wires (short), terminal markers (-o, *-*), and monopoles (ground). With [siunitx], angle brackets like 10<\kilo\ohm> format SI values automatically.
rc-lowpass.tex
Ready to use this syntax? Continue in the browser editor when you want to adapt the example in a real project.Open LaTeX Cloud Studio
Common component symbols
Two-terminal dipoles fit directly intoto[...] segments. Place each symbol at its own coordinates so labels and paths do not collide:
common-components.tex
Operational amplifiers
Multi-terminal devices are placed as TikZ nodes (node[op amp] (op) {}) and connected through their named anchors: op.- (inverting input), op.+ (non-inverting input), and op.out (output). Add ++(dx,dy) for relative coordinates when routing feedback loops.
opamp-inverter.tex
Transistors
Fornode[npn] or node[pnp], wire to .B (base), .C (collector), and .E (emitter), and for nmos or pmos use .G (gate), .D (drain), and .S (source). Use node[vcc]{...} and node[ground]{} for supply and reference nodes.
npn-amplifier.tex
Digital logic circuits
Use.in 1, .in 2, and .out on two-input gates such as and port, or port, xor port, nand port, and nor port, and use .in and .out on not port. Use TikZ perpendicular coordinates like (0.8,0 |- xor1.in 1) to take the x-coordinate from (0.8,0) and the y-coordinate from xor1.in 1.
logic-half-adder.tex
Labels, voltage/current arrows, and European style
By default,circuitikz uses American zigzag resistors and logic gates with European voltage and current styles. Pass [european] or [american] to switch the package defaults for resistors, inductors, voltage and current notation, logic gates, and gas-filled surge arresters.
Key label options on to[...] paths:
l=...sets the primary label;a=...sets an annotation on the opposite side.l2=top and bottomstacks a two-line label (such as component name and value) on one side so the opposite side stays free for a voltage arrow (v=...).i=...adds a current arrow along a wire or component.- Inside single-line keys (
l=,a=),[siunitx]parses5<\volt>; insidel2=, use\qty{4.7}{\kilo\ohm}directly.
voltage-current-labels.tex
Common mistakes
- Using
<unit>syntax without[siunitx]or insidel2=:10<\kilo\ohm>requires\usepackage[siunitx]{circuitikz}and applies to single-line keys (l=,a=). Insidel2=... and ..., write\qty{10}{\kilo\ohm}instead, or TeX stops withUndefined control sequenceon the unit macro. - Reusing the same coordinates for multiple components: Drawing several
to[...]statements between(0,0)and(2,0)stacks symbols on top of each other. Chain paths continuously or offset each component to its own(x,y)coordinates. - Wrong anchor names on multi-terminal parts: Transistor anchors are uppercase (
.B,.C,.E), op-amp inputs are.-and.+, and logic gate inputs include a space (.in 1,.in 2). - Colliding labels and voltage arrows: Placing
l=,a=, andv=on the same component crowds one side of the symbol. To put a stacked label and voltage marker on opposite sides of a directed path, usel2_=andv^=.
In LaTeX Cloud Studio
LaTeX Cloud Studio compiles with TeX Live 2026 (full distribution), which includescircuitikz, tikz, and siunitx. All six schematics above compile under PDFLaTeX. If your project uses XeLaTeX or LuaLaTeX for custom fonts, you can select PDFLaTeX, XeLaTeX, or LuaLaTeX under Settings -> General -> LaTeX Engine (default Auto (Recommended)), and your explicit choice is kept.
Ready to build a circuit report or electronics assignment in the browser? Start from the Lab Report template in LaTeX Cloud Studio and replace main.tex with whichever complete schematic above fits your circuit.
