summaryrefslogtreecommitdiff
path: root/support/splint/tex/limbo.sty
blob: 91ec2c973fc3cb8e5a332fdcd76eb2d80d345f21 (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
% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% SPLinT is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with SPLinT.  If not, see <http://www.gnu.org/licenses/>.

% limbo.sty version 3.0

\input epsf.tex
\input amssym.def

\catcode`\@=11 % a name space protection measure (weak)

% fonts
\font\tenboldi=cmbxti10
\font\nineboldi=cmbxti9
\font\eightboldi=cmbxti8
\font\sevenboldi=cmbxti7
\font\sixboldi=cmbxti6
\font\fiveboldi=cmbxti5

\font\twelvebi=cmmib10 at 12pt
\font\tenbi=cmmib10
\font\tencyr=lhr10
\font\ninebi=cmmib9
\font\sevenbi=cmmib7
\font\sixbi=cmmib6
\font\twelvebsy=cmbsy10 at 12pt
\font\ninebsy=cmbsy9
\font\sevenbsy=cmbsy7

\font\twelvei=cmmi10 at 12pt
\font\ninei=cmmi9
\font\twelvesy=cmsy10 at 12pt
\font\ninesy=cmsy9

\font\twelvetitle=cmssbx12
\font\tentitle=cmssbx10
\font\tentitlei=cmssbxo10
\font\ninetitle=cmssbx9
\font\eighttitle=cmssbx8
\font\seventitle=cmssbx7
\font\titlefrak=eufb10 at 12pt

%\font\eightss=cmssq8
%\font\eightssi=cmssqi8

\font\tenss=cmss10
\font\niness=cmss9
\font\eightss=cmss8
\font\sevenss=cmss7
\font\sixss=cmss6
\font\fivess=cmss5

\font\tenssn=cmssdc10
\font\ninessn=cmssdc9
\font\eightssn=cmssdc8
\font\sevenssn=cmssdc7
\font\sixssn=cmssdc6
\font\fivessn=cmssdc5

\font\tenssb=cmssbx10
\font\ninessb=cmssbx9
\font\eightssb=cmssbx8
\font\sevenssb=cmssbx7
\font\sixssb=cmssbx6
\font\fivessb=cmssbx5

\font\twelvetitleit=cmssbxo10 at 12pt
\font\ninetitleit=cmssbxo10 at 9pt
\font\seventitleit=cmssbxo10 at 7pt

\font\authorfont=cmssqi8
\font\affiliationfont=cmssq8
\font\timefont=cmss7
\font\keywordsfn=cmssbx8

\font\tentex=cmtex10
\font\ninetex=cmtex9
\font\eighttex=cmtex8

\font\inchhigh=cminch
\font\titlefont=cmssdc10 at 40pt

\font\ninerm=cmr9
\font\eightrm=cmr8
\font\sevenrm=cmr7
\font\sixrm=cmr6

\font\ninecyr=lhr9
\font\eightcyr=lhr8
\font\sevencyr=lhr7

\font\ninei=cmmi9
\font\eighti=cmmi8
\font\sixi=cmmi6
\skewchar\ninei='177 \skewchar\eighti='177 \skewchar\sixi='177

\font\ninesy=cmsy9
\font\eightsy=cmsy8
\font\sixsy=cmsy6
\skewchar\ninesy='60 \skewchar\eightsy='60 \skewchar\sixsy='60

\font\twelvebf=cmbx12
\font\ninebf=cmbx9
\font\eightbf=cmbx8
\font\sixbf=cmbx6

\font\ninett=cmtt9
\font\eighttt=cmtt8
\font\seventt=cmtt7
\font\sixtt=cmtt6

\font\tentti=cmitt10 % typewriter italic
\font\ninetti=cmitt9
\font\eighttti=cmitt8
\font\seventti=cmitt7
\font\sixtti=cmitt6

\hyphenchar\tentt=-1 % inhibit hyphenation in typewriter type
\hyphenchar\ninett=-1
\hyphenchar\eighttt=-1

\font\ninesl=cmsl9
\font\eightsl=cmsl8
\font\sevensl=cmsl7
\font\sixsl=cmsl6

\font\nineit=cmti9
\font\eightit=cmti8
\font\sevenit=cmti7
\font\sixit=cmti6
\font\fiveit=cmti5

\font\twelvemsam=msam10 at 12pt
\font\tenmsam=msam10
\font\ninemsam=msam9
\font\eightmsam=msam8
\font\sevenmsam=msam7
\font\sixmsam=msam6
\font\fivemsam=msam5

\font\twelvemsbm=msbm10 at 12pt
\font\tenmsbm=msbm10
\font\ninemsbm=msbm9
\font\eightmsbm=msbm8
\font\sevenmsbm=msbm7
\font\sixmsbm=msbm6
\font\fivemsbm=msbm5

\font\tenfrak=eufm10
\font\ninefrak=eufm9
\font\eightfrak=eufm8
\font\sevenfrak=eufm7
\font\sixfrak=eufm6

\font\nineidss=idssbx9
\font\eightidss=idssbx8
\font\sevenidss=idssbx7
\font\sixidss=idssbx6

\font\hv=phvr

\font\dings=pzdr
\font\dingssmall=pzdr at 8pt
\chardef\pen='062
\chardef\leaf='247
\chardef\fancystar='122

\newfam\ssfam
\newfam\ssbnfam
\newfam\itbfam
\newfam\msbmfam
\newfam\msamfam

% take `<=' and `>=' from Euler ...
% but this will be changed back in the title due to 
% the absence of the bold version

\mathchardef\leq="3\hexnumber@\msamfam36 \let\le=\leq
\mathchardef\geq="3\hexnumber@\msamfam3E \let\ge=\geq
\mathchardef\emptyset="0\hexnumber@\msbfam3F

% left and right `french quotes' (guillemots); the characters reside in lhr fonts

\chardef\lqq='375
\chardef\rqq='376

\def\cdotfill{\cleaders\hbox {$\m@th \mkern .5mu\cdot\mkern .5mu$}\hfill}
\def\dinkus{$\ast\ast\ast$}
\def\asterism{\setbox0\hbox{$\ast$}\copy0 \kern-.3\wd0 \raise\ht0 \copy0 \kern-.3\wd0 \copy0 }

\newskip\ttglue
\def\tenpoint{\def\rm{\fam0\tenrm}%
  \textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
  \textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei
  \textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
  \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  \def\it{\fam\itfam\tenit}%
  \textfont\itfam=\tenit\scriptfont\itfam=\sevenit
   \scriptscriptfont\itfam=\fiveit
  \def\itbold{\fam\itbfam\tenboldi}%
  \textfont\itbfam=\tenboldi\scriptfont\itfam=\sevenboldi
   \scriptscriptfont\itbfam=\fiveboldi
  \def\sl{\fam\slfam\tensl}%
  \textfont\slfam=\tensl
  \def\bf{\fam\bffam\tenbf}%
  \textfont\bffam=\tenbf \scriptfont\bffam=\sevenbf
   \scriptscriptfont\bffam=\fivebf
  \def\tt{\fam\ttfam\tentt 
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \def\tti{\fam\ttfam\tentti % switch to typewriter italic 
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \def\ttex{\tentex 
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \def\ttl{\let\it\tentitlei\let\sl\tentitlei\tentitle}%
  \def\ssf{\fam\ssfam\tenss}%
  \textfont\ssfam=\tenss\scriptfont\ssfam=\sevenss
  \def\ssfb{\fam\ssfam\tenssb}%
  \def\ssfbn{\fam\ssbnfam\tenssb}%
  \textfont\ssbnfam=\tenssn\scriptfont\ssfam=\sevenssn
  \textfont\ttfam=\tentt\scriptfont\ttfam=\seventt
  \fam\ttfam\tentt \ttglue=.5em plus.25em minus.15em
  \def\Bbb{\fam\msbmfam\tenmsbm}%
  \textfont\msbmfam=\tenmsbm\scriptfont\msbmfam=\sevenmsbm \scriptscriptfont\msbmfam=\fivemsbm
  \textfont\msamfam=\tenmsam\scriptfont\msamfam=\sevenmsam 
  \scriptscriptfont\msamfam=\fivemsam
  \def\frak##1{{\tenfrak ##1}}%
  \normalbaselineskip=12pt
  \let\sc=\eightrm
  \let\sci=\eightit
  \let\mc=\ninerm
  \let\cyr=\tencyr
  \let\big=\tenbig
  \let\idss=\eightidss
  \setbox\strutbox=\hbox{\vrule height8.5pt depth3.5pt width0pt}%
  \let\sscmd\sevenpoint
  \normalbaselines\rm}

\def\ninepoint{\def\rm{\fam0\ninerm}%
  \textfont0=\ninerm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm
  \textfont1=\ninei \scriptfont1=\sixi \scriptscriptfont1=\fivei
  \textfont2=\ninesy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  \def\it{\fam\itfam\nineit}%
  \textfont\itfam=\nineit\scriptfont\itfam=\sixit
  \def\itbold{\fam\itbfam\nineboldi}%
  \textfont\itbfam=\nineboldi\scriptfont\itfam=\sixboldi
  \def\sl{\fam\slfam\ninesl}%
  \textfont\slfam=\ninesl
  \def\bf{\fam\bffam\ninebf}%
  \textfont\bffam=\ninebf \scriptfont\bffam=\sixbf
   \scriptscriptfont\bffam=\fivebf
  \def\tt{\fam\ttfam\ninett
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \def\tti{\fam\ttfam\ninetti % switch to typewriter italic 
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \def\ttex{\ninetex 
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \def\ttl{\let\it\ninetitleit\let\sl\ninetitleit\ninetitle}%
  \def\ssf{\fam\ssfam\niness}%
  \textfont\ssfam=\niness\scriptfont\ssfam=\sixss
  \def\ssfb{\fam\ssfam\ninessb}%
  %no room for another font family
  \def\ssfbn{\fam\ssbnfam\ninessn}%
  \textfont\ssbnfam=\ninessn\scriptfont\ssbnfam=\sixssn
  \textfont\ttfam=\ninett\scriptfont\ttfam=\sixtt
  \fam\ttfam\ninett \ttglue=.5em plus.25em minus.15em
  \def\Bbb{\fam\msbmfam\ninemsbm}%
  \textfont\msbmfam=\ninemsbm\scriptfont\msbmfam=\sixmsbm \scriptscriptfont\msbmfam=\fivemsbm
  \textfont\msamfam=\ninemsam\scriptfont\msamfam=\sixmsam 
  \scriptscriptfont\msamfam=\fivemsam
  \def\frak##1{{\ninefrak ##1}}%
  \normalbaselineskip=11pt
  \let\sc=\sevenrm
  \let\sci\sevenit
  \let\mc=\eightrm
  \let\cyr=\ninecyr
  \let\big=\ninebig
  \let\idss=\sevenidss
  \setbox\strutbox=\hbox{\vrule height8pt depth3pt width0pt}%
  \let\sscmd\sixpoint
  \normalbaselines\rm}

\def\eightpoint{\def\rm{\fam0\eightrm}%
  \textfont0=\eightrm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm
  \textfont1=\eighti \scriptfont1=\sixi \scriptscriptfont1=\fivei
  \textfont2=\eightsy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  \def\it{\fam\itfam\eightit}%
  \def\itbold{\fam\itbfam\eightboldi}%
  \textfont\itfam=\eightit
  \def\sl{\fam\slfam\eightsl}%
  \textfont\slfam=\eightsl
  \def\bf{\fam\bffam\eightbf}%
  \textfont\bffam=\eightbf \scriptfont\bffam=\sixbf
   \scriptscriptfont\bffam=\fivebf
  \def\tt{\fam\ttfam\eighttt
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \def\tti{\fam\ttfam\eighttti % switch to typewriter italic 
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \def\ttex{\eighttex 
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \textfont\ttfam=\eighttt
  \fam\ttfam\eighttt \ttglue=.5em plus.25em minus.15em
  \def\ssf{\fam\ssfam\eightss}%
  \textfont\ssfam=\eightss\scriptfont\ssfam=\sixss
  \def\ssfb{\fam\ssfam\eightssb}%
  \def\ssfbn{\fam\ssbnfam\eightssb}%
  \textfont\ssbnfam=\eightssn\scriptfont\ssbnfam=\sixssn
  \def\Bbb{\fam\msbmfam\eightmsbm}%
  \textfont\msbmfam=\eightmsbm\scriptfont\msbmfam=\sixmsbm \scriptscriptfont\msbmfam=\fivemsbm
  \textfont\msamfam=\eightmsam\scriptfont\msamfam=\sixmsam 
  \scriptscriptfont\msamfam=\fivemsam
  \def\frak##1{{\eightfrak ##1}}%
  \normalbaselineskip=9pt
  \let\sc=\sixrm
  \let\sci=\sixit
  \let\mc=\sevenrm
  \let\cyr=\eightcyr
  \let\big=\eightbig
  \let\idss=\sixidss
  \setbox\strutbox=\hbox{\vrule height7pt depth2pt width0pt}%
  \let\sscmd\sixpoint
  \normalbaselines\rm}

\def\sevenpoint{\def\rm{\fam0\sevenrm}%
  \textfont0=\sevenrm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm
  \textfont1=\seveni \scriptfont1=\sixi \scriptscriptfont1=\fivei
  \textfont2=\sevensy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  \def\it{\fam\itfam\sevenit}%
  \def\itbold{\fam\itbfam\sevenboldi}%
  \textfont\itfam=\sevenit
  \def\sl{\fam\slfam\sevensl}%
  \textfont\slfam=\sevensl
  \def\bf{\fam\bffam\sevenbf}%
  \textfont\bffam=\sevenbf \scriptfont\bffam=\sixbf\scriptscriptfont\bffam=\fivebf
  \def\tt{\fam\ttfam\seventt
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \def\tti{\fam\ttfam\seventti % switch to typewriter italic 
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \textfont\ttfam=\seventt
  \fam\ttfam\seventt \ttglue=.5em plus.25em minus.15em
  \def\ssf{\fam\ssfam\sevenss}%
  \textfont\ssfam=\sevenss\scriptfont\ssfam=\sixss
  \def\ssfb{\fam\ssfam\sevenssb}%
  \def\ssfbn{\fam\ssbnfam\sevenssb}%
  \textfont\ssbnfam=\sevenssn\scriptfont\ssbnfam=\sixssn
  \def\Bbb{\fam\msbmfam\sevenmsbm}%
  \textfont\msbmfam=\sevenmsbm\scriptfont\msbmfam=\sixmsbm \scriptscriptfont\msbmfam=\fivemsbm
  \textfont\msamfam=\sevenmsam\scriptfont\msamfam=\sixmsam 
  \scriptscriptfont\msamfam=\fivemsam
  \def\frak##1{{\sevenfrak ##1}}%
  \normalbaselineskip=8pt
  \let\sc=\sixrm
  \let\sci=\sixit
  \let\mc=\sixrm
  \let\big=\sevenbig
  \let\idss=\sixidss
  \setbox\strutbox=\hbox{\vrule height6pt depth2pt width0pt}%
  \normalbaselines\rm}

\def\sixpoint{\def\rm{\fam0\sixrm}%
  \textfont0=\sixrm \scriptfont0=\fiverm \scriptscriptfont0=\fiverm
  \textfont1=\sixi \scriptfont1=\fivei \scriptscriptfont1=\fivei
  \textfont2=\sixsy \scriptfont2=\fivesy \scriptscriptfont2=\fivesy
  \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  \def\it{\fam\itfam\sixit}%
  \def\itbold{\fam\itbfam\sixboldi}%
  \textfont\itfam=\sixit
  \def\sl{\fam\slfam\sixsl}%
  \textfont\slfam=\sixsl
  \def\bf{\fam\bffam\sixbf}%
  \textfont\bffam=\sixbf \scriptfont\bffam=\fivebf\scriptscriptfont\bffam=\fivebf
  \def\tt{\fam\ttfam\sixtt
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \def\tti{\fam\ttfam\sixtti % switch to typewriter italic 
    \let\{=\LB % left brace in a string
    \let\}=\RB % right brace in a string
  }%
  \textfont\ttfam=\sixtt
  \fam\ttfam\sixtt \ttglue=.5em plus.25em minus.15em
  \def\ssf{\fam\ssfam\sixss}%
  \textfont\ssfam=\sixss\scriptfont\ssfam=\fivess
  \def\ssfb{\fam\ssfam\sixssb}%
  \def\ssfbn{\fam\ssbnfam\sixssb}%
  \textfont\ssbnfam=\sixssn\scriptfont\ssbnfam=\fivessn
  \def\Bbb{\fam\msbmfam\sixmsbm}%
  \textfont\msbmfam=\sixmsbm\scriptfont\msbmfam=\fivemsbm \scriptscriptfont\msbmfam=\fivemsbm
  \textfont\msamfam=\sixmsam\scriptfont\msamfam=\fivemsam 
  \scriptscriptfont\msamfam=\fivemsam
  \def\frak##1{{\sixfrak ##1}}%
  \normalbaselineskip=8pt
  \let\sc=\sixrm
  \let\sci=\sixit
  \let\mc=\sixrm
  \let\big=\sixbig
  \let\idss=\sixidss
  \setbox\strutbox=\hbox{\vrule height5.5pt depth1.5pt width0pt}%
  \normalbaselines\rm}

\def\em{\let\tt\tti\let\sc\sci\it}

% fonts for the chapter titles

\font\cmhuge=cmssbx10 at .7in
\font\tthuge=cmtt10 at .7 in

\font\cmmiddle=cmss10 at .3in
\font\ttmiddle=cmtt10 at .3in

\def\hugetitle{%
    \let\ssf\cmhuge
    \let\tt\tthuge
    \ssf
}

\def\midtitle{%
    \let\ssf\cmmiddle
    \let\tt\ttmiddle
    \ssf
}

% temporary registers

\input trt1.sty

% we can prevent acrobat from defaulting to
% the "shrink to printable area" setting, which causes an 8.5"\times11" page to shrink
% by about 6\% to fit onto the printable region of the physical printer;
% this macro was contributed by Jeff Norden. 

\ifx\pdfcatalog\UNDEFINED\else
 \pdfcatalog{/ViewerPreferences<</PrintScaling/None>>}%
\fi

% a slightly involved way of determining whether we are making a pdf file is
% due to the fact that pdftex can output dvi files as well.

\newif\ifmakepdf

\ifx\pdfoutput\undefined
  \makepdffalse
\else
  \ifnum\pdfoutput>\z@ 
    \makepdftrue
  \else
    \makepdffalse
  \fi
\fi

% cleaning up whitespace

\newif\ifspaceleft

\def\removewhitespace{% a macro that removes glue, kerns, and
		      % penalties before the current point
  \loop\spaceleftfalse\unwhitespaceonce\ifspaceleft\repeat
}

\def\unwhitespaceonce{%
\ifhmode
    \ifdim\lastskip=\z@\else\unskip\spacelefttrue\fi
    \ifdim\lastkern=\z@\else\unkern\spacelefttrue\fi
    \ifnum\lastpenalty=\z@\else\unpenalty\spacelefttrue\fi
\fi}

% color management

% remember the cmyk color in an impossible control sequence

\def\colordef#1#2{\expandafter\def\csname cmykc@l@r #1\endcsname{#2}}

% color switch: we maintain our own color stack for pdf output;
% newer versions of pdf\TeX\ have `proper' color stack primitives
% which provide a more reliable implementation (across page breaks
% and inside insertions, for example) 

\def\colorset#1{\begingroup
  \ifmakepdf
    \expandafter\let\expandafter\currentc@l@r\csname cmykc@l@r #1\endcsname
    \edef\next{\noexpand\pdfliteral{\csname cmykc@l@r #1\endcsname\space k}}\next
  \else
    \special{ps:gsave}%
    \edef\next{\special{ps:\csname cmykc@l@r #1\endcsname\space setcmykcolor}}\next
  \fi
}

\def\currentc@l@r{1 1 1 1} % start out black

\def\quickcolordef#1#2{\colordef{#1}{#2}%
  \expandafter\def\csname color#1\endcsname##1{\colorset{#1}##1\restorecolor}}

\def\grayset#1{\begingroup
  \ifmakepdf
    \def\currentc@l@r##1k{#1 g}% so we can use \restoreco...
    \pdfliteral{#1 g}%
  \else
    \special{ps:gsave}\special{ps:#1 setgray}%
  \fi
}

\def\restorecolor{\endgroup
  \ifmakepdf
    \expandafter\pdfliteral\expandafter{\currentc@l@r\space k}%
  \else
    \special{ps:grestore}%
  \fi
}

% macros to provide pdf references to outside documents as well as inside the code

\def\locallink#1{%
  \ifmakepdf\colorset{link}\pdfstartlink attr {/Border [0 0 0]} goto name {#1}\fi}

\def\exlinkpage#1#2#3{\colorset{link}%
  \ifmakepdf\pdfstartlink attr {/Border [0 0 0]} goto file {#1} page #2 {#3}\fi}

\def\endlink{\ifmakepdf\pdfendlink\restorecolor\fi}

\def\namedspot#1{\ifmakepdf
  % raise the reference to make sure that the viewer window shows the
  % whole line in which the reference occurs
  \raise\ht\strutbox\vbox to 0pt{\vss\hbox to 0pt{\pdfdest name {#1} xyz}}%
\fi}

\def\pdfpagelink#1{% reference the page number
    \pdfstartlink attr {/Border [0 0 0]} goto page #1 {/XYZ null null null}\BlueGreen#1\Black\pdfendlink
}

\quickcolordef{peach}{0 0.06 0.14 0}
\quickcolordef{corn}{0 0.06 0.63 0.02}
\quickcolordef{sandybrown}{0 0.33 0.61 0.04}
\quickcolordef{darkwood}{0 0.29 0.5 0.48}
\quickcolordef{link}{0 0 1 0.30}

\def\colorblack#1{\grayset{0}#1\restorecolor}
\def\colorwhite#1{\grayset{1}#1\restorecolor}
\def\colorgray#1{\grayset{.5}#1\restorecolor}

% verbatim listing macros borrowed (with changes) from The TeXbook

\newcount\democodelc

\chardef\other=12
\def\ttverbatim{\begingroup
  \catcode`\\=\other
  \catcode`\{=\other
  \catcode`\}=\other
  \catcode`\$=\other
  \catcode`\&=\other
  \catcode`\#=\other
  \catcode`\%=\other
  \catcode`\~=\other
  \catcode`\_=\other
  \catcode`\|=\other
  \obeyspaces \obeylines \tt \ttglue=.5em plus.25em minus.15em }

{\catcode`\^=\active \catcode`\*=7 \obeylines
 \gdef^{\leavevmode\ttverbatim \spaceskip\ttglue \def**M{\endgroup\cr}\let^=\endgroup}}

\def\beginlines{\begingroup\parindent0pt \obeylines \everypar{\strut}\catcode`\^=\active}
\def\endlines{\endgroup}

\def\paddednumber#1{\ifnum #1 < 10 0\number#1\relax\else \number#1\fi}

% demo code display
% **H will produce a `|', **K can be used as an escape character, **L and **N 
% can be used in place of left and right braces to provide some control **C is
% a comment character when needed

{\catcode`\ =\active\gdef {\phantom{\char"20\relax}}\catcode`\^^H=\active\gdef^^H{\yl}}%

\newif\ifnumberlines

\def\begindemo{%
  \medskip
  \bgroup
  \def\linenoup{%
    \global\advance\democodelc by1 
    \ifnumberlines{\sevenrm\paddednumber\democodelc}\fi}
  \def\nooutput{\omit\hfil{\sevenrm\strut[more code $\ldots$]}\hfil\cr\noalign{\kern3pt}}
  \catcode`\^=\active\democodelc=0 \catcode`\*=7
  \chardef\*=`\*%
  \catcode`\^^H=\active % ^^H
  \catcode`\^^K=0 \catcode`\^^L=1 \catcode`\^^N=2 \catcode`\^^C=14 
  \tabskip=0pt plus 1 fill 
  \halign \demoastyle\bgroup\linenoup\hskip\demomargin ##\hfil\hskip\demomargin%
  \ifnumberlines{\sevenrm\paddednumber\democodelc}\fi\cr%
}

\def\enddemo{\egroup\egroup\medskip\noindent}

% referencing lines from the demo code
\def\dlbl#1{\expandafter\xdef\csname lncnt_#1\endcsname{\the\democodelc}}%
\def\dref#1{\csname lncnt_#1\endcsname}%

\newskip\demomargin
\demomargin=3em

\def\demoastyle{to\hsize}

% macros to provide some primitive alignment

\def\texalignment{\setbox0\lastbox\setbox0\lastbox\unkern\begingroup\settabs 3 \columns
\let\C\tabC\let\8\tabalign\def\5{\relax\ifmmode\oopsamp\else\clearamp\fi}\def\6{\strut\cr}}

\def\oopsamp{$&$}
\def\clearamp{&}

\def\texalignmentshort{\setbox0\lastbox\setbox0\lastbox\unkern\begingroup\settabs 2 \columns
  \let\C\tabC\let\8\tabalign\def\5{\ifmmode\oopsamp\else\clearamp\fi}\def\6{\strut\cr}}

\def\endtexalignment{\vskip-\baselineskip\strut\endgroup}

\def\eatcr#1\6{\ignorespaces}

\newtoks\postlimbotoks

\def\postlimbostuff{%
}

\def\picture#1{\ifmakepdf\pdfximage{#1.pdf}\pdfrefximage\pdflastximage
  \else
  \epsfbox{#1.eps}\fi
}

\let\yl|   % to use in \TeX\ mode instead of `|'
\def\vl{|} % same as above but expandable
\def\greaterthan{>} % CTANGLE always leaves a space after `>' in the output which interferes with some macros

% redefinitions of various CWEB macros;

% macros that provide a way to customize printing of reserved words

\let\oldamp\&
\let\oldoneletterid\|
\let\oldslashslash\\

\def\replaceunderscore#1{%
  \ifx#1\_%
      \yybreak{x\replaceunderscore}%
  \else
      \ifx#1\#%
          \yybreak@{H\replaceunderscore}%
      \else
          \ifx#1\end
              \yybreak@@{}%
          \else
              \yybreak@@{\string#1\replaceunderscore}%
          \fi
      \fi
  \yycontinue
}
      
\def\reservedid#1{\expandafter\r@servedid\expandafter{\csname RVD\replaceunderscore#1\end\endcsname}{#1}}

\def\r@servedid#1#2{\ifx#1\relax\yybreak{\oldamp{#2}}\else\yybreak{#1}\yycontinue}

\def\reservedname#1{\expandafter\r@servedname\expandafter{\csname RVD\replaceunderscore#1\end\endcsname}{#1}}

\def\r@servedname#1#2{\ifx#1\relax\yybreak{\oldslashslash{#2}}\else\yybreak{#1}\yycontinue}

\def\reservedoneletterid#1{%
  \expandafter\ifx\csname RVD\string#1\endcsname\relax
      \yybreak{\oldoneletterid{#1}}%
  \else
      \yybreak{\csname RVD\string#1\endcsname}%
  \yycontinue}

\def\defreserved#1{%
    \expandafter\def\csname RVD\replaceunderscore#1\end\endcsname
}

\let\&\reservedid
\let\|\reservedoneletterid

% better `hash'

\let\oldhash\#
\def\#{\lower.5pt\hbox{\tt\oldhash}}

\let\oldmathS\$

% cweb macros adopted to making typesetting languages other than C possible: Makefile and linker scripts.

\tempca=\catcode`\^^I% remember the old catcode
\catcode`\^^I=\active
\def\vb{\begingroup\catcode`\^^I=\active\vvb} % give the tab a chance to change its catcode before the rest is scanned
\def\vvb#1{{%
  \hbox{\vbox{\ttex%\tt
  \let\\=\BS % backslash in a string
  \let\{=\LB % left brace in a string
  \let\}=\RB % right brace in a string
  \let\~=\TL % tilde in a string
  %\let\ =\space % space in a string
  \def\ {\phantom{0}}%
  \let\_=\UL % underline in a string
  \let\&=\AM % ampersand in a string
  \let\^=\CF % circumflex in a string
  \let\$=\oldmathS % dollar sign
  \let\#=\oldhash % hash symbol: the new definition above would break alignment
  \let\n\empty % the `end of line' inserted by the preprocessing script
  \def^^I{$\llcorner$&$\lrcorner$}% a tab is a tab
  \tabalign{}#1\cr}}}\endgroup} % verbatim string
\catcode`\^^I=\tempca

\def\hex{\hbox{\tt\aftergroup}\aftergroup\hexsubscript}
\def\hexsubscript{\hbox{$_{\scriptscriptstyle1\kern-.7pt6}$}}
\let\K=\Leftarrow
\setbox\MGbox=\hbox{\hbox{\ninei\char'053}}
\def\R{\hbox{$^{\rm not}$}}
\let\CM\lnot
\def\MRL#1{\KK#1}\def\KK#1#2{\buildrel\;{\let\OR\lor\scriptscriptstyle#1}\over#2}
\def\C#1{\5\5\quad\hbox{$\triangleright\,$}{\rm #1}\hbox{$\,\triangleleft$}}
\let\Z=\leq \let\G=\geq
\let\E==

\def\tabC#1{\quad$\triangleright\,${\cmntfont#1}$\,\triangleleft$}

\def\.#1{\leavevmode\hbox{\tt % typewriter type for strings
  \let\\=\BS % backslash in a string
  \let\{=\LB % left brace in a string
  \let\}=\RB % right brace in a string
  \let\~=\TL % tilde in a string
  \let\ =\SP % space in a string
  %\let\_=\UL % underline in a string
  \let\&=\AM % ampersand in a string
  \let\^=\CF % circumflex in a string
  \let\uscore\_\chardef\_=`\_%
  #1\kern.05em}}

% macros to change the appearance of section headers

\outer\def\N#1#2#3.{% beginning of starred section
    \ifacro{\toksF={}\makeoutlinetoks#3\outlinedone\outlinedone}\fi
    \gdepth=#1\gtitle={#3}\MN{#2}%
    \ifon\ifnum#1<\secpagedepth \vfil\eject % force page break if depth is small
      \else\vfil\penalty-100\vfilneg\vskip\intersecskip\fi\fi
    \message{*\secno} % progress report
    \def\stripprefix##1>{}\def\gtitletoks{#3}%
    \edef\gtitletoks{\expandafter\stripprefix\meaning\gtitletoks}%
    \edef\next{\write\cont{%\noexpand\noexpand\noexpand\eatone{\noexpand\meaning\noexpand\ZZ}%
                \noexpand\noexpand\noexpand % AS: this is a (sort of a) bug in cwebmac.tex
                                            % as long as the index is output (i.e. ...\eject) 
                                            % before all the sections this is unnecessary
                                            % uncomment the line after the brace to see what \ZZ
                                            % expands to in case of weird errors
                \ZZ{\gtitletoks}{#1}{\secno}% write to contents file
     {\noexpand\the\pageno}{\the\toksE}}}\next % \ZZ{title}{depth}{sec}{page}{ss}
    \ifpdftex\expandafter\xdef\csname curr#1\endcsname{\secno}%
      \ifnum#1>0\countB=#1 \advance\countB by-1
        \advancenumber{chunk\the\countB.\expnumber{curr\the\countB}}\fi\fi
    \ifpdf\special{pdf: outline #1 << /Title (\the\toksE) /Dest
      [ @thispage /FitH @ypos ] >>}\fi
    \ifon\startsection{\ttl#3.\ }\ignorespaces} % changed the font; AS

\let\oldN\N

\outer\def\textN#1#2#3.{% beginning of starred section in `text' mode
    \ifacro{\toksF={}\makeoutlinetoks#3\outlinedone\outlinedone}\fi
    \gdepth=#1\gtitle={#3}\MN{#2}%
    \ifon
        \ifnum#1<2
            \vfil\eject % force page break for chapters
        \else
            \vskip0pt plus 3.5\baselineskip\penalty-100\vskip0pt plus -3.5\baselineskip\vskip\intersecskip % no page break
        \fi
    \fi
    \message{*\secno} % progress report
    \def\stripprefix##1>{}\def\gtitletoks{#3}%
    \edef\gtitletoks{\expandafter\stripprefix\meaning\gtitletoks}%
    \edef\next{\write\cont{%\noexpand\noexpand\noexpand\eatone{\noexpand\meaning\noexpand\ZZ}%
                \noexpand\noexpand\noexpand % AS this is a (sort of) bug in cwebmac.tex
                                            % as long as the index is output (i.e. ...\eject) 
                                            % before all the sections this is unnecessary
                                            % uncomment the line after the brace to see what \ZZ
                                            % expands to in case of weird errors
                \ZZ{\gtitletoks}{#1}{\secno}% write to contents file
     {\noexpand\the\pageno}{\the\toksE}}}\next % \ZZ{title}{depth}{sec}{page}{ss}
    \ifpdftex\expandafter\xdef\csname curr#1\endcsname{\secno}%
      \ifnum#1>0\countB=#1 \advance\countB by-1
        \advancenumber{chunk\the\countB.\expnumber{curr\the\countB}}\fi\fi
    % drop support for pdf specials: AS
    \ifon\startsection{\ttl#3}\smallskip\noindent\ignorespaces} 

\outer\def\chapterN#1#2#3.{% beginning of starred section in `book' mode
    \ifacro{\toksF={}\makeoutlinetoks#3\outlinedone\outlinedone}\fi
    \gdepth=#1\gtitle={#3}\MN{#2}%
    \ifon\stsecchappreseparator{#1}\fi % before the title
    \message{*\secno}% progress report
    \def\stripprefix##1>{}\def\gtitletoks{#3}%
    \edef\gtitletoks{\expandafter\stripprefix\meaning\gtitletoks}%
    \edef\next{%
        \write\cont{%\noexpand\noexpand\noexpand\eatone{\noexpand\meaning\noexpand\ZZ}%
        \noexpand\noexpand\noexpand % AS this is a (sort of) bug in cwebmac.tex
                                    % as long as the index is output (i.e. ...\eject) 
                                    % before all the sections this is unnecessary
                                    % uncomment the line after the brace to see what \ZZ
                                    % expands to in case of weird errors
        \ZZ{\gtitletoks}{#1}{\secno}{\noexpand\the\pageno}{\the\toksE}% \ZZ{title}{depth}{sec}{page}{ss}
    }}\next % write to contents file
    \ifpdftex
        \expandafter\xdef\csname curr#1\endcsname{\secno}%
        \ifnum#1=\z@
            \countB=#1 \advance\countB by\@ne
            \expandafter\xdef\csname curr\the\countB\endcsname{\secno}%
            \advance\countB by\@ne
            \expandafter\xdef\csname curr\the\countB\endcsname{\secno}%
            \advance\countB by\@ne
            \expandafter\xdef\csname curr\the\countB\endcsname{\secno}%
        \fi % allow subsection depth to jump up to 3 levels after a chapter: AS
        \ifnum#1>0\countB=#1 \advance\countB by-1
            %\message{#3::chunk\the\countB.\expnumber{curr\the\countB}::\expnumber{chunk\the\countB.\expnumber{curr\the\countB}}}%
            \advancenumber{chunk\the\countB.\expnumber{curr\the\countB}}%
        \fi
    \fi
    % drop support for pdf specials: AS
    \ifon\stsecchap{#1}{#3}\ignorespaces
}

\def\writebookmarkline#1#2#3#4#5{{% the scheme for bookmarks is rather fragile
                                  % the proper implementation must involve a stack: AS
    \let\(=\let \let\)=\let \let\[=\let \let\]=\let \let\/=\let
    \edef\depth{\expnumber{chunk#2.#3}}%
    \ifnum\depth=\z@ % allow subsection depth to jump up to 3 levels: AS
        \countB=#2 \advance\countB\@ne
        \edef\depth{\expnumber{chunk\the\countB.#3}}%
        \ifnum\depth=\z@
            \advance\countB\@ne
            \edef\depth{\expnumber{chunk\the\countB.#3}}%
        \fi
    \fi
    %\message{bookmark for #5::depth:\depth::#2.#3}%
    \pdfoutline goto num #3 count -\depth {#5}}}

\def\stsecchappreseparator#1{% separator between the end of the previous section and the current one
    \ifnum#1<\tw@
        \vfil\eject % force page break for chapters and major subsections
        \ifodd\pageno
        \else
            \null\vfill\eject
        \fi
    \else
        \vskip0pt plus 3.5\baselineskip
        \penalty-100
        \vskip0pt plus -3.5\baselineskip
        \vskip\intersecskip % no forced page break
    \fi
}

\def\stsecchap#1#2{\rightskip=0pt % get out of C mode (cf. \B)
    \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
%
    \ifnum#1>0
        \noindent{\let\*=\lapstar\llap{\tentitle\secstar\quad}}{\ttl #2}\smallskip\noindent% push it to the margins
    \else
        \null % sloppy but this works for the narrow case of this example
        \global\chapterheadtrue
        \vskip1.5in
        \vbox{\tabskip=0pt plus 1 fil
            \halign to\hsize{%
                \hfil##\tabskip=0pt\cr
                \cmhuge\secstar\cr
                \noalign{\vskip 1pc}%
                \cmmiddle#2\cr
            }%
        }%
        \bigskip
        \noindent
    \fi
%
    \ifpdftex\smash{\raise\baselineskip\hbox to0pt{%
       \let\*=\empty\ifmakepdf\pdfdest num \secstar fith\fi}}% this space is a bug in the original cwebmac.tex; AS
    \else\ifpdf\smash{\raise\baselineskip\hbox to0pt{%
       \let\*=\empty\special{%
         pdf: dest (\romannumeral\secstar) [ @thispage /FitH @ypos ]}}}\fi\fi}

\outer\def\textM#1{\MN{#1}\ifon\vskip0pt plus 3\baselineskip\penalty-100\vskip0pt plus -3\baselineskip % no page break
    \vskip\intersecskip\startsection\ignorespaces}

\def\MN#1{\par % common code for \M, \N
    {\xdef\secstar{#1}\let\*=\empty\xdef\secno{#1}}% remove \* from section name
    \ifx\secno\secstar \onmaybe \else\ontrue \fi
    \mark{{\secno}{\the\gdepth}{\the\gtitle}}% remove the annoying `paragraph' sign; AS
}

% a new start section macro: fix the extra space bug and push the section number to the margins

\def\stseclap{\rightskip=0pt % get out of C mode (cf. \B)
    \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
    \noindent{\let\*=\lapstar\llap{\tentitle\secstar\quad}}% push it to the margins
    \ifpdftex\smash{\raise\baselineskip\hbox to0pt{%
       \let\*=\empty\ifmakepdf\pdfdest num \secstar fith\fi}}% this space is a bug in the original cwebmac.tex; AS
    \else\ifpdf\smash{\raise\baselineskip\hbox to0pt{%
       \let\*=\empty\special{%
         pdf: dest (\romannumeral\secstar) [ @thispage /FitH @ypos ]}}}\fi\fi}

\let\startsection\stseclap

\newif\ifchapterhead

% make page and section number hang in the margins; \quad is chosen to
% be consistent with section appearance; the page numbers are printed
% in old-style numerals;

\def\lheader{%
    \ifchapterhead
        \hfil
    \else
        \termindexfalse\headertrue\llap{\mainfont\oldstyle\the\pageno\tentitle\quad}%
        \eightpoint\rm\grouptitle\hfill\title
        \rlap{\tentitle\quad\secrangedisplay}%
    \fi
} % top line on left-hand pages

\def\rheader{%
    \ifchapterhead
        \hfil
    \else
        \termindexfalse\headertrue\llap{\secrangedisplay\tentitle\quad}% 
        \eightpoint\rm\title\hfill\grouptitle
        \rlap{\tentitle\quad\mainfont\oldstyle\the\pageno}%
    \fi
} % top line on right-hand pages

\def\secrangedisplay{{\tenpoint$^{\hbox{\sevenrm\topsecno}}_{\hbox{\sevenrm\botsecno}}$}}

\def\botsecno{\expandafter\takeone\botmark} % the first section on the
                                            % next page
\newif\ifsepsectionchapter % do we put the section list in its own chapter?

\def\finmod{%
  \parfillskip 0pt plus 1fil
  \def\grouptitle{NAMES OF THE SECTIONS}
  \let\topsecno=\nullsec
  \message{Section names:}
  \setpage
  \def\note##1##2.{\quad{\eightrm##1~\ifacro{\pdfnote##2.}\else{##2}\fi.}}
  \def\Q{\note{Cited in section}} % crossref for mention of a section
  \def\Qs{\note{Cited in sections}} % crossref for mentions of a section
  \def\U{\note{Used in section}} % crossref for use of a section
  \def\Us{\note{Used in sections}} % crossref for uses of a section
  \def\I{\par\hangindent 2em}\let\*=*
  \ifacro 
      \def\outsecname{Names of the sections} 
      \let\Xpdf\X
      %
      \ifpdftex 
          %\makebookmarks 
          % move this to just before the contents so \inxmod has a 
          % chance to close the \cont channel; AS
          \ifsepsectionchapter\else\pdfdest name {NOS} fith \fi
          %\pdfoutline goto name {NOS} count -\secno {\outsecname}%
          %\def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
              %{\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
              %\pdfoutline goto num \the\toksA \expandafter{\the\toksE}%
              % remove bookmarks for individual sections to avoid unpleasant
              % pdf navigation artefacts; AS
          %}
          % pdf specials are not supported: AS
      \fi
  \fi
  %
  \bigskip
  \vskip0pt plus 5pt
  \penalty-10
  \tenpoint
  \centerline{\sc A LIST OF ALL SECTIONS}
  \penalty300
  \medskip
  \emergencystretch=12pt
  \sectionlistsetup
  \readsections
}

\let\sectionlistsetup\relax

\def\YYcontentsline#1#2#3#4#5{\ifnum#2=0 \smallbreak\fi
    \line{\consetup{#2}#1
      \rm\leaders\hbox to .5em{.\hfil}\hfil
      \ \ifacro
          \pdfstartlink attr {/Border [0 0 0]} goto page #4 {/FitH} \BlueGreen #3\Black\pdfendlink
      \else#3\fi\hbox to3em{\hss#4}}}

\def\YYwritebookmarkline#1#2#3#4#5{{%
    \let\(=\let \let\)=\let \let\[=\let \let\]=\let \let\/=\let
    \pdfoutline goto page #4 {#4} count 0 {#5}}}


\def\makebookmarks{\let\ZZ=\writebookmarkline \let\YY\YYwritebookmarkline \readcontents\relax}

\def\topofcontents{%
    \null\vskip-3\baselineskip\centerline{C{\sc ONTENTS} (\sc\uppercase\expandafter{\title})}\medskip
    \ifacro
        \ifpdftex
            \makebookmarks
            \ifsepsectionchapter\else\pdfoutline goto name {NOS} count 0 {\outsecname}\fi% no section listing; AS
            \pdfdest name {TOC} fith % bookmark for the table of contents
        \fi
    \fi
    \let\YY\YYcontentsline
}

\def\botofcontents{\vfill
  \ifpdftex\pdfoutline goto name {TOC} count 0 {Table of Contents}\fi 
  \centerline{\covernote}} % this material will end the table of contents page

\newwrite\exampletable

\newif\ifsaveparseoutput
\newif\ifchecktable

% \Cee\ section macros

% stage one macros for `\B' sections: collecting tokens

% \B is always paired with \par (see CWEAVE section 213); unfortunately, this is 
% where certainty ends; the output of \CWEAVE\ is woefully unstructured, to say the
% least; the ugly hack below appears to be the only way to typeset the \Cee\ sections
% in their own style (using the 9pt face as is the case below).

\let\oldB\B

\long\def\Bvbpp#1\par{% the \vb{\yyendgame}\vb... is inserted by brack.pl
    \Bvbp@#1\cleanBtail\X\X$\E$\par
}

\def\cleanBtail\X\X$\E${}

\long\def\Bvbp@#1\X#2\X$#3\E#4$#5\par{%
    \yystringempty{#5}%
        {%  this is a \Cee\ section (@c or @p); it is tempting to assume that the suffix
         %  is \X\X$\E$\par and forego the invocation of \Bvb@@, however, this is not always
         %  the case as the first \X may come from a different section in the middle.
            \oldB#1\X#2\X$#3\E#4$\par
        }{% the logic here is not perfect but if this is still a \Cee\ section,
          % inserting @t@> between @> and whatever follows that produces $...\E...$
          % will correct the misidentification (the result of which may be, at best,
          % part of the section being typeset in a wrong face, or, worse \begingroup
          % starting a group in a wrong place (such as in the middle of the math mode))
            \oldB#1\X#2\X${#3}\E{#4}$\begingroup % the braces around #3 and #4 are necessary
                                                 % to ensure proper spacing around \E in case
                                                 % #3 and #4 are empty
            \ninepoint
            \Binputtoks{#5}\Btoksmathfalse
            #5\par\endgroup
        }%
}

\newtoks\Binputtoks

\newif\ifBtoksmath % does the section start in math mode?

\let\yyendgame\empty

\let\postparse\empty % the `upper half' \preparse... macros will use the contents of \Binputtoks

\newif\ifyyskipparse

\let\B\Bvbpp

% parser stack setup

\def\fillpstack#1#2{%
    \expandafter\def\csname currentparser[#1]\endcsname{#2}%
}

\def\poppstack#1{%
    \expandafter\ifx\csname currentparser[#1]\endcsname\relax
        \yybreak{% unknown language, skip the section
            \preparsetrivial
        }
    \else
        \yybreak{%
            \expandafter\expandafter\expandafter
                \p@ppstack\csname currentparser[#1]\endcsname\end{#1}%
        }%
    \yycontinue
}

\def\p@ppstack#1#2\end#3{%
    \yystringempty{#2}{%
        \fillpstack{#3}\relax#1%
    }{%
        \fillpstack{#3}{#2}#1%
    }%
}

% section macros

\def\lsectionbegin#1{%
    \ifmmode
        \yybreak{%
            {}$% exit the group inside the math mode
            \Btoksmathtrue
            \poppstack{#1}\vb{}$%
        }% finish the math mode and reinsert it as stash
    \else
        \yybreak{%
            \poppstack{#1}%
        }%
    \yycontinue
}

\def\skiptolsection#1\lsectionbegin#2{%
    \ifBtoksmath
        \yybreak{%
            \lsectionbegin{#2}\vb{}${}%
        }%
    \else
        \yybreak{%
            \lsectionbegin{#2}%
        }%
    \yycontinue
}

\def\removefinalvb#1\endparse{}

\def\preparsetrivial#1\postparse{} % in case the section contains some dangerous
                                   % terms like \insertraw{...} that must be skipped

% URL typesetting

\def\urls#1#2{% make it possible to omit the `https://' nonsense
    \hskip0pt plus .3\hsize\penalty1000
    \hskip0pt plus -.3\hsize
    {%
        \def~{\string~}%
        \ifmakepdf
            \pdfURL{{\tt #2}}{#1#2}%
        \else
            {\tt #2}%
        \fi
    }%
    \hskip0pt plus .2\hsize\penalty1000
    \hskip0pt plus -.2\hsize\relax % this is somewhat of an infidelity in \TeX's syntax
}

\def\urll#1#2{% make it possible to omit the `https://' nonsense
    \hskip0pt plus .3\hsize\penalty1000
    \hskip0pt plus -.3\hsize
    {%
        \def~{\string~}%
        \ifmakepdf
            \pdfURL{#2}{#1}%
        \else
            {\tt #2}%
        \fi
    }%
    \hskip0pt plus .2\hsize\penalty1000
    \hskip0pt plus -.2\hsize\relax % this is somewhat of an infidelity in \TeX's syntax
}

\def\url#1{\urls{}{#1}}

% commonly used names

\def\CWEB{\.{CWEB}}
\def\CTANGLE{\.{CTANGLE}}
\def\CWEAVE{\.{CWEAVE}}
\def\WEB{\.{WEB}}
\def\Pascal{P{\sc ASCAL}}
\def\noweb{\.{noweb}}
\def\splint{\.{SPLinT}}
\def\POSIX{{\sc POSIX}}
\def\AST{{\sc AST}}
\def\EAST{{\sc EAST}}
\def\WEST{{\sc WEST}}
\def\ISO{{\mc ISO}}
\def\bison{\ifheader B{\sc ISON}\else\.{bison}\fi}
\def\flex{\ifheader F{\sc LEX}\else\.{flex}\fi}
\def\lex{\.{lex}}
\def\yacc{\.{yacc}}
\def\gcc{\.{gcc}}
\def\ld{\ifheader LD\else\.{ld}\fi}
\def\GNU{{\sc GNU}}
\def\CEEPP/{{\mc C{\tt ++}\spacefactor1000}}
\def\Ceepp{\CEEPP/}
\def\mft{\.{mft}}
\def\MF{{\tt META}\-{\tt FONT}\spacefactor1000 }
\def\MP{{\tt META}\-{\tt POST}\spacefactor1000 }
% from tugboat.cmn
\newbox\TestBox
\def\La{\tempca=\the\fam \leavevmode L%
        \setbox\TestBox=\hbox{$\fam\tempca\scriptstyle A$}%
        \kern-.5\wd\TestBox\raise.42ex\box\TestBox}
\def\LaTeX{\La\kern-.15em\TeX}

\def\sqbullet{\kern.3ex\vrule height .9ex width .8ex depth -.1ex }% square bullet (from manmac.tex)

\def\sqebullet{% empty square bullet
    \kern.3ex\vbox{\hsize=.8ex
        \hrule height .4pt
        \kern-.4pt
        \hbox to\hsize{\vrule height .9ex \hfill\vrule height .9ex} 
        \kern-.4pt
        \hrule height .4pt
        \kern.1ex
    }%
}

% a `union' to control command sequences in the .aux files; 
\def\auxunionctl{}% here we add sequences that control namespace switching
                  % although it is handled as a `union', we plan to execute this
                  % sequence rather than use it as a storage list
\newwrite\auxstream

\def\initauxstream{% this command should be executed only after 
                   % all the command sequances have been loaded (i.e. after
                   % noweb.sty, dcols.sty, etc. have been loaded)
    \immediate\openin\trystream=\jobname.aux
    \ifeof\trystream
    \else
        \restorecslist{aux:global:activate}\auxunionctl
        \auxunionctl % activate/deactivate individual subsets
        \immediate\closein\trystream
        \input \jobname.aux
    \fi
    \immediate\openout\auxstream=\jobname.aux
    \restorecslist{aux:global:prestart}\auxunionctl
    \auxunionctl
}

\def\everyendofjob{%
    \restorecslist{aux:global:precutoff}\auxunionctl
    \auxunionctl % write delayed data to the stream
    \immediate\closeout\auxstream
    \restorecslist{aux:global:preend}\auxunionctl
    \auxunionctl % do end of run tasks for every command set that writes to aux stream
    \message{Closed auxilary streams}%
}

% \end amendment, based on stackexchange question/answer by Bruno LeFloch
% https://tex.stackexchange.com/questions/39279/test-whether-end-will-really-end-the-run/40894
% with some simplifications (we do not really need to take care of every possible situation
% since the \end command appears at a predictable spot)

\def\newend{%
    \ifdim\pagegoal=\maxdimen
        \yybreak{\checkdeadcycles}%
    \else
        \yybreak{\end}% do nothing, the regular \output will take care of the endgame
    \yycontinue
}

\def\checkdeadcycles{%
    \ifnum\deadcycles=\z@
        \yybreak{\testpageforstuff}%
    \else
        \yybreak{\end}% do nothing, the regular \output will take care of the endgame
    \yycontinue
}

% insert the same material \end would insert (see The \TeX book, p.~264)
\def\forceoutputagain{%
  \prevdepth=-1000pt
  \hbox{}\vfill\penalty-'10000000000
}

\def\testpageforstuff{% temporarily replace the output routine
                      % to check if the page contains stuff other than boxes
    \begingroup\output{\aftergroup\endgroup\testpageoutput}%
    \forceoutputagain % call the new output routine
}

\def\testpageoutput{%
    \deadcycles=\z@
    \cleantemppage
    \yyifpageempty % is there any stuff other than boxes in the vertical list?
                   % this macro is only expanded if \pagegoal=\maxdimen and \deadcycles=0
        {\everyendofjob}% vertical list is empty
        {}% whatsit nodes present, let \end take care of them
    \aftergroup\end
    \unvbox255
    \ifnum\outputpenalty=\@M % 10000 the break was not at a penalty item
    \else
         \penalty\outputpenalty
    \fi
}

\def\cleantemppage{% remove material inserted by \forceoutputagain
    \setbox255\vbox{%
        \unvbox255
        \unskip % remove \vfill
        \setbox0\lastbox % remove \hbox{}
        \unskip % remove \topskip
    }%
}

\def\yyifpageempty{%
    \setbox\z@\vbox{%
        \vbox{}\unvcopy255\setbox0\lastbox
        \expandafter
    }%
    \ifvoid\z@ %\vbox was not the last item, force output again
        \yybreak{\yysecondoftwo}%
    \else
        \yybreak{\yyfirstoftwo}%
    \yycontinue
}

\def\con{\par\vfill\eject % finish the section names
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
  \rightskip 0pt \hyphenpenalty 50 \tolerance 200
  \setpage \output={\normaloutput\page\lheader\rheader}
  \titletrue % prepare to output the table of contents
  \pageno=\contentspagenumber
  \def\grouptitle{TABLE OF CONTENTS}
  \message{Table of contents:}
  \topofcontents \startpdf
  \line{\hfil Section\hbox to3em{\hss Page}}
  \let\ZZ=\contentsline
  \readcontents\relax % read the contents info
  \botofcontents 
  \newend
} % print the contents page(s) and terminate

% sugar

\def\FOREVER{{\bf forever}}

% microtypography extensions: activate optical alignment
\ifacro
    \ifpdftex
        \input other/texmf/macros/protcode.tex
        \pdfprotrudechars=2
        \setprotcode\tenrm
        \setprotcode\ninerm
        \setprotcode\eightrm
        \setprotcode\sevenrm
        \setprotcode\sixrm
        \setprotcode\tenit
        \setprotcode\nineit
        \setprotcode\eightit
        \setprotcode\sevenit
        \setprotcode\sixit
        % do not stretch characters
        %\pdfdjustspacing=2 
        %\pdffontexpand\sevenrm 30 20 10 autoexpand
    \fi
\fi

% TODO: use \pdfsavepos, \pdflastxpos, and \pdflastypos to
% save the position of index terms on the page

% unstable macros

% two column typesetting for short sections
% CAUTION: while the macros below seem to work, their use requires a great deal of care
% o they assume that the sections are narrow so only use them if you are reasonably sure that
%   the width of the sections to be typeset as double column text are stable and not
%   going to change much
% o sections to be so typeset should not be part of `concatenated' @c sections; otherwise
%   the noweb style section pointers in the margins will clash with the text in the adjacent
%   column (this is not a concern if the traditional \CWEB\ referencing style is used

\def\dcolbM{\expandafter\let\csname M\endcsname\thisM
    \vskip 0pt plus 3\baselineskip\penalty-100 \vskip 0pt plus -3\baselineskip
    \vskip\ht\strutbox
    \vskip-\topskip % negate the \topskip at the beginning of the column box
    \vskip-\smallskipamount
    \vskip\intersecskip
    \begindoublecols
    \csname M\endcsname
}

\def\dcolbN{\expandafter\let\csname M\endcsname\thisN
    \vskip\ht\strutbox
    \vskip-\topskip % negate the \topskip at the beginning of the column box
    \vskip-\smallskipamount
    \vskip\intersecskip
    \begindoublecols
    \csname N\endcsname
}

\def\dcoleM{%
    \vfil\enddoublecols
    \crudelet{M}{thisM}%
    \crudelet{N}{thisN}%
    \csname M\endcsname
}

\def\dcoleN{%
    \vfil\enddoublecols
    \crudelet{M}{thisM}%
    \crudelet{N}{thisN}%
    \csname N\endcsname
}

\def\beginfoldedsections{% begin double column output starting with the next
                         % \M or \N section
    \ifbootstrapmode
    \else
        \crudelet{thisM}{M}%
        \crudelet{thisN}{N}%
        \crudelet{M}{dcolbM}%
        \crudelet{N}{dcolbN}%
    \fi
}

\def\endfoldedsections{% finish double column output starting with the next
                       % \M or \N section
    \ifbootstrapmode
    \else
        \crudelet{M}{dcoleM}%
        \crudelet{N}{dcoleN}%
    \fi
}

\def\crudelet#1#2{% ignore \outer (as a useful side effect these assignments can be skipped
                  % as a part of an \if... statement without producing `incomplete \iftrue'
                  % or like errors
    \edef\next{\global\let\expandafter\nx\csname#1\endcsname\expandafter\nx\csname#2\endcsname}\next
}

\def\beginfoldedsectionshere{% similar to \beginfoldedsections but can be used immediately
                             % before the @c portion of the section that will be typeset in two
                             % columns; this way the \TeX\ portion of the section can still be
                             % typeset in a single column
    % save the current section macro to be restored by \endfoldedsections
    \ifbootstrapmode
    \else
        \crudelet{thisN}{N}% both types of section macros are saved
        \crudelet{thisM}{M}% just in case the section changes to an \M section
        \vskip\ht\strutbox
        \vskip-\topskip % negate the \topskip at the beginning of the column box
        \vskip-\smallskipamount % undo the skip from \begindoublecols
        \yskip
        \begindoublecols
        \parindent=1em
    \fi
}

% support reproducible compilation
\ifpdftex
    \pdfinfoomitdate=1
    \pdftrailerid{}%
\fi
\tenpoint