Drawing electrical circuits
Electrical documents, especially for learners, can contain a lot of formulas. So LaTeX, with its strengths in math typesetting, is a very good choice for writers. Electrical units are easily written complying with standards using the siunitx
package, as we saw in a previous recipe in this chapter.
It seems natural to also draw circuits directly within LaTeX. In contrast to including external drawings, native LaTeX drawings can have annotations that perfectly match the text with font and styles.
So, this recipe will deal with drawing circuits. Our goal is to create a circuit with common electrical components such as a resistor, a diode, a capacitor, a bulb, and more.
Note
This is just a sample illustration, so don't
try building this one with real components at home.
How to do it...
The TikZ package provides several libraries for drawing electrical and logical circuits. We will choose one following the IEC norm. As usual, the code can be downloaded from the publisher...