%
\newdimen{\leftwid}\setlength{\leftwid}{2in}
\newdimen{\libwid}\setlength{\libwid}{0.5in}
\newdimen\rightwid
\setlength{\rightwid}{\textwidth}
\addtolength{\rightwid}{-\leftwid}
\addtolength{\rightwid}{-\libwid}
%
\newbox\Defbox
\newcommand{\macrodef}[3]{\setbox\Defbox=\hbox{\tt #1}%
  \ifdim\wd\Defbox>\leftwid%
       \box\Defbox\hfill\break\hspace*{\leftwid}%
  \else\hbox to \leftwid{\box\Defbox\hfill}\fi%
  \hbox to \libwid{#2\hfill}\parbox[t]{\rightwid}%
   {\raggedright #3}\vspace{\parsep}\\}
%\begin{tabbing}
%\hspace{2.1in} \= darrow$\;$ \= \kill

\vspace{\abovedisplayskip}
\noindent
\macrodef{AND\_gate({\sl n},N)}
  {log}
  {basic `and' gate, 2 or {\sl n\/} inputs; N=negated input}
\macrodef{AND\_gen($n$,{\sl chars},[{\sl wid},[{\sl ht}]])}
  {log}
  {general AND gate: $n$=number of inputs $(0\leq n\leq 16)$;
           {\sl chars:}
           B=base and straight sides; A=Arc;
           [N]NE,[N]SE,[N]I,[N]N,[N]S=inputs or circles;
           [N]O=output; C=center }
\macrodef{AND\_ht}
  {log}
  {height of basic `and' and `or' gates in {\tt L\_unit}s}
\macrodef{AND\_wd}
  {log}
  {width of basic `and' and `or' gates in {\tt L\_unit}s}
\macrodef{BOX\_gate({\sl inputs,output,swid,sht,label})}
  {log}
  {output=[{\tt P|N}], inputs=[{\tt P|N}]$\ldots$, sizes swid and sht
  in {\tt L\_unit}s}
\macrodef{BUFFER\_gate({\sl linespec}, N)}
  {log}
  {basic buffer, 1 input or as a 2-terminal element, N=negated input}
\macrodef{BUFFER\_gen({\sl chars,wd,ht},[N|P]*,[N|P]*,[N|P]*)}
  {log}
  {general buffer, {\sl chars:} {\tt T}=triangle,
            {\tt [N]O}=output location {\tt Out}
            ({\tt NO} draws circle {\tt N\_Out});
            {\tt [N]I, [N]N, [N]S, [N]NE, [N]SE}
            input locations; {\tt C}=centre location.
            Args 4-6 allow alternative
            definitions of respective {\tt In, NE,}
            and {\tt SE} argument sequences }
\macrodef{BUF\_ht}
  {log}
  {basic buffer gate height in {\tt L\_unit}s}
\macrodef{BUF\_wd}
  {log}
  {basic buffer gate width in {\tt L\_unit}s}
\macrodef{Cos({\sl integer})}
  {gen}
  {cosine function, {\sl integer\/} degrees}
\macrodef{Cosine( {\sl amplitude}, {\sl freq}, {\sl time}, {\sl phase} )}
  {gen}
  {function $a\times\cos(\omega t + \phi)$ }
\macrodef{Darlington({\sl linespec},L|R,P)}
  {cct}
  {left or right, N- or P-type bipolar Darlington pair, internal locations
   E, B, C}
\macrodef{E\_}
  {gen}
  {the constant $e$}
\macrodef{Equidist3({\sl Pos1, Pos2, Pos3, Result})}
  {gen}
  {Calculates location named {\sl Result} equidistant from the first three
   positions, i.e.\ the centre of the circle passing through the three
   positions}
\macrodef{FF\_ht}
  {cct}
  {flipflop height parameter in {\tt L\_unit}s}
\macrodef{FF\_wid}
  {cct}
  {flipflop width parameter in {\tt L\_unit}s}
\macrodef{Fector(x1,y1,z1,x2,y2,z2)}
  {3D}
  {vector projected on current view plane with top face
   of 3-dimensonal arrowhead normal to x2,y2,z2 }
\macrodef{FlipFlop(D|T|RS|JK, {\sl label}, {\sl boxspec})}
  {log}
  {flip-flops,
  {\sl boxspec}=e.g.\ ht x wid y}
\macrodef{FlipFlop6({\sl label}, {\sl spec}, {\sl boxspec})}
  {log}
  {6-input flip-flops,
    {\sl spec}={\tt [[n]NQ][[n]Q][[n]CK][[n]PR][lb]}
    {\tt [[n]CLR][[n]S][[n].|D|T|R]} to include and negate pins,
    {\tt lb} to print labels }
\macrodef{FlipFlopJK({\sl label}, {\sl spec},{\sl boxspec})}
  {log}
  {JK flip-flop, spec similar to above}
\macrodef{G\_hht}
  {log}
  {gate half-height in {\tt L\_unit}s}
\macrodef{H\_ht}
  {log}
  {hysteresis symbol dimension in {\tt L\_unit}s}
\macrodef{Int\_}
  {gen}
  {corrected (old) gpic $int()$ function}
\macrodef{IOdefs({\sl linespec},{\sl label},[P|N]*,L|R) }
  {log}
  {Define locations {\sl label}{\tt 1}, $\ldots$ {\sl label}{\tt n}
    along the line; {\tt P}= label only;
    {\tt N}=with {\tt NOT\_circle};
    {\tt R}=circle to right of current direction }
\macrodef{Intersect\_({\sl Name1},{\sl Name2})}
  {gen}
  {intersection of two named lines}
\macrodef{LH\_symbol(U|D|L|R|degrees)}
  {log}
  {logic-gate hysteresis symbol}
\macrodef{Loopover\_(`{\sl variable}',{\sl actions},{\sl value1,
   value2, $\ldots$})}
  {gen}
  {Repeat {\sl actions} with {\sl variable} set successively to
   {\sl value1, value2, $\ldots$}}
\macrodef{LT\_symbol(U|D|L|R|degrees)}
  {log}
  {logic-gate triangle symbol}
\macrodef{L\_unit}
  {log}
  {logic-element grid size}
\macrodef{Max({\sl arg, arg, $\ldots$})}
  {gen}
  {Max of an arbitrary number of inputs}
\macrodef{Min({\sl arg, arg, $\ldots$})}
  {gen}
  {Min of an arbitrary number of inputs}
\macrodef{Mux({\sl n, label}, {\tt [L][T]})}
  {gen}
  {binary multiplexer, $n$ inputs,
    {\tt L} reverses pin numbers, {\tt T} puts Sel pin to top }
\macrodef{Mux\_ht}
  {cct}
  {Mux height parameter in {\tt L\_unit}s}
\macrodef{Mux\_wid}
  {cct}
  {Mux width parameter in {\tt L\_unit}s}
\macrodef{Mx\_pins}
  {log}
  {max number of gate inputs without wings}
\macrodef{NAND\_gate({\sl n},N)}
  {log}
  {`nand' gate, 2 or {\sl n\/} inputs; N=negated input}
\macrodef{NOR\_gate({\sl n},N)}
  {log}
  {`nor' gate, 2 or {\sl n\/} inputs; N=negated input}
\macrodef{NOT\_circle}
  {log}
  {`not' circle}
\macrodef{NOT\_gate({\sl linespec},N)}
  {log}
  {`not' gate, 1 input or as a 2-terminal element, N=negated input}
\macrodef{NOT\_rad}
  {log}
  {`not' radius in absolute units}
\macrodef{NXOR\_gate({\sl n},N)}
  {log}
  {`nxor' gate, 2 or {\sl n\/} inputs; N=negated input}
\macrodef{N\_diam}
  {log}
  {diameter of `not' circles in {\tt L\_unit}s}
\macrodef{N\_rad}
  {log}
  {radius of `not' circles in {\tt L\_unit}s}
\macrodef{OR\_gate({\sl n},N)}
  {log}
  {`or' gate, 2 or {\sl n\/} inputs; N=negated input}
\macrodef{OR\_gen($n$,{\sl chars},[{\sl wid},[{\sl ht}]])}
  {log}
  {general OR gate: $n$=number of inputs $(0\leq n\leq 16)$;
    {\sl chars:} B=base and straight sides; A=Arcs;
           [N]NE,[N]SE,[N]I,[N]N,[N]S=inputs or circles;
           [N]P=XOR arc; [N]O=output; C=center }
\macrodef{OR\_rad}
  {log}
  {radius of OR input face in {\tt L\_unit}s}
\macrodef{Point\_({\sl integer})}
  {gen}
  {sets direction cosines in degrees}
\macrodef{Rect\_({\sl radius},{\sl angle})}
  {gen}
  {(deg) polar-to-rectangular conversion}
\macrodef{Sin({\sl integer})}
  {gen}
  {sine function, {\sl integer\/} degrees}
\macrodef{View3D}
  {3D}
  {The view vector (triple) defined by {\tt setview({\sl azim, elev})}. The 
   {\tt project}
   macro projects onto the plane perpendicular to this vector}
\macrodef{Vperp({\sl position name}, {\sl position name})}
  {gen}
  {unit-vector pair CCW-perpendicular to line joining two named positions}
\macrodef{XOR\_gate({\sl n},N)}
  {log}
  {`xor' gate, 2 or {\sl n\/} inputs; N=negated input}
\macrodef{XOR\_off}
  {log}
  {XOR and NXOR offset of input face}
\macrodef{above\_}
  {gen}
  {string position above relative to current direction}
\macrodef{abs\_({\sl number})}
  {gen}
  {absolute value function}
\macrodef{adc({\sl width,height},nIn,nN,nOut,nS)}
  {cct}
  {ADC with defined width, height, and number of inputs {\tt In$i$},
    top terminals {\tt N$i$}, ouputs {\tt Out$i$},
    and bottom terminals~{\tt S$i$}}
\macrodef{amp({\sl linespec},{\sl size})}
  {cct}
  {amplifier}
\macrodef{along\_({\sl linear object name})}
  {gen}
  {short for {\tt between name.start and name.end}}
\macrodef{antenna(at {\sl location}, T, A|L|T|S|D|P|F, U|D|L|R|{\sl degrees})}
  {cct}
  {antenna, without stem for nonblank 2nd arg; {\tt A}=aerial,
    {\tt L}=loop, {\tt T}=triangle, {\tt S}=diamond, {\tt D}=dipole,
    {\tt P}=phased, {\tt F}=fork;
    up, down, left, right, or angle from horizontal (default -90) }
\macrodef{arca({\sl chord linespec}, ccw|cw, {\sl radius}, {\sl modifiers}) }
  {gen}
  {arc with acute angle (obtuse if radius is negative)}
\macrodef{arcd({\sl center},
  {\sl radius},{\sl start degrees},{\sl end degrees}) }
  {gen}
  {arc definition (see {\tt arcr}), angles in degrees}
\macrodef{arcr({\sl center},{\sl radius},{\sl start angle},{\sl end angle}) }
  {gen}
  {arc definition, e.g., {\tt arcr(A,r,0,pi\_/2) cw ->}}
\macrodef{arcto({\sl position 1},{\sl position 2},{\sl radius},[dashed|dotted])}
  {gen}
  {line toward position 1 with rounded corner toward position 2}
\macrodef{arrowline({\sl linespec})}
  {cct}
  {line (dotted, dashed permissible) with centred arrowhead}
\macrodef{b\_}
  {gen}
  {blue color value}
\macrodef{b\_current({\sl label},{\sl pos},In|Out,Start|End,{\sl frac})}
  {cct}
  {labelled branch-current arrow to {\sl frac} between branch end and body}
\macrodef{battery({\sl linespec},n,R)}
  {cct}
  {n-cell battery: default 1 cell,
  R=reversed polarity}
\macrodef{beginshade({\sl gray value})}
  {gen}
  {begin gray shading, see {\tt shade}
   e.g., {\tt beginshade(.5);} {\sl closed line specs}; {\tt endshade}}
\macrodef{bell( U|D|L|R|{\sl degrees}, {\sl size})}
  {cct}
  {bell, {\sl In1} to {\sl In3} defined}
\macrodef{below\_}
  {gen}
  {string position relative to current direction}
\macrodef{bi\_tr({\sl linespec},L|R,P,E)}
  {cct}
  {left or right, N- or P-type bipolar transistor, without or with envelope }
\macrodef{bi\_trans({\sl linespec},L|R,{\sl chars},E)}
  {cct}
  { bipolar transistor, core left or right; chars:
   {\tt BU}=bulk line,
   {\tt B}=base line and label,
   {\tt S}=Schottky base hooks,
   {\tt uEn|dEn}=emitters E0 to En,
   {\tt uE|dE}=single emitter,
   {\tt Cn|uCn|dCn}=collectors C0 to Cn; {\tt u} or {\tt d} add an arrow,
   {\tt C}=single collector; {\tt u} or {\tt d} add an arrow,
   {\tt G}=gate line and location,
   {\tt H}=gate line; {\tt L}=L-gate line and location,
   {\tt [d]D}=named parallel diode,
   {\tt d}=dotted connection,
   {\tt [u]T}=thyristor trigger line;
   arg 4 = E: envelope
   }
\macrodef{boxcoord({\sl planar obj},{\sl x fraction},{\sl y fraction})}
  {gen}
  {internal point in a planar object}
\macrodef{boxdim({\sl name},h|w|d|v,{\sl default})}
  {gen}
  {evaluate, e.g.\ {\sl name}{\tt \_w} if defined, else {\sl default\/}
   if given, else 0 {\tt v} gives sum of {\tt d} and {\tt h} values }
\macrodef{bp\_\_}
  {gen}
  {big-point-size factor, in scaled inches, ({\tt *scale/72})}
\macrodef{bswitch({\sl linespec}, [L|R],chars)}
  {cct}
  {pushbutton switch R=right orientation (default L=left);
     chars: O= normally open, C=normally closed }
\macrodef{buzzer( U|D|L|R|degrees, size,[C])}
  {cct}
  {buzzer, {\sl In1} to {\sl In3} defined, C=curved}
\macrodef{c\_fet({\sl linespec},L|R,P)}
  {cct}
  {left or right, plain or negated pin simplified MOSFET}
\macrodef{capacitor({\sl linespec},{\sl char}[+],R)}
  {cct}
  {capacitor, {\sl char}: F or none=flat plate, C=curved-plate,
    E=polarized boxed plates,
    K=filled boxed plates, P=alternate polarized; + adds a polarity sign;
    arg3:  R=reversed polarity}
\macrodef{cbreaker({\sl linespec}, L|R, D)}
  {cct}
  {circuit breaker to left or right, {\tt D}=dotted}
\macrodef{cct\_init}
  {cct}
  {initialize circuit-diagram environment}
\macrodef{centerline\_({\sl linespec, thickness{\tt|}color,
   minimum long dash len, short dash len, gap len}}
  {gen}
  {Technical drawing centerline}
\macrodef{cintersect({\sl Pos1, Pos2, rad1, rad2,} [R])}
  {gen}
  {Upper (lower if arg5={\tt R}) intersection of circles at
    {\sl Pos1} and {\sl Pos2}, radius {\sl rad1} and {\sl rad2}}
\macrodef{clabel({\sl label},{\sl label},{\sl label})}
  {cct}
  {centre triple label}
\macrodef{consource({\sl linespec},V|I|v|i,R)}
  {cct}
  {voltage or current controlled source with alternate forms;
   {\tt R}=reversed polarity}
\macrodef{corner({\sl line thickness,color})}
  {gen}
  {filled square to make square corner at line intersection}
\macrodef{contact(O|C,R)}
  {cct}
  {single-pole contact: default double pole or
    normally open or closed, {\tt R}=oriented right (default left)}
\macrodef{contline({\sl line})}
  {gen}
  {evaluates to {\tt continue}
    if processor is {\bf dpic}, otherwise to first arg (default {\tt line})}
\macrodef{cosd({\sl arg})}
  {gen}
  {cosine of an expression in degrees}
\macrodef{cross(at {\sl location})}
  {gen}
  {plots a small cross}
\macrodef{cross3D(x1,y1,z1,x2,y2,z2)}
  {3D}
  {cross product of two triples}
\macrodef{crossover({\sl linespec}, L|R, Line1, ...)}
  {cct}
  {line jumping left or right over named lines}
\macrodef{crosswd\_}
  {gen}
  {cross dimension}
\macrodef{csdim\_}
  {cct}
  {controlled-source width}
\macrodef{dac({\sl width,height},nIn,nN,nOut,nS)}
  {cct}
  {DAC with defined width, height, and number of inputs {\tt In$i$},
    top terminals {\tt N$i$}, ouputs {\tt Out$i$},
    and bottom terminals~{\tt S$i$}}
\macrodef{d\_fet({\sl linespec},L|R,P,S,E|S)}
  {cct}
  {left or right, N or P depletion MOSFET, normal or simplified,
    without or with envelope or thick channel}
\macrodef{dabove(at {\sl location})}
  {darrow}
  {above (displaced dlinewid/2)}
\macrodef{darrow({\sl linespec},
  t,t,{\sl width},{\sl arrowhd wd},{\sl arrowhd ht},
  {\tt <-} {\sl or} {\tt <-|} {\sl or} {\tt |})}
  {darrow}
  {double arrow, truncated at beginning or end, specified sizes,
    reversed arrowhead or closed stem}
\macrodef{darrow\_init}
  {darrow}
  {initialize darrow drawing parameters}
\macrodef{dashline({\sl linespec},{\sl thickness}|{\sl color}|<->,
                                  {\sl dash len, gap len},G)}
  {gen}
  {dashed line with dash at end ({\tt G} ends with gap)}
\macrodef{dbelow(at {\sl location})}
  {darrow}
  {below (displaced dlinewid/2)}
\macrodef{dcosine3D(i,x,y,z)}
  {3D}
  {extract i-th entry of triple x,y,z}
\macrodef{def\_bisect}
  {gen}
  {defines the pic procedure bisect ( func, xmin, xmax, eps, result )
   that finds a root of func(arg,value) to precision eps in the interval
   (xmin,xmax) by the method of bisection}
\macrodef{delay({\sl linespec},{\sl size})}
  {cct}
  {delay element}
\macrodef{delay\_rad\_}
  {cct}
  {delay radius}
\macrodef{deleminit\_}
  {darrow}
  {sets drawing direction for dlines}
\macrodef{dend(at {\sl location})}
  {darrow}
  {close (or start) double line}
\macrodef{diff3D(x1,y1,z1,x2,y2,z2)}
  {3D}
  {difference of two triples}
\macrodef{diff\_({\sl a},{\sl b})}
  {gen}
  {difference function}
\macrodef{dimen\_}
  {cct}
  {size parameter for circuit elements}
\macrodef{dimension\_({\sl linespec},{\sl offset},{\sl label},
    D|H|W|{\sl blank width},{\sl tic offset},{\sl arrowhead })}
  {gen}
  {macro for dimensioning diagrams;
      {\sl arrowhead=}{\tt -> | <-}}
\macrodef{diode({\sl linespec},B|CR|D|K|L|LE[R]|P[R]|S|T|V|v|Z,[R][E])}
  {cct}
  {diode: 
   {\tt B}=bi-directional,
   {\tt CR}=current regulator,
   {\tt D}=diac,
   {\tt K}=open form,
   {\tt L}=open form with centre line,
   {\tt LED[R]}=LED [right],
   {\tt P[R]}=photodiode [right],
   {\tt S}=Schottky,
   {\tt T}=tunnel,
   {\tt V}=varicap,
   {\tt v}=varicap (curved plate),
   {\tt Z}=zener;
   arg 4: {\tt R}=reversed polarity, {\tt E}=enclosure }
\macrodef{dir\_}
  {darrow}
  {used for temporary storage of direction by darrow macros}
\macrodef{distance({\sl Position 1}, {\sl Position2})}
  {gen}
  {distance between named positions}
\macrodef{direction\_(U|D|L|R|{\sl degrees}, {\sl default})}
  {gen}
  {sets current direction up, down, left, right, or angle in degrees}
\macrodef{distance({\sl position}, {\sl position})}
  {gen}
  {distance between positions}
\macrodef{dlabel({\sl long},{\sl lat},{\sl label},{\sl label},{\sl label})}
  {cct}
  {general triple label}
\macrodef{dleft}
  {darrow}
  {double line left turn}
\macrodef{dline({\sl linespec},t,t,{\sl width}, {\tt |-|} {\sl or} {\tt -|}
  {\sl or} {\tt |-})}
  {darrow}
  {double line, truncated by half width at either end, closed
    at either or both ends}
\macrodef{dlinewid}
  {darrow}
  {width of double lines}
\macrodef{dn\_}
  {gen}
  {down with respect to current direction}
\macrodef{dljust(at {\sl location})}
  {darrow}
  {ljust (displaced dlinewid/2)}
\macrodef{dn\_}
  {gen}
  {sets down relative to current-direction}
\macrodef{dna\_}
  {cct}
  {characters that determine which components are drawn}
\macrodef{dnm\_}
  {cct}
  {similar to dna\_}
\macrodef{dot(at {\sl location},{\sl radius},{\sl fill})}
  {gen}
  {filled circle (third arg= gray value: 0=black, 1=white)}
\macrodef{dot3D(x1,y1,z1,x2,y2,z2)}
  {3D}
  {dot product of two triples}
\macrodef{dotrad\_}
  {gen}
  {dot radius}
\macrodef{down\_}
  {gen}
  {sets current direction to down}
\macrodef{dright}
  {darrow}
  {double arrow right turn}
\macrodef{drjust(at {\sl location})}
  {darrow}
  {rjust (displaced dlinewid/2)}
\macrodef{dswitch({\sl linespec},L|R,W[ud]B[K]{\sl chars})}
  {cct}
  {SPST switch left or right, W=baseline, B=contact blade,
    dB=contact blade to the right of drawing direction,
         K=vertical closing contact line,
         C = external operating mechanism,
         D = circle at contact and hinge,
             (dD = hinge only, uD = contact only)
         E = emergency button,
         EL = early close
            (or late open),
         LE = late close (or early open),
         F = fused,
         H = time delay closing,
         uH = time delay opening,
         HH = time delay
             opening and closing,
         K = vertical closing contact,
         L = limit,
         M = maintained (latched),
         MM = momentary contact on make,
         MR = momentary contact on release,
         MMR = momentary contact
            on make and release,
         O = hand operation button,
         P = pushbutton,
         T = thermal control linkage,
         Y = pull switch,
         Z = turn switch
   }
\macrodef{dtee([L|R])}
  {darrow}
  {double arrow tee junction with tail to left,
   right, or (default) back along current direction }
\macrodef{dtor\_}
  {gen}
  {degrees to radians conversion constant}
\macrodef{dturn({\sl degrees ccw})}
  {darrow}
  {turn dline arg1 degrees left (ccw)}
\macrodef{e\_}
  {gen}
  {.e relative to current direction}
\macrodef{e\_fet({\sl linespec},L|R,P,S,E|S)}
  {cct}
  {left or right, N or P enhancement MOSFET, normal
   or simplified, without or with envelope or thick channel }
\macrodef{earphone( U|D|L|R|degrees, size)}
  {cct}
  {earphone, {\sl In1} to {\sl In3} defined}
\macrodef{ebox({\sl linespec},{\sl length},{\sl ht},{\sl fill value})}
  {cct}
  { two-terminal box element with adjustable dimensions and fill
   value 0 (black) to 1 (white) }
\macrodef{elchop({\sl E},{\sl A})}
  {gen}
  {{\tt chop} for ellipses: evaluates to {\tt chop} $r$ where $r$ is
    the distance from the centre of ellipse E to the intersection of E with
    a line to location A; e.g., {\tt line from A to E elchop(E,A)}}
\macrodef{eleminit\_({\sl linespec})}
  {cct}
  {internal line initialization}
\macrodef{elen\_}
  {cct}
  {default element length}
\macrodef{em\_arrows([N|I|E][D],{\sl angle,length})}
  {cct}
  {radiation arrows, N=nonionizing, I=ionizing, E=simple; D=dot}
\macrodef{endshade}
  {gen}
  {end gray shading, see {\tt beginshade}}
\macrodef{expe}
  {gen}
  {exponential, base $e$}
\macrodef{f\_box({\sl boxspecs},{\sl text},{\sl expr1},$\cdots$)}
  {gen}
  {like {\tt s\_box} but the text is overlaid on a box of identical size.
   If there is only one argument then the default box
   is invisible and filed white}
\macrodef{fill\_({\sl number})}
  {gen}
  {fill macro, 0=black, 1=white}
\macrodef{fitcurve(V,n,[e.g. dotted],m (default 0))}
  {gen}
  {Draw a spline through V[m],...V[n]: Works only with dpic (and $n-m>2$):
    V[m]:{\sl position}; ... V[n]:{\sl position}}
\macrodef{for\_({\sl start},{\sl end},{\sl increment},`{\sl actions}')}
  {gen}
  {integer for loop with index variable {\tt m4x}}
\macrodef{fuse({\sl linespec, type, wid, ht})}
  {cct}
  {fuse symbol, type$=$
  {\tt  A|B|C|D|S|HB|HC} or {\tt dA=D}}
\macrodef{g\_}
  {gen}
  {green color value}
\macrodef{gap({\sl linespec},{\sl fill},A)}
  {cct}
  {gap with (filled) dots, A=chopped arrow between dots}
\macrodef{gen\_init}
  {gen}
  {initialize environment for general diagrams (customizable)}
\macrodef{glabel\_}
  {cct}
  {internal general labeller}
\macrodef{gpar\_({\sl element},{\sl element},{\sl separation})}
  {cct}
  {two same-direction elements in parallel}
\macrodef{gpolyline\_({\sl fraction},{\sl location}, ...)}
  {gen}
  {internal to {\tt gshade}}
\macrodef{grid\_({\sl x},{\sl y})}
  {log}
  {absolute grid location}
\macrodef{ground(at {\sl location}, T, N|F|S|L|P|E, U|D|L|R|{\sl degrees})}
  {cct}
  { ground, without stem for nonblank 2nd arg;
    {\tt N}=normal, {\tt F}=frame, {\tt S}=signal, {\tt L}=low-noise,
    {\tt P}=protective, {\tt E}=European; up, down, left, right, or angle
    from horizontal (default -90) }
\macrodef{gyrator({\sl box specs,space ratio,pin lgth,}[N][V])}
  {cct}
  {Gyrator two-port wrapper for {\tt nport}, {\tt N} omits pin dots; {\tt V}
   gives a vertical orientation.}
\macrodef{gshade({\sl gray value},A,B,...,Z,A,B)}
  {gen}
  {(Note last two arguments).  Shade a polygon with named
    vertices, attempting to avoid sharp corners}
\macrodef{hoprad\_}
  {cct}
  {hop radius in crossover macro}
\macrodef{ht\_}
  {gen}
  {height relative to current direction}
\macrodef{ifdpic({\sl if true},{\sl if false})}
  {gen}
  {test if dpic has been specified as pic processor}
\macrodef{ifgpic({\sl if true},{\sl if false})}
  {gen}
  {test if gpic has been specified as pic processor}
\macrodef{ifinstr({\sl string},{\sl string},{\sl if true},{\sl if false})}
  {gen}
  {test if the second argument is a substring of the first argument}
\macrodef{ifmfpic({\sl if true},{\sl if false})}
  {gen}
  {test if mfpic has been specified as pic post-processor}
\macrodef{ifmpost({\sl if true},{\sl if false})}
  {gen}
  {test if MetaPost has been specified as pic post-processor}
\macrodef{ifpgf({\sl if true},{\sl if false})}
  {gen}
  {test if \TPGF~has been specified as pic post-processor}
\macrodef{ifpostscript({\sl if true},{\sl if false})}
  {gen}
  {test if Postscript ({\tt dpic -r}) has been specified as pic output format}
\macrodef{ifpstricks({\sl if true},{\sl if false})}
  {gen}
  {test if \PSTricks~has been specified as post-processor}
\macrodef{ifroff({\sl if true},{\sl if false})}
  {gen}
  {test if {\bf troff} or {\bf groff} has been specified as post-processor}
\macrodef{ifxfig({\sl if true},{\sl if false})}
  {gen}
  {test if Fig 3.2 ({\tt dpic -x}) has been specified as pic output format}
\macrodef{igbt({\sl linespec},L|R,[L][[d]D])}
  {cct}
  {left or right IGBT, L=alternate gate type, D=parallel diode,
   dD=dotted connections }
\macrodef{in\_\_}
  {gen}
  {absolute inches}
\macrodef{inductor({\sl linespec},W|L,{\sl n},M)}
  {cct}
  {inductor, arg2: narrow (default), W=wide, L=looped;
   arg3: {\sl n} arcs (default 4); arg4: M=magnetic core }
\macrodef{inner\_prod({\sl linear obj},{\sl linear obj})}
  {gen}
  {inner product of (x,y) dimensions of two linear objects}
\macrodef{integrator({\sl linespec},{\sl size})}
  {cct}
  {integrating amplifier}
\macrodef{intersect\_({\sl line1}.start,{\sl line1}.end,
{\sl line2}.start,{\sl line2}.end)}
  {gen}
  {intersection of two lines}
\macrodef{j\_fet({\sl linespec},L|R,P,E)}
  {cct}
  {left or right, N or P JFET, without or with envelope}
\macrodef{larrow({\sl label},{\tt ->|<-},{\sl dist})}
  {cct}
  {arrow {\sl dist} to left of last-drawn 2-terminal element}
\macrodef{lbox({\sl wid}, {\sl ht}, {\sl type})}
  {gen}
  {box oriented in current direction, type= e.g.\ dotted}
\macrodef{left\_}
  {gen}
  {left with respect to current direction}
\macrodef{length3D(x,y,z)}
  {3D}
  {Euclidean length of triple x,y,z}
\macrodef{lg\_bartxt}
  {log}
  {draws an overline over logic-pin text (except for xfig)}
\macrodef{lg\_pin({\sl location, logical name, pin label}, n|e|s|w[N|L|M][E],
    {\sl pinno, optlen})}
  {log}
  {comprehensive logic pin; {\tt n|e|s|w}=direction, {\tt N}=negated,
    {\tt L}=active low out, {\tt M}=active low in, {\tt E}=edge trigger}
\macrodef{lg\_pintxt}
  {log}
  {reduced-size text for logic pins}
\macrodef{lg\_plen}
  {log}
  {logic pin length in in {\tt L\_unit}s}
\macrodef{lin\_leng({\sl line-reference})}
  {gen}
  {calculate the length of a line}
\macrodef{linethick\_({\sl number})}
  {gen}
  {set line thickness in points}
\macrodef{ljust\_}
  {gen}
  {ljust with respect to current direction}
\macrodef{llabel({\sl label},{\sl label},{\sl label})}
  {cct}
  {triple label on left side of the element}
\macrodef{loc\_({\sl x}, {\sl y})}
  {gen}
  {location adjusted for current direction}
\macrodef{log10E\_}
  {gen}
  {constant $\log_{10}(e)$}
\macrodef{log\_init}
  {log}
  {initialize environment for logic diagrams (customizable)}
\macrodef{loge}
  {gen}
  {logarithm, base $e$}
\macrodef{lp\_xy}
  {log}
  {coordinates used by {\tt lg\_pin}}
\macrodef{lpop({\sl xcoord}, {\sl ycoord}, {\sl radius}, {\sl fill},
  {\sl zero ht})}
  {gen}
  {for lollipop graphs: filled circle with stem to (xcoord,zeroht)}
\macrodef{lswitch( {\sl linespec}, L|R, {\sl chars} )}
  {cct}
  {knife switch R=right orientation (default L=left); {\sl chars}=[O{\tt|}C][D] O= opening; C=closing; D=dots }
\macrodef{lt\_}
  {gen}
  {left with respect to current direction}
\macrodef{manhattan}
  {gen}
  {sets direction cosines for left, right, up, down}
\macrodef{memristor({\sl linespec, wid, ht})}
  {cct}
  {memristor element}
\macrodef{microphone( U|D|L|R|degrees, size)}
  {cct}
  {microphone, {\sl In1} to {\sl In3} defined}
\macrodef{mm\_\_}
  {gen}
  {absolute millimetres}
\macrodef{mosfet({\sl linespec},L|R,{\sl chars},E)}
  {cct}
  {MOSFET left or right, included components defined by characters, envelope.
   arg 3 chars:
      {\tt [u][d]B:} center bulk connection pin;
      {\tt D:} D pin and lead;
      {\tt E:} dashed substrate;
      {\tt F:} solid-line substrate;
      {\tt [u][d]G:} G pin to substrate at source;
      {\tt [u][d]H:} G pin to substrate at center;
      {\tt L:} G pin to channel (obsolete);
      {\tt [u][d]M:} G pin to channel; u: at drain end; d: at source end
      {\tt Pz:} parallel zener diode;
      {\tt Q:} connect B pin to S pin;
      {\tt R:} thick channel;
      {\tt [u][d]S:} S pin and lead u: arrow up; d: arrow down;
      {\tt [d]T:} G pin to center of channel d: not circle;
      {\tt X:} XMOSFET terminal;
      {\tt Z:} simplified complementary MOS
}
\macrodef{m4xpand({\sl arg})}
  {gen}
  {Evaluate the argument as a macro}
\macrodef{m4lstring({\sl arg1},{\sl arg2})}
  {gen}
  {expand {\sl arg1} if it begins
    with {\tt sprintf} or {\tt "}, otherwise {\sl arg2}}
\macrodef{m4\_arrow({\sl linespec},{\sl ht},{\sl wid})}
  {gen}
  {arrow with adjustable head, filled when possible}
\macrodef{m4xtract(`{\sl string1}',{\sl string2})}
  {gen}
  {delete {\sl string2} from {\sl string1}, return 1 if present}
\macrodef{n\_}
  {gen}
  {.n with respect to current direction}
\macrodef{ne\_}
  {gen}
  {.ne with respect to current direction}
\macrodef{neg\_}
  {gen}
  {unary negation}
\macrodef{norator({\sl linespec},{\sl width},{\sl ht})}
  {cct}
  { norator two-terminal element }
\macrodef{nport({\sl box spec{\tt ;}other commands,
nw,nn,ne,ns,space ratio,pin lgth,style, other commands})}
  {cct}
  {nport macro (default 2-port)}
\macrodef{nterm({\sl box spec{\tt ;}other commands,
nw,nn,ne,ns,pin lgth,style, other commands})}
  {cct}
  {n-terminal box macro (default three pins)}
\macrodef{nullator({\sl linespec},{\sl width},{\sl ht})}
  {cct}
  { nullator two-terminal element }
\macrodef{nw\_}
  {gen}
  {.nw with respect to current direction}
\macrodef{opamp({\sl linespec},{\sl label},{\sl label},{\sl size},{\sl chars},
other commands)}
  {cct}
  {operational amplifier with $-,$ $+$ or other internal labels,
    specified size. {\sl chars:} {\tt P=} add power connections,
    {\tt R=} swap In1, In2 labels,
    {\tt T=} truncated point.
    The first and last arguments allow added customizations }
\macrodef{open\_arrow({\sl linespec},{\sl ht},{\sl wid})}
  {gen}
  {arrow with adjustable open head}
\macrodef{par\_({\sl element},{\sl element},{\sl separation})}
  {cct}
  {two same-direction, same-length elements in parallel}
\macrodef{pc\_\_}
  {gen}
  {absolute points}
\macrodef{pi\_}
  {gen}
  {$\pi$}
\macrodef{pmod({\sl integer}, {\sl integer})}
  {gen}
  {+ve $\hbox{mod}(M,N)$ e.g., $\hbox{\tt pmod}(-3,5)=2$}
\macrodef{point\_({\sl angle})}
  {gen}
  {(radians) set direction cosines}
\macrodef{polar\_({\sl x},{\sl y})}
  {gen}
  {rectangular-to polar conversion}
\macrodef{potentiometer({\sl linespec},%
  {\sl cycles},{\sl fractional pos},{\sl length},$\cdots$)}
  {cct}
  {resistor with taps T1, T2, $\ldots$
    with specified fractional positions and lengths (possibly neg) }
\macrodef{print3D(x,y,z)}
  {3D}
  {write out triple for debugging}
\macrodef{prod\_({\sl a},{\sl b})}
  {gen}
  {binary multiplication}
\macrodef{project({\sl x},({\sl y},({\sl z})}
  {3D}
  {3D to 2D projection onto the plane perpendicular to the view vector with
   angles defined by {\tt setview({\sl azim, elev})}}
\macrodef{psset\_({\sl PSTricks settings})}
  {gen}
  {set PSTricks parameters}
\macrodef{ptrans({\sl linespec}, [R|L])}
  {cct}
  {pass transistor; {\tt L=} left orientation}
\macrodef{pt\_\_}
  {gen}
  {\TeX\ point-size factor, in scaled inches, ({\tt *scale/72.27})}
\macrodef{r\_}
  {gen}
  {red color value}
\macrodef{rarrow({\sl label,{\tt ->|<-},{\sl dist}})}
  {cct}
  {arrow {\sl dist} to right of last-drawn 2-terminal element}
\macrodef{rect\_({\sl radius},{\sl angle})}
  {gen}
  {(radians) polar-rectangular conversion}
\macrodef{relay(n,O|C,R)}
  {cct}
  {relay: n poles (default 1), default double throw or normally open
    or closed, {\tt R}=oriented to right (default left) of current direction}
\macrodef{resetrgb}
  {gen}
  {cancel {\tt r\_, g\_, b\_} color definitions}
\macrodef{resistor({\sl linespec},n|E,{\sl chars})}
  {cct}
  {resistor, n cycles (default 3), {\sl chars:} {\tt E}={\tt ebox},
    {\tt Q}=offset, {\tt H}=squared, {\tt R}=right-oriented }
\macrodef{resized({\sl factor},`{\sl macro name}',args)}
  {cct}
  {scale the element body size by {\sl factor}}
\macrodef{reversed(`{\sl macro name}',args)}
  {cct}
  {reverse polarity of 2-terminal element}
\macrodef{rgbdraw({\sl color triple}, {\sl drawing commands})}
  {gen}
  {color drawing for PSTricks, pgf, MetaPost postprocessors }
\macrodef{rgbfill({\sl color triple}, {\sl closed path})}
  {gen}
  {fill with arbitrary color}
\macrodef{right\_}
  {gen}
  {set current direction right}
\macrodef{rjust\_}
  {gen}
  {right justify with respect to current direction}
\macrodef{rlabel({\sl label},{\sl label},{\sl label})}
  {cct}
  {triple label on right side of the element}
\macrodef{rot3Dx({\sl radians},x,y,z)}
  {3D}
  {rotates x,y,z about x axis}
\macrodef{rot3Dy({\sl radians},x,y,z)}
  {3D}
  {rotates x,y,z about y axis}
\macrodef{rot3Dz({\sl radians},x,y,z)}
  {3D}
  {rotates x,y,z about z axis}
\macrodef{rotbox({\sl wid,ht,type})}
  {gen}
  {box oriented in current direction in {\tt [ ]} block;
   {\sl type}= e.g. {\tt dotted shaded "green".}  Defined
   internal locations: N, NE, E, SE, S, SW, W, NW. }
\macrodef{rotellipse({\sl wid,ht,type})}
  {gen}
  {ellipse oriented in current direction in {\tt [ ]} block;
   e.g. {\tt Point\_(45); rotellipse(,,dotted fill\_(0.9)).} Defined internal
   locations: N, S, E, W.}
\macrodef{round({\sl line thickness,{\tt at} location,color})}
  {gen}
  {filled circle for rounded corners}
\macrodef{rpoint\_({\sl linespec})}
  {gen}
  {set direction cosines}
\macrodef{rpos\_({\sl position})}
  {gen}
  {Here + {\sl position}}
\macrodef{rrot\_({\sl x, y, angle})}
  {gen}
  {\tt Here + vrot\_({\sl x, y, cos(angle), sin(angle))}}
\macrodef{rs\_box({\sl text},{\sl expr1},$\cdots$)}
  {gen}
  {like {\tt s\_box} but the text is rotated by {\tt text\_ang}
   (default 90) degrees}
\macrodef{rsvec\_({\sl position})}
  {gen}
  {Here + {\sl position}}
\macrodef{rt\_}
  {gen}
  {right with respect to current direction}
\macrodef{rtod\_}
  {gen}
  {constant, degrees/radian}
\macrodef{rtod\_\_}
  {gen}
  {constant, degrees/radian}
\macrodef{rvec\_({\sl x},{\sl y})}
  {gen}
  {location relative to current direction}
\macrodef{s\_}
  {gen}
  {.s with respect to current direction}
\macrodef{s\_box({\sl text},{\sl expr1},$\cdots$)}
  {gen}
  {generate dimensioned text string using {\tt\char92{}boxdims} from
    {\tt boxdims.sty}. Two or more args are passed to {\tt sprintf()} }
\macrodef{s\_dp({\sl name},{\sl default})}
  {gen}
  {depth of the most recent (or named) {\tt s\_box}}
\macrodef{s\_ht({\sl name},{\sl default})}
  {gen}
  {height of the most recent (or named) {\tt s\_box}}
\macrodef{s\_init({\sl name})}
  {gen}
  {initialize {\tt s\_box} string label to {\sl name} which should be unique}
\macrodef{s\_name}
  {gen}
  {the value of the last {\tt s\_init} argument}
\macrodef{s\_wd({\sl name},{\sl default})}
  {gen}
  {width of the most recent (or named) {\tt s\_box}}
\macrodef{sc\_draw({\sl dna string, chars, iftrue, iffalse})}
  {cct}
  {test if chars are in string, deleting chars from string}
\macrodef{scr({\sl linespec, chars, label})}
  {cct}
  {Wrapper to place thyristor as a two-terminal element with label given by
   the third argument}
\macrodef{se\_}
  {gen}
  {.se with respect to current direction}
\macrodef{setrgb({\sl red value, green value, blue value},[{\sl name}])}
  {gen}
  {define colour for lines and text, optionally named (default {\tt lcspec})}
\macrodef{setview({\sl azimuth degrees},{\sl elevation degrees})}
  {3D}
  {set projection viewpoint}
\macrodef{sfg\_init({\sl default line len, node rad, arrowhd len, arrowhd wid})}
  {cct}
  {initialization of signal flow graph macros}
\macrodef{sfgabove}
  {cct}
  {like above but with extra space}
\macrodef{sfgarc({\sl linespec},{\sl text},{\sl text justification},cw|ccw,
    {\sl height scale factor})}
  {cct}
  {directed arc drawn between nodes, with text label
    and a height-adjustment parameter }
\macrodef{sfgbelow}
  {cct}
  {like below but with extra space}
\macrodef{sfgline({\sl linespec},{\sl text},{\sl text justification})}
  {cct}
  {directed straight line chopped by node radius, with text label}
\macrodef{sfgnode(at {\sl location},{\sl text},above|below,{sl circle options})}
  {cct}
  {small circle default white interior, with text label. The default label
  position is inside if the diameter is bigger than {\tt textht} and
  {\tt textwid}; otherwise it is {\tt sfgabove.} Options such as fill or
  line thickness can be given.}
\macrodef{sfgself(at {\sl location}, U|D|L|R|{\sl degrees}, {\sl text}, 
    {\sl text justification}, cw|ccw, {\sl scale factor})}
  {cct}
  {self-loop drawn at angle {\sl angle} from a node,
     with text label and a size-adjustment parameter }
\macrodef{shade({\sl gray value},{\sl closed line specs})}
  {gen}
  {fill arbitrary closed curve}
\macrodef{shadebox({\sl box specification})}
  {gen}
  {box with edge shading}
\macrodef{sign\_({\sl number})}
  {gen}
  {sign function}
\macrodef{sinc({\sl number})}
  {gen}
  {the $\hbox{sinc}(x)$ function} 
\macrodef{sind({\sl arg})}
  {gen}
  {sine of an expression in degrees}
\macrodef{sinusoid({\sl amplitude, frequency, phase, tmin, tmax})}
  {gen}
  {draws a sinusoid over the interval $(t_{\hbox{\scriptsize min, max}}$}
\macrodef{source({\sl linespec},V|v|I|i|AC|F|G|Q|L|P|S|T|X|U|{\sl string},{\sl
      diameter},R)}
  {cct}
  {source, blank or voltage (2 types), current (2 types), AC,
   or type F, G, Q, L, X or labelled, P = pulse, U = square, R = ramp,
   S = sinusoid, T = triangle; R = reversed polarity }
\macrodef{sourcerad\_}
  {cct}
  {default source radius}
\macrodef{sp\_}
  {gen}
  {evaluates to medium space for gpic strings}
\macrodef{speaker( U|D|L|R|{\sl degrees},{\sl size},H)}
  {cct}
  {speaker, {\sl In1} to {\sl In7} defined; {\tt H}=horn}
\macrodef{sprod3D(a,x,y,z)}
  {3D}
  {scalar product of triple x,y,z by a}
\macrodef{sum3D(x1,y1,z1,x2,y2,z2)}
  {3D}
  {sum of two triples}
\macrodef{sum\_({\sl a},{\sl b})}
  {gen}
  {binary sum}
\macrodef{svec\_({\sl x},{\sl y})}
  {log}
  {scaled and rotated grid coordinate vector}
\macrodef{sw\_}
  {gen}
  {.sw with respect to current direction}
\macrodef{switch({\sl linespec},L|R,[C|O][D],[B|D])}
  {cct}
  {SPST switch (wrapper for bswitch, lswitch, and dswitch macros),
    arg2: R=right orientation (default L=left);
     if arg4=blank (knife switch): arg3 = [O{\tt|}C][D]
       O= opening, C=closing, D=dots;
     if arg4=B (button switch): arg3 = [O{\tt|}C]
       O=normally open, C=normally closed,
     if arg4=D: arg3 = same as for dswitch }
\macrodef{ta\_xy({\sl x, y})}
  {cct}
  {macro-internal coordinates adjusted for {\tt L|R}}
\macrodef{tgate({\sl linespec,} [B][R|L])}
  {cct}
  {transmission gate, {\tt B=} ebox type; {\tt L=} oriented left}
\macrodef{thicklines\_({\sl number})}
  {gen}
  {set line thickness in points}
\macrodef{thinlines\_({\sl number})}
  {gen}
  {set line thickness in points}
\macrodef{thyristor({\sl linespec},{\sl chars})}
  {cct}
  {thyristor, chars:
     D=Diode,
     A=Open diode,
     B=Bidirectional diode,
     C=Type IEC,
     E=Envelope,
     G=Full-size gate terminal,
     H=Gate at arrowhead centre,
     N=Anode gate,
     R=Right orientation,
     U=Adds centre line (to open diode),
     V=Arrowhead centre gate bar }
\macrodef{tline({\sl linespec},{\sl wid},{\sl ht}) }
  {cct}
  {transmission line, manhattan direction}
\macrodef{tr\_xy({\sl x, y})}
  {cct}
  {relative macro internal coordinates adjusted for {\tt L|R}}
\macrodef{tr\_xy\_init({\sl origin, unit size, sign })}
  {cct}
  {initialize {\tt tr\_xy}}
\macrodef{transformer({\sl linespec},L|R,np,[A][W|L],ns)}
  {cct}
  {2-winding transformer: left or right, np primary arcs,
    air core or wide or looped windings, ns secondary arcs }
\macrodef{ttmotor({\sl linespec, string, diameter, brushwid, brushht})}
  {cct}
  {motor with label}
\macrodef{twopi\_}
  {gen}
  {$2\pi$}
\macrodef{ujt({\sl linespec},R,P,E)}
  {cct}
  {unijunction transistor, right, P-channel, envelope}
\macrodef{unit3D(x,y,z)}
  {3D}
  {unit triple in the direction of triple x,y,z}
\macrodef{up\_}
  {gen}
  {set current direction up}
\macrodef{up\_\_}
  {gen}
  {up with respect to current direction}
\macrodef{variable(`{\sl element}',
  {\tt [A|P|L|[u]N][C|S]},{\sl angle},{\sl length})}
  {cct}
  {overlaid arrow or line to indicate variable 2-terminal element:
    {\tt A}=arrow, {\tt P}=preset,
    {\tt L}=linear, {\tt N}=nonlinear, {\tt C}=continuous, {\tt S}=setpwise }
\macrodef{vec\_({\sl x},{\sl y})}
  {gen}
  {position rotated with respect to current direction}
\macrodef{vlength({\sl x},{\sl y})}
  {gen}
  {vector length $\sqrt{x^2+y^2}$}
\macrodef{vperp({\sl linear object})}
  {gen}
  {unit-vector pair CCW-perpendicular to linear object}
\macrodef{vrot\_({\sl x},{\sl y},{\sl xcosine},{\sl ycosine})}
  {gen}
  {rotation operator}
\macrodef{vscal\_({\sl number},{\sl x},{\sl y})}
  {gen}
  {vector scale operator}
\macrodef{w\_}
  {gen}
  {.w with respect to current direction}
\macrodef{wid\_}
  {gen}
  {width with respect to current direction}
\macrodef{winding(L|R, {\sl diam, pitch, turns, core wid, core color})}
  {cct}
  {core winding drawn in the current direction; {\tt R}=right-handed}
\macrodef{xtal({\sl linespec})}
  {cct}
  {quartz crystal}
\macrodef{xtract({\sl string, substring})}
  {gen}
  {returns substring if present}
%  \end{tabbing}
