Download CMman. - SunSITE RedIRIS

Transcript
.PS
cct_init
# Pic input begins with .PS
# Set defaults
elen = 0.75
# Variables are allowed; default units are inches
Origin: Here
# Position names are capitalized
source(up_ elen); llabel(-,v_s,+)
resistor(right_ elen); rlabel(,R,)
dot
{
# Save current position and direction
capacitor(down_ to (Here,Origin))
#(Here,Origin) = (Here.x,Origin.y)
rlabel(+,v,-); llabel(,C,)
dot
R
+
}
# Restore position and direction
+
line right_ elen*2/3
vs
v
−
inductor(down_ Here.y-Origin.y); rlabel(,L,); b_current(i)
−
line to Origin
.PE
# Pic input ends
i
C
L
Figure 2: The file quick.m4 and resulting diagram.
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 <path>pstricks.m4 <path>libcct.m4 quick.m4 > quick.pic
dpic -p quick.pic > quick.tex
where <path> is the path to the libcct.m4 file. 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}
This distribution is compatible with the Tikz PGF drawing commands, which have nearly the power
of the PSTricks package with the ability to produce pdf output by running the pdflatex command
instead of latex on the input file. The commands are modified to read pgf.m4 and invoke the
dpic -g option as follows:
m4 <path>pgf.m4 <path>libcct.m4 quick.m4 > quick.pic
dpic -g quick.pic > quick.tex
The LATEX header should contain \usepackage{tikz}, but the inclusion statemensts are the same
as for PSTricks input.
In all cases the essential line is \input quick, which inserts the previously created file quick.tex.
Then LATEX the document, convert to postscript typically using dvips, and print the result or view
it using Ghostview. The alternative for Tikz PGF output of dpic -g is to invoke PDFlatex.
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 <path>libcct.m4 quick.m4 > quick.pic
gpic -t quick.pic > quick.tex
3