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.tex61
1 files changed, 39 insertions, 22 deletions
diff --git a/graphics/circuit_macros/doc/body.tex b/graphics/circuit_macros/doc/body.tex
index 0fd36ecb5c..0acc9dc2ec 100644
--- a/graphics/circuit_macros/doc/body.tex
+++ b/graphics/circuit_macros/doc/body.tex
@@ -115,6 +115,7 @@ only with \dpic.
concepts applied here do not require \Mfour.
\subsection{Quick start\label{Quickstart:}}
+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,
@@ -507,10 +508,11 @@ Lines can be concatenated. For example, to draw a triangle:
{\tt line up\_ sqrt(3) right\_ 1 then down\_ sqrt(3) right\_ 1 then left\_ 2}
\subsection{Positions\label{Positions:}}
-A {\sl position} can be defined by a coordinate pair, e.g. {\tt 3,2.5},
+A {\sl position} can be defined by a coordinate pair;
+ e.g., {\tt 3,2.5},
more generally using parentheses by {\tt (}{\sl expression, expression}{\tt )},
-as a sum or difference as
-{\tt{\sl position} $+$ ({\sl expression, expression})},
+as a sum or difference;
+ e.g., {\tt{\sl position} $+$ ({\sl expression, expression})},
or by the construction {\tt (}{\sl position, position}{\tt )},
the latter taking the $x$-coordinate from the first
position and the $y$-coordinate from the second. A position can be
@@ -657,6 +659,8 @@ two words, one above the other, at the centre of an ellipse:
The C-like \pic function
{\tt sprintf("{\sl format string}",{\sl numerical arguments})}
is equivalent to a string.
+(Its implementation passes arguments singly to the C {\tt snprintf}
+function).
\subsection{Compound objects\label{Compoundobjects:}}
A compound object is a group of statements enclosed in square
@@ -915,6 +919,7 @@ Some more basic elements are in \FR{MoreTable}, and amplifiers in \FR{AmpTable}.
\label{MoreTable}
\end{figure}
\begin{figure}[h!t]
+\vspace*{-\baselineskip}
\input AmpTableMan
\caption{Amplifier, delay, and integrator.}
\label{AmpTable}
@@ -1122,11 +1127,11 @@ also can be specified.
For those who prefer a separate arrow to indicate the reference
direction for current, the macros {\tt larrow({\sl label}, ->|<-,{\sl dist})}
and {\tt rarrow({\sl label}, ->|<-,{\sl dist})} are provided. The label is
-placed outside the arrow as shown in \FR{currents}. The first
-argument is assumed to be in math mode unless
+placed outside the arrow as shown in \FR{currents}.
+The first argument is assumed to be in math mode unless
it begins with {\tt sprintf} or a double
-quote, in which case the argument is copied literally. The third argument
-specifies the separation from the element.
+quote, in which case the argument is copied literally.
+The third argument specifies the separation from the element.
\subsection{Labels\label{Labels:}}
Arbitrary labels
@@ -2235,11 +2240,11 @@ which executes the given actions successively with
There are several issues related to scale changes. You may wish to use
millimetres, for example, instead of the default inches. You may wish
to change the size of a complete diagram while keeping the relative
-proportions of objects within it. You may wish to change the sizes or
-proportions of individual elements within a diagram. You must take
-into account that line widths are scaled separately from drawn objects,
-and that the size of typeset text is independent of the \pic language
-except when svg is being produced.
+proportions of objects within it. You may wish to change the sizes
+or proportions of individual elements within a diagram. You must take
+into account that the size of typeset text is independent of the \pic
+language except when svg is being produced, and that line widths are
+independent of the scaling of drawn objects.
The scaling of circuit elements will be described first, then
the \pic scaling facilities.
@@ -2597,7 +2602,7 @@ placed by specifying the position of one of its defined points; by
default it will be placed as if it were a box.
\fi
-\subsection{Macro arguments\label{Marcroarguments:}}
+\subsection{Macro arguments\label{Macroarguments:}}
Macro parameters are defined
by entering them into specific arguments, and if an argument is blank then
a default parameter is used.
@@ -2626,13 +2631,11 @@ Then for example in a macro, the line
{\tt setkey\_( `\$2', wdth, dimen\_*2 )}
\noindent
-checks argument 2 for a term {\tt wdth=}{\sl value} and defines
-the macro {\tt m4wdth} to evaluate to
-{\tt (dimen\_*2)} if not found,
-otherwise to {\tt ({\sl value}).}
-The enclosing parentheses are omitted if the
-third argument of {\tt setkey\_} is {\tt N,} as may be required if {\tt m4wdth}
-is non-numeric.
+checks argument 2 for a term {\tt wdth=}{\sl value} and defines the macro
+{\tt m4wdth} to evaluate to {\tt (dimen\_*2)} if not found, otherwise
+to {\tt ({\sl value}).} The enclosing parentheses are omitted if the
+third argument of {\tt setkey\_} is {\tt N,} as would be required if
+{\tt m4wdth} were to be non-numeric.
In addition, the macro
@@ -2663,6 +2666,21 @@ 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
{\tt define(`key\_prefix',`m4')}.
+%\iffalse
+As another example, the macro
+{\tt sarrow({\sl linespec}, {\sl keys})}
+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]
+ \input arrowex
+ \caption{The three \dpic native arrows and others generated by
+ {\tt sarrow({\sl linespec}, {\sl keys})}.}
+ \label{arrowex}
+ \end{figure}
+%\fi
+
\xection{Interaction with \latex\label{Interaction:}}
The sizes of typeset labels and other \tex boxes are generally unknown
@@ -3260,8 +3278,7 @@ part of an argument must be protected by parentheses or quotes. Thus,
{\tt shadebox(box with .n at (w,h))}
\noindent do not. The parentheses are preferred.
-For example,
-a macro invoked by circuit elements contained the line
+For example, a macro invoked by circuit elements contained the line
\verb|command "\pscustom[fillstyle=solid`,'fillcolor=m4fillv]{%"|