Circuitikz provides a set of macros to typeset electronic networks. It is based on pgf and TikZ packages. Here is the syntax for basic circuits to typeset using circuitikz in LaTeX tikzpicture environment .
Despite of the beautiful pictures CircuiTikz(TikZ) generate, it is not a popular typesetting tool for circuits due to difficulty in coding them. Here I made an attempt by coding the small building blocks in a way to reuse them in building bigger circuits. I illustrated the approach followed in the following examples.
For every circuit/subcircuit, I tried to maintain uniformity in coding style. The main steps in coding a subcircuit are outlined here
- Define height and width of the figure using \figHt and \figWd variables
- Create grid while typesetting. Once done remove grid
- Assign the coordinates for the reference points
- Instantiate the components(R,L,C,MOS,BJT,etc.,)
- Interconnect the components
- Name the components, nodes, nets, etc.,
- Draw VDD and GND connections
To make a circuit using several subcircuits,
- Change the coordinates of the reference points
- Change the component names if required in each subcircuit to meet your circuit requirements
- Change VDD and GND connections in each circuit
- Make top level connection between different subcircuits
- Finally draw VDD and GND lines
For example I created a Two stage CMOS opamp from current mirror and differential pair subcircuits, where I exactly followed the above approach. I took around 15min to hook an opamp from the sub-circuits.