summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gmdoc/gmdoc.sty
blob: cee0aa6b911bc2f18742499e01e96ffa4497779c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
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
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
%
% \GetFileInfo{gmdoc.sty}
% \title{The \pk{gmdoc.sty} Package\thfileinfo}
% \author{Grzegorz `Natror' Murzynowski}
% \date{\today}
% \maketitle
% \label{gmd}
%% 
%% This is (a~documentation of) file \pk{gmdoc.sty},
%% intended to be used with \LaTeXe\ as a~package for
%% documenting \LaTeXpar\ files and to be documented with itself. 
%% \stanza
%% 
% \begin{copyrnote}
%
%% Written by Grzegorz `Natror' Murzynowski,
%% natror at o2 dot pl
%%
%% \copyright\,2006 by Grzegorz `Natror' Murzynowski.
%%
%% This program is subject to the \LaTeX\ Project Public License.
%% See \url{http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html} ^^A
%% for the details of that license.
%%
%% LPPL status: "author-maintained".\par
%%
%% Many thanks to my \TeX\ Guru Marcin Woli\'nski for his \TeX nical ^^A
%% support.
%
%\end{copyrnote}
%
% \ChangesStart{v0.98c}{1000/0/0}
%
% \chschange{v0.96}{2006/08/22}{2395}
% \chschange{v0.97}{06/09/04}{3636}
% \chschange{v0.98}{06/09/04}{3636}
% \chschange{v0.98a}{06/09/06}{4092}
% \chschange{v0.98b}{06/9/7}{4119}
% \chschange{v0.98c}{06/9/10}{4299}
% \chschange{v0.98d}{06/9/15}{4409}
% \chschange{v0.98e}{06/9/23}{4420}
% \chschange{v0.98f}{06/9/30}{4430}
% \chschange{v0.98g}{06/10/5}{4294}
% \chschange{v0.98i}{06/10/14}{4352}
% \chschange{v0.98j}{06/10/17}{4372}
% \chschange{v0.98k}{06/10/21}{4416}
% \chschange{v0.98l}{06/10/27}{4401}
% \chschange{v0.98m}{06/11/14}{4349}
% \chschange{v0.99}{06/11/29}{4462}
% \chschange{v0.99a}{2006/12/1}{4479}
% 
%^^A \docstrip
%<package>

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{gmdoc}
         [2006/12/30 v0.99a a documenting package (GM)]

%
%
% \CharacterTable {In my \TeX\ Guru's opinion the idea of
%   checking of the correctness of chars is a~bit obsolete
%   nowadays. Therefore I~define the \CharacterTable<#1>
%   macro to gobble its argument and to typeout a~request
%   for request.}
%
%
% \newcommand*\docfm{\pk{doc}}
% \newcommand*\gmdoc{\pk{gmdoc}}
%
% \tableofcontents
%
%
% \division{Readme}
%
%   This package is a~tool for documenting of \LaTeXpar\
%   packages, classes etc., i.e., the \file{.sty}, \file{.cls} files
%   etc. The author just writes the code and adds the commentary 
%   preceded with |%| sign (or another properly declared). No special
%   environments are necessary.
%
%   The package tends to be (optionally) compatible with the standard
%   \pk{doc.sty} package, 
%   i.e., the \file{.dtx} files are also compilable with \pk{gmdoc}
%   (they may need very little adjustment, in some rather special
%   cases).
%
%   The tools are integrated with \pk{hyperref}'s advantages such as
%   hyperlinking of index entries, contents entries and
%   cross-references.
%
% \begin{gmlonely}
%   \subdivision{Installation}
%
%   Just put the \pk{gmdoc.sty} and \pk{gmdocc.cls} somewhere in the
%   \file{texmf/\:tex/\:latex} branch. Creating
%   a~\file{texmf/\:tex/\:latex/\:gm} directory may be advisable if
%   you consider using other packages written by me.
%
%   You should also install \pk{gmverb.sty}, \pk{gmutils.sty}
%   and \pk{gmiflink.sty} (e.g., put them into the same \file{gm}
%   directory). These packages are available on CTAN as separate
%   \file{.zip} archives.
%
%   Moreover, you should put the \file{gmglo.ist} file, a MakeIndex
%   style for the changes' history, into some \file{texmf/\:makeindex}
%   (sub)directory.
%
%   Then you should refresh your \TeX\ distribution's files' database
%   most probably.
% \end{gmlonely}
%
%
% \subdivision{Contents of the \pk{gmdoc.zip} Archive}
%
% The distribution of the \pk{gmdoc} package consists of the
% following six files.
% \begin{verse}
%   \pk{gmdoc.sty}\\
%   \pk{gmdocc.cls}\\
%   \pk{gmglo.ist}\\
%   \pk{README}\\
%   \pk{gmdocDoc.tex}\\
%   \pk{gmdocDoc.pdf}
% \end{verse}
%
% 
% \begin{gmlonely}
%   \subdivision{Compiling the Documentation}
%
%   The last of the above files (the \pk{.pdf}, i.e., \emph{this
%     file}) is a~documentation compiled from the \pk{.sty} and
%   \pk{.cls} files by running \LaTeX\ on the \file{gmdocDoc.tex}
%   twice, then MakeIndex on the \file{gmdocDoc.idx} and
%   \file{gmdocDoc.glo} files, and then \LaTeX\ on \file{gmdocDoc.tex}
%   once more.
%
%   MakeIndex shell commands:
%\begin{verbatim}
%makeindex -r gmdocDoc
%makeindex -r -s gmglo.ist -o gmdocDoc.gls gmdocDoc.glo
%\end{verbatim}
%   The |-r| switch is to forbid MakeIndex to make implicit ranges since
%   the (code line) numbers will be hyperlinks.
%
%   Compiling the documentation requires the packages:
%   \pk{gmdoc} (\pk{gmdoc.sty} and \pk{gmdocc.cls}), \pk{gmutils.sty},
%   \pk{gmverb.sty}, \pk{gmiflink.sty} and also some standard packages:
%   \pk{hyperref.sty}, \pk{color.sty}, \pk{geometry.sty},
%   \pk{multicol.sty}, \pk{lmodern.sty}, \pk{fontenc.sty} that should
%   be installed on your computer by default.
%
%   If you had not installed the \pk{mwcls} classes (available on
%   CTAN and present in \TeX\ Live e.g.), the result of your
%   compilation might differ a~bit from the \pk{.pdf} provided in this
%   \pk{.zip} archive in formatting: If you had not installed
%   \pk{mwcls}, the standard \pk{article.cls} class would be used.
% \end{gmlonely}
%
% 
% % \subdivision{Bonus: \file{base} Drivers}
%
% As a~bonus and example of \docfm-compatibility 
% there are driver files included
% (cf.\ Palestrina, \textit{Missa papae Marceli} ;-):
%
% \begin{verse}
%   \pk{source2e_gmdoc.tex}\\
%   \pk{docstrip_gmdoc.tex}\\
%   \pk{doc_gmdoc.tex}
%
%   \pk{oldcomm.sty}\\
%   \pk{gmeometric.sty}
% \end{verse}
%
% These drivers typeset the respective files from the
%\[\hbox{\file{ .../texmf-dist/source/latex/base}}\]
% directory of the \TeX Live2005 distribution.
%
% Probably you should redefine the |\BasePath| macro in them
% so that it points that directory on your computer.
%
%
%\division*{Introduction}
%
% There are very sophisticated and effective tools for documenting
% \LaTeX\ macro packages, namely the \pk{doc} package and the
% \pk{ltxdoc} class.
% Why did I~write another documenting package then? 
%
% I~like comfort and \pk{doc} is not comfortable enough for me. It
% requires special marking of the macro code to be properly typeset
% when documented. I~want \TeX\ to know `itself' where the code begins
% and ends, without additional marks. 
%
% That's the difference. One more difference, more important for the
% people for whom the \docfm's conventions are acceptable, is that
% \gmdoc\ makes use of \pk{hyperref} advantages and makes
% a~hyperlinking index and toc entries and the
% cross-references, too. (The CSs in the code maybe in the future.) 
%
% The rest is striving to level the very high \pk{doc/ltxdoc}'s
% standard, such as (optional) numbering of the codelines and
% authomatic indexing the control sequences e.g.
%
% The \docfm\ package was and still is a~great inspiration for me and
% I~would like this humble package to be considered as a~sort of
% hommage to it\footnote{As Grieg's Piano Concerto is a~hommage to ^^B
%   the Schumann's.}. If I~mention copying some code or narrative but do
% not state the source explicitly, I~mean the \docfm\ package's
% documentation (I~have v2.1b dated 2004/02/09).
%
%
%
% \division{The User Interface}
%
%
% \subdivision{Used Terms}
%
% When I~write of a~\textbf{macro}, I~mean a~macro in \TeXbook's
% meaning, i.e., a~control sequence whose meaning is
% |\(e/g/x)def|ined. By a~\textbf{macro's parameter} I~mean each of
% |#|\<digit>s in its definition. When I~write about ^^A\)
% a~\textbf{macro's argument}, I~mean the value (list of tokens)
% subsituting the corresponding parameter of this macro. 
% (These understandings are according ^^A(
% to \TeXbook, I~hope: \TeX\ is a~religion of Book ;-)\,.)
%
% I'll use a~shorthand for `control sequence', \textbf{CS}. 
%
% When I~talk of a~\textbf{declaration}, I~mean a~macro that expands
% to a~certain assignment, such as |\itshape| or
% |\@onlypreamble{|\<CS>|}|.
%
% Talking of declarations, I'll use the \textbf{OCSR} acronym as
% a~shorthand for 'observes/ing common \TeX\ scoping rules'.
%
% By a~\textbf{command} I~mean a~certain abstract visible to the end
% user as a~CS but consisting possibly of more than one macro. I'll
% talk of a~\textbf{command's argument} also in
% the `sense\:-for\:-the\:-end\:-user', e.g., I'll talk of the
% |\verb| \emph{command's} argument although \emph{the macro}
% |\verb| has no |#|\<digit> in its definition.
%
% The \textbf{code} to be typeset verbatim (and with all the bells
% and whistles) is everything that's not commented out in the source
% file and what is not a~leading space(s).
% 
% The \textbf{commentary} or \textbf{narrative} is everything after
% the comment char till the end of a~line. The \textbf{comment char}
% is a~character the |\catcode| of which is 14 usually i.e., when the
% file works; if you don't play with
% the |\catcode|s, it's just the |%|. When the file is documented with
% \gmdoc, such a~char is re|\catcode|d and its r\^ole is else: it
% becomes the \textbf{code delimiter}.
%
% A~line containing any \TeX\ code (not commented out) will be called
% a~\textbf{codeline}. A~line that begins with (some leading spaces
% and) a~code delimiter will be called a~\textbf{comment line} or
% \textbf{narration line}. 
%
% The \textbf{user} of this package will also be addressed
% as \textbf{you}.\stanza
%
% Not to favour any particular gender (of the amazingly rich variety,
% I~mean, not of the vulgarly simplified two-element set), in this
% documentation I~use alternating pronouns of third person ^^A(
% (\TextUsage\heshe\ etc. commands provided by \pk{gmutils}), so let
% one be not surprised if `\heshe' sees `\himher self' altered in the
% same sentence :-)\,.
% 
%
% \subdivision{Preparing the Source File}
%
%  When \LaTeXpar\ with \pk{gmdoc.sty} package loaded typesets the
% comment lines, the code delimiter is ommitted. If the comment
% continues a~codeline, the code delimiter is printed. It's done so
% because ending a~\TeX\ code line with a~|%| is often very important
% and significant. Comments longer than one line are typeset
% continuously with the code delimiters ommitted.
%
% The user should just write \hisher\ splendid code and brilliant
% commentary. In the latter \heshe\ may use usual \LaTeXpar\ commands.
% The only requirement is, if an argument is divided in two
% lines, to end such a~dividing line with \TextUsage*{^^B} sequence
% that'll enter the (active) \<char2> which shall gobble the line end.
% ^^A~and the leading code delimiter of the next line---obsoleted by
% ^^A~making % ignored in the commentary.
%
% Moreover, if \heshe\ wants to add a~meta-comment i.e., a~text that
% doesn't appear in the code layer nor in the narrative, \heshe\ may
% use the \TextUsage*{^^A} sequence that'll be read by \TeX\ as
% \<char1>, which 
% is in \gmdoc\ active and defined to gobble the stuff between itself
% and the next line end. 
%
% Note, however, that both |^^A| and |^^B| are usually macros in
% \gmdoc\ and the text being gobbled is their argument so it has to be
% balanced of braces and, if it occures inside an |\if...|, it has to
% have all |\if...|s coupled with |\else|s and |\fi|s.
% 
% However, it may be a~bit confusing
% for someone acquainted with the \docfm\ conventions. If you don't
% fancy the |^^B| special sequence, instead you may restore the
% standard meaning of the line end with the \TextUsage\StraightEOL\
% declaration which
% OCSR. As almost all the control
% sequences, it may be used also as an environment, i.e.,
% |\begin{StraightEOL}|\ \dots\ |\end{StraightEOL}|. However, if for any
% reason you don't want to make an environment (a~group), there's
% a~|\StraightEOL|'s counterpart, the \TextUsage\QueerEOL\ declaration that
% restores again the 
% \StraightEOL
% queer\footnote{In my understanding
%   `queer' and `straight' are not the opposites excluding each
%   other but the counterparts that may cooperate in harmony for
%   people's good. And, as I~try to show with the \cs{QueerEOL} and
%   \cs{StraightEOL} declarations, `queer' may be very useful and
%   recommended while `straight' is the standard but not necessarily
%   normative. (Remember also Alice's in the Wonderland exclamations
%   ``What a~queer day is today''.)}^^A
% \QueerEOL
% \gmdoc's meaning of the line end. It OCSR, too.  One more point to use
% |\StraightEOL| is where you wish some code lines to be executed
% both while loading the file and during the documentation pass
% (it's analogous to \docfm's not embracing some code lines in
% a~\env{macrocode} environment).
%
% \stanza
%
% As in standard \TeX ing, one gets a~paragraph by a~blank line.
% Such a~line should be |%|ed of course. A~fully blank line is
% considered a~blank \emph{code line} and hence results in
% a~vertical space in the documentation. As in the environments for
% poetry known to me, subsequent blank lines do not increase such
% a~space.
%
% Then \heshe\ should prepare a~main document file,
% a~\textbf{driver} henceforth, to set all the
% required formattings such as |\documentclass|, paper size
% etc., and load this package with a~standard command
% i.e., |\usepackage{gmdoc}|, just as \docfm's documentation says:
%
% \begin{quotation}
%   If one is going to document a set of macros with the \pk{[gm]doc}
%   package one has to prepare a special driver file which produces
%   the formatted document. This driver file has the following
%   characteristics: \par\leftskip\CodeIndent
%   \stanza
%
%   \noindent|\documentclass[|\<options>|]{|\<document-class>|}|\par
%   \noindent|\usepackage[|\<options, probably none>|]{gmdoc}|\par
%   \<preamble>\par
%   \noindent|\begin{document}|\par
%     \<special input commands>\par
%     \noindent|\end{document}|\par
% \end{quotation}
%
%
% \subdivision{The Main Input Commands}
%
% To typeset a~source file you may use the \TextUsage\DocInput\
% macro that takes the (path and) name of the file \emph{with ^^B
%   the extension} as the only argument, e.g.,
% |\DocInput{mybrilliantpackage.sty}|.
%
% (Note that an \emph{installed} package or class file is findable to
% \TeX\ even if you don't specify the path.)
%
% If a~source file is written with rather \docfm\ than \gmdoc\ in
% mind, then the \TextUsage\OldDocInput\ command may be more
% appropriate (e.g., if you break the arguments of commands in the
% commentary in lines). It also takes the file (path and) name as the
% argument. 
%
% When using |\OldDocInput|, you have to wrap all the code in
% \TextUsage*{macrocode} environments, which is not necessary when you
% use |\DocInput|. Moreover, with |\OldDocInput| the
% \env{macrocode(*)} environments require to be ended with
% |%    \end{macrocode(*)}|.
%
% \stanza
% If you wish to document many files in one document, you are
% provided \TextUsage\DocInclude\ command, analogous to \LaTeX's
% |\include| and very likely to \pk{ltxdoc}'s command of the same
% name. In \gmdoc\ it has one mandatory argument that should be the
% file name \emph{without extension}, just like for |\include|.
%
% The file extensions supported by |\DocInclude| are \pk{.fdd},
% \pk{.dtx}, \pk{.cls}, \pk{.sty}, \pk{.tex} and \pk{.fd}. The macro
% looks for 
% one of those 
% extensions in the order just given. If you need to document files
% of other extensions, please let me know and most probably we'll make
% it possible.
%
% |\DocInclude| has also an optional first argument that is intended
% to be the path of the included file with the levels separated by |/|
% (slash) and also ended with a~slash. The path given to |\DocInclude| as
% the first and optional argument will not appear in the headings nor
% in the footers. 
%
% |\DocInclude| redefines \TextUsage\maketitle\ so
% that it makes a~chapter heading or, in the classes that don't
% support |\chapter|, a~part heading, in both cases with
% respective toc entries. The default assumption is that all the
% files have the same author(s) so there's no need to print them in
% the file heading. If you wish the authors names to be printed, you
% should write \TextUsage\PrintFilesAuthors\ in the preamble or before
% the relevant |\DocInclude|s. If you wish to undeclare printing the
% authors names, there is \TextUsage\SkipFilesAuthors\ declaration.
%
% Like in \pk{ltxdoc}, the name of an included file appears in the
% footer of each page with date and version info (if they are
% provided).
%
% The |\DocInclude|d files are numbered with the letters, the
% lowercase first, as in \pk{ltxdoc}. Such a~filemarker also precedes
% the index entries, if the (default) codeline index option is in force.
%
% As with |\include|, you may declare
% \TextUsage\includeonly|{|\<filenames separated by commas>|}| for
% the draft versions.
%
% \stanza
% If you wish to include the driver file into your documentation, you
% may write |\DocInput{\jobname.tex}|, but a~try of
% |\DocInclude{\jobname}| would result with input stack overflow
% caused by infinite |\input{|\<jobname>|.aux}| recursion.
% But there's \TextUsage\SelfInclude\ at your service that creates and
% uses \pk{\<jobname>.auxx} file instead of the usual
% \pk{\<jobname>.aux}. Its effect is analogous to the |\DocInclude|'s, but
% \emph{the arguments it takes are totally different}: Since the
% filename is known, there's no need to state it. The extension is
% assumed to be \file{.tex}, but if it's different, you may state it in
% the first and optional argument. The second argument is mandatory and
% it's the stuff to be put at begin of file input, this one and no
% else (with \TextCommonIndex\AtBegInputOnce|\AtBegInputOnce| hook).
% For the example of usage see line \ref{SelfIncludeUsg} of
% chapter~\ref*{Driver}.
% 
% \stanza
% 
% At the default settings, the |\Doc/SelfInclude|d files constitute
% chapters if |\chapter| is known and parts otherwise. The
% |\maketitle|s of those files result in the respective headings.
%
% If you prefer more \pk{ltxdoc}ish look, in which the files always
% constitute the parts and those parts have a~part's title
% pages with the file name and the files' |\maketitle|s result in
% (article-like) titles not division headings, then you are provided
% the \TextUsage\ltxLookSetup\ declaration (allowed only in the
% preamble). However, even after this declaration the files will be
% included according to \gmdoc's rules not necessarily to the \docfm's
% ones (i.e., with minimal marking necessary at the price of active
% line ends (therefore not allowed between a~command and its argument
% nor inside an argument)).
%
% On the other hand, if you like the look offered by me but you have
% the files prepared for \docfm\ not for \gmdoc, then you
% should declare \TextUsage\olddocIncludes. Unlike the previous one,
% this may be used anywhere, because I~have the account of including both
% \docfm-like and \gmdoc-like files into one document. This
% declaration just changes the internal input command and doesn't
% change the sectioning settings.
%
% It seems possible that you wish to document the `old-doc' files
% first and the `new-doc' ones after, so the above declaration has its
% counterpart, \TextUsage\gmdocIncludes, that may be used anywhere,
% too. Before the respective |\DocInclude|(s), of course.
%
% Both these declarations OCSR.
%
% If you wish to document your files as with \pk{ltxdoc} \emph{and}
% as with \docfm, you should declare
% |\ltxLookSetup| in the preamble \emph{and} |\olddocIncludes|.
%
% \stanza
% Talking of analogies with \pk{ltxdoc}, if you like only the page
% layout provided by that class, there is the
% \TextUsage\ltxPageLayout\ declaration (allowed only in preamble)
% that only changes the margins and the text width (it's intended to
% be used with the default paper size). This declaration is
% contained in the |\ltxLookSetup| declaration.
%
% \stanza
% If you need to add something at the beginning of the input of file,
% there's the \TextUsage\AtBegInput\ declaration that takes one and
% mandatory argument which is the stuff to be added. This declaration
% is global. It may be used more than one time and the arguments of
% each occurrence of it add up and are put at the beginning of input
% of every subsequent files. 
%
% Simili modo, for the end of input, there's the
% \TextUsage\AtEndInput\  declaration, also one-argument, global and
% cumulative.
%
% If you need to add something at the beginning of input of only one
% file, put before the respective input command an
% \TextUsage\AtBegInputOnce|{|\<the stuff to be added>|}|
% declaration. It's also global which means that the groups do not
% limit its scope but it adds its argument only at the first input
% succeding it (the argument gets wrapped in a~macro that's |\relax|ed 
% at the first use). |\AtBegInputOnce|s add up, too.
%
% \stanza
% One more input command is \TextUsage\IndexInput\ (the name and idea
% of effect comes from \docfm). It takes the same argument as
% |\DocInput|, the file's (path and) name with extension. (It
% \emph{has} |\DocInput| inside). It works properly if the input file
% doesn't contain explicit \<char1> (|^^A| is OK). 
%
% The effect of this command is typesetting of all the input file
% verbatim, with the code lines numbered and the CSs automatically
% indexed (\pk{gmdoc.sty} options are in force).
%
%
% \subdivision{Package Options}
%
% As many good packages, this also provides some options:
% \stanza
%
% Due to best \TeX\ documenting traditions the codelines will be
% numbered. But if the user doesn't wish that, \heshe\ may turn it off
% with the \TextUsage*{linesnotnum} option.
%
% However, if \heshe\ agrees to have the lines numbered, \heshe\ may wish
% to reset the counter of lines \himher self, e.g., when \heshe\
% documents many source files in one document. Then \heshe\ may wish
% the line numbers to be reset with every |{section}|'s turn for
% instance. This is the r\^ole of the \TextUsage*{uresetlinecount}
% option, which seems to be a~bit obsolete however, since the
% \TextCommonIndex\DocInclude|\DocInclude| command takes care of
% a~proper reset.
%
% Talking of line numbering further, a~tradition seems to exist to
% number only the codelines and not to number the lines of
% commentary. That's the default behaviour of \pk{gmdoc} but, if
% someone wants the comment lines to be numbered too, \heshe\ is
% provided the \TextUsage*{countalllines} option. ^^A(
% {\LineNumFont 441}\,Then the narration acquires a~bit biblical look ;-),
% {\LineNumFont 442}\,as shown in this short example. This option is intended
% {\LineNumFont 443}\,for the draft versions and it is not perfect (as if anything
% {\LineNumFont 444}\,in this package was). As you see, the lines 
% {\LineNumFont 445}\,are typeset continuously with the numbers printed.
%
% \stanza
% By default the \pk{makeidx} package is loaded and initialized and
% the CSs occurring in the code are automatically
% (hyper)indexed thanks to the \pk{hyperref} package. If the user
% doesn't wish to index anything, she should use the
% \TextUsage*{noindex} option.
%
% The index comes two possible ways: with the line numbers (if the
% lines are numbered) and that's the default, or with the page numbers, if
% the \TextUsage*{pageindex}\label{indexoptions} option is set.
%
% \stanza
% By default, \gmdoc\ excludes some 300 CSs from being indexed.
% They are the most common CSs, \LaTeX\ internal
% macros and \TeX\ primitives. To learn what CSs are
% excluded actually, see lines \ref{DIE1}--\ref{DIE2}.
%
% If you don't want all those exclusions, you may turn them off with
% the \TextUsage*{indexallmacros} option. 
%
% If you have ambiguous feelings about whether to let the default
% exclusions or forbid them, see p.\,\pageref{IEIDeclarations} to
% feed this ambiguity with a~couple of declarations.
%
% \stanza
% In \docfm\ package there's a~default behaviour of putting marked
% macro's or environment's name to a~marginpar. In the standard
% classes it's allright but not all the classes support marginpars.
% That is the reason why this package enables marginparing when in
% standard classes, enables or disables it due to the respective option
% when with Marcin Woli\'nski's classes and in any case provides the
% options \TextUsage*{withmarginpar} and \TextUsage*{nomarginpar}. So, in
% non-standard classes the default behaviour is to disable marginpars.
% If the marginpars are enabled in \pk{gmdoc}, it will put marked
% control sequences and environments into marginpars (see
% \gmiflink[textUsage]{\cs{TextUsage} etc.}). These options do
% not affect common using marginpars, which depends on the
% documentclass.
%
% \stanza
% My suggestion is to make the spaces in the code visible except the
% leading ones and that's the default. But if you wish all the code
% spaces to be blank, I~give the option \TextUsage*{codespacesblank}
% reluctantly. Moreover, if you wish the code spaces to be blank only
% in some areas, then there's \TextUsage\CodeSpacesBlank\ declaration
% (OCSR).
%
%
% \subdivision{The Packages Required}
%
% \pk{gmdoc} requires (loads if they're not loaded yet) some other
% packages of mine, namely \pk{gmutils}, \pk{gmverb}, analogous to
% Frank Mittelbach's \pk{shortvrb}, and \pk{gmiflink} for conditional
% making of hyperlinks. It also requires \pk{hyperref},
% \pk{multicol}, \pk{color} and \pk{makeidx}. 
%
% The \pk{gmverb}\gmdmarginpar{\pk{gmverb}} package redefines the
% |\verb| command and the \env{verbatim} environment in such a~way that 
% | |, |{| and |\| are breakable, the first with no `hyphen' and the
%   other two with the comment char as a~hyphen, i.e.,
%   |{|\<subsequent text>|}| breaks into 
%     |{%|\\ \<subsequent text>|}| ^^A] bal. braces for Emacs
%       and \<text>|\mylittlemacro| breaks into \<text>|%|\\
%       |\mylittlemacro|.
%
% As the standard \LaTeX\ one, my |\verb| issues an error when a~line
% end occures in its scope. But, if you'd like to allow line ends in
% short verbatims, there's the \TextUsage\verbeolOK\ declaration.  The
% plain |\verb| typesets spaces blank and |\verb*| makes them visible,
% as in the standard version(s).
%
% Moreover, \pk{gmverb} provides the \TextUsage\MakeShortVerb\
% declaration 
% that takes a~one-char control sequence as the only argument and
% turns the char used into a~short verbatim delimiter, e.g., after
% \[\hbox{\verb+\MakeShortVerb*\|+}\]
% (as you see, the declaration has the starred version, which is for
% visible spaces, and non-starred for blank spaces) to get
% |\mylittlemacro| you may type \verb+|\mylittlemacro|+ instead of
% |\verb+\mylittlemacro+|. Because the char used in the last example
% is my favourite and is used this way by DEK in \TeXbook's
% format, \pk{gmverb} provides a~macro \TextUsage\dekclubs\ that
% expands to the example displayed above.
%
% Be careful because such active chars may interfere with other
% things, e.g., the \verb+|+ with the vertical line marker in \env{tabular}s and
% with the \pk{tikz} package. If this happens, you can declare e.g.,
% \TextUsage\DeleteShortVerb\verb+\|+ and the previous meaning of the
% char used shall be restored.
%
% One more difference between \pk{gmverb} and \pk{shortvrb} is that
% the chars |\active|ated  by |\MakeShortVerb|, behave as if they were
% `other' in math mode, so you may type e.g., \verb+$k|n$+ to get
% $k|n$ etc.
% \stanza
%
% The \pk{gmutils}\gmdmarginpar{\pk{gmutils}} package provides a~couple of
% macros similar to some basic \LaTeXpar\ ones, rather strictly
% technical and (I~hope) tricky, such as |\afterfi|, |\ifnextcat|,
% |\addtomacro| etc. It's this package that provides the macros for
% formatting of names of macros and files, such as |\cs|, |\marg|, |\pk|
% etc.  \stanza
% 
% The \gmdoc\ package uses a~lot of hyperlinking possibilities
% provided by \pk{hyperref}\gmdmarginpar{\pk{hyperref}} which is therefore
% probably the most important package required. The recommended
% situation is that the user loads \pk{hyperref} package with \hisher\
% favourite options \emph{before} loading \pk{gmdoc}.
%
% If \heshe\ does not, \pk{gmdoc} shall load it with \emph{my}
% favourite options. 
%
% To avoid an error if a~(hyper)referenced label does not exist,
% \pk{gmdoc} uses the \pk{gmiflink}\gmdmarginpar{\pk{gmiflink}}
% package. It works e.g., in the index when the codeline numbers have
% been changed: then they are still typeset, only not as hyperlinks
% but as a~common text.
%
% \stanza
% To typeset the index and the change history in balanced columns
% \gmdoc\ uses the \gmdmarginpar{\pk{multicol}}\pk{multicol} package
% that seems to be standard these days.
%
% Also the \gmdmarginpar{\pk{color}}\pk{multicol} package, required to
% define the default colour of the hyperlinks, seems to be standard
% already, and \pk{makeidx}.
%
%
% \subdivision[Macros for Marking the Macros]{^^B
%   \gmhypertarget{Macros for Marking the Macros}}
%
% The concept (taken from \docfm ) is to index virtually all the
% control sequences occurring in the code. \gmdoc\ does that by
% default and needs no special command. (See below about exluding some
% macros from being indexed.)
%
% The next concept (also taken from \docfm) is to ditinguish some
% occurrences of some control sequences by putting such a~sequence
% into a~marginpar and by special formatting of its index entry. That
% is what I~call marking the macros. \gmdoc\ provides also
% a~possibility of analogous marking for the environments' names and
% other sequences such as |^^A|.
%
% This package provides two kinds of special formatting of the
% index entries: `usage', with the reference number italic by default,
% and `def' (in \docfm\ called `main'), with the reference number
% roman (upright) and underlined by default. All the reference
% numbers, also those with no special formatting, are made hyperlinks
% to the page or the codeline according to the respective indexing
% option (see p.\,\pageref{indexoptions}).
%
% The macros and environments to be marked appear either in the code
% or in the commentary. But all the definitions appear in the code,
% I~suppose. Therefore the `def' marking macro is provided only for
% the code case. So we have\gmhypertarget[textUsage]{} the
% \TextUsage\CodeDefine, \TextUsage\CodeUsage\ and
% \TextUsage\TextUsage\ commands.
%
% All three take one argument and all three may be starred.  The
% non-starred versions are intended to take a~control sequence as the
% argument and the starred to take whatever (an
% environment name or a~|^^A|-like and also a~CS).
%
% You don't have to bother whether |@| is a~letter while documenting
% because even if not, these commands do make it a~letter, or more
% precisely, they execute \TextUsage\MakePrivateLetters\ whatever 
% it does: At the default settings this command makes |*|
% a~letter, too, so a~starred version of a~command is a~proper argument
% to any of the three `|\...Define/Usage| commands unstarred.
%
% The two |\Code...| commands, if unstarred, mark the next scanned
% occurrence of their argument in the code. (By `scanned occurrence'
% I~mean a~situation of the CS having been scanned in the
% code which happens iff its name was preceded by the char declared as
% |\CodeEscapeChar|). The starred versions of those commands
% mark just the next codeline and don't make \TeX\ looks for the
% scanned occurrence of their argument (which would never happen if
% the argument is not a~CS). Therefore, if you want to mark
% a~definition of an environment \env{foo}, you should put
% \[ \hbox{|%\CodeDefine*{foo}|} \]
%  right before the code line
% \[\hbox{|\newenvironment{foo}{%|}\]^^A]
%     i.e., not separated by any code line. The starred versions of
%     the |\Code...| commands are also intended to mark implicit
%     definitions of macros, e.g.,  |\CodeDefine*\@foofalse| before
%     the line
% \[\hbox{|\newif\if@foo|.}\]
%
% They both are |\outer|.
%
% The |\TextUsage| (one-argument) command is intended to mark usage of
% a~verbatim occurrence of a~\TeX\ object in the commentary. Unlike
% the two |\Code...|s, it typesets its argument which means among others\ that
% the marginpar appears usually at the same line as the text you
% wanted to mark. This command also has the starred version primarily
% intended for the environments names, and secondarily for
% |^^A|-likes and CSs, too. Currently, the most important difference
% is that the unstarred version executes |\MakePrivateLetters| while
% the starred does both |\MakePrivateLetters| and |\MakePrivateOthers|
% before reading the argument.
%
% If you consider the marginpars a~sort of sub(sub\dots)section
% marks, then you may wish to have a~command that makes a~marginpar of
% the desired CS (or whatever) at the beginning of its description,
% which may be fairly far from the first occurrence of its
% object. Then you have the \TextUsage\Describe\ command which
% puts its argument in a~marginpar and indexes it as a~`usage' entry
% but doesn't print it in the text. It's |\outer|.
%
% All four commands  just described put their (|\string|ed) argument
% into a~marginpar (if the marginpars are enabled) and create an index
% entry (if indexing is enabled).
%
% But what if you want just to make a~marginpar with macro's or
% environment's name? Then you have \TextUsage\CodeMarginize\
% to declare what to put into a~marginpar in the \TeX\ code (it's
% |\outer|) and
% \TextUsage\TextMarginize\ to do so in the commentary. According to
% the spirit of this part of the interface, these commands also take one
% argument and have their starred versions for strings other than
% control sequences.
%
% The marginpars (if enabled) are `reverse' i.e., at the left margin, and
% their contents is flush right and typeset in a~font declared with
% \TextUsage\marginpartt. By default, this declaration is |\let| to
% |\tt| but it may be advisable to choose a~condensed font if there is
% any. Such a~choice is made by \pk{gmdocc.cls} if the Latin Modern
% fonts are available: in this case \pk{gmdocc.cls} uses Latin Modern
% Typewriter Light Condensed.
% 
% If you need to put something in a~marginpar without making it typewriter
% font, there's the \TextUsage\gmdmarginpar\ macro (that takes one
% and mandatory argument) that only flushes its contents right.
%
% \stanza
% On the other hand, if you don't want to put a~CS (or another
% verbatim text) in a~marginpar but only to index it, then there are
% \TextUsage\CodeDefIndex\ and \TextUsage\CodeUsgIndex\ to declare
% special formatting of an entry. The unstarred versions of these
% commands look for their argument's scanned occurrence in the code
% (the argument should be a~CS), and the starred ones just take the
% next code line as the reference point. Both these commands are
% |\outer|.
%
% In the code all the control sequences (except the excluded ones, see
% below) are indexed by default so no explicit command is needed for
% that. But the environments and other special sequences are not and
% the two commands described above in their |*|ed versions contain the
% command for indexing their argument. But what if you wish to index
% a~not scanned stuff as a~usual entry? The \TextUsage\CodeCommonIndex*\
% comes in rescue, starred for the symmetry with the two previous commands
%  (without |*| it just gobbles
% it's argument). It's |\outer|.
%
% Similarly, to index a~\TeX\ object occurring verbatim in the narrative, you
% have \TextUsage\TextUsgIndex\ and \TextUsage\TextCommonIndex\
% commands with 
% their starless versions for a~CS argument and the starred for all
% kinds of the argument.
%
% \stanza
% Moreover, as in \docfm, the \TextUsage*{macro} and 
% \TextUsage*{environment} environments are provided. Both take one
% argument that should be a~CS for \env{macro} and `whatever' for
% \env{environment}. Both add the |\MacroTopsep| glue before and after
% their contents, and put their argument in a~marginpar at the first
% line of their contents (since it's done with |\strut|, you should
% not put any blank line (|%|ed or not) between
% |\begin{macro/environment}| and the first line of the
% contents). Then \env{macro} commands the first scanned occurrence of
% its argument to be indexed as `def' entry and \env{environment}
% commands \TeX\ to index the argument as if it occurred in the next
% code line (also as `def' entry).
%
% Since it's possible that you define a~CS implicitly i.e., in such a~way that it
% cannot be scanned in the definition (with |\csname...\endcsname|
% e.g.) and wrapping such a~definition (and description) in an
% \env{environment} environment would look misguidedly ugly, there's
% the \env{macro*} environment which \TeX nically is just an alias for
% \env{environment}.
%
% (To be honest, if you give a~\env{macro} environment a~non-CS
% argument, it will accept it and then it'll work as
% \env{evironment}.)
%
%
% \subdivision{Index Ex/Inclusions}
%
% It's\label{IEIDeclarations} understandable\footnote{After reading ^^B(
%   \docfm's documentation ;-)\,.} that you don't
% want some control sequences to be indexed in your documentation. The
% \docfm\ package gives a~brilliant solution: the
% \TextUsage\DoNotIndex\ declaration. So do I
% (although here, \TeX nically it's done another
% way). It OCSR. This declaration takes one
% argument consisting of a~list of control sequences not to be
% indexed. The items of this list may be separated with commas, as in
% \docfm , but it's not obligatory. The whole list should come in
% curly braces (except when it's one-element), e.g.,
% \[\hbox{\verb+\DoNotIndex{\some@macros,\are* \too\auxiliary\?}+}\]
% (The spaces after the control sequences are ignored.)
% You may use as many |\DoNotIndex|es as you wish (about half as many as
% many CSs may be declared, because for each CS excluded from indexing
% a~special CS is declared that stores the ban sentence).
%  Excluding the same CS more than once makes no problem.
%
% I~assume you wish most of \LaTeX\ macros, \TeX\ primitives etc.\ to
% be excluded from your index (as I~do). Therefore \pk{gmdoc} excludes
% some 300 CSs by default. If you don't like it, just set the
% |indexallmacros| package option.
%
% On the third hand, if you like the default exclusions in general but
% wish to undo just a~couple of them, you are given \TextUsage\DoIndex\
% declaration (OCSR) that removes a~ban on all the CSs given in the
% argument, e.g.,
% \[\hbox{\verb+\DoIndex{\par \@@par \endgraf}+}\]
%
% Moreover, you are provided the \TextUsage\DefaultIndexExclusions\
% and \Describe\UndoDefaultIndexExclusions^^A
% \cs{Un\-do\-Def\-ault\-Ind\-ex\-Ex\-cl\-us\-ions} declarations that
% act according to their names. You may use them in any configuration
% with the |indexallmacros| option. Both of these declarations OCSR.
%
%
% \subdivision{The \ds\ Directives}
%
% \gmdoc\ typesets the \ds\ directives and it does it quite likely as
% \docfm, i.e., with math sans serif font. It does it automatically
% whether you use the traditional settings or the new.
%
% Advised by my \TeX\ Guru, I~didn't implement the module nesting
% recognition (MW told it's not that important.)
%
% So far \gmhypertarget{verbatim mode directive} is only
% half-handled. That is, a~line beginning with |%<<|\<END-TAG> will be
% typeset as a~\ds\ directive, but 
% the closing line |%|\<END-TAG> will be not. It doesn't hard to
% implement, I~only receive some message it's really useful for
% someone.
%
%^^A If you use the \TextUsage*{macrocode} environment, you don't have to
%^^A add any CS to get \ds\ directive typeset properly: within
%^^A \env{macrocode} a~|<| sign in a~line commented out is read as
%^^A a~beginning of a~\ds\ directive, which means that \TeX\ looks
%^^A for the closing |>| or the very next |<| as the beginning of the
%^^A special directive |<<|\<any text till the end of line>.  In the
%^^A standard case of |<|\<directive>|>| \TeX\ typesets any further text
%^^A in its line as the code.
%^^A
%^^A If you want the \ds\ directives to be typeset without
%^^A \env{macrocode}, you shoud declare \TextUsage\docstrips\ to make
%^^A \TeX\ read the |<| in the comment layer as the beginning of
%^^A a~\ds\ directive. In |\docstrips|'s scope the |<| signs
%^^A occurring in math mode remain just inequality signs.
%^^A
%^^A If you wish only the first |<| met to start a~\ds\ directive
%^^A typesetting, then there's \TextUsage\docstrip\ declaration that
%^^A restores the previous meaning of |<| after the first using it as
%^^A a~\ds\ directive opener.
%^^A
%^^A Both |\docstrips| and |\docstrip| OCSR and, of course you may use
%^^A them as environments (which doesn't make much sense with the
%^^A latter, though).
%^^A
%
% \subdivision{The Changes History}
%
% The \docfm's documentation reads:
% \begin{quotation}
% To maintain a change history within the file, the |\changes| command may
% be placed amongst the description part of the changed code. It takes three
% arguments, thus:
% \[\hbox{|\changes{|\<version>|}{|\<YYYY/MM/DD date>|}{|\<text>|}|}\]
%
% The changes may be used to produce an auxiliary file (\LaTeX's
% |\glossary| mechanism is used for this) which may be printed after
% suitable formatting. The |\changes| [command] encloses the \<date> in
% parentheses and appends the \<text> to form the printed entry in
% such a change history [\dots\ obsolete remark ommitted].
% 
% To cause the change information to be written out, include
% \TextUsage\RecordChanges\ in the driver['s preamble or just in the
% source file (\pk{gmdocc.cls} does it for you)]. To read in and print
% the sorted change history (in two 
% columns), just put the \TextUsage\PrintChanges\ command as the last
% (commented-out, and thus executed during the documentation pass
% through the file) command in your package file [or in the driver].
% Alternatively, this command may form one of the arguments of the
% |\StopEventually| command, although a change history is probably not
% required if only the description is being printed. The command
% assumes that MakeIndex or some other program has processed the
% \pk{.glo} file to generate a~sorted \pk{.gls} file. You need
% a~special MakeIndex style file; a suitable one is supplied with
% \docfm\ [and \gmdoc], called \iffalse\pk{gglo.ist}\fi^^A
% [\dots\ \textbf{\pk{gmglo.ist}} for \gmdoc]. The \TextUsage\GlossaryMin,
% \TextUsage\GlossaryPrologue\ and \TextUsage\GlossaryParms\ macros are
% analagous to the |\Index...| versions [see
% sec.~\gmiflink[IndexParams]{The Parameters}
% p.\,\pageref*{IndexParams}]. (The \LaTeX\ `glossary' 
% mechanism is used for the change entries.)
% \end{quotation}
%
% In \gmdoc\ |\changes| is |\outer|.
%
% \stanza
% As mentioned in the introduction, the glossary, the changes history
% that is, uses a~special MakeIndex style, \pk{gmglo.ist}. This style
% declares another set of the control chars but you don't have to
% worry: |\changes| takes care of setting them properly. To be
% precise, |\changes| executes \TextUsage\MakeGlossaryControls\ that
% is defined as
% \begin{verbatim}
%  \def\actualchar{=} \def\quotechar{!}%
%  \def\levelchar{>} \edef\encapchar{\twelveclub}
%\end{verbatim}
%
% Only if you
% want to add a~control character yourself in a~changes entry, to quote
% some char, that is (using level or encapsulation chars is not
% recommended since |\changes| uses them itself), use rather
% |\quotechar|.
%
% \stanza
% Before writing an entry to the \pk{.glo} file, |\changes|
% checks if the date (the second mandatory\equals the third argument)
% is later than the date stored in the counter
% \TextUsage*{ChangesStartDate}. You may set this counter with a
% \Describe\ChangesStart^^B
% \[\hbox{|\ChangesStart{|\<version>|}{|\<year>|/|\<month>|/|\<day>|}|}\]
% declaration.
%
% If the \env{ChangesStartDate} is set to a~date contemporary to \TeX\
% i.e., not earlier than September 1982\footnote{DEK in \textit{\TeX\ ^^B
% The Program} mentions that month as of \TeX\ Version 0 release.},
% then a~note shall appear at the beginning of the changes history
% that informs the reader of ommitting the earlier changes entries.
%
% If the date stored in \env{ChangesStartDate} is earlier than \TeX,
% no notification of ommitting shall be printed. This is intended for
% a~rather tricky usage of the changes start date feature: you may
% establish two threads of the changes history: the one for the users,
% dated with four digit year, and the other for yourself only, dated
% with two or three digit year. If you declare 
% \[\hbox{|\ChangesStart{|\<version?>|}{1000/00/00}|}\]
% or so, the changes entries dated with less-than-four digit year
% shall be ommitted and no notification shall be issued of that.
%
% \stanza
%
% While scanning the CSs in the code, \gmdoc\ counts them and prints
% the information about their number on the terminal and in
% \pk{.log}. Moreover, you may declare
% \TextUsage\CheckSum|{|\<number>|}| before the code and \TeX\ will
% inform you whether the number stated by you is
% correct or not, and what it is. As you guess, it's not my original idea
% but I~took it from \docfm. 
%
% There it is provided as a~tool for
% testing whether the file is corrupted. 
% My \TeX\ Guru says it's a~bit old-fashioned nowadays but I~like the
% idea and use it to document the file's growth. For this purpose
% \gmdoc\ types out lines like
% \begin{verbatim}
%% \chschange{v0.98j}{2006/10/19}{4372}
%% \chschange{v0.98j}{06/10/19}{4372}
%\end{verbatim}
% and you may place them at the beginning of the source file. Such
% a~line results in setting the check sum to the number contained in
% the last pair of braces and in making a~`general' changes entry that
% states the check sum for version \<first brace> dated \<second ^^B
% brace> was \<third brace>.
%
% \subdivision{The Parameters}
%
% The \pk{gmdoc} package provides some parameters specific to
% typesetting the \TeX\ code:
%
% \stanza
% \TextUsage\stanzaskip\ is a~vertical space inserted when a~blank
% (code) line is met. It's equal |0.75\medskipamount| by default
% (with the \emph{entire} |\medskipamount|'s stretch- and
% shrinkability). Subsequent blank code lines do not increase this
% space.
%
% At the points where narration begins a~new line after the code or an
% inline comment and where a~new code line begins after the narration
% (that is not an inline comment), a~\TextUsage\CodeTopsep\ glue is
% added. At the beginning and the end of a~\env{macro} or
% \env{environment} environment a~|\MacroTopsep| glue is added. By
% default, these two skips are set equal |\stanzaskip|. 
%
% The |\stanzaskip|'s value is assigned also to the display skips and
% to |\topsep|. This is done with the \TextUsage\UniformSkips\
% declaration executed by default. If you want to change some of those
% values, you should declare \TextUsage\NonUniformSkips\ in the
% preamble to discard the default declaration. (To be more precise, by
% default |\UniformSkips| is executed twice: when loading \gmdoc\ and
% again |\AtBeginDocument| to allow you to change |\stanzaskip| and
% have the other glues set due to it. |\NonUniformSkips| relaxes the
% |\UniformSkips|'s occurrence at |\begin{document}|.)
%
% If you want to add a~vertical space of |\CodeTopsep| (equal by
% default |\stanzaskip|), you are provided the \TextUsage\stanza\
% command. Similarly, if you want to add a~vertical space of the
% |\MacroTopsep| amount (by default also equal |\stanzaskip|), you are
% given the \TextUsage\chunkskip\ command. They both act analogously
% to |\addvspace| i.e., don't add two consecutive glues but put the
% bigger of them.
%
% Since |\CodeTopsep| glue is inserted automatically at each
% transition from the code (or code with an inline comment) to the
% narration and reverse, it may happen that you want not to add such
% a~glue exceptionally. Then there's the \TextUsage\nostanza\
% command.
%
% \stanza
% The \TeX\ code is indented with the \TextUsage\CodeIndent\ glue
% and a~leading space increases indentation of the line by its
% (space's) width. The default value of |\CodeIndent| is 1.5\,em.
%
% There's also a~parameter for the indent of the narration,
% \TextUsage\TextIndent, but you should use it only in emergency
% (otherwise what would be the margins for?). It's 0\,sp by default.
%
% \stanza
% By default, typesetting a~|\DocInput/Include|d file is ended with
% a~codeline containing the text `\EOFMark' given by the
% \TextUsage\EOFMark\ macro. If you don't like such an ending, you
% should end the source file with the \TextUsage\NoEOF\ macro in
% a~comment, i.e.,
% \[\hbox{|%|\<some text, why not>|\NoEOF|}\]
%   This macro redefines |\EOFMark| and suppresses the End
% Of File token to close the input properly. It also has the
% |\endinput| effect so you may put some text you don't want to 
% document after it.
%
% \stanza
%
% The crucial concept of \gmdoc\ is to use the line end character
% as a~verbatim group opener and the comment char, usually the |%|, as
% its delimiter. Therefore the `knowledge' what char starts
% a~commentary is for this package crucial and utterly
% important. The default assumption is that you use |%| as we
% all do. So, if you use another character, then you should declare it
% with \TextUsage\CodeDelim\ typing the desired char
% preceded by a~backslash, e.g., |\CodeDelim\&|\,. (As just
% mentioned implicitly, \possfil|\CodeDelim\%| is declared by
% deafult.) 
%
% This declaration is always global so when- and wherever you change
% your mind you should express it with a~new |\CodeDelim|
% declaration.
%
% The plain (unstarred) version of |\CodeDelim| changes also the verb
% `hyphen', the char appearing at the verbatim line breaks that is. If
% you don't want to change the verb `hyphen', use |\CodeDelim*|.
%
% \stanza
% Talking of special chars, the escape char, |\| by default, is also
% very important for this package as it marks control sequences and
% allows automatic indexing them for instance. Therefore, if you for
% any reason choose another than |\| character to be the escape char,
% you should tell \pk{gmdoc} about it with the
% \TextUsage\CodeEscapeChar\ declaration. As the previous one, this too
% takes its argument preceded by a~backslash,
% e.g., |\CodeEscapeChar\!|. (As you may deduct from the above,
% |\CodeEscapeChar\\| is declared by default.)
%
% The tradition is that in the packages |@| char is a~letter
% i.e., of catcode \catletter. Frank Mittelbach in \docfm\ takes into account
% a~possibility that a~user wishes some other chars to be letters,
% too, and therefore he (F.M.) provides the
% \TextUsage\MakePrivateLetters\ macro.  
% So do I~and like in \docfm, this macro makes |@| sign a~letter. It
%  also makes  |*| a~letter in order to cover the starred versions
% of commands.
%
% Analogously but for a~slightly different purpose, the
% \TextUsage\AddtoPrivateOthers\ macro is provided here. It adds its
% argument, which is supposed to be a~one-char CS, to the
% |\doprivateothers| list, whose r\^ole is to allow some special chars
% to appear in the marking commands' arguments (the commands described
% in section \gmiflink{Macros for Marking the Macros}). The default
% contents of this list is | | (the space) and |^| so you may mark the
% environments names and special sequences like |^^A| safely. This
% list is also extended with every char that is |\MakeShortVerb|ed.
% (I~don't see a~need of removing chars from this list, but if
% you do, please let me know.)
%
% \stanza
% The line numbers (if enabled) are typeset in the
% \TextUsage\LineNumFont\ declaration's scope, which
% is defined as |{\normalfont\tiny}| by default. Let us also remember, that for
% each counter there is a~|\the|\<counter> macro available. The
% counter for the line numbers is called \TextUsage*{codelinenum} so
% the macro printing it is |\thecodelinenum|. By default we don't
% change its \LaTeX's definition which is equivalent
% |\arabic{codelinenum}|.
%
%
% Three more parameter macros, are \TextUsage\IndexPrefix,
% \TextUsage\EntryPrefix\ and \TextUsage\HLPrefix. All three are
% provided with the account of  including multiple files in one
% document. 
% They are equal (almost) |\@empty| by default. The first may store
% main level index entry of which all indexed macros and environments
% would be subentries, e.g., the name of the package. The third may or
% even should store a~text to distinguish equal codeline numbers of
% distinct source files. It may be the file name too, of course. The
% second macro is intended for another concept, namely the one from
% \pk{ltxdoc} class, to distinguish the codeline numbers from
% different files \emph{in the index} by the file marker. Anyway, if
% you document just one file per document, there's no need of
% redefining those macros, nor when you input multiple files with
% |\DocInclude|.
%
% \pk{gmdoc} automatically indexes the control sequences
% occurring in the code. Their index entries may be `common' or
% distinguished in two (more) ways. The concept is to distinguish the
% entries indicating the \emph{usage} of the CS and the entries
% indicating the \emph{definition} of the CS.
%
% The special formattings of `usage' and `def' index entries are
% determined by \TextUsage\UsgEntry\ and \TextUsage\DefEntry\
% one-parameter macros (the parameter shall be substituted with the
% reference number) and by default are defined as |\textit| and
% |\underline| respectively (as in \docfm).
%
% There's one more parameter macro, \TextUsage\CommonEntryCmd\ that
% stores the name of the encapsulation for the `common' index
% entries (not special) i.e., a~word that'll become a~CS that will 
% be put before an entry in the \file{.ind} file. By default it's defined
% as |{relax}| and a~nontrivial use of it you may see in line
% \ref{UsgHack} of the driver file of this documentation, where it
% makes all the index entries of the driver's code are formatted as `usage'.
%
% \stanza
% ^^A~Index Parameters
% \gmhypertarget[IndexParams]{The index} comes in a~\env{multicols}
% environment whose columns number is determined by the
% \TextUsage*{IndexColumns} counter set by default to~3. To save space,
% the index begins at the same page as the previous text provided
% there is at least \TextUsage\IndexMin\ of the page height free. By
% default, |\IndexMin|\equals\the\IndexMin.
%
% The text put at the beginning of the index is declared with
% a~one-argument \TextUsage\IndexPrologue. Its default text at current
% index option you may \gmiflink[DIPrologue]{admire} on page
% \pageref*{DIPrologue}.^^A
% \AtDIPrologue{\raisebox{4cm}[0sp][0sp]{\gmhypertarget[DIPrologue]}}
% Of course, 
% you may write your own |\IndexPrologue{|\<brand new index ^^B
% prologue>|}|, but if you like the default and want only to add
% something to it, you are provided \TextUsage\AtDIPrologue\
% one-argument declaration that adds the stuff after the default
% text. For instance, I~used it to add a~label and hypertarget that is
% referred to two sentences earlier.
%
% By default the colour of the index entry hyperlinks is set black to
% let Adobe Reader work faster. If you don't want this,
% \Describe\IndexLinksBlack|\let\IndexLinksBlack\relax|. That leaves
% the index links colour alone and hides
% the text about black links from the default index prologue.
%
% Other index parameters are set with the \TextUsage\IndexParms\ macro
% defined in line \gmifref[IndexParms]{sixty-odd} of the code. If you
% want to change some of them, you don't have to use
% |\renewcommand*\IndexParms| and set all of the parameters: you may
% \Describe\gaddtomacro^^A
% |\gaddtomacro\IndexParms{|\<only the desired changes>|}|.
% (|\gaddtomacro| is an alias for \LaTeX's |\g@addto@macro| provided
% by \pk{gmutils}.)
%
% At the default \gmdoc\ settings the \file{.idx} file is prepared for
% the default settings of MakeIndex (no special style). Therefore the
% index control chars are as usual. But if you need to use other
% chars as MakeIndex controls, know that they are stored in the four
% macros: \TextUsage\actualchar, \TextUsage\quotechar,
% \TextUsage\levelchar\ and \TextUsage\encapchar\ whose meaning you
% infer from their names.  Any redefinition of them \emph{should be ^^B 
% done in the preamble} because the first usage of them takes place at
% |\begin{document}| and on it depends further tests telling \TeX\
%   what characters of a~scanned CS name it should quote before
%   writing it to the \pk{.idx} file.
% 
% \stanza
% Frank Mittelbach in \docfm\ provides the |\verbatimchar| macro to
% (re)define the |\verb|'s delimiter for the index entries of the
% scanned CS names etc. \gmdoc\ also uses \TextUsage\verbatimchar\ but
% defines it as |{&}|. Moreover, a~macro that wraps a~CS name in |\verb|
% checks whether the wrapped CS isn't |\&| and if it is, |$| is taken
% as the delimiter. So there's hardly chance that you'll need to
% redefine |\verbatimchar|.
%
% So strange delimiters are chosen deliberately to allow any `other'
% chars in the environments names.
%
% \stanza
% There's a~quadratus of commands taken from \docfm:
% \TextUsage\StopEventually, \TextUsage\Finale,
% \TextUsage\AlsoImplementation\ and \TextUsage\OnlyDescription\ that
% should be 
% explained simultaneously (in a~polyphonic song
% e.g.).
%
% The |\OnlyDescription| and |\AlsoImplementation|
% declarations are intended to  exclude or include the code part from
% the documentation. The point between the description and the
% implementation part should be marked with |\StopEventually{|\<the ^^B
% stuff to be executed anyway>|}| and |\Finale| should be typed
% at the end of file. Then |\OnlyDescription| defines
% |\StopEventually| to expand to its argument followed by |\endinput|
% and |\AlsoImplementation| defines |\StopEventually| to do nothing
% but pass its argument to |\Finale|.
%
%
% \subdivision{The Narration Macros}
%
% To print the control sequences' names you have the \TextUsage\verb\ macro and
% its `shortverb' version whatever you define. But they won't work if
% you put them in an argument of another macro. For such a~situation,
% or if you just prefer, \gmdoc\ (\pk{gmutils}) provides a~robust command
% \TextUsage\cs, which takes one obligatory argument, the macro's name
% without the backslash, e.g., |\cs{mymacro}| produces
% \cs{mymacro}. I~take account of a~need of printing some other text
% verbatim, too, and therefore |\cs| has the first argument
% optional, which is the text to be typeset before the mandatory
% argument. It's the backslash by default, but if you wish to typeset
% something without the |\|, you may write {\verbeolOK |\cs[]{not
% a~macro}|}. Moreover, for typesetting the environments' names,
% \gmdoc\ (\pk{gmutils})
% provides the \TextUsage\env\ macro, that prints its argument
% verbatim and without a~backslash, e.g., |\env{an environment}|
% produces \env{an environment}.
%
% To print packages' names sans serif there is a~\TextUsage\pk\
% one-argument command, and the \TextUsage\file\ command intended for
% the filenames. 
%
% Because we play a~lot with the |\catcode|s here and want to talk
% about it, there are \TextUsage\catletter, \TextUsage\catother\ and
% \TextUsage\catactive\ macros that print \catletter, \catother\ and
% \catactive\ respectively to concisely mark the most used char
% categories.
%
% I~wish my self-documenting code to be able to be typeset each
% package separately or several in one document. Therefore I~need some
% `flexible' sectioning commands and here they are:
% \TextUsage\division\ and \TextUsage\subdivision\ so far, that by
% default are |\let| to be |\section| and |\subsection| if such
% commands are defined in the documentclass. (If not, |\division| and
% |\subdivision| are |\let| to be |\relax|.)
%
% \stanza
% One more kind of flexibility is to allow using \pk{mwcls} or the
% standard classes for the same file. There was a~trouble with the
% number and order of the optional arguments of the original
% \pk{mwcls}'s sectioning commands.
%
% It's resolved in \pk{gmutils} so you are free at this point, and
% even more free than in the standard classes: if you give
% a~sectioning command just one optional argument, it will be the
% title to toc and to the running head (that's standard in
% scls\footnote{See \pk{gmutils} for some subtle details.}). If you give
% \emph{two} optionals, the first will go to the running head and the
% other to toc. (In both cases the mandatory argument goes only to the
% page).
%
% \stanza
% If you wish the |\DocInclude|d files make other sectionings than the
% default, you may declare \TextUsage\SetFileDiv|{|\<sec name without ^^B
% backslash>|}|.
%
% \stanza
%
% \pk{gmdoc.sty} provides also an environment \TextUsage*{gmlonely}
% to wrap some text you think you may want to skip some day. When
% that day comes, you write \TextUsage\skipgmlonely\ before the
% instances of \env{gmlonely} you want to skip. This declaration has
% an optional argument which is for a~text that'll appear in(stead of) the
% first \env{gmlonely}'s instance in every |\DocInput| or
% |\DocInclude|d file within |\skipgmlonely|'s scope.
%
% An example of use you may see in this documentation: the repeated
% passages about the installation and compiling the documentation are
% skipped in further chapters thanks to it.
%
% \stanza
% \gmdoc\ provides some \TeX-related logos:\\
% \Describe\AmSTeX typesets \AmSTeX,\\
% \Describe\BibTeX\BibTeX,\\
% \Describe\SliTeX\SliTeX,\\
% \Describe\PlainTeX\PlainTeX,\\
% \Describe\Web\Web,\\
% \Describe\TeXbook\TeXbook,\par^^A~without par there raised error
% ^^A `too many unprocessed floats'.
% \noindent\Describe\eTeX\eTeX,\\
% \Describe\pdfeTeX\pdfeTeX\\
% \Describe\pdfTeX\pdfTeX\\
% \Describe\XeTeX\XeTeX\ (the first |E| will be reversed if the
% \pk{graphics} package is loaded) and\\
% \Describe\LaTeXpar\LaTeXpar.\par
% (The last logo is defined in \pk{gmutils}.)
%
% \noindent\Describe\ds\ds\ not quite a~logo, but still convenient.
%
% \stanza
% The \TextUsage*{copyrnote} environment is provided to format the
% copyright note flush left in |\obeylines|' scope.
%
% \stanza
%
% To put an arbitrary text into a~marginpar and have it flushed right
% just like the macros' names, you are provided the
% \TextUsage\gmdmarginpar\ macro that takes one and mandatory argument
% which is the contents of the marginpar.
%
% \stanza
% To make a~vertical space to separate some piece of text you are
% given two macros: \TextUsage\stanza\ and \TextUsage\chunkskip. The
% first adds |\stanzaskip| while the latter |\MacroTopsep|. Both of
% them take care of not cumulating the vspaces.
%
%
%\stanza
% The \TextUsage*{quotation} environment is redefined just to enclose
% its contents in double quotes.
% \stanza
%
% The \TextUsage\GetFileInfo|{|\<file name with extension>|}| command
% defines \TextUsage\filedate, \Describe\fileversion\cs{fil\-e\-vers\-ion} and
% \TextUsage\fileinfo\ as the respective pieces of the info (the
% optional argument) provided
% by \cs{Pro\-vid\-es\-Class/Pack\-age/Fi\-le} declarations. The
% information of the file you process with \gmdoc\
% is provided (and therefore getable) if the file is also loaded (or
% the |\Provide...| line occures in a~|\StraightEOL| scope).
%
% Since you may wish to process also files that you don't load,
% there are commands \TextUsage\ProvideFileInfo|{|\<file name with ^^B
% extension>|}[|\<info>|]| and
% \TextUsage\ProvideSelfInfo|[|\<info>|]|. (\<info> should consist of:
% \<year>|/|\<month>|/|\<day>| |\<version number>| |\<a~short note>.)
%
% A~macro for the standard note is provided, \TextUsage\filenote, that
% expands to ``This file has version number \<version number> dated
% \<date>.'' To place such a~note in the document's title (or heading,
% with |\DocInclude| at the default settings), there's
% \TextUsage\thfileinfo\ macro that puts |\fileinfo| in |\thanks|.
%
% \stanza
% Since |\noindent| didn't want to cooperate with my code and
% narration layers sometimes, I~provide \TextUsage\gmdnoindent\ that
% forces a~not indented paragraph if |\noindent| could not.
%
% \stanza
% If you declare the code delimiter other than |%| and then want |%|
% back, you may write \TextUsage\CDPerc\ instead of |\CodeDelim\%|.
%
% If you like |&| as the code delimiter (as I~did twice), you may write
% \TextUsage\CDAnd\ instead of |\CodeDelim\&|.
%
% 
%^^A \stanza
%^^A For an example driver file see chapter \gmiflink{The Driver}.
%
%
% \subdivision{A~Queerness of \cs{label}}
%
% You should be loyally informed that |\label| in \gmdoc\
% behaves slightly
% non-standard in the \cs{Doc\-In\-put/\:Inc\-lud\-e}d files:
% the automatic redefinitions of |\ref| at each code line
% are \emph{global} (since the code is typeset in groups and the
% |\ref|s will be out of those groups), so
% a~|\ref|erence in the narrative will point at the last code line not
% the last section, \emph{unlike} in the standard \LaTeX.
%
% 
% \subdivision{\docfm-Compatibility}
% 
% One of my goals while writing \gmdoc\ was to make compilation of
% \docfm-like files with \gmdoc\ possible. I~cannot guarantee the goal
% has been reached but I~\emph{did} compile \pk{doc.dtx} with not
% a~smallest change of that file (actually, there was a~tiny little buggie in
% line 3299 which I~fixed remotely with |\AfterMacrocode| tool written
% specially for that). So,
% if you wish to compile a~\docfm-like file with my humble package,
% just try.
%
% The \docfm\ commands most important in my opinion are supported by
% \gmdoc. Some commands, mostly the obsolete in my opinion, are not
% supported but give an info on the terminal and in \pk{.log}.
%
% I~assume that if one wishes to use \docfm's interface then \heshe\
% won't use \gmdoc's options but just the default. (Some \gmdoc\
% options may interfere with some \docfm\ commands, they may cancel
% them e.g.)
%
% \stanza
% The main input commands compatible with \docfm\ are
% \TextUsage\OldDocInput\ and \TextUsage\DocInclude, the latter
% however only in the \TextUsage\olddocIncludes\ declaration's scope.
%
% Within their scope/argument the \TextUsage*{macrocode} environments
% behave as in \docfm, i.e.\ they are a~kind of verbatim and require to be
% ended with |%    \end{macrocode(*)}|.
%
% The default behaviour of \env{macrocode(*)} with the `new' input
% commands is different however. Remember at te `new' fashion the code
% and narration layers philosophy is in force and that is sustained
% within \env{macrocode(*)}. Which means basically that with `new'
% settings when you write
%\begin{verbatim}
%% \begin{macrocode}
%  \alittlemacro % change it to \blaargh
%%\end{macrocode}
%\end{verbatim}
% and |\blaargh|'s definition is |{foo}|, you'll get
%\[\hbox{|\alittlemacro %| change it to foo}\]
% (Note that `my' \env{macrocode} doesn't require 
% the magical |%    \end|.)
%
% If you are used to the traditional (\docfm's) \env{macrocode} and still wish to
% use \gmdoc\ new way, you have at least two options: there is the
% \TextUsage*{oldmc} environment analogous to the traditional (\docfm's)
% \env{macrocode} (it also has the starred version), that's the first
% option (I~needed the traditional behaviour once in this
% documentation, find out where \& why). The other is to write
% \TextUsage\VerbMacrocodes. That declaration (OCSR) redefines 
% \env{macrocode} and \env{macrocode*} to behave the traditional way.
% (It's always executed by |\OldDocInput| and |\olddocIncludes|.)
%
% \stanza
% For a~more detailed discussion of what is \docfm-compatible and how,
% see the code section \gmiflink[doccompa]{\docfm-Compatibiliy}.
%
% \StopEventually{\NoEOF}
%
%
% \division{The Code}
%
%\iffalse For debug
\catcode`\^^C9\relax
% \fi
% \catcode`\^^C\active
%
% \changes[^^C]{v0.98g}{06/10/10}{recatcoded for debug: in the working
% pass it's made ignored and in the documenting pass it's made active}
%
%
% \DoIndex{\par \@@par}
% 
% The basic idea of this package is to re|\catcode| |^^M| (the line
% end char) and |%| (or any other comment char) so that they start and
% finish typesetting of what's between them as the \TeX\ code i.e.,
% verbatim and with the bells and whistles.
%
% The bells and whistles are (optional) numbering of the codelines,
% and automatic indexing the CSs, possibly with
% special format for the `def' and `usage' entries.
%
% As mentioned in the preface, this package aims at a~minimal markup
% of the working code. A~package author writes \hisher\ splendid code
% and adds a~brilliant comment in |%|ed lines and that's all. Of
% course, if \heshe\ wants tomake a~|\section| or |\emph|asise,
% \heshe\ has to type respective CSs.
%
% I~see the feature described above to be quite a~convenience,
% however it has some price. See section 
% \gmiflink[afc]{Life Among Queer EOLs}  for details,
% here I~state only that in my opinion the price is not very high.
% \stanza
%
% More detailedly, the idea is to make |^^M| (end of line char) active
% and to define it to check if the next char i.e., the beginnig of the
% next line is a~|%| and if so
% to gobble it and just continue usual typesetting or else to start
% a~verbatim scope. In fact, every such a~line end starts a~verbatim
% scope which is immediately closed, if the next line begins with
% (leading spaces and) the code delimiter.
%
% Further details are typographical parameters of verbatim scope and
% how to restore normal settings after such a~scope so that a~code
% line could be commented and still displayed, how to deal with
% leading spaces, how to allow breaking a~moving argument in two lines
% in the comment layer, how to index and marginpar macros etc.
%
%
%\subdivision{The Package Options}
%
% Maybe someone wants the code lines not to be numbered.
% \CodeDefIndex\if@linesnotnum
% \CodeDefIndex*\@linesnotnumtrue
% \CodeDefIndex*\@linesnotnumalse
\newif\if@linesnotnum
% \CodeDefine*{linesnotnum}
\DeclareOption{linesnotnum}{\@linesnotnumtrue}

% And maybe he or she wishes to declare resetting the line counter
% along with some sectioning counter  him/herself.
% \CodeDefIndex\if@uresetlinecount
% \CodeDefIndex*\@uresetlinecounttrue
% \CodeDefIndex*\@uresetlinecountfalse
\newif\if@uresetlinecount
% \CodeDefine*{uresetlinecount}
\DeclareOption{uresetlinecount}{\@uresetlinecounttrue}

% And let the user be given a~possibility to count the comment
% lines.
% \CodeDefIndex\if@countalllines
\newif\if@countalllines
% \CodeDefine*{countalllines}
\DeclareOption{countalllines}{\@countalllinestrue}

% Unlike in \docfm , indexing the macros is the default and the
% default reference is the code line number.
% \CodeDefIndex\if@noindex
% \CodeDefIndex*\@noindextrue
% \CodeDefIndex*\@noindexfalse
\newif\if@noindex
% \CodeDefine*{noindex}
\DeclareOption{noindex}{\@noindextrue}

% \CodeDefIndex\if@pageindex
% \CodeDefIndex*\@pageindextrue
% \CodeDefIndex*\@pageindexfalse
\newif\if@pageindex
% \CodeDefine*{pageindex}
\DeclareOption{pageindex}{\@pageindextrue}

% It would be a~great honour to me if someone would like to document
% \LaTeX\ source with this humble package but I~don't think it's
% really probable so let's make an option that'll switch index exclude
% list properly (see sec.\ \gmiflink{Index Exclude List}).
% \CodeDefIndex\if@indexallmacros
% \CodeDefIndex*\@indexallmacrostrue
% \CodeDefIndex*\@indexallmacrosfalse
\newif\if@indexallmacros
% \CodeDefine*{indexallmacros}
\DeclareOption{indexallmacros}{\@indexallmacrostrue}

% Some document classes don't support marginpars or disable them by
% default (as my favourite Marcin Woli\'nski's classes).
%
% \CodeDefIndex\if@marginparsused
% \changes{v0.98e}{06/09/23}{wrapped in \cs{@ifundefined} (a~bug fix:
%   before the bare \cs{newif} falsified the \cs{if@marginparsused}
%   switch when it had been defined and set True by the \pk{mwart}
%   class.)}
% \CodeDefIndex*\@marginparsusedtrue
% \CodeDefIndex*\@marginparsusedfalse
\@ifundefined{if@marginparsused}{\newif\if@marginparsused}{}
% This switch is copied from \pk{mwbk.cls} for compatibility with
% it. Thanks to it loading an \pk{mwcls} with |[withmarginpar]| option
% shall switch marginpars on in this package, too. 
%
% To be compatible with the standard classes, let's |\let|:
\@ifclassloaded{article}{\@marginparsusedtrue}{}
%\label{mparclause1}
\@ifclassloaded{report}{\@marginparsusedtrue}{}
\@ifclassloaded{book}{\@marginparsusedtrue}{}
% \label{mparclause2} And if you don't use \pk{mwcls} nor standard
% classes, then you have the options:\CodeDefine*{withmarginpar}
\DeclareOption{withmarginpar}{\@marginparsusedtrue}
%\CodeDefine*{nomarginpar}
\DeclareOption{nomarginpar}{\@marginparsusedfalse}
% The order of the above conditional switches and options is significant.
% Thanks to it the options are available also in the
% standard classes and in \pk{mwcls}.
%
% \stanza
% To make the code spaces blank (they are visible by default except
% the leading ones).
% \CodeDefIndex\if@codespacesblank
\newif\if@codespacesblank
% \CodeDefine*{codespacesblank}
\DeclareOption{codespacesblank}{\@codespacesblanktrue}


\ProcessOptions


% \subdivision{The Dependencies and Preliminaries}
%
% We require another package of mine that provides some tricky macros
% analogous to the \LaTeX\ standard ones, such as |\newgif| and
% |\@ifnextcat|.
\RequirePackage{gmutils}

% A~standard package for defining colours,
\RequirePackage{color}
% and a~colour definition for the hyperlinks not to be too bright
\definecolor{deepblue}{rgb}{0,0,.85}

% And the standard package probably most important for \gmdoc:
% If the user doesn't load \pk{hyperref} with \hisher\ favourite
% options, we do, with \emph{ours}. If \heshe\ has
% done it, we change only the links' colour.
% 
% \changes{v0.97}{06/09/04}{linkcolor made deep blue}
\@ifpackageloaded{hyperref}{\hypersetup{colorlinks=true,
    linkcolor=deepblue, urlcolor=blue, filecolor=blue}}{%
  \RequirePackage[colorlinks=true, linkcolor=deepblue, urlcolor=blue,
  filecolor=blue, pdfstartview=FitH, pdfview=FitBH,
  pdfpagemode=None]{hyperref}}

% Now a~little addition to \pk{hyperref}, a~conditional hyperlinking
% possibility with the |\gmhypertarget| and |\gmiflink| macros. It
% \emph{has} to be loaded \emph{after} \pk{hyperref}.
\RequirePackage{gmiflink}
% And a~slight redefinition of \env{verbatim}, |\verb(*)| and
% providing of |\MakeShortVerb(*)|.
\RequirePackage{gmverb}

\if@noindex
  \AtBeginDocument{\gag@index}% for the latter macro see line
  % \ref{gag@index}.
\else
   \RequirePackage{makeidx}\makeindex
\fi

% Now, a~crucial statement about the code delimiter in the input file.
% Providing a~special declaration for the assignment is intended for
% documenting the packages that play with |%|'s
% |\catcode|. Some macros for such plays are defined
% \gmiflink[CDAnd]{further}.
%
% The declaration comes in the starred and unstarred version. The
% unstarred version besides declaring the code delimiter declares
% the same char as the verb(atim) `hyphen'. The starred version
% doesn't change the verb 'hyphen'. That is intended for the special
% tricks e.g.\ for the \env{oldmc} environment.
%
% If you want to change the verb `hyphen', there is the
% |\VerbHyphen\|\<char> 
% declaration provided by \pk{gmverb}.
% 
% \changes{v0.98c}{06/9/8}{\cs{CodeDelim} renamed from a~rather confusing
% \cs{NewCommentChar}; also the internal \cs{code@delim} is renamed
% from as much confusing \cs{commentchar} and a~\cs{glet} for
% \cs{verb}s \cs{verbhyphen} is added; similarly
% \cs{[Un]CodeDelimAnd} renamed from \cs{[un]commentand}}
%
% \changes{v0.98m}{06/11/10}{\cs{CDAnd} and \cs{CDPerc} renamed from
% \cs{CodeDelimAnd} and \cs{UnCodeDelimAnd} and both those commands
% simplified to just declaring the code delimiter}
%
% \changes{v0.99a}{06/12/1}{split into the starred and unstarred
% versions}
%
% \CodeDefine\CodeDelim \CodeDefine\code@delim
\def\CodeDelim{\@ifstar{\Code@Delim}{\Code@Delim@St}}

\def\Code@Delim#1{%
  {\escapechar\m@ne
    \expandafter\gdef\expandafter\code@delim\expandafter{\string#1}}}

\def\Code@Delim@St#1{\Code@Delim{#1}\VerbHyphen{#1}}

% It is an invariant of \gmdoc ing that |\code@delim| stores the
% current code delimiter (of catcode 12).
%
% The |\code@delim| should be \catother\ so a~space is not allowed as
% a~code delimiter. I~don't think it \emph{really} to be a~limitation.
%
% And let's assume you do as we all do:
\CodeDelim\%

% We'll play with |\everypar|, a~bit, and if you use such things as
% the |{itemize}| environment, an error would occure if we didn't
% store the previous value of |\everypar| and didn't restore it at
% return to the narration. So let's assign a~|\toks| list to store the
% original |\everypar|
% \CodeDefIndex\gmd@preverypar
\newtoks\gmd@preverypar 

% \CodeDefIndex\settexcodehangi
\newcommand*\settexcodehangi{%
  \hangindent=\verbatimhangindent \hangafter=\@ne}% we'll use
% it in the inline comment case. |\verbatimhangindent| is provided by the
% \pk{gmverb} package and\equals3\,em by default.
% \CodeDefIndex\@@settexcodehangi
\@ifdefinable\@@settexcodehangi{\let\@@settexcodehangi=\settexcodehangi}
%^^A~\gmdeverycodeline{\@@settexcodehangi}

% We'll play a~bit with |\leftskip|, so let the user have a~parameter
% instead. For normal text (i.e.\ the comment):
% \CodeDefine\TextIndent
\newlength\TextIndent
% I~assume it's originally equal |\leftskip|, i.e.\ |\z@|. And for
% the \TeX\ code:
\newlength\CodeIndent
%\label{CodeIndent}
% \CodeDefine\CodeIndent
\CodeIndent=1,5em\relax
% And the vertical space to be inserted where there are blank lines in the
% source code:
\@ifundefined{stanzaskip}{\newlength\stanzaskip}{}
% I~use |\stanzaskip| in \pk{gmverse} package and
% derivates for typesetting poetry. A~computer program code \emph{is}
% poetry.
% \CodeDefine\stanzaskip
\stanzaskip=\medskipamount
\advance\stanzaskip by-.25\medskipamount% to preserve the stretch- and
% shrinkability.\par
%
%\stanza
% A~vertical space between the commentary and the code seems
% to enhance readability so declare
\newskip\CodeTopsep
\newskip\MacroTopsep

% And let's set them.  For the \ae sthetical
% minimality\StraightEOL\footnote{The terms `minimal' and `minimalist'
%   used in \gmdoc\ are among others\ inspired by the \emph{South Park}
%   cartoon's episode \emph{Mr.\ Hankey The~Christmas (\dots)}\/ in
%   which `Philip Glass, a~Minimalist New York composer' appears in
%   a~`non-denominational non-offensive Christmas play' ^^A(
%   ;-)\,. (Philip Glass composed the music to the \emph{Qatsi}
%   trilogy among others)}\QueerEOL\ let's unify them and other most important
% vertical spaces used in \gmdoc. I~think a~macro that gathers all
% these assignments may be handy.  
% \CodeDefine\MacroTopsep 
% \CodeDefine\CodeTopsep
% \CodeDefine\UniformSkips
\def\UniformSkips{%\label{UniformSkips}
  % \CodeDefine\CodeTopsep \CodeDefine\MacroTopsep
  \CodeTopsep=\stanzaskip
  \MacroTopsep=\stanzaskip
  \abovedisplayskip=\stanzaskip
  %\nostanza
  % \leftskip0sp \noindent |%\abovedisplayshortskip|
  % remains untouched as it is 0.0\,pt plus 3.0\,pt by default.\par
  % 
  % \nostanza
  \belowdisplayskip=\stanzaskip
  \belowdisplayshortskip=.5\stanzaskip% due to DEK's idea of making the
  % short below display skip half of the normal.
  \advance\belowdisplayshortskip by\smallskipamount
  \advance\belowdisplayshortskip by-1\smallskipamount% We advance
  % \nlpercent\cs{be\+low\+dis\+play\+short\+skip} forth and back to
  % give it the \nlpercent\cs{small\+skip\+am\+ount}'s shrink- and
  % stretchability components.
  \topsep=\stanzaskip
  \partopsep=\z@
}
% We make it the default,
\UniformSkips
% \gmdnoindent but we allow you to change the benchmark glue
% i.e., |\stanzaskip| in the preamble and still have the other glues
% set due to it: we launch |\UniformSkips| again after the
% preamble. 
\AtBeginDocument{\UniformSkips}

% So, if you don't want them at all i.e., you don't want to set other
% glues due to |\stanzaskip|, you should use the following
% declaration. That shall discard the unwanted setting already placed
% in the |\begin{document}| hook.
%
% \CodeDefine\NonUniformSkips
\newcommand*\NonUniformSkips{\@relaxen\UniformSkips}
% Why do we launch |\UniformSkips| twice then? The first time is
% to set all the \gmdoc-specific glues \emph{somehow}, which allows
% you to set not all of them, and the second
% time to set them due to a~possible change of |\stanzaskip|.
%
% \stanza
% And let's define a~macro to insert a~space
% for a~chunk of documentation, e.g., to mark the beginning of new
% macro's explanation and code.
% \CodeDefine\chunkskip
\newcommand*\chunkskip{%
  \skip0=\MacroTopsep
  \if@codeskipput\advance\skip0 by-\CodeTopsep\fi
  \par\addvspace{\skip0}\@codeskipputgtrue}

% And, for a~smaller part of text,
% \CodeDefine\stanza
\newcommand*\stanza{%
  \skip0=\stanzaskip
  \if@codeskipput\advance\skip0 by-\CodeTopsep\fi
  \par\addvspace{\skip0}\@codeskipputgtrue}

% Since the stanza skips are inserted automatically most often (cf.\ lines
% \ref{codeskip}, \ref{codeskip2}, \ref{codeskip3}, \ref{codeskip4},
% \ref{codeskip5}), sometimes you may need to forbid them.
% \CodeDefine\nostanza
\newcommand*\nostanza{%
  \@codeskipputgtrue\@afternarrgfalse\@aftercodegtrue}% In the `code
% to narration' case the first switch is enough but in the countercase
% `narration to code' both the second and third are necessary while
% the first is not.
%
%
% To count the lines where they have begun not before them
% \CodeDefine\if@newline \CodeDefine*\@newlinegtrue
% \CodeDefine*\@newlinegfalse
\newgif\if@newline
% |\newgif| is |\newif| with global effect i.e., it defines |\...gtrue|
% and |\...gfalse| switchers that switch respective Boolean switch
% \emph{globally}. See \pk{gmutils} package for details.
% \stanza
%
% To handle the \ds\ directives not \emph{any} |%<...|.
% \CodeDefine*\if@dsdir
\newgif\if@dsdir
% This switch will be falsified at the first char of a~code line. (We
% need a~switch independent of the one indicationg whether the line
% has or has not been counted because of two reasons: 1.\ line
% numbering is optional, 2.\ counting the line falsifies that switch
% \emph{before} the first char.)
%
% \subdivision{The Core}
%
% Now we define main |\input|ing command that'll change catcodes.
% The macros used by it are defined later.
% 
% \CodeDefine\DocInput \CodeDefine\Doc@Input
% \changes{v0.98}{06/09/05}{\cs{@makeother\protect\bslash_} added}

\newcommand*\DocInput{\bgroup\@makeother\_\Doc@Input}

\begingroup\catcode`\^^M=\active%
\firstofone{\endgroup%
  \newcommand*{\Doc@Input}[1]{\egroup\begingroup%
  % \CodeDefIndex\gmd@inputname
    \edef\gmd@inputname{#1}% we'll use it in some notifications.
    % \CodeDefIndex\gmd@currentlabel@before
    \let\gmd@currentlabel@before=\@currentlabel% we store it 'cause
    % we'll do |\xdef|s of |\@currentlabel| to make proper references
    % to the line numbers so we want to restore current
    % |\@currentlabel| after our group.
    % \CodeUsgIndex\clubpenalty \CodeUsgIndex\widowpenalty
    \gmd@setclubpenalty% we wrapped the assignment of |\clubpenalty|
    % in a~macro because we'll repeat it twice more.
    \@clubpenalty\clubpenalty \widowpenalty=3333 % Most paragraphs of the code will be
    % one-line most probably and many of the narration, too.\par
    %\vskip-\stanzaskip
    % \changes[\DocInput]{v0.95}{06/08/15}{\cs{club-}
    % and \cs{widowpenalty} set both to 3333}
    %\CodeUsgIndex\tolerance
    \tolerance=1000 % as in \docfm.
    % \CodeUsgIndex\CodeSpacesBlank
    \if@codespacesblank\CodeSpacesBlank\fi% \label{cspb}The default is
    % that the code spaces are visible but here this may be cancelled
    % due to the \cs{co\+de\+spa\+ces\+blank} option.
    \catcode`\^^M=\active%
    % \CodeUsgIndex\code@delim
    \expandafter\@makeother\code@delim%
    % \CodeUsgIndex\gmd@resetlinecount
    \gmd@resetlinecount% due to the option |uresetlinecount|
    % we reset the linenumber counter or do nothing.
    % \CodeUsgIndex\@beginputhook
    \@beginputhook% my first use of it is to redefine |\maketitle|
    % just at this point not globally. \CodeUsgIndex\everypar
    \everypar=\expandafter{\expandafter\@codetonarrskip\the\everypar}%
    % \CodeDefine*{^^M}
    \let^^M=\gmd@textEOL%
    % \CodeDefIndex\gmd@guardedinput
    \edef\gmd@guardedinput{%
      \noexpand\@@input #1\relax% it's true \TeX's
      % |\input|. \CodeUsgIndex\EOFMark
      \noexpand\EOFMark% to pretty finish the input, see
      % line~\ref{eofMark}.\CodeUsgIndex\code@delim
      \noexpand^^M\code@delim%
      % \label{guardians}
    }% we add guardians after
    % |\input|ing a~file; somehow an error occurred without them.
    \catcode`\%=9 % for \docfm -compatibility.\label{ignorePercent}
    \setcounter{CheckSum}{0}% we initialize the counter for the number
    % of the escape chars (the assignment is |\global|).
    \expandafter\expandafter\expandafter^^M\gmd@guardedinput%\label{eeeEOL}
    \par%
    % \CodeUsgIndex\@endinputhook
    \@endinputhook% It's a~hook to let postpone
    % some stuff till the end of input. We use it e.g.\ for the
    % \docfm-(not)likeliness notifications.
    \glet\@currentlabel=\gmd@currentlabel@before% we restore
    % value from before this group. In a~very special case this could
    % cause unexpected behaviour of crossrefs, but anyway we acted
    % globally and so acts \pk{hyperref}.
    \endgroup%
  }% end of |\Doc@Input|'s definition.
}% end of |\firstofone|'s argument.

% So, having the main macro outlined, let's fill in the details.
%
% First, define the queer EOL. We define a~macro that |^^M| will be
% let to. |\gmd@textEOL|
% will be used also for checking the |%^^M| case (|\@ifnextchar|
% does |\ifx|).
%
% \CodeDefine\gmd@textEOL

\def\gmd@textEOL{ % a~space just like in normal \TeX. We put it first to
  % cooperate with \nlpercent|\^^M|'s |\expandafter\ignorespaces|. It's no
  % problem since a~space | |${}_{10}$ doesn't drive \TeX\ out of
  % the vmode.
  \ifhmode\@afternarrgtrue\@codeskipputgfalse\fi% being in
  % the horizontal mode means we've just typeset some narration so we
  % turn the respective switches: the one bringing the message `we are
  % after narration' to True (|@afternarr|) and the `we have put the
  % code-narration glue' to False (|@codeskipput|). Since we are in
  % a~verbatim group and the information should be brought outside it,
  % we switch the switches globally (the letter |g| in both).
  \@newlinegtrue% to |\refstep| the lines' counter at the proper
  % point.
  \@dsdirgtrue% to handle the \ds\ directives.
  \expandafter\@trimandstore\the\everypar\@trimandstore%we store the
  % previous value of |\everypar| register to restore it at
  % a~proper point. See line \ref{@trimandstore} for the details.
  \begingroup%^^A ##### maybe we prefer to restore the genuine |\par|
  % ^^A~before the group?
% ^^A      \let\gmd@narrpar\par% we store the possibly redefined |\par| to
% ^^A~typeset the previous narration appropriately.
% ^^A      \def\par{\gmd@narrpar\let\par\@@par}% the first |\par| will be
% ^^A~the one brought from the narration but then, 
  \gmd@setclubpenalty% Most paragraphs will be
  % one-line most probably. Since some sectioning commands may change
  % \nlpercent|\clubpenalty|, we set it again here and also after this
  % group.
  \aftergroup\gmd@setclubpenalty%
  \let\par\@@par% inside the verbatim group we wish |\par| to be genuine.
  % \CodeUsgIndex\ttverbatim
  \ttverbatim% it does |\tt| and makes specials
  % other or |\active|-and-breakable.
  \gmd@DoTeXCodeSpace%
  \@makeother\|% 'cause |\ttverbatim| doesn't do that.
  \MakePrivateLetters% see line \ref{MPL}.\par
  \expandafter\@makeother\code@delim% we are
  % almost sure the code comment char is among the chars having
  % been \catother ed already. For `almost' see the
  % \gmiflink[IndexInput]{\cs{IndexInput}} macro's definition.\par
  % So, we've opened a~verbatim group and want to peek at the next
  % character. If it's |%|, then we just continue narration, else we
  % process the leading spaces supposed there are any and, if after
  % them is a~|%|, we just continue the commentary as in the
  % previous case or else we typeset the \TeX\ code.
  \expandafter\@ifnextchar\expandafter{\code@delim}{%\label{ifContNarr}
    % \CodeUsgIndex\gmd@continuenarration
    \gmd@continuenarration}{% \CodeUsgIndex\gmd@dolspaces
    \gmd@dolspaces% it will launch |\gmd@typesettexcode|.
  }% end of |\@ifnextchar|'s else.
}% end of |\gmd@textEOL|'s definition.

\def\gmd@setclubpenalty{\clubpenalty=3333 }

% \stanza
% For convenient adding things to the begin- and endinput hooks:
% \CodeDefine\AtEndInput \CodeDefine\@endinputhook
\def\AtEndInput{\g@addto@macro\@endinputhook}
\def\@endinputhook{}
%\label{@endinputhook}
% Simili modo
% \CodeDefine\AtBegInput \CodeDefine\@beginputhook
\def\AtBegInput{\g@addto@macro\@beginputhook}
\def\@beginputhook{}

% And let's use it instantly to avoid a~disaster while reading in the
% table of contents.
% \CodeDefine\tableofcontents
% \CodeDefIndex\gmd@@toc
\AtBegInput{\let\gmd@@toc\tableofcontents
  \def\tableofcontents{% \label{straighttoc}
    \@ifQueerEOL{\StraightEOL\gmd@@toc\QueerEOL}{\gmd@@toc}}}

% As you'll learn from lines \ref{QueerEOL} and \ref{StraightEOL}, we
% use those two strange declarations to change and restore the very
% special meaning of the line end. Without such changes
% |\tableofcontents| would cause a~disaster (it did indeed). And to
% check the catcode of |^^M| is the r\^ole of |\@ifQueerEOL|:
%
% \changes{v0.98a}{06/09/06}{\cs{tableofcontents}, \cs{PrintIndex}
% and \cs{PrintChanges} modified to work properly in the `queer line
% ends' environment.}
% \CodeDefine\@ifQueerEOL
% \changes{v0.98a}{06/09/06}{added}
\long\def\@ifQueerEOL#1#2{%
  \ifnum\the\catcode`\^^M=\active \afterelsefi#1\else\afterfi#2\fi}

% \CodeDefine\AtBegInputOnce The declaration below is useful if you
% wish to put sth.\ just in the nearest input/included file and no
% else: at the moment of putting the stuff it will erase it from the
% hook. You may declare several |\AtBegInputOnce|s, they add up.
% \changes{v0.98a}{06/09/05}{The counter \cs[]{hook@oncecnt} added
%   to number the self-destructing cs's (thence the hooks add up) and
%   the prefix changed to \cs[]{gmd/AtBI/NeuroOncer}}
%
% \changes{v0.98l}{06/10/26}{After the Tiger's suggestion, defining
% a~unique macro for each use of \* substituted with just one macro in
% the begin input hook and adding to this macro.}
%
%^^A CodeDefine*{hook@oncecnt}
%^^A CodeDefIndex*\c@hook@oncecnt
%^^A\newcounter{hook@oncecnt}
% \CodeDefine\gmd@ABIOnce
\@emptify\gmd@ABIOnce
\AtBegInput\gmd@ABIOnce

\long\def\AtBegInputOnce#1{%
%^^A  \stepcounter{hook@oncecnt}%
%^^A  \expandafter\long\expandafter\edef% \CodeUsgIndex*{NeuroOncer}
%^^A    \csname gmd/AtBI/NeuroOncer\the\c@hook@oncecnt\endcsname{%
%^^A      \noexpand\glet\csname gmd/AtBI/NeuroOncer\the\c@hook@oncecnt\endcsname\relax}%
%^^A  \expandafter\addtomacro\csname gmd/AtBI/NeuroOncer\the\c@hook@oncecnt\endcsname{#1}%
%^^A  \expandafter\AtBegInput\csname gmd/AtBI/NeuroOncer\the\c@hook@oncecnt\endcsname
  \gaddtomacro\gmd@ABIOnce{\g@emptify\gmd@ABIOnce#1}}

% Many tries of finishing the input cleanly led me to setting the
% guardians as in line \ref{guardians} and to
% \CodeDefine\EOFMark
\def\EOFMark{\<eof>}
% \label{eofMark}Other solutions did print the last code delimiter or
% would require managing a~special case for the macros typesetting
% \TeX\ code to suppress the last line's numbering etc.
%
% If you don't like it, see line \ref{NoEOF}.
% \stanza
%
% Due to the |codespacesblank| option in the line \ref{cspb} we launch
% the macro defined below to change the meaning of a~\pk{gmdoc}-kernel
% macro.
% \CodeDefIndex\gmd@DoTeXCodeSpace
\begin{obeyspaces}%
\gdef\gmd@DoTeXCodeSpace{%
\obeyspaces\let =\breakabletwelvespace}%
% \stanza
% \CodeDefine\CodeSpacesBlank
% \changes{v0.98a}{06/09/06}{a~kernel \cs{gmd@verbatimspace} renamed
%   to \cs{gmd@texcodespace} and a~bug fixed.}
% \CodeUsgIndex\gmobeyspaces
% \CodeDefIndex\gmd@texcodespace
\gdef\CodeSpacesBlank{%
\let\gmd@DoTeXCodeSpace\gmobeyspaces%
\let\gmd@texcodespace=\ }% the latter |\let| is for the |\if...|s.
%\stanza
% \CodeDefine\CodeSpacesSmall
\gdef\CodeSpacesSmall{%
\def\gmd@DoTeXCodeSpace{%
\obeyspaces\def {\,\hskip\z@}}%
\def\gmd@texcodespace{\,\hskip\z@}}%
%
\end{obeyspaces}

% How the continuing of the narration should look like?
% \CodeDefIndex\gmd@continuenarration
\def\gmd@continuenarration{%
  \endgroup
  \gmd@countnarrationline% see \gmiflink[countnarr]{below}.
  \expandafter\@trimandstore\the\everypar\@trimandstore
  \everypar=\expandafter{\expandafter\@codetonarrskip\the\everypar}%
  \expandafter\gmd@checkifEOL\@gobble}
% Simple, isn't it? (We gobble the `other' code delimiter. Despite of
% |\egroup| it's \catother\ because it was touched by |\futurelet|
% contained in |\@ifnextchar| in line \ref{ifContNarr}. And in line
% \ref{ContNarr2} it's been read as \catother. That's why it
% works in spite of that |%| is of category `ignored'.)

%\gmhypertarget[countnarr]{Whether} we count the narration lines
% depends on the option |countalllines| which is off by default.
% \CodeDefIndex\gmd@countnarrationline
\if@countalllines
  \def\gmd@countnarrationline{%
    \if@newline
      \grefstepcounter{codelinenum}\@newlinegfalse% the
      % |\grefstepcounter| macro, defined in \pk{gmverb}, is a~global
      % version of |\refstepcounter|, observing the redefinition made
      % to |\refstepcounter| by \pk{hyperref}.
      \everypar=\expandafter{%
        \expandafter\@codetonarrskip\the\gmd@preverypar}%^^A
      % the \cs{hy\+p\+er\+lab\+el\+@\+li\+ne} macro puts
      % a~hypertarget in a~|\raise| i.e., drives \TeX\ into the
      % horizontal mode so |\everypar| shall be issued. Therefore we
      % should restore it.
      \hyperlabel@line
      {\LineNumFont\thecodelinenum}\,\ignorespaces
    \fi}% \CodeDefIndex\gmd@countnarrationline
\else
  \@emptify\gmd@countnarrationline%
\fi

% And typesetting the \TeX\ code?
\begingroup\catcode`\^^M=\active%
\firstofone{\endgroup% \CodeDefIndex\gmd@typesettexcode
  \def\gmd@typesettexcode{%
    \gmd@parfixclosingspace% it's to eat a~space closing the
    % paragraph, see \gmiflink[closingspace]{below}. It contains
    % |\par|.
    %
    % A~verbatim group has already been opened by \cs{ttverb\+at\+im} and
    % additional |\catcode|.
    \everypar={\@@settexcodehangi}% At first attempt we thought
    % of giving the user a~|\toks| list to insert at the beginning of
    % every code line, but what for?
    % \CodeDefine*{^^M}^^A
    \def^^M{%
      \@newlinegtrue% to |\refstep| the counter in proper place.
      \@dsdirgtrue% to handle the \ds\ directives.
      \global\gmd@closingspacewd=\z@% \label{noclosingspace}we
      % don't wish to eat a~closing space after a~codeline, 'cause
      % there isn't any and a~negative rigid |\hskip| added to
      % |\parfillskip| would produce a~blank line.
      \ifhmode\par\@codeskipputgfalse\else%
        \if@codeskipput%
        \else\addvspace{\stanzaskip}\@codeskipputgtrue%
        \fi% if we've just met a~blank (code) line, we insert
        % a~|\stanzaskip| glue.
        % \label{codeskip}
      \fi%
      \prevhmodegfalse% we want to know later that now we are in the
      % vmode. 
      \@ifnextchar{\gmd@texcodespace}{%
        \@dsdirgfalse\gmd@dolspaces}{\gmd@charbychar}%
    }% end of |^^M|'s definition.\label{debug!2}
    % \CodeDefIndex\gmd@texcodeEOL
    \let\gmd@texcodeEOL=^^M% for further checks inside |\gmd@charbychar|.
    \raggedright\leftskip=\CodeIndent%
    \if@aftercode\gmd@nocodeskip1{iaC}\else\if@afternarr%
    % ^^A~\def^^C{\showthe\hyphenpenalty\showthe\rightskip}
        \if@codeskipput\else\gmd@codeskip1\@codeskipputgtrue\@aftercodegfalse\fi%
        % \label{codeskip3}
    \else\gmd@nocodeskip1{naN}\fi\fi% if now we are
    % switching from the narration into the code, we insert a~proper
    % vertical space.
    \@aftercodegtrue\@afternarrgfalse%
    \ifdim\gmd@ldspaceswd>\z@% and here the leading spaces.
      \leavevmode\@dsdirgfalse%
      \if@newline\grefstepcounter{codelinenum}\@newlinegfalse%
      \fi%
      \printlinenumber% if we don't want the lines to be numbered,
      % the respective option \nlpercent|\let|s this CS to |\relax|.
      \hyperlabel@line%
      \mark@envir% index and/or marginize an environment if there is
      % some to be done so, see line \ref{mark@envir}.
      \hskip\gmd@ldspaceswd%
      \advance\hangindent by\gmd@ldspaceswd%
      \xdef\settexcodehangi{%
        \noexpand\hangindent=\the\hangindent% and also set the
        % hanging indent setting for the same line comment case. BTW.,
        % this |%| or rather lack of it costed me five hours of
        % debugging and rewriting. Active lineends require extreme
        % caution. 
        \noexpand\hangafter=1\space}%^^A~\noexpand\relax
    \else%
      \glet\settexcodehangi=\@@settexcodehangi%\\
      %|%| |\printlinenumber| here produced line numbers for blank lines
      % which is what we don't want.
    \fi% of |\ifdim|
    \gmd@ldspaceswd=\z@%
    \prevhmodegfalse% we have done |\par| so we are not in the
    % hmode.
    \@aftercodegtrue% we want to know later that now we are
    % typesetting a~codeline.
    \gmd@charbychar% we'll eat the code char by char to scan all the
    % macros and thus to deal properly with the case |\%| in which the
    % |%| will be scanned and won't
    % launch closing of the verbatim group.
  }%
}% end of |\gmd@typesettexcode|'s definitions's group's |\firstofone|.
%
% \stanza
%
% Now let's deal with the leading spaces once forever. We wish not to
% typeset | |s but to add the width of every leading space to the
% paragraph's indent and to the hanging indent, but only if there'll
% be any code character not being |%| in this line (e.g., the end of
% line). If there'll be only |%|, we want just to continue the comment
% or start a~new one. (We don't have to worry about whether we should
% |\par| or not.) 
% \CodeDefIndex\gmd@spacewd
\newlength\gmd@spacewd% to store the width of a~(leading) 
% | |\catother.
% \CodeDefIndex\gmd@ldspaceswd
\newlength\gmd@ldspaceswd% to store total length of gobbled leading
                          %spaces.

% It costed me some time to reach that in my verbatim scope a~space
% isn't \catother\ but \catactive, namely |\let| to
% |\breakabletwelvespace|.
% So let us |\let| for future:
% \CodeDefIndex\gmd@texcodespace
\let\gmd@texcodespace=\breakabletwelvespace
% And now let's try to deal with those spaces.
% \CodeDefIndex\gmd@dolspaces
\def\gmd@dolspaces{%
  \ifx\gmd@texcodespace\@let@token
    \@dsdirgfalse
    \afterelsefi\settowidth{\gmd@spacewd}{\twelvespace}%
    \gmd@ldspaceswd=\z@
    \gmd@eatlspace%
  \else\afterfi% about this smart macro and other of its family see
  % \pk{gmutils} sec.\,3.
    \par\gmd@typesettexcode
  \fi}

% And now, the iterating inner macro that'll eat the leading spaces.
% \CodeDefIndex\gmd@eatlspace
\def\gmd@eatlspace#1{%
  \ifx\gmd@texcodespace#1%
    \advance\gmd@ldspaceswd by\gmd@spacewd% we don't
    % |\advance| it |\global|ly 'cause the current group may be closed
    % iff we meet |%| and then we'll won't indent the line anyway.
    \afterelseiffifi\gmd@eatlspace
  \else
    \if\code@delim\noexpand#1%
      \gmd@ldspaceswd=\z@
      \gmd@continuenarration#1%\label{ContNarr2}
    \else \afterfifi\gmd@typesettexcode#1%
    \fi
  \fi}%

% We want to know whether we were in hmode before reading current
% |\code@delim|. We'll need to switch the switch globally.
% 
% \CodeDefine\ifprevhmode \CodeDefine*\prevhmodegtrue
% \CodeDefine*\prevhmodegfalse
\newgif\ifprevhmode

% \addvspace\medskipamount
%
% And the main iterating inner macro which eats every single char of
% verbatim text to check the end. The case |\%| should be excluded
% and it is indeed.
% \CodeDefine*\gmd@charbychar
\newcommand*\gmd@charbychar[1]{%
  \ifhmode\prevhmodegtrue
  \else\prevhmodegfalse\fi 
  \if\code@delim\noexpand#1%
    \afterelseiffifi\gmd@percenthack% to typeset |%| if a~comment
    % continues the~codeline.
    \endgroup%
    \gmd@checkifEOLmixd% to see if next is |^^M| and then do |\par|.
  \else% i.e., we've not met the code delimiter
    \if\code@escape@char\noexpand#1%
      \@dsdirgfalse% yes, just here not before the whole |\if| because
      % then we would discard checking for \ds\ directives doable by
      % the active |%| at the `old macrocode' setting.
      \afterelsefifi\gmd@counttheline#1\scan@macro
    \else
      \afterfifi\gmd@EOLorcharbychar#1%
    \fi
  \fi}

% One more inner macro because |^^M| in \TeX\ code wants to peek at the
% next char and possibly launch |\gmd@charbychar|. We deal with
% counting the lines thorougly. Increasing the counter is divided into
% cases and it's very low level in one case because |\refstepcounter| and
% |\stepcounter| added some stuff that caused blank lines, at
% least with \pk {hyperref} package loaded.
% \CodeDefIndex\gmd@EOLorcharbychar
\def\gmd@EOLorcharbychar#1{%
  \ifx\gmd@texcodeEOL#1%
    \if@newline
      \if@countalllines\global\advance\c@codelinenum by\@ne
      \@newlinegfalse\fi
    \fi
    \afterelsefi#1%\label{printhashone1}here we print |#1|.
  \else% i.e., |#1| is \emph{not} a~(very active) line end,
    \afterfi
    \gmd@counttheline#1\gmd@charbychar% \label{printhashone2}or here
    % we print |#1|. Here we would also possibly mark an environment
    % but there's no need of it because declaring an environment to
    % be marked requires a~bit of commentary and here we are after
    % a~code |^^M| with no commentary.
 \fi}

% \CodeDefIndex\gmd@counttheline
\def\gmd@counttheline{%
  \ifvmode
    \if@newline
      \grefstepcounter{codelinenum}\@newlinegfalse
      \hyperlabel@line
    \fi
    \printlinenumber
    \mark@envir
  \else
    \if@newline
      \grefstepcounter{codelinenum}\@newlinegfalse
      \hyperlabel@line
    \fi
  \fi}

% If before reading current |%| char we were in horizontal mode, then
% we wish to print |%| (or another code delimiter).
% \CodeDefIndex\gmd@percenthack
\def\gmd@percenthack{%
  \ifprevhmode\code@delim\aftergroup\space% We add a~space after |%|,
  % 'cause I~think it looks better. It's done |\aftergroup| to make
  % the spaces possible after the |%| not to be
  % typeset.
  \else\aftergroup\gmd@narrcheckifds@ne% remember that
  % \cs{gmd\-@\-pre\-cent\-hack} is only called when we've the code
  % delimiter and soon we'll close the verbatim group and right after
  % |\endgroup| there waits |\gmd@checkifEOLmixd|.
  \fi}

\def\gmd@narrcheckifds@ne#1{%^^A\typeout{narr@ne if ds \on@line}%
  \@dsdirgfalse\@ifnextchar<{%
    \expandafter\gmd@docstripdirective\@gobble}{#1}}

% The macro below is used to look for the |%^^M| case to make
% a~commented blank line make a~new paragraph.
% Long searched and very simple at last.
% \CodeDefIndex\gmd@checkifEOL
\def\gmd@checkifEOL{%
  \gmd@countnarrationline
  \everypar=\expandafter{\expandafter\@codetonarrskip% we add the
    % macro that'll insert a~vertical space if we leave the code and
    % enter the narration.
    \the\gmd@preverypar}%
  \@ifnextchar{\gmd@textEOL}{%
    \@dsdirgfalse\par\ignorespaces}{\gmd@narrcheckifds}}%

% We check if it's |%<|, a~\ds\ directive that is.
\def\gmd@narrcheckifds{%^^A\typeout{narr if ds \on@line}%
  \@dsdirgfalse\@ifnextchar<{%
    \expandafter\gmd@docstripdirective\@gobble}{\ignorespaces}}
    

% In the `mixed' line case it should be a~bit more complex, though. On
% the other hand, there's no need to checking for \ds\ directives.
% \CodeDefIndex\gmd@checkifEOLmixd
\def\gmd@checkifEOLmixd{%
  \gmd@countnarrationline
  \everypar=\expandafter{\expandafter\@codetonarrskip\the\gmd@preverypar}%
  % 
  % \label{longlinethatshouldbebroken}
  \@afternarrgfalse\@aftercodegtrue
  \ifhmode\@codeskipputgfalse\fi
  \@ifnextchar{\gmd@textEOL}{%
    {\raggedright\gmd@endpe\par}% without |\raggedright| this |\par|
    % would be justified which is not appropriate for a~long codeline
    % that should be broken, e.g., \ref{longlinethatshouldbebroken}.
    \prevhmodegfalse
    \gmd@endpe\ignorespaces}{% 
    % If a~codeline ends with |%|
    % (|prevhmode|${}=={}$True) first |\gmd@endpe| sets the parameters
    % at the \TeX\ code values and |\par| closes a~paragraph and the
    % latter |\gmd@endpe| sets the parameters at the narration values.
    % In the other case both |\gmd@endpe|s do the same
    % and |\par| between them does nothing.
    % \CodeDefIndex\par
    \def\par{%
      \ifhmode% (I~added this |\ifhmode| as a~result of a~heavy
      % debug.) 
%^^A      \typeout{par of 1766 in hmode \on@line}%
        \@@par
        \if@afternarr
          \if@aftercode
            \if@codeskipput\else\gmd@codeskip2\@aftercodegfalse\@codeskipputgtrue\fi
            %\label{codeskip4}
          \else\gmd@nocodeskip2{naC}%
          \fi
        \else\gmd@nocodeskip2{naN}%
        \fi
        \prevhmodegfalse\gmd@endpe% when taken out of |\ifhmode|, this
        % line caused some codeline numbers were typeset with
        % |\leftskip|${}=0$.
        \everypar=\expandafter{%
          \expandafter\@codetonarrskip\the\gmd@preverypar}%
        \let\par\@@par%
%^^A     else
%^^A        \typeout{par of 1766 in NOT hmode \on@line}%
      \fi}%
    \gmd@endpe\ignorespaces}}

% As we announced, we play with |\leftskip| inside the verbatim
% group and therefore we wish to restore normal |\leftskip| when back to
% normal text i.e.\ the commentary. But, if normal text starts in the
% same line as the code, then we still wish to indent such a~line.
% \CodeDefIndex\gmd@endpe
\def\gmd@endpe{%
  \ifprevhmode
    \settexcodehangi%\unskip ndent
    \leftskip=\CodeIndent
%^^A    \typeout{gmd@endpe in prevhmode \on@line}%
  \else
    \leftskip=\TextIndent
    \hangindent=\z@
    \everypar=\expandafter{%
      \expandafter\@codetonarrskip\the\gmd@preverypar}%
%^^A    \typeout{gmd@endpe in not prevhmode \on@line}%
  \fi}

%
%
% \subdivision{Numbering (or Not) of the Lines}
%
% Maybe you want codelines to be numbered and maybe you want to
% reset the counter within sections.
\if@uresetlinecount% with |uresetlinecount| option\dots
  \@relaxen\gmd@resetlinecount% \dots\  we turn
  % resetting the counter by \cs{Doc\+In\+put} off\dots
  \newcommand*\resetlinecountwith[1]{%
    % \CodeDefIndex*\c@codelinenum
    \newcounter{codelinenum}[#1]}% \dots\ and provide a~new
  % declaration of the counter.
\else% With the option turned off\dots \CodeDefine*{DocInputsCount}
  \newcounter{DocInputsCount}% \CodeDefine*{codelinenum}
  \newcounter{codelinenum}[DocInputsCount]% \dots\ we declare the
  % |\DocInput|s' number counter andthe codeline counter
  % to be reset with stepping of it.
  % \changes[\c@DocInputsCount]{v0.98c}{06/9/8}{added for fixing
  % duplication of \pk{hyperref} labels in the case of a~multiple
  % \cs{DocInput}}
  % \CodeDefine\gmd@resetlinecount
  \newcommand*\gmd@resetlinecount{\stepcounter{DocInputsCount}}% \dots 
  % and let the |\DocInput| increment the |\DocInput|s number count
  % and thus reset the codeline count. It's for unique naming of the
  % \pk{hyperref} labels.
\fi

% Let's define printing the line number as we did in \pk{gmvb}
% package.
% \CodeDefIndex\printlinenumber
\newcommand*\printlinenumber{%
  \leavevmode\llap{\rlap{\LineNumFont$\phantom{999}$\llap{\thecodelinenum}}%
    \hskip\leftskip}}
% \CodeDefine\LineNumFont
\def\LineNumFont{\normalfont\tiny}

\if@linesnotnum\@relaxen\printlinenumber\fi
% \CodeDefIndex\hyperlabel@line
\newcommand*\hyperlabel@line{%
  \if@pageindex% It's good to be able to switch it any time not just
  % define it once according to the value of the switch set by the
  % option.
  \else
    \raisebox{2ex}[1ex][\z@]{\gmhypertarget[clnum.%
      \HLPrefix\arabic{codelinenum}]{}}%
  \fi}

%
% \subdivision{Spacing with \cs{everypar}}
%
% Last but not least, let's define the macro inserting a~vertical space
% between the code and the narration.  Its parameter is
% a~\gmhypertarget[relic parameter]{relic} of a~very heavy debug of
% the automatic vspacing mechanism. Let it remain at least until this
% package is 2.0 version.  \CodeDefIndex\gmd@codeskip
\newcommand*\gmd@codeskip[1]{\@@par\addvspace\CodeTopsep\@codeskipputgtrue}
%\label{codeskip2}

% Sometimes we add the |\CodeTopsep| vertical space in
% |\everypar|. When this happens, first we remove the |\parindent|
% empty box, but this doesn't reverse putting |\parskip| to the main
% vertical list. And if |\parskip| is put, |\addvspace| shall see it
% not the `true' last skip. \Describe*{@codeskipput}Therefore we need
% a~Boolean switch to keep the knowledge of putting similar vskip
% before |\parskip|.
% \CodeDefine\if@codeskipput \CodeDefIndex*\@codeskipputgtrue
% \CodeDefIndex*\@codeskipputgfalse \CodeDefIndex*{@codeskipput}
\newgif\if@codeskipput

% The below is another relic of the heavy debug of the automatic
% vspacing. Let's give it the same removal clause as 
% \gmiflink[relic parameter]{above}. 
% \CodeDefIndex\gmd@nocodeskip
\newcommand*\gmd@nocodeskip[2]{}

% And here is how the two relic macros looked like during the
% debug. As you see, they are disabled by a~false |\if| (look at it
% closely ;-).
\if1 1
  \renewcommand*\gmd@codeskip[1]{%
    \hbox{\rule{1cm}{3pt} #1!!!}}
  \renewcommand*\gmd@nocodeskip[2]{%
    \hbox{\rule{1cm}{0.5pt} #1: #2 }}
\fi

% We'll wish to execute |\gmd@codeskip| wherever a~codeline (possibly with
% an inline comment) is followed by a~homogenic comment line or
% reverse. Let us dedicate a~Boolean switch to this then.
% \CodeDefine\if@aftercode \CodeDefine*\@aftercodegtrue
% \CodeDefine*\@aftercodegfalse
\newgif\if@aftercode
% This switch will be set true in the moments when we are able to
% switch from the \TeX\ code into the narration and the below one when
% we are able to switch reversely.
% \CodeDefine\if@afternarr \CodeDefine*\@afternarrgtrue
% \CodeDefine*\@afternarrgfalse
\newgif\if@afternarr

% To insert vertical glue between the \TeX\ code and the narration
% we'll be playing with |\everypar|. More precisely, we'll add a~macro
% that the |\parindent| box shall move and the glue shall put. 
% \CodeDefine\@codetonarrskip
\long\def\@codetonarrskip{%
  \if@codeskipput\else
    \if@afternarr\gmd@nocodeskip4{iaN}\else
      \if@aftercode
% We are at the beginning of |\everypar|, i.e., \TeX\ has just entered
% the hmode and put the |\parindent| box. Let's remove it then.
        {\setbox0=\lastbox}%
% Now we can put the vertical space and state we are not `aftercode'.
        \gmd@codeskip4\@codeskipputgtrue
        %\label{codeskip5}
        \leftskip\TextIndent% this line is a~patch against
        % a~bug-or-feature that in certain cases the narration |\leftskip|
        % is left equal the code leftskip. (It happens when there're
        % subsequent code lines after an inline comment not ended with
        % an explicit |\par|.)
        \else\gmd@nocodeskip4{naC}%
      \fi%
    \fi
  \fi\@aftercodegfalse}

% But we play with |\everypar| for other reasons too, and while restoring it,
% we don't want to add the |\@codetonarrskip| macro infinitely many
% times. So let us define a~macro that'll check if |\everypar| begins
% with |\@codetonarrskip| and trim it if so. We'll use this macro with
% proper |\expandafter|ing in order to give it the contents of
% |\everypar|. The work should be done in two steps first of which
% will be checking whether |\everypar| is nonempty (we can't have two
% delimited parameters for a~macro: if we define a~two-parameter
% macro, the first is undelimited so it has to be nonempty; it costed
% me some one hour to understand it).
% \CodeDefine\@trimandstore
% \CodeDefIndex\@trimandstore@hash
\long\def\@trimandstore#1\@trimandstore{%
  \def\@trimandstore@hash{#1}%
  \ifx\@trimandstore@hash\@empty% we check if |#1| is
  % nonempty. The |\if|\nlpercent*|\relax#1\relax| trick is not
  % recommended here because using it we couldn't avoid expanding |#1|
  % if it'd be expandable.
    \gmd@preverypar={}%
  \else
    \afterfi\expandafter\@trimandstore@ne\the\everypar\@trimandstore
  \fi}

% \CodeDefIndex\@trimandstore@ne
\long\def\@trimandstore@ne#1#2\@trimandstore{%\label{@trimandstore}
  \def\trimmed@everypar{#2}%
  \ifx\@codetonarrskip#1%
    \gmd@preverypar=\expandafter{\trimmed@everypar}%
  \else
    \gmd@preverypar=\expandafter{\the\everypar}%
  \fi}
% We prefer not to repeat |#1| and |#2| within the |\if|s and we even
% define an auxiliary macro because |\everypar| may contain some
% |\if|s or |\fi|s.
%
%
% \subdivision[Life Among Queer EOLs]{Life Among Queer \gmhypertarget[afc]{EOLs}}
%
% When I~showed this package to my \TeX\ Guru he commended it and
% immediately pointed some disadvantages in the comparison with the
% \docfm\ package.
%
% One of them was an expected difficulty of breaking a~moving argument
% (e.g., of a~sectioning macro) in two lines. To work it around let's
% define a~line-end eater:
\catcode`\^^B=\active% note we re|\catcode| \<char2> globally, for the
% entire document.
\bgroup\catcode`\^^M=\active%
\firstofone{\egroup% \CodeDefIndex\QueerCharTwo \CodeDefine*{^^B}
  \def\QueerCharTwo{\long\def^^B##1^^M{\ignorespaces}}}

\QueerCharTwo

\AtBegInput{\@ifQueerEOL{\catcode`\^^B\active}{}\QueerCharTwo}% \label{QCh2}
% We repeat redefinition of \<char2> at begin of the documenting
% input, because \pk{doc.dtx} suggests that some packages (namely
% \pk{inputenc}) may re|\catcode| such unusual characters.
%
% \changes{v0.98d}{06/9/11}{re\cs{catcode}ing and defining
% \cs{char1} and \cs{char2} added atto begin doc input}
%
% \stanza
% As you see the |^^B| active char is defined to gobble everything
% since itself till the end of line and the very end of line. This is
% intended for harmless continuing a~line. The price is affecting the
% line numbering when |countalllines| option is enabled.
%
% I~also liked the \docfm's idea of comment${}^2$ i.e., the
% possibility of marking some text so that it doesn't appear nor in the
% working version neither in the documentation, got by making
% |^^A| (i.e., \<char1>) a~comment char. 
%
% However, in this package such a~trick would work another way: here
% the line ends are active, a~comment char would disable them and that
% would cause disasters. So let's do it an |\active| way.
\catcode`\^^A=\active% note we re|\catcode| \<char1> globally, for the
% entire document.
\bgroup\catcode`\^^M=\active%
\firstofone{\egroup% \CodeDefIndex\QueerCharOne \CodeDefine*{^^A}
  \def\QueerCharOne{\long\def^^A##1^^M{\ignorespaces^^M}}}

\QueerCharOne

\AtBegInput{\@ifQueerEOL{\catcode`\^^A\active}\QueerCharOne}% see note
% after line \ref{QCh2}.


% As I~suggested in the users' guide, |\StraightEOL| and |\QueerEOL| are
% intended to cooperate in harmony for the user's good. They take care
% not only of redefining the line end but also these little things
% related to it.
%
% One usefulness of |\StraightEOL| is allowing linebreaking of the
% command arguments. Another making possible executing some code lines
% during the documentation pass.
%
% \changes{v0.98b}{06/09/07}{\cs{QueerM} and \cs{StraightM} renamed
% to \cs{QueerEOL} and \cs{StraightEOL} and other (internal) macros
% ending with \cs[]{M}}
% \CodeDefine\StraightEOL
\def\StraightEOL{%\label{StraightEOL}
  \catcode`\^^M=5\relax
  \catcode`\^^A=14\relax
  \catcode`\^^B=14\relax
  \def\^^M{\ }}

% \CodeDefine\QueerEOL
\def\QueerEOL{%\label{QueerEOL}
  \catcode`\^^M=\active
  \catcode`\^^A=\active
  \catcode`\^^B=\active% I~only re|\catcode| \<char1> and \<char2>
  % hoping no one but me is \emph{that} perverse to make them
  % |\active| and (re)define. (Let me know if I'm wrong at this point.)
  \let\^^M=\gmd@bslashEOL}

% \iffalse
% They won't work in \verb+|verbatim|+ scopes but the clubs redefine
% the active lineend to be a~breakable (and visible) space, so
% breaking a~`clubbed' text in two lines will not cause a~disaster but
% you get e.g., |...^^B %...|.
% \fi

% \gmhypertarget[closingspace]{To make} |^^M| behave more like a~`normal'
% lineend I~command it to add a~| |${}\subs{10}$ at first. It works
% but has one uwelcome feature: if the line has nearly |\textwidth|,
% this closing space may cause line breaking and setting a~blank line.
% To fix this I~|\advance| the |\parfillskip|:
% \CodeDefIndex\gmd@parfixclosingspace
\def\gmd@parfixclosingspace{{%
    \advance\parfillskip by-\gmd@closingspacewd\par}}
% We'll put it in a~group surrounding |\par| but we need to check if
% this |\par| is executed after narration or after the code,
% i.e., whether the closing space was added or not.
% \CodeDefIndex\gmd@closingspacewd
% \CodeDefIndex\gmd@setclosingspacewd
\newskip\gmd@closingspacewd
\newcommand*\gmd@setclosingspacewd{%
  \global\gmd@closingspacewd=\fontdimen2\font%
    plus\fontdimen3\font minus\fontdimen4\font\relax}
%
% See also line \ref{noclosingspace} to see what we do in the codeline
% case when no closing space is added.

% And one more detail:
\bgroup\catcode`\^^M=\active%
\firstofone{\egroup% \CodeDefIndex*{\^^M}
  \def\^^M{\ \expandafter\ignorespaces^^M}}
% To make |\^^M| behave properly. If this definition was ommitted, it
% would just expand to |\ | and thus not gobble the leading |%| of the
% next line leave alone typesetting the \TeX\ code.  I~type |\ | etc.
% instead of just |^^M| which adds a~space itself because I~take
% account of a~possibility of redefining the |\ | CS by the user, just
% like in normal \TeX.
% \CodeDefIndex\gmd@bslashEOL
\let\gmd@bslashEOL=\^^M
% We'll need it for restoring queer definitions for \docfm-compatibility.
%
%
% \subdivision{Adjustment of \env{verbatim} and \cs{verb}}
%
% To make \env{verbatim(*)} typeset its contents with the \TeX\ code's
% indentation: 
% \CodeDefIndex\@verbatim
\gaddtomacro\@verbatim{\leftskip=\CodeIndent}

% And a~one more little definition to accomodate |\verb| and pals for the
% lines commented out.
% \CodeDefIndex\check@percent
\AtBegInput{\long\def\check@percent#1{%
    \expandafter\ifx\code@delim#1\else\afterfi#1\fi}}
% We also redefine \pk{gmverb}'s |\AddtoPrivateOthers| that has been
% provided just with \pk{gmdoc}'s need in mind.
% \CodeDefine\AddtoPrivateOthers
\def\AddtoPrivateOthers#1{%
  \expandafter\def\expandafter\doprivateothers\expandafter{%
    \doprivateothers\do#1}}%

% We also redefine an internal |\verb|'s macro |\gm@verb@eol| to put a~proper
% line end if a~line end char is met in a~short verbatim: we have to
% check if we are in `queer' or `straight' EOLs area.
\begingroup
\obeylines% \CodeDefIndex\gm@verb@eol
\AtBegInput{\def\gm@verb@eol{\obeylines%
    \def^^M{\verb@egroup\@latex@error{%
        \noexpand\verb ended by end of line}%
      \@ifQueerEOL{\gmd@textEOL}{\@ehc}}}}%
\endgroup

% \subdivision{Macros for Marking The Macros}
%
% A~great inspiration for this part was the \docfm\ package again.
% I~take some macros from it, and some tasks I~solve a~different way,
% e.g., the |\| (or another escapechar) is not active, because anyway
% all the chars of code are scanned one by one. And exclusions from
% indexing are supported not with a~list stored as |\toks| register
% but with separate control sequences for each excluded CS.
%
% \stanza
%
% The \docfm\ package shows a~very general approach to the indexing
% issue. It assumes using a~special MakeIndex style and doesn't use
% explicit MakeIndex controls but provides specific macros to hide
% them. But here in \pk{gmdoc} we prefer no special style for the
% index. 

% \CodeDefine\actualchar \CodeDefine\quotechar \CodeDefine\encapchar 
% \CodeDefine\levelchar 
% \changes[\actualchar]{v0.98e}{06/09/23}{a~bug fix: making the
% \cs[]{@} \protect\catother\space again}
\edef\actualchar{\string @} 
\def\quotechar{"}
\edef\encapchar{\twelveclub} 
\def\levelchar{!}
% However, for the glossary, i.e., the change history, a~special style
% is required, e.g., \pk{gmglo.ist}, and the above macros are
% redefined by the |\changes| command due to \pk{gmglo.ist} and
% \pk{gglo.ist} settings.
%
% Moreover, if you insist on using a~special MakeIndex style, you may
% redefine the above four macros in the preamble. The |\edef|s that
% process them further are postponed till |\begin{document}|.
%
%
% \CodeDefine\CodeEscapeChar \CodeDefine\code@escape@char
\def\CodeEscapeChar#1{%
  \begingroup
  \escapechar\m@ne
  \xdef\code@escape@char{\string#1}%
  \endgroup}
% As you see, to make a~proper use of this macro you should give it
% the~|\|\<char> CS as an argument. It's an invariant assertion that
% |\code@escape@char| stores  `other' version of the code layer
% escape char.
% \CodeUsgIndex\CodeEscapeChar
\CodeEscapeChar\\

% As mentioned in \docfm, someone may have some chars \catletter ed.
\@ifundefined{MakePrivateLetters}{%\label{MPL}
  % \CodeDefine\MakePrivateLetters 
  \def\MakePrivateLetters{\makeatletter\catcode`\*=11 }}{}
% A~tradition seems to exist to write about e.g., `command |\section| and
% command |\section*|' and such an uderstanding also of `macro' is
% noticeable in \docfm. Making the |*| a~letter solves the problem of
% scanning starred commands.
%
% \stanza
% And you may wish some special chars to be \catother.
% \CodeDefine\MakePrivateOthers
\def\MakePrivateOthers{\let\do=\@makeother \doprivateothers}
% This macro we use to re|\catcode| the space for marking the
% environments' names and the caret for marking chars such as |^^M|, see
% line \ref{TextUsage}. So let's define the list:
% \CodeDefine\doprivateothers
\def\doprivateothers{\do\ \do\^}
% Two chars for the beginning, and also the |\MakeShortVerb| command
% shall this list enlarge with the char(s) declared.
% (There's no need to add the backslash to this list since all the
% relevant commands |\string| their argument whatever it is.)
%
% \changes{v0.98c}{06/9/9}{\cs{} removed from \cs{doprivateothers}
% list and \cs{string} added instead to commands that process the
% `environments' names;}

% Now the main macro indexing a~macro's name. It would be a~verbatim
% :-) copy of the \docfm 's one if I~didn't ommit some lines
% irrelevant with my approach.
% \CodeDefine\scan@macro
\def\scan@macro#1{% we are sure to scan at least one token and
                  % therefore we define this macro as one-parameter.\par
% Unlike in \docfm , here we have the escape char \catother\ so we
% may just have it printed during main scan char by char, i.e., in the
% lines \ref{printhashone1} and \ref{printhashone2}.\par
% So, we step the checksum counter first,
  \step@checksum% \label{checksumUse}(see line \ref{checksum} for
  % details),\par
  % Then, unlike in \docfm , we do \emph{not} check if the scanning is
  % allowed, because here it's always allowed and required.\par
  % Of course, I~can imagine horrible perversities, but I~don't think
  % they should really be taken into account.  Giving the letter |a|
  % |\catcode| other than \catletter\ surely would be one of those
  % perversities. Therefore I~feel safe to take the character |a| as
  % a~benchmark letter.
  \ifcat a\noexpand#1%
    \quote@char#1%
    \xdef\macro@iname{\maybe@quote#1}% global for symmetry with
    % line \ref{x123}.
    \xdef\macro@pname{\string#1}%\label{stringing0} we'll print entire
    % name of the macro later.\par
    % We |\string| it here and in the lines \ref{stringing1} and
    % \ref{stringing2} to be sure it is whole \catother\ for easy
    % testing for special indexentry formats, see line
    % \ref{pnametestDef} etc.
    \afterelsefi\@ifnextcat{a}{\continue@macroscan}{\finish@macroscan}%
  \else% |#1| is not a~letter, so we have just scanned a~one-char
  % CS.\par 
  % Another reasonable |\catcode|s assumption seems to be that the
  % digits are \catother. Then we don't have to
  % type (|%|)|\expandafter\@gobble\string\a|. We do the |\uccode|
  % trick to be sure that the char we write as the macro's name is
  % \catother. 
    {\uccode`9=`#1%
      \uppercase{\xdef\macro@iname{9}}%
    }%\label{x123}
    \quote@char#1%
    \xdef\macro@iname{\maybe@quote\macro@iname}%
    \xdef\macro@pname{\xiistring#1}%\label{stringing1}
    \afterfi \finish@macroscan
  \fi}
% This is the end\dots\ beautiful friend, the end\dots\ of
% |\scan@macro|'s |\def| the end\dots\
% The |\xiistring| macro, provided by \pk{gmutils}, is used instead of
% original |\string| because we wish to get the space \catother.
%
% \stanza
% Now, let's explain some details, i.e., let's define them. We call
% the following macro having known |#1| to be \catletter.
% \CodeDefIndex\continue@macroscan
\def\continue@macroscan#1{%
  \quote@char#1%
  \xdef\macro@iname{\macro@iname \maybe@quote#1}%
  \xdef\macro@pname{\macro@pname \string#1}%\label{stringing2}
  \@ifnextcat{a}{\continue@macroscan}{\finish@macroscan}%
}
% The |\@ifnextcat| macro is defined analogously to |\@ifnextchar| but
% the test done by it is not |\ifx| but |\ifcat|.
% \CodeDefIndex\quote@char
\def\quote@char#1{{\uccode`9=`#1% at first I~took digit 1 for this
    % |\uccode|ing but then |#1| meant |#|\<\#1> in |\uppercase|'s
    % argument, of course.
    \uppercase{%
      \@ifismember 9\of \indexcontrols\glet\maybe@quote\quotechar%
      \else\g@emptify\maybe@quote%
      \fi}%
  }}

% And now let's take care of the MakeIndex control characters. We'll
% define a~list of them to check whether we should quote a~char or
% not. But we'll do it at |\begin{document}| to allow the user to use
% some special MakeIndex style and in such a~case to redefine the four
% MakeIndex controls' macros. We enrich this list with the backslash
% because sometimes MakeIndex didn't like it unquoted.
% \CodeDefine\indexcontrols
% \changes{v0.98d}{06/9/15}{relativized to the index control macros:
% previously the controls were given explicitly as the standard ones.}
\AtBeginDocument{\xdef\indexcontrols{%
    \bslash\levelchar\encapchar\actualchar\quotechar}}
  % \CodeDefine\@ifismember
  \long\def \@ifismember#1\of#2{%
    \long\def\in@@##1#1##2\in@@{%
      \if\noexpand^^A##2\noexpand^^A\afterelsefi\gmd@@iffalse
      \else\afterfi\gmd@@iftrue
      \fi}%
    \expandafter\in@@#2#1\in@@}%

% To hide the Booleans from \TeX\ in some contexts define
% \CodeDefine\gmd@@iftrue \CodeDefine\gmd@@iffalse
\def\gmd@@iftrue{\iftrue}
\def\gmd@@iffalse{\iffalse}
% A~try to |\let| instead of |\def| resulted with the `incomplete if'
% error: \TeX\ looks at the meanings not the names while counting
% |\if|s. 

% A~word of commentary. \docfm\ in another situation solves the
% problem of checking similar way, but a~little more complexely.  On
% the other hand, \docfm 's solution is more general: here a~trouble
% may arise if the list begins with |^^A|. It seems little possible to
% me, though.  Btw., this macro is used only for catching chars that are
% MakeIndex's controls so far. How does it work?
%
% |\quote@char| sort of re|\catcode|s its argument through the
% |\uccode| trick: assigns the argument as the uppercase code of the
% digit 9 and does further work in the |\uppercase|'s scope so the
% digit 9 (a~benchmark `other') is substituted by |#1| but the
% |\catcode| remains so thus the |\@ifismember| macro gets
% |\quote@char|'s |#1|  `other'ed as the first argument. 
%
% |\@ifismember| is defined to take two parameters separated by |\of|.
% In |\quote@char| the second argument for it is |\indexcontrols|
% defined as the (expanded) sequence of the MakeIndex controls.
% |\@ifismember| defines its inner macro |\in@@| to take two
% parameters separated by the first and the second |\@ifismember|'s
% parameter, which are here the char investigated by |\quote@char| and
% the |\indexcontrols| list. The inner macro's parameter string is
% delimited by the macro itself, why not. |\in@@| is put before
% a~string consisting of |\@ifismember|'s second and first parameters
% (in such a~reversed order) and |\in@@| itself. In such a~sequence it
% looks for something fitting its parameter pattern. |\in@@| is sure
% to find the parameters delimiter (|\in@@| itself) and the separator,
% |\ifismember|'s |#1| i.e., the investigated char, because they are
% just there. But the investigated char may be found not near the end,
% where we put it, but among the MakeIndex controls' list. Then the
% rest of this list and |\ifismember|'s |#1| put by us become the
% secong argument of |\in@@|. What |\in@@| does with its arguments, is
% just a~check whether the second one is empty. This may happen \emph{iff}
% the investigated char hasn't been found among the MakeIndex controls'
% list and then |\in@@| shall expand to |\iffalse|, otherwise it'll
% expand to |\iftrue|. (The |\after...| macros are employed not to
% (mis)match just got |\if...| with the test's |\fi|.)  ``(Deep
% breath.) You got that?'' If not, try \docfm 's explanation of
% |\ifnot@excluded|, pp.\,36--37 of the v2.1b dated 2004/02/09
% documentation, where a~similar construction is attributed to Michael
% Spivak.

% \CodeDefIndex\finish@macroscan
\newcommand*\finish@macroscan{%\par
  % We have the macro's name for indexing in |\macro@iname| and
  % for print in |\macro@pname|. So we index it. We do it a~bit
  % countercrank way because we wish to use more general indexing
  % macro.
  \if\verbatimchar\macro@pname% it's important that |\verbatimchar| comes before the macro's
  % name: when it was reverse, the |\tt| CS turned this test true
  % and left the |\verbatimchar| what resulted with `|\+tt|'
  % typeset. Note that this test should turn true iff the scanned
  % macro name shows to be the default |\verb|'s delimiter. In such
  % a~case we give |\verb| another delimiter, namely |$|:
    \def\im@firstpar{[$]}%^^A$
  \else\def\im@firstpar{}\fi
  \expandafter \index@macro\im@firstpar\macro@iname\macro@pname
  \maybe@marginpar\macro@pname
  \macro@pname
  \gmd@charbychar
}

% Now, the~macro that checks whether the just scanned macro should be
% put into a~marginpar: it checks the meaning of a~very special CS:
% whose name consists of |gmd/2marpar/| and of the examined macro's
% name. 
% \CodeDefIndex\maybe@marginpar
\def\maybe@marginpar#1{%
  %^^A\ifx#1\mname@tomarginpar
  \@ifundefined{gmd/2marpar/#1}{}{%
    \expandafter\Text@Marginize\expandafter{\bslash#1}% |\expandafter|s 
    % \possfil'cause the |\Text@Marginize| command applies |\string| to its
    % argument.  \nlpercent |\macro@pname|, which will be the only possible
    % argument to
    % \cs{may\+be\+@mar\+g\+in\+par},  
    % contains the macro's name 
    % without the escapechar so we added it here.
    % ^^A\gdef\mname@tomarginpar{}
    \expandafter\g@relaxen\csname gmd/2marpar/#1\endcsname% we reset the switch.
  }}

% The inner macro indexing macro. |#1| is the |\verb|'s delimiter;
% |#2| is assumed to be the macro's name with MakeIndex-control chars
% quoted. |#3| is a~macro storing the \catother\ macro's name, usually
% |\macro@pname|, built with |\string|ing every char in lines ^^A
% \ref{stringing0}, \ref{stringing1} and \ref{stringing2}. |#3| is
% used only to test if the entry should be specially formatted.
% \changes{v0.98}{06/09/05}{Indexing the codelines improved to sort
%   with account of the \cs{filesep} (\cs{HLPrefix})}
% \CodeDefine\index@macro
\newcommand*\index@macro[3][\verbatimchar]{{%
    \@ifundefined{gmd/iexcl/#3}%\label{iexcltest}
    {% |#3| is not excluded from index
      \@ifundefined{gmd/defentry/#3}% \label{pnametestDef} 
      {% |#3| is not def entry
        \@ifundefined{gmd/usgentry/#3}%\label{pnametestUsg}
        {% |#3| is not usg entry
          \edef\kind@fentry{\CommonEntryCmd}}%\label{CECmd}
        {% |#3| is usg entry
          \def\kind@fentry{UsgEntry}%
          \un@usgentryze{#3}}%\label{usgentryrs}
      }%
      {% |#3| is def entry
        \def\kind@fentry{DefEntry}%
        \un@defentryze{#3}%\label{defentryrs}
      }% of |gmd/defentry/| test's `else'
      \if@pageindex\@pageinclindexfalse\fi% should it be here or
      % there? Definitely here because we'll wish to switch the switch
      % with a~declaration.
      \if@pageinclindex
        \edef\IndexRefCs{gmdindexpagecs{\HLPrefix}{\kind@fentry}{\EntryPrefix}}%        
      \else
        \edef\IndexRefCs{gmdindexrefcs{\HLPrefix}{\kind@fentry}{\EntryPrefix}}%
      \fi
      \edef\@tempa{\IndexPrefix#2\actualchar%
        \quotechar\bslash verb*#1\quoted@eschar#2#1% The last macro in
        % this line usually means the first two, but in some cases
        % it's redefined to be empty (when we use |\index@macro| to
        % index not a~CS).
        \encapchar\IndexRefCs}% 
      \expandafter\special@index\expandafter{\@tempa}% We give the
      % indexing macro the argument expanded so that \pk{hyperref} may
      % see the explicit encapchar in order not to add its own
      % encapsulation of \verb+|hyperpage+ when the (default)
      % |hyperindex=true|\TextCommonIndex*{hyperindex} option is in
      % force. (After this setting the |\edef|s in the above may be
      % changed to |\def|s.)
      % \changes[\index@macro]{v0.98f}{06/9/30}{explicit MakeIndex
      %   controls changed to corresponding macros. Therefore
      %   \cs[]{hyperindex} option of \pk{hyperref} didn't see the
      %   encapsulation and added its own. So I~expanded the
      %   argument of the very indexing macro}
    }{}% closing of |gmd/iexcl/| test.
    }}

%\CodeDefine\un@defentryze \CodeDefine\un@usgentryze
\def\un@defentryze#1{%
  \expandafter\g@relaxen\csname gmd/defentry/#1\endcsname
  \g@relaxen\last@defmark}% we care to clear the last definition
% marker checked by |\changes|.
\def\un@usgentryze#1{%
  \expandafter\g@relaxen\csname gmd/usgentry/#1\endcsname}

\@emptify\EntryPrefix% this macro seems to be obsolete now
% (v0.98d).

% For the case of page-indexing a~macro in the commentary when
% codeline index option is on:
% \CodeDefine\if@pageinclindex \CodeDefine*\@pageinclindextrue
% \CodeDefine*\@pageinclindexfalse
\newif\if@pageinclindex

% \CodeDefine\quoted@eschar
\newcommand*\quoted@eschar{\quotechar\bslash}% we'll redefine it when
% indexing an environment.

% Let's initialize |\IndexPrefix|
\def\IndexPrefix{}
% The |\IndexPrefix| and |\HLPrefix| (`HyperLabel Prefix') macros are
% given with account of a~possibility of documenting several files
% in(to) one document.  In such case the user may for each file
% |\def\IndexPrefix{|\<package name>|!}| for instance and it will work
% as main level index entry and |\def\HLPrefix{|\<package name>|}|
% as a~prefix in hypertargets in the codelines. They are redefined by
% |\DocInclude| e.g.

\if@linesnotnum\@pageindextrue\fi
\AtBeginDocument{%
  \if@pageindex
    \def\gmdindexrefcs#1#2#3#4{\csname#2\endcsname{\hyperpage{#4}}}%^^A
    % in the page case we gobble the third argument that is supposed
    % to be the entry prefix.
    \let\gmdindexpagecs=\gmdindexrefcs
  \else
% \CodeDefIndex\gmdindexrefcs
% \CodeDefIndex\gmdindexpagecs
    \def \gmdindexrefcs#1#2#3#4{\gmiflink[clnum.#4]{%
        \csname#2\endcsname{#4}}}%
    \def \gmdindexpagecs#1#2#3#4{\hyperlink{page.#4}{%
        \csname#2\endcsname{\gmd@revprefix{#3}#4}}}%
    % \stanza \CodeDefIndex\gmd@revprefix
    \def\gmd@revprefix#1{%
      \def\@tempa{#1}%
      \ifx\@tempa\@empty p.\,\fi}

    \providecommand*\HLPrefix{}% it'll be the hypertargets names' prefix
    % in mul\-ti-docs. Moreover, it showed that if it was empty,
    % \pk{hyperref} saw duplicates of the hyper destinations, which
    % was perfectly understandable (|codelinenum.123| made by
    % |\refstepcounter| and |codelinenum.123| made by
    % |\gmhypertarget|). But since v0.98 it is not a~problem anymore
    % 'cause during the authomatic |\hypertarget|ing the lines are labeled
    % |clnum.|\<number>. When |\HLPrefix| was defined as dot,
    % MakeIndex rejected the 
    % entries as `illegal page number'.
    % \changes[\HLPrefix]{v0.98a}{06/09/05}{again \cs{@empty}fied
    % since \cs{hypertarget}ing the codelines names them \cs[]{clnum}
    % (since v0.98).}
  \fi}
% The definition is postponed till |\begin{document}| because of the
%   |\PageIndex| declaration (added for \docfm-compatibility), see
%   line \ref{PageIndex}.
%
% I~design the index to contain hyperlinking numbers whether they are
% the line numbers or page numbers. In both cases the last parameter
% is the number, the one before the last is the name of a~formatting macro
% and in linenumber case the first parameter is a~prefix for proper
% reference in multi-doc.


% I~take account of three kinds of formatting the numbers: 1.~the
% `def' entry, 2.~a~`usage' entry, 3.~a~common entry. As in \docfm , let
% them be underlined, italic and upright respectively.
% \CodeDefine\DefEntry \CodeDefine\UsgEntry
\def\DefEntry#1{\underline{#1}}
\def\UsgEntry#1{\textit{#1}}
% The third option will be just |\relax| by default:
% \CodeDefine\CommonEntryCmd
\def\CommonEntryCmd{relax}
% In line \ref{CECmd} it's |\edef|ed to allow an `unm\"oglich'
% situation that the user wants to have the common index entries
% specially formatted. I~use this to make \emph{all} the index entries
% of the (|\SelfInclude|d) driver file to be `usage', see codeline
% \ref{UsgHack} of \file{gmdocDoc.tex}.

% Now let's |\def| the macros declaring a~CS to be indexed
% special way. Each declaration puts the \catother ed name of the
% macro given it as the argument into proper macro to be |\ifx|ed in
% lines \ref{pnametestDef} and \ref{pnametestUsg} respectively.
%
% But first let's make a~version of |\@ifstar| that would work with
% |*|\catletter. It's analogous to |\@ifstar|.
% \CodeDefine\@ifstarl
\bgroup\catcode`\*=11 %
\firstofone{\egroup
  \def\@ifstarl#1{\@ifnextchar *{\@firstoftwo{#1}}}}

% Now we are ready to define a~couple of commands. % The |*| versions of
% them are for marking environments and \emph{implicit} CSs.

% \CodeDefine\CodeDefIndex
% \CodeDefine*\CodeDefIndex*
\outer\def\CodeDefIndex{\begingroup
  \MakePrivateLetters
  \@ifstarl{\MakePrivateOthers\Code@DefIndexStar}{\Code@DefIndex}}

% \changes{v0.98d}{06/9/11}{The macros indexing and marginizing
% macros (and other sequences) made \cs{long}}
%\CodeDefIndex\Code@DefIndex
\long\def\Code@DefIndex#1{\endgroup{%
    \escapechar\m@ne% because we will compare the macro's name with
    % a~string without the backslash.
    \global\@defentryze{#1}}}
% \label{stringamacro}

% \CodeDefIndex\Code@DefIndexStar
\long\def\Code@DefIndexStar#1{%
  \endgroup
  \addto@estoindex{#1}%
  \@defentryze{#1}}

% \CodeDefine\gmd@justadot
\def\gmd@justadot{.}

%\CodeDefine\@defentryze \CodeDefine\@usgentryze
\long\def\@defentryze#1{%
  \expandafter\let\csname gmd/defentry/\string#1\endcsname\gmd@justadot% The
  % \LaTeX\ |\@namedef| macro could not be used since it's not `long'.
  % \CodeDefine\last@defmark
  \xdef\last@defmark{\string#1}}% we |\string| the argument 'cause it's
% a~control sequence most probably.
\long\def\@usgentryze#1{%
  \expandafter\let\csname gmd/usgentry/\string#1\endcsname\gmd@justadot}

% Initialize |\envirs@toindex|
\@emptify\envirs@toindex

% Now we'll do the same for the `usage' entries:
%\CodeDefine\CodeUsgIndex
%\CodeDefine*\CodeUsgIndex*
\outer\def\CodeUsgIndex{\begingroup
  \MakePrivateLetters
  \@ifstarl{\MakePrivateOthers\Code@UsgIndexStar}{\Code@UsgIndex}}
% The |*| possibility is for marking environments etc.
% \CodeDefIndex\Code@UsgIndex
\long\def\Code@UsgIndex#1{\endgroup{%
    \escapechar\m@ne
    \global\@usgentryze{#1}}}

% \CodeDefIndex\Code@UsgIndexStar
\long\def\Code@UsgIndexStar#1{%
  \endgroup
  \addto@estoindex{#1}%
  \@usgentryze{#1}}

% For the symmetry, if we want to mark a~control sequence or an
% environment's name to be indexed as a~`normal' entry, let's have:
% \CodeDefine\CodeCommonIndex
% \CodeDefine\CodeCommonIndex*
\outer\def\CodeCommonIndex{\begingroup
  \MakePrivateLetters
  \@ifstarl{\MakePrivateOthers\Code@CommonIndexStar}{\Code@CommonIndex}}

% \CodeDefIndex\Code@CommonIndex
\long\def\Code@CommonIndex#1{\endgroup}

% \CodeDefIndex\Code@CommonIndexStar
\long\def\Code@CommonIndexStar#1{%
  \endgroup\addto@estoindex{#1}}


% And now let's define commands to index the control sequences and
% environments occurring in the narrative.
% \CodeDefine\text@indexmacro
\long\def\text@indexmacro#1{%
  {\escapechar\m@ne \xdef\macro@pname{\xiistring#1}}%
  \expandafter\quote@mname\macro@pname\relax% we process the CS's
  % name char by char and quote MakeIndex controls. |\relax| is the
  % iterating macro's stopper. The scanned CS's quoted name shall be the
  % expansion of |\macro@iname|.
  \if\verbatimchar\macro@pname
    \def\im@firstpar{[$]}%^^A$
  \else\def\im@firstpar{}%
  \fi
  {\do@properindex% see line \ref{do@properindex}.
    \expandafter \index@macro\im@firstpar\macro@iname\macro@pname}}

% The macro defined below (and the next one) are executed only before
% a~\catother\ macro's name i.e.\ a~nonempty sequence of \catother\
% character(s). This sequence is delimited (guarded) by |\relax|.
% \CodeDefine\quote@mname
\def\quote@mname{%
  \def\macro@iname{}%
  \quote@charbychar}

% \CodeDefIndex\quote@charbychar
\def\quote@charbychar#1{%
  \if\relax#1% finish quoting when you meet |\relax| or:
  \else
    \quote@char#1%
    \xdef\macro@iname{\macro@iname \maybe@quote#1}%
    \afterfi\quote@charbychar
  \fi}

% The next command will take one argument,
% which in plain version should be a~control sequence and in the
% starred version also a~sequence of chars allowed in environment names or
% made other by |\MakePrivateOthers| macro, taken in the curly braces.
% \CodeDefine\TextUsgIndex
% \CodeDefine*\TextUsgIndex*
\def\TextUsgIndex{\begingroup
  \MakePrivateLetters
  \@ifstarl{\MakePrivateOthers\Text@UsgIndexStar}{\Text@UsgIndex}}

% \CodeDefIndex\Text@UsgIndex
\long\def\Text@UsgIndex#1{%
  \endgroup\@usgentryze#1%
  \text@indexmacro#1}

% \CodeDefIndex\Text@UsgIndexStar
\long\def\Text@UsgIndexStar#1{\endgroup\@usgentryze{#1}%
  \text@indexenvir{#1}}

% \CodeDefine\text@indexenvir
\long\def \text@indexenvir#1{%
  \edef\macro@pname{\xiistring#1}%
  \if\bslash\expandafter\@firstofmany\macro@pname\@@nil% if
  % |\string|ed |#1| begins with a~backslash, we will gobble it
  % to make MakeIndex not see it.
    \edef\@tempa{\expandafter\@gobble\macro@pname}%
    \@tempswatrue
  \else
    \let\@tempa\macro@pname
    \@tempswafalse
  \fi
  \expandafter\quote@mname\@tempa\relax% \label{quote@mname comm}we 
  % process |\sting|ed |#1| char by char and quote MakeIndex
  % controls. |\relax| is the iterating macro's stopper. The quoted
  % |\string|ed |#1| shall be the expansion of |\macro@iname|.
  {\if@tempswa
    \def\quoted@eschar{\quotechar\bslash}%
    \else\@emptify\quoted@eschar\fi% we won't print any backslash before
    % an environment's name, but we will before a~CS's name.
    \do@properindex% see line \ref{do@properindex}.
    \index@macro\macro@iname\macro@pname}}

% \CodeDefine\TextCommonIndex
% \CodeDefine*\TextCommonIndex*
\def\TextCommonIndex{\begingroup
  \MakePrivateLetters
  \@ifstarl{\MakePrivateOthers\Text@CommonIndexStar}{\Text@CommonIndex}}

%\CodeDefIndex\Text@CommonIndex
\long\def\Text@CommonIndex#1{\endgroup
  \text@indexmacro#1}

% \CodeDefIndex\Text@CommonIndexStar
\long\def\Text@CommonIndexStar#1{\endgroup
  \text@indexenvir{#1}}

% As you see in the lines \ref{defentryrs} and \ref{usgentryrs}, the
% markers of special formatting are reset after first use.

% But we wish the CSs not only to be indexed special way but also
% to be put in marginpars. So:
% \CodeDefine\CodeMarginize
% \CodeDefine*\CodeMarginize*
\outer\def\CodeMarginize{\begingroup
  \MakePrivateLetters
  \@ifstarl{\MakePrivateOthers\egCode@MarginizeEnvir}{\egCode@MarginizeMacro}}

% One more expansion level because we wish |\Code@MarginizeMacro| not
% to begin with |\endgroup| because in the subsequent macros it's used
% \emph{after} ending the re|\catcode|ing group.
% \CodeDefIndex\egCode@MarginizeMacro
\long\def\egCode@MarginizeMacro#1{\endgroup
  \Code@MarginizeMacro#1}

% \CodeDefIndex\Code@MarginizeMacro
\long\def\Code@MarginizeMacro#1{{\escapechar\m@ne
    \expandafter\glet\csname gmd/2marpar/\string#1\endcsname\gmd@justadot
%^^A    \xdef\mname@tomarginpar{\xiistring#1}
  }}

% \CodeDefIndex\egCode@MarginizeEnvir
\long\def\egCode@MarginizeEnvir#1{\endgroup
  \Code@MarginizeEnvir{#1}}

% \CodeDefIndex\Code@MarginizeEnvir
\long\def\Code@MarginizeEnvir#1{\addto@estomarginpar{#1}}

% And a~macro really putting the environment's name in a~marginpar
% shall be trigged at the beginning of the nearest codeline.
%
% Here it is:
% \CodeDefine\mark@envir
\def\mark@envir{%\label{mark@envir}
  \ifx\envirs@tomarginpar\@empty
  \else
    \let\do\Text@Marginize
    \envirs@tomarginpar%
    \g@emptify\envirs@tomarginpar%
  \fi
  \ifx\envirs@toindex\@empty
  \else
    \def\do##1{% the |\envirs@toindex| list contains |\string|ed
      % macros or environments' names in braces and each  preceded
      % with |\do|.
      \if\bslash\@firstofmany##1\@@nil% if
      % |##1| begins with a~backslash, we will gobble it for
      % MakeIndex not see it.
        \edef\@tempa{\@gobble##1}%
        \@tempswatrue
      \else
        \edef\@tempa{##1}\@tempswafalse
      \fi
      \expandafter\quote@mname\@tempa\relax% see line
      % \ref{quote@mname comm} \& subs. for commentary.
      {\if@tempswa
        \def\quoted@eschar{\quotechar\bslash}%
        \else\@emptify\quoted@eschar\fi
        \index@macro\macro@iname{##1}}}%
    \envirs@toindex
    \g@emptify\envirs@toindex%
  \fi}

% One very important thing: initialisation of the list macros:
\@emptify\envirs@tomarginpar
\@emptify\envirs@toindex


% For convenience we'll make the `private letters' first not to bother
% ourselves with |\makeatletter| for instance when we want mark some
% CS. And |\MakePrivateOthers| for the environment and other string
% case.
% \CodeDefine\CodeDefine
% \CodeDefine*\CodeDefine*
\outer\def\CodeDefine{\begingroup
  \MakePrivateLetters
% We do |\MakePrivateLetters| before |\@ifstarl| in order to avoid
% a~situation that \TeX\ sees a~control sequence with improper name
% (another CS than we wished)
% (because |\@ifstarl| establishes the |\catcode|s for the next token):
  \@ifstarl{\MakePrivateOthers\Code@DefEnvir}{\Code@DefMacro}}

% \CodeDefine\CodeUsage
% \CodeDefine*\CodeUsage*
\outer\def\CodeUsage{\begingroup
  \MakePrivateLetters
  \@ifstarl{\MakePrivateOthers\Code@UsgEnvir}{\Code@UsgMacro}}

% And then we launch the macros that close the group and do the work. 
% \CodeDefIndex\Code@DefMacro
\long\def\Code@DefMacro#1{%
  \Code@DefIndex#1% we use the internal macro; it'll close the group.
  \Code@MarginizeMacro#1}

% \CodeDefIndex\Code@UsgMacro
\long\def\Code@UsgMacro#1{%
  \Code@UsgIndex#1% here also the internal macro; it'll close the group
  \Code@MarginizeMacro#1}

% The next macro is taken verbatim ;-) from \docfm\ and the subsequent
% |\let|s, too.
% \CodeDefIndex\codeline@wrindex
\def\codeline@wrindex#1{\if@filesw
  \immediate\write\@indexfile
  {\string\indexentry{#1}%
    {\HLPrefix\number\c@codelinenum}}\fi}

% We initialize it due to the option (or lack of the option):
\AtBeginDocument{%
  \if@pageindex
    \let\special@index=\index
  \else
  % \CodeDefIndex\special@index
    \let\special@index=\codeline@wrindex
    % \label{codeline indexnumber declaration}
  \fi}% postponed till |\begin{document}| with respect of \docfm-like
% declarations.

% And in case we don't want to index:
% \CodeDefine\gag@index
\def\gag@index{\let\index=\@gobble
  %\label{gag@index}
  \let\codeline@wrindex=\@gobble}
% We'll use it in one more place or two. And we'll wish to be able to
% undo it so
% let's copy the original meanings:
% \CodeDefIndex\@@index \CodeDefIndex\@@codeline@wrindex
\StoreMacros{\index\codeline@wrindex}
% \CodeDefine\ungag@index
\def\ungag@index{\RestoreMacros{\index\@@codeline@wrindex}}
  %\label{ungag@index}
  


% Our next task is to define macros that'll mark and index an
% environment or other string in the code. Because of lack of
% a~backslash, no environment's name is scanned so we have to proceed
% different way. But we wish the user to have symmetric tools, i.e.,
% the `def' or `usage' use of an environment should be declared before
% the line where the environment occurs. Note the slight difference
% between these and the commands to declare a~CS marking: the latter
% do not require to be used \emph{immediately} before the line containig the
% CS to be marked.  We separate indexing from marginizing to leave
% a~possibility of doing only one of those things.
% \CodeDefIndex\Code@DefEnvir
\long\def\Code@DefEnvir#1{%
  \endgroup
  \addto@estomarginpar{#1}%
  \addto@estoindex{#1}%
  \@defentryze{#1}}

% \CodeDefIndex\Code@UsgEnvir
\long\def\Code@UsgEnvir#1{%
  \endgroup
  \addto@estomarginpar{#1}%
  \addto@estoindex{#1}%
  \@usgentryze{#1}}

% \CodeDefIndex\addto@estomarginpar
\long\def\addto@estomarginpar#1{%
  \edef\@tempa{\noexpand\do{\xiistring#1}}% we |\string| the argument to
  % allow it to be a~control sequence.
  \expandafter\addtomacro\expandafter\envirs@tomarginpar\expandafter{\@tempa}}

% \CodeDefIndex\addto@estoindex
\long\def\addto@estoindex#1{%
  \edef\@tempa{\noexpand\do{\xiistring#1}}
  \expandafter\addtomacro\expandafter\envirs@toindex\expandafter{\@tempa}}


% And now a~command to mark a~`usage' occurrence of a~CS, environment
% or another string in the commentary. As the `code' commands this also
% has plain and starred version, first for CSs appearing explicitly and the
% latter for the strings and CSs appearing implicitly.
% \CodeDefine\TextUsage
% \CodeDefine*\TextUsage*
\def\TextUsage{\begingroup
  %\label{TextUsage}
  \MakePrivateLetters
  \@ifstarl{\MakePrivateOthers\Text@UsgEnvir}{\Text@UsgMacro}}

% \CodeDefIndex\Text@UsgMacro
\long\def\Text@UsgMacro#1{%
  \endgroup{\tt\xiistring#1}%
  \Text@Marginize#1%
  \begingroup\Code@UsgIndex#1% we declare the kind of formatting of the entry.
  \text@indexmacro#1}

% \CodeDefIndex\Text@UsgEnvir
\long\def\Text@UsgEnvir#1{%
  \endgroup{\tt\xiistring#1}%
  \Text@Marginize{#1}%
  \@usgentryze{#1}% we declare the `usage' kind of formatting of the
  % entry and index the sequence |#1|.
  \text@indexenvir{#1}}

% We don't provide commands to mark a~macro's or environment's
% definition present within the narrative because we think there won't
% be any: one defines macros and environments in the code not in
% the commentary. 
% \CodeDefine\TextMarginize
% \CodeDefine*\TextMarginize*
\def\TextMarginize{\begingroup
  \MakePrivateLetters
  \@ifstarl{\MakePrivateOthers\egText@Marginize}{\egText@Marginize}}

% \CodeDefIndex\egText@Marginize
\long\def\egText@Marginize#1{\endgroup
  \Text@Marginize#1}

% We check whether the margin pars are enabled and proceed
% respectively in either case.
\if@marginparsused
  \reversemarginpar
  \marginparpush\z@
  \marginparwidth8pc\relax
  % ^^A  \settowidth{\marginparsep}{\ \ }%
  %
  % You may wish to put not only macros and environments to
  % a~marginpar. 
  % \CodeDefine\gmdmarginpar
  \long\def\gmdmarginpar#1{%
    \marginpar{\raggedleft\strut
      \hskip0ptplus100ptminus100pt%
      #1}}%\stanza
  % 
\else
  \long\def\gmdmarginpar#1{}%
\fi

% \CodeDefine\Text@Marginize
\long\def\Text@Marginize#1{%
  \gmdmarginpar{\marginpartt\xiistring#1}}
% Note that the above macro will just gobble its argument if the
% marginpars are disabled.^^A\NoEOF so far O.K.
%
% It may be advisable to choose a~condensed typewriter font for the
% marginpars, if there is any. (The Latin Modern font family provides
% a~light condensed typewriter font, it's set in \pk{gmdocc} class.)
\let\marginpartt\tt

% If we count all lines then the index entries for CSs and
% environments marked in the commentary should have codeline numbers
% not page numbers and that is |\let| in line 
% \ref{codeline indexnumber declaration}.  On the other hand, if we
% count only the codelines, then a~macro or an environment marked in
% the commentary should have page number not codeline number. This we
% declare here, among others\ we add the letter |p| before the page number.
% \CodeDefIndex\do@properindex
\def\do@properindex{%\label{do@properindex}
  \if@countalllines\else
    \@pageinclindextrue
    \let\special@index=\index
  \fi}

% \stanza
% In \docfm\ all the `working' \TeX\ code should be braced in(to) the
% \env{macrocode} environments. Here another solutions are taken so to
% be \docfm-compatible we only should
%  nearly-ignore \env{macrocode(*)}s
% with their Percent and The Four Spaces Preceding ;-)\,. I.e., to ensure
% the line ends are `queer'. And that the \ds\ directives will be
% typeset as the \ds\ directives. And that the usual code escape
% char will be restored at |\end{macrocode}|. And to add the vertical
% spaces.
%
% ^^A~\NoEOF so far OK
% If you know \docfm\ conventions, note that \gmdoc\ \emph{does not}
% require |\end{macrocode}| to be preceded ^^A(  
% with any particular number of any char :-)\,.
% \changes{v0.98b}{06/09/07}{To \env{macrocode(*)} default
% definitions \cs{QueerEOL} added}
%\CodeDefine*{macrocode*} 
\newenvironment*{macrocode*}{%\label{macrocode*}
  \if@codeskipput\else\par\addvspace\CodeTopsep\@codeskipputgtrue\fi
  \QueerEOL}%^^A\docstrips
  {\par\addvspace\CodeTopsep\CodeEscapeChar\\}
  % Let's remind that the starred version makes | |
% visible, which is the default in \pk{gmdoc} outside
% \env{macrocode}.
%
% So we should make the spaces \emph{invisible} for the unstarred
% version.
%\CodeDefine*{macrocode}
\newenvironment*{macrocode}{%\label{macrocode}
  \if@codeskipput\else\par\addvspace\CodeTopsep\@codeskipputgtrue\fi
  \CodeSpacesBlank\QueerEOL}%^^A\docstrips
  {\par\addvspace\CodeTopsep\CodeEscapeChar\\}
% Note that at the end of both the above environments the |\|'s r\^ole
% as the code escape char is restored. This is crafted for the
% |\SpecialEscapechar| macro's compatibility: this macro influences
% only the first \env{macrocode} environment. The situation that the
% user wants some queer escape char in general and in a~particular
% \env{macrocode} yet another seems to me ``unm\"oglich,
% Prinzessin''\footnote{Richard Strauss after Oscar Wilde, ^^B
% \textit{Salome}.}. 
%
% \stanza
% Since the first \file{.dtx} I~tried to compile after the first
% published version of \gmdoc\ uses a~lot of commented out code in
% \env{macrocode}s, it seems to me necessary to add a~possibility to
% typeset \env{macrocode}s as if they were a~kind of \env{verbatim},
% that is to leave the code layer and narration layer philosophy.
%
%\CodeDefine*{oldmc}
%\CodeDefine*{oldmc*}
\let\oldmc\macrocode
\let\endoldmc\endmacrocode
\@namelet{oldmc*}{macrocode*}
\@namelet{endoldmc*}{endmacrocode*}

% Now we arm \env{oldmc} and \env{olmc*} with the 
% the macro looking for |%   \end|\arg{envir name}.
\addtomacro\oldmc{\@oldmacrocode@launch}%
\expandafter\addtomacro\csname oldmc*\endcsname{%
  \@oldmacrocode@launch}

% \CodeDefIndex\@oldmacrocode@launch
\def\@oldmacrocode@launch{%
  \emptify\gmd@textEOL% to disable it in |\gmd@docstripdirective|
  % launched within the code.
  \glet\stored@code@delim\code@delim
  \@makeother\^^B\CodeDelim*\^^B%
  \ttverbatim \gmd@DoTeXCodeSpace%
  \@makeother\|% 'cause |\ttverbatim| doesn't do that.
  \MakePrivateLetters% see line \ref{MPL}.\par
  % ^^A  \expandafter\@makeother\code@delim
  \docstrips@percent \@makeother\>%
  % sine qua non of the automatic delimiting is replacing possible
  % |*|\catother in the environment's name with |*|\catletter.
  % Not to complicate assume |*| may occure at most once and only at
  % the end. We also assume the environment's name consists only of
  % character tokens whose catcodes (except of |*|) will be the same
  % in the verbatim text.
  \expandafter\gmd@currenvxistar\@currenvir*\relax
  \@oldmacrocode}

\bgroup\catcode`*11
\firstofone{\egroup
  \def\gm@xistar{*}}

\def\gmd@currenvxistar#1*#2\relax{%
  \edef\@currenvir{#1\if*#2\gm@xistar\fi}}
% The trick is that |#2| may be either |*|\catother\ or empty. If it's
% |*|, the test is satisfied and |\if...\fi| expands to
% |\gm@xistar|. If |#2| is empty, the test is also satisfied since
% |\gm@xistar| expands to |*| but there's nothing to expand to. So, if
% the environment's name ends with |*|\catother, it'll be substituted
% with |*|\catletter or else nothing will be added. (Note that a~|*|
% not at the end of env.\ name would cause a~disaster.)

% \CodeDefine\@oldmacrocode
\bgroup
\catcode`[=1 \catcode`]=2
\catcode`\{=\active \@makeother\}
\@makeother\^^B
\catcode`!=0 \catcode`\\=\active
% \CodeEscapeChar\! \CDAnd
!catcode`&=14 !catcode`*=11
!catcode`!%=!active !obeyspaces&
!firstofone[!egroup&
&%\stanza
!def!@oldmacrocode[&
!bgroup!let =!relax&% to avoid writing |!noexpand | four times.
!xdef!oldmc@def[&
!def!noexpand!oldmc@end####1!noexpand%    !noexpand\end&
!noexpand{!@currenvir}[&
####1^^B!noexpand!end[!@currenvir]!noexpand!gmd@oldmcfinis]]&
!egroup&% now |\oldmc@edef| is defined to have one parameter delimited
&% with |\end|\arg{current env.'s name}
!oldmc@def&
!oldmc@end]&% \CDPerc
]

\def\gmd@oldmcfinis{%
  \expandafter\CodeDelim\stored@code@delim
  \gmd@mchook}% see line \ref{gmd@mchook}


% \CodeDefine\VerbMacrocodes
\def\VerbMacrocodes{%
  \let\macrocode\oldmc
  \@namelet{macrocode*}{oldmc*}}


% To handle \ds\ directives in the code (in the old macrocodes
% case that is).

%    \begin{oldmc}
\bgroup\catcode`\%\active
\firstofone{\egroup
\def\docstrips@percent{\catcode`\%\active
  \let%\gmd@codecheckifds}}
%    \end{oldmc}

% The point is, the active |%| will be expanded when just after it is
% the |\gmd@charbychar| cs token and next is some char, the |^^B| code
% delimiter at least. So, if that char is |<|, we wish to launch
% \ds\ directive typesetting. (Thanks to |\ttverbatim| all the |<|
% are `other'.)
\def\gmd@codecheckifds#1#2{% note that |#1| is just to gobble
  % \nlpercent|\gmd@charbychar| token.
% ^^A  \typeout{code if ds \on@line}%
  \if@dsdir\@dsdirgfalse
    \if\noexpand<\noexpand#2\afterelsefifi\gmd@docstripdirective
    \else\afterfifi\twelvepercent#1#2%
    \fi
  \else\afterfi\twelvepercent#1#2%
  \fi}
%
% \begin{environment}{macro}
% Almost  the same we do with the \env{macro(*)} environments, stating
% only their argument to be processed as the `def' entry. Of course,
% we should re|\catcode| it first.
% \CodeDefIndex*\macro
\newenvironment{macro}{%\label{macro}
  \@tempskipa=\MacroTopsep
  \if@codeskipput\advance\@tempskipa by-\CodeTopsep\fi
  \par\addvspace{\@tempskipa}\@codeskipputgtrue
  \begingroup\MakePrivateLetters\MakePrivateOthers% we make also the
  % `private others' to cover the case of other sequence in the
  % argument. (We'll use the |\macro| macro also in the environment
  % for describing and defining environments.)
  \gmd@ifonetoken\Hybrid@DefMacro\Hybrid@DefEnvir}%
% \CodeDefIndex*\endmacro
  {\par\addvspace\MacroTopsep\@codeskipputgtrue}
  % It came out that the \docfm's author(s) give the \env{macro}
  % environment also starred versions of commands as argument. It's OK
  % since (the default version of) |\MakePrivateLetters| makes |*|
  % a~letter and therefore such a~starred version is just one CS.
  % However, in \pk{doc.dtx} occure \env{macro}s that mark
  % \emph{implicit} definitions i.e., such that the defined CS is not
  % scanned in the subsequent code.
%
% \begin{macro*}{macro*}
% And for those who want to to use this environment
% for marking implicit definitions, define the star
% version:
\@namedef{macro*}{\let\gmd@ifonetoken\@secondoftwo\macro}
% \CodeDefIndex*\endmacro*
\expandafter\let\csname endmacro*\endcsname\endmacro
% Note that \env{macro} and \env{macro*} have the same effect for
% more-than-one-token arguments thanks to |\gmd@ifonetoken|'s meaning
% inside unstarred \env{macro} (it checks whether the argument is
% one-token and if it isn't, |\gmd@ifonetoken| switches execution to
% `other sequence' path).
%
% The two environments behave different only with a~one-token
% argument: \env{macro} postpones indexing it till the first scanned
% occurrence while \env{macro*} till the first code line met.
% \end{macro*}
% \end{environment}
%
% \stanza
% Now, let's complete the details.
% First define an |\if|-like macro  that turns true when the string
% given to it consists of just one token (or one |{|\<text>|}|, to
% tell the whole truth).
% \CodeDefine\gmd@ifsingle
\def\gmd@ifsingle#1#2\@@nil{%
  \def\@tempa{#2}%
  \ifx\@tempa\@empty}
% Note it expands to an open |\if...| test (unbalanced with |\fi|) so it
% has to be used as all the |\if|s, with optional |\else| and
% obligatory |\fi|. And cannot be used in the possibly skipped
% branches of other |\if...|s (then it would result with `extra
% |\fi|/extra |\else|' errors). But the below usage is safe since both
% |\gmd@ifsingle| and its |\else| and |\fi| are hidden in a~macro
% (that will not be |\expandafter|ed).
%
% Note also that giving |\gmd@ifsingle| an |\if...| or so as the first
% token of the argument will not confuse \TeX\ since the first token 
% is just gobbled. The possibility of occurrence of  |\if...| or so as
% a~not-first token seems to be negligible.
% \CodeDefine\gmd@ifonetoken
\def\gmd@ifonetoken#1#2#3{%
  \def\@tempb{#3}% We hide |#3| from \TeX\ in case it's |\if...| or
  % so. \nlpercent|\@tempa| is used in \nlpercent|\gmd@ifsingle|. 
  \gmd@ifsingle#3\@@nil
    \afterelsefi\expandafter#1\@tempb%
  \else
    \edef\@tempa{\expandafter\string\@tempb}%
    \afterfi\expandafter#2\expandafter{\@tempa}%
  \fi}
% Now, define the mysterious |\Hybrid@DefMacro| and |\Hybrid@DefEnvir|
% macros. They mark their argument with a~certain subtlety: they put
% it in a~marginpar at the point where they are and postpone indexing
% it till the first scanned occurrence or just the first code line met.
% \CodeDefine\Hybrid@DefMacro \CodeDefine\Hybrid@DefEnvir
\long\def\Hybrid@DefMacro#1{%
  \Code@DefIndex{#1}% this macro closes the group opened by |\macro|.
  \Text@MarginizeNext{#1}}

\long\def\Hybrid@DefEnvir#1{%
  \Code@DefIndexStar{#1}% this macro also closes the group begun by
  % |\macro|.
  \Text@MarginizeNext{#1}}

%\CodeDefine\Text@MarginizeNext
\long\def\Text@MarginizeNext#1{%
  \gmd@evpaddonce{\Text@Marginize{#1}\ignorespaces}}
%^^A~\strut from before Text@Marginize deleted as unnecessary in everypar.

% The following macro adds its argument to |\everypar| using an auxiliary
% macro to wrap the stuff in. The auxiliary macro has
% a~self-destructor built in so it |\relax|es itself after first use.
%\CodeDefine\gmd@evpaddonce
\long\def\gmd@evpaddonce#1{%
  \stepnummacro\gmd@oncenum
  \expandafter\long\expandafter\edef% \CodeUsgIndex*{NeuroOncer}
    \csname gmd/evp/NeuroOncer\gmd@oncenum\endcsname{%
      \noexpand\g@relaxen
      \csname gmd/evp/NeuroOncer\gmd@oncenum\endcsname}% Why does it
    % work despite it shouldn't? Because when the CS got with
    % \nlpercent|\csname...\endcsname| is undefined, it's equivalent
    % |\relax| and therefore unexpandable. That's why it passes
    % \nlpercent|\edef| and is able to be assigned.
  \expandafter\addtomacro\csname gmd/evp/NeuroOncer\gmd@oncenum\endcsname{#1}%
  \expandafter\addto@hook\expandafter\everypar\expandafter{%
    \csname gmd/evp/NeuroOncer\gmd@oncenum\endcsname}%
}

\nummacro\gmd@oncenum% We store the number uniquifying the auxiliary
% macro in a~macro to save count registers (cf.\ \pk{gmutils}
% sec.\ \gmiflink{To Save Precious Count Registers}).

% \begin{environment}{environment}
% Wrapping a~description and definition of an environment in
% a~\env{macro} environment would look inappropriate (`zgrzyta\l o by'
% in Polish) although there's no \TeX nical obstacle to do
% so. Therefore we define the \env{environment}, because of \ae^^B
% sthetic and psychological reasons.
\expandafter\let\expandafter\environment\csname macro*\endcsname
\expandafter\let\expandafter\endenvironment\csname endmacro*\endcsname
% \end{environment}
%


%\subdivision[Index Exclude List]{\gmhypertarget{Index Exclude List}}
% We want some CSs not to be indexed, e.g., the \LaTeX\
% internals and \TeX\ primitives.
%
% \docfm\ takes |\index@excludelist| to be a~|\toks| register to store
% the list of expelled CSs. Here we'll deal another way. For each CS
% to be excluded we'll make (|\let|, to be precise) a~control sequence
% and then we'll be checking if it's undefined (|\ifx|-equivalent
% |\relax|).\footnote{This idea comes from Marcin Woli\'nski.}
%
% \CodeDefine\DoNotIndex
% \changes{v0.97}{06/09/04}{\cs{MakePrivateLetters} added}
% \changes{v0.98}{06/09/05}{Removed since it had not worked. The
% macros in the argument should be separated with commas. I~understood
% why it didn't work: 'cause 't was iside a~command. So I~put it back}
% \changes{v0.98d}{06/9/11}{Unmade \cs{global}}
\def\DoNotIndex{\bgroup\MakePrivateLetters\DoNot@Index}

% \CodeDefIndex\DoNot@Index
\long\def\DoNot@Index#1{\egroup% we close the group,
  \let\gmd@iedir\gmd@justadot% we declare the direction of the cluding
  % to be \emph{ex}cluding. We act this way to be able to reverse the
  % exclusions easily later.
  \dont@index#1.}

% \CodeDefIndex\dont@index
\long\def\dont@index#1{%
  \def\@tempa{\noexpand#1}% My \TeX\ Guru's trick to deal with |\fi|
  % and such, i.e., to hide from \TeX\ when it is processing a~test's
  % branch without expanding.
  \if\@tempa.% a~dot finishes expelling
  \else
    \if\@tempa,% The list this macro is put before may
    % contain commas and that's O.K., we just continue the work.
      \afterelsefifi\dont@index
    \else% what is else shall off the Index be expelled.
      {\escapechar\m@ne
        \xdef\@tempa{\string#1}}%
      \expandafter\let%
      \csname gmd/iexcl/\@tempa\endcsname=\gmd@iedir% In the default
      % case explained e.g.\ by the macro's name, the last macro's
      % meaning is such that the test in line \ref{iexcltest} will
      % turn false and the subject CS shall not be indexed.
      % We |\let| not |\def| to spare \TeX's memory.
      \afterfifi\dont@index
    \fi
  \fi}

%^^A(
% Let's now give the exclude list copied \*verbatim ;-) from
% \pk{doc.dtx}. I~give it in the code layer 'cause I~suppose one will
% document not \LaTeX\ source but normal packages.
% 
% \begin{CodeSpacesSmall}
% \DoNotIndex\DoNotIndex \CodeDefine\DefaultIndexExclusions
\DoNotIndex\{ \DoNotIndex\}% \label{DNIbraces}the index entries of
% these two CSs would be rejected by MakeIndex anyway.

\begin{MakePrivateLetters}% Yes, |\DoNotIndex| does
  % |\MakePrivateLetters| on its own but No, it won't have any effect
  % if it's given in another macro's |\def|.
  \gdef\DefaultIndexExclusions{%
    \DoNotIndex{\@ \@@par \@beginparpenalty \@empty}%\label{DIE1}
    \DoNotIndex{\@flushglue \@gobble \@input}%
    \DoNotIndex{\@makefnmark \@makeother \@maketitle}%
    \DoNotIndex{\@namedef \@ne \@spaces \@tempa}%
    \DoNotIndex{\@tempb \@tempswafalse \@tempswatrue}%
    \DoNotIndex{\@thanks \@thefnmark \@topnum}%
    \DoNotIndex{\@@ \@elt \@forloop \@fortmp \@gtempa \@totalleftmargin}%
    \DoNotIndex{\" \/ \@ifundefined \@nil \@verbatim \@vobeyspaces}%
    \DoNotIndex{\| \~ \  \active \advance \aftergroup \begingroup \bgroup}%
    \DoNotIndex{\mathcal \csname \def \documentstyle \dospecials \edef}%
    \DoNotIndex{\egroup}%
    \DoNotIndex{\else \endcsname \endgroup \endinput \endtrivlist}%
    \DoNotIndex{\expandafter \fi \fnsymbol \futurelet \gdef \global}%
    \DoNotIndex{\hbox \hss \if \if@inlabel \if@tempswa \if@twocolumn}%
    \DoNotIndex{\ifcase}%
    \DoNotIndex{\ifcat \iffalse \ifx \ignorespaces \index \input \item}%
    \DoNotIndex{\jobname \kern \leavevmode \leftskip \let \llap \lower}%
    \DoNotIndex{\m@ne \next \newpage \nobreak \noexpand \nonfrenchspacing}%
    \DoNotIndex{\obeylines \or \protect \raggedleft \rightskip \rm \sc}%
    \DoNotIndex{\setbox \setcounter \small \space \string \strut}%
    \DoNotIndex{\strutbox}%
    \DoNotIndex{\thefootnote \thispagestyle \topmargin \trivlist \tt}%
    \DoNotIndex{\twocolumn \typeout \vss \vtop \xdef \z@}%
    \DoNotIndex{\, \@bsphack \@esphack \@noligs \@vobeyspaces \@xverbatim}%
    \DoNotIndex{\` \catcode \end \escapechar \frenchspacing \glossary}%
    \DoNotIndex{\hangindent \hfil \hfill \hskip \hspace \ht \it \langle}%
    \DoNotIndex{\leaders \long \makelabel \marginpar \markboth \mathcode}%
    \DoNotIndex{\mathsurround \mbox}%\verb+% \newcount \newdimen \newskip+
    \DoNotIndex{\nopagebreak}%
    \DoNotIndex{\parfillskip \parindent \parskip \penalty \raise \rangle}%
    \DoNotIndex{\section \setlength \TeX \topsep \underline \unskip}%
    \DoNotIndex{\vskip \vspace \widetilde \\ \% \@date \@defpar}%
    \DoNotIndex{\[ \]}% see line \ref{DNIbraces}.
    \DoNotIndex{\count@ \ifnum \loop \today \uppercase \uccode}%
    \DoNotIndex{\baselineskip \begin \tw@}%
    \DoNotIndex{\a \b \c \d \e \f \g \h \i \j \k \l \m \n \o \p \q}%
    \DoNotIndex{\r \s \t \u \v \w \x \y \z \A \B \C \D \E \F \G \H}%
    \DoNotIndex{\I \J \K \L \M \N \O \P \Q \R \S \T \U \V \W \X \Y \Z}%
    \DoNotIndex{\1 \2 \3 \4 \5 \6 \7 \8 \9 \0}%
    \DoNotIndex{\! \# \$ \& \' \( \) \. \: \; \< \= \> \? \_}% |\+|
    % seems to be so rarely used that it may be advisable to index it.
    \DoNotIndex{\discretionary \immediate \makeatletter \makeatother}%
    \DoNotIndex{\meaning \newenvironment \par \relax \renewenvironment}%
    \DoNotIndex{\repeat \scriptsize \selectfont \the \undefined}%
    \DoNotIndex{\arabic \do \makeindex \null \number \show \write \@ehc}%
    \DoNotIndex{\@author \@ehc \@ifstar \@sanitize \@title}%
    \DoNotIndex{\if@minipage \if@restonecol \ifeof \ifmmode}%
    \DoNotIndex{\lccode %|%\newtoks|
      \onecolumn \openin \p@ \SelfDocumenting}%
    \DoNotIndex{\settowidth \@resetonecoltrue \@resetonecolfalse \bf}%
    \DoNotIndex{\clearpage \closein \lowercase \@inlabelfalse}%
    \DoNotIndex{\selectfont \mathcode \newmathalphabet \rmdefault}%
    \DoNotIndex{\bfdefault}%
    % From the above list I~removed some |\new...| declarations 'cause
    % I~think it may be useful to see gathered the special |\new...|s of
    % each kind. For the same reason I~would not recommend excluding
    % from the index such declarations as |\AtBeginDocument|,
    % |\AtEndDocument|, |\AtEndOfPackage|, |\DeclareOption|,
    % |\DeclareRobustCommand| etc. But the
    % common definitions, such as |\new/providecommand| and
    % |\(e/g/x)def|s, as the most common, in my opinion excluded should
    % be.^^A\)
    % 
    % \stanza
    % And some my exclusions:
    \DoNotIndex{\@@input \@auxout \@currentlabel \@dblarg}%
    \DoNotIndex{\@ifdefinable \@ifnextchar \@ifpackageloaded}%
    \DoNotIndex{\@indexfile \@let@token \@sptoken \^}% the latter comes
    % from CSs like |\^^M|, see sec. \ref{Tasks}.
    \DoNotIndex{\addto@hook \addvspace}%
    \DoNotIndex{\CurrentOption}%
    \DoNotIndex{\emph \empty \firstofone}%
    \DoNotIndex{\font \fontdimen \hangindent \hangafter}%
    \DoNotIndex{\hyperpage \hyperlink \hypertarget}%
    \DoNotIndex{\ifdim \ifhmode \iftrue \ifvmode \medskipamount}%
    \DoNotIndex{\message}%
    \DoNotIndex{\NeedsTeXFormat \newcommand \newif}%
    \DoNotIndex{\newlabel}%
    \DoNotIndex{\of}%
    % ^^A\PassOptionsToClass\PassOptionsToPackage
    \DoNotIndex{\phantom \ProcessOptions \protected@edef}%
    \DoNotIndex{\protected@xdef \protected@write}%
    \DoNotIndex{\ProvidesPackage \providecommand}%
    \DoNotIndex{\raggedright}%
    \DoNotIndex{\raisebox \refstepcounter \ref \rlap}% ^^A\RequirePackage
    \DoNotIndex{\reserved@a \reserved@b \reserved@c \reserved@d}%
    \DoNotIndex{\stepcounter \subsection \textit \textsf \thepage \tiny}%
    \DoNotIndex{\copyright \footnote \label \LaTeX}%
    % \changes[\DefaultIndexExclusions]{v0.98a}{06/09/06}{more
    % macros added to the `exclude list'}
    \DoNotIndex{\@eha \@endparenv \if@endpe \@endpefalse \@endpetrue}%
    \DoNotIndex{\@evenfoot \@oddfoot \@firstoftwo \@secondoftwo}%
    \DoNotIndex{\@for \@gobbletwo \@idxitem \@ifclassloaded}%
    \DoNotIndex{\@ignorefalse \@ignoretrue \if@ignore}%
    \DoNotIndex{\@input@ \@input}%
    \DoNotIndex{\@latex@error \@mainaux \@nameuse}%
    \DoNotIndex{\@nomath \@oddfoot}%|%\@onlypreamble| should be indexed
    % IMO.
    \DoNotIndex{\@outerparskip \@partaux \@partlist \@plus}%
    \DoNotIndex{\@sverb \@sxverbatim}%
    \DoNotIndex{\@tempcnta \@tempcntb \@tempskipa \@tempskipb}%\\
    % I~think the layout parameters  even the kernel, should not be
    % excluded: \nlpercent|\@topsep| \nlpercent|\@topsepadd|^^B 
    % \ \nlpercent|\abovedisplayskip| \nlpercent|\clubpenalty| etc.
    \DoNotIndex{\@writeckpt}%
    \DoNotIndex{\bfseries \chapter \part \section \subsection}%
    \DoNotIndex{\subsubsection}%
    \DoNotIndex{\char \check@mathfonts \closeout}%
    \DoNotIndex{\fontsize \footnotemark \footnotetext \footnotesize}%
    \DoNotIndex{\g@addto@macro \hfilneg \Huge \huge}%
    \DoNotIndex{\hyphenchar \if@partsw \IfFileExists \in@@}%
    \DoNotIndex{\include \includeonly \indexspace}%
    \DoNotIndex{\itshape \language \LARGE \Large \large}%
    \DoNotIndex{\lastbox \lastskip \m@th \makeglossary}%
    \DoNotIndex{\maketitle \math@fontsfalse \math@fontstrue \mathsf}%
    \DoNotIndex{\MessageBreak \noindent \normalfont \normalsize}%
    \DoNotIndex{\on@line \openout \outer}%
    \DoNotIndex{\parbox \part \rmfamily \rule \sbox}%
    \DoNotIndex{\sf@size \sffamily \skip}%
    \DoNotIndex{\textsc \textup \toks@ \ttfamily \vbox}%
    % \changes[\DoNotIndex]{v0.97}{06/09/04}{Excluding some star-versions of
    %   commands}
    % \nostanza
    % |%%\DoNotIndex{\begin*}| maybe in the future, if the idea gets
    % popular\dots \nostanza
    \DoNotIndex{\hspace* \newcommand* \newenvironment* \providecommand*}%
    \DoNotIndex{\renewenvironment* \section* \chapter*}%\label{DIE2}
  }% of |\DefaultIndexExclusions|.\par
  % I~put all the expellings into a~macro because I~want them
  % to be optional.
\end{MakePrivateLetters}
% \end{CodeSpacesSmall}

% And we execute it due to the (lack of) counter-corresponding option:
\if@indexallmacros\else
  \DefaultIndexExclusions
\fi


% If we expelled so many CSs, someone may like it in general but
% he/she may need one or two expelled to be indexed back. So
%
% \CodeDefine\DoIndex
% \changes{v0.97}{06/09/04}{\cs{MakePrivateLetters} added.}
% \changes{v0.98}{06/09/05}{\cs{MakePrivateLetters} removed since it
% hadn't worked. I~understood why it didn't work: 'cause
% 't was iside a~command and I~put it back}
% \changes{v0.98d}{06/9/11}{Unmade \cs{global}}
\def\DoIndex{\bgroup\MakePrivateLetters\Do@Index}

% \CodeDefIndex\Do@Index
\long\def\Do@Index#1{\egroup\@relaxen\gmd@iedir\dont@index#1.}% note
% we only redefine an auxiliary CS and launch also |\dont@index| inner
% macro.

% And if a~user wants here make default exclusions and there do not
% make them, \heshe\ may use the |\DefaultIndexExclusions| declaration
% \himher self. This declaration OCSR, but anyway let's provide the
% counterpart. It OCSR, too.
%
% \CodeDefine\UndoDefaultIndexExclusions
% \changes{v0.98d}{06/9/11}{Unmade \cs{global}}
\def\UndoDefaultIndexExclusions{%
  \StoreMacro\DoNotIndex
  % ^^A\dont@index
  \let\DoNotIndex\DoIndex
  % ^^A  \let\dont@index=\do@index
  \DefaultIndexExclusions
  % ^^A  \RestoreMacro\dont@index
  \RestoreMacro\DoNotIndex}

%
%
% \subdivision{Index Parameters}
%
% \begin{quotation}The |\IndexPrologue| macro is used to place a short
% message into the document above the index. It is implemented by
% redefining |\index@prologue|, a macro which holds the default
% text. We'd better make it a |\long| macro to allow |\par| commands 
% in its argument.\end{quotation} \CodeDefine\IndexPrologue
\long\def\IndexPrologue#1{\@bsphack\def\index@prologue{#1}\@esphack}
% \label{IndexPrologue}

% \CodeDefine\indexdiv
% \changes{v0.98a}{06/09/06}{modified to contain the star so that
% it may be redefined for tests.}
\def\indexdiv{\@ifundefined{chapter}{\section*}{\chapter*}}
% \CodeDefine\index@prologue
\@ifundefined{index@prologue} {\def\index@prologue{\indexdiv{Index}%
    \markboth{Index}{Index}%
    Numbers written in italic refer to the \if@pageindex pages \else
    code lines \fi where the
    corresponding entry is described; numbers underlined refer to the
    \if@pageindex\else code line of the \fi definition; numbers in
    roman refer to the \if@pageindex pages\else code lines \fi where
    the entry is used. 
    \if@pageindex\else 
      \ifx\HLPrefix\@empty 
        The numbers preceded with `p.' are page numbers.
      \else The numbers with no prefix are page numbers.
    \fi\fi
    \ifx\IndexLinksBlack\relax\else
      All the numbers are hyperlinks.
      % ^^A, they are made black just to let Adobe Reader work
      % ^^A~faster. 
    \fi
    \gmd@dip@hook% this hook is intended to let a~user add
    % something without redefining the entire prologue, see below.
  }}{}

% During the preparation of this package for publishing I~needed
% only to add something at the end of the default index prologue. So
% \CodeDefine\AtDIPrologue
% \changes{v0.98c}{06/9/8}{added 'cause of need}
% \CodeDefIndex\gmd@dip@hook \CodeDefine\AtDIPrologue
\@emptify\gmd@dip@hook
\long\def\AtDIPrologue#1{\g@addto@macro\gmd@dip@hook{#1}}

% The Author(s) of \docfm\ assume \pk{multicol} is known not to
% everybody. My assumption is the other so
\RequirePackage{multicol}

% \begin{quotation}If \pk{multicol} is in use, when the index is
%   started we compute 
%   the remaining space on the current page; if it is greater than
%   |\IndexMin|, the first part of the index will then be placed in the
%   available space. The number of columns set is controlled by the
%   counter |\c@IndexColumns| which can be changed with a
%   |\setcounter| declaration.\end{quotation}
% \CodeDefine\IndexMin
\newdimen\IndexMin \IndexMin = 133pt\relax% originally it was set
% 80\,pt, but with my default prologue there's at least 4.7\,cm needed
% to place the prologue and some index entries on the same page.
% \CodeDefine*{IndexColumns}
% \CodeDefIndex*{\c@IndexColumns}
\newcount\c@IndexColumns \c@IndexColumns = 3
% \CodeDefine*{theindex}
\renewenvironment{theindex}
  {\begin{multicols}\c@IndexColumns[\index@prologue][\IndexMin]%
      \IndexLinksBlack
      \IndexParms \let\item\@idxitem \ignorespaces}%
    {\end{multicols}}

%\CodeDefine\IndexLinksBlack
\def\IndexLinksBlack{\hypersetup{linkcolor=black}}% To make Adobe
% Reader work faster.

% \CodeDefine\IndexParms
\@ifundefined{IndexParms}
  {\def\IndexParms{%
      % \label{IndexParms}
      \parindent \z@
      \columnsep 15pt
      \parskip 0pt plus 1pt
      \rightskip 15pt
      \mathsurround \z@
      \parfillskip=-15pt plus 1 fil % \docfm\ defines this parameter
      % rigid but that's because of the stretchable space (more
      % precisely, a~|\dotfill|) between the item and the entries. But
      % in \pk{gmdoc} we define no such special delimiters, so we add
      % an ifinite stretch.
      \small
      \def\@idxitem{\par\hangindent 30pt}%
      \def\subitem{\@idxitem\hspace*{15pt}}%
      \def\subsubitem{\@idxitem\hspace*{25pt}}%
      \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}%
      \ifx\EntryPrefix\@empty\else\raggedright\fi% long (actually,
      % a~quite \emph{short but nonempty} entry prefix) made space
      % stretches so terribly large in the justified paragraphs that
      % we should make |\raggedright| rather.
      \ifnum\c@IndexColumns>\tw@\raggedright\fi% the numbers in narrow
      % col\-umns look better when they are |\raggedright| in my opinion.
    }}{}

  % \CodeDefine\PrintIndex
\def\PrintIndex{% we ensure the standard meaning of the line end
  % character not to cause a~disaster.
  \@ifQueerEOL{\StraightEOL\printindex\QueerEOL}{\printindex}}

% Remember that if you want to change not all the parameters, you
% don't have to redefine the entire |\IndexParms| macro but you may
% use a~very nice \LaTeX\ command |\g@addto@macro| (it has |\global|
% effect, also with an apeless name (|\gaddtomacro|) provided by
% \pk{gmutils}. (It adds its second argument at the end of definition
% of its first argument provided the first argument is a~no-argument
% macro.) Moreover, \pk{gmutils} provides also 
% |\addtomacro| that has the same effect except it's not |\global|.
%
%
%
% \subdivision{The \ds\ Directives}
%
% \StraightEOL
% \iffalse
%
% This passage is obsoleted on 2006/11/30.
%
% In the \gmdoc\ thinking, the \ds\ directives belong to the
% narration layer since they all begin with |%|. For now I~don't
% have a~more minimal idea than to define a~pair of macros the first of
% which would |\active|ate the |<| and the other, assigned to the
% active |<|, would do the work and re`other' the |<| back.
%
% We provide two versions of the seargant-activating macro: the first
% makes only the first subsequent seargant typeset a~\ds\
% directive (and the previous meaning of the |<| will be restored, the
% latter doesn't restore the previous meaning of |<| after (by) the
% first occurrence and the latter obeys usual scoping rules while the
% scoping rules of the first (|\docstrip|) are more strict: the scope
% is delimited by the first occurrence of the subject~|<|.
%
% Let us remeber that, just as all the control sequences except
% |\relax|, you can use |\docstrips| as an environment, i.e., in the
% |\begin{docstrips}|\dots |\end{docstrips}| syntax. And, that
% \env{macrocode} environment declares it.
% \bgroup\catcode`\<=\active
% \firstofone{\egroup
%   % \stanza
%   % \CodeDefine\docstrip
%   \newcommand*\docstrip{%
%     \gmd@storesearg
%     \catcode`\<=\active
%     \gmd@setdocstrips
%     \let\gmd@docstripshook=\gmd@restoresearg}%
%   % \stanza
%   % \CodeDefine\docstrips
%   \newcommand*\docstrips{%
%     \catcode`\<=\active
%     \gmd@setdocstrips
%     \@emptify\gmd@docstripshook}%
%   % \stanza
%   % \CodeDefIndex\gmd@setdocstrips
%   \def\gmd@setdocstrips{%
%     \def<{\ifmmode\sgtleftxii\else\afterfi\gmd@docstripdirective\fi}}
%   %\stanza
%   % \CodeDefIndex\gmd@storesearg
%   \def\gmd@storesearg{%
%     \edef\gmd@SeargantCat{\the\catcode`\<}%
%     \ifnum\gmd@SeargantCat=\active
%       \let\gmd@SeargantMng=<%
%     \fi}

%   % \CodeDefIndex\gmd@restoresearg
%   \def\gmd@restoresearg{%
%     \catcode`\<=\gmd@SeargantCat\relax
%     \ifnum\gmd@SeargantCat=\active
%       \let<=\gmd@SeargantMng
%     \fi}%
%   % \stanza
% }% of |\active| |<|'s |\firstofone|
%
% \fi ^^A~of the obsoletion iffalse
% \QueerEOL

% \CodeDefine\gmd@docstripdirective
{\@makeother\<\@makeother\>
  \glet\sgtleftxii=<

\gdef\gmd@docstripdirective{%
  \begingroup\let\do=\@makeother
  \do\*\do\/\do\+\do\-\do\,\do\&\do\|\do\!\do\(\do\)\do\>\do\<% ^^Ayes, we
  % ^^A make \nlpercent|<|\catother\ since a~directive |<<|\<any text till ^^B
  % ^^A~the end of line> theoretically may occure.
  \@ifnextchar{<}{%
    \let\do=\@makeother \dospecials
    \gmd@docstripverb}
  {\gmd@docstripinner}}%

\if1 1%^^A~as the other debugs, let them rest in peace alt least till
%^^A the v2.0.
\gdef\Debug@dstron{\ifnum\c@codelinenum>1178 \ifdtraceon\fi
  \ifnum\c@codelinenum>1184 \ifdtraceoff\@emptify\Debug@dstron\fi}%
\else
  \global\@emptify\Debug@dstron
\fi

  % \CodeDefIndex\gmd@docstripinner
  \gdef\gmd@docstripinner#1>{%
    \endgroup
    \def\gmd@modulehashone{%
      \Module{#1}\space
      \@afternarrgfalse\@aftercodegtrue\@codeskipputgfalse}%
    % ^^A    \gmd@docstripshook
    \gmd@textEOL\gmd@modulehashone\Debug@dstron}
  % A~word of explanation: first of all, we
  % close the group for changed |\catcode|s; the directive's text has its
  % |\catcode|s fixed. Then we put the directive's text wrapped with the
  % formatting macro into one macro in order to give just one token
  % the \gmdoc's \TeX\ code scanner. 
  % ^^A But before we launch the \TeX\ code
  % ^^A  scanning with all the b\&w, we virtually restore the meaning of
  % ^^A  further |<|s to let them start further \ds\ directives,
  % ^^A  and after this possible restore (if it \emph{actually} takes place
  % ^^A  depends on the declaration used: |\docstrip| or |\docstrips|) we
  % Then launch this big \TeX\ code scanning machinery by calling
  % |\gmd@textEOL| which is an alias for the `narrative' meaning of the
  % line end. This macro opens the verbatim group and launches the
  % char-by-char scanner. That is this scanner because of what we
  % encapsulated the directive's text with the formatting into one
  % macro: to let it pass the scanner. 
  % 
  % That's why in the `old' macrocodes case the active |%| closes the
  % group before launching |\gmd@docstripdirective|.
  % 
  % \stanza
  % The `verbatim' directive macro works very similarly.
  % \CodeDefIndex\gmd@docstripverb
  \catcode`\^^M=\active%
  \gdef\gmd@docstripverb<#1^^M{%
    \endgroup%
    \def\gmd@modulehashone{%
      \ModuleVerb{#1}\@afternarrgfalse\@aftercodegtrue%
      \@codeskipputgfalse}%
    \gmd@docstripshook%
    \gmd@textEOL\gmd@modulehashone^^M}%
}

% (\*Verbatim ;-) from \docfm:)
% \CodeDefine\Module \CodeDefine\ModuleVerb
\providecommand*\Module[1]{{\mod@math@codes$\langle\mathsf{#1}\rangle$}}

\providecommand*\ModuleVerb[1]{{\mod@math@codes$\langle\langle\mathsf{#1}$}}

% \CodeDefIndex\mod@math@codes
\def\mod@math@codes{\mathcode`\|="226A \mathcode`\&="2026 }

% \subdivision{The Changes History}
% 
% The contents of this section was copied \*verbatim from the
% \docfm's documentation, with only smallest necessary changes. Then ^^A(( 
% my additions were added :-))\,.
%
% \begin{quotation}To provide a change history log, the |\changes|
% command has been
%   introduced.  This takes [one optional and] three [mandatory]
%   arguments, respectively, [the macro that'll become the entry's
%   second level,] the version 
%   number of the file, the date of the change, and some detail
%   regarding what change has been made [i.e., the description of the
%   change]. The [second] of these arguments 
%   is otherwise ignored, but the others are written out and may be
%   used to generate a history of changes, to be printed at the end of
%   the document. [\dots\ I~ommit an obsolete remark about then-older
%   MakeIndex's versions.]
% 
%   The output of the |\changes| command goes into the
%   \<Glossary_File> and therefore uses the normal |\glossaryentry|
%   commands. Thus MakeIndex or a~similar program can be used to
%   process the output into a sorted ``glossary''. The |\changes|
%   command commences by taking the usual measures to hide its
%   spacing, and then redefines |\protect| for use within the argument
%   of the generated |\indexentry| command.  We re-code nearly all
%   chars found in |\@sanitize| to letter since the use of special
%   package which make some characters active might upset the
%   |\changes| command when writing its entries to the file. However
%   we have to leave |%| as
%   comment and | | as \<space> otherwise chaos will happen. And, of
%   course the |\| should be available as escape character.\end{quotation}
%
% We put the definition inside a~macro that will be 
% executed by (the first use of) |\RecordChanges|. And we provide
% the default definition of |\changes| as a~macro just gobbling its
% arguments. We do this to provide no changes' writing out if
% |\RecordChanges| is not used.
%
% \CodeDefine\gmd@DefineChanges
% \CodeDefine\changes
% \changes{v0.98e}{06/09/23}{definition put into a~macro that shall
% launch it when \cs{RecordChanges} is executed and the default
% defining it as a~gobbling macro}
%
\def\gmd@DefineChanges{%
  \outer\long\def\changes{\@bsphack\begingroup\@sanitize
    \catcode`\\\z@ \catcode`\ 10 \MakePercentIgnore
    \MakePrivateLetters \StraightEOL
    \MakeGlossaryControls
    \changes@}}

\newcommand\changes[4][]{\PackageWarningNoLine{gmdoc}{%
    ^^JThe \bslash changes command used \on@line
    ^^Jwith no \string\RecordChanges\space declared.
    ^^JI shall not warn you again about it}%
  \renewcommand\changes[4][]{}}

\def\MakeGlossaryControls{%
  \def\actualchar{=}\def\quotechar{!}%
  \def\levelchar{>}\edef\encapchar{\twelveclub}}%for the glossary the
  % `actual', the `quote' and the `level' chars are respectively |=|,
  % |!| and |>|, the `encap' char remains untouched. I~decided to
  % preserve the \docfm's settings for the compatibility.

% \CodeDefine\changes@
% \changes[\changes]{v0.97}{06/09/04}{The optional pseudo-argument
%   added intended to be the macro-entry.}
\newcommand\changes@[4][\generalname]{%
  \if@RecentChange{#3}% if the date is later than the one stored in
  % \cs{c@Chang\+es\+Start\+Date},
    \@tempswafalse
    \ifx\generalname#1% then we check whether a~CS-entry is given
    % in the optional first argument or is it unchanged.
      \ifx\last@defmark\relax\else% if no particular CS is
      % specified in |#1|, we check whether |\last@defmark| contains
      % something and if so, we put it into |\@tempb| scratch macro.
        \@tempswatrue
        \edef\@tempb{% it's a~bug fix: while typesetting traditional
          % \file{.dtx}es, |\last@defmark| came out with |\| at the
          % beginning (which resulted with |\\|\<name> in the change
          % log) but while typesetting the `new' way, it occured 
          % without the bslash. So we gobble the bslash if it's
          % present and two lines below we handle the exception of
          % |\last@defmark|\equals|{\}| (what would happen if 
          % a~definition of |\\| was marked in new way \gmdoc ing).%^^A]
          \if\bslash\last@defmark\else\last@defmark\fi}%
        \ifx\last@defmark\bslash\let\@tempb\last@defmark\fi%
%^^A        \typeout{last dm @tempb: \@tempb}% (debugging)
        % ^^A~\expandafter\quote@mname\macro@pname\relax
      \fi
    \else%the first argument isx not |\generalname| i.e.,
         %a~particular CS is specified by it (if some day one
    % wishes to |\changes| |\generalname|, \heshe\ should type
    % |\changes[generalname]|\dots)
      \@tempswatrue
      {\escapechar\m@ne
        \xdef\@tempb{\string#1}}
      % ^^A~\expandafter\quote@mname\@tempb\relax
    \fi
    \protected@edef\@tempa{\noexpand\glossary{%
        \if\relax\GeneralName\relax\else
          \GeneralName% it's for the |\DocInclude| case to precede
          % every |\changes| of the same file with the file name, cf.\ line
          % \ref{GeneralName}.
        \fi
        #2\levelchar%
        \if@tempswa% If the macro |\last@defmark|
        % doesn't contain any CS name (i.e., is empty) nor |#1|
        % specifies a~CS, the current
        % changes entry was done at top-level.  In this case we preceed
        % it by |\generalname|.
          \@tempb
          \actualchar\bslash verb*%
          \if\verbatimchar\@tempb$\else\verbatimchar\fi
          \quotechar\bslash \@tempb
          \if\verbatimchar\@tempb$\else\verbatimchar\fi       
        \else
          \space\actualchar\generalname
        \fi
        :\levelchar#4\encapchar hyperpage}}%
    \@tempa
  \fi\endgroup\@esphack}

% Let's initialize |\last@defmark| and |\GeneralName|.
\@relaxen\last@defmark
\@emptify\GeneralName
% Let's explain |\if@RecentChange|. We wish to check whether the
% change's date is later than date declared (if any limit date
% \emph{was} declared). First of all, let's establish a~counter to store
% the declared date. The untouched counters are equal 0 so if no date
% is declared there'll be no problem. The date will have the
% \<YYYYMMDD> shape both to be easily compared and readable.
% \CodeDefine\c@ChangesStartDate
\newcount\c@ChangesStartDate

% \CodeDefine\if@RecentChange
\def\if@RecentChange#1{%
  \gmd@setChDate#1\@@nil\@tempcnta
  \ifnum\@tempcnta>\c@ChangesStartDate}

% \CodeDefIndex\gmd@setChDate
\def\gmd@setChDate#1/#2/#3\@@nil#4{% the last parameter will be a~|\count|
  % register.
  #4=#1\relax
  \multiply#4 by\@M
  \count8=#2\relax% I~know it's a~bit messy not to check whether the
  % |#4| |\count| is |\count8| but I~know this macro will only be used
  % with |\count0 | \nlpercent(\cs{@\+te\+m\+p\+cn\+ta}) and some
  % higher (not a~scratch) one.
  \multiply\count8 by100 %
  \advance#4 by\count8 \count8=\z@
  \advance#4 by#3\relax}

% Having the test defined, let's define the command setting the date
% counter. |#1| is to be the version and |#2| the date
% \cs[]{\{\<year>/\<month>/\<day>\}}. 
% \CodeDefine\ChangesStart
% \changes{v0.98e}{06/09/23}{\cs{string}s added before the seargants
% in the message with account of \cs{docstrip(s)}}
\def\ChangesStart#1#2{%
  \gmd@setChDate#2\@@nil\c@ChangesStartDate
  \typeout{^^JPackage gmdoc info: ^^JChanges' start date #1 memorized
    as \string<\the\c@ChangesStartDate\string> \on@line.^^J}
  \advance\c@ChangesStartDate\m@ne% we shall show the changes \emph{at ^^B
  % the specified day} and later.
  \ifnum\c@ChangesStartDate>19820900 %\unskip\StraightEOL\footnote{^^A
  % DEK writes in \textit{\TeX, The Program} of September 1982 as the
  % date of \TeX\ Version 0.}\QueerEOL\label{TeXVer0}
  % see \gmiflink[personalchanges]{below}.
    \edef\@tempa{%
      \noexpand\g@addto@macro\noexpand\glossary@prologue{%
        The changes
        \if\relax\GeneralName\relax\else of \GeneralName\space\fi
        earlier than
        #1 \if\relax#1\relax #2\else(#2)\fi\space are not shown.}}%
    \@tempa
  \fi}
% (Explanation to line \ref{TeXVer0}.)
% \gmhypertarget[personalchanges]{My} \TeX\ Guru has remarked that the
% change history tool should be used for documenting the changes that
% may be significant for the users not only for the author and talking
% of what may be significant to the user, no changes should be hidden
% since the first published version. However, the changes' start date
% may be used to provide hiding the author's `personal' notes: \heshe\
% should only date the `public' changes with the four digit year and
% the `personal' ones with two digit year and set
% |\ChangesStart{}{1000/0/0}| or so.
%
% In line \ref{TeXVer0} I~establish a~test value that corresponds to
% a~date earlier than any \TeX\ stuff and is not too small (early) to
% ensure that hiding the two digit year changes shall not be mentioned
% in the changes prologue.
% 
% \changes{v0.98d}{2006/9/15}{An entry to show the change history
% works: watch and admire. Some sixty \cs{changes} entries irrelevant
% for the users-other-than-myself are hidden due to the trick
% described on
% p.\protect\,\protect\pageref{personalchanges}.%
% \protect\StoreMacro\protect\hyperpage 
% \protect\def\protect\hyperpage#1{\protect\RestoreMacro\protect\hyperpage}%
% \protect\gobble}
% \stanza
% \begin{quotation}The entries [of a~given version number] are sorted
%   for convenience by the name of [the macro explicitly specified as
%   the first argument or] the most recently introduced macroname
%   (i.e., that in the most recent |\begin{macro}| command [or
%     |\CodeDefine|]). We therefore provide [|\last@defmark|] to
%     record that argument, and provide a default definition in case
%     |\changes| is used outside a \env{macro} environment. (This is a
%     wicked hack to get such entries at the beginning of the sorted
%     list! It works providing no macro names start with |!| or |"|.)
% 
% This macro holds the string placed before changes entries on
% top-level.\end{quotation} 
% \CodeDefine\generalname
\def\generalname{General}

% \CodeDefine\chschange
% \changes{v0.98a}{06/09/06}{added.}
%
% \stanza
% \begin{quotation}To cause the changes to be written (to a \pk{.glo})
% file, we define |\RecordChanges| 
%   to invoke \LaTeX's usual |\makeglossary| command.\end{quotation}
% 
% I~add to it also the |\write|ing definition of the |\changes| macro
% to ensure no changes are written out without |\RecordChanges|.
%
% \CodeDefine\RecordChanges
% \changes{v0.98c}{06/09/08}{made self-\cs{relax}ing}
% \changes{v0.98e}{06/09/23}{made it defining \cs{changes}}
\def\RecordChanges{\makeglossary\gmd@DefineChanges
  \@relaxen\RecordChanges}
% \begin{quotation}The remaining macros are all analogues of those used
%   for the \env{theindex} environment. 
% When the glossary is started we compute the space which remains at
% the bottom of the current page; if this is greater than |\GlossaryMin| then the
% first part of the glossary will be placed in the available space. The number of
% columns set [is] controlled by the counter |\c@GlossaryColumns| which can be
% changed with a |\setcounter| declaration.\end{quotation}
% \begin{CodeSpacesBlank}

\newdimen\GlossaryMin         \GlossaryMin       = 80pt
% \CodeDefIndex*\c@GlossaryColumns
\newcount\c@GlossaryColumns   \c@GlossaryColumns = 2
% \end{CodeSpacesBlank}
%\begin{quotation}The environment \env{theglossary} is defined in the
%same manner as the \env{theindex} 
% environment.\end{quotation}
%
% \CodeDefine*{theglossary}
% \CodeDefIndex*\theglossary
\newenvironment{theglossary}{%
  \begin{multicols}\c@GlossaryColumns
    [\glossary@prologue][\GlossaryMin]%
    \GlossaryParms \let\item\@idxitem \ignorespaces}%
  {\end{multicols}}

% Here is the MakeIndex style definition:
% \index{gmglo.ist@\file{gmglo.ist}}
%^^A \begin{docstrips}
%</package>
%<+gmglo>preamble
%<+gmglo>"\n \\begin{theglossary} \n
%<+gmglo>\\makeatletter\n"
%<+gmglo>postamble
%<+gmglo>"\n\n \\end{theglossary}\n"
%<+gmglo>keyword "\\glossaryentry"
%<+gmglo>actual '='
%<+gmglo>quote '!'
%<+gmglo>level '>'
%<*package>
%^^A \end{docstrips}
% The MakeIndex shell command for the glossary should look as
% follows:
% \[\hbox{|makeindex -r -s gmglo.ist -o |\<myfile>|.gls |\<myfile>|.glo|}\]
% ^^B
% ^^B makeindex -r -s gmglo.ist -o <myfile>.gls <myfile>.glo 
% ^^B
% where |-r| commands MakeIndex not to make implicit page ranges,
% |-s| commands MakeIndex to use the style stated next not the
% default settings and the |-o| option with the subsequent filename
% defines the name of the output.
%
% \begin{quotation}The |\GlossaryPrologue| macro is used to place a
% short message above the 
% glossary into the document. It is implemented by redefining |\glossary@prologue|,
% a macro which holds the default text. We better make it a long macro to allow
% |\par| commands in its argument.\end{quotation}
%
% \CodeDefine\GlossaryPrologue
\long\def\GlossaryPrologue#1{\@bsphack
  \def\glossary@prologue{#1}%
  \@esphack}
% \begin{quotation}Now we test whether the default is already defined
% by another package file. If not we define it.\end{quotation}
% \changes{v0.98a}{06/09/06}{a~bug fixed: \cs{filediv} replaced with
% \cs{indexdiv} in the default prologue.}
% \CodeDefine\glossary@prologue
\@ifundefined{glossary@prologue}
  {\def\glossary@prologue{\indexdiv{{Change History}}%
      \markboth{{Change History}}{{Change History}}%
    }}{}
%\begin{quotation}Unless the user specifies otherwise, we set the
%change history using the same parameters as for the index.\end{quotation}
% \CodeDefine\GlossaryParms
\AtBeginDocument{%
  \@ifundefined{GlossaryParms}{\let\GlossaryParms\IndexParms}{}}

%\begin{quotation}
%  To read in and print the sorted change history, just put the
%  |\PrintChanges| command as the last (commented-out, and thus
%  executed during the documentation pass through the file) command in
%  your package file. Alternatively, this command may form one of the
%  arguments of the |\StopEventually| command, although a change history
%  is probably not required if only the description is being printed.
%  The command assumes that MakeIndex or some other program has
%  processed the \pk{.glo} file to generate a sorted \pk{.gls}
%  file.\end{quotation} \CodeDefine\PrintChanges
\def\PrintChanges{% to avoid a~disaster among queer EOLs:
  \@ifQueerEOL
    {\StraightEOL\@input@{\jobname.gls}\QueerEOL}%
    {\@input@{\jobname.gls}}%
  \g@emptify\PrintChanges}

% % \iffalse
% % \begin{quotation}
% %   The following definitions provide the |\pfill| command; if this is
% %   specified in the index style file to MakeIndex as the delimiter to
% %   appear after index items, then the intervening space before the
% %   referenced page numbers will be filled with dots, with a little
% %   white space interpolated at each end of the dots. If the line is
% %   broken the dots will show up on both lines.\end{quotation}
% \def\dotfill{\leaders\hbox to.6em{\hss .\hss}\hskip\z@ plus 1fill}%
% \def\dotfil{\leaders\hbox to.6em{\hss .\hss}\hfil}%
% \def\pfill{\unskip~\dotfill\penalty500\strut\nobreak
%   \dotfil~\ignorespaces}%
%%
%%\begin{verbatim}
%%</package>
%%<+ist>delim_0 "\\pfill "
%%<+ist>delim_1 "\\pfill "2
%%<+ist>delim_2 "\\pfill "
%%<*package>
%\end{verbatim}
% % skipped definitions of dotted fills\fi
%
%
% \subdivision{The Checksum}
%
%
% \docfm\ provides a~checksum mechanism that counts the backslashes 
% in the scanned code. Let's do almost the same.
%
% At the beginning of the source file you may put the |\CheckSum|
% macro with a~number (in one of \TeX's formats) as its argument and
% \TeX\ with \pk{gmdoc} shall count the number of the \emph{escape ^^B
%   chars} in the source file and tell you in the \file{.log} file (and
%   on the terminal)
% whether you have typed the right number. If you don't type |\CheckSum|,
% \TeX\ anyway will tell you how much it is.
% \CodeDefine\check@sum \CodeDefine\CheckSum 
\newcount\check@sum
\def\CheckSum#1{\@bsphack\global\check@sum#1\relax\@esphack}
% \CodeDefine*{CheckSum} \CodeDefIndex*\c@CheckSum
\newcounter{CheckSum}
% \label{checksum}
% \CodeDefIndex\step@checksum
\newcommand*\step@checksum{\stepcounter{CheckSum}}
% And we'll use it in the line \ref{checksumUse} (|\stepcounter| is
% |\global|). See also the |\chschange| declaration,
% l.\,\ref{chschange}.  
%
% However, the check sum mechanism in \gmdoc\ behaves slightly
% different than in \docfm\ which
% is nicely visible while \pk{gmdoc}ing \docfm: \docfm\ states its
% check sum to be 2171 and our count counts 2126. The mystery lies in
% the fact that \docfm's CheckSum mechanism counts the code's
% backslashes no matter what they mean and the \gmdoc's the escape
% chars so, among others, |\\| at the default settings increases \docfm's
% CheckSum by 2 while the \gmdoc's by 1. (There are 38 occurrences of |\\|
% in \pk{doc.dtx} \env{macrocode}s, I~counted
% myself.)\begin{StraightEOL}\footnote{My opinion is that nowadays
%     a~check sum 
%     is not necessary for checking the completness of a~file but
%     I~like it as a~marker of file development and this more than
%     that is its r\^ole in \gmdoc.}
% \end{StraightEOL}
%
%
% \begin{quotation}But |\Finale| will be called at the very end of a
%   file. This is exactly the point were we want to know if the file
%   is uncorrupted. Therefore we also call |\check@checksum| at this
%   point.\end{quotation}
% In \pk{gmdoc} we have the |\AtEndInput| hook.
\AtEndInput{\check@checksum}

% Based on the lines 723--741 of \pk{doc.dtx}.
% \CodeDefine\check@checksum
\def\check@checksum{\relax
  \ifnum\check@sum=\z@
    \typeout{**********************************}%
    \typeout{* The input file \gmd@inputname\space has no Checksum
      stated.}%
    \typeout{* The current checksum is \the\c@CheckSum.}%
    \gmd@chschangeline% a~check sum changes history entry, see below.
    \typeout{* (package gmdoc info.)}
    \typeout{**********************************}%
  \else
    \ifnum\check@sum=\c@CheckSum
      \typeout{*****+*+*+*+*+*+*+*+*+*+}%
      \typeout{* The input file \gmd@inputname: Checksum passed.}%
      \gmd@chschangeline
      \typeout{* (package gmdoc info.)}
      \typeout{*****+*+*+*+*+*+*+*+*+*+}%
    \else
      \typeout{********!*!*!*!*!*!*!*!*!*!*!*!}%
      \typeout{*! The input file \gmd@inputname:}
      \typeout{*! The CheckSum stated: \the\check@sum\space<> my
        count: \the\c@CheckSum.} 
      \gmd@chschangeline
      \typeout{*! (package gmdoc info.)}
      \typeout{********!*!*!*!*!*!*!*!*!*!*!*!}%
    \fi
  \fi
  \global\check@sum\z@}

% As I~mentioned above, I~use the check sum mechanism to mark the file
% growth. Therefore I~provide a~macro that produces a~line on the
% terminal to be put somewhere at the
% beginning of the source file's commentary for instance.
% \CodeDefIndex\gmd@chschangeline
\def\gmd@chschangeline{%
  \typeout{\twelvepercent\space\string\chschange{%
      \fileversion}{\the\year/\the\month/\the\day}{\the\c@CheckSum}}
  \typeout{\twelvepercent\space\string\chschange{\fileversion}{%
      \expandafter\@gobbletwo\the\year/\the\month/\the\day}{%\relax
      %  with two di\-g\-it year in case you use |\ChangesStart|.
      \the\c@CheckSum}}}

% And here the meaning of such a~line is defined:
\newcommand*\chschange[3]{%\label{chschange}
  \csname changes\endcsname{#1}{#2}{CheckSum #3}% |\csname...| 'cause
  % \nlpercent\cs{cha\+n\+g\+es} is \nlpercent|\outer|.
  \CheckSum{#3}}
% It will make a~`General' entry in the change history unless
% used in some |\CodeDefine|'s scope or inside a~\env{macro}
% environment. It's intended to be put 
% somewhere at the beginning of the documented file.
%
%
% \changes[\CheckSum]{v0.98a}{06/09/06}{`package gmdoc info'
% statement moved to the end of the checksum messages.}
% \changes[\CheckSum]{v0.98b}{06/09/07}{typing out the
% \cs{chschange} line added}

%
%
% \subdivision{Macros from \pk{ltxdoc}}
%
% I'm not sure whether this package still remains `minimal' but
% I~liked the macros provided by \pk{ltxdoc.cls} so much\dots
% \stanza
%
% The next page setup declaration is intended to be used
% with the \pk{article}'s default Letter paper size. But since 
% \CodeDefine\ltxPageLayout
\newcommand*\ltxPageLayout{%
%\begin{quotation}Increase the text width slightly so that width the standard fonts
% 72 columns of code may appear in a |macrocode| environment.\end{quotation}
% 
  \setlength{\textwidth}{355pt}%
% \begin{quotation}Increase the marginpar width slightly, for long
% command names. And increase the left margin by a similar
% amount.\end{quotation}
% To make these settings independent from the defaults (changed e.g.\
% in \pk{gmdocc.cls}) we replace the original |\addtolength|s with
% |\setlength|s.
%^^A  \addtolength\marginparwidth{30pt}%
%^^A  \addtolength\oddsidemargin{20pt}% 
%^^A  \addtolength\evensidemargin{20pt}
 \setlength\marginparwidth{95pt}%
 \setlength\oddsidemargin{82pt}%
 \setlength\evensidemargin{82pt}}

% %\iffalse
% \def\task#1#2{}
% % What is this for? Probably to turn an obsolete command off. Or maybe
% % a~TODO?
% % \fi

%\subdivision{\cs{DocInclude} and the \pk{ltxdoc}-Like Setup}
%
% Let's provide a~command for including
% multiple files into one document. In the \pk{ltxdoc} class such
% a~command is defined to include files as parts. But we prefer to
% include them as chapters in the classes that provide
% |\chapter|. We'll redefine |\maketitle| so that it make a~chapter or
% a~part heading \emph{unlike} in \pk{ltxdoc} where the file parts
% have their titlepages with only the filename and \pk{article}-like titles
% made by |\maketitle|.
%
% But we will also provide a~possibility of typesetting multiple files
% exactly like with the \pk{ltxdoc} class.
%
% \begin{macro}{\DocInclude}
%
%   So, define the |\DocInclude| command, that acts
%   \begin{quotation}more or less exactly the same as |\include|, but
%     uses |\DocInput| on a \pk{dtx} [or \pk{.fdd}] file, not |\input| on
%     a \pk{tex} file.\end{quotation}
%   Our version will accept also \pk{.sty}, \pk{.cls}, and \pk{.tex}
%   files.
%
% \changes{v0.98}{06/09/05}{\cs{@makeother\protect\bslash_} added}
\newcommand*\DocInclude{\bgroup\@makeother\_\Doc@Include}% First, we
% make \nlpercent|_| `other' in order to allow it in the filenames.

% \CodeDefine\Doc@Include
\newcommand*{\Doc@Include}[2][]{% originally it took just one
  % argument. Here we make it take two, first of which is intended to
  % be the path (with the closing \nlpercent |/|). This is intended not to print
  % the path in the page footers only the filename.\par
  % \CodeUsage\HLPrefix \CodeDefine\EntryPrefix
  \egroup% having the arguments read, we close the group opened by the
  % previous macro for |_|\catother.
  \gdef\HLPrefix{\filesep}% 
  \gdef\EntryPrefix{\filesep}% we define two rather kernel parameters
  % to expand to the file marker. The first will bring the information
  % to one of the default \nlpercent|\IndexPrologue|'s
  % |\if|s. Therefore the 
  % definition is global. The latter is such for symmetry.
  % \CodeDefine\GeneralName
  \def\GeneralName{#2\actualchar\pk{#2} }% \label{GeneralName} for the
    % changes'history main level entry.
  \relax
  %^^A\if@ltxDocInclude
  \clearpage
  % ^^A\fi
  \docincludeaux
  \def\currentfile{gmdoc-IncludeFileNotFound.000}%
  \let\fullcurrentfile\currentfile
  \IfFileExists{#1#2.fdd}{\edef\currentfile{#2.fdd}}{% it's not \pk{.fdd},
    \IfFileExists{#1#2.dtx}{\edef\currentfile{#2.dtx}}{% it's not \pk{.dtx}
      % either,
      \IfFileExists{#1#2.sty}{\edef\currentfile{#2.sty}}{% it's not
        % \pk{.sty},
        \IfFileExists{#1#2.cls}{\edef\currentfile{#2.cls}}{% it's
            % not \pk{.cls},
          \IfFileExists{#1#2.tex}{\edef\currentfile{#2.tex}}{% it's
            % not \pk{.tex},
            \IfFileExists{#1#2.fd}{\edef\currentfile{#2.fd}}{% so it
            % must be \pk{.fd} or error.
              \PackageError{gmdoc}{\string\DocInclude\space file
                #1#2.fdd/dtx/sty/cls/tex/fd not found.}}}}}}}%
  % \changes{v0.98j}{06/10/16}{\pk{.fdd} added in \cs{DocInclude}'s
  % search for the extension.}
  \edef\fullcurrentfile{#1\currentfile}%
  \ifnum\@auxout=\@partaux
    \@latexerr{\string\DocInclude\space cannot be nested}\@eha
  \else \@docinclude{#1}#2 \fi}% Why is |#2| delimited with | | not
% braced as we are used to, one may ask. 

% \CodeDefine\@docinclude
% \changes[\DocInclude]{v0.97}{06/09/03}{\cs{@docinclude} gets 2 params
%   in order to \cs{includeonly} work as expected, with only the names
%   (w.o. the paths)}
\def\@docinclude#1#2 {% To match the macro's parameter string, is an
  % answer. But why is |\@docinclude| defined so? Originally, in
  % \pk{ltxdoc} it takes one argument and it's delimited with a~space
  % probably in resemblance to the true |\input| \nlpercent(|\@@input| in
  % \LaTeX). ^^A\if@ltxDocInclude
  \clearpage
  %^^A\fi
  \if@filesw \gmd@writemauxinpaux{#2.aux}\fi% this strange macro with
  % a~long name is another thing to allow |_| in the filenames (see
  % line \ref{gmd@writemauxinpaux}).
  \@tempswatrue
  \if@partsw \@tempswafalse\edef\@tempb{#2}%
    \@for \@tempa:=\@partlist\do{\ifx\@tempa\@tempb\@tempswatrue\fi}%
  \fi
  \if@tempswa \let\@auxout\@partaux 
    \if@filesw
      \immediate\openout\@partaux #2.aux\relax% Yes, only |#2|. It's to
      % create and process the partial \pk{.aux} files always in the main
      % document's (driver's) directory.
      % \changes[\DocInclude]{v0.97}{06/09/04}{\protect\TeX forced to
      %   process the partial \pk{.aux}es in the main document directory}
      \immediate\write\@partaux{\relax}%
    \fi
    % \begin{quotation}We need to save (and later restore) various
    %   index-related commands which might be changed by the included
    %   file.\end{quotation}
    % \changes{v0.98a}{06/09/06}{\cs{MacroStoringDo} renamed (in
    %   \pk{gmutils}) to \cs{StoringAndRelaxingDo}, and
    %   \cs{MacroRestoringDo} to \cs{RestoringDo}.}
    \StoringAndRelaxingDo\gmd@doIndexRelated
    \if@ltxDocInclude\part{\currentfile}% In the \pk{ltxdoc}-like setup
    % we make a~part title page with only the filename and the file's
    % |\maketitle| will typeset an \pk{article}-like title.
    \else\let\maketitle=\InclMaketitle
    \fi% In the default setup we
    % redefine |\maketitle| to typeset a~common chapter or part heading.
    \if@ltxDocInclude\xdef@filekey\fi
    \GetFileInfo{\currentfile}% it's my (GM) addition with the account
    % of using file info in the included files' title/\:heading etc.
    \incl@DocInput{\fullcurrentfile}% originally just |\currentfile|.
    \if@ltxDocInclude\else\xdef@filekey\fi% in the default case we add
    % new file to the file key \emph{after} the input because in this
    % case it's the files own |\maketitle| what launches the
    % sectioning command that increases the counter.
    % \par And here is the moment to restore the index-related
    % commands.
    \RestoringDo\gmd@doIndexRelated
    % ^^A\if@ltxDocInclude
    \clearpage
    % ^^A\fi
    \gmd@writeckpt{#1#2}%
    \if@filesw \immediate\closeout\@partaux \fi
  \else\@nameuse{cp@#1#2}%
  \fi
  \let\@auxout\@mainaux}% end of |\@docinclude|.
% \end{macro}
%
% (Two is a~sufficient number of iterations to define a~macro for.)
% \CodeDefine\xdef@filekey
\def\xdef@filekey{{\@relaxen\ttfamily% \label{LetTTFRelax}This
    % assignment is very trickly crafted: it makes \emph{all}
    % |\ttfamily|s present in the |\filekey|'s expansion unexpandable
    % not only the one added in this step.
    \xdef\filekey{\filekey, \thefilediv={\ttfamily\currentfile}}}}


% To allow |_| in the filenames we must assure |_| will be \catother\
% while reading the filename. Therefore define
% \CodeDefIndex\gmd@writemauxinpaux
\def\gmd@writemauxinpaux#1{% \label{gmd@writemauxinpaux}
  % this name comes from `\emph{write} outto \emph main
  % \emph{\pk{.aux}} to \emph{in}put \emph partial
  % \emph{\pk{.aux}}'.\par 
  % We wrap |\@input{|\<partial \pk{.aux}>|}| in a~|_|\catother\
  % hacked scope. This hack is especially recommended here since the
  % \pk{.aux} file may contain a~non-|\global| stuff that should not
  % be localized by a~group that we would have to establish if we
  % didn't use the hack. (Hope you understand it. If not, notify me
  % and for now I'll only give a~hint: ``Look at it with the \TeX's
  % eyes''. More uses of this hack are to be seen in \pk{gmutils}
  % where they are a~bit more explained.)
  \immediate\write\@mainaux{%
    \bgroup\string\@makeother\string\_%
    \string\firstofone{\egroup
    \string\@input{#1}}}}

% We also slightly modify a~\LaTeX\ kernel macro |\@writeckpt| to
% allow |_| in the file name.
% \changes[\DocInclude]{v0.98a}{06/09/06}{\cs{@writeckpt} wrapped
% with \cs{firstofone} hack to allow \cs[]{_} in the file names.}
% \CodeDefIndex\gmd@writeckpt
\def\gmd@writeckpt#1{%
  \immediate\write\@partaux{%
    \string\bgroup\string\@makeother\string\_%
    \string\firstofone\@charlb\string\egroup}
  \@writeckpt{#1}%
  \immediate\write\@partaux{\@charrb}}

%\CodeDefine\gmd@doIndexRelated
\def\gmd@doIndexRelated{%
  \do\tableofcontents \do\makeindex \do\EnableCrossrefs
  \do\PrintIndex \do\printindex \do\RecordChanges \do\PrintChanges
  \do\theglossary \do\endtheglossary}


\@emptify\filesep
% The \pk{ltxdoc} class establishes a~special number format for
% multiple file documentation numbering needed to document the \LaTeX\
% sources. I~like it too, so\CodeDefine\aalph \CodeDefine\@aalph
\def\aalph#1{\@aalph{\csname c@#1\endcsname}}
\def\@aalph#1{%
  \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or
         j\or k\or l\or m\or n\or o\or p\or q\or r\or s\or
         t\or u\or v\or w\or x\or y\or z\or A\or B\or C\or
         D\or E\or F\or G\or H\or I\or J\or K\or L\or M\or
         N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or
         X\or Y\or Z\else\@ctrerr\fi}

% A~macro that initialises things for |\DocInclude|.
% \CodeDefine\docincludeaux
\def\docincludeaux{%
  % We set the things for including the files only once.
  \global\@relaxen\docincludeaux
  % By default, we will include multiple files into one document
  % as chapters in the classes that provide |\chapter| and as parts
  % elsewhere.
  \ifx\filediv\relax
    \ifx\filedivname\relax% (nor |\filediv| neither
    % |\filedivname| is defined by the user)
    % \changes[\filediv]{v0.98a}{06/09/06}{definition moved into
    % \cs{DocInclude} and let \cs{relax} by default ($\quotechar=$a~bug fix).}
      \@ifundefined{chapter}{%
        \SetFileDiv{part}}%\changes[\DocInclude]{v0.98f}{06/9/29}{\cs{filediv(name)}  
      % defined as \cs[]{(\protect\bslash)part} for the classes that
      % don't know \cs{chapter}} 
      {\SetFileDiv{chapter}}%
    \else% (|\filedivname| is defined by the user, |\filediv| is not)
      \SetFileDiv{\filedivname}% why not? Inside is |\edef| so it'll work.
    \fi
  \else% (|\filediv| is defined by the user
    \ifx\filedivname\relax% and |\filedivname| is not)
    %^^A~I~deleted a~six level test which one sectioning command
    %^^A~|\filedivname| isx. 
      \PackageError{gmdoc}{You've redefined \string\filediv\space
        without redefining \string\filedivname.}{Please redefine the
        two macros accordingly. You may use \string\SetFileDiv{name
          without bslash}.}%
    \fi
  \fi
  \@addtoreset{codelinenum}{\filedivname}% remember it has
  % a~|\global| effect in fact. For each file we'll reset
  % \env{codelinenum}.
  \def\thefilediv{\aalph{\filedivname}}% The files will be numbered
  % with letters, lowercase first.
  \expandafter\let\csname the\filedivname\endcsname=\thefilediv% This
  % li\-ne lets |\the|\<chapter> etc.\ equal |\thefilediv|.
  \def\filesep{\thefilediv-}% File separator (identifier) for the index.
  \let\filekey=\@gobble
  \g@addto@macro\index@prologue{%
    \gdef\@oddfoot{\parbox{\textwidth}{\strut\footnotesize
        \raggedright{\bfseries File Key:} \filekey}}% The footer for
    % the pages of index.
    \glet\@evenfoot\@oddfoot}% \label{oneside}anyway, it's intended to
  % be oneside. 
  \g@addto@macro\glossary@prologue{%
    \gdef\@oddfoot{\strut Change History\hfill\thepage}% The footer
    % for the changes history.
    \glet\@evenfoot\@oddfoot}%
  % \changes[\DocInclude]{v0.98c}{06/9/10}{Change History footer
  % defined}
  \gdef\@oddfoot{% The footer of the file pages will be its name and,
    % if there is a~file info, also the date and version.
    \expandafter\ifx\csname ver@\currentfile\endcsname\relax
      File \thefilediv: {\ttfamily\currentfile} %
    \else
      \GetFileInfo{\currentfile}%
      File \thefilediv: {\ttfamily\filename} %
      Date: \filedate\ %
      Version \fileversion
    \fi
    \hfill\thepage}%
  \glet\@evenfoot\@oddfoot% see line \ref{oneside}.
  % ^^A  \show\filedivname% for debug
  \expandafter\def\csname\filedivname name\endcsname{File}% we
  % redefine the name of the proper division to `File'.
  \ifx\filediv\section
    \let\division=\subsection
    \let\subdivision=\subsubsection% If |\filediv| is higher than
    % |\section| we don't change the two divisions (they are
    % |\section| and |\subsection| by default). |\section| seems
    % to me the lowest reasonable sectioning command for the file. If 
    % |\filediv| is lower you should rather rethink the level of
    % a~file in your documentation not redefine the two divisions.
  \fi}% end of |\docincludeaux|.

% The |\filediv| and |\filedivname| macros should always be set
% together. Therefore provide a~macro that takes care of both at
% once. Its |#1| should be a~sectioning name without the backslash.
% \CodeDefine\SetFileDiv
% \changes{v0.98c}{06/9/10}{added and a~bug fixed in \cs{docincludeaux}}
\def\SetFileDiv#1{%
  \edef\filedivname{#1}%
  \expandafter\let\expandafter\filediv\csname#1\endcsname}

% \subdivision{\cs{SelfInclude}}
%
% I~needed to include the driver file into
% a~documentation so I~wrote
% a~macro in case I'll need it again or you'll need it.
% We define it immediately i.e.,
% without the |\catcode|s trick because it uses |\jobname| inside so
% the filename will be all \catother\ anyway.
% \CodeDefine\SelfInclude
% \changes{v0.98a}{06/09/06}{added in response to the needs}
\newcommand*{\SelfInclude}[2][.tex]{% As you guess, the optional |#1|
  % is the jobname's extension. The second parameter is \emph{not} for
  % the filename (note \emph{it's known:} as |\jobname|!), but
  % \emph{for the stuff to be put at begin input.}
  \AtBegInputOnce{#2}%
  \gdef\HLPrefix{\filesep}%
  \gdef\EntryPrefix{\filesep}% we define two rather kernel parameters
  % etc.\ as in \nlpercent|\DocInclude|.
  \relax
  %^^A\if@ltxDocInclude
  \clearpage
  % ^^A\fi
  \docincludeaux
  \edef\currentfile{\jobname#1}%
  \let\fullcurrentfile\currentfile
  \def\GeneralName{\jobname\actualchar\pk{\jobname} }% for the
  % changes history main level entry.
  \ifnum\@auxout=\@partaux
    \@latexerr{\string\DocInclude\space cannot be nested}\@eha
  \else
    \if@filesw
      \gmd@writemauxinpaux{\jobname.auxx}% ^^A
      % this queer macro allows |_| in the file names. In this
      % particular case |\string\jobname| would do, but anyway we
      % provide a~more general solution. Note the \pk{.auxx} extension
      % used instead of \pk{.aux}. This is done to avoid an infinite
      % recurrence of \nlpercent|\input|s.
    \fi
    \@tempswatrue
    \if@partsw \@tempswafalse\edef\@tempb{\jobname}%
      \@for
      \@tempa:=\@partlist\do{\ifx\@tempa\@tempb\@tempswatrue\fi}%
    \fi
    \if@tempswa \let\@auxout\@partaux
      \if@filesw
        \immediate\openout\@partaux \jobname.auxx\relax
        \immediate\write\@partaux{\relax}
      \fi
      % \begin{quotation}We need to save (and later
      %   restore)\dots\end{quotation} 
      \StoringAndRelaxingDo% provided by \pk{gmutils}
      \gmd@doIndexRelated
      \if@ltxDocInclude\part{\currentfile}%
      \else\let\maketitle=\InclMaketitle
      \fi
      \if@ltxDocInclude\xdef@filekey\fi
      \GetFileInfo{\currentfile}% it's my (GM) addition with the account
      % of using file info in the included files' title etc.
      \incl@DocInput{\fullcurrentfile}% originally just |\currentfile|, no
      % difference in |\SelfInclude|.
      \if@ltxDocInclude\else\xdef@filekey\fi% in 
      % the default case we add new file to the file key \emph{after} the
      % input because in this case it's files own |\maketitle| what
      % launches the sectioning command that increases the counter.
      % \par And here is the moment to restore the index-related commands.
      \RestoringDo
      \gmd@doIndexRelated
      %^^A\if@ltxDocInclude
      \clearpage% among others, causes the |\writes| to be executed which is
      % crucial for proper toc-ing e.g.
      %^^A\fi
      \gmd@writeckpt{\jobname.x}% note the |.x| in the checkpoint
      % used to distinguish this instance (input) of the driver file
      % from its main instance.
      \if@filesw \immediate\closeout\@partaux \fi
    \else\@nameuse{cp@\jobname.x}% note |.x|: it's used for the same
    % reason as above. 
    \fi
    \let\@auxout\@mainaux
  \fi}% end of |\SelfInclude|.

% The \pk{ltxdoc} class makes some preparations for inputting multiple
% files. We are not sure if the user wishes to use \pk{ltxdoc}-like
% way of documenting (maybe \heshe\ will prefer what I~offer,
% \pk{gmdocc.cls} e.g.), so we put
% those preparations into a~declaration.
%
% \CodeDefine\ltxLookSetup
% \CodeDefIndex\if@ltxDocInclude \CodeDefIndex*\@ltxDocIncludetrue
% \CodeDefIndex*\@ltxDocIncludefalse
\newif\if@ltxDocInclude

\newcommand*\ltxLookSetup{%
  \SetFileDiv{part}%
  \ltxPageLayout
  \@ltxDocIncludetrue
}

\@onlypreamble\ltxLookSetup

% The default is that we |\DocInclude| the files due to the original
% \gmdoc\ input settings.
\let\incl@DocInput=\DocInput

\@emptify\currentfile% for the pages outside the
% |\DocInclude|'s scope. In force for all includes.
%
% \iffalse
% % \stanza
% % But it may be not a~usual situation to include the source files
% % as with \pk{ltxdoc} but with the \emph{new} |\DocInput| macro. So
% % let's |\def|
% % \CodeDefine\ltxMultidocOldSetup
% \newcommand*\ltxMultidocOldSetup{%
%   \ltxMultidocSetup
%   \let\incl@DocInput=\OldDocInput}
%
% \@onlypreamble\ltxMultidocOldSetup
%
% And, for the symmetry, if you prefer the look offered by
% me, but 
% \fi

% If you want to |\Doc/SelfInclude| \docfm-likes:
% \CodeDefine\olddocIncludes
\newcommand*\olddocIncludes{%
  \let\incl@DocInput=\OldDocInput}

% And, if you have set the previous and want to set it back:
% \CodeDefine\gmdocIncludes
\newcommand*\gmdocIncludes{%
  \let\incl@DocInput=\DocInput
  \AtBegInput{\QueerEOL}}% to move back the |\StraightEOL| declaration put
% at begin input by |\olddocIncludes|.
%
%
% \subdivision{Redefinition of \cs{maketitle}}
%
% A~not-so-slight alteration of the \TextUsage\maketitle\ command in
% order it allow multiple titles in one document seems to me very
% clever. So let's copy again (\pk{ltxdoc.dtx} the lines 643--656):
%
% \begin{quotation}The macro to generate titles is easily altered in
% order that it can be used more than once (an article with many
% titles). In the original, diverse macros were concealed 
% after use with |\relax|. We must cancel anything that may have been
% put into |\@thanks|, etc., otherwise all titles will carry forward
% any earlier such setting!\end{quotation} 
% But here in \pk{gmdoc} we'll do it locally for (each) input 
% not to change the main title settings if there are any.
% \CodeDefine\maketitle
\AtBegInput{%
  \providecommand*\maketitle{\par
    \begingroup \def \thefootnote {\fnsymbol {footnote}}%
    \setcounter {footnote}\z@
    \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}%
    \long\def\@makefntext##1{\parindent 1em\noindent
      \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}%
    \if@twocolumn \twocolumn [\@maketitle ]%
    \else \newpage \global \@topnum \z@ \@maketitle \fi
% \begin{quotation}For special formatting requirements (such as in
% TUGboat), we use pagestyle |titlepage| for this; this is later defined
% to be |plain|, unless already defined, as, for example, by
% \pk{ltugboat.sty}.\end{quotation}
    \thispagestyle{titlepage}\@thanks \endgroup 
%\begin{quotation}If the driver file
% documents many files, we don't want parts of a title of one to
% propagate to the next, so we have to cancel these:\end{quotation}
    \setcounter {footnote}\z@
    \gdef\@date{\today}\g@emptify\@thanks%
    \g@emptify\@author\g@emptify\@title%
  }%\par
  % \begin{quotation}When a number of articles are concatenated into
  % a~journal, for example, it is not usual for the title pages of
  % such documents to be formatted differently. Therefore, a class
  % such as \pk{ltugboat} can define this macro in advance. However,
  % if no such definition exists, we use pagestyle plain for title
  % pages.\end{quotation}
  \@ifundefined{ps@titlepage}{\let\ps@titlepage=\ps@plain}{}%
  % \par And let's provide |\@maketitle| just in case:  an error occurred
  % without it at \TeX ing with \pk{mwbk.cls} because this class with the
  % default options does not define |\@maketitle|. The below definitions
  % are taken from \pk{report.cls} and \pk{mwrep.cls}.
  % \CodeDefine\@maketitle
  \providecommand*\@maketitle{%
    \newpage\null \vskip 2em\relax%
    \begin{center}%
      \titlesetup
      \let \footnote \thanks
      {\LARGE \@title \par}%
      \vskip 1.5em%
      {\large \lineskip .5em%
        \begin{tabular}[t]{c}%
          \strut \@author
        \end{tabular}\par}%
      \vskip 1em%
      {\large \@date}%
    \end{center}%
    \par \vskip 1.5em\relax}%\par
  % We'd better restore the primary meanings of the macros making
  % a~title. (\LaTeXe\ source, File F: ltsect.dtx Date: 1996/12/20 Version
  % v1.0z, lines 3.5.7.9--12.14--17.)
  % \CodeDefine\title \CodeDefine\author \CodeDefine\date
  % \CodeDefine\thanks 
  \providecommand*\title[1]{\gdef\@title{#1}}
  \providecommand*\author[1]{\gdef\@author{#1}}
  \providecommand*\date[1]{\gdef\@date{#1}}
  \providecommand*\thanks[1]{\footnotemark
    \protected@xdef\@thanks{\@thanks
      \protect\footnotetext[\the\c@footnote]{#1}}%
  }%\CodeDefIndex\and
  \providecommand*\and{%| % \begin{tabular}|
    \end{tabular}%
    \hskip 1em \@plus.17fil%
    \begin{tabular}[t]{c}}%| % \end{tabular}|
    % And finally, let's initialize \cs{tit\+le\+set\+up} if it is not yet.
    % \CodeDefine\titlesetup
    \providecommand*\titlesetup{}%
}% end of |\AtBegInput|.
%
% \changes[\titlesetup]{v0.98c}{06/09/08}{\cs{provide}d \cs[]{\{\}}}
%
%
% The \pk{ltxdoc} class redefines the |\maketitle| command to allow
% multiple titles in one document. We'll do the same and something
% more: our |\Doc/SelfInclude| will turn the file's |\maketitle| into
% a~part or chapter heading. But, if hte |\ltxLookSetup| declaration
% is in force, |\Doc/SelfInclude| will make for an included file
% a~part's title page and an \pk{article}-like title.
%
% \stanza
% Let's initialize the file division macros.
\@relaxen\filediv
\@relaxen\filedivname

% If we don't include files the \pk{ltxdoc}-like way, we wish to
% redefine |\maketitle| so that it typesets a~division's heading.
%

% Now, we redefine |\maketitle| and its relatives.
%
% \CodeDefine\InclMaketitle
% \changes{v0.98a}{06/09/05}{renamed from \cs{incl@maketitle} 'cause
% I~needed it in self-input hacks.}
\def\InclMaketitle{%\par\CodeDefIndex\and
  {\def\and{, }% we make |\and| just a~comma.
    {\let\thanks=\@gobble% for the toc version of the heading we
      % discard |\thanks|.\tOnLine
      \protected@xdef\incl@titletotoc{\@title\if@fshda\protect\space
        (\@author)\fi}% we add the author iff the `files have
      % different authors' \nlpercent(|@fshda|)
    }% \CodeDefine\thanks
    \def\thanks##1{\footnotemark
      \protected@xdef\@thanks{\@thanks% to keep the previous |\thanks|
        % if there were any.
        \protect\footnotetext[\the\c@footnote]{##1}}}% for some
    % mysterious reasons so defined |\thanks| do typeset the footnote
    % mark and text but they don't hyperlink it
    % properly. A~\pk{hyperref} bug?
    \@emptify\@thanks
    \protected@xdef\incl@filedivtitle{%
      [{\incl@titletotoc}]% braces to allow |[| and
      % |]| in the title to toc.
      {\protect\@title
        {\smallerr% this macro is provided by the \pk{gmutils}
          % package after the \pk{relsize} package.
          \if@fshda\\[0.15em]\protect\@author
            \if\relax\@date\relax\else, \fi
          \else
            \if\relax\@date\relax\else\\[0.15em]\fi
          \fi
          % The default is that all the included files have the same
          % author(s). In this case we won't print the author(s) in
          % the headings. Otherwise we wish to print them.  The
          % information which case are we in is brought by the
          % |\if@fshda| switch defined in line \ref{@fshda}.
% 
%  If we wish to print the author's name
% (|\if@fshda|), then we'll print the date after the author, separated
% with a~comma. If we don't print the author, there still may be
% a~date to be printed. In such a~case we break the line, too, and
% print the date with no comma.
          \protect\@date}}% end of |\incl@filedivtitle|'s brace (2nd
      % or 3rd argument).
    }% end of |\incl@filedivtitle|'s |\protected@xdef|.\par
    % We |\protect| all the title components to avoid expanding
    % |\footnotemark| hidden in |\thanks| during  |\protected@xdef|
    % (and to let it be executed during the typesetting, of course).
    }% end of the comma-|\and|'s group.
    \expandafter\filediv\incl@filedivtitle
    \@thanks
    \g@relaxen\@author \g@relaxen\@title \g@relaxen\@date
    \g@emptify\@thanks
}% end of |\InclMaketitle|.

% What I~make the default, is an assumption that all the
% multi-documented files have the same author(s). 
% And with the account of the other possibility I~provide
% the below switch and declaration.
%
% \CodeDefIndex\if@fshda
% \CodeDefIndex*\@fshdatrue
% \CodeDefIndex*\@fshdafalse
% \CodeDefine\PrintFilesAuthors
\newif\if@fshda
% \label{@fshda} (its name comes from \textit file\textit s
% \textit have \textit different \textit authors).

\newcommand*\PrintFilesAuthors{\@fshdatrue}
% And the counterpart, if you change your mind:
\newcommand*\SkipFilesAuthors{\@fshdafalse}

%
%
% \subdivision{Miscellanea}
%
% The main inputting macro, |\DocInput| has been provided. But there's
% another one in \docfm\ and it looks very reasonably:
% \gmhypertarget[IndexInput]{\cs{IndexInput}}. Let's make analogous one
% here:
% \CodeDefine\IndexInput
% \changes{v0.98b}{06/09/07}{\cs{StoreMacro}ing and \cs{RestoreMacro}ing
%   \cs{code@delim} added}
\def\IndexInput#1{%
  \StoreMacro\code@delim
  \CodeDelim*\^^A%
  \DocInput{#1}\RestoreMacro\code@delim}
% How does it work? We assume in the input file is no explicit 
% \<char1>. This char is chosen as the code delimiter and will be put
% at the end of input. So, entire file contents will be scanned char
% by char as the code.
% \stanza
%
% \iffalse First I~tried to use \specialcomment{gmlonely} provided by
% the \pk{comment} package, but it caused errors.\fi
%
% The below environment I~designed to be able to skip some repeating
% texts while documenting several packages of mine into one
% document. At the default settings it's just a~|\StraightEOL| group
% and in the |\skipgmlonely| declaration's scope it gobbles its
% contents.
%
% \CodeDefine*{gmlonely}
% \CodeDefine\skipgmlonely
\newenvironment{gmlonely}{\StraightEOL}{}

\newcommand\skipgmlonely[1][]{%
  \def\@tempa{%\CodeDefIndex\gmd@skipgmltext
    \def\gmd@skipgmltext{\g@emptify\gmd@skipgmltext#1}}%
  \@tempa
  \expandafter\AtBegInput\expandafter{\@tempa}%
  \renewenvironment{gmlonely}{%
    \StraightEOL
    \@fileswfalse% to forbid writing to \pk{.toc}, \pk{.idx} etc.
    \setbox0=\vbox\bgroup}{\egroup\gmd@skipgmltext}}

% Sometimes in the commentary of this package, so maybe also others,
% I~need to say some char is of category 12 (`other sign'). This I'll
% mark just as \catother\ got by |\catother|.
%
% \CodeDefine\catother
\bgroup\catcode`\_=8 % we ensure the standard |\catcode| of |_|.
\firstofone{\egroup
  \newcommand*\catother{${}_{12}$}%\par
% Similarly, if we need to say some char is of category 13 (`active'),
% we'll write \catactive, got by |\catactive|
% \CodeDefine\catactive
  \newcommand*\catactive{${}_{13}$}%\par
% and a~letter, \catletter
% \CodeDefine\catletter
  \newcommand*\catletter{${}_{11}$}%.
}
%
% For the copyright note first I~used just \env{verse} but it requires
% marking the line ends with |\\| and indents its contents while
% I~prefer the copyright note to be flushed left. So
% \CodeDefine*{copyrnote}
\newenvironment*{copyrnote}{%
  \StraightEOL\everypar{\hangindent3em\relax\hangafter1 }%
  \par\addvspace\medskipamount\parindent\z@\obeylines}{%
  \@codeskipputgfalse\stanza}
%
% I~renew the \env{quotation} environment to make the fact of quoting
% visible
% \CodeDefine*{quotation}
\renewenvironment{quotation}{\par``\ignorespaces}{\unskip''\par}
% \chunkskip
% For some mysterious reasons |\noindent| doesn't work with the first
% (narrative) paragraph after the code so let's work it around:
% \CodeDefine\gmdnoindent
\newcommand*\gmdnoindent{\leavevmode\hskip-\parindent}
%
% When a~verbatim text occurres in an inline comment, it's advisable to
% precede it with |%| if it begins a~not first line of such a~comment
% not to mistake it for a~part of code. For this purpose provide 
% \CodeDefine\nlpercent
\newcommand*\nlpercent{%
  \@ifstar{\def\@tempa{{\tt\twelvepercent}}%
    \@emptify\@tempb\nl@percent}%
  {\@emptify\@tempa
    \def\@tempb{\gmboxedspace}\nl@percent}}

\newcommand*\gmboxedspace{\hbox{\normalfont{ }}}

\newcommand*\nl@percent[1][]{%
  \unskip
  \discretionary{\@tempa}{{\tt\twelvepercent\gmboxedspace}}{\@tempb}%
  \penalty10000\hskip0sp\relax}
% As you see, |\nlpercent| inserts a~discretionary that breaks to |%|
% at the beginning of the lower line. Without the break it's a~space
% (alas at its natural width i.e., not flexible) or, with the starred
% version, nothing. The starred version puts |%| also at the end of
% the upper line.
%
% TODO: make the space flexible (most probably it requires using sth.\
% else than |\discretionary|).
%\stanza
%
% An optional hyphen for CSs in the inline comment:
% \CodeDefine\+
\@ifundefined{+}{}{\typeout{^^Jgmdoc.sty: redefining \bslash+.}}
\def\+{\discre{{\normalfont-}}{{\tt\twelvepercent\gmboxedspace}}{}}
%
%
% And finally, some logos:
% \begin{quotation} Here are a few definitions which can usefully be
% employed when documenting 
% package files: now we can readily refer to \AmSTeX, \BibTeX\ and \SliTeX, as well
% as the usual \TeX\ and \LaTeX. There's even a \PlainTeX\ and
% a~\Web.\end{quotation}
% \CodeDefine\AmSTeX \CodeDefine\BibTeX \CodeDefine\SliTeX
% \CodeDefine\PlainTeX \CodeDefine\Web \CodeDefine\TeXbook
% \CodeDefine\eTeX \CodeDefine\pdfeTeX \CodeDefine\pdfTeX
% \CodeDefine\XeTeX \CodeDefine\ds
\@ifundefined{AmSTeX}
  {\def\AmSTeX{\leavevmode\hbox{$\mathcal A\kern-.2em\lower.376ex%
        \hbox{$\mathcal M$}\kern-.2em\mathcal S$-\TeX}}}{}

\@ifundefined{BibTeX}
  {\def\BibTeX{{\rmfamily B\kern-.05em%
        \textsc{i\kern-.025em b}\kern-.08em%
        \TeX}}}{}

\@ifundefined{SliTeX}
  {\def\SliTeX{{\rmfamily S\kern-.06emL\kern-.18em\raise.32ex\hbox
        {\scshape i}\kern -.03em\TeX}}}{}

\@ifundefined{PlainTeX}{\def\PlainTeX{\textsc{Plain}\kern2pt\TeX}}{}

\@ifundefined{Web}{\def\Web{\textsc{Web}}}{}
% There's also the \LaTeXpar\ logo got with the |\LaTeXpar| macro
% provided by \pk{gmutils}. And here \TeXbook's logo:
\def\TeXbook{The \TeX book}

\@ifundefined{eTeX}{\def\eTeX{$\varepsilon$\TeX}}{}% The \eTeX\ manual
% uses `$\varepsilon$-\TeX' but that would look strange in \pdfeTeX.

\@ifundefined{pdfeTeX}{\def\pdfeTeX{pdf\eTeX}}{}

\@ifundefined{pdfTeX}{\def\pdfTeX{pdf\TeX}}{}

\@ifundefined{XeTeX}{\def\XeTeX{X\kern-.125em\relax
    \@ifundefined{reflectbox}{%
      \lower.5ex\hbox{E}\kern-.1667em\relax}{%
      \lower.5ex\hbox{\reflectbox{E}}\kern-.1667em\relax}%
    \TeX}}{}% As you see, if
% \TeX\ doesn't recognize \nlpercent\cs{re\+flect\+box} (\pk{graphics}
% isn't loaded), the first |E| will not be reversed. This version of
% the command is intended for non-\XeTeX\ usage. With \XeTeX, the
% reversed |E| you get as the Unicode Latin Letter Reversed E.

\@ifundefined{ds}{\def\ds{DocStrip}}{}

% Define |\filedate| and friends from info in the
% |\ProvidesPackage| etc.\ commands.
% \CodeDefine\GetFileInfo
\def\GetFileInfo#1{%
  \def\filename{#1}%
  \def\@tempb##1 ##2 ##3\relax##4\relax{%
    \def\filedate{##1}%
    \def\fileversion{##2}%
    \def\fileinfo{##3}}%
  \edef\@tempa{\csname ver@#1\endcsname}%
  \expandafter\@tempb\@tempa\relax? ? \relax\relax}

% Since we may documentally input files that we don't load, as \docfm\
% e.g., let's define a~macro for explicit providing the file
% info. It's written in analogy to |\ProvidesFile|, \pk{source ^^B
% 2${}_\epsilon$}, file L v1.1g, l.\,102.
% \CodeDefine\ProvideFileInfo
% \changes{v0.98a}{06/09/06}{added}
\def\ProvideFileInfo#1{%
  \begingroup
    \catcode`\ 10 \catcode\endlinechar 10 %
    \@makeother\/\@makeother\&%
    \kernel@ifnextchar[{\gmd@providefii{#1}}{\gmd@providefii{#1}[]}%^^A]
  }

  % \CodeDefIndex\gmd@providefii
\def\gmd@providefii#1[#2]{%\\
  % (we \emph{don't} write the file info to \pk{.log})
  \expandafter\xdef\csname ver@#1\endcsname{#2}%
  \endgroup}

% And a~self-reference abbreviation (intended for providing file info
% for the driver):
% \CodeDefine\ProvideSelfInfo
\def\ProvideSelfInfo{\ProvideFileInfo{\jobname.tex}}

% A~neat conventional statement used in \docfm's documentation e.g.,
% to be put in |\thanks| to the title or in a~footnote:
% \CodeDefine\filenote
\newcommand*\filenote{This file has version number \fileversion{} dated \filedate{}.}
% And exactly as  |\thanks|:
% \CodeDefine\thfileinfo
\newcommand*\thfileinfo{\thanks\filenote}


% \gmhypertarget[CDAnd]{Finally,} a~couple of macros for documenting
% files playing with |%|'s
% catcode(s). Instead of |%| I~used |&|. They may be at the end
% because they're used in the commented thread i.e.\ after package's
% |\usepackage|.  \CodeDefine\CDAnd
\newcommand*\CDAnd{\CodeDelim\&}
% \CodeDefine\CDPerc
\newcommand*\CDPerc{\CodeDelim\%}

% And for documenting in general:
%
% A~general sectioning command because I~foresee a~possibility of
% typesetting the same file once as independent document and another
% time as a~part of bigger whole.
\@ifdefinable\division{}% just to test (this \LaTeX\ check issues an
% error if the first argument is already defined). \CodeDefine\division
\@ifundefined{section}{%
  \@relaxen\division}{% \CodeDefine\division
  \let\division=\section}

\@ifdefinable\subdivision{}% just to test (see above). \CodeDefine\subdivision
\@ifundefined{subsection}{%
  \@relaxen\subdivision}{% \CodeDefine\subdivision
  \let\subdivision=\subsection}
% The |\let|s are inside |\@ifundefined|s because I'm not sure
% whether you will typeset a~documentation with usual classes. Maybe
% too much care.
%
%
% \stanza
% To kill a~tiny little bug in \file{doc.dtx} (in line 3299 |\@tempb| and
% |\@tempc| are written plain not verbatim):
% \CodeDefIndex*{gmd@mc} \CodeDefine\AfterMacrocode
\newcounter{gmd@mc}

\def\gmd@mchook{\stepcounter{gmd@mc}% \label{gmd@mchook}
  \gmd@mcdiag
  \csname gmd@mchook\the\c@gmd@mc\endcsname}

\long\def\AfterMacrocode#1#2{\@namedef{gmd@mchook#1}{#2}}
% What have I~done? I~declare a~new counter and employ it to count the
% \env{macrocode(*)}s (and \env{oldmc(*)}s too, in fact) and attach
% a~hook to (after) the end of every such environment. That lets us to
% put some stuff pretty far inside the compiled file (for the buggie
% in \file{doc.dtx}, to redefine |\@tempb/c|).

% One more detail to expalin and define: the |\gmd@mcdiag| macro may
% be defined to type out a~diagnostic message (the
% \env{macrocode(*)}'s number, code line number and input line number).
% \CodeDefine\gmd@mcdiag \CodeDefine\mcdiagOn \CodeDefine\mcdiagOff
\@emptify\gmd@mcdiag

\def\mcdiagOn{\def\gmd@mcdiag{%
    \typeout{^^J\bslash end{macrocode(*)} No.\the\c@gmd@mc
    \space\on@line, cln.\the\c@codelinenum.}}}

\def\mcdiagOff{\@emptify\gmd@mcdiag}
%
%
% \subdivision[\docfm-Compatibility]{\gmhypertarget[doccompa]{\docfm-Compatibility}}
%
% \gmhypertarget[doc-likeness]{My} \TeX\ Guru recommended me to write
% hyperlinking for \docfm. The suggestion came out when writing of
% \gmdoc\ was at such a~stage that I~thought it to be much easier to write
% a~couple of |\let|s to make \gmdoc\ able to typeset
% sources written for \docfm\ than to write a~new package that adds
% hyperlinking to \docfm. So\dots
%
% \stanza
% The \docfm\ package makes |%| an ignored char. Here the |%| delimits
% the code and therefore has to be `other'. But only the first one
% after the code. The others we may re|\catcode| to be ignored and we
% do it indeed in line \ref{ignorePercent}.
% \stanza
%
% At the very beginning of a~\docfm-prepared file we meet a~nice
% command \cs{Char\-act\-er\-Tab\-le}. My \TeX\ Guru says it's a~bit old
% fashioned these days so let's just make it notify the user:
% \CodeDefine\CharacterTable
% \CodeDefIndex\Character@Table
\def\CharacterTable{\begingroup
  \@makeother\{\@makeother\}%
  \Character@Table}

\begingroup
\catcode`\<=1 \catcode`\>=2 %
\@makeother\{\@makeother\}%
\firstofone<\endgroup
  \def\Character@Table#1{#2}<\endgroup
     \message<^^J^^J gmdoc.sty package:^^J
     ==== The input file contains the \bslash CharacterTable.^^J
     ==== If you really need to check the correctness of the chars,^^J
     ==== please notify the author of gmdoc.sty at the email address^^J
     ==== given in the legal notice in gmdoc.sty.^^J^^J>>>
% Similarly as \docfm, \gmdoc\ provides \env{macrocode}, \env{macro}
% and \env{environment} environments. Unlike in \docfm,
% |\end{macrocode}| \emph{does not} require to be preceded with any
% particular number of spaces. Unlike in \docfm, it \emph{is not}
% a~kind of \env{verbatim}, however, which means the code and
% narration layers remains in force inside it which means that any
% text after the first |%| in a~line will be processed as narration
% (and its control sequences will be executed). For a~discussion of
% a~possible workaround see line \ref{AVerySpecialMacro}.
%
% \stanza
% Let us now look over other original \docfm's control sequences and
% let's `domesticate' them if they are not yet.
% 
%  \gmdmarginpar{kici kici}
% The \TextUsage\DescribeMacro\ and \TextUsage\DescribeEnv\ commands
% seem to correspond with my |\TextUsage| macro in its plain and starred
% version respectively except they don't typeset their arguments in the text
% i.e., they do two things of the three. So let's |\def| them to do these
% two things in this package, too:
% \CodeDefine\DescribeMacro
\outer\def\DescribeMacro{%
  \begingroup\MakePrivateLetters
  \gmd@ifonetoken\Describe@Macro\Describe@Env}
% Note that if the argument to |\DescribeMacro| is not
% a~(possibly starred) control sequence, then as an environment's name
% shall it be processed \emph{except} the \cs{Mak\-ePriv\-at\-e\-Oth\-ers}
% re|\catcode|ing shall not be done to it.
% \CodeDefine\DescribeEnv
\outer\def\DescribeEnv{%
  \begingroup\MakePrivateOthers\Describe@Env}

% Actually, I've used the |\Describe...| commands myself a~few times, so
% let's |\def| a~common command with a~starred
% version:\CodeDefine\Describe
\outer\def\Describe{%
  \begingroup\MakePrivateLetters
  \@ifstarl{\MakePrivateOthers\Describe@Env}{\Describe@Macro}}

% The below two definitions are adjusted \*s of |\Text@UsgMacro| and
% |\Text@UsgEnvir|.
% \CodeDefIndex\Describe@Macro
\long\def\Describe@Macro#1{%
  \endgroup
  \strut\Text@Marginize#1%
  \@usgentryze#1% we declare kind of formatting the entry
  \text@indexmacro#1\ignorespaces}

% \CodeDefIndex\Describe@Env
\def\Describe@Env#1{%
  \endgroup
  \strut\Text@Marginize{#1}%
  \@usgentryze{#1}% we declare the `usage' kind of
  % formatting the entry and index the sequence |#1|.
  \text@indexenvir{#1}\ignorespaces}

% Note that here the environments' names are typeset in |\tt| font
% just like the macros', \emph{unlike} in \docfm.
%
% \stanza
% My understanding of `minimality' includes avoiding too much freedom
% as causing chaos not beauty. That's the philosophical and \ae^^B
% sthetic reason why I~don't provide \TextUsage\MacroFont. In
% my opinion there's a~noble tradition of typesetting the \TeX\ code
% in |\tt| font nad this tradition sustained should be. If one wants
% to change the tradition, let \himher\ redefine |\tt|, in \TeX\ it's
% no problem. I~suppose |\MacroFont| is not used explicitly, and that
% it's (re)defined at most, but just in case let's |\let|:

\let\MacroFont\tt

%
% \stanza
% We have provided \TextUsage\CodeIndent\ in line
% \ref{CodeIndent}. And it corresponds with \docfm's
% \Describe\MacroIndent\cs{Mac\-ro\-In\-dent} so
% \CodeDefine\MacroIndent
\let\MacroIndent\CodeIndent
% And similarly the other skips: \CodeDefine\MacrocodeTopsep
\let\MacrocodeTopsep\CodeTopsep
% Note that \TextUsage\MacroTopsep\ is defined in \gmdoc\ and has
% the same r\^ole as in \docfm.

\let\SpecialEscapechar\CodeEscapeChar

% \TextUsage\theCodelineNo\ is not used in
% \pk{gmdoc}. Instead of it there is \TextUsage\LineNumFont\
% declaration and a~possibility to redefine |\thecodelinenum| as for
% all the counters. Here the |\LineNumFont| is used two different
% ways, to set the benchmark width for a~linenumber among others, so it's not
% appropriate to put two things into one macro. Thus let's give the
% user a~notice if \heshe\ defined this macro: 
%
% Because of possible localness of the definitions it seems to be
% better to add a~check at the end of each |\DocInput| or
% |\IndexInput|. 

\AtEndInput{\@ifundefined{theCodelineNo}{}{\PackageInfo{gmdoc}{The
      \string\theCodelineNo\space macro has no effect here, please use
      \string\LineNumFont\space for setting the font and/or
      \string\thecodelinenum\space to set the number format.}}}
% I~hope this lack will not cause big trouble.
%
% \stanza
% For further notifications let's define a~shorthand:
% \CodeDefine\noeffect@info
\def\noeffect@info#1{\@ifundefined{#1}{}{\PackageInfo{gmdoc}{^^J%
      The \bslash#1 macro is not supported by this package^^J
      and therefore has no effect but this notification.^^J
      If you think it should have, please contact the maintainer^^J
      indicated in the package's legal note.^^J}}}

% The four macros formatting the macro and environment names, namely
% \possfil\TextUsage\PrintDescribeMacro,
% \possfil\TextUsage\PrintMacroName,
% \possfil\TextUsage\PrintDescribeEnv\ and
% \possfil\TextUsage\PrintEnvName\  are not
% supported by \pk{gmdoc}. They seem to me to be too internal to take
% care of them. Note that in the name of (\ae sthetical) minimality
% and (my) convenience I~deprive you of easy knobs to set strange
% formats for verbatim bits: I~think they are not advisable.
%
% Let us just notify the user. 
\AtEndInput{%
  \noeffect@info{PrintDescribeMacro}%
  \noeffect@info{PrintMacroName}%
  \noeffect@info{PrintDescribeEnv}%
  \noeffect@info{PrintEnvName}}
  
% The \TextUsage\CodelineNumbered\ declaration of \docfm\ seems to be
% equivalent to our |noindex| option with the |linesnotnum| option set
% off so let's define it such a~way.
\def\CodelineNumbered{\AtBeginDocument{\gag@index}}
\@onlypreamble\CodelineNumbered
% Note that if the |linesnotnum| option is in force, this declaration
% shall not revert its effect. 
%
% I~assume that if one wishes to use \docfm's interface then \heshe'll
% not use \gmdoc's options but just the default.
%
% \stanza
% The |\CodelineIndex| and |\PageIndex| declarations
% correspond with  the \pk{gmdoc}'s default and the |pageindex| option
% respectively.
% Therefore let's |\let|
% \CodeDefine\CodelineIndex
\let\CodelineIndex\@pageindexfalse
\@onlypreamble\CodelineIndex

% \CodeDefine\PageIndex 
\let\PageIndex\@pageindextrue
% \label{PageIndex}
\@onlypreamble\PageIndex

% The next two declarations I~find useful and
% smart:\CodeDefine\DisableCrossrefs
\def\DisableCrossrefs{\@bsphack\gag@index\@esphack}

% \CodeDefine\EnableCrossrefs
\def\EnableCrossrefs{\@bsphack\ungag@index
  \def\DisableCrossrefs{\@bsphack\@esphack}\@esphack}
% The latter definition is made due to the footnote 6 on p.\,8 of the
% Frank Mittelbach's \docfm's documentation and both of them are
% copies of lines 302--304 of it modulo |\|(|un|)|gag@index|.
%
% \stanza
% The subsequent few lines I~copy almost verbatim ;-) from the lines
% 611--620.\CodeDefine\AlsoImplementation
\newcommand*\AlsoImplementation{\@bsphack%
  \long\def\StopEventually##1{\gdef\Finale{##1}}% we define
  % \cs{Fi\+n\+a\+le} just to expand to the argument of |\StopEventually| not
  % to to add anything to the end input hook because |\Finale| should
  % only be executed if entire document is typeset.\nostanza\par
  % 
  % \hangindent\verbatimhangindent \hangafter1\relax
  % \gmdnoindent \leftskip\CodeIndent
  % |%\init@checksum| is obsolete in
  % \pk{gmdoc} at this point: the \env{CheckSum} counter is reset just at
  % the beginning of (each of virtually numerous) input(s).
  % \nostanza\par
    \@esphack}

\AlsoImplementation

% \begin{quotation} When the user places an |\OnlyDescription|
%   declaration in the driver file the document should only be typeset
%   up to |\StopEventually|. We therefore have to redefine this
%   macro.\end{quotation} \CodeDefine\OnlyDescription 

\def\OnlyDescription{\@bsphack\long\def\StopEventually##1{%
    % \begin{quotation} In this case the argument of |\StopEventually|
    %   should be set and afterwards \TeX\ should stop reading from
    %   this file. Therefore we finish this macro with\end{quotation}
    ##1\endinput}\@esphack}

% \begin{quotation} If no |\StopEventually| command is given we
%   silently ignore a~|\Finale| issued.\end{quotation}

\@relaxen\Finale

% The \TextUsage\meta\ macro is so beautifully crafted in \docfm\ that
% I~couldn't resist copying it into \pk{gmutils}. It's also available
% in Knuthian (\TeXbook\ format's) disguise
% \Describe*{\<...>}|\<|\<the argument>|>|.
% \stanza
% The checksum mechanism is provided and developed for a~slightly
% different purpose.
% \stanza
% Most of \docfm's indexing commands have already been `almost
% defined' in \pk{gmdoc}:
% \CodeDefine\SpecialMainIndex
\let\SpecialMainIndex=\CodeDefIndex

% \DoNotIndex\endcsname*
% \CodeDefine\SpecialMainEnvIndex
\def\SpecialMainEnvIndex{\csname CodeDefIndex\endcsname*}% we don't
% type |\CodeDefIndex| explicitly here 'cause it's |\outer|, remember?

% \CodeDefine\SpecialIndex \CodeDefine\SpecialUsageIndex
% \CodeDefine\SpecialEnvIndex \CodeDefine\SortIndex
\let\SpecialIndex=\CodeCommonIndex

\let\SpecialUsageIndex=\TextUsgIndex

\def\SpecialEnvIndex{\csname TextUsgIndex\endcsname*}

\def\SortIndex#1#2{\index{#1\actualchar#2}}
% \begin{quotation}All these macros are usually used by other macros;
% you will need them only in an emergency.\end{quotation}
% 
% Therefore I~made the assumption(s) that `Main' indexing macros are
% used in my `Code' context and the 'Usage' ones in my `Text' context.
%
% \stanza
% Frank Mittelbach in \docfm\ provides the \TextUsage\verbatimchar\
% macro to (re)define the |\verb(*)|'s delimiter for the index
% entries. The \gmdoc\ package uses the same macro and its default definition
% is |{&}|. When you use \docfm\ you
% may have to redefine |\verbatimchar| if you use (and index) the |\+|
% control sequence. \pk{gmdoc} does a~check for the analogous situation
% (i.e., for processing |\&|) and
% if it occures it takes |$| as the |\verb*|'s delimiter. So strange
% delimiters are chosen deliberately to allow any `other' chars in the
% environments' names. If this would cause problems, please
% notify me and we'll think of adjustments.
%
% \CodeDefine\verbatimchar
% \changes{v0.98c}{06/9/10}{put into all indexing macros for the
% accordance of the `macro' and the `environment' index entries; the 
% \cs[]{\$} sign set as its alternative}
\def\verbatimchar{&}

% One more a~very neat macro provided by \docfm. I~copy it
% verbatim and put into \pk{gmutils}, too. (|\DeclareRobustCommand|
% doesn't issue an error if its argument has been defined, it only
% informs about redefining.)
% \CodeDefine\*\changes{v0.98}{06/09/05}{made robust.}
\DeclareRobustCommand*\*{\leavevmode\lower.8ex\hbox{$\,\widetilde{\ }\,$}}


% \TextUsage\IndexPrologue\ is defined in line
% \ref{IndexPrologue}. And other \docfm\ index commands too.

% \CodeDefine\main \CodeDefine\usage
\@ifundefined{main}{}{\let\DefEntry=\main}

\@ifundefined{usage}{}{\let\UsgEntry=\usage}

% About how the \ds\ directives are supported by \pk{gmdoc},
% see section \gmiflink[docstrip]{The \ds\dots}.
% This support is not \emph{that} sophisticated as in \docfm, among others, it
% doesn't count the modules' nesting. Therefore if we dont want an
% error while \pk{gmdoc}umenting \docfm-prepared files, better let's
% define \docfm's counter for the modules' depths.
% \CodeDefine*{StandardModuleDepth}
\newcounter{StandardModuleDepth}

% \stanza
% For now let's just mark the macro for further development
% \CodeDefine*\DocstyleParms
\noeffect@info{DocstyleParms}

% For possible further development or to notify the user once and
% forever:
% \CodeDefine\DontCheckModules \CodeDefine\CheckModules
\@emptify\DontCheckModules \noeffect@info{DontCheckModules}
\@emptify\CheckModules \noeffect@info{CheckModules}
% The \TextMarginize\Module|\Module| macro \emph{is} provided exactly
% as in \docfm.
% \CodeDefine\AltMacroFont
\@emptify\AltMacroFont \noeffect@info{AltMacroFont}

% \begin{quotation} And finally the most important bit: we change the
% |\catcode| of |%| so that it is ignored (which is how we are able to
% produce this \pk{doc}ument!). We provide two commands to do the
% actual switching.\end{quotation}
% \CodeDefine\MakePercentIgnore \CodeDefine\MakePercentComment
\def\MakePercentIgnore{\catcode`\%9\relax}
\def\MakePercentComment{\catcode`\%14\relax}
%
%
% \subdivision{\gmdoc ing \file{doc.dtx}}
%
% The author(s) of \docfm\ suggest(s): \begin{quotation}For examples
% of the use of most---if not all---of the features described above
% consult the \file{doc.dtx} source itself.\end{quotation}
% Therefore I~hope that after \file{doc.dtx} has been \gmdoc-ed, one
% can say \gmdoc\ is \docfm-compatible ``at most---if not at all''.
%
% \TeX ing the original \docfm\ with my humble\footnote{What ^^B(
% a~\emph{false} modesty! ;-)}  package was a~challenge and
% a~milestone experience in my \TeX\ life.
%
% \stanza
% One of minor errors was caused by my understanding of a~`shortverb'
% char: due to \pk{gmverb}, in the math mode an active `shortverb' char
% expands to itself's `other' version thanks to |\string| (It's done
% with \verb+|+ in mind). \docfm's
% concept is different, there a~`shortverb' char should in the math
% mode work as shortverb. So let it be as they wish: \pk{gmverb}
% provides |\OldMakeShortVerb| and the oldstyle input commands change
% the inner macros so that also |\MakeShortVerb| works as in \docfm
% (cf.\ line \ref{oldmkshvrrb}). 
%
% We also redefine the \env{macro} environment to make it mark the
% first code line as the point of defining of its argument, because
% \pk{doc.dtx} uses this environment also for implicit definitions.
%
% \changes[\OldMakeShortVerb]{v0.98a}{06/09/05}{and pals moved to
% \pk{gmverb}.} 
%\CodeDefine\OldDocInput
% \changes{v0.98}{06/09/05}{\cs{@makeother\protect\bslash_} added}
% \changes{v0.98a}{06/09/05}{\cs{AtBegInput} changed into
% \cs{AtBegInputOnce}.}
% \changes{v0.98b}{06/09/07}{enrichments of the \env{macrocode(*)}
% definitions moved to the default definitions of these envs.}
\def\OldDocInput{%
  \AtBegInputOnce{\StraightEOL
    \let\@MakeShortVerb=\old@MakeShortVerb
    %\label{oldmkshvrrb}\CodeDefIndex\gmd@@macro
    \let\gmd@@macro\macro
    \def\macro{\let\gmd@ifonetoken\@secondoftwo\gmd@@macro}% (Of course,
  % na\-\"\i{}\-ve
  % \nlpercent|\exp...\let\exp...\macro\cs...\macro*\endcs...| caused
  % an infinite loop since in the definition of \env{macro*} the
  % |\macro| macro occures.)
    \VerbMacrocodes}%
  \bgroup\@makeother\_% it's to allow |_| in the filenames. The next
  % macro will close the group.
  \Doc@Input}
% We don't swith the |@codeskipput| switch neither we check it because
% in `old' world there's nothing to switch this switch in the
% narration layer.
%
% \stanza
% I~had a~hot and wild \TeX\ all the night nad what a~bliss when
% the `Succesfully formated 67 page(s)' message appeared. 
% 
% My package needed fixing some bugs and adding some compatibility
% adjustments (listed in the previous section) and the original
% \pk{doc.dtx} source file needed a~few adjustments too because some
% crucial differences came out. I'd like to write a~word about them now.
%
% \stanza
% The first but not least is that the author(s) of \docfm\ give the
% CS marking commands non-macro arguments sometimes, e.g.,
% |\DescribeMacro{StandardModuleDepth}|. Therefore we should launch
% the \emph{starred} versions of corresponding \gmdoc\ commands. This
% means the \docfm-like commands will not look for the CS's occurrence
% in the code but will mark the first codeline met.
% \stanza
%
% Another crucial difference is that in \gmdoc\ the narrative and the
% code layers are separated with only the code delimiter and
% therefore may be much more mixed than in \docfm. among others, the \env{macro}
% environment is \emph{not} a~typical \env{verbatim} like: the texts
% commented out within \env{macrocode} are considered a~normal
% commentary i.e., not verbatim. Therefore some macros `commented out'
% to be shown verbatim as an example source must have been `additionally'
% verbatimized for \gmdoc\ with the shortverb chars e.g. You may also
% change the code delimiter for a~while, e.g., the line
% \CodeDelim*\.
% \AVerySpecialMacro % delete the first % when.\unskip|..|\par\CDPerc
%
% \gmdnoindent\label{AVerySpecialMacro}
%  was got with
% \begin{verbatim}
%\CodeDelim*\.
%% \AVerySpecialMacro % delete the first % when.\unskip|..|\CDPerc
%\end{verbatim}
%
% \leftskip0sp\relax
% One more difference is that my shortverb chars expand to their
% \catother\ versions in the math mode while in \docfm\ remain
% shortverb, so I~added a~declaration |\OldMakeShortVerb| etc.
%
% \stanza
% Moreover, it's \TeX ing \docfm\ what inspired adding the
% |\StraightEOL| and |\QueerEOL| declarations.
%
%
%
% \division{Polishing, Development and Bugs}
% 
% \begin*{bulletpars}
%   \everypar{$\bullet$ }
%   \label{Tasks}|\MakePrivateLetters| theoretically may interfere
%   with |\active|ating some chars to allow linebreaks. But making
%   a~space or an opening brace a~letter seems so perverse that we may
%   feel safe not to take account of such a~possibility.
%
%   When |countalllines| option is enabled, the comment lines
%   that don't produce any printed output result with a~(blank) line too
%   because there's put a~hypertarget at the beginning of them. But for
%   now let's assume this option is for draft versions so hasn't be
%   perfect.
%   
%   Marcin Woli\'nski suggests to add the marginpar clauses for the
%   AMS classes as we did for the standard ones in the lines
%   \ref{mparclause1}--\ref{mparclause2}. Most probably I~can do it on
%   request when I~only know the classes' names and their `marginpar
%   status'.
%
%   When the |countalllines| option is in force, some |\list|
%   environments shall raise the `missing |\item|' error if you don't
%   put the first |\item| in the same line as
%   |\begin{|\<environment>|}| because the (comment-) line number is
%   printed.^^A~\end{} 
%
% I'm prone to make the control sequences hyperlinks to the(ir)
% `definition' occurrences. It doesn't seem to be a~big work compared
% with what has been done so far.
%     
% Is |\RecordChanges| really necessary these days? Shouldn't be the
% |\makeglossary| command rather executed by default?\footnote{It's ^^B
% understandable that ten years earlier writing things out to the files ^^B
% remarkably decelerated \TeX, but nowadays it does not in most ^^B
% cases. That's why \cs{makeindex} is launched by default in \gmdoc.}
%
% Do you use |\listoftables| and/or |\listoffigures| in your
% documentations? If so, I~should `EOL-straighten' them like
% |\tableofcontents|, I~suppose (cf.\ line \ref{straighttoc}).
%
% Some lines of non-printing stuff such as |\CodeDefine...| and
% |\changes| connecting the narration with the code resulted with
% unexpected large vertical space. Adding a~fully blank line between
% the printed narration text and not printed stuff helped.
%
% My \TeX\ Guru remarked that |\jobname| expands to the main file name
% without extension iff that extension is \file{.tex}. Should
% I~replace |\jobname| with |\jobnamewoe| then? (The latter always
% expands to the file name without extension.)
%
% About the \ds\ \gmiflink{verbatim mode directive} see above.
%
% \end{bulletpars}
% 
% \def\EOFMark{\<eof>}
% \division{(No) \EOFMark} If the user doesn't wish the
% documentation to be ended by \EOFMark, \heshe\
% should end the file with a~comment ending with |\NoEOF| macro
% defined below\footnote{Thanks to Bernd Raichle at Bacho\TeX\ 2006 ^^B
%   Pearl Session where he presented \cs{input}ing a~file inside ^^B
%   \cs{edef}.}:
%
% \CodeDefine\NoEOF
% \changes{v0.98}{06/09/05}{extended to add it the \cs{endinput} effect}
% \changes{v0.98l}{06/10/27}{divided in two macros first of which
% makes queer EOL and the latter gobbles the stuff till the EOL to
% suppress possible \cs{endinput} when used in \cs{StopEventually}}

\bgroup\catcode`\^^M\active \firstofone{\egroup%
  \def\@NoEOF#1^^M{%
    \@relaxen\EOFMark\expandafter\noexpand\endinput^^M}}

\def\NoEOF{\QueerEOL\@NoEOF}

% \label{NoEOF} As you probably see, |\NoEOF| has also the
% |\endinput| effect. 

\endinput
%^^A~\docstrip
%</package>
%\PrintChanges \PrintIndex 
%
%
%^^A~place for general changes:
%
% \changes{v0.98a}{06/09/06}{\cs{AtBeginput}, \cs{AtEndinput},
% \cs{AtBeginputOnce} renamed to \cs{AtBegInput}, \cs{AtEndInput}
% \cs{AtBegInputOnce} respect.}
%
% \changes{v0.98c}{06/9/9}{making \cs{CodeDefine} and \cs{CodeUsage}
% markers to add up; bug fixes in indexing macros and change of
% concept of \cs{Code(Define$\quotechar|$Usage)*}: hence they serve not only for
% environments but also for implicit def/use of macros}
%
% \changes{v0.98d}{06/9/11}{mostly editing the narrative, marking
% special index entries etc.; queering \cs{char1} and \cs{char2}
% repeated \cs{AtBegInput}}
%
% \changes{v0.98e}{06/09/24}{Some macros moved to \pk{gmutils}:
% \cs{cs} and pals and one-chars with queer \cs{catcode}s}
%
% \changes{v0.98f}{06/09/27}{A~bug fixed: \cs{Code@MarginizeMacro} set
% to define a~CS and the corresponding test set to check if it's
% undefined. In all three such definitions and resets after the use,
% \cs{def} is changed to \cs{(g)let}}
%
% \changes{v0.98g}{06/10/10}{among others, \cs{discretionary}s for breaking
% a~CS to percent at the beginning of the lower line. Moreover, fixing
% a~bug/feature that leaves the code leftskip in the narration when an
% inline comment is followed by another codeline (w.o.\ explicit
% \cs{par}). And lots of finishing touches to the text. A~special font
% for the marginpar CSs among others}
%
% \changes{v0.98l}{06/10/26}{in \cs{AtBegInputOnce} an auxiliary macro
% for each use substituted with one macro added at begin input. In
% \cs{gmd@evpaddonce} a~counter substituted with a~numeric
% macro. \cs{@ifQueerEOL} made polite i.e., a~two-argument not
% expanding to an open \cs{if...}}
%
% \changes{v0.99}{06/11/24}{\env{oldmc(*)} implemented that's
% (hope)fully  compatible with \docfm's \env{macrocode(*)}. Moreover,
% a~declaration letting \gmdoc's \env{macrocode} to \env{oldmc(*)}}
%
% \changes{v0.99a}{06/11/30}{The \ds\ directives implemented fully
% automatic (no more need of \cs{doctrip(s)} declarations). Moreover,
% some minor changes due to \TeX ing The Source.}
%
% \Finale

% (For my GNU Emacs:)
%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "e:/LaTeX/TeXGuru/gmdoc/gmdocDoc"
%%% End: