Debian Codegraph @

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

raw
1 .PS
2 # ex05.m4
3 darrow_init
4 ifelse(ifpstricks(T)`'ifpgf(T)`'ifsvg(T)`'ifmpost(T),T,`
5
6 Kalman: [
7 fillval = 0.8 # environmental variable
8 linethick = 1 # slightly thicker for better screen pdf
9
10 dx = boxht/5 # diagram parameters wrt scaled env variables
11 circlerad = boxht*3/8
12 extlen=4*dx
13 indel = boxht/3
14
15 # Replacement for \bar, see
16 # https://tex.stackexchange.com/questions/22100/the-bar-and-overline-commands
17 latexcommand(\newcommand{\ols}[1]{%
18 \mskip.5\thinmuskip\overline{\mskip-.5\thinmuskip {#1} \mskip-.5\thinmuskip}%
19 \mskip.5\thinmuskip})
20
21 COb: box fill_ "C$\ols{\mbox{O}}$"
22 CO:box fill_ with .nw at last box.se+(dx,-dx) "CO"
23 CbOb: box fill_ with .nw at last box.se+(dx,-dx) \
24 "$\ols{\mbox{C}}$$\ols{\mbox{O}}$"
25 CbO: box fill_ with .nw at last box.se+(dx,-dx) "$\ols{\mbox{C}}$O"
26
27 dline(from CbO.s down_ dx,,t,,!-)
28 dright
29 {Sum: circle invis at (CO,Here)}
30 darrow(to Sum.e)
31
32 SW: (COb.w,Sum.s)+(-3*dx-extlen/2,-dx)
33 NE: (CbO.e,COb.n)+(dx,dx)
34 right_; shadebox(box wid NE.x-SW.x ht NE.y-SW.y with .sw at SW)
35
36 U: "\bf u$\,$" rjust at COb.w-(3*dx+extlen,0)
37 dline(right_ extlen+dx,,t,,|-)
38 TU: dtee(R)
39 {darrow(to COb.w,t)}
40 dline(to (Here,CO),t,t)
41 {Dum: circle invis at (Here,Sum)}
42 dtee(L)
43 {darrow(to CO.w,t)}
44 {D: box "D" wid boxwid/2 ht boxwid/2 at 0.5<Here,Dum.n>}
45 darrow(to D.n,t)
46 darrow(from D.s to Dum.n,,,,,,!-)
47
48 dline(up_ from CO.n to (CO,COb)-(0,indel),,t,,!-)
49 dleft; darrow(to (COb.e,Here))
50
51 dline(up_ from CbOb.n to (CbOb,COb),,t,,!-)
52 dleft; darrow(to COb.e)
53
54 dline(from CbO.n-(indel,0) up_ CbOb.y-CbO.n.y,,t,,!-)
55 dleft; darrow(to CbOb.e)
56
57 dline(up_ from CbO.n to (CbO,CO),,t,,!-)
58 dleft
59 darrow(to CO.e)
60
61 dline(up_ from CbO.n+(indel,0) to (CbO,COb)+(indel,indel),,t,,!-)
62 dleft; darrow(to (COb.e,Here))
63
64 darrow(from CO.s to Sum.n,,,,,,!-)
65
66 darrow(left_ from Sum.w to Dum.e)
67 darrow(from Dum.w to (U,Dum))
68 {"{\bf y$\,$}" rjust}
69 move left 0.23
70
71 circle at Sum
72 circle at Dum
73 ]
74 Coxeter: [
75 # Coxeter.m4
76
77 customlinethick = 1.5
78
79 linethick = customlinethick
80 define(`dotrad_',`(3/2*linethick pt__)')
81
82 Orig: (0,0)
83 for i=0 to 4 do { P[i]: dot(at (i*linewid,0)) }
84 line from Orig to P[4]
85 P[-1]: dot(at (Rect_(linewid, 120))); line to Orig
86 P[-2]: dot(at (Rect_(linewid,-120))); line to Orig
87
88 Pa: dot(at P[4]+(linewid,0)); "$a$" at last [].n above
89 arrow from P[4] to Pa chop linewid/4
90 Pd: dot(at P[0]+(0,-2*linewid)); "$d$" at last [].w rjust
91 Pe: dot(at Pd+(linewid,0)); "$e$" at last [].n above
92 Pf: dot(at Pe+(linewid,0)); "$f$" at last [].n above
93 Pb: dot(at Pd+(Rect_(linewid,120))); "$b$" at last [].w rjust
94 Pc: dot(at Pd+(Rect_(linewid,-120))); "$c$" at last [].w rjust
95 line from Pb to Pd then to Pc
96 line from Pd to Pf
97
98 define(`customarc',
99 `pushdef(`dfillcolor',`0.7,0.7,0.7') linethick_(0.4); dnl
100 # Darc(`$1',linewid, (`$2')*dtor_, (`$3')*dtor_,
101 # thick=linewid/6; wid=linewid*0.3; ht=linewid/6; ends=<->)dnl
102 Darc(,centre=`$1';rad=linewid;startdeg= (`$2');enddeg=(`$3');
103 thick=linewid/6; wid=linewid*0.3; ht=linewid/6; ends=<->)
104 linethick_(customlinethick); popdef(`dfillcolor')')
105
106 customarc((linewid,-linewid/3), 25,155)
107 "$d$" at (linewid,linewid*2/3)
108 customarc((2*linewid,-linewid/3), 25,155)
109 "$e$" at (2*linewid,linewid*2/3)
110 customarc((3*linewid,-linewid/3), 25,155)
111 "$f$" at (3*linewid,linewid*2/3)
112 customarc(Orig,130,230); "$a$" at (Rect_(linewid,180))
113 customarc(Orig, 10,110); "$b$" at (Rect_(linewid, 60))
114 customarc(Orig,-110,-10); "$c$" at (Rect_(linewid,-60))
115
116 ] with .sw at Kalman.se+(15bp__,0)
117 [
118 linethick = 5
119 Darrow(right_ Coxeter.wid,
120 thick=0.3;wid=0.55;ht=0.55;ends=<->; innershade=(0,1,1);outline=(0,0,1))
121 ] with .sw at Coxeter.nw+(0,0.3)
122
123 ',` "This diagram requires LaTex" ')
124 .PE