Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/dpv/CountingDPV.m4

raw
1 .PS
2 # CountingDPV.m4
3 gen_init(svg_font(sans-serif,11bp__))
4
5 g = 0.4 # grid size
6 define grid { (($2)*g,-($1)*g) }
7 circlerad = 0.1
8
9 for i=1 to 4 do { # 66% becomes 66%% in the sprintf string:
10 sprintf("svg_it(S`'svg_sub(%g,66%):)",i) ljust at grid(i,-0.5)
11 for j=1 to 4 do { if i+j < 8 then {
12 sprintf("svg_it(s`'svg_sub(%g%g,66%))",i,j) at grid(i,j) } } }
13
14 "." at grid(4.6,0)
15 "." at grid(4.7,0)
16 "." at grid(4.8,0)
17 for i=1 to 3 do { `"..."' at grid(i,5) }
18 "..." at grid(4,4)
19
20 P: grid(1,1)
21 for k=3 to 5 do {
22 for i=1 to k-1 do { if (k%2==1) then { m=i; n=k-i } else { m=k-i; n=i }
23 Q: grid(m,n)
24 arrow from P to Q chop
25 P: Q }
26 }
27
28 move from grid(1,1)+(-0.5,0.1) \# Adjust bounding box
29 to grid(4,4)+(0.5,-0.45)
30
31 command "</g>" # end font
32 .PE