Home
>
Examples
These diagrams are in svg format, obtained by first
producing pdf using pdflatex and then converting using dvisvgm --pdf.
The pdf equivalent can be found in
examples.pdf.
Sources for producing similar figures as svg using dpic -v without
invoking LaTeX or equivalent can be found in examples/dpv of
the the distribution or
here.
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 diagram](quick.svg)
quick.m4
:
The quick-start example from the manual
![Resistors diagram](Resistors.svg)
Resistors.m4
:
Resistors, showing some variations and the ebox
![Capacitors diagram](Capacitors.svg)
Capacitors.m4
:
Capacitors
![Inductors diagram](Inductors.svg)
Inductors.m4
:
Inductors
![Diodes diagram](Diodes.svg)
Diodes.m4
:
Diodes: appending a K to the second argument
draws an open arrowhead
![Emarrows diagram](Emarrows.svg)
Emarrows.m4
:
Radiation arrows
![Variable diagram](Variable.svg)
Variable.m4
:
Arrows and marks for showing variability
![Sources diagram](Sources.svg)
Sources.m4
:
Sources and source-like elements
![AmpTable diagram](AmpTable.svg)
AmpTable.m4
:
Macros amp, delay, and integrator
![Fuses diagram](Fuses.svg)
Fuses.m4
:
Macros fuse, cbreaker, and jumper
![Arresters diagram](Arresters.svg)
Arresters.m4
:
The arrester macro
![MoreTable diagram](MoreTable.svg)
MoreTable.m4
:
Additional two-terminal elements
![Grounds diagram](Grounds.svg)
Grounds.m4
:
Ground symbols
![Antennas diagram](Antennas.svg)
Antennas.m4
:
Antenna symbols
![Switches diagram](Switches.svg)
Switches.m4
:
The switch macros; switch(,,,L|B|D) is a wrapper
for lswitch, bswitch, and dswitch
![Opamp diagram](Opamp.svg)
Opamp.m4
:
The opamp
![Audio diagram](Audio.svg)
Audio.m4
:
Audio elements
![Xform diagram](Xform.svg)
Xform.m4
:
Some variations of the transformer element, drawing direction down
![NPDT diagram](NPDT.svg)
NPDT.m4
:
Double throw with the NPDT macro
![Contact diagram](Contact.svg)
Contact.m4
:
A non-exhaustive sampling of contact macro variations
![Contacts diagram](Contacts.svg)
Contacts.m4
:
The contacts macro
![relaycoil diagram](relaycoil.svg)
relaycoil.m4
:
The relaycoil macro
![Relay diagram](Relay.svg)
Relay.m4
:
Some variants of relay
![Jack diagram](Jack.svg)
Jack.m4
:
The jack and plug macros
![Conn diagram](Conn.svg)
Conn.m4
:
The tstrip, ccoax, tconn, and tbox macros
![Pconn diagram](Pconn.svg)
Pconn.m4
:
The pconnex macro
![cbresistor diagram](cbresistor.svg)
cbresistor.m4
:
Color-coded through-hole resistors. All are
10 percent tolerance except the last,
which illustrates 5 percent
![EVplugs diagram](EVplugs.svg)
EVplugs.m4
:
Electric vehicle charging plug patterns make extensive
use of key=value pairs to set options
![Headers diagram](Headers.svg)
Headers.m4
:
The Header macro
![Connectors diagram](Connectors.svg)
Connectors.m4
:
Some connectors with simple geometry and lists of labels
![Chips diagram](Chips.svg)
Chips.m4
:
IC package outlines and examples
![fet diagram](fet.svg)
fet.m4
:
FETs, showing programmable components and example customizations
![ujt diagram](ujt.svg)
ujt.m4
:
UJT examples
![thyristor diagram](thyristor.svg)
thyristor.m4
:
Thyristor examples. The thyristor is a 3- or 4-terminal
composite element
![Bip diagram](Bip.svg)
Bip.m4
:
Bipolar transistors (drawing direction: up)
![Tgate diagram](Tgate.svg)
Tgate.m4
:
The tgate and ptrans elements
![Nport diagram](Nport.svg)
Nport.m4
:
The nport and nterm macros
![NLG diagram](NLG.svg)
NLG.m4
:
Some customizations of nport
![Windings diagram](Windings.svg)
Windings.m4
:
The macro
winding(L|R,diam,pitch,turns,core wid,core color)
![ex01 diagram](ex01.svg)
ex01.m4
:
Two simple labeled circuits
![Optoiso diagram](Optoiso.svg)
Optoiso.m4
:
Optical isolator: a circuit with right or left orientation
![pwrsupply diagram](pwrsupply.svg)
pwrsupply.m4
:
An elementary power supply circuit with colored elements,
and a multiple-winding transformer with 3-phase rectifier
![PS50 diagram](PS50.svg)
PS50.m4
:
An unregulated 50V power supply
![Reg723 diagram](Reg723.svg)
Reg723.m4
:
A 723 regulator circuit with a heat sink
![Mixer diagram](Mixer.svg)
Mixer.m4
:
A balanced mixer, using mosfet and a custom transformer
![PushPull diagram](PushPull.svg)
PushPull.m4
:
A push-pull mixer, showing FETs with multiple gates
![Quantum diagram](Quantum.svg)
Quantum.m4
:
A quantum circuit and a
superconducting quantum interface device (drawing direction down)
![Sixpole diagram](Sixpole.svg)
Sixpole.m4
:
A six-pole filter
![ex18 diagram](ex18.svg)
ex18.m4
:
Precision half-wave rectifier and a tunnel diode circuit
(illustrating opamp, diode, resistor, ground, and labels)
![ex10 diagram](ex10.svg)
ex10.m4
:
Non-planar graph and bistable circuit
(illustrating the crossover macro and colored elements)
![Three diagram](Three.svg)
Three.m4
:
Three-phase oscillator
![MC diagram](MC.svg)
MC.m4
:
A three-phase switched AC-AC converter and a DC-DC converter
![ex12 diagram](ex12.svg)
ex12.m4
:
A CMOS NAND gate, a test circuit, and an XMOSFET example
![TTLnand diagram](TTLnand.svg)
TTLnand.m4
:
TTL NAND gate illustrating a transistor with multiple emitters
![I2L diagram](I2L.svg)
I2L.m4
:
Gate circuit and equivalent embedded I2L components
illustrating multiple collectors
![Schottky diagram](Schottky.svg)
Schottky.m4
:
A 4-input NAND circuit illustrating the S (Schottky)
option of bi_trans
![ex11 diagram](ex11.svg)
ex11.m4
:
Transistor radio audio chain
![LT3724 diagram](LT3724.svg)
LT3724.m4
:
IC controller and auxiliary elements of a step-down converter
![ex04 diagram](ex04.svg)
ex04.m4
:
Labels on non-manhattan elements
![Drive diagram](Drive.svg)
Drive.m4
:
Synchronous machine driven by variable-speed drive and rectifier
![Csource diagram](Csource.svg)
Csource.m4
:
Realization of a controlled source
(illustrating stacked element labels)
![ex16 diagram](ex16.svg)
ex16.m4
:
A rate 1/2 binary convolutional coder and its state diagram
![ex03 diagram](ex03.svg)
ex03.m4
:
Digital filter
![MotorControl diagram](MotorControl.svg)
MotorControl.m4
:
Motor control connections
![OneLine diagram](OneLine.svg)
OneLine.m4
:
Single line distribution diagram
![Heathkit diagram](Heathkit.svg)
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 diagram](lcct.svg)
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
![UNO diagram](UNO.svg)
UNO.m4
:
An Arduino UNO circuit adapted and redrawn
![Tubediags diagram](Tubediags.svg)
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 diagram](sfg.svg)
sfg.m4
:
Signal-flow graphs
![Logic diagram](Logic.svg)
Logic.m4
:
Basic logic gates
![ex08 diagram](ex08.svg)
ex08.m4
:
General-purpose latch: a small logic circuit
![Decoder diagram](Decoder.svg)
Decoder.m4
:
Decoder logic, constructed using the for_ macro
![ex21 diagram](ex21.svg)
ex21.m4
:
Some flip-flops
![Multiplexer diagram](Multiplexer.svg)
Multiplexer.m4
:
Multiplexer
![Demultiplexer diagram](Demultiplexer.svg)
Demultiplexer.m4
:
Demultiplexer
![ShiftR diagram](ShiftR.svg)
ShiftR.m4
:
A 5-bit shift register drawn using a custom flip-flop
![Adder diagram](Adder.svg)
Adder.m4
:
A full adder and a cascade of n-bit adders
![CanLogic diagram](CanLogic.svg)
CanLogic.m4
:
A way of automatically drawing two-layer logic diagrams
![Alogix diagram](Alogix.svg)
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 diagram](ABlogix.svg)
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 diagram](XOR.svg)
XOR.m4
:
Realizations of the XOR function using Autologix
![EEP diagram](EEP.svg)
EEP.m4
:
A test of single-line diagram macros
![ex05 diagram](ex05.svg)
ex05.m4
:
Use of darrow and Darc
![GrayCode diagram](GrayCode.svg)
GrayCode.m4
:
The power of looping and branching:
Gray code 10-bit encoder disk pattern and a crossbar switch
![control diagram](control.svg)
control.m4
:
Control-system block diagrams
![Byte diagram](Byte.svg)
Byte.m4
:
Elementary splines
![Sevensegment diagram](Sevensegment.svg)
Sevensegment.m4
:
A customizable seven-segment display showing the
numbered segments, a custom shape, and the numerals from 0 to 9
![Rotbox diagram](Rotbox.svg)
Rotbox.m4
:
The macro
rotbox(wid,ht,type,[r|t=val])
draws a box in the current direction
![Shadowed diagram](Shadowed.svg)
Shadowed.m4
:
Embellishments: the top row illustrates
shadowed(box|circle|ellipse|line,[at position],keys)
and the second row
ColoredV(box|circle|ellipse,(r,g,b)|((colorseq)),attributes)
![Loglog diagram](Loglog.svg)
Loglog.m4
:
A graph and crosshatching example drawn using the pic language
![Geometry diagram](Geometry.svg)
Geometry.m4
:
Some geometrical constructions
![Smithchart diagram](Smithchart.svg)
Smithchart.m4
:
A Smith chart
![ex09 diagram](ex09.svg)
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.
![Plate diagram](Plate.svg)
Plate.m4
:
Dimensioning with tolerances
![random diagram](random.svg)
random.m4
:
Testing random number generation using
dpic macro randn(array name, n, mean, std dev)
which calls pic built-in rand()
![exp diagram](exp.svg)
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 diagram](graysurf.svg)
graysurf.m4
:
Plotting surfaces using gray scales
![shapes diagram](shapes.svg)
shapes.m4
:
Basic shapes
![csc diagram](csc.svg)
csc.m4
:
Conestoga Sailing Club (illustrating the filling of arbitrary
shapes) and an antique clock face with shading and rotated text
![rose diagram](rose.svg)
rose.m4
:
The left object, used for testing dipic, is redrawn from
a detail of the set design for the musical Dracula. This
consumes much LaTeX main memory but can be produced directly
as pdf using dpic -d, as svg using dpic -v,
or as postscript using dpic -r since no text formatting
is required. The right object adjusts the size of dots to produce
a halftone effect
![diamond diagram](diamond.svg)
diamond.m4
:
Variations on M. Goossens, S. Rahtz, and F. Mittelbach,
The LaTeX Graphics Companion, Addison-Wesley 1997, pp. 57-58
![worm diagram](worm.svg)
worm.m4
:
An exercise in calculating RGB colours
![Buttons diagram](Buttons.svg)
Buttons.m4
:
Shading in color
![keyboard diagram](keyboard.svg)
keyboard.m4
:
This diagram has been produced as svg with dpic -v
(then converted to pdf for inclusion in examples.pdf)
![Dini diagram](Dini.svg)
Dini.m4
:
Dini surface, an icosahedron, and a sphere with inscribed cylinder
![Sierpinski diagram](Sierpinski.svg)
Sierpinski.m4
:
The Sierpinski triangle and a Cayley graph:
tests of pic macro recursion
![Escher diagram](Escher.svg)
Escher.m4
:
Penrose stairs and an Escher-like object
![recycle diagram](recycle.svg)
recycle.m4
:
Modest repetition and partial fill
![ex15 diagram](ex15.svg)
ex15.m4
:
Simple diagrams that are easily drawn by looping
![Crow diagram](Crow.svg)
Crow.m4
:
Illustrating shadebox and a custom crowfoot line termination
![Flow diagram](Flow.svg)
Flow.m4
:
A flowchart sampler
![Btree diagram](Btree.svg)
Btree.m4
:
Trees
![Incleps diagram](Incleps.svg)
Incleps.m4
:
Overlaying a figure with line graphics
Dwight Aplevich
Contact the author: last name at domain
Domain: uwaterloo.ca
See the
README
file for information about sources, manuals, installation,
integration with other tools, and output formats.
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.