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
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
|
% \iffalse
%
% Copyright 2008-2023, Boris Veytsman
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3 of this license or (at your option) any
% later version.
% The latest version of the license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of
% LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Boris Veytsman,
% <borisv@lk.net>
%
% This work consists of the file nostarch.dtx and the
% derived file nostarch.cls
%
% \fi
% \CheckSum{0}
%
%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%
%\iffalse
% Taken from xkeyval.dtx
%\fi
%\makeatletter
%\def\DescribeOption#1{\leavevmode\@bsphack
% \marginpar{\raggedleft\PrintDescribeOption{#1}}%
% \SpecialOptionIndex{#1}\@esphack\ignorespaces}
%\def\PrintDescribeOption#1{\strut\emph{option}\\\MacroFont #1\ }
%\def\SpecialOptionIndex#1{\@bsphack
% \index{#1\actualchar{\protect\ttfamily#1}
% (option)\encapchar usage}%
% \index{options:\levelchar#1\actualchar{\protect\ttfamily#1}\encapchar
% usage}\@esphack}
%\def\DescribeOptions#1{\leavevmode\@bsphack
% \marginpar{\raggedleft\strut\emph{options}%
% \@for\@tempa:=#1\do{%
% \\\strut\MacroFont\@tempa\SpecialOptionIndex\@tempa
% }}\@esphack\ignorespaces}
%\makeatother
%
% \MakeShortVerb{|}
% \GetFileInfo{nostarch.dtx}
% \newcommand{\progname}[1]{\textsf{#1}}
% \title{\LaTeX{} Style For \emph{No Starch Press}
% \thanks{\copyright 2008--2023, Boris Veytsman}}
% \author{Boris Veytsman\thanks{%
% \href{mailto:borisv@lk.net}{\texttt{borisv@lk.net}},
% \href{mailto:boris@varphi.com}{\texttt{boris@varphi.com}}}}
% \date{\filedate, \fileversion}
% \maketitle
% \begin{abstract}
% This package provides class for typesetting books for No Starch
% Press, \url{http://www.nostarch.com}
% \end{abstract}
% \tableofcontents
%
% \clearpage
%
% \changes{v0.1}{2008/02/27}{First fully functional version}
% \changes{v0.5}{2008/03/19}{Documentation update}
% \changes{v0.6}{2008/03/21}{Documentation update}
% \changes{v1.0}{2008/04/07}{First public release}
% \changes{v1.1}{2008/05/24}{Added interface to listings package and
% upquote package. Updated documentation}
% \changes{v1.4}{2020/04/29}{Updated interface with listings package}
% \changes{v2.0}{2023/03/30}{Incorporated in-house changes by No
% Starch Press}
%
%
%\section{Introduction}
%\label{sec:intro}
%
% This is the ``official'' \LaTeX{} style for \emph{No Starch Press,}
% \url{http://www.nostarch.com}. The class is intended to typeset
% books for this publisher---both hard copies and electronic books.
%
% The suite provides main class, |nostarch.cls|, hyperref interface
% |nshyper.sty| and MakeIndex style |nostarch.ist|.
%
% The initial version of this class was written in 2008. Since then a
% number of changes was made for in-house processing by the \emph{No
% Starch} team, with special thanks to Alex Freed. In 2023 these
% changes were incorporated back to the publicly released version.
%
%\section{User's Guide}
%\label{sec:manual}
%
%
%\subsection{Installation}
%\label{sec:installation}
%
% The installation of the class follows the usual
% practice~\cite{TeXFAQ} for \LaTeX{} packages:
% \begin{enumerate}
% \item Run \progname{latex} on |nostarch.ins|. This will produce the
% following files:
% \LaTeX{} class |nostarch.cls|, \LaTeX{} style |nshyper.sty| and
% MakeIndex style |nostarch.ist|.
% \item Put the files |nostarch.cls|, |nshypher.sty| and
% |nostarch.ist| to
% the places where \LaTeX{} and MakeIndex can find them (see
% \cite{TeXFAQ} or the documentation for your \TeX{}
% system).\label{item:install}
% \item Update the database of file names. Again, see \cite{TeXFAQ}
% or the documentation for your \TeX{} system for the system-specific
% details.\label{item:update}
% \item The file |nostarch.pdf| provides the documentation for the
% package (this is the file you are probably reading now).
% \end{enumerate}
% As an alternative to items~\ref{item:install} and~\ref{item:update}
% you can just put the files in the working directory where your
% |.tex| file is.
%
% To typeset the books in the distinctive \emph{No Starch Press} style
% you will need the fonts used by them. Unfortunately these fonts
% (New Baskerville, Futura, The Sans Mono Condensed and Dogma) are not
% free. You have the following options:
% \begin{enumerate}
% \item Typeset your book using only free fonts (the option |nocfonts|
% discussed below).
% \item Buy the fonts and install them.
% \item Arrange with \emph{No Starch Press} for the use of these fonts
% for your book.
% \end{enumerate}
% The details of the installation are discussed below in
% Section~\ref{sec:ug_fonts}.
%
%
%
%\subsection{Fonts installation}
%\label{sec:ug_fonts}
%
% If you wish to try \progname{nostarch} class without bothering to
% typeset camera-ready copy, you may use the option |nocfonts| for
% \emph{no commercial fonts,} and the class will use only the free
% fonts available in \TeX\ distributions.
%
% If you work with \emph{No Starch Press} on your book, you might be
% provided with the fonts. Today \emph{No Starch Press} typically
% uses \progname{xelatex} and expects the fonts in True~Type format.
% If this is the case, use the option |cfonts|. \emph{No Starch
% Press} recommends the authors to put the font files in the
% subdirectory \path{fonts} of their main directory. This is where
% \progname{nostarch} expects them. This is also the layout of
% directories in the \emph{No Starch Press} \emph{Overleaf}
% templates. However, if you prefer to put the fonts in another
% directory, searcheable by \progname{xelatex}, use the option
% |nofontsdir| in the invocation.
%
% These options are summarized in Figure~\ref{fig:fonts}.
%
% \begin{figure}
% \centering
% \begin{tikzpicture}
% \node[draw, circle, radius=0.1] (start) {};
% \node[draw, align=center, below=of start]
% (haveFonts) {Do you have \\commercial fonts?};
% \node[draw, left=of haveFonts, align=center] (nocfonts)
% {Use |nocfonts|\\ option};
% \node[draw, below=of nocfonts, rounded corners]
% (any) {Use any engine};
% \node[draw, right=of haveFonts, align=center] (cfonts)
% {Use |cfonts|\\option};
% \node[draw, below=of cfonts, align=center] (haveSubdir) {Are the fonts
% \\in |fonts| \\subdirectory?};
% \node[draw, left=of haveSubdir, align=center]
% (nofontsdir) {Use |nofontsdir|\\option};
% \node[draw, below=of haveSubdir, align=center] (fontsdir)
% {Use |fontsdir|\\option};
% \node[draw, below=of fontsdir, rounded corners] (xelatex)
% {Use \progname{xelatex} engine};
% \draw[-latex] (start) -- (haveFonts);
% \draw[-latex] (haveFonts) -- node[above] {No} (nocfonts);
% \draw[-latex] (haveFonts) -- node[above] {Yes} (cfonts);
% \draw[-latex] (nocfonts) -- (any);
% \draw[-latex] (cfonts) -- (haveSubdir);
% \draw[-latex] (haveSubdir) -- node[above] {No} (nofontsdir);
% \draw[-latex] (haveSubdir) -- node[right] {Yes} (fontsdir);
% \draw[-latex] (nofontsdir) |- (xelatex);
% \draw[-latex] (fontsdir) -- (xelatex);
% \end{tikzpicture}
% \caption{Flowchart for font-related options}
% \label{fig:fonts}
% \end{figure}
%
%
%\subsection{Invocation}
%\label{sec:invocation}
%
% To use the class, put in the preamble of your document
% \begin{flushleft}
% |\documentclass[|\meta{options}|]{nostarch}|
% \end{flushleft}
%
% \DescribeOptions{cfonts,nocfonts}%
% As discussed above, \emph{No Starch Press} uses a number of
% commercial fonts to typeset their books.
% The option |cfonts| (default) tells \LaTeX{} that you do have these
% commercial fonts. On the other hand, the option |nocfonts| instructs
% \LaTeX{}
% to use freely available fonts for typesetting. Of course in this
% case the result will not look like a \emph{No Starch Press} Book.
%
% \DescribeOptions{fontsdir,nofontsdir}%
% If you use commercial fonts \emph{and} \progname{xelatex}, the
% latter usually expects them in the subdirectory \path{fonts} of the
% main directory (see Section~\ref{sec:ug_fonts}). The options
% |fontsdir| (default) sets up this behavior. Use the option
% |nofontsdir| to tell \progname{xelatex} to search standard font
% directories insted.
%
% Figure~\ref{fig:fonts} may help to choose the right options.
%
%
%\subsection{Use of \progname{hyperref} Package}
%\label{sec:guide:hyperref}
%
% The books typeset by \emph{No Starch Press} can be sold either as
% traditional printed and bound hard copies, or as PDF files. If you,
% the author, envisage the second possibility, you may want additional
% possibilites provided by \progname{hyperref}
% package~\cite{Rahtz06:Hyperref}, like ``clickable'' entries in the
% table of context and index, etc. The provided package |nshyper.sty|
% adds the functionality of \progname{hyperref} to the class. This
% package is highly recommended for the books that are going to be
% distributed in an electronic form.
%
% To use the package, just add the line |\uspackage{nshyper}| to your
% preamble. This package should be loaded last since it redefines
% internals of many other packages. Note that a direct call of
% \progname{hyperref} by |\usepackage{hyperref}| will not work since
% \progname{nshyper} patches hyperref to work with our class.
%
%
%
%\subsection{Front Matter}
%\label{sec:guide:frontmatter}
%
% \DescribeMacro{\frontmatter}
% A book can be divided into three parts: front matter, main matter
% and back matter. Front matter starts with the command
% |\frontmatter|. Normally this is the first command in the class.
% Front matter contains half page, title page, copyright page, brief
% contents, detailed contents, foreword(s) and other stuff which is
% traditionally typeset on roman-numbered pages. The commands in main
% matter can be divides into \emph{declarations} and
% \emph{directives.} Declarations do not typeset anything. Rather,
% they up parameters for the typesetting. Directives use them to
% typeset the stuff.
%
%
%\subsubsection{Front Matter Declarations}
%\label{sec:guide:decls}
%
%
%
% \DescribeMacro{\title}
% There are five declarations defined by |nostarch.cls|: |\title|,
% |\subtitle|,
% |\author|, |\nostarchlogo| and |\nostarchlocation|. The macro
% |\title|, like the standard \LaTeX{} |\title|, sets the title of the
% book, for example |\title|\texttt{\{The book about everything\}}.
%
% \DescribeMacro{\subtitle}
% The macro |\subtitle| takes one argument and sets up the subtitle of
% your book, for example |\subtitle|\texttt{\{A Guide For
% Perplexed\}}.
%
% \DescribeMacro{\author}
% The command |\author| has just one argument, which is the list of
% authors, separated by commas and (for the last author) the word
% ``and''. Do not use the command |\and| defined in the standard
% \LaTeX. For example,
% |\author|\texttt{\{Ralph Alpher, Hans Bethe and George Gamow\}}.
%
% \DescribeMacro{\nostarchlogo}
% Due to copyright reasons the logo of \emph{No Starch Press} is not
% distribuded with the package. You should get the logo as a graphics
% file from the publishers and put in the directory where \LaTeX{} can
% find it (for example, the directory with the other sources of your
% book). The command |\nostarchlogo| has one argument: the name of
% the file, for example, |\nostarchlogo{biglogo.pdf}|.
% The file will be automatically scaled to the proper size.
%
% \DescribeMacro{\nostarchlocation}
% \emph{No Starch Press} books are usually published in San
% Francisco. If you need to change this setting, use
% |\nostarchlocation| declaration, for example,
% |\nostarchlocation|\texttt{\{San Francisco; London; Tokyo\}}.
%
%
%
%\subsubsection{Front Matter Directives}
%\label{sec:guide:directives}
%
%
%
% \DescribeMacro{\makehalftitle}
% The command |\makehalftitle| creates \emph{half title page.}
% This is normally the first page of the book.
%
% \DescribeMacro{\maketitle}
% The command |\maketitle| creates \emph{title page.} It uses logo
% and full title of the book.
%
% \DescribeMacro{copyrightpage}
% The copyright page is the \emph{verso} of the title page. It has
% information about copyright, edition history, the credits of the
% people who helped you to make the book, CIP information, etc. The
% exact contents of the copyright page differ from book to book.
% Therefore the class does not try to create this page automatically,
% and rather sets up the typographic style for arbitrary contents.
% For this purpose the environment |copyrigthtpage| is used. So just
% put the information provided by the publisher between
% |\begin{copyrightpage}| and |\end{copyrightpage}|. Use
% |\textbf{\sffamily title}| for the title of the book on the
% copyright line.
%
% \DescribeMacro{cipblock}
% One of important parts of the copyright page is \emph{CIP block.}
% It contains catalogue data for your book (CIP means Cataloguing in
% Publication, by the way). Again, the contents of this field will be
% provied by the publishers; you just need to put them inside
% |cipblock| environment, i.e. between |\begin{cipblock}| and
% |\end{cipblock}|. To make your life easier, this block is typeset
% verbatim, so line ends and spaces are typeset as is.
%
%
% \DescribeMacro{dedicationpage}
% Dedications, if any, are included in the special dedication page,
% for which a special environment |dedicationpage| is provided.
%
% \DescribeMacro{\brieftableofcontents}
% \DescribeMacro{\tableofcontents}
% The standard \LaTeX{} provides just one table of contents. This
% class uses two tables: brief contents and contents in detail. They
% are correspondingly typeset by the commands |\brieftableofcontents|
% and |\tableofcontents|.
%
%
% \DescribeMacro{\sectionnumberwidth}
% \DescribeMacro{\subsectionnumberwidth}
% In most books by \emph{No Starch Press} sections and subsections are
% unnumbered. However, sometimes the books use numbered sections or
% subsections. In these cases you may want to adjust the widths left
% for section and subsection numbers in the detailed table of
% contents. They are set by
% |\sectionnumberwidth| and |\subsectionnumberwidth|, and can be
% changed with the usual |\setlength| command.
%
%
% Forewords and similar front matter materials are unnumbered
% chapters: |\chapter*[Foreword by R. E.~Viewer]{Foreword}|.
%
%
% Front matter with its formal parts like copyright page, CIP
% information, etc., can be daunting, especially for novice authors.
% Feel free to use the sample enclosed and ask the publisher for
% advice.
%
%\subsection{Main Matter}
%\label{sec:guide:mainmatter}
%
% \DescribeMacro{\mainmatter}
% The command |\mainmatter| finishes the front matter and starts the
% main matter of the book. The main matter is divided into chapters,
% sections, subsections, etc. They are discussed below.
%
%
%\subsubsection{Parts, Chapters and Sections}
%\label{sec:guide:sections}
%
% \DescribeMacro{\chapter}
% \DescribeMacro{\section}
% \DescribeMacro{\subsection}
% \DescribeMacro{\subsubsection}
% \emph{No Starch Press} books have chapters, sections, subsections and
% subsubsections. The chapters are usually numbered, but sections ande
% below are not. The commands for them are the same as in the
% standard \LaTeX: |\chapter|\oarg{short title}\marg{long title},
% |\section|\oarg{short title}\marg{long title}, etc. For
% example:
% \begin{verbatim}
% \section[Building Lego Fire Track]{How To Build A Lego Fire Track
% And Why It Is Fun}
% \end{verbatim}
% The ``starred'' forms |\chapter*|, |\section*| etc. are used when
% the corresponding division has no number (like unnumbered chapters in
% the front matter). Since our sections, subsections and
% subsusbsections are unnumbered anyway, this form has meaning only
% for chapters (but can be used for other divisions as well).
%
% \DescribeMacro{\chapterart}
% \DescribeMacro{\chapterartfile}
% \emph{No Starch Press} books use ``circular art'' for chapter
% openings (except for unnumbered chapters in the front matter). The
% command |\chapterart| should be issued immediately
% after |\chapter| command and before the first paragraph. Its
% argument is the artwork used for the current chapter:
% |\chapterart|\marg{\LaTeX{} commands}. In the
% simplest case it is just inclusion of an external graphics file, for
% example:
% \begin{verbatim}
% \chapterart{\includegraphics[width=1.264in]{firetrack.jpg}}
% \end{verbatim}
% Actually, this simplest case is so ubiquitous, that there is a
% special command |\chapterartfile|\marg{filename} for it, so the
% previous example can be simplified as
% \begin{verbatim}
% \chapterartfile{firetrack.jpg}
% \end{verbatim}
% However, you can use instead any \LaTeX{} commands to produce
% the artwork. Rememer that it must be $1.264''\times1.222''$.
%
% The first paragraph after chapter start is typeset in larger size
% font than the body font. If this paragraph is too long, you may
% need to manually change the font size back in the middle of it. The
% simplest way to do this is the combination
% |\par\noindent\normalfont| in a strategic place.
%
%
% \DescribeMacro{\part}
% Sometimes larger books are separated into parts. The command
% |\part|\marg{Title} is used to typeset parts.
%
%\subsubsection{Environments}
%\label{sec:guide:lists}
%
%
% \DescribeMacro{itemize}
% \DescribeMacro{enumerate}
% \DescribeMacro{description}
% \DescribeMacro{aside}
% \DescribeMacro{note}
% \DescribeMacro{warning}
% The class offers standard |itemize|, |enumerate| and |description|
% environment. There are also special environments reserverd for
% asides. The |aside| environment has a mandatory argument: aside
% name. It typesets its contents in italics with the name in bold on
% the marginh:
% \begin{verbatim}
% \begin{aside}{Reminder}
% Do not forget to plug off the computer before doing any
% modifications!
% \end{aside}
% \end{verbatim}
% The environments |note| and |warning| are similar, but have
% pre-defined names NOTE and WARNING, e.g
% \begin{verbatim}
% \begin{note}
% Do not forget to plug off the computer before doing any
% modifications!
% \end{note}
% \begin{warning}
% Do not forget to plug off the computer before doing any
% modifications!
% \end{warning}
% \end{verbatim}
%
%
%\subsubsection{Tables and Figures}
%\label{sec:guide:floats}
%
% There are several things to keep in mind when using tables and
% figures with the class.
%
% The tables and figures are not centered. Neither are their
% captions. The captions for figures go \emph{below} the figures, the
% captions for tables go \emph{above} the tabular data.
%
% \DescribeMacro{\NextCaptionWidth}%
% The captions of tables and figures are automatically typeset with
% the same width as the table or figure. Sometimes, however, \LaTeX\
% makes a mistake in the calculation. In this case the macro
% \cs{NextCaptionWidth}\marg{length} overrides this calculation and
% sets the width of the caption for the next figure or table to
% \marg{length}, for example
% \begin{verbatim}
% \NextCaptionWidth{2in}
% \begin{figure}
% ...
% \caption{...}
% \end{figure}
% \end{verbatim}
%
%
% Typesetting tables, unfortunately, is rarely done right, and
% standard \LaTeX{} is not an exception. The authors are urged to
% read the introduction to \progname{booktabs}
% package~\cite{Fear05:Booktabs}. To summarize,
% \begin{enumerate}
% \item Never ever use vertical rules.
% \item Never ever use double rules.
% \item Use only |\toprule|, |\midrule| and |\bottomrule| for tables.
% \end{enumerate}
% \DescribeMacro{\tbfont}
% \DescribeMacro{\thfont}
% \DescribeMacro{tabular}
% \emph{No Starch Press} uses special fonts for table body and table
% header. Since there are too many tabular-like environments
% (|tabular|, |tabbing|, |longtable|, \dots) we do not redefine them
% switch on these fonts automatically, but rather provide two font
% switching commands. The command |\tbfont| should be used
% \emph{before} tabular environment, and the command |\thfont| should
% be used in all header cells. Also, usually the table entries are
% flushed left, so you might want to put |@{}| before the first column
% declaration in |\begin{tabular}| to suppress the padding on the
% left. Here is an example of a properly
% done table layout:
% \begin{verbatim}
% \begin{table}
% \caption{Starch Content of Foods}
% \label{tab:starch}
% \tbfont
% \begin{tabular}{@{}lr}
% \toprule
% \thfont Product & \thfont Starch Content, \% \\
% \midrule
% Bran (wheat) & 23.0\\
% Brown rice (raw) & 80.0\\
% Brown bread (average) & 41.3\\
% White bread (average) & 46.7\\
% \bottomrule
% \end{tabular}
% \end{table}
% \end{verbatim}
%
%
%
%\subsubsection{Code Fragments}
%\label{sec:guide:code}
%
% The class provides two facilities for including code fragments in
% the books.
%
% \DescribeMacro{Code}
% For short unformatted code fragments the \progname{fancyvrb}
% package~\cite{VanZandt98:Fancyvrb} facilities are recommended. This
% package is automatically automatically loaded by the class. Long code
% fragments should be
% separated by rules; the class defines verbatim-like |Code|
% environment, which does exactly this:
% \begin{verbatim}
% \begin{Code}
% main() {
% printf("Hello, World\n");
% }
% \end{Code}
% \end{verbatim}
% See the documentation of~\cite{VanZandt98:Fancyvrb} about many
% features of this package.
%
% For longer code fragments the \progname{listings}
% package~\cite{Heinz07:Listings} is more appropriate. It is also
% automatically loaded. This package provides a number of useful
% features, well describe in its manual. We will briefly mention
% several of them, which might be of interest for the authors of
% \emph{No Starch Press}:
% \begin{enumerate}
% \item Automatic code formatting according to the rules of the chosen
% program language (for example, |\lstset{language=C}| or
% |\lstset{language=Lisp}|).
% \item A rich set of different frames: ruled code with
% |frame=lines|, boxed code with |frame=single| etc.
% \item An option to add captions to the listings (the class
% automatically formats the captions according to the style of
% \emph{No Starch Press}).
% \item An option to make a listing floating.
% \item An option to automatically number code lines.
% \item An option to add list of listings (with the command
% |\lstlistoflistings|).
% \end{enumerate}
%
% To make the code in |\verb| commands and |verbatim|-like
% environments be typeset with the \progname{listings} package, you
% may want to set |fancyvrb=true| in the preamble of your document.
%
% It should be noted that the authors are recommended \emph{not} to
% use |\texttt| or |\tt| for inline code fragments. The proper way to
% add inline code is |\verb| or |\lstinline| from the
% \progname{listings} package. The difference is obvious, for
% example, in quote characters.
%
%
%\subsection{Boxes}
%\label{sec:ug_boxes}
%
% \DescribeEnv{nspbox}%
% You may put some information into \emph{boxes}. Boxes have a \emph{heading}
% and a \emph{text}. The environment |nspbox| can be used to typeset
% them, for example:
% \begin{verbatim}
% \begin{nspbox}{This is a heading}
% This is a text for the box.
% \end{nspbox}
% \end{verbatim}
%
%\subsection{Back Matter}
%\label{sec:guide:backmatter}
%
% \DescribeMacro{\backmatter}
% Back matter includes bibliography, index, update page, colophon and
% other material. It starts with the command |\backmatter|.
%
%
%
%\subsubsection{Bibliography}
%\label{sec:guide:bibliography}
%
% \emph{No Starch Press} at present has no special style for
% bibliography, so the authors have a relative freedom to choose one.
% However, it would be a good idea to use the \progname{natbib}
% package~\cite{Daly07:Natbib}. This class should work with
% \progname{natbib}.
%
% No support for per chapter bibliography lists is provided by the
% package.
%
%
%\subsubsection{Index}
%\label{sec:guide:index}
%
% The books published by \emph{No Starch Press} usually have index.
% This package provides special style file |nostarch.ist| for index
% formatting.
%
%
% \DescribeMacro{\makeindex}
% \DescribeMacro{\printindex}
% To create index:
% \begin{enumerate}
%
% \item Put in the preamble of your
% document the command |\makeindex|.
% \item In the body of your document use |\index| commands as
% described in~\cite{Lamport94}.
% \item Put in the Back Matter the command |\printindex| at the place
% you want the index to be printed.
% \item After a \progname{latex} run \progname{makeindex} with the
% style |nostarch.ist|. In a Unix system the corresponding command is
% \begin{verbatim}
% makeindex -s nostarch.ist mydocument
% \end{verbatim}
% or, in a more verbose way
% \begin{verbatim}
% makeindex -s nostarch.ist -o mydocument.ind mydocument.idx
% \end{verbatim}
% (here we assume that your main file is |mydocument.tex|).
%
% Refer to the documentation of your \TeX{} system for the way to run
% \progname{makeindex} on your computer.
% \end{enumerate}
%
%
%\subsubsection{Updates and Colophon}
%\label{sec:guide:updates}
%
% \DescribeMacro{\updatespage}
% \emph{No Starch Press} books usually have updates page, which lists
% the Web address for updates, errata, etc. The command
% |\updatespage| starts such page. You are free to choose any text
% there. Note that if you use the package
% \progname{nshypher}~\ref{sec:guide:hyperref}, then the command
% |\url|\marg{URL} becomes a hyperlink in the electronic edition.
%
%
% \DescribeMacro{\colophon}
% The last part of Back Matter is usually a \emph{colophon} which
% describes how the book was printed and typeset. The command
% |\colophon| starts this part and prints some standard information
% about your fonts and \LaTeX{} package. You may want to add some
% information after this command.
%
%
% \StopEventually{%
% \clearpage
% \bibliography{nostarch}
% \bibliographystyle{unsrt}}
%
% \clearpage
%
%
%\section{Implementation}
%\label{sec:impl}
%
%\subsection{Identification}
%\label{sec:ident}
%
% We start with the declaration who we are. Most |.dtx| files put
% driver code in a separate driver file |.drv|. We roll this code into the
% main file, and use the pseudo-guard |<gobble>| for it.
% \begin{macrocode}
%<class>\NeedsTeXFormat{LaTeX2e}
%<*gobble>
\ProvidesFile{nostarch.dtx}
%</gobble>
%<class>\ProvidesClass{nostarch}
%<nshyper>\ProvidesPackage{nshyper}
%<*!ist>
[2023/06/18 v2.3 Typesetting books for No Starch Press]
%</!ist>
% \end{macrocode}
%
% And the driver code:
% \begin{macrocode}
%<*gobble>
\documentclass{ltxdoc}
\usepackage{array}
\usepackage{url,amsfonts, tikz}
\usepackage[breaklinks,colorlinks,linkcolor=black,citecolor=black,
pagecolor=black,urlcolor=black,hyperindex=false]{hyperref}
\usetikzlibrary{positioning}
\PageIndex
\CodelineIndex
\RecordChanges
\EnableCrossrefs
\begin{document}
\DocInput{nostarch.dtx}
\end{document}
%</gobble>
%<*class>
% \end{macrocode}
%
%
%\subsection{Options}
%\label{sec:options}
%
%\begin{macro}{\ifnostarch@cfonts}
% First, let us decide whether we have non-free fonts:
% \begin{macrocode}
\newif\ifnostarch@cfonts
\nostarch@cfontstrue
\DeclareOption{cfonts}{\nostarch@cfontstrue}
\DeclareOption{nocfonts}{\nostarch@cfontsfalse}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ifnostarch@fontsdir}
% \changes{v2.0}{2023/03/31}{Introduced macro}
% We also need to check whether we want to use \emph{No Starch} in
% house |fonts| directory
% \begin{macrocode}
\newif\ifnostarch@fontsdir
\nostarch@fontsdirtrue
\DeclareOption{fontsdir}{\nostarch@fontsdirtrue}
\DeclareOption{nofontsdir}{\nostarch@fontsdirfalse}
% \end{macrocode}
% \end{macro}
%
% The size-changing options produce a warning:
% \begin{macrocode}
\long\def\nostarch@size@warning#1{%
\ClassWarning{nostarch}{Size-changing option #1 will not be
honored}}%
\DeclareOption{8pt}{\nostarch@size@warning{\CurrentOption}}%
\DeclareOption{9pt}{\nostarch@size@warning{\CurrentOption}}%
\DeclareOption{10pt}{\nostarch@size@warning{\CurrentOption}}%
\DeclareOption{11pt}{\nostarch@size@warning{\CurrentOption}}%
\DeclareOption{12pt}{\nostarch@size@warning{\CurrentOption}}%
% \end{macrocode}
%
%
%
% All other options are passed to \progname{book}:
% \begin{macrocode}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
% \end{macrocode}
%
% Now we read the configuration file
% \begin{macrocode}
\InputIfFileExists{nostarch.cfg}{%
\ClassInfo{nostarch}{%
Loading configuration file nostarch.cfg}}{%
\ClassInfo{nostarch}{%
Configuration file nostarch.cfg is not found}}
% \end{macrocode}
% And process the options:
% \begin{macrocode}
\ProcessOptions\relax
% \end{macrocode}
%
%
%
%
%
%\subsection{Loading Class and Packages}
%\label{sec:loading}
%
% We start with the base class
% \begin{macrocode}
\LoadClass[10pt]{book}
% \end{macrocode}
%
% A bunch of packages:
% \begin{macrocode}
\RequirePackage[table]{xcolor}
\RequirePackage{iftex, ifpdf, longtable,
fancyhdr, fancyvrb, booktabs, graphicx,
listings, caption, makeidx, upquote, pifont,
textcomp, xcolor, lmodern, nameref, float, amssymb, etoolbox,
setspace, marginnote, url, subfigure}
\RequirePackage[framemethod=TikZ]{mdframed}
\RequirePackage{soul}
\RequirePackage[T1]{fontenc}
\RequirePackage{ragged2e}
% \end{macrocode}
%
% We do not want the option |document| with \progname{ragged2e}: this
% calls \progname{footmisc}, while we want our own footnotes:
% \begin{macrocode}
\RequirePackage{ragged2e}
\setlength\RaggedRightParindent{\parindent}
\RaggedRight
% \end{macrocode}
%
%
% \begin{macro}{\@nschapterpreamble}
% This is the preamble to bibliography and index commands used when
% \progname{nshyper} is loaded. Normally it is empty.
% \begin{macrocode}
\def\@nschapterpreamble{}
% \end{macrocode}
%
% \end{macro}
%
%
%\subsection{Fonts}
%\label{sec:fonts}
%
% \begin{macro}{\nostarch@fontspath}
% \changes{v2.0}{2023/03/31}{Introduced macro}
% The path to load fonts
% \begin{macrocode}
\ifnostarch@fontsdir
\def\nostarch@fontspath#1{Path=fonts/#1/,}
\else
\def\nostarch@fontspath#1{Path,}
\fi
% \end{macrocode}
% \end{macro}
%
% If we have commercial fonts, we load them.
% \begin{macrocode}
\ifnostarch@cfonts
\ifpdftex
\ClassWarning{nostarch}{Commercial fonts usually require xelatex engine}
\RequirePackage{nbaskerv}%
\RequirePackage{futurans}%
\RequirePackage[scaled=0.85]{thsmc}%
\RequirePackage{dogma}%
\newcommand{\dogma}{\fontfamily{fdg}\selectfont}%
\else %XeTeX or LuaTeX
\RequirePackage{fontspec}
\newfontface\dogma[
\nostarch@fontspath{dogma}
UprightFont=dogmab01.ttf,
Ligatures=TeX
]{dogma} % Font used for chapter titles
\newfontface\timesnewroman[
\nostarch@fontspath{tnr}
UprightFont=times.ttf,
BoldFont=timesbd.ttf,
ItalicFont=timesi.ttf,
BoldItalicFont=timesbi.ttf,
Ligatures=TeX
]{timesnewroman}
\newfontface\futurabook[
\nostarch@fontspath{futurans}
UprightFont=FuturB37.ttf,
BoldFont=FuturH79.ttf,
ItalicFont=FutuBO08.ttf,
BoldItalicFont=FutCBO63.ttf,
Ligatures=TeX
]{futurabook}
\newfontface\futuraheavy[
\nostarch@fontspath{futurans}
UprightFont=FuturH79.ttf,
Ligatures=TeX
]{futuraheavy}
\newfontface\futuraboldc[
\nostarch@fontspath{futurans}
UprightFont=futucb18.ttf,
Ligatures=TeX
]{futuraboldc}
\newfontface\futuraboldcoblique[
\nostarch@fontspath{futurans}
UprightFont=FutCBO63.ttf,
Ligatures=TeX
]{futuraboldcoblique}
\newfontface\futuraoblique[
\nostarch@fontspath{futurans}
UprightFont=FutuBO08.ttf,
Ligatures=TeX
]{futuraoblique}
\setmainfont{nbaskerv}[
\nostarch@fontspath{nbaskerv}
UprightFont=NewBaskervilleEF-Roman.ttf,
BoldFont=NewBaskervilleEF-Bold.ttf,
ItalicFont=NewBaskervilleEF-RomanIta.ttf,
BoldItalicFont=NewBaskervilleEF-BoldIta.ttf,
Ligatures=TeX]
\setmonofont[Scale=0.85,
\nostarch@fontspath{thsmc}
UprightFont=ThSMCP25.ttf,
BoldFont=ThSMCB02.ttf,
ItalicFont=ThSMCI29.ttf,
BoldItalicFont=TSMCBI56.ttf]{thsmc}
\setsansfont[
\nostarch@fontspath{futurans}
UprightFont=futura.ttf,
BoldFont=FuturB41.ttf,
ItalicFont=FutuBO08.ttf,
BoldItalicFont=FutCBO63.ttf,
Ligatures=TeX
]{futurans}
\fi
% \end{macrocode}
% Otherwise we just use sans serif font for dogma.
% \begin{macrocode}
\else
\newcommand{\dgdefault}{\sfdefault}%
\fi
% \end{macrocode}
%
% A number of commands to provide font defaults in case we use
% non-commercial fonts
% \begin{macrocode}
\providecommand{\dogma}{\fontfamily{dgdefault}\selectfont}
\providecommand{\futuraboldc}{\fontfamily{\sfdefault}\fontseries{bc}%
\selectfont}
\providecommand{\futuraboldcoblique}{\fontfamily{\sfdefault}\fontseries{bc}%
\itshape\selectfont}
\providecommand{\futuraheavy}{\fontfamily{\sfdefault}\fontseries{hq}%
\selectfont}
\providecommand{\futurabook}{\fontfamily{\sfdefault}\fontseries{k}%
\selectfont}
% \end{macrocode}
%
% And switch to normal size---just in case
% \begin{macrocode}
\normalsize
% \end{macrocode}
%
% Special commands for number balls
% \begin{macro}{\wingding}
% \changes{v2.0}{2023/03/31}{Introduced macro}
% The number ball
% \begin{macrocode}
\newcommand{\wingding}[1]{\ding{\the\numexpr #1 + 181 \relax}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\codewingding}
% \changes{v2.0}{2023/03/31}{Introduced macro}
% The number ball inside code
% \begin{macrocode}
\newcommand{\codewingding}[1]{\vbox{\llap{\wingding{#1}\hskip 0.5em}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\menuarrow}
% \changes{v2.0}{2023/04/08}{Introduced macro}
% \begin{macrocode}
\newcommand\menuarrow{\raisebox{.2ex}{\small $\blacktriangleright$}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\bettertilde}
% \changes{v2.0}{2023/04/04}{Introduced macro}
% A tilde uses for some texts
% \begin{macrocode}
\newcommand{\bettertilde}{\raisebox{-1ex}{\textasciitilde}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\slashslash}
% \changes{v2.0}{2023/04/04}{Introduced macro}
% The special slash
% \begin{macrocode}
\newcommand{\slashslash}{%
\raisebox{.53ex}{%
\scalebox{.5}{%
\rotatebox[origin=c]{18}{$\mathbf{/}$}%
}%
}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\neq}
% \changes{v2.0}{2023/04/04}{Introduced macro}
% A better $\neq$
% \begin{macrocode}
\renewcommand{\neq}{\mathrel
{%
\vphantom{=}%
\ooalign{\kern.05em\smash{\slashslash}\hidewidth\cr$=$\cr}%
}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\keycap}
% Taken from:
% \url{https://tex.stackexchange.com/questions/55664/fake-small-caps-with-xetex-fontspec/225078}
% \begin{macrocode}
\newcommand\keycap[1]{\fauxschelper#1 \relax\relax}
\def\fauxschelper#1 #2\relax{%
\fauxschelphelp#1\relax\relax%
\if\relax#2\relax\else\ \fauxschelper#2\relax\fi%
}
\def\Hscale{.83}\def\Vscale{.72}\def\Cscale{1.00}
\def\fauxschelphelp#1#2\relax{%
\ifnum`#1>``\ifnum`#1<`\{\scalebox{\Hscale}[\Vscale]{\uppercase{#1}}\else%
\scalebox{\Cscale}[1]{#1}\fi\else\scalebox{\Cscale}[1]{#1}\fi%
\ifx\relax#2\relax\else\fauxschelphelp#2\relax\fi}
% \end{macrocode}
% \end{macro}
%
%\subsection{Page Dimensions and Paragraphing}
%\label{sec:page}
%
% \begin{macro}{\paperheight}
% \begin{macro}{\paperwidth}
% The trim size:
% \begin{macrocode}
\setlength{\paperheight}{9.25in}
\setlength{\paperwidth}{7in}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\pdfpaperheight}
% \begin{macro}{\pdfpaperwidth}
% \begin{macro}{\pdfvorigin}
% \begin{macro}{\pdfhorigin}
% If we deal with \progname{pdftex}, we can use this information more
% creatively. This was inspired by
% \progname{memoir}~\cite{Wilson04:Memoir}.
% \begin{macrocode}
\ifpdf\relax
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\pdfvorigin=1in
\pdfhorigin=1in
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\topmargin}
% \changes{v0.2}{2008/03/03}{Moved down}
% \changes{v0.7}{2008/04/04}{Changed dimensions}
% \changes{v1.1}{2008/05/24}{Made shorter}
% The top margin is 0.625''. We use fake headers of 12pt:
% \begin{macrocode}
\setlength\topmargin{0.625in}
\addtolength\topmargin{-1in}
\addtolength\topmargin{-12pt}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\textheight}
% This is the height of the text including footnotes, but excluding
% running head and foot.
% \begin{macrocode}
\setlength\textheight{8in}
\addtolength{\textheight}{-0.207in}
% \end{macrocode}
% Now we take care of the first line height:
% \begin{macrocode}
\addtolength\textheight{\topskip}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\evensidemargin}
% \begin{macro}{\oddsidemargin}
% The margins on even and odd pages are 0.687''+0.833'' (margin par
% width) + 0.167'' (margin par gap):
% \begin{macrocode}
\setlength\evensidemargin{0.687in}
\addtolength{\evensidemargin}{-1in}
\addtolength{\evensidemargin}{0.833in}
\addtolength{\evensidemargin}{0.167in}
\setlength\oddsidemargin{\evensidemargin}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\textwidth}
% The type area is 5.625'', but this includes side gap:
% \begin{macrocode}
\setlength\textwidth{5.625in}
\addtolength\textwidth{-0.833in}
\addtolength\textwidth{-0.167in}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\parindent}
% The paragraph indentation is 0.25'':
% \begin{macrocode}
\setlength\parindent{0.25in}
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macro}{\headheight}
% \begin{macro}{\headsep}
% We do not have headers in these books. Fancyhdr sets |headheight|
% to 12pt, so we compensate it above in |\topmargin|
% \begin{macrocode}
\setlength\headheight{12pt}
\setlength\headsep{0pt}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\footskip}
% The footer is 8.792'' from top
% \begin{macrocode}
\setlength{\footskip}{9in}
\addtolength{\footskip}{-\textheight}
\addtolength{\footskip}{0.067in}
\addtolength{\footskip}{\baselineskip}
\addtolength{\footskip}{-1in}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\widowpenalty}
% \begin{macro}{\clubpenalty}
% \changes{v0.3}{2008/03/11}{Changed settings}
% We forbid widows and clubs. To prevent too extended pages we use
% |\raggedbottom|:
% \begin{macrocode}
\widowpenalty=10000
\clubpenalty=10000
\raggedbottom
% \end{macrocode}
%
% \end{macro}
% \end{macro}
%
% \begin{macro}{\sochapter}
% \changes{v2.0}{2023/04/04}{Introduced macro}
% \begin{macro}{\sotitle}
% \changes{v2.0}{2023/04/04}{Introduced macro}
% \begin{macro}{\sobox}
% \changes{v2.0}{2023/04/04}{Introduced macro}
% \begin{macro}{\sonote}
% \changes{v2.0}{2023/04/04}{Introduced macro}
% Some spacing commands.
% \begin{macrocode}
\sodef\sochapter{}{.150em}{.5em}{1em}
\sodef\sotitle{}{.125em}{.5em}{1em}
\sodef\sobox{}{.075em}{.5em}{1em}
\sodef\sonote{}{.200em}{.5em}{1em}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%\subsection{Headers and Footers}
%\label{sec:headers}
%
%
% \begin{macro}{\headrulewidth}
% \begin{macro}{\footrulewidth}
% We do not want decorative rules:
% \begin{macrocode}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%
% We do not have headers:
% \begin{macrocode}
\pagestyle{fancy}
\lhead{}
\rhead{}
\chead{}
% \end{macrocode}
%
% The right footer is stuck 0.833''+0.167'' = 1'' to the right
% \begin{macrocode}
\fancyhfoffset[L]{1in}
% \end{macrocode}
%
% On even pages we put page number and chapter title in footer.
% \begin{macrocode}
\fancyfoot[RO]{\sffamily \fontsize{6pt}{6pt}%
\fontseries{lq}\selectfont\rightmark%
\hspace{2em} \futuraboldc \fontsize{9pt}{6pt}\selectfont\thepage}
\fancyfoot[LO]{}
\fancyfoot[CO]{}
% \end{macrocode}
%
% On even pages we put page number and chapter number in footer:
% \begin{macrocode}
\fancyfoot[LE]{\futuraboldc \fontsize{9pt}{6pt}%
\selectfont\thepage%
\fontseries{lq}\sffamily \fontsize{6pt}{6pt}\selectfont%
\hspace{2em}\leftmark}
\fancyfoot[RE]{}
\fancyfoot[CE]{}
% \end{macrocode}
%
%
%\subsection{Front Matter}
%\label{sec:frontmatter}
%
%
% \begin{macro}{\subtitle}
% \changes{v0.5}{2008/03/19}{Introduced the macro}
% We use subtitle of the book\dots
% \begin{macrocode}
\newcommand{\subtitle}[1]{\gdef\@subtitle{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@subtitle}
% \changes{v0.5}{2008/03/19}{Introduced the macro}
% \dots With empty default:
% \begin{macrocode}
\def\@subtitle{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\nostarchlogo}
% \changes{v0.5}{2008/03/19}{Introduced the macro}
% The logotype of the publisher:
% \begin{macrocode}
\newcommand{\nostarchlogo}[1]{\gdef\@nostarchlogo{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@nostarchlogo}
% \changes{v0.5}{2008/03/19}{Introduced the macro}
% The default it empty:
% \begin{macrocode}
\def\@nostarchlogo{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\nostarchlocation}
% \changes{v0.5}{2008/03/19}{Introduced the macro}
% Similarly for location:
% \begin{macrocode}
\newcommand{\nostarchlocation}[1]{\gdef\@nostarchlocation{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@nostarchlocation}
% \changes{v0.5}{2008/03/19}{Introduced the macro}
% The default is SF:
% \begin{macrocode}
\def\@nostarchlocation{San Francisco}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\makehalftitle}
% \changes{v0.5}{2008/03/19}{Introduced the macro}
% \changes{v0.7}{2008/04/04}{Changed dimensions}
% Now we are ready to typeset the half title page. It is flushed
% right, cannot be to the left of the page center and must be 0.25''
% indented from the right:
% \begin{macrocode}
\def\makehalftitle{%
\clearpage
{\pagestyle{empty}\cleardoublepage}%
\thispagestyle{empty}%
\null%\vskip1.025in%
\leavevmode\noindent\hspace{1.66in}%
\begin{minipage}[t]{2.5625in}%
\flushright
\sffamily\bfseries\fontsize{12\p@}{13\p@}\selectfont
\MakeUppercase{\@title}%
\end{minipage}}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{maketitle}
% \changes{v0.5}{2008/03/19}{Changed LaTeX default}
% \changes{v0.7}{2008/04/04}{Changed dimensions}
% Now the main title page:
% \begin{macrocode}
\def\maketitle{%
\bgroup
\clearpage
{\pagestyle{empty}\cleardoublepage}%
\thispagestyle{empty}%
\bgroup
\list{}{\leftmargin-1in\rightmargin\z@\labelwidth\z@%
\labelsep\z@\listparindent\z@\parsep\z@\itemsep\z@%
\topsep\z@\partopsep\z@}%
\item\relax
\centering
\null\vskip0.855in%
{\dogma \fontsize{36\p@}{37\p@}\selectfont
\MakeUppercase{\sotitle{\@title}}\par}%
\if\@subtitle\@empty\relax\else
{\null\vskip25\p@%
\dogma \fontsize{24\p@}{25\p@}\selectfont
\@subtitle\par}%
\fi
\vspace{2.15in}%
\vspace{-\baselineskip}%
{\futuraheavy\fontsize{18\p@}{22\p@}\selectfont
by \@author\par}%
\vspace{12\p@}%
\vspace{\baselineskip}%
\if\@nostarchlogo\@empty\relax\else
\includegraphics[height=1.08in]{\@nostarchlogo}\par
\fi
\vspace{12\p@}%
\normalfont\@nostarchlocation\par
\endlist
\egroup
\clearpage\egroup}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{copyrightpage}
% \changes{v0.5}{2008/03/19}{Introduced the macro}
% This is the page copyright data:
% \begin{macrocode}
\newenvironment{copyrightpage}{%
\clearpage
\bgroup
\list{}{\leftmargin-1in\rightmargin\z@\labelwidth\z@%
\labelsep\z@\listparindent\z@\parsep8\p@\itemsep\z@%
\topsep\z@\partopsep\z@}%
\item\relax
\thispagestyle{empty}%
\normalfont\fontsize{8\p@}{10\p@}\selectfont}{%
\endlist
\egroup
\clearpage}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{cipblock}
% \changes{v0.5}{2008/03/19}{Introduced the macro}
% CIP block is supposed to be in typewriter font. So we use
% verbatim:
% \begin{macrocode}
\newenvironment{cipblock}{%
\leavevmode\par\normalfont\fontsize{8\p@}{10\p@}\selectfont
\textit{Library of Congress Cataloging-in-Publication Data}\par%
\ttfamily\@vobeyspaces\obeylines
\parindent\z@\parfillskip\@flushglue\parskip\z@skip}{\par\vskip8pt\relax}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{dedicationpage}
% \changes{v0.5}{2008/03/19}{Introduced the macro}
% \changes{v2.0}{2023/04/04}{Rewritten}
% Dedication is centered:
% \begin{macrocode}
\newenvironment{dedicationpage}{%
\clearpage
\bgroup
\list{}{\leftmargin-1in\rightmargin\z@\labelwidth\z@%
\labelsep\z@\listparindent\z@\parsep8\p@\itemsep\z@%
\topsep\z@\partopsep\z@}%
\item\relax
\thispagestyle{empty}%
\null\vskip1.175in%
\centering\normalfont}{%
\endlist
\egroup
\clearpage}
% \end{macrocode}
% \end{macro}
%
%
%\subsection{Tables of Contents}
%\label{sec:toc}
%
% Standard \LaTeX{} has just one table of contents. We have two. The
% table of brief contents will have the extension |tbc|, while the
% standard table of contents will have the standard extension |toc|.
%
% \begin{macro}{\briefcontentsname}
% The name for brief contents
% \begin{macrocode}
\def\briefcontentsname{{Brief Contents}}
% \end{macrocode}
%
% \end{macro}
%
% \begin{macro}{\contentsname}
% Same with |\contentsname|
% \begin{macrocode}
\def\contentsname{Contents in Detail}%
% \end{macrocode}
% Special treatment if \progname{babel} is used:
% \begin{macrocode}
\AtBeginDocument{\@ifpackageloaded{babel}{%
\addto\captionsenglish{%
\renewcommand{\contentsname}%
{Contents in Detail}}}{}}
% \end{macrocode}
%
% \end{macro}
%
% \begin{macro}{\apptoc}
% \changes{v2.0}{2023/04/14}{Added macro}
% Changing chapter names in appendix
% \begin{macrocode}
\newcommand{\apptoc}{\renewcommand{\chaptername}{Appendix}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\brieftableofcontents}
% \changes{v0.5}{2008/03/19}{Introduced macro}
% \changes{v0.7}{2008/04/04}{Changed dimensions}
% \changes{v0.8}{2008/04/07}{Changed dimensions}
% \changes{v1.1}{2008/05/24}{Added toc name to the verso footers}
% This is the new macro:
% \begin{macrocode}
\newcommand\brieftableofcontents{%
\clearpage
{\pagestyle{empty}\cleardoublepage}%
\bgroup
\thispagestyle{empty}%
\markboth{\briefcontentsname}{\briefcontentsname}%
\null\vskip0.925in%
\list{}{\leftmargin-1.0in\rightmargin0.4in\labelwidth\z@%
\labelsep\z@\listparindent\z@\parsep\z@\itemsep\z@%
\topsep\z@\partopsep\z@}%
\item\relax
{\centering
\dogma\fontsize{16\p@}{18\p@}\selectfont
\MakeUppercase{\sochapter{Brief Contents}}\par}\vskip40pt%
\@starttoc{tbc}%
\endlist
\egroup}
% \end{macrocode}
%
% \end{macro}
% \begin{macro}{\tableofcontents}
% \changes{v0.5}{2008/03/19}{Changed LaTeX default}
% \changes{v0.7}{2008/04/04}{Changed dimensions}
% \changes{v0.8}{2008/04/07}{Changed dimensions}
% \changes{v1.1}{2008/05/24}{Added toc name to the verso footers}
% \changes{v1.2}{2008/06/01}{Added toc name to the verso footers}
% This is the new macro:
% \begin{macrocode}
\renewcommand\tableofcontents{%
\clearpage
{\pagestyle{empty}\cleardoublepage}%
\bgroup
\thispagestyle{empty}%
\markboth{\contentsname}{\contentsname}%
\null\vskip0.175in%
\list{}{\leftmargin-1.0in\rightmargin0.6in\labelwidth\z@%
\labelsep\z@\listparindent\z@\parsep\z@\itemsep\z@%
\topsep\z@\partopsep\z@}%
\item\relax
{\centering
\dogma\fontsize{16\p@}{18\p@}\selectfont
\MakeUppercase{\sochapter{Contents in Detail}}\par}\vskip18pt%
\@starttoc{toc}%
\endlist
\egroup}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@dotsep}
% \changes{v0.7}{2008/04/04}{Changed LaTeX default}
% \changes{v0.8}{2008/04/07}{Tightened dots}
% Standard \LaTeX{} provides 4.5 for the distance between dots. We
% will make this tighter:
% \begin{macrocode}
\renewcommand\@dotsep{1.5}
% \end{macrocode}
%
% \end{macro}
%
% \begin{macro}{\l@part}
% \changes{v0.5}{2008/03/19}{Changed LaTeX default}
% This is how we typeset parts in the table of contents
% \begin{macrocode}
\renewcommand*\l@part[2]{%
\ifnum \c@tocdepth >-2\relax
\addpenalty{-\@highpenalty}%
\addvspace{28\p@}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
\sffamily\bfseries\fontsize{12\p@}{14\p@}\selectfont
#1}\par
\nobreak
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\endgroup
\fi}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\l@chapter}
% \changes{v0.5}{2008/03/19}{Changed LaTeX default}
% This is how we typeset chapters in the table of contents
% \begin{macrocode}
\renewcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 20\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode
\sffamily \bfseries \fontsize{10\p@}{12\p@}\selectfont{#1}%
\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\vskip4\p@\penalty\@highpenalty
\endgroup
\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\sectionnumberwidth}
% \changes{v1.3}{2008/06/06}{Introduced the length}
% The number width for sections. Normally the width of |99.99|
% \begin{macrocode}
\newlength{\sectionnumberwidth}
\settowidth{\sectionnumberwidth}{%
\futurabook\fontsize{9\p@}{11\p@}\selectfont
99.99}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\boldsectionnumberwidth}
% \changes{v2.0}{2023/04/06}{Introduced the length}
% The number width for bold sections. Normally the width of |99.99|
% \begin{macrocode}
\newlength{\boldsectionnumberwidth}
\settowidth{\boldsectionnumberwidth}{%
\futuraheavy\fontsize{9\p@}{11\p@}\selectfont
99.99}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\subsectionnumberwidth}
% \changes{v1.3}{2008/06/06}{Introduced the length}
% The number width for subsections. Normally the width of
% |99.99.99|
% \begin{macrocode}
\newlength{\subsectionnumberwidth}
\settowidth{\subsectionnumberwidth}{%
\futurabook\fontsize{9\p@}{11\p@}\selectfont
99.99.99}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l@section}
% \changes{v0.5}{2008/03/19}{Changed LaTeX default}
% \changes{v1.3}{2008/06/06}{Made number width user settable}
% This is how we typeset sections in the table of contents
% \begin{macrocode}
\renewcommand{\l@section}[2]{\@dottedtocline{1}{\z@}{%
\sectionnumberwidth}{%
\futurabook\fontsize{9\p@}{11\p@}\selectfont#1}{%
\futurabook\fontsize{9\p@}{11\p@}\selectfont#2}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l@subsection}
% \changes{v0.5}{2008/03/19}{Changed LaTeX default}
% \changes{v1.1}{2008/05/24}{Changed numwidth}
% \changes{v1.2}{2008/06/01}{Changed numwidth again}
% \changes{v1.3}{2008/06/06}{Made number width user settable}
% This is how we typeset subsections in the table of contents
% \begin{macrocode}
\renewcommand{\l@subsection}[2]{\@dottedtocline{2}{0.5in}%
{\subsectionnumberwidth}{%
\futurabook\fontsize{9\p@}{11\p@}\selectfont#1}{%
\futurabook\fontsize{9\p@}{11\p@}\selectfont#2}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l@boldsection}
% \changes{v2.0}{2023/04/06}{Introduced the macro}
% This is how we typeset bold sections in the table of contents
% \begin{macrocode}
\newcommand*\l@boldsection[2]{{\bfseries\@dottedtocline{1}{\z@}{%
\boldsectionnumberwidth}{%
\futuraheavy\fontsize{9\p@}{11\p@}\selectfont#1}{%
\futuraheavy\fontsize{9\p@}{11\p@}\selectfont#2}}}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\l@bpart}
% \changes{v0.6}{2008/03/21}{Introduced macro}
% There is a special formatting of parts in the brief table of
% contents:
% \begin{macrocode}
\newcommand*\l@bpart[2]{%
\ifnum \c@tocdepth >-2\relax
\addpenalty{-\@highpenalty}%
\addvspace{14\p@}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
\futuraheavy\fontsize{9\p@}{14\p@}\selectfont
#1}\par\vskip7\p@%
\nobreak
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\endgroup
\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@pnumwidth}
% \changes{v2.0}{2023/04/08}{Redefined macro}
% \begin{macrocode}
\renewcommand{\@pnumwidth}{17pt}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l@bchapter}
% \changes{v0.6}{2008/03/21}{Introduced macro}
% There is a special formatting of chapters in the brief table of
% contents:
% \begin{macrocode}
\newcommand*\l@bchapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode
\futurabook\fontsize{9\p@}{14\p@}\selectfont
#1\nobreak\leaders\hbox{$\m@th
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
mu$}\hfill
\nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi}
% \end{macrocode}
% \end{macro}
%
%
%\subsection{Main Matter}
%\label{sec:mainmatter}
%
% \begin{macro}{\mainmatter}
% \changes{v0.6}{2008/03/19}{Changed LaTeX default}
% We redefine |\mainmatter| to take care of that blank verso
% page\dots
% \begin{macrocode}
\renewcommand\mainmatter{%
\clearpage
{\thispagestyle{empty}\cleardoublepage}%
\@mainmattertrue
\pagenumbering{arabic}}
% \end{macrocode}
% \end{macro}
%
%
%\subsection{Back Matter}
%\label{sec:backmatter}
%
% \begin{macro}{\backmatter}
% \changes{v0.6}{2008/03/21}{Changed LaTeX default}
% We redefine |\backmatter| to take care of that blank verso
% page\dots
% \begin{macrocode}
\renewcommand\backmatter{%
\clearpage
{\thispagestyle{empty}\cleardoublepage}%
\@mainmatterfalse}
% \end{macrocode}
% \end{macro}
%
%
%\subsection{Sectioning}
%\label{sec:sectioning}
%
% We do not number sections and below:
% \begin{macrocode}
\setcounter{secnumdepth}{0}
% \end{macrocode}
%
% \begin{macro}{\sectionmark}
% Our section commands do not mark:
% \begin{macrocode}
\def\sectionmark#1{}%
% \end{macrocode}
% \end{macro}
%
%
% Chapters, unlike the ones in~\cite{classes}, have \emph{two} obligatory
% arguments. The second argument is the command to fill the ``circular
% graphics''. Otherwise we follow the design in~\cite{classes}. One
% problem, however: we \emph{cannot} use |\secdef| because we have
% three arguments, not two.
%
%
% \begin{macro}{\if@firstpara}
% We introduce a macro to get special typesetting for the first
% paragraph after a part or a chapter begins:
% \begin{macrocode}
\newif\if@firstpara
\@firstparafalse
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\turnoffbigpara}
% \changes{v2.0}{2023/04/01}{Introduced macro}
% And the code to manually turn it off
% \begin{macrocode}
\newcommand{\turnoffbigpara}{\@firstparafalse}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@chapterart}
% We also keep track of the current artwork for chapter start:
% \begin{macrocode}
\def\@chapterart{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\secdef}
% \changes{v0.6}{2008/03/21}{Changed LaTeX default}
% The standard \LaTeX{} |secdef| assumes that starred commands have no
% optional argument. This is not right for us:
% \begin{macrocode}
\def\secdef#1#2{\@ifstar{\@dblarg{#2}}{\@dblarg{#1}}}
% \end{macrocode}
%
% \end{macro}
%
%
% \begin{macro}{\part}
% \changes{v0.5}{2008/03/16}{Changed LaTeX default}
% Our parts differ from the ones in standard LaTeX since we use empty
% pagestyle rather than plain in part pages. The trick with
% |\cleardoublepage| is from~\cite{Oostrum04:Fancyhdr}
% \begin{macrocode}
\renewcommand\part{%
\clearpage
{\pagestyle{empty}\cleardoublepage}%
\everypar{}%
\markboth{}{}%
\def\@chapterart{}%
\thispagestyle{empty}%
\null\vskip0.715in%
\secdef\@part\@spart}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@part}
% \changes{v0.5}{2008/03/16}{Changed LaTeX default}
% \changes{v0.7}{2008/04/04}{Changed dimensions}
% This code is used when we have a numbered part.
% \begin{macrocode}
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
\addcontentsline{toc}{part}{\MakeUppercase{\partname}
\thepart\protect\linebreak\penalty\@highpenalty\MakeUppercase{#1}}%
\addcontentsline{tbc}{bpart}{\MakeUppercase{\partname~\thepart: \futuraheavy #1}}%
\else
\addcontentsline{toc}{part}{\MakeUppercase{#1}}%
\addcontentsline{tbc}{bpart}{\MakeUppercase{\futuraheavy #1}}%
\fi
{\centering
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >-2\relax
\futuraboldc\fontsize{80pt}{80pt}\selectfont
\MakeUppercase{\partname\nobreakspace\thepart}%
\par
\vskip 0.45in%
\fi
\dogma \fontsize{16pt}{16pt}\selectfont
\MakeUppercase{\sochapter{#2}}\par}%
\@endpart}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@spart}
% \changes{v0.5}{2008/03/16}{Changed LaTeX default}
% This is used for starred parts (probably not something we are
% going to encounter\dots)
% \begin{macrocode}
\def\@spart[#1]#2{%
\addcontentsline{toc}{part}{\MakeUppercase{#1}}%
\addcontentsline{tbc}{bpart}{\MakeUppercase{#1}}%
{\centering
\dogma \fontsize{16pt}{16pt}\selectfont
\MakeUppercase{\sochapter{#2}}\par}%
\@endpart}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@endpart}
% \changes{v0.5}{2008/03/16}{Changed LaTeX default}
% When part is finished, we change the settings of the first paragraph:
% \begin{macrocode}
\def\@endpart{%
\@afterindentfalse
\vskip49\p@%
\@firstparatrue
\@afterheading}
% \end{macrocode}
%
% \end{macro}
%
% \begin{macro}{\chapter}
% \changes{v0.6}{2008/03/21}{Reverted to standard interface}
% First, we suppress floats, set up empty page style and delete
% indentation after the chapter. Then we check whether the chapter is
% starred:
% \begin{macrocode}
\def\chapter{%
\clearpage
{\pagestyle{empty}\cleardoublepage}%
\everypar{}%
\thispagestyle{empty}%
\global\@topnum\z@
\@afterindentfalse
\gdef\@chapterart{}%
\secdef\@chapter\@schapter}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@chapter}
% \changes{v0.2}{2008/03/04}{Moved up}
% \changes{v0.6}{2008/03/21}{Reverted to standard interface}
% \changes{v1.3}{2008/06/06}{Corrected a stupid mistake: put
% refstepcounter out of a group}
% The actual work is done by |\@chapter| macro.
% \begin{macrocode}
\def\@chapter[#1]#2{%
\vspace*{0.622in}
\ifnum \c@secnumdepth > \m@ne
\refstepcounter{chapter}%
\typeout{Chapter:\thechapter\space\@currentlabel}%
\markboth{\@chapapp~\thechapter}{#1}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}{\thechapter%
\protect\linebreak\penalty\@highpenalty
\MakeUppercase{#1}}%
\addcontentsline{tbc}{bchapter}{%
\chaptername~\thechapter:~#1}%
{\centering
\futuraboldc\fontsize{120pt}{120pt}
\selectfont
\thechapter\par\nobreak\vskip27pt}%
\else
\addcontentsline{toc}{chapter}{%
\MakeUppercase{#1}}%
\addcontentsline{tbc}{bchapter}{#1}%
\markboth{#1}{#1}%
\fi
{\centering
\dogma\fontsize{16pt}{18pt}\selectfont
\MakeUppercase{\sochapter{#2}}\par}\nobreak\vskip25pt\relax%
\@firstparatrue
\@afterheading}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@schapter}
% \changes{v0.6}{2008/03/21}{Reverted to standard interface}
% \changes{v0.7}{2008/04/04}{Changed dimensions}
% This is used when we have a starred chapter:
% \begin{macrocode}
\def\@schapter[#1]#2{%
\vspace*{2.747in}
{\centering
\phantomsection
\addcontentsline{toc}{chapter}{%
\MakeUppercase{#1}}%
\addcontentsline{tbc}{bchapter}{#1}%
\markboth{#1}{#1}%
{\fontsize{16pt}{18pt}\selectfont
\MakeUppercase{\dogma \sochapter{#2}}\par}}\nobreak\vskip25pt\relax%
\@firstparatrue
\@afterheading}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@afterheading}
% \changes{v0.3}{2008/03/12}{Moved the circle art}
% \changes{v0.4}{2008/03/14}{Added special treatment for the case of
% empty chapter art}
% \changes{v0.7}{2008/04/04}{Changed dimensions}
% We cannot use the standard |\@afterheading| since we want to put the
% first paragraph in larger font and put there the artwork. So we
% take |\@afterheading| code and patch it:
% \begin{macrocode}
\def\@afterheading{%
\@nobreaktrue
\everypar{%
\if@nobreak
\@nobreakfalse
\clubpenalty \@M
\setbox\z@\lastbox
\else
\clubpenalty \@clubpenalty
\everypar{}%
\fi
\if@firstpara
% \end{macrocode}
% The first paragraph has a special font and artwork in the beginning:
% \begin{macrocode}
\rule{\z@}{49\p@}%
\ifx\@chapterart\@empty%
\else
\makebox[0pt][r]{\raisebox{-0.5in}[0pt][0pt]{%
\@chapterart\hspace{0.21in}}}%
\parshape=5
0.963in 3.622in
0.913in 3.672in
0.813in 3.772in
0.563in 4.022in
0in \textwidth
\fi
\fontsize{14pt}{16.5pt}\selectfont%
\parskip=3pt
\else
\parskip=0pt
\normalsize\selectfont
\fi
\@firstparafalse}}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\chapterwithquote}
% \changes{v2.0}{2023/04/08}{Introduced the command}
% \begin{macrocode}
\def\chapterwithquote{%
\clearpage
{\pagestyle{empty}\cleardoublepage}%
\everypar{}%
\thispagestyle{empty}%
\global\@topnum\z@
\@afterindentfalse
\gdef\@chapterart{}%
\secdef\@chapterwithquote\@schapter}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@chapterwithquote}
% \changes{v2.0}{2023/04/08}{Introduced the command}
% \begin{macrocode}
\def\@chapterwithquote[#1]#2#3#4{%
\vspace*{0.622in}
\ifnum \c@secnumdepth > \m@ne
\refstepcounter{chapter}%
\typeout{Chapter:\thechapter\space\@currentlabel}%
\markboth{\@chapapp~\thechapter}{#1}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}{\thechapter%
\protect\linebreak\penalty\@highpenalty
\MakeUppercase{#1}}%
\addcontentsline{tbc}{bchapter}{%
\chaptername~\thechapter:~#1}%
{\centering
\futuraboldc\fontsize{120pt}{120pt}
\selectfont
\thechapter\par\nobreak\vskip27pt}%
\else
\addcontentsline{toc}{chapter}{%
\MakeUppercase{#1}}%
\addcontentsline{tbc}{bchapter}{#1}%
\markboth{#1}{#1}%
\fi
{\centering
\dogma\fontsize{16pt}{18pt}\selectfont
\MakeUppercase{\sochapter{#2}}\par\vspace{.1in}\normalfont\fontsize{9pt}{11pt}\selectfont\textit{#3}\par\textit{\textemdash#4}\par}\nobreak\vskip25pt\relax%
\@firstparatrue
\@afterheading}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\chapterart}
% \changes{v0.6}{2008/03/21}{Introduced the command}
% This creates the chapterart:
% \begin{macrocode}
\newcommand{\chapterart}[1]{\gdef\@chapterart{#1}}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\chapterartfile}
% \changes{v0.6}{2008/03/21}{Introduced the command}
% The simplified version of |\chapterart|:
% \begin{macrocode}
\newcommand{\chapterartfile}[1]{\gdef\@chapterart{%
\includegraphics[width=1.264in]{#1}}}%
% \end{macrocode}
%
% \end{macro}
%
%
% \begin{macro}{\section}
% \changes{v0.3}{2008/03/09}{Changed indentation}
% Sections correspond to |HeadA| in our specs. We use |\everypar{}|
% in case section starts just after chapter start.
% \begin{macrocode}
\renewcommand{\section}{\everypar{}%
\@startsection{section}{1}{-0.75in}{16pt}{6pt}{%
\sffamily \bfseries \fontsize{12pt}{16pt}\selectfont}}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subsection}
% Subsections correspond to |HeadB| in our specs:
% \begin{macrocode}
\renewcommand{\subsection}{\everypar{}%
\@startsection{subsection}{2}{0pt}{14pt}{4pt}{%
\futuraboldcoblique
\fontsize{12pt}{17pt}\selectfont}}%
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\subsubsection}
% Subsubsections correspond to |HeadC| in our specs:
% \begin{macrocode}
\renewcommand{\subsubsection}{\everypar{}%
\@startsection{subsubsection}{3}{0pt}{10pt}{2pt}{%
\futuraboldc \fontsize{10pt}{14pt}%
\selectfont}}%
% \end{macrocode}
% \end{macro}
%
% We do not redefine levels below, leaving the options
% from~\cite{classes} in place.
%
%
%
%\subsection{Lists}
%\label{sec:lists}
%
% This follows design of~\cite{classes} with the values from our
% specifications:
% \begin{macro}{\leftmargin}
% \begin{macro}{\leftmargini}
% \begin{macro}{\leftmarginii}
% \begin{macro}{\leftmarginiii}
% \begin{macro}{\leftmarginiv}
% The host of |\leftmargin| commands:
% \begin{macrocode}
\setlength{\leftmargin}{0.25in}
\setlength{\leftmargini}{0.25in}
\setlength{\leftmarginii}{0.25in}
\setlength{\leftmarginiii}{0.25in}
\setlength{\leftmarginiv}{0.25in}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\rightmargin}
% Right margin is always zero:
% \begin{macrocode}
\setlength{\rightmargin}{0pt}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@listi}
% \begin{macro}{\@listI}
% This is the default list on the first level
% \begin{macrocode}
\def\@listi{\leftmargin\leftmargini
\labelwidth\leftmargini\relax
\advance\labelwidth-\labelsep\relax
\parsep0\p@\relax
\topsep6\p@\relax
\itemsep4\p@\relax}
\let\@listI\@listi
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@listii}
% \begin{macro}{\@listiii}
% \begin{macro}{\@listiv}
% \begin{macro}{\@listv}
% \begin{macro}{\@listvi}
% And the lists for the next levels:
% \begin{macrocode}
\def\@listii{\leftmargin\leftmarginii
\labelwidth\leftmarginii
\advance\labelwidth-\labelsep
\parsep0\p@\relax
\topsep0\p@\relax
\itemsep0\p@\relax}
\def\@listiii{\leftmargin\leftmarginiii
\labelwidth\leftmarginiii
\advance\labelwidth-\labelsep
\parsep0\p@\relax
\topsep0\p@\relax
\itemsep0\p@\relax}
\def\@listiv{\leftmargin\leftmarginiv
\labelwidth\leftmarginiv
\advance\labelwidth-\labelsep
\parsep0\p@\relax
\topsep0\p@\relax
\itemsep0\p@\relax}
\def\@listv{\leftmargin\leftmarginv
\labelwidth\leftmarginv
\advance\labelwidth-\labelsep
\parsep0\p@\relax
\topsep0\p@\relax
\itemsep0\p@\relax}
\def\@listvi{\leftmargin\leftmarginvi
\labelwidth\leftmarginvi
\advance\labelwidth-\labelsep
\parsep0\p@\relax
\topsep0\p@\relax
\itemsep0\p@\relax}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{itemize}
% \changes{v0.2}{2008/03/03}{Flush left bullets}
% We make bullets flushleft:
% \begin{macrocode}
\def\itemize{%
\ifnum \@itemdepth >\thr@@\@toodeep\else
\advance\@itemdepth\@ne
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
\expandafter
\list
\csname\@itemitem\endcsname
{\def\makelabel##1{##1}}%
\fi}
% \end{macrocode}
%
% \end{macro}
%
% \begin{macro}{enumerate}
% \changes{v0.2}{2008/03/03}{Flush left numbers}
% We make numbering flushleft:
% \begin{macrocode}
\def\enumerate{%
\ifnum \@enumdepth >\thr@@\@toodeep\else
\advance\@enumdepth\@ne
\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
\expandafter
\list
\csname label\@enumctr\endcsname
{\usecounter\@enumctr\def\makelabel##1{##1}}%
\fi}
% \end{macrocode}
%
% \end{macro}
%
% \begin{macro}{description}
% \changes{v2.0}{2023/04/08}{Redefined}
% \begin{macrocode}
\renewenvironment{description}%
{\list{}{\labelwidth=0pt \leftmargin=18pt
\let\makelabel\descriptionlabel}}
{\endlist}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{quotation}
% In |quotation| environment the paragraphs are indented. We use
% 9pt Roman for quotations:
% \begin{macrocode}
\renewenvironment{quotation}{%
\list{}{\listparindent\parindent\relax
\itemindent\listparindent\relax
\rightmargin0.5in\relax
\leftmargin0.5in\relax}%
\item\fontsize{9pt}{11pt}\selectfont}{\endlist}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{quote}
% Quote is for short quotations without indentations:
% \begin{macrocode}
\renewenvironment{quote}{%
\list{}{\listparindent0pt\relax
\itemindent\listparindent\relax
\rightmargin0.5in\relax
\leftmargin0.5in\relax}%
\item\fontsize{9pt}{11pt}\selectfont}{\endlist}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\aside}
% \changes{v2.2}{2023/06/10}{Added macro}
% An environment for asides. Italics with the name (the mandatory
% arg) on the margin
% \begin{macrocode}
\newenvironment{aside}[1]{%
\list{\makebox[0pt][r]{\dogma \fontsize{7.5pt}{12pt}
\colorbox{black}{\textcolor{white}{\sonote{#1}}}\hspace{2em}}}{\listparindent0pt\relax
\topsep9\p@\relax
\itemindent0\p@\relax
\rightmargin0\p@\relax
\leftmargin0\p@\relax
\labelwidth0\p@\relax
\labelsep0\p@}%
\item\itshape}{\vspace{-3pt}\endlist}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\note}
% \changes{v2.2}{2023/06/10}{Redefined using generic}
% Note is in italics with
% the word ``NOTE'' on the margin:
% \begin{macrocode}
\newenvironment{note}{\begin{aside}{NOTE}}{\end{aside}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\warning}
% \changes{v2.2}{2023/06/10}{Defined using generic}
% Warning is in italics with
% the word ``WARNING'' on the margin:
% \begin{macrocode}
\newenvironment{warning}{\begin{aside}{WARNING}}{\end{aside}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{plainlist}
% \changes{v2.0}{2023/04/08}{Added macro}
\newenvironment{plainlist}{%
\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textbf{##1}} % Add em space to description label
\begin{description}%
}{%
\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textbf{##1 \quad}} % Add em space to description label
\end{description}%
}
% \end{macro}
%
%\subsection{Footnotes}
%\label{sec:footnotes}
%
% \begin{macro}{\footnoterule}
% \changes{v0.3}{2008/03/11}{Increased kern above the rule}
% \changes{v1.1}{2008/06/01}{Increased kern below the rule}
% We want one inch by 0.25 footnote rule:
% \begin{macrocode}
\renewcommand\footnoterule{%
\kern6\p@
\hrule height 0.25pt depth 0pt width 1in
\kern2\p@}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@footnotetext}
% \changes{v0.3}{2008/03/11}{Changed LaTeX default}
% We want 4pt between footnotes. Unfortunately the standard
% functions introduces |\@finalstrut|, which we do not need
% here\dots
% \begin{macrocode}
\long\def\@footnotetext#1{\insert\footins{%
\reset@font\footnotesize
\interlinepenalty\interfootnotelinepenalty
\splittopskip\footnotesep
\splitmaxdepth \dp\strutbox \floatingpenalty \@MM
\hsize\columnwidth \@parboxrestore
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\@thefnmark
}%
\color@begingroup
\@makefntext{%
\rule\z@{13.5pt}\ignorespaces#1}%
\color@endgroup}}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\footins}
% \changes{v0.3}{2008/03/11}{Changed LaTeX defaults}
% We make some space between footnotes:
% \begin{macrocode}
\setlength{\skip\footins}{20\p@ \@plus 4\p@ \@minus 0\p@}
% \end{macrocode}
%
% \end{macro}
%
%
% \begin{macro}{\@makefntext}
% \changes{v1.1}{2008/05/24}{Added space between footnote mark and
% footnote text}
% We do not indent the footnotes:
% \begin{macrocode}
% \renewcommand\@makefntext[1]{%
% \parindent 0\p@%
% \RaggedRightParindent0\p@%
% \noindent
% \@makefnmark\space#1}
\renewcommand\@makefntext[1]{%
\@thefnmark.~#1}
% \end{macrocode}
% \end{macro}
%
%
%\subsection{Tables, Figures and Listings}
%\label{sec:tbl_fig}
%
% \begin{macro}{\thefigure}
% We want dash instead of dot between chapter number and figure
% number:
% \begin{macrocode}
\renewcommand \thefigure
{\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@figure}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thetable}
% We want dash instead of dot between chapter number and table
% number:
% \begin{macrocode}
\renewcommand \thetable
{\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@table}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thelistings}
% \changes{v1.4}{2020/04/24}{Added \cs{AtBeginDocument}}
% And the same for listings. Note that listings package uses
% \cs{AtBeginDocument}, so we need to postpone this
% \begin{macrocode}
\AtBeginDocument{%
\renewcommand \thelstlisting
{\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@lstlisting}%
}
% \end{macrocode}
% \end{macro}
%
% Default listings settings
% \begin{macrocode}
\lstset{
frame = lines,
showstringspaces=false,
tabsize=4,
title=\lstname,
numbers = none,
caption={},
literate={\ }{{\ }}1{"}{\textquotedbl}1,
escapeinside={(@}{@)},
captionpos=b,
basicstyle=\ttfamily,
columns=fullflexible,
moredelim=[is][\bfseries]{***}{***},
moredelim=[is][\itshape]{___}{___},
moredelim=[is][\bfseries\itshape]{&&&}{&&&},
aboveskip=8pt,
}
% \end{macrocode}
%
% \begin{macro}{codewide}
% \changes{v2.0}{2023/4/08}{Added environment}
% \begin{macrocode}
\lstnewenvironment
{codewide}[1][]
{
\renewcommand{\codewingding}[1]
{\ding{\the\numexpr ##1 + 181 \relax}}
\captionsetup[lstlisting]{font=nostarchfigfont,singlelinecheck=off,
aboveskip=4pt, belowskip=-12pt, margin=-70pt}
\lstset{
frame = lines,
showstringspaces=false,
tabsize=4,
title=\lstname,
numbers = none,
literate={\ }{{\ }}1{"}{\textquotedbl}1,
escapeinside={(@}{@)},
captionpos=b,
caption={},
basicstyle=\ttfamily,
columns=fullflexible,
moredelim=[is][\bfseries]{***}{***},
moredelim=[is][\itshape]{___}{___},
moredelim=[is][\bfseries\itshape]{&&&}{&&&},
xleftmargin=-70pt,
aboveskip=8pt,
#1
}}
{
\renewcommand{\codewingding}[1]
{\vbox{\llap{\wingding{#1}\hskip 0.5em}}}
\captionsetup[lstlisting]{font=nostarchfigfont,singlelinecheck=off,
aboveskip=4pt, belowskip=0pt, margin=0pt}}
% \end{macrocode}
% \end{macro}
%
% Setting up longtables
% \begin{macrocode}
\def\LTleft{\z@}
\def\LTright{\fill}
% \end{macrocode}
%
% \begin{macro}{\ifnostarch@overridecaptionwidth}
% \changes{v2.1}{2023/04/09}{Introduced macro}
% Whether the user wants to override automatically selected caption
% width
% \begin{macrocode}
\newif\ifnostarch@overridecaptionwidth
\nostarch@overridecaptionwidthfalse
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\nostarch@captionwidth}
% \changes{v2.1}{2023/04/09}{Introduced macro}
% The width of the caption. Either set by the user or measured
% \begin{macrocode}
\newlength\nostarch@captionwidth
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NextCaptionWidth}
% \changes{v2.1}{2023/04/09}{Introduced macro}
% A user-level command to set the caption width
% \begin{macrocode}
\newcommand\NextCaptionWidth[1]{%
\global\nostarch@overridecaptionwidthtrue
\global\setlength{\nostarch@captionwidth}{#1}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\nostarch@measurecaptionwidth}
% \changes{v2.1}{2023/04/09}{Introduced macro}
% We set \cs{nostarch@captionwidth} to the width of the last box
% unless the flag \cs{ifnostarch@overridecaptionwidth} is set. At the
% end we set the flag to false.
% \begin{macrocode}
\newcommand\nostarch@measurecaptionwidth{%
\ifnostarch@overridecaptionwidth\else
\par
\setbox\@tempboxa\lastbox
\setbox\@tempboxa=\hbox{\unhbox\@tempboxa}%
\global\setlength{\nostarch@captionwidth}{\wd\@tempboxa}%
\box\@tempboxa\par
\fi
\global\nostarch@overridecaptionwidthfalse
}
% \end{macrocode}
% \end{macro}
%
% We measure the width at the begin of the figure caption. Note that
% the cs{AtBeginCaption} hook is too late for us.
% \begin{macrocode}
\AtBeginDocument{%
\pretocmd{\caption}{\def\@tempa{figure}%
\ifx\@tempa\@captype\relax
\nostarch@measurecaptionwidth
\fi}{}{}}
% \end{macrocode}
%
%
% We declare the caption format for figures and tables
% \begin{macrocode}
\DeclareCaptionFormat*{nostarchfigtblformat}{%
\parbox{\nostarch@captionwidth}{#1#2#3}}
% \end{macrocode}
%
% Tables are more complex, because captions are \emph{before} the
% tables. Therefore we need to write the width into aux file and read
% it from there. Most of the ideas here are stolen from
% \textsl{longtable} code.
%
% \begin{macro}{\nostarch@tbl@warn}
% \changes{v2.1}{2023/04/10}{Introduced macro}
% Whether to ask the user for rerun due to changed widths
% \begin{macrocode}
\def\nostarch@tbl@warn{}
\AtEndDocument{\nostarch@tbl@warn}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\c@nostarch@tbl}
% \changes{v2.1}{2023/04/10}{Introduced macro}
% We write the table width into the macro \cs{nostarch@tbl@N}, where
% $N$ is the roman representation of the table number
% \begin{macrocode}
\newcounter{nostarch@tbl}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\nostarch@read@tbl@width}
% \changes{v2.1}{2023/04/10}{Introduced macro}
% At the beginning of table environment we read the latest value of the
% width for the given table and set the caption size
% \begin{macrocode}
\newcommand\nostarch@read@tbl@width{%
\stepcounter{nostarch@tbl}%
\expandafter\ifx\csname nostarch@tbl@\romannumeral\c@nostarch@tbl\endcsname\relax
\edef\@tempa{\the\textwidth}%
\else
\edef\@tempa{\csname nostarch@tbl@\romannumeral\c@nostarch@tbl\endcsname}%
\fi
\expandafter\setlength\expandafter\nostarch@captionwidth\expandafter{\@tempa}%
}
\AtBeginEnvironment{table}{\nostarch@read@tbl@width}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\nostarch@save@tbl@width}
% \changes{v2.1}{2023/04/10}{Introduced macro}
% At the end of the table environment we measure the width of the last
% box and write it in the aux file.
% \begin{macrocode}
\newcommand\nostarch@save@tbl@width{%
\nostarch@measurecaptionwidth
\if@filesw
\immediate\write\@auxout{%
\gdef\expandafter\noexpand\csname nostarch@tbl@\romannumeral\c@nostarch@tbl\endcsname
{\the\nostarch@captionwidth}}%
\fi
\expandafter\ifx\csname nostarch@tbl@\romannumeral\c@nostarch@tbl\endcsname\relax
\edef\@tempa{\the\textwidth}%
\else
\edef\@tempa{\csname nostarch@tbl@\romannumeral\c@nostarch@tbl\endcsname}%
\fi
\expandafter\ifdim\@tempa=\nostarch@captionwidth\else
\gdef\nostarch@tbl@warn{\ClassWarningNoLine{nostarch}
{Table widths have changed. Rerun LaTeX.}}
\fi
}
\pretocmd{\endtable}{\nostarch@save@tbl@width}{}{}
% \end{macrocode}
% \end{macro}
%
% The |H| specifier from the |float| package redefines the end of the
% float, so we need to patch it too
% \begin{macrocode}
\pretocmd{\float@endH}{\def\@tempa{table}%
\ifx\@tempa\@captype\nostarch@save@tbl@width\fi}{}{}
% \end{macrocode}
%
% \begin{macro}{\nostarch@read@LT@width}
% \changes{v2.1}{2023/04/10}{Introduced macro}
% The long table version of setting caption width is different,
% because a longtable knows its width.
% \begin{macrocode}
\def\nostarch@read@LT@width{%
\ifnostarch@overridecaptionwidth\else
\global\setlength{\nostarch@captionwidth}{\z@}%
\bgroup
\def\LT@entry##1##2{%
\global\addtolength{\nostarch@captionwidth}{##2}}%
\csname LT@\romannumeral\c@LT@tables\endcsname
\egroup
\fi
\global\nostarch@overridecaptionwidthfalse
}
\AtBeginDocument{\pretocmd{\caption@LT@config}{\global\rownum=1\relax
\nostarch@read@LT@width}{}{}}
\AtBeginEnvironment{longtable}{\global\rownum=0\relax}
% \end{macrocode}
% \end{macro}
%
%
% Fonts for captions
% \begin{macrocode}
\DeclareCaptionFont{nostarchfigfont}{\sffamily
\itshape \fontsize{8.5pt}{9pt}\selectfont}
\DeclareCaptionFont{nostarchtabfont}{\futurabook
\fontsize{9pt}{9pt}\selectfont}
% \end{macrocode}
% And the setup
% \begin{macrocode}
\captionsetup[figure]{font=nostarchfigfont,singlelinecheck=off,
aboveskip=8pt,belowskip=-8pt, format=nostarchfigtblformat}
\captionsetup[lstlisting]{font=nostarchfigfont,singlelinecheck=off,
aboveskip=4pt, belowskip=0pt}
\captionsetup[table]{font=nostarchtabfont,singlelinecheck=off,
aboveskip=0pt,belowskip=4pt, labelfont=bf, format=nostarchfigtblformat}
% \end{macrocode}
%
% \begin{macro}{\captionlst}
% \begin{macro}{\boxlst}
% \begin{macro}{\tablelst}
\newcommand{\captionlst}[1]{{\ttfamily \itshape \fontsize{10pt}{9pt}\selectfont #1}}
\newcommand{\boxlst}[1]{{\ttfamily \fontsize{10pt}{9pt}\selectfont #1}}
\newcommand{\tablelst}[1]{{\ttfamily \fontsize{10pt}{9pt}\selectfont #1}}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\tbfont}
% This is the font used for table body:
% \begin{macrocode}
\def\tbfont{%
\futurabook\fontsize{8.5pt}{10pt}\selectfont}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\thfont}
% Font for table headers:
% \begin{macrocode}
\def\thfont{%
\futuraheavy\fontsize{9pt}{10pt}\selectfont}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\AtBeginEnvironment{tabular}{\tbfont}
\AtBeginEnvironment{longtable}{\tbfont}
% \end{macrocode}
%
% \begin{macro}{\heawyrulewidth}
% \begin{macro}{\lightrulewidth}
% \begin{macro}{\cmidrulewidth}
% Changing \progname{booktabs} defaults:
% \begin{macrocode}
\heavyrulewidth=3\p@
\lightrulewidth=1\p@
\cmidrulewidth=1.5\p@
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\bottomrule}
% Our |\bottomrule| is thin:
% \begin{macrocode}
\def\bottomrule{\noalign{\ifnum0=`}\fi
\@aboverulesep=\aboverulesep
\global\@belowrulesep=\belowbottomsep
\global\@thisruleclass=\@ne
\@ifnextchar[{\@BTrule}{\@BTrule[\lightrulewidth]}}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\belowrulesep}
% \begin{macro}{\belowbottomsep}
% \begin{macro}{\abovetopsep}
% Again redefining \progname{booktabs}:
% \begin{macrocode}
\belowrulesep=0.7ex
\belowbottomsep=0.65pt
\aboverulesep=0.7ex
\abovetopsep=0.65pt
% \end{macrocode}
%
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{tablewide}
% Wide table
% \begin{macrocode}
\newenvironment{tablewide}[1][]
{
\captionsetup[table]{font=nostarchtabfont,singlelinecheck=off,
aboveskip=0pt,belowskip=4pt, labelfont=bf, margin=-70pt}
\begin{table}[#1]
}
{
\end{table}
\captionsetup[table]{font=nostarchtabfont,singlelinecheck=off,
aboveskip=0pt,belowskip=4pt, labelfont=bf, margin=0pt}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{tabularwide}
% Wide tabular
% \begin{macrocode}
\newenvironment{tabularwide}[1]
{
\hspace*{-72pt}
\begin{tabular}{#1}
}
{
\end{tabular}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{figurewide}
% Wide figure
% \begin{macrocode}
\newenvironment{figurewide}[1][]
{
\captionsetup[figure]{font=nostarchfigfont,singlelinecheck=off,
aboveskip=8pt,belowskip=-8pt, margin=-70pt}
\begin{figure}[#1]
\hspace*{-70pt}
}
{
\end{figure}
\captionsetup[figure]{font=nostarchfigfont,singlelinecheck=off,
aboveskip=8pt,belowskip=-8pt}
}
% \end{macrocode}
% \end{macro}
%
% Setting up colors in tables
% \begin{macrocode}
\rowcolors[]{1}{}{nspgray}
% \end{macrocode}
%
% We extend the height of the rows and delete the space arounr rules
% \begin{macrocode}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\setlength{\extrarowheight}{.8ex}
% \end{macrocode}
%
%\subsection{Verbatim, url and Listings Customization}
%\label{sec:verbatim}
%
% \begin{macro}{Code}
% This is for framed code:
% \begin{macrocode}
\DefineVerbatimEnvironment{Code}{Verbatim}{frame=lines,framerule=0.25pt, commandchars=\\\{\}}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\FV@ListParameterHook}
% The skip before code is too large for us
% \begin{macrocode}
\FV@AddToHook\FV@ListParameterHook{\vspace{-6pt}}
% \end{macrocode}
% \end{macro}
%
% We also enable verbatim footnotes.
% \begin{macrocode}
\VerbatimFootnotes
% \end{macrocode}
%
%
%\subsection{Boxes and projects}
%\label{sec:boxes}
%
% Various boxes.
%
% \begin{macro}{nspgray}
% The color for boxes
% \begin{macrocode}
\definecolor{nspgray}{cmyk}{0, 0, 0, 0.1}
% \end{macrocode}
% \end{macro}
%
% And various mdframed styled boxes
% \begin{macrocode}
\mdfdefinestyle{nspbox}{%
linecolor=black,
outerlinewidth=1pt,
roundcorner=5pt,
innertopmargin=\baselineskip,
innerbottommargin=\baselineskip,
innerrightmargin=18pt,
innerleftmargin=18pt,
backgroundcolor=nspgray,
everyline=true
}
\mdfdefinestyle{custombox}{%
linecolor=black,
outerlinewidth=1pt,
roundcorner=5pt,
innertopmargin=\baselineskip,
innerbottommargin=\baselineskip,
innerrightmargin=18pt,
innerleftmargin=18pt,
everyline=true
}
\newenvironment{nspbox}[1]
{\begin{mdframed}[style=nspbox]
\begin{center}
{\dogma \fontsize{9pt}{15pt} \MakeUppercase{\sobox{#1}}}
\end{center}
\begin{flushright}
\begin{flushleft}
\parskip=.5\baselineskip
\tbfont
}
{\end{flushleft}\end{flushright}
\end{mdframed}}
\newenvironment{nspboxcontinued}
{\begin{mdframed}[style=nspbox]
\begin{flushright}
\begin{flushleft}
\parskip=.5\baselineskip
\tbfont
}
{
\end{flushleft}
\end{flushright}
\end{mdframed}}
\newenvironment{custombox}[1]
{\begin{mdframed}[style=custombox]
\begin{center}
{\dogma \fontsize{9pt}{15pt} \MakeUppercase{\sobox{#1}}}
\end{center}
\begin{flushright}
\begin{flushleft}
\parskip=.5\baselineskip
\tbfont
}
{\end{flushleft}\end{flushright}
\end{mdframed}}
\newenvironment{customboxcontinued}
{\begin{mdframed}[style=custombox]
\begin{flushright}
\begin{flushleft}
\parskip=.5\baselineskip
\tbfont
}
{
\end{flushleft}
\end{flushright}
\end{mdframed}}
\newcommand{\continued}[0]{%
{\begin{flushright}%
\emph{(continued)}%
\end{flushright}}%
}
% \end{macrocode}
%
%
% Project stuff
% \begin{macrocode}
\newcounter{project}
\stepcounter{project}
\newcommand{\projecthead}[1]{
\vspace{16pt}%
\noindent%
\hspace{-.75in}%
\addcontentsline{toc}{boldsection}{Project~\#\theproject: #1}%
{\sffamily\bfseries\fontsize{12pt}{16pt}\selectfont
\colorbox{black}{\textcolor{white}{Project~\#\theproject: #1}}}%
\vspace{6pt}%
\@afterindentfalse\@afterheading%
\refstepcounter{project}%
}
% \end{macrocode}
%
% Urls are typeset in italics, with upper tilde, and according to the
% following rules: URLs should break \emph{before} periods,
% underscores, equal signs, ampersands, and hyphens but \emph{after}
% colons, slashes and hash marks. Also, we do not allow splitting
% before slashes.
% \begin{macro}{\UrlFont}
% \changes{v2.1}{2023/04/08}{Redefined macro}
% Urls are in italic
% \begin{macrocode}
\def\UrlFont{\itshape}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\UrlTildeSpecial}
% \changes{v2.1}{2023/04/08}{Redefined macro}
% \begin{macrocode}
\def\UrlTildeSpecial{\do\~{\raise.2ex\hbox{\m@th$\scriptstyle\sim$}}}
\let\Url@force@Tilde\UrlTildeSpecial
% \end{macrocode}
% \end{macro}
% \begin{macro}{\UrlBreaks}
% \changes{v2.1}{2023/04/08}{Redefined macro}
% \changes{v2.1}{2023/04/10}{Moved slashes to specials}
% Breaks after colons, slashes, hash marks. Colons are defined in
% \cs{UrlBigBreaks}, so we need the other signs. We also add some
% other signs here
% \begin{macrocode}
\def\UrlBreaks{\do\#\do\\\do\>\do\]\do\)\do\}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\UrlSpecials}
% \changes{v2.1}{2023/04/08}{Redefined macro}
% \changes{v2.1}{2023/04/11}{Added slashes and double quote}
% \changes{v2.3}{2023/06/18}{Moved out opening braces for
% compatibility with amsmath}
% We add to macro special treatment of the chars with breaking URLs.
% Slashes are interesting: we allow breaking after them, but not
% before, even after other slashes or colons
% \emph{before} them
% \begin{macrocode}
\g@addto@macro{\UrlSpecials}{%
\do\.{\penalty\UrlBreakPenalty\mathchar46\relax}%
\do\_{\penalty\UrlBreakPenalty\mathchar95\relax}%
\do\={\penalty\UrlBreakPenalty\mathchar61\relax}%
\do\&{\penalty\UrlBreakPenalty\mathchar38\relax}%
\do\-{\penalty\UrlBreakPenalty\mathchar45\relax}%
\do\!{\penalty\UrlBreakPenalty\mathchar33\relax}%
\do\?{\penalty\UrlBreakPenalty\mathchar63\relax}%
\do\|{\penalty\UrlBreakPenalty\mathchar124\relax}%
\do\,{\penalty\UrlBreakPenalty\mathchar44\relax}%
\do\;{\penalty\UrlBreakPenalty\mathchar59\relax}%
\do\@{\penalty\UrlBreakPenalty\mathchar64\relax}%
\do\'{\penalty\UrlBreakPenalty\mathchar39\relax}%
\do\"{\penalty\UrlBreakPenalty\mathchar34\relax}%
\do\+{\penalty\UrlBreakPenalty\mathchar43\relax}%
\do\/{\unpenalty\penalty\@M\mathchar47\penalty\UrlBreakPenalty}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\UrlNoBreaks}
% \changes{v2.1}{2023/04/08}{Redefined macro}
% \changes{v2.3}{2023/06/18}{Removed redefinition}
% We do not allow breaks in urls after brackets
% \begin{macrocode}
% \def\UrlNoBreaks{} % Rolled back redefinition
% \end{macrocode}
% \end{macro}
%
%\subsection{Margin notes}
%\label{sec:margins}
%
% Filenames on margins
% \begin{macrocode}
\renewcommand*{\marginfont}{\sffamily\itshape\fontsize{8.5}{10}\selectfont}
\renewcommand*{\marginnotevadjust}{-\baselineskip}
\newcommand{\marginwingding}[1]{{\fontsize{10pt}{12pt}\selectfont \wingding{#1}}}
% \end{macrocode}
%
% Code below makes the margin note always on the left, taken from:
% \url{https://tex.stackexchange.com/questions/472728/marginnote-always-on-left-side-of-the-page}
% \begin{macrocode}
\long\def\@mn@@@marginnote[#1]#2[#3]{%
\begingroup
\ifmmode\mn@strut\let\@tempa\mn@vadjust\else
\if@inlabel\leavevmode\fi
\ifhmode\mn@strut\let\@tempa\mn@vadjust\else\let\@tempa\mn@vlap\fi
\fi
\@tempa{%
\vbox to\z@{%
\vss
\@mn@margintest
\if@reversemargin\if@tempswa
\@tempswafalse
\else
\@tempswatrue
\fi\fi
\llap{%
\vbox to\z@{\kern\marginnotevadjust\kern #3
\vbox to\z@{%
\hsize\marginparwidth
\linewidth\hsize
\kern-\parskip
%\mn@parboxrestore
\marginfont\raggedleftmarginnote\strut\hspace{\z@}%
\ignorespaces#1\endgraf
\vss
}%
\vss
}%
\if@mn@verbose
\PackageInfo{marginnote}{xpos seems to be \@mn@currxpos}%
\fi
\begingroup
\ifx\@mn@currxpos\relax\else\ifx\@mn@currpos\@empty\else
\kern\@mn@currxpos
\fi\fi
\ifx\@mn@currpage\relax
\let\@mn@currpage\@ne
\fi
\if@twoside\ifodd\@mn@currpage\relax
\kern-\oddsidemargin
\else
\kern-\evensidemargin
\fi
\else
\kern-\oddsidemargin
\fi
\kern-1in
\endgroup
\kern\marginparsep
}%
}%
}%
\endgroup
}
% \end{macrocode}
%
%\subsection{Bibliography}
%\label{sec:biblio}
%
% \begin{macro}{\bibsection}
% \changes{v0.6}{2008/03/22}{Introduced the macro}
% We actually use chapter for bibliographic sections, but here we
% try to be nice to \progname{natbib}:
% \begin{macrocode}
\AtBeginDocument{
\def\bibsection{%
\clearpage
{\pagestyle{empty}\cleardoublepage}%
\everypar{}%
\thispagestyle{empty}%
\global\@topnum\z@
\@afterindentfalse
\gdef\@chapterart{}%
\@nschapterpreamble
\vspace*{0.622in}%
\addcontentsline{toc}{chapter}{\MakeUppercase{\bibname}}%
\addcontentsline{tbc}{bchapter}{\bibname}%
{\centering
{\dogma\fontsize{16pt}{20pt}\selectfont
\MakeUppercase{\sochapter{\bibname}}\par}}\nobreak\vskip25pt\relax%
\@mkboth{\bibname}{\bibname}}}%
% \end{macrocode}
%
% \end{macro}
%
%
% \begin{macro}{thebibliography}
% \changes{v0.6}{2008/03/22}{Introduced the macro}
% We want bibliography to be in the table of contents:
% \begin{macrocode}
\renewenvironment{thebibliography}[1]{%
\bibsection
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
% \end{macrocode}
%
% \end{macro}
%
%\subsection{Index}
%\label{sec:index}
%
% \begin{macro}{\term}
% \changes{v2.0}{2023/04/04}{Introduced the macro}
% An indexed term
% \begin{macrocode}
\newcommand{\term}[1]{\emph{#1}\index{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{theindex}
% \changes{v0.6}{2008/03/22}{Introduced the macro}
% We want our index to be in the table of contents too:
% \begin{macrocode}
\renewenvironment{theindex}{%
\clearpage
{\pagestyle{empty}\cleardoublepage}%
\everypar{}%
\thispagestyle{empty}%
\global\@topnum\z@
\@afterindentfalse
\gdef\@chapterart{}%
\if@twocolumn
\@restonecolfalse
\else
\@restonecoltrue
\fi
\twocolumn[%
\@nschapterpreamble
\vspace*{0.622in}%
\addcontentsline{toc}{chapter}{\MakeUppercase{\indexname}}%
\addcontentsline{tbc}{bchapter}{\indexname}%
{\centering
{\dogma%
\fontsize{16pt}{20pt}\selectfont
\MakeUppercase{\sochapter{\indexname}}\par}}%
\nobreak\vskip25pt\relax]%
\@mkboth{\indexname}%
{\indexname}%
\parindent\z@
\parskip\z@ \@plus .3\p@\relax
\columnseprule \z@
\columnsep 0.25in%
\let\item\@idxitem}
{\if@restonecol\onecolumn\else\clearpage\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@idxitem}
% \changes{v0.6}{2008/03/22}{Changed default}
% This is how we format level 1 index entries:
% \begin{macrocode}
\renewcommand\@idxitem{%
\par\hangindent0.45in\normalfont\fontsize{9.5\p@}{11.5\p@}\selectfont
\raggedright}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\subitem}
% \changes{v0.6}{2008/03/22}{Changed default}
% Level 2 entries:
% \begin{macrocode}
\renewcommand\subitem{\@idxitem \hspace*{0.15in}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\subsubitem}
% \changes{v0.6}{2008/03/22}{Changed default}
% Level 3 entries:
% \begin{macrocode}
\renewcommand\subsubitem{\@idxitem \hspace*{0.3in}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\indexspace}
% \changes{v0.6}{2008/03/22}{Changed default}
% The space between the groups
% \begin{macrocode}
\renewcommand\indexspace{\par \vskip 14\p@\relax}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\indexgroup}
% \changes{v0.6}{2008/03/22}{Introduced the macro}
% When an index starts a new letter, we call this macro:
% \begin{macrocode}
\newcommand\indexgroup[1]{{\futuraboldc
\fontseries{bc}\fontsize{11\p@}{13\p@}\selectfont#1}\par\vskip4\p@}
% \end{macrocode}
% \end{macro}
%
%
%
%\subsection{Update Page and Colophon}
%\label{sec:update_colophon}
%
% \begin{macro}{\updatesname}
% \changes{v0.6}{2008/03/22}{Introduced the macro}
% Just the name for updates:
% \begin{macrocode}
\def\updatesname{Updates}
% \end{macrocode}
%
% \end{macro}
%
%
% \begin{macro}{\updatespage}
% \changes{v0.6}{2008/03/22}{Introduced the macro}
% This is the command that start update page. It looks like
% chapter, but it does not mark the pages or appear in the tables of
% contents:
% \begin{macrocode}
\newcommand\updatespage{%
\clearpage
{\pagestyle{empty}\cleardoublepage}%
\everypar{}%
\thispagestyle{empty}%
\global\@topnum\z@
\gdef\@chapterart{}%
\vspace*{1.875in}%
{\centering
\dogma%
\fontsize{16pt}{20pt}\selectfont
\MakeUppercase{\sochapter{\updatesname}}\par\nobreak\vskip40\p@}%
\@nobreaktrue
\everypar{%
\if@nobreak
\@nobreakfalse
\clubpenalty \@M
\setbox\z@\lastbox
\else
\clubpenalty \@clubpenalty
\everypar{}%
\fi}}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\colophonname}
% \changes{v0.6}{2008/03/22}{Introduced the macro}
% Just the name for colophon:
% \begin{macrocode}
\def\colophonname{Colophon}
% \end{macrocode}%
% \end{macro}
%
%
% \begin{macro}{\colophon}
% Colophon does not start a separate page:
% \changes{v0.6}{2008/03/22}{Introduced the macro}
% \begin{macrocode}
\newcommand\colophon{%
\everypar{}%
\global\@topnum\z@
\gdef\@chapterart{}%
\vspace*{0.875in}%
%{\centering
%\dogma%
% \fontsize{16pt}{20pt}\selectfont
%\MakeUppercase{\sochapter{\colophonname}}\par\nobreak\vskip40\p@}%
\@nobreaktrue
\everypar{%
\if@nobreak
\@nobreakfalse
\clubpenalty \@M
\setbox\z@\lastbox
\else
\clubpenalty \@clubpenalty
\everypar{}%
\fi}\par
The fonts used in \emph{\@title} are New Baskerville, Futura, The
Sans Mono Condensed, and Dogma. The book was typeset with
\LaTeXe{} package
\texttt{nostarch} by Boris Veytsman with many additions by Alex
Freed and other members of the \emph{No Starch Press} team
\emph{(\csname ver@nostarch.cls\endcsname).}\par}
% \end{macrocode}
% \end{macro}
%
%\subsection{End of Class}
%\label{end}
%
%
% \begin{macrocode}
%</class>
% \end{macrocode}
%
%\subsection{Dealing with \progname{hyperref}}
%\label{sec:hyperref}
%
% \changes{v0.6}{2008/03/22}{Introduced package \progname{nshyper}}
% First, we load \progname{hyperref} with right options. I do not
% know why bookmarks do not work, but this is important to switch off:
% \begin{macrocode}
%<*nshyper>
\RequirePackage[breaklinks,colorlinks,linkcolor=black,
citecolor=black,pagecolor=black,urlcolor=black,hyperindex]{hyperref}
% \end{macrocode}
%
% \progname{hyperref} expects the starred parts and chapters to have
% only one argument---but we have two!
% \begin{macrocode}
\AtBeginDocument{%
\def\@schapter[#1]#2{%
\H@old@schapter[#1]{#2}%
\@nschapterpreamble}%
\def\@spart[#1]#2{%
\H@old@spart[#1]{#2}%
\Hy@GlobalStepCount\Hy@linkcounter
\xdef\@currentHref{part*.\the\Hy@linkcounter}%
\Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}}}%
% \end{macrocode}
% We change the preamble for bibliography and index:
% \begin{macrocode}
\def\@nschapterpreamble{%
\begingroup
\let\@mkboth\@gobbletwo
\Hy@GlobalStepCount\Hy@linkcounter
\xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
\Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
\endgroup}
% \end{macrocode}
%
% We can add information about the file to the pdf metadata as well:
% \begin{macrocode}
\let\ns@old@maketitle\maketitle
\def\maketitle{%
\hypersetup{pdfauthor=\@author, pdftitle=\@title}%
\ns@old@maketitle}
%</nshyper>
% \end{macrocode}
%
%
%\subsection{\progname{MakeIndex} Style File}
%\label{sec:makeindex}
% \changes{v0.6}{2008/03/23}{Added \progname{MakeIndex} style}
%
% These lines will produce some warnings when
% running Makeindex as they try to cover two different
% versions of the program:
% \begin{macrocode}
%<*ist>
lethead_prefix "\\indexgroup{"
lethead_suffix "}\\nopagebreak\n"
lethead_flag 1
heading_prefix "\\indexgroup{"
heading_suffix "}\\nopagebreak\n"
headings_flag 1
%</ist>
% \end{macrocode}
%
%
%\Finale
%\clearpage
%
%\PrintChanges
%\clearpage
%\PrintIndex
%
\endinput
|