These diagrams are in .png format.
Pdf
and
svg
versions are also available.
The PDF equivalent can be found in examples.pdf of the distribution.
Click on the link to view the source of each diagram.
Read the manual
Circuit_macros.pdf
for a complete explanation.
Browse and enjoy!

quick.m4
:
The quick-start example from the manual

CctTable.m4
:
Two-terminal elements, showing some variations

Diodes.m4
:
Diodes: a K in the second argument draws an open arrowhead

Emarrows.m4
:
Radiation arrows

Sources.m4
:
Sources and source-like elements

Variable.m4
:
Arrows and marks indicating variability

AmpTable.m4
:
Macros amp, delay, and integrator

Fuses.m4
:
Macros fuse and cbreaker

Switches.m4
:
The switch macros; switch(,,,L|B|D) is a wrapper
for lswitch, bswitch, and dswitch

Grounds.m4
:
Ground symbols

Antennas.m4
:
Antenna symbols

Audio.m4
:
Audio elements

Opamp.m4
:
The opamp

Xform.m4
:
The transformer element, drawing direction down

NPDT.m4
:
Double throw with the NPDT macro

Relay.m4
:
The contact and relay macros

Jack.m4
:
The jack and plug macros

Conn.m4
:
The tstrip, ccoax, tconn, and tbox macros

Pconn.m4
:
The pconnex macro

Headers.m4
:
The Header macro

fet.m4
:
FETs, showing programmable components and example customizations

ujt.m4
:
UJT examples

thyristor.m4
:
Thyristor examples

Bip.m4
:
Bipolar transistors (drawing direction: up)

Tgate.m4
:
The tgate and ptrans elements

Nport.m4
:
The nport and nterm macros

NLG.m4
:
Some customizations of nport

Windings.m4
:
The macro
winding(L|R,diam,pitch,turns,core wid,core color)

ex01.m4
:

Timer.m4
:
Two simple labeled circuits

ex02.m4
:
Elements at obtuse angles

Optoiso.m4
:
Optical isolator: a circuit with right or left orientation

Mixer.m4
:
A balanced mixer, using mosfet and a custom transformer

PushPull.m4
:
A push-pull mixer, showing FETs with multiple gates

Quantum.m4
:
A quantum circuit

SQUID.m4
:
Superconducting quantum interface device (drawing direction down)

Sixpole.m4
:
A six-pole filter

ex18.m4
:
Precision half-wave rectifier and a tunnel diode circuit
(illustrating opamp, diode, resistor, ground, and labels)

MC.m4
:
A three-phase switched AC-AC converter

ex10.m4
:
Non-planar graph and bistable circuit
(illustrating the crossover macro and colored elements)

Three.m4
:
Three-phase oscillator

ex17.m4
:
A repetitive network created by Pic looping and
a skewed circuit used to test the macro parallel_

ex12.m4
:
A CMOS NAND gate, a test circuit, and an XMOSFET example

pwrsupply.m4
:
An elementary power supply circuit with colored elements,
and a multiple-winding transformer with 3-phase rectifier

TTLnand.m4
:
TTL NAND gate illustrating a transistor with multiple emitters

I2L.m4
:
Gate circuit and equivalent embedded I2L components
illustrating multiple collectors

Schottky.m4
:
A 4-input NAND circuit illustrating the S (Schottky)
option of bi_trans

ex11.m4
:
Transistor radio audio chain

ex04.m4
:
Labels on non-manhattan elements

Csource.m4
:
Realization of a controlled source
(illustrating stacked element labels)

Drive.m4
:
Synchronous machine driven by variable-speed drive and rectifier

ex16.m4
:
A rate 1/2 binary convolutional coder and its state diagram

ex03.m4
:
Digital filter

MotorControl.m4
:
Motor control connections

Rectifiers.m4
:
Rectifier circuits and waveforms

Heathkit.m4
:
The power supply of a Heathkit AR-15 (Now, that
was a receiver!) with custom transformer and other elements,
drawn on a grid (partially shown) to aid in placement

lcct.m4
:
A digital circuit of moderate size,
redrawn from M. P. Maclenan and G. M. Burns,
"An Approach to Drawing Circuit Diagrams for Text Books,"
Tugboat (12)1, March 1991, pp. 66-69

Tubediags.m4
:
Electron-tube diagrams: a few bottom-view base diagrams,
a generic triode test circuit, and a 25-watt audio amplifier adapted
from F. Langford-Smith, Radiotron Designer's Handbook, fourth
edition, Harrison, NJ: Radio Corporation of America, 1952

sfg.m4
:
Signal-flow graphs

Logic.m4
:
Basic logic gates

ex08.m4
:
General-purpose latch: a small logic circuit

Decoder.m4
:
Decoder logic, constructed using the for_ macro

ex21.m4
:
Some flip-flops

Multiplexer.m4
:
Multiplexer

Demultiplexer.m4
:
Demultiplexer

ShiftR.m4
:
A 5-bit shift register drawn using a custom flip-flop

Adder.m4
:
A full adder and a cascade of n-bit adders

CanLogic.m4
:
A way of automatically drawing two-layer logic diagrams

Alogix.m4
:
The Autologix(Boolean expression;
Boolean expression... , options)
macro automatically draws Boolean expressions in function notation.
The function tree is drawn, then a row or column of inputs, then
the connections. The default result is on the left,
a custom element at the top, and a tree of gates only is shown
on the right.

ABlogix.m4
:
The Autologix macro can draw inputs on the left but
the added drawing complexity may require hand tuning with
second-argument options: L puts the inputs on the left,
R reverses their order, V scans the input arguments
in reverse order, and offset=value displaces the array
of inputs

XOR.m4
:
Realizations of the XOR function using Autologix

ex00.m4
:
Line diagrams

control.m4
:
Control-system block diagrams that do not require m4

GrayCode.m4
:
Gray code 10-bit encoder disk pattern

Crossbar.m4
:
A crossbar switch

Byte.m4
:
Elementary splines

Rotbox.m4
:
The macro
rotbox(wid,ht,type,[r|t=val])
draws a box in the current direction

ex06.m4
:
Crosshatching by for loops

ex09.m4
:
Illustrating the macro
dimension_(linespec, offset, label,
D|H|W|blank width, tic offset,<-|->).
A negative second argument implies an offset to the right of the
linespec direction. A label starting with " or
sprintf is copied literally. If label is an
s_box(...) then setting argument 4 to H, W, or
D tailors the blank width to the s_box height, width, or
diagonal respectively; i.e., W is equivalent to
s_wd+textoffset*2.
The macro arcdimension_ is similar but the first argument
specifies the arc to be dimensioned and the second argument is
the outward radial offset of the dimension arrow arc.

ex05.m4
:
Use of darrow

Loglog.m4
:
A graph drawn using the pic language

random.m4
:
Testing random numbers

exp.m4
:
Test of project and other lib3D
macros, showing the projection of a solid onto
the y1,z1 plane by sighting along the x1 axis.

graysurf.m4
:
Plotting surfaces using gray scales. A sort algorithm
determines plotting order

shapes.m4
:
Basic shapes

csc.m4
:
Conestoga Sailing Club (illustrating the filling of arbitrary
shapes)

rose.m4
:
Redrawn from a detail of the set design for the musical
Dracula, used for testing dpic. This diagram
consumes much LaTeX main memory but can be produced
directly as pdf using dpic -d,
as svg using dpic -g,
or as postscript using dpic -r
since no text formatting is required

diamond.m4
:
Variations on M. Goossens, S. Rahtz, and F. Mittelbach,
The LaTeX Graphics Companion, Addison-Wesley 1997, pp. 57-58

worm.m4
:
An exercise in calculating RGB colours

Buttons.m4
:
Shading in color

Dini.m4
:
Dini surface

Sierpinski.m4
:
The Sierpinski triangle and a Cayley graph:
tests of pic macro recursion

recycle.m4
:
Modest repetition and partial fill

ex15.m4
:
Simple diagrams that are easily drawn by looping

Counting.m4
:
An example of enumeration

Crow.m4
:
Illustrating shadebox and a custom crowfoot line termination

Flow.m4
:
A flowchart sampler

Btree.m4
:
A binary tree

Ttree.m4
:
Another tree

Incleps.m4
:
Overlaying a figure with line graphics
Dwight Aplevich
Contact the author: last name at domain
Domain: uwaterloo.ca
Examples and hints by Alan Robert Clark:
Using Circuit Macros
For more examples in the context of textbooks, see:
J. Dwight Aplevich,
The Essentials of Linear State-Space Systems,
New York: John Wiley & Sons Inc., 2000,
or
Gordon C. Andrews, J. Dwight Aplevich, Roydon A. Fraser, Carolyn G. MacGregor,
Introduction to Professional Engineering in Canada,
(fifth edition)
Toronto: Prentice Hall, Pearson Education Canada, Inc., 2018.
Circuit_macros home page.