How to Change the Default Line Width in CircuitikZ
At a glance
- 1. Set path width
Pass TikZ’s line width option to the circuitikz environment to change the default stroke width in that circuit.
- 2. Adjust symbol strokes
Use the CircuitikZ bipoles/thickness key to change the relative thickness of two-terminal component symbols.
- 3. Choose the right scope
Set options on one circuit, one draw command, or a reusable wrapper, depending on where you want the change.
CircuitikZ uses TikZ’s line width option for the stroke width of circuit paths, including wires. Set it on the circuitikz environment to establish a baseline for the whole circuit. If you specifically want to adjust the strokes inside two-terminal component symbols, use CircuitikZ’s separate bipoles/thickness setting.
Set the width for one circuit
Pass line width=<length> as an option to circuitikz. The length is a TeX dimension, so values such as 0.8pt and 1mm are valid.
\documentclass{standalone}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}[line width=1pt]
\draw (0,0) to[R] (2,0);
\draw (2,0) to[C] (2,2);
\draw (0,0) -- (0,2) -- (2,2);
\end{circuitikz}
\end{document}
This is a complete example: compile it with a LaTeX engine that supports the standalone class and has CircuitikZ installed. The environment option sets the default path width within that circuit. You can change 1pt to the width you prefer.
The same TikZ option can be applied to an individual path instead:
\draw[line width=1.2pt] (0,0) -- (2,0);
That is useful when only one wire or part of a circuit should be heavier than the rest.
Adjust component-symbol thickness separately
CircuitikZ provides the bipoles/thickness key to change the relative thickness of two-terminal component symbols, such as resistors and capacitors. For example, set it in the preamble:
\ctikzset{bipoles/thickness=1.3}
The value is a multiplier: 1.3 requests component strokes 1.3 times the normal thickness. It does not specify a width in points. Use line width when you need a particular physical stroke width; use bipoles/thickness when you want component-symbol strokes to be heavier or lighter relative to the circuit’s baseline.
You can use both settings together:
\begin{circuitikz}[line width=0.8pt]
\ctikzset{bipoles/thickness=1.3}
\draw (0,0) to[R] (2,0);
\end{circuitikz}
This gives the circuit a baseline path width of 0.8pt and requests relatively thicker bipole symbols. CircuitikZ may use component-specific drawing styles, so if a particular symbol does not respond as expected, check that component’s options in the manual.
Reuse a setting
For a small number of circuits, putting [line width=...] on each circuitikz environment is explicit and easy to maintain. If you need the same options repeatedly, define a wrapper environment:
\newenvironment{mycircuitikz}[1][]{%
\begin{circuitikz}[line width=1pt,#1]%
}{%
\end{circuitikz}%
}
Then write \begin{mycircuitikz} ... \end{mycircuitikz}. The optional argument lets you add other CircuitikZ or TikZ options for an individual circuit. If you supply line width again in that argument, it takes precedence because it appears later in the option list.
You can also use \tikzset{every picture/.style={line width=1pt}} to set a baseline for TikZ pictures throughout a document. This affects ordinary TikZ pictures too, not just CircuitikZ diagrams, and explicit styles can override it. For that reason, an option on the circuit environment or a wrapper is usually the more controlled choice.
Common mistakes
- Changing only
bipoles/thicknesswhen wires are too thin: that key adjusts component-symbol thickness; setline widthfor the circuit paths. - Using a bare number for
line width: use a dimension such as1ptor0.4mm. - Expecting every element to have identical strokes: symbols can have their own drawing settings, while wires and manually drawn paths follow TikZ path options. Adjust the relevant component setting when needed.
- Putting the option on the wrong scope: an option on one
\drawcommand affects that path; an option on the environment establishes the baseline for paths throughout that circuit.
References
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.