diff options
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.tex | 203 |
1 files changed, 110 insertions, 93 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 91c8fbe3ec6..38aff51f3b8 100644 --- a/Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex +++ b/Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex @@ -82,9 +82,8 @@ combinations of them for particular drawings. \xection{Using the macros\label{Using:}} This section describes the basic process of adding circuit diagrams to \latex documents to produce postscript or pdf files. On some operating -systems, project management software with graphical interfaces can be used -to automate the process, -but the steps can also be performed by a script, +systems, project management software with graphical interfaces can +automate the process, but the steps can also be performed by a script, makefile, or by hand for simple documents as described in~\SR{Quickstart:}. The diagram source file is preprocessed as illustrated in @@ -836,9 +835,10 @@ The two-terminal elements are shown in \FRS{CctTable} to~\REF{Diodes} and \FRS{Fuses} to~\REF{Switches}. Several elements are included more than once to illustrate some of their arguments, which are listed in \SR{defines}. +\enlargethispage{\baselineskip} \begin{figure}[h!] \input CctTable - \ifpdf\vspace*{-0.5\baselineskip}\fi% + \ifpdf\vspace*{-\baselineskip}\fi% \caption{Basic two-terminal elements, showing some variations.} \label{CctTable} \end{figure} @@ -1446,18 +1446,6 @@ A {\tt D1} puts phase dots at the {\sl P1, S1} end, {\tt D2} at the and centre-tap points.} \label{Xform} \end{figure} -\iffalse -A transformer with four connections is illustrated -in \FR{tran}. -\begin{figure}[hbt] - \parbox{4in}{\small \verbatiminput{tranbody.m4}}% - \quad\raise-0.2in\hbox{\input tran }% - \vspace{-\baselineskip} - \caption{Showing the - {\tt transformer(\linespec,L|R,np,A,ns)} macro.} - \label{tran} - \end{figure} -\fi %\enlargethispage{\baselineskip} \FR{Audio} shows some audio devices, defined in {\tt []} blocks, @@ -1479,7 +1467,6 @@ Thus, {\tt S: speaker(U) with .In2 at Here} \noindent -%\enlargethispage{\baselineskip} places an upward-facing speaker with input {\sl In2} at the current location. @@ -1536,63 +1523,79 @@ define(`nullor',`nport(`$1' The above example and the related gyrator macro are illustrated in \FR{NLG}. + \ifpdf\vspace*{\baselineskip}\fi% \begin{figure}[h!t] \input NLG - \ifpdf\vspace*{-1.5\baselineskip}\fi% \caption{The {\tt nullor} example and the {\tt gyrator} macro are customizations of the {\tt nport} macro.} \label{NLG} \end{figure} -A basic winding macro for magnetic-circuit sketches and similar figures -is shown in \FR{Windings}. +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] - \vspace*{-\baselineskip}% -% \ifpdf\vspace*{-2\baselineskip}\else \vspace{-\baselineskip}\fi - \input Windings - \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. - Setting the first argument to {\tt R} draws a right-hand winding.} - \label{Windings} + \ifpdf\vspace*{-0.5\baselineskip}\fi% + \input NPDT + \ifpdf\vspace*{-0.5\baselineskip}\fi% + \caption{Multipole double-throw switches drawn by + {\tt NPDT({\sl npoles}, [R])}.} + \label{NPDT} \end{figure} -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!). -\FR{Relay} shows the macro {\tt contact({\sl chars})}, +\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. -The macro {\tt relay({\sl poles, chars})} -defines coil terminals {\sl V1, V2} and contact -terminals {\sl P$_i$, C$_i$, O$_i$.} -\begin{figure}[ht] +\begin{figure}[h!t] \ifpdf\vspace*{-\baselineskip}\else\vspace*{-0.5\baselineskip}\fi% - \input Relay + \input Contact \vspace{-1ex} \caption{The {\tt contact({\sl chars})} - and {\tt relay({\sl poles, chars})} - macros (default direction right).} - \label{Relay} + macro (default drawing direction right) + can be used alone, in a set of ganged contacts, or in relays.} + \label{Contact} \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. +The {\tt contacts({\sl poles, chars})} macro in \FR{Contacts} +draws multiple contacts. \begin{figure}[h!t] - \ifpdf\vspace*{-0.5\baselineskip}\fi% - \input NPDT - \ifpdf\vspace*{-0.5\baselineskip}\fi% - \caption{Multipole double-throw switches drawn by - {\tt NPDT({\sl npoles}, [R])}.} - \label{NPDT} + \ifpdf\vspace*{-\baselineskip}\else\vspace*{-0.5\baselineskip}\fi% + \input Contacts + \vspace{-1ex} + \caption{The {\tt contacts({\sl poles, chars})} + macro (drawing direction right).} + \label{Contacts} + \end{figure} + +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] + \ifpdf\vspace*{-\baselineskip}\else\vspace*{-0.5\baselineskip}\fi% + \input relaycoil + \vspace{-1ex} + \caption{The {\tt relaycoil} macro.} + \label{relaycoil} + \end{figure} + +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% + \input Relay + \vspace{-1ex} + \caption{The {\tt relay({\sl poles, chars})} + macro (drawing direction right).} + \label{Relay} \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] \input Jack \vspace{-1ex} @@ -1601,21 +1604,11 @@ The {\tt jack} and {\tt plug} macros and their defined points are and their defined points.} \label{Jack} \end{figure} - The first argument of both macros - establishes the drawing direction. The second argument is a string of - characters defining drawn components. + 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. The two principal terminals of the jack are included by putting \hbox{{\tt L} {\tt S}} -% -% This is a kludge to put a blank line on the bottom -\phantom{or both into the string with associated make ({\tt M}) -or break ({\tt B}) points. Thus, {\tt LMB} within the third}\hfill\break -\phantom{or both into the string with associated make ({\tt M}) -or break ({\tt B}) points. Thus, {\tt LMB} within the third}\hfill\break -% -% or both into the string with associated make ({\tt M}) or break ({\tt B}) points. Thus, {\tt LMB} within the third argument draws the {\tt L} contact with @@ -1623,10 +1616,26 @@ or break ({\tt B}) points. Thus, {\tt LMB} within the third}\hfill\break or {\tt S[M|B]} substrings add auxiliary contacts with specified make or break points. -%\pagebreak +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] + \vspace*{-\baselineskip}% +% \ifpdf\vspace*{-2\baselineskip}\else \vspace{-\baselineskip}\fi + \input Windings + \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. + Setting the first argument to {\tt R} draws a right-hand winding.} + \label{Windings} + \end{figure} + 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 +The {\tt tstrip} macro allows ``{\sl key}{\tt =}{\sl value}{\tt ;}'' arguments \begin{figure}[h!t] \ifpdf\vspace*{-0.5\baselineskip}\fi% \input Headers @@ -1655,21 +1664,23 @@ for width and height. \label{Pconn} \end{figure} +\pagebreak \subsection{Semiconductors\label{Semiconductors:}}% \FR{Bip} shows the variants of bipolar transistor macro {\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} to {\sl C,} with location determined by the enclosing -block as for other elements, and the base placed -\begin{figure}[h!b] +The first argument defines the distance and direction from {\sl E} +\begin{figure}[h!t] \ifpdf\vspace*{-0.5\baselineskip}\fi% \input Bip \ifpdf\vspace*{-0.5\baselineskip}\fi% - \caption{Bipolar transistor variants (current direction upward).} + \caption{Variants of bipolar transistor {\tt bi\_tr(\linespec,L|R,P,E)} + (current direction upward).} \label{Bip} \end{figure} +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 @@ -1708,6 +1719,7 @@ 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}, and a thyristor macro with predefined internal locations @@ -1748,6 +1760,19 @@ 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] + \ifpdf\vspace*{-\baselineskip}\fi% + \input fet + \ifpdf\vspace*{-\baselineskip}\fi% + \caption{JFET, insulated-gate enhancement and depletion MOSFETs, + and simplified versions. + These macros are wrappers that invoke the {\tt mosfet} + macro as shown in the middle and bottom rows. + The two lower-right examples show custom devices, the first + defined by omitting the substrate connection, and the second + defined using a wrapper macro.} + \label{fet} + \end{figure} In all cases the first argument is a linespec, and entering {\tt R} as the second argument orients the {\sl G} terminal to the right of the @@ -1765,21 +1790,8 @@ The obsolete letter {\tt L} is equivalent to {\tt dM} and has been kept temporarily for compatibility. This system allows considerable freedom in choosing or customizing components, as illustrated in \FR{fet}. -\begin{figure}[h!t] - \ifpdf\vspace*{-\baselineskip}\fi% - \input fet - \ifpdf\vspace*{-\baselineskip}\fi% - \caption{JFET, insulated-gate enhancement and depletion MOSFETs, - and simplified versions. - These macros are wrappers that invoke the {\tt mosfet} - macro as shown in the middle and bottom rows. - The two lower-right examples show custom devices, the first - defined by omitting the substrate connection, and the second - defined using a wrapper macro.} - \label{fet} - \end{figure} -\pagebreak +%\pagebreak 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. For example, @@ -1904,7 +1916,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!t] +\begin{figure}[h!] \input Logic \caption{Basic logic gates. The input and output locations of a three-input NOR gate are shown. Inputs are negated by @@ -1932,7 +1944,6 @@ regardless of gate orientation, as in \FR{FF}. \end{figure} Beyond a default number (6) of inputs, the gates are given wings as in \FR{exVIII}. -\pagebreak Negated inputs or outputs are marked by circles drawn using the \verb|NOT_circle| macro. The name marks the point at the outer edge of the circle and the circle itself has the same name prefixed by~{\tt N\_}. @@ -1986,7 +1997,7 @@ but requires internal locations of the block to be referenced using \label{Buffer} \end{figure} -\pagebreak +%\pagebreak A good strategy for drawing complex logic circuits might be summarized as follows: \begin{itemize}\itemsep=0pt @@ -2027,16 +2038,19 @@ the very similar demultiplexer. \end{figure} \FR{FlipFlops} shows -the macro {\tt FlipFlop(D|T|RS|JK, {\sl label, boxspec})}, which is a +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}{\tt )}. +leftpins, toppins, rightpins, bottompins, pinlength}{\tt )}. \begin{figure}[h!t] \input FlipFlop \caption{The {\tt FlipFlop} and {\tt FlipFlopX} macros, with variations.} \label{FlipFlops} \end{figure} +The first argument modifies the box (labelled Chip) default specification. Each of arguments 3 to 6 is null or a string of {\sl pinspecs} separated -by semicolons ({\tt;}). {\sl Pinspecs} are either empty (null) or of the form +by semicolons ({\tt;}). +A {\sl pinspec} is either empty (null) or of the form {\tt[}{\sl pinopts}{\tt]:[}{\sl label}{\tt[:}{\sl Picname}{\tt]]}. The first colon draws the pin. Pins are placed top to bottom or left to right along the box edges with @@ -2045,10 +2059,12 @@ by default; eg {\tt W1, W2, ..., N1, N2, ..., E1, ..., S1, ...} ; however, if {\tt:}{\sl Picname} is present in a {\sl pinspec} then {\sl Picname} replaces the default name. A {\sl pinspec} label is text placed at the pin base. Semicolons are -not allowed in labels; use eg \verb|\char59{}| instead, and to put a bar over +not allowed in labels; use e.g., \verb|\char59{}| instead. To put a bar over 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. +Option argument 7 is the pin length in drawing units. +\pagebreak Customized gates can be defined simply. For example, the following code defines the custom flipflops in \FR{ShiftR}. \begin{figure}[h!t] @@ -2070,7 +2086,7 @@ 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] - \ifpdf\vspace*{-\baselineskip}\fi% +% \ifpdf\vspace*{-\baselineskip}\fi% \input Dac \ifpdf\vspace*{-\baselineskip}\fi% \caption{The {\tt dac({\sl width,height},nIn,nN,nOut,nS)} @@ -2081,7 +2097,6 @@ of which can be specified as macro arguments. In addition to the logic gates described here, some experimental IC chip diagrams are included with the distributed example files. -\pagebreak \xection{Element and diagram scaling\label{Scaling:}} There are several issues related to scale changes. You may wish to use @@ -2220,6 +2235,7 @@ 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 %\enlargethispage{\baselineskip} %\noindent\hbox{}\\ {\bf Example 1:} %\par\noindent {\bf Example 1:} @@ -2227,9 +2243,9 @@ 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!] +\begin{figure}[h!t] \parbox{4.2in}{\tt define(`thermalsw',\hfill\break - \hbox{}\space`dswitch(`\$1',`\$2',WDdBT)\hfill\break + \hbox{}\space`dswitch(`\$1',`\$2',WDdBTh)\hfill\break \hbox{}\space\space circle rad distance(M4T,last line.c) at last line.c ') }% \hfill\raise-0.15in\hbox{\input Thermal } @@ -2252,6 +2268,7 @@ a subcircuit that is replicated several times to generate \FR{Tline}. \label{Tline} \end{figure} +\pagebreak \Example{3} %\par\noindent {\bf Example 3:} Composite elements containing several basic elements may be |