diff options
Diffstat (limited to 'graphics/circuit_macros/doc')
-rw-r--r-- | graphics/circuit_macros/doc/ACsymbol.m4 | 4 | ||||
-rw-r--r-- | graphics/circuit_macros/doc/AntennasMan.m4 | 4 | ||||
-rw-r--r-- | graphics/circuit_macros/doc/ArrestersMan.m4 | 75 | ||||
-rw-r--r-- | graphics/circuit_macros/doc/CctTableMan.m4 | 2 | ||||
-rw-r--r-- | graphics/circuit_macros/doc/Circuit_macros.pdf | bin | 1285894 -> 950156 bytes | |||
-rw-r--r-- | graphics/circuit_macros/doc/DCsymbol.m4 | 4 | ||||
-rw-r--r-- | graphics/circuit_macros/doc/GroundsMan.m4 | 6 | ||||
-rw-r--r-- | graphics/circuit_macros/doc/Makefile | 10 | ||||
-rw-r--r-- | graphics/circuit_macros/doc/Version.tex | 2 | ||||
-rw-r--r-- | graphics/circuit_macros/doc/body.tex | 357 | ||||
-rw-r--r-- | graphics/circuit_macros/doc/defines.tex | 122 |
11 files changed, 396 insertions, 190 deletions
diff --git a/graphics/circuit_macros/doc/ACsymbol.m4 b/graphics/circuit_macros/doc/ACsymbol.m4 new file mode 100644 index 0000000000..114a0f1879 --- /dev/null +++ b/graphics/circuit_macros/doc/ACsymbol.m4 @@ -0,0 +1,4 @@ +.PS +cct_init +ACsymbol +.PE diff --git a/graphics/circuit_macros/doc/AntennasMan.m4 b/graphics/circuit_macros/doc/AntennasMan.m4 index 6053cd2e3f..a2bb3be5f0 100644 --- a/graphics/circuit_macros/doc/AntennasMan.m4 +++ b/graphics/circuit_macros/doc/AntennasMan.m4 @@ -31,9 +31,9 @@ sinclude(Circuit_macros.dim) s_box(T1) below rjust at A.T1 s_box(T2) below ljust at A.T2 s_box(`\tt (,{,}D)') at A.n above - A: antenna(at A.T+(elen_,0),,P) + A: antenna(at A.T+(elen_,0),dimen_*3/4,P) s_box(T) below at A.T - s_box(`\tt (,{,}P)') at A.n above + s_box(`\tt (,dimen\_*3/4,P)') at A.n above A: antenna(at A.T+(elen_,0),,F) s_box(T) below at A.T s_box(`\tt (,{,}F)') at A.n above diff --git a/graphics/circuit_macros/doc/ArrestersMan.m4 b/graphics/circuit_macros/doc/ArrestersMan.m4 new file mode 100644 index 0000000000..dc08e40429 --- /dev/null +++ b/graphics/circuit_macros/doc/ArrestersMan.m4 @@ -0,0 +1,75 @@ +.PS +# ArrestersMan.m4 +cct_init + + sep = 0.2 + +R1: [ + arrester + {`"\tt arrester"' at last line.c+(0,-0.2)} + move sep + arrester(,G) + {`"\tt arrester(,G)"' at last line.c+(0,-0.2)} + move sep + arrester(,g) + {`"\tt ...(,g)"' at last line.c+(0,-0.2)} + move sep + arrester(,M) + {`"\tt \ldots(,M)"' at last line.c+(0,-0.2)} + move sep + arrester(,C) + {`"\tt \ldots(,C)"' at last line.c+(0,-0.2)} + move sep + arrester(,A) + {`"\tt \ldots(,A)"' at last line.c+(0,-0.2)} + ] + +R2: [ + arrester(,H) + {`"\tt \ldots(,H)"' at last line.c+(0,-0.2)} + move sep + arrester(,HR) + {`"\tt \ldots(,HR)"' at last line.c+(0,-0.2)} + move sep + arrester(,P) + {`"\tt \ldots(,P)"' at last line.c+(0,-0.2)} + move sep + arrester(,s) + {`"\tt \ldots(,s)"' at last line.c+(0,-0.2)} + move sep + arrester(,F) + {`"\tt \ldots(,F)"' at last line.c+(0,-0.2)} + move sep + arrester(,S) + {`"\tt \ldots(,S)"' at last line.c+(0,-0.2)} + + ] with .nw at R1.sw+(0,-0.2) + + define(`Dlabels', + `{ thinlines_ + arrow <- from A.A up 0.1 left 0.1; "\sl A" rjust + arrow <- from A.B up 0.1 right 0.1; "\sl B" ljust + arrow <- from A.G up 0.05 right 0.15; "\sl G" ljust + thicklines_ }') +[ + arrester(,E) + {`"\tt \ldots(,E)"' at last line.c+(0,-0.25)} + move sep + A: arrester(,DE) + {`"\tt \ldots(,DE)"' at last [].s+(0,-0.1)} + Dlabels + move sep*3 + A: arrester(,DS) + {`"\tt \ldots(,DS)"' at last [].s+(0,-0.1)} + Dlabels + move sep*3 + A: arrester(,DEL) + {`"\tt \ldots(,DEL)"' at last [].s+(0,-0.1)} + Dlabels + move sep*3 + A: arrester(,DSL) + {`"\tt \ldots(,DSL)"' at last [].s+(0,-0.1)} + Dlabels + ] with .nw at R2.sw+(0,-0.2) + +.PE diff --git a/graphics/circuit_macros/doc/CctTableMan.m4 b/graphics/circuit_macros/doc/CctTableMan.m4 index f7e47d0758..221c62b737 100644 --- a/graphics/circuit_macros/doc/CctTableMan.m4 +++ b/graphics/circuit_macros/doc/CctTableMan.m4 @@ -85,6 +85,8 @@ vm = 0.28 } move down 0.25; right_ { {pvcell ; move;"`{\tt pvcell}'" ljust} + move right_ hm + {arrester ; move ;"`{\tt arrester}'" ljust} } .PE diff --git a/graphics/circuit_macros/doc/Circuit_macros.pdf b/graphics/circuit_macros/doc/Circuit_macros.pdf Binary files differindex 78a14a9ca9..6e50fe8ba6 100644 --- a/graphics/circuit_macros/doc/Circuit_macros.pdf +++ b/graphics/circuit_macros/doc/Circuit_macros.pdf diff --git a/graphics/circuit_macros/doc/DCsymbol.m4 b/graphics/circuit_macros/doc/DCsymbol.m4 new file mode 100644 index 0000000000..5d66149410 --- /dev/null +++ b/graphics/circuit_macros/doc/DCsymbol.m4 @@ -0,0 +1,4 @@ +.PS +cct_init +DCsymbol +.PE diff --git a/graphics/circuit_macros/doc/GroundsMan.m4 b/graphics/circuit_macros/doc/GroundsMan.m4 index e93fadf33c..a2aeba6e7f 100644 --- a/graphics/circuit_macros/doc/GroundsMan.m4 +++ b/graphics/circuit_macros/doc/GroundsMan.m4 @@ -1,5 +1,5 @@ .PS -# `Grounds.m4' +# GroundsMan.m4 cct_init sep = 0.65 @@ -22,7 +22,7 @@ D: B+(0,11bp__) "{\tt (,{,}E)}" at (GE,D)} -GS: ground(,,S) +GS: ground(,dimen_/2,S) move right sep GS90: [ground(,,S,90) ] with .n at Here move right sep from GS90.n @@ -36,7 +36,7 @@ GPA: ground(,T,PA) C: Here+(0,-0.5) E: C+(0,11bp__) - "{\tt (,{,}S)}" at (GS,C) + "{\tt (,dimen\_/2,S)}" at (GS,C) "{\tt (,{,}S,90)}" at (GS90,E) "{\tt (,{,}Q)}" at (GQ,C) "{\tt (,{,}L)}" at (GL,E) diff --git a/graphics/circuit_macros/doc/Makefile b/graphics/circuit_macros/doc/Makefile index 9e27cc0b27..fb7ed9bc93 100644 --- a/graphics/circuit_macros/doc/Makefile +++ b/graphics/circuit_macros/doc/Makefile @@ -5,11 +5,12 @@ DOC = Circuit_macros DOCSRC = Circuit_macros.tex body.tex defines.tex PICTEX = \ - AmpTableMan.tex AntennasMan.tex AudioMan.tex Axes.tex \ + ACsymbol.tex \ + AmpTableMan.tex AntennasMan.tex ArrestersMan.tex AudioMan.tex Axes.tex \ Buffer.tex BigResistor.tex BipMan.tex \ CctTableMan.tex Composite.tex ConfigA.tex ConfigB.tex ConfigC.tex \ ConnMan.tex Corners.tex ContactMan.tex ContactsMan.tex \ - Dac.tex Darlington.tex DemultiplexerMan.tex DiodesMan.tex \ + Dac.tex Darlington.tex DCsymbol.tex DemultiplexerMan.tex DiodesMan.tex \ EmarrowsMan.tex FF.tex FlipFlop.tex Flowdiag.tex FusesMan.tex \ GroundsMan.tex HeadersMan.tex HybridPi.tex JackMan.tex LogicMan.tex \ Loop.tex MultiplexerMan.tex NPDTMan.tex NLGMan.tex NportMan.tex \ @@ -89,6 +90,11 @@ $(DOC).$(SFX): mode.tex citations $(PICTEX) @printf "\n No file $(DOC).$(SFX)\n\n" ; \ $(LATEX) $(DOC) ; bibtex $(DOC) ; fi +ACsymbol.tex DCsymbol.tex: + touch $(DOC).dim + $(M4) $(M4LIBS) $(DOC).dim $*.m4 > $*.pic + $(PRE) $(PIC) $*.pic | sed -e '/end{tikzpicture}/s/$$/%/' > $*.tex + citations: mode.tex $(DOC).bbl $(PICTEX) @printf "\n citations:\n\n" $(LATEX) $(DOC) ; bibtex $(DOC) diff --git a/graphics/circuit_macros/doc/Version.tex b/graphics/circuit_macros/doc/Version.tex index ca449b0a0b..9d14ec204e 100644 --- a/graphics/circuit_macros/doc/Version.tex +++ b/graphics/circuit_macros/doc/Version.tex @@ -1 +1 @@ -Version 9.3 +Version 9.4 diff --git a/graphics/circuit_macros/doc/body.tex b/graphics/circuit_macros/doc/body.tex index cbb2fdb058..ac8db93ef5 100644 --- a/graphics/circuit_macros/doc/body.tex +++ b/graphics/circuit_macros/doc/body.tex @@ -92,7 +92,7 @@ The result is passed through a \pic interpreter to produce {\tt .tex} output that can be inserted into a {\tt .tex} document using the \verb|\input| command. -\begin{figure}[hbt] +\begin{figure}[ht] \pdftooltip{\input Flowdiag }{Flow diagram for the inclusion of figures} \caption{Inclusion of figures and macros in the \latex document. \label{Flowdiag}} @@ -193,7 +193,7 @@ 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: \begin{verbatim} -\begin{figure}[hbt] +\begin{figure}[ht] \centering \input quick \caption{Customized caption for the figure.} @@ -218,7 +218,7 @@ 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}[hbt] +\begin{figure}[ht] \input ConfigA \caption{The command {\tt m4 pstricks.m4 quick.m4 > quick.pic}. @@ -239,7 +239,7 @@ the commands are \noindent and the figure inclusion statements are as shown: \begin{verbatim} -\begin{figure}[hbt] +\begin{figure}[ht] \input quick \centerline{\box\graph} \caption{Customized caption for the figure.} @@ -470,7 +470,7 @@ The construction \noindent truncates the line at each end by {\tt x} (which may be negative) or, if {\tt x} is omitted, by -the current circle radius, which is convenient when A and B are +the current circle radius, a convenience when A and B are circular graph nodes, for example. Otherwise {\tt line from A to B chop x chop y} @@ -728,7 +728,11 @@ operating-system commands, \pic macros, and external file inclusion. There is a fundamental difference between the two-terminal elements, each of which is drawn along an invisible straight-line segment, and other elements, which are compound objects mentioned -in \SR{Compoundobjects:}. The two-terminal element macros follow a +in \SR{Compoundobjects:}. +% Specifying the straight-line segment requires four numbers, the coordinates +% of the start and end, or equivalent, but default values are used if +% not specified. +The two-terminal element macros follow a set of conventions described in this section, and other elements will be described in \SR{Composite:}. @@ -745,7 +749,7 @@ The first part of the source file for this figure is %as follows: on the left: -\begin{figure}[hbt] +\begin{figure}[ht] \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}}} @@ -829,7 +833,8 @@ were added after the previously shown source: \subsection{The two-terminal elements\label{Twoterminal:}} The two-terminal elements are shown in \FRS{CctTable} % to~\REF{Diodes} and \FRS{Fuses} -to~\REF{Switches}. +%to~\REF{Switches}. +to~\REF{Arresters}. Several elements are included more than once to illustrate some of their arguments, which are listed in \SR{defines}. \enlargethispage{\baselineskip} @@ -846,12 +851,13 @@ If the argument is blank, the element is drawn from the current position in the current drawing direction along a default length. The other arguments produce variants of the default elements. -\begin{figure}[hbt] +\begin{figure}[ht] \input AmpTableMan \caption{Amplifier, delay, and integrator.} \label{AmpTable} \end{figure} +\pagebreak Thus, for example, \par {\tt resistor(up\_ 1.25,7)} @@ -862,7 +868,7 @@ vertices per side. The macro {\tt up\_} evaluates to {\tt up} but also resets the current directional parameters to point up. -\begin{figure}[hbt] +\begin{figure}[ht] \input SourcesMan % \ifpdf\vspace*{-0.5\baselineskip}\fi% \caption{Sources and source-like elements.} @@ -875,11 +881,16 @@ to draw a single cycle of a sinusoid or approximate sinusoid. As a convenience, the macro {\tt ACsymbol(at {\sl position, length, height,} [A]U|D|L|R|{\sl degrees})} is included as an interface to -the {\tt sinusoid} macro. For example to add the sumbol to an ebox: +the {\tt sinusoid} macro. For example to add the sumbol +(\input{ACsymbol.tex}) to an ebox: \par {\tt ebox; $\lbrace$\ ACsymbol(at last [],{,},dimen\_/8) $\rbrace$} -\begin{figure}[hbt] +\noindent +For direct current (\input{DCsymbol.tex}), there is also +{\tt DCsymbol(at {\sl position, length, height,} U|D|L|R|{\sl degrees})}. + +\begin{figure}[ht] \input DiodesMan \caption{The macro {\tt diode(\linespec,B|CR|D|L|LE[R]|P[R]|S|T|V|v|w|Z|{\sl chars},[R][E])}. @@ -923,6 +934,8 @@ The first argument of the macro \noindent is the name of a two-terminal element in quotes, followed by the element arguments. The element is drawn with reversed direction. + +\pagebreak Thus, \par {\tt diode(right\_ 0.4); reversed(`diode',right\_ 0.4)} @@ -930,11 +943,6 @@ Thus, \noindent draws two diodes to the right, but the second one points left. -\begin{figure}[bt] - \input EmarrowsMan - \caption{Radiation arrows: {\tt em\_arrows({\sl type, angle, length})}} - \label{Emarrows} - \end{figure} Similarly, the macro \par {\tt resized(}{\sl factor},`{\sl macro name}',{\sl macro arguments}{\tt )} @@ -949,12 +957,31 @@ by 1.8, for example {\tt resized(1.8,`diode',right\_ 0.4);} {\tt resized(1.8,`reversed',`diode',right\_ 0.4)} +\pagebreak +\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] + \input ArrestersMan + \caption{Variations of the {\tt arrester({\sl linespec, chars,} + {\sl wid}[{\tt :}{\sl arrowhead ht}], {\sl ht}[{\tt :}{\sl arrowhead wid})} + macro. Putting {\tt D} in argument 2 for the {\tt S} or {\tt E} + configuration creates a 3-terminal composite element + with terminals {\sl A, B}, and {\sl G.}} + \label{Arresters} + \end{figure} + \FR{Emarrows} contains radiation-effect arrows for embellishing two-terminal and other macros. 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 +\begin{figure}[ht] + \input EmarrowsMan + \caption{Radiation arrows: {\tt em\_arrows({\sl type, angle, length})}} + \label{Emarrows} + \end{figure} 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 @@ -979,7 +1006,7 @@ thus, the following line draws the resistor in \FR{Variable}: \par {\tt resistor(down\_ dimen\_); variable(,uN)} -\begin{figure}[h!t] +\begin{figure}[ht] \vspace*{-\baselineskip} \input VariableMan \caption{Illustrating @@ -1011,7 +1038,7 @@ The macro \noindent draws an arrow from the start of the last-drawn two-terminal element {\sl frac} of the way toward the body. -\begin{figure}[h!t] +\begin{figure}[ht] % \ifpdf\vspace*{-0.5\baselineskip}\fi% \input currents \caption{Illustrating {\tt b\_current, larrow,} and {\tt rarrow}. @@ -1153,7 +1180,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!b] +\begin{figure}[ht] \vspace{-\baselineskip} \parbox{4.5in}{\small \verbatiminput{Oblique.m4}}% \hfill\raise-0.7in\llap{\hbox{\input Oblique }}% @@ -1196,7 +1223,7 @@ makes some geometries particularly simple. Thus, \noindent draws three elements in series as shown in the top line of \FR{Series}. -\begin{figure}[h!t] +\begin{figure}[ht] \vspace{-\baselineskip} \input Series \caption{Three ways of drawing basic elements in series.} @@ -1247,7 +1274,7 @@ producing the left circuit in \FR{ParSeries}: line from L.end to C.end \end{verbatim} -\begin{figure}[h!t] +\begin{figure}[ht] % \vspace*{-\baselineskip} \input ParSeries \vspace*{-\baselineskip} @@ -1305,7 +1332,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}[h!t] +\begin{figure}[ht!] \input Potentiometers \caption{Default and multiple-tap potentiometer.} \label{Potentiometers} @@ -1317,7 +1344,7 @@ The macro {\tt $\ldots$)}, shown in \FR{Taps}, will add taps to the immediately preceding two-terminal element. -\begin{figure}[h!t] +\begin{figure}[ht] \input Taps \caption{Macros for adding taps to two-terminal elements.} \label{Taps} @@ -1338,7 +1365,17 @@ drawn elements. A few composite symbols derived from two-terminal elements are shown in \FR{Composite}. +\begin{figure}[h!b] + \vspace*{-0.5ex} +% \vspace*{-\baselineskip} + \input Composite + \vspace*{-0.5ex} + \caption{Composite elements {\tt KelvinR({\sl cycles},[R],{\sl cycle wid})} + and {\tt FTcap({\sl chars})} .} + \label{Composite} + \end{figure} +\enlargethispage{\baselineskip} The ground symbol is shown in \FR{Grounds}. The first argument specifies position; for example, the two lines shown have identical effect: @@ -1347,15 +1384,6 @@ have identical effect: \par ground(at (1.5,2)) } -\begin{figure}[h!t] - \vspace*{-0.5ex} - \input Composite - \vspace*{-0.5ex} - \caption{Composite elements {\tt KelvinR({\sl cycles},[R],{\sl cycle wid})} - and {\tt FTcap({\sl chars})} .} - \label{Composite} - \end{figure} - %\noindent The second argument truncates the stem, and the third defines the symbol type. @@ -1369,26 +1397,27 @@ macro and reset at the end using {\tt resetdir\_}. \input GroundsMan \caption{The {\tt ground( at }{\sl position}{\tt, - T, N|F|S|L|P[A]|E, U|D|L|R|{\sl degrees} )} + T|{\sl stem length}, N|F|S|L|P[A]|E, U|D|L|R|{\sl degrees} )} macro.} \label{Grounds} \end{figure} -The arguments of the macro -{\tt antenna( at }{\sl position}{\tt, - T, A|L|T|S|D|P|F, U|D|L|R|{\sl degrees} )} +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!t] +\begin{figure}[h!] \input AntennasMan \caption{Antenna symbols, with macro arguments shown above and terminal names below.} \label{Antennas} \end{figure} -\pagebreak \FR{Opamp} illustrates the macro {\tt opamp({\sl\linespec, - label, + label, size, chars})\label{OPAMP}}. -\begin{figure}[h!t] +The element is enclosed in a block +containing the predefined internal locations shown. +\begin{figure}[ht] % \ifpdf\vspace*{-0.5\baselineskip}\fi% \input OpampMan \caption{Operational amplifiers. The {\tt P} option adds @@ -1396,8 +1425,6 @@ shown in \FR{Antennas} are similar to those of {\tt ground}. 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 @@ -1418,7 +1445,7 @@ using postprocessor commands (for example \PSTricks \verb|\rput|) as second and third arguments. The code in \FR{oax} places an opamp with three connections. -\begin{figure}[h!t] +\begin{figure}[h!b] \parbox{4in}{\small \verbatiminput{oaxbody.m4}}% \quad\raise-0.2in\hbox{\input oax }% % \vspace{-\baselineskip} @@ -1430,6 +1457,14 @@ The code in \FR{oax} places an opamp with three connections. \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] + \input XformMan + \caption{The {\tt transformer(\linespec,L|R,{\sl np},% +[A|P][W|L][D1|D2|D12|D21],{\sl ns})} + macro (drawing direction {\tt down}), showing predefined terminal + and centre-tap points.} + \label{Xform} + \end{figure} The first argument specifies the direction and distance from {\sl P1} to {\sl P2}, with position determined by the enclosing block as for opamps. The second @@ -1442,21 +1477,18 @@ if a {\tt P}, the core is dashed (powder); and if it contains a {\tt W}, wide windings are drawn. A {\tt D1} puts phase dots at the {\sl P1, S1} end, {\tt D2} at the {\sl P2, S2} ends, and {\tt D12} or {\tt D21} puts dots at opposite ends. -\begin{figure}[h!t] -% \ifpdf\vspace*{-\baselineskip}\fi% - \input XformMan -% \vspace{-\baselineskip} - \caption{The {\tt transformer(\linespec,L|R,{\sl np},% -[A|P][W|L][D1|D2|D12|D21],{\sl ns})} - macro (drawing direction {\tt down}), showing predefined terminal - and centre-tap points.} - \label{Xform} - \end{figure} -\pagebreak \FR{Audio} shows some audio devices, defined in {\tt []} blocks, with predefined internal locations as shown. -\begin{figure}[h!t] +The first argument specifies the device orientation. +Thus, +\par +{\tt S: speaker(U) with .In2 at Here} + +\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% @@ -1466,20 +1498,11 @@ with predefined internal locations as shown. earphone}, with their internally named positions and components.} \label{Audio} \end{figure} -The first argument specifies the device orientation. - -Thus, - -{\tt S: speaker(U) with .In2 at Here} - -\noindent -places an upward-facing speaker with input {\sl In2} at the -current location. 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}[h!t] +\begin{figure}[ht] % \ifpdf\vspace*{-\baselineskip}\fi \input NportMan % \ifpdf\vspace*{-\baselineskip}\fi @@ -1520,7 +1543,6 @@ immediately after drawing it but within the enclosing block: If this trick were to be used extensively, then the following custom wrapper would save typing, add the labels, and pass all arguments to {\tt nport}: -\pagebreak \begin{verbatim} define(`nullor',`nport(`$1' @@ -1529,33 +1551,21 @@ define(`nullor',`nport(`$1' \end{verbatim} The above example and the related gyrator macro are illustrated in -\FR{NLG}. -% \ifpdf\vspace*{\baselineskip}\fi% -\begin{figure}[h!t] +\FR{NLG}.\hfill\break + +\begin{figure}[ht] \input NLGMan \caption{The {\tt nullor} example and the {\tt gyrator} macro are customizations of the {\tt nport} macro.} \label{NLG} \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*{-0.5\baselineskip}\fi% - \input NPDTMan -% \ifpdf\vspace*{-0.5\baselineskip}\fi% - \caption{Multipole double-throw switches drawn by - {\tt NPDT({\sl npoles}, [R])}.} - \label{NPDT} - \end{figure} - \FR{Contact} shows the macro {\tt contact({\sl chars})}, 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}[h!t] +\begin{figure}[ht] % \ifpdf\vspace*{-\baselineskip}\else\vspace*{-0.5\baselineskip}\fi% \input ContactMan \vspace{-1ex} @@ -1565,11 +1575,9 @@ An {\tt I} in the first argument draws open circles for contacts. \label{Contact} \end{figure} -\pagebreak The {\tt contacts({\sl poles, chars})} macro in \FR{Contacts} draws multiple contacts. -\begin{figure}[h!t] -% \ifpdf\vspace*{-\baselineskip}\else\vspace*{-0.5\baselineskip}\fi% +\begin{figure}[ht] \input ContactsMan \vspace{-1ex} \caption{The {\tt contacts({\sl poles, chars})} @@ -1581,7 +1589,9 @@ 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}[h!t] + +\pagebreak +\begin{figure}[ht] % \ifpdf\vspace*{-\baselineskip}\else\vspace*{-0.5\baselineskip}\fi% \input relaycoilMan \vspace{-1ex} @@ -1591,9 +1601,8 @@ actuator types. The {\tt relay({\sl poles, chars})} macro in \FR{Relay} defines coil terminals {\sl V1, V2} and contact -terminals {\sl P$_i$, C$_i$, O$_i$.} -\begin{figure}[h!t] -% \ifpdf\vspace*{-\baselineskip}\else\vspace*{-0.5\baselineskip}\fi% +terminals {\sl P$_i$, C$_i$, O$_i$.} +\begin{figure}[ht] \input RelayMan \vspace{-1ex} \caption{The {\tt relay({\sl poles, chars})} @@ -1602,14 +1611,14 @@ terminals {\sl P$_i$, C$_i$, O$_i$.} \end{figure} The {\tt jack} and {\tt plug} macros and their defined points are - illustrated in \FR{Jack}. - The first argument of both macros establishes the drawing direction. -\begin{figure}[h!t] +illustrated in \FR{Jack}. +The first argument of both macros establishes the drawing direction. +\begin{figure}[h!] \input JackMan \vspace{-1ex} \caption{The {\tt jack(U|D|L|R|{\sl degrees}, {\sl chars})} - and {\tt plug(U|D|L|R|{\sl degrees},[2|3][R])} components - and their defined points.} + and {\tt plug(U|D|L|R|{\sl degrees},[2|3][R])} components + and their defined points.} \label{Jack} \end{figure} The second argument is a string of characters defining drawn components. @@ -1628,14 +1637,14 @@ A macro for drawing headers is in \FR{Headers}, and some experimental 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}[ht] % \ifpdf\vspace*{-0.5\baselineskip}\fi% \input HeadersMan % \ifpdf{\vspace*{-0.5ex}}\fi% \caption{Macro {\tt Header(1|2, {\sl rows, wid, ht, type})}.} \label{Headers} \end{figure} -\begin{figure}[h!t] +\begin{figure}[ht] \input ConnMan % \ifpdf{\vspace*{-0.5ex}}\fi% \caption{Macros {\tt tstrip(R|L|U|D|{\sl degrees}, {\sl chars})}, @@ -1645,7 +1654,7 @@ for width and height. \label{Conn} % \ifpdf{\vspace*{-1ex}}\fi% \end{figure} -\begin{figure}[h!t] +\begin{figure}[ht] % \ifpdf{\vspace*{-1ex}}\fi% \input PconnMan % \ifpdf{\vspace*{-0.5ex}}\fi% @@ -1655,13 +1664,23 @@ for width and height. \label{Pconn} \end{figure} -\pagebreak +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!b] + \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!b] \vspace*{-\baselineskip}% % \ifpdf\vspace*{-2\baselineskip}\else \vspace{-\baselineskip}\fi \input WindingsMan @@ -1679,7 +1698,7 @@ is first drawn and then blanked in appropriate places using the background which contains predefined internal locations {\sl E}, {\sl B}, {\sl C}. The first argument defines the distance and direction from {\sl E} -\begin{figure}[h!t] +\begin{figure}[ht] % \ifpdf\vspace*{-0.5\baselineskip}\fi% \input BipMan % \ifpdf\vspace*{-0.5\baselineskip}\fi% @@ -1694,7 +1713,7 @@ 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}[ht] \input Darlington \caption{Macro {\tt Darlington(L|R,[E][P][B1][E1|R1][E2|R2][D][Z])}, drawing direction {\tt up\_}.} @@ -1703,8 +1722,8 @@ fourth to {\tt E} draws an envelope around the device. 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] -\vspace*{-\baselineskip} +\begin{figure}[ht] +%\vspace*{-\baselineskip} \quad\quad\parbox{4in}{\small \verbatiminput{bitrbody.m4}}% \quad\raise-0.4in\hbox{\input bitr }% \vspace{-\baselineskip} @@ -1717,8 +1736,8 @@ 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] -\vspace*{-0.5\baselineskip} +\begin{figure}[ht] +%\vspace*{-0.5\baselineskip} \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 @@ -1734,7 +1753,7 @@ and a thyristor macro with predefined internal locations {\sl G} and {\sl T1,} {\sl T2,} or {\sl A,} {\sl K} is in \FR{thyristor}. Except for the {\sl G} terminal, a thyristor (the {\tt IEC} variant excluded) -\begin{figure}[h!t] +\begin{figure}[ht] % \ifpdf\vspace*{-\baselineskip}\else\vspace*{-0.5\baselineskip}\fi% \input ujtMan % \ifpdf\vspace*{-0.5\baselineskip}\fi% @@ -1768,7 +1787,7 @@ draws the element from position {\sl A} to position {\sl B} with label 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}[h!t] +\begin{figure}[ht] % \ifpdf\vspace*{-\baselineskip}\fi% \input fetMan % \ifpdf\vspace*{-\baselineskip}\fi% @@ -1806,7 +1825,7 @@ the {\tt thyristor(\linespec, {\sl chars})} macro illustrated in \FR{thyristor} is derived from the diode and bipolar transistor macros. Another example is the {\tt tgate} macro shown in \FR{Tgate}, which also shows a pass transistor. -\begin{figure}[h!t] +\begin{figure}[ht] % \ifpdf\vspace*{-\baselineskip}\fi% \input TgateMan \caption{The {\tt tgate({\sl linespec,} [B][R|L])} element, derived from @@ -1824,7 +1843,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}[ht] \input bistableMan % \vspace{-1ex} \caption{Bipolar transistor circuit, illustrating {\tt crossover} @@ -1936,7 +1955,7 @@ two-terminal element. Input locations retain their positions relative to the gate body regardless of gate orientation, as in \FR{FF}. -\begin{figure}[h!t] +\begin{figure}[ht] \vspace*{-\baselineskip} \parbox{4.75in}{\small \verbatiminput{FF.m4}}% \input FF @@ -1944,7 +1963,7 @@ regardless of gate orientation, as in \FR{FF}. \caption{$SR$ flip-flop.} \label{FF} \end{figure} -\begin{figure}[h!t] +\begin{figure}[ht] \input mplex \caption{Eight-input multiplexer, showing a gate with wings.} \label{exVIII} @@ -2018,7 +2037,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}[ht] \input Buffer \caption{The {\tt BUFFER\_gate} and {\tt BUFFER\_gen} macros. The bottom two examples show how the gate can be drawn as a two-terminal @@ -2027,28 +2046,12 @@ but requires internal locations of the block to be referenced using \label{Buffer} \end{figure} -\FR{Multiplexer} shows a multiplexer block with variations, and - \FR{Demultiplexer} shows -the very similar demultiplexer. -\begin{figure}[h!t] - \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] - \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.} - \label{Demultiplexer} - \end{figure} - \FR{FlipFlops} shows 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}[h!t] +\begin{figure}[ht] \input FlipFlop \caption{The {\tt FlipFlop} and {\tt FlipFlopX} macros, with variations.} \label{FlipFlops} @@ -2070,27 +2073,45 @@ 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] + \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] + \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.} + \label{Demultiplexer} + \end{figure} + Customized gates can be defined simply. For example, the following code defines the custom flipflops in \FR{ShiftR}. +\begin{verbatim} +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] \input ShiftRMan \caption{A 5-bit shift register.} \label{ShiftR} \end{figure} -\begin{verbatim} -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} This definition makes use of macros \verb|L_unit| and \verb|FF_ht| that predefine default dimensions. -There are three pins on the right side; the centre pin is null and +There are three pins on the right; the centre pin is null and the bottom is null if the first macro argument is 1. +\pagebreak 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}[h!t] +\begin{figure}[ht] % \ifpdf\vspace*{-\baselineskip}\fi% \input Dac % \ifpdf\vspace*{-\baselineskip}\fi% @@ -2145,7 +2166,7 @@ can be given to the \char96{}{\sl actions}\char39, {\sl value1, value2, $\ldots$})} which executes the given actions successively with - {\sl variable} = {\sl value1}, {\sl value2} $ldots$ and the + {\sl variable} = {\sl value1}, {\sl value2} $\ldots$ and the counter {\tt m4Lx} set to 1, 2, $\ldots$ as in the diagram. \xection{Element and diagram scaling\label{Scaling:}} @@ -2291,7 +2312,7 @@ A few examples will be given. 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}[h!t] +\begin{figure}[ht] \parbox{4.2in}{\tt define(`thermalsw',\hfill\break \hbox{}\space`dswitch(`\$1',`\$2',WDdBTh)\hfill\break \hbox{}\space\space circle rad distance(M4T,last line.c) @@ -2360,7 +2381,7 @@ define(`hybrid_PI_BJT', `"$\mathrm{r_o}$"' at Ro.c+vec_(hunit/4,0) `$2' ] ') \end{verbatim} -\begin{figure}[h!t] +\begin{figure}[ht] \vspace*{-0.5ex} \input HybridPi \vspace*{-0.5ex} @@ -2368,10 +2389,10 @@ define(`hybrid_PI_BJT', \label{HybridPi} \end{figure} +%\enlargethispage{\baselineskip} \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, +\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] \hfill\input Sinus @@ -2391,14 +2412,13 @@ $3,$4,$5)') \end{figure} \Example{5} -Repeated subcircuits might have different orientations -that -include only the element and its mirror image, for example, so the +Repeated subcircuits might appear only +as the subcircuit and its mirror image, for example, so the 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!t] +\begin{figure}[h!b] \input Opto \caption{Showing {\tt opto} and {\tt opto(BR)} with defined labels.} \label{Opto} @@ -2423,6 +2443,7 @@ for readability; this usage is made possible by testing the argument string using the {\tt ifinstr()} macro rather than requiring an exact match. A draft of the macro follows, and the file {\tt Optoiso.m4} in the examples directory adds a third type option. + \begin{verbatim} # `opto([R|L][A|B])' define(`opto',`[{u = dimen_/2 @@ -2470,7 +2491,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}[h!t] +\begin{figure}[ht] \input fbfilter \caption{Showing the result of two invocations of the {\tt fbfilter} macro, with labels.} @@ -2546,8 +2567,8 @@ main document source is \latex{}ed to input the diagram and format the text, and also to write the text dimensions into a supplementary file. Then the diagram source is processed again, reading the required dimensions from the supplementary file and producing a diagram ready -for final \latex{}ing. This hackery is summarized below, with an example -in \FR{stringdim}. +for final \latex{}ing. +This hackery is summarized below, with an example in \FR{stringdim}. \begin{itemize} \item Put \verb|\usepackage{boxdims}| into the document source. \item Insert the following at the beginning of the diagram source, @@ -2558,9 +2579,9 @@ in \FR{stringdim}. typeset text of known size, or alternatively, invoke the macros \verb|\boxdims| and \verb|boxdim| described later. The argument of {\tt s\_box} need not be text exclusively; it can - be anything that produces a \TeX\ box. + be anything that produces a \TeX\ box, for example, \verb|\includegraphics|. \end{itemize} -\begin{figure}[h!t] +\begin{figure}[ht] \parbox{3.5in}{\small\tt.PS\\ gen\_init\\ sinclude(Circuit\_macros.dim)\\ @@ -2649,6 +2670,8 @@ for the second time: Here is a second small example. Suppose that the file {\tt tsbox.m4} contains the following: + +\pagebreak \begin{verbatim} \documentclass{article} \usepackage{boxdims,ifpstricks(pstricks,tikz)} @@ -2682,7 +2705,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}[h!t] +\begin{figure}[ht] \parbox{4.2in}{\small \input eboxdims.verb }% \hfill\llap{\raise-0.35in\hbox{\input eboxdims }}% \vspace{-\baselineskip} @@ -2736,13 +2759,12 @@ More tricks can be played. The example \noindent shows a nice way of including eps graphics in a diagram. The included picture (named {\tt Picture} in the example) has known position and dimensions, which can be used to add vector graphics or text to the -picture. To aid in overlaying objects, the macro {\tt boxcoord(}{\sl -object name, x-fraction, y-fraction}{\tt)} 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. +picture. To aid in overlaying objects, the macro +{\tt boxcoord(}{\sl object name, x-fraction, y-fraction}{\tt)} +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. -\pagebreak \xection{\PSTricks and other tricks\label{Pstricks:}} This section applies only to a \pic processor (\dpic) that is capable of producing output compatible with @@ -2764,7 +2786,7 @@ which contains both horizontal text and text rotated $90^\circ$ along the vertical line. This rotation of text is also implemented by the macro {\tt rs\_box}, which is similar -to {\tt s\_box} but rotates its text argument by $90^\circ,$ a default angle +to {\tt s\_box} but rotates its argument by~$90^\circ,$ a default angle that can be changed by preceding invocation with \verb|define(`text_ang',|{\sl degrees}{\tt )}. The {\tt rs\_box} macro requires either \PSTricks or \TPGF and, like {\tt s\_box}, it calculates the @@ -2814,15 +2836,6 @@ macros such as {\tt rs\_box}, {\tt shade}, and {\tt rgbfill} mentioned previously can be used to hide code differences. \subsection{\Tikz\ with pic}\label{Tikzwithpic:} -%The line -% -%\vspace{\parsep} -%\noindent{\tt command "}{\sl string}{\tt "} -%\vspace{\parsep} -% -%\noindent -%allows arbitrary postprocessor code to be embedded in \pic output. However, -%one can also embed Arbitrary \pic output can be inserted into a {\tt \bsl{}tikzpicture} environment. The trick is to keep the \pic and \Tikz coordinate systems the same. @@ -2830,14 +2843,14 @@ The lines \vspace{\parsep} \noindent\verb|\begin{tikzpicture}[scale=2.54]|\\ -\noindent\verb|\end{tikzpicture}| +\noindent\verb|\end{tikzpicture}%| \vspace{\parsep} \noindent in the {\tt dpic -g} output must be changed to \vspace{\parsep} \noindent\verb|\begin{scope}[scale=2.54]|\\ -\noindent\verb|\end{scope}| +\noindent\verb|\end{scope}%| \vspace{\parsep} This is accomplished, for example, by adapting the {\tt \bsl{}mtotex} @@ -3010,6 +3023,7 @@ With raw \Postscript, \PDF, and \SVG output, the user is responsible for ensuring that the correct fonts are provided and for formatting the text. +\pagebreak Many thanks to the people who continue to send comments, questions, and, occasionally, bug fixes. What began as a tool for my own use changed into a hobby that has persisted, thanks to your help and advice. @@ -3181,6 +3195,8 @@ repaired by using an \Mfour loop: {\tt for\_(1,5,1,`s\_box(A[m4x]); move')} +Note that the loop index variable {\tt m4x} is automatically defined. + \item \bflistitem{Quotes}{quotes} Single quote characters are stripped in pairs by \Mfour, so the string @@ -3201,6 +3217,11 @@ repaired by using an \Mfour loop: not optimal or where the quotes could be omitted, and there are rare exceptions such as the {\tt parallel\_} macro. + To keep track of paired single quotes, parentheses ``{\tt (}, {\tt)},'' + braces ``\lbr, \rbr,'' and brackets ``{\tt [}, {\tt ]},'' use an editor + that highlights these pairs. For example, the vim editor highlights + single quotes with the command \verb|:set mps+=`:'|. + \item \bflistitem{Dollar signs}{dollarsigns} The $i$-th argument of an \Mfour macro is {\tt \$}$i,$ where $i$ is diff --git a/graphics/circuit_macros/doc/defines.tex b/graphics/circuit_macros/doc/defines.tex index cb3a1a5dae..fdc1f85c35 100644 --- a/graphics/circuit_macros/doc/defines.tex +++ b/graphics/circuit_macros/doc/defines.tex @@ -8,11 +8,11 @@ % \newbox\Defbox -\newcommand{\macx}[2]{% - \phantomsection\pdfbookmark[subsection]{#1}{#2}#1} +%\newcommand{\macx}[2]{% +% \phantomsection\pdfbookmark[subsection]{#1}{#2}#1} \newcommand{\macrodef}[5]{%\begin{samepage}% -\phantomsection\pdfbookmark[subsection]{#1}{#2}% +\phantomsection\pdfbookmark[subsubsection]{#1}{#2}% \setbox\Defbox=\hbox{\tt #1#3}% \ifdim\wd\Defbox>\textwidth% \setbox\Defbox=\hbox{\parbox{\textwidth}{\tt #1#3}}\fi @@ -22,12 +22,26 @@ \hbox to \libwid{#4\hfill}\parbox[t]{\rightwid}% {\raggedright #5}% % \end{samepage}% - \vspace{\parsep}\\} + \vspace{\parsep}\\}% \newcommand{\seesect}[1]{ (\SR{#1})} +\newcommand{\Letter}[1]{\noindent% + \pdfbookmark[subsection]{#1}{#1}% + \hskip-2em\hbox to 2em{#1\label{#1}\hfill}\relax}% + +\newcommand{\LR}[1]{\hyperref[#1]{{#1}}\hskip1em} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \vspace{\abovedisplayskip} \noindent +\LR{A} \LR{B} \LR{C} \LR{D} \LR{E} \LR{F} \LR{G} \LR{H} \LR{I} \LR{J} +\LR{K} \LR{L} \LR{M} \LR{N} \LR{O} \LR{P} +\LR{R} \LR{S} \LR{T} \LR{U} \LR{V} \LR{W} \LR{X} +\\ + +\Letter{A}% \macrodef{above\_}{above_}{} {gen} {string position above relative to current direction} @@ -39,8 +53,8 @@ {cct} {draw an AC symbol ( 1-cycle sine wave); If arg 4 contains A, two arcs are drawn. The current drawing direction is default, otherwise Up, Down, - Left, Right, or at {\sl degrees} slant; e.g., - {\tt ebox; $\lbrace$ ACsymbol(at last [],{,}dimen\_/8) $\rbrace$} } + Left, Right, or at {\sl degrees} slant; \seesect{Twoterminal:} e.g.,\\ + {\tt ebox; $\lbrace$ACsymbol(at last [],{,}dimen\_/8)$\rbrace$}} \macrodef{adc}{adc}{({\sl width,height,nIn,nN,nOut,nS})} {cct} {ADC with defined width, height, and number of inputs {\tt In$i$}, @@ -107,6 +121,12 @@ {\sl modifiers}) } {gen} {arc with acute angle (obtuse if radius is negative), drawn in a [ ] block} +\macrodef{ArcAngle}{ArcAngle}{({\sl position, position, position, radius, + modifiers}) } + {gen} + {Arc angle symbol drawn ccw at arg2. Arg4 is the radius from arg2; + arg5 contains line attributes, e.g., {\tt thick linethick/2}} + \macrodef{arcd}{arcd}{({\sl center}, {\sl radius},{\sl start degrees},{\sl end degrees}) } {gen} @@ -139,6 +159,29 @@ radius},[dashed|dotted])} {gen} {line toward position 1 with rounded corner toward position 2} +\macrodef{arrester}{arrester}{(\linespec,{\sl chars}, + {\sl len}[:arrowhead ht], + {\sl ht}[:arrowhead wid] )} + {cct} +{ + {\sl Arg2 chars:} + {\tt G=} spark gap (default), + {\tt g=} general (dots), + {\tt E=} gas discharge, + {\tt S=} box enclosure, + {\tt C=} carbon block, + {\tt A=} electrolytic cell, + {\tt H=} horn gap, + {\tt P=} protective gap, + {\tt s=} sphere gap, + {\tt F=} film element, + {\tt M=} multigap. + {\sl Modifiers in arg2:} + {\tt R=} right orientation, + {\tt L=} left orientation, + {\tt D=} 3-terminal element for {\tt S, E} + only, with terminals {\sl A, B, G} + \seesect{Twoterminal:}} \macrodef{arrowline}{arrowline}{(\linespec)} {cct} {line (dotted, dashed permissible) with centred arrowhead @@ -176,6 +219,7 @@ Setting {\tt offset=}{\sl value} displaces the drawn input list in order to disambiguate the input connections when {\tt L} is used} +\Letter{B}% \macrodef{b\_}{b_}{} {gen} {blue color value} @@ -276,6 +320,7 @@ {cct} {buzzer, {\sl In1} to {\sl In3} defined, C=curved \seesect{Composite:}} +\Letter{C}% \macrodef{c\_fet}{c_fet}{(\linespec,L|R,P)} {cct} {left or right, plain or negated pin simplified MOSFET} @@ -387,6 +432,7 @@ \macrodef{csdim\_}{csdim_}{} {cct} {controlled-source width} +\Letter{D}% \macrodef{d\_fet}{d_fet}{(\linespec,L|R,P,S,E|S)} {cct} {left or right, N or P depletion MOSFET, normal or simplified, @@ -473,6 +519,14 @@ \macrodef{dcosine3D}{dcosine3D}{({\sl i,x,y,z})} {3D} {extract i-th entry of triple x,y,z} +\macrodef{DCsymbol}{DCsymbol}{(at {\sl position, len, ht,} + U|D|L|R|{\sl degrees}) } + {cct} + {A DC symbol (a dashed line below a solid line). + The current drawing direction is default, otherwise Up, Down, + Left, Right, or at {\sl degrees} slant; e.g., + {\tt source(up\_ dimen\_); $\lbrace$ DCsymbol(at last [],,,R) $\rbrace$} + \seesect{Twoterminal:} } \macrodef{delay\_rad\_}{delay_rad_}{} {cct} {delay radius} @@ -510,7 +564,7 @@ {difference of two triples} \macrodef{dimen\_}{dimen_}{} {cct} - {size parameter for circuit elements \seesect{Circuitscaling:}} + {size parameter for scaling circuit element bodies \seesect{Circuitscaling:}} \macrodef{dimension\_}{dimension_}{(\linespec,{\sl offset},{\sl label}, D|H|W|{\sl blank width},{\sl tic offset},{\sl arrowhead })} {gen} @@ -653,6 +707,7 @@ B|CR|D|G|L|LE[R]|P[R]|S|Sh|T|V|v|w|Z|chars,% \macrodef{dturn}{dturn}{({\sl degrees ccw})} {darrow} {turn dline arg1 degrees left (ccw)} +\Letter{E}% \macrodef{E\_\_}{E__}{} {gen} {the constant $e$} @@ -692,14 +747,15 @@ B|CR|D|G|L|LE[R]|P[R]|S|Sh|T|V|v|w|Z|chars,% \macrodef{endshade}{endshade}{} {gen} {end gray shading, see {\tt beginshade}} -\macrodef{Equidist3}{Equidist3}{({\sl Pos1, Pos2, Pos3, Result})} +\macrodef{Equidist3}{Equidist3}{({\sl Pos1, Pos2, Pos3, Result, distance})} {gen} {Calculates location named {\sl Result} equidistant from the first three positions, i.e.\ the centre of the circle passing through the three - positions} + positions. If arg5 is nonblank, it is equated to the radius.} \macrodef{expe}{expe}{} {gen} {exponential, base $e$} +\Letter{F}% \macrodef{f\_box}{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. @@ -778,6 +834,7 @@ B|CR|D|G|L|LE[R]|P[R]|S|Sh|T|V|v|w|Z|chars,% {cct} {fuse symbol, type$=$ {\tt A|B|C|D|S|HB|HC|SB} or {\tt dA=D}\seesect{Twoterminal:}} +\Letter{G}% \macrodef{g\_}{g_}{} {gen} {green color value} @@ -809,10 +866,10 @@ B|CR|D|G|L|LE[R]|P[R]|S|Sh|T|V|v|w|Z|chars,% \macrodef{grid\_}{grid_}{({\sl x},{\sl y})} {log} {absolute grid location} -\macrodef{ground}{ground}{(at {\sl location}, T, N|F|S|L|P[A]|E, U|D|L|R|{\sl - degrees})} +\macrodef{ground}{ground}{(at {\sl location}, T|{\sl stem length}, + N|F|S|L|P[A]|E, U|D|L|R|{\sl degrees})} {cct} - { ground, without stem for nonblank 2nd arg; + { ground, without stem for 2nd arg = T; {\tt N}=normal, {\tt F}=frame, {\tt S}=signal, {\tt L}=low-noise, {\tt P}=protective, {\tt PA}=protective alternate, @@ -828,6 +885,7 @@ B|CR|D|G|L|LE[R]|P[R]|S|Sh|T|V|v|w|Z|chars,% {Gyrator two-port wrapper for {\tt nport}, {\tt N} omits pin dots; {\tt V} gives a vertical orientation \seesect{Composite:}} +\Letter{H}% \macrodef{H\_ht}{H_ht}{} {log} {hysteresis symbol dimension in {\tt L\_unit}s} @@ -867,6 +925,7 @@ n|e|s|w,{\sl length})} \macrodef{ht\_}{ht_}{} {gen} {height relative to current direction} +\Letter{I}% \macrodef{ifdpic}{ifdpic}{({\sl if true},{\sl if false})} {gen} {test if dpic has been specified as pic processor} @@ -942,6 +1001,7 @@ n|e|s|w,{\sl length})} along the line; {\tt P}= label only; {\tt N}=with {\tt NOT\_circle}; {\tt R}=circle to right of current direction } +\Letter{J}% \macrodef{j\_fet}{j_fet}{(\linespec,L|R,P,E)} {cct} {left or right, N or P JFET, without or with envelope @@ -952,10 +1012,12 @@ n|e|s|w,{\sl length})} one or more {\tt L[M][B]} for L and auxiliary contacts with make or break points; {\tt S[M][B]} for S and auxiliary contacts \seesect{Composite:}} +\Letter{K}% \macrodef{KelvinR}{KelvinR}{({\sl cycles},[R],{\sl cycle wid})} {cct} {IEEE resistor in a {\tt [ ]} block with Kelvin taps {\sl T1} and {\sl T2} \seesect{Composite:}} +\Letter{L}% \macrodef{L\_unit}{L_unit}{} {log} {logic-element grid size} @@ -1073,6 +1135,7 @@ n|e|s|w,{\sl length})} \macrodef{lthick}{lthick}{} {gen} {current line thickness in drawing units} +\Letter{M}% \macrodef{m4\_arrow}{m4_arrow}{(\linespec,{\sl ht},{\sl wid})} {gen} {arrow with adjustable head, filled when possible} @@ -1169,6 +1232,7 @@ n|e|s|w,{\sl length})} \macrodef{Mx\_pins}{Mx_pins}{} {log} {max number of gate inputs without wings} +\Letter{N}% \macrodef{n\_}{n_}{} {gen} {.n with respect to current direction} @@ -1254,6 +1318,7 @@ nw,nn,ne,ns,pin lgth,style, other commands})} Otherwise, arg1 can be a sequence of letters {\tt P|N} to define normal or negated inputs. \seesect{Logicgates:}} +\Letter{O}% \macrodef{opamp}{opamp}{(\linespec,{\sl label},{\sl label},{\sl size},{\sl chars}, other commands)} {cct} @@ -1283,6 +1348,7 @@ nw,nn,ne,ns,pin lgth,style, other commands})} \macrodef{OR\_rad}{OR_rad}{} {log} {radius of OR input face in {\tt L\_unit}s} +\Letter{P}% \macrodef{parallel\_}{parallel_}{(\char96{\sl elementspec}\char39,% \char96{\sl elementspec}\char39 $\ldots$)} {cct} @@ -1339,12 +1405,19 @@ nw,nn,ne,ns,pin lgth,style, other commands})} \macrodef{point\_}{point_}{({\sl angle})} {gen} {(radians) set direction cosines} +\macrodef{PerpTo}{PerpTo}{({\sl Pos1, Line, Point})} + {gen} + {{\sl Point} is the label for the point on {\sl Line} of the perpendicular + from {\sl Point} to {\sl Line}.} \macrodef{Point\_}{Point_}{({\sl integer})} {gen} {sets direction cosines in degrees \seesect{Placing:}} \macrodef{polar\_}{polar_}{({\sl x},{\sl y})} {gen} {rectangular-to polar conversion} +\macrodef{langle}{langle}{({\sl Start, End})} + {gen} + {Angle in radians from horizontal of the line from {\sl Start} to {\sl End}.} \macrodef{potentiometer}{potentiometer}{(\linespec,% {\sl cycles},{\sl fractional pos},{\sl length},$\cdots$)} {cct} @@ -1371,6 +1444,7 @@ nw,nn,ne,ns,pin lgth,style, other commands})} {cct} {pass transistor; {\tt L=} left orientation \seesect{Semiconductors:}} +\Letter{R}% \macrodef{r\_}{r_}{} {gen} {red color value} @@ -1450,9 +1524,12 @@ nw,nn,ne,ns,pin lgth,style, other commands})} {reverse polarity of 2-terminal element} \macrodef{rgbdraw}{rgbdraw}{({\sl color triple}, {\sl drawing commands})} {gen} - {color drawing for PSTricks, pgf, MetaPost, svg postprocessors; + {color drawing for PSTricks, pgf, MetaPost, SVG postprocessors; (color entries are 0 to 1 except for SVG entries which are 0 to 255), - see {\tt setrgb} \seesect{Semiconductors:}} + see {\tt setrgb} \seesect{Semiconductors:}. + Exceptionally, the color of + SVG arrows other than the default black has to be defined using + the {\tt outlined }{\sl string} and {\tt shaded }{\sl string} constructs.} \macrodef{rgbfill}{rgbfill}{({\sl color triple}, {\sl closed path})} {gen} {fill with arbitrary color (color entries are 0 to 1 except @@ -1470,6 +1547,11 @@ nw,nn,ne,ns,pin lgth,style, other commands})} \macrodef{right\_}{right_}{} {gen} {set current direction right \seesect{Placing:}} +\macrodef{RightAngle}{RightAngle}{({\sl Pos1, Pos2, Pos3, line len, + attributes})} + {gen} + {Draw a right-angle symbol at {\sl Pos2}, of size given by arg4. Arg5 = + line attributes, e.g., {\tt outlined "gray"}} \macrodef{rjust\_}{rjust_}{} {gen} {right justify with respect to current direction} @@ -1538,6 +1620,7 @@ nw,nn,ne,ns,pin lgth,style, other commands})} \macrodef{rvec\_}{rvec_}{({\sl x},{\sl y})} {gen} {location relative to current direction} +\Letter{S}% \macrodef{s\_}{s_}{} {gen} {.s with respect to current direction} @@ -1611,6 +1694,12 @@ nw,nn,ne,ns,pin lgth,style, other commands})} {gen} {define colour for lines and text, optionally named (default {\tt lcspec}); svg values are integers from 0 to 255\seesect{Semiconductors:}} +\macrodef{setkey\_}{setkey_}{({\sl string, key, default,}[N])} + {gen} + {Key-value definition. The string contains semicolon-separated terms + of the form {\sl key}{\tt =}{\sl value}. Then macro {\tt m4{\sl key}} + is defined using {\tt pushdef} to be {\tt ({\sl value})} but if arg4 is + nonbland, the parentheses are omitted.} \macrodef{setview}{setview}{({\sl azimuth degrees},{\sl elevation degrees})} {3D} {set projection viewpoint} @@ -1784,6 +1873,7 @@ nw,nn,ne,ns,pin lgth,style, other commands})} if arg4=B (button switch): arg3 = O{\tt|}C O=normally open, C=normally closed, if arg4=D: arg3 = same as for dswitch \seesect{Twoterminal:}} +\Letter{T}% \macrodef{ta\_xy}{ta_xy}{({\sl x, y})} {cct} {macro-internal coordinates adjusted for {\tt L|R}} @@ -1901,6 +1991,7 @@ nw,nn,ne,ns,pin lgth,style, other commands})} \macrodef{twopi\_}{twopi_}{} {gen} {$2\pi$} +\Letter{U}% \macrodef{ujt}{ujt}{(\linespec,R,P,E)} {cct} {unijunction transistor, right, P-channel, envelope @@ -1914,6 +2005,7 @@ nw,nn,ne,ns,pin lgth,style, other commands})} \macrodef{up\_}{up_}{} {gen} {set current direction up \seesect{Placing:}} +\Letter{V}% \macrodef{variable}{variable}{(`{\sl element}', {\tt [A|P|L|[u]N|[u]NN][C|S]},{\sl angle},{\sl length})} {cct} @@ -1961,6 +2053,7 @@ nw,nn,ne,ns,pin lgth,style, other commands})} {gen} {{\tt Vsum\_(A,B)} evaluates to {\tt A+B} with dpic, {\tt A+(B.x,B.y)} with gpic} +\Letter{W}% \macrodef{w\_}{w_}{} {gen} {.w with respect to current direction} @@ -1984,6 +2077,7 @@ nw,nn,ne,ns,pin lgth,style, other commands})} \macrodef{XOR\_off}{XOR_off}{} {log} {XOR and NXOR offset of input face} +\Letter{X}% \macrodef{xtal}{xtal}{(\linespec)} {cct} {quartz crystal\seesect{Twoterminal:}} |