summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/doc/defines.tex
blob: 0c9c67bfbf9e03316800c10093a5824e5a539b84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
%
\newdimen{\leftwid}\setlength{\leftwid}{2in}
\newdimen{\libwid}\setlength{\libwid}{0.5in}
\newdimen\rightwid
\setlength{\rightwid}{\textwidth}
\addtolength{\rightwid}{-\leftwid}
\addtolength{\rightwid}{-\libwid}
%
\newbox\Defbox

%\newcommand{\macx}[2]{%
%  \phantomsection\pdfbookmark[subsection]{#1}{#2}#1}

\newcommand{\macrodef}[5]{%\begin{minipage}[b]{\textwidth}%
\phantomsection\pdfbookmark[subsubsection]{#1}{#2}%
\setbox\Defbox=\hbox{\tt #1#3}%
  \ifdim\wd\Defbox>\textwidth%
    \setbox\Defbox=\hbox{\parbox{\textwidth}{\tt #1#3}}\fi
  \ifdim\wd\Defbox>\leftwid%
       \box\Defbox\hfill\break\hspace*{\leftwid}%
  \else\hbox to \leftwid{\box\Defbox\hfill}\fi%
  \nopagebreak
  \hbox to \libwid{#4\hfill}\parbox[t]{\rightwid}%
   {\raggedright #5}%
   %\end{minipage}%
  \vspace{\parsep}\\}%

\newcommand{\seesect}[1]{ (\SR{#1})}

\newcommand{\Letter}[1]{\noindent%
  \pdfbookmark[subsection]{#1}{#1}%
  \hskip-2em\hbox to 2em{#1\label{#1}\hfill}\relax}%

\newcommand{\LR}[1]{\hyperref[#1]{{#1}}\hskip1em}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\raggedbottom
\vspace{\abovedisplayskip}
\noindent
\LR{A} \LR{B} \LR{C} \LR{D} \LR{E} \LR{F} \LR{G} \LR{H} \LR{I} \LR{J}
\LR{K} \LR{L} \LR{M} \LR{N} \LR{O} \LR{P}
\LR{R} \LR{S} \LR{T} \LR{U} \LR{V} \LR{W} \LR{X} \LR{Y}
\\

\Letter{A}%
\macrodef{above\_}{above_}{}%
  {gen}%
  {string position above relative to current direction}%
\macrodef{abs\_}{abs_}{({\sl number})}%
  {gen}%
  {absolute value function}%
\macrodef{ACsymbol}{ACsymbol}{(at {\sl position, len, ht,}%
  [n:][A]U|D|L|R|{\sl degrees}) }%
  {cct}%
  {draw a stack of $n$ (default 1) AC symbols
   (1-cycle sine waves); If arg 4 contains A, two arcs
   are used.  The current drawing direction is default, otherwise Up, Down,
   Left, Right, or at {\sl degrees} slant; \seesect{Twoterminal:} e.g.,\\ 
   {\tt ebox; $\lbrace$ACsymbol(at last [],{,}dimen\_/8)$\rbrace$}}%
\macrodef{adc}{adc}{({\sl width,height,nIn,nN,nOut,nS})}%
  {cct}%
  {Analog-digital converter with defined width, height, and number of
   inputs {\tt In$i$}, top terminals {\tt N$i$}, ouputs {\tt Out$i$},
    and bottom terminals~{\tt S$i$}}%
\macrodef{addtaps}{addtaps}{[{\sl arrowhd}%
  | type={\sl arrowhd};name={\sl Name}],
    {\sl fraction, length, fraction, length,} $\cdots$)}%
  {cct}%
  {Add taps to the previous two-terminal element.
   {\sl arrowhd} is blank or one of {\tt . - <- -> <->}.
   Each fraction determines the position along the element body of the tap.
   A negative length draws the tap to the right of the current
   direction; positive length to the left.
   Tap names are Tap1, Tap2, $\cdots$ by default  or
   Name1, Name2, $\cdots$ if specified 
   \seesect{Composite:}}%
\macrodef{along\_}{along_}{({\sl linear object name})}%
  {gen}%
  {short for {\tt between {\sl name}.start and {\sl name}.end}}%
\macrodef{Along\_}{Along_}{({\sl LinearObj,distance,}[R])}%
  {gen}%
  {Position arg2 (default all the way) along a linear object
   from {\tt .start} to {\tt .end}%
   (from {\tt .end} to {\tt .start} if arg3={\tt R}) }%
\macrodef{amp}{amp}{(\linespec, {\sl size}, {\sl attributes})}%
  {cct}%
  {amplifier\seesect{Twoterminal:}}%
\macrodef{And, Or, Not, Nand, Nor, Xor, Nxor, Buffer}%
 {And, Or, Not, Nand, Nor, Xor, Nxor, Buffer}{}%
  {log}%
  {Wrappers of {\tt AND\_gate}, $\ldots$ for use in the {\tt Autologix}%
   macro}%
\macrodef{AND\_gate}{AND_gate}{({\tt {\sl n}, [N][B],
   [{\sl wid}, [{\sl ht}]], {\sl attributes}})}%
  {log}%
  {`and' gate, 2 or {\sl n\/} inputs ($0 \leq n \leq 16$) drawn in the
   current direction;
   {\tt N}: negated inputs; {\tt B}: box shape.
   Alternatively, {\tt AND\_gate({\sl chars}, [B], {\sl wid},
    {\sl ht}, {\sl attributes})}, where
   arg1 is a sequence of letters {\tt P|N} to define
   normal or negated inputs.
    \seesect{Logicgates:}}%
\macrodef{AND\_gen}{AND_gen}{($n$, {\sl chars}, [{\sl wid}, [{\sl ht}]],
  {\sl attributes})}%
  {log}%
  {general AND gate: $n$=number of inputs $(0\leq n\leq 16)$;
           {\sl chars:}%
           B=base and straight sides; A=Arc;
           [N]NE,[N]SE,[N]I,[N]N,[N]S=inputs or circles;
           [N]O=output; C=center.
   Otherwise, arg1 can be a sequence of letters {\tt P|N}%
   to define normal or negated inputs; arg2 is as above except that
   {\tt [N]I} is ignored. Arg 5 contains body attributes.}%
\macrodef{AND\_ht}{AND_ht}{}%
  {log}%
  {height of basic `and' and `or' gates in {\tt L\_unit}s}%
\macrodef{AND\_wd}{AND_wd}{}%
  {log}%
  {width of basic `and' and `or' gates in {\tt L\_unit}s}%
\macrodef{antenna}{antenna}{%
  (at {\sl location}, T, A|L|T|S|D|P|F, U|D|L|R|{\sl degrees})}%
  {cct}%
  {antenna, without stem for nonblank 2nd arg; arg3 is\\
    {\tt A}: aerial (default),\\
    {\tt L}: loop,\\
    {\tt T}: triangle,\\
    {\tt S}: diamond,\\
    {\tt D}: dipole,\\
    {\tt P}: phased,\\
    {\tt F}: fork;\\
    arg4 specifies Up, Down, Left, Right, or angle from horizontal (default 90) 
   \seesect{Composite:}}%
\macrodef{arca}{arca}{({\sl absolute chord linespec}, ccw|cw, {\sl radius},
   {\sl modifiers}) }%
  {gen}%
  {arc with acute angle (obtuse if radius is negative), drawn in a [ ] block}%
\macrodef{ArcAngle}{ArcAngle}{({\sl position, position, position, radius,
  modifiers, label}) }%
  {gen}%
  {Arc angle symbol drawn ccw at arg2. Arg4 is the radius from arg2;
     arg5 contains line attributes, e.g., {\tt thick linethick/2 ->};
     arg6 is an optional label at mid-arc}%
\macrodef{arcd}{arcd}{({\sl center},
  {\sl radius},{\sl start degrees},{\sl end degrees}) }%
  {gen}%
  {Arc definition (see {\tt arcr}), angles in degrees
    \seesect{Positions:}}%
\macrodef{arcdimension\_}{arcdimension_}{({\sl arcspec},{\sl offset},%
{\sl label},
    D|H|W|{\sl blank width},{\sl tic offset},{\sl arrowhead })}%
  {gen}%
  {like {\tt dimension\_}, for drawing arcs for dimensioning diagrams;
      {\sl arrowhead=}{\tt -> | <-}. Uses the first argument as the attributes
      of an invisible arc: {\tt arc invis }{\sl arg1}.  {\sl Arg2} is the
      radial displacement (possibly negative) of the dimension arrows.
      If {\sl arg3} is {\tt s\_box(\ldots)} or {\sl rs\_box(\ldots)} and
      {\sl arg4=}{\tt D|H|W} then {\sl arg4} means:
      {\tt D:} blank width is the diagonal length of {\sl arg3};
      {\tt H:} blank width is the height of {\sl arg3} + {\tt textoffset*2};
      {\tt W:} blank width is the width of {\sl arg3} + {\tt textoffset*2};
      otherwise {\sl arg4} is the absolute blank width}%
\macrodef{arcr}{arcr}{({\sl center},{\sl radius},{\sl start angle},{\sl
    end angle,modifiers,ht}) }%
  {gen}%
  {Arc definition.  If arg5 contains {\tt <-} or {\tt ->} then a midpoint
    arrowhead of height equal to arg6 is added. Arg5 can contain modifiers
    (e.g. outlined "red"), for the arc and arrowhead.  Modifiers following
    the macro affect the arc only,
    e.g., {\tt arcr(A,r,0,pi\_/2,->) dotted ->}%
   \seesect{Positions:}}%
\macrodef{arcto}{arcto}{({\sl position 1},{\sl position 2},{\sl
    radius},[dashed|dotted])}%
  {gen}%
  {line toward position 1 with rounded corner toward position 2}%
\macrodef{array}{array}{({\sl variable, expr1, expr2, \ldots})}%
  {dpictools}%
  {$\;\;$  Populate a singly-subscripted array:
    {\tt {\sl var}[1]={\sl expr1;} {\sl var}[2]={\sl expr2;} \ldots}.}%
\macrodef{array2}{array2}{({\sl variable, expr1, expr2, \ldots})}%
  {dpictools}%
  {$\;\;$  Populate a doubly-subscripted array:
    {\tt {\sl var}[{\sl expr1},1]={\sl expr2;}%
         {\sl var}[{\sl expr1},2]={\sl expr3;} \ldots}.}%
\macrodef{arraymax}{arraymax}{({\sl data array, n, index name, value})}%
  {dpictools}%
  {$\;\;$ Find the index in {\sl array[1:n]} of the first occurrence
   of the maximum array element value.  The value is assigned if arg4 is
   nonblank; example: 
   {\tt array(x,4,9,8,6); arraymax( x,4,i )}%
    assigns 2 to {\sl i,} and {\tt arraymax( x,4,i,m )}%
    assigns 2 to {\sl i} and 9 to {\sl m.}}%
\macrodef{arraymin}{arraymin}{({\sl data array, n, index name, value})}%
  {dpictools}%
  {$\;\;$ Find the index in {\sl array[1:n]} of the first occurrence
   of the minimum array element value.  The value is assigned if arg4 is
   nonblank; see {\tt arraymax}.}%
\macrodef{arrester}{arrester}{(\linespec,{\sl chars},
                                   {\sl len}[:arrowhead ht],
                                   {\sl ht}[:arrowhead wid],
                                   {\sl attributes} )}%
  {cct}%
{                                Arg2 {\sl chars:}\\
                                   {\tt G=} spark gap (default)\\
                                   {\tt g=} general (dots)\\
                                   {\tt E=} gas discharge\\
                                   {\tt S=} box enclosure\\
                                   {\tt C=} carbon block\\
                                   {\tt A=} electrolytic cell\\
                                   {\tt H=} horn gap\\
                                   {\tt P=} protective gap\\
                                   {\tt s=} sphere gap\\
                                   {\tt F=} film element\\
                                   {\tt M=} multigap\\
                                 {\sl Modifiers in arg2:}\\
                                   {\tt R=} right orientation\\
                                   {\tt L=} left orientation\\
                                   {\tt D=} 3-terminal element for {\tt S, E}
                                      only, with terminals {\sl A, B, G}\\
                                   Arg5 applies to options C, E, S
   \seesect{Twoterminal:}}%
\macrodef{arrowline}{arrowline}{(\linespec)}%
  {cct}%
  {line (dotted, dashed permissible) with centred arrowhead
    \seesect{Twoterminal:}}%
\macrodef{assign3}{assign3}{({\sl var name,var name,var name,arg4,arg5,arg6})}%
  {gen}%
  {Assigns \$1 = arg4 if \$1 is nonblank; similarly \$2 = arg5 and \$3 = arg6}%
\macrodef{AutoGate}{AutoGate}{}%
  {log}%
  {Draw the tree for a gate as in the {\tt Autologix} macro.  No inputs
   or external connections are drawn.  The names of the internal gate
   inputs are stacked in {\tt `AutoInNames'}}%
\macrodef{Autologix}{Autologix}%
 {({\sl Boolean function sequence},%
    [N[oconnect]][L[eftinputs]][R][V][M][;offset={\sl value}])}%
  {log}%
  {Draw the Boolean expressions defined in function notation.
   The first argument is a semicolon (;)-separated sequence of
   Boolean function specifications using the functions
   {\tt And, Or, Not, Buffer, Xor, Nand, Nor, Nxor}%
   with variables, e.g.,
   {\tt Autologix(And(Or(x1,~x2),Or(~x1,x2)));}.
   Each function specification is of the form
   {\tt {\sl function}({\sl arguments}) [@{\sl attributes}]}.
   \par
   Function outputs are aligned vertically but appending
   {\tt@}{\sl attributes} to a function can be used to place it.
   \par
   The function arguments are variable names or nested Boolean functions.
   Each unique variable {\sl var} causes an input point {\tt In}{\sl var}%
   to be defined.  Preceding the variable by a {\tt \~{}} causes a NOT gate
   to be drawn at the input.
   The inputs are drawn in a row at the upper left by default.
   An {\tt L} in arg2 draws the inputs in a column at the left;
   {\tt R} reverses the order of the drawn inputs;
   {\tt V} scans the expression from right to left
   when listing inputs;
   {\tt M} draws the left-right mirror image of the diagram;
   and {\tt N} draws only the function tree without the input array.
   The inputs are labelled {\tt In1}, {In2}, \ldots and the function
   outputs are {\tt Out1}, {Out2}, \dots.
   Each variable {\sl var} corresponds also to one of the input array
   points with label {\tt In}{\sl var}.
   Setting {\tt offset=}{\sl value} displaces the
   drawn input list in order to disambiguate the input connections when {\tt L}%
   is used.
   \par
   In the (possibly rare) case where one or more inputs of a normal function
   gate is to have a NOT-circle, an additional first argument of the function
   is inserted, of the form {\tt [{\sl charseq}]}, where {\sl charseq}%
   is a string containing the characters {\tt P} for a normal input or
   {\tt N} for a negated input, the length of the string equal to the number
   of gate inputs.  For example:
   {\tt Autologix(Xor([PN],And(x,y),And(x,y)),LRV)}}%

\Letter{B}%
\macrodef{basename\_}{basename_}{({\sl string sequence, separator})}%
  {gen}%
  {Extract the rightmost name from a sequence of names separated by arg2
   (default dot ``.'')}%
\macrodef{battery}{battery}{(\linespec,{\sl n},R)}%
  {cct}%
  {n-cell battery: default 1 cell,
  R=reversed polarity\seesect{Twoterminal:}}%
\macrodef{b\_}{b_}{}%
  {gen}%
  {blue color value}%
\macrodef{b\_current}{b_current}{({\sl label},{\sl pos},In|Out,Start|End,{\sl
    frac})}%
  {cct}%
  {labelled branch-current arrow to {\sl frac} between branch end and body
    \seesect{Branchcurrent:}}%
\macrodef{beginshade}{beginshade}{({\sl gray value})}%
  {gen}%
  {begin gray shading, see {\tt shade}%
   e.g., {\tt beginshade(.5);} {\sl closed line specs}; {\tt endshade}}%
\macrodef{bell}{bell}{( U|D|L|R|{\sl degrees}, {\sl size})}%
  {cct}%
  {bell, {\sl In1} to {\sl In3} defined
   \seesect{Composite:}}%
\macrodef{below\_}{below_}{}%
  {gen}%
  {string position relative to current direction}%
\macrodef{Between\_}{Between_}{({\sl Pos1, Pos2,distance,}[R])}%
  {gen}%
  {Position {\sl distance} from {\sl Pos1} toward {\sl Pos2}.  If
   the fourth arg is {\tt R} then from {\sl Pos2} toward {\sl Pos1}.}%
\macrodef{binary\_}{binary_}{($n$, [$m$])}%
  {gen}%
  {binary representation of $n,$ left padded to $m$ digits if the second
   argument is nonblank}%
\macrodef{bisect}{bisect}{%
  ({\sl function name, left bound, right bound, tolerance, variable}))}%
  {dpictools}%
  {$\;\;$ Solve $\hbox{\sl function}(x) = 0$ by the method of 
   bisection.
   Like {\tt findroot} but uses recursion and is without a {\tt[]} box.
   The calculated value is assigned to the variable named in the
   last argument (\SR{Libraries:}). Example:\\
   {\tt define parabola \{ \$2 = (\$1)\char94{}2 - 1 \};\\
   bisect( parabola, 0, 2, 1e-8, x )}. }%
\macrodef{bi\_trans}{bi_trans}{(\linespec,L|R,{\sl chars},E)}%
  {cct}%
  { bipolar transistor, core left or right; chars:\\
   {\tt BU}: bulk line\\
   {\tt B}: base line and label\\
   {\tt S}: Schottky base hooks\\
   {\tt uEn|dEn}: emitters E0 to En\\
   {\tt uE|dE}: single emitter\\
   {\tt Cn|uCn|dCn}: collectors C0 to Cn; {\tt u} or {\tt d} add an arrow\\
   {\tt C}: single collector; {\tt u} or {\tt d} add an arrow\\
   {\tt G}: gate line and location\\
   {\tt H}: gate line;\\
   {\tt L}: L-gate line and location\\
   {\tt [d]D}: named parallel diode\\
   {\tt d}: dotted connection\\
   {\tt [u]T}: thyristor trigger line\\
   arg 4 = {\tt E}: envelope
    \seesect{Semiconductors:}}%
\macrodef{bi\_tr}{bi_tr}{(\linespec,L|R,P,E)}%
  {cct}%
  {left or right, N- or P-type bipolar transistor, without or with envelope 
    \seesect{Semiconductors:}}%
\macrodef{boxcoord}{boxcoord}{({\sl planar obj},{\sl x fraction},{\sl y
    fraction})}%
  {gen}%
  {internal point in a planar object}%
\macrodef{boxdim}{boxdim}{({\sl name},h|w|d|v,{\sl default})}%
  {gen}%
  {evaluate, e.g.\ {\sl name}{\tt \_w} if defined, else {\sl default\/}%
   if given, else 0 {\tt v} gives sum of {\tt d} and {\tt h} values
     \seesect{Interaction:}}%
\macrodef{BOX\_gate}{BOX_gate}{({\sl inputs, output, swid, sht, label,
    attributes })}%
  {log}%
  {output=[{\tt P|N}], inputs=[{\tt P|N}]$\ldots$, sizes swid and sht
  in {\tt L\_unit}s (default {\tt AND\_wd} = 7)
    \seesect{Logicgates:}}%
\macrodef{bp\_\_}{bp__}{}%
  {gen}%
  {big-point-size factor, in scaled inches, ({\tt *scale/72})}%
\macrodef{bswitch}{bswitch}{(\linespec, [L|R],chars)}%
  {cct}%
  {pushbutton switch R=right orientation (default L=left);
     chars: O= normally open, C=normally closed }%
\macrodef{BUFFER\_gate}{BUFFER_gate}{(\linespec, [N|B],
  {\sl wid, ht,} [N|P]\char42, [N|P]\char42, [N|P]\char42,
    {\sl attributes})}%
  {log}%
  {basic buffer, dfault 1 input or as a 2-terminal element,\\
    arg2: {\tt N}: negated input, {\tt B}: box gate;\\
    arg 5: normal ({\tt P}) or negated {\tt N}) inputs labeled In1 
    \seesect{Logicgates:}}%
\macrodef{BUFFER\_gen}{BUFFER_gen}{({\sl chars,wd,ht},[N|P]*,[N|P]*,[N|P]*,
    {\sl attributes})}%
  {log}%
  {general buffer, {\sl chars:}\\
            {\tt T}: triangle,\\
            {\tt [N]O}: output location {\tt Out}%
            ({\tt NO} draws circle {\tt N\_Out});\\
            {\tt [N]I, [N]N, [N]S, [N]NE, [N]SE} input locations;\\
            {\tt C}: centre location.\\
            Args 4-6 allow alternative
            definitions of respective {\tt In, NE,}%
            and {\tt SE} argument sequences }%
\macrodef{BUF\_ht}{BUF_ht}{}%
  {log}%
  {basic buffer gate height in {\tt L\_unit}s}%
\macrodef{BUF\_wd}{BUF_wd}{}%
  {log}%
  {basic buffer gate width in {\tt L\_unit}s}%
\macrodef{buzzer}{buzzer}{( U|D|L|R|{\sl degrees, size,}[C])}%
  {cct}%
  {buzzer, {\sl In1} to {\sl In3} defined, C=curved
   \seesect{Composite:}}%
\Letter{C}%
\macrodef{cangle}{cangle}{({\sl Start, End},[d])}%
  {gen}%
  {Angle in radians of the sector at arg2 with arm ends given
   by arg1 and arg3 (degrees if arg4=d).}%
\macrodef{capacitor}{capacitor}{(\linespec,{\sl chars},R,
    {\sl height}, {\sl wid})}%
  {cct}%
  {capacitor, {\sl chars}:\\
    {\tt F} or blank: flat plate\\
    {\tt dF} flat plate with hatched fill\\
    {\tt C} curved-plate\\
    {\tt dC} curved-plate with variability arrowhead\\
    {\tt CP} constant phase element\\
    {\tt E} polarized boxed plates\\
    {\tt K} filled boxed plates\\
    {\tt M} unfilled boxes\\
    {\tt N} one rectangular plate\\
    {\tt P} alternate polarized\\
    {\tt +} adds a polarity sign\\
    {\tt +L} polarity sign to the left of drawing direction\\
    arg3:  {\tt R=}reversed polarity\\
    arg4: height (defaults {\tt F:} {\tt dimen\_}$/3$,
      {\tt C,P:} {\tt dimen\_}$/4$,
      {\tt E,K:} {\tt dimen\_}$/5$)\\
    arg5: wid (defaults {\tt F:} {\sl height}*0.3,
      {\tt C,P:} {\sl height}*0.4,
      {\tt CP:} {\sl height}*0.8,
      {\tt E,K:} {\sl height})
    \seesect{Twoterminal:}}%
\macrodef{case}{case}{({\sl i, alt1, alt2, \ldots})}%
  {dpictools}%
  {$\;\;$ Case statement for dpic; execute alternative {\sl i.}%
   Example: {\tt case( 2, x=5, x=10, x=15 )} sets {\tt x} to 10.
   Note: this is a macro so {\tt \${}n} refers to the {\sl n}-th
	 argument of {\tt case}.}%
\macrodef{cbreaker}{cbreaker}{(\linespec, L|R, D|Th|TS, body name)}%
  {cct}%
  {circuit breaker to left or right, {\tt D}: with dots; {\tt Th}: thermal;
   {\tt TS}: squared thermal; default body bounding box name is
     {\sl Br}\seesect{Twoterminal:}}%
\macrodef{ccoax}{ccoax}{(at {\sl location}, M|F, {\sl diameter, attributes})}%
  {cct}%
  {coax connector, {\tt M}: male, {\tt F}: female
    \seesect{Composite:}}%
\macrodef{cct\_init}{cct_init}{}%
  {cct}%
  {initialize circuit-diagram environment (reads {\tt libcct.m4})}%
\macrodef{centerline\_}{centerline_}{({\sl linespec, thickness{\tt|}color,
   minimum long dash len, short dash len, gap len}}%
  {gen}%
  {Technical drawing centerline}%
\macrodef{c\_fet}{c_fet}{(\linespec,R,P)}%
  {cct}%
  {left or right, plain or negated pin simplified MOSFET}%
\macrodef{Cintersect}{Cintersect}{({\sl Pos1, Pos2, rad1, rad2,} [R])}%
  {gen}%
  {Upper (lower if arg5={\tt R}) intersection of circles at
    {\sl Pos1} and {\sl Pos2}, radius {\sl rad1} and {\sl rad2}}%
\macrodef{clabel}{clabel}{({\sl label},{\sl label},{\sl label},[{\sl arg4}],%
    [{\sl block name}])}%
  {cct}%
  {Triple label along the drawing axis of the body of an element in the
    current direction \seesect{Labels:}.  Labels are placed at the
    beginning, centre, and end of the last {\tt []} block (or a named
    {\tt []} block). Each label is treated as math by default, but is
    copied literally if it is in double quotes or sprintf.
    {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,} or {\tt
    right} to supplement the default relative position.  The fifth
    argument is the optional name of the {\tt []} block to be labelled,
    which is {\tt last []} by default.}%
\macrodef{cm\_\_}{cm__}{}%
  {gen}%
  {absolute centimetres}%
\macrodef{cmyktorgb}{cmyktorgb}{({\sl c, m, y, k, r, g, b})}%
  {dpictools}%
  {$\;\;$ cmyk values in percent, i.e., 0 to 100, to rgb.}%
\macrodef{consource}{consource}{(\linespec,V|I|v|i,R,{\sl attributes})}%
  {cct}%
  {voltage or current controlled source with alternate forms;
   {\tt R}: reversed polarity\seesect{Twoterminal:}}%
\macrodef{ColoredV}{ColoredV}{%
   (box|circle|ellipse,({\sl r,g,b})|(({\sl colorseq})),{\sl attributes})}%
  {gen}%
  {box (default), circle, or ellipse in a {\tt []} block.
   If arg2 is blank then all formatting is in arg3.  If arg2 is blank
   then all formatting is in arg3; if parenthesized r,g,b, the object
   is shaded top to bottom white to the specified rgb color; if a
   double-parenthesized colorseq then the colorseq defines the internal
   shading top to bottom.  A {\sl colorseq} is of the form
   0, r0,g0,b0, {\sl frac1},r1,g1,b1, {\sl frac2},r2,g2,b2,
   \ldots 1,rn,gn,bn with $0 < \hbox{\sl frac1} < \hbox{\sl frac2} \ldots 1$.
   Examples: {\tt ColoredV(circle,(1,0,0));
   ColoredV(ellipse,(1,0.04,1),wid 0.75 ht 1 outlined "magenta" "Goodbye");
   ColoredV(box,(1,0,0),outlined "blue" rad 0.1, (0,1,1,0, 1,0,0,1)).} }%
\macrodef{contact}{contact}{({\sl chars})}%
  {cct}%
  {single-pole contact:
   {\tt O}:  normally open\\
   {\tt C}: normally closed (default)\\
   {\tt I}: open circle contacts\\
   {\tt P}: three position\\
   {\tt R}: right orientation\\
   {\tt T}: T contacts\\
   {\tt U}: U contacts
   \seesect{Composite:}}%
\macrodef{contacts}{contacts}{({\sl count, chars})}%
  {cct}%
  {multiple ganged single-pole contacts:
   {\tt P}: three position\\
   {\tt O}: normally open\\
   {\tt C}: normally closed\\
   {\tt D}: dashed ganging line over contact armatures
   {\tt I}: open circle contacts\\
   {\tt R}: right orientation\\
   {\tt T}: T contacts\\
   {\tt U}: U contact lines parallel to drawing direction
   \seesect{Composite:}}%
\macrodef{contline}{contline}{({\sl line})}%
  {gen}%
  {evaluates to {\tt continue}%
    if processor is {\bf dpic}, otherwise to first arg (default {\tt line})}%
\macrodef{copy3}{copy3}{({\sl vector1,vector2})}%
  {dpictools}%
  {$\;\;$ Copy vector1 into vector named by arg2.}%
\macrodef{copythru}{copythru}{({\sl dpic macro name,} "{\sl file name}")}%
  {dpictools}%
  {$\;\;$ Implements the gpic {\tt copy {\sl filename} thru {\sl macro-name}}%
   for file data separated by commas, spaces, or tabs.}%
\macrodef{corner}{corner}{({\sl line thickness,attributes,turn radians})}%
  {gen}%
  { Mitre (default filled square) drawn at end of last line or at a
    given position.
    arg1 default: current line thickness;
    arg2: e.g. {\tt outlined} {\sl string}; if arg2 starts with
    {\tt at} {\sl position} then a manhattan (right-left-up-down) corner
    is drawn;
    arg3= radians (turn angle, +ve is ccw, default $\pi/2$).
    The corner is enclosed in braces
    in order to leave {\tt Here} unchanged unless arg2 begins with {\tt at}%
    \seesect{Corners:}}%
\macrodef{Cos}{Cos}{({\sl integer})}%
  {gen}%
  {cosine function, {\sl integer\/} degrees}%
\macrodef{cosd}{cosd}{({\sl arg})}%
  {gen}%
  {cosine of an expression in degrees}%
\macrodef{Cosine}{Cosine}{( {\sl amplitude}, {\sl freq}, {\sl time},
    {\sl phase} )}%
  {gen}%
  {function $a\times\cos(\omega t + \phi)$ }%
\macrodef{cross3}{cross3}{({\sl vec1, vec2, vec3})}%
  {dpictools}%
  {$\;\;$ The 3-vector cross product
    $\hbox{\sl vec3} = \hbox{\sl vec1} \times \hbox{\sl vec2}$.}%
\macrodef{cross3D}{cross3D}{({\sl x1,y1,z1,x2,y2,z2})}%
  {3D}%
  {cross product of two triples}%
\macrodef{cross}{cross}{(at {\sl location, size}|{\sl keys})}%
  {gen}%
  {Plots a small cross.  The possible key-value pairs are:
    {\tt size={\sl expr};},
    {\tt line={\sl attributes};} }%
\macrodef{crossover}{crossover}{(\linespec, [L|R][:{\sl line attributes}],
  Line1, Line2, .{.}.)}%
  {cct}%
  {line jumping left or right over ordered named lines\seesect{Semiconductors:}}%
\macrodef{crosswd\_}{crosswd_}{}%
  {gen}%
  {cross dimension}%
\macrodef{csdim\_}{csdim_}{}%
  {cct}%
  {controlled-source width}%
\Letter{D}%
\macrodef{dabove}{dabove}{(at {\sl location})}%
  {darrow}%
  {above (displaced dlinewid/2)}%
\macrodef{dac}{dac}{({\sl width,height,nIn,nN,nOut,nS})}%
  {cct}%
  {DAC with defined width, height, and number of inputs {\tt In$i$},
    top terminals {\tt N$i$}, ouputs {\tt Out$i$},
    and bottom terminals~{\tt S$i$} \seesect{Logicgates:}}%
\macrodef{Darc}{Darc}{({\sl center position},
  {\sl radius}, {\sl start radians}, {\sl end radians},
  {\sl parameters})}%
  {darrow}%
  {Wrapper for {\tt darc}.
   CCW arc in {\tt dline} style, with closed ends or (dpic only) arrowheads.
  Semicolon-separated {\sl parameters}:
  {\tt thick=}{\sl value}, {\tt wid=}{\sl value}, {\tt ends=}%
  {\sl x}{\tt -},
  {\tt -}{\sl x}, {\sl x}{\tt -}{\sl x}, {\tt ->}, {\sl x}{\tt ->},
  {\tt <-}, {\tt <-}{\sl x}, {\tt <->}%
  where {\sl x} means {\tt |} or (half-thickness line) {\tt !}.}%
\macrodef{darc}{darc}{({\sl center position},
  {\sl radius}, {\sl start radians}, {\sl end radians}, {\sl dline thickness},
  {\sl arrowhead wid}, {\sl arrowhead ht},
  {\sl end symbols}, {\sl outline attributes}, {\sl inner attributes})}%
  {darrow}%
  {See also {\tt Darc}.
   CCW arc in {\tt dline} style, with closed ends or (dpic only) arrowheads.
  Permissible {\sl end symbols}:
  {\sl x}{\tt -},
  {\tt -}{\sl x}, {\sl x}{\tt -}{\sl x}, {\tt ->}, {\sl x}{\tt ->},
  {\tt <-}, {\tt <-}{\sl x}, {\tt <->}%
  where {\sl x} means {\tt |} or (half-thickness line) {\tt !}.
  An inner arc is drawn overlaying the outer arc.
  Example: {\tt darc(,{,},{,},{,},{,}outlined "red",outlined "yellow")}.}%
\macrodef{Darlington}{Darlington}{(L|R,{\sl chars})}%
  {cct}%
  {Composite Darlington pair Q1 and Q2 with internal locations E, B, C;
   Characters in {\sl arg2:}\\
   E= envelope\\
   P= P-type\\
   B1= internal base lead\\
   D= damper diode\\
   R1= Q1 bias resistor; E1= ebox\\
   R2= Q2 bias resistor; E1= ebox\\
   Z= zener bias diode 
    \seesect{Semiconductors:}}%
\macrodef{darrow}{darrow}{(\linespec,
  t,t,{\sl width},{\sl arrowhd wd},{\sl arrowhd ht},{\sl parameters},
    {\sl color attributes})}%
  {darrow}%
  {See also {\tt Darrow}.
   Double arrow, truncated at beginning (arg2={\tt t}) or
    end (arg3={\tt t}), specified sizes,
    with arrowhead and optional closed stem. The parameters (arg7) are
    {\tt {\sl x}-} or {\tt ->} or {\tt {\sl x}->} or {\tt <-} or {\tt <-{\sl x}}%
    or {\tt <->} where {\sl x} is {\tt |} or {\tt !}.
    The {\tt !-} or {\tt -!} parameters close
    the stem with half-thickness lines to simplify butting to other objects.
    The color attributes are, e.g.,
    {\tt outlined "{\sl color}" shaded "{\sl color}"}.
    Example:
    {\tt linethick=5; darrow(down\_\ 2,{,},0.5,0.75,0.75,|,outlined "red")}. }%
\macrodef{Darrow}{Darrow}{(\linespec, {\sl parameters})}%
  {darrow}%
  {Wrapper for {\tt darrow}.
  Semicolon-separated {\sl parameters}:\\
    {\tt S;}, {\tt E;} truncate at start or end by dline thickness/2\\
    {\tt thick=}{\sl val};   (total thicknes, ie width)\\
    {\tt wid=}{\sl val};     (arrowhead width)\\
    {\tt ht=}{\sl val};      (arrowhead height)\\
    {\tt ends=}%
      {\sl x}{\tt -}{\sl x} or
      {\tt -}{\sl x} or
      {\sl x}{\tt -} where {\sl x} is {\tt !} (half-width line)
       or {\tt |} (full-width line).\\
    Examples:
    {\tt define(`dfillcolor',`1,0.85,0') linethick=5;
     rgbdraw(1,0,0,Darrow(down\_\ 2,thick=0.5; wid=0.75; ht=0.75; ends=|->))},
     which is equivalent to
    {\tt Darrow(down\_\ 2,thick=0.5; wid=0.75; ht=0.75; \
      ends=|->; outline="red")}.  }%
\macrodef{darrow\_init}{darrow_init}{}%
  {darrow}%
  {Initialize darrow drawing parameters (reads library file {\tt darrow.m4})}%
\macrodef{dashline}{dashline}{(\linespec,{\sl thickness}|{\sl color}|<->,
                                  {\sl dash len, gap len},G)}%
  {gen}%
  {dashed line with dash at end ({\tt G} ends with gap)}%
\macrodef{dbelow}{dbelow}{(at {\sl location})}%
  {darrow}%
  {below (displaced dlinewid/2)}%
\macrodef{dcosine3D}{dcosine3D}{({\sl i,x,y,z})}%
  {3D}%
  {extract i-th entry of triple x,y,z}%
\macrodef{DCsymbol}{DCsymbol}{(at {\sl position, len, ht,}%
  U|D|L|R|{\sl degrees}) }%
  {cct}%
  {A DC symbol (a dashed line below a solid line).
   The current drawing direction is default, otherwise Up, Down,
   Left, Right, or at {\sl degrees} slant; e.g., 
   {\tt source(up\_ dimen\_); $\lbrace$ DCsymbol(at last [],{},{},R) $\rbrace$}%
   \seesect{Twoterminal:} }%
\macrodef{DefineCMYKColor}{DefineCMYKColor}{({\sl color-name, c, m, y, k})}%
  {dpictools}%
  {$\;\;$ Like {\tt DefineRGBColor} but takes arguments in percent, i.e.,
    the range $[0,100].$ Define dpic macro {\sl colorname}%
    according to the postprocessor specified by dpic command-line option.
    The macro evaluates to a string.}%
\macrodef{DefineHSVColor}{DefineHSVColor}{({\sl color-name, h, s, v})}%
  {dpictools}%
  {$\;\;$ Like {\tt DefineRGBColor} but takes argument {\sl h} in the
    range $[0,360],$ {\sl s} in $[0,1],$ and {\sl v} in $[0,1].$
    Define dpic macro {\sl colorname}%
    according to the postprocessor specified by dpic command-line option.
    The macro evaluates to a string.}%
\macrodef{DefineRGBColor}{DefineRGBColor}{({\sl color-name, r, g, b})}%
  {dpictools}%
  {$\;\;$ Arguments are in the range 0 to 1. Define dpic macro {\sl colorname}%
    according to the postprocessor specified by dpic command-line option.
    The macro evaluates to a string.}%
\macrodef{definergbcolor}{definergbcolor}{({\sl color-name, r, g, b})}%
  {gen}%
  {Arguments are in the range 0 to 1. Define color name
    according to the postprocessor.  Similar to dpictools {\tt DefineRGBColor}%
    but the color name is an m4 macro, not a string.}%
\macrodef{delay}{delay}{(\linespec,{\sl size},{\sl attributes})}%
  {cct}%
  {delay element\seesect{Twoterminal:}}%
\macrodef{delay\_rad\_}{delay_rad_}{}%
  {cct}%
  {delay radius}%
\macrodef{deleminit\_}{deleminit_}{}%
  {darrow}%
  {sets drawing direction for dlines}%
\macrodef{Deltasymbol}{Deltasymbol}{(at {\sl position},keys,
    U|D|L|R|{\sl degrees}) (default {\tt U} for up)}%
  {cct}%
  {Delta symbol for power-system diagrams.
   {\sl keys:} {\tt size={\sl expression;}}%
    {\tt type=C|O} (default {\tt C} for closed;
      {\tt O} draws an ``open'' symbol); }%
\macrodef{Demux}{Demux}{({\sl n},{\sl label},
  {\tt [L][B|H|X][N[{\sl n}]|S[{\sl n}]][[N]OE],
   {\sl wid},{\sl ht},{\sl attributes}})}%
  {log}%
  {binary demultiplexer, $n$ inputs\\
    {\tt L} reverses input pin numbers\\
    {\tt B} displays binary pin numbers\\
    {\tt H} displays hexadecimal pin numbers\\
    {\tt X} do not print pin numbers\\
    {\tt N[{\sl n}]} puts Sel or Sel$0$ .. Sel$n$ at the top
    (i.e., to the left of the drawing direction)\\
    {\tt S[{\sl n}]} puts the Sel inputs at the bottom (default)
    {\tt OE} ({\tt N=}negated) {\tt OE} pin
    \seesect{Logicgates:}}%
\macrodef{dend}{dend}{(at {\sl location},
  {\sl line thickness}{\tt |}{\sl attributes})}%
  {darrow}%
  {Close (or start) double line (Note specifying {\tt dends=} for {\tt Dline}%
   is a similar function.  Arg2 is dline thickness or atributes:
   {\tt thick={\sl expression};} (dline thickness in drawing units)
   {\tt outline=({\sl r,g,b})|"{\sl color}";}}%
\macrodef{d\_fet}{d_fet}{(\linespec,R,P,E|S)}%
  {cct}%
  {left or right, N or P depletion MOSFET, envelope or simplified
    \seesect{Semiconductors:}}%
\macrodef{dfillcolor}{dfillcolor}{}%
  {darrow}%
  {dline fill color (default white)}%
\macrodef{diff3}{diff3}{({\sl vec1, vec2, vec3})}%
  {dpictools}%
  {$\;\;$ The 3-vector subtraction
    $\hbox{\sl vec3} = \hbox{\sl vec1} - \hbox{\sl vec2}$.}%
\macrodef{dfitcurve}{dfitcurve}{({\sl Name, n, linetype, m})}%
  {dpictools}%
  {$\;\;$ Draw a spline through {\sl Name}{\tt [m],} \ldots {\sl Name}{\tt [n]}%
   with attribute {\sl linetype} {\tt dotted,} for example.
   The calculated control points {\sl P[i]} satisfy approximately:
   {\sl P[0] = V[0];} {\sl P[i-1]/8 + P[i]*3/4 + P[i+1]/8 = V[i];}%
   {\sl P[n] = V[n].}  See m4 macro {\tt fitcurve.}}%
\macrodef{dfitpoints}{dfitpoints}{({\sl V,n,m,P,mp})}%
  {dpictools}%
  {$\;\;$ Compute the control locations {\tt P[mP], P[mP+1]...} for
  the spline passing throught points {\tt V[m]...V[n].}  Used by
  macro {\tt dfitcurve}.}%
\macrodef{diff3D}{diff3D}{({\sl x1,y1,z1,x2,y2,z2})}%
  {3D}%
  {difference of two triples}%
\macrodef{diff\_}{diff_}{({\sl a},{\sl b})}%
  {gen}%
  {difference function}%
\macrodef{dimen\_}{dimen_}{}%
  {cct}%
  {size parameter for scaling circuit element bodies \seesect{Circuitscaling:}}%
\macrodef{dimension\_}{dimension_}{(\linespec,{\sl offset},{\sl label},
    D|H|W|{\sl blank width},{\sl tic offset},{\sl arrowhead })}%
  {gen}%
  {macro for dimensioning diagrams;
      {\sl arrowhead=}{\tt -> | <-}}%
\macrodef{diode}{diode}{(\linespec,%
B|b|CR|D|G|L|LE[R]|P[R]|S|Sh|T|U|V|v|w|Z|chars,%
[R][E])}%
  {cct}%
  {diode:
   {\tt B}: bi-directional\\
   {\tt b}: bi-directional with outlined zener crossbar\\
   {\tt CR}: current regulator\\
   {\tt D}: diac\\
   {\tt G}: Gunn\\
   {\tt L}: open form with centre line\\
   {\tt LE[R]}: LED [right]\\
   {\tt P[R]}: photodiode [right]\\
   {\tt S}: Schottky\\
   {\tt Sh}: Shockley\\
   {\tt T}: tunnel\\
   {\tt U}: limiting\\
   {\tt V}: varicap\\
   {\tt v}: varicap (curved plate)\\
   {\tt w}: varicap (reversed polarity)\\
   {\tt Z}: zener\\
   appending {\tt K} to arg 2 draws open arrowheads;
   arg 3: {\tt R}: reversed polarity, {\tt E}: enclosure \seesect{Twoterminal:}}%
%\macrodef{DIP}{DIP}{({\sl pin count, attributes})}%
%  {log}%
%  {Dual in-line package diagram. Default pin count = 8.
%   Arg2 ({\sl attributes})= semicolon-separated list of optional terms:
%   {\tt bodywid=}{\sl expr} (default 0.25$\,$in${} {}$5{\tt *L\_unit}),
%   {\tt bodylen=}{\sl expr} (default {\sl pin count} $\times$ {\sl pin pitch}),
%   {\tt pinpitch=}{\sl expr} (default 0.1),
%   {\tt pinwid=}{\sl expr} (default 0.06),
%   {\tt pinlen=}{\sl expr} (default 0.05),
%   {\tt direct=U|D|L|R} (default {\tt U} for up),
%   {\tt type=I|Q} (default {\tt I}; Q=pins of alternating length)
%   \seesect{Logicgates:}}%
\macrodef{dir\_}{dir_}{}%
  {darrow}%
  {used for temporary storage of direction by darrow macros}%
\macrodef{distance}{distance_}{({\sl Position 1}, {\sl Position2})}%
  {gen}%
  {distance between named positions}%
\macrodef{distance}{distance}{({\sl position}, {\sl position})}%
  {gen}%
  {distance between positions}%
\macrodef{dlabel}{dlabel}{({\sl long},{\sl lat},{\sl label},{\sl
     label},{\sl label},{\sl chars})}%
  {cct}%
  {general triple label; {\sl chars:}%
    $X$ displacement {\tt {\sl long, lat}} with respect to the drawing
      direction is from the centre of the last
      line rather than the centre of the last {\tt [ ]};
    L,R,A,B align labels ljust, rjust, above,
      or below (absolute) respectively  \seesect{Labels:}}%
\macrodef{dleft}{dleft}{({\tt at} {\sl position}, {\sl line thickness},
      {\sl attributes})}%
  {darrow}%
  {Double line left turn 90 degrees.  Attributes can be
    {\tt outline=({\sl r, g, b})|"{\sl color}";}%
    {\tt innershade=({\sl r, g, b})|"{\sl color}";}%
    where rgb values in parentheses or a defined color is specified.}%
\macrodef{Dline}{Dline}{(\linespec, {\sl parameters})}%
  {darrow}%
  {Wrapper for {\tt dline}.
  The semicolon-separated {\sl parameters} are:\\
    {\tt S;}, {\tt E;} truncate at start or end by dline thickness/2;\\
    {\tt thick={\sl val};}   (total thicknes, ie width);\\
    {\tt outline={\sl color};} (e.g., {\tt "red"} or {\tt (1,0,0)}),\\
    {\tt innershade={\sl color};} (e.g., {\tt (0,1,1)} or {\tt "cyan"}),\\
    {\tt name={\sl Name};},\\
    {\tt ends=}%
      {\sl x}{\tt -}{\sl x} or
      {\tt -}{\sl x} or
      {\sl x}{\tt -} where {\sl x} is {\tt !} (half-width line)
       or {\tt |;} (full-width line).}%
\macrodef{dline}{dline}{(\linespec,t,t,{\sl width},{\sl parameters})}%
  {darrow}%
  {See also {\tt Dline}.
   Double line, truncated by half width at either end, closed
    at either or both ends.
   {\sl parameters=}%
      {\sl x}{\tt -}{\sl x} or
      {\tt -}{\sl x} or
      {\sl x}{\tt -} where {\sl x} is {\tt !} (half-width line)
       or {\tt |} (full-width line).}%
\macrodef{dlinewid}{dlinewid}{}%
  {darrow}%
  {width of double lines}%
\macrodef{dljust}{dljust}{(at {\sl location})}%
  {darrow}%
  {ljust (displaced dlinewid/2)}%
\macrodef{dna\_}{dna_}{}%
  {cct}%
  {internal character sequence that specifies which subcomponents are drawn}%
\macrodef{dn\_}{dnx}{}%
  {gen}%
  {down with respect to current direction}%
%\macrodef{dnm\_}{dnm_}{}%
%  {cct}%
%  {similar to dna\_}%
\macrodef{dot3}{dot3}{({\sl vec1, vec2})}%
  {dpictools}%
  {$\;\;$ Expands to the dot (scalar) product of the two 3-vector arguments:
   $(\${}1[1]\cdot\${}2[1] + \${}1[2]\cdot\${}2[2] + \${}1[3]\cdot\${}2[3])$.}%
\macrodef{dot3D}{dot3D}{({\sl x1,y1,z1,x2,y2,z2})}%
  {3D}%
  {dot product of two triples}%
\macrodef{dot}{dot}{(at {\sl location},{\sl radius}|{\sl keys},{\sl fill})}%
  {gen}%
  {Filled circle (third arg= gray value: 0=black, 1=white). The possible
   key-value pairs are:
    {\tt rad={\sl expr};} and
    {\tt circle={\sl attributes};} }%
\macrodef{dotrad\_}{dotrad_}{}%
  {gen}%
  {dot radius}%
\macrodef{down\_}{down_}{}%
  {gen}%
  {sets current direction to down \seesect{Placing:}}%
\macrodef{dpquicksort}{dpquicksort}{({\sl array name, lo, hi, ix})}%
  {dpictools}%
  {$\;\;$ Given array {\sl a[lo:hi]} and index array {\sl ix[lo:hi] =
    lo, lo+1, lo+2,\ldots hi}, sort {\sl a[lo:hi]} and do identical exchanges
    on {\sl ix}.}%
\macrodef{dprot}{dprot}{({\sl radians, x, y})}%
  {dpictools}%
  {$\;\;$ Evaluates to a rotated pair (see m4 {\tt rot\_}).}%
\macrodef{dprtext}{dprtext}{({\sl degrees, text})}%
  {dpictools}%
  {$\;\;$ Rotated PStricks or pgf text in a {\tt []} box.}%
\macrodef{dright}{dright}{({\tt at} {\sl position}, {\sl line thickness},
      {\sl attributes})}%
  {darrow}%
  {Double line right turn 90 degrees.  Attributes can be
    {\tt outline=({\sl r, g, b})|"{\sl color}";}%
    {\tt innershade=({\sl r, g, b})|"{\sl color}";}%
    where rgb values in parentheses or a defined color is specified.}%
\macrodef{drjust}{drjust}{(at {\sl location})}%
  {darrow}%
  {rjust (displaced dlinewid/2)}%
\macrodef{dswitch}{dswitch}{(\linespec, L|R, W[ud]B {\sl chars},
     {\sl attributes})}%
  {cct}%
  {
                                 Comprehensive IEEE-IEC single-pole switch:
                                 arg2={\tt R}: orient to the right of
                                     drawing dir
                                 arg4 is a key-value sequence for the body of
                                 {\tt GC} and {\tt GX} options:
                                   {\tt GC} keys: {\tt diam, circle;}%
                                   {\tt GX} keys: {\tt lgth, wdth, box, text}.
\par
                                 Arg 3:
                                   blank means {\tt WB} by default\\
                                   {\tt B}: contact blade open\\
                                   {\tt Bc}: contact blade closed\\
                                   {\tt Bm}: mirror blade\\
                                   {\tt Bo}: contact blade more widely open\\
                                   {\tt dB}: contact blade to the right of
                                     direction\\
                                   {\tt Cb}: circuit breaker function 
                                     (IEC S00219)\\
                                   {\tt Co}: contactor function (IEC S00218)\\
                                   {\tt C}: external operating mechanism\\
                                   {\tt D}: circle at contact and hinge
                                      ({\tt dD} = hinge only,
                                       {\tt uD}: contact only)\\
                                   {\tt DI}: Disconnector, isolator
                                     (IEC S00288)\\
                                   {\tt E}: emergency button\\
                                   {\tt EL}: early close (or late open)\\
                                   {\tt LE}: late close (or early open)\\
                                   {\tt F}: fused\\
                                   {\tt GC}: disk control mechanism, attribs:
                                    {\tt diam={\sl expr};
                                         circle={\sl circle attribs};}\\
                                   {\tt GX}: box control mechanism, attribs:
                                    {\tt lgth={\sl expr}; wdth={\sl expr}; %
                                         box={\sl box attr};}%
                                    {\tt text={\sl char};}\\
                                   {\tt H}: time delay closing\\
                                   {\tt uH}: time delay opening\\
                                   {\tt HH}: time delay opening and closing\\
                                   {\tt K}: vertical closing contact line
                                     use {\tt WdBK} for a normally-closed
                                     switch\\
                                   {\tt L}: limit\\
                                   {\tt M}: maintained (latched)\\
                                   {\tt MM}: momentary contact on make\\
                                   {\tt MR}: momentary contact on release\\
                                   {\tt MMR}: momentary contact on make and
                                     release\\
                                   {\tt O}: hand operation button\\
                                   {\tt P}: pushbutton\\
                                   {\tt Pr[T|M]}: proximity (touch-sensitive or
                                       magnetically controlled)\\
                                   {\tt R}: time-delay operating arm\\
                                   {\tt Sd}: Switch-disconnector\\
                                   {\tt Th}: thermal control linkage\\
                                   {\tt Tr}: tripping\\
                                   {\tt W}: baseline with gap\\
                                   {\tt Y}: pull switch\\
                                   {\tt Z}: turn switch
   \seesect{Twoterminal:}}%
\macrodef{dtee}{dtee}{([L|R], {\sl line thickness}, {\sl attributes})}%
  {darrow}%
  {Double arrow tee junction with tail to left,
   right, or (default) back along current direction, leaving the current
   location at the tee centre; e.g.,
   {\tt dline(right\_,{,}t); dtee(R);
    \{ darrow(down\_,t) \}; darrow(right\_,t)}.
   The attributes are
     {\tt thick={\sl expr};} (line thickness in drawing units),
     {\tt innershade=({\sl r,g,b})|"{\sl color}";}%
     {\tt outline=({\sl r,g,b})|"{\sl color}";}. }%
\macrodef{dtor\_}{dtor_}{}%
  {gen}%
  {degrees to radians conversion constant}%
\macrodef{dturn}{dturn}{({\sl degrees ccw},{\sl line thickness},
  {\sl attributes})}%
  {darrow}%
  {Tturn dline arg1 degrees left (ccw).
  Attributes can be
    {\tt outline=({\sl r, g, b})|"{\sl color}";}%
    {\tt innershade=({\sl r, g, b})|"{\sl color}";}%
    where rgb values in parentheses or a defined color is specified.}%
%
\Letter{E}%
\macrodef{earphone}{earphone}{( U|D|L|R|{\sl degrees, size})}%
  {cct}%
  {earphone, {\sl In1} to {\sl In3} defined
   \seesect{Composite:}}%
\macrodef{ebox}{ebox}{(\linespec,{\sl lgth},{\sl wdth},{\sl fill value},
  {\sl box attributes})}%
  {cct}%
  { two-terminal box element with adjustable dimensions and fill
   value 0 (black) to 1 (white). {\sl lgth} (length) and {\sl wdth} (width)
   are relative
   to the direction of \linespec. Alternatively, argument 1 is the
   \linespec\ and argument 2 is a semicolon-separated sequence of key=value
   terms.  The possible keys are {\tt lgth, wdth, text, box},
   e.g., {\tt lgth=0.2; text=\char34{}XX\char34;
     box=shaded \char34{}green\char34}\seesect{Twoterminal:}}%
\macrodef{E\_\_}{E__}{}%
  {gen}%
  {the constant $e$}%
\macrodef{e\_}{e_}{}%
  {gen}%
  {.e relative to current direction}%
\macrodef{e\_fet}{e_fet}{(\linespec,R,P,E|S)}%
  {cct}%
  {left or right, N or P enhancement MOSFET, normal
   or simplified, without or with envelope
    \seesect{Semiconductors:}}%
\macrodef{elchop}{elchop}{({\sl Name1,Name2})}%
  {gen}%
  {{\tt chop} for ellipses: evaluates to {\tt chop} $r$ where $r$ is
    the distance from the centre of ellipse Name1 to the intersection of
    the ellipse with a line to location Name2;
    e.g., {\tt line from A to E elchop(E,A)}}%
\macrodef{eleminit\_}{eleminit_}{(\linespec)}%
  {cct}%
  {internal line initialization}%
\macrodef{elen\_}{elen_}{}%
  {cct}%
  {default element length}%
\macrodef{ellipsearc}{ellipsearc}{({\sl width, height, startangle, endangle,
   rotangle, {\tt cw|ccw}, line attributes})}%
  {gen}%
  {Arc of a rotated ellipse in a {\tt [ ]} block. Angles are in radians.
   Arg5 is the angle of the width axis;
   e.g., {\tt ellipsearc(2,1,0,pi\_,pi\_/4,{},dashed ->)}.  Internal locations
   are {\tt Start, End, C} (for centre). }%
\macrodef{em\_arrows}{em_arrows}{({\sl type}|{\sl keys, angle, length})}%
  {cct}%
  { Radiation arrows: {\sl type} {\tt N|I|E [D|T]}:\\
  {\tt N}: nonionizing,\\
  {\tt I}: ionizing,\\
  {\tt E}: simple;\\
  {\tt D}: dot on arrow stem;\\
  {\tt T}: anchor tail;\\
  {\sl keys:} {\tt type=}{\sl chars} as above;\\
  {\tt angle=}{\sl degrees}; (absolute direction)\\
  {\tt lgth=}{\sl expr};\\
  {\tt sep=}{\sl expr}; arrow separation
  \seesect{Twoterminal:}}%
\macrodef{endshade}{endshade}{}%
  {gen}%
  {end gray shading, see {\tt beginshade}}%
\macrodef{Equidist3}{Equidist3}{({\sl Pos1, Pos2, Pos3, Result, distance})}%
  {gen}%
  {Calculates location named {\sl Result} equidistant from the first three
   positions, i.e.\ the centre of the circle passing through the three
   positions.  If arg5 is nonblank, it is returned equated to the radius.}%
\macrodef{expe}{expe}{}%
  {gen}%
  {exponential, base $e$}%
%
\Letter{F}%
\macrodef{f\_box}{f_box}{({\sl boxspecs},{\sl text},{\sl expr1},$\cdots$)}%
  {gen}%
  {like {\tt s\_box} but the text is overlaid on a box of identical size.
   If there is only one argument then the default box
   is invisible and filed white
    \seesect{Interaction:}}%
\macrodef{Fector}{Fector}{({\sl x1,y1,z1,x2,y2,z2})}%
  {3D}%
  {vector projected on current view plane with top face
   of 3-dimensonal arrowhead normal to x2,y2,z2 }%
\macrodef{Fe\_fet}{Fe_fet}{(\linespec,R,{\sl chars})}%
  {cct}%
  {FET with superimposed ferroelectric symbol. Args 1 to 3 are as for
   the {\tt mosfet} macro
    \seesect{Semiconductors:}}%
\macrodef{FF\_ht}{FF_ht}{}%
  {cct}%
  {flipflop height parameter in {\tt L\_unit}s}%
\macrodef{FF\_wid}{FF_wid}{}%
  {cct}%
  {flipflop width parameter in {\tt L\_unit}s}%
\macrodef{fill\_}{fill_}{({\sl number})}%
  {gen}%
  {fill macro, 0=black, 1=white\seesect{Semiconductors:}}%
\macrodef{findroot}{findroot}{%
  ({\sl function name, left bound, right bound, tolerance, variable}))}%
  {dpictools}%
  {$\;\;$ Solve $\hbox{\sl function}(x) = 0$ by the method of 
   bisection.  The calculated value is assigned to the variable named in the
   last argument (\SR{Libraries:}). Example:
   {\tt define parabola \{ \$2 = (\$1)\char94{}2 - 1 \};
   findroot( parabola, 0, 2, 1e-8, x )}. }%
\macrodef{fitcurve}{fitcurve}{(V, n, {\sl attributes,} m (default 0))}%
  {gen}%
  {Draw a spline through positions V[m], \ldots V[n]: Works only with dpic.}%
\macrodef{FlipFlop}{FlipFlop}{(D|T|RS|JK,{\sl label},{\sl boxspec},%
 {\sl pinlength})}%
  {log}%
  {flip-flops,
  {\sl boxspec} e.g.,\ ht x wid y \seesect{Logicgates:}}%
\macrodef{FlipFlopX}{FlipFlopX}{({\sl boxspec, label, leftpins, toppins,
   rightpins, bottompins, pinlength})}%
  {log}%
  {General flipflop.
   Arg 1 modifies the box (labelled Chip) default specification.
   Each of args 3 to 6 is null or a string of {\sl pinspecs}%
   separated by semicolons ({\tt;}).  A {\sl Pinspec} is either empty
   or of the form
   {\tt[}{\sl pinopts}{\tt]:[}{\sl label}{\tt[:}{\sl Picname}{\tt]]}.
   The first colon draws the pin.
   Pins are placed top to bottom or left to right along the box edges with
   null {\sl pinspecs} counted for placement. Pins are named by side and number
   by default; eg {\tt W1, W2, ..., N1, N2, ..., E1, ..., S1, ...} ; however,
   if {\tt:}{\sl Picname} is present in a {\sl pinspec} then {\sl Picname}%
   replaces the default name.
   A {\sl pinspec} label is text placed at the pin base. Semicolons are
   not allowed in labels; use, e.g., {\tt \char92{}char59\char123\char125}%
   instead.
   To put a bar over a label, use {\tt lg\_bartxt(}{\sl label}{\tt)}.
   The {\sl pinopts} are {\tt[N|L|M][E]};
   {\tt N}: pin with not circle;
   {\tt L}: active low out;
   {\tt M}: active low in;
   {\tt E}: edge trigger \seesect{Logicgates:}.\\
   Optional arg 7 is the length of pins}%
\macrodef{foreach\_}{foreach_}{(`{\sl variable}',{\sl actions},{\sl
  value1, value2, $\ldots$})}%
  {gen}%
  {Clone of Loopover\_ by a different name:
   Repeat {\sl actions} with {\sl variable} set successively to
   {\sl value1, value2, $\ldots$}, setting macro {\tt m4Lx} to 1, 2,
   $\ldots$, terminating if {\sl variable} is nul}%
\macrodef{for\_}{for_}{({\sl start},{\sl end},{\sl increment},`{\sl actions}')}%
  {gen}%
  {integer for loop with index variable {\tt m4x} \seesect{Looping:}}%
\macrodef{FTcap}{FTcap}{({\sl chars})}%
  {cct}%
  {Feed-through capacitor; example of a composite element derived from
   a two-terminal element.  Defined points: {\sl .Start, .End, .C .T1 .T2 T}%
   Arg 1: {\tt A}:  type A (default),
   {\tt B}: type B,
   {\tt C}: type C 
   \seesect{Composite:}}%
\macrodef{fuse}{fuse}{({\sl linespec, type, wid, ht, attributes})}%
  {cct}%
  {fuse symbol, type$=$
  {\tt  A|B|C|D|S|HB|HC|SB} or {\tt dA=D}\seesect{Twoterminal:}}%
%
\Letter{G}%
\macrodef{gap}{gap}{(\linespec,{\sl fill},A)}%
  {cct}%
  {gap with (filled) dots, A=chopped arrow between dots\seesect{Twoterminal:}}%
\macrodef{gen\_init}{gen_init}{}%
  {gen}%
  {initialize environment for general diagrams
    (customizable, reads {\tt libgen.m4})}%
\macrodef{g\_fet}{g_fet}{(\linespec,R,P,{\sl shade spec})}%
  {cct}%
  {left or right, N or P graphene FET, without or with shading
    \seesect{Semiconductors:}}%
\macrodef{g\_}{g_}{}%
  {gen}%
  {green color value}%
\macrodef{G\_hht}{G_hht}{}%
  {log}%
  {gate half-height in {\tt L\_unit}s}%
\macrodef{glabel\_}{glabel_}{}%
  {cct}%
  {internal general labeller}%
%\macrodef{gpar\_}{gpar_}{({\sl element},{\sl element},{\sl separation})}%
%  {cct}%
%  {two same-direction elements in parallel}%
\macrodef{gpolyline\_}{gpolyline_}{({\sl fraction},{\sl location}, ...)}%
  {gen}%
  {internal to {\tt gshade}}%
\macrodef{graystring}{graystring}{({\sl gray value})}%
  {gen}%
  {evaluates to a string compatible with the postprocessor in use
   to go with {\tt colored}, {\tt shaded}, or {\tt outlined} attributes.
   (PSTricks, metapost, pgf-tikz, pdf, postscript, svg).
   The argument is a fraction in the range $[0,1]$; see {\tt rgbstring}}%
\macrodef{grid\_}{grid_}{({\sl x},{\sl y})}%
  {log}%
  {absolute grid location}%
\macrodef{ground}{ground}{(at {\sl location}, T|{\sl stem length},
   N|F|S|L|P[A]|E, U|D|L|R|{\sl degrees})}%
  {cct}%
  { ground, without stem for 2nd arg = T;\\
    {\tt N}: normal,\\
    {\tt F}: frame,\\
    {\tt S}: signal,\\
    {\tt L}: low-noise,\\
    {\tt P}: protective,\\
    {\tt PA}: protective alternate,\\
    {\tt E}: European; up, down, left, right, or angle
    from horizontal (default -90) \\
   \seesect{Composite:}}%
\macrodef{gshade}{gshade}{({\sl gray value},A,B,...,Z,A,B)}%
  {gen}%
  {(Note last two arguments).  Shade a polygon with named
    vertices, attempting to avoid sharp corners}%
\macrodef{gyrator}{gyrator}{({\sl box specs,space ratio,pin lgth,}[N][V])}%
  {cct}%
  {Gyrator two-port wrapper for {\tt nport}, {\tt N} omits pin dots; {\tt V}%
   gives a vertical orientation
   \seesect{Composite:}}%
%
\Letter{H}%
\macrodef{hatchbox}{hatchbox}{({\sl boxspec,hashsep,hatchspec,angle})
  {\rm or} hatchbox({\sl keys})}%
  {gen}%
% {Alternate invocation: {\tt hatchbox({\sl keys})}.
  {Manhattan box hatched at a specified separation
    and angle (default 45 degrees).
   Defined keys are:\\
    {\tt wid={\sl expr};}\\
    {\tt ht={\sl expr};}\\
    {\tt box={\sl attributes};} (e.g. {\tt dashed outline "{\sl color}"})\\
    {\tt fillcolor="{\sl color}"|({\sl r,g,b});}\\
    {\tt hatchsep={\sl expr};}\\
    {\tt hatchspec={\sl attributes};}\\
    {\tt angle={\sl expr};}%
 e.g.,
   {\tt hatchbox(outlined "blue",{},dashed outlined "green" thick 0.4)};\\
   also
   {\tt DefineRGBColor(mycolor,1,0.2,0.5);\\
        hatchbox(box=dashed outlined mycolor)}}%
\macrodef{Header}{Header}{(1|2,{\sl rows,wid,ht,box attributes})}%
  {log}%
  {Header block with 1 or 2 columns and square Pin 1:
   arg1 = number of columns;
   arg2 = pins per column;
   arg3,4 = custom wid, ht;
   arg5 = e.g., {\tt fill\_(0.9)}%
    \seesect{Composite:}}%
\macrodef{HeaderPin}{HeaderPin}{({\sl location, type, Picname},%
n|e|s|w,{\sl length})}%
  {log}%
  {General pin for {\tt Header} macro; arg 4 specifies pin direction
   with respect to the current drawing direction)}%
\macrodef{heatere}{heatere}{({\sl linespec, keys,} [R][T])}%
  {cct}%
  {Heater element with curved sides\seesect{Twoterminal:}.
    {\tt R} means right orientation;
    {\tt T} truncates leads to the width of the body.
    The {\sl keys} for the body are
    {\tt lgth={\sl expr};}%
    {\tt wdth={\sl expr};} (default {\tt lgth*2/5});
    {\tt cycles={\sl expr};}%
    {\tt line={\sl attributes};} (e.g., {\tt dotted, dashed, outlined})}%
\macrodef{heater}{heater}{({\sl linespec, ndivisions|keys, wid, ht,
    boxspec}|[E[R][T]])}%
  {cct}%
  {Heater element\seesect{Twoterminal:}. If arg 5 contains {\tt E,}%
    draws an {\tt heatere({\sl linespec, keys,} [R][T]),}%
    otherwise a
    {\tt heatert({\sl linespec, nparts, wid, ht, boxspec})}}%
\macrodef{heatert}{heatert}{({\sl linespec, nparts|keys, wid, ht, boxspec})}%
  {cct}%
  {Two-terminal rectangular heater element\seesect{Twoterminal:}.
    The {\sl keys} for the body are
    {\tt parts={\sl expr};}%
    {\tt lgth={\sl expr};}%
    {\tt wdth={\sl expr};} (default {\tt lgth*2/5});
    {\tt box={\sl body attributes};}%
      (e.g., {\tt dotted, dashed, outlined, shaded}).
    Args 3--5 are unused if any key is given}%
\macrodef{hexadecimal\_}{hexadecimal_}{($n$, [$m$])}%
  {gen}%
  {hexadecimal representation of $n,$ left padded to $m$ digits if the second
   argument is nonblank}%
\macrodef{hex\_digit}{hex_digit}{($n$)}%
  {gen}%
  {hexadecimal digit for $0 \leq n < 16$}%
\macrodef{H\_ht}{H_ht}{}%
  {log}%
  {hysteresis symbol dimension in {\tt L\_unit}s}%
\macrodef{histbins}{histbins}{({\sl data-array name, n, min, max, nbins,
  bin array name})}%
  {dpictools}%
  {$\;\;$ Generate the distribution of {\sl n} values in {\sl data-array}.
    If given, arg3 and arg4 specify maximum and minimum data values,
    otherwise they are calculated. Bins have index 0 to arg5-1.}%
\macrodef{hlth}{hlth}{}%
  {gen}%
  {current line half thickness in drawing units}%
\macrodef{hoprad\_}{hoprad_}{}%
  {cct}%
  {hop radius in crossover macro}%
\macrodef{hsvtorgb}{hsvtorgb}{({\sl h, s, v, r, g, b})}%
  {dpictools}%
  {$\;\;$ hsv color triple to rgb; {\sl h} has range 0 to 360.}%
\macrodef{ht\_}{ht_}{}%
  {gen}%
  {height relative to current direction}%
%
\Letter{I}%
\macrodef{ifdpic}{ifdpic}{({\sl if true},{\sl if false})}%
  {gen}%
  {test if dpic has been specified as pic processor}%
\macrodef{ifgpic}{ifgpic}{({\sl if true},{\sl if false})}%
  {gen}%
  {test if gpic has been specified as pic processor}%
\macrodef{ifinstr}{ifinstr}{({\sl string},{\sl string},{\sl if true},{\sl
    if false})}%
  {gen}%
  {test if the second argument is a substring of the first; also
  {\tt ifinstr({\sl string},{\sl string},{\sl if true},{\sl
  string},{\sl string},{\sl if true}, $\ldots$ {\sl if false})}%
    }%
\macrodef{ifmfpic}{ifmfpic}{({\sl if true},{\sl if false})}%
  {gen}%
  {test if mfpic has been specified as pic post-processor}%
\macrodef{ifmpost}{ifmpost}{({\sl if true},{\sl if false})}%
  {gen}%
  {test if MetaPost has been specified as pic post-processor}%
\macrodef{ifpgf}{ifpgf}{({\sl if true},{\sl if false})}%
  {gen}%
  {test if \TPGF~has been specified as pic post-processor}%
\macrodef{ifpostscript}{ifpostscript}{({\sl if true},{\sl if false})}%
  {gen}%
  {test if Postscript ({\tt dpic -r}) has been specified as pic output format}%
\macrodef{ifpsfrag}{ifpsfrag}{({\sl if true},{\sl if false})}%
  {gen}%
  {Test if either {\tt psfrag} or {\tt psfrag\_} has been defined. For
   postscript with psfrag strings, one or the other should be defined
   prior to or at the beginning of the diagram}%
\macrodef{ifpstricks}{ifpstricks}{({\sl if true},{\sl if false})}%
  {gen}%
  {test if \PSTricks~has been specified as post-processor}%
\macrodef{ifroff}{ifroff}{({\sl if true},{\sl if false})}%
  {gen}%
  {test if {\bf troff} or {\bf groff} has been specified as post-processor}%
\macrodef{ifxfig}{ifxfig}{({\sl if true},{\sl if false})}%
  {gen}%
  {test if Fig 3.2 ({\tt dpic -x}) has been specified as pic output format}%
\macrodef{igbt}{igbt}{(\linespec,L|R,[L][[d]D])}%
  {cct}%
  {left or right IGBT, L=alternate gate type, D=parallel diode,
   dD=dotted connections }%
\macrodef{inductor}{inductor}{(\linespec, W|L, {\sl cycles}, M[n]|P[n]|K[n],
   {\sl loop wid})}%
  {cct}%
  {inductor, arg2: (default narrow), {\tt W}: wide, {\tt L}: looped;\\
   arg3: number of arcs or cycles (default 4);\\
   arg4:
   {\tt M}: magnetic core,
   {\tt P}: powder (dashed) core,
   {\tt K}: long-dashed core,
     n={\sl integer} (default 2) number of core lines named
     {\sl M4Core1, M4Core2,} $\ldots$;\\
   arg5: loop width (default {\tt L, W}: {\tt dimen\_}/5;
     other: {\tt dimen\_}/8)
   \seesect{Twoterminal:}}%
\macrodef{in\_\_}{in__}{}%
  {gen}%
  {absolute inches}%
\macrodef{inner\_prod}{inner_prod}{({\sl linear obj},{\sl linear obj})}%
  {gen}%
  {inner product of (x,y) dimensions of two linear objects}%
\macrodef{integrator}{integrator}{(\linespec,{\sl size})}%
  {cct}%
  {integrating amplifier\seesect{Twoterminal:}}%
\macrodef{intersect\_}{intersect_}{({\sl line1}.start,{\sl line1}.end,
{\sl line2}.start,{\sl line2}.end)}%
  {gen}%
  {intersection of two lines}%
\macrodef{Intersect\_}{Intersect_}{({\sl Name1},{\sl Name2})}%
  {gen}%
  {intersection of two named lines}%
\macrodef{Int\_}{Int_}{}%
  {gen}%
  {corrected (old) gpic $int()$ function}%
\macrodef{IOdefs}{IOdefs}{(\linespec,{\sl label},[P|N]*,L|R) }%
  {log}%
  {Define locations {\sl label}{\tt 1}, $\ldots$ {\sl label}{\tt n}%
    along the line; {\tt P}: label only;
    {\tt N}: with {\tt NOT\_circle};
    {\tt R}: circle to right of current direction }%
%
\Letter{J}%
\macrodef{jack}{jack}{(U|D|L|R|{\sl degrees},{\sl chars})}%
  {cct}%
  {arg1: drawing direction; string arg2: {\tt R}: right orientation,
   one or more {\tt L[M][B]} for L and auxiliary contacts with make or break
   points; {\tt S[M][B]} for S and auxiliary contacts
   \seesect{Composite:}}%
\macrodef{j\_fet}{j_fet}{(\linespec,L|R,P,E)}%
  {cct}%
  {left or right, N or P JFET, without or with envelope
    \seesect{Semiconductors:}}%
\macrodef{jumper}{jumper}{({\sl linespec, chars}|{\sl keys})}%
  {cct}%
  { Two-terminal solder jumper with named body parts.
    The {\sl chars} character sequence specifies the jumper components,
    and normally begins with {\tt C} and ends with {\tt D.} The character
    {\tt E} is an empty (blank) gap, {\tt J} is a filled gap, {\tt B}%
    is a box component.  The components are named {\sl T1, T2, \ldots}%
    Examples: {\tt CED} is a simple open jumper (the default); {\tt CJD}%
    closed; {\tt CEBED} three-contact open; {\tt CJBED} three-contact
    open and closed.
    The {\sl keys} are: {\tt type=}{\sl chars} as previously;
                        {\tt body=}{\sl attributes} (e.g. {\tt fill\_(0.5)});
                        {\tt wdth=}{\sl expr};
                        {\tt name=}{\sl chars} (the body name)%
\seesect{Twoterminal:}}%
%
\Letter{K}%
\macrodef{KelvinR}{KelvinR}{({\sl cycles},[R],{\sl cycle wid})}%
  {cct}%
  {IEEE resistor in a {\tt [ ]} block with Kelvin taps {\sl T1} and {\sl T2}%
   \seesect{Composite:}}%
%
\Letter{L}%
\macrodef{lamp}{lamp}{(\linespec, [R][T])}%
  {cct}%
  {Two-terminal incandescent lamp. {\tt T} truncates leads to the body width.
   \seesect{Twoterminal:}}%
\macrodef{langle}{langle}{({\sl Start, End})}%
  {gen}%
  {Angle in radians from horizontal of the line from {\sl Start}%
  to {\sl End}.}%
\macrodef{larrow}{larrow}{({\sl label},{\tt ->|<-},{\sl dist})}%
  {cct}%
  {arrow {\sl dist} to left of last-drawn 2-terminal element
   \seesect{Branchcurrent:}}%
\macrodef{lbox}{lbox}{({\sl wid}, {\sl ht}, {\sl attributes})}%
  {gen}%
  {box oriented in current direction, arg 3= e.g.\ {\tt dashed shaded "red"}}%
\macrodef{LCintersect}{LCintersect}{({\sl line name, Centre, rad,} [R],
  [{\sl Line start, End}])}%
  {gen}%
  { First (second if arg4 is R) intersection of a line with a circle.
    Solves $|V.{\tt start} + tV| = {\sl radius}$ for $t$ where $V$ is the line.
    If arg1 is blank then the line start and end are given in arg5 and arg6.}%
\macrodef{LCtangent}{LCtangent}{({\sl Pos1, Centre, rad,} [R])}%
  {gen}%
  { Left (right if arg4=R) tangent point of line
     from Pos1 to circle at Centre with radius arg3}%
\macrodef{left\_}{left_}{}%
  {gen}%
  {left with respect to current direction \seesect{Placing:}}%
\macrodef{LEintersect}{LEintersect}{({\sl line name, Centre, ellipse wid,
  ellipse ht}, [R], [{\sl Line start, End}])}%
  {gen}%
  { First (second if arg5 is R) intersection of a line with an ellipse.
    If arg1 is blank then the line start and end are given in arg6 and arg7.}%
\macrodef{length3}{length3}{({\sl vector})}%
  {dpictools}%
  {$\;\;$ Euclidean length of 3-vector argument.}%
\macrodef{length3D}{length3D}{(x,y,z)}%
  {3D}%
  {Euclidean length of triple x,y,z}%
\macrodef{LEtangent}{LEtangent}{({\sl Pos1, Centre, ellips wid, ellipse ht}%
 [R])}%
  {gen}%
  { Left (right if arg5=R) tangent point of line
     from Pos1 to ellipse at Centre with given width and height}%
\macrodef{lg\_bartxt}{lg_bartxt}{}%
  {log}%
  {draws an overline over logic-pin text (except for xfig)}%
\macrodef{lg\_pin}{lg_pin}{({\sl location, label, Picname},
  n|e|s|w[L|M|I|O][N][E], {\sl pinno, optlen})}%
  {log}%
  {comprehensive logic pin;\\
   {\sl label}: text (indicating logical pin function, usually),\\
   {\sl Picname}: pic label for referring to the pin (line),\\
   {\tt n|e|s|w}: orientation (north, south, east, west),\\
   {\tt L}: active low out,\\
   {\tt M}: active low in,\\
   {\tt I}: inward arrow,\\
   {\tt O}: outward arrow,\\
   {\tt N}: negated,\\
   {\tt E}: edge trigger}%
\macrodef{lg\_pintxt}{lg_pintxt}{}%
  {log}%
  {reduced-size text for logic pins}%
\macrodef{lg\_plen}{lg_plen}{}%
  {log}%
  {logic pin length in in {\tt L\_unit}s}%
\macrodef{LH\_symbol}{LH_symbol}{([U|D|L|R|{\sl degrees}][I])}%
  {log}%
  {logic-gate hysteresis symbol; {\tt I:} inverted}%
\macrodef{lin\_ang}{lin_ang}{({\sl line-reference}[,d])}%
  {gen}%
  {the angle of a line or move from {\tt .start} to {\tt .end} of a linear
   object (in degrees if arg2={\tt d})}%
\macrodef{linethick\_}{linethick_}{({\sl number})}%
  {gen}%
  {set line thickness in points}%
\macrodef{lin\_leng}{lin_leng}{({\sl line-reference})}%
  {gen}%
  {length of a line, equivalent to {\sl line-reference}{\tt .len}%
   with dpic}%
\macrodef{ljust\_}{ljust_}{}%
  {gen}%
  {ljust with respect to current direction}%
\macrodef{llabel}{llabel}{({\sl label},{\sl label},{\sl label},[{\sl arg4}],%
    [{\sl block name}])}%
  {cct}%
  {Triple label on the left of the body of an element with respect to the
    current direction \seesect{Labels:}.  Labels are placed at the
    beginning, centre, and end of the last {\tt []} block (or a named
    {\tt []} block). Each label is treated as math by default, but is
    copied literally if it is in double quotes or defined by sprintf.
    {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,} or {\tt
    right} to supplement the default relative position.  The fifth
    argument is the optional name of the {\tt []} block to be labelled,
    which is {\tt last []} by default}%
\macrodef{loc\_}{loc_}{({\sl x}, {\sl y})}%
  {gen}%
  {location adjusted for current direction}%
\macrodef{log10E\_}{log10E_}{}%
  {gen}%
  {constant $\log_{10}(e)$}%
\macrodef{loge}{loge}{}%
  {gen}%
  {logarithm, base $e$}%
\macrodef{log\_init}{log_init}{}%
  {log}%
  {initialize environment for logic diagrams
    (customizable, reads {\tt liblog.m4})}%
\macrodef{loop}{loop}{({\sl initial assignments, test, loop end, statements})}%
  {dpictools}%
  {$\;\;$ C-like loop.  Commas in arg3 and arg4 must
    be in quotes or parentheses. Example:
    {\tt loop(i=1, i<=3, i+=1, print i)} prints 1, 2, 3.}%
\macrodef{Loopover\_}{Loopover_}{(`{\sl variable}',{\sl actions},{\sl
  value1, value2, $\ldots$})}%
  {gen}%
  {Repeat {\sl actions} with {\sl variable} set successively to
   {\sl value1, value2, $\ldots$}, setting macro {\tt m4Lx} to 1, 2,
   $\ldots$, terminating if {\sl variable} is nul}%
\macrodef{lpop}{lpop}{({\sl xcoord}, {\sl ycoord}, {\sl radius},
{\sl fill},
  {\sl zero ht})} {gen}%
  {for lollipop graphs: filled circle with stem to
  (xcoord,zeroht)}%
\macrodef{lp\_xy}{lp_xy}{}%
  {log}%
  {coordinates used by {\tt lg\_pin}}%
\macrodef{lswitch}{lswitch}{( \linespec, L|R, {\sl chars} )}%
  {cct}%
  {knife switch R=right orientation (default L=left);
    {\sl chars}: [O{\tt|}C][D][K][A] O=opening arrow; C=closing arrow;
    D=dots; K=closed switch; A=blade arrowhead \seesect{Twoterminal:}}%
\macrodef{lthick}{lthick}{}%
  {gen}%
  {current line thickness in drawing units}%
\macrodef{lt\_}{lt_}{}%
  {gen}%
  {left with respect to current direction}%
\macrodef{LT\_symbol}{LT_symbol}{(U|D|L|R|{\sl degrees})}%
  {log}%
  {logic-gate triangle symbol}%
\macrodef{L\_unit}{L_unit}{}%
  {log}%
  {logic-element grid size}%
%
\Letter{M}%
\macrodef{m4\_arrow}{m4_arrow}{(\linespec,{\sl ht},{\sl wid})}%
  {gen}%
  {arrow with adjustable head, filled when possible}%
\macrodef{m4dupstr}{m4dupstr}{({\sl string},{\sl n},`{\sl name}')}%
  {gen}%
  {Defines {\sl name} as {\sl n} concatenated copies of {\sl
  string}.}%
\macrodef{m4lstring}{m4lstring}{({\sl arg1},{\sl arg2})}%
  {gen}%
  {expand {\sl arg1} if it begins
    with {\tt sprintf} or {\tt "}, otherwise {\sl arg2}}%
\macrodef{m4xpand}{m4xpand}{({\sl arg})}%
  {gen}%
  {Evaluate the argument as a macro}%
\macrodef{m4xtract}{m4xtract}{(`{\sl string1}',{\sl string2})}%
  {gen}%
  {delete {\sl string2} from {\sl string1}, return 1 if present}%
\macrodef{manhattan}{manhattan}{}%
  {gen}%
  {sets direction cosines for left, right, up, down}%
\macrodef{Magn}{Magn}{({\sl length, height,} U|D|L|R|{\sl degrees})}%
  {cct}%
  {magnetic action symbol.}%
\macrodef{Max}{Max}{({\sl arg, arg, $\ldots$})}%
  {gen}%
  {Max of an arbitrary number of inputs}%
\macrodef{memristor}{memristor}{({\sl linespec, wid, ht, attributes})}%
  {cct}%
  {memristor element\seesect{Twoterminal:}}%
\macrodef{microphone}{microphone}{( A|U|D|L|R|{\sl degrees, size, attributes})}%
  {cct}%
  {microphone; if arg1 = A: upright mic, otherwise arg1 sets
  direction
   of standard microphone with {\sl In1} to {\sl In3} defined
   \seesect{Composite:}}%
\macrodef{Min}{Min}{({\sl arg, arg, $\ldots$})}%
  {gen}%
  {Min of an arbitrary number of inputs}%
\macrodef{Mitre\_}{Mitre_}{%
 ({\sl Line1,Line2,length,line attributes})}%
  {gen}%
  {e.g., {\tt Mitre\_(L,M)} draws angle at intersection of lines
   L and M with legs of length arg3 (default {\tt linethick bp\_\_/2});
   sets {\tt Here} to intersection
    \seesect{Corners:}}%
\macrodef{mitre\_}{mitre_}{%
 ({\sl Position1,Position2,Position3,length,line attributes})}%
  {gen}%
  {e.g., {\tt mitre\_(A,B,C)} draws angle ABC with legs
   of length arg4 (default {\tt linethick bp\_\_/2}); sets {\tt Here}%
   to Position2
    \seesect{Corners:}}%
\macrodef{mm\_\_}{mm__}{}%
  {gen}%
  {absolute millimetres}%
\macrodef{mosfet}{mosfet}{(\linespec,L|R,{\sl chars},E)}%
  {cct}%
  {MOSFET left or right, included components defined by characters,
  envelope.
   arg 3 chars:\\
   {\tt [u][d]B:} center bulk connection pin\\
   {\tt D:} D pin and lead\\
   {\tt E:} dashed substrate\\
   {\tt F:} solid-line substrate\\
   {\tt [u][d]G:} G pin to substrate at source\\
   {\tt [u][d]H:} G pin to substrate at center\\
   {\tt L:} G pin to channel (obsolete)\\
   {\tt [u][d]M:} G pin to channel, u: at drain end, d: at source end\\
   {\tt [u][d]M{\sl n}:} multiple gates G0 to G{\sl n}\\
   {\tt Py:} parallel diode\\
   {\tt Pz:} parallel zener diode\\
   {\tt Q:} connect B pin to S pin\\
   {\tt R:} thick channel\\
   {\tt [u][d]S:} S pin and lead u: arrow up, d: arrow down\\
   {\tt [d]T:} G pin to center of channel d: not circle\\
   {\tt X:} XMOSFET terminal\\
   {\tt Z:} simplified complementary MOS
   \seesect{Semiconductors:}}%
\macrodef{Mux\_ht}{Mux_ht}{}%
  {cct}%
  {Mux height parameter in {\tt L\_unit}s}%
\macrodef{Mux}{Mux}{({\sl n},{\sl label},
   {\tt [L][B|H|X][N[{\sl n}]|S[{\sl n}]][[N]OE], {\sl wid}, {\sl ht},
     {\sl attributes}})}%
  {log}%
  {binary multiplexer, $n$ inputs,
    {\tt L} reverses input pin numbers, {\tt B} display binary pin
    numbers, {\tt H} display hexadecimal pin numbers, {\tt X} do not
    print pin numbers, {\tt N[{\sl n}]} puts Sel or Sel$0$ .. Sel$n$
    at the top (i.e., to the left of the drawing direction), {\tt
    S[{\sl n}]} puts the Sel inputs at the bottom (default) {\tt OE}%
    ({\tt N}: negated) {\tt OE} pin \seesect{Logicgates:}}%
\macrodef{Mux\_wid}{Mux_wid}{}%
  {cct}%
  {Mux width parameter in {\tt L\_unit}s}%
\macrodef{Mx\_pins}{Mx_pins}{}%
  {log}%
  {max number of gate inputs without wings}%
%
\Letter{N}%
\macrodef{NAND\_gate}{NAND_gate}{({\tt {\sl n}, [N][B],
   [{\sl wid}, [{\sl ht}]], {\sl attributes}})}%
  {log}%
  {`nand' gate, 2 or {\sl n\/} inputs ($0 \leq n \leq 16$);
   {\tt N}: negated inputs; {\tt B}: box shape.
   Alternatively, {\tt NAND\_gate({\sl chars}, [B], {\sl wid},
    {\sl ht}, {\sl attributes})}, where
   arg1 is a sequence of letters {\tt P|N} to define
   normal or negated inputs.
    \seesect{Logicgates:}}%
\macrodef{N\_diam}{N_diam}{}%
  {log}%
  {diameter of `not' circles in {\tt L\_unit}s}%
\macrodef{NeedDpicTools}{NeedDpicTools}{}%
  {gen}%
  {executes {\tt copy "HOMELIB\_/dpictools.pic"} if the file has
  not been read}%
\macrodef{neg\_}{neg_}{}%
  {gen}%
  {unary negation}%
\macrodef{ne\_}{ne_}{}%
  {gen}%
  {.ne with respect to current direction}%
\macrodef{n\_}{n_}{}%
  {gen}%
  {.n with respect to current direction}%
\macrodef{norator}{norator}{(\linespec,{\sl width},{\sl ht},{\sl attributes})}%
  {cct}%
  { norator two-terminal element \seesect{Twoterminal:}}%
\macrodef{NOR\_gate}{NOR_gate}{({\sl n},N)}%
  {log}%
  {`nor' gate, 2 or {\sl n\/} inputs; {\tt N}: negated input.
   Otherwise, arg1 can be a sequence of letters {\tt P|N} to define
   normal or negated inputs.
    \seesect{Logicgates:}}%
\macrodef{NOT\_circle}{NOT_circle}{}%
  {log}%
  {`not' circle}%
\macrodef{NOT\_gate}{NOT_gate}{(\linespec,[B][N|n],{\sl wid},{\sl height},
  {\sl attributes})}%
  {log}%
  {`not' gate.
   When {\sl linespec} is blank then the element is composite and In1,
   Out, C, NE, and SE are defined; otherwise the element is drawn as a
   two-terminal element. arg2: {\tt B}: box gate, {\tt N}: not circle at
   input and output, {\tt n}: not circle at input only
    \seesect{Logicgates:}}%
\macrodef{NOT\_rad}{NOT_rad}{}%
  {log}%
  {`not' radius in absolute units}%
\macrodef{NPDT}{NPDT}{({\sl npoles,}[R])}%
  {cct}%
  {Double-throw switch; {\sl npoles:} number of poles;
   {\tt R}: right orientation with respect to drawing direction
   \seesect{Composite:}}%
\macrodef{nport}{nport}{({\sl box spec{\tt ;}other commands,
nw,nn,ne,ns,space ratio,pin lgth,style, other commands})}%
  {cct}%
  { Default is a standard-box twoport.  Args 2 to 5 are
    the number of ports to be drawn on w, n, e, s sides.  The port pins
    are named by side, number, and by a or b pin, e.g., W1a, W1b, W2a,
    $\ldots$ Arg 6 specifies the ratio of port width to interport space
    (default 2), and arg 7 is the pin length.  Set arg 8 to N to omit
    the dots on the port pins. Arguments 1 and 9 allow customizations
   \seesect{Composite:}}%
\macrodef{N\_rad}{N_rad}{}%
  {log}%
  {radius of `not' circles in {\tt L\_unit}s}%
\macrodef{nterm}{nterm}{({\sl box spec{\tt ;}other commands,
nw,nn,ne,ns,pin lgth,style, other commands})}%
  {cct}%
  {n-terminal box macro (default three pins).
   Args 2 to 5 are the number of pins to be drawn on W, N, E, S
   sides.  The pins are named by side and number, e.g. W1, W2, N1,
   $\ldots$ Arg 6 is the pin length.  Set arg 7 to N to omit the
   dots on the pins. Arguments 1 and 8 allow customizations, e.g.
   {\tt nterm(,{,},{,},{,}N,"\$a\$" at Box.w ljust,"\$b\$" at Box.e rjust,
      "\$c\$" at Box.s above)} }%
\macrodef{nullator}{nullator}{(\linespec,{\sl width},{\sl ht},{\sl attributes})}%
  {cct}%
  { nullator two-terminal element \seesect{Twoterminal:}}%
\macrodef{nw\_}{nw_}{}%
  {gen}%
  {.nw with respect to current direction}%
\macrodef{NXOR\_gate}{NXOR_gate}{({\sl n},N)}%
  {log}%
  {`nxor' gate, 2 or {\sl n\/} inputs; {\tt N}: negated input.
   Otherwise, arg1 can be a sequence of letters {\tt P|N} to define
   normal or negated inputs.
    \seesect{Logicgates:}}%
%
\Letter{O}%
\macrodef{opamp}{opamp}{\tt (\linespec,{\sl label, label, size|keys, chars,
  other commands})}%
  {cct}%
  {operational amplifier with $-,$ $+$ or other internal labels and
    specified size, drawn in a {\tt [ ]} block.
    {\sl chars:} {\tt P} add power connections, {\tt
    R} swap {\sl In1, In2 labels,} {\tt T} truncated point.  The internally
    defined positions are {\sl W, N, E, S, Out, NE, SE, In, In2}, and
    the (obsolete) positions {\sl E1 = NE, E2 = SE}. Instead of a size
    value, arg4 can be a key-value sequence.  The keys are:
    {\tt lgth={\sl expr};}, 
    {\tt wdth={\sl expr};}, 
    {\tt body={\sl attributes};}, e.g., {\tt body=shaded "{\sl color}"}. 
   \seesect{Composite:}}%
\macrodef{open\_arrow}{open_arrow}{(\linespec,{\sl ht},{\sl wid})}%
  {gen}%
  {arrow with adjustable open head}%
\macrodef{OR\_gate}{OR_gate}{({\sl n},[N][B], {\sl wid,} {\sl ht,}%
   {\sl attributes})}%
  {log}%
  {Or gate, $n$ inputs ($0 \leq n \leq 16$); arg2: {\tt N}: negated inputs;
   {\tt B}: box gate.
   Otherwise, arg1 can be a sequence of letters {\tt P|N} to define
   normal or negated inputs.
    \seesect{Logicgates:}}%
\macrodef{OR\_gen}{OR_gen}{($n$,{\sl chars},[{\sl wid},[{\sl ht}]],
   {\sl attributes})}%
  {log}%
  {General OR gate: $n$=number of inputs $(0\leq n\leq 16)$;
    {\sl chars:}%
    {\tt B}: base and straight sides;\\ 
    {\tt A}: arcs;\\
    {\tt [N]NE,[N]SE,[N]I,[N]N,[N]S}: inputs or circles;\\ 
    {\tt [N]P}: XOR arc;\\
    {\tt [N]O}: output; C=center.\\
   Otherwise, arg1 can be a sequence of letters {\tt P|N} to define
   normal or negated inputs.  If arg5 contains {\tt shaded rgbstring(...)}%
   the arguments of {\tt rgbstring} may not contain parentheses.}%
\macrodef{OR\_rad}{OR_rad}{}%
  {log}%
  {radius of OR input face in {\tt L\_unit}s}%
%
\Letter{P}%
\macrodef{parallel\_}{parallel_}{(\char96{\sl elementspec}\char39,%
 \char96{\sl elementspec}\char39 $\ldots$)}%
  {cct}%
  { Parallel combination of two-terminal elements in a {\tt []} block.
    Each argument is a {\em quoted} elementspec of the form\\
    {\tt[Sep={\sl val};][{\sl Label}:]{\sl element};[{\sl attributes}]} where
    an {\sl attribute} is of the form\\
    {\tt[llabel($\ldots$);]|[rlabel($\ldots$);]|[b\_current($\ldots$);]}.\\
    An argument may also be {\tt series\_($\ldots$)} or {\tt
    parallel\_($\ldots$)} {\em without} attributes or quotes.  Sep={\sl
    val}; in the first branch sets the default separation of all branches
    to {\sl val}; in a later element Sep={\sl val}; applies only to
    that branch.  An element may have normal arguments but should not
    change the drawing direction.
   \seesect{Seriesandparallel:}}%
\macrodef{pconnex}{pconnex}{(R|L|U|D|{\sl degrees},{\sl chars, attributes})}%
  {cct}%
  {power connectors, arg 1: drawing direction; {\sl chars:}\\
   {\tt R} (right orientation)\\
   {\tt M|F} (male, female)\\
   {\tt A[B]|AC} (115V 3-prong, B: default box, C: circle)\\
   {\tt P} (PC connector)\\
   {\tt D} (2-pin connector)\\
   {\tt G|GC} (GB 3-pin)\\
   {\tt J} (110V 2-pin)
    \seesect{Composite:}}%
\macrodef{pc\_\_}{pc__}{}%
  {gen}%
  {absolute points}%
\macrodef{perpto}{perpto}{({\sl Pos1, Line, Point})}%
  {gen}%
  {{\sl Point} is the label for the point on {\sl Line} of the
  perpendicular
   from {\sl Point} to {\sl Line}.}%
\macrodef{PerpTo}{PerpTo}{({\sl Pos1, Pos2, Pos3})}%
  {gen}%
  {The point between Pos2 and Pos3 of intersection of the perpendicular
   to Pos1, i.e., the perpendicular projection of Pos1 onto the line
   from Pos2 to Pos3.}%
\macrodef{pi\_}{pi_}{}%
  {gen}%
  {$\pi$}%
\macrodef{plug}{plug}{(U|D|L|R|{\sl degrees},[2|3][R])}%
  {cct}%
  {arg1: drawing direction; string arg2: {\tt R} right orientation,
   {\tt 2|3} number of conductors \seesect{Composite:}}%
\macrodef{pmod}{pmod}{({\sl integer}, {\sl integer})}%
  {gen}%
  {+ve $\hbox{mod}(M,N)$ e.g., $\hbox{\tt pmod}(-3,5)=2$}%
\macrodef{point\_}{point_}{({\sl angle})}%
  {gen}%
  {(radians) set direction cosines}%
\macrodef{Point\_}{Point_}{({\sl integer})}%
  {gen}%
  {sets direction cosines in degrees \seesect{Placing:}}%
\macrodef{polar\_}{polar_}{({\sl x},{\sl y})}%
  {gen}%
  {rectangular-to polar conversion}%
\macrodef{polygon}{polygon}{({\sl n},{\sl keys})}%
  {gen}%
  {Regular polygon in a {\tt []} block. The keys are
    {\tt line={\sl line attributes};} (e.g., {\tt dashed shaded "blue"}),
    {\tt rot={\sl degrees};} (angle of first internal vertex {\tt V[0]}),
    {\tt side|rad={\sl expression};} size by side length or by radius.
   The internal defined points are the centre {\tt C} and vertices
   {\tt V[0]} $\ldots$ {\tt V[{\sl n}-1]}. }%
\macrodef{posarray}{posarray}{({\sl Name, Position1, Position2, \ldots})}%
  {dpictools}%
  {$\;\;$  Populate a singly-subscripted array of positions:
    {\tt {\sl Name}[1]:{\sl Position1;}%
         {\sl Name}[2]={\sl Position2;} \ldots}.}%
\macrodef{posarray2}{posarray2}{({\sl Name, expr, Position1, Position2,
  \ldots})}%
  {dpictools}%
  {$\;\;$  Populate a doubly-subscripted array of positions:
    {\tt {\sl Name}[{\sl expr},1]={\sl Position1;}%
         {\sl Name}[{\sl expr},2]={\sl Position2;} \ldots}.}%
\macrodef{potentiometer}{potentiometer}{(\linespec,%
  {\sl cycles},{\sl fractional pos},{\sl length},$\cdots$)} {cct}%
  {resistor with taps T1, T2, $\ldots$
    with specified fractional positions and lengths (possibly neg)
   \seesect{Composite:}}%
\macrodef{print3D}{print3D}{(x,y,z)}%
  {3D} {write out triple for debugging}%
\macrodef{prod\_}{prod_}{({\sl a},{\sl b})}%
  {gen}%
  {binary multiplication}%
\macrodef{project}{project}{({\sl x},{\sl y},{\sl z})}%
  {3D}%
  {3D to 2D projection onto the plane perpendicular to the view
  vector {\tt View3D} with angles defined by
  {\tt setview({\sl azimuth, elevation, rotation})}.}%
\macrodef{Proxim}{Proxim}{({\sl size,} U|D|L|R|{\sl degrees, attributes})}%
  {cct}%
  {proximity detector with fillable body.}%
\macrodef{proximity}{proximity}{(\sl linespec)}%
  {cct}%
  {proximity detector (= {\tt consource(,P)})}%
\macrodef{psset\_}{psset_}{({\sl PSTricks settings})}%
  {gen}%
  {set PSTricks parameters}%
\macrodef{PtoL}{PtoL}{({\sl position}, U|D|L|R|{\sl degrees}, {\sl length}) }%
  {gen}%
  {Evaluates to {\tt from {\sl position} to
   {\sl position} + Rect\_({\sl length, angle}) }%
   from the polar-coordinate data in the arguments }%
\macrodef{pt\_\_}{pt__}{}%
  {gen}%
  {\TeX\ point-size factor, in scaled inches, ({\tt *scale/72.27})}%
\macrodef{ptrans}{ptrans}{(\linespec, [R|L])}%
  {cct}%
  {pass transistor; {\tt L=} left orientation
    \seesect{Semiconductors:}}%
\macrodef{pushkey\_}{pushkey_}{({\sl string, key, default value,}[N])}%
  {gen}%
  {Key-value definition.
  If {\sl string} contains the substring
  {\sl key}{\tt =}{\sl expr} then macro {\tt m4{\sl key}}%
  is defined using {\tt pushdef()} to
  expand to {\tt ({\sl expr})}, or to {\tt ({\sl default value})} if the
  substring is missing.  Arg 1 can contain several such substrings separated
  by semicolons.
  If arg4 is nonblank, the parentheses are omitted.
   \seesect{Macroarguments:}}%
\macrodef{pushkeys\_}{pushkeys_}{({\sl string, key sequence})}%
  {gen}%
  {Multiple key-value definitions. Arg 2 is a semicolon-separated
   sequence of terms of the form {\tt {\sl key}:{\sl default value}:[N]}%
   which must contain no semicolons and the default values contain no colons.
   Macro {\tt pushkey\_} is applied to each of the terms in order.
   \seesect{Macroarguments:}}%
\macrodef{pvcell}{pvcell}{({\sl linespec, width, height, attributes})}%
  {cct}%
  {PV cell}%
\macrodef{px\_\_}{px__}{}%
  {gen}%
  {absolute SVG screen pixels}%
%
\Letter{R}%
\macrodef{randn}{randn}{({\sl array name, $n,$ mean, stddev})}%
  {dpictools}%
  {$\;\;$ Assign $n$ Gaussian random numbers in array
   $\hbox{\sl name}[1], \hbox{\sl name}[2], \ldots \hbox{\sl name}[n]$
   with given mean and standard deviation.}%
\macrodef{rarrow}{rarrow}{({\sl label,{\tt ->|<-},{\sl dist}})}%
  {cct}%
  {arrow {\sl dist} to right of last-drawn 2-terminal element
   \seesect{Branchcurrent:}}%
\macrodef{Rect\_}{Rect_}{({\sl radius},{\sl angle})}%
  {gen}%
  {(deg) polar-to-rectangular conversion}%
\macrodef{rect\_}{rect_}{({\sl radius},{\sl angle})}%
  {gen}%
  {(radians) polar-rectangular conversion}%
\macrodef{reed}{reed}{({\sl linespec, width, height, box attribues},
[R][C])}%
  {cct}%
  {Enclosed reed two-terminal contact;
   {\tt R}: right orientation; {\tt C}: closed contact; e.g., {\tt
   reed(,{,}dimen\_/5,shaded "lightgreen"} \seesect{Composite:}}%
\macrodef{relaycoil}{relaycoil}{({\sl chars, wid, ht,} R|L|U|D|{\sl
degrees, attributes})}%
  {cct}%
  {chars:
    {\tt X}: or default: external lines from A2 and B2;\\
    {\tt AX}: external lines at positions A1,A3;\\
    {\tt BX}: external lines at positions B1,B3;\\
    {\tt NX}: no lines at positions A1,A2,A3,B1,B2,B3;\\
    {\tt SO}: slow operating;\\
    {\tt SOR}: slow operating and release;\\
    {\tt SR}: slow release;\\
    {\tt HS}: high speed;\\
    {\tt NAC}: unaffected by AC current;\\
    {\tt AC}: AC current;\\
    {\tt ML}: mechanically latched;\\
    {\tt PO}: polarized;\\
    {\tt RM}: remanent;\\
    {\tt RH}: remanent;\\
    {\tt TH}: thermal;\\
    {\tt EL}: electronic
   \seesect{Composite:}}%
\macrodef{relay}{relay}{({\sl number of poles, chars, attributes})}%
  {cct}%
  {relay: n poles (default 1),\\
    {\sl chars:} {\tt O}: normally open,\\
    {\tt C}: normally closed,\\
    {\tt P}: three position, default double throw,\\
    {\tt L}: drawn left (default),\\
    {\tt R}: drawn right,\\
    {\tt Th}: thermal.\seesect{Composite:}}%
\macrodef{resetdir\_}{resetdir_)}{}%
  {gen}%
  {resets direction set by {\tt setdir\_}}%
\macrodef{resetrgb}{resetrgb}{}%
  {gen}%
  {cancel {\tt r\_, g\_, b\_} color definitions}%
\macrodef{resistor}{resistor}{(\linespec, n|E, {\sl chars}, {\sl cycle wid})}%
  {cct}%
  {resistor, n cycles (default 3), {\sl chars:}\\
    {\tt AC}: general complex element,\\
    {\tt E}: {\tt ebox},\\
    {\tt ES}: {\tt ebox} with slash,\\
    {\tt Q}: offset,\\
    {\tt H}: squared,\\
    {\tt N}: IEEE,\\
    {\tt B}: not burnable,\\
    {\tt V}: varistor variant,\\
    {\tt R}: right-oriented,\\
    {\sl cycle width} (default {\tt dimen\_}$/6$)
   \seesect{Twoterminal:}}%
\macrodef{resized}{resized}{({\sl factor},`{\sl macro name}',args)}%
  {cct}%
  {scale the element body size by {\sl factor}}%
\macrodef{restorem4dir}{restorem4dir}{([`{\sl stack name}'])}%
  {gen}%
  {Restore m4 direction parameters from the named stack;
    default {\tt `savm4dir\_'}}%
\macrodef{reversed}{reversed}{(`{\sl macro name}',args)}%
  {cct}%
  {reverse polarity of 2-terminal element}%
\macrodef{rgbdraw}{rgbdraw}{({\sl color triple}, {\sl drawing commands})}%
  {gen}%
  {color drawing for PSTricks, pgf, MetaPost, SVG postprocessors;
   (color entries are 0 to 1),
   see {\tt setrgb} \seesect{Semiconductors:}.  Exceptionally, the color
   of SVG arrows other than the default black has to be defined using the
   {\tt outlined }{\sl string} and {\tt shaded }{\sl string} constructs.}%
\macrodef{rgbfill}{rgbfill}{({\sl color triple}, {\sl closed path})}%
  {gen}%
  {fill with arbitrary color (color entries are 0 to 1); see {\tt
   setrgb}\seesect{Semiconductors:}}%
\macrodef{rgbstring}{rgbstring}{({\sl color triple or color name})}%
  {gen}%
  {evaluates to a string compatible with the postprocessor in use
   to go with {\tt colored}, {\tt shaded}, or {\tt outlined} attributes.
   (PSTricks, metapost, pgf-tikz, pdf, postscript, svg).  The arguments
   are fractions in the range $[0,1]$; For example, {\tt box outlined
   rgbstring(0.1,0.2,0.7) shaded rgbstring(0.75,0.5,0.25)}.  For those
   postprocessors that allow it, there can be one argument which is the
   name of a defined color}%
\macrodef{rgbtocmyk}{rgbtocmyk}{({\sl r, g, b, c, m, y, k})}%
  {dpictools}%
  {$\;\;$ rgb to cmyk values in the range 0 to 100.}%
\macrodef{rgbtohsv}{rgbtohsv}{({\sl r, g, b, h, s, v})}%
  {dpictools}%
  {$\;\;$ rgb color triple to hsv with {\sl h} range 0 to 360.}%
\macrodef{RightAngle}{RightAngle}{({\sl Pos1, Pos2, Pos3, line len,
  attributes})} {gen}%
  {Draw a right-angle symbol at {\sl Pos2}, of size
  given by arg4. Arg5 =
   line attributes, e.g., {\tt outlined "gray"}}%
\macrodef{right\_}{right_}{}%
  {gen}%
  {set current direction right \seesect{Placing:}}%
\macrodef{rjust\_}{rjust_}{}%
  {gen}%
  {right justify with respect to current direction}%
\macrodef{rlabel}{rlabel}{({\sl label},{\sl label},{\sl label},[{\sl arg4}],%
    [{\sl block name}])}%
  {cct}%
  {Triple label on the right of the body of an element with respect to the
    current direction \seesect{Labels:}.  Labels are placed at the
    beginning, centre, and end of the last {\tt []} block (or a named
    {\tt []} block). Each label is treated as math by default, but is
    copied literally if it is in double quotes or defined by sprintf.
    {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,} or {\tt
    right} to supplement the default relative position.  The fifth
    argument is the optional name of the {\tt []} block to be labelled,
    which is {\tt last []} by default}%
\macrodef{rot3Dx}{rot3Dx}{({\sl radians,x,y,z})}%
  {3D} {rotates x,y,z about x axis}%
\macrodef{rot3Dy}{rot3Dy}{({\sl radians,x,y,z})}%
  {3D} {rotates x,y,z about y axis}%
\macrodef{rot3Dz}{rot3Dz}{({\sl radians,x,y,z})}%
  {3D} {rotates x,y,z about z axis}%
\macrodef{rotbox}{rotbox}{({\sl wid,ht,type},[r|t={\sl val}])}%
  {gen}%
  {box oriented in current direction in {\tt [ ]} block;
   {\sl type=} e.g. {\tt dotted shaded "green".}  Defined internal
   locations: N, E, S, W (and NE, SE, NW, SW if arg4 is blank).  If arg4
   is {\tt r=}{\sl val} then corners have radius {\sl val}.  If arg4 is
   {\tt t=}{\sl val} then a spline with tension {\sl val} is used to draw
   a ``superellipse,'' and the bounding box is then only approximate. }%
\macrodef{rotellipse}{rotellipse}{({\sl wid,ht,attributes})}%
  {gen}%
  {ellipse oriented in current direction in {\tt [ ]} block;
   e.g. {\tt Point\_(45); rotellipse(,{},dotted fill\_(0.9)).} Defined
   internal locations: N, S, E, W.}%
\macrodef{Rot\_}{Rot_}{({\sl position, degrees})}%
  {gen}%
  {rotate position by degrees}%
\macrodef{rot\_}{rot_}{({\sl x, y, angle})}%
  {gen}%
  {rotate {\sl x,y} by theta radians}%
\macrodef{round}{round}{(at {\sl location,line thickness,attributes})}%
  {gen}%
  {filled circle for rounded corners; attributes={\tt colored
  "gray"}%
   for example; leaves {\tt Here} unchanged if arg1 is blank
    \seesect{Corners:}}%
\macrodef{rpoint\_}{rpoint_}{(\linespec)}%
  {gen}%
  {set direction cosines}%
\macrodef{rpos\_}{rpos_}{({\sl position})}%
  {gen}%
  {Here + {\sl position}}%
\macrodef{r\_}{r_}{}%
  {gen}%
  {red color value}%
\macrodef{rrot\_}{rrot_}{({\sl x, y, angle})}%
  {gen}%
  {\tt Here + vrot\_({\sl x, y, cos(angle), sin(angle))}}%
\macrodef{rs\_box}{rs_box}{([angle={\sl degrees};]
     {\sl text},{\sl expr1},$\cdots$)}%
  {gen}%
  {like {\tt s\_box} but the text is rotated by {\tt text\_ang}%
   (default 90) degrees, unless
   the first argument begins with {\tt angle={\sl decimal number};},
   in which case the number defines the rotation angle.
   Two or more args are passed to {\tt sprintf()}.
   If the first argument begins with {\tt angle={\sl expr};} then
   the specified angle is used.
   The examples {\tt define(`text\_ang',45); rs\_box(Hello World)} and
   {\tt rs\_box(angle=45; Hello World)} are equivalent
   \seesect{Interaction:}, \seesect{Pstricks:}}%
\macrodef{rsvec\_}{rsvec_}{({\sl position})}%
  {gen}%
  {Here + {\sl position}}%
\macrodef{r\_text}{r_text}{({\sl degrees},{\sl text},at {\sl position})}%
  {gen}%
  {Rotate text by arg1 degrees (provides a single command for
   PSTricks, PGF, or SVG only) placed at position in arg3.
   The first argument is a decimal constant (not an expression) and
   the text is a simple string without quotes.
   \seesect{Interaction:}, \seesect{Pstricks:}}%
\macrodef{rtod\_\_}{rtod__}{}%
  {gen}%
  {constant, degrees/radian}%
\macrodef{rtod\_}{rtod_}{}%
  {gen}%
  {constant, degrees/radian}%
\macrodef{rt\_}{rt_}{}%
  {gen}%
  {right with respect to current direction}%
\macrodef{rvec\_}{rvec_}{({\sl x},{\sl y})}%
  {gen}%
  {location relative to current direction}%
%
\Letter{S}%
\macrodef{sarrow}{sarrow}{(\linespec,{\sl keys})}%
  {gen}%
  {Single-segment, single-headed special arrows with {\sl keys}:\\
       {\tt type=}{\tt O[pen]} (default)
          | {\tt D[iamond]} | {\tt C[rowfoot]} | {\tt P[lain]}%
          | {\tt R[ight]} | {\tt L[eft]} {\tt ;}\\
       {\tt wdth=}{\sl expression}{\tt ;} (default {\tt arrowwid})\\
       {\tt lgth=}{\sl expression}{\tt ;} (default {\tt arrowht})\\
       {\tt shaft=}{\sl shaft attributes} (e.g., {\tt dashed}){\tt ;}\\
       {\tt head=}{\sl head attributes} (e.g., {\tt shaded}){\tt ;}\\
       {\tt name=}{\sl Name}{\tt ;} (default {\sl Sarrow\_})
  \seesect{Macroarguments:}}%
\macrodef{savem4dir}{savem4dir}{([`{\sl stack name}'])}%
  {gen}%
  {Stack m4 direction parameters in the named stack
    (default {\tt `savm4dir\_'})}%
\macrodef{s\_box}{s_box}{({\sl text},{\sl expr1},$\cdots$)}%
  {gen}%
  {generate dimensioned text string using {\tt\char92{}boxdims} from
    {\tt boxdims.sty}. Two or more args are passed to {\tt sprintf()}%
   (default 90) degrees \seesect{Interaction:}}%
\macrodef{sbs}{sbs}{({\sl linespec, chars, label})}%
  {cct}%
  {Wrapper to place an SBS thyristor as a two-terminal element with
   {\tt [ ]} block label given by the third argument
    \seesect{Semiconductors:}}%
\macrodef{sc\_draw}{sc_draw}{({\sl dna string, chars, iftrue, iffalse})}%
  {cct}%
  {test if chars are in string, deleting chars from string}%
\macrodef{scr}{scr}{({\sl linespec, chars, label})}%
  {cct}%
  {Wrapper to place an SCR thyristor as a two-terminal element with
   {\tt [ ]} block label given by the third argument
    \seesect{Semiconductors:}}%
\macrodef{scs}{scs}{({\sl linespec, chars, label})}%
  {cct}%
  {Wrapper to place an SCS thyristor as a two-terminal element with
   {\tt [ ]} block label given by the third argument
    \seesect{Semiconductors:}}%
\macrodef{s\_dp}{s_dp}{({\sl name},{\sl default})}%
  {gen}%
  {depth of the most recent (or named) {\tt s\_box}%
    \seesect{Interaction:}}%
\macrodef{series\_}{series_}{({\sl elementspec}, {\sl elementspec},
$\ldots$)}%
  {cct}%
  { Series combination in a {\tt []} block of elements
    with shortened default length.  An {\sl elementspec} is of the
    form {\tt [{\sl Label}:] {\sl element}; [{\sl attributes}]},
    where an {\sl attribute} is of the form {\tt [llabel($\ldots$);] |
    [rlabel($\ldots$);] [b\_current($\ldots$);]}.  Internal points {\tt
    Start}, {\tt End}, and {\tt C} are defined
   \seesect{Seriesandparallel:} }%
\macrodef{se\_}{se_}{}%
  {gen}%
  {.se with respect to current direction}%
\macrodef{setdir\_}{setdir_}{(R|L|U|D|{\sl degrees}, {\sl default}%
    U|D|R|L|{\sl degrees})}%
  {gen}%
  {store drawing direction and set it to
    up, down, left, right, or angle in degrees (reset by {\tt
    resetdir\_}).  The directions may be spelled out, i.e., Right,
    Left, $\ldots$
   \seesect{Seriesandparallel:}}%
\macrodef{setkey\_}{setkey_}{({\sl string, key, default,}[N])}%
  {gen}%
  {Key-value definition, like {\tt pushkey\_()} but the resulting
  macro is defined using {\tt define()} rather than {\tt pushdef().}%
   \seesect{Macroarguments:}}%
\macrodef{setkeys\_}{setkeys_}{({\sl string, key sequence})}%
  {gen}%
  {Multiple key-value definition using {\tt define()} rather than
   {\tt pushdef().} See macro {\tt pushkeys\_}.
   \seesect{Macroarguments:}}%
\macrodef{setrgb}{setrgb}{({\sl red value, green value, blue value},[{\sl
   name}])}%
  {gen}%
  {define colour for lines and text, optionally named (default
   {\tt lcspec}); \seesect{Semiconductors:}}%
\macrodef{setview}{setview}{({\sl azimuth degrees},{\sl elevation
   degrees}, {\sl rotation degrees})}%
  {3D} {Set projection viewpoint for the {\tt project} macro.
   The view vector is obtained by looking in along the $x$ axis,
   then rotating about $-x,$ $-y,$ and $z$ in that order.  The components
   {\tt view3D1, view3D2,} and {\tt view3D3} are defined, as well as
   positions {\tt UPx\_, UPy\_,} and {\tt UPz\_} which are the projections
   of unit vectors {\tt (1,0,0), (0,1,0),} and {\tt (0,0,1)} respectively
   onto the plane.}%
\macrodef{sfgabove}{sfgabove}{}%
  {cct}%
  {like above but with extra space}%
\macrodef{sfgarc}{sfgarc}{(\linespec,{\sl text},{\sl text
justification},cw|ccw,
    {\sl height scale factor},{\sl arc attributes})}%
  {cct}%
  {Directed arc drawn between nodes, with text label
    and a height-adjustment parameter. Example:
    {\tt sfgarc(from B to A,-B/M,below,{,}1.1,outlined "red")} }%
\macrodef{sfgbelow}{sfgbelow}{}%
  {cct}%
  {like below but with extra space}%
\macrodef{sfg\_init}{sfg_init}{({\sl default line len, node rad,
arrowhd len,
  arrowhd wid}), (reads {\tt libcct.m4})} {cct}%
  {initialization of signal
  flow graph macros}%
\macrodef{sfgline}{sfgline}{(\linespec,{\sl text},{\tt
  sfgabove|sfgbelow|ljust|rjust},{\sl line attributes})}%
  {cct}%
  {Directed straight line chopped by node radius, with text label,
   e.g., {\tt sfgline(,K/M,{,}dashed colored "orange")} }%
\macrodef{sfgnode}{sfgnode}{(at {\sl location},{\sl text},above|below,{\sl
   circle attributes})}%
  {cct}%
  {small circle default white interior, with text label. The default
  label position is inside if the diameter is bigger than {\tt textht}%
  and {\tt textwid}; otherwise it is {\tt sfgabove.} Options such as
  color, fill, or line thickness can be given, e.g.,
  {\tt thick 0.8 outlined "red" shaded "orange"}. }%
\macrodef{sfgself}{sfgself}{(at {\sl location}, U|D|L|R|{\sl degrees},
   {\sl text label}, {\sl text justification}, cw|ccw, {\sl scale factor},
    [-> | <- | <->], {\sl attributes})}%
  {cct}%
  {Self-loop drawn at an angle from a node,
     with text label, specified arrowheads, and a size-adjustment parameter.
     The attributes can set thickness and color, for example. }%
\macrodef{shade}{shade}{({\sl gray value},{\sl closed line specs})}%
  {gen}%
  {Fill arbitrary closed curve. Note: when producing pdf via pdflatex, line
   thickness changes within this macro must be made via the {\tt linethick}%
   environment variable rather than by the {\tt thickness} line attribute}%
\macrodef{shadebox}{shadebox}{(box {\sl attributes, shade width})}%
  {gen}%
  {Box with edge shading.  Arg2 is in points. See also {\tt shaded} }%
\macrodef{ShadedPolygon}{ShadedPolygon}{({\sl vertexseq, line attributes,
  degrees, colorseq})} {gen}%
  {Draws the polygon specified in arg1 and
  shades the interior according
   to arg4 by drawing lines perpendicular to the angle in arg3.  The {\sl
   vertexseq} is a colon ({\tt:}) separated sequence of vertex positions
   (or names) of the polygon in cw or ccw order. A {\sl colorseq} is of
   the form 0, r0,g0,b0, {\sl frac1},r1,g1,b1, {\sl frac2},r2,g2,b2,
   \ldots 1,rn,gn,bn with $0 < \hbox{\sl frac1} < \hbox{\sl frac2} \ldots 1$ }%
\macrodef{ShadeObject}{ShadeObject}{({\sl drawroutine name, n, colorseq})}%
  {dpictools}%
  {$\;\;$  Fill an area in a {\tt []} block with graded color
  defined by {\sl colorseq,} an indexed sequence of rgb colors:
    {\sl 0,r0,g0,b0,}%
    {\sl frac1,r1,g1,b1,}%
    {\sl frac2,r2,g2,b2,}%
    \ldots
    {\sl 1,rn,gn,bn}%
  with $0 < \hbox{\sl frac1}$ $< \hbox{\sl frac2} <$ $\ldots < 1.$  The macro
  {\sl drawroutine{\tt(}frac, r, g, b{\tt)}} typically draws a colored line
  and must be defined according to the area to be filled.
  The routine is called $n{+}1$ times for
  $\hbox{\sl frac}= 0, 1/n, 2/n, \ldots 1$ with rgb arguments interpolated
  in hsv space between {\sl colorseq} points.
  Example (shade a box with 101 graded-color lines):\\ 
  {\tt B: box\\
   define HorizShade \lbr\ line right B.wid \textbackslash\\
   $\;$ thick B.ht/100/(1bp\_\_) from (0,-(\$1)*B.ht) \textbackslash\\
   $\;$ outlined rgbstring(\$2,\$3,\$4) \rbr;}%
   {\tt ShadeObject(HorizShade,100, 0,1,0,0, 1,0,0,1) \textbackslash\\
   $\;$ at B}.}%
\macrodef{shadowed}{shadowed}{(box|circle|ellipse|line,
  {\sl position spec, keys})}%
  {gen}%
  { Object with specified shadow.  {\sl possspec} is e.g.,
    {\tt with .w at ...} or {\tt at} {\sl position}.
    The {\sl keys} are
       {\tt attrib=}{\sl object attributes}{\tt ;}%
       {\tt shadowthick=}{\sl expr}{\tt ;} (default {\tt linethick*)}5/4),
       {\tt shadowcolor=}{\sl string}{\tt ;} (default {\tt "gray"}),
       {\tt shadowangle=}{\sl expr}{\tt ;} (default $-45$)
       for box only: {\tt rad=}{\sl expr}{\tt ;}%
 }%
\macrodef{shielded}{shielded}{(`{\sl two-terminal element}',
  L|U, {\sl line attributes})} {cct}%
  {shielding in a {\tt [ ]} box for
  two-terminal element. Arg2= blank
    (default) to enclose the element body; L for the left side with
    respect to drawing direction, R for right. Internal points {\tt
    .Start, .End,} and {\tt .C} are defined}%
\macrodef{s\_ht}{s_ht}{({\sl name},{\sl default})}%
  {gen}%
  {height of the most recent (or named) {\tt s\_box}%
    \seesect{Interaction:}}%
\macrodef{SIdefaults}{SIdefaults}{}%
  {gen}%
  {Sets {\tt scale = 25.4} for drawing units in mm, and sets
   pic parameters {\tt lineht = 12, linewid = 12, moveht = 12,
    movewid = 12,
    arcrad = 6, circlerad = 6, boxht = 12, boxwid = 18, ellipseht = 12,
    ellipsewid = 18, dashwid = 2, arrowht = 3, arrowwid = arrowht/2,}}%
\macrodef{sign\_}{sign_}{({\sl number})}%
  {gen}%
  {sign function}%
\macrodef{sinc}{sinc}{({\sl number})}%
  {gen}%
  {the $\hbox{sinc}(x)$ function}%
\macrodef{sind}{sind}{({\sl arg})}%
  {gen}%
  {sine of an expression in degrees}%
\macrodef{s\_init}{s_init}{({\sl name})}%
  {gen}%
  {initialize {\tt s\_box} string label to {\sl name} which should
  be unique
    \seesect{Interaction:}}%
\macrodef{Sin}{Sin}{({\sl integer})}%
  {gen}%
  {sine function, {\sl integer\/} degrees}%
\macrodef{sinusoid}{sinusoid}{({\sl amplitude, frequency, phase, tmin,
  tmax, linetype})}%
  {gen}%
  {draws a sinusoid over the interval $(t_{\hbox{\scriptsize min}},
  t_{\hbox{\scriptsize max}})$;
   e.g., to draw a dashed sine curve, amplitude {\sl a},
   of {\sl n} cycles of length {\sl x} from {\sl A}, {\tt
   sinusoid(a,twopi\_*n/x,-pi\_/2,0,x,dashed) with .Start at A}}%
\macrodef{sl\_box}{sl_box}{({\sl stem linespec, keys, stem object})}%
  {SLD}%
  {One-terminal SLD element: argument 1 is a \linespec\ to define the stem
   or, in the case of a zero-length stem, one of {\tt U, D, L, R,} or an
   angle in degrees, optionally followed by {\tt at {\sl position}}.
   The position is {\sl Here} by default.

   Argument 2 contains semicolon (;)-separated key-value attributes
   of the head:
   {\tt name={\sl{}Name}} (default {\sl Head});
   {\tt lgth={\sl{}expr}};
   {\tt wdth={\sl{}expr}};
   {\tt text="{\sl{}text}"},
   {\tt box={\sl{}box pic attributes}}.

   If argument 3 is null then a plain stem is drawn; if it is of the
   form {\tt S:}{\sl keys} or {\tt S$n$:}{\sl keys} an $n$-line slash
   symbol is overlaid on the stem; otherwise the keys are for an overlaid
   breaker, so that a {\tt C} specifies a default closed breaker, {\tt
   O} an open breaker, {\tt X,} {\tt /,} or \bsl\ for these marks, or
   \MR{sl_ttbox}{\tt sl\_ttbox} key-value pairs defining box attributes
   for the breaker (default name {\sl Br})

   \seesect{SingleLine:}}%
\macrodef{sl\_breaker}{sl_breaker}{({\sl linespec,} {\tt type=[A|C][D];}%
  {\sl ttbox args})}%
  {SLD}%
  {Two-terminal SLD element:
   type {\tt A} (the default) is for a box breaker; type 
   {\tt C} for a curved breaker; adding a {\tt D} puts drawout elements
   in the input and output leads.
   Otherwise, the arguments are as for 
   \MR{sl_ttbox}{\tt sl\_ttbox}%
   \seesect{SingleLine:}}%
\macrodef{sl\_busbar}{sl_busbar}{({\sl linespec, np, keys})}%
  {SLD}%
  {Composite SLD element drawn in a {\tt [ ]} block.  A busbar is
   essentially a thick straight line 
   drawn along the {\sl linespec} with positions evenly distributed
   along it.  For example,
     {\tt line right\_; sl\_busbar(, up\_ 4.5, 5) with .P3 at Here}.

   Argument 1 is a \linespec\ to define the direction and length of the
     busbar (but not its position, since it is drawn in a {\tt [ ]} block).

   Argument 2 is the number $np$ of evenly spaced positions
     $P1, P2, \ldots Pnp$ along the line with $P1$ and $Pnp$ indented
     from the ends of the line.

   Argument 3 contains semicolon (;)-separated key-value attributes
     of the line:
   {\tt port=D} (for a dot at each port position);
   {\tt line=}{\sl pic line attributes}.
   {\tt indent=}{\sl indent distance}.
   \seesect{SingleLine:}}%
\macrodef{sl\_ct}{sl_ct}{%
    ({\tt at}{\sl position},{\sl keys},{\tt R|L|U|D|}{\sl degrees})}%
  {SLD}%
  {Composite SLD element drawn in a {\tt [ ]} block:

   The keys are as follows:
   {\tt type=L|N|S[n]} (default {\tt L;} {\tt S$n$} draws an $n$-line slash
     symbol, default 2); {\tt N} means no stem);
   {\tt scale={\sl expr} (default 1.0)};
   {\tt grnd={\sl expr} attached ground at given angle
     (type {\tt S} or {\tt N}))};
   {\tt sep={\sl{}expr}};
   {\tt stemlgth={\sl{}expr}};
   {\tt wdth={\sl{}expr}};
   {\tt direct=U|D|L|R|{\sl degrees}} (drawing direction).

   Key {\tt stemlgth} is the length of the leads at the start, centre, and end,
     with labeled ends {\sl Tstart, Tc,} and {\sl Tend}.
     The {\tt L} (default) variant also defines internal labels
     Internal labels {\sl L} and {\sl C} are included.

   Key {\tt sep} is the type-{\tt S} separation from the head to the centre
     of the slash symbol.

   Key {\tt scale} allows scaling (default scale 1.0) but, with \dpic,
     the {\tt scaled} directive can also be used.
   \seesect{SingleLine:}}%
\macrodef{sl\_disk}{sl_disk}{({\sl stem linespec, keys, breaker})}%
  {SLD}%
  {One-terminal SLD element: argument 1 is a \linespec\ to define the stem
   or, in the case of a zero-length stem, one of {\tt U, D, L, R,} or an
   angle in degrees, optionally followed by {\tt at {\sl position}}.
   The position is {\sl Here} by default.

   Argument 2 contains semicolon (;)-separated key-value attributes
   of the head:
   {\tt name={\sl{}Name}} (default {\sl Head});
   {\tt text="{\sl{}text}"};
   {\tt diam={\sl{}expr}};
   {\tt circle={\sl{}circle pic attributes}}.

   Argument 3 is null for no breaker in the stem, {\tt C} for a default
   closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
   these marks, or
   \MR{sl_ttbox}{\tt sl\_ttbox}%
   key-value pairs defining box attributes for the breaker
   (default name {\sl Br})
   \label{sl_disk}%
   \seesect{SingleLine:}}%
\macrodef{sl\_drawout}{sl_drawout}{({\sl linespec, keys,} R)}%
  {SLD}%
  {Two-terminal SLD element: argument 1 is a \linespec\ as for ordinary
   two-terminal elements.

   Argument 2 contains semicolon (;)-separated key-value body attributes:
   {\tt type=T} (for truncated leads);
   {\tt lgth={\sl{}expr},}%
   {\tt wdth={\sl{}expr}} (body size);
   {\tt name={\sl{}Name}} (default {\sl Body});
   {\tt line={\sl{}pic line attributes}}; (e.g., {\tt thick 2})

   Argument 3 is {\tt R} to reverse the direction of the drawn chevrons.
   \seesect{SingleLine:}}%
\macrodef{sl\_generator}{sl_generator}{({\sl stem linespec, keys, breaker})}%
  {SLD}%
  {One-terminal SLD element: argument 2 is
   {\tt type=AC|WT|BS|StatG|PV|Y|Delta} and,
   if {\tt type=PV,} the {\tt SL\_box} keys;
   otherwise, the {\tt sl\_disk} body keys.

   Argument 3 is null for no breaker in the stem, {\tt C} for a default
   closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
   these marks, or
   \MR{sl_ttbox}{\tt sl\_ttbox}%
   key-value pairs defining box attributes for the breaker
   (default name {\sl Br})
   \seesect{SingleLine:}}%
\macrodef{sl\_grid}{sl_grid}{({\sl stem linespec, keys, breaker})}%
  {SLD}%
  {One-terminal SLD element: argument 1 is a \linespec\ to define the stem
   or, in the case of a zero-length stem, one of {\tt U, D, L, R,} or an
   angle in degrees, optionally followed by {\tt at {\sl position}}.
   The position is {\sl Here} by default.

   Argument 2 contains semicolon (;)-separated key-value attributes
   of the head:
   {\tt name={\sl{}Name}} (default {\sl Head});
   {\tt lgth={\sl{}expr}};
   {\tt wdth={\sl{}expr}}.

   Argument 3 is null for no breaker in the stem, {\tt C} for a default
   closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
   these marks, or
   \MR{sl_ttbox}{\tt sl\_ttbox}%
   key-value pairs defining box attributes for the breaker
   (default name {\sl Br})
   \seesect{SingleLine:}}%
\macrodef{sl\_inverter}{sl_inverter}{({\sl ttbox args})}%
  {SLD}%
  {Two-terminal SLD element: the arguments are as for 
   \MR{sl_ttbox}{\tt sl\_ttbox}%
   \seesect{SingleLine:}}%
\macrodef{sl\_lamp}{sl_lamp}{({\sl stem linespec, keys, breaker})}%
  {SLD}%
  {One-terminal SLD element: the arguments are as for 
   \MR{sl_disk}{\tt sl\_disk}%
   \seesect{SingleLine:}}%
\macrodef{sl\_load}{sl_load}{({\sl stem linespec, keys, breaker})}%
  {SLD}%
  {One-terminal SLD element: argument 1 is a \linespec\ to define the stem
   or, in the case of a zero-length stem, one of {\tt U, D, L, R,} or an
   angle in degrees, optionally followed by {\tt at {\sl position}}.
   The position is {\sl Here} by default.

   Argument 2 contains semicolon (;)-separated key-value attributes
   of the head:
   {\tt name={\sl{}Name}} (default {\sl Head});
   {\tt lgth={\sl{}expr}};
   {\tt wdth={\sl{}expr}};
   {\tt head={\sl{}arrowhead pic attributes}}.

   Argument 3 is null for no breaker in the stem, {\tt C} for a default
   closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
   these marks, or
   \MR{sl_ttbox}{\tt sl\_ttbox}%
   key-value pairs defining box attributes for the breaker
   (default name {\sl Br})
   \seesect{SingleLine:}}%
\macrodef{sl\_meterbox}{sl_meterbox}{({\sl stem linespec, keys, breaker})}%
  {SLD}%
  {One-terminal SLD element: argument 1 is a \linespec\ to define the stem
   or, in the case of a zero-length stem, one of {\tt U, D, L, R,} or an
   angle in degrees, optionally followed by {\tt at {\sl position}}.
   The position is {\sl Here} by default.

   Argument 2 contains semicolon (;)-separated key-value attributes
   of the head:
   {\tt name={\sl{}Name}} (default {\sl Head});
   {\tt lgth={\sl{}expr}};
   {\tt wdth={\sl{}expr}};
   {\tt text="{\sl{}text}"},
   {\tt box={\sl{}box pic attributes}}.

   Argument 3 is null for no breaker in the stem, {\tt C} for a default
   closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
   these marks, or
   \MR{sl_ttbox}{\tt sl\_ttbox}%
   key-value pairs defining box attributes for the breaker
   (default name {\sl Br})
   \seesect{SingleLine:}}%
\macrodef{sl\_reactor}{sl_reactor}{({\sl stem linespec, keys, breaker keys,
    breaker keys})}%
  {SLD}%
  {Two-terminal SLD element: argument 1 is a \linespec\ as for ordinary
   two-terminal elements.

   Argument 2 contains semicolon (;)-separated key-value body attributes:
   {\tt name={\sl{}Name}} (default {\sl Body});
   {\tt diam={\sl{}expr}}.

   Argument 3 is null for no breaker in the input lead, {\tt C} for a default
   closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
   these marks, or
   key-value pairs as above defining breaker attributes
   except that the default breaker name is {\sl BrI}.

   Argument 4 defines the breaker in the output lead as for argument 3
   except that the default breaker name is {\sl BrO}.
   \seesect{SingleLine:}}%
\macrodef{sl\_rectifier}{sl_rectifier}{({\sl ttbox args})}%
  {SLD}%
  {Two-terminal SLD element: the arguments are as for 
   \MR{sl_ttbox}{\tt sl\_ttbox}%
   \seesect{SingleLine:}}%
\macrodef{sl\_slash}{sl_slash}{(at {\sl position, keys,}%
   [$n$:]R|L|U|D|{\sl degrees})}%
  {SLD}%
  {Slash symbol for SLD elements: draws $n$ slashes in a {\tt [] } block.
   The keys are
   {\tt lines={\sl line attributes,} e.g., dotted thick {\sl expr}};
   {\tt size=}{\sl expr} (default {\tt ht dimen\_/3}).
   \seesect{SingleLine:}}%
%
\macrodef{sl\_transformer3}{sl_transformer3}{({\sl linespec, keys,
    breaker keys, symbol keys})}%
  {SLD}%
  {Composite (block) SLD element: argument 1 is a \linespec\ that can be used
   to set the direction and distance between primary terminals but not
   position.

   Argument 2 contains semicolon (;)-separated key-value body attributes:
   {\tt name={\sl{}Name}} (default {\sl Body});
   {\tt type=S|C} (default {\tt S});
   {\tt scale={\sl expr}} (body size factor, default 1.0);
   {\tt direct=L|R} (default {\tt L}) direction of the tertiary
     circle and terminal relative to the drawing direction;
   {\tt body={\sl circle attributes}}.

   Argument 3 is colon (:)-separated sequence of up to three breaker
   attribute specifications for the input, output, and teriary breaker
   in order.  A null or blank means no breaker, {\tt tt\_breaker}%
   specifications otherwise. Default breaker names are {\sl BrI}%
   and {\sl BrO} as for
   {\tt sl\_transformer,} and {\sl Br} for the third breaker. 

   Argument 4 is colon (:)-separated sequence of up to three symbol
   specifications for the input, output, and teriary circle
   in order.  A null or blank means no symbol;
   {\tt Y} for a Y-symbol;
   {\tt Delta} for a $\Delta$ symbol;
   otherwise, other customization commands expanded in a {\tt \lbr\rbr} pair.
   \seesect{SingleLine:}}%
%
\macrodef{sl\_transformer}{sl_transformer}{({\sl linespec, keys,
    input breaker keys, output breaker keys,
    input circle inner object, output circle inner object})}%
  {SLD}%
  {Two-terminal SLD element: argument 1 is a \linespec\ as for ordinary
   two-terminal elements.

   Argument 2 contains semicolon (;)-separated key-value body attributes:
   {\tt name={\sl{}Name}} (default {\sl Body});
   {\tt scale={\sl expr}} (body size factor, default 1.0);
   {\tt type=I|S|A[R]} (default {\tt I}).

   Additional type {\tt I} keys are
   {\tt cycles={\sl{}integer}} (default 4);
   {\tt core=A|M[$n$]|P[$n$]|K[$n$]}, $n$={\sl integer} (default 2 lines).

   Additional type {\tt S} keys are
   {\tt body={\sl circle pic attributes}} e.g., {\tt shaded "{\sl color}"}.

   Type {\tt A} keys are
   {\tt body={\sl circle pic attributes}}.  Type {\tt AR} means right
   orientation.

   Argument 3 is null for no breaker in the input lead, {\tt C} for a default
   closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
   these marks, or
   key-value pairs as above defining breaker attributes
   except that the default breaker name is {\sl BrI}.

   Argument 4 defines the breaker in the output lead as for argument 3
   except that the default breaker name is {\sl BrO}.

   Argumentss 5 and 6 for the input and output circles respectively are:
   {\tt Y} for a Y-symbol;
   {\tt YN} for a Y-symbol with ground;
   {\tt Delta} for a $\Delta$ symbol;
   otherwise, other customization commands expanded in a {\tt \lbr\rbr} pair.
   \seesect{SingleLine:}}%
%
\macrodef{sl\_ttbox}{sl_ttbox}{({\sl linespec, keys, input breaker keys,
    output breaker keys})}%
  {SLD}%
  {Two-terminal SLD element: argument 1 is a \linespec\ as for ordinary
   two-terminal elements.

   Argument 2 contains semicolon (;)-separated key-value body attributes:
   {\tt name={\sl{}Name}} (default {\sl Body});
   {\tt lgth={\sl{}expr}};
   {\tt wdth={\sl{}expr}};
   {\tt text="{\sl{}text}"};
   {\tt box={\sl{}box pic attributes}};
   {\tt supp={\sl{}additional {\tt rotbox} commands}}.

   Argument 3 is null for no breaker in the input lead, {\tt C} for a default
   closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
   these marks, or
   key-value pairs as above defining breaker attributes
   except that the default breaker name is {\sl BrI}.

   Argument 4 defines the breaker in the output lead as for argument 3
   except that the default breaker name is {\sl BrO}.
   \label{sl_ttbox}%
   \seesect{SingleLine:}}%
\macrodef{s\_name}{s_name}{}%
  {gen}%
  {the value of the last {\tt s\_init} argument
    \seesect{Interaction:}}%
\macrodef{sourcerad\_}{sourcerad_}{}%
  {cct}%
  {default source radius}%
\macrodef{slantbox}{slantbox}{%
  ({\sl wid, height, x offset, y offset,  attributes})}%
  {dpictools}%
  {$\;\;$ Trapezoid formed from a box with top corners displaced right by
    $x$ offset and right corners displaced up by $y$ offset.}%
\macrodef{source}{source}{(\linespec,
   V|v|tv|I|i|ti|ii|AC|B|F|G|H|J|Q|L|N|P|S[C[r]]|E[r]]|T|X|U|{\sl other}, {\sl
   diameter},R)}%
  {cct}%
  {source, arg2 blank or:\\
               {\tt V}: voltage source;\\
               {\tt v}: alternate voltage source;\\
               {\tt tv}: truncated-bar alternate voltage source;\\
               {\tt I}: current source;\\
               {\tt i}: alternate current source;\\
               {\tt ti}: truncated-bar alternate current source;\\
               {\tt ii}: double arrow current source; AC: AC source;\\
               {\tt B}: bulb;\\
               {\tt F}: fluorescent;\\
               {\tt G}: generator;\\
               {\tt H}: step function;\\
               {\tt L}: lamp;\\
               {\tt N}: neon;\\
               {\tt P}: pulse;\\
               {\tt Q}: charge;\\
               {\tt R}: ramp;
               {\tt r}: right orientation;
               {\tt S}: sinusoid;\\
               {\tt SC}: quarter arc;\\
               {\tt SE}: arc;\\
               {\tt T}: triangle;\\
               {\tt U}: square-wave;\\
               {\tt X}: interior X;\\
               other: custom interior label or waveform;\\
        arg 4: R: reversed polarity;\\
        arg 5 modifies the circle with e.g., color or fill
   \seesect{Twoterminal:}}%
\macrodef{speaker}{speaker}{( U|D|L|R|{\sl degrees},{\sl size},H,attributes)}%
  {cct}%
  {speaker, {\sl In1} to {\sl In7} defined; {\tt H}: horn
   \seesect{Composite:}}%
\macrodef{sprod3}{sprod3}{({\sl scalar, vec1, vec2})}%
  {dpictools}%
  {$\;\;$ Multiplied vector by scalar arg1: {\sl vec2 = vec1 * arg1}.}%
\macrodef{sprod3D}{sprod3D}{(a,x,y,z)}%
  {3D} {scalar product of triple x,y,z by arg1}%
\macrodef{sp\_}{sp_}{}%
  {gen}%
  {evaluates to medium space for gpic strings}%
\macrodef{sqrta}{sqrta}{({\sl arg})}%
  {gen}%
  {square root of the absolute value of {\sl arg}; i.e.,
   {\tt sqrt(abs({\sl arg}))}}%
\macrodef{SQUID}{SQUID}{({\sl n, diameter, initial angle}, {\tt ccw|cw})}%
  {cct}%
  {Superconducting quantum interface device
   with {\sl }n junctions labeled {\tt J1, ... J}{\sl n} placed around
   a circle with initial angle -90 deg (by default) with respect to the
   current drawing direction. The default diameter is {\tt dimen\_} }%
\macrodef{s\_}{s_}{}%
  {gen}%
  {.s with respect to current direction}%
\macrodef{stackargs\_}{stackargs}{(`{\sl stackname}',{\sl args})}%
  {gen}%
  {Stack arg 2, arg 3, ... onto the named stack up to a blank arg}%
\macrodef{stackcopy\_}{stackcopy_}{(`{\sl name 1}',`{\sl name 2}')}%
  {gen}%
  {Copy stack 1 into stack 2, preserving the order of pushed
  elements}%
\macrodef{stackdo\_}{stackdo}{(`{\sl stackname}',{\sl commands})}%
  {gen}%
  {Empty the stack to the first blank entry, performing arg 2}%
\macrodef{stackexec\_}{stackexec_}{(`{\sl name 1}',`{\sl name 2}',%
 {\sl commands})}%
  {gen}%
  {Copy stack 1 into stack 2, performing arg3 for each nonblank
  entry}%
\macrodef{stackprint\_}{stackprint_}{(`{\sl stack name}')}%
  {gen}%
  {Print the contents of the stack to the terminal}%
%\macrodef{stackpromote\_}{stackpromote_}{({\sl prefix},% 
% `{\sl stack name}',{\sl In name})}%
%  {gen}%
%  {Define locations {\tt In1} or {\sl In name }{\tt 1}, $\ldots$ corresponding %   to the locations in stack {\sl stack name}, as created by the
%   {\tt AutoGate} and {\tt Autologic} macros.  Each location is prefixed
%   by argument 1 ``.''}%
\macrodef{stackreverse\_}{stackreverse_}{(`{\sl stack name}')}%
  {gen}%
  {Reverse the order of elements in a stack, preserving the name}%
\macrodef{stacksplit\_}{stacksplit_}{(`{\sl stack name}',{\sl string},{\sl
   separator})}%
  {gen}%
  {Stack the fields of {\sl string} left to right separated
  by nonblank
    {\sl separator} (default .).  White space preceding the fields
    is ignored.}%
\macrodef{sum3}{sum3}{({\sl vec1, vec2, vec3})}%
  {dpictools}%
  {$\;\;$ The 3-vector sum
    $\hbox{\sl vec3} = \hbox{\sl vec1} + \hbox{\sl vec2}$.}%
\macrodef{sum3D}{sum3D}{({\sl x1,y1,z1,x2,y2,z2})}%
  {3D} {sum of two triples}%
\macrodef{sum\_}{sum_}{({\sl a},{\sl b})}%
  {gen}%
  {binary sum}%
\macrodef{sus}{sus}{({\sl linespec, chars, label})}%
  {cct}%
  {Wrapper to place an SUS thyristor as a two-terminal element with
   {\tt [ ]} block label given by the third argument
    \seesect{Semiconductors:}}%
\macrodef{svec\_}{svec_}{({\sl x},{\sl y})}%
  {log}%
  {scaled and rotated grid coordinate vector}%
\macrodef{s\_wd}{s_wd}{({\sl name},{\sl default})}%
  {gen}%
  {width of the most recent (or named) {\tt s\_box}%
    \seesect{Interaction:}}%
\macrodef{switch}{switch}{(\linespec,L|R,[C|O][D],[B|D])}%
  {cct}%
  {SPST switch (wrapper for bswitch, lswitch, and dswitch),
    arg2: {\tt R}: right orientation (default {\tt L} for left);\\
     if arg4=blank (knife switch): arg3 = {\tt [O|C][D][A]},
       {\tt O}: opening, {\tt C}: closing, {\tt D}:dots,
       {\tt A}: blade arrowhead;\\
     if arg4=B (button switch): arg3 = 
       {\tt O|C}: {\tt O}: normally open, {\tt C}: normally closed;\\
     if arg4={\tt D}: arg3 = same as for dswitch \seesect{Twoterminal:}}%
\macrodef{sw\_}{sw_}{}%
  {gen}%
  {.sw with respect to current direction}%
%
\Letter{T}%
\macrodef{tapped}{tapped}{(`{\sl two-terminal element}',
  [{\sl arrowhd} | type={\sl arrowhd};name={\sl Name}],
    {\sl fraction, length, fraction, length,} $\cdots$)}%
  {cct}%
  {Draw the two-terminal element with taps in a [ ] block (see
  {\tt addtaps}).
   {\sl arrowhd} = blank or one of {\tt . - <- -> <->}.  Each fraction
   determines the position along the element body of the tap.  A negative
   length draws the tap to the right of the current direction; positive
   length to the left.  Tap names are Tap1, Tap2, $\cdots$ by default
   or Name1, Name2, $\cdots$ if specified.  Internal block names are
   {\tt .Start, .End,} and {.C} corresponding to the drawn element,
   and the tap names \seesect{Composite:} }%
\macrodef{ta\_xy}{ta_xy}{({\sl x, y})}%
  {cct}%
  {macro-internal coordinates adjusted for {\tt L|R}}%
\macrodef{tbox}{tbox}{({\sl text,wid,ht},<|>|<>,{\sl attributes})}%
  {cct}%
  {Pointed terminal box. The {\sl text} is placed at the rectangular
  center
   in math mode unless the text begins with {\tt "} or {\tt sprintf} in
   which case the arument is used literally.  Arg 4 determines whether
   the point is forward, backward, or both with respect to the current
   drawing direction.
    \seesect{Composite:}}%
\macrodef{tconn}{tconn}{({\sl linespec, chars}|{\sl keys}, {\sl wid})}%
  {cct}%
  {Terminal connector drawn on a linespec, with head enclosed in a {\tt []}%
   block.  The permissible {\sl chars} are:
   {\tt > | >{}> | < | <{}< | A | AA | M | O | OF}.
   Type {\tt O} draws a node (circle); {\tt OF} a filled circle.
   Type {\tt M} is a black bar; {\tt A} is an open arc end; type {\tt AA}%
   a double open arc.  Type {\tt >} (the default) is an arrow-like output
   connector; {\tt <} and {\tt <<} input connectors.  Arg 3 is arrowhead
   width or circle diameter when key-value pairs are not used.
   If keys are specified, they are {\tt type=}{\sl chars} as previously;
   {\tt wdth=}{\sl expr}; {\tt lgth=}{\sl expr}; {\tt sep=}{\sl expr};
   {\tt head=}{\sl attributes except} {\tt lgth, wdth.}%
   The key {\tt sep=} is the double-head separation
    \seesect{Composite:}}%
\macrodef{testexpr}{testexpr}{({\sl variable, expr1, expr2, \ldots})}%
  {dpictools}%
  {$\;\;$ Set the variable given by arg1 to the index of the first true
  alternative in a sequence of logical expressions, e.g.,
  {\tt testexpr(i, 1>2, 1<2 )} sets {\sl i} to 2. The variable is set to 0
   if no test is true.}%
\macrodef{tgate}{tgate}{({\sl linespec,} [B][R|L])}%
  {cct}%
  {transmission gate, {\tt B=} ebox type; {\tt L=} oriented left
    \seesect{Semiconductors:}}%
\macrodef{thermocouple}{thermocouple}{({\sl linespec, wid, ht,} L|R [T])}%
  {cct}%
  { Thermocouple drawn to the left (by default) of the
    {\sl linespec} line.  A {\tt T} argument truncates the leads so
    only the two branches appear.  {\tt R=}%
    right orientation.  \seesect{Twoterminal:}}%
\macrodef{thicklines\_}{thicklines_}{({\sl number})}%
  {gen}%
  {set line thickness in points}%
\macrodef{thinlines\_}{thinlines_}{({\sl number})}%
  {gen}%
  {set line thickness in points}%
\macrodef{threeD\_init}{threeD_init}{}%
  {3D} {initialize 3D transformations (reads {\tt lib3D.m4})}%
\macrodef{thyristor}{thyristor}{(\linespec,%
 {\tt [SCR|SCS|SUS|SBS|IEC][{\sl chars}]})}%
  {cct}%
  {Composite thyristor element in {\tt []}block, types:\\
                     {\tt SCR}: silicon controlled rectifier (default),\\
                     {\tt SCS}: silicon controlled switch,\\
                     {\tt SUS}: silicon unilateral switch,\\
                     {\tt SBS}: silicon bilateral switch,\\
                     {\tt IEC}: type IEC.\\
   {\sl Chars} to modify or define the element:\\
                     {\tt K}: open arrowheads,\\
                     {\tt A}: arrowhead,\\
                     {\tt F}: half arrowhead,\\
                     {\tt B}: bidirectional diode,\\
                     {\tt E}: adds envelope,\\
                     {\tt H}: perpendicular gate (endpoint {\sl G}),\\
                     {\tt N}: anode gate (endpoint {\sl Ga}),\\
                     {\tt U}: centre line in diodes,\\
                     {\tt V}: perpendicular gate across arrowhead centre,\\
                     {\tt R}: right orientation,\\
                     {\tt E}: envelope
    \seesect{Semiconductors:}}%
\macrodef{thyristor\_t}{thyristor_t}{({\sl linespec, chars, label})}%
  {cct}%
  {Wrapper to place a thyristor as a two-terminal element with
   {\tt [ ]} block label given by the third argument
    \seesect{Semiconductors:}}%
\macrodef{tikznode}{tikznode}{({\sl \Tikz node name, position}) }%
  {pgf}%
  {insert \Tikz code to define a zero-size \Tikz node at {\sl location}%
    (default {\tt Here}) to assist with inclusion of \pic code output
    in \Tikz diagrams.  This macro must be invoked in the outermost
    \pic scope.  \seesect{Tikzwithpic:}}%
\macrodef{tline}{tline}{(\linespec,{\sl wid},{\sl ht}) }%
  {cct}%
  {transmission line, manhattan direction\seesect{Twoterminal:}}%
\macrodef{ToPos}{ToPos}{({\sl position}, U|D|L|R|{\sl degrees}, {\sl length}) }%
  {gen}%
  {Evaluates to {\tt from {\sl position} - Rect\_({\sl length, angle}) to
   {\sl position}} from the polar-coordinate data in the arguments }%
\macrodef{transformer}{transformer}{(\linespec,L|R,{\sl np},%
[A|P][W|L][D1|D2|D12|D21],{\sl ns})}%
  {cct}%
  {2-winding transformer or choke with terminals {\sl P1, P2, TP, S1, S2, TS}:\\
    arg2: {\tt L}: left, {\tt R}: right,\\
    arg3: np primary arcs,\\
    arg5: ns secondary arcs,\\
    arg4:
    {\tt A}: air core,\\
    {\tt P}: powder (dashed) core,\\
    {\tt W}: wide windings,\\
    {\tt L}: looped windings,\\
    {\tt D1}: phase dots at {\sl P1} and {\sl S1} end;\\
    {\tt D2}: at {\sl P2} and {\sl S2} end;\\
    {\tt D12}: at {\sl P1} and {\sl S2} end;\\
    {\tt D21} at {\sl P2} and {\sl S1} end
   \seesect{Composite:}}%
\macrodef{tr\_xy\_init}{tr_xy_init}{({\sl origin, unit size, sign })}%
  {cct}%
  {initialize {\tt tr\_xy}}%
\macrodef{tr\_xy}{tr_xy}{({\sl x, y})}%
  {cct}%
  {relative macro internal coordinates adjusted for {\tt L|R}}%
\macrodef{tstrip}{tstrip}{(R|L|U|D|{\sl degrees, nterms, chars})}%
  {cct}%
  {terminal strip, chars:
   I (invisible terminals), C (default circle terminals), D (dot terminals),
   O (omitted separator lines), {\tt wid=}value{\tt ;} total strip width,
   {\tt ht=}value{\tt ;} strip height, {\tt box={\sl shaded etc.};}%
    \seesect{Composite:}}%
\macrodef{ttmotor}{ttmotor}{({\sl linespec, string, diameter, brushwid,
brushht})}%
  {cct}%
  {motor with label\seesect{Twoterminal:}}%
\macrodef{twopi\_}{twopi_}{}%
  {gen}%
  {$2\pi$}%
%
\Letter{U}%
\macrodef{ujt}{ujt}{(\linespec,R,P,E)}%
  {cct}%
  {unijunction transistor, right, P-channel, envelope
    \seesect{Semiconductors:}}%
\macrodef{unit3D}{unit3D}{(x,y,z)}%
  {3D} {unit triple in the direction of triple x,y,z}%
\macrodef{up\_\_}{up__}{}%
  {gen}%
  {up with respect to current direction}%
\macrodef{up\_}{up_}{}%
  {gen}%
  {set current direction up \seesect{Placing:}}%
%
\Letter{V}%
\macrodef{variable}{variable}{(`{\sl element}', {\sl chars}, [+|-]{\sl angle},
   {\sl length}, at position)}%
% {\tt [A|P|L|[u]N|[u]NN][C|S]},
  {cct}%
  {Overlaid arrow or line to indicate variable 2-terminal element:
    The {\sl chars} are\\
    {\tt A}: arrow,\\
    {\tt P}: preset,\\
    {\tt L}: linear,\\
    {\tt N}:  symmetric nonlinear,\\
    {\tt C}: continuous,\\
    {\tt S}: setpwise;\\
    {\tt u} changes the nonlinearity direction.  The angle is absolute
    but preceding it with a sign makes the angle (often -30 or -45)
    relative to the element drawing direction.\\
    If arg5 is blank the symbol is placed over the last {\tt []} block
   \seesect{Twoterminal:}}%
\macrodef{Vcoords\_}{Vcoords_}{({\sl position})}%
  {gen}%
  {The $x, y$ coordinate pair of the position}%
\macrodef{Vdiff\_}{Vdiff_}{({\sl position},{\sl position})}%
  {gen}%
  {{\tt Vdiff\_(A,B)} evaluates to {\tt A-(B)} with dpic, {\tt
  A-(B.x,B.y)}%
   with gpic}%
\macrodef{vec\_}{vec_}{({\sl x},{\sl y})}%
  {gen}%
  {position rotated with respect to current direction}%
\macrodef{vec3}{vec3}{({\sl vector})}%
  {dpictools}%
  {$\;\;$ Expands to the threee components of the vector argument separated
    by commas.}%
\macrodef{View3D}{View3D}{}%
  {3D} {The view vector (triple) defined by {\tt setview({\sl azimuth,
   elevation, rotation})}. The {\tt project} macro projects onto the plane
   through {\tt (0,0)} and orthogonal to this vector.}%
\macrodef{vlength}{vlength}{({\sl x},{\sl y})}%
  {gen}%
  {vector length $\sqrt{x^2+y^2}$}%
\macrodef{vperp}{vperp}{({\sl linear object})}%
  {gen}%
  {unit-vector pair CCW-perpendicular to linear object}%
\macrodef{Vperp}{Vperp}{({\sl position name}, {\sl position name})}%
  {gen}%
  {unit-vector pair CCW-perpendicular to line joining two named
  positions}%
\macrodef{vrot\_}{vrot_}{({\sl x},{\sl y},{\sl xcosine},{\sl ycosine})}%
  {gen}%
  {rotation operator}%
\macrodef{vscal\_}{vscal_}{({\sl number},{\sl x},{\sl y})}%
  {gen}%
  {vector scale operator}%
\macrodef{Vsprod\_}{Vsprod_}{({\sl position}, {\sl expression})}%
  {gen}%
  {The vector in arg 1 multiplied by the scalar in arg 2}%
\macrodef{Vsum\_}{Vsum_}{({\sl position},{\sl position})}%
  {gen}%
  {{\tt Vsum\_(A,B)} evaluates to {\tt A+B} with dpic, {\tt
  A+(B.x,B.y)}%
   with gpic}%
%
\Letter{W}%
\macrodef{while\_}{while_}{(`{\sl test}',`{\sl actions}')}%
  {gen}%
  {Integer m4 while loop}%
\macrodef{wid\_}{wid_}{}%
  {gen}%
  {width with respect to current direction}%
\macrodef{winding}{winding}{(L|R, {\sl diam, pitch, turns, core wid,
   core color})}%
  {cct}%
  {core winding drawn in the current direction; {\tt R}: right-handed
   \seesect{Composite:}}%
\macrodef{w\_}{w_}{}%
  {gen}%
  {.w with respect to current direction}%
\macrodef{XOR\_gate}{XOR_gate}{({\sl n},N)}%
  {log}%
  {`xor' gate, 2 or {\sl n\/} inputs; {\tt N}: negated input.
   Otherwise, arg1 can be a sequence of letters {\tt P|N} to define
   normal or negated inputs.
    \seesect{Logicgates:}}%
\macrodef{XOR\_off}{XOR_off}{}%
  {log}%
  {XOR and NXOR offset of input face}%
%
\Letter{X}%
\macrodef{xtal}{xtal}{(\linespec,{\sl keys})}%
  {cct}%
  {Quartz crystal. The {\sl keys} are
     {\tt type=N} (default) or {\tt type=R} (round);\\
            type {\tt N} keys:\\
              {\tt lgth=}{\sl expr} (body length);\\
              {\tt wdth=}{\sl expr} (body width);\\
              {\tt bxwd=}{\sl expr} (body inner box width);\\
              {\tt box=} box attributes ({\tt shaded} $\ldots$);\\
            type {\tt R} keys:\\
              {\tt outerdiam=}{\sl expr};\\
              {\tt innerdiam=}{\sl expr};\\
              {\tt outer=} outer circle attributes ({\tt dotted} $\ldots$);\\
              {\tt inner=} inner circle attributes ({\tt shaded} $\ldots$)%
\seesect{Twoterminal:}}%
\macrodef{xtract}{xtract}{({\sl string, substr1, substr2, $\ldots$})}%
  {gen}%
  {returns substrings if present}%
\Letter{Y}%
\macrodef{Ysymbol}{Ysymbol}{(at {\sl position},keys,
    U|D|L|R|{\sl degrees}) (default {\tt U} for up)}%
  {cct}%
  {Y symbol for power-system diagrams
   {\sl keys:} {\tt size={\sl expression}; type=G}}%
%  \end{tabbing}%