Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/debug2.m4

raw
1 % This is file debug2.m4
2 % Type the two (identical) command lines:
3 % m4 pdf.m4 debug2.m4 | dpic -g > debug2.tex; pdflatex debug2
4 % m4 pdf.m4 debug2.m4 | dpic -g > debug2.tex; pdflatex debug2
5 % Alternatively, type the two not-quite-identical lines:
6 % m4 pstricks.m4 debug2.m4 | dpic -p > debug2.tex; latex debug2
7 % m4 pstricks.m4 debug2.m4 | dpic -p > debug2.tex; latex debug2; dvips debug2
8 % In either case, the first command creates the file debug2.dim; the second
9 % reads it to draw the correct bounding box.
10 %
11 % If m4 gives an error saying that it cannot find pdf.m4 then the M4PATH
12 % environment variable has not been set to the directory containing
13 % pgf.m4, pstricks.m4, and the other m4 libraries. For example, I have
14 % export M4PATH=.:~/lib:
15 % in the file ~/.bash_aliases on my Ubuntu machine, and on my PC with cygwin
16 % it is in .bashrc. (You will have to change ~/lib to suit.)
17 %
18 % If other errors occur, look at debug2.log for details.
19 %
20 % If boxdims.sty is not found, then either it has not been copied to
21 % where latex can find it or the latex filename database has not been
22 % updated correctly. Instructions for the latter depend on the operating
23 % system and may involve commands texhash, mktexlsr, tlmgr, possibly preceded
24 % by sudo, or (for MiKTeX) clicking on the Refresh FNDB button.
25 % See Manual Installation, steps 3 and 4 (ignore 1 and 2) at
26 % https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages
27 %
28 % On my Ubuntu machine, boxdims.sty is in
29 % /usr/local/lib/localtexmf/tex/latex/local/
30 % and on my PC with Cygwin it is in
31 % /cygdrive/d/localtexmf/tex/latex/local/
32 % but you might choose something like ~/texmf/tex/latex/boxdims/
33 %
34 \documentclass{article}
35 \usepackage{boxdims}
36 \usepackage{ifpstricks(pstricks,tikz)}
37 \begin{document}
38 .PS
39 cct_init
40 sinclude(debug2.dim)
41 s_init(steinmetz)
42 [
43 source(up_,AC); llabel(,s_box(`${}20$ V'),)
44 inductor(up_,W); llabel(,s_box(`${}20$ mH'),)
45 ]
46 showbox_
47 .PE
48 \end{document}