CircuiTikZ: circuit diagrams that live in the LaTeX source
CircuiTikZ TeX/LaTeX package for drawing circuits
At a glance
- What is it?
- CircuiTikZ is a set of macros on top of TikZ for typesetting electrical networks inside LaTeX documents, distributed through CTAN and used through a single usepackage line. Its ConTeXt support is real but no longer checked by CI, and the git version can change options between releases.
- Who is it for?
- CircuiTikZ suits anyone writing technical documents, lecture notes or exam sheets whose circuits have to match the surrounding text, restyle with the document and stay in version control as source. It does not suit a workflow built around a binary schematic file, and it does not suit you if you need ConTeXt compatibility to be tested automatically, because the project states that those CI checks are disabled.
- Can I use it commercially?
- Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
- Is it still maintained?
- Yes. The repository last received commits 41 days ago.
- What is it written in?
- Mainly TeX, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Born from lecture notes, designed for lean syntax
CircuiTikZ is a TeX and LaTeX package for drawing circuits, providing a set of macros on top of TikZ for naturally typesetting electrical and electronic networks.
The origin story explains the syntax. It was born mainly for writing Massimo Redaelli's exercise book and exam sheets for the Elettrotecnica courses at Politecnico di Milano, Italy. He wanted a tool that was easy to use, with a lean syntax, native to LaTeX, and supporting directly the PDF output format.
Those four requirements still describe the project, and they explain why it looks different from a general purpose graphics package. Native to LaTeX means a resistor is a macro that participates in the document's typography, so it inherits your font size, your line spacing and your page geometry. Lean syntax means you describe topology rather than coordinates. PDF output means there is no intermediate format to lose fidelity in. The downside of the same choice is that the picture is only as good as the surrounding typography, and a circuit in a document with a badly chosen symbol font looks badly chosen rather than badly drawn.
Three dependencies, and one of them is optional in practice
CircuiTikZ is included with the most common LaTeX systems, so the README says it should work out of the box. The dependency list is short and worth knowing precisely.
* TikZ/PGF graphics library, version 3.1.5b * `xstring` newer than 2009/03/13 * `siunitx`, better if `v2` or newer
siunitx is the one to watch. It is not merely a convenience: the package options allow you to use the siunitx special syntax for values, and if you want that syntax then siunitx is effectively mandatory. The other two are hard requirements. The README also flags xstring as needing a version newer than a 2009 date, which is the kind of constraint that bites when you are working with an old TeX distribution rather than a current one.
The practical consequence for a build: if your CI image pins an old TeX Live or uses a minimal distribution, the failure will appear at package load time rather than when a specific circuit is drawn.
One usepackage line, and the voltage direction option
With the stable version from CTAN, the whole setup is a single line in the preamble.
\usepackage[RPvoltages, siunitx]{circuitikz}% or your preferred optionsThe options argument is not decoration. The README asks you to check the options you like and says you should at least state one of the voltage direction options, like RPvoltages shown above, or use the siunitx special syntax, and then to check the relevant sections in the manual.
Voltage direction is the choice that changes how every source and every battery is drawn and labelled, and getting it wrong produces diagrams that are internally consistent but disagree with the surrounding text. This is the kind of decision the manual exists to make explicit.
For ConTeXt, the equivalent is a module load.
\usemodule[circuitikz]which goes in the preamble and compiles with both PS and PDF target output.
ConTeXt support is maintained by hand, not by CI
The README carries an explicit warning about the state of ConTeXt compatibility. Because of a bug in the Ubuntu context package, automatic CI checks for ConTeXt compatibility are disabled. The author states that he is still checking it at home but is not able to have it integrated in the CI.
That is a small sentence with a large consequence for a team. The ConTeXt path is described as working, and it is plausible that it does, but the guarantee you get is the maintainer's manual checking rather than a green build on every commit. If your document pipeline is ConTeXt based, you are relying on a weaker safety net than the LaTeX path, and you should keep a ConTeXt compile in your own CI to restore it.
The repository layout supports that kind of local checking. The Makefile has a test-compile target that runs a context compile of circuitikz-context.tex when a context binary is available, and prints a message that ConTeXt was not found and the compatibility check was skipped when it is not.
The git version arrives as one file and warns you
If you need a newer version than your distribution ships, the README describes a deliberately simple route. You go to the project page, download the version you want from the link called download the latest version in a single file, and you end up with a file called circuitikzgit.sty that you put somewhere in your LaTeX input path, best in the same directory as your main file.
\usepackage[siunitx, RPvoltages]{circuitikzgit}and for ConTeXt.
\usemodule[circuitikzgit]The README is unusually blunt about the consequences: options and style files can and do change between versions, so you have to check them manually, and the recommended version is always the one that comes with your TeX distribution. The trick is for the case where you really need something newer.
For the opposite direction there is a roll-back mechanism inside the package that lets you use older versions if you need them, documented in the manual under the section named Incompatibilities between versions. That section name is a warning too: incompatibility between versions is the thing the project expects you to hit.
The Makefile shows how a release is actually produced
The repository root holds a Makefile that documents the release process more clearly than a changelog does. The CTIKZ_GIT_FILENAME variable is set to circuitikzgit.sty and CTIKZ_CONTEXT_GIT_FILENAME to t-circuitikzgit.tex, which are the two artefacts the single file download and the ConTeXt module rely on.
The test-compile target compiles the compatibility document and the manual with pdflatex using the options -8bit -halt-on-error, so a failed build stops the make run rather than continuing. The manual-git target builds the manual from the flat git version, rewrites the document headers to use circuitikzgit instead of circuitikz, produces circuitikzmanualgit.pdf, and packages the ctikzstyle files into ctikzstylesgit.zip. There is a separate ctan target that creates the zip for CTAN upload, matching the release tags, which are named as CTAN releases.
The tree also holds gpl-3.0_license.txt and lppl-1-3c_license.txt, plus a CHANGELOG.md, a doc/ directory, a tools/ directory and a pics/ directory for artwork.
A dual licence and a four person copyright line
The licence section says the file may be distributed and modified under the LaTeX Project Public License and or under the GNU Public License. Both licence texts are in the repository, lppl-1-3c_license.txt and gpl-3.0_license.txt, so the dual licensing is explicit rather than implied.
The copyright block lists four authors with the years of their contributions: Romano Giannetti for 2018 to 2026, Stefan Lindner for 2015 to 2026, Stefan Erhardt for 2013 to 2026, and Massimo Redaelli for 2007 to 2026. The dates themselves tell the story of the project, from the original exercise books to a maintained package with a CTAN release history.
The README is also explicit about how to report problems. Bug reports and enhancement suggestions should go through the issue page, and you are asked to be ready to provide example code showing the bug. The same page is explicitly not the place for generic help on how to use the package, and the README points you to the manual examples, to questions tagged circuitikz on tex.stackexchange.com, and to the pgf-tikz matrix room and TopTeX instead.
Editorial conclusion
CircuiTikZ suits anyone writing technical documents, lecture notes or exam sheets whose circuits have to match the surrounding text, restyle with the document and stay in version control as source. It does not suit a workflow built around a binary schematic file, and it does not suit you if you need ConTeXt compatibility to be tested automatically, because the project states that those CI checks are disabled. Verify first which version your distribution ships, since the recommended version is the one that comes with your TeX distribution and the git version can change options and style files between releases.
Frequently asked questions
How do I install CircuiTikZ?
The stable version is available on CTAN and is included within the major LaTeX distributions, Texlive and Miktex. If you need the latest version, the project page offers the git version as a single file.
Which packages does CircuiTikZ depend on?
The main dependencies are the TikZ/PGF graphics library at version 3.1.5b, xstring newer than 2009/03/13, and siunitx, better if v2 or newer. CircuiTikZ itself ships with the common LaTeX systems.
How do I use a newer version of CircuiTikZ than my distribution ships?
Download the single file version from the project page, put circuitikzgit.sty in your LaTeX input path, and load it with the usepackage command for circuitikzgit. The README warns that options and style files can change between versions and that the recommended version is the one from your TeX distribution.
Is CircuiTikZ available for ConTeXt?
Yes, the README gives the usemodule command for ConTeXt and says it compiles with both PS and PDF target output. Automatic CI checks for ConTeXt compatibility are disabled because of a bug in the Ubuntu context package, so the maintainer checks it manually.
What licence does CircuiTikZ use?
The file may be distributed and modified under the LaTeX Project Public License and or under the GNU Public License, and the repository contains lppl-1-3c_license.txt and gpl-3.0_license.txt.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/circuitikz-circuitikz)Was this useful?