Download CMman. - Electrical and Computer Engineering
Transcript
To process the file, make sure that the libraries libcct.m4 and libgen.m4 are installed and
readable. Verify that m4 is installed and accepts the -I option; otherwise, see page 42. Now there
are at least two basic possibilities as follows, but be sure to read Section 2.1.3 for simplified use.
2.1.1
Processing with dpic and PSTricks or Tikz PGF
If you are using dpic with PSTricks, type the following commands or put them into a script:
m4 -I installdir pstricks.m4 quick.m4 > quick.pic
dpic -p quick.pic > quick.tex
where installdir is the full name (i.e., the path) of the directory containing libcct.m4. The
option -I installdir can be omitted if environment variable M4PATH points to installdir. Put
\usepackage{pstricks} in the main LATEX source file header and the following in the body:
\begin{figure}[hbt]
\centering
\input quick
\caption{Customized caption for the figure.}
\label{Symbolic_label}
\end{figure}
Then the commands latex file; dvips file produce file.ps that can be printed or viewed using
gsview, for example.
The effect of the m4 command above is shown in Figure 3. Configuration file pstricks.m4 causes
library libgen.m4 to be read, thereby defining the macro cct_init. The diagram source file is
then read and the circuit-element macros in libcct.m4 are defined during expansion of cct_init.
pstricks.m4
.pic
m4
libgen.m4
Configuration file
Diagram source quick.m4
···
define(‘cct_init’,...)
···
libcct.m4
···
define(‘resistor’,...)
···
.PS
cct_init
···
Figure 3: The command m4 -I installdir pstricks.m4 quick.m4 > quick.pic.
To produce Tikz PGF code, the commands are modified to read pgf.m4 and invoke the -g
option of dpic as follows:
m4 -I installdir pgf.m4 quick.m4 > quick.pic
dpic -g quick.pic > quick.tex
The LATEX header should contain \usepackage{tikz}, but the inclusion statements are the
same as for PSTricks input. Invoking PDFlatex on the source produces .pdf output directly.
In all cases the essential line is \input quick, which inserts the previously created file quick.tex.
2.1.2
Processing with gpic
If your printer driver understands tpic specials and you are using gpic (on some systems the gpic
command is pic), the commands are
m4 -I installdir gpic.m4 quick.m4 > quick.pic
gpic -t quick.pic > quick.tex
and the figure inclusion statements are as shown:
3