summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex')
-rw-r--r--Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex424
1 files changed, 201 insertions, 223 deletions
diff --git a/Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex b/Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex
index 934e7813d74..f89fe710fe7 100644
--- a/Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex
+++ b/Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex
@@ -121,19 +121,10 @@ concepts applied here do not require \Mfour.
Read this section to understand basic usage of \Mfour and macros.
The contents of file {\tt quick.m4} and resulting diagram are shown in
\FR{quick} to illustrate the language
-% to show several ways for placing circuit elements,
-%and to provide sufficient information for producing
and the production of basic labeled circuits.
\begin{figure}[ht]
\parbox{\textwidth}{\small\verbatiminput{quick.m4}}%
\hfill\llap{\raise-1.15in\hbox{\input quick }}%
-% \hfill\llap{\raise-1.15in\hbox{\pdftooltip{\input quick }%
-% {The file {\tt quick.m4} and resulting diagram.
-% There are several ways of drawing the same picture; for example,
-% nodes (such as {\tt Origin}) can be defined and circuit branches
-% drawn between them; or absolute coordinates can be used (e.g.,
-% {\tt source(up\_ from (0,0) to (0,0.75))} ). Element sizes and styles
-% can be varied as described in later sections.}}}%
\vspace*{-\baselineskip}%
\caption{The file {\tt quick.m4} and resulting diagram.
There are several ways of drawing the same picture; for example,
@@ -189,6 +180,7 @@ and invoke the {\tt-g} option of \dpic as follows:
dpic -g quick.pic > quick.tex
\vspace*\parsep}
+\enlargethispage{\baselineskip}
A configuration file ({\tt pstricks.m4} and {\tt pgf.m4} in the
above examples) is {\em always} the first file to be given to \Mfour.
Put the following or its equivalent in the document body:
@@ -210,18 +202,19 @@ The essential line is \verb|\input quick| whether or not the {\tt figure}
environment is used.
The effect of the \Mfour command above is shown in \FR{ConfigA}.
+\begin{figure}[H]
+% \vspace*{-\baselineskip}
+ \input ConfigA
+ \caption{The command
+ {\tt m4 pstricks.m4 quick.m4 > quick.pic}.
+ \label{ConfigA}}
+ \end{figure}
Configuration files {\tt pstricks.m4} or {\tt pgf.m4}
cause library {\tt libgen.m4}
to be read, thereby defining the macro {\tt cct\_init}.
The diagram source file is then read and
the circuit-element macros in {\tt libcct.m4} are defined during
expansion of {\tt cct\_init}.
-\begin{figure}[ht]
- \input ConfigA
- \caption{The command
- {\tt m4 pstricks.m4 quick.m4 > quick.pic}.
- \label{ConfigA}}
- \end{figure}
\subsubsection{Processing with \gpic\label{Processingwithgpic:}}
If your printer driver understands \tpic specials and
@@ -270,31 +263,16 @@ The \Mfour commands illustrated above can be shortened to
\noindent
by inserting {\tt include(pstricks.m4)} (assuming \PSTricks processing)
-%or {\tt include(libgen.m4)} (assuming the default processor is to be used)
{\em immediately} after the {\tt .PS} line, the effect of which
-%The effect of the first include statement
is shown in \FR{ConfigB}.
However, if you then want to use \TPGF,
the line must be changed to {\tt include(pgf.m4)}.
-%and the second in \FR{ConfigC}.
\begin{figure}[h!]
\input{ConfigB}
\caption{The command {\tt m4 quick.m4 > quick.pic},
with {\tt include(pstricks.m4)} preceding {\tt cct\_init}.}
\label{ConfigB}
\end{figure}
-%\begin{figure}[h!]
-% \input{ConfigC}
-% \caption{The command {\tt m4 quick.m4 > quick.pic},
-% with {\tt include(libgen.m4)} preceding {\tt cct\_init}, causing
-% the default configuration file to be read.}
-% \label{ConfigC}
-% \end{figure}
-
-%\item
-%On some systems, setting the environment variable {\tt M4PATH} to {\sl
-%installdir} allows the {\tt -I} {\sl installdir} option of \Mfour to
-%be omitted, but it will be kept in following examples.
\item
In the absence of a need to examine the file {\tt quick.pic},
@@ -784,7 +762,7 @@ The first part of the source file for this figure is
%as follows:
on the left:
-\begin{figure}[ht]
+\begin{figure}[H]
\parbox{2in}{\tt .PS\\ \hbox{}\quad cct\_init\\ \hbox{}\quad linewid = 2.0\\
\hbox{}\quad linethick\_(2.0)\\ R1: resistor}
\raisebox{-0.3in}{\hbox{\input{BigResistor.tex}}}
@@ -904,7 +882,7 @@ directional parameters to point up.
Capacitors are illustrated in \FR{Capacitors}.
See \SR{Composite:} for the {\tt variable} macro.
-\begin{figure}[h!t]
+\begin{figure}[H]
\input CapacitorsMan
\caption{The {\tt capacitor({\sl linespec, chars,} [R],{\sl height, width})}
macro, and an example application of the {\tt variable} macro.}
@@ -912,7 +890,7 @@ See \SR{Composite:} for the {\tt variable} macro.
\end{figure}
Basic inductors are illustrated in \FR{Inductors}.
-\begin{figure}[h!]
+\begin{figure}[H]
\input InductorsMan
\caption{Basic inductors created with the
{\tt inductor({\sl linespec,} W|L, {\sl cycles,} M|P|K, {\sl loop wid})}
@@ -923,13 +901,21 @@ Basic inductors are illustrated in \FR{Inductors}.
\label{Inductors}
\end{figure}
-Some more basic elements are in \FR{MoreTable}, and amplifiers in \FR{AmpTable}.
-\begin{figure}[h!t]
+Some two-terminal elements often drawn with truncated leads are in
+\FR{heaterMan}.
+More basic elements are in \FR{MoreTable}, and amplifiers in \FR{AmpTable}.
+\begin{figure}[H]
+ \input heaterMan
+ \caption{These elements have two terminals but are often drawn
+ with truncated leads.}
+ \label{heaterMan}
+ \end{figure}
+\begin{figure}[H]
\input MoreTableMan
\caption{More two-terminal elements.}
\label{MoreTable}
\end{figure}
-\begin{figure}[h!t]
+\begin{figure}[H]
\vspace*{-\baselineskip}
\input AmpTableMan
\caption{Amplifier, delay, and integrator.}
@@ -939,7 +925,7 @@ Some more basic elements are in \FR{MoreTable}, and amplifiers in \FR{AmpTable}.
\FR{Sources} shows sources, many of which contain internal symbols,
and of which the {\tt AC} and {\tt S} options illustrate the need
to draw a single cycle of a sinusoid or approximate sinusoid.
-\begin{figure}[h!t]
+\begin{figure}[H]
\input SourcesMan
\caption{Sources and source-like elements.}
\label{Sources}
@@ -960,15 +946,49 @@ and for power-system diagrams, macros
and
{\tt Ysymbol(at {\sl position, keys,} U|D|L|R|{\sl degrees})},
-%Diodes and fuses are shown in \FRS{Diodes} and \REF{Fuses}.
Diodes are shown in \FR{Diodes}.
-\begin{figure}[h!t]
+\begin{figure}[H]
\input DiodesMan
\caption{The macro {\tt
diode(\linespec, B|b|CR|D|L|LE[R]|P[R]|S|T|U|V|v|w|Z|{\sl chars}, [R][E])}.
Appending {\tt K} to the second argument draws an open arrowhead.}
\label{Diodes}
\end{figure}
+The arrows are drawn relative to the diode direction by the {\tt LE}
+option. For absolute arrow directions, one can
+define a wrapper (see \SR{Writing:}) for the {\tt diode} macro to draw arrows
+at 45 degrees, for example:
+\par
+{\tt define(`myLED',`diode(`\$1'); em\_arrows(N,45)
+ with .Tail at last [].ne')}
+
+Switches with numerous controls are in \FR{Switches},
+and fuses, breakers, and jumpers in \FR{Fuses}.
+\begin{figure}[H]
+ \input SwitchesMan
+ \caption{The
+ {\tt switch(\linespec,L|R,{\sl chars},L|B|D,{\sl attribs})}
+ macro is a wrapper for the macros
+ {\tt lswitch(\linespec,[L|R],[O|C][D][K][A])},
+ {\tt bswitch(\linespec,[L|R],[O|C])},
+ and the many-optioned
+ {\tt dswitch(\linespec,R,W[ud]B {\sl chars,text})} shown.
+ The switch is drawn in the current drawing direction.
+ A second-argument {\tt R} produces a mirror
+ image with respect to the drawing direction.
+ The separately defined macros {\tt Proxim} and {\tt Magn}
+ embellish switches in the bottom row.}
+ \label{Switches}
+ \end{figure}
+\begin{figure}[H]
+ \input FusesMan
+ \caption{Variations of the macros
+ {\tt fuse(\linespec, A|dA|B|C|D|E|S|HB|HC|SB, {\sl wid}, {\sl ht}),}
+ {\tt cbreaker(\linespec,L|R,D|T|TS),}
+ and
+ {\tt jumper(\linespec,{\sl chars}|{\sl keys}).}}
+ \label{Fuses}
+ \end{figure}
Most of the two-terminal elements are oriented; that is, they have
a defined direction or polarity. Several element macros include an
@@ -1009,61 +1029,10 @@ done by redefining {\tt dimen\_} globally as described in \SR{Circuitscaling:}.
%{\tt resized(1.8,`diode',right\_ 0.4);}
%{\tt resized(1.8,`reversed',`diode',right\_ 0.4)}
-Fuses are shown in \FR{Fuses}
-and switches with numerous controls in \FR{Switches}.
-\begin{figure}[h!t]
- \input FusesMan
- \caption{Variations of the macros
- {\tt fuse(\linespec, A|dA|B|C|D|E|S|HB|HC|SB, {\sl wid}, {\sl ht})}
- and {\tt cbreaker(\linespec,L|R,D|T|TS)}.}
- \label{Fuses}
- \end{figure}
-
-%\enlargethispage{\baselineskip}%
-\begin{figure}[h!t]
-%\vspace*{-\baselineskip}
- \input SwitchesMan
- \caption{The
- {\tt switch(\linespec,L|R,{\sl chars},L|B|D,{\sl attribs})}
- macro is a wrapper for the macros
- {\tt lswitch(\linespec,[L|R],[O|C][D][K][A])},
- {\tt bswitch(\linespec,[L|R],[O|C])},
- and the many-optioned
- {\tt dswitch(\linespec,R,W[ud]B {\sl chars,text})} shown.
- The switch is drawn in the current drawing direction.
- A second-argument {\tt R} produces a mirror
- image with respect to the drawing direction.
- The separately defined macros {\tt Proxim} and {\tt Magn}
- embellish switches in the bottom row.}
- \label{Switches}
- \end{figure}
-
-\pagebreak
-\FR{Emarrows} contains radiation-effect arrows for embellishing two-terminal
-and other macros.
-\begin{figure}[h!t]
- \input EmarrowsMan
- \caption{Radiation arrows: {\tt em\_arrows({\sl type}|{\sl keys,%
- angle, length})}}
- \label{Emarrows}
- \end{figure}
-The arrow stems are named {\sl A1}, {\sl A2},
-and each pair is drawn in a \verb|[]| block, with
-the names {\sl Head} and {\sl Tail} defined to
-aid placement near another device. The second argument specifies
-absolute angle in degrees (default 135 degrees).
-The arrows are drawn relative to the diode direction by the {\tt LE}
-option in \FR{Diodes}. For absolute arrow directions, one can
-define a wrapper (see \SR{Writing:}) for the {\tt diode} macro to draw arrows
-at 45 degrees, for example:
-\par
-{\tt define(`myLED',`diode(`\$1'); em\_arrows(N,45)
- with .Tail at last [].ne')}
-
\FR{Arresters} shows a collection of surge-protection devices, or arresters,
of which the {\tt E} and {\tt S} types may be either 2-terminal or as
3-terminal (composite) elements described in \SR{Composite:}.
-\begin{figure}[ht]
+\begin{figure}[H]
\input ArrestersMan
\caption{Variations of the {\tt arrester({\sl linespec, chars,}
{\sl wid}[{\tt :}{\sl arrowhead ht}],
@@ -1089,7 +1058,7 @@ thus, the following line draws the third resistor in \FR{Variable}:
\par
{\tt resistor(up\_ dimen\_); variable(,uN)}
-\begin{figure}[ht]
+\begin{figure}[H]
\vspace*{-\baselineskip}
\input VariableMan
\caption{Illustrating
@@ -1105,6 +1074,21 @@ thus, the following line draws the third resistor in \FR{Variable}:
\label{Variable}
\end{figure}
+\pagebreak
+\FR{Emarrows} contains radiation-effect arrows for embellishing two-terminal
+and other macros.
+\begin{figure}[H]
+ \input EmarrowsMan
+ \caption{Radiation arrows: {\tt em\_arrows({\sl type}|{\sl keys,%
+ angle, length})}}
+ \label{Emarrows}
+ \end{figure}
+The arrow stems are named {\sl A1}, {\sl A2},
+and each pair is drawn in a \verb|[]| block, with
+the names {\sl Head} and {\sl Tail} defined to
+aid placement near another device. The second argument specifies
+absolute angle in degrees (default 135 degrees).
+
\subsection{Branch-current arrows\label{Branchcurrent:}}
Arrowheads and labels can be added to conductors using basic
\pic statements. For example, the following line adds a labeled
@@ -1116,8 +1100,7 @@ just been drawn. Many variations of this are possible:
\enlargethispage{\baselineskip}%
Macros have been defined to simplify labelling two-terminal
elements, as shown in \FR{currents}.
-\begin{figure}[ht]
-% \ifpdf\vspace*{-0.5\baselineskip}\fi%
+\begin{figure}[H]
\input currents
\caption{Illustrating {\tt b\_current, larrow,} and {\tt rarrow}.
The drawing direction is to the right.}
@@ -1184,7 +1167,7 @@ places the strings along the centre of the element, and the third along
the right side. Labels beginning with {\tt sprintf} or a double quote
are copied literally rather than assumed to be in math mode. A simple
circuit example with labels is shown in \FR{Loop}.
-\begin{figure}[h!t]
+\begin{figure}[H]
\vspace*{-\baselineskip}
\parbox{4in}{\small \verbatiminput{Loop.m4}}%
\hfill\raise-0.5in\hbox{\input Loop }
@@ -1273,7 +1256,7 @@ The macro {\tt eleminit\_} in the two-terminal elements invokes
to establish element length and direction.
As shown in \FR{Oblique},
-\begin{figure}[h!t]
+\begin{figure}[H]
\vspace{-\baselineskip}
\parbox{4.5in}{\small \verbatiminput{Oblique.m4}}%
\hfill\raise-0.7in\llap{\hbox{\input Oblique }}%
@@ -1316,7 +1299,7 @@ makes some geometries particularly simple. Thus,
\noindent
draws three elements in series
as shown in the top line of \FR{Series}.
-\begin{figure}[ht]
+\begin{figure}[H]
\vspace{-\baselineskip}
\input Series
\caption{Three ways of drawing basic elements in series.}
@@ -1367,7 +1350,7 @@ producing the left circuit in \FR{ParSeries}:
line from L.end to C.end
\end{verbatim}
-\begin{figure}[ht]
+\begin{figure}[H]
% \vspace*{-\baselineskip}
\input ParSeries
\vspace*{-\baselineskip}
@@ -1425,7 +1408,7 @@ first draws a resistor along the specified line, then adds arrows for taps
at fractional positions along the body, with default or specified length.
A negative length draws the arrow from the right of the current drawing
direction.
-\begin{figure}[ht!]
+\begin{figure}[H]
\input Potentiometers
\caption{Default and multiple-tap potentiometer.}
\label{Potentiometers}
@@ -1437,7 +1420,7 @@ The macro {\tt
$\ldots$)},
shown in \FR{Taps}, will add taps to the
immediately preceding two-terminal element.
-\begin{figure}[ht]
+\begin{figure}[H]
\input Taps
\caption{Macros for adding taps to two-terminal elements.}
\label{Taps}
@@ -1458,7 +1441,7 @@ drawn elements.
A few composite symbols derived from two-terminal elements
are shown in \FR{Composite}.
-\begin{figure}[ht]
+\begin{figure}[H]
\vspace*{-0.5ex}
% \vspace*{-\baselineskip}
\input Composite
@@ -1485,7 +1468,7 @@ This macro is one of several in which a temporary drawing direction
is set using the
{\tt setdir\_( U|D|L|R|{\sl degrees, default} R|L|U|D|{\sl degrees} )}
macro and reset at the end using {\tt resetdir\_}.
-\begin{figure}[ht!]
+\begin{figure}[H]
\input GroundsMan
\caption{The
{\tt ground( at }{\sl position}{\tt,
@@ -1498,7 +1481,7 @@ The arguments of
{\tt antenna(at }{\sl position}{\tt,
T|{\sl stem length}, A|L|T|S|D|P|F, U|D|L|R|{\sl degrees})}
shown in \FR{Antennas} are similar to those of {\tt ground}.
-\begin{figure}[h!]
+\begin{figure}[H]
\input AntennasMan
\caption{Antenna symbols, with macro arguments shown above and
terminal names below.}
@@ -1507,16 +1490,15 @@ shown in \FR{Antennas} are similar to those of {\tt ground}.
\FR{Opamp} illustrates the macro
{\tt opamp({\sl\linespec, - label, + label, size, chars})\label{OPAMP}}.
-The element is enclosed in a block
-containing the predefined internal locations shown.
-\begin{figure}[ht]
-% \ifpdf\vspace*{-0.5\baselineskip}\fi%
+\begin{figure}[H]
\input OpampMan
\caption{Operational amplifiers. The {\tt P} option adds
power connections. The second and third arguments can be used
to place and rotate arbitrary text at {\tt In1} and {\tt In2}.}
\label{Opamp}
\end{figure}
+The element is enclosed in a block
+containing the predefined internal locations shown.
These locations can be referenced in later
commands, for example as ``{\tt last [].Out}.''
The first argument defines the direction and length of the opamp, but the
@@ -1538,7 +1520,7 @@ using postprocessor commands (for example \PSTricks \verb|\rput|)
as second and third arguments.
The code in \FR{opampex} places an opamp with three connections.
-\begin{figure}[h!b]
+\begin{figure}[H]
\parbox{4in}{\small \verbatiminput{opampexbody.m4}}%
\quad\raise-0.2in\hbox{\input opampex }%
\caption{A code fragment invoking the
@@ -1546,11 +1528,10 @@ The code in \FR{opampex} places an opamp with three connections.
\label{opampex}
\end{figure}
-\pagebreak
\FR{Xform} shows variants of the transformer macro,
which has predefined internal locations
{\sl P1,} {\sl P2,} {\sl S1,} {\sl S2,} {\sl TP,} and {\sl TS.}
-\begin{figure}[h!t]
+\begin{figure}[H]
\input XformMan
\caption{The {\tt transformer(\linespec,L|R,{\sl np},%
[A|P][W|L][D1|D2|D12|D21],{\sl ns})}
@@ -1573,6 +1554,14 @@ A {\tt D1} puts phase dots at the {\sl P1, S1} end, {\tt D2} at the
\FR{Audio} shows some audio devices, defined in {\tt []} blocks,
with predefined internal locations as shown.
+\begin{figure}[H]
+ \input AudioMan
+ \caption{Audio components:
+ {\tt speaker(U|D|L|R|{\sl degrees},{\sl size},{\sl type}),
+ bell, microphone, buzzer,
+ earphone}, with their internally named positions and components.}
+ \label{Audio}
+ \end{figure}
The first argument specifies the device orientation.
Thus,
\par
@@ -1581,24 +1570,13 @@ Thus,
\noindent
places an upward-facing speaker with input {\sl In2} at the
current location.
-\begin{figure}[ht]
-% \ifpdf\vspace*{-\baselineskip}\fi%
- \input AudioMan
-% \ifpdf\vspace*{-\baselineskip}\fi%
- \caption{Audio components:
- {\tt speaker(U|D|L|R|{\sl degrees},{\sl size},{\sl type}),
- bell, microphone, buzzer,
- earphone}, with their internally named positions and components.}
- \label{Audio}
- \end{figure}
+
The {\tt nport({\sl box specs {\tt[;} other commands{\tt]},
nw, nn, ne, ns, space ratio, pin lgth, style})}
macro is shown in \FR{Nport}.
-\begin{figure}[ht]
-% \ifpdf\vspace*{-\baselineskip}\fi
+\begin{figure}[H]
\input NportMan
-% \ifpdf\vspace*{-\baselineskip}\fi
\caption{The {\tt nport} macro draws a sequence of pairs of named pins
on each side of a box. The pin names are shown. The default is a twoport.
The {\tt nterm} macro draws single pins instead of pin pairs.}
@@ -1644,9 +1622,8 @@ define(`nullor',`nport(`$1'
\end{verbatim}
The above example and the related gyrator macro are illustrated in
-\FR{NLG}.\hfill\break
-
-\begin{figure}[ht]
+\FR{NLG}.
+\begin{figure}[H]
\input NLGMan
\caption{The {\tt nullor} example and the {\tt gyrator}
macro are customizations of the {\tt nport} macro.}
@@ -1658,8 +1635,8 @@ which contains predefined locations {\sl P, C, O}
for the armature and normally closed and normally
open terminals.
An {\tt I} in the first argument draws open circles for contacts.
-\begin{figure}[ht]
-% \ifpdf\vspace*{-\baselineskip}\else\vspace*{-0.5\baselineskip}\fi%
+\begin{figure}[H]
+ \vspace*{-\baselineskip}
\input ContactMan
\caption{The {\tt contact({\sl chars})}
macro (default drawing direction right)
@@ -1667,10 +1644,10 @@ An {\tt I} in the first argument draws open circles for contacts.
\label{Contact}
\end{figure}
-\pagebreak
+\enlargethispage{\baselineskip}
The {\tt contacts({\sl poles, chars})} macro in \FR{Contacts}
draws multiple contacts.
-\begin{figure}[h!t]
+\begin{figure}[H]
\input ContactsMan
\caption{The {\tt contacts({\sl poles, chars})}
macro (drawing direction right).}
@@ -1681,19 +1658,17 @@ For drawing relays, the macro
{\tt relaycoil({\sl chars, wid, ht,} {\tt U|D|L|R|}{\sl degrees})}
shown in \FR{relaycoil} provides a choice of connection points and
actuator types.
-
-\begin{figure}[ht]
-% \ifpdf\vspace*{-\baselineskip}\else\vspace*{-0.5\baselineskip}\fi%
+\begin{figure}[H]
\input relaycoilMan
\vspace{-1ex}
\caption{The {\tt relaycoil} macro.}
\label{relaycoil}
\end{figure}
-The {\tt relay({\sl poles, chars})} macro in \FR{Relay}
+The {\tt relay} macro in \FR{Relay}
defines coil terminals {\sl V1, V2} and contact
terminals {\sl P$_i$, C$_i$, O$_i$.}
-\begin{figure}[ht]
+\begin{figure}[H]
\input RelayMan
\vspace{-1ex}
\caption{The {\tt relay({\sl poles, chars})}
@@ -1701,9 +1676,19 @@ terminals {\sl P$_i$, C$_i$, O$_i$.}
\label{Relay}
\end{figure}
+The double-throw switches shown in \FR{NPDT} are drawn in the
+current drawing direction like the two-terminal elements, but are
+composite elements that must be placed accordingly.
+\begin{figure}[H]
+ \input NPDTMan
+ \caption{Multipole double-throw switches drawn by
+ {\tt NPDT({\sl npoles}, [R])}.}
+ \label{NPDT}
+ \end{figure}
+
The {\tt jack} and {\tt plug} macros and their defined points are
illustrated in \FR{Jack}.
-The first
+The first argument of both macros establishes the drawing direction.
\begin{figure}[H]
\input JackMan
\vspace{-1ex}
@@ -1713,7 +1698,6 @@ The first
\label{Jack}
\end{figure}
\noindent%
-argument of both macros establishes the drawing direction.
The second argument is a string of characters defining drawn components.
An {\tt R} in the string specifies a
right orientation with respect to the drawing direction.
@@ -1726,24 +1710,26 @@ argument of both macros establishes the drawing direction.
or {\tt S[M|B]} substrings add auxiliary contacts with
specified make or break points.
+
A macro for drawing headers is in \FR{Headers}.
-Some connectors are shown in \FR{Conn} and \FR{Pconn}.
-The {\tt tstrip} macro allows ``{\sl key}{\tt =}{\sl value}{\tt ;}'' arguments
-for width and height.
-\begin{figure}[h!t]
+\begin{figure}[H]
\input HeadersMan
\caption{Macro {\tt Header(1|2, {\sl rows, wid, ht, type})}.}
\label{Headers}
\end{figure}
-\begin{figure}[h!t]
+
+Some connectors are shown in \FR{Conn} and \FR{Pconn}.
+The {\tt tstrip} macro allows ``{\sl key}{\tt =}{\sl value}{\tt ;}'' arguments
+for width and height.
+\begin{figure}[H]
\input ConnMan
\caption{Macros {\tt tstrip(R|L|U|D|{\sl degrees}, {\sl chars})},
{\tt ccoax(at} {\sl location}, {\tt M|F, {\sl diameter})},
- {\tt tconn(\linespec, >|>>|<|<<|O[F], {\sl wid})}, and
- {\tt tbox({\sl text, wid, ht}, <|>|<>,{\sl type})}. }
+ {\tt tbox({\sl text, wid, ht}, <|>|<>,{\sl type})}, and
+ {\tt tconn(\linespec, {\sl chars}|{\sl keys}, {\sl wid})}. }
\label{Conn}
\end{figure}
-\begin{figure}[h!t]
+\begin{figure}[H]
\input PconnMan
\caption{A small set of power connectors drawn by
{\tt pconnex(R|L|U|D|}{\sl degrees, chars}{\tt)}. Each connector has
@@ -1751,27 +1737,14 @@ for width and height.
\label{Pconn}
\end{figure}
-The double-throw switches shown in \FR{NPDT} are drawn in the
-current drawing direction like the two-terminal elements, but are
-composite elements that must be placed accordingly.
-\begin{figure}[h!t]
-% \ifpdf{\vspace*{-1ex}}\fi%
- \input NPDTMan
- \caption{Multipole double-throw switches drawn by
- {\tt NPDT({\sl npoles}, [R])}.}
- \label{NPDT}
- \end{figure}
-
A basic winding macro for magnetic-circuit sketches and similar figures
is shown in \FR{Windings}.
For simplicity, the complete spline
is first drawn and then blanked in appropriate places using the background
(core) color (\verb!lightgray! for example, default \verb!white!).
-\begin{figure}[h!t]
+\begin{figure}[H]
\vspace*{-\baselineskip}%
-% \ifpdf\vspace*{-2\baselineskip}\else \vspace{-\baselineskip}\fi
\input WindingsMan
-% \ifpdf\vspace*{-\baselineskip}\else\vspace*{-1ex}\fi
\caption{The {\tt winding(L|R, diam, pitch, turns, core wid, core color)}
macro draws a coil with axis along the current drawing direction.
Terminals {\tt T1} and {\tt T2} are defined.
@@ -1785,30 +1758,33 @@ is first drawn and then blanked in appropriate places using the background
{\tt bi\_tr(\linespec,L|R,P,E)}
which contains predefined internal locations {\sl E},
{\sl B}, {\sl C}.
-The first argument defines the distance and direction from {\sl E}
-\begin{figure}[ht]
+\begin{figure}[H]
+ \vspace*{-1ex}
\input BipMan
\caption{Variants of bipolar transistor {\tt bi\_tr(\linespec,L|R,P,E)}
(current direction upward).}
\label{Bip}
\end{figure}
+The first argument defines the distance and direction from {\sl E}
to {\sl C,} with location determined by the enclosing
block as for other elements, and the base placed
to the left or right of the
current drawing direction according to the second argument. Setting the third
argument to {\tt P} creates a PNP device instead of NPN, and setting the
fourth to {\tt E} draws an envelope around the device.
+
\FR{Darlington} shows a composite macro with several optional internal elements.
-\begin{figure}[h!t]
+\begin{figure}[H]
\input Darlington
\caption{Macro {\tt Darlington(L|R,[E][P][B1][E1|R1][E2|R2][D][Z])},
drawing direction {\tt up\_}.}
\label{Darlington}
\end{figure}
+\enlargethispage{\baselineskip}
The code fragment example in \FR{bitr} places a bipolar transistor,
connects a ground to the emitter, and connects a resistor to the collector.
-\begin{figure}[h!t]
+\begin{figure}[H]
\quad\quad\parbox{4in}{\small \verbatiminput{bitrbody.m4}}%
\quad\raise-0.4in\hbox{\input bitr }%
\vspace{-\baselineskip}
@@ -1821,7 +1797,7 @@ the macro {\tt bi\_trans(\linespec, L|R, {\sl chars}, E)}, which
draws the components of the transistor according to the characters in its
third argument. For example, multiple emitters and collectors can be
specified as shown in \FR{bitrans}.
-\begin{figure}[h!t]
+\begin{figure}[H]
\input bi_trans
\caption{The {\tt bi\_trans(\linespec,L|R,{\sl chars},E)} macro.
The sub-elements are specified by the third argument. The substring
@@ -1830,16 +1806,16 @@ specified as shown in \FR{bitrans}.
\label{bitrans}
\end{figure}
+\pagebreak
A UJT macro with predefined internal locations {\sl B1,} {\sl B2,}
and {\sl E} is shown in \FR{ujt}.
-\begin{figure}[h!t]
-% \ifpdf\vspace*{-\baselineskip}\else\vspace*{-0.5\baselineskip}\fi%
+\begin{figure}[H]
\input ujtMan
-% \ifpdf\vspace*{-0.5\baselineskip}\fi%
\caption{UJT devices, with current drawing direction {\tt up\_}. }
\label{ujt}
\end{figure}
+
The 3 or 4-terminal thyristor macro with predefined internal locations
{\sl G} and {\sl T1,} {\sl T2,} or
{\sl A,} {\sl K,} {\sl G,} and {\sl Ga}
@@ -1870,17 +1846,16 @@ but require a third argument for the label for the compound block; thus,
draws the element from position {\sl A} to position {\sl B} with label
{\sl Q3}, and draws a line from {\sl G}.
-\enlargethispage{\baselineskip}
Some FETs with predefined internal locations {\sl S,} {\sl D,} and {\sl G} are
also included, with similar arguments to those of {\tt bi\_tr,} as shown in
\FR{fet}.
-\begin{figure}[ht]
+\begin{figure}[H]
\vspace*{-\baselineskip}
\input fetMan
\caption{JFET, insulated-gate enhancement and depletion MOSFETs,
simplified versions, graphene, and ferroelectric fets.
These macros are wrappers that invoke the {\tt mosfet}
- macro as shown in the middle and bottom rows.
+ macro as shown in the second and lower rows.
The bottom-row examples show custom devices, the first
defined by omitting the substrate connection, and the second
defined using a wrapper macro.}
@@ -1904,7 +1879,6 @@ temporarily for compatibility.
This system allows considerable freedom in choosing or customizing components,
as illustrated in \FR{fet}.
-\enlargethispage{\baselineskip}
The number of possible semiconductor symbols is very
large, so these macros must be regarded as prototypes.
Often an element is a minor modification of existing elements.
@@ -1928,7 +1902,7 @@ optional argument ``{\tt at} {\sl location}'', the line-thickness
macros, the {\tt fill\_} macro, and {\tt crossover}, which is a useful if
archaic method to show non-touching conductor crossovers, as in
\FR{bistable}.
-\begin{figure}[h!t]
+\begin{figure}[H]
\input bistableMan
% \vspace{-1ex}
\caption{Bipolar transistor circuit, illustrating {\tt crossover}
@@ -1967,7 +1941,7 @@ in \SR{Planarobjects:}.
If two straight lines meet at an angle then, depending on the postprocessor,
the corner may not be mitred or rounded unless the two lines belong to
a multisegment line, as illustrated in \FR{Corners}.
-\begin{figure}[ht]
+\begin{figure}[H]
\input Corners
\caption{Producing mitred angles and corners.}
\label{Corners}
@@ -2015,8 +1989,8 @@ Repetitive actions can also be performed with the {\tt libgen} macro
{\sl value2}, $\ldots$)}
\noindent
-which evaluates {\sl actions} for each instance of {\sl variable} set
-to {\sl value1, value2, $\ldots$}.
+which evaluates {\sl actions} and increments counter {\tt m4Lx}
+for each instance of {\sl variable} set to {\sl value1, value2, $\ldots$}
\xection{Logic gates\label{Logicgates:}}
\FR{Logic} shows the basic logic gates included in
@@ -2029,7 +2003,7 @@ By default, $N=2$ except for macros {\tt NOT\_gate} and {\tt BUFFER\_gate},
which have one input {\tt In1} unless they are given a
first argument, which is treated as the line specification of a
two-terminal element.
-\begin{figure}[h!]
+\begin{figure}[H]
\vspace*{-0.5\baselineskip}
\input LogicMan
\caption{Basic logic gates. The input and output locations of
@@ -2043,7 +2017,7 @@ two-terminal element.
Input locations retain their positions relative to the gate body
regardless of gate orientation, as in \FR{FF}.
-\begin{figure}[ht]
+\begin{figure}[H]
\vspace*{-\baselineskip}
\parbox{4.75in}{\small \verbatiminput{FF.m4}}%
\input FF
@@ -2051,9 +2025,11 @@ regardless of gate orientation, as in \FR{FF}.
\caption{$SR$ flip-flop.}
\label{FF}
\end{figure}
+
+\pagebreak
Beyond a default number (6) of inputs, the
gates are given wings as in \FR{exVIII}.
-\begin{figure}[h!t]
+\begin{figure}[H]
\input mplex
\vspace*{-0.5\baselineskip}
\caption{Eight-input multiplexer, showing a gate with wings.}
@@ -2127,7 +2103,7 @@ If the first argument is non-blank however, then the buffer is drawn along
an invisible line like a two-terminal element, which is convenient sometimes
but requires internal locations of the block to be referenced using
{\tt last []}, as shown in \FR{Buffer}.
-\begin{figure}[h!t]
+\begin{figure}[H]
\vspace*{-\baselineskip}
\input Buffer
\caption{The {\tt BUFFER\_gate} and {\tt BUFFER\_gen} macros.
@@ -2142,7 +2118,7 @@ the macro {\tt FlipFlop(D|T|RS|JK, {\sl label, boxspec, pinlength})},
which is a
wrapper for the more general macro {\tt FlipFlopX(}{\sl boxspec, label,
leftpins, toppins, rightpins, bottompins, pinlength}{\tt )}.
-\begin{figure}[ht]
+\begin{figure}[H]
\input FlipFlop
\caption{The {\tt FlipFlop} and {\tt FlipFlopX} macros, with variations.}
\label{FlipFlops}
@@ -2164,17 +2140,17 @@ a label, use {\tt lg\_bartxt(}{\sl label}{\tt)}.
The {\sl pinopts} are {\tt [L|M|I|O][N][E]} as for the \verb|lg_pin| macro.
Optional argument 7 is the pin length in drawing units.
-\pagebreak
+
\FR{Multiplexer} shows a multiplexer block with variations, and
\FR{Demultiplexer} shows
the very similar demultiplexer.
-\begin{figure}[h!t]
+\begin{figure}[H]
\input MultiplexerMan
\caption{The {\tt Mux({\sl input count}, {\sl label},
[L][B|H|X][N[$n$]|S[$n$]][[N]OE],{\sl wid},{\sl ht})} macro.}
\label{Multiplexer}
\end{figure}
-\begin{figure}[h!t]
+\begin{figure}[H]
\input DemultiplexerMan
\caption{The {\tt Demux({\sl input count}, {\sl label},
[L][B|H|X][N[$n$]|S[$n$]][[N]OE],{\sl wid},{\sl ht})} macro.}
@@ -2187,7 +2163,7 @@ For example, the following code defines the custom flipflops in \FR{ShiftR}.
define(`customFF',`FlipFlopX(wid 10*L_unit ht FF_ht*L_unit,,
:S;NE:CK;:R, N:PR, :Q;;ifelse(`$1',1,:lg_bartxt(Q)), N:CLR) ')
\end{verbatim}
-\begin{figure}[h!t]
+\begin{figure}[H]
\input ShiftRMan
\caption{A 5-bit shift register.}
\label{ShiftR}
@@ -2201,10 +2177,8 @@ For hybrid applications, the \verb|dac| and \verb|adc| macros are
illustrated in \FR{Dac}.
The figure shows the default and predefined internal locations, the number
of which can be specified as macro arguments.
-\begin{figure}[ht]
-% \ifpdf\vspace*{-\baselineskip}\fi%
+\begin{figure}[H]
\input Dac
-% \ifpdf\vspace*{-\baselineskip}\fi%
\caption{The {\tt dac({\sl width,height},nIn,nN,nOut,nS)}
and {\tt adc({\sl width,height},nIn,nN,nOut,nS)} macros.}
\label{Dac}
@@ -2232,7 +2206,7 @@ To draw the left-side pins, for example, one can write
\end{verbatim}
\noindent
and so on.
-\begin{figure}[h!]
+\begin{figure}[H]
\parbox{\textwidth}{\small\verbatiminput{sampleIC.m4}}%
\hfill\llap{\raise-0.15in\hbox{\input sampleIC }}%
\vspace*{-\baselineskip}%
@@ -2311,7 +2285,8 @@ that can be named as for normal two-terminal elements.
There are four arguments for which defaults are provided as always.
The transformers are shown in \FR{SLDTransformers} and other two-terminal
elements in \FR{SLDTwoTerms}.
-\begin{figure}[h!t]
+\begin{figure}[H]
+ \vspace*{-\baselineskip}
\SLDTransformers
\caption{The SLD draft transformers
drawn by {\tt sl\_transformer({\sl linespec, key-value pairs,
@@ -2324,7 +2299,7 @@ elements in \FR{SLDTwoTerms}.
The first argument is the linespec defining the direction and location
of the element, e.g.,
{\tt sl\_transformer(right\_ {\sl expr}).}
-\begin{figure}[h!t]
+\begin{figure}[H]
\SLDTwoTerms
\caption{SLD two-terminal elements, drawing direction {\tt right\_}.}
\label{SLDTwoTerms}
@@ -2388,23 +2363,23 @@ and can be labelled like a normal two-terminal element. If, however,
breakers are included using {\tt B: tt\_box(,{,},C,C)} then write, for example,
{\tt llabel(,Box 15,{,},Body)} to place the label correctly.
+\pagebreak
\subsection{One-terminal and composite SLD elements\label{OneTermSLD:}}
The one-terminal elements have two components: a stem with optional
breaker or slash symbol, and a head.
SLD generators are shown in \FR{SLDGenerators}, other
one-terminal elements in \FR{SLDOneTerms}.
-\begin{figure}[h!t]
+\begin{figure}[H]
\SLDGenerators
\caption{SLD generators, drawing direction {\tt up\_}.}
\label{SLDGenerators}
\end{figure}
-\begin{figure}[h!t]
+\begin{figure}[H]
\SLDOneTerms
\caption{SLD one-terminal elements, drawing direction {\tt up\_}.}
\label{SLDOneTerms}
\end{figure}
There are three arguments, as follows.
-
The first argument is a linespec which defines the location and drawing
direction of the element stem.
The second argument is a sequence of semicolon-separated key-value pairs
@@ -2431,9 +2406,10 @@ internal positions. For {\tt sl\_busbar}, these are
{\sl Start, End,} and
{\sl P1, P2, $\ldots$ Pnp} where {\sl np} is the value of the
second argument.
-\begin{figure}[h!t]
+\begin{figure}[H]
+ \vspace*{-\baselineskip}
\SLDComposite
- \caption{The {\tt sl\_busbar()} and two variants of {\tt sl\_ct}.}
+ \caption{The {\tt sl\_busbar()} and some transformer variants.}
\label{SLDComposite}
\end{figure}
@@ -2601,11 +2577,12 @@ to defer macro expansion. Macro arguments are referenced inside a
macro by number; thus {\tt \$1} refers to the first argument.
A few examples will be given.
+\pagebreak
\Example{1}
Custom two-terminal elements can often be defined by writing a wrapper
for an existing element. For example, an enclosed thermal switch
can be defined as shown in \FR{Thermal}.
-\begin{figure}[ht]
+\begin{figure}[H]
\parbox{5in}{\tt define(`thermalsw',\hfill\break
\hbox{}\space`dswitch(`\$1',`\$2',WDdBTh)\hfill\break
\hbox{}\space\space circle rad distance(last [].T,last line.c)
@@ -2620,22 +2597,22 @@ In the following,
two macros are defined to simplify the repeated drawing
of a series resistor and series inductor, and the macro {\tt tsection} defines
a subcircuit that is replicated several times to generate \FR{Tline}.
-\pagebreak
+
{\small \verbatiminput{Tline.m4}}
-\begin{figure}[h!t]
-% \ifpdf\vspace*{-\baselineskip}\fi%
+\begin{figure}[H]
\input Tline
\caption{A lumped model of a transmission line, illustrating the
use of custom macros.}
\label{Tline}
\end{figure}
+\pagebreak
\Example{3}
\FR{HybridPi} shows an element that is composed of several basic
elements and that can be drawn in any direction prespecified by
{\tt Point\_({\sl degrees})}. The labels always appear in their natural
horizontal orientation.
-\begin{figure}[h!t]
+\begin{figure}[H]
\vspace*{-0.5ex}
\input HybridPi
\vspace*{-0.5ex}
@@ -2682,11 +2659,12 @@ define(`hybrid_PI_BJT',
`$2' ] ')
\end{verbatim}
+\pagebreak
\Example{4}
A number of elements have arguments meant explicitly for customization.
\FR{Sinus} customizes the {\tt source} macro to show a cycle of a horizontal sinusoid with adjustable phase given by argument 2 in degrees,
as might be wanted for a 3-phase circuit:
-\begin{figure}[ht]
+\begin{figure}[H]
\hfill\input Sinus
\vspace*{-0.5in}
\begin{verbatim}
@@ -2710,7 +2688,7 @@ power of the \verb|vec_()| and \verb|rvec_()| macros is not required.
Suppose that an optoisolator is to be drawn with left-right or right-left
orientation as shown in \FR{Opto}.
%\vspace*{-0.5em}
-\begin{figure}[h!b]
+\begin{figure}[H]
\input Opto
\caption{Showing {\tt opto} and {\tt opto(BR)} with defined labels.}
\label{Opto}
@@ -2783,7 +2761,7 @@ F2: fbfilter(L,R,K_2,C_{23},R_3) with .In at F1.In
ground(at F2.G)
\end{verbatim}
\vspace*{-0.5em}
-\begin{figure}[ht]
+\begin{figure}[H]
\input fbfilter
\caption{Showing the result of two invocations of the {\tt fbfilter} macro,
with labels.}
@@ -2895,7 +2873,7 @@ can generate the custom arrows shown below the three native arrows
in \FR{arrowex}. The defined keys are
{\tt type=}; {\tt lgth=}; {\tt wdth=}; {\tt shaft=}; and {\tt head=}.
Many variations of these arrowheads are possible.
-\begin{figure}[h!t]
+\begin{figure}[H]
\input arrowex
\caption{The three \dpic native arrows and others generated by
{\tt sarrow({\sl linespec}, {\sl keys})}.}
@@ -2968,7 +2946,7 @@ This hackery is summarized below, with an example in \FR{stringdim}.
The argument of {\tt s\_box} need not be text exclusively; it can
be anything that produces a \TeX\ box, for example, \verb|\includegraphics|.
\end{itemize}
-\begin{figure}[h!t]
+\begin{figure}[H]
\parbox{3.5in}{\small\tt.PS\\
gen\_init\\
sinclude(Circuit\_macros.dim)\\
@@ -3091,7 +3069,7 @@ Objects can be taylored to their attached text by invoking
The small source file in \FR{boxdims}, for example,
produces the box in the figure.
%\vspace*{-\baselineskip}%
-\begin{figure}[ht]
+\begin{figure}[H]
\parbox{4.2in}{\small \input eboxdims.verb }%
\hfill\llap{\raise-0.35in\hbox{\input eboxdims }}%
\vspace{-\baselineskip}
@@ -3114,7 +3092,7 @@ libgen.m4}, to convert points to drawing coordinates.
Sometimes a label needs a plain background in order to blank
out previously drawn components overlapped by the label,
as shown on the left of \FR{fbox}.
-\begin{figure}[h!b]
+\begin{figure}[H]
\input woodchips
\vspace{-0.5\baselineskip}
\caption{Illustrating the {\tt f\_box} macro.}
@@ -3151,6 +3129,7 @@ evaluates to a position, with {\tt boxcoord(}{\sl object name}{\tt,0,0)}
at the lower left corner of the object, and {\tt boxcoord(}{\sl object
name}{\tt,1,1)} at its upper right.
+
\xection{\PSTricks and other tricks\label{Pstricks:}}
This section applies only to a \pic processor (\dpic) that is
capable of producing output compatible with
@@ -3249,7 +3228,6 @@ The lines
\noindent\verb|\end{scope}%|
\vspace{\parsep}
-\pagebreak
This is accomplished, for example, by adapting the {\tt \bsl{}mtotex}
macro of \SR{Simplifications:} as follows:
@@ -3288,10 +3266,8 @@ formats, as shown in \FR{Workflow}.
One of the easiest methods
for producing web documents is to generate postscript as usual and to
convert the result to pdf format with Adobe Distiller or equivalent.
-\begin{figure}[h!t]
-% \ifpdf\vspace*{-\baselineskip}\fi%
+\begin{figure}[H]
\input Workflow
-% \ifpdf\vspace*{-\baselineskip}\fi%
\caption{Output formats produced by \gpic {\tt -t} and \dpic.
SVG output can be read by Inkscape or used directly in web documents.}
\label{Workflow}
@@ -3348,6 +3324,7 @@ as illustrated in \FR{Workflow} and in example files included with the
distribution. The \latex drawing commands alone or with {\tt eepic}
or {\tt pict2e} extensions are suitable only for simple diagrams.
+\enlargethispage{\baselineskip}
\xection{Developer's notes\label{Developersnotes:}}
In the course of writing a book in the late 1980s when there was little
available for creating line diagrams in \latex, I wished to eliminate
@@ -3373,18 +3350,19 @@ locations to an external file to be used in overlaying text or other
items on the diagram.
The simple \pic\ language is but one of many available tools for creating
-line graphics. Consequently, the main value of this distribution is
-not necessarily in the use of a specific language but in the element
-data encoded in the macros, which have been developed with reference
-to standards and refined over decades, and which now total thousands
-of lines. The learning curve of \pic\ compares well with other
-possibilities, but some of the macros have become less readable as more
-options and flexibility have been added, and if starting over today,
-perhaps I would change some details. Compromises have been made in order
-to retain reasonable compatibility with the various postprocessors.
-No choice of tool is without compromise, and producing good graphics
-seems to be time consuming, no matter how it is done, but the payoff
-can be worth the effort.
+line graphics. Consequently, the main value of this distribution
+is not necessarily in the use of a specific language but in the
+element data encoded in the macros, which have been developed with
+reference to standards and refined over decades, and which now total
+thousands of lines. The learning curve of \pic\ compares well with
+other possibilities, but some of the macros have become less readable
+as more options and flexibility have been added, and if starting
+over today, perhaps I would change some details. Compromises have
+been made to preserve the compatability of some of the older macros.
+Compromises have also been made to retain reasonable compatibility with
+the various postprocessors. No choice of tool is without compromise,
+and producing good graphics seems to be time consuming, no matter how
+it is done, but the payoff can be worth the effort.
Instead of using \pic macros, I preferred the equally simple but more
powerful \Mfour macro processor, and therefore \Mfour is required here,