summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/doc/body.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/circuit_macros/doc/body.tex')
-rw-r--r--graphics/circuit_macros/doc/body.tex94
1 files changed, 54 insertions, 40 deletions
diff --git a/graphics/circuit_macros/doc/body.tex b/graphics/circuit_macros/doc/body.tex
index b6b9ca0dde..79827bb2e4 100644
--- a/graphics/circuit_macros/doc/body.tex
+++ b/graphics/circuit_macros/doc/body.tex
@@ -64,7 +64,7 @@ processed by \Mfour and a \pic processor to
convert them to \TPGF, \PSTricks, other \latex-compatible code, \SVG,
or other formats.
In its basic usage, the method has the advantages and disadvantages of
-\tex itself, since it is macro-based and non-WYSIWYG,
+\tex itself since it is macro-based and non-WYSIWYG,
with ordinary text input. The book from which the above quotation
is taken correctly points out that the payoff can be in quality of
diagrams at the price of the time spent in drawing them.
@@ -73,7 +73,7 @@ A collection of basic components, most based on IEC and IEEE
standards~\cite{IECstd,IEEEstd},
and conventions for their internal
structure are described. Macros such as these are only a starting
-point, since it is often convenient to customize elements or to package
+point since it is often convenient to customize elements or to package
combinations of them for particular drawings or contexts,
a process for which \Mfour\ and \pic\ are well suited.
@@ -126,11 +126,11 @@ in \FR{quick} to illustrate the language and the production of basic
labeled circuits.
\begin{figure}[ht]
\parbox{\textwidth}{\small\verbatiminput{quick.m4}}%
- \hfill\llap{\raise-1.15in\hbox{\input quick }}%
- \vspace*{-\baselineskip}%
+ \hfill\llap{\raise-1in\hbox{\input quick }}%
+% \vspace*{-\baselineskip}%
\caption{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
+ nodes (example: {\tt Origin: Here}) 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
can be varied and non-two-terminal elements included (\FR{QTrans})
@@ -501,7 +501,8 @@ truncates the line by {\tt x} at the start and {\tt y} at the end.
Any of the above means of specifying line (or arrow) direction and length
will be called a \linespec.
-Lines can be concatenated. For example, to draw a triangle:
+Lines can be concatenated to create multsegmented objects.
+For example, to draw a triangle:
{\tt line up\_ sqrt(3) right\_ 1 then down\_ sqrt(3) right\_ 1 then left\_ 2}
@@ -903,11 +904,11 @@ The first macro argument specifies the
\begin{figure}[H]
\input ResistorsMan
\caption{Resistors drawn by the macro
- {\tt resistor({\sl linespec, n}|E, {\sl chars}, {\sl cycle wid})}.
- The second argument is either an integer to specify number of cycles,
- the letter {\tt E}, or blank. The third argument specifies the desired
- variant.
- The default {\tt ebox} element designates a resistor.}
+ {\tt resistor({\sl linespec, n}, {\sl chars}, {\sl cycle wid})}.
+ The second argument is either an integer to specify number of cycles
+% the letter {\tt E},
+ or blank. The third argument specifies the desired variant.
+ The default {\tt ebox} element designates a box resistor.}
\label{Resistors}
\end{figure}
\noindent%
@@ -936,7 +937,7 @@ See \SR{Composite:} for the {\tt variable} macro.
\label{Capacitors}
\end{figure}
-Basic inductors are illustrated in \FR{Inductors}.
+Inductors are illustrated in \FR{Inductors}.
\begin{figure}[H]
\input InductorsMan
\caption{Basic inductors created with the
@@ -992,7 +993,8 @@ to draw a single cycle of a sinusoid or approximate sinusoid.
\begin{figure}[hbt]
\input SourcesMan
\caption{Sources and source-like elements. An argument of each
- element allows customization such as shading.}
+ element allows customization such as shading. The {\tt geiger}
+ macro is a wrapper for {\tt source}.}
\label{Sources}
\end{figure}
As a convenience,
@@ -1270,6 +1272,8 @@ The macro {\tt eleminit\_} in the two-terminal elements invokes
to establish element length and direction.
As shown in \FR{Oblique},
+``{\tt Point\_(-30); resistor}'' draws a resistor
+along a line with slope of~-30 degrees,
\begin{figure}[hbt]
\vspace{-\baselineskip}
\parbox{4.5in}{\small \verbatiminput{Oblique.m4}}%
@@ -1278,8 +1282,7 @@ As shown in \FR{Oblique},
\caption{Illustrating elements drawn at oblique angles.}
\label{Oblique}
\end{figure}
-``{\tt Point\_(-30); resistor}'' draws a resistor
-along a line with slope of~-30 degrees, and ``{\tt rpoint\_(to Z)}'' sets
+and ``{\tt rpoint\_(to Z)}'' sets
the current direction cosines to point from the current location to location Z.
Macro {\tt vec\_(x,y)}
evaluates to the position {\tt (x,y)} rotated as defined by the
@@ -1419,19 +1422,22 @@ the {\tt ground} macro, for example:
include a transformer, a composite element described in detail below,
followed by code for the figure.
\begin{figure}[H]
-% \vspace*{-\baselineskip}
-% \parbox{4in}{\small \verbatiminput{QTrans.m4}}%
-% \hspace*{-0.45in}\raise-0.15in\hbox{\input QTrans }
-% \vspace*{-\baselineskip}
\input Qtrans
\caption{The file {\tt quick.m4} modified to include a composite
element, the transformer, which is positioned by placing an
- internal point.}
-% transformer, of which the length and orientation of connectors
-% is given by the first argument, and which is positioned in this
-% example by placing the internal position {\sl P1.}}
+ internal point, thus:
+ {\tt T1:~transformer(down\_ Vs.len,{},6,{},4) with .P1 at Here}.}
\label{QTrans}
\end{figure}
+%\begin{figure}[H]
+% \parbox{\textwidth}{\small\verbatiminput{Qtrans.m4}}%
+% \hfill\llap{\raise-1in\hbox{\input Qtrans }}%
+% \caption{The file {\tt quick.m4} modified to include a composite
+% element, the transformer, which is positioned by placing an
+% internal point, thus:
+% {\tt T1:~transformer(down\_ Vs.len,{},6,{},4) with .P1 at Here}.}
+% \label{QTrans}
+% \end{figure}
\FR{Xform} shows variants of the transformer macro,
which has predefined internal locations
@@ -1457,12 +1463,12 @@ puts dots at opposite ends.
\end{figure}
The code for \FR{QTrans} is reproduced in the following.
-Label {\sl Vs} has been added for later reference.
-The transformer is positioned by placing internal position {\sl P1.}
+%Label {\sl Vs} has been added for later reference.
+The transformer is positioned by placing internal point {\sl P1.}
\verbatiminput{QTrans.m4}
-The macro {\tt
- potentiometer(\linespec,{\sl cycles},{\sl fractional pos},{\sl length},
+Another composite element,
+ {\tt potentiometer(\linespec,{\sl cycles},{\sl fractional pos},{\sl length},
$\ldots$)},
shown in \FR{Potentiometers},
first draws a resistor along the specified line, then adds arrows for taps
@@ -1983,6 +1989,7 @@ A macro is also provided for colored fills:
\noindent%
These macros depend heavily on the postprocessor and are intended only for
\PSTricks, \TPGF, \MetaPost, \SVG, and the Postscript or PDF output of \dpic.
+Their effects are fragile in some situations.
Basic \Pic\ objects are probably best colored and filled as discussed
in \SR{Planarobjects:}.
@@ -2056,7 +2063,9 @@ of input locations {\tt In1,} $\ldots$ {\tt In}$N,$ as illustrated
for the NOR gate in the figure. 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.
+specification of a two-terminal element. Alternately, the first argument
+can be a sequence of letters {\tt P} or {\tt N} to define a number of
+normal or negated ({\tt Not}-circled) inputs.
\begin{figure}[H]
\vspace*{-0.5\baselineskip}
\input LogicMan
@@ -3068,7 +3077,7 @@ respectively, and {\tt custombox} evaluates to
{\tt B1:\ box wid (2) ht (boxht) "Hello"}.
The key prefix {\tt m4} of the automatically created parameter macros can be
-redefined if necessary, since it is given in the distribution by the line
+redefined if necessary since it is given in the distribution by the line
{\tt define(`key\_prefix',`m4')}.
@@ -3550,10 +3559,10 @@ packages available these days? It would depend on the context, but
and read but powerful enough (that is, Turing-complete) for coding the
geometrical calculations required for precise component sizing and
placement. It would be nice if arbitrary rotations and scaling were
-simpler and if a general path element with clipping were available
-as in \Postscript. However, all the power of \Postscript or \TPGF,
-for example, remains available, as arbitrary postprocessor code can be
-included with \pic code.
+simpler, if a general path element with clipping were available as in
+\Postscript, and if adding color across postprocessors were easier.
+However, all the power of \Postscript or \TPGF, for example, remains
+available, as arbitrary postprocessor code can be included with \pic code.
The \dpic interpreter has several output-format options that may be
useful. The {\tt eepicemu} and {\tt pict2e} extensions of the
@@ -3568,13 +3577,12 @@ editor, but SVG can also be used directly for web pages.
\Dpic will also generate low-level \MetaPost or \Postscript code, so
that diagrams defined using \pic can be manipulated and combined with
others.
-I learned to great benefit that the \Postscript output can be imported into
-CorelDraw and Adobe Illustrator for further processing,
-so that detailed diagram components produced by pic program can be combined
-with effects best acheived using a wysiwyg drawing program.
-With raw \Postscript, \PDF, and \SVG output however, the user is
-responsible for ensuring that the correct fonts are provided and for
-formatting the text.
+I learned to great benefit that the \Postscript output can be imported
+into CorelDraw and Adobe Illustrator for further processing, so that
+detailed diagram components produced by pic program can be combined
+with effects best acheived using a wysiwyg drawing program. With raw
+\Postscript, \PDF, and \SVG output however, the user is responsible for
+ensuring that the correct fonts are provided and for formatting the text.
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
@@ -3759,6 +3767,12 @@ Note that the loop index variable {\tt m4x} is automatically defined.
\noindent The cure is to add single quotes in pairs as necessary.
+ If text containing single quote characters causes difficulties
+ then replace the \LaTeX\ single quote by {\tt \bsl{}char39}
+ or disable the m4 quote characters temporarily as shown:
+
+ {\tt changequote(,)} {\sl text containing single quotes} {\tt changequote(`,)}
+
The only subtlety required in writing
\Mfour macros is deciding when to quote macro arguments. In the context
of circuits it seemed best to assume that arguments would not