summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/svg/VariableSVG.m4
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/circuit_macros/examples/svg/VariableSVG.m4')
-rw-r--r--graphics/circuit_macros/examples/svg/VariableSVG.m436
1 files changed, 36 insertions, 0 deletions
diff --git a/graphics/circuit_macros/examples/svg/VariableSVG.m4 b/graphics/circuit_macros/examples/svg/VariableSVG.m4
new file mode 100644
index 0000000000..642b81466a
--- /dev/null
+++ b/graphics/circuit_macros/examples/svg/VariableSVG.m4
@@ -0,0 +1,36 @@
+.PS
+# `Variable.m4'
+cct_init(svg_font(sans-serif,11bp__))
+
+define(`elen_',dimen_)
+down_
+[ { variable(`capacitor') }
+ move right; down_
+ { variable(`resistor',uN) }
+ move right; down_
+ { variable(`capacitor(,C)') }
+ move right; down_
+ { variable(`inductor') }
+ move right; down_
+ { variable(`inductor(,W)') }
+ ]
+[
+ skp = 0.4
+ hskip = linewid*0.5
+ cskip = hskip
+Orig: Here
+ { move right cskip
+ move right elen_; move up 0.15 then down 0.15 then right_ hskip
+ line invis right_ elen_ "C"; move right_ hskip
+ line invis right_ elen_ "S" }
+ Loopover_(`char',
+ `move down skp ifelse(char,A,*0.5)
+ { line invis right_ cskip "char"
+ variable(`capacitor(,C)',char); move right_ hskip
+ variable(`capacitor(,C)',char`'C); move right_ hskip
+ variable(`capacitor(,C)',char`'S) }',
+ A,P,L,N)
+ ] with .w at last [].e+(0.4,0)
+
+ command "</g>" # end font
+.PE