summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nameauth/nameauth.dtx
blob: 6c7589aa3ebd1c872766b68858c5e12d249412a6 (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
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
% \iffalse meta-comment
%
% Copyright (C) 2024 by Charles P. Schaum <charles[dot]schaum@comcast.net>
% -------------------------------------------------------
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
%    https://www.latex-project.org/lppl.txt
%
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
%<*internal>
\iffalse
%</internal>
%<*readme>
%<<readmevb
# 1. Short Description

The `nameauth` package automates the correct formatting and indexing of names for professional writing. This aids the use of a name authority and the editing process without needing to retype name instances.

# 2. Files in Zip Archive

The following files are included in the archive that is uploaded to CTAN:

| Filename       | Description                |
| :------------- | :------------------------- |
| `Makefile`     | for use with GNU make      |
| `cat01.pdf`    | manual illustration, ch. 7 |
| `beamer01.pdf` | manual illustration, ch. 9 |
| `beamer02.pdf` | manual illustration, ch. 9 |
| `beamer03.pdf` | manual illustration, ch. 9 |
| `nameauth.dtx` | commented macro file       |
| `compat.tex`   | compatibility module       |
| `examples.tex` | example file               |
| `nameauth.pdf` | package documentation      |
| `README.md`    | this file                  |

# 3. Installing a Distro Package

One can find `nameauth` in one's current TeX distribution. See the appropriate documentation in TeXlive, MikTeX, MacTeX, Linux distro, BSD, etc. Use those tools to ensure that `nameauth` is installed. You are done.

# 4. Installing from CTAN

## 4.1 Getting the Package Archive

If not using the tools above, one can download `nameauth.zip` from [CTAN](https://mirrors.ctan.org/macros/latex/contrib/nameauth.zip). After downloading, unpack `nameauth.zip` in an appropriate directory. Change to the directory containing the supplied files.

## 4.2 Using GNU make

### 4.2.1 Read the File

**Please inspect the included `Makefile` before using it.**

`Makefile` has an extensive comment on usage, as well as many other comments. This file lists all the programs that must be installed in order to use the GNU make file, helping one to check for prerequisites and dependencies. This method is designed for a POSIX-compliant environment, such as GNU/Linux, various BSDs, MacOS, and WSL or Cygwin on Windows.

### 4.2.2 Prepare to Install, No Building

One does not need to build `nameauth` completely from source (although it may be a good idea to do a native build). If the provided files are sufficient, one can type:

    make unpack

This target only unpacks the supplied generated files from `nameauth.dtx`. It does not try to create the documentation. One will have the following files now:

| Filename       | Description                | TDS-where to |
| :------------- | :------------------------- | :----------- |
| `Makefile`     | for use with GNU make      | source dir   |
| `cat01.pdf`    | manual illustration, ch. 7 | source dir   |
| `beamer01.pdf` | manual illustration, ch. 9 | source dir   |
| `beamer02.pdf` | manual illustration, ch. 9 | source dir   |
| `beamer03.pdf` | manual illustration, ch. 9 | source dir   |
| `nameauth.dtx` | commented macro file       | source dir   |
|                |                            |              |
| `nameauth.ins` | installation driver        | unneeded     |
|                |                            |              |
| `compat.tex`   | compatibility module       | doc dir      |
| `examples.tex` | example file               | doc dir      |
| `nameauth.pdf` | package documentation      | doc dir      |
| `README.md`    | this file                  | doc dir      |
|                |                            |              |
| `nameauth.sty` | style file                 | package dir  |

Take a look at **4.2.3 Specific Build Cases** and, depending on the use case, skip either to **4.2.5 Installation** (using make) or **4.3.3 Installation Prerequisites** (manual) below.

### 4.2.3 Specific Build Cases: Program Extensions

Windows presents some interesting cases. Both Cygwin and WSL provide POSIX environments that include respective TeX distros of their own. Yet they also will operate with native Windows-based TeX distros like MikTeX and TeXlive.

When using the TeX distros built in to Cygwin and WSL exclusively, one can treat it basically as a POSIX-compliant environment.

Even when using Cygwin and a Windows-based TeX distro, one can treat package building as being mostly the same as a POSIX environment if all the prerequisite programs are installed. Installation, however, must be manual.

When one uses WSL with a Windows-based TeX distro, the `Makefile` will test whether an ".exe" extension is needed by the programs used in the building process.

With both Cygwin and WSL, tests will determine if the standard POSIX method is capable of installing and packaging as intended, or if manual methods are needed.

* Make will test if `ltxfileinfo` exists. If not, it will produce a zip file with just the package base name to avoid problems that otherwise could arise in Windows.

* Make will test if `dvipdf` from Ghostscript is installed and use that. Otherwise it will fall back to `dvipdfmx`.

* Make will test if `pdfjam` is installed, if one needs to remake the manual illustrations. Otherwise, it will advise on how to do that manually.

* Make will try to see if the path to the desired install directory exists. If it does not, make will produce an error message and exit. If this happens, which is likely under Windows, please refer to installation of local packages in MikTeX [here](https://docs.miktex.org/manual/localadditions.html#id573803) and [here](https://miktex.org/kb/texmf-roots). Otherwise see the [TeX FAQ](https://www.texfaq.org/FAQ-privinst) and [this page](https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages).

Here is a table showing the feasibility of a few scenarios:

| Platform | TeX Distro Platform | Make builds pkg/zip            | Make installs package           |
| :------- | :------------------ | :----------------------------- | :------------------------------ |
| POSIX    | POSIX               | Yes<sup>1</sup>                | Yes                             |
| Cygwin   | Cygwin (packages)   | Not tested; likely<sup>1</sup> | Not tested; likely <sup>2</sup> |
| Cygwin   | MikTeX (Windows)    | Yes<sup>1, 3</sup>             | No;<sup>4</sup> do manually     |
| Cygwin   | TeXlive (Windows)   | Not tested; likely<sup>1</sup> | Not tested; do manually         |
| Cygwin   | Cygwin and Windows  | Not tested; not recommended    | Not tested; not recommended     |
| WSL      | WSL Linux packages  | Yes<sup>1</sup>                | Yes<sup>5</sup>                 |
| WSL      | MikTeX (Windows)    | Yes<sup>1, 3</sup>             | No;<sup>4</sup> do manually     |
| WSL      | TeXlive (Windows)   | Not tested; likely<sup>1</sup> | Not tested; do manually         |
| WSL      | WSL and Windows     | Not tested; not recommended    | Not tested; not recommended     |
| WSL/Cyg  | WSL and Cygwin      | Not tested; not recommended    | Not tested; not recommended     |
| GNUWin   | any (Windows)       | Not tested; not recommended    | Not tested; not recommended     |

<sup>1</sup> All dependencies must be met. Bear in mind MacOS quirks.

<sup>2</sup> Installs only to Cygwin environment; not to Windows environment.

<sup>3</sup> If one attempts the `make images` target, it is unlikely that `pdfjam` will work; one must create pdf page examples included in the manual by compiling the appropriate test files and extracting the pages using a different app.

<sup>4</sup> Neither `ltxfileinfo` nor `kpsewhich` will give useful results; do a manual install.

<sup>5</sup> Installs only to WSL Linux distro environment; not to Windows environment.

### 4.2.4 Building the Package

In the directory where the files unpacked from the zip archive are located, type `make`. This will do a fresh build of the package using `pdflatex`.

### 4.2.5 Installation

The user must already have a TDS-compliant tree set up in order for installation to work. Thus, one must have created a `texmf` directory to which TEXMFHOME refers, if in a POSIX environment, or have the equivalent in another environment. Currently, `Makefile` only installs into POSIX environments.

Assuming that one has a use case where one can use GNU make, one can choose the following:

* Type `make inst` to install the package files in the user's personal TDS-compliant directory tree.

* Type `make install` to install the package files in the system-wide, local TDS-compliant directory tree. The user will be prompted for the `sudo` password.
  
  If, for some reason, this fails, do a manual install (below).

Note that these make targets depend on `package`, which does not do a clean build. If one desires a clean build that is followed by an install, use `make release inst` or `make release install`.

### 4.2.6 Removal

The same constraints that apply to installation also apply to removal. If one can do the former, one can do the latter.

* Type `make uninst` to remove the package files in the user's personal TDS-compliant directory tree.

* Type `make uninstall` to remove the package files in the system-wide, local TDS-compliant directory tree. The user will be prompted for the `sudo` password.
  
  If, for some reason, this fails, do a manual removal (opposite of steps used below).

The approach of `Makefile` is not to get too aggressive with deletions from the texmf tree, just in case. One may see harmless, extra empty directories after removal.

## 4.3 Manual Method

Unlike when using GNU make, which automates adding extensions, in the case of working with WSL together with native Windows TeX distros, in the command lines below there may be certain cases where one may have to add the ".exe" extension to the programs. Those cases should, however, be few.

### 4.3.1 Prepare to Install, No Building

One does not need to build `nameauth` completely from source (although it may be a good idea to do a native build). If the provided files are sufficient, one can type:

    pdftex nameauth.dtx

This only unpacks the supplied generated files from `nameauth.dtx`. It does not try to create the documentation. One will have the following files now:

| Filename       | Description                | TDS-where to |
| :------------- | :------------------------- | :----------- |
| `Makefile`     | for use with GNU make      | source dir   |
| `cat01.pdf`    | manual illustration, ch. 7 | source dir   |
| `beamer01.pdf` | manual illustration, ch. 9 | source dir   |
| `beamer02.pdf` | manual illustration, ch. 9 | source dir   |
| `beamer03.pdf` | manual illustration, ch. 9 | source dir   |
| `nameauth.dtx` | commented macro file       | source dir   |
|                |                            |              |
| `nameauth.ins` | installation driver        | unneeded     |
|                |                            |              |
| `compat.tex`   | compatibility module       | doc dir      |
| `examples.tex` | example file               | doc dir      |
| `nameauth.pdf` | package documentation      | doc dir      |
| `README.md`    | this file                  | doc dir      |
|                |                            |              |
| `nameauth.sty` | style file                 | package dir  |

One may skip past building to **4.3.3 Installation Prerequisites** below.

### 4.3.2 Building the Package

1. Using the unpacked files from the zip archive, we begin by creating the installation driver, unpacking additional files from `nameauth.dtx`, and generating a copy of the documentation without the table of contents and cross-references:
   
       pdflatex --shell-escape --recorder --interaction=batchmode nameauth.dtx
   
   Now we should have the following files:

| Filename       | Description                |
| :------------- | :------------------------- |
| `Makefile`     | for use with GNU make      |
| `cat01.pdf`    | manual illustration, ch. 7 |
| `beamer01.pdf` | manual illustration, ch. 9 |
| `beamer02.pdf` | manual illustration, ch. 9 |
| `beamer03.pdf` | manual illustration, ch. 9 |
| `nameauth.dtx` | commented style file       |
|                |                            |
| `compat.tex`   | compatibility module       |
| `examples.tex` | example file               |
| `nameauth.pdf` | package documentation      |
| `README.md`    | this file                  |
|                |                            |
| `nameauth.ins` | installation driver        |
| `nameauth.sty` | style file                 |

   In addition, we have the following temporary files:

| Filename       | Description                  |
| :------------- | :--------------------------- |
| `nameauth.aux` | auxiliary file               |
| `nameauth.fls` | shows files read             |
| `nameauth.glo` | raw glossary entries         |
| `nameauth.hd ` |                              |
| `nameauth.idx` | raw index entries            |
| `nameauth.log` | log file                     |
| `nameauth.out` | pdf bookmark/hypertext info  |
| `nameauth.tmp` | temp file used with fancyvrb |
| `nameauth.toc` | table of contents info       |

2. Generate the TOC and cross-references within the documentation:
   
       pdflatex --recorder --interaction=nonstopmode nameauth.dtx

3. Generate the index and glossary files using `makeindex`:
   
       makeindex -q -s gglo.ist -o nameauth.gls nameauth.glo
       makeindex -q -s gind.ist -o nameauth.ind nameauth.idx
   
   This adds the following files:

| Filename       | Description              |
| :------------- | :----------------------- |
| `nameauth.gls` | typeset glossary entries |
| `nameauth.ilg` | `makeindex` log file     |
| `nameauth.ind` | typeset index entries    |

4. Integrate the glossary (list of changes) and index into the documentation. The second run updates the TOC:
   
       pdflatex --recorder --interaction=nonstopmode nameauth.dtx
       pdflatex --recorder --interaction=nonstopmode nameauth.dtx

### 4.3.3 Installation Prerequisites

In order to perform manual installation, one should be familiar with the general information at the [TeX FAQ](https://www.texfaq.org/FAQ-installthings).

Different TeX distributions have somewhat different ways to store TDS-compliant configuration and package data. See, for example, for MikTeX [here](https://docs.miktex.org/manual/localadditions.html#id573803) and [here](https://miktex.org/kb/texmf-roots). Otherwise see the [TeX FAQ](https://www.texfaq.org/FAQ-privinst) and [this page](https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages).

The instructions below conform generally to a Unix-based system. There are some cases under Windows where this method may not work. For other systems, please consult the appropriate documentation as needed.

The user must already have a TDS-compliant tree set up in order for installation to work. We assume that one knows how to become superuser, create directories, move files, and the like.

### 4.3.4 User's Home Directory

`TEXMFHOME` is a variable that points to the root of a TDS-compliant directory tree available to a user. To get its value on POSIX-compliant systems, use:

    kpsewhich --var-value TEXMFHOME

Quite often, `$TEXMFHOME` is equivalent to `$HOME/texmf`. The dollar sign in front of the variable denotes the value of the variable instead of its name. If `$HOME` is `/home/bob`, then `$TEXMFHOME` would be `/home/bob/texmf`. We can understand the following paths to be under this home directory.

| Path                               | Files          |
| :--------------------------------- | :------------- |
| `$TEXMFHOME/source/latex/nameauth` | `Makefile`     |
|                                    | `cat01.pdf`    |
|                                    | `beamer01.pdf` |
|                                    | `beamer02.pdf` |
|                                    | `beamer03.pdf` |
|                                    | `nameauth.dtx` |
|                                    |                |
| `$TEXMFHOME/doc/latex/nameauth`    | `compat.tex`   |
|                                    | `examples.tex` |
|                                    | `nameauth.pdf` |
|                                    | `README.md`    |
|                                    |                |
| `$TEXMFHOME/tex/latex/nameauth`    | `nameauth.sty` |

Create the directories in the left-hand column, or whatever one needs to do in one's own case. Move or copy the files in the right-hand column to their respective directories in the left-hand column. On older TeX distributions, run `mktexlsr` on `$TEXMFHOME` to complete the install process (current distributions may not need this).

### 4.3.5 System-Wide Directory

`TEXMFLOCAL` is a variable that points to the root of a TDS-compliant directory tree available to all users on a local site, system-wide installation.To get its value, use:

    kpsewhich --var-value TEXMFLOCAL

See the [TeX FAQ](https://www.texfaq.org/FAQ-what-TDS). We can understand the following paths to be under this local site, system-wide directory:

| Path                                | Files          |
| :---------------------------------- | :------------- |
| `$TEXMFLOCAL/source/latex/nameauth` | `Makefile`     |
|                                     | `cat01.pdf`    |
|                                     | `beamer01.pdf` |
|                                     | `beamer02.pdf` |
|                                     | `beamer03.pdf` |
|                                     | `nameauth.dtx` |
|                                     |                |
| `$TEXMFLOCAL/doc/latex/nameauth`    | `compat.tex`   |
|                                     | `examples.tex` |
|                                     | `nameauth.pdf` |
|                                     | `README.md`    |
|                                     |                |
| `$TEXMFLOCAL/tex/latex/nameauth`    | `nameauth.sty` |

Create the directories in the left-hand column, or whatever one needs to do in one's own case. Move or copy the files in the right-hand column to their respective directories in the left-hand column. Change file ownership as needed (not so much on Windows). If needed, run `mktexlsr` with the appropriate permissions on `$TEXMFLOCAL` to complete the install process. See also the discussion on [this page](https://tex.stackexchange.com/questions/45231/how-to-install-system-wide-packages-without-requiring-an-ls-r-database-with-tex).

# 5. More on Package Building

* `Makefile` has been upgraded to handle more special cases and not to do unexpected or bad things in those cases, especially on Windows.

* The package and manual build on current and older TeX distributions. In a number of examples, some Unicode characters have been replaced with control sequences in order for this compatibility to work, due to how files written out and read back in affects the expansion of active Unicode characters.

* The documentation now builds only with `pdflatex`, but the examples and tests can use any LaTeX engine. This is because several typesetting decisions that are quite helpful for the manual work only with `pdflatex`.

* This release was tested on Linux (Pop! OS; vanilla TL 2023 and 2017) and Windows 10 (MikTeX using shells from both Cygwin and WSL). The tests using TL 2017 include my published book manuscript, *Breath of God, Yet Work of Man: Scripture, Philosophy, Dialogue, and Conflict*, with Dr. Albert B. Collver III.

* The CTAN release was created with vanilla TL 2023 on Pop! OS. The most recent `equivs` file was used to meet package equivalences. See also [this page](https://tug.org/texlive/debian.html).

* TeXlive 2023 and TL 2017 are managed on Pop! OS using [tl-switch](https://github.com/ServusCarolus/tl-switch).

* Four pdf files (`cat01.pdf` and `beamer*.pdf`) used in graphic illustrations are created from the output of test files associated with this manual (see below). Normally, the user need not generate them; they are supplied as source files.

# 6. Examples / Testing

The file `examples.tex`, also includes `compat.tex`; they should be in the same directory when compiled. The examples document should be enough to illustrate various non-trivial features of this package. It includes most of the longer examples in the manual, edited to fit together in a single document. It also includes other material and tests.

In addition to this file, a special run of `nameauth.dtx` that defines the macro `\NameauthDoTestFiles` will generate many separate test files. Normally they are written out to `nameauth.tmp` and read in again as verbatim text. They are not included in the package archive by default in order to minimize clutter.

To test `nameauth`, either test the files right after installing, or create a new testing directory. One can copy the files from the TDS-compliant source dir and optionally, the documentation directory as well, or unpack the CTAN zip file and build the package.

## 6.1 GNU make: Examples, Tests, Images

* Use the default: `make examples`.

* If one wants to change engines and re-test the file, type `make exclean`.

* To create `examples.pdf` with other LaTeX engines, one can do the following:
  
      make examples ENGINE=xelatex
      make examples ENGINE=lualatex
      make examples ENGINE=dvilualatex
      make examples ENGINE=latex

* To generate additional test files, type `make tests`.
  
  This will produce many test files numbered by chapter and example within that chapter from the `nameauth.dtx` file. By default it will compile all of the test files using `pdflatex`.
  
* If one wants to change engines and re-test the files, type `make testclean`.

* One can add the value of ENGINE:
  
      make tests ENGINE=xelatex
      make tests ENGINE=lualatex
      make tests ENGINE=dvilualatex
      make tests ENGINE=latex

* If, for some reason, one wanted to make the manual illustrations (usually not required), one would type `make images`.

## 6.2 Manual Method

### 6.2.1 Examples

Compile `examples.tex`. In the following command lines, one may substitute `latex`, `xelatex`, `lualatex`, and `dvilualatex` for `pdflatex`.

    pdflatex --interaction=nonstopmode examples
    pdflatex --interaction=nonstopmode examples
    makeindex -o examples.ind examples.idx

This next line is needed because the `index` package makes an index of persons.

    makeindex -o examples.rnd examples.rdx

These lines complete the indexes and TOC.

    pdflatex --interaction=nonstopmode examples
    pdflatex --interaction=nonstopmode examples

Another step is used only with `latex` and `dvilualatex`. We default to `dvipdfmx` in case Ghostscript is not installed. If Ghostscript is already installed, one can use `dvipdf` instead. If a file `examples.out.ps` exists, one may delete it after creating the pdf file.

    dvipdfmx examples

If one changes LaTeX engines, one first must remove all of the auxiliary files.

### 6.2.2 Tests

Generate the test files in the following manner from the `dtx`:

    pdflatex "\def\NameauthDoTestFiles{}\input{nameauth.dtx}"

Compile the test files. In the following command lines, one may substitute `latex`, `xelatex`, `lualatex`, and `dvilualatex` for `pdflatex`. One must change the root or base file name for each test file.

    pdflatex --interaction=nonstopmode test01-01
    pdflatex --interaction=nonstopmode test01-01
    makeindex -o test01-01.ind test01-01.idx

This next line is needed only for `test07-01.tex` because the `index` package is used for an index of persons.

    makeindex -o test07-01.rnd test07-01.rdx

These lines complete the indexes and TOC.

    pdflatex --interaction=nonstopmode test01-01
    pdflatex --interaction=nonstopmode test01-01

This step is used only when using `latex` and `dvilualatex`.

    dvipdfmx test01-01

If one changes LaTeX engines, one first must remove all of the auxiliary files.

### 6.2.3 Images

If, for some reason, one wants to make the manual illustrations (usually not required), this would be the default procedure:

Generate the test files in the following manner from the `dtx`:

    pdflatex "\def\NameauthDoTestFiles{}\input{nameauth.dtx}"

Compile the test files:

    pdflatex --interaction=nonstopmode test07-02
    pdflatex --interaction=nonstopmode test07-02
    makeindex -o test07-02.ind test07-02.idx
    pdflatex --interaction=nonstopmode test07-02
    pdflatex --interaction=nonstopmode test07-02
    
    pdflatex --interaction=nonstopmode test09-01
    pdflatex --interaction=nonstopmode test09-01
    makeindex -o test09-01.ind test09-01.idx
    pdflatex --interaction=nonstopmode test09-01
    pdflatex --interaction=nonstopmode test09-01

    pdfjam --paper a6paper --landscape --quiet test07_02.pdf 3 --outfile cat01.pdf
    pdfjam --paper a5paper --landscape --quiet test09_01.pdf 1 --outfile beamer01.pdf
    pdfjam --paper a5paper --landscape --quiet test09_01.pdf 2 --outfile beamer02.pdf
    pdfjam --paper a5paper --landscape --quiet test09_01.pdf 3 --outfile beamer03.pdf

# 7. Additional Notes

Version 4.0 switches from `xargs` and `suffix` to `xparse`. Should any modifications still require `xargs` and `suffix`, one can use the `oldargs` package option.

Improvements in version 4.0 include:

* Change to `xparse`, which increases power and flexibility going forward.

* Further changes to the manual that make it more readable and consistent.

Version 3.7 remains here: [style](https://www.tug.org/svn/texlive/branches/branch2022.final/Master/texmf-dist/tex/latex/nameauth/), [docs](https://www.tug.org/svn/texlive/branches/branch2022.final/Master/texmf-dist/doc/latex/nameauth/), and [source](https://www.tug.org/svn/texlive/branches/branch2022.final/Master/texmf-dist/source/latex/nameauth/).

Improvements in version 3.7 include:

* Rejection of stale assumptions that had built up over time, based either on initial ignorance or on features that have since changed in LaTeX.

* The examples file contains some tests that used to be in the documentation.

* Major rewrite of documentation.

* The table of contents better frflects scope and sequence.

* The package itself has been reorganized to follow the same scope and sequence as the documentation.

* Several macros have been optimized, leading to simpler and cleaner designs that are easier to debug. Additional bug fixes ensure stability,

* Name arguments shown in package warnings are detokenized in order to prevent potential errors.

# 8. Copyright

Copyright (C) 2024 by Charles P. Schaum <charles[dot]schaum@comcast.net>

This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
of this license or (at your option) any later version.
The latest version of this license is in:

   [https://www.latex-project.org/lppl.txt](https://www.latex-project.org/lppl.txt)

and version 1.3 or later is part of all distributions of LaTeX
version 2005/12/01 or later.

%readmevb
%</readme>
%<*internal>
\fi
\def\nameofplainTeX{plain}
\ifx\fmtname\nameofplainTeX\else
  \expandafter\begingroup
\fi
%</internal>
%<*install>
\input docstrip.tex
\keepsilent
\askforoverwritefalse

\preamble

This is a generated file.

Copyright (C) 2024 by Charles P. Schaum <charles[dot]schaum@comcast.net>

This file may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3 of this license
or (at your option) any later version.  The latest version of this
license is in:

   https://www.latex-project.org/lppl.txt

and version 1.3 or later is part of all distributions of LaTeX version
2005/12/01 or later.

\endpreamble

\usedir{tex/latex/nameauth}
\generate{
  \file{\jobname.sty}{\from{\jobname.dtx}{package}}
}
%</install>
%<install>\endbatchfile
%<*internal>
\usedir{source/latex/nameauth}
\generate{
  \file{\jobname.ins}{\from{\jobname.dtx}{install}}
}
\usedir{doc/latex/nameauth}
\nopostamble
\generate{
  \file{examples.tex}{\from{\jobname.dtx}{examples}}
}
\generate{
  \file{compat.tex}{\from{\jobname.dtx}{compat}}
}
\nopreamble
\generate{
  \file{README.md}{\from{\jobname.dtx}{readme}}
}
\ifx\fmtname\nameofplainTeX
  \expandafter\endbatchfile
\else
  \expandafter\endgroup
\fi
%</internal>
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{nameauth.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<package>\ProvidesPackage{nameauth}
%<*package>
    [2024/02/09 4.0 Name authority mechanism for consistency in text and index]
%</package>
%
%<*driver>
%^^A %%%%%%%%%%%%% Stuff Needed in the Document Preamble %%%%%%%%%%%%%%%%%

\documentclass[11pt]{ltxdoc}

%^^A %%%%% General layout %%%%%

%^^A Set up page layout to fit both letter and DIN A4.
\usepackage[paperheight=279.4mm,paperwidth=210mm,
            textheight=239.4mm,textwidth=140mm,
            right=20mm,marginparwidth=40mm,nohead]{geometry}

%^^A Permit horizontal boxes to be overfull.
\hfuzz=3pt

%^^A Define negative skip values if needed.
\newcommand\negsmallskip{\vspace{-\smallskipamount}}
\newcommand\negmedskip{\vspace{-\medskipamount}}
\newcommand\negbigskip{\vspace{-\bigskipamount}}

%^^A Redefine emphasis in the body text because italic has dedicated uses.
\let\oldemph\emph
\let\emph\textbf

%^^A %%%%% Detecting LaTeX engine used %%%%%

%^^A Since we only use pdflatex to make the documentation,
%^^A this section is not as much of a big deal as it used to be.
%^^A We still use these macros for some detection examples.

%^^A We need etoolbox for this functionality.
\usepackage{etoolbox}

%^^A Provide a macro to check against latex versions and set a flag.
%^^A This must be done in the document preamble.
%^^A We use the date 2018/10/05 because that is when unicode
%^^A processing changed for the better.
%^^A We use the date 2018/04/30 because that is when xparse
%^^A added the ! modifier.
\makeatletter
  \@ifl@t@r\fmtversion{2018/10/05}{\def\nameauthltx{}}{}
  \@ifl@t@r\fmtversion{2018/04/30}{\def\nameauthxp{}}{}
\makeatother

%^^A %%%%% Set up fonts and typography %%%%%

%^^A Again, this is specific to our use of pdflatex.
%^^A We do not load inputenc unless we are using an old distro.
\IfFileExists{utf8-2018.def}{}{\usepackage[utf8]{inputenc}}

\usepackage[LGR,TS1,T1]{fontenc}

%^^A We load textcomp for backward compatibility.
\usepackage{textcomp}

%^^A We demonstrate hyphenation only with English and German.
%^^A Otherwise we don't hyphenate any other languages.
\usepackage[ngerman,latin,polutonikogreek,american]{babel}
\newcommand\de[1]{\foreignlanguage{ngerman}{#1}}
\newcommand{\la}[1]{\foreignlanguage{latin}{#1}}
\newcommand{\el}[1]{\foreignlanguage{polutonikogreek}{#1}}

%^^A The Latin Modern font gives us the glyphs that we need.
\usepackage{lmodern}

%^^A This bit is for an example that involves accents and names.
\usepackage{newunicodechar}
\DeclareTextSymbolDefault{\textlongs}{TS1}
\DeclareTextSymbol{\textlongs}{TS1}{115}
\newunicodechar{ſ}{\textlongs}

%^^A Load the dangerous bend symbol and microtypography..
\usepackage{manfnt}
\usepackage{microtype}

%^^A Do not automatically put extra space after a full stop.
\frenchspacing

%^^A %%%%% Set up specific document elements %%%%%

%^^A ----- TOC and index -----

%^^A Two-column TOC
\usepackage[toc]{multitoc}

%^^A Include an index
\usepackage{makeidx}

%^^A These options allow the index to focus on names in the index more
%^^A like one might see in a normal document.
%^^A We do not use \DisableCrossrefs
\CodelineIndex
\RecordChanges

%^^A ----- Color and graphical diagram elements -----

%^^A Color helps categorize information.
\usepackage{xcolor}
\colorlet{nared}{red!60!black}
\colorlet{nagreen}{green!35!black}
\colorlet{nablue}{blue!50!black}
\colorlet{nabrown}{brown!50!black}
\colorlet{naslate}{cyan!45!black}
\colorlet{nagrey}{black!7!white}

%^^A Use color for yes/no indicators in tables.
\newcommand\NO{\bgroup
  \color{black!20!white}\lower 0.075ex\hbox{\rule{1.5ex}{1.5ex}}\egroup}
\newcommand\YES{\bgroup
  \color{black!80!white}\lower 0.075ex\hbox{\rule{1.5ex}{1.5ex}}\egroup}

%^^A Diagrams
\usepackage{tikz}
\usepackage{tcolorbox}

%^^A Set basic format for tcolorboxes drawn by TikZ.
\tcbset{fonttitle=\bfseries\sffamily,box align=top,lower separated=false}

%^^A ----- Hyperlinks and URLs -----

%^^A Have documentation with hyperlinks
\usepackage[numbered]{hypdoc}

%^^A Change URL color
\hypersetup{urlcolor=violet}

%^^A ----- Tables, lists, quotes, center -----

\usepackage{booktabs}
\usepackage{colortbl}

\usepackage[inline]{enumitem}
\setlist{rightmargin=\leftmargin,itemsep=0pt}

%^^A Make default font small for quote and center environments
\apptocmd{\quote}{\small}{}{}
\apptocmd{\center}{\small}{}{}

%^^A ----- Verbatim environments -----

%^^A Let verbatim environments be fancy.
\usepackage{fancyvrb}

%^^A Define fancyvrb defaults.
\fvset{gobble=2,numbers=left,fontsize=\small}

%^^A ----- Font debugging; only for dev use -----

%^^A These two macros help track down any unintended changes to font sizes.
%^^A One can use these only once each.
\let\savegraf\everypar
\makeatletter
\newcommand\FontDebugStart
{%^^A
  \let\oldep\everypar%^^A
  \newtoks\everypar%^^A
  \oldep{\the\everypar \llap{\color{red}\hbox to \marginparwidth {\f@size\hfill}}}%^^A
}
\newcommand\FontDebugStop
{%^^A
  \let\oldep\savegraf%^^A
  \oldep{\the\everypar}%^^A
}
\makeatother

%^^A ----- Various text elements -----

%^^A Show a ``dangerous bend'' in the margin.
\newcommand*\Warn
{%^^A
  \unless\ifinner
  {\marginpar{\raggedleft\strut\small\raise0.7ex\hbox{\dbend}}}%^^A
  \fi
}

%^^A Put information in the margin.
\newcommand*\Info[1]
{%^^A
  \unless\ifinner
  {\marginpar{\raggedleft\footnotesize#1}}%^^A
  \fi
}

\newcommand\Same
  {\Info{Same name patterns\break and index entries\break as above.}}

%^^A Show a name pattern in margin.
\newcommand*\PatInfo[1]
{%^^A
  \unless\ifinner
  {%^^A
    \marginpar
      {\raggedleft\footnotesize Name Pattern(s):\hfill\break
        \ttfamily#1}%^^A
  }%^^A
  \fi
}

%^^A Show a basic index entry info in margin.
\newcommand*\IdxInfo[1]
{%^^A
  \unless\ifinner
  {%^^A
    \marginpar{\raggedleft\footnotesize Basic Index:\hfill\break#1}%^^A
  }%^^A
  \fi
}

%^^A Show both name patterns and index entries in margin.
\newcommand*\BothInfo[2]
{%^^A
  \unless\ifinner
  {%^^A
    \marginpar{%^^A
      \raggedleft\footnotesize Name Pattern(s):\hfill\break%^^A
      {\ttfamily#1}\break%^^A
      \raggedleft\footnotesize Basic Index:\hfill\break#2%^^A
    }%^^A
  }%^^A
  \fi
}

%^^A Return to the TOC at the end of a major section.
\newcommand*\ReturnLink
{%^^A
  \leavevmode
  \begin{quote}%^^A
    \centering\tcbox{Back to \hyperlink{TOC}{Table of Contents}}%^^A
  \end{quote}%^^A
}

%^^A Print a high-visibility callout that can have an optional title.
\newenvironment{InfoBox}[1][]
{%^^A
  \def\titulus{#1}%^^A
  \medskip%^^A
  \ifx\titulus\empty
    \begin{tcolorbox}[colback=white,colframe=red!90!black]%^^A
  \else
    \begin{tcolorbox}[colback=white,colframe=red!90!black,
    adjusted title={\bfseries\hfil #1}]%^^A
  \fi
}
{\end{tcolorbox}\medskip}

%^^A Print a callout that can have an optional title.
\newenvironment{SyntaxBox}[1][]
{%^^A
  \def\titulus{#1}%^^A
  \begingroup\medskip
  \ifx\titulus\empty
    \begin{tcolorbox}[colback=white,colframe=darkgray]%^^A
      \begin{tabular}{@{}l@{}}
  \else
    \begin{tcolorbox}[colback=white,colframe=darkgray,
    adjusted title={\bfseries\hfil #1}]%^^A
      \begin{tabular}{@{}l@{}}
  \fi
}
{\end{tabular}\end{tcolorbox}\medskip\endgroup}

%^^A Print a two-cell callout that can have an optional title.
\newenvironment{SyntaxBoxii}[1][]
{%^^A
  \def\titulus{#1}%^^A
  \ifx\titulus\empty
    \begin{tcolorbox}[colback=white,colframe=darkgray]%^^A
      \begingroup\begin{tabular}{@{}ll@{}}
  \else
    \begin{tcolorbox}[colback=white,colframe=darkgray,
    adjusted title={\bfseries\hfil #1}]%^^A
      \begingroup\begin{tabular}{@{}ll@{}}
  \fi
}
{\end{tabular}\endgroup\end{tcolorbox}\medskip}

%^^A Print a quote and the source.

\renewcommand{\hrulefill}{%
  \leavevmode\leaders\hrule height 1.5pt\hfill\kern0pt }

\newenvironment{Quote}[1]
{%^^A
  \def\QuoteName{#1}%^^A
  \vfill\noindent\hfil\hbox to 0.9\textwidth{\hrulefill}
  \begin{quote}}
{\negmedskip\end{quote}\begin{quote}\hfill---\QuoteName\end{quote}}

%^^A Used for one or more examples
\newenvironment{Block}
{%^^A
  \begin{quote}
    \setlist{rightmargin=0pt,leftmargin=0pt,topsep=0ex,itemsep=0pt}%^^A
    \begin{itemize}\item[]
}
{\end{itemize}\end{quote}}

%^^A Warning repeated throughout the manual
\newcommand\NameArgWarning
{%^^A
  \begin{InfoBox}%^^A
  When a macro occurs in a name argument appearing in both text
  and index, fix any concerns about macro expansion by using
  \cmd{\noexpand} before that macro.
  \end{InfoBox}%^^A
}

%^^A Macros that handle describing index states

\newcommand\Stay[2]
{%^^A
  \parbox{0.685\textwidth}{#1\dotfill}%^^A
  \lower 2ex\hbox{%^^A
    \quad\tcbox[boxsep=0.2ex]{\textls[-20]{Stay in State #2}}%^^A
  }%^^A
}

\newcommand\Go[2]
{%^^A
  \parbox{0.685\textwidth}{#1\dotfill}%^^A
  \lower 2ex\hbox{%^^A
    \quad\tcbox[boxsep=0.2ex]{\textls[30]{Go to State #2}}%^^A
  }%^^A
}

%^^A Used when introducing name forms
\newcommand\FUse{\leavevmode\hbox to 5em{First use:\hfill}}
\newcommand\LUse{\leavevmode\hbox to 5em{Later use:\hfill}}
\newcommand\UseB{\leavevmode\hbox to 5em{\hfill}}

%^^A ----- Names, the reason for it all -----

%^^A Include specifically the current version of the package.
\usepackage{\jobname}[2024/02/09]

%^^A Set up the ``actual'' character
\IndexActual{=}

%^^A Redefine name formatting for this manual.
\renewcommand*\FrontNamesFormat[1]{\color{red}\sffamily #1}
\renewcommand*\FrontNameHook[1]{\color{darkgray}\sffamily #1}
\renewcommand*\NamesFormat[1]{\color{blue}\sffamily #1}
\renewcommand*\MainNameHook[1]{\sffamily #1}

%^^A Use this example in the body text. It is defined here due
%^^A to the vertical bars, which are redefined in the body text.
%
\newcommand\Orphan[2]{#1(\hyperpage{#2})}
\TagName[Lost]{Name}{\,\S|Orphan{perdit}}
\TagName{foo\Name {bar}}{\,\S|hyperpage}

%^^A Set up all the shorthands, but not all the names. Even if one does
%^^A not set up all the names here, it is a very good idea to set up the
%^^A (pre)tags just below, especially in a dtx file, where the vertical
%^^A bars are active.

\begin{nameauth}
  \< Aeth & & Æthelred, II & >
  \< Aris & & Aristotle & >
  \< Bailey & Betsey & Bailey & >
  \< Carter & J.E. & Carter, Jr. & >
  \< Cicero & M.T. & Cicero & >
  \< Confucius & & Confucius & >
  \< Dagb & & Dagobert & I >
  \< Dem & & Demetrius, I & >
  \< deSmet & Pierre-Jean &
     \noexpand\Fbox{\noexpand\AltCaps{d}e~Smet} & >
  \< Soto & Hernando & de~Soto & >
  \< Doug & Frederick & Douglass & >
  \< DuBois & W.E.B. & Du~Bois & >
  \< AltDuBois & W.E.B. & DuBois & >
  \< Einstein & Albert & Einstein & >
  \< Eliz & & Elizabeth, I & >
  \< Fukuyama & & \noexpand\textUC{Fukuyama} & Takeshi >
  \< JWG & J.W. von & Goethe & >
  \< TGrac & \noexpand\TSemp & Gracchus & >
  \< Harnack & Adolf & Harnack & >
  \< AVH     & Adolf & Harnack & Adolf\noexpand\von >
  \< Henry & & Henry & VIII >
  \< Ike  & Dwight D. & Eisenhower & >
  \< Jeff & Thomas &
     \noexpand\textSC{Jefferson}\noexpand\GEN{} & >
  \< Eriugena & & John, Eriugena & >
  \< MLK & Martin Luther & King, Jr. & >
  \< Lewis & Clive Staples & Lewis & >
  \< CSL & Clive Staples & Lewis & C.S. >
  \< Linc & Abraham & Lincoln & >
  \< Luth & Martin & \noexpand\textSC{Luther} & >
  \< Cath & Catherine \noexpand\AltCaps{d}e' &
     \noexpand\textSC{Medici} & >
  \< Miyazaki & & Miyazaki, Hayao & >
  \< MSens & & Miyazaki, Hayao & Sensei >
  \< Noguchi & Hideyo & Noguchi & >
  \< Patton & George S. & Patton, Jr. & >
  \< Plato & & Plato & >
  \< JRIV & J.D. & Rockefeller, IV & >
  \< JayR & J.D. & Rockefeller, IV & Jay >
  \< Scipio & \noexpand\SCIPi & \noexpand\SCIPii & >
  \< OScipio & Lucius & \noexpand\CSB & >
  \< Shak & \noexpand\WM & \noexpand\SHK & >
  \< Striet & John & \noexpand\de{Strietelmeier} & >
  \< Sun & & Sun, Yat-sen & >
  \< KempMed & & Thomas, à~Kempis & >
  \< KempW & Thomas & à~Kempis & >
  \< Tyson & Mike & Tyson & >
  \< Iron & Mike & Tyson & Iron Mike >
  \< VBuren & Martin & Van Buren & >
  \< Wash & George & Washington & >
%^^A We use the next row as an example in the docs.
%^^A  \< White & E.\,B. & White & >
  \< Yamt & & Yamamoto, Isoroku & >
  \< Yosh & & Yoshida & Shigeru >
\end{nameauth}

%^^A Add sort tags here for those needing them.

\PretagName{Æthelred, II}{Aethelred 2}
\PretagName[Thomas]{à~Kempis}{Akempis, Thomas}
\PretagName{Antiochus, III}{Antiochus 3}
\PretagName{Antiochus, IV}{Antiochus 4}
\PretagName{Atat\"urk}{Ataturk}
\PretagName[W.H.]{Auden}{Auden, Wystan}

\PretagName[Charles]{\noexpand\textBF{Babbage}}{Babbage, Charles}
\PretagName{Bo\"ethius}{Boethius}
\PretagName[Robert]{\textSC{Burns}}{Burns, Robert}

\PretagName[Giovanni]{d'Andrea}{Dandrea, Giovanni}
\PretagName{Demetrius, I}{Demetrius 1}
\PretagName[Jacques]{De~Pamele}{Depamele, Jacques}
\PretagName[Charles-Louis]{de Secondat}{deSecondat, Charles}
\PretagName[Pierre-Jean]{\noexpand\Fbox{\noexpand\AltCaps{d}e~Smet}}
  {deSmet, Pierre-Jean}
\PretagName[Hernando]{de~Soto}{Desoto, Hernando}
\PretagName{\textit{Doctor angelicus}}{Doctor angelicus}
\PretagName{\textit{Doctor mellifluus}}{Doctor mellifluus}
\PretagName[W.E.B.]{Du~Bois}{DuBois, William}
\PretagName{du~Cange}{Ducange}
\PretagName[Charles]{du~Fresne}{Dufresne, Charles}

\PretagName{Elizabeth, I}{Elizabeth 1}

\PretagName{\noexpand\textUC{Fukuyama}}[Takeshi]{Fukuyama Takeshi}

\PretagName[Greta]{\noexpand\textSC{Garbo}}{Garbo, Greta}
\PretagName{Ghazāli}{Ghazali}
\PretagName[\noexpand\TSemp]{Gracchus}{Gracchus, Tiberius Sempronius}
\PretagName{Gregory, I}{Gregory 1}

\PretagName[Thomas]{\noexpand\textSC{Jefferson}\noexpand\GEN{}}
  {Jefferson, Thomas}
  
\PretagName{\noexpand\textUC{Kanade}, Takeo}{Kanade Takeo}

\PretagName[Ada]{\noexpand\textIT{Lovelace}}{Lovelace, Ada}
\PretagName[Martin]{\noexpand\textSC{Luther}}{Luther, Martin}

\PretagName[Catherine \noexpand\AltCaps{d}e']{\noexpand\textSC{Medici}}
  {Medici, Catherine de}
\PretagName{\noexpand\textSC{Misora}, Hibari}{Misora Hibari}
\PretagName[Frenec]{Molnár}{Molnar, Frenec}

\PretagName[Sandra Day]{O'Connor}{OConnor, Sandra}

\PretagName{Ptolemy, IV}{Ptolemy 4}
\PretagName{Ptolemy, V}{Ptolemy 5}

\PretagName[J.D.]{Rockefeller, IV}{Rockefeller, John D 4}
\PretagName[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}}
  {Ruehmann, Heinrich Wilhelm}
\PretagName[Heinz]{\noexpand\textSC{R\"uhmann}}{Ruehmann, Heinz}

\PretagName{Seleucus, III}{Seleucus 3}
\PretagName[\noexpand\SCIPi]{\noexpand\SCIPii}{Scipio Africanus}
\PretagName[Lucius]{\noexpand\CSB}{Cornelius Scipio Barbatus}
\PretagName[\noexpand\WM]{\noexpand\SHK}{Shakespeare, William}
\PretagName{\textit{Snellius}}{Snellius}
\PretagName[John]{\noexpand\de{Strietelmeier}}{Strietelmeier, John}

\PretagName{Thomas, à~Kempis}{Thomas Akempis}

\PretagName{Vlad, {\c T}epe{\c s}}{Vlad Tepes}

\PretagName[E.\,B.]{White}{White, Elwyn}

\PretagName[Konrad]{\noexpand\textSC{Zuse}}{Zuse, Konrad}

%^^A Add index tags for all names in the dtx file.

\TagName{Æthelred, II}{, king|hyperpage}
\TagName{Antiochus, III}{ the Great, king|hyperpage}
\TagName{Antiochus, IV}{ Epiphanes, king|hyperpage}
\TagName{Aristotle}{|hyperpage}
\TagName[W.H.]{Auden}{|hyperpage}

\TagName[Charles]{\noexpand\textBF{Babbage}}{|hyperpage}
\TagName[Betsey]{Bailey}{|hyperpage}
\TagName[Leonard]{Bernstein}{|hyperpage}
\TagName{Bernard, of Clairvaux}{|hyperpage}
\TagName{Bo\"ethius}{|hyperpage}
\TagName[Robert]{\textSC{Burns}}{|hyperpage}

\TagName[Julius]{Caesar}{, imperator|hyperpage}
\TagName[Rudolph]{Carnap}{|hyperpage}
\TagName[J.E.]{Carter, Jr.}{, pres.|hyperpage}
\TagName[Charlie]{Chaplin}{|hyperpage}
\TagName[Charles W.]{Chesnutt}{|hyperpage}
\TagName[M.T.]{Cicero}{|hyperpage}
\TagName{Chiang}[Kai-shek]{\ddag, pres.|hyperpage}
\TagName[Schuyler]{Colfax}{, v.p.|hyperpage}
\TagName{Confucius}{|hyperpage}
\TagName{Cratylus}{|hyperpage}
\TagName[e.e.]{cummings}{|hyperpage}

\TagName{Dagobert}[I]{\ddag, king|hyperpage}
\TagName[Sammy]{Davis,Jr.}{|hyperpage}
\TagName[Giovanni]{d'Andrea}{|hyperpage}
\TagName{Demetrius, I}{ Soter, king|hyperpage}
\TagName[Jacques]{De~Pamele}{|hyperpage}
\TagName[Pierre-Jean]
  {\noexpand\Fbox{\noexpand\AltCaps{d}e~Smet}}{|hyperpage}
\TagName[Hernando]{de~Soto}{|hyperpage}
\TagName[Marc van]{Dongen}{|hyperpage}
\TagName[Frederick]{Douglass}{|hyperpage}
\TagName[W.E.B.]{Du~Bois}{|hyperpage}
\TagName[Charles]{du~Fresne}{|hyperpage}

\TagName[Albert]{Einstein}{|hyperpage}
\TagName[Dwight D.]{Eisenhower}{, pres.|hyperpage}
\TagName{Elizabeth, I}{, queen|hyperpage}
\TagName[Leif]{Erikson}{|hyperpage}

\TagName[Robin]{Fairbairns}{|hyperpage}
\TagName{\noexpand\textUC{Fukuyama}}[Takeshi]{\ddag|hyperpage}

\TagName[Greta]{\noexpand\textSC{Garbo}}{|hyperpage}
\TagName{Ghazāli}{|hyperpage}
\TagName{Ghazali}{|hyperpage}
\TagName[\noexpand\TSemp]{Gracchus}{, consul|hyperpage}
\TagName[J.W. von]{Goethe}{|hyperpage}
\TagName[Ulysses S.]{Grant}{, pres.|hyperpage}
\TagName[Enrico]{Gregorio}{|hyperpage}
\TagName{Gregory, I}{ the Great, pope|hyperpage}

\TagName[Oskar]{Hammerstein, II}{|hyperpage}
\TagName[Adolf]{Harnack}{|hyperpage}
\TagName[Lafcadio]{Hearn}{|hyperpage}
\TagName{Hermogenes}{|hyperpage}
\TagName{Henry}[VIII]{, king|hyperpage}
\TagName[Bob]{Hope}{|hyperpage}
\TagName[Hubert H.]{Humphrey}{, v.p.|hyperpage}

\TagName[Thomas]{\noexpand\textSC{Jefferson}\noexpand\GEN{}}
  {, pres.|hyperpage}
\TagName{Jesus, Christ}{|hyperpage}
\TagName{John, Eriugena}{|hyperpage}

\TagName[Mustafa]{Kemal}{|hyperpage}
\TagName[John F.]{Kennedy}{, pres.|hyperpage}
\TagName{Kim, Jong Un}{|hyperpage}
\TagName[Martin Luther]{King, Jr.}{|hyperpage}

\TagName{Lao-tzu}{|hyperpage}
\TagName[Clive Staples]{Lewis}{|hyperpage}
\TagName[Abraham]{Lincoln}{, pres.|hyperpage}
\TagName[Frenec]{Liszt}{\dag|hyperpage}
\TagName[Titus]{Livius}{|hyperpage}
\TagName{Llywelyn, ap Gruffudd}{, prince|hyperpage}
\TagName{Louis, XIV}{, king|hyperpage}
\TagName[Ada]{\noexpand\textIT{Lovelace}}{|hyperpage}
\TagName[Uwe]{Lueck}{|hyperpage}
\TagName[Dan]{Luecking}{|hyperpage}
\TagName[Martin]{\noexpand\textSC{Luther}}{|hyperpage}

\TagName{Maimonides}{|hyperpage}
\TagName[Dean]{Martin}{|hyperpage}
\TagName{\noexpand\textSC{Misora}, Hibari}{|hyperpage}
\TagName[Nicolas]{Malebranche}{|hyperpage}
\TagName[Catherine \noexpand\AltCaps{d}e']{\noexpand\textSC{Medici}}
  {|hyperpage}
\TagName{\noexpand\textSC{Mencius}}{|hyperpage}
\TagName{Miyazaki, Hayao}{|hyperpage}
\TagName[L.M.]{Montgomery}{|hyperpage}
\TagName[Frenec]{Molnár}{\dag|hyperpage}
\TagName[Nancy C.]{Mulvany}{|hyperpage}

\TagName{Nippon Gakki}{|hyperpage}
\TagName[Hideyo]{Noguchi}{\dag|hyperpage}

\TagName[Sandra Day]{O'Connor}{, justice|hyperpage}
\TagName[Heiko]{Oberdiek}{|hyperpage}

\TagName[George S.]{Patton, Jr.}{|hyperpage}
\TagName[Lucius]{Sergius Paulus}{|hyperpage}
\TagName{Plato}{|hyperpage}
\TagName{Pontius, Pilate}{|hyperpage}
\TagName{Ptolemy, IV}{ Philopator, king|hyperpage}
\TagName{Ptolemy, V}{ Epiphanes, king|hyperpage}

\TagName{Rambam}{|hyperpage}
\TagName[Luke]{Ranieri}{|hyperpage}
\TagName[the]{Rat Pack}{|hyperpage}
\TagName[J.D.]{Rockefeller, IV}{|hyperpage}
\TagName[Theodore]{Roosevelt}{, pres.|hyperpage}
\TagName[Heinz]{\noexpand\textSC{R\"uhmann}}{|hyperpage}
\TagName[Salman]{Rushdie}{|hyperpage}

\TagName{Saul, of Tarsus}{|hyperpage}
\TagName[Robert]{Schlicht}{|hyperpage}
\TagName{Seleucus, III}{ Ceraunus, king|hyperpage}
\TagName[\noexpand\SCIPi]{\noexpand\SCIPii}{|hyperpage}
\TagName[Lucius]{\noexpand\CSB}{, consul|hyperpage}
\TagName[\noexpand\WM]{\noexpand\SHK}{|hyperpage}
\TagName[Frank]{Sinatra}{|hyperpage}
\TagName[R.]{Snel van Royen}{|hyperpage}
\TagName[W.]{Snel van Royen}{|hyperpage}
\TagName{Socrates}{|hyperpage}
\TagName[Philipp]{Stephani}{|hyperpage}
\TagName[John]{\noexpand\de{Strietelmeier}}{|hyperpage}
\TagName{Sun, Yat-sen}{, pres.|hyperpage}

\TagName{Thomas, à~Kempis}{|hyperpage}
\TagName{Thomas, Aquinas}{|hyperpage}
\TagName[Henry David]{Thoreau}{|hyperpage}
\TagName{\noexpand\textUC{Kanade}, Takeo}{|hyperpage}
\TagName[Mark]{Twain}{|hyperpage}
\TagName[Mike]{Tyson}{|hyperpage}

\TagName[Bob]{Uecker}{|hyperpage}
\TagName[Harold]{Urey}{|hyperpage}

\TagName[Martin]{Van Buren}{, pres.|hyperpage}
\TagName[Publius]{Vegetius Renatus}{|hyperpage}
\TagName[Jesse]{Ventura}{|hyperpage}
\TagName{Vlad, II}{ Dracul|hyperpage}
\TagName{Vlad, III}{ Dracula|hyperpage}
\TagName{Voltaire}{|hyperpage}

\TagName[George]{Washington}{, pres.|hyperpage}
\TagName[Alan]{Watts}{|hyperpage}
\TagName[E.\,B.]{White}{|hyperpage}
\TagName{William, I}{, king |hyperpage}
\TagName{William, the Conqueror}{|hyperpage}

\TagName{Yamaha, Torakusu}{|hyperpage}
\TagName{Yamaha Corp.}{|hyperpage}
\TagName{Yamamoto, Isoroku}{|hyperpage}
\TagName{Yoshida}[Shigeru]{\ddag, PM|hyperpage}

\TagName[Caspar]{Ziegler}{|hyperpage}

\TagName[Konrad]{\noexpand\textSC{Zuse}}{|hyperpage}

\begin{document}
  \DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
%^^A %%%%%%%%%%%%%%%%%%%%%%% Error Correction %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \CheckSum{3388}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \changes{0.7}{2011/12/26}{Initial release}
% \changes{0.75}{2012/01/19}{Standardized arguments}
% \changes{0.85}{2012/02/05}{Show or hide commas}
% \changes{1.0}{2012/02/20}
%   {Works with \textsf{microtype}, \textsf{memoir}}
% \changes{2.3}{2016/01/05}{New back-end for naming macros}
% \changes{2.5}{2016/04/06}{No default format}
% \changes{3.2}{2017/03/22}{Root, suffix macros renamed, redesigned}
% \changes{3.4}{2020/02/26}{Update manual, \texttt{examples.tex}}
% \changes{3.5}{2020/11/23}{Update manual, \texttt{Readme.md},
%   \texttt{Makefile},\texttt{examples.tex}; combine \texttt{Readme.md}
%   and \texttt{examples.tex} files in \texttt{dtx} file}
% \changes{3.6}{2021/02/27}
%   {Update \texttt{Readme.md}, \texttt{Makefile}}
% \changes{3.7}{2023/02/03}{Major updates to all files}
% \changes{4.0}{2024/02/09}{Improve manual, \texttt{Readme.md}, \texttt{compat.tex}}
%
% \GetFileInfo{\jobname.dtx}
%
% \DoNotIndex{\@empty, \@gobble, \@period,
% \@token, \trim@spaces, \zap@space}
%
% \DoNotIndex{\begingroup, \bfseries, \bgroup,
% \csdef, \csgdef, \csname, \csundef,
% \DeclareOption, \def, \detokenize, \edef,
% \egroup, \else, \endcsname, \endgroup, \endinput,
% \ExecuteOptions, \expandafter, \fi, \futurelet,
% \global, \hbox, \if, \ifcsname, \ifx, \ignorespaces,
% \index, \itshape, \leavevmode, \let, \newcommand,
% \NewDocumentCommand, \newenvironment, \newif,
% \nobreakspace, \PackageError, \PackageWarning,
% \ProcessOptions, \relax, \renewcommand,
% \RequirePackage, \scshape, \textbackslash, \uppercase}
%
%^^A %%%%%%%%%%%%%%% Macros That Must Be Defined Here %%%%%%%%%%%%%%%%%%%%
%
%^^A Lengths to size tcboxes
%
% \newlength{\nameboxi}
% \newlength{\nameboxii}
% \newlength{\nameboxiii}
%
%^^A Global definitions of conditionals used for examples
%^^A must be included here because \newif statements cannot
%^^A occur within an \iffalse ... \fi pair (driver section).
%
%^^A For George Washington/Mustafa Kemal
% \newif\ifNoTag
%
%^^A For Thomas Jefferson
% \newif\ifGenitive
% \newif\ifDoGenitive
%
%^^A For the Cornelii Scipiones
% \newif\ifNoPraenomen
% \newif\ifNoGens
% \newif\ifNoCognomen
% \newif\ifNoAgnomen
% \newif\ifXPrae
% \newif\ifXGens
% \newif\ifXCogn
% \newif\ifXAgno
%
%^^A For Babbage and company
% \newif\ifHeadword
% \newif\ifAncientName
%
%^^A For William Shakespeare
% \newif\ifSpecialFN
% \newif\ifSpecialSN
% \newif\ifRevertSN
%
%^^A For advanced hooks
% \newif\ifFbox
% \newif\ifFirstCap
% \newif\ifInHook
% \Fboxtrue
% \newif\ifCaps
%
%^^A Global definitions of macros for examples
%
%^^A For Thomas Jefferson
% \newcommand*\GEN{\ifDoGenitive\textSC{'s}\fi}
%
%^^A For Scipio Africanus
% \newcommand*\SCIPi
% {^^A
%   \ifXGens Publius\else
%     \ifXPrae Cornelius\else
%       Publius Cornelius^^A
%     \fi
%   \fi
% }
%
% \newcommand*\SCIPii
% {^^A
%   \ifXAgno Scipio\else
%     Scipio Africanus^^A
%   \fi
% }
%
%^^A For Gracchus
% \newcommand*\TSemp
% {^^A
%   \ifXGens Tiberius\else
%     \ifXPrae Sempronius\else
%       Tiberius Sempronius^^A
%     \fi
%   \fi
% }
%
%^^A For Scipio Barbatus
% \newcommand*\CSB
% {^^A
%   \ifXGens
%     \ifXAgno Scipio\else
%       Scipio Barbatus\fi
%   \else
%     \ifXCogn Cornelius\else
%       \ifXAgno Cornelius Scipio\else
%         Cornelius Scipio Barbatus^^A
%       \fi
%     \fi
%   \fi
% }
%
%^^A For William Shakespeare
% \newcommand*\WM
% {^^A
%   \ifSpecialFN Wm.\else
%   William\fi
% }
%
% \newcommand*\SHK
% {^^A
%   \ifRevertSN
%     \textSC{Shakespeare}\else
%     \ifSpecialSN
%       \noexpand\AltCaps{t}he Bard\else
%       \textSC{Shakespeare}^^A
%     \fi
%   \fi
% }
%
% \newcommand*\Revert{\RevertSNtrue}
%
%^^A %%%%%%%%%%%%%%%%%%%%%%%%%% Title Page %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \title{\textsf{nameauth} --- Name authority mechanism\\
% for consistency in text and index^^A
% \thanks{This file describes version \fileversion, last revised \filedate.}}
% \author{Charles P. Schaum\thanks{Email: charles[dot]schaum@comcast.net}}
% \date{Released \filedate}
%
% \maketitle
%^^A This negative space fixes a warning.
% \vspace{-16.67pt}
%
% \begin{abstract}
% \noindent The \textsf{nameauth} package automates the correct formatting and indexing of names for professional writing. This aids the use of a \emph{name authority} and the editing process without needing to retype name instances.
% \end{abstract}
%
%^^A %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TOC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \begingroup
% \small
% \hypertarget{TOC}{}^^A
% \tableofcontents
% \endgroup
%
% \begin{InfoBox}[Disclaimer]
% This manual mentions names of historical figures both living and deceased. We intend to use all names herein with respect, for teaching purposes only, and never express or imply any disrespect or bias.
% \end{InfoBox}
%
% \begin{InfoBox}[Compatibility]
% Starting with version 4.0, \textsf{nameauth} uses \textsf{xparse} for starred macros and name arguments. Benefits include better macro design, more control over arguments, less code duplication, and better customization.
% \begin{itemize}
%   \item Use with a pre-2017 \TeX\ distribution might cause occasional errors. See also Sections~\ref{sec:FinalOptargs}, \ref{sec:ChangeParse} and~\ref{sec:CompatON}.
%   \item Older user customizations using \textsf{xargs} may still work with the \texttt{oldargs} option. See Sections~\ref{sec:OptionCompat} and~\ref{sec:ChangeParse}.
% \end{itemize}
% If one should require version 3.7, see section 7 of \texttt{README.md}.
% \end{InfoBox}
%
% \begin{InfoBox}[Fair Use]
% Other works quoted herein either are in the public domain or they are copyrighted works cited under the terms of fair use, to which the present author claims no copyright. The purpose is to show the power of words and names.
% \end{InfoBox}
%
% \begin{Quote}{\Name[Leonard]{Bernstein}\break
% \hbox{}\hfill ``What Makes Opera Grand?'', \textit{Vogue}
% (December 1958)}
% \textls[-15]{Any great work of art \dots revives and readapts time and space, and the measure of its success is the extent to which it makes you an inhabitant of that world\,---\,the extent to which it invites you in and lets you breathe its strange, special air.}^^A
% \index{creatives, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
%^^A %%%%%%%%%%%%%%%%% Start of Documentation Proper %%%%%%%%%%%%%%%%%%%%%
%
% \section{Quick Start}
% \label{sec:QuickStart}
%
% A \emph{name authority} is a canonical, scholarly list of names to which variant name forms and aliases refer. Books can contain hundreds of names and index entries. The \textsf{nameauth} package assists academic and business writing to minimize the work of managing many names:
%
% \begin{itemize}
% \item Automate the display and formatting of names.
% \item Manage and display information that is associated with names.
% \item Make decisions relating to names (name control sequence patterns).
% \item Sort name index entries properly.
% \item Automatically add information to index entries.
% \item Ensure correct indexing of names that span page breaks.
% \item Change name forms in the text while retaining consistent index entries.
% \item Adopt name forms in the text and index that are culturally appropriate.
% \item Do not force the user to adopt any one culture's naming conventions.
% \item Permit European academic conventions (``Continental'' formatting).
% \end{itemize}
%
% Indexing rules implemented by \textsf{nameauth} are based on \Name[Nancy C.]{Mulvany}, \textit{Indexing Books} (Chicago: University of Chicago Press, 1994). All references [\hypertarget{Mulvany}{Mulvany}] refer to this edition. See also similar information in \textit{The Chicago Manual of Style} (15\textsuperscript{th} ed., Chicago: Chicago UP, 2003, 309f., 755f.) or newer editions; referenced as [\hypertarget{Chicago}{Chicago}].
%
% \subsection{Simple Example}
% \label{sec:QuickExample}
% \begingroup
% \renewcommand{\NamesFormat}{}
% \renewcommand{\MainNameHook}{}
%
% We begin with an excerpt from a biography written by \Name[Charles W.]{Chesnutt}[Charles Waddell], a prominent African-American author at the turn of the twentieth century.\footnote{\Name[Charles W.]{Chesnutt}, \textit{Frederick Douglass} (Boston: Small, Maynard, 1899). See also \href{https://docsouth.unc.edu/neh/chesnutt/summary.html} {\bfseries this web page}.}
% We create a new document, use only the default \textsf{nameauth} options, and create no extra formatting for names (cf. Section~\ref{sec:Formatting}).
%
% The \texttt{nameauth} environment (Section~\ref{sec:QuickUIStart}) in the preamble resembles a \texttt{tabular} with four columns. In column one we define the naming macros. In columns two and three we define the names that the macros will display. We leave column four empty.
% 
% We use \cmd{\Forgetname} (Section~\ref{sec:NameControl}) in Group 2 to ``forget'' about the names in Group 1. When we reorder the statements, the names change form automatically.
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test01_01.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage{nameauth}
% \usepackage[inline]{enumitem}
% \makeindex
%
% \begin{nameauth}
% %    Col. 1   Col. 2      Col. 3     Col. 4
%   \< Doug   & Frederick & Douglass &        >
%   \< Bailey & Betsey    & Bailey   &        >
% \end{nameauth}
%
% \begin{document}
%
% \textbf{Group 1}\\
% \begin{enumerate*}
%   \item[\textbf{1.}] \Doug\ rose to eminence by sheer force 
%     of character and talents that neither slavery nor caste
%     proscription could crush.
%   \item[\textbf{2.}] \Doug's early life is perhaps the most
%     complete indictment of the slave system ever presented at
%     the bar of public opinion.
%   \item[\textbf{3.}] \Doug\ was born in February, l8l7. His
%     earliest memories centered around the cabin of his
%     grandmother, \Bailey.
% \end{enumerate*}
%
% \textbf{Group 2}\\
% \ForgetName[Frederick]{Douglass}
% \ForgetName[Betsey]{Bailey}
% \begin{enumerate*}
%   \item[\textbf{2.}] \Doug's early life is perhaps the most
%     complete indictment of the slave system ever presented at
%     the bar of public opinion.
%   \item[\textbf{3.}] \Doug\ was born in February, l8l7. His
%     earliest memories centered around the cabin of his
%     grandmother, \Bailey.
%   \item[\textbf{1.}] \Doug\ rose to eminence by sheer force 
%     of character and talents that neither slavery nor caste
%     proscription could crush.
% \end{enumerate*}
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\NameauthTestFile}
%
% \textbf{Group 1}\\
% \begin{enumerate*}
%   \item[\textbf{1.}] \Doug\ rose to eminence by sheer force 
%     of character and talents that neither slavery nor caste
%     proscription could crush.
%   \item[\textbf{2.}] \Doug's early life is perhaps the most
%     complete indictment of the slave system ever presented at
%     the bar of public opinion.
%   \item[\textbf{3.}] \Doug\ was born in February, l8l7. His
%     earliest memories centered around the cabin of his
%     grandmother, \Bailey.
% \end{enumerate*}
%
% \textbf{Group 2}\\
% \ForgetName[Frederick]{Douglass}
% \ForgetName[Betsey]{Bailey}
% \begin{enumerate*}
%   \item[\textbf{2.}] \Doug's early life is perhaps the most
%     complete indictment of the slave system ever presented at
%     the bar of public opinion.
%   \item[\textbf{3.}] \Doug\ was born in February, l8l7. His
%     earliest memories centered around the cabin of his
%     grandmother, \Bailey.
%   \item[\textbf{1.}] \Doug\ rose to eminence by sheer force 
%     of character and talents that neither slavery nor caste
%     proscription could crush.
% \end{enumerate*}
% \end{quote}
%
% \endgroup
%
% \begin{Quote}{\ForgetThis\Doug\break
% \hbox{}\hfill motto, \textit{The North Star} (Rochester, NY, 1847)}
% Right Is of No Sex\,---\,Truth Is of No Color\,---\,God Is the Father
% of Us All, and All We Are Brethren.\negmedskip^^A
% \index{north star, concept of\noexpand\string|hyperpage}^^A
% \index{civil rights leaders, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \subsection{How To Use the Manual}
% \label{sec:ManualUse}
%
% This manual tries to support various learning styles by using layout, colors, shapes, and similar ordering of both document sections and package code.
%
% \subsubsection*{\hfil Macro Argument Types}
% \vspace{-4ex}
%
% \begin{multicols}{2}
%   \begin{tcolorbox}[colback=white,colframe=black,
%     adjusted title={\bfseries\hfil \{Mandatory Arguments\}}]
%     \centering This manual shows mandatory arguments in black.
%   \end{tcolorbox}
%
%   \begin{tcolorbox}[colback=white,colframe=nared,
%     adjusted title={\bfseries\hfil [Optional Arguments]}]
%     \centering This manual shows optional arguments in dark red.
%   \end{tcolorbox}
% \end{multicols}
%
% \subsubsection*{\hfil Scope and Sequence}
%
% The table of contents indicates what topics are covered, the simpler and frequent to the complex and infrequent. Later topics require knowledge from multiple sections. The end of each major section includes a return link to the table of contents.
%
% \subsubsection*{\hfil Key Concepts}
%
% Starting in Section~\ref{sec:BasicStart}, we use debugging macros to show \emph{name control patterns} in the margins (Section~\ref{sec:NamePatterns}). These patterns are the key to how names work in \textsf{nameauth}. Through Section~\ref{sec:NameMedieval} we show \emph{basic index entries} in the margins in order to illustrate the things for which one should look when debugging.
%
% \subsubsection*{\hfil Special Signs}
%
% \noindent This manual uses signs and illustrative typesetting that are not built-in defaults of \textsf{nameauth}, but in some cases are implemented using it:
%
% \begin{itemize}
%   \item[\ \ ]We highlight {\NamesFormat{First Uses}} and
%     {\MainNameHook{Later Uses}} of names (Sections~\ref{sec:Formatting},
%     \ref{sec:NameControl}).
%   \item[\dag\ ]A dagger indicates reversed Western forms
%     (Sections~\ref{sec:RevNames}).
%   \item[\ddag\ ]A double dagger shows usage of the obsolete syntax
%     (Section~\ref{sec:Obsolete}).
%   \item[\S\ ]A section mark denotes index entries of fictional names.
%   \item[\(\leftarrow\)]The\Warn{} ``dangerous bend'' shows where caution
%     is needed.
% \end{itemize}
%
% \subsubsection*{\hfil Example Files}
%
% The files \texttt{examples.tex} and \texttt{compat.tex} are located with this manual. For generating package testing files, see \texttt{README.md}, also located with this manual.
%
% \vfill
%
% \begin{InfoBox}[Thanks]\small
% For assistance at various times, thanks to \Name[Marc van]{Dongen}, \Name[Enrico]{Gregorio}, \Name[Philipp]{Stephani}, \Name[Heiko]{Oberdiek}, \Name[Uwe]{Lueck}, \Name[Dan]{Luecking}, \Name[Robert]{Schlicht}, and others.\\[1ex]
% \hbox{}\hfil \textit{In memoriam} \Name[Robin]{Fairbairns}\\[1ex]
% He was very kind when I first uploaded \textsf{nameauth}, and gracious thereafter as well.
% \end{InfoBox}
%
% \newpage
%
% \subsection{Basic Concepts}
%
% This section introduces fundamental concepts needed by package users.
% The rest of the manual requires these to be understood.
%
% \subsubsection{Name Arguments}
% \label{sec:NameArgs}
%
% Below we show how familiar categories of names map to name arguments in the appropriate macros, as defined by the current syntax. We use the excellent advice in [\hyperlink{Mulvany}{Mulvany}, 152--82] and [\hyperlink{Chicago}{Chicago}], adapting them for use in \LaTeX.
% \medskip
%
% \begingroup\small
% \setbox0\hbox{Family / clan name\ }
% \global\setlength{\nameboxi}{\wd0}
% \setbox0\hbox{nomen / cognomen\ }
% \global\setlength{\nameboxii}{\wd0}
% \setbox0\hbox{notable attribute\ }
% \global\setlength{\nameboxiii}{\wd0}
% \endgroup
%
% \noindent\begin{tcolorbox}[colframe=naslate,
% adjusted title={\large Western Name:
%   \oarg{FNN}\marg{SNN, Affix}\oarg{Alternate}}]
% \centering\small^^A
%^^A
%   \tcbox[equal height group=A,on line,tikznode,colback=white,
%     adjusted title={\centering\bfseries\sffamily Forename(s):\meta{FNN}}]
%     {\hbox to \nameboxi {\hfil Personal name(s):\hfil}\\
%     \textit{baptismal name}\\
%     \textit{Christian name}\\
%     \textit{multiple names}\\
%     \textit{praenomen}\footnotemark}\hfill^^A
%^^A
%   \tcbox[equal height group=A,on line,tikznode,colback=white,
%     adjusted title={\bfseries\sffamily Surname(s):\meta{SNN}}]
%     {\hbox to \nameboxii {\hfil Family name:\hfil}\\
%     \textit{of father, mother}\\
%     \textit{ancestor, vocation}\\
%     \textit{origin, region}\\
%     \textit{nomen\,/\,cognomen}\\
%     \textit{patronym}}\hfill^^A
%^^A
%   \tcbox[equal height group=A,on line,tikznode,colback=white,colframe=nared,
%     adjusted title={\bfseries\sffamily Qualifier:\meta{Affix}}]
%     {\hbox to \nameboxiii {\hfil Sobriquet\,/\,title:\hfil}\\
%     \textit{Sr., Jr., III\dots}\\
%     \textit{notable attribute}\\
%     \textit{origin, region}}
%
%   \begin{tcolorbox}[colback=white,colframe=nared,
%     adjusted title={\bfseries\sffamily Alias:\meta{Alternate}}]
%     \centering Replaces \meta{FNN} only in the text.
%   \end{tcolorbox}
%
% \end{tcolorbox}
% \footnotetext{There are several ways of handling the Roman \textit{tria
% nomina}. See Section~\ref{sec:Romani}.}
%
% \begin{tcolorbox}[colframe=naslate,
% adjusted title={\large ``Native'' Eastern Name}:
%   \marg{SNN, Affix}\oarg{Alternate}]
% \centering\small^^A
%^^A
%   \tcbox[equal height group=B,on line,tikznode,colback=white,
%     adjusted title={\bfseries\sffamily Family:\meta{SNN}}]
%     {\hbox to \nameboxi {\hfil Family\,/\,clan name\hfil}}\hfill^^A
%^^A
%   \tcbox[equal height group=B,on line,tikznode,colback=white,
%     adjusted title={\bfseries\sffamily Personal:\meta{Affix}}]
%     {\hbox to \nameboxii {\hfil Usually one name\hfil}}\hfill^^A
%^^A
%   \tcbox[equal height group=B,on line,tikznode,colback=white,colframe=nared,
%     adjusted title={\bfseries\sffamily Alias:\meta{Alternate}}]
%     {\hbox to \nameboxiii {\hfil Replaces \meta{Affix}\hfil}\\
%     only in text.\footnotemark}
% \end{tcolorbox}
% \footnotetext{The obsolete syntax uses \meta{Alternate} instead of
% \meta{Affix} for a personal name (Section~\ref{sec:Obsolete}).}
%
% \begin{tcolorbox}[colframe=naslate,
%   adjusted title={\large Royal/Medieval/Ancient Name}:
%   \marg{SNN, Affix}\oarg{Alternate}]
% \centering\small^^A
%^^A
%   \tcbox[equal height group=C,on line,tikznode,colback=white,
%     adjusted title={\bfseries\sffamily Personal:\meta{SNN}}]
%     {\hbox to \nameboxi {\hfil Given name(s)\hfil}\\
%     \phantom{Family\,/\,clan name}}\hfill^^A
%^^A
%   \tcbox[equal height group=C,on line,tikznode,colback=white,colframe=nared,
%     adjusted title={\bfseries\sffamily Qualifier:\meta{Affix}}]
%     {\hbox to \nameboxii {\hfil Sobriquet\,/\,title:\hfil}\\
%     \textit{Sr., Jr., III\dots}\\
%     \textit{notable attribute}\\
%     \textit{origin, region}\\
%     \textit{patronym}}\hfill^^A
%^^A
%   \tcbox[equal height group=C,on line,tikznode,colback=white,colframe=nared,
%     adjusted title={\bfseries\sffamily Alias:\meta{Alternate}}]
%     {\hbox to \nameboxiii {\hfil Replaces \meta{Affix}\hfil}\\
%     only in text.\footnotemark}
% \end{tcolorbox}
% \footnotetext{The obsolete syntax uses \meta{Alternate} instead of
% \meta{Affix} for a qualifier (Section~\ref{sec:Obsolete}).}
%
% \newpage
%
% \subsubsection{Name Ambiguity}
%
% \begin{itemize}
% \item \textbf{Name forms are ambiguous.}
%
% In Western culture, one often sees forenames followed by a surname. Patronyms, as in \Name[Leif]{Erikson} and \Name{Llywelyn, ap Gruffudd}, and other exceptions exist.\footnote{Indexed here under \Name[Leif]{Erikson} and \Name{Llywelyn, ap Gruffudd}. See also \href{https://www.theindexer.org/wp-content/uploads/2020/07/welsh-personal-names.pdf} {\bfseries this document} on indexing Welsh names.}
% Some readers might assume the following:
%
% \begin{center}
%   \renewcommand\NamesFormat{\color{blue}\sffamily}
%   \renewcommand\MainNameHook{\color{blue}\sffamily}
%   \begin{tabular}{lll}\toprule
%     \rowcolor{nagrey}\bfseries Forename & \bfseries Forename & \bfseries Surname\\
%     \SubvertThis\FName[M.T.]{Cicero}[Marcus] &
%       \FName[M.T.]{Cicero}[Tullius] &
%       \Name[M.T.]{Cicero}\\\midrule
%     \rowcolor{nagrey}\bfseries Forename & & \bfseries Surname\\
%     \SubvertThis\Name{Pontius, Pilate} & &
%       \ForceFN\FName{Pontius, Pilate}\\
%     \SubvertThis\Name{Jesus, Christ} & &
%       \ForceFN\FName{Jesus, Christ}\\\bottomrule
%   \end{tabular}
% \end{center}
%
% Even though all these initial assumptions are false, Western naming conventions tend to dominate the general readership market and, \textit{mutatis mutandis}, they affect the use and indexing of names.
%
% \item \textbf{Cultural context resolves ambiguity.}
%
% Here we see how the names above have meaning in their proper context. The words themselves \textit{as signs} do not offer the as many clues about their meaning until the signs become part of a cultural landscape.
%
% \begin{center}
%   \renewcommand\NamesFormat{\sffamily}
%   \renewcommand\MainNameHook{\sffamily}
%   \begin{tabular}{lll}\toprule
%     \rowcolor{nagrey}\bfseries Personal Name &
%       \bfseries Clan Name & \bfseries Branch Family or Nickname\\
%     \SubvertThis\FName[M.T.]{Cicero}[Marcus] &
%       \FName[M.T.]{Cicero}[Tullius] &
%       \Name[M.T.]{Cicero}\\
%     & \SubvertThis\Name{Pontius, Pilate} &
%       \ForceFN\FName{Pontius, Pilate}\\\midrule
%     \rowcolor{nagrey}\bfseries Personal Name & & \bfseries Sobriquet\\
%     \SubvertThis\Name{Jesus, Christ} & &
%       \ForceFN\FName{Jesus, Christ}\\\bottomrule
%   \end{tabular}
% \end{center}
%
% \item \textbf{This package embraces such ambiguities.}
%
% Roman \textit{praenomina} did not have the same significance as Western forenames.\footnote{See \href{https://en.wikipedia.org/wiki/Praenomen}{Wikipedia}. Roman names in particular are sensitive to the historical and political development of Rome and its empire, the history of Roman families and culture, as well as other factors.}
% Yet the family name (\textit{nomen}) of the man we call \Name[M.T.]{Cicero} is \FName[M.T.]{Cicero}[Tullius]. In English, he used to be known as \IndexRef{Tully}{Cicero, M.T.}\Name{Tully}. In this manual we choose the popular case for the \textit{cognomen} \Name[M.T.]{Cicero} as a Western surname. Scholarly publications can take at least two different approaches (see Section~\ref{sec:Romani}).
%
% The name \Name*{Pontius, Pilate} has no personal name, which fits with Roman naming trends. \Name{Pontius, Pilate} is a clan name. Most texts and inscriptions favor the \textit{cognomen} \ForceFN\FName{Pontius, Pilate}[Pilatus], denoting martial prowess.
%
% \Name*{Jesus, Christ} is a name derived from Greek \el{Ἰησοῦς Χριστός}, from \textit{Y'shua ha-Mashiach}, Joshua the Anointed One. The personal name is \Name{Jesus, Christ}. Other added names are titles or descriptors.
%
% \item \textbf{Macros can modify names in the text to fit cultural norms.}
%
% Name forms in the text are independent of their index entries. This is necessary for special cases like Hungarian names. Thus, a text oriented to Hungarian readers can talk about \RevName\Name[Frenec]{Liszt}\dag\ (\IndexRef[Franz]{Liszt}{Liszt, Frenec}\Name[Franz]{Liszt}) in the body text, but he can be indexed as \ShowIdxPageref*[Frenec]{Liszt}. One can do something similar with East Asian names, if Western index entries are required.
%
% \item \textbf{Name arguments determine index entry forms.}
%
% The way that one puts names into macro name arguments absolutely determines the entry form in the index:\medskip
%
% \begingroup\IndexInactive\footnotesize
%   \renewcommand\NamesFormat{}
%   \renewcommand\MainNameHook{}
%   \begin{tabular}{l@{\ }l@{\ }l}\toprule
%     \rowcolor{nagrey}\bfseries Printed Name &
%       \bfseries Macro and Arguments & \bfseries Western Index Entry\\
%     \Name[Person]{Family, Affix} & |\Name[Person]{Family, Affix}| &
%       \ShowIdxPageref*[Person]{Family, Affix}\\
%     \Name[Person]{Family} & |\Name[Person]{Family}| &
%       \ShowIdxPageref*[Person]{Family}\\
%     \RevName\Name*[Person]{Family} & |\RevName%| &
%       \ShowIdxPageref*[Person]{Family}\\
%     & |\Name[Person]{Family}|\\\midrule
%     \rowcolor{nagrey}\bfseries Printed Name &
%       \bfseries Macro and Arguments & \bfseries Nonwestern Index Entry\\
%     \Name{Family, Person} & |\Name{Family, Person}| &
%       \ShowIdxPageref*{Family, Person}\\
%     \RevName\Name*{Family, Person} & |\RevName%| &
%       \ShowIdxPageref*{Family, Person}\\
%     & |\Name{Family, Person}|\\
%     \Name{Person, Affix} & |\Name{Person, Affix}| &
%       \ShowIdxPageref*{Person, Affix}\\
%     \Name{Person} & |\Name{Person}| &
%       \ShowIdxPageref*{Person}\\\bottomrule
%   \end{tabular}\IndexActive
% \endgroup\bigskip
%
% The following choices reflect non-scholarly English-language books. Later sections will show different ways to encode name arguments for scholarly works or non-English books.
%
% \begin{center}\footnotesize
%   \renewcommand\NamesFormat{\sffamily}
%   \renewcommand\MainNameHook{\sffamily}
%   \begin{tabular}{lll}\toprule
%     \rowcolor{nagrey}\bfseries Printed Name &
%       \bfseries Macro and Arguments & \bfseries Western Index Entry\\
%     \ForgetThis\Name[M.T.]{Cicero} & \cmd{\Name[M.T.]\{Cicero\}} &
%       \ShowIdxPageref*[M.T.]{Cicero}\\\midrule
%     \rowcolor{nagrey}\bfseries Printed Name &
%       \bfseries Macro and Arguments & \bfseries Nonwestern Index Entry\\
%     \ForgetThis\Name{Pontius, Pilate} & \cmd{\Name\{Pontius, Pilate\}} &
%       \ShowIdxPageref*{Pontius, Pilate}\\
%     \ForgetThis\Name{Jesus, Christ} & \cmd{\Name\{Jesus, Christ\}} &
%       \ShowIdxPageref*{Jesus, Christ}\\\bottomrule
%   \end{tabular}
% \end{center}
%
% \item \textbf{Name complexity creates \textsf{nameauth} complexity.}
%
% We might take names for granted until we have to consider them, use them in multicultural contexts, index them, and so on. Even if one does not use the \textsf{nameauth} package, one cannot escape this complexity.
%
% Indeed, it is only through the process of making \textsf{nameauth} that the present author became aware of the many intricate and fascinating complexities of names. The hope is that this package might facilitate accurate and respectful cross-cultural use of names in quality publications.
% \end{itemize}
%
% \begin{Quote}{\Name[Theodore]{Roosevelt}\break\hbox{}\hfill
% Introduction, \textit{The Papers and Writings of Abraham Lincoln} (1905)}
% It is a very poor thing, whether for nations or individuals, to advance the history of great deeds done in the past as an excuse for doing poorly in the present; but it is an excellent thing to study the history of the great deeds of the past, and of the great men who did them, with an earnest desire to profit thereby so as to render better service in the present. In their essentials, the men of the present day are much like the men of the past, and the live issues of the present can be faced to better advantage by men who have in good faith studied how the leaders of the nation faced the dead issues of the past.\negmedskip^^A
% \index{politicians, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \subsection{Basic Interface}
% \label{sec:BasicStart}
%
% The description of macro arguments in this section applies to all \textsf{nameauth} macros that take name arguments (Sections~\ref{sec:NameArgs} and~\ref{sec:NameArgMacros}), making this section critical to using and mastering \textsf{nameauth}.
%
% \begin{itemize}
% \item If the required argument \meta{SNN} is empty, \textsf{nameauth}
%   issues a package error, even when the \meta{Affix} part of an
%   \meta{SNN}, \meta{Affix} pair is not empty.
% \item Extra spaces around each argument are stripped.
% \item Include name arguments consistently to have consistent
%   index entries.
% \item For all name forms, see Section~\ref{sec:FinalOptargs} regarding
%   final optional arguments.
% \end{itemize}
%
% \subsubsection{Western Names}
%
% \begin{tcolorbox}[colframe=naslate]\centering
%   \begin{tabular}{l@{ }c@{ }c@{ }c}
%   & Required	& Required \meta{SNN}	& Optional\\
%   & \meta{FNN}	& optional \meta{Affix}	& (text only)\\[1ex]
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries \hbox{\cmd{\Name}\texttt{ }}\\
%     \cmd{\Name*}\\
%     \cmd{\FName}} &
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries\oarg{FNN}} &
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries\marg{SNN\color{nared}, Affix}} &
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries\oarg{\color{nared}Alternate}}
%   \end{tabular}
% \end{tcolorbox}\medskip
%
% \noindent
% Within \textsf{nameauth}, Western names have distinct features:
%
% \begin{itemize}
% \item Western names must use the first optional \meta{FNN} argument.
% \item They require a comma to delimit any affixes
%   (Section~\ref{sec:Affix}).
% \item Western index entries have two general forms:
% \begin{itemize}
%   \item[] \meta{SNN}, \meta{FNN}
%   \item[] \meta{SNN}, \meta{FNN}, \meta{Affix}
% \end{itemize}
% \item They have Western name patterns (Section~\ref{sec:NamePatterns})
%   and index entry forms.
% \end{itemize}
%
% \subsubsection*{\hfil Full, Last, and First Names}
%
% \cmd{\Name} prints first uses of names long, then short thereafter. \cmd{\Name*} ensures a long form. Both \cmd{\FName} and \cmd{\FName*} print long names in first uses, then just a forename in later uses.\footnote{The intent is that one can just add an \texttt{F} to either \cmd{\Name} or \cmd{\Name*}.}
% The affix in a surname only appears in long name instances.
%
% \begin{Block}
% \vspace{3.5ex}
% \BothInfo{\ShowPattern[George]{Washington}\break
%   \ShowPattern[George S.]{Patton, Jr.}}
% {\ShowIdxPageref*[George]{Washington}\break
%   \ShowIdxPageref*[George S.]{Patton, Jr.}}
% \vspace{-3.5ex}
% \ForgetName[George]{Washington}
% \FUse \Name [George]{Washington}\dotfill^^A
%   |\Name [George]{Washington}|\break
% \LUse \Name*[George]{Washington}\dotfill^^A
%   |\Name*[George]{Washington}|\break
% \LUse \Name [George]{Washington}\dotfill^^A
%   |\Name [George]{Washington}|\break
% \LUse \FName[George]{Washington}\dotfill^^A
%   |\FName[George]{Washington}|
% \end{Block}
%
% \begin{Block}
% \FUse \Name [George S.]{Patton, Jr.}\dotfill^^A
%   |\Name [George S.]{Patton, Jr.}|\break
% \LUse \Name*[George S.]{Patton, Jr.}\dotfill^^A
%   |\Name*[George S.]{Patton, Jr.}|\break
% \LUse \Name [George S.]{Patton, Jr.}\dotfill^^A
%   |\Name [George S.]{Patton, Jr.}|\break
% \LUse \FName[George S.]{Patton, Jr.}\dotfill^^A
%   |\FName[George S.]{Patton, Jr.}|
% \end{Block}
%
% \subsubsection*{\hfil Affixes and Alternate Forms}
%
% In a long name instance, \cmd{\DropAffix} drops the affix from a Western surname. The \meta{Alternate} argument appears only in long names or forename-only names in the text. Otherwise, the automatic shortening of names will display only a short surname.
%
% \begin{itemize}
% \item Drop the affix in a long name instance (forced by \cmd{\Name*}):
% \BothInfo{\ShowPattern[George S.]{Patton, Jr.}\break
%   \ShowPattern[J.D.]{Rockefeller, IV}\break
%   \ShowPattern[Clive Staples]{Lewis}}
% {\ShowIdxPageref*[George S.]{Patton, Jr.}\break
%   \ShowIdxPageref*[J.D.]{Rockefeller, IV}\break
%   \ShowIdxPageref*[Clive Staples]{Lewis}}
% \begin{Block}
%   \FUse \ForgetThis\DropAffix\Name*[George S.]{Patton, Jr.}\\
%   \UseB |\DropAffix\Name*[George S.]{Patton, Jr.}|\\
%   \LUse \DropAffix\Name*[George S.]{Patton, Jr.}\\
%   \UseB |\DropAffix\Name*[George S.]{Patton, Jr.}|
% \end{Block}
%
% \item Use an alternate forename in a long- or forename instance:
% \begin{Block}
%   \FUse \Name[J.D.]{Rockefeller, IV}[John Davison]\\
%   \UseB |\Name[J.D.]{Rockefeller, IV}[John Davison]|\\
%   \LUse \FName[George S.]{Patton, Jr.}[George]\\
%   \UseB |\FName[George S.]{Patton, Jr.}[George]|
% \end{Block}
%
% \item Drop the affix and alter the forenames:
% \begin{Block}
%   \FUse \ForgetThis\DropAffix\Name*[J.D.]{Rockefeller, IV}[Jay]\\
%   \UseB |\DropAffix\Name*[J.D.]{Rockefeller, IV}[Jay]|\\
%   \LUse \DropAffix\Name*[J.D.]{Rockefeller, IV}[Jay]\\
%   \UseB |\DropAffix\Name*[J.D.]{Rockefeller, IV}[Jay]|
% \end{Block}
%
% \item Use multiple alternate forenames for the same person:
% \begin{Block}
%   \FUse \Name [Clive Staples]{Lewis}\\
%   \UseB |\Name [Clive Staples]{Lewis}|\\
%   \LUse \Name*[Clive Staples]{Lewis}[C.S.]\\
%   \UseB |\Name*[Clive Staples]{Lewis}[C.S.]|\\
%   \LUse \FName[Clive Staples]{Lewis}[Jack]\\
%   \UseB |\FName[Clive Staples]{Lewis}[Jack]|
% \end{Block}
% \end{itemize}
%
% \begin{InfoBox}
% To sort the index consistently and properly, all names should be sorted by their longest unique name forms and by the Arabic equivalents of Roman numerals. See Section~\ref{sec:NameMedieval}, \ref{sec:IndexSort}, \ref{sec:IndexInitials}, \ref{sec:VarNames}. and all of Section~\ref{sec:AdvancedFormat}. For example:
%
% \begin{center}
% |\PretagName[J.D.]{Rockefeller, IV}{Rockefeller, John D 4}|
% \end{center}
% \end{InfoBox}
%
% \begin{Quote}{\ForgetThis\Wash, Farewell Address (1796)}
% The alternate domination of one faction over another, sharpened by the spirit of revenge, \dots is itself a frightful despotism. But this leads at length to a more formal and permanent despotism. The disorders and miseries, which result, gradually incline the minds of men to seek security and repose in the absolute power of an individual; and sooner or later the chief of some prevailing faction, more able or more fortunate than his competitors, turns this disposition to the purposes of his own elevation, on the ruins of Public Liberty.^^A
% \index{politicians, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \subsubsection[Reversed Western]{Reversed Western Names}
%
% \begin{tcolorbox}[colframe=naslate]\centering
%   \begin{tabular}{l@{ }c@{ }c@{ }c}
%   & Required	& Required \meta{SNN}	& Optional\\
%   & \meta{FNN}	& no \meta{Affix}	 	& (text only)\\[1ex]
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries \hbox{\cmd{\Name}\texttt{ }}\\
%     \cmd{\Name*}\\
%     \cmd{\FName}} &
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries\oarg{FNN}} &
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries\quad\marg{SNN}\quad\hbox{}} &
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries\oarg{\color{nared}Alternate}}
%   \end{tabular}
% \end{tcolorbox}\medskip
%
% \noindent
% Reversed Western names (Section~\ref{sec:RevNames}) have these features:
%
% \begin{itemize}
% \item They must use the first optional \meta{FNN} argument.
% \item Avoid using affixes in order to avoid odd name forms. One also
%    could use \cmd{\DropAffix} (Section~\ref{sec:Affix}), but that would
%    not affect index entries.
% \item Index entries have the Western form: \meta{SNN}, \meta{FNN}.
% \item They have Western name patterns and index entry forms.
% \item They do not work with the obsolete syntax
%   (Section~\ref{sec:Obsolete}).
% \end{itemize}
%
% \subsubsection*{\hfil Starting with Western Name Forms}
%
% These reversed Western forms are used optimally in a context where Hungarian names and similar cases of name order appear in a document because their index entries take a Western form [\hyperlink{Mulvany}{Mulvany}, 166].\footnote{Regarding the margin note that shows name control sequences, with \texttt{pdflatex} and \texttt{latex}, in \texttt{\ShowPattern[Frenec]{Molnár}} the glyphs \texttt{Ãą} correspond to \cmd{\IeC\{\textbackslash\textquotesingle a\}}.}
%
% \begin{Block}
% \BothInfo{\ShowPattern[Frenec]{Molnár}\break
%   \ShowPattern[Hideyo]{Noguchi}}
% {\ShowIdxPageref*[Hideyo]{Noguchi}\break
%   \ShowIdxPageref*[Frenec]{Molnár}}
% \FUse \Name [Frenec]{Molnár}\dotfill |\Name [Frenec]{Molnár}|\\
% \FUse \Name [Hideyo]{Noguchi}\dotfill |\Name [Hideyo]{Noguchi}|\\
% \LUse \Name*[Hideyo]{Noguchi}[Doctor]\dotfill |\Name*[Hideyo]{Noguchi}[Doctor]|
% \end{Block}
%
% \subsubsection*{\hfil Using the Reversing Macros}
%
% \noindent We use the prefix macros \cmd{\RevName} and optionally \cmd{\CapName} (Section~\ref{sec:SelectOver}) to print either a Hungarian or ``non-native'' Eastern name in the text while keeping Western forms in the index:
%
% \begin{Block}
% \LUse\Same \RevName\Name*[Frenec]{Molnár}\dag\\
% \UseB |\RevName\Name*[Frenec]{Molnár}\dag|\\
% \LUse \RevName\Name [Frenec]{Molnár}\dag\\
% \UseB |\RevName\Name [Frenec]{Molnár}\dag|\\
% \LUse \CapName\RevName\Name*[Hideyo]{Noguchi}[Sensei]\dag\\
% \UseB |\CapName\RevName\Name*[Hideyo]{Noguchi}[Sensei]\dag|\\ 
% \LUse \CapName\RevName\Name [Hideyo]{Noguchi}[Sensei]\dag\\
% \UseB |\CapName\RevName\Name [Hideyo]{Noguchi}[Sensei]\dag| 
% \end{Block}
%
% These macros, as is the case with many \textsf{nameauth} macros, work properly in context, not arbitrarily. \emph{They always have Western index entries,} regardless of how they appear in the text.
%
% \subsubsection{Eastern Names}
%
% All nonwestern name forms in \textsf{nameauth} have the syntax: \meta{SNN,Affix}. In Eastern names, \meta{SNN} refers to a family name and \meta{Affix} to a personal name. Otherwise, \meta{SNN} refers to a person's name and \meta{Affix} to added information. Knowing this difference helps one avoid nonsense names.\medskip
%
% \begin{tcolorbox}[colframe=naslate]\centering
%   \begin{tabular}{l@{ }c@{ }c}
%   & Required \meta{SNN}	& Optional\\
%   & required \meta{Affix}	& (text only)\\[1ex]
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries \hbox{\cmd{\Name}\texttt{ }}\\
%     \cmd{\Name*}\\
%     \cmd{\FName}} &
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries\marg{SNN, Affix}} &
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries\oarg{\color{nared}Alternate}}
%   \end{tabular}
% \end{tcolorbox}\medskip
%
% \noindent
% These features denote ``native'' Eastern names in \textsf{nameauth} (Sections~\ref{sec:Eastern}, \ref{sec:RevNames}):
%
% \begin{itemize}
% \item They must \emph{leave empty} the \meta{FNN} argument.
% \item They use instead the \meta{SNN, Affix} arguments.
% \item Their index entries take the nonwestern form: \meta{SNN Affix}.
% \item Names with the form \meta{SNN, Affix} can use the \meta{Alternate}
%   argument  to swap \meta{Affix} with \meta{Alternate}.
% \item They have nonwestern name patterns and index entry forms.
% \end{itemize}
%
% \subsubsection*{\hfil ``Native'', Reversible Eastern Name Forms}
%
% Among the names shown below, \cmd{\FName} does not show a personal name by default. This design helps to prevent Western writers from being culturally insensitive.
%
% \begin{Block}
% \vspace{3.5ex}
% \BothInfo{\ShowPattern{Miyazaki, Hayao}}
% {\ShowIdxPageref*{Miyazaki, Hayao}}
% \vspace{-3.5ex}
% \ForgetName {Miyazaki, Hayao}
% \FUse \Name {Miyazaki, Hayao}\dotfill |\Name {Miyazaki, Hayao}|\\
% \LUse \Name {Miyazaki, Hayao}\dotfill |\Name {Miyazaki, Hayao}|\\
% \LUse \Name*{Miyazaki, Hayao}[Sensei]\dotfill |\Name*{Miyazaki, Hayao}[Sensei]|\\
% \LUse \FName{Miyazaki, Hayao}\dotfill |\FName{Miyazaki, Hayao}|
% \end{Block}
%
% One must use \cmd{\ForceFN} with \cmd{\FName} (Section~\ref{sec:FName}) to get a personal name. \meta{Alternate} swaps with \meta{FNN} (in both long forms and in short forms) in the text only. \meta{Alternate} does not work with the obsolete syntax (Section~\ref{sec:Obsolete}):
%
% \begin{Block}
% \LUse\Same \ForceFN\FName{Miyazaki, Hayao}\dotfill^^A
%   |\ForceFN\FName{Miyazaki, Hayao}|\\
% \LUse \CapName\Name*{Miyazaki, Hayao}[Sensei]\dotfill^^A
%   |\CapName\Name*{Miyazaki, Hayao}[Sensei]|\\
% \LUse \ForceFN\FName{Miyazaki, Hayao}[Sensei]\dotfill^^A
%   |\ForceFN\FName{Miyazaki, Hayao}[Sensei]|\\
% \LUse \RevName\Name*{Miyazaki, Hayao}[Mr.]\dotfill^^A
%   |\RevName\Name*{Miyazaki, Hayao}[Mr.]|
% \end{Block}
%
% If ``native'' Eastern names are reversed, they will have Western name order in the text, but \emph{they will retain Eastern-form index entries.}
%
% \newpage
%
% \subsubsection[Ancient Names]{Royal, Medieval, and Ancient Names}
%
% \begin{tcolorbox}[colframe=naslate]\centering
%   \begin{tabular}{l@{ }c@{ }c}
%   & Required \meta{SNN}	& Optional,\\
%   & optional \meta{Affix}	& special\\[1ex]
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries \hbox{\cmd{\Name}\texttt{ }}\\
%     \cmd{\Name*}\\
%     \cmd{\FName}} &
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries\marg{SNN\color{nared}, Affix}} &
%   \tcbox[equal height group=D,colback=white,tikznode,
%     left=1mm,right=1mm,valign=center]
%     {\normalsize\bfseries\oarg{\color{nared}Alternate}}
%   \end{tabular}
% \end{tcolorbox}\medskip
%
% \noindent
% These features denote royal, medieval, and ancient names in \textsf{nameauth}, grouped under the general rubric of ``nonwestern'' name forms:
%
% \begin{itemize}
% \item They must \emph{leave empty} the \meta{FNN} argument.
% \item They use either the \meta{SNN, Affix} arguments or just \meta{SNN}.
% \item Their index entries take the nonwestern forms: \meta{SNN Affix}
%   or \meta{SNN}.
% \item Names with the form \meta{SNN, Affix} can use the \meta{Alternate}
%   argument to swap \meta{Affix} with \meta{Alternate}.
% \item Names with the form \meta{SNN} should not use \meta{Alternate}
%   (cf. Section~\ref{sec:Obsolete}).
% \item They have nonwestern name patterns and index entry forms.
% \item One generally does not reverse these names (Section~\ref{sec:RevNames}).
% \end{itemize}
%
% \subsubsection*{\hfil No School Like the Old School}
%
% \begin{itemize}
% \item \cmd{\FName} normally prints \meta{SNN} to avoid nonsense names
%   in the text.
% \BothInfo{\ShowPattern{Elizabeth, I}\break
%   \ShowPattern{John, Eriugena}\break
%   \ShowPattern{Aristotle}}
% {\ShowIdxPageref*{Elizabeth, I}\break
%   \ShowIdxPageref*{John, Eriugena}\break
%   \ShowIdxPageref*{Aristotle}}
% \begin{Block}
%   \FUse \Name {Elizabeth, I}\dotfill |\Name {Elizabeth, I}|\\
%   \LUse \Name {Elizabeth, I}\dotfill |\Name {Elizabeth, I}|\\
%   \LUse \FName{Elizabeth, I}\dotfill |\FName{Elizabeth, I}|
% \end{Block}
%
% \item Here we work with titles and sobriquets:
% \begin{Block}
%   \FUse \ForgetThis\Name{Elizabeth, I}[I ``Gloriana'']\\
%   \UseB |\ForgetThis\Name{Elizabeth, I}[I ``Gloriana'']|\\
%   \LUse \ForceFN\FName{Elizabeth, I}[Gloriana]\\
%   \UseB |\ForceFN\FName{Elizabeth, I}[Gloriana]|
% \end{Block}
%
% \item Here we show a non-royal:
% \begin{Block}
%   \FUse \Name {John, Eriugena}[Scotus Eriugena]\\
%   \UseB |\Name {John, Eriugena}[Scotus Eriugena]|\\
%   \LUse \Name*{John, Eriugena}\dotfill |\Name*{John, Eriugena}|\\
%   \LUse \Name {John, Eriugena}\dotfill |\Name {John, Eriugena}|\\
%   \LUse \ForceFN\FName{John, Eriugena}\dotfill |\ForceFN\FName{John, Eriugena}|
% \end{Block}
%
% \item These are nonsensical name forms:
% \begin{Block}
%   \LUse \ForceFN\FName{Elizabeth, I}\dotfill |\ForceFN\FName{Elizabeth, I}|\\
%   \LUse \RevName\Name*{John, Eriugena}\dotfill |\RevName\Name*{John, Eriugena}|
% \end{Block}
%
% \item The trivial case:
% \begin{Block}
%   \FUse \Name{Aristotle}\dotfill |\Name{Aristotle}|\\
%   \LUse \Name{Aristotle}\dotfill |\Name{Aristotle}|
% \end{Block}
% \end{itemize}
%
% \newpage
%
% \subsection{Quick Interface}
% \label{sec:QuickUIStart}
%
% \subsubsection{Name Shorthands}
%
% \DescribeEnv{nameauth}
% To reduce typing, we replace frequently-used macros with the shorthand forms of the quick interface. Using the \texttt{nameauth} environment in the preamble guards against undefined macros. It defines a delimited macro \cmd{\<}, recalling a \texttt{tabular}:
%
% \begin{SyntaxBox}
%   \cmd{\begin\{nameauth\}}\\
%   \hspace{2em}\cmd{\<} \meta{arg1} \texttt{\&}
%   \meta{arg2} \texttt{\&}
%   \meta{arg3} \texttt{\&}
%   \meta{arg4} \texttt{>}\\
%   \cmd{\end\{nameauth\}}
% \end{SyntaxBox}
%
% In this context, \meta{arg1} becomes the root of three new macros per name:
%
% \begin{quote}
% \begin{tabular}{@{\quad}l@{\ same as: }ll}
%   \texttt{\textbackslash}\meta{arg1} &
%     \cmd{\Name\ }\oarg{arg2}\marg{arg3}\oarg{arg4} \\
%   \texttt{\textbackslash L}\meta{arg1} &
%     \cmd{\Name*}\oarg{arg2}\marg{arg3}\oarg{arg4} &
%     {\color{nared} |%| L for \textit{long}} \\
%   \texttt{\textbackslash S}\meta{arg1} &
%     \cmd{\FName}\oarg{arg2}\marg{arg3}\oarg{arg4} &
%     {\color{nared} |%| S for \textit{short}} \\
% \end{tabular}
% \end{quote}
%
% Usually we leave \meta{arg4} empty, apart from specific contexts. That field permanently displays only alternate names, or is used with the obsolete syntax (Section~\ref{sec:Obsolete}). Here is another way of thinking about arguments in the \texttt{nameauth} environment that relates back to what we have seen:
%
% \begin{SyntaxBox}
%   \cmd{\begin\{nameauth\}}\\
%   \hspace{2em}\cmd{\<} \meta{arg1} \texttt{\&}
%   \meta{\color{nared}FNN} \texttt{\&}
%   \meta{SNN\color{nared}, Affix} \texttt{\&}
%   \meta{\color{nared}Alternate} \texttt{>}\\
%   \cmd{\end\{nameauth\}}
% \end{SyntaxBox}
%
% By seeing the mandatory arguments in black and the optional ones in red, it helps us to see that, if either \meta{arg1} or \meta{arg3} are empty, or \meta{SNN} is empty, \textsf{nameauth} will generate a package error. Forgetting the backslash, any ampersand, or angle bracket will cause fatal errors. See Section~\ref{sec:FinalOptargs} on final optional arguments.
%
% Package warnings\Warn\ result when one redefines name shorthands using the \texttt{nameauth} environment. For example, we use \texttt{White} in two different rows to populate \meta{Arg1}. That causes \cmd{\White}, \cmd{\LWhite}, and \cmd{\SWhite} to be redefined:
%
% \begin{quote}
% \begin{Verbatim}
% \begin{nameauth}
%   \< White & E.B.   & White & >	 % version 1
%   \< White & E.\,B. & White & >	 % version 2
% \end{nameauth}
% \end{Verbatim}
% \end{quote}
% \begin{nameauth}
%   \< White & E.B.   & White & >	 ^^A version 1
%   \< White & E.\,B. & White & >	 ^^A version 2
% \end{nameauth}
%
% \cmd{\White} produces \White, the version with the thin space. We lost the first version of the name when we redefined it.\footnote{When building this package there should be a warning: \texttt{Shorthand macro already exists.} This is intentional, meant to test if the warning is working properly.}
%
% On the next page we will create an example \texttt{nameauth} environment using many of the names that we have so far encountered. We will add other names that we have not yet seen, introducing additional concepts in the process. Those include Western name forms that contain particles (usually prepositions or clan designators), which are discussed in greater detail in Section~\ref{sec:NameParticles}.
%
% \newpage
%
% The comments below are merely explanatory and in no wise required to use the environment. Likewise, extra spaces that are added for clarity are stripped.
%
% \begin{quote}
% \begin{Verbatim}
% \begin{nameauth}
% % Western Name Forms
% %    <arg1>     <arg2>          <arg3>              <arg4>
%   \< Wash     & George        & Washington        &        >
%   \< Lewis    & Clive Staples & Lewis             &        >
% % Western Name Forms with Affixes
%   \< Patton   & George S.     & Patton, Jr.       &        >
%   \< JRIV     & J.D.          & Rockefeller, IV   &        >
% % Western Name Forms with Particles
%   \< Soto     & Hernando      & de Soto           &        >
%   \< JWG      & J.W. von      & Goethe            &        >
%   \< VBuren   & Martin        & Van Buren         &        >
% % Reversed Western Forms
%   \< Noguchi  & Hideyo        & Noguchi           &        >
%   \< Molnar   & Frenec        & Molnár            &        >
% % ``Native'' Eastern Forms
%   \< Miyazaki &               & Miyazaki, Hayao   &        >
% %  Royal, Medieval, and Ancient Forms
%   \< Eliz     &               & Elizabeth, I      &        >
%   \< Aeth     &               & Æthelred, II      &        >
%   \< Eriugena &               & John, Eriugena    &        >
%   \< Aris     &               & Aristotle         &        >
% % Name Forms Always Using Alternate Names
%   \< CSL      & Clive Staples & Lewis             & C.S.   >
%   \< MSens    &               & Miyazaki, Hayao   & Sensei >
% \end{nameauth}
% \end{Verbatim}
% \end{quote}
%
% Here is an example of how much typing one can save with the quick interface, not to mention the prevention of error by not retyping arguments:
%
% \begin{center}
% \begin{tabular}{rll}\toprule
% \rowcolor{nagrey}^^A
%  \bfseries Output &        & \bfseries Macro\\
%
% \Wash             & Quick: & \cmd{\Wash}\\
%                   & Basic: &
%                   \cmd{\Name}\texttt{[George]\{Washington\}}\\
%
% \rowcolor{nagrey}^^A
%           \LWash  & Quick: & \cmd{\LWash}\\
% \rowcolor{nagrey}^^A
%                   & Basic: &
%                   \cmd{\Name*}\texttt{[George]\{Washington\}}\\
%                         
%            \SWash & Quick: & \cmd{\SWash}\\
%                   & Basic: &
%                   \cmd{\FName}\texttt{[George]\{Washington\}}\\
%
% \rowcolor{nagrey}^^A
% \ForgetThis\Wash  & Quick: & \cmd{\ForgetThis}\cmd{\Wash}\\
% \rowcolor{nagrey}^^A
%                   & Basic: &
%                   \cmd{\ForgetName}\texttt{[George]\{Washington\}}\\
% \rowcolor{nagrey}^^A
%                   &        &
%                   \cmd{\Name}\texttt{[George]\{Washington\}}\\
%
%  \ForgetThis\Wash & Quick: & \cmd{\ForgetThis}\cmd{\Wash}\\
%                   & Basic: &
%                   \cmd{\ForgetThis}^^A
%                   \cmd{\Name}\texttt{[George]\{Washington\}}\\
%
% \rowcolor{nagrey}^^A
% \SubvertThis\Wash & Quick: & \cmd{\SubvertThis}\cmd{\Wash}\\
% \rowcolor{nagrey}^^A
%                   & Basic: &
%                   \cmd{\SubvertName}\texttt{[George]\{Washington\}}\\
% \rowcolor{nagrey}^^A
%                   &        &
%                   \cmd{\Name}\texttt{[George]\{Washington\}}\\
%
% \SubvertThis\Wash & Quick: & \cmd{\SubvertThis}\cmd{\Wash}\\
%                   & Basic: &
% \cmd{\SubvertThis}\cmd{\Name}\texttt{[George]\{Washington\}}\\
%
% \rowcolor{nagrey}^^A
% \JustIndex\Wash(unseen in text) & Quick: & \cmd{\JustIndex}\cmd{\Wash}\\
% \rowcolor{nagrey}^^A
%                   & Basic: &
%                   \cmd{\IndexName}\texttt{[George]\{Washington\}}\\\bottomrule
% \end{tabular}
% \end{center}
%
% \newpage
%
% \subsubsection[Name Variants]{Quick Name Variant Overview}
%
% After setting up the previous \texttt{nameauth} environment, we use the resulting name shorthands. Below we show more ``prefix macros'' that affect name forms in the text. We hide the use of \cmd{\ForgetThis} (Section~\ref{sec:NameControl}), which creates first instances.
%
% \begin{itemize}
% \item Western Names: \hfill Sections~\ref{sec:Naming},
%   \ref{sec:FName}
% \BothInfo{\ShowPattern[George]{Washington}\break
%   \ShowPattern[George S.]{Patton, Jr.}\break
%   \ShowPattern[J.D.]{Rockefeller, IV}\break
%   \ShowPattern[Clive Staples]{Lewis}\break
%   \ShowPattern[Hideyo]{Noguchi}\break
%   \ShowPattern{Miyazaki, Hayao}}
% {\ShowIdxPageref*[George]{Washington}\break
%   \ShowIdxPageref*[George S.]{Patton, Jr.}\break
%   \ShowIdxPageref*[J.D.]{Rockefeller, IV}\break
%   \ShowIdxPageref*[Clive Staples]{Lewis}\break
%   \ShowIdxPageref*[Hideyo]{Noguchi}\break
%   \ShowIdxPageref*{Miyazaki, Hayao}}
%   \begin{Block}
%     \FUse \ForgetThis\Wash \dotfill \cmd{\Wash}\\
%     \LUse \LWash \dotfill \cmd{\LWash}\\
%     \LUse \Wash \dotfill \cmd{\Wash}\\
%     \LUse \SWash \dotfill \cmd{\SWash}
%   \end{Block}
%
% \item Nicknames and Affixes: \hfill Sections~\ref{sec:FName},
%   \ref{sec:Affix}
%   \begin{Block}
%     \FUse \ForgetThis\DropAffix\Patton \dotfill \cmd{\DropAffix}\cmd{\Patton}\\
%     \LUse \LPatton \dotfill \cmd{\LPatton}\\
%     \LUse \Patton \dotfill \cmd{\Patton}\\
%     \LUse \DropAffix\LPatton \dotfill \cmd{\DropAffix}\cmd{\LPatton}\\
%     \LUse \DropAffix\LPatton[George]\dotfill^^A
%       \cmd{\DropAffix}\cmd{\LPatton[George]}\\
%     \LUse \SPatton\dotfill \cmd{\SPatton}\\
%     \LUse \SPatton[George]\dotfill \cmd{\SPatton[George]}
%   \end{Block}
%
%   \begin{Block}
%     \FUse \ForgetThis\JRIV[John Davison]\dotfill^^A
%       \cmd{\JRIV[John Davison]}\\
%     \LUse \LJRIV \dotfill \cmd{\LJRIV}\\
%     \LUse \DropAffix\LJRIV[Jay]\dotfill \cmd{\DropAffix}\cmd{\LJRIV[Jay]}
%   \end{Block}
%
%   \begin{Block}
%     \FUse \ForgetThis\Lewis\dotfill \cmd{\Lewis}\\
%     \LUse \LLewis[C.S.]\dotfill \cmd{\LLewis[C.S.]}\\
%     \LUse \LLewis[Jack]\dotfill \cmd{\LLewis[Jack]}\\
%     \LUse \SLewis\dotfill \cmd{\SLewis}\\
%     \LUse \SLewis[Jack]\dotfill \cmd{\SLewis[Jack]}\\
%     \LUse \LCSL\dotfill \cmd{\LCSL}\\
%     \LUse \SCSL\dotfill \cmd{\SCSL}
%   \end{Block}
%
% \item ``Native'' Eastern Names: \hfill Section~\ref{sec:Eastern}
%   \begin{Block}
%     \FUse \ForgetThis\CapName\Miyazaki\dotfill \cmd{\CapName}\cmd{\Miyazaki}\\
%     \LUse \CapName\LMiyazaki\dotfill \cmd{\CapName}\cmd{\LMiyazaki}\\
%     \LUse \CapName\Miyazaki\dotfill \cmd{\CapName}\cmd{\Miyazaki}\\
%     \LUse \RevName\LMiyazaki\dotfill \cmd{\RevName}\cmd{\LMiyazaki}\\
%     \LUse \RevName\LMiyazaki[Mr.]\dotfill \cmd{\RevName}\cmd{\LMiyazaki[Mr.]}\\
%     \LUse \SMiyazaki\dotfill \cmd{\SMiyazaki}\\
%     \LUse \ForceFN\SMiyazaki\dotfill \cmd{\ForceFN}\cmd{\SMiyazaki}
%   \end{Block}
%
% \item Reversed Western Names: \hfill Section~\ref{sec:RevNames}
%   \begin{Block}
%     \FUse \ForgetThis\Noguchi\dotfill \cmd{\Noguchi}\\
%     \LUse \LNoguchi\dotfill \cmd{\LNoguchi}\\
%     \LUse \LNoguchi[Doctor]\dotfill \cmd{\LNoguchi[Doctor]}\\
%     \LUse \SNoguchi\dotfill \cmd{\SNoguchi}\\
%     \LUse \RevName\LNoguchi\dag\dotfill \cmd{\RevName}\cmd{\LNoguchi}\cmd{\dag}\\
%     \LUse \CapName\RevName\LNoguchi\dag\dotfill^^A
%       \cmd{\CapName}\cmd{\RevName}\cmd{\LNoguchi}\cmd{\dag}\\
%     \LUse \CapName\Noguchi\dag\dotfill \cmd{\CapName}\cmd{\Noguchi}\cmd{\dag}
%   \end{Block}
%
% \item Western Names Reversed by Surname: \hfill Section \ref{sec:LastFirst}
%   \begin{Block}
%     \FUse \ForgetThis\RevComma\LWash\dotfill \cmd{\RevComma}\cmd{\LWash}\\
%     \LUse \RevComma\LWash\dotfill \cmd{\RevComma}\cmd{\LWash}
%   \end{Block}
%
% \item Particles: \hfill Section~\ref{sec:NameParticles}
% \BothInfo{\ShowPattern[Hernando]{de~Soto}\break
%   \ShowPattern{Aristotle}\break
%   \ShowPattern{Æthelred, II}\break
%   \ShowPattern{John, Eriugena}}
% {\ShowIdxPageref*[Hernando]{de~Soto}\break
%   \ShowIdxPageref*{Aristotle}\break
%   \ShowIdxPageref*{Æthelred, II}\break
%   \ShowIdxPageref*{John, Eriugena}}
%   \begin{Block}
%     \FUse \ForgetThis\Soto\dotfill \cmd{\Soto}\\
%     \LUse \Soto\dotfill \cmd{\Soto}\\
%     \LUse \CapThis\Soto\dotfill \cmd{\CapThis}\cmd{\Soto}
%   \end{Block}
%
% \item Royal and Medieval Names: \hfill Section~\ref{sec:NameMedieval}
%   \begin{Block}
%     \FUse \ForgetThis\Aeth\footnote
%       {Regarding the margin note that shows name control sequences,
%        with \texttt{pdflatex} and \texttt{latex}, in
%        \texttt{\ShowPattern{Æthelred, II}} the glyphs \texttt{ÃĘ}
%        correspond to \cmd{\IeC\{}\cmd{\AE\}}.}\dotfill \cmd{\Aeth}\\
%     \LUse \Aeth\dotfill \cmd{\Aeth}\\
%     \LUse \LAeth[II, ``Unræd'']\dotfill |\LAeth[II, ``Unræd'']|
%   \end{Block}
%
%   \begin{Block}
%     \FUse \ForgetThis\Eriugena[Scotus Eriugena]\dotfill^^A
%       \cmd{\Eriugena[Scotus Eriugena]}\\
%     \LUse \LEriugena\dotfill \cmd{\LEriugena}\\
%     \LUse \Eriugena\dotfill \cmd{\Eriugena}
%   \end{Block}
%
%   \begin{Block}
%     \FUse \ForgetThis\Aris\dotfill \cmd{\Aris}\\
%     \LUse \Aris\dotfill \cmd{\Aris}
%   \end{Block}
% \end{itemize}
%
% \subsubsection[\protect\textit{Alternate} Field]
%   {\protect\meta{Alternate} Name Field Tips}
% \label{sec:ArgIV}
%
% Two shorthands above use \meta{arg4}, the final field in each row of the \texttt{nameauth} environment. These are \cmd{\CSL} and \cmd{\MSens}. They correspond to similar name shorthands \cmd{\Lewis} and \cmd{\Miyazaki}, which leave \meta{arg4} empty. Here is how they are related:
%
% \begin{itemize}
% \item They share identical name control patterns
%   (Section~\ref{sec:NamePatterns}).
% \BothInfo{\ShowPattern[Clive Staples]{Lewis}\break
%   \ShowPattern{Miyazaki, Hayao}}
% {\ShowIdxPageref*[Clive Staples]{Lewis}\break
%   \ShowIdxPageref*{Miyazaki, Hayao}}
%   \begin{Block}
%   \ForgetName{Miyazaki, Hayao}\ForgetName[Clive Staples]{Lewis}
%   \FUse \MSens\dotfill \cmd{\MSens}\\
%   \LUse \Miyazaki\dotfill \cmd{\Miyazaki}\\
%   \FUse \CSL\dotfill \cmd{\CSL}\\
%   \LUse \Lewis\dotfill \cmd{\Lewis}
%   \end{Block}
%
% \item Usually, one leaves \meta{arg4} empty and adds alternate names in
%   brackets as needed: \LLewis[C.S.] \cmd{\LLewis[C.S.]}
%
% \item By using \meta{arg4}, one trades less work for more ambiguity: Can
%   one add an alternate name or not? To answer that, one should keep track
%   of all name shorthands that use \meta{arg4}.
%
% \item Failure to keep track of such macros creates output like \LCSL[Jack]
%   \cmd{\LCSL[Jack]} and \LMSens[Sensei] \cmd{\LMSens[Sensei]}.
%   The reason why these macro versions produce undesired output is because
%   \meta{arg4} permanently populates \meta{Alternate}.
%
% \item Remember that \meta{arg4} can be used for the obsolete
%   syntax, as mentioned previously, but we do not cover that here.
% \end{itemize}
%
% \begin{Quote}{\Name[Harold]{Urey} (1961)}
% The space program is not only scientific in purpose but also is an expression of man's insistent determination to do the nearly impossible\,---\,to explore the unknown, even at great risk.\negmedskip^^A
% \index{scientists, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \subsection{Select Macro Overview}
% \label{sec:SelectOver}
%
% \subsubsection[With Name Args]{Macros with Name Arguments}
% \label{sec:NameArgMacros}
%
% All macros that take name arguments (Section~\ref{sec:NameArgs}) can have final optional arguments (Section~\ref{sec:FinalOptargs}) and update \cmd{\NameauthPattern} (Section~\ref{sec:DataTemp}). The \meta{xref args} are the same as \meta{name args} for a cross-reference to a \meta{target} (Section~\ref{sec:IndexRef}).
% \begin{center}
% \begin{tabular}{lrcll}\toprule
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill}}\qquad\qquad}^^A
%   Optional Prefix & Macro & Star & Arguments & \\
%
% \llap{\colorbox{white}{\hbox to 2.65cm{\strut\hfill Naming}}\qquad\qquad}^^A
%   \meta{prefix macros} &
%   \cmd{\Name} & \texttt{*} & \meta{name args} & \\
% \llap{\colorbox{white}{\hbox to 2.65cm{\strut\hfill}}\qquad\qquad}^^A
%   \meta{prefix macros} &
%   \cmd{\FName} & \texttt{*} & \meta{name args} & \\
%
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill Page entry}}\qquad\qquad}^^A
%   \cmd{\SeeAlso} & \cmd{\IndexName} & &
%   \meta{name args} & \\
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill Only cross-ref}}\qquad\qquad}^^A
%   \cmd{\SeeAlso} & \cmd{\IndexRef} & &
%   \meta{xref args} & \meta{target}\\
%
% \llap{\colorbox{white}{\hbox to 2.65cm{\strut\hfill Stop page entry}}\qquad\qquad}^^A
%   & \cmd{\ExcludeName} & &
%   \meta{name args} & \\
% \llap{\colorbox{white}{\hbox to 2.65cm{\strut\hfill Allow page entry}}\qquad\qquad}^^A
%   & \cmd{\IncludeName} &
%   \texttt{*} & \meta{name args} & \\
%
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill Sort index}}\qquad\qquad}^^A
%   & \cmd{\PretagName} & & \meta{name args} &
%   \meta{sort key} \\
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill Make index tag}}\qquad\qquad}^^A
%   & \cmd{\TagName} & & \meta{name args} &
%   \meta{tag} \\
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill Delete index tag}}\qquad\qquad}^^A
%   & \cmd{\UntagName} & & \meta{name args} & \\
%
% \llap{\colorbox{white}{\hbox to 2.65cm{\strut\hfill Make name tag}}\qquad\qquad}^^A
%   & \cmd{\NameAddInfo} & &
%   \meta{name args} & \meta{tag} \\
% \llap{\colorbox{white}{\hbox to 2.65cm{\strut\hfill Show name tag}}\qquad\qquad}^^A
%   & \cmd{\NameQueryInfo} & &
%   \meta{name args} & \\
% \llap{\colorbox{white}{\hbox to 2.65cm{\strut\hfill Delete name tag}}\qquad\qquad}^^A
%   & \cmd{\NameClearInfo} & &
%   \meta{name args} & \\
%
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill Delete name cs}}\qquad\qquad}^^A
%   & \cmd{\ForgetName} & & \meta{name args} & \\
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill Create name cs}}\qquad\qquad}^^A
%   & \cmd{\SubvertName} & &
%   \meta{name args} & \\
%
% \llap{\colorbox{white}{\hbox to 2.65cm{\strut\hfill Name cs tests}}\qquad\qquad}^^A
%   & \cmd{\IfMainName} & &
%   \meta{name args} & \marg{y}\marg{n}\\
% \llap{\colorbox{white}{\hbox to 2.65cm{\strut\hfill}}\qquad\qquad}^^A
%   & \cmd{\IfFrontName} & & \meta{name args} &
%   \marg{y}\marg{n}\\
% \llap{\colorbox{white}{\hbox to 2.65cm{\strut\hfill}}\qquad\qquad}^^A
%   & \cmd{\IfAKA} & & \meta{name args} & \marg{y}\marg{n}\marg{x}\\
%
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill Debugging}}\qquad\qquad}^^A
%   & \cmd{\ShowPattern} & & \meta{name args} & \\
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill}}\qquad\qquad}^^A
%   & \cmd{\ShowIdxPageref} & \texttt{*} & \meta{name args} & \\
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill}}\qquad\qquad}^^A
%   & \cmd{\ShowNameInfo} & & \meta{name args} & \\
% \rowcolor{nagrey}^^A
% \llap{\colorbox{nagrey}{\hbox to 2.65cm{\strut\hfill}}\qquad\qquad}^^A
%   & \cmd{\ShowNameState} & & \meta{name args} &\\\bottomrule
% \end{tabular}
% \end{center}
%
% Optional prefix macros are shown in the next subsection. Not shown above are \cmd{\AKA}, \cmd{\AKA*}, \cmd{\PName}, and \cmd{\PName*} (Section~\ref{sec:AKA}).
%
% \begin{Quote}{\Name[John F.]{Kennedy}, Inaugural Address (1961)}
% The world is very different now. For man holds in his mortal hands the power to abolish all forms of human poverty and all forms of human life. And yet the same revolutionary beliefs for which our forebears fought are still at issue around the globe\,---\,the belief that the rights of man come not from the generosity of the state, but from the hand of God.^^A
% \index{politicians, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \subsubsection{Prefix Macros}
%
% Similar to the package options (Section~\ref{sec:PkgOptions}), many prefix macros alter the values of the Boolean flags that reflect the state of names and name processing. The naming and indexing macros reset the Boolean flags after they are invoked.
%
% \begin{itemize}[rightmargin=0em]
% \item Capitalization in the Text\negmedskip
% \begin{itemize}[leftmargin=6.5em]\small
% \item[\cmd{\CapName}] Capitalize entire \meta{SNN}. Overrides \cmd{\CapThis}.
% \item[\cmd{\CapThis}] Capitalize first letter of all name components.
% \item[\cmd{\AccentCapThis}] Fallback when Unicode detection cannot be done.
% \end{itemize}
%
% \item Reversing in the Text\negmedskip
% \begin{itemize}[leftmargin=6.5em]\small
% \item[\cmd{\RevName}] Reverse order of any name. Overrides \cmd{\RevComma}
% \item[\cmd{\RevComma}] Reverse only Western names to \meta{SNN}, \meta{FNN}.
% \end{itemize}
%
% \item Commas in the Text\negmedskip
% \begin{itemize}[leftmargin=6.5em]\small
% \item[\cmd{\ShowComma}] Add comma between \meta{SNN} and \meta{Affix}.
% \item[\cmd{\NoComma}] No comma between \meta{SNN} and \meta{Affix}. Overrides \cmd{\ShowComma}.
% \end{itemize}
%
% \item Name Breaks in the Text\negmedskip
% \begin{itemize}[leftmargin=6.5em]\small
% \item[\cmd{\DropAffix}] Drop affix only for a long Western name instance.
% \item[\cmd{\KeepAffix}] Insert non-breaking space (NBSP) between \meta{SNN}, \meta{FNN/Affix}.
% \item[\cmd{\KeepName}] Insert NBSP between all name elements. Overrides \cmd{\KeepAffix}.
% \end{itemize}
%
% \item Forcing Name Forms via Control Sequence\negmedskip
% \begin{itemize}[leftmargin=6.5em]\small
% \item[\cmd{\ForgetThis}] Force first name instance. Negates \cmd{\SubvertThis}.
% \item[\cmd{\SubvertThis}] Force subsequent name instance.
% \end{itemize}
%
% \item Forcing Name Forms via Boolean Flags\negmedskip
% \begin{itemize}[leftmargin=6.5em]\small
% \item[\cmd{\ForceName}] Force first-use formatting hooks.
% \item[\cmd{\ForceFN}] Print \meta{Affix}/\meta{Alternate} in nonwestern short forms.
% \end{itemize}
%
% \item Indexing\negmedskip
% \begin{itemize}[leftmargin=6.5em]\small
% \item[\cmd{\SeeAlso}] For \cmd{\IndexName}, \cmd{\AKA}, and \cmd{\PName}; make a \textit{see also} xref.
% \item[\cmd{\SkipIndex}] For naming macros; do not create index entry (once).
% \item[\cmd{\JustIndex}] For naming macros; index only (once); negated by \cmd{\AKA}, \cmd{\PName}.
% \end{itemize}
% \end{itemize}
%
% \noindent Some important notes include:
%
% \begin{itemize}
% \item Prefix macros stack:\\[0.4ex]
%   \CapThis\RevName\SkipIndex\Name[bar]{foo}\dotfill^^A
%   |\CapThis\RevName\SkipIndex\Name[bar]{foo}|
% \item The Boolean flags governed by the prefix macros are reverted after
%   the appropriate macros produce output in the text (or index) unless the
%   output of the naming macros is suppressed via \cmd{\JustIndex}.
% \item Even after using \cmd{\JustIndex}, several name form modifiers are reset.
%   This prevents errors when handling the next name.
% \item Except for \cmd{\SeeAlso}, use prefix macros only before a naming
%   macro that is designed to print output in the text.
% \item Use \cmd{\SeeAlso} only with \cmd{\IndexRef}, \cmd{\AKA}, and
%   \cmd{\PName}. Otherwise it will be ignored and reset by \cmd{\IndexName}
%   and the naming macros.
% \end{itemize}
%
% \noindent Macros that do not take name arguments include prefix macros (Section~\ref{sec:PrefixMacs}), helper macros (Section~\ref{sec:Helpers}), most internal package macros, and formatting macros (Sections~\ref{sec:Formatting} and~\ref{sec:AdvancedFormat}).
%
% \newpage
%
% \subsection{Names and Complexity}
% \label{sec:Complexity}
%
% The \textsf{nameauth} package allows levels of complexity when representing names. Already, we have seen this example above:
%
% \begin{Block}
%   \LEliz[I ``Gloriana'']\dotfill |\LEliz[I ``Gloriana'']|
% \end{Block}
%
% We can display the same thing with different macros. This next example does not offer more features; it only offers more complexity:
%
% \begin{Block}
%   \LEliz\ ``\ForceFN\SEliz[Gloriana]''\dotfill^^A
%   |\LEliz\ ``\ForceFN\SEliz[Gloriana]''|
% \end{Block}
%
% The next example offers more features and better automation. Based on Section~\ref{sec:NameAncient} we use name tags and change the formatting hooks to match this manual's conventions. The key here is that \emph{we make a few key changes once,} which then govern many appearances of names:
%
% \begingroup
% \begin{quote}
% \begin{Verbatim}
% \NameAddInfo{Elizabeth, I}{ ``Gloriana''}
% \renewcommand*\NamesFormat[1]
% {
%   \color{blue}\sffamily #1
%   \ifcsname\NameauthPattern!DB\endcsname
%     \expandafter\csname\NameauthPattern!DB\endcsname
%   \fi
% }
% \renewcommand*\MainNameHook{\sffamily}
% \end{Verbatim}
% \end{quote}
%
% \NameAddInfo{Elizabeth, I}{ ``Gloriana''}
% \renewcommand*\NamesFormat[1]
% {^^A
%   \color{blue}\sffamily #1^^A
%   \ifcsname\NameauthPattern!DB\endcsname
%     \expandafter\csname\NameauthPattern!DB\endcsname^^A
%   \fi
% }
% \renewcommand*\MainNameHook{\sffamily}
% \begin{Block}
%   \FUse \ForgetThis\LEliz\dotfill |\ForgetThis\LEliz|\\
%   \LUse \LEliz\dotfill |\LEliz|\\
%   \LUse \Eliz\dotfill |\Eliz|
% \end{Block}
% \endgroup
%
% Section~\ref{sec:NameParticles} shows a similar trade-off between simplicity and automation with an example using the name of poet \Name[e.e.]{cummings}. Moving on to Section~\ref{sec:Romani}, complexity increases, yet the state of any given name remains well-defined.
%
% \begin{InfoBox}[Avoid the Rabbit Hole]
% \begin{itemize}[leftmargin=1em]
% \item In \textsf{nameauth}, names are nouns that have state and modifiers.
% \item In \textsf{nameauth}, names are verbs capable of changing their environment.
% \item There are trade-offs between ease of use and automation.
% \item Simple examples often are not easy to automate.
% \item Automation works best with a few key changes.
% \item Most use-cases can be as simple as Section~\ref{sec:QuickExample}.
% \item Use the simple approach unless a complex approach is needed.
% \end{itemize}
% \end{InfoBox}
%
% \ReturnLink
%
% \newpage
%
% \section{Package Options}
% \label{sec:PkgOptions}
%
% There are many options for use in \textsf{nameauth}, which can be divided into specific areas of functionality. These range from defaults that make conforming to certain standards easier to backward compatibility with old versions. The expected syntax follows:
%
% \begin{SyntaxBox}
%   \cmd{\usepackage[}\meta{\(option_1\)}\texttt{,}\meta{\(option_2\)}^^A
%   \texttt{,}\dots\texttt{,}\meta{\(option_n\)}\texttt{]\{nameauth\}}
% \end{SyntaxBox}
%
% We discuss package options according to the structure of this package. That structure repeats among the Boolean flags, package options, user interface macros, and internal macros. The goal is understanding through repetition.
%
% Section~\ref{sec:Priorities} shows the hierarchy of these options and related macros. Default options are in \emph{boldface} and need not be invoked by the user. Non-default options are in \emph{\color{nared} dark red} and must be invoked explicitly. Many of these options work together with macros that do the same thing, but with finer control.
%
% \subsection{Name Grammar and Syntax}
%
% \subsubsection[Affix Commas]{Show/Hide Affix Commas}
%
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{nocomma} &
%   \bfseries Modern standards: Suppress commas between surnames and
%   affixes.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{comma} &
%   \leavevmode\color{nared}Older standards: Retain commas between surnames
%   and affixes.\medskip\\
% \end{tabular}
%
% \noindent These options do not affect the index. They permit different standards for name affixes. The default \texttt{nocomma} option gives, e.g., \Name[J.E.]{Carter, Jr.}[James Earl]. The \texttt{comma} option produces \ShowComma\Name*[J.E.]{Carter, Jr.}[James Earl]. Macros that allow finer control of commas and affixes are shown in Section~\ref{sec:Affix}.
%
% \subsubsection[Surname in Caps]{Capitalize Entire Surnames}
%
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{normalcaps} &
%   \bfseries Do not perform any special capitalization.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{allcaps} &
%   \leavevmode\color{nared}\textls[-5]{Capitalize entire surnames, e.g., Romanized
%   Eastern names, throughout the document.}\medskip\\
% \end{tabular}
%
% \noindent These options do not affect the index. See Section~\ref{sec:Eastern} for finer control. To capitalize names in the index, use caps as desired or alternate formatting (Section~\ref{sec:AltFormat}).
%
% \subsubsection{Reverse Name Order}
%
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{notreversed} &
%   \bfseries Print names in the order specified by \cmd{\Name}
%   and the other macros.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{allreversed} &
%   \leavevmode\color{nared}Print all name forms in ``smart'' reverse order;
%   Western as nonwestern, and vice versa.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{allrevcomma} &
%   \leavevmode\color{nared}Print all names in ``Surname, Forenames'' order,
%   meant for Western names.\medskip\\
% \end{tabular}
%
% \noindent These options do not affect the index and are mutually exclusive (Sections~\ref{sec:RevNames} and~\ref{sec:LastFirst}). Use \texttt{allrevcomma} option only for listing Western names by surname.
%
% \subsection{Indexing}
%
% \subsubsection{Toggle Indexing}
%
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{index} &
%   \bfseries Create index entries in place with names.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{noindex} &
%   \leavevmode\color{nared}Suppress indexing of names.\medskip\\
% \end{tabular}
%
%^^A Starting with the text below, any errors will force one to remove all
%^^A auxiliary files before compiling this file. There is no clear indication
%^^A of why that happens to be the case.
%
% \noindent
% These options and related macros apply only to the \textsf{nameauth} package macros. The default \texttt{index} option enables name indexing right away. The \texttt{noindex} option disables the indexing of names until \cmd{\IndexActive} enables it. \emph{Caution:}\Warn{} using \texttt{noindex} and \cmd{\IndexInactive} prevents index tags until you call \cmd{\IndexActive}, as explained in Section~\ref{sec:GeneralIndex}. For indexing feature priority, see Section~\ref{sec:Priorities}.
%
% \subsubsection{Toggle Index Sorting}
%
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{pretag} &
%   \bfseries Create sort keys used with \texttt{makeindex}.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{nopretag} &
%   \leavevmode\color{nared}Do not create sort keys.\medskip\\
% \end{tabular}
%
% \noindent The default allows \cmd{\PretagName} to create sort keys used with \texttt{makeindex}. The \texttt{nopretag} option disables the sorting mechanism and causes \cmd{\PretagName} only to emit warnings, as might be needed with, e.g., \texttt{xindy}. See Section~\ref{sec:IndexSort}.
%
% \subsubsection{Verbose Warnings}
%
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \leavevmode\color{nared}\quad\texttt{verbose} &
%   \leavevmode\color{nared}Show more diagnostic warnings.\medskip\\
% \end{tabular}
%
% \noindent The default suppresses all but the most essential package warnings. Increasing the warnings may help to debug index page entries, cross-references, and exclusions. Section~\ref{sec:GeneralIndex} shows macros that can enable and disable verbose warnings.
%
% \addtocontents{toc}{\protect\goodbreak}
%
% \subsection[Formatting]{Formatting and Name Control Sequences}
%
% Formatting, which, in its simplest form is typographic post-processing of a name, and in its complex forms can affect the syntactic form of a name, refers to the appearance of a name in the body text.
%
% \subsubsection[Choose System]{Choose Formatting System}
%
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \bfseries\quad\texttt{mainmatter} &
%   \bfseries Start with ``main-matter names'' and formatting hooks \normalfont
%   (Section~\ref{sec:PostProcess}).\smallskip\\
% \leavevmode\color{nared}\quad\texttt{frontmatter} &
%   \leavevmode\color{nared}Start with ``front-matter names'' and hooks until
%   \cmd{\NamesActive} starts the main system.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{alwaysformat} &
%   \leavevmode\color{nared}Use only respective ``first use'' formatting
%   hooks.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{formatAKA} &
%   \leavevmode\color{nared}Format the first use of a name with \cmd{\AKA} like
%   the first use of a name with \cmd{\Name}.\medskip\\
% \end{tabular}
%
% \noindent The \texttt{mainmatter} and \texttt{frontmatter} options enable two respectively independent systems of name use and formatting. Even when no extra formatting occurs, the formatting hooks are defined. Changes require \cmd{\renewcommand}. See Section~\ref{sec:Formatting}.
%
% The \texttt{alwaysformat} option forces ``first use'' hooks globally in both naming systems. Its use is limited in current versions of \textsf{nameauth}.
%
% The \texttt{formatAKA} option permits \cmd{\AKA} to use the ``first use'' formatting hooks. This enables \cmd{\ForceName} to trigger those hooks at will (Section~\ref{sec:AKA}). Otherwise \cmd{\AKA} only uses ``subsequent use'' formatting hooks.
%
% \subsubsection[Predefined Hooks]{Predefined Formatting Hooks}
% \label{sec:PostProcess}
%
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{noformat} &
%   \bfseries Pass the displayed name through the formatting hooks
%   unchanged.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{smallcaps} &
%   \leavevmode\color{nared}First use of a main-matter name in small
%   caps.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{italic} &
%   \leavevmode\color{nared}First use of a main-matter name in
%   italic.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{boldface} &
%   \leavevmode\color{nared}First use of a main-matter name in
%   boldface.\medskip\\
% \end{tabular}
%
% \noindent The options above are ``quick'' definitions of \cmd{\NamesFormat} based on English typography. The default is no formatting.\footnote{For the old default, use the \texttt{smallcaps} option. User feedback dictated this change.}
% See also Robert Bringhurst, \textit{The Elements of Typographic Style}, version 3.2 (Point Roberts, Washington: Hartley \& Marks, 2008), 53--60. All references [\hypertarget{Bringhurst}{Bringhurst}] refer to this edition.
%
% The following macros govern the way that names in the text appear. Two naming systems are used in \textsf{nameauth}, one for main-matter text (default) and one for front-matter text.\footnote{\cmd{\NamesFormat} was once the only formatting hook. The other macros developed from there. Regrettably, this package originated in a time when the present author was ignorant of several cultural and technical aspects of handling names. The ``learn as you go'' approach contributed to a fair bit of ``cargo-cult'' programming.}
% These hooks do not affect the index. Changes to the formatting hooks normally apply within the scope where they occur:
%
% \begin{itemize}
% \item \cmd{\NamesFormat} formats first uses of main-matter names.
% \item \cmd{\MainNameHook} formats subsequent uses of main-matter names.
% \item \cmd{\FrontNamesFormat} formats first uses of front-matter names.
% \item \cmd{\FrontNameHook} formats subsequent uses of front-matter names.
% \end{itemize}
%
% Sections \ref{sec:Formatting}, \ref{sec:AdvancedFormat}, and~\ref{sec:AdvCustomize} explain these hooks and their redefinition in greater detail. Section~\ref{sec:AKA} discusses how \cmd{\AKA} does not respect these formatting systems.
%
% \subsection{Alternate Formatting}
%
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \leavevmode\color{nared}\quad\texttt{altformat} &
%   \leavevmode\color{nared}Make available the alternate formatting framework
%   from the start of the document. Activate alternate formatting by
%   default.\medskip\\
% \end{tabular}
%
% \noindent A built-in framework provides an alternate formatting mechanism that can be used for ``Continental'' formatting that one sees in German, French, and so on. Continental standards often format surnames only, both in the text and in the index. Section~\ref{sec:AltFormat} introduces the topic and should be sufficient for most users, while Section~\ref{sec:AdvCustomize} goes into greater detail for customization.
%
% Previous methods that produced Continental formatting were more complex than the current ones. Yet these older solutions still should work, as long as one uses the \texttt{altformat} option and related macros.
%
% \subsection[Scope of Decisions]{Change Scope of Name Decision Macros}
%
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \leavevmode\color{nared}\quad\texttt{globaltest} &
%   \leavevmode\color{nared}Do not put name decision paths in a local
%   scope.\medskip\\
% \end{tabular}
%
% \noindent The default puts the decision paths of \cmd{\IfMainName}, etc., into groups with local scope (Section~\ref{sec:NameTests}). This option removes that scoping.
%
% \subsection{Version Compatibility}
% \label{sec:OptionCompat}
%
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \leavevmode\color{nared}\quad\texttt{oldAKA} &
%   \leavevmode\color{nared}Force \cmd{\AKA*} to act like it did before version
%   3.0, instead of like \cmd{\FName}.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{oldreset} &
%   \leavevmode\color{nared}Reset per-use name flags locally; let
%   \cmd{\ForgetThis} and \cmd{\SubvertThis} pass through \cmd{\AKA} (pre-v3.3).
%   Let \cmd{\SeeAlso} pass through \cmd{\IndexName} and other macros.
%   Keep \cmd{\IndexName} and \cmd{\IndexRef} from resetting \cmd{\SkipIndex}
%   (pre-version 3.5).\smallskip\\
% \leavevmode\color{nared}\quad\texttt{oldpass} &
%   \leavevmode\color{nared}When \cmd{\Justindex} is called, allow long or short
%   Boolean flags to pass through, as they did before version 3.3.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{oldtoks} &
%   \leavevmode\color{nared}Token registers holding the arguments of the
%   last-used name are set locally, as before version 3.5.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{oldsee} &
%   \leavevmode\color{nared}Allow lax handling of \textit{see} references that
%   are extant names, as before version 3.5.\smallskip\\
% \leavevmode\color{nared}\quad\texttt{oldargs} &
%   \leavevmode\color{nared}Load the \textsf{xargs} and \textsf{suffix}
%   packages in order to permit user-supplied modifications to work as
%   in version 3.7 and before. The package macros will still use
%   \textsf{xparse} because of its advantages.\medskip\\
% \end{tabular}
%
% Using these options may increase the chance of undocumented behavior.\footnote{Previously, the prefix macros and mechanisms for long and short names used Boolean flags locally. With continued use of this package, it became clear that such local scope could produce unexpected results. Those results, in turn, could mask problems caused by some flags not being reset by \cmd{\AKA}, \cmd{\AKA*}, and \cmd{\JustIndex}. The result was undocumented behavior.}
% They are included for the sake of approximate backward compatibility with older documents, illustrated by the following table:
%
% \begin{center}
% \begin{tabular}{lll}\toprule
%   \rowcolor{nagrey}^^A
%   \bfseries Version & \bfseries Needed Options & \bfseries Possible Options \\
%
%   2.6      & \ttfamily oldreset,oldtoks,oldsee, & \ttfamily oldargs \\
%            & \ttfamily oldAKA,oldpass & \\
%
%   \rowcolor{nagrey}^^A
%   3.0--3.2 & \ttfamily oldreset,oldtoks,oldsee, & \ttfamily oldargs \\
%   \rowcolor{nagrey}^^A
%            & \ttfamily oldpass & \\
%
%   3.3--3.4 & \ttfamily oldreset,oldtoks,oldsee & \ttfamily oldargs \\
%
%   \rowcolor{nagrey}^^A
%   3.5--3.7 & \ttfamily & \ttfamily oldargs \\\bottomrule
% \end{tabular}
% \end{center}
%
% \ReturnLink
%
% \begin{Quote}{\ForgetThis\MLK[Dr. Martin Luther], \textit{Stride Towards Freedom} (1958)}
% \IndexName{Jesus, Christ}^^A
% We believe firmly in the revelation of God in Jesus Christ. I can see no conflict between our devotion to Jesus Christ and our present action. In fact, I can see a necessary relationship. If one is truly devoted to the religion of Jesus he will seek to rid the earth of social evils. The gospel is social as well as personal.^^A
% \index{civil rights leaders, quotes of\noexpand\string|hyperpage}^^A
% \index{theologians, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \section{Feature Priority}
% \label{sec:Priorities}
%
% \begin{center}
% \begin{tabular}{llll}\toprule
%   \bfseries Indexing & \bfseries Capitalization &
%   \bfseries Reversing & \bfseries Name Forms,\\
%   & & & \bfseries Commas, Breaks\\\midrule
%
%   \ttfamily\bfseries index & \ttfamily\bfseries normalcaps &
%   \ttfamily\bfseries notreversed & \cmd{\ForgetThis}\\
%   \ttfamily\bfseries noindex & \ttfamily\bfseries allcaps &
%   \ttfamily\bfseries allreversed & \cmd{\DropAffix}\\
%   \cmd{\IndexActive} & \cmd{\AllCapsInactive} & \cmd{\ReverseActive}\\
%   \cmd{\IndexInactive} & \cmd{\AllCapsActive} & \cmd{\ReverseInactive}\\[1ex]
%
%   \rowcolor{black!6!white}
%     \cmd{\JustIndex} & \cmd{\CapName} & \cmd{\RevName} & \cmd{\SubvertThis}\\
%   \rowcolor{black!6!white}
%     & & & \cmd{\ForceName}\\
%   \rowcolor{black!6!white}
%     & & & \cmd{\NoComma}\\[1ex]
%
%   \rowcolor{black!12!white}
%     \cmd{\SkipIndex} & \cmd{\AccentCapThis} &
%     \ttfamily\bfseries allrevcomma & \cmd{\KeepName}\\
%   \rowcolor{black!12!white}
%     & & \cmd{\RevCommaActive} & \cmd{\ForceFN}\\
%   \rowcolor{black!12!white}
%     & & \cmd{\RevCommaInactive} & \cmd{\ShowComma}\\[1ex]
%
%   \rowcolor{black!18!white}
%     \cmd{\SeeAlso} & \cmd{\CapThis} & \cmd{\RevComma} &
%     \cmd{\KeepAffix}\\\bottomrule
% \end{tabular}
% \end{center}
%
% Above we see the relative priority of package options and their related macros. Package options are shown in boldface.
%
% \begin{itemize}
% \item Lighter-colored rows show higher priority. Darker-colored rows show
%   lower priority. Higher-priority options and macros have the ability to override
%   lower-priority ones.
% \item All options and macros in a given row have equal priority and are
%   able to countermand each other within a given column.
% \item Priority affects macros and options within columns.
%   \cmd{\IndexInactive} overrides \cmd{\JustIndex}, which overrides
%   \cmd{\SkipIndex}. If \cmd{\IndexInactive} is invoked, \cmd{\JustIndex}
%   will have no effect.
% \item Section~\ref{sec:IdxPrefix} shows the complex interaction between
%   \cmd{\SkipIndex} and \cmd{\JustIndex}. It it is best to use \cmd{\SkipIndex}
%   and \cmd{\JustIndex} only before a naming macro that can print to the text.
% \item Priority usually does not affect macros and options in different
%   columns. Yet the macros themselves can have specific effects that change
%   the expected behavior of macros in other columns.
%
%   For example, \cmd{\JustIndex} prevents a name from being displayed in
%   the text. Even if \cmd{\IndexInactive} overrides \cmd{\JustIndex} with
%   respect to indexing, it has no effect on the fact that the name will not
%   be printed.
%
%   Also, \cmd{\JustIndex} resets the effects of \cmd{\ForgetThis} and
%   \cmd{\SubvertThis} because those prefix macros should precede only naming
%   macros that produce output in the text.
%
%   Due to this behavior, even though \cmd{\JustIndex} does not ``override''
%   the caps and reversing macros and options, nevertheless it simply prevents
%   any other macros related to the display of a name from taking effect.
% \end{itemize}
%
% \ReturnLink
%
% \newpage
%
% \section{Naming Macros}
%
% This section is a ``pedantic'' presentation of macros, their syntax, and their output. Section~\ref{sec:BasicStart} is better for getting started. All naming macros that have the same arguments also create consistent index entries. These entries are created both at the start and at the end of a name, in case that name spans a page break.
%
% \subsection{\texttt{\textbackslash Name} and \texttt{\textbackslash Name*}}
% \label{sec:Naming}
%
% \DescribeMacro{\Name}
% \cmd{\Name} displays and indexes names. It always prints the \meta{SNN} argument. \cmd{\Name} prints the full name at the first occurrence,
% \DescribeMacro{\Name*}
% then usually just the \meta{SNN} argument thereafter. \cmd{\Name*} always prints the full name:
%
% \begin{SyntaxBox}
%     \cmd{\Name\ }\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}\\
%     \cmd{\Name*}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% In the body text, not the index, the \meta{Alternate} argument replaces either \meta{FNN} or, if \meta{FNN} is absent, \meta{Affix}. If both \meta{FNN} and \meta{Affix} are absent when \meta{Alternate} is present, then the obsolete syntax is used (Section~\ref{sec:Obsolete}, not shown below).
%
% \begin{quote}
% \begin{Verbatim}
% \begin{nameauth}
%   \< Einstein  & Albert & Einstein        & >
%   \< Carter    & J.E.   & Carter, Jr.     & >
%   \< Confucius &        & Confucius       & >
%   \< Miyazaki  &        & Miyazaki, Hayao & >
%   \< Eliz      &        & Elizabeth, I    & >
% \end{nameauth}
% \end{Verbatim}
% \end{quote}
%
% \ForgetName[Albert]{Einstein}\ForgetName[J.E.]{Carter, Jr.}
% \begin{center}
% \vspace{3ex}
% \BothInfo{\ShowPattern[Albert]{Einstein}\break
%   \ShowPattern[J.E.]{Carter, Jr.}\break
%   \ShowPattern{Confucius}\break
%   \ShowPattern{Miyazaki, Hayao}\break
%   \ShowPattern{Elizabeth, I}}
% {\ShowIdxPageref*[Albert]{Einstein}\break
%   \ShowIdxPageref*[J.E.]{Carter, Jr.}\break
%   \ShowIdxPageref*{Confucius}\break
%   \ShowIdxPageref*{Miyazaki, Hayao}\break
%   \ShowIdxPageref*{Elizabeth, I}}
% \vspace{-3ex}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
% \Name [Albert]{Einstein} & |\Name [Albert]{Einstein}| or |\Einstein|\\
% \rowcolor{nagrey}^^A
% \LEinstein & |\Name*[Albert]{Einstein}| or |\LEinstein|\\
% \rowcolor{nagrey}^^A
% \Einstein & |\Name [Albert]{Einstein}| or |\Einstein|\\
%
% \Name [J.E.]{Carter, Jr.} & |\Name [J.E.]{Carter, Jr.}| or |\Carter|\\
% \LCarter[James Earl] & |\Name*[J.E.]{Carter, Jr.}[James Earl]|\\
% &  or |\LCarter[James Earl]|\\
% \Carter & |\Name [J.E.]{Carter, Jr.}| or |\Carter|\\
%
% \rowcolor{nagrey}^^A
% \Confucius & |\Name {Confucius}| or |\Confucius|\\
% \rowcolor{nagrey}^^A
% \Confucius & |\Name {Confucius}| or |\Confucius|\\
%
% \ForgetThis\Name {Miyazaki, Hayao} &
% |\Name {Miyazaki, Hayao}| or |\Miyazaki|\\
% \Name*{Miyazaki, Hayao}[Sensei] & |\Name*{Miyazaki, Hayao}[Sensei]|\\
% \Name {Miyazaki, Hayao} & |\Name {Miyazaki, Hayao}| or |\Miyazaki|\\
%
% \rowcolor{nagrey}^^A
% \ForgetThis\Eliz & |\Name {Elizabeth, I}| or |\Eliz|\\
% \rowcolor{nagrey}^^A
% \Name*{Elizabeth, I} & |\Name*{Elizabeth, I}| or |\LEliz|\\
% \rowcolor{nagrey}^^A
% \Name {Elizabeth, I} & |\Name {Elizabeth, I}| or |\Eliz|\\\bottomrule
% \end{tabular}
% \end{center}
%
% With the quick interface, the best way to get alternate names follows patterns like ``\LCarter[James Earl]'' |\LCarter[James Earl]|  and ``\LMiyazaki[Sensei]'' |\LMiyazaki[Sensei]|. The alternate forename is not shown in subsequent short name instances e.g., ``\Carter[James Earl]'' |\Carter[James Earl]|. Thus, one must use either long-name instances or forename instances to see the alternate names.
%
% \newpage
%
% \subsection{Forenames: \texttt{\textbackslash FName}}
% \label{sec:FName}
%
% \DescribeMacro{\FName}
% \cmd{\FName} and its synonym \cmd{\FName*} print personal names only in subsequent name uses.
% \DescribeMacro{\FName*}
% That means when a name control sequence does not exist, they print long name forms because it is a first use of a name.
%
% Unlike all other starred forms of macros in \textsf{nameauth}, these macros are synonyms because one might edit either \cmd{\Name} or \cmd{\Name*} by adding an \texttt{F} to create a short name instead of the usual forms. This was implemented before the quick interface.
%
% \begin{SyntaxBox}
%     \cmd{\FName\ }\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}\\
%     \cmd{\FName*}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% These forename instance macros will permit all name types, but the normal behavior prints forenames only with Western names. With nonwestern names only \meta{SNN} is printed. This is designed to prevent Western writers from causing unintended offense in Eastern contexts. It also prevents the display of nonsense names in the context of ancient and royal names.
%
% \DescribeMacro{\ForceFN}
% To get an Eastern personal name or any affixed components of an ancient name, or to get \meta{Alternate} to display in their place, one must precede these macros with \cmd{\ForceFN}. See also Section~\ref{sec:NameMedieval} for more uses of \cmd{\ForceFN}.
%
% \begin{center}
% \vspace{3ex}
% \PatInfo{\ShowPattern[Albert]{Einstein}\break
%   \ShowPattern[J.E.]{Carter, Jr.}\break
%   \ShowPattern{Confucius}\break
%   \ShowPattern{Miyazaki, Hayao}\break
%   \ShowPattern{Elizabeth, I}}
% \vspace{-3ex}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
% \SEinstein & |\FName[Albert]{Einstein}| or |\SEinstein|\\
%
% \SCarter[Jimmy] & |\FName[J.E.]{Carter, Jr.}[Jimmy]|\\
% & or |\SCarter[Jimmy]|\\
%
% \rowcolor{nagrey}^^A
% \FName{Confucius} & |\FName{Confucius}|  or |\SConfucius |\\
%
% \FName{Miyazaki, Hayao} & |\FName{Miyazaki, Hayao}| or |\SMiyazaki|\\
%
% \rowcolor{nagrey}^^A
% \ForceFN\FName{Miyazaki, Hayao} & |\ForceFN\FName{Miyazaki, Hayao}|\\
% \rowcolor{nagrey}^^A
% & or |\ForceFN\SMiyazaki|\\
%
% \ForceFN\FName{Miyazaki, Hayao}[Sensei] &
% |\ForceFN\FName{Miyazaki, Hayao}[Sensei]|\\
% & or |\ForceFN\SMiyazaki[Sensei]|\\
%
% \rowcolor{nagrey}^^A
% \SEliz & |\FName{Elizabeth, I}| or |\SEliz|\\
% \ForceFN\SEliz[Good Queen Bess] &
% |\ForceFN\SEliz[Good Queen Bess]|\\\bottomrule
% \end{tabular}
% \end{center}
%
% The \meta{Alternate} argument replaces forenames in the text, which strongly shapes the use of \cmd{\FName}. We already have covered the use of \meta{Arg4} of the \texttt{nameauth} environment in Section~\ref{sec:ArgIV}. Please refer to that material when using \meta{Alternate}, especially with the quick interface.
%
% \begin{Quote}{\Name[Dwight D.]{Eisenhower}\break
% \hbox{}\hfill Associated Press luncheon (24 April 1950)}
% Censorship, in my opinion, is a stupid and shallow way of approaching the solution to any problem. Though sometimes necessary, as witness a professional and technical secret that may have a bearing upon the welfare and very safety of this country, we should be very careful in the way we apply it, because in censorship always lurks the very great danger of working to the disadvantage of the American nation.\negmedskip^^A
% \index{politicians, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \subsection{Technical Details}
% \label{sec:TechDetails}
%
% \subsubsection[Final Optargs]{Final Optional Arguments}
% \label{sec:FinalOptargs}
%
% Macros that take name arguments (see also Section~\ref{sec:NameArgMacros}) sometimes use a final optional argument. Using these arguments with the current syntax gives:
%
% \begin{center}\IndexInactive\footnotesize
%   \renewcommand\NamesFormat{}
%   \renewcommand\MainNameHook{}
%   \begin{tabular}{l@{\ }l@{\ }l}\toprule
%     \rowcolor{nagrey}\bfseries Printed Name &
%       \bfseries Macro and Arguments & \bfseries Western Index Entry\\
%     \ForgetThis\Name[Person]{Family, Affix}[Alias] & |\Name[Person]{Family, Affix}[Alias]| &
%       \ShowIdxPageref*[Person]{Family, Affix}\\
%     \ForgetThis\Name[Person]{Family}[Alias] & |\Name[Person]{Family}[Alias]| &
%       \ShowIdxPageref*[Person]{Family}\\
%     \RevName\Name*[Person]{Family}[Alias] & |\RevName%| &
%       \ShowIdxPageref*[Person]{Family}\\
%     & |\Name[Person]{Family}[Alias]|\\\midrule
%     \rowcolor{nagrey}\bfseries Printed Name &
%       \bfseries Macro and Arguments & \bfseries Nonwestern Index Entry\\
%     \ForgetThis\Name{Family, Person}[Alias] & |\Name{Family, Person}[Alias]| &
%       \ShowIdxPageref*{Family, Person}\\
%     \RevName\Name*{Family, Person}[Alias] & |\RevName%| &
%       \ShowIdxPageref*{Family, Person}\\
%     & |\Name{Family, Person}[Alias]|\\
%     \ForgetThis\Name{Person, Affix}[Alias] & |\Name{Person, Affix}[Alias]| &
%       \ShowIdxPageref*{Person, Affix}\\\bottomrule
%   \end{tabular}\IndexActive
% \end{center}
%
% Since May 2018, \textsf{xparse} offers two approaches that have their own pros and cons. Below \cmd{\Namei} works the same as \textsf{nameauth}. \cmd{\Nameii} takes the alternate route. If one builds this package with a \LaTeX\ distro from before 2018, \cmd{\Nameii} will not appear, and \cmd{\Namei} will work like \cmd{\Nameii} in newer versions. It was for the sake of stability and consistency that \textsf{nameauth} used \textsf{xargs} and \textsf{suffix} in its early days. Now that all the issues with \textsf{xparse} have been addressed, the latter is the best choice going forward.
%
% \begin{quote}
% \begin{Verbatim}
% \NewDocumentCommand {\Namei}{O{} m  O{}}
%   {\def\Opt{#3}\ifx\Opt\empty #1\ #2\else \Opt\ #2\fi}
% % Cannot use this definition before May 2018.
% \NewDocumentCommand{\Nameii}{O{} m !O{}}
%   {\def\Opt{#3}\ifx\Opt\empty #1\ #2\else \Opt\ #2\fi}
%
% |\Namei: | \Namei[Person1]{Family1} [something1]\\[1ex]
% |\Nameii:| \Nameii[Person2]{Family2} [something2]
% \end{Verbatim}
%
% \ifdefined\nameauthxp%^^A
% \NewDocumentCommand {\Namei}{O{} m  O{}}
%   {\def\Opt{#3}\ifx\Opt\empty #1\ #2\else \Opt\ #2\fi}
% \NewDocumentCommand{\Nameii}{O{} m !O{}}
%   {\def\Opt{#3}\ifx\Opt\empty #1\ #2\else \Opt\ #2\fi}
% |\Namei: | \Namei[Person1]{Family1} [something1]\\[1ex]
% |\Nameii:| \Nameii[Person2]{Family2} [something2]%^^A
% \else
% \NewDocumentCommand {\Namei}{O{} m  O{}}
%   {\def\Opt{#3}\ifx\Opt\empty #1\ #2\else \Opt\ #2\fi}
% |\Namei: | \Namei[Person1]{Family1} [something1]\\[1ex]
% |\Nameii:| (\LaTeX\ too old)%^^A
% \fi
% \end{quote}
%
% \begin{itemize}
% \item \cmd{\Namei} ignores spaces between the mandatory argument and the final optional argument.
% \begin{itemize}
% \item Subsequent text in brackets will be interpreted as a name argument, even if unintended.
% \item Yet we avoid errors from unintended spaces when using alternate names and the obsolete syntax.
% \end{itemize}
%
% \item \cmd{\Nameii} treats spaces between the mandatory argument and the final optional argument as significant.
% \begin{itemize}
% \item Subsequent text in brackets will be seen as a name argument only if no spaces occur between the mandatory argument and final optional argument.
% \item Yet when using alternate names and the obsolete syntax, with unintended spaces we could ``lose'' names from the arguments and see unwanted results in the text.
% \end{itemize}
% \end{itemize}
%
% In the next example we show the default approach of \textsf{nameauth} in practice using the basic name interface. \cmd{\ForgetName} (Section~\ref{sec:NameControl}) lets us simulate first instances of names, even if they have appeared already.
%
% \begin{quote}
% \ForgetName[Albert]{Einstein} \ForgetName{Miyazaki, Hayao}
% \renewcommand\NamesFormat{}
% \renewcommand\MainNameHook{}
%
% \begin{itemize}
%   \item[We want:] ``Albert Einstein [then] said'';
%                   ``Miyazaki Hayao [apparently] said''.
%   \item[Also:]    ``Einstein [then] said'';
%                   ``Miyazaki [apparently] said''.
%   \item[Macros:]  |``\Name[Albert]{Einstein} [then] said'';|\\
%                   |``\Name{Miyazaki, Hayao} [apparently] said''.|
%   \item[We get:]  ``\Name[Albert]{Einstein} [then] said'';
%                   ``\Name{Miyazaki, Hayao} [apparently] said''.
%   \item[Repeat:]  ``\Name[Albert]{Einstein} [then] said'';
%                   ``\Name{Miyazaki, Hayao} [apparently] said''.
% \end{itemize}
%
% \ForgetName[Albert]{Einstein} \ForgetName{Miyazaki, Hayao}
% \begin{itemize} 
%   \item Add explicit spaces:\\
%     ``\Name[Albert]{Einstein}\ [then] said'';
%     ``\Name {Miyazaki, Hayao}\ [apparently] said''.\\
%     |``\Name[Albert]{Einstein}\ [then] said'';|\\
%     |``\Name {Miyazaki, Hayao}\ [apparently] said''.|
%   \item Add curly braces:\\
%     ``\Name[Albert]{Einstein}{} [then] said'';
%     ``\Name{Miyazaki, Hayao}{} [apparently] said''.\\
%     |``\Name[Albert]{Einstein}{} [then] said'' and|\\
%     |``\Name{Miyazaki, Hayao}{} [apparently] said''.|
% \end{itemize}
% \end{quote}
%
% Now we show how the \textsf{nameauth} default argument handling works with the quick naming interface:
%
% \begin{quote}
% \begin{Verbatim}
% \begin{nameauth}
%   \< Einstein & Albert & Einstein & >
%   \< Miyazaki & & Miyazaki, Hayao & >
% \end{nameauth}
% \end{Verbatim}
% \end{quote}
%
% \begin{quote}
%   \renewcommand\NamesFormat{}
%   \renewcommand\MainNameHook{}
%
% \ForgetName[Albert]{Einstein} \ForgetName{Miyazaki, Hayao}
% \begin{itemize}
%   \item[We want:] ``Albert Einstein [then] said'';
%                   ``Miyazaki Hayao [apparently] said''.
%   \item[Also:]    ``Einstein [then] said'';
%                   ``Miyazaki [apparently] said''.
%   \item[Macros:]  |``\Einstein [then] said'';|\\
%                   |``\Miyazaki [apparently] said''.|
%   \item[We get:]  ``\Einstein [then] said'';
%                   ``\Miyazaki [apparently] said''.
%   \item[Repeat:]  ``\Einstein [then] said'';
%                   ``\Miyazaki [apparently] said''.
% \end{itemize}
%
% \ForgetName[Albert]{Einstein} \ForgetName{Miyazaki, Hayao}
% \begin{itemize} 
%   \item Add explicit spaces:\\
%     ``\Einstein\ [then] said'';
%     ``\Miyazaki\ [apparently] said''.\\
%     |``\Einstein\ [then] said'' and|\\
%     |``\Miyazaki\ [apparently] said''.|
%   \item Add curly braces:\\
%     ``\Einstein{} [then] said'';
%     ``\Miyazaki{} [apparently] said''.\\
%     |``\Einstein{} [then] said'' and|\\
%     |``\Miyazaki{} [apparently] said''.|
% \end{itemize}
% \end{quote}
%
% Section~\ref{sec:ChangeParse} shows how one can customize and change argument handling, addressing some of the same issues and caveats illustrated above.
%
% \begin{Quote}{\ForgetThis\Miyazaki\break
% \hbox{}\hfill Proposal for \textit{Princess Mononoke}}
% We depict hatred, but it is to depict that there are more important things. We depict a curse, to depict the joy of liberation.\negmedskip^^A
% \index{creatives, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \subsubsection[Name Arg Caveats]{Name Argument Caveats}
%
% To get consistent index entries, all \textsf{nameauth} macros that take name arguments trim extra spaces around each name argument, shown in gray below:
% \begin{quote}
% \def\gbox{\colorbox{nagrey}{\strut\quad\strut}}
% \cmd{\Name}\texttt{[}\gbox\meta{\color{nared}FNN}\gbox\texttt{]}^^A
%      \texttt{\{}\gbox\meta{SNN}\gbox\texttt{\color{nared},}\gbox^^A
%      \meta{\color{nared}Affix}\gbox\texttt{\}}^^A
%      \texttt{[}\gbox\meta{\color{nared}Alternate}\gbox\texttt{]}
% \end{quote}
% We show this in practice while suppressing name formatting:
%
% \begin{VerbatimOut}{\jobname.tmp}
% No spaces:\\
% \fbox{\strut\Name*[Martin Luther]{King,Jr.}}
% \fbox{\strut\Name [Martin Luther]{King,Jr.}}
% \fbox{\strut\FName[Martin Luther]{King,Jr.}}
%
% Spaces:\\
% \fbox{\strut\Name*[ Martin  Luther ]{ King , Jr. }}
% \fbox{\strut\Name [ Martin  Luther ]{ King , Jr. }}
% \fbox{\strut\FName[ Martin  Luther ]{ King , Jr. }}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%   \renewcommand*\NamesFormat{}
%   \renewcommand*\MainNameHook{}
%
%   \vspace{3ex}
%   \BothInfo{\ShowPattern[Martin Luther]{King, Jr.}\break
%     \ShowPattern[  Martin  Luther  ]{  King  ,  Jr.  }}
%   {\ShowIdxPageref*[Martin Luther]{King, Jr.}\break
%     \ShowIdxPageref*[  Martin  Luther  ]{  King  ,  Jr.  }}
%   \vspace{-3ex}
%   \input{\jobname.tmp}
% \end{quote}
%
% We resume name formatting to show names that look the same, but are different. Non-breaking spaces, explicit spaces, thin spaces, and macros that expand to spaces \emph{are not trimmed}. They produce different name patterns, shown below:
%
% \begin{center}\IndexInactive
% \begin{tabular}{lll}\toprule
% \rowcolor{nagrey}^^A
% \bfseries Output & \bfseries Macro & \bfseries Name Pattern\\
%
% \Name{foo~bar} & |\Name{foo~bar}| & \ttfamily\ShowPattern{foo~bar} \\
%
% \rowcolor{nagrey}^^A
% \Name{foo\ bar} & |\Name{foo\ bar}| & \ttfamily\ShowPattern{foo\ bar} \\
%
% \Name{foo\space bar} & |\Name{foo\space bar}| &
% \ttfamily\ShowPattern{foo\space bar} \\\bottomrule
% \end{tabular}\IndexActive
% \end{center}
%
% Name patterns, not name appearance, determine if names are the same (Section~\ref{sec:NamePatterns}). There may be cases where one might leverage that point.
%
% \subsubsection{Full Stop Detection}
%
% Western names tend to use full stops in various cases, including the following:
%
% \begin{itemize}
% \item After the initial letter abbreviation of forenames.
% \item After affixes: ``Jr''. (junior), ``Sr''. (senior), ``d.\,Ä.''
%   (\textit{der Ältere}), ``d.\,J.'' (\textit{der Jüngere}) etc.
% \item In some contexts, after degrees like ``M.D.'' (\textit{Medicinae
%   Doctor}), J.D. (\textit{Juris Doctor}), Ph.D.
%   (\textit{Philosophiae Doctor}), etc.
% \end{itemize}
%
% If name contains a full stop at the end, followed by a full stop in the text. the \textsf{nameauth} macros try to prevent two adjacent full stops. All macros that take name arguments and print names in the text check if the printed name ends with a full stop. They also check the lookahead token for a full stop. If both cases are true, they gobble the lookahead token.
%
% \newpage
%
% We show this behavior in the example below. \cmd{\ForgetName} (Section~\ref{sec:NameControl}) lets us simulate the first instances of names. The table tells us whether or not the full stop on the lookahead token is gobbled, why that is the case, as well as the output of the name in the text and its correlating source.
%
% \begin{quote}
% \begin{Verbatim}
% \begin{nameauth}
%   \< MLK & Martin Luther & King, Jr. & >
% \end{nameauth}
% \end{Verbatim}
% \end{quote}
%
% \ForgetName[Martin Luther]{King, Jr.}
%
% \begin{center}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Gobbled & \bfseries Long Name Form, First Use\\
%  Dr. \Name[Martin Luther]{King, Jr.}.  &
% |Dr. \Name[Martin Luther]{King, Jr.}.| \\ 
%
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Gobbled & \bfseries Force Long Name Form \\
%  Dr. \Name*[Martin Luther]{King, Jr.}.   &
% |Dr. \Name*[Martin Luther]{King, Jr.}.|  \\
%  Dr. \LMLK.   &
% |Dr. \LMLK.|  \\
%
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Gobbled & \bfseries Alternate FNN with Initials \\
%  \FName[Martin Luther]{King, Jr.}[M.L.].  &
% |\FName[Martin Luther]{King, Jr.}[M.L.].| \\
%  \SMLK[M.L.].  &
% |\SMLK[M.L.].| \\
%
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Remains & \bfseries Affix Auto-Drops   \\
%  Dr. \Name[Martin Luther]{King, Jr.}.  &
% |Dr. \Name[Martin Luther]{King, Jr.}.| \\
%
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Remains & \bfseries Force Affix to Drop \\
%  \DropAffix\Name*[Martin Luther]{King, Jr.}.  &
% |\DropAffix\Name*[Martin Luther]{King, Jr.}.| \\
%  \DropAffix \LMLK.  &
% |\DropAffix \LMLK.| \\\bottomrule
% \end{tabular}
% \end{center}
%
% \subsubsection[Grouping, Spaces]{Grouping and Spaces}
% \label{sec:GroupSpace}
%
% We disable indexing for the examples below so that we do not generate unwanted entries. Take care when using curly braces \texttt{\bfseries\{\,\}} in naming macro arguments. They will produce different names, as the formatting shows:
%
% \IndexInactive
% \begin{center}
% \begin{tabular}{lllll}\toprule
% \rowcolor{nagrey}^^A
% & \bfseries Macro & \bfseries Result & \bfseries Name Pattern & \bfseries Type\\
%
% 1 & |\Name[one]{two}| & \Name[one]{two} &
% \ttfamily\ShowPattern[one]{two} & Western\\
%
% \rowcolor{nagrey}^^A
% 2 & |\Name[{one}]{{t}w{o}}| & \Name[{one}]{{t}w{o}} &
%   \ttfamily\ShowPattern[{one}]{{t}w{o}} & Western\\
%
% 3 & |\Name{{one}, two}| & \Name{{one}, two} &
%   \ttfamily\ShowPattern{{one}, two} & nonwestern\\
%
% \rowcolor{nagrey}^^A
% 4 & |\Name{{one}, {two}}| & \Name{{one}, {two}} &
%   \ttfamily\ShowPattern{{one}, {two}} & nonwestern\\
%
% 5 & |\Name{{one, two}}| & \Name{{one, two}} &
%   \ttfamily\ShowPattern{{one, two}} & abnormal\\\bottomrule
% \end{tabular}
% \end{center}
%
% These names have different patterns and different index entries, even if they look similar in the text (Sections~\ref{sec:NamePatterns}, \ref{sec:IndexSort}). Similar issues pertain to grouping used with alternate formatting (Section~\ref{sec:AltFormat}). Consistency is key.
% 
% The grouping used in name~5 creates an abnormality . Here we illustrate that with the output of \cmd{\ShowNameInfo} (Section~\ref{sec:DebuggingMacros}). Normally, the comma should delimit or segment the argument into two names:
% 
% \begin{quote}
%   |\Name{one, two}  | \ShowNameInfo{one, two}\\
%   |\Name{{one, two}}| \ShowNameInfo{{one, two}}
% \end{quote}
% \IndexActive
%
% Curly braces can change the lookahead token and defeat punctuation detection (as well as create a new, unique name). Using spaces between a name and a full stop can have a similar effect. The next table shows us several actions that allow or inhibit full stop detection. We se ethe results of each action, the action taken, and both output and source related to that action.
%
% \begin{center}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Remains & \bfseries Not Contained in Group \\
%  Dr. {\Name*[Martin Luther]{King, Jr.}}.   &
% |Dr. {\Name*[Martin Luther]{King, Jr.}}.|  \\ 
%  Dr. {\LMLK}.   &
% |Dr. {\LMLK}.|  \\
%
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Gobbled & \bfseries Contained in Group \\
%  Dr. {\Name*[Martin Luther]{King, Jr.}.}  &
% |Dr. {\Name*[Martin Luther]{King, Jr.}.}| \\
%  Dr. {\LMLK.}  &
% |Dr. {\LMLK.}| \\
%
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Remains & \bfseries Grouped in Affix; New Name \\
%  Dr. \SkipIndex\Name*[Martin Luther]{King, {Jr.}}. &
% |Dr. \Name*[Martin Luther]{King, {Jr.}}.| \\
%
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Gobbled & \bfseries Not Grouped in Affix; New Name \\
%  Dr. \SkipIndex\Name*[Martin Luther]{King, {Jr}.}. &
% |Dr. \Name*[Martin Luther]{King, {Jr}.}.| \\
%
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Remains & \bfseries Intervening Space \\
%  Dr. \Name*[Martin Luther]{King, Jr.} . &
% |Dr. \Name*[Martin Luther]{King, Jr.} .| \\
%
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Gobbled & \bfseries After Shorthand \\
%  Dr. \LMLK .  &
% |Dr. \LMLK .| \\
%
% \rowcolor{nagrey}^^A
% \bfseries Full Stop Remains & \bfseries After Shorthand with Optional Argument \\
%  Dr. \LMLK[M.L.] . &
% |Dr. \LMLK[M.L.] .| \\
%
% \rowcolor{nagrey}^^A
% \bfseries Fixed; Space Removed & \\
%  Dr. \LMLK[M.L.]. &
% |Dr. \LMLK[M.L.].| \\\bottomrule
% \end{tabular}
% \end{center}
%
% \subsubsection{Formatting Initials}
%
% This can be a thorny topic. Some publishers are dead-set on having a space between initials. Many designers find that practice to be inelegant at best. [\hyperlink{Bringhurst}{Bringhurst}] wisely advises one to omit spaces between initials.
%
% Fighting with one's editor does little good. If a style guide requires spaces, try thin spaces. The quick interface simplifies the task. Below we use no formatting:
%
% \begin{quote}^^A Normal size to show the spacing better.
% \begin{minipage}[c]{0.45\textwidth}
% \begin{Verbatim}
% \PretagName[E.\,B.]{White}%
%   {White, Elwyn}
% \begin{nameauth}
%   \< White & E.\,B. & White & >
% \end{nameauth}
% \end{Verbatim}
% \end{minipage}
% \begin{minipage}[c]{0.35\textwidth}
% \renewcommand*\NamesFormat{}\renewcommand*\MainNameHook{}
% \def\sep{\vrule width0.5pt\kern-0.5pt}%
% \begin{tabular}{@{}ll@{}}
% \cmd{\LWhite} & \hspace{0.48pt}\LWhite\\
% & \sep\hphantom{E.}\sep\,\sep\hphantom{B.}\sep\hphantom{\ }^^A
% \sep\hphantom{White}\sep\\\hline
% & \sep\hphantom{E.}\sep\ \sep\hphantom{B.}\sep\ \sep\hphantom{White}\sep\\
% Normal text:\hfill & E. B. White\\
% \end{tabular}
% \end{minipage}
% \end{quote}
%
% One might notice that we used \cmd{\PretagName} to sort this name by something other than its initials: ``White, Elwyn''. Sorting only by initials (and with embedded macros like a thin space) will produce unexpected entry order (Section~\ref{sec:IndexInitials}).
%
% \ReturnLink
%
% \section{Language Topics}
% \label{sec:Lang}
%
% Here we cover technical issues related to the use of names in various languages and cultures. Specifically, we show how they should be represented in English, but this material can apply to other language standards as well.
%
% \subsection[Active Characters]{Caveats with Active Characters}
%
% Active characters affect name patterns and index sorting, depending on the \LaTeX\ engine being used. We use \cmd{\PretagName} (Section~\ref{sec:IndexSort}; cf.~\ref{sec:Unicode}) to get correct sorting and \cmd{\SkipIndex} (Section~\ref{sec:IdxPrefix}) to suppress bogus index entries:
%
% \newpage
%
% \begin{enumerate}\small
% \item \Name*{Æthelred, II}\dotfill |\Name*{Æthelred, II}|
% \PatInfo{\ShowPattern{Æthelred, II} \textrm{(1)}\break
%   \ShowPattern{\AE thelred, II} \textrm{(2)}\break
%   \ShowPattern{Bo\"ethius} \textrm{(3)}\break
%   \ShowPattern{Boëthius} \textrm{(4)}\break
%   \ShowPattern{Bo{\"e}thius} \textrm{(5)}}
% \item[] We have seen this name earlier, as the formatting shows.\footnote{Regarding the margin note that shows name control sequences, with \texttt{pdflatex} and \texttt{latex}, in \texttt{\ShowPattern{Æthelred, II}} the glyphs \texttt{ÃĘ} correspond to \cmd{\IeC\{}\cmd{\AE\}}. Likewise in \texttt{\ShowPattern{Boëthius}} the glyphs \texttt{Ãń} correspond to \cmd{\IeC\{}\cmd{\"e\}}.}
% \item[] We sort this with |\PretagName{Æthelred, II}{Aethelred, 2}|
% \item \SkipIndex\Name{\AE thelred, II}\dotfill |\SkipIndex\Name{\AE thelred, II}|
% \item[] This name is new, as the formatting shows us. It looks like the
%   name above, but its control pattern differs by the macro \cmd{\AE}.
% \item[] We get a different index entry, regardless of how we sort it.
% \item \Name{Bo\"ethius}\dotfill |\Name{Bo\"ethius}|
% \item[] This new name uses |\"e| to display a lowercase e with a diaeresis.
% \item[] We sort it with |\PretagName{Bo\"ethius}{Boethius}|.
% \item \SkipIndex\Name{Boëthius}\dotfill |\SkipIndex\Name{Boëthius}|
% \item[] This name differs by the character ë. It cannot have the same index entry as \Name{Bo\"ethius} above.
% \item \SkipIndex\Name{Bo{\"e}thius}\dotfill |\SkipIndex\Name{Bo{\"e}thius}|
% \item[] Yet another different name by virtue of grouping tokens (Section~\ref{sec:GroupSpace}). The index entry for this one is again different.
% \end{enumerate}
%
% \subsection{Hyphenation}
%
% In modern English, names can be hyphenated to reflect their cultural origins. With \textsf{nameauth}, one can handle such names by using default hyphenation, optional hyphens, or packages like \textsf{babel} and \textsf{polyglossia}.
% \IndexName[John]{\noexpand\de{Strietelmeier}}
%
% \subsubsection*{\hfil Default Hyphenation}
%
% Here\PatInfo{\ShowPattern[John]{Strietelmeier}} we use the default hyphenation. Using \cmd{\textls} from \textsf{microtype} we get the name to break badly. We use \cmd{\SkipIndex} to omit this version from the index.
%
% \begin{VerbatimOut}{\jobname.tmp}
% \textls[20]{In English, some names come from other cultures.
% Names like \SkipIndex\Name[John]{Strietelmeier}
% can break badly in some cases.}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%   
%   \input{\jobname.tmp}
% \end{quote}
%
% \subsubsection*{\hfil Discretionary Hyphens}
%
% We\PatInfo{\ShowPattern[John]{Strie\-tel\-meier}} create a different name from that above. One must use the discretionary hyphens consistently in the macro arguments. We use \cmd{\Name[John]\{Strie\textbackslash-tel\textbackslash-meier\}} to omit this version from the index. We see that it breaks properly.
%
% \begin{VerbatimOut}{\jobname.tmp}
% \textls[20]{In English, some names come from other cultures.
% Names like \SkipIndex\Name[John]{Strie\-tel\-meier}
% can break badly in some cases.}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%   
%   \input{\jobname.tmp}
% \end{quote}
%
% \subsubsection*{\hfil Language Packages}
%
% Here\PatInfo{\textls[-5]{\ShowPattern[John]{\de{Strietelmeier}}}} we use an approach with macros in name arguments that can be applied to \textsf{babel} and \textsf{polyglossia}. This approach has issues that we discuss in Sections~\ref{sec:NameParticles}, \ref{sec:AltFormat}, and elsewhere, showing how to prevent errors.
%
% \NameArgWarning
%
% Since the leading element of \meta{SNN} is a macro, using \cmd{\CapThis} would halt \LaTeX\ with errors unless we used alternate formatting (Section~\ref{sec:AltFormat}):
%
% \begin{VerbatimOut}{\jobname.tmp}
% \textls[20]{In English, some names come from other cultures.
% Names like \Striet\ or \Name[John]{\noexpand\de{Strietelmeier}}
% break badly in some cases.}
% \end{VerbatimOut}
%
% \begin{quote}
% \begin{Verbatim}
% \newcommand\de[1]{\foreignlanguage{ngerman}{#1}}
% %  or polyglossia: \newcommand\de[1]{\textgerman{#1}}
%
% \begin{nameauth}
%   \< Striet & John & \noexpand\de{Strietelmeier} & >
% \end{nameauth}
%
% \PretagName[John]{\noexpand\de{Strietelmeier}}
%   {Strietelmeier, John}
% \end{Verbatim}
% \VerbatimInput[gobble=0,firstnumber=10]{\jobname.tmp}
%   
% \input{\jobname.tmp}
% \end{quote}
%
% \subsection{Affixes Need Commas}
% \label{sec:Affix}
% \negmedskip
%
% \begin{InfoBox}
% Regarding an \meta{SNN, Affix} pair, the key to avoiding error is to apply macros to \meta{SNN} and \meta{Affix} as if they were independent arguments.^^A
% \end{InfoBox}
%
% A comma is not a required name element unless used in an \meta{SNN, Affix} pair. When thus used it delimits a Western surname from its affix, an Eastern family name from a personal name, and an ancient name from an affix.
%
% When a comma appears in a required name argument, each member of the \meta{SNN, Affix} pair is treated as a separate argument. Thus, we say that the comma delimits or segments the name argument. Spaces around the comma are ignored. See Section~\ref{sec:Noexpand} for more information when using macros in name arguments. Below we see the basics of commas in name arguments.
%
% \begin{center}
% \vspace{1ex}
% \BothInfo{\ShowPattern[Oskar]{Hammerstein, II}\break
%   \ShowPattern{Louis, XIV}\break
%   \ShowPattern{Sun, Yat-sen}}
% {\ShowIdxPageref*[Oskar]{Hammerstein, II}\break
%   \ShowIdxPageref*{Louis, XIV}\break
%   \ShowIdxPageref*{Sun, Yat-sen}}
% \vspace{-1ex}
% \ForgetName{Sun, Yat-sen}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
% \Name[Oskar]{Hammerstein, II} & |\Name[Oskar]{Hammerstein, II}|\\
% \rowcolor{nagrey}^^A
% \Name[Oskar]{Hammerstein, II} & |\Name[Oskar]{Hammerstein, II}|\\
%
% \Name{Louis, XIV} & |\Name{Louis, XIV}|\\
% \Name{Louis, XIV} & |\Name{Louis, XIV}|\\
%
% \rowcolor{nagrey}^^A
% \Name{Sun, Yat-sen} & |\Name{Sun, Yat-sen}|\\
% \rowcolor{nagrey}^^A
% \Name{Sun, Yat-sen} & |\Name{Sun, Yat-sen}|\\\bottomrule
% \end{tabular}
% \end{center}
%
% Western names with affixes must use \meta{SNN,Affix},^^A
% \PatInfo{\ShowPattern[Oskar]{Hammerstein}[II]} never the obsolete syntax, which is meant for nonwestern names and is discouraged. We get \SkipIndex\Name[Oskar]{Hammerstein}[II] and a bad index entry from, e.g., \cmd{\SkipIndex}\cmd{\Name[Oskar]\{Hammerstein\}[II]}.
%
% \DescribeMacro{\KeepAffix}
% If the name displayed in the text shows both \meta{SNN} and \meta{Affix}, then \cmd{\KeepAffix} turns the space \emph{between} \meta{SNN} and \meta{Affix} into a non-breaking space. \cmd{\KeepAffix}\cmd{\Name\{Louis, XIV\}} will not break between \Name{Louis, XIV} and \ForceFN\FName{Louis, XIV}. All name types that use \meta{Affix} are supported. 
%
% \DescribeMacro{\KeepName}
% In longer name forms, \cmd{\KeepName} turns spaces \emph{between} all visible name elements into non-breaking spaces.
%
% \begin{itemize}\small
% \item |\Name[Sandra Day]{O'Connor}| \Name[Sandra Day]{O'Connor} has two
% points where the name can break: after \FName[Sandra Day]{O'Connor}[Sandra]
% and after \FName[Sandra Day]{O'Connor}[Day].
% \item |\KeepName\Name*[Sandra Day]{O'Connor}|
% \KeepName\Name*[Sandra Day]{O'Connor}
% has one point where the name can break: after
% \FName[Sandra Day]{O'Connor}[Sandra].
% \end{itemize}
%
% This macro does not alter spaces \emph{within} name elements with multiple names, such as French and German forenames, as well as Spanish surnames. \cmd{\KeepName} works with all name types.
%
% \DescribeMacro{\DropAffix}
% If \cmd{\DropAffix} precedes only a Western name, it will suppress the affix after the surname in a first or long instance. We get ``\DropAffix\Name*[Oskar]{Hammerstein, II}'' From |\DropAffix\Name*[Oskar]{Hammerstein, II}|.
%
% With nonwestern names, the \meta{Affix} in the \meta{SNN, Affix} pair drops automatically in the text for subsequent uses, making \cmd{\DropAffix} redundant. We see that above in the case of \Name*{Louis,XIV}, who becomes \Name{Louis,XIV}.
%
% \DescribeMacro{\ShowComma}
% In a long name form, \cmd{\ShowComma} forces the display of a comma between a Western name and its affix.
% \DescribeMacro{\NoComma}
% It works like the \texttt{comma} option on a per-name basis, and only in the text. One uses \cmd{\ShowComma} with older publication styles that separate a Western name and affix with a comma. \cmd{\NoComma} works like the \texttt{nocomma} option in the body text on a per-name basis.
%
% \begin{center}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
% \ShowComma\LPatton & |\ShowComma\LPatton|\\
% \NoComma\LPatton & |\NoComma\LPatton|\\\bottomrule
% \end{tabular}
% \end{center}
%
% Neither \cmd{\ShowComma}, \cmd{\NoComma}, nor their related package options interact with the use of \cmd{\RevComma} and friends (Sections~\ref{sec:Priorities} and~\ref{sec:LastFirst}).
%
% \subsection[Eastern Names, Name Caps]
% {Eastern Names and Family Names in All Caps}
% \label{sec:Eastern}
%
% Proper Eastern names, included with ancient and medieval forms in the broader group of nonwestern names, are encoded using comma-delimited syntax (compare the obsolete syntax in Section~\ref{sec:Obsolete}). They have nonwestern index entries: \meta{SNN} \meta{Affix} (no comma between name elements). The current syntax permits alternate names; the obsolete does not.
%
% \begin{SyntaxBox}
%   \cmd{\Name}\marg{SNN, Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% Even in some academic texts, one sees nonwestern names encoded with Western forms.\footnote{\textls[-5]{Jaroslav Pelikan, \textit{The Christian Tradition}, 5 vols. (Chicago: Chicago UP, 1971–1989); Immanuel Geiss, \textit{Personen: Die biographische Dimension der Weltgeschichte}, Geschichte Griffbereit vol. 2 (Munich: Wissen Media Verlag, 2002).} At this time, \href{https://www.nndb.com/}{\bfseries NNDB} sorts \Name{Kim, Jong Un} under U, not K.}
% The \textsf{nameauth} package seeks to remedy that issue, which has more to do with outsourcing indexes to non-expert providers than with scholars. For example, the macro |\Name*{Sun, Yat-sen}| \Name*{Sun, Yat-sen} ensures correct forms in the text and the index. We get cross-cultural sensitivity and scholarly accuracy.
%
% \DescribeMacro{\AllCapsActive}
% Certain contexts call for one's entire family name to be capitalized. This differs
% \DescribeMacro{\AllCapsInactive}
% from the way in which initial letter capitalization is handled (Section~\ref{sec:NameParticles}). In addition to the \texttt{allcaps} package option
% \DescribeMacro{\CapName}
% (Section~\ref{sec:PkgOptions}), \cmd{\AllCapsActive} and \cmd{\AllCapsInactive} work for blocks of text. All have priority over \cmd{\CapName}, which works once per name. These capitalize \meta{SNN} in the body text only. They also work with \cmd{\AKA} and friends. For capitalization in both the text and index (beyond doing it manually) see Sections~\ref{sec:AltFormat} and~\ref{sec:AdvCustomize}.
%
% Both\Info{\cmd{\global}} \cmd{\AllCapsActive} and \cmd{\AllCapsInactive} can be used either as a pair or singly within an explicitly local scope. Use \cmd{\global} to force a global effect.
% \medskip
%
% \begin{center}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
% \LNoguchi & |\LNoguchi| \\
%
% \CapName\LNoguchi & |\CapName\LNoguchi}|\\
%
% \rowcolor{nagrey}^^A
% \LMiyazaki & |\LMiyazaki| \\
%
% \CapName\LMiyazaki & |\CapName\LMiyazaki|\\\bottomrule
% \end{tabular}
% \end{center}
% \vspace{-14ex}
% \BothInfo{\ShowPattern[Hideyo]{Noguchi}\break
%   \ShowPattern{Miyazaki, Hayao}}
% {\ShowIdxPageref*[Hideyo]{Noguchi}\break
%   \ShowIdxPageref*{Miyazaki, Hayao}}
% \vspace{14ex}
%
% \subsection{Reversed Names}
% \label{sec:RevNames}
%
% Sometimes a publisher expects Western-style index entries. Sometimes certain names have specific forms in the index, The reversing option and macros can adapt forms in the text to the index entries required in such cases.
%
% \DescribeMacro{\ReverseActive}
% In addition to the \texttt{allreversed} option for reversing name order (Section~\ref{sec:PkgOptions}), \cmd{\ReverseActive} and \cmd{\ReverseInactive} do the same for blocks of text.
% \DescribeMacro{\ReverseInactive}
% These all have priority over the use of \cmd{\RevName}, used once per name.
% \DescribeMacro{\RevName}
% These macros do not affect the index. They work also with \cmd{\AKA} and friends. \emph{Reversing only affects long name forms,} which is why we show only long names below. In this manual, reversed Western forms are shown with a dagger (\dag).
%
% Both\Info{\cmd{\global}} \cmd{\ReverseActive} and \cmd{\ReverseInactive} can be used either as a pair or singly within an explicitly local scope. Use \cmd{\global} to force a global effect.
%
% \begin{center}
% \vspace{3ex}
% \BothInfo{\ShowPattern[Hideyo]{Noguchi}\break \ShowPattern{Miyazaki, Hayao}}
% {\ShowIdxPageref*[Hideyo]{Noguchi}\break \ShowIdxPageref*{Miyazaki, Hayao}}
% \vspace{-3ex}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
% \bfseries Output & \bfseries Macro \\
%
% \LNoguchi & |\LNoguchi| \\
% \LNoguchi[Doctor] & |\LNoguchi[Doctor]| \\
% \strut Bad result: \fbox{\LNoguchi[Sensei]} & |\LNoguchi[Sensei]| \\
%
% \rowcolor{nagrey}^^A
% \RevName\LNoguchi\dag & |\RevName\LNoguchi\dag| \\
% \rowcolor{nagrey}^^A
% \strut Bad result: \fbox{\RevName\LNoguchi[Doctor]} & |\RevName\LNoguchi[Doctor]| \\
% \rowcolor{nagrey}^^A
% \RevName\LNoguchi[Sensei]\dag & |\RevName\LNoguchi[Sensei]| \\
%
% \LMiyazaki & |\LMiyazaki| \\
% \LMiyazaki[Sensei] & |\LMiyazaki[Sensei]| \\
% \strut Bad result: \fbox{\LMiyazaki[Mr.]} & |\LMiyazaki[Mr.]| \\
%
% \rowcolor{nagrey}^^A
% \RevName\LMiyazaki & |\RevName\LMiyazaki| \\
% \rowcolor{nagrey}^^A
% \RevName\LMiyazaki[Mr.] & |\RevName\LMiyazaki[Mr.]| \\
% \rowcolor{nagrey}^^A
% \strut Bad result: \fbox{\RevName\LMiyazaki[Sensei]} &
%   |\RevName\LMiyazaki[Sensei]| \\\bottomrule
% \end{tabular}
% \end{center}
% \negmedskip
%
% \begin{SyntaxBox}[Reversing Western Names]
%   \cmd{\RevName}\cmd{\Name}\oarg{FNN}\marg{SNN}\oarg{Alternate}
% \end{SyntaxBox}
%
% Avoid using \meta{Affix} with such names. For example, |\RevName\LPatton\dag| produces ``\RevName\LPatton\dag''. The name looks wrong unless one uses either \cmd{\RevComma} or \cmd{\DropAffix}. This name has a Western index entry.
%
% \begin{SyntaxBox}[Reversing Eastern Names]
%   \cmd{\RevName}\cmd{\Name}\marg{SNN, Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% The index entry of this name form looks like \meta{SNN} \meta{FNN} (no comma). This name has a nonwestern index entry.
%
% \begin{InfoBox}
%   Reversing ancient names works the same as reversing Eastern names. The problem is that, in most cases, one produces a nonsense name.
% \end{InfoBox}
% \negmedskip
%
% \subsection[Listing by Surname]{Listing Western names by Surname}
% \label{sec:LastFirst}
%
% \DescribeMacro{\ReverseCommaActive}
% To make lists of ``last comma first'' names, in addition to the \texttt{allrevcomma} option (Section~\ref{sec:PkgOptions}),
% \DescribeMacro{\ReverseCommaInactive}
% the macros \cmd{\ReverseCommaActive} and \cmd{\ReverseCommaInactive} function the same way with blocks of text.\DescribeMacro{\RevComma} They both have priority over \cmd{\RevComma}. These all affect only long Western name forms. The first two are broad toggles, while the third is used once per name.
%
% Both\Info{\cmd{\global}} \cmd{\ReverseCommaActive} and \cmd{\ReverseCommaInactive} can be used either as a pair or singly within a local scope. Use \cmd{\global} to force a global effect.
%
% \begin{center}
% \begin{tabular}{lll}\toprule
% \rowcolor{nagrey}^^A
% \Name*[Oskar]{Hammerstein, II} &
%   \RevComma\Name*[Oskar]{Hammerstein, II} & change\\
% \rowcolor{nagrey}^^A
% \LNoguchi & \RevComma\LNoguchi & change\\
%
% \LAeth & \RevComma\LAeth & no change\\
% \Name*{Sun, Yat-sen} &
%   \RevComma\Name*{Sun, Yat-sen} & no change\\\bottomrule
% \end{tabular}
% \end{center}^^A
% \vspace{-12ex}
% \PatInfo{\ShowPattern[Oskar]{Hammerstein, II}\break
%   \ShowPattern[Hideyo]{Noguchi}\break
%   \ShowPattern{Æthelred,II}\break
%   \ShowPattern{Sun, Yat-sen}}
% \vspace{12ex}
%
% \subsection{Particles in Names}
% \label{sec:NameParticles}
%
% Particles are small words attached to names, grouped either with forenames or surnames, that refer often to places of origin or noble houses. Some particles have been carried into modern names through various means.
%
% \subsubsection{Standard Rules}
%
% According to [\hyperlink{Mulvany}{Mulvany}, 152–82], one may treat name particles in the following way:
%
% \begin{itemize}
% \item English use of \textit{de}, \textit{de\ la}, \textit{d'},
%   \textit{von}, \textit{van}, and \textit{ten} often keeps them with the
%   surname. Capitalization may vary.
% \item \textit{Le}, \textit{La}, and \textit{L'} always are capitalized
%   unless preceded by \textit{de}.
% \item Modern Romance languages keep particles with the surname.
% \item German and medieval Romance languages keep particles with forenames.
% \item Modern Welsh, Irish, and Scots names often merge particles with
%   surnames: FitzRoy or Fitzroy; O'Leary; McDonald, MacLeish.
% \end{itemize}
%
% \begin{center}
% \vspace{2ex}
% \BothInfo{\ShowPattern[Martin]{Van Buren}\break
%   \ShowPattern[Hernando]{de~Soto}\break
%   \ShowPattern[J.W. von]{Goethe}}
% {\ShowIdxPageref*[Martin]{Van Buren}\break
%   \ShowIdxPageref*[Hernando]{de~Soto}\break
%   \ShowIdxPageref*[J.W. von]{Goethe}}
% \vspace{-2ex}
%   \begin{tabular}{lll}\toprule
%   \rowcolor{nagrey}^^A
%     \bfseries Body Text & \bfseries Index & \bfseries Macro \\
%
%     \ForgetThis\VBuren & \ShowIdxPageref*[Martin]{Van Buren} &
%       \cmd{\ForgetThis}\cmd{\VBuren} \\
%     \VBuren & \ShowIdxPageref*[Martin]{Van Buren} & \cmd{\VBuren} \\
%
%   \rowcolor{nagrey}^^A
%     \ForgetThis\Soto & \ShowIdxPageref*[Hernando]{de~Soto} &
%       \cmd{\ForgetThis}\cmd{\Soto} \\
%   \rowcolor{nagrey}^^A
%      \CapThis\Soto & \ShowIdxPageref*[Hernando]{de~Soto} &
%       \cmd{\CapThis}\cmd{\Soto} \\
%
%     \ForgetThis\JWG & \ShowIdxPageref*[J.W. von]{Goethe} &
%       \cmd{\ForgetThis}\cmd{\JWG}\\
%
%     \JWG & \ShowIdxPageref*[J.W. von]{Goethe} & \cmd{\JWG}\\\bottomrule
%   \end{tabular}
% \end{center}
%
% \subsubsection{Non-Breaking Spaces}
%
% Despite the macros in Section~\ref{sec:Affix}, names with particles present their own challenges. We recommend inserting a tilde (active character for a non-breaking space) or \cmd{\nobreakspace} between some particles and names to prevent bad breaks, sorting them with \cmd{\PretagName} (Section~\ref{sec:IndexSort}). Here the quick interface helps greatly.
%
% \subsubsection{Look-Alike Particles}
%
% There are characters that look similar, but in fact are different. For example, \textit{L'} (L+apostrophe) and \textit{d'} (d+apostrophe) are two separate glyphs each. In contrast, \textit{Ľ} (L+caron) and \textit{ď} (d+caron) are one Unicode glyph each (Section~\ref{sec:Unicode}). If one confuses these similar characters, spurious results can occur.
%
% \subsubsection[Capitalizing]{Capitalizing Particles}
%
% \DescribeMacro{\CapThis}
% In English and modern Romance languages, names like \LSoto\ have their particles in the \meta{SNN} argument: \Soto. When the particle appears at the beginning of a sentence, one must capitalize it, e.g.,:
%
% \begin{itemize}
% \item[] \CapThis\Soto\ was a famous Spanish explorer.
% \item[] |\CapThis\Soto\ was a famous Spanish explorer.|\medskip
%
% \item With \texttt{latex} and \texttt{pdflatex}, using \cmd{\CapThis}
%   should work with all of the Unicode characters available in the T1
%   encoding. For a broader set of characters, consider using \texttt{xelatex}
%   and \texttt{lualatex}.
%
% \item Section~\ref{sec:NonstandardCaps} applies \cmd{\CapThis}
%   to nonstandard names and indexing.
%
% \item Sections~\ref{sec:AltFormat} and~\ref{sec:Unicode} explain
%   potential problems of \cmd{\CapThis}. That is a trade-off
%   for using a natural language approach.
%
% \item \cmd{\CapName} overrides the \meta{SNN} created by \cmd{\CapThis}.
%   It is unlikely that the two would be used in the same context.
% \end{itemize}
%
% \DescribeMacro{\AccentCapThis}
% Before \textsf{nameauth} used automatic Unicode detection,  \cmd{\AccentCapThis} placed before \cmd{\CapThis} handled Unicode characters. It remains for backward compatibility. Otherwise it is seldom used and not needed.
%
% \subsection{Medieval Names}
% \label{sec:NameMedieval}
%
% Medieval names present some interesting difficulties, often based on the expected standards of the context in which they are used. Some publications use them like Western names while others do not. In the following preamble snippet we have:\footnote{Regarding the margin note that shows name control sequences, with \texttt{pdflatex} and \texttt{latex}, in \texttt{\ShowPattern{Thomas, à~Kempis}} the glyphs \texttt{Ãă} correspond to \cmd{\IeC\{}\texttt{\textbackslash\textquotesingle a\}}.}
%
% \begin{quote}
% \begin{Verbatim}
% \PretagName{Thomas, à~Kempis}{Thomas Akempis}  % medieval
% \PretagName[Thomas]{à~Kempis}{Akempis, Thomas} % Western
%
% % We do not index an alternate medieval form
% \ExcludeName{Thomas, \`a~Kempis}
%
% % If we did use the alternate form, we would sort it as
% \PretagName{Thomas, \`a~Kempis}{Thomas Akempis}
%
% \begin{nameauth}
%   \< KempMed & & Thomas,   à~Kempis & >        % medieval
%   \< KempW     & Thomas  & à~Kempis & >        % Western
% \end{nameauth}
%
% % Create xref before using the Western name.
% \IndexRef[Thomas]{à~Kempis}{Thomas à~Kempis}
% \end{Verbatim}
% \ExcludeName{Thomas,\`a~Kempis}
% \IndexRef[Thomas]{à~Kempis}{Thomas à~Kempis}
% \end{quote}
%
% \begin{itemize}
% \item Medieval form: \cmd{\KempMed}
% \BothInfo{\ShowPattern{Thomas, à~Kempis}\hfill \textrm{(1--4, 7)}\break
%   \ShowPattern{Thomas,\`a~Kempis}\hfill \textrm{(5--6)}\break
%   \ShowPattern[Thomas]{à~Kempis}\hfill \textrm{(8--10)}}
% {\ShowIdxPageref*{Thomas, à~Kempis}\hfill (1--4, 7)\break
%   \ShowIdxPageref*{Thomas,\`a~Kempis}\hfill (5--6)\break
%   \ShowIdxPageref*[Thomas]{à~Kempis}\hfill (8--10)}
% \begin{enumerate}
% \item In the text, we see \KempMed\ and \KempMed. The added name
%   ``\ForceFN\SKempMed'' |\ForceFN\SKempMed| is a place name, not a
%   surname. It is Latin for \textit{von Kempen}.
% \item \KempMed\ is indexed as ``\ShowIdxPageref*{Thomas, à~Kempis}''.
% \item \CapThis\ForceFN\SKempMed\ |\CapThis\ForceFN\SKempMed|
%   can start a sentence.
% \item We use \cmd{\PretagName} (Section~\ref{sec:IndexSort}) to sort the
%   name under \texttt{Thomas}, followed by \texttt{Akempis}, not
%   \texttt{A kempis} (cf. 10 below).
% \end{enumerate}
%
% \item Alternate medieval form: |\Name{Thomas,\`a~Kempis}|
% \begin{enumerate}\addtocounter{enumi}{4}
% \item \Name{Thomas,\`a~Kempis} is a different name.
% \item We used \cmd{\ExcludeName} (Section~\ref{sec:IdxFine})
%   before using the alternate form to keep it from generating an extra
%   index entry.
% \item We index the canonical form here with
%   \JustIndex\KempMed|\JustIndex\KempMed|.
% \end{enumerate}
%
% \item Western form: \cmd{\KempW}
% \begin{enumerate}\addtocounter{enumi}{7}
% \item \KempW\ is a Western name form with the index entry:
%   ``\ShowIdxPageref*[Thomas]{à~Kempis}''.
% \item \CapThis\KempW\ appears via |\CapThis\KempW|.
% \item We first created a cross-reference from the Western form to the
%   medieval form to prevent spurious page entries
%   (Section~\ref{sec:IndexRef}).
% \item[] We index the canonical form again:
%   \JustIndex\KempMed|\JustIndex\KempMed|.
% \item[\dbend] \cmd{\PretagName[Thomas]\{à~Kempis\}\{a Kempis, Thomas\}}
%   puts \KempMed\ before \texttt{aardvark} in the index. We remove the extra
%   spaces to get the proper sorting between \texttt{ajar} and
%   \texttt{alkaline}:
%   |\PretagName[Thomas]{à~Kempis}{Akempis, Thomas}|
% \end{enumerate}
% \end{itemize}
%
% \ReturnLink
%
% \newpage
%
% \addtocontents{toc}{\protect\goodbreak}
% \section{Debugging}
% \label{sec:Debugging}
%
% From this point onward, concepts that we introduced earlier will mesh together in complex ways, starting with indexing. Name patterns govern those interactions, illustrated by debugging macros. We explain what the debugging macros communicate, then we describe the macros.
%
% \leavevmode^^A
% \PatInfo{\ShowPattern[George]{Washington}\\
%          \ShowPattern{Miyazaki, Hayao}}
% Previously, we have seen simple name patterns displayed in the margin, which look like the examples to the left of this paragraph. Now we show full name patterns, which indicate the ``system'' or data set to which they belong. Name patterns are control sequences that usually expand to the empty string.
% They look like this:\footnote{To fit the information in the margin, we display them by taking the output of \cmd{\ShowPattern} and manually adding the system to correspond to the package internals.}
%
% \begin{quote}
%   \ttfamily\begin{tabular}{@{\qquad}l@{\quad \% }l}
%   \ShowPattern[George]{Washington}!MN & name, main matter\\
%   \ShowPattern{Miyazaki, Hayao}!NF & name, front matter\\
%   \ShowPattern[Jay]{Rockefeller}!PN & index cross-reference\\
%   \ShowPattern[W.E.B.]{Du~Bois}!PRE & index sort tag\\
%   \ShowPattern{Gregory, I}!TAG & index tag\\
%   \ShowPattern[Schuyler]{Colfax}!DB & name tag\\
%   \end{tabular}
% \end{quote}
% \negmedskip
%
% \begin{InfoBox}
% From this point onward, we show index entries in the body text instead of the margin due to their increasing complexity.
% \end{InfoBox}
% \negmedskip
%
% \subsection[Name Patterns]{Name Pattern Overview}
% \label{sec:NamePatterns}
%
% Below we show how macro arguments generate name patterns. The \meta{Alternate} argument only affects patterns when using the obsolete syntax (Section~\ref{sec:Obsolete}). The patterns govern names in both the text and the index. The colon at the beginning of each pattern prevents any collisions with extant macros:
%
% \begin{center}
% \begin{tabular}{lll}\toprule
% \rowcolor{nagrey}^^A
%   \bfseries Macro Arguments & \bfseries Patterns & \bfseries Name Type\\
%
%   \oarg{FNN}\marg{SNN} &
%     :\meta{FNN}!\meta{SNN} & Western\\
%   \oarg{FNN}\marg{SNN}\oarg{Alt} &
%     :\meta{FNN}!\meta{SNN} & Western\\
%   \oarg{FNN}\marg{SNN, Affix} &
%     :\meta{FNN}!\meta{SNN},\meta{Affix} & Western\\
%   \oarg{FNN}\marg{SNN, Affix}\oarg{Alt} &
%     :\meta{FNN}!\meta{SNN},\meta{Affix} & Western\\
%
% \rowcolor{nagrey}^^A
%   \hphantom{\oarg{FNN}}\marg{SNN, Affix} &
%     :\meta{SNN},\meta{Affix} & nonwestern\\
% \rowcolor{nagrey}^^A
%   \hphantom{\oarg{FNN}}\marg{SNN, Affix}\oarg{Alt} &
%     :\meta{SNN},\meta{Affix} & nonwestern\\
%
%   \hphantom{\oarg{FNN}}\marg{SNN}\oarg{Alt} &
%     :\meta{SNN},\meta{Alt} & old syntax\\
%
% \rowcolor{nagrey}^^A
%   \hphantom{\oarg{FNN}}\marg{SNN} &
%     :\meta{SNN} & nonwestern\\\bottomrule
% \end{tabular}
% \end{center}
%
% \DescribeMacro{\NameauthPattern}
% Every time a macro that takes name arguments is called (Section~\ref{sec:NameArgMacros}), the internal name category logic will \cmd{\let} the current name pattern to \cmd{\NameauthPattern}, making it available to formatting hooks (cf. Section~\ref{sec:DataTagHooks}).
%
% The name category logic is provided by \cmd{\@nameauth@Choice}, which determines the type of name (Western or nonwestern) by its arguments. Various \textsf{nameauth} macros append the appropriate ``system'' or name data set indicator to the pattern. We use this concept starting here, but mostly in Section~\ref{sec:AdvancedFormat}.
%
% Below are name patterns generated from name elements. We mark reversed Western names with a dagger (\dag) and names using the obsolete syntax with a double dagger (\ddag). We show that name patterns depend on name arguments, not on the appearance of a name. The obsolete nonwestern syntax and the current syntax share the same patterns.
%
% \begin{center}
%  \begin{tabular}{lll}\toprule
% \rowcolor{nagrey}^^A
%   \bfseries Body Text & \bfseries \cmd{\ShowPattern} & \bfseries Macro\\
%
%   \Harnack[Adolf von] & \texttt{\ShowPattern[Adolf]{Harnack}} &
%     \cmd{\Harnack[Adolf von]}\\
%   \LHarnack & \texttt{\ShowPattern[Adolf]{Harnack}} &
%     \cmd{\LHarnack}\\
%
% \rowcolor{nagrey}^^A
%   \ForgetThis\Patton & \texttt{\ShowPattern[George S.]{Patton, Jr.}} &
%     \cmd{\ForgetThis}\cmd{\Patton}\\
% \rowcolor{nagrey}^^A
%   \DropAffix\LPatton & \texttt{\ShowPattern[George S.]{Patton, Jr.}} &
%     \cmd{\DropAffix}\cmd{\LPatton}\\
%
%   \ForgetThis\Noguchi & \texttt{\ShowPattern[Hideyo]{Noguchi}} &
%     \cmd{\ForgetThis}\cmd{\Noguchi}\\
%   \RevName\LNoguchi\dag & \texttt{\ShowPattern[Hideyo]{Noguchi}} &
%     \cmd{\RevName}\cmd{\LNoguchi}\cmd{\dag}\\
%
% \rowcolor{nagrey}^^A
%   \ForgetThis\Yamt & \texttt{\ShowPattern{Yamamoto,Isoroku}} &
%     \cmd{\ForgetThis}\cmd{\Yamt}\\
% \rowcolor{nagrey}^^A
%   \RevName\LYamt & \texttt{\ShowPattern{Yamamoto,Isoroku}} &
%     \cmd{\RevName}\cmd{\LYamt}\\
%
%   \Name{Henry,VIII} & \texttt{\ShowPattern{Henry,VIII}} &
%     \cmd{\Name\{Henry,VIII\}}\\
%   \Name*{Henry}[VIII]\ddag & \texttt{\ShowPattern{Henry,VIII}} &
%     \cmd{\Name*\{Henry\}[VIII]}\cmd{\ddag}\\
%
% \rowcolor{nagrey}^^A
%   \Dem[I Soter] & \texttt{\ShowPattern{Demetrius,I}} & \cmd{\Dem[I Soter]}\\
% \rowcolor{nagrey}^^A
%   \LDem & \texttt{\ShowPattern{Demetrius,I}} & \cmd{\LDem}\\
%
%   \ForgetThis\Aris & \texttt{\ShowPattern{Aristotle}} &
%     \cmd{\ForgetThis}\cmd{\Aris}\\
%   \Aris & \texttt{\ShowPattern{Aristotle}} &
%     \cmd{\Aris}\\\bottomrule
%   \end{tabular}
% \end{center}
%
% Six suffixes are appended to these patterns to create six ``systems'' or data sets. The \meta{pattern} element in the next table is the output of \cmd{\ShowPattern}. Within that \meta{pattern} is a leading colon, name elements with spaces removed, and delimiters that separate those elements. Western names use an exclamation point and a comma. Nonwestern names only use a comma. For the use of ID, see \cmd{\ShowNameState} on page~\pageref{page:NameState}. For the way that exclusions use the cross-reference system as a special case for preventing index interaction, see Section~\ref{sec:IdxFine}.
%
% \begin{center}
% \begin{tabular}{llll}\toprule
% \rowcolor{nagrey}^^A
%   \bfseries Description & \bfseries Pattern & \bfseries ID & \bfseries Example\\
%
%   Front-matter names & \meta{pattern}\texttt{!NF} &
%     front & \texttt{\ShowPattern[Adolf]{Harnack}{!NF}}\\
%
% \rowcolor{nagrey}^^A
%   Main-matter names & \meta{pattern}\texttt{!MN} & main &
%     \texttt{\ShowPattern[Hideyo]{Noguchi}{!MN}}\\
%
%   Index cross-refs & \meta{pattern}\texttt{!PN} &
%     xref & \texttt{\ShowPattern{Yamamoto, Isoroku}{!PN}}\\
%
% \rowcolor{nagrey}^^A
%   Exclusions & \meta{pattern}\texttt{!PN} &
%     excl & (like xref, special value)\\
%
%   Index sort tags & \meta{pattern}\texttt{!PRE} & pretag &
%     \texttt{\ShowPattern{Henry, VIII}{!PRE}}\\
%
% \rowcolor{nagrey}^^A
%   Index data tags & \meta{pattern}\texttt{!TAG} &
%     idxtag & \texttt{\ShowPattern{Demetrius, I}{!TAG}}\\
%
%   Name data tags & \meta{pattern}\texttt{!DB} & namedb &
%     \texttt{\ShowPattern{Aristotle}{!DB}}\\\bottomrule
% \end{tabular}
% \end{center}
%
% Next we see what macros write patterns to what systems. \cmd{\IndexName} does not generate a name pattern. This lets cross-references determine the index control logic.
%
% \begin{center}
% \begin{tabular}{lcccccc}\toprule[1pt]
%   \bfseries Macros & \bfseries \ttfamily \,!NF\, & \bfseries \ttfamily \,!MN\, &
%     \bfseries \ttfamily \,!PN\, & \bfseries \ttfamily !PRE &
%     \bfseries \ttfamily !TAG & \bfseries \ttfamily \,!DB\,\\\midrule
%   \cmd{\Name} \cmd{\Name*} \cmd{\FName} \cmd{\FName*} & \YES & \YES & \NO &
%     \NO & \NO & \NO\\
%   \cmd{\ForgetName} \cmd{\SubvertName} & \YES & \YES & \NO &
%     \NO & \NO & \NO\\\midrule
%   \cmd{\PName} \cmd{\PName*} & \YES & \YES & \YES & \NO & \NO & \NO\\\midrule
%   \cmd{\AKA} \cmd{\AKA*} \cmd{\IndexRef} & \NO & \NO & \YES &
%     \NO & \NO & \NO\\
%   \cmd{\ExcludeName} & \NO & \NO & \YES & \NO & \NO & \NO\\
%   \cmd{\IncludeName} \cmd{\IncludeName*} & \NO & \NO & \YES &
%     \NO & \NO & \NO\\\midrule
%   \cmd{\PretagName} & \NO & \NO & \NO & \YES & \NO & \NO\\\midrule
%   \cmd{\TagName} \cmd{\UntagName} & \NO & \NO & \NO &
%     \NO & \YES & \NO\\\midrule
%   \cmd{\NameAddInfo} \cmd{\NameClearInfo} & \NO & \NO & \NO &
%     \NO & \NO & \YES\\\bottomrule
% \end{tabular}
% \end{center}
%
% \subsection{Indexing: States}
% \label{sec:RuleStates}
%
% Six distinct ``states'' describe any name pattern with respect to the index. They are derived using \cmd{\ShowNameState}. Below we show these states and what they mean.\medskip
%
% \begin{tcolorbox}
%   [colback=white,colframe=darkgray,
%   adjusted title={\bfseries\hfil State 1: No Name Information Present}]
%   \footnotesize
%   \begin{itemize}[leftmargin=1em,rightmargin=1em]
%   \item \Stay{\cmd{\IndexName} makes index page entry,
%     creates no name pattern control sequence}{1}
%   \item \Stay{\cmd{\TagName} makes index tag, creates a pattern
%     ending in \texttt{!TAG}; \cmd{\UntagName} destroys it}{1}
%   \item \Stay{\cmd{\PretagName} makes index sort tag, creates a
%     pattern ending in \texttt{!PRE} (do only once)}{1}
%   \item \Stay{\cmd{\ForgetName} is redundant; it cannot destroy
%     a control sequence that does not exist.}{1}
%   \item \Go{Naming macro makes name pattern (\texttt{!MN} or
%     \texttt{!NF}), prints name, makes two index page entries}{2}
%   \item \Go{\cmd{\SubvertName} makes a name pattern ending
%     either in \texttt{!MN} or in \texttt{!NF}, or both at once}{2}
%   \item \Go{\cmd{\IndexRef} makes an xref pattern ending with
%     \texttt{!PN}; that pattern expands to empty}{3}
%   \item \Go{\cmd{\SeeAlso}\cmd{\IndexRef} makes an xref pattern
%     ending with \texttt{!PN}; that pattern expands to empty}{3}
%   \item \Go{\cmd{\ExcludeName} makes an xref pattern ending with
%     \texttt{!PN}; that pattern expands to \texttt{!x!}}{5}
% \end{itemize}
% \end{tcolorbox}
%
% \begin{tcolorbox}
%   [colback=white,colframe=darkgray,
%   adjusted title={\bfseries\hfil State 2: Only a Name Pattern Exists}]
%   \footnotesize
%   \begin{itemize}[leftmargin=1em,rightmargin=1em]
%   \item \Stay{\cmd{\IndexName} makes index page entry, creates
%     no name pattern control sequence}{2}
%   \item \Stay{\cmd{\TagName} makes index tag, creates a pattern
%     ending in \texttt{!TAG}; \cmd{\UntagName} destroys it}{2}
%   \item \Stay{\cmd{\PretagName} is doable, but not recommended
%     (that will create spurious entries)}{2}
%   \item \Stay{Naming macro makes name pattern (\texttt{!MN} or
%     \texttt{!NF}), prints name, makes two index page entries}{2}
%   \item \Stay{\cmd{\SubvertName} is redundant; it cannot create
%     a control sequence that already exists.}{2}
%   \item \Stay{\cmd{\IndexRef} by itself does nothing because a
%     name pattern already exists}{2}
%   \item \Go{\cmd{\ForgetName} destroys a name pattern ending in
%     \texttt{!MN}, \texttt{!NF}, or both at once}{1}
%   \item \Go{\cmd{\SeeAlso}\cmd{\IndexRef} makes an xref pattern
%     ending with \texttt{!PN}; that pattern expands to empty}{4}
%   \item \Go{\cmd{\ExcludeName} makes an xref pattern ending with
%     \texttt{!PN}, that pattern expands to \texttt{!x!}}{6}
% \end{itemize}
% \end{tcolorbox}
%
% \begin{Quote}{\Name[Mark]{Twain}, \textit{The Innocents Abroad} (1869)}
% Virtue never has been as respectable as money.^^A
% \index{creatives, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \begin{tcolorbox}
%   [colback=white,colframe=darkgray,
%   adjusted title={\bfseries\hfil State 3: Only an Xref Pattern Exists}]
%   \footnotesize
%   \begin{itemize}[leftmargin=1em,rightmargin=1em]
%   \item \Stay{\cmd{\PretagName} is doable, but not recommended
%     (that will create spurious entries)}{3}
%   \item \Stay{\cmd{\TagName}, \cmd{\UntagName}, \cmd{\IndexName},
%     \cmd{\IndexRef} (also with \cmd{\SeeAlso}), \cmd{\ExcludeName},
%     and \cmd{\IncludeName} do nothing}{3}
%   \item \Stay{\cmd{\ForgetName} is redundant; it cannot destroy
%     a control sequence that does not exist.}{3}
%   \item \Go{\cmd{\Includename*} destroys an extant xref pattern
%     (\texttt{!PN})}{1}
%   \item \Go{Naming macro makes name pattern (\texttt{!MN} or
%     \texttt{!NF}), prints name, makes no index entries}{4}
%   \item \Go{\cmd{\SubvertName} creates a name pattern ending
%     either in \texttt{!MN} or in \texttt{!NF}, or both at once}{4}
% \end{itemize}
% \end{tcolorbox}
%
% \begin{tcolorbox}
%   [colback=white,colframe=darkgray,
%   adjusted title={\bfseries\hfil State 4: Both Name and
%   Xref Patterns Exist}]
%   \footnotesize
%   \begin{itemize}[leftmargin=1em,rightmargin=1em]
%   \item \Stay{\cmd{\PretagName} is doable, but not recommended
%     (that will create spurious entries)}{4}
%   \item \Stay{\cmd{\TagName}, \cmd{\UntagName}, \cmd{\IndexName},
%     \cmd{\IndexRef} (also with \cmd{\SeeAlso}), \cmd{\ExcludeName},
%     and \cmd{\IncludeName} do nothing}{4}
%   \item \Stay{Naming macro makes name pattern (\texttt{!MN} or
%     \texttt{!NF}), prints name, makes no index entries}{4}
%   \item \Stay{\cmd{\SubvertName} is redundant; it cannot create
%     a control sequence that already exists.}{4}
%   \item \Go{\cmd{\Includename*} destroys an extant xref pattern
%     (\texttt{!PN})}{2}
%   \item \Go{\cmd{\ForgetName} destroys a name pattern ending in
%     \texttt{!MN}, \texttt{!NF}, or both at once}{3}
% \end{itemize}
% \end{tcolorbox}
%
% \begin{tcolorbox}
%   [colback=white,colframe=darkgray,
%   adjusted title={\bfseries\hfil State 5: Only an Exclusion Exists}]
%   \footnotesize
%   \begin{itemize}[leftmargin=1em,rightmargin=1em]
%   \item \Stay{\cmd{\PretagName} is doable, but not recommended
%     (that will create spurious entries)}{5}
%   \item \Stay{\cmd{\TagName}, \cmd{\UntagName}, \cmd{\IndexName},
%     \cmd{\IndexRef} (also with \cmd{\SeeAlso}), and
%     \cmd{\ExcludeName} do nothing}{5}
%   \item \Stay{\cmd{\ForgetName} is redundant; it cannot destroy
%     a control sequence that does not exist.}{5}
%   \item \Go{\cmd{\Includename}, \cmd{\Includename*} destroy xref
%     pattern ending with \texttt{!PN}, expanding to \texttt{!x!}}{1}
%   \item \Go{Naming macro makes name pattern (\texttt{!MN} or
%     \texttt{!NF}), prints name, makes no index entries}{6}
%   \item \Go{\cmd{\SubvertName} creates a name pattern ending either
%     in \texttt{!MN} or in \texttt{!NF}, or both at once}{6}
% \end{itemize}
% \end{tcolorbox}
%
% \begin{Quote}{\Name[W.H.]{Auden}, \textit{Paris Review} interview (1972) p. 206}
% I don't think the mystical experience can be verbalized. When the ego disappears, so does power over language.^^A
% \index{creatives, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \begin{tcolorbox}
%   [colback=white,colframe=darkgray,
%   adjusted title={\bfseries\hfil State 6: Both Name Pattern and
%   Exclusion Exist}]
%   \footnotesize
%   \begin{itemize}[leftmargin=1em,rightmargin=1em]
%   \item \Stay{\cmd{\PretagName} is doable, but not recommended
%     (that will create spurious entries)}{6}
%   \item \Stay{\cmd{\TagName}, \cmd{\UntagName}, \cmd{\IndexName},
%   \cmd{\IndexRef} (also with \cmd{\SeeAlso}), and
%   \cmd{\ExcludeName} do nothing}{6}
%   \item \Stay{Naming macro makes name pattern (\texttt{!MN} or
%     \texttt{!NF}), prints name, makes no index entries}{6}
%   \item \Go{\cmd{\Includename}, \cmd{\Includename*} destroy xref
%     pattern ending with \texttt{!PN}, expanding to \texttt{!x!}}{2}
%   \item \Go{\cmd{\ForgetName} destroys a name pattern ending in
%     \texttt{!MN}, \texttt{!NF}, or both at once}{5}
% \end{itemize}
% \end{tcolorbox}
%
% \subsection{Debugging Macros}
% \label{sec:DebuggingMacros}
%
% \DescribeMacro{\ShowPattern}
% We use \cmd{\ShowPattern} in Section~\ref{sec:NamePatterns} to illustrate name control patterns. It displays how the name arguments create name patterns that form name control sequences. One can debug pattern collisions and other issues with this macro:
%
% \begin{SyntaxBox}
%   \cmd{\ShowPattern}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% Thus, |\texttt{\ShowPattern[Hernando]{de~Soto}}| will produce the output \JustIndex\Soto\texttt{\ShowPattern[Hernando]{de~Soto}}. As we have seen before, using \textsf{inputenc}/\textsf{fontenc} will cause names like |\texttt{\ShowPattern{Boëthius}}| to produce \texttt{\ShowPattern{Boëthius}}\JustIndex\Name{Bo\"ethius}.
%
% \DescribeMacro{\ShowIdxPageref}
% \cmd{\ShowIdxPageref} displays a full index entry in the text as if it were only a page entry, not a cross-reference.
%
% \begin{SyntaxBox}
%   \cmd{\ShowIdxPageref\ }\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% Index styles, \cmd{\PretagName}, and \cmd{\TagName} affect the output of \cmd{\ShowIdxPageref}. Active characters and macros appear as printed, not as in \texttt{idx} files. In a normal \LaTeX\ document, for example, if we mention \LSoto\ after setting up a sort tag (Section~\ref{sec:IndexSort}), we get the following:
%
% \begin{quote}
%   |\PretagName[Hernando]{de~Soto}{Desoto, Hernando}|
%
%   \IndexActual{@}\UntagName[Hernando]{de~Soto}
%   |\ShowIdxPageref[Hernando]{de~Soto}|\\
%   \ShowIdxPageref[Hernando]{de~Soto}
% \end{quote}
%
% We could not create index entries within the quote above in this \texttt{dtx} file because we changed \cmd{\IndexActual}. A \texttt{dtx} file uses a different default for \cmd{\IndexActual} (see Section~\ref{sec:IndexTag}). Here we get instead:
%
% \begin{quote}
%   |\PretagName[Hernando]{de~Soto}{Desoto, Hernando}|\\
%   \verb+\TagName[Hernando]{de~Soto}{\string|hyperpage}+
%
%   \TagName[Hernando]{de~Soto}{\string|hyperpage}
%   \IndexActual{=}
%   |\ShowIdxPageref[Hernando]{de~Soto}|\\
%   \ShowIdxPageref[Hernando]{de~Soto}
% \end{quote}
%
% \DescribeMacro{\ShowIdxPageref*}
% Throughout this manual, \cmd{\ShowIdxPageref*} illustrates basic index entries that do not contain sorting information or tags. The syntax is:
%
% \begin{SyntaxBox}
%   \cmd{\ShowIdxPageref*}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% Regardless of whether we have a normal \LaTeX\ document or a \texttt{dtx} file, we get:\JustIndex\Soto
%
% \begin{quote}
%   |\ShowIdxPageref*[Hernando]{de~Soto}|\\
%   \ShowIdxPageref*[Hernando]{de~Soto}
% \end{quote}
%
% \DescribeMacro{\ShowNameInfo}
% Here we can see how the macros that take name arguments interpret them. We can check our intent against what the package actually sees.
%
% \begin{SyntaxBox}
%   \cmd{\ShowNameInfo}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% Below we show several name forms. This macro shows detokenized name arguments to prevent potential errors and to disclose any macros in the name arguments, which are designated according to Section~\ref{sec:NameArgs}.
%
% \begin{itemize}\small
% \item   \Name*[J.E.]{Carter, Jr.}[James Earl]\dotfill^^A
%   |\Name*[J.E.]{Carter, Jr.}[James Earl]|
% \item[] |\ShowNameInfo[J.E.]{Carter, Jr.}[James Earl]|:\\
%   \ShowNameInfo[J.E.]{Carter, Jr.}[James Earl]
%
% \item   \Name*{Miyazaki, Hayao}[Sensei]\dotfill^^A
%   |\Name*{Miyazaki, Hayao}[Sensei]|
% \item[] |\ShowNameInfo{Miyazaki, Hayao}[Sensei]|:\\
%   \ShowNameInfo{Miyazaki, Hayao}[Sensei]
%
% \item   \Name*{Elizabeth, I}[I, ``Gloriana'']\dotfill^^A
%   |\Name*{Elizabeth, I}[I, ``Gloriana'']|
% \item[] |\ShowNameInfo{Elizabeth, I}[I, ``Gloriana'']|:\\
%   \ShowNameInfo{Elizabeth, I}[I, ``Gloriana'']
%
% \item   \Name*{Henry}[VIII]\ddag\dotfill |\Name*{Henry}[VIII]\ddag|
% \item[] |\ShowNameInfo{Henry}[VIII]| (obsolete syntax):\\
%   \ShowNameInfo{Henry}[VIII]
%
% \item   \Name*{Confucius}\dotfill |\Name*{Confucius}|
% \item[] |\ShowNameInfo{Confucius}|:\\
%   \ShowNameInfo{Confucius}
% \end{itemize}
%
% For the following examples we activate alternate formatting
% (Section~\ref{sec:AltFormat}), which permits typesetting more complex name forms seen in European academic writing. This use of small caps may generate harmless font substitution warnings.
%
% \AltFormatActive
% \begin{itemize}\small
% \item   \ForgetThis\LStriet\\
%   |\ForgetThis\Name[John]{\noexpand\de{Strietelmeier}|
% \item[] |\ShowNameInfo[John]{\noexpand\de{Strietelmeier}}|:\\
%   \ShowNameInfo[John]{\noexpand\de{Strietelmeier}}
%
% \item   \Cath\\
%   |\Name[Catherine \noexpand\AltCaps{d}e']{\noexpand\textSC{Medici}}|
% \item[] |\ShowNameInfo[Catherine \noexpand\AltCaps{d}e']|\\
%   |{\noexpand\textSC{Medici}}|:\\
%   \ShowNameInfo[Catherine \noexpand\AltCaps{d}e']{\noexpand\textSC{Medici}}
%
% \item   \Luth\\
%   |\Name[Martin]{\noexpand\textSC{Luther}}|
% \item[] |\ShowNameInfo[Martin]{\noexpand\textSC{Luther}}|:\\
%   \ShowNameInfo[Martin]{\noexpand\textSC{Luther}}
%
% \item Using \cmd{\noexpand} before macros in name arguments ``fixates'' them, ensuring consistency (important for name patterns and the index):
% \begin{itemize}
%   \item   |\ShowNameInfo[John]{\noexpand\de{Strietelmeier}}|
%   \item[] \ShowNameInfo[John]{\noexpand\de{Strietelmeier}}
%   \item   |\ShowNameInfo[John]{\de{Strietelmeier}}|
%   \item[] \footnotesize\ShowNameInfo [John]{\de{Strietelmeier}}
% \end{itemize}
%
% \item If one uses an undefined macro in the arguments,
%   but precedes it with \cmd{\noexpand}, \cmd{\ShowNameInfo}
%   will not generate an error.
% \begin{itemize}
%   \item   |\ShowNameInfo{\noexpand\SomeUndefinedMacro}|
%   \item[] \ShowNameInfo{\noexpand\SomeUndefinedMacro}
% \end{itemize}
% \end{itemize}
% \AltFormatInactive
% \negbigskip
%
% \NameArgWarning
%
% \phantomsection
% \label{page:NameState}
% \DescribeMacro{\ShowNameState}
% With this macro we can see all the systems with which a name pattern is associated and the current index ``state'' described in Section~\ref{sec:RuleStates}. Its syntax is:
%
% \begin{SyntaxBox}
%   \cmd{\ShowNameState}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% \cmd{\ShowNameState} produces a line of text with the following information:
%
% \begin{itemize}
% \item Base name pattern, the base control pattern that
%   \textsf{nameauth} sees. This would be the output of \cmd{\ShowPattern}.
% \item Type of name, referring to how the name in the argument was parsed.
%
% \begin{itemize}[leftmargin=3.7em]
% \item[w :] Western (regardless of whether it is reversed)
% \item[nw :] nonwestern (regardless of whether it is reversed)\\
%   current syntax
% \item[nw,os :] nonwestern name, obsolete syntax (Section~\ref{sec:Obsolete})
% \end{itemize}
%
% \item Index state (Section~\ref{sec:RuleStates}) shows what index-related
%   options are permissible and how the indexing macros will behave.
% \begin{itemize}[leftmargin=3.7em]
% \item[states :] 1, 2, 3, 4, 5, and 6
% \end{itemize}
%
% \item All the control systems (Section~\ref{sec:NamePatterns}) that
%   the name pattern inhabits.
% \begin{itemize}[leftmargin=4.5em]
% \item[systems :] front, main, xref, excl, pretag, idxtag, namedb.
% \end{itemize}
% \end{itemize}
%
% In the next example we show names in indexing states from one to six, and we illustrate all name types and many of the control systems. All extant names have index tags due to being used in a \texttt{dtx} file with the \textsf{ltxdoc} class and the \textsf{hypdoc} package (Section~\ref{sec:SpecialTag}). Otherwise, names need not always have a control pattern in the \texttt{idxtag} system.
%
% \begin{itemize}
% \item Some yet unused name:\dotfill |\ShowNameState{Not Seen, Yet}|\\
%   \ShowNameState{Not Seen, Yet}
%
% \item New and extant names:
% \begin{itemize}
%   \item \Name*[Rudolph]{Carnap}\dotfill |\Name*[Rudolph]{Carnap}|\\
%     \ShowNameState[Rudolph]{Carnap}
%
%   \item \Name*{Henry, VIII}\dotfill |\Name*{Henry, VIII}|\\
%     \ShowNameState{Henry, VIII}
%
%   \item \Name*{Henry}[VIII]\ddag\dotfill |\Name*{Henry}[VIII]\ddag|\\
%     \ShowNameState{Henry}[VIII]
%
%   \item \Name*{Thomas, à~Kempis}\dotfill |\Name*{Thomas, à~Kempis}|\\
%     \ShowNameState{Thomas, à~Kempis}
% \end{itemize}
%
% \item Name used only in xref:\dotfill^^A
%   |\IndexRef{Sun King}{Louis XIV}|\IndexRef{Sun King}{Louis XIV}\\
%   \ShowNameState{Sun King}
%
% \item Name used after xref exists:\\
%   \Name*{Sun King}\dotfill |\Name*{Sun King}|\\
%   \ShowNameState{Sun King}
%
% \item Unused name excluded from index:\dotfill^^A
%   \ExcludeName{Santa, Claus}|\ExcludeName{Santa, Claus}|\\
%   \ShowNameState{Santa, Claus}
%
% \item Previously excluded name gets used:\\
%   \Name*{Thomas,\`a~Kempis}\dotfill |\Name*{Thomas,\`a~Kempis}|\\
%   \ShowNameState{Thomas,\`a~Kempis}
% \end{itemize}
% \negbigskip
%
% \ReturnLink\smallskip
%
% \AltFormatActive
% \begin{Quote}{\ForgetThis\Luth\break
% \hbox{}\hfill \textit{\de{Von der Freiheit eines Christenmenschen}} (1520)}
% \de{Eyn Chriſten menſch iſt eyn freyer herr /
% u\raise 0.2ex\hbox{\kern -1.1ex\textsuperscript{e}\kern 1pt}ber alle
% ding / und niemande unterthan. Eyn Chriſten menſch iſt eyn dienſtpar
% knecht aller ding und yderman unterthan.}
% 
% (A Christian person is a free lord, above all things, and subject to no one. A Christian person is a willing servant of all things and is subject to
% everyone.)^^A
% \index{theologians, quotes of\noexpand\string|hyperpage}
% \end{Quote}
% \AltFormatInactive
%
% \newpage
%
% \section{Indexing Macros}
% \label{sec:Indexing}
% \IndexWarnVerbose
%
% Indexing pulls together all the concepts from the previous sections, yet applies them to the index. In this section we enable (and trigger) verbose index warnings.
%
% \subsection[General Control]{General Indexing Control}
% \label{sec:GeneralIndex}
%
% \subsubsection{Toggle Indexing}
%
% \DescribeMacro{\IndexInactive}
% \cmd{\IndexInactive} deactivates the indexing functions of the naming macros, as well as \cmd{\IndexName}, and \cmd{\IndexRef}.
% \DescribeMacro{\IndexActive}
% \cmd{\IndexActive} enables indexing. These can be used throughout the document. They do not affect indexing apart from \textsf{nameauth}.
%
% \begin{itemize}
% \item \cmd{\IndexInactive} broadly suppresses \cmd{\IndexName},
%   \cmd{\IndexRef}, and the indexing components of the naming macros,
%   \cmd{\AKA}, and \cmd{\PName}.
% \item For a fine degree of control, use \cmd{\ExcludeName} and
%   \cmd{\IncludeName}.
% \end{itemize}
%
% \cmd{\IndexActive}\Info{\cmd{\global}} and \cmd{\IndexInactive} can be used as a pair or singly within a group. They have top priority (Section~\ref{sec:Priorities}). Use \cmd{\global} to force a global  effect.
%
% \subsubsection{Multiple Indexes}
%
% \DescribeMacro{\NameauthIndex}
% \LaTeX\ has various ways to produce multiple indexes; see \href{https://www.texfaq.org/FAQ-multind}{\bfseries this page}. \cmd{\NameauthIndex} is the indexing hook defined by default as \cmd{\index}. Users can redefined this hook for use with multiple indexes. Below we use the \textsf{index} package to do this.
% \vspace{3ex}
% \Info{\hrule\strut Test indexing rules:\break
%   \Name{Yamaha, Torakusu}\label{page:Idx1}\break
%   create index entry:\break
%   \cmd{\IndexName}\break
%   \texttt{\{Nippon Gakki\}}\IndexName{Nippon Gakki}\strut\hrule}
% \vspace{-3ex}
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test07_01.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
%
% \usepackage{makeidx} % Must have for defining \seealso macro.
% \usepackage{index}
% \usepackage{nameauth}
%
% \makeindex %  Default index
% \newindex{per}{rdx}{rnd}{Index of Persons} %  Other index
% \renewcommand*\NameauthIndex{\index[per]}
%
% \begin{document}
%   The Electric Boogaloo\index{Boogaloo, Electric}\\ %  main index
%   was created by \Name{Ollie~\& Jerry}.             %  name index
%
%   \printindex[per] %  Shows the entry: Ollie & Jerry, 1
%
%   \renewcommand\indexname{Index of Subjects}
%   \printindex      %  Shows the entry: Boogaloo, Electric, 1
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\NameauthTestFile}
% \end{quote}
%
% \subsubsection{Verbose Warnings}
%
% \DescribeMacro{\IndexWarnVerbose}
% As with many of the other options in \textsf{nameauth}, we have added two macros that toggle verbose index warnings like the  \texttt{verbose} option (default is terse).
% \DescribeMacro{\IndexWarnTerse}
% To disable verbose warnings, use \cmd{\IndexWarnTerse}. To enable verbose warnings, use the \texttt{verbose} option or \cmd{\IndexWarnVerbose}. Throughout Section~\ref{sec:Indexing} we enable verbose warnings.
% 
% \cmd{\IndexWarnVerbose}\Info{\cmd{\global}} and \cmd{\IndexWarnTerse} can be used as a pair or singly within a group. They have the same priority as the \texttt{verbose} option, but they do not affect what is displayed in the document. Use \cmd{\global} to force a global effect.
%
% \subsubsection{Index Protection}
%
% \DescribeMacro{\IndexProtect}
% This macro prevents naming macros from producing output, both in the text and in the index. It is local in scope. Its primary use is to prevent errors in the index, in case the naming macros get passed as arguments to themselves or passed into index entries by mistake. The core naming engine uses internal locks to protect against this problem in the text.
%
% One can use \cmd{\IndexProtect} right before \cmd{\printindex} to protect the index against bogus output. For example:
%
% \vspace{4ex}
% \Info{\hrule\strut Test indexing rules:\break
% \Name{Yamaha, Torakusu}\label{page:Idx2}\strut\hrule}
% \vspace{-4ex}
% \begin{itemize}
% \item |\Name{foo\Name{bar}}| in the text generates \Name{foo\Name{bar}}.
%   Notice that the internal locks prevent |\Name{bar}| from producing
%   output in the text.
% \item The first \LaTeX\ pass creates |\indexentry{foo\Name {bar}}|
%   in the \texttt{idx} file. With enough passes, using also
%   \texttt{makeindex}, in the \texttt{ind} file we get both
%   |\item foo\Name {bar}| from the text and an additional
%   |\item bar| from the macro executed in the index.
% \item That gives one index entry ``foo{\NamesFormat bar}'' and
%   another entry ``bar''.
% \item Using \cmd{\IndexProtect} \cmd{\printindex} still permits
%   the index entry generated by |\item foo\Name {bar}|, but it does not
%   allow |\Name {bar}| to generate any output or additional entries
%   in the index.
% \item We get only one entry ``foo'', similar to what we see in the text.
%   This manual uses the tag \S\ for \cmd{\Name\{foo}\cmd{\Name\{bar\}\}},
%   not shown in the example for the sake of clarity.
% \end{itemize}
%
% \subsection{Page Entries}
% \label{sec:IndexPageno}
%
% \DescribeMacro{\IndexName}
% The internal version of this macro is used also by the naming macros. This is the user interface to create index page entries in the same way that the naming macros do. \cmd{\IndexName} prints nothing in the body text.
%
% \begin{SyntaxBox}
%   \cmd{\IndexName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% If \meta{FNN} is present, it ignores \meta{Alternate} for Western and ``native'' Eastern name forms. If \meta{FNN} is absent, \cmd{\IndexName} can use either the current or the obsolete nonwestern syntax (Section~\ref{sec:Obsolete}). Indexing follows [\hyperlink{Mulvany}{Mulvany}, 152--82]. The points below deal with macros explained in Section~\ref{sec:IdxPrefix}.
%
% \begin{itemize}
% \item \cmd{\IndexName} obeys both \cmd{\IndexInactive} and
%   \cmd{\IndexActive}, which are used to deactivate and activate indexing.
% \item \cmd{\IndexName} does not obey \cmd{\SkipIndex}. The latter
%   only works with macros that display a name in the text, which
%   \cmd{\IndexName} does not.
% \item \cmd{\IndexName} will not make page entries for any names that are
%   excluded by \cmd{\ExcludeName}. Nor will it make entries names that
%   have been used to create cross-references.
% \item \cmd{\IndexName} resets the effects of both \cmd{\SeeAlso} and
%   \cmd{\SkipIndex} unless one uses the \texttt{oldreset} option.
% \item Section~\ref{sec:IdxPrefix} shows behavior among
%   \cmd{\SkipIndex}, \cmd{\JustIndex}, and the naming macros that
%   differs from the same macros and \cmd{\IndexName}.
% \end{itemize}
%
% \subsection{Cross-References}
% \label{sec:IndexRef}
%
% Index cross-references have two kinds. \textit{See} references only point from a name to other name entries containing page entries. \textit{See also} references occur at the end of an entry with page entries or sub-entries.
%
% \subsubsection[Basic Macro]{Basic Macros for Both Kinds of Xrefs}
%
% \DescribeMacro{\IndexRef}
% By default, \cmd{\IndexRef} creates a \textit{see} reference from the name defined by its first three arguments to the target in its final argument. To create a \textit{see also} reference, one must precede it with \cmd{\SeeAlso} (Section~\ref{sec:IdxPrefix}). Thus, the two forms used are:
%
% \begin{SyntaxBox}
%   \phantom{\cmd{\SeeAlso}}\cmd{\IndexRef}\oarg{FNN}\marg{SNN|,|
%     Affix}\oarg{Alternate}\marg{Target}\\
%   \cmd{\SeeAlso}\cmd{\IndexRef}\oarg{FNN}\marg{SNN|,|
%     Affix}\oarg{Alternate}\marg{Target}
% \end{SyntaxBox}
%
% Although it might be redundant to point this out, in practice, when using \cmd{\IndexName} and \cmd{\IndexRef}, one might forget that the latter has four arguments, at least two of which are required. Missing text and bad xrefs can result.
%
% \begin{itemize}
% \item Define \textit{see} references \emph{before} making any
%   \cmd{\Name} entries for them.
% \vspace{-1ex}
% \Info{\hrule\strut Test indexing rules:\break
%   Creating \textit{see also} xref\break\footnotesize
%   \cmd{\SeeAlso}\cmd{\IndexRef}\break\ttfamily
%   \{Yamaha, Torakusu\}\break
%   \{Nippon Gakki\}\SeeAlso\IndexRef{Yamaha, Torakusu}{Nippon Gakki}^^A
%   \label{page:Idx3}\strut\hrule}
% \vspace{1ex}
% \item Define \textit{see also} references \emph{after} all
%   \cmd{\Name} instances to the respective names have been created.
% \item \cmd{\IndexRef} will not alter or repeat extant cross-references.
% \item \cmd{\IndexRef} will not cross-reference names excluded
%   by \cmd{\ExcludeName}.
% \item \cmd{\IndexRef} will not add a \textit{see} cross-reference
%   that would map also to an extant name control pattern, unless one
%   uses the \texttt{oldsee} option. A fuller explanation of this
%   non-trivial fact lies in Section~\ref{sec:RuleStates}, illustrated
%   by a state diagram. A page entry usually correlates with a name
%   control pattern, but that may not always be the case. We check for
%   a control sequence (name pattern); usually, a page entry also exists.
% \item \cmd{\IndexName} resets the effects of both \cmd{\SeeAlso}
%   and \cmd{\SkipIndex}, unless one uses the \texttt{oldreset} option.
% \item To have multiple names and cross-references interact, see
%   Section~\ref{sec:IdxVariants}.
% \end{itemize}
%
% \cmd{\IndexRef} prints nothing in the text. The name parsing is like \cmd{\IndexName}. The final argument is not checked in any way. For example:
%
% \begin{quote}
%   \vspace{3ex}
%   \Info{\strut\footnotesize Name Pattern(s):\hfill
%   \break\ttfamily\ShowPattern{Sun King}!PN}
%   \vspace{-3ex}
%   \begin{tabular}{ll}
%     source: & \cmd{\IndexRef}\texttt{\{Sun King\}\{Louis XIV\}}^^A
%       \IndexRef{Sun King}{Louis XIV}\\[0.5ex]
%     index: & Sun King \textit{see} Louis XIV\\
%   \end{tabular}
% \end{quote}
%
% \cmd{\IndexRef} will not merge multiple cross-references and it will not allow more than one cross-reference. For multiple cross-references one must use something like the following example, or create manual index entries:
%
% \begin{quote}
%   \begin{tabular}{ll}
%     source: & |\IndexRef{bar}{baz; foo}|\\[0.5ex]
%     index: & bar, \textit{see} baz; foo\\
%   \end{tabular}
% \end{quote}
%
% \newpage
%
% \subsubsection[Fine Control]{Fine Control of Xref Logic}
% \label{sec:IdxFine}
%
% Here we show how the index control logic pertinent to cross-references can be extended to establish fine-grained control that can exclude or include names.
%
% \DescribeMacro{\ExcludeName}
% We can prevent a name from being used as either an index entry or as an index cross-reference. This macro will not exclude extant cross-references:
%
% \begin{SyntaxBox}
%   \cmd{\ExcludeName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% Unlike \cmd{\IndexInactive} and \cmd{\IndexActive}, which prevent and permit all indexing, \cmd{\ExcludeName} only excludes a specific name from being printed as a page entry or cross-reference in the index. See the following example, as well as examples in Sections~\ref{sec:NameParticles} and \ref{sec:VarNames}. Indexing remains active:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \ExcludeName{Mr. Baseball}
% In this example we cannot get page entries for
% \Name{Mr. Baseball}, the nickname of
% \Name[Bob]{Uecker}, because it was excluded.
% \end{VerbatimOut}
%
% \begin{quote}
%   \vspace{3ex}
%   \PatInfo{\ShowPattern{Mr. Baseball}!PN\break
%     \ShowPattern[Bob]{Uecker}!MN}
%   \vspace{-3ex}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% \DescribeMacro{\IncludeName}
% Use the following macros to break a few indexing rules. They remove protections used for exclusion and cross-referencing.
% \DescribeMacro{\IncludeName*}
% They have the same syntax as \cmd{\ExcludeName}:
%
% \begin{SyntaxBox}
%   \cmd{\IncludeName\ }\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}\\
%   \cmd{\IncludeName*}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% \cmd{\IncludeName} removes an exclusion attached to a name by \cmd{\ExcludeName}. \cmd{\IncludeName*} completely erases both exclusion and cross-reference information. Once that protection is removed, one can create page entries to a name in the index that had been used as a cross-reference.
%
% Analogously, \cmd{\ForgetName} (Section~\ref{sec:NameControl}) removes name control patterns, allowing one to create a cross-reference. Section~\ref{sec:RuleStates} explains this behavior as a set of states. Below we run some tests (cf. Section~\ref{sec:NameTests}) and produce a few warnings because verbose warnings are active here.
% \vspace{3ex}
% \Info{\hrule\strut Test indexing rules:\break
%   \Name{Yamaha, Torakusu}\label{page:Idx4}\strut\hrule}
% \vspace{-3ex}
%
% \begin{VerbatimOut}{\jobname.tmp}
% \begin{itemize}
% \item \Name*{Mr. Baseball} is
%   \IfAKA{Mr. Baseball}
%     {\meta{an xref}}{\meta{a name}}{\meta{excluded}}.
%
% \item Making an xref fails.\IndexRef{Mr. Baseball}{Uecker, Bob}
%   \Name*{Mr. Baseball} is still
%   \IfAKA{Mr. Baseball}
%    {\meta{an xref}}{\meta{a name}}{\meta{excluded}}.
%
% \item The inclusion macro\IncludeName{Mr. Baseball} makes it
%   \IfAKA{Mr. Baseball}
%     {\meta{an xref}}{\meta{a name}}{\meta{excluded}}.
%   Now we could create page entries with a naming macro.
%
% \item Instead, we forget the name\ForgetName{Mr. Baseball}
%   to destroy the name pattern that governs the name. It is now
%   \IfAKA{Mr. Baseball}
%     {\meta{an xref}}
%     {\IfMainName{Mr. Baseball}{\meta{extant}}
%       {\IfFrontName{Mr. Baseball}{\meta{extant}}
%         {\meta{destroyed}}}}
%     {\meta{excluded}}.
%
% \item Making another xref\IndexRef{Mr. Baseball}{Uecker, Bob} creates
%   \IfAKA{Mr. Baseball}
%     {\meta{an xref}}{\meta{a name}}{\meta{excluded}}.
% \end{itemize}
% \end{VerbatimOut}
% 
% \begin{quote}
% \VerbatimInput[gobble=0]{\jobname.tmp}
% 
% \input{\jobname.tmp}
% \end{quote}
%
% Cross-references get more protection than exclusions: 
% \vspace{-1ex}
% \PatInfo{\ShowPattern[J.D.]{Rockefeller, IV}!MN\break
%   \ShowPattern[Jay]{Rockefeller}!PN\break
%   \ShowPattern[Jay]{Rockefeller}!MN}
% \vspace{1ex}
% \begin{VerbatimOut}{\jobname.tmp}
% \begin{itemize}
% \item \DropAffix\LJRIV[Jay] was indexed as
% ``\ShowIdxPageref*[J.D.]{Rockefeller, IV}.
%
% \item We create the
%   xref\IndexRef[Jay]{Rockefeller}{Rockefeller, J.D., IV}.
%
% \item The test calls \SJRIV[Jay] an
%   \IfAKA[Jay]{Rockefeller}{\meta{xref}}{\meta{name}}{}.
%
% \item After being ``included''\IncludeName[Jay]{Rockefeller}
%   he still is an
%   \IfAKA[Jay]{Rockefeller}{\meta{xref}}{\meta{name}}{}.
%
% \item After ``forced inclusion''\IncludeName*[Jay]{Rockefeller}
%   he can be a \IfAKA[Jay]{Rockefeller}{\meta{xref}}{\meta{name}}{}
%   and create page entries.
% \end{itemize}
% \end{VerbatimOut}
%
% \begin{quote}
% \VerbatimInput[gobble=0]{\jobname.tmp}
% 
% \input{\jobname.tmp}
% \end{quote}
%
% \begin{InfoBox}
% Using \cmd{\IncludeName*} is necessary when creating index sub-entries for a name using \cmd{\IndexTag}. If one creates a cross-reference in any sub-entry of a name, \cmd{\IncludeName*} will permit additional page entries to be made for the other sub-entries of that name or for the name itself. See Section~\ref{sec:CatSub}.
% \end{InfoBox}
%
% \subsection[Prefix Macros]{Prefix Macros Used for Indexing}
% \label{sec:IdxPrefix}
%
% Indexing macros ignore Boolean flags meant for naming macros. Yet there are three prefix macros that affect indexing: \cmd{\SeeAlso}, \cmd{\SkipIndex}, and \cmd{\JustIndex}.
%
% \DescribeMacro{\SeeAlso}
% Put \cmd{\SeeAlso} before \cmd{\IndexRef}, \cmd{\AKA}, and \cmd{\PName} (Section~\ref{sec:AKA}) to make a \textit{see also} reference for a name that has appeared already in the index. If enabled before invoking \cmd{\PName}, \cmd{\SeeAlso} will be disabled when the regular name is generated, then enabled when the cross-reference is generated.
% \vspace{3ex}
% \Info{\hrule\strut Test indexing rules:\break
%   \Name{Nippon Gakki}\label{page:Idx5}\strut\hrule}
% \vspace{-3ex}
%
% \begin{VerbatimOut}{\jobname.tmp}
% One can refer to \Name[the]{Rat Pack} as a group of entertainers
% including \Name[Sammy]{Davis, Jr.}, \Name[Dean]{Martin}, and
% \Name[Frank]{Sinatra}. No more page entries for
% \Name*[the]{Rat Pack} will occur after this line, and a
% \textit{see also} xref will exist.
% \SeeAlso\IndexRef[the]{Rat Pack}
% {Davis, Sammy, Jr.; Martin, Dean; Sinatra, Frank}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% Currently \cmd{\IndexName} and other \textsf{nameauth} macros that create index entries will reset the Boolean flag governed by \cmd{\SeeAlso} unless one uses the \texttt{oldreset} option. preventing a stray use of the macro from affecting the index.
%
% \DescribeMacro{\SkipIndex}
% The prefix macro \cmd{\SkipIndex} will suppress indexing for just one instance of a name displayed by a naming macro. |\SkipIndex\Name[Monty]{Python}| produces \SkipIndex\Name[Monty]{Python} in the text, but with no index entry. \cmd{\SkipIndex} works with the naming macros. Side effects include:
%
% \begin{itemize}
% \item Unless the \texttt{oldreset} option is used, both \cmd{\IndexName}
%   and \cmd{\IndexRef} issue warnings if \cmd{\SkipIndex} precedes them.
%   Then, both \cmd{\IndexName} and \cmd{\IndexRef} ignore \cmd{\SkipIndex}
%   and reset its flag.
%
% \item When the \texttt{oldreset} option is used, both \cmd{\PName}
%   and \cmd{\PName*} issue warnings when
%   {\ttfamily \string \if@nameauth@SkipIndex} is true on exit.
% \end{itemize}
%
% \DescribeMacro{\JustIndex}
% This prefix macro makes \cmd{\Name}, \cmd{\Name*}, \cmd{\FName}, and the quick interface shorthand macros act similar to \cmd{\IndexName}. \cmd{\JustIndex} suppresses name output in the text, but flags for long and first name forms are reset as if the naming macro had produced output. Using the \texttt{oldreset} option prevents these flags from being reset, completely mimicking a call to \cmd{\IndexName}.
%
% \begin{center}
% \begin{tabular}{lll}\toprule
% \rowcolor{nagrey}^^A
%   \bfseries Option & \bfseries Output & \bfseries Source\\
%
%   default & \JustIndex\SWash \Wash & |\JustIndex\SWash \Wash|\\
%
%   default & \JustIndex\LWash \Wash & |\JustIndex\LWash \Wash|\\
%
% \rowcolor{nagrey}^^A
% \makeatletter\global\@nameauth@OldPasstrue\makeatother^^A
%   \ttfamily oldpass & \JustIndex\SWash \Wash &
%     |\JustIndex\SWash \Wash|\\
% \rowcolor{nagrey}^^A
%   \ttfamily oldpass & \JustIndex\LWash \Wash &
%     |\JustIndex\LWash \Wash|\\\bottomrule
% \makeatletter\global\@nameauth@OldPassfalse\makeatother^^A
% \end{tabular}
% \vspace{-16ex}\PatInfo{\ShowPattern[George]{Washington}!MN}\vspace{14ex}
% \end{center}
%
% There are potential side effects related to \cmd{\JustIndex}:
%
% \begin{itemize}
% \item Both \cmd{\AKA} and \cmd{\PName} ignore \cmd{\JustIndex}
%   and go on about their business. They also set
%   \cmd{\@nameauth@JustIndexfalse}.
% \item \cmd{\JustIndex} resets the flags set by \cmd{\ForgetThis}
%   and \cmd{\SubvertThis}, preventing them from passing through.
% \item The following three lines are equivalent:
% \begin{itemize}
% \phantomsection
% \Info{\hrule\strut Test indexing rules:\break
%   Creating \textit{see} xref\break\footnotesize 
%   \cmd{\IndexRef}\ttfamily \{Nippon Gakki\}\break
%   \{Yamaha Corp.\}^^A
%   \IndexRef{Nippon Gakki}{Yamaha Corp.}^^A
%   \label{page:Idx6}\strut\hrule}
%   \item\cmd{\JustIndex} \cmd{\SkipIndex}
%     \cmd{\Name\{A\}} \cmd{\Name\{B\}}
%   \item\cmd{\SkipIndex} \cmd{\JustIndex}
%     \cmd{\Name\{A\}} \cmd{\Name\{B\}}
%   \item\cmd{\JustIndex} \cmd{\Name\{A\}}
%     \cmd{\SkipIndex} \cmd{\Name\{B\}}
% \end{itemize}
%   \cmd{\JustIndex} takes priority with \cmd{\Name\{A\}} and passes
%     \cmd{\SkipIndex} to \cmd{\Name\{B\}}
%     (see also Section~\ref{sec:Priorities}).
% \item \cmd{\JustIndex} and the naming macros do not replace \cmd{\IndexRef}.
% \end{itemize}
%
% \subsection{Automatic Rules}
% \label{sec:IdxRules}
%
% Below we indicate what to expect regarding index rules in any given state. Here we do not attempt to concatenate page ranges. Above, we put a series of names and cross-references in margin notes, Here is the result:
%
% \begin{center}\footnotesize
% \begin{tabular}{rp{0.3\textwidth}p{0.5\textwidth}}\toprule
% \rowcolor{nagrey}^^A
%   \bfseries Page & \bfseries Macro & \bfseries Index Result\\
%
%   \pageref{page:Idx1} &
%        \cmd{\Name\{Yamaha, Torakusu\}}\par
%        \cmd{\IndexName\{Nippon Gakki\}} &
%   \ShowIdxPageref*{Yamaha, Torakusu}, \pageref{page:Idx1}\par
%   \ShowIdxPageref*{Nippon Gakki}, \pageref{page:Idx1}\\
%
%   \rowcolor{nagrey}^^A
%   \pageref{page:Idx2} &
%        \cmd{\Name\{Yamaha, Torakusu\}} &
%   \ShowIdxPageref*{Yamaha, Torakusu}, \pageref{page:Idx1},
%     \pageref{page:Idx2}\par
%   \ShowIdxPageref*{Nippon Gakki}, \pageref{page:Idx1}\\
%
%   \pageref{page:Idx3} &
%   \cmd{\SeeAlso}\cmd{\IndexRef\{Yamaha,}\par
%     \texttt{Torakusu\}\{Nippon Gakki\}} &
%   \ShowIdxPageref*{Yamaha, Torakusu}, \pageref{page:Idx1},
%     \pageref{page:Idx2} \textit{see also} Nippon Gakki\par
%   \ShowIdxPageref*{Nippon Gakki}, \pageref{page:Idx1}\\
%
%   \rowcolor{nagrey}^^A
%   \pageref{page:Idx4} &
%        \cmd{\Name\{Yamaha, Torakusu\}} &
%   \ShowIdxPageref*{Yamaha, Torakusu}, \pageref{page:Idx1},
%     \pageref{page:Idx2} \textit{see also} Nippon Gakki\par
%   \ShowIdxPageref*{Nippon Gakki}, \pageref{page:Idx1}\\
%
%   \pageref{page:Idx5} &
%            \cmd{\Name\{Nippon Gakki\}} &
%   \ShowIdxPageref*{Yamaha, Torakusu}, \pageref{page:Idx1},
%     \pageref{page:Idx2} \textit{see also} Nippon Gakki\par
%   \ShowIdxPageref*{Nippon Gakki}, \pageref{page:Idx1}, \pageref{page:Idx5}\\
%
%   \rowcolor{nagrey}^^A
%   \pageref{page:Idx6} &
%   \cmd{\IndexRef\{Nippon Gakki\}}\par \texttt{\{Yamaha Corp.\}} &
%   \ShowIdxPageref*{Yamaha, Torakusu}, \pageref{page:Idx1},
%     \pageref{page:Idx2} \textit{see also} Nippon Gakki\par
%   \ShowIdxPageref*{Nippon Gakki}, \pageref{page:Idx1},
%     \pageref{page:Idx5}\\\bottomrule
% \end{tabular}
% \end{center}
%
% \begin{enumerate}
% \item On page \pageref{page:Idx1}^^A
%   \PatInfo{\ShowPattern{Yamaha,Torakusu}!MN}
%   there are no name control patterns (Section~\ref{sec:NamePatterns})
%   for either a name or a cross-reference. Then the name
%   \Name*{Yamaha, Torakusu} comes into being, along with its control
%   pattern. A pair of index page entries are generated, one before and
%   one after the name.
% \item[] Also on \pageref{page:Idx1} an index page entry is created for
%   \Name{Nippon Gakki}, whose control pattern does not yet exist.
% \item On page \pageref{page:Idx2}^^A
%   \PatInfo{\ShowPattern{Yamaha,Torakusu}!MN}
%   the name \Name{Yamaha, Torakusu} appears again. Since a control
%   pattern exists, a short form is printed and two index page entries
%   are generated.
% \item On page \pageref{page:Idx3}^^A
%   \PatInfo{\ShowPattern{Yamaha,Torakusu}!PN}
%   we create a \textit{see also} cross-reference from
%   \Name*{Yamaha, Torakusu} to the name \Name{Nippon Gakki}. Now a
%   cross-reference pattern exists for Mr. \Name{Yamaha, Torakusu}.
%   We can no longer create index page entries for him.
% \item On page \pageref{page:Idx4} we attempt to make an index page
%   entry to Mr. \Name{Yamaha, Torakusu} by invoking his name. That
%   attempt fails due to the extant xref.
% \item On page \pageref{page:Idx5}^^A
%   \PatInfo{\ShowPattern{Nippon Gakki}!MN}
%   we print the name \Name{Nippon Gakki}, bringing its name control
%   sequence into being. Even though it was the \emph{target} of an xref,
%   that does not restrict the ability to make page entries for it.
% \item On page \pageref{page:Idx6}^^A
%   \PatInfo{\ShowPattern{Yamaha Corp.}!MN}
%   we attempt to create a \textit{see} cross-reference from
%   \Name{Nippon Gakki} to the name \Name{Yamaha Corp.}. (Notice that
%   the extra full stop in the text gets gobbled.) That fails because,
%   unlike a \textit{see also} reference, a \textit{see} reference
%   cannot be created when a name control pattern already exists.
% \end{enumerate}
%
% This manual's index entries for \Name{Nippon Gakki} and \Name{Yamaha Corp.} will also include this page in addition to those shown above.
%
% \subsection[Sorting Names]{Sorting Names in the Index}
% \label{sec:IndexSort}
%
% When using \texttt{makeindex}, all names with characters outside the ASCII range \texttt{[A–Za–z]} need to be sorted. All names with macros in their arguments need to be sorted. All names with particles need to be sorted. We do that with sort tags.
%
% \subsubsection{General Approach}
%
% \DescribeMacro{\IndexActual}
% Using \cmd{\index\{}\meta{sort key}\texttt{@}\meta{actual}\texttt{\}} works with both \texttt{makeindex} and \texttt{texindy}. The general practice for sorting with \texttt{makeindex -s} involves creating an \texttt{ist} file (pages 659--65 in \textit{The Latex Companion}).
%
% By default, the ``actual'' character is |@|. If one needs to change the ``actual'' character, such as when using \texttt{gind.ist} with \texttt{dtx} files, one would put |\IndexActual{=}| in the preamble (or driver section) before creating index entries with the naming macros. \cmd{\PretagName} does not care about the ``actual'' character, but it provides the information that is automatically added after that character. 
%
% Effects of \cmd{\IndexActual}\Info{\cmd{\global}} are local in scope. Use \cmd{\global} to make it otherwise, but that will affect every use of \cmd{\PretagName} thereafter. We demonstrate this scoping below as it pertains to \texttt{gind.ist} in a \texttt{dtx} file:
%
% \begin{quote}
%   \vspace{4ex}
%   \PatInfo{\ShowPattern{Ægidius}!PRE}
%   \vspace{-4ex}
% \begin{Verbatim}
% \PretagName{Ægidius}{Aegidius}
%
% In a \texttt{dtx} file the ``actual'' character is \texttt{=}.
% \begingroup
%   In a local scope we change to the normal character \texttt{@}
%   and show the index entry:
%   \texttt{\IndexActual{@}\ShowIdxPageref{Ægidius}}.
% \endgroup
% Now back to \texttt{dtx} mode: \texttt{\ShowIdxPageref{Ægidius}}.
% \end{Verbatim}
%
% \PretagName{Ægidius}{Aegidius}
%
% In a \texttt{dtx} file the ``actual'' character is \texttt{=}.
% \begingroup
%   In a local scope we change to the normal character \texttt{@}
%   and show the index entry:
%   \texttt{\IndexActual{@}\ShowIdxPageref{Ægidius}}.
% \endgroup
% Now back to \texttt{dtx} mode: \texttt{\ShowIdxPageref{Ægidius}}.
% \end{quote}
%
% \noindent \DescribeMacro{\PretagName}
% The \textsf{nameauth} package enables automatic index sorting using a ``pretag'' (cf. Section~\ref{sec:NamePatterns}). Unless the \texttt{nopretag} option is used (which results in warnings), \cmd{\PretagName} creates a sort key terminated with the ``actual'' character. Do not put the ``actual'' character in the ``pretag'':
%
% \begin{SyntaxBox}
%   \cmd{\PretagName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}\marg{tag}
% \end{SyntaxBox}
%
% \vspace{2ex}
% \PatInfo{\ShowPattern{Æthelred, II}!PRE\break
%   \ShowPattern[W.E.B.]{Du~Bois}!PRE\break
%   \ShowPattern{Æthelred, II}!MN\break
%   \ShowPattern[W.E.B.]{Du~Bois}!MN}
% \vspace{-2ex}
% One can ``pretag'' any name, any cross-reference, and even excluded names. Once made, sorting tags cannot be unmade. If one uses \cmd{\PretagName} in the preamble, those names will be sorted automatically throughout the document. For example:
%
% \begin{quote}
% \begin{Verbatim}
% \PretagName{Æthelred, II}{Aethelred 2}
% \PretagName[W.E.B.]{Du~Bois}{Dubois, William}
% \end{Verbatim}
% \end{quote}
%
% Every reference to \LAeth\ and \LDuBois\ is automatically tagged and sorted.\footnote{Regarding the margin note that shows name control sequences, with \texttt{pdflatex} and \texttt{latex}, in \texttt{\ShowPattern{Æthelred, II}} the glyphs \texttt{ÃĘ} correspond to \cmd{\IeC\{}\cmd{\AE\}}.} One should ``pretag'' all names that contain active characters or macros. That can differ when using \texttt{xindy} and Unicode-based \LaTeX.
%
% We keep the next example simple to illustrate the concept. We do not use alternate formatting because we do not capitalize, mutate, or segment the alias ``\textit{Doctor angelicus}'' (cf. Sections~\ref{sec:NameMedieval}, \ref{sec:AltFormat}). We create a \textit{see} reference before using this alias, for which no page entries will be generated. The name patterns are:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \PretagName{\textit{Doctor angelicus}}{Doctor angelicus}
% \IndexRef{\textit{Doctor angelicus}}{Thomas Aquinas}
%
% Perhaps the greatest medieval theologian was
% \Name{Thomas, Aquinas}, later known as
% \Name{\textit{Doctor angelicus}}.
% \end{VerbatimOut}
%
% \begin{quote}
%   {\ttfamily\ShowPattern{\textit{Doctor angelicus}}!PRE\\
%   \ShowPattern{\textit{Doctor angelicus}}!PN\\
%   \ShowPattern{Thomas, Aquinas}!MN\\
%   \ShowPattern{\textit{Doctor angelicus}}!MN}
%
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \IndexRef{\textit{Doctor angelicus}}{Thomas Aquinas}
%
%   Perhaps the greatest medieval theologian was
%   \Name{Thomas, Aquinas}, later known as
%   \Name{\textit{Doctor angelicus}}.
% \end{quote}
%
% To give \Name{\textit{Doctor angelicus}} page entries and a \textit{see also} reference, we omit line~2 above, wait until the end of the body text, after both names are fully indexed, and then use:
% \fbox{\cmd{\SeeAlso}\cmd{\IndexRef\{}\cmd{\textit\{Doctor angelicus\}\}\{Thomas Aquinas\}}}.
%
% \subsubsection*{\hfil Name Particles}
%
% Spaces change sorting. For example, the sort tag \texttt{De\textvisiblespace Soto} precedes \texttt{deal} due to the space therein. The sort tag \texttt{DeSoto} falls as expected between \texttt{derp} and \texttt{determinism}.
%
% \subsubsection*{\hfil Collating Sequences}
%
% German \textsf{ä ö ü ß} map to English \textsf{ae oe ue ss}. Yet Norwegian \textsf{æ ø å} follow \textsf{z} in that order. Check a style guide regarding collating sequences, spaces, and sorting. This is where using \texttt{xindy} can be very helpful. See also Section~\ref{sec:NameParticles}.
%
% \subsubsection*{\hfil Alternate Formatting}
%
% Additional examples starting with Section~\ref{sec:RealAltEx} deal with index sorting as it relates to alternate formatting, ``Continental'' practice, and macros in name arguments. Please ensure that such macros expand to the form desired in the index in order to get proper sorting with \cmd{\PretagName}.
%
% \begin{Quote}{\Name[Publius]{Vegetius Renatus}, \textit{De re militari} (c. 390)}
% Igitur qui desiderat pacem, praeparet bellum.
%
% (Accordingly, the person who would desire peace prepares for war.)^^A
% \index{Romans, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \subsubsection{Sorting Initials}
% \label{sec:IndexInitials}
% \negbigskip
%
% \begin{InfoBox}
% In order to sort the index consistently and properly, all names
% should be sorted by their longer name forms, not their initials.
% \end{InfoBox}
%
% Sorting \Name*[J.D.]{Rockefeller, IV} |\Name*[J.D.]{Rockefeller, IV}| presents a problem that does not occur with \Name*[Clive Staples]{Lewis} |\Name*[Clive Staples]{Lewis}|. In the case of \Name*[J.D.]{Rockefeller, IV}[Jay], the initials will appear in the index, while with \Name*[Clive Staples]{Lewis}[C.S.], the longer names will appear in the index.
%
% In \textsf{nameauth} we have a specific way to do that once per name, and all the remaining names will be sorted as expected. Before we use a name like \Name[J.D.]{Rockefeller, IV}, preferably in the preamble, we use the following macro:
%
% \begin{quote}
%   |\PretagName[J.D.]{Rockefeller, IV}{Rockefeller, John D 4}|
%   
%   \begin{itemize}
%   \item The index entry is ``\ShowIdxPageref*[J.D.]{Rockefeller, IV}''.
%   
%   \item In the ``pretag'' we spell out the first forename
%     and add enough of the second to get a unique sorting key.
%
%   \item We turn the Roman numeral affix into an Arabic numeral
%     so that it does not sort like letters.
%   \end{itemize}
% \end{quote}
%
% For more examples of handling alternate forms of surnames see Sections~\ref{sec:NameMedieval}, \ref{sec:VarNames}, all subsections of Section~\ref{sec:AdvancedFormat}, and~\ref{sec:AdvCustomize}.
%
% \subsection{Index Tags}
% \label{sec:IndexTag}
%
% Index data tags are information added automatically to index page entries for names used with \textsf{nameauth} macros.
%
% \subsubsection{General Approach}
%
% \DescribeMacro{\TagName}
% This macro creates a tag that persists until one changes it with \cmd{\TagName} or destroys it with \cmd{\UntagName}.
% \DescribeMacro{\UntagName}
% Tags can include life dates, regnal dates, and other information. Both \cmd{\TagName} and \cmd{\UntagName} have \emph{global scope} and handle arguments in the same way as \cmd{\IndexName}:
%
% \begin{SyntaxBox}
%  \cmd{\TagName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}\marg{tag}\\
%  \cmd{\UntagName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% All the indexing macros are keyed to the name patterns. \cmd{\PretagName} generates the leading sort key. \cmd{\TagName} and \cmd{\UntagName} affect the trailing content. The following graphic illustrates the ``segments'' of an index entry and the \textsf{nameauth} macros that affect the respective segments:
%
% \begin{center}
% \begin{tabular}{r|l|l|l}\toprule
% &                   & Naming macros\\
% & \cmd{\PretagName} & \cmd{\IndexName}\\
% \large\bfseries|\index{| & \large\bfseries|Aethelred 2@| &
%   \large\bfseries|Æthelred II| & \large\bfseries|, king}|\\
% & & & \cmd{\TagName}\\
% & & & \cmd{\UntagName}\\\bottomrule
% \end{tabular}
% \end{center}
%
% Tags created by \cmd{\TagName} can be helpful in the indexes of academic texts by adding dates, titles, etc. \cmd{\TagName} causes the \textsf{nameauth} indexing macros to append
% {\ttfamily\fbox{\textvisiblespace the Great, pope}}
% to the index entries created in the next example:
%
% \begin{quote}
%   \vspace{3.5ex}
%   \PatInfo{\ShowPattern{Gregory, I}!TAG\break
%     \ShowPattern{Gregory, I}!MN}
%   \vspace{-3.5ex}
% \begin{Verbatim}
% \TagName{Gregory, I}{ the Great, pope}
% Pope \Name*{Gregory, I} was known as \Name*{Gregory, I}
% [the Great].
% \end{Verbatim}
%
% Pope \Name*{Gregory, I} was known as \Name*{Gregory, I}
% [the Great].
% \end{quote}
%
% See Section~\ref{sec:NameAncient} for more ways to deal with ancient names. \cmd{\TagName} works with all names that produce index page entries. It does not work with with cross-references produced by \cmd{\IndexRef}, \cmd{\AKA}, etc.
% Tags can hold different kinds of information, but they should not be verbose. They can include daggers, asterisks, and so on. For example, all fictional names in the index of this manual are tagged with \S. One must add any desired spaces to the start of the tag.
%
% \subsubsection[Identical Names]{Disambiguating Identical Names}
%
% We can format and index one name as two different people with \cmd{\TagName} and \cmd{\ForgetThis} (Section~\ref{sec:NameControl}). The index tags group together their respective entries, while the name decision macros can set up specific logic for each name:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \TagName[E.]{Humperdinck}{ (composer)}
% This refers to the classical composer:
% \Name[E.]{Humperdinck}[Engelbert].
%
% \TagName[E.]{Humperdinck}{ (singer)}
% This refers to the pop singer from the 60s and 70s:
% \ForgetThis\Name[E.]{Humperdinck}[Engelbert].
% \end{VerbatimOut}
%
% \begin{quote}
%   \vspace{4ex}
%   \PatInfo{\ShowPattern[E.]{Humperdinck}!TAG\break
%     \ShowPattern[E.]{Humperdinck}!MN}
%   \vspace{-4ex}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \TagName[E.]{Humperdinck}{ (composer)\string|hyperpage}
%   This refers to the classical composer:
%   \Name[E.]{Humperdinck}[Engelbert].
%
%   \TagName[E.]{Humperdinck}{ (singer)\string|hyperpage}
%   This refers to the pop singer from the 60s and 70s:
%   \ForgetThis\Name[E.]{Humperdinck}[Engelbert].
% \end{quote}
%
% \subsubsection[Special Tags]{Special Tags for Special Cases}
% \label{sec:SpecialTag}
%
% \cmd{\TagName} can create ``special'' index entries for names with the general form below. These tags are compatible with \textsf{hyperref} used in normal \LaTeX\ documents.\footnote{This was implemented in v.3.3, based on the answer of \Name*[Heiko]{Oberdiek} to \href{https://tex.stackexchange.com/questions/201720/index-produces-invalid-idx-entry-with-manual-style-commaparse-hyperref}
% {\bfseries this question}.}
% When \texttt{\textbackslash}\meta{macro}\texttt{\#1\{\#1\}} exists and \meta{name args} are the arguments, one can use the form:
%
% \begin{SyntaxBox}
% \cmd{\TagName}\meta{name args}\texttt{\{\textbar}\meta{macro}\texttt{\}}
% \end{SyntaxBox}
%
% When \Warn\ using the \textsf{ltxdoc} class with \textsf{hypdoc}, as in this manual, neither \textsf{nameauth} nor regular use of \cmd{\index} creates hyperlinked page entries. Index data tags in the |<driver>| section of the \texttt{dtx} file, which reads the ``commented'' part of the \texttt{dtx} file into a \texttt{document} environment, take the form:
%
% \begin{quote}
%   \cmd{\TagName}\meta{name args}\texttt{\{\textbar hyperpage\}}
% \end{quote}
%
% Within the ``commented'' part of the package documentation in this \texttt{dtx} file, the vertical bar is active. Hence, we use:
%
% \begin{quote}
%   \cmd{\TagName}\meta{name args}\texttt{\{}\cmd{\noexpand}\cmd{\string\textbar hyperpage\}}\\[0.5ex]
%   or\\[0.5ex]
%   \cmd{\index\{}\meta{entry argument}\cmd{\noexpand}\cmd{\string \textbar hyperpage\}}
% \end{quote}
%
% Internally, in \cmd{\@nameauth@IdxFormat}, when a cross-reference is being created, a tag of the form \meta{some text}\texttt{\textbar}\meta{some macro} is reduced to \meta{some text}, allowing the macros \texttt{\textbar see} and \texttt{\textbar seealso} internally to be appended to the index entry even if a tag with a vertical bar exists.
%
% Next we create a special tag. Since we used lines~1–2 in this \texttt{dtx} file\Warn, we put them in the driver section to avoid both errors with the redefinition of the vertical bar and any possible confusion when using \cmd{\string}.
%
% \begin{quote}
% \begin{Verbatim}
% \newcommand\Orphan[2]{#1(\hyperpage{#2})}
% \TagName[Lost]{Name}{\,\S|Orphan{perdit}}
% \Name[Lost]{Name}
% \end{Verbatim}
%
% \Name[Lost]{Name}\\
% \texttt{idx} file: 
%   |\indexentry{Name, Lost\,\S  |\texttt
%   {\textbar}|Orphan{perdit}}{|\meta{page}|}|\\
% \texttt{ind} file:
%   |\item Name, Lost\,\S  \pfill \Orphan{perdit}{|\meta{page}|}|
% \end{quote}
%
% \subsubsection*{\hfil Manual Breaks and Entries}
%
% The \textsf{microtype} package and its \texttt{Spacing} environment may be the best solution to fix index entries and sub-entries that break badly across columns or pages. Yet we could add manual breaks after editing is complete.
%
% We must create a helper macro that takes an argument and adds a break after that argument. That is how macros like \cmd{\textbf} use implied page entries in the index, e.g.: \cmd{\index\{Doe, John\string|textbf\}}.
%
% Below we use \cmd{\newpage} to jump to a new column. See also the \textsf{multicol} and \textsf{idxlayout} packages, as well as classes like \textsf{memoir}. On line~1 we define the \cmd{\Endbreak} macro that will break the column after the end of an index entry.
%
% \begin{quote}
%   |\newcommand*{\EndBreak}[1]{#1\newpage}|
% \end{quote}
%
% We use \cmd{\EndBreak} after the last page in a given entry. This method works for both manual index entries and for the \textsf{nameauth} macros. If all instances of \cmd{\Name\{Some, Name\}} on the same page have that same index tag, there will be no duplicate page entries, hyperlinks will work, and the index will break as indicated:
%
% \begin{center}
% \begin{tabular}{rll}\toprule
% \rowcolor{nagrey}^^A
%   \bfseries Page & \bfseries Macro & \bfseries Index Result\\
%
%   10 & \cmd{\Name\{Some, Name\}} & Some Name, 10\\
%      & \cmd{\index\{Topic\}}     & Topic, 10\\
%
% \rowcolor{nagrey}^^A
%   15 & \cmd{\Name\{Some, Name\}} & Some Name, 10, 15\\
% \rowcolor{nagrey}^^A
%      & \cmd{\index\{Topic\}}     & Topic, 10, 15\\
%
%   18 & \cmd{\TagName\{Some, Name\textbar EndBreak\}\%} & \\
%      & \cmd{\Name\{Some, Name\}} &
%        Some Name, 10, 15, 18\meta{break}\\
%      &
%        \cmd{\index\{Topic\textbar EndBreak\}} &
%        Topic, 10, 15, 18\meta{break}\\\bottomrule
% \end{tabular}
% \end{center}
%
% We do not have to supply an argument to \cmd{\EndBreak} because, as with the font switching example above, the page entry is implied.
%
% We can intermix \textsf{nameauth} macros with manual index entries. We may need to look at the \texttt{idx} or \texttt{ind} files to craft matching entries on the page where the break occurs. Instead of using \cmd{\TagName}, we also can do this:
%
% \begin{center}
% \begin{tabular}{rll}\toprule
% \rowcolor{nagrey}^^A
%   \bfseries Page & \bfseries Macro & \bfseries Index Result\\
%
%   18 & \cmd{\SkipIndex}\cmd{\Name\{Some, Name\}\%}\hfill\hbox{} & \\
%      & \cmd{\index\{Some Name\textbar EndBreak\}}\dotfill \hbox{} &
%        Some Name, 10, 15, 18\meta{break}\\\bottomrule
% \end{tabular}
% \end{center}
%
% Results for manual entries may vary, depending on what distribution of \LaTeX\ is being used and how old it is. Any name with active characters needs to be handled differently before 2018 than after 2018. All instances of \cmd{\index\{Some Name\textbar EndBreak\}} must fall on the same page.
%
% We do not\Warn\ recommend breaking an index entry in the middle. There are several discussions, such as \href{https://tex.stackexchange.com/questions/86646/indexing-subentries-and-see-also}{\bfseries this page} and \href{https://tex.stackexchange.com/questions/231840/what-is-the-proper-use-of-several-seealso-in-the-same-index-entry-with-makeinde}{\bfseries that page}. A ``quick and dirty'' version corresponding to the \cmd{\EndBreak} macro follows:
%
% \begin{quote}
% \begin{Verbatim}
% \makeatletter
% \newcommand*{\MidBreak}[1]{#1\newpage\@gobble}
% \makeatother
% \end{Verbatim}
% \end{quote}
%
% Nevertheless, it is clear from some discussions that such macros can be rather fiddly at times and can produce unexpected results. One is advised to take caution when breaking index entries midway or otherwise modifying them in this manner.
%
% \subsection[Categories/Sub-entries]{Categories and Sub-entries}
% \label{sec:CatSub}
%
% Indexes can have categories and sub-entries such as the following:
%
% \begin{itemize}
% \item[] \meta{category 1}
% \begin{itemize}
% \item[] \meta{name entry}
% \begin{itemize}
% \item[] \meta{name sub-entry 1}
% \item[] \meta{name sub-entry 2}\dots
% \end{itemize}
% \item[] \meta{name entry}\dots
% \end{itemize}
% \item[] \meta{category 2}\dots
% \end{itemize}
%
% To get \textsf{nameauth} to work with this structure, one must use both \cmd{\PretagName} and \cmd{\TagName}. For example, to sort a name under \meta{category}, use something like:
%
% \begin{SyntaxBox}
%   \cmd{\PretagName}\oarg{FNN}\marg{SNN}\texttt
%     {\{}\meta{category 1}\texttt{!}\meta{SNN}\texttt
%     {, }\meta{FNN}\texttt{\}}\\
%   \cmd{\PretagName}\marg{SNN, Affix}\texttt
%     {\{}\meta{category 1}\texttt{!}\meta{SNN} \meta{Affix}\texttt{\}}
% \end{SyntaxBox}
%
% Whenever one wants to generate a sub-entry for a name, one can use \cmd{\TagName} to create that sub-entry when needed via something like:
%
% \begin{SyntaxBox}
%   \cmd{\TagName}\oarg{FNN}\marg{SNN}\texttt
%   {\{!}\meta{name sub-entry}\texttt{\}}\\
%   \cmd{\TagName}\marg{SNN, Affix}\texttt
%   {\{!}\meta{name sub-entry}\texttt{\}}
% \end{SyntaxBox}
%
% One is not restricted to Western or nonwestern name arguments; the boxes above are meant just to show the basic tag formats.
%
% \newpage
%
% One could use \Warn\cmd{\TagName} to change to another sub-entry or the default tag as needed, or use \cmd{\UntagName} to remove the tag. If a sub-entry contains a cross-reference via \cmd{\IndexRef}, it is necessary to follow that with \cmd{\IncludeName*} to permit any further page entries in other sub-entries or the main name entry. Below we demonstrate how one would implement sub-entries using index tags in a normal \LaTeX\ document. We cannot show categories when using \texttt{gind.ist}.
%
% Categories higher than names are handled by \cmd{\PretagName}. Categories lower in the hierarchy are handled by \cmd{\TagName}. It is best practice to have three or less levels of categories in an index. Two levels are more common. Using such levels also depends on the index style and formatting files.
% \JustIndex\Wash \JustIndex\Ike
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test07_02.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage[a6paper,landscape,left=1cm,right=1cm]{geometry}
% \usepackage{makeidx}
% \usepackage{nameauth}
%
% \makeindex
%
% \newcommand*{\EndBreak}[1]{#1\newpage}
%
% %  Sort these names under: US Presidents.
% \PretagName[George]{Washington}{US Presidents!Washington, George}
% \PretagName[Abraham]{Lincoln}{US Presidents!Lincoln, Abraham}
%
% %  Sort these names under: Philosophers.
% \PretagName{Aristotle}{Philosophers!Aristotle}
% \PretagName{Plato}{Philosophers!Plato}
%
% %  Sort these names under: Black Americans, famous.
% \PretagName[Frederick]{Douglass}
%   {Black Americans, famous!Douglass, Frederick}
% \PretagName[Martin Luther]{King, Jr.}
%   {Black Americans, famous!King, Martin Luther, Jr.}
%
% %  Sort these names under: Europeans, historical.
% \PretagName{\AE thelred, II}{Europeans, historical!Aethelred 2}
% \PretagName[Hernando]{de Soto}
%   {Europeans, historical!de Soto, Hernando}
%
% % This is not a sub-category.
% \TagName[George S.]{Patton, Jr.}{, general}
%
% \begin{nameauth}
%   \< Wash & George & Washington & >
%   \< Aris & & Aristotle & >
%   \< Plato & & Plato & >
%   \< Aeth & & \AE thelred, II & >
%   \< Sun & & Sun, Yat-sen & >
%   \< Linc & Abraham & Lincoln & >
%   \< MLK & Martin Luther & King, Jr. & >
%   \< Soto & Hernando & de Soto & >
%   \< Goethe & J.W. von & Goethe & >
%   \< Patton & George S. & Patton, Jr. & >
%   \< Ike & Dwight D. & Eisenhower & >
% \end{nameauth}
%
% \begin{document}
% \small
%
% \section{Famous Black Americans}
%
% \Name[Frederick]{Douglass} rose to eminence by sheer force of
% character and talents that neither slavery nor caste
% proscription could crush. Circumstances made
% \Name[Frederick]{Douglass} a slave, but they could not prevent
% him from becoming a freeman and a leader among mankind.\\
%
% We also celebrate \MLK, then \MLK.
%
% \section{Patres Patriae}
%
% We mention President \Wash; again, \Wash.
% Family and close friends called him \SWash.\\
%
% \TagName[George]{Washington}{!as general}
% We can reminisce about \LWash[General].
% \UntagName[George]{Washington}
%
% When speaking of \Linc, we can refer to \LLinc[Abe].
%
% \section{Philosophers}
%
% Among philosophers we consider \Plato\ and \Aris.
%
% \section{Historical Figures}
%
% \TagName{Sun, Yat-sen}{|EndBreak}
% We ponder about \Aeth, then \Aeth.
% We speak of \Sun, then \Sun.
% We note \Soto, then just \Soto.
% \CapThis\Soto{} starts a sentence.
%
% \section{Further Discussion}
%
% \TagName[George]{Washington}{!as general}
% \TagName[Dwight D.]{Eisenhower}{!as general}
% \LWash, \LPatton, and \LIke\ were high-ranking generals.\\
%
% \TagName[Dwight D.]{Eisenhower}{!as president}
% \UntagName[George]{Washington}
% \Wash\ and \Ike\ also were US presidents.
%
% % Instead of pre-tagging Ike we do the following:
% \index{US Presidents!other|see{Eisenhower, Dwight D., president}}
%
% \small
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\NameauthTestFile}
% \end{quote}
%
% \newpage
%
% Below we show only the index from this example.
% A few notable features include:
%
% \begin{itemize}
% \item \Patton\ uses a regular index tag instead of a subcategory.
%   That is a way to `cheat'' and get more groupings of entries
%   than allowed categories.
% \item \Ike\ illustrates multiple subcategories for a name. A
%   cross-reference from a sub-entry of US presidents points to him.
% \item \Wash\ illustrates having both a super-category and a subcategory.
% \item \Ike, \Patton, and \Sun\ are not sorted under categories. The
%   other names are sorted under categories.
% \end{itemize}
% \JustIndex\MLK \JustIndex\Doug \JustIndex\Aeth \JustIndex\Soto
% \JustIndex\Aris \JustIndex\Plato \JustIndex\Linc
%
% \begin{tcolorbox}[colback=white]
%   \IfFileExists{cat01.pdf}{\includegraphics[scale=0.85]{cat01.pdf}}
%   {\hbox{\vbox to 8cm{\hbox{\hfill}}}}
% \end{tcolorbox}
% \JustIndex\Wash \JustIndex\Ike
% \IndexWarnTerse
%
% \ReturnLink
%
% \begin{Quote}{\Linc, \textit{Gettysburg Address} (19 November 1863)}
% Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. \dots It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us\,---\,that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion\,---\,that we here highly resolve that these dead shall not have died in vain\,---\,that this nation, under God, shall have a new birth of freedom\,---\,and that government of the people, by the people, for the people, shall not perish from the earth.^^A
% \index{politicians, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \section{Name Tags}
% \label{sec:DataTags}
%
% \DescribeMacro{\NameAddInfo}
% All valid names in \textsf{nameauth} can have name tags; no restrictions exist. Unlike index tags, name tags are not printed automatically with every name managed by \textsf{nameauth}. Sections~\ref{sec:NameTests} and~\ref{sec:DataTagHooks} have more examples. The macro is \cmd{\long}, allowing for some complexity in the \meta{tag} argument:
%
% \begin{SyntaxBox}
%   \cmd{\NameAddInfo}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}\marg{tag}
% \end{SyntaxBox}
%
% \vspace{2ex}
% \PatInfo{\ShowPattern[George]{Washington}!DB\break
%   \ShowPattern[George]{Washington}!MN} 
% \vspace{-2ex}
% For example, |\NameAddInfo[George]{Washington}{(1732--99)}|\NameAddInfo[George]{Washington}{(1732--99)} makes a name tag but does not print whenever \Wash\ \cmd{\Wash} is used. The name tag needs to be displayed using the helper macro below.
%
% \DescribeMacro{\NameQueryInfo}
% To print a name tag for a given name, we use \cmd{\NameQueryInfo}, a helper macro that prints a name tag in the name info data set:
%
% \begin{SyntaxBox}
%   \cmd{\NameQueryInfo}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% \cmd{\NameQueryInfo[George]\{Washington\}} prints the name tag for \LWash:
% \NameQueryInfo[George]{Washington}. In Section~\ref{sec:DataTagHooks} and thereafter we show how one can automate the retrieval of name tags using formatting hooks, Yet therein also lies a caution:
%
% \begin{itemize}
% \item When using the recommended template for a formatting hook (Section~\ref{sec:DataTemp}), one can use \cmd{\noexpand} in arguments for \cmd{\NameAddInfo}, \cmd{\NameQueryInfo}, and \cmd{\NameClearInfo} without restriction.
%
% \item When using designs based on older templates, using \cmd{\noexpand} may cause \cmd{\NameQueryInfo} to print nothing if one uses the basic interface. Using the quick interface will work as expected.
% \end{itemize}
%
% One can insert a space at the start of a name tag; use signs like asterisks, daggers, and the like; and even create footnotes, such as footnote \addtocounter{footnote}{1}\arabic{footnote}\addtocounter{footnote}{-1} (below):
%
% \begin{VerbatimOut}{\jobname.tmp}
% \NameAddInfo[Ulysses S.]{Grant}
%   {eighteenth US president (1869--1877)}
% \NameAddInfo[Schuyler]{Colfax}
%   {\footnote{\Name[Schuyler]{Colfax} was the seventeenth US
%   vice-president during the first term (1869--73) of
%   \Name*[Ulysses S.]{Grant}, \NameQueryInfo[Ulysses S.]{Grant}.}}
%
% Remember \Name[Schuyler]{Colfax}?\NameQueryInfo[Schuyler]{Colfax}
% Derived from the same origin as ``scholar'', this name can occur
% as ``Skylar'' for girls and ``Skyler'' for boys.
% \end{VerbatimOut}
%
% \begin{quote}
%   \vspace{3.5ex}
%   \PatInfo{\ShowPattern[George]{Washington}!DB\break
%     \ShowPattern[Ulysses S.]{Grant}!DB\break
%     \ShowPattern[Schuyler]{Colfax}!DB\break
%     \ShowPattern[Schuyler]{Colfax}!MN\break
%     \ShowPattern[Ulysses S.]{Grant}!MN}
%   \vspace{-3.5ex}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% \newpage
%
% The previous\Warn{} example cannot be used in a formatting hook (Section~\ref{sec:DataTagHooks}). Within the formatting hooks, one is in a ``locked path'' that prevents calling a naming macro. This prevents a stack overflow. |\Name*[Ulysses S.]{Grant}| would not print inside a formatting hook, although |\NameQueryInfo[Ulysses S.]{Grant}| would print.
%
% Name\Warn{} tags can call each other. To protect against a stack overflow, use Boolean flags and conditional statements. Below, \cmd{\NameQueryInfo} calls a tag that sets a Boolean flag true, which causes the \emph{other} tag to stop any recursion and exit.
%
% \begin{VerbatimOut}{\jobname.tmp}
% \newif\ifA
% \newif\ifB
% \NameAddInfo{A}
%   {\Atrue A \ifB Stop \else \NameQueryInfo{B} \fi \Afalse}
% \NameAddInfo{B}
%   {\Btrue B \ifA Stop \else \NameQueryInfo{A} \fi \Bfalse}
% \begin{itemize}
%   \item \NameQueryInfo{A}
%   \item \NameQueryInfo{B}
% \end{itemize}
% \end{VerbatimOut}
% 
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% \DescribeMacro{\NameClearInfo}
% \cmd{\NameAddInfo} will replace one name tag with another name tag, but it does not delete a tag. That is the role of \cmd{\NameClearInfo}. The syntax is:
%
% \begin{SyntaxBox}
%   \cmd{\NameClearInfo}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% We now revisit \LWash\ and his associated name tag. \PatInfo{\ShowPattern[George]{Washington}!DB}
%
% \begin{VerbatimOut}{\jobname.tmp}
% The name tag is: \fbox{\NameQueryInfo[George]{Washington}}\quad
% Clearing data.\NameClearInfo[George]{Washington}\quad
% The name tag is empty: \fbox{\NameQueryInfo[George]{Washington}}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
% \ReturnLink
%
% \begin{Quote}{\ForgetThis\Name{Confucius}, \textit{The Analects}, C II (475–221 \textsc{bc})}
% He who exercises government by means of his virtue may be compared to the north polar star, which keeps its place and all the stars turn towards it.^^A
% \index{north star, concept of\noexpand\string|hyperpage}^^A
% \index{philosophers, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \section[Formatting and Decisions]{Basic Formatting and Name Decisions}
% \label{sec:FormatChoice}
%
% \subsection{Basic Formatting}
% \label{sec:Formatting}
%
% This section offers a brief overview; Section~\ref{sec:AdvancedFormat} goes into great detail. Even when using the default options for \textsf{nameauth} wherein no formatting occurs, we can observe syntactic changes to names:
%
% \begingroup
% \renewcommand\NamesFormat{}
% \renewcommand\MainNameHook{}
% \renewcommand\FrontNamesFormat{}
% \renewcommand\FrontNameHook{}
% \begin{tcolorbox}[colframe=naslate,colback=white,
% adjusted title={\large\hfil Syntactic Changes;
% No Formatting/Post-Processing}]\centering
%   \begin{tabular}{llll}\toprule
%     \bfseries First Instance & \bfseries Macro & \bfseries Later Instance & \bfseries Macro\\\midrule
%     \ForgetThis\Patton  & \cmd{\Patton}  & \Patton  & \cmd{\Patton}\\
%     \ForgetThis\LPatton & \cmd{\LPatton} & \LPatton & \cmd{\LPatton}\\
%     \ForgetThis\SPatton & \cmd{\SPatton} & \SPatton & \cmd{\SPatton}\\\midrule
%     \ForgetThis\Yamt  & \cmd{\Yamt}  & \Yamt  & \cmd{\Yamt}\\
%     \ForgetThis\LYamt & \cmd{\LYamt} & \LYamt & \cmd{\LYamt}\\
%     \ForgetThis\SYamt & \cmd{\SYamt} & \SYamt & \cmd{\SYamt}\\\bottomrule
%   \end{tabular}
% \end{tcolorbox}
% \endgroup
%
% We can add formatting to these syntactic changes. In its basic form, formatting is typographic post-processing. In its advanced form, formatting locally affects also the syntactic forms of names while leaving index entries undisturbed.
%
% Many books are structured with front matter that includes a table of contents, foreword, introductory material or survey material, and other instructive content that is not part of the main matter. The \textsf{nameauth} package has separate syntax and formatting system for front matter (\texttt{!NF}) and main matter (\texttt{!MN}). These formatting systems are linked to the existence of a name control pattern.
%
% \begin{itemize}
% \item First instance of a name
%   \begin{itemize}
%   \item No name control sequence exists.
%   \item A name is printed with its long form (default).
%   \item The ``first-use'' formatting hook is used (default).
%   \item After the name is printed, a name control sequence is created.
%   \end{itemize}
% \item Subsequent instance of a name
%   \begin{itemize}
%   \item A name control sequence already exists.
%   \item A name is printed using a shorter form (default).
%   \item The ``subsequent-use'' formatting hook is used (default).
%   \end{itemize}
% \end{itemize}
%
% The parser and related macros create name forms and formats only in the text. Macros in name arguments affect both text and index (Section~\ref{sec:AltFormat}).
%
% \DescribeMacro{\NamesActive}
% Independent ``main-matter'' and ``front-matter'' systems are used to format first and subsequent name uses.
% \DescribeMacro{\NamesInactive}
% \cmd{\NamesInactive} and the \texttt{frontmatter} option enable the front-matter system. \cmd{\NamesActive} switches names to the main-matter system. The \texttt{mainmatter} option is the default setting for names.
%
% These\Info{\cmd{\global}} two macros can be used explicitly as a pair or singly within an explicit local scope. Use \cmd{\global} to force a global effect.
%
% \newpage
%
% \DescribeMacro{\NamesFormat}
% The main-matter system uses \cmd{\NamesFormat} to post-process first occurrences of names and
% \DescribeMacro{\MainNameHook}
% \cmd{\MainNameHook} for subsequent uses. The front-matter system uses \cmd{\FrontNamesFormat}
% \DescribeMacro{\FrontNamesFormat}
% for first uses and \cmd{\FrontNameHook} for subsequent uses. The \texttt{alwaysformat}
% \DescribeMacro{\FrontNameHook}
% option causes only \cmd{\NamesFormat} and \cmd{\FrontNamesFormat} to be used. Since the formatting hooks always are defined when using \textsf{nameauth}, one must use \cmd{\renewcommand} when changing their definitions.\footnote{The names of these macros grew from \cmd{\NamesFormat}, originally the only formatting hook. Especially with the macros in this section, the naming scheme is unfortunate because package development involved some groping in the dark regarding the concepts.}
% Section~\ref{sec:NamePatterns} shows how name control sequences are keyed either to the main-matter system or to the front-matter system. The two formatting systems are distinct, useful for separate document elements. We color-code them and ``forget'' any previous name uses: 
%
% \begin{quote}
% \ForgetName[Rudolph]{Carnap}
% \vspace{4ex}
% \PatInfo{\textrm{front-matter}\hfill\break
%   \ShowPattern[Rudolph]{Carnap}!NF\break
%   \ShowPattern[Nicolas]{Malebranche}!NF\break
%   \textrm{main-matter}\hfill\break
%   \ShowPattern[Rudolph]{Carnap}!MN\break
%   \ShowPattern[Nicolas]{Malebranche}!MN}
% \vspace{-4ex}
% \begin{tcolorbox}[colframe=red,colback=white,
% adjusted title={\large\hfil Front-matter system: \cmd{\NamesInactive}}]
% \NamesInactive
% \begin{tabular}{ll}
% \Name[Rudolph]{Carnap} & |\Name[Rudolph]{Carnap}|\\
% \Name[Rudolph]{Carnap} & |\Name[Rudolph]{Carnap}|\\
% \Name[Nicolas]{Malebranche} & |\Name[Nicolas]{Malebranche}|\\
% \Name[Nicolas]{Malebranche} & |\Name[Nicolas]{Malebranche}|\\
% \end{tabular}
% \end{tcolorbox}
%
% \begin{tcolorbox}[colframe=blue,colback=white,
% adjusted title={\large\hfil Main-matter system: \cmd{\NamesActive}}]
% \NamesActive
% \begin{tabular}{ll}
% \Name[Rudolph]{Carnap} & |\Name[Rudolph]{Carnap}|\\
% \Name[Rudolph]{Carnap} & |\Name[Rudolph]{Carnap}|\\
% \Name[Nicolas]{Malebranche} & |\Name[Nicolas]{Malebranche}|\\
% \Name[Nicolas]{Malebranche} & |\Name[Nicolas]{Malebranche}|\\
% \end{tabular}
% \end{tcolorbox}
% \end{quote}
%
% We used the \textsf{xcolor} package with the following macros:
% \begin{quote}
% \begin{Verbatim}
% \renewcommand*\FrontNamesFormat[1]{\color{red}\sffamily #1}
% \renewcommand*\FrontNameHook[1]{\color{darkgray}\sffamily #1}
% \renewcommand*\NamesFormat[1]{\color{blue}\sffamily #1}
% \renewcommand*\MainNameHook[1]{\sffamily #1}
% \end{Verbatim}
% \end{quote}
%
% \DescribeMacro{\ForceName}
% We show examples of \cmd{\ForceName} in Sections~\ref{sec:NameControl}, \ref{sec:DataTagHooks}, and~\ref{sec:AKA}. Use this prefix macro to force ``first use'' formatting for the next \cmd{\Name}, etc., but without deleting any name control sequences. Thus:
%
% \begin{quote}
%   \Name[Rudolph]{Carnap}^^A
%   \PatInfo{\ShowPattern[Rudolph]{Carnap}!MN}
%   \cmd{\Name[Rudolph]\{Carnap\}} \\[1ex]
%   \ForceName\Name[Rudolph]{Carnap}
%   \cmd{\ForceName}\cmd{\Name[Rudolph]\{Carnap\}}
% \end{quote}
%
% Below\Info{\texttt{alwaysformat}} we simulate \texttt{alwaysformat} via package internals. Only the ``first use'' formatting hooks are used:
%
% \makeatletter\@nameauth@AlwaysFormattrue\makeatother%
% \ForgetName[M.T.]{Cicero}\ForgetName{Elizabeth, I}%
% \begin{itemize}
% \item Front matter: \NamesInactive \Name[Albert]{Einstein},
%   \Name[Albert]{Einstein}; \Name{Confucius}, \Name{Confucius}.\\
%   Patterns: \texttt{\ShowPattern[Albert]{Einstein}!NF
%   \ShowPattern{Confucius}!NF}
% \item Main matter: \NamesActive \Name[M.T.]{Cicero}, \Name[M.T.]{Cicero};
%   \Name{Elizabeth, I}, \Name{Elizabeth, I}.\\
%   Patterns:  \texttt{\ShowPattern[M.T.]{Cicero}!MN
%   \ShowPattern{Elizabeth, I}!MN}
% \end{itemize}
% \makeatletter\@nameauth@AlwaysFormatfalse\makeatother
%
% \newpage
%
% \subsubsection*{\hfil Hook caveats}
%
% The internal name parser determines what syntactic name elements exist and how they are constituted. It passes that information to macros that determine the form of nonwestern or Western names to be displayed. They in turn call the format hook dispatcher for post-processing, which calls the formatting hooks using the pattern:
%
% \begin{quote}
%   \cmd{\bgroup}\meta{Hook}\texttt{\{\#1\}}\cmd{\egroup}.
% \end{quote}
%
% One can create formatting hooks that take either no argument or one argument. Since the formatting hooks are already defined, one must not use \cmd{\newcommand} to create new hooks. Instead, use \cmd{\renewcommand} e.g.:
%
% \begin{quote}
%   \cmd{\renewcommand*}\cmd{\NamesFormat\{}\meta{content}\texttt{\}}\\
%   \cmd{\renewcommand*}\cmd{\NamesFormat[1]\{}\meta{content}\texttt{\}}
% \end{quote}
%
% A hook that takes one argument can use, change, or discard it and invoke \cmd{\NameParser} (Section~\ref{sec:SpecialUses}). Due to package design using local scope, both the following achieve exactly the same effect:
%
% \begin{quote}
%   \cmd{\renewcommand*}\cmd{\NamesFormat\{}\cmd{\itshape}\texttt{\}}\\
%   \cmd{\renewcommand*}\cmd{\NamesFormat\{}\cmd{\textit}\texttt{\}}
% \end{quote}
%
% \subsection{Application: Footnotes}
%
% The independent systems of names work with footnotes. Names in the body text, such as \ForgetThis\Harnack\ (later ennobled to \LHarnack[Adolf von]), normally affect name forms in the footnotes.\footnote{We have \Harnack\ from \cmd{\Harnack} instead of \ForgetThis\Harnack.}
% In footnote \arabic{footnote} \cmd{\MainNameHook} is called instead of \cmd{\NamesFormat} because \Harnack\ already had occurred above. We can use the front-matter system to change that:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \makeatletter
% \let\@oldfntext\@makefntext
% \long\def\@makefntext#1{\NamesInactive\@oldfntext{#1}\NamesActive}
% \makeatother
% \end{VerbatimOut}
%
% \begin{quote}
%   \vspace{4ex}
%   \PatInfo{\ShowPattern[Adolf]{Harnack}!MN\break
%     \ShowPattern[Adolf]{Harnack}!NF}
%   \vspace{-4ex}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
% \end{quote}
% \input{\jobname.tmp}
%
% When we create another footnote, we see very different results.\footnote{We have \Harnack\ from \cmd{\Harnack}, then \Harnack.}
% Footnote \arabic{footnote} shows the first use of a name because it is the first use in the front-matter system. One can synchronize the two systems with \cmd{\ForgetThis} and \cmd{\SubvertThis} (Section~\ref{sec:NameControl}). Below we revert footnotes with:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \makeatletter
% \let\@makefntext\@oldfntext
% \makeatother
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
% \end{quote}
% \input{\jobname.tmp}
%
% \begin{Quote}{\ForgetThis\Name[M.T.]{Cicero}[Marcus Tullius], \textit{De oratore} B II; C IX, \S 36 (55 \textsc{BC})}
% By what other voice, too, than that of the orator, is history, the evidence of time, the light of truth, the life of memory, the directress of life, the herald of antiquity, committed to immortality?^^A
% \index{Romans, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \subsection{Making Name Decisions}
% \label{sec:NameControl}
%
% By default, the macros below produce global effects. They change both the \texttt{!MN} and \texttt{!NF} data sets (Section~\ref{sec:NamePatterns}). Those changes implicitly affect syntactic name forms, name formatting, index protection with respect to creating cross-references (Section~\ref{sec:IndexRef}), and the name testing macros (Section~\ref{sec:NameTests}).
%
% \DescribeMacro{\ForgetName}
% This macro takes the same arguments as \cmd{\Name}, but it prints no output. It ``forgets'' a name, forcing a ``pre-first use'' state. The next instance of that name will display as if the name did not yet exist:
%
% \begin{SyntaxBox}
%   \cmd{\ForgetName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% \cmd{\ForgetName} ``unprotects'' names like \cmd{\IncludeName*} ``unprotects'' xrefs. This allows one to make both \textit{see} and \textit{see also}  cross-references to a name, even if that name already has index page entries.
%
% \DescribeMacro{\ForgetThis}
% This prefix macro causes the next instance of a naming macro or shorthand to ``forget'' a name before printing it. After knowing \Einstein, we forget him and again have a first instance via |\ForgetThis\Einstein|: \ForgetThis\Einstein. \cmd{\ForgetThis} no longer affects the index unless one uses the \texttt{oldreset} option.
%
% \DescribeMacro{\SubvertName}
% This macro takes the same arguments as \cmd{\Name}, but it produces no output in the text. It ``subverts'' a name by creating a name pattern control sequence, forcing a ``subsequent use'', and ``protecting'' a name from being used as a \textit{see} reference (analogous to \cmd{\ExcludeName} and \cmd{\IndexRef}:
%
% \begin{SyntaxBox}
%   \cmd{\SubvertName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
% \end{SyntaxBox}
%
% \DescribeMacro{\SubvertThis}
% This prefix macro causes the next instance of a naming macro or shorthand to ``subvert'' a name before printing it. As indicated in Section~\ref{sec:Priorities}, \cmd{\ForgetThis} has a higher priority than \cmd{\SubvertThis} and negates it. \cmd{\SubvertThis} no longer affects the index unless one uses the \texttt{oldreset} option.
%
% \begin{InfoBox}
% \centering We still advise one to avoid using \cmd{\ForgetThis} and \cmd{\SubvertThis}\\ before any naming macro that produces no output in the text.
% \end{InfoBox}
%
% \DescribeMacro{\LocalNames}
% By default, \cmd{\ForgetName}, \cmd{\SubvertName}, \cmd{\ForgetThis}, and \cmd{\SubvertThis} are not limited either by scope or by the active naming system. 
% \DescribeMacro{\GlobalNames}
% \cmd{\LocalNames} restricts the effects of these macros to the current naming system, but not to scope. \cmd{\GlobalNames} restores the default behavior that affects both systems. Both macros always have global scope.
%
% To see how these two macros work, in the following example we define a macro that reports whether or not |\Name[Charlie]{Chaplin}| exists. This macro gives four possible results: the name exists in the main matter, it exists in the front matter, it exists in both systems, or it does not exist (see Section~\ref{sec:NameTests}):
%
% \begin{VerbatimOut}{\jobname.tmp}
% \def\CheckChuck{{\bfseries\IfFrontName[Charlie]{Chaplin}
%   {\IfMainName[Charlie]{Chaplin}{both}{front}}
%   {\IfMainName[Charlie]{Chaplin}{main}{none}}}}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
% \end{quote}
% \input{\jobname.tmp}
%
% \begin{itemize}
% \item Start in the ``main-matter'' system with no extant name:
%   \begin{itemize}[rightmargin=2\leftmargin]
%     \ForgetName[Charlie]{Chaplin}
%     \item[] |\CheckChuck|\dotfill \CheckChuck
%   \end{itemize}
%
% \item Create a name in the ``main matter'':
%   \PatInfo{\ShowPattern[Charlie]{Chaplin}!MN}
%   \begin{itemize}[rightmargin=2\leftmargin]
%     \ForgetName[Charlie]{Chaplin}
%     \item[] |\Name[Charlie]{Chaplin}|\dotfill \Name[Charlie]{Chaplin}
%     \item[] |\CheckChuck|\dotfill \CheckChuck
%   \end{itemize}
%
% \item Switch to the ``front-matter'' system and create a name.
%   \PatInfo{\ShowPattern[Charlie]{Chaplin}!NF}
%   If one is within a group or local scope, one may have to add
%   \cmd{\global} to \cmd{\NamesInactive}:
%   \begin{itemize}[rightmargin=2\leftmargin]
%     \item[] |\global\NamesInactive|\global\NamesInactive
%     \item[] |\Name[Charlie]{Chaplin}|\dotfill \Name[Charlie]{Chaplin}
%     \item[] |\CheckChuck|\dotfill \CheckChuck
%   \end{itemize}
%
% \item use \cmd{\LocalNames} to make both \cmd{\ForgetName} and
%   \cmd{\SubvertName} work with only the current system.
%   \begin{itemize}[rightmargin=2\leftmargin]
%     \item[] |\LocalNames|\LocalNames
%   \end{itemize}
%
% \item Had we not used \cmd{\global} above, we would have implicitly
%   returned to the main-matter system due to scoping and environments
%   like \texttt{quote} and \texttt{itemize}. We ``forget'' only the
%   name in the front-matter system. 
%   \begin{itemize}[rightmargin=2\leftmargin]
%     \item[] |\ForgetName[Charlie]{Chaplin}|\ForgetName[Charlie]{Chaplin}
%     \item[] |\CheckChuck|\dotfill \CheckChuck
%   \end{itemize}
%
% \item Next ``subvert'' the front-matter name to ``remember'' it again.
%   Then switch to main matter:
%   \begin{itemize}[rightmargin=2\leftmargin]
%     \item[] |\SubvertName[Charlie]{Chaplin}|\SubvertName[Charlie]{Chaplin}
%     \item[] |\CheckChuck|\dotfill \CheckChuck
%     \item[] |\global\NamesActive|\global\NamesActive
%   \end{itemize}
%
% \item Now the current system is main matter. We forget the main-matter
%   name only, leaving the front-matter name intact:
%   \begin{itemize}[rightmargin=2\leftmargin]
%     \item[] |\ForgetName[Charlie]{Chaplin}|\ForgetName[Charlie]{Chaplin}
%     \item[] |\CheckChuck|\dotfill \CheckChuck
%   \end{itemize}
%
% \item Use \cmd{\GlobalNames} to make \cmd{\ForgetName} and
%   \cmd{\SubvertName} work with both systems again:
%   \begin{itemize}[rightmargin=2\leftmargin]
%     \item[] |\GlobalNames|\GlobalNames
%   \end{itemize}
%
% \item Finally, we forget everything. Even though we are in a main-matter
%   section, the front-matter name also goes away:
%   \begin{itemize}[rightmargin=2\leftmargin]
%     \item[] |\ForgetName[Charlie]{Chaplin}|\ForgetName[Charlie]{Chaplin}
%     \item[] |\CheckChuck|\dotfill \CheckChuck
%   \end{itemize}
% \end{itemize}
%
% \subsection{Formatting and Decisions}
%
% We pull together information on name forms and formatting, focusing on what happens in one naming system only, since the two systems are independent.
%
% \begin{itemize}[leftmargin=3cm]\small
% \item[First Instance:] \ForgetThis\Bailey \dotfill \cmd{\Bailey}\\
% \ForgetThis\LBailey \dotfill \cmd{\LBailey}\\
% \ForgetThis\SBailey \dotfill \cmd{\SBailey}\\
% Name control pattern created with text output.
% Index state 2, 4, or 6 (Section~\ref{sec:RuleStates}).
% Name form: long. First-use hooks.
%
% \item[Later Instance:] \Bailey \dotfill \cmd{\Bailey}\\
% \LBailey \dotfill \cmd{\LBailey}\\
% \SBailey \dotfill \cmd{\SBailey}\\
% No change to name pattern. Index state 2, 4, or 6.
% Name form: short. Subsequent-use hooks.
%
% \item[Forgotten:] (no output)\ForgetName[Betsey]{Bailey} \dotfill^^A
% \cmd{\ForgetName[Betsey]\{Bailey\}}\\
% Name pattern deleted. Index state 1, 3, or 5
% (Section~\ref{sec:RuleStates}).
% next instance usually will be a first use, e.g.: \Bailey.
%
% \item[Subverted:] (no output)\SubvertName[Betsey]{Bailey} \dotfill^^A
% \cmd{\SubvertName[Betsey]\{Bailey\}}\\
% Name pattern created. Index state 2, 4, or 6.
% next instance usually will be a later use, e.g.: \Bailey, \LBailey, \SBailey.
%
% \item[\cmd{\ForgetThis}:]
% \ForgetThis\Bailey \dotfill \cmd{\ForgetThis}\cmd{\Bailey}\\
% \ForgetThis\LBailey \dotfill \cmd{\ForgetThis}\cmd{\LBailey}\\
% \ForgetThis\SBailey \dotfill \cmd{\ForgetThis}\cmd{\SBailey}\\
% Name pattern deleted, then created again. Index state 2, 4, or 6.
% Name form and format: same as first use above. next instance usually
% will be a later use, e.g.: \Bailey, \LBailey, \SBailey.
%
% \item[\cmd{\SubvertThis}:]
% \SubvertThis\Bailey \dotfill \cmd{\SubvertThis}\cmd{\Bailey}\\
% \SubvertThis\LBailey \dotfill \cmd{\SubvertThis}\cmd{\LBailey}\\
% \SubvertThis\SBailey \dotfill \cmd{\SubvertThis}\cmd{\SBailey}\\
% Name pattern created. Index state 2, 4, or 6.
% Name form and format: same as later use above. next instance usually
% will be a later use, e.g.: \Bailey, \LBailey, \SBailey.
%
% \item[Format as First:]
% \ForceName\Bailey \dotfill \cmd{\ForceName}\cmd{\Bailey}\\
% \ForceName\LBailey \dotfill \cmd{\ForceName}\cmd{\LBailey}\\
% \ForceName\SBailey \dotfill \cmd{\ForceName}\cmd{\SBailey}\\
% No change to name pattern. Index state 2, 4, or 6.
% Name form: short or long. Name format: First-use hooks.
% \end{itemize}
%
% \begin{Quote}{\Name[Hubert H.]{Humphrey}, speech (26 March 1966)}
% In real life, unlike in Shakespeare, the sweetness of the rose depends upon the name it bears. Things are not only what they are. They are, in very important respects, what they seem to be.^^A
% \index{politicians, quotes of\noexpand\string|hyperpage}^^A
% \index{Shakespearian rose, references to\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \subsection{Testing Name Decisions}
% \label{sec:NameTests}
%
% Since name patterns are control sequences like macros, we can test for their existence. This can relate names to each other dynamically throughout a document.
%
% \subsubsection{Testing Macros}
%
% The macros in this section test for the presence or absence of a name, then expand to a result based on the outcome of the test.
%
% \DescribeMacro{\GlobalNameTest}
% The default behavior encapsulates the decision paths in a local scope, insulating any changes therein.
% \DescribeMacro{\LocalNameTest}
% If this is not desired, use the \texttt{globaltest} option or \cmd{\GlobalNameTest}. \cmd{\LocalNameTest} will re-enable the default. These commands affect assignment statements in test paths. By default, one must explicitly use \cmd{\global} when desired. See also the examples below.
%
% \DescribeMacro{\IfMainName}
% In order to test whether or not a ``main matter'' name control sequence exists, use this long macro that can accommodate paragraph breaks:
%
% \begin{SyntaxBox}
%   \cmd{\IfMainName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}^^A
%   \marg{yes}\marg{no}
% \end{SyntaxBox}
%
% For example we have not encountered |\Name[Bob]{Hope}| yet. Using \cmd{\IndexName} does not affect the tests in this section. We could do the following test that will reflect whether or not the name is present in the text:
%
% \begin{VerbatimOut}{\jobname.tmp}
% I heard someone say: \IfMainName[Bob]{Hope}
%   {Bob here!}
%   {No Bob here.}\IndexName[Bob]{Hope}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% Now we test for |\Name{Elizabeth,I}|, a name that has occurred, and we also show the difference between local and global test paths. We see that the default keeps local any assignments made in the test paths:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \GlobalNameTest
% \def\msg{We are unsure about \LEliz}
%
% \IfMainName{Elizabeth,I}
%   {\def\msg{We really do know of \LEliz}}
%   {\def\msg{We do not know of \LEliz}}
%
% \parbox{0.4\textwidth}{\msg} (\cmd{\GlobalNameTest}).
%
% \LocalNameTest
% \def\msg{We are unsure about \LEliz}
%
% \IfMainName{Elizabeth,I}
%   {\def\msg{We really do know of \LEliz}}
%   {\def\msg{We do not know of \LEliz}}
%
% \parbox{0.4\textwidth}{\msg} (\cmd{\LocalNameTest}).
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% \newpage
%
% \DescribeMacro{\IfFrontName}
% In order to test whether or not a ``front matter'' name pattern exists, use this long macro that can accommodate paragraph breaks. Its syntax is:
%
% \begin{SyntaxBox}
%   \cmd{\IfFrontName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}^^A
%   \marg{yes}\marg{no}
% \end{SyntaxBox}
%
% This macro works just like \cmd{\IfMainName}, except using the ``front matter'' name control sequences as the test subject. These testing macros prove their worth especially through combination. For example, we do a test based on Section~\ref{sec:Formatting}.
%
% \begin{VerbatimOut}{\jobname.tmp}
% \IfFrontName[Rudolph]{Carnap}
% {\IfMainName[Rudolph]{Carnap}
%   {\Name[Rudolph]{Carnap} is in both main- and front-matter text.}
%   {\Name[Rudolph]{Carnap} is only in front-matter text.}}
% {\IfMainName[Rudolph]{Carnap}
%   {\Name[Rudolph]{Carnap} is only in main-matter text.}
%   {\Name[Rudolph]{Carnap} has not been mentioned.}}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% \DescribeMacro{\IfAKA}
% This macro tests whether or not a regular or excluded form of cross-reference control sequence exists. The syntax is:
%
% \begin{SyntaxBox}
%   \cmd{\IfAKA}\oarg{FNN}\marg{SNN|,|Affix}\oarg{Alternate}^^A
%   \marg{y}\marg{n}\marg{excl}
% \end{SyntaxBox}
%
% This macro also works like \cmd{\IfMainName}, except that it has an additional \meta{excl} branch in order to detect the activity of \cmd{\ExcludeName} (Section~\ref{sec:GeneralIndex}). Cross-references are governed by name control sequences ending in \texttt{!PN} (Section~\ref{sec:NamePatterns}).
%
% \begin{itemize}
% \item Excluded control sequences (the \meta{excl} path) expand
%   to the value of \cmd{\@nameauth@Exclude}.
% \item Regular cross-references (the \meta{y} path) do not expand
%   to that value. At present, they are empty.
% \item \cmd{\ExcludeName} creates excluded xrefs. \cmd{\IncludeName}
%   destroys them.
% \item Regular xrefs are created by \cmd{\IndexRef}, \cmd{\AKA},
%   \cmd{\PName} and their starred forms. Regular xrefs are destroyed
%   by \cmd{\IncludeName*}.
% \end{itemize}
%
% Based on the known facts above, below we offer some examples:
%
% \begin{enumerate}
% \item In\PatInfo{\ShowPattern[Jesse]{Ventura}!MN\break
%   \ShowPattern[James]{Janos}!PN\break
%   \ShowPattern[James]{Janos}!MN}
% the text we first create an instance of former pro-wrestler and
% Minnesota governor \Name[Jesse]{Ventura}, |\Name[Jesse]{Ventura}|.
% \item We establish his lesser-known legal name as an alias:
%   ``\IndexRef[James]{Janos}{Ventura, Jesse}\Name[James]{Janos}'',\\
%   |\IndexRef[James]{Janos}{Ventura,|\,|Jesse}\Name[James]{Janos}|.
% \item We get the result:
%   ``\IfAKA[James]{Janos}
%   {\Name*[Jesse]{Ventura} is a stage name}
%   {\Name*[Jesse]{Ventura} is a regular name}
%   {}''.
%   If we do not use \cmd{\ExcludeName}, we can leave the
%   \meta{excl} branch empty:
% \end{enumerate}
%
% \begin{quote}
% \begin{Verbatim}
% \IfAKA[James]{Janos}
%   {\Name*[Jesse]{Ventura} is a stage name}
%   {\Name*[Jesse]{Ventura} is a regular name}
%   {}
% \end{Verbatim}
% \end{quote}
%
% \newpage
%
% We can combine all these macros to create a complete, unified test:
%
% \begin{quote}
% \begin{Verbatim}
% \IfAKA[FNN]{SNN, Affix}[Alternate]
% {%
%   % yes; it is an xref
% }
% {%
%   % no, it is a name
%   \IfFrontName[FNN]{SNN, Affix}[Alternate]
%   {%
%     % yes, it is in the front matter
%     \IfMainName[FNN]{SNN, Affix}[Alternate]
%     {%
%       % it is in both front and main matter
%     }
%     {%
%       % it is only in the front matter
%     }%
%   }
%   {%
%     % no, it is not in the front matter
%     \IfMainName[FNN]{SNN, Affix}[Alternate]
%     {%
%       % it is only in the main matter
%     }
%     {%
%       % it does not exist
%     }%
%   }%
% }
% {%
%   % no; it is excluded
% }
% \end{Verbatim}
% \end{quote}
%
% \subsubsection[Applications]{Applications: Game Books, Histories, Etc.}
%
% In any text where encountering certain names can change variables, character statistics, personal information, the macros described above can be used to key various pieces of information to the presence or the absence of a name. For example, in a series of independent document sections, one can craft notes like the one below to sketch out character development:
%
% \begin{quote}
% \begin{Verbatim}
% \ifMainName[Ferris]{Bueller}
%   {\Name[Cameron]{Frye} is gloomy and introspective.}
%   {\Name[Cameron]{Frye} is developing positive traits.}
% \end{Verbatim}
% \end{quote}
%
% In some instances, one might test for the presence of a name to determine whether or not to use a particular version of that name:
%
% \begin{quote}
% \JustIndex\JWG^^A
% \begin{Verbatim}
% \ifMainName[J.W. von]{Goethe}
%   {\Name[J.W. von]{Goethe}}
%   {\Name[J.W. von]{Goethe}[Johann Wolfgang von]}
% \end{Verbatim}
% \end{quote}
%
% In Sections~\ref{sec:NameAncient} and~\ref{sec:SpecialUses} we explore ways that one could automate something like what we have above. Section~\ref{sec:SpecialUses} applies better to Western names.
%
% In addition to using the name decision testing macros by themselves, one can use them with name tags to ensure that the information associated with a given name is not anachronistic.
%
% For example, we know that certain people are associated with chronological events. We associate those people and events to the information presented in a name tag via name testing macros:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \NameAddInfo{Saul, of Tarsus}
%   {\IfMainName{Jesus, Christ}
%     {\IfMainName[Lucius]{Sergius Paulus}
%       {renamed himself \Name{Paul}, in
%        honor of his patron}
%       {next became a preacher to the Gentiles}}
%     {wrote first that he persecuted Christians}}
% \ForgetName{Jesus, Christ}
% \ForgetName[Lucius]{Sergius Paulus}
% \IndexRef{Paul}{Saul of Tarsus}
%
% \Name{Saul, of Tarsus} \NameQueryInfo{Saul, of Tarsus}.
% He wrote in the letter to the Galatians, later reported in
% the book of Acts, that he saw a vision of \Name{Jesus, Christ}
% on the road to Damascus.
%
% \Name{Saul, of Tarsus} \NameQueryInfo{Saul, of Tarsus}.
% He undertook three missionary journeys before being
% sent to Rome for trial in an appeal to Caesar.
% While in Cyprus, \Name{Saul, of Tarsus} converted
% \Name[Lucius]{Sergius Paulus}, who became a patron.
%
% \Name{Saul, of Tarsus} \NameQueryInfo{Saul, of Tarsus}.
% Under the name \Name{Paul} he wrote his letters.
% \end{VerbatimOut}
%
% \begin{quote}
%   \vspace{3ex}
%   \PatInfo{\ShowPattern{Paul}!PN\break
%     \ShowPattern{Saul, of Tarsus}!DB\break
%     \ShowPattern{Jesus, Christ}!MN\break
%     \textls[-10]{\ShowPattern[Lucius]{Sergius Paulus}!MN}\break
%     \ShowPattern{Paul}!MN\break
%     \ShowPattern{Saul, of Tarsus}!MN}
%   \vspace{-3ex}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% \subsubsection*{\hfil Caveats}
%
% Using these tests inside other macros or passing control sequences to them may create false results (see \textit{The \TeX book}, 212--15). This was especially the case before 2018 with names using diacritical marks and other letters outside the basic Latin characters. That is why \textsf{nameauth} uses token registers to save name arguments.
%
% We have stressed and will continue to stress using \cmd{\noexpand} in macros passed as name arguments to stabilize what happens. See also Section~\ref{sec:Unicode} regarding how one might engage possible Unicode issues in certain \LaTeX\ engines.
%
% In addition to these points, using the \textsf{trace} package, \cmd{\show}, or \cmd{\meaning} can help one to mitigate problems.
%
% \newpage
%
% \subsubsection{Beamer Example}
%
% Below we keep names consistent with \textsf{beamer} overlays using some of the macros explained in this section. Otherwise, name forms will change automatically as one advances the slides. We do not use indexing in this example.
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test09_01.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{beamer}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage[noindex]{nameauth}
%
% \mode<presentation>
% \beamerdefaultoverlayspecification{<+->}
%
% \begin{document}
%
% \begin{frame}{Move Text Without Retyping Names}
%   \begin{itemize}\footnotesize
%   \item<1-> Original\ForgetName[George]{Washington}%
%                     \ForgetName[George]{Washington's}\\
%             This version of \Name[Ulysses S.]{Grant} changes.
%   \begin{enumerate}
%   \item<2-> \IfMainName[George]{Washington's}{He}%
%             {\Name[George]{Washington}}
%             became the first president
%             of the United States.
%   \item<3-> \IfMainName[George]{Washington}{His}%
%             {\Name*[George]{Washington's}}
%             military successes during the Seven Years War
%             readied him to command the army
%             of the Continental Congress.
%   \end{enumerate}
%   \item<1-> Reordered\ForgetName[George]{Washington}%
%                      \ForgetName[George]{Washington's}\\
%             This version of \ForgetThis\Name[Ulysses S.]{Grant}
%             does not change.
%   \begin{enumerate}
%   \item<3-> \IfMainName[George]{Washington}{His}%
%             {\Name*[George]{Washington's}}
%             military successes during the Seven Years War
%             readied him to command the army
%             of the Continental Congress.
%   \item<2-> \IfMainName[George]{Washington's}{He}%
%             {\Name[George]{Washington}}
%             became the first president
%             of the United States.
%   \end{enumerate}
%   \end{itemize}
% \end{frame}
%
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\NameauthTestFile}
%   \IndexName[George]{Washington}
%   \IndexName[Ulysses S.]{Grant}
% \end{quote}
%
% The overlays, numbered from one to three, keep name forms consistent by deleting name control sequence patterns for each new overlay. Otherwise, name patterns would change for each new overlay.
%
% \newpage
%
% Name conditionals ensure specific, context-dependent forms based on what name has appeared. These conditionals allow the text in each overlay to be order-independent and able to be moved around at will. The first overlay shows the use of \cmd{\ForgetThis} to keep names constant.
%
% \begin{tcolorbox}\centering
%   \IfFileExists{beamer01.pdf}{\includegraphics[scale=0.6]{beamer01.pdf}}
%   {\hbox{\vbox to 8cm{\hbox{\hfill}}}}
% \end{tcolorbox}
% \IndexName[George]{Washington}
% \IndexName[Ulysses S.]{Grant}
% 
%
% The second overlay uses \cmd{\ForgetName} forcing specific name forms respective to each overlay, instead of respective to the overall sequence of overlays. We also observe the use of name conditionals in text elements that one might reorder.
%
% \begin{tcolorbox}\centering
%   \IfFileExists{beamer02.pdf}{\includegraphics[scale=0.6]{beamer02.pdf}}
%   {\hbox{\vbox to 8cm{\hbox{\hfill}}}}
% \end{tcolorbox}
% \IndexName[George]{Washington}
% \IndexName[Ulysses S.]{Grant}
%
% \newpage
%
% Overlay three fully illustrates how all these features integrate. This could allow a presenter to maintain information used in different presentations, making each element or slide a ``drop-in'' unit that can figure out how to present names, name forms, and related information without extensive retyping.
%
% \begin{tcolorbox}\centering
%   \IfFileExists{beamer03.pdf}{\includegraphics[scale=0.6]{beamer03.pdf}}
%   {\hbox{\vbox to 8cm{\hbox{\hfill}}}}
% \end{tcolorbox}
% \IndexName[George]{Washington}
% \IndexName[Ulysses S.]{Grant}
%
% \ReturnLink
%
% \AltFormatActive
% \begin{Quote}{\ForgetThis\Shak\break
% \hbox{}\hfill ``Romeo and Juliet'', Act II, Scene II (published 1597)}
% 'Tis but thy name that is my enemy;\dots\\
% What's in a name? That which we call a rose\\
% By any other name would smell as sweet;\\
% So Romeo would, were he not Romeo call'd,\\
% Retain that dear perfection which he owes\\
% Without that title. Romeo, doff thy name,\\
% And for that name which is no part of thee\\
% Take all myself.\negmedskip^^A
% \index{creatives, quotes of\noexpand\string|hyperpage}^^A
% \index{Shakespearian rose, references to\noexpand\string|hyperpage}
% \end{Quote}
% \AltFormatInactive
%
% \newpage
%
% \section{Name Authority Basics}
%
% \subsection{Variant Names}
% \label{sec:VarNames}
%
% This section explains how to manage simpler surname variants. There are several ways that \textsf{nameauth} can handle variants, in increasing levels of complexity.
%
% \begin{enumerate}
% \item Use \meta{Alternate} to create variant forms, yet retain consistent
%   index entries. This is the default function of \textsf{nameauth} that
%   readers already have seen.
%
% \item Create several names. Index one or more occurrences of these names
%   as ``standard'' variants that refer to each other via \textit{see also}
%   references. In relation to the ``standard'' variants, any other variants
%   would be indexed only with a \textit{see} reference. The macros
%   \cmd{\JustIndex}, \cmd{\IndexName}, and \cmd{\IndexRef} play a big role
%   here (Sections~\ref{sec:IndexPageno} and~\ref{sec:IndexRef}).
%
% \item Use alternate formatting, \cmd{\noexpand}, and macros in the name
%   arguments that expand differently under specific conditions in the
%   formatting hooks, but expand consistently when indexed.
% \end{enumerate}
%
% We will repeat the following rule in the discussion of Roman names (Section~\ref{sec:Romani}) and in the discussion of alternate formatting (Section~\ref{sec:AltFormat}). One cannot overstate this point when using mutable macros in name arguments:
%
% \NameArgWarning
%
% \subsubsection[Alternate Argument]{Variants and the Alternate Argument}
%
% We begin with the first kind of variant names listed above. We decide that the canonical name to be used is \Tyson. We set up both the canonical name and an alternate name in the \texttt{nameauth} environment:
%
% \begin{quote}
% \vspace{4ex}
% \PatInfo{\ShowPattern[Mike]{Tyson}!MN}
% \vspace{-4ex}
% \begin{Verbatim}
% \begin{nameauth}
%   \< Tyson & Mike & Tyson & >
%   \< Iron & Mike & Tyson & Iron Mike >
% \end{nameauth}
%
% \IndexRef{Iron Mike}{Tyson, Mike}
% \end{Verbatim}
% \end{quote}
%
% Because \cmd{\Iron} uses the \meta{Alternate} column, all index page entries are the same as those for \cmd{\Tyson}, the canonical name. Adding the cross-reference via \cmd{\IndexRef} produces ``Iron Mike \textit{see} Tyson, Mike'' in the index.
%
% \begin{quote}
%   \begin{tabular}{rlrl}\toprule
% \rowcolor{nagrey}^^A
%   \bfseries Output & \bfseries Macro &
%   \bfseries Output & \bfseries Macro\\
%
%   \LIron \qquad & \cmd{\LIron} &
%     \LTyson[Iron Mike] & \cmd{\LTyson[Iron Mike]}\\
%
% \rowcolor{nagrey}^^A
%   \Iron & \cmd{\Iron} & \Tyson & \cmd{\Tyson}\\
%
%   \SIron & \cmd{\SIron} & \STyson & \cmd{\STyson}\\\bottomrule
%   \end{tabular}
% \end{quote}
%
% Yet \meta{Alternate} does more than handle variant forenames in Western name forms. It can be used to manage alternate names in Eastern and ancient forms, as we have already seen. For this to work properly, we must have a name where \meta{SNN} and \meta{Affix} are both populated in order to use \meta{Alternate}. Otherwise, one winds up with the obsolete syntax (Section~\ref{sec:Obsolete}).
%
% We will engage this topic more, beginning with Section~\ref{sec:NameAncient}, Here we give a basic illustration of how one can start to manage these names. For instance:
%
% \begin{quote}
% \vspace{4ex}
% \PatInfo{\ShowPattern{Elizabeth, I}!MN}
% \vspace{-4ex}
% \begin{Verbatim}
% \begin{nameauth}
%   \< Eliz & & Elizabeth, I & >
% \end{nameauth}
%
% \IndexRef{Gloriana}{Elizabeth I}
% \IndexRef[Good Queen]{Bess}{Elizabeth I}
%
% \LEliz[I, ``Gloriana''] was known also as
% \ForceFN\SEliz[``Good Queen Bess''].
% \end{Verbatim}
%
% \LEliz[I, ``Gloriana''] was known also as
% \ForceFN\SEliz[``Good Queen Bess''].
% \end{quote}
%
% \subsubsection[Multiple Variants]{Managing Multiple Variant Names}
%
% With the second class of name variants listed above, we get into pseudonyms, aliases, and variant family names. This class is more complicated:
%
% \begin{enumerate}
% \item Names that change capitalization in the surname, take grammatical
%   endings, or vary in other ways. See Sections~\ref{sec:NameParticles},
%   \ref{sec:NameMedieval}, \ref{sec:NameAncient}, \ref{sec:RealAltEx}ff.,
%   and~\ref{sec:Romani}, for increasingly complex examples.
%
% \item Names having separate index entries that are linked together with
%   cross-references. Sections~\ref{sec:IndexPageno} and~\ref{sec:IndexRef}
%   give many examples, which we will not repeat here because most of the
%   work is done with indexing macros.
%
% \item Names that the author wants to treat as different, yet which the
%   \textsf{nameauth} internals might see as the same. One can use the
%   naming macros, index tagging macros, and formatting macros to simulate
%   the existence of multiple identical names (see below and
%   Section~\ref{sec:IndexTag}).
% \end{enumerate}
%
% The following method avoids using macros in name arguments and it is easier to set up. The trade-off is that, while macros in name arguments are harder to set up, they benefit from automation. Below we establish two names and a sort key for the main name under which both names are indexed:
%
% \begin{quote}
% \begin{Verbatim}
% \begin{nameauth}
%   \< DuBois    & W.E.B. & Du~Bois & >
%   \< AltDuBois & W.E.B. & DuBois  & >
% \end{nameauth}
% \PretagName[W.E.B.]{Du~Bois}{DuBois, William}
% \end{Verbatim}
% \end{quote}
%
% \begin{itemize}
% \item Based on\PatInfo{\ShowPattern[W.E.B.]{Du~Bois}!MN\break
%   \ShowPattern[W.E.B.]{DuBois}!MN} historical research and
%   some name authorities, we decide that the the canonical
%   name will be: \ForgetThis\DuBois\ \cmd{\DuBois}.
%
% \item We use the non-breaking space (the tilde active character) because
%   internally, \textsf{nameauth} removes all regular spaces from
%   name patterns. Both \cmd{\Name[W.E.B.]\{Du Bois\}} and
%   \cmd{\Name[W.E.B.]\{DuBois\}} have the same name control pattern:
%   \texttt{\ShowPattern[W.E.B.]{DuBois}} (Section~\ref{sec:NamePatterns}).
%   The name pattern \texttt{\ShowPattern[W.E.B.]{Du~Bois}} differs from
%   both of the other names.
%
% \item Another reason to use the non-breaking space is that it prevents
%   a line break between the particle \textit{Du} and the name \textit{Bois}.
%
% \item The sort key that could be applicable to both names is
%   \texttt{\{DuBois, William\}}. Had we used the sort key
%   \texttt{\{Du Bois, William\}}, the name would be sorted before
%   \texttt{dual}, which is not in order (Section~\ref{sec:IndexInitials}).
%
% \item Instead of using \cmd{\SkipIndex}\cmd{\AltDuBois} many times, we
%   create a cross-reference before the alternate name is used to prevent
%   index page entries from being created for the alternate form:
%   \IndexRef[W.E.B.]{DuBois}{Du Bois, W.E.B.}\\[1ex]
%   |  \IndexRef[W.E.B.]{DuBois}{Du Bois, W.E.B.}|
%
% \item With the following setup we keep full stop detection, modify name
%   forms, and check if the name straddles a page break in order to append
%   |\JustIndex\DuBois| if needed:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \newcommand\VarDuBois{\JustIndex\DuBois\AltDuBois}
% \newcommand\LVarDuBois{\JustIndex\DuBois\LAltDuBois}
% \newcommand\SVarDuBois{\JustIndex\DuBois\SAltDuBois}
% Speaking of \VarDuBois[William E.B.].\\
% Speaking of \LVarDuBois.\\
% Speaking of \SVarDuBois[William E.B.].
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% \item The macro below loses full stop detection, but it does
% automatically handle the name spanning a page break, just like the
% regular naming macros. Yet it is rather inelegant.
%
% \begin{quote}
% \begin{Verbatim}
% \newcommand\NewDuBois[2]{%
%   \def\Test{#1}%
%   \def\Long{L}%
%   \def\Short{S}%
%   \JustIndex\DuBois%
%   \ifx\Test\Long \LAltDuBois[#2] \else
%     \ifx\Test\Short \SAltDuBois[#2] \else
%     \AltDuBois \fi\fi
%   \JustIndex\DuBois}
% \ForgetThis\NewDuBois{}{William E.B.}\\
% \NewDuBois{L}{}\\
% \NewDuBois{S}{William}
% \end{Verbatim}
% 
% \newcommand\NewDuBois[2]{^^A
%   \def\Test{#1}^^A
%   \def\Long{L}^^A
%   \def\Short{S}^^A
%   \JustIndex\DuBois^^A
%   \ifx\Test\Long \LAltDuBois[#2] \else
%     \ifx\Test\Short \SAltDuBois[#2] \else
%     \AltDuBois[#2] \fi\fi
%   \JustIndex\DuBois}
% \ForgetThis\NewDuBois{}{William E.B.}\\
% \NewDuBois{L}{}\\
% \NewDuBois{S}{William}
% \end{quote}
% \end{itemize}
%
% \begin{Quote}{\ForgetThis\DuBois\break
% \hbox{}\hfill \textit{Darkwater} (1920), C II: The Souls of White Folk}
% The cause of war is preparation for war.\negmedskip^^A
% \index{civil rights leaders, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \subsubsection[Nonstandard Caps]{Nonstandard Capitalization and Indexing}
% \label{sec:NonstandardCaps}
%
% Here we look at nonstandard capitalization. We consider poet \ForgetThis\Name[e.e.]{cummings}. As long as one sticks with the default \texttt{noformat} option, the easiest solution is to begin a sentence with something like:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \SubvertThis\CapThis\Name[e.e.]{cummings}'s motif of the
% goat-footed balloon man has underlying sexual themes that
% nevertheless present a childish facade.
% \end{VerbatimOut}
%
% \begin{quote}
%   \vspace{4ex}
%   \BothInfo{\ShowPattern[e.e.]{cummings}!MN}
%   {\ShowIdxPageref*[e.e.]{cummings}}
%   \vspace{-4ex}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%   \renewcommand*\NamesFormat{}
%   \renewcommand*\MainNameHook{}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% Suppose, however, that we want both some kind of name formatting and still use capitalization. We can use the indexing macros discussed in Section~\ref{sec:GeneralIndex}:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \ExcludeName[e.e.]{cummings's}
% We consider the work of \ForgetThis\Name[e.e.]{cummings}.
% \SubvertThis\CapThis\Name[e.e.]{cummings's}
% motif of the goat-footed balloon man has underlying
% sexual themes that nevertheless present a childish facade.
% \end{VerbatimOut}
%
% \begin{quote}
%   \vspace{4.5ex}
%   \PatInfo{\ShowPattern[e.e.]{cummings's}}
%   \vspace{-4.5ex}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% In both examples above, we\Warn{} use \cmd{\SubvertThis} to force a subsequent use in order to prevent a first use that looks like ``\ForgetThis\CapThis\Name[e.e.]{cummings's}''. The macro \cmd{\CapThis} will capitalize the first letter in all name elements. Using \cmd{\ExcludeName} keeps one from having to use \cmd{\SkipIndex} every time.
%
% Section~\ref{sec:AltFormat} explains how to use \cmd{\CapThis} with alternate formatting when using macros in name arguments. Section~\ref{sec:InflNames} describes how automation lends itself to grammatical inflections of names.
%
% \subsubsection[Variants and Xrefs]{Variant Names and Index Cross-References}
% \label{sec:IdxVariants}
%
% Here we show differences among variants and cross-references. We can choose to index variants under the canonical name or we can set up cross-references with variants. The order in which we do that is significant:
%
% \begin{enumerate}
% \vspace{5ex}
% \PatInfo{\ShowPattern[J.E.]{Carter, Jr.}!MN\hfill
%   \textrm{(1--2)}\break
%   \ShowPattern[Jimmy]{Carter}!PN\hfill \textrm{(3, 6)}\break
%   \ShowPattern[Jimmy]{Carter}!MN\hfill \textrm{(4)}\break
%   \ShowPattern[J.E.]{Carter, Jr.}!PN\hfill
%   \textrm{(5)}}
% \vspace{-5ex}
% \item   We use the canonical name to create page entries:
% \item[] \Name*[J.E.]{Carter, Jr.}\dotfill |\Name*[J.E.]{Carter, Jr.}|
%
% \item   Variants that use \meta{Alternate} in the text create page
%   entries under the canonical form, not the variant form:
% \item[] \DropAffix\Name*[J.E.]{Carter, Jr.}[Jimmy]\dotfill^^A
%   |\DropAffix\Name*[J.E.]{Carter, Jr.}[Jimmy]|
% \item[] |\ShowIdxPageref*[J.E.]{Carter, Jr.}[Jimmy]|\dotfill^^A
%   \ShowIdxPageref*[J.E.]{Carter, Jr.}[Jimmy]
%
% \item We must create a \textit{see} reference from an alternate form
%   to a canonical form \emph{before} using the alternate form in a naming
%   macro, or it will be ignored and a warning will result:
% \item[] |\IndexRef[Jimmy]{Carter}{Carter, J.E., Jr.}|^^A
%   \IndexRef[Jimmy]{Carter}{Carter, J.E., Jr.}
%
% \newpage
%
% \item No page entries will occur below because we made the
%   \textit{see} reference first. Note how the alternate form is an
%   independent name:
% \item[] \Name[Jimmy]{Carter}\dotfill |\Name[Jimmy]{Carter}|
%
% \item If we want to index the alternate name, we have to use the
%   canonical name instead of the alternate name:
% \item[] |\IndexName[J.E.]{Carter, Jr.}| 
%
% \item If instead we wanted to make a \textit{see also} reference, we
%   would use both the canonical name and the alternate name, then create
%   the cross-reference \emph{after} all uses of the alternate name
%   (at the end of the document), e.g.:
% \item[] |\SeeAlso\IndexRef[Jimmy]{Carter}{Carter, J.E., Jr.}|
% \end{enumerate}
%
% \subsubsection*{\hfil Multiple Connections}
%
% Below, two names are indexed with page numbers. They have \textit{see also} cross-references to each other. One of those names also has a \textit{see} reference to it:
%
% \begin{enumerate}
% \vspace{5ex}
% \PatInfo{\ShowPattern{Maimonides}!MN \textrm{(1)}\break
%   \ShowPattern{Moses, ben-Maimon}!PN \textrm{(2)}\break
%   \ShowPattern{Moses, ben-Maimon}!MN \textrm{(3)}\break
%   \ShowPattern{Rambam}!MN \textrm{(4)}\break
%   \ShowPattern{Rambam}!PN \textrm{(5)}}
% \vspace{-5ex}
% \item We use the canonical name to set up page entries:
% \item[] \Name{Maimonides}\dotfill |\Name{Maimonides}|
%
% \item \Name{Maimonides} has two other names, one more used than the
%   other. We set up his least-used name as the \textit{see}
%   reference:
% \item[] |\IndexRef{Moses, ben-Maimon}{Maimonides}|^^A
%   \IndexRef{Moses, ben-Maimon}{Maimonides}
%
% \item We have a main name with a page entry and a ``\textit{see}
%   reference'' to that name. No page entries will occur below because
%   we made the xref first:
% \item[] \Name{Moses, ben-Maimon}\dotfill |\Name{Moses, ben-Maimon}|
%
% \item Before creating \textit{see also} cross-references, we use the other
%   alias so that all the page entries precede the
%   cross-references:
% \item[] \Name{Rambam}\dotfill |\Name{Rambam}|
%
% \item All \textit{see also} references must come after all page entries.
%   For example, one could put both of these macros at the end of the
%   document:
% \item[] |\SeeAlso\IndexRef{Maimonides}{Rambam}|\\
%   \SeeAlso\IndexRef{Maimonides}{Rambam}^^A
%   |\SeeAlso\IndexRef{Rambam}{Maimonides}|^^A
%   \SeeAlso\IndexRef{Rambam}{Maimonides}
% \end{enumerate}
%
% \subsubsection*{\hfil Multiple Targets}
%
% There is a case where one cross-reference can point to multiple targets, such as demonstrated in the example below:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \PretagName{\textit{Snellius}}{Snellius}
% \IndexRef{\textit{Snellius}}
%   {Snel van Royen, R.; Snel van Royen, W.}
% Both \Name[W.]{Snel van Royen}[Willebrord] and
% his son \Name[R.]{Snel van Royen}[Rudolph] were known
% by the Latin moniker \Name{\textit{Snellius}}.
% \end{VerbatimOut}
%
% \begin{quote}
%   \vspace{5ex}
%   \PatInfo{\ShowPattern{\textit{Snellius}}!PRE\break
%     \ShowPattern{\textit{Snellius}}!PN\break
%     \ShowPattern[W.]{Snel van Royen}!MN\break
%     \ShowPattern[R.]{Snel van Royen}!MN}
%   \vspace{-5ex}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% One must plan the location of xrefs or use \cmd{\IncludeName*}. Above, we have no page entry for |\Name{\textit{Snellius}}| because \cmd{\IndexRef} comes first.
%
% \subsection{Using a Name Authority}
%
% Below are a couple of names from a name authority created for a translation of \textit{De Diaconis et Diaconissis Veteris Ecclesiae Liber Commentarius} by \Name[Caspar]{Ziegler}, of which the present author was the editor.\footnote{The book, \textit{The Diaconate of the Ancient and Medieval Church} had been typeset using \LaTeX, but then had to be converted to a different format.}
%
% Constructing that name authority of over 500 names was a challenge. The deceased translator left names in abbreviated Latin. He left many place-names in Latin and incorrectly translated some others. To get valid names that one can research, the present author recommends:
%
% \begin{itemize}
%   \item \href{https://data.cerl.org/thesaurus/_search}{CERL Thesaurus}
%   \item \href{https://viaf.org/}{Virtual International Authority File}
%   \item \href{https://edit16.iccu.sbn.it/web/edit-16}{EDIT16} 
%   \item \href{https://www.worldcat.org/}{WorldCat} 
%   \item \href{https://id.loc.gov/authorities/names.html}{Library of Congress}   
%   \item \href{https://www.columbia.edu/acis/ets/Graesse/contents.html}
%     {Older version of Graesse, \textit{Orbis Latinus}}
% \end{itemize}
%
% I set the vernacular forms as canonical, with the Latin versions referring to them. I re-translated all the place-names. I also did the following:
%
% \begin{enumerate*}
% \item Sort vernacular names with \cmd{\PretagName} due to
%   particles (Section~\ref{sec:IndexSort}).
% \item If Latin names are only cross-references, use
%   \cmd{\IndexRef}\meta{name args} to generate cross-references
%   before referring to any names (Section~\ref{sec:IndexRef}).
% \item If Latin names have page entries, then place
%   \cmd{\SeeAlso}\cmd{\IndexRef}\meta{name args} as needed
%   at the end of the document, before \cmd{\printindex}.
% \item Use \cmd{\CapThis} (Section~\ref{sec:NameParticles}).
% \end{enumerate*}
%
% \begin{quote}
% \vspace{3.5ex}
% \BothInfo{\ShowPattern[Jacques]{De~Pamele}!MN\break
%   \ShowPattern[Jacobus]{Pamelius}!MN\break
%   \ShowPattern[Giovanni]{d'Andrea}!MN\break
%   \ShowPattern[Ioannes]{Andreae}!MN}
% {\ShowIdxPageref*[Jacques]{De~Pamele}\break
%   \ShowIdxPageref*[Jacobus]{Pamelius}\break
%   \ShowIdxPageref*[Giovanni]{d'Andrea}\break
%   \ShowIdxPageref*[Ioannes]{Andreae}}
% \vspace{-3ex}
% \begin{Verbatim}
% \PretagName[Jacques]{De~Pamele}{Depamele, Jacques}
% \Name[Jacques]{De~Pamele}[Jacques de~Joigny]
% \IndexRef[Jacobus]{Pamelius}{De~Pamele, Jacques}
% \Name[Jacobus]{Pamelius}
%
% \PretagName[Giovanni]{d'Andrea}{Dandrea, Giovanni}
% \Name[Giovanni]{d'Andrea}
% \IndexRef[Ioannes]{Andreae}{d'Andrea, Giovanni}
% \Name[Ioannes]{Andreae}
% \end{Verbatim}
% \end{quote}
%
% \IndexRef[Jacobus]{Pamelius}{De~Pamele, Jacques}
% \IndexRef[Ioannes]{Andreae}{d'Andrea, Giovanni}
% \begin{itemize}[leftmargin=3.5cm]
%   \item[Canonical Name] |\Name[Jacques]{De~Pamele}[Jacques de~Joigny]|\\
%                          \Name[Jacques]{De~Pamele}[Jacques de~Joigny]
%   \item[Latin Name] |\Name[Jacobus]{Pamelius}|
%                      \Name[Jacobus]{Pamelius}
%   \item[Canonical Name] |\Name[Giovanni]{d'Andrea}|
%                          \Name[Giovanni]{d'Andrea}
%   \item[Latin Name] |\Name[Ioannes]{Andreae}|
%                      \Name[Ioannes]{Andreae}
% \end{itemize}
%
% \CapThis\Name[Giovanni]{d'Andrea} |\CapThis\Name[Giovanni]{d'Andrea}| can be used at the beginning of a sentence. |\Name[Jacques]{De~Pamele}| gives \Name[Jacques]{De~Pamele}.
%
% \ReturnLink
%
% \newpage
%
% \section{Advanced Formatting}
% \label{sec:AdvancedFormat}
%
% Up to this point, formatting hooks have taken a name whose form was set in the internal name parser and the hooks applied some typographic changes to that name.
%
% In this section we start using formatting hooks in ways that interact with and change the syntactic form of a name, perhaps in addition to making typographic changes to that name.
%
% We thus merge the two concepts of syntax and formatting to create more complex examples that are able to do more complicated things with names. We thus can meet a few specific, real-world cultural expectations and scholarly conventions.
%
% Before we delve into this section, below we see a general scheme of how the core name engine processes a name:
%
% \begin{tcolorbox}[colback=white,
% adjusted title={\bfseries Naming Macro Layer}]
%
% Naming macros \cmd{\Name}, \cmd{\Name*}, \cmd{\FName}, \cmd{\FName*}, and
% the macros created by the \texttt{nameauth} environment all send their
% arguments to three hooks that, by default, point to \cmd{\@nameauth@Name}
% (Section~\ref{sec:FullCustomize}). Here \cmd{\@nameauth@Name} handles the
% work requested by \cmd{\JustIndex}, \cmd{\SubvertThis}, \cmd{\ForgetThis},
% and \cmd{\SkipIndex}. It then hands off the name arguments to the name
% parser, either with a main-matter \texttt{!MN} suffix or a front-matter
% \texttt{!NF} suffix\dots
%
% \begin{tcolorbox}[colframe=naslate,colback=white,
% adjusted title={\bfseries Syntactic Element Layer}]
%
% \cmd{\@nameauth@Parse}: Determine name category, capitalization,
% punctuation, elements to be used, and pass on to\dots
%
% \begin{tcolorbox}[colframe=nablue,colback=white,
% adjusted title={\sffamily\bfseries Name Display Layer}]
%
% \cmd{\@nameauth@NonWest}: Consult rules, construct displayed form.\\
% \cmd{\@nameauth@West}: Consult rules, construct displayed form.\\
% \cmd{\@nameauth@Form}: ``Magic Eight Ball'' of rules for name forms.
% Includes checking if a name control sequence exists, checking which is
% the calling macro, and so on. Pass the information to\dots
%
% \begin{tcolorbox}[colframe=nared,colback=white,
% adjusted title={\sffamily\bfseries Format Hook Dispatcher}]
%
% \cmd{\@nameauth@Hook}: Check the name to be printed for a final full
% stop. Check which naming system we are using.
%
% Call a formatting hook depending on if our name control sequence
% pattern exists, and if we are in the main-matter system or the
% front-matter system. The formatting hook prints the name in the text.
%
% \end{tcolorbox}
%
% \end{tcolorbox}
%
% \cmd{\@nameauth@Parse}: Make name control sequence from name pattern.
%
% \end{tcolorbox}
%
% \cmd{\@nameauth@NameEngine}: If the final full stop flag is true, check
% the lookahead token for a full stop and gobble it if needed.
%
% \end{tcolorbox}
%
% \newpage
%
% \subsection{Formatting Hooks}
% \label{sec:ComplexHooks}
%
% This proof of concept puts the first mention of a name either in italics (front matter) or in boldface (main matter), and it adds a margin note if that is allowed. We use \cmd{\let} to save and restore the old hooks, although we also could use a group to keep format changes in a local scope:
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test11_01.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage{nameauth}
%
% \makeindex
%
% % First save main- and front-matter hooks. Then change
% % first-use hooks for both main matter and front matter.
% \let\OldFormat\NamesFormat
% \let\OldFrontNames\FrontNamesFormat
%
% \renewcommand*\NamesFormat[1]{\textbf{#1}\unless\ifinner
%    \marginpar{\raggedleft\scriptsize #1}\fi}
% \renewcommand*\FrontNamesFormat[1]{\textit{#1}\unless\ifinner
%    \marginpar{\raggedleft\scriptsize #1}\fi}
%
% \PretagName{Vlad, {\c T}epe{\c s}}{Vlad Tepes} % for accented names
% \TagName{Vlad, II}{ Dracul}          % for index information
% \TagName{Vlad, III}{ Dracula}
% \IndexRef{Dracula}{Vlad III}
%
% \begin{document}
%
% The new format (front matter):\NamesInactive
%
% \Name{Vlad, III}[III Dracula], known as
% \IndexRef{Vlad, {\c T}epe{\c s}}{Vlad III}
% \SubvertThis\Name*{Vlad, {\c T}epe{\c s}}
% (\Name*{Vlad, {\c T}epe{\c s}}[the Impaler])
% after his death, was the son of \Name{Vlad, II}[II Dracul],
% a member of the Order of the Dragon. Later instances of
% ``\Name*{Vlad, III}'' and ``\Name{Vlad, III}'' appear thus.
%
% The new format (main matter):\NamesActive
%
% \Name{Vlad, III}[III Dracula], known as
% \IndexRef{Vlad, {\c T}epe{\c s}}{Vlad III}
% \SubvertThis\Name*{Vlad, {\c T}epe{\c s}}
% (\Name*{Vlad, {\c T}epe{\c s}}[the Impaler])
% after his death, was the son of \Name{Vlad, II}[II Dracul],
% a member of the Order of the Dragon. Later instances of
% ``\Name*{Vlad, III}'' and ``\Name{Vlad, III}'' appear thus.
%
% \let\NamesFormat\OldFormat
% \let\FrontNamesFormat\OldFrontNames
%
% We are back in the old format.
%
% in the front matter we see: \NamesInactive
% \ForgetThis\Name{Vlad, III}[III Dracula],
% \Name*{Vlad, III}, and  \Name{Vlad, III}.
%
% in the main matter we see: \NamesActive
% \ForgetThis\Name{Vlad, III}[III Dracula],
% \Name*{Vlad, III}, and  \Name{Vlad, III}.
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\NameauthTestFile}
%
%   \let\OldFormat\NamesFormat
%   \let\OldFrontNames\FrontNamesFormat
%
%   \renewcommand*\NamesFormat[1]{\textbf{#1}\unless\ifinner
%     \marginpar{\raggedleft\scriptsize #1}\fi}
%   \renewcommand*\FrontNamesFormat[1]{\textit{#1}\unless\ifinner
%     \marginpar{\raggedleft\scriptsize #1}\fi}
%
%   The new format (front matter):\NamesInactive
%
%   \Name{Vlad, III}[III Dracula], known as
%   \IndexRef{Vlad, {\c T}epe{\c s}}{Vlad III}
%   \SubvertThis\Name*{Vlad, {\c T}epe{\c s}}
%   (\Name*{Vlad, {\c T}epe{\c s}}[the Impaler])
%   after his death, was the son of \Name{Vlad, II}[II Dracul],
%   a member of the Order of the Dragon. Later instances of
%   ``\Name*{Vlad, III}'' and ``\Name{Vlad, III}'' appear thus.
%
%   The new format (main matter):\NamesActive
%
%   \Name{Vlad, III}[III Dracula], known as
%   \IndexRef{Vlad, {\c T}epe{\c s}}{Vlad III}
%   \SubvertThis\Name*{Vlad, {\c T}epe{\c s}}
%   (\Name*{Vlad, {\c T}epe{\c s}}[the Impaler])
%   after his death, was the son of \Name{Vlad, II}[II Dracul],
%   a member of the Order of the Dragon. Later instances of
%   ``\Name*{Vlad, III}'' and ``\Name{Vlad, III}'' appear thus.
%
%   \let\NamesFormat\OldFormat
%   \let\FrontNamesFormat\OldFrontNames
%
%   We are back in the old format.
%
%   in the front matter we see: \NamesInactive
%   \ForgetThis\Name{Vlad, III}[III Dracula],
%   \Name*{Vlad, III}, and  \Name{Vlad, III}.
%
%   in the main matter we see: \NamesActive
%   \ForgetThis\Name{Vlad, III}[III Dracula],
%   \Name*{Vlad, III}, and  \Name{Vlad, III}.
% \end{quote}
%
% The reason why we redefine \cmd{\NamesFormat} is because it is more common to add extra information with the first mention of a name. Yet one similarly could redefine \cmd{\MainNameHook} or \cmd{\FrontNameHook} for subsequent uses of names.
%
% \subsection{Name Tags in Hooks}
% \label{sec:DataTagHooks}
%
% By recalling name tags (Section~\ref{sec:DataTags}) in formatting hooks, one can automate how they either appear with a name or not. This package is all about automation and the associated trade-offs.
%
% Formatting hooks are called within a local scope. They take zero or one argument (Section~\ref{sec:Formatting}). When they take one argument, they have the option to print that argument, add information to the argument, or discard the argument. Yet macros used in formatting hooks can present challenges that we show how to manage:
%
% \begin{itemize}
% \item When \cmd{\noexpand} is used in a name argument, \cmd{\NameQueryInfo}
%   and perhaps other macros may not produce output within a formatting hook
%   when using the basic interface, but the quick interface works fine.
% \item Macros that are used to make local changes in formatting hooks should
%   never make the same changes outside of that context, else spurious index
%   entries will occur.
% \end{itemize}
%
% \DescribeMacro{\@nameauth@toksa}
% Three token registers contain each of the name arguments used in a macro that takes them.
% \DescribeMacro{\@nameauth@toksb}
% They are needed to manage the proper expansion of name arguments, especially in the index.
% \DescribeMacro{\@nameauth@toksc}
% Historically, these registers have been necessary for names that contain accents and diacritics. In Section~\ref{sec:AKA}, these registers correspond to the \emph{last} three name arguments. They can be used, if needed, in formatting hooks by \textsf{nameauth} macros that take name arguments.
%
% Their chief use, historically speaking, was to facilitate retrieving name tags via \cmd{\NameQueryInfo}. That use has been superseded by \cmd{\NameauthPattern}, which is described in Section~\ref{sec:NamePatterns}.
%
% \newpage
%
% \subsubsection{Hook Templates}
% \label{sec:DataTemp}
%
% \begingroup ^^A Local formatting hook change
%
% \subsubsection*{\hfil Recommended Template}
%
% The hook below prints the name tag with the first use of a name in the main-matter system, if such a tag exists. It is simple, it avoids the \cmd{\NameQueryInfo} problem, and it is easy to debug.
%
% \begin{quote}
% \begin{Verbatim}
% \renewcommand*\NamesFormat[1]
% {%
%   #1%
%   \ifcsname\NameauthPattern!DB\endcsname
%     \expandafter\csname\NameauthPattern!DB\endcsname%
%   \fi
% }
% \end{Verbatim}
% \end{quote}
%
% \subsubsection*{\hfil Older Templates}
%
% Two other hook designs were used in the past to display name tags. They are included here only for the sake of illustration. After showing the templates, we test all three of them to show why we recommend the template above.
%
% We use \(\epsilon\)-\TeX\ features next. See \href{https://tex.stackexchange.com/questions/140785/how-is-unexpanded-defined}{\bfseries this page} on the use of \cmd{\unexpanded} and \href{https://tex.stackexchange.com/questions/61223/explanations-about-begingroup-edef-x-endgroup}{\bfseries another page} pertinent to the structure of this hook. We print the name, expand the arguments of \cmd{\NameQueryInfo}, and use those arguments to print the tag.
%
% \begin{quote}
% \vspace{3ex}\Info{Alternate A}\vspace{-3ex}
% \begin{Verbatim}
% \makeatletter
% \renewcommand*\NamesFormat[1]{%
%   \begingroup%
%   \protected@edef\temp{\endgroup%
%     {#1\noexpand\NameQueryInfo
%       [\unexpanded\expandafter{\the\@nameauth@toksa}]
%       {\unexpanded\expandafter{\the\@nameauth@toksb}}
%       [\unexpanded\expandafter{\the\@nameauth@toksc}]%
%     }%
%   }%
%   \temp%
% }
% \makeatother
% \end{Verbatim}
% \end{quote}
%
% The older form of this hook was the first to be used in \textsf{nameauth},
% based on \href{https://www.tug.org/TUGboat/tb09-1/tb20bechtolsheim.pdf}{\bfseries this \texttt{pdf} article} from \textit{TUGboat} that gives a tutorial on \cmd{\expandafter}. As one can see, it is more tedious, but gets the same result as above:
%
% \begin{quote}
% \vspace{3ex}\Info{Alternate B}\vspace{-3ex}
% \begin{Verbatim}
% \let\ex\expandafter
% \makeatletter
% \renewcommand*\NamesFormat[1]{%
%   #1%
%   \ex\ex\ex\ex\ex\ex\ex\NameQueryInfo%
%   \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the%
%   \ex\ex\ex\@nameauth@toksa\ex\ex\ex]%
%   \ex\ex\ex{\ex\the\ex\@nameauth@toksb\ex}%
%   \ex[\the\@nameauth@etoksc]%
% }
% \makeatother
% \end{Verbatim}
% \end{quote}
%
% \subsubsection*{\hfil Template Test}
%
% We set up the following test for our three templates, with indexing suppressed:
%
% \begin{itemize}
%   \item A macro in a name argument is preceded by \cmd{\noexpand}. That
%     occurs with greater frequency in advanced formatting.
%   \item If we see the outcome, ``Test passed'', we have success.
%   \item If we see the outcome, ``Test'', we have failure.
% \end{itemize}
%
% \IndexInactive
% \begin{VerbatimOut}{\jobname.tmp}
% \newcommand\testname{Test}
% \NameAddInfo{\noexpand\testname}{ passed}
% \begin{nameauth}
%   \< Test & & \noexpand\testname & >
% \end{nameauth}
% \end{VerbatimOut}
%
% \begin{quote}
% The macro \cmd{\testname} contains the first part of our test output.
% The name tag contains the second part. We will use both name
% interfaces with all three templates.
%
% \VerbatimInput[gobble=0]{\jobname.tmp}
% \end{quote}
%
% \input{\jobname.tmp}
%
% \begin{itemize}
% \item The recommended hook gives us:\\
% \renewcommand*\NamesFormat[1]
% {^^A
%   #1^^A
%   \ifcsname\NameauthPattern!DB\endcsname
%     \expandafter\csname\NameauthPattern!DB\endcsname^^A
%   \fi
% }
% \begin{tabular}{lll}
% \cmd{\ForgetThis}\cmd{\Name\{}\cmd{\noexpand}\cmd{\testname\}} &
%   \ForgetThis\Name{\noexpand\testname} & success \\
% \cmd{\ForgetThis}\cmd{\Test} & \ForgetThis\Test & success \\
% \end{tabular}
%
% \item Alternate A gives us:\\
% \makeatletter
% \renewcommand*\NamesFormat[1]{^^A
%   \begingroup^^A
%   \protected@edef\temp{\endgroup^^A
%     {#1\noexpand\NameQueryInfo
%       [\unexpanded\expandafter{\the\@nameauth@toksa}]
%       {\unexpanded\expandafter{\the\@nameauth@toksb}}
%       [\unexpanded\expandafter{\the\@nameauth@toksc}]^^A
%     }^^A
%   }^^A
%   \temp^^A
% }
% \makeatother
% \begin{tabular}{lll}
% \cmd{\ForgetThis}\cmd{\Name\{}\cmd{\noexpand}\cmd{\testname\}} &
%   \ForgetThis\Name{\noexpand\testname} & failure \\
% \cmd{\ForgetThis}\cmd{\Test} & \ForgetThis\Test & success \\
% \end{tabular}
%
% \item Alternate B gives us:\\
% \let\ex\expandafter
% \makeatletter
% \renewcommand*\NamesFormat[1]{^^A
%   #1^^A
%   \ex\ex\ex\ex\ex\ex\ex\NameQueryInfo^^A
%   \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the^^A
%   \ex\ex\ex\@nameauth@toksa\ex\ex\ex]^^A
%   \ex\ex\ex{\ex\the\ex\@nameauth@toksb\ex}^^A
%   \ex[\the\@nameauth@etoksc]^^A
% }
% \makeatother
% \begin{tabular}{lll}
% \cmd{\ForgetThis}\cmd{\Name\{}\cmd{\noexpand}\cmd{\testname\}} &
%   \ForgetThis\Name{\noexpand\testname} & failure \\
% \cmd{\ForgetThis}\cmd{\Test} & \ForgetThis\Test & success \\
% \end{tabular}
% \end{itemize}
%
% \endgroup ^^A Local formatting hook change
%
% \subsubsection[Ancient Names]{Application: Ancient Names}
% \label{sec:NameAncient}
%
% \begingroup%^^A Local format hook redefinition
%
% \renewcommand*\NamesFormat{}^^A
% \renewcommand*\MainNameHook{}^^A
% Ancient names tend to be the most fluid regarding the meaning and use of affixes. Certain scholarly contexts add more information to a name when it is first introduced. Here we look at ways to address that need. For the sake of clarity, here the examples do not use the formatting conventions of this manual.
%
% First we explore the easiest way to handle royal or ancient variants by manually adding any epithets or sobriquets to a standard name form:
%
% \begin{itemize}
% \item We use \cmd{\PretagName}\PatInfo{\ShowPattern{Antiochus, IV}!PRE}
%   to sort especially Roman numerals in the index. For example:
%   \cmd{\PretagName\{Antiochus, IV\}\{Antiochus 4\}}
% \item We use \cmd{\TagName}\PatInfo{\ShowPattern{Antiochus, IV}!TAG} to
%   ensure that any ``long form'' information is displayed in the index:
%   \cmd{\TagName\{Antiochus, IV]\}\{ Epiphanes, king\}}.
% \item Using \cmd{\PretagName} and \cmd{\TagName} in the preamble ensures
%   consistency.
% \item We use \meta{Alternate} to add ``long form'' information in the text,
%   e.g:\PatInfo{\ShowPattern{Antiochus, IV}!MN}
% \end{itemize}
% \begin{Block}
%   \cmd{\Name\ \{Antiochus, IV\}[IV Epiphanes]}\dotfill
%     \Name{Antiochus, IV}[IV Epiphanes]\\
%   \cmd{\Name*\{Antiochus, IV\}}\dotfill \Name*{Antiochus, IV}\\
%   \cmd{\Name\ \{Antiochus, IV\}}\dotfill \Name{Antiochus, IV}
% \end{Block}
%
% \newpage
%
% Next we show a snippet that uses the quick interface with this same method. We trigger a first use, followed by long and short subsequent uses:
%
% \begin{quote}
% \vspace{3ex}
% \PatInfo{\ShowPattern{Demetrius, I}!PRE\break
%   \ShowPattern{Demetrius, I}!TAG\break
%   \ShowPattern{Demetrius, I}!MN}
% \vspace{-3ex}
% \begin{Verbatim}
% \PretagName{Demetrius, I}{Demetrius 1}
% \TagName{Demetrius, I}{ Soter, king}
% \begin{nameauth}
%   \< Dem & & Demetrius, I & >
% \end{nameauth}
% \end{Verbatim}
% \end{quote}
%
% \begin{Block}
%   |\ForgetName{Demetrius, I}|\ForgetName{Demetrius, I}\\
%   \cmd{\Dem[I Soter]}\dotfill \Dem[I Soter]\\
%   \cmd{\LDem}\dotfill \LDem\\
%   \cmd{\Dem}\dotfill \Dem
% \end{Block}
%
% As discussed in Section~\ref{sec:Complexity}, simple examples do not lend themselves to automation. Below we trade automation, where we do not need to add information manually to the \meta{Alternate} argument, for a complex initial setup that uses name tags and the recommended template:
%
% \begin{quote}
% \vspace{3ex}
% \PatInfo{\ShowPattern{Demetrius, I}!DB}
% \vspace{-3ex}
% \begin{Verbatim}[firstnumber=last]
% \NameAddInfo{Demetrius, I}{ Soter}
% \renewcommand*\NamesFormat[1]
% {%
%   #1%
%   \ifcsname\NameauthPattern!DB\endcsname
%     \expandafter\csname\NameauthPattern!DB\endcsname%
%   \fi
% }
% \renewcommand*\MainNameHook{}
% \end{Verbatim}
% \end{quote}
% \NameAddInfo{Demetrius, I}{ Soter}
% \renewcommand*\NamesFormat[1]
% {^^A
%   #1^^A
%   \ifcsname\NameauthPattern!DB\endcsname
%     \expandafter\csname\NameauthPattern!DB\endcsname^^A
%   \fi
% }
% \renewcommand*\MainNameHook{}
%
% \begin{Block}
%   |\ForgetName{Demetrius, I}|\ForgetName{Demetrius, I}\\
%   \cmd{\Dem}\dotfill \Dem\\
%   \cmd{\LDem}\dotfill \LDem\\
%   \cmd{\Dem}\dotfill \Dem
% \end{Block}
%
% In both cases, the index entry in a normal document would be sorted like the following:
% \begingroup
% \IndexActual{@}^^A
% \TagName{Demetrius, I}{ Soter, king}^^A
% \texttt{\ShowIdxPageref{Demetrius, I}}.^^A
% \TagName{Demetrius, I}{ Soter, king\string|hyperpage}
% \endgroup
%
% The first use of a name, or one after the use of \cmd{\ForgetName} or \cmd{\ForgetThis}, shows the most information. A long instance of an extant name shows a little less info, and a short instance shows the least. Every difference in name form corresponds with a macro in a known state.
% \endgroup^^A Local format hook redefinition
%
% \subsubsection[Life Dates]{Application: Life Dates}
%
% \begingroup^^A Local format hook redefinition
%
% History texts tend to use life dates, regnal dates, and dates when certain figures flourished. As we used more information with ancient names via name tags, we can do something similar here.
%
% First we must create any name tags that might be used. Whether it is in the preamble or in the body text, the main point is that the tag can only be used if it exists. The tags have a leading space because they are printed conditionally.
%
% We also define a cross-reference ``Atat\"urk,'' yet we use naming macros with that name, printing formatted names in the text but making no index page entries. We add a Boolean flag to the formatting hook that lets us suppress dates in first uses as needed, while normally displaying dates in first uses by default. Below we suppress the usual formatting of this manual.
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test11_02.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage{nameauth}
%
% \makeindex
%
% % Add name tags to names.
% \NameAddInfo[George]{Washington}{ (1732--99)}
% \NameAddInfo[Mustafa]{Kemal}{ (1881--1938)}
% \NameAddInfo{Atat\"urk}{ (in 1934, a special surname)}
%
% % Ensure that Atat\"urk is a cross-reference that
% % has no page entries in the index.
% \IndexRef{Atat\"urk}{Kemal, Mustafa}
%
% % Manually suppress name tag in ``first'' instance
% \newif\ifNoTag
%
% % Redesign formatting hook to usually print a tag
% % only in ``first'' instance. On exit, It resets
% % the flag that suppresses tags, making that flag
% % work only once per name use.
%
% \renewcommand*\NamesFormat[1]
% {%
%   #1%
%   \ifcsname\NameauthPattern!DB\endcsname
%     \unless\ifNoTag
%       \expandafter\csname\NameauthPattern!DB\endcsname%
%     \fi
%     \global\NoTagfalse%
%   \fi
% }
%
% \begin{document}
%
% \ForgetThis\Name[George]{Washington} held office as the first US
% president from 1789 to 1797. \Name[George]{Washington} was the only
% president whose term in office was completely in the eighteenth
% century. If we need to trigger the first use hook at some point,
% we can suppress dates and get an automatic long instance via:
% \NoTagtrue\ForgetThis\Name[George]{Washington}. Or we can trigger
% the first-use hook in a subsequent name use and still have dates:
% \ForceName\Name[George]{Washington}.
%
% We can add name info tags to names used only as cross-
% references. For example, \Name[Mustafa]{Kemal} was granted
% the name \Name{Atat\"urk}. We mention \Name[Mustafa]{Kemal}
% and \Name{Atat\"urk} again. Likewise, we can trigger a
% first use, but with no name tag tag:
% \NoTagtrue\ForgetThis\Name{Atat\"urk}.
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \NameAddInfo[George]{Washington}{ (1732--99)}
% \NameAddInfo[Mustafa]{Kemal}{ (1881--1938)}
% \NameAddInfo{Atat\"urk}{ (in 1934, a special surname)}
% \IndexRef{Atat\"urk}{Kemal, Mustafa}
% \renewcommand*\NamesFormat[1]
% {^^A
%   #1^^A
%   \ifcsname\NameauthPattern!DB\endcsname
%     \unless\ifNoTag
%       \expandafter\csname\NameauthPattern!DB\endcsname^^A
%     \fi
%     \global\NoTagfalse^^A
%   \fi
% }
% \renewcommand*\MainNameHook{}
%
% \begin{quote}
%   \VerbatimInput[gobble=0,lastline=34]{\NameauthTestFile}
% \end{quote}
%
% Up to this point it seems as if there has been a lot of setup. The payoff, however, comes in the main body text where the use of the naming macros does not look much different than normal.
%
% \begin{quote}
%   \VerbatimInput[gobble=0,firstline=35,lastline=45]{\NameauthTestFile}
%
%   \ForgetThis\Name[George]{Washington} held office as the first US
%   president from 1789 to 1797. \Name[George]{Washington} was the only
%   president whose term in office was completely in the eighteenth
%   century. If we need to trigger the first use hook at some point,
%   we can suppress dates and get an automatic long instance via:
%   \NoTagtrue\ForgetThis\Name[George]{Washington}. Or we can trigger
%   the first-use hook in a subsequent name use and still have dates:
%   \ForceName\Name[George]{Washington}.
% \end{quote}
%
% Since we already set up a cross-reference with \cmd{\IndexRef}, we can use just the the naming macros with ``Atat\"urk'' and get the desired formatting without any page entries in the index:
%
% \begin{quote}
%   \VerbatimInput[gobble=0,firstline=46]{\NameauthTestFile}
%
%   We can add name info tags to names used only as cross-
%   references. For example, \Name[Mustafa]{Kemal} was granted
%   the name \Name{Atat\"urk}. We mention \Name[Mustafa]{Kemal}
%   and \Name{Atat\"urk} again. Likewise, we can trigger a
%   first use, but with no name tag tag:
%   \NoTagtrue\ForgetThis\Name{Atat\"urk}.
% \end{quote}
%
% \endgroup^^A Local format hook redefinition
%
% \subsection{Alternate Formatting}
% \label{sec:AltFormat}
%
% We build on the subject of complex formatting hooks that \cmd{\noexpand} playing a role therein, Before we engage the topic of Roman names and other complex examples, we need to cover alternate formatting.
%
% \subsubsection[Enabling/Disabling]{Enabling and Disabling}
%
% The first thing we need to know is how to enable and disable alternate formatting:
%
% \begin{center}
% \begin{tabular}{lcc}\toprule
% Macro                    & Enabled & Activated\\\midrule
% \cmd{\AltFormatActive}   & \YES    & \YES\\
% \cmd{\AltFormatActive*}  & \YES    & \NO\\
% \cmd{\AltFormatInactive} & \NO     & \NO\\\bottomrule
% \end{tabular}
% \end{center}
%
% \begin{itemize}
% \item \emph{Enabled} means that the alternate formatting mechanism
%   inhibits the normal behavior of \cmd{\CapThis}.
% \item \emph{Disabled} means that the normal behavior of \cmd{\CapThis}
%   is again in force and alternate formatting is inhibited.
% \item \emph{Activated} means that built-in alternate formatting macros
%   like \cmd{\textSC} format their arguments.
% \item \emph{Deactivated} means that built-in alternate formatting macros
%   like \cmd{\textSC} do not format their arguments.
% \end{itemize}
%
% \DescribeMacro{\AltFormatActive}
% Both the \texttt{altformat} option and \cmd{\AltFormatActive} enable and activate alternate formatting. Both cause \cmd{\CapThis} to work via \cmd{\AltCaps} instead of the normal way. \cmd{\AltFormatActive} countermands \cmd{\AltFormatActive*}.
%
% \DescribeMacro{\AltFormatActive*}
% The starred form \cmd{\AltFormatActive*} enables alternate formatting but deactivates the built-in alternate formatting macros, preventing them from changing their arguments. It countermands both the \texttt{altformat} option and \cmd{\AltFormatActive}. It causes \cmd{\CapThis} only to work via \cmd{\AltCaps}.
%
% \newpage
%
% \DescribeMacro{\AltFormatInactive}
% This macro both disables and deactivates alternate formatting. This reverts globally to standard formatting and the normal function of \cmd{\CapThis}. 
%
% Most \textsf{nameauth} macros that turn things on and off have a local scope unless one uses \cmd{\global}. These alternate formatting macros have global scope to eliminate implied scope becoming a point of failure, creating spurious index entries.\medskip
%
% \begin{InfoBox}
% The macros above \emph{always} make global changes. Using names designed for alternate formatting in a document section that uses regular formatting will produce an inconsistent appearance in the text and spurious index entries.
% \end{InfoBox}
% \negmedskip
%
% \subsubsection{Using \texttt{\textbackslash noexpand}}
% \label{sec:Noexpand}
%
% As we get into advanced formatting, we will encounter \cmd{\noexpand} with greater frequency. Even before we consider that discussion, we need to touch on a few ways that macros can break \textsf{nameauth} when used in name arguments.
%
% In order to handle the inherent ambiguity of name forms, macros that take name arguments trade a certain ``fragility'' for the ability to be as close to natural language as possible. In versions of \textsf{nameauth} before 3.5, enclosing an \meta{SNN},\meta{Affix} argument within a robust macro like \cmd{\textsc} would halt \LaTeX\ with errors. That seems to be no longer the case. Nevertheless, depending on the macros used, it may be helpful to apply macros separately to \meta{SNN} and \meta{Affix} like this:
%
% \begin{quote}
%   |\Name{\noexpand\MyMacro{|\meta{SNN}|},\noexpand\MyMacro{|\meta{Affix}|}}|
% \end{quote}
%
% Using \cmd{\CapThis} with a name whose leading element is a macro may fail, depending on the particular macro. Use alternate formatting to have \cmd{\CapThis} activate the alternate capitalization mechanism.\medskip
%
% \NameArgWarning
%
% In Section~\ref{sec:DebuggingMacros} we encountered reasons for using \cmd{\noexpand} in name arguments, as well as related caveats. Now we include more reasons to use \cmd{\noexpand}:
%
% \begin{itemize}
% \item If a macro is undefined, even putting \cmd{\noexpand} before it will
%   permit an error unless the macro is detokenized or verbatim.
% \item The use of \cmd{\noexpand} isolates the local, conditional expansion of
%   macros in the formatting hooks from the global macro state in the index.
% \item Indexing of such names normally does not occur  within the formatting
%   hooks. Otherwise, different index entries would result.
% \item One can use macros in the formatting hooks to trigger local changes. If
%   using Boolean flags to trigger those changes, one needs two flags per change
%   (e.g., grammatical inflection) but not per name.
% \item Local flags are false when the hook executes. Global flags are reset
%   when the hook terminates.
% \item Take care when using macros in name arguments without using
%   \cmd{\noexpand} before them.
% \end{itemize}
%
% \subsubsection[Capitalization]{Alternate Capitalization}
% \AltFormatActive
%
% Above we referred to potential problems using \cmd{\CapThis}. When alternate formatting is enabled, \cmd{\CapThis} changes its mechanism to avoid such problems.
%
% \DescribeMacro{\AltCaps}
% Using the aid of the helper macro \cmd{\AltCaps}, \cmd{\CapThis} will cause \cmd{\AltCaps} to capitalize its argument only in a formatting hook. \cmd{\AltCaps} is enabled whenever alternate formatting is enabled, but it works independently of both \cmd{\AltOn} and \cmd{\AltOff}, which are covered in the next section. We describe the syntax:
%
% \begin{SyntaxBox}
%   \cmd{\noexpand}\cmd{\AltCaps}\marg{Arg}
% \end{SyntaxBox}
%
% We offer a silly example below, taking advantage of the local scope of the \texttt{quote} environment to disable indexing temporarily:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \IndexInactive
% What's in \Name[\noexpand\AltCaps{a}]{Name}?
% \CapThis\Name*[\noexpand\AltCaps{a}]{Name} smells not,
% but a rose does, even if it has
% \Name*[\noexpand\AltCaps{a}]{Name}.
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}^^A
%   \index{Shakespearian rose, references to\noexpand\string|hyperpage}
% \end{quote}
%
% \cmd{\AltCaps} does not partition its argument, so it will not have the same issues as the normal use of \cmd{\CapThis}, adding to stability and robustness at the expense of doing a little more work.
% \AltFormatInactive
%
% \begingroup^^A Local format hook redefinition
%
% \subsubsection{Formatting Features}
% \label{sec:AltFeatures}
% \AltFormatActive
%
% \DescribeMacro{\textSC}
% Using alternate formatting can be as easy as using any one of four predefined macros.
% \DescribeMacro{\textIT}
% These macros are analogous to the predefined formatting hooks that are accessible via package options.
% \DescribeMacro{\textBF}
% They \emph{always format} their arguments when using the \texttt{altformat} option or \cmd{\AltFormatActive}.
% \DescribeMacro{\textUC}
% They \emph{never format} their arguments when \cmd{\AltFormatActive*} is used or alternate formatting is disabled.
%
% By themselves, they do not change format. Yet the macros \cmd{\AltOff} and \cmd{\AltOn}, described shortly, are able to turn the formatting of these macros on and off. We advise using \cmd{\noexpand} before these macros because they can be made to change format. Assuming that we have sorted the following names with \cmd{\PretagName} (Section~\ref{sec:IndexSort}), we get the following, using this manual's formatting conventions:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \Name[Konrad]{\noexpand\textSC{Zuse}};
% \Name[Konrad]{\noexpand\textSC{Zuse}}\\
% \Name[Ada]{\noexpand\textIT{Lovelace}};
% \Name[Ada]{\noexpand\textIT{Lovelace}}\\
% \Name[Charles]{\noexpand\textBF{Babbage}};
% \Name[Charles]{\noexpand\textBF{Babbage}}\\
% \Name{\noexpand\textUC{Kanade}, Takeo};
% \Name{\noexpand\textUC{Kanade}, Takeo}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
%
%   \input{\jobname.tmp}
% \end{quote}
%
% Font substitutions might occur with these macros, depending on the font used. \cmd{\CapName}, \cmd{\RevComma}, and \cmd{\RevName} can modify the names, but only in the text.
%
% The alternate formatting macros shown above become more interesting when we automate how they turn on and off. Using \cmd{\noexpand} is necessary here. Both macros below are used in formatting hooks. They hide some complexity from authors.
%
% Vaguely reminiscent of depressing\DescribeMacro{\AltOff}\ an automobile's manual clutch lever, \cmd{\AltOff} deactivates \cmd{\textSC}, \cmd{\textBF}, \cmd{\textIT}, and \cmd{\textUC} only in a formatting hook. The alternate formatting mechanism is still ``running'', but it is not transferring ``power'' to the formatting macros. They display their arguments unmodified.
%
% Likewise, \cmd{\AltOn}\DescribeMacro{\AltOn}\ activates \cmd{\textSC}, \cmd{\textBF}, \cmd{\textIT}, and \cmd{\textUC} only in a formatting hook, as if one let out the clutch pedal, causing ``power'' to transfer through the gearbox to the formatting macros. They now modify their arguments.
%
% If one uses the \texttt{altformat} option or \cmd{\AltFormatActive}, the formatting ``power'' goes to the formatting macros by default in order to have formatted names in the index. Otherwise, the normal formatting regime isolates formatting in the text, as the Anglosphere seems wont to do.
%
% We use \cmd{\noexpand} as discussed and add a formatting hook to get changes in the text, not in the index. We also suspend this manual's formatting conventions:
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test11_03.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
%
% \makeindex
%
% \PretagName[Konrad]{\noexpand\textSC{Zuse}}{Zuse, Konrad}
% \PretagName[Ada]{\noexpand\textIT{Lovelace}}{Lovelace, Ada}
% \PretagName[Charles]{\noexpand\textBF{Babbage}}
%   {Babbage, Charles}
% \PretagName{\noexpand\textUC{Kanade}, Takeo}{Kanade Takeo}
%
% \begin{document}
%
% \renewcommand*\MainNameHook{\AltOff}
%
% \ForgetThis\Name[Konrad]{\noexpand\textSC{Zuse}};
% \Name[Konrad]{\noexpand\textSC{Zuse}}\\
% \ForgetThis\Name[Ada]{\noexpand\textIT{Lovelace}};
% \Name[Ada]{\noexpand\textIT{Lovelace}}\\
% \ForgetThis\Name[Charles]{\noexpand\textBF{Babbage}};
% \Name[Charles]{\noexpand\textBF{Babbage}}\\
% \ForgetThis\Name{\noexpand\textUC{Kanade}, Takeo};
% \Name{\noexpand\textUC{Kanade}, Takeo}
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\NameauthTestFile}
%
%   \renewcommand*\NamesFormat{}
%   \renewcommand*\MainNameHook{\AltOff}
%
%   \ForgetThis\Name[Konrad]{\noexpand\textSC{Zuse}};
%   \Name[Konrad]{\noexpand\textSC{Zuse}}\\
%   \ForgetThis\Name[Ada]{\noexpand\textIT{Lovelace}};
%   \Name[Ada]{\noexpand\textIT{Lovelace}}\\
%   \ForgetThis\Name[Charles]{\noexpand\textBF{Babbage}};
%   \Name[Charles]{\noexpand\textBF{Babbage}}\\
%   \ForgetThis\Name{\noexpand\textUC{Kanade}, Takeo};
%   \Name{\noexpand\textUC{Kanade}, Takeo}
% \end{quote}
%
% \AltFormatInactive
% \endgroup^^A Local format hook redefinition
%
% \subsubsection{History Text}
% \label{sec:RealAltEx}
% \AltFormatActive
%
% \begingroup^^A Local format hook redefinition
%
% First we engage the idea of a history text, where we use standards for medieval Italian to encode a name instead of those used in modern Romance languages.
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test11_04.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
%
% \makeindex
%
% \begin{nameauth}
%   \< Luth & Martin & \noexpand\textSC{Luther} & >
%   \< Cath & Catherine \noexpand\AltCaps{d}e'
%           & \noexpand\textSC{Medici} & >
% \end{nameauth}
% \PretagName[Martin]{\noexpand\textSC{Luther}}{Luther, Martin}
% \PretagName[Catherine \noexpand\AltCaps{d}e']
%            {\noexpand\textSC{Medici}}{Medici, Catherine de}
%
% \renewcommand*\MainNameHook{\sffamily\AltOff}
%
% \begin{document}
%
% \ForgetThis\Luth\ was a leading figure in the Protestant
% Reformation. \Luth\ believed that one is declared
% righteous in a forensic sense by divine grace through faith
% created by the Holy Spirit via the Gospel and the Sacraments.
%
% \ForgetThis\Cath\ was not only Queen of France in her own right,
% but she also guided the reigns of her three sons.
% \CapThis\LCath[\noexpand\AltCaps{d}e']
% was blamed for the St.\ Bartholomew's Day massacre that saw the
% murder of thousands of Huguenots.
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \renewcommand*\MainNameHook{\sffamily\AltOff}
% \begin{quote}
%   \VerbatimInput[gobble=0]{\NameauthTestFile}
%
%   \ForgetThis\Luth\ was a leading figure in the Protestant
%   Reformation. \Luth\ believed that one is declared
%   righteous in a forensic sense by divine grace through faith
%   created by the Holy Spirit via the Gospel and the Sacraments.
%
%   \ForgetThis\Cath\ was not only Queen of France in her own right,
%   but she also guided the reigns of her three sons.
%   \CapThis\LCath[\noexpand\AltCaps{d}e']
%   was blamed for the St.\ Bartholomew's Day massacre that saw the
%   murder of thousands of Huguenots.
% \end{quote}
%
% Comparing the example above to Section~\ref{sec:NameParticles} shows us some differences. Medieval Italian, similar to modern German, keeps the particle(s) with the forename(s). Modern Italian groups particles and surnames together. Thus, we must use here:
%
% \begin{itemize}
% \item \parbox{0.2\textwidth}{\LCath[\noexpand\AltCaps{d}e']}
%   |\LCath[\noexpand\AltCaps{d}e']|
% \item \parbox{0.2\textwidth}{\CapThis\LCath[\noexpand\AltCaps{d}e']}
%   |\CapThis\LCath[\noexpand\AltCaps{d}e']|
% \end{itemize}
% \endgroup^^A Local format hook redefinition
%
%
% \subsubsection{Inflected Names}
% \label{sec:InflNames}
% \begingroup^^A Local format hook redefinition
%
% Next we design grammatical inflections for use with alternate formatting. We do not use the general formatting conventions in this manual. We shall build on this example in order to design the more complex hooks used for Roman names.
%
% We need two Boolean flags for one change in name form, which is a grammatical inflection in this case. Thus, we set up \texttt{\textbackslash ifGenitive} as the global flag and \texttt{\textbackslash ifDoGenitive} as the local flag.
%
% \cmd{\DoGenitivetrue} occurs only in the formatting hook. The macro that produces the genitive (or possessive) ending only does so when \texttt{\textbackslash ifDoGenitive} is true. This keeps the index entries consistent via \cmd{\noexpand}. Likewise, \cmd{\AltOff} only occurs in the formatting hook \cmd{\MainNameHook}.
% \JustIndex\Jeff
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test11_05.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
%
% \makeindex
%
% \newif\ifGenitive
% \newif\ifDoGenitive
%
% \newcommand*\GEN{\ifDoGenitive\textSC{'s}\fi}
%
% \begin{nameauth}
%   \< Jeff & Thomas &
%      \noexpand\textSC{Jefferson}\noexpand\GEN{} & >
% \end{nameauth}
%
% \PretagName[Thomas]{\noexpand\textSC{Jefferson}\noexpand\GEN{}}
%   {Jefferson, Thomas}
% \TagName[Thomas]{\noexpand\textSC{Jefferson}\noexpand\GEN{}}
%   {, pres.}
%
% \renewcommand*\NamesFormat[1]
%   {\ifGenitive\DoGenitivetrue\fi#1\global\Genitivefalse}
% \renewcommand*\MainNameHook[1]
%   {\ifGenitive\DoGenitivetrue\fi\AltOff#1\global\Genitivefalse}
%
% \begin{document}
%
% Consider \Genitivetrue\Jeff\ legacy as the author of the
% colonies' \textit{Declaration of Independence} and his impact
% as third president of the United States. \Jeff\ was a complex
% historical figure whose actions defy a consistent moral compass
% both in public policy and in personal affairs.
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\NameauthTestFile}
%
%   \renewcommand*\NamesFormat[1]
%     {\ifGenitive\DoGenitivetrue\fi#1\global\Genitivefalse}
%   \renewcommand*\MainNameHook[1]
%     {\ifGenitive\DoGenitivetrue\fi\AltOff#1\global\Genitivefalse}
%
% Consider \Genitivetrue\Jeff\ legacy as the author of the
% colonies' \textit{Declaration of Independence} and his impact
% as third president of the United States. \Jeff\ was a complex
% historical figure whose actions defy a consistent moral compass
% both in public policy and in personal affairs.
% \end{quote}
% \endgroup^^A Local format hook redefinition
%
% \subsubsection{Reference Work I}
% \begingroup^^A Local format hook redefinition
%
% Here we show how \textsf{nameauth} might be used in a reference work, where names are also the head-words of articles. We present examples that include a basic Western name, a basic Eastern name, and a more complicated Western name that includes an alias. Here are a few points to consider:
%
% \begin{itemize}
% \item Sort all names that use alternate formatting.
%
% \item Match index entry forms to article head-words. Name variants
%   are cross-referenced to the name form in the head-word.
%
% \item Ensure that the first appearance of a name displays only the
%   active alternate formatting. Any additional formatting comes from
%   the macro that formats entries.
%
% \item Deactivate alternate formatting in subsequent name instances.
%
% \item Since some \LaTeX\ fonts do not combine small caps and boldface,
%   we instead use slanted text to set the head-words off from the articles.
%   That font switch is done in the macro that formats the articles
%   (\cmd{\RefArticle}).
% \end{itemize}
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test11_06.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
%
% \makeindex
%
% % Sort any names with macros in the arguments.
%
% \PretagName[Greta]{\noexpand\textSC{Garbo}}{Garbo, Greta}
% \PretagName{\noexpand\textSC{Misora}, Hibari}{Misora Hibari}
% \PretagName[Heinz]{\noexpand\textSC{R\"uhmann}}{Ruehmann, Heinz}
% \PretagName[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}}
%   {Ruehmann, Heinrich Wilhelm}
%
% % Make a cross-reference from a variant name form to the
% % form of the head-words
%
% \IndexRef[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}}
%   {\noexpand\textSC{R\"uhmann}, Heinz}
%
% % Define the formatting hooks. Since we use the `altformat'
% % option, alternate formatting is turned off in later
% % name uses.
%
% \renewcommand*\MainNameHook{\AltOff}
%
% % Typeset head-words with a slanted font.
%
% \newcommand{\RefArticle}[3]
% {%
%   \def\check{#2}%
%   \ifx\check\empty
%     \noindent\ForgetThis\textsl{#1}\ #3
%   \else
%     \noindent\ForgetThis\textsl{#1}\ #2\ #3
%   \fi\medskip
% }
%
% \begin{document}
%
% \RefArticle
%   {\RevComma\Name[Greta]{\noexpand\textSC{Garbo}}}
%   {}
%   {(18 September 1905\,--\,15 April 1990) was a Swedish
%    film actress during the 1920s and 1930s.
%    \Name[Greta]{\noexpand\textSC{Garbo}}\dots}
%
% \RefArticle
%   {\Name{\noexpand\textSC{Misora}, Hibari}}
%   {(W:\,``\RevName\Name*{\noexpand\textSC{Misora}, Hibari}'';}
%   {29 May 1937\,--\,24 June 1989) was a Japanese singer
%    and actress noted for her positive message.
%    \Name{\noexpand\textSC{Misora}, Hibari}\dots}
%
% \RefArticle
%   {\RevComma\Name[Heinz]{\noexpand\textSC{R\"uhmann}}}
%   {(\SubvertThis\ForceName
%     \FName[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}};}
%   {7 March 1902\,--\,3 October 1994) was a German actor
%    in over 100 films.
%    \Name[Heinz]{\noexpand\textSC{R\"uhmann}}\dots}
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
% \VerbatimInput[gobble=0]{\NameauthTestFile}
%
% \IndexRef[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}}
%   {\noexpand\textSC{R\"uhmann}, Heinz}
%
% \renewcommand*\NamesFormat{}
% \renewcommand*\MainNameHook{\AltOff}
%
% \newcommand{\RefArticle}[3]
% {^^A
%   \def\check{#2}^^A
%   \ifx\check\empty
%     \noindent\ForgetThis\textsl{#1}\ #3
%   \else
%     \noindent\ForgetThis\textsl{#1}\ #2\ #3
%   \fi\medskip
% }
%
% \RefArticle
%   {\RevComma\Name[Greta]{\noexpand\textSC{Garbo}}}
%   {}
%   {(18 September 1905\,--\,15 April 1990) was a Swedish
%    film actress during the 1920s and 1930s.
%    \Name[Greta]{\noexpand\textSC{Garbo}}\dots}
%
% \RefArticle
%   {\Name{\noexpand\textSC{Misora}, Hibari}}
%   {(W:\,``\RevName\Name*{\noexpand\textSC{Misora}, Hibari}'';}
%   {29 May 1937\,--\,24 June 1989) was a Japanese singer
%    and actress noted for her positive message.
%    \Name{\noexpand\textSC{Misora}, Hibari}\dots}
%
% \RefArticle
%   {\RevComma\Name[Heinz]{\noexpand\textSC{R\"uhmann}}}
%   {(\SubvertThis\ForceName
%     \FName[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}};}
%   {7 March 1902\,--\,3 October 1994) was a German actor
%    in over 100 films.
%    \Name[Heinz]{\noexpand\textSC{R\"uhmann}}\dots}
% \end{quote}
%
% \endgroup^^A Local format hook redefinition
% \AltFormatInactive
%
% \begin{Quote}{\Name[L.M.]{Montgomery},
% \textit{Anne of Green Gables}, C 5 (1908)}
% I read in a book once that a rose by any other name would smell as sweet, but I've never been able to believe it. I don't believe a rose \textsc{would} be as nice if it was called a thistle or a skunk cabbage.^^A
% \index{creatives, quotes of\noexpand\string|hyperpage}^^A
% \index{Shakespearian rose, references to\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \subsection{Roman Names}
% \label{sec:Romani}
%
% Roman names tend to be among the most variable in terms of treatment. As far as \textsf{nameauth} is concerned, they range from being treated as Western names to being treated in very special ways. Below we show some variations.
%
% \subsubsection[General Market]{Casual Reading / General Book Market}
%
% \begin{itemize}
% \item Treat as a Western name, especially among well-known Roman names like
%   \Name*[M.T.]{Cicero}[Marcus Tullius], where the final name, \Cicero, is a
%   surname and the rest forenames:\footnote{Philip J. Adler, \textit{World
%   Civilizations}, 3rd ed. (Belmont, Calif.: Thomson/Wadsworth, 2003).}
%
% \begin{quote}
% \begin{Verbatim}
% \TagName[Julius]{Caesar}{, imperator} % for index
% \Name[Julius]{Caesar}[Gaius Julius]\\
% \Name*[Julius]{Caesar}\\
% \Name[Julius]{Caesar}
% \end{Verbatim}
% \Name[Julius]{Caesar}[Gaius Julius]^^A
%   \PatInfo{\ShowPattern[Julius]{Caesar}[Gaius Julius]!MN}\\
% \Name*[Julius]{Caesar}\\
% \Name[Julius]{Caesar}\\[1ex]
% Index: \ShowIdxPageref*[Julius]{Caesar}^^A
% \end{quote}
%
% \item Treat as a Western name; put \textit{nomen} and \textit{cognomen} in
%   \meta{SNN}:\footnote{Paul L. Maier, \textit{In the Fullness of Time: A
%   Historian Looks at Christmas, Easter, and the Early Church}, revised ed.
%   (San Francisco: Harper, 1991).}
%
% \begin{quote}
% \begin{Verbatim}
% \ForgetThis\Name[Lucius]{Sergius Paulus}\\
% \Name[Lucius]{Sergius Paulus}
% \end{Verbatim}
% \ForgetThis\Name[Lucius]{Sergius Paulus}^^A
%   \PatInfo{\ShowPattern[Lucius]{Sergius Paulus}!MN}\\
% \Name[Lucius]{Sergius Paulus}\\[1ex]
% Index: \ShowIdxPageref*[Lucius]{Sergius Paulus}^^A
% \end{quote}
%
% \item Treat as ancient names, especially those with no \textit{praenomen}:
%
% \begin{quote}
% \begin{Verbatim}
% \ForgetThis\Name{Pontius, Pilate}[Pilatus]\\
% \Name*{Pontius, Pilate}\\
% \ForceFN\FName{Pontius, Pilate}
% \end{Verbatim}
% \ForgetThis\Name{Pontius, Pilate}[Pilatus]^^A
%   \PatInfo{\ShowPattern{Pontius, Pilate}[Pilatus]!MN}\\
% \Name*{Pontius, Pilate}\\
% \ForceFN\FName{Pontius, Pilate}\\[1ex]
% Index: \ShowIdxPageref*{Pontius, Pilate}
% \end{quote}
% \end{itemize}
%
% There is also a method where Roman names are indexed as mononyms using the most recognizable of their names.\footnote{Justo L. González, \textit{The Story of Christianity}, 2 vols. (San Francisco: Harper, 1984).} That method is ill-suited for \textsf{nameauth}.
%
% \begin{Quote}{\ForgetThis\Name[Julius]{Caesar},
% \textit{\la{De bello gallico}} 3.16.6 (58–49 \textsc{bc})}
% \la{Fere libenter homines, id quod volunt, credunt.}
%
% (In general, people willingly believe what they want [to believe].)^^A
% \index{Romans, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \subsubsection[Student Reference]{Student-Oriented Reference Works}
% \AltFormatActive
%
% \begingroup^^A Local format hook redefinition
% \renewcommand*\NamesFormat{}
% \renewcommand*\MainNameHook{}
%
% We focus here on reference works meant for general education. In this subsection and the next, we do not use the general formatting conventions of this manual and we activate alternate formatting. Roman names have the following format:
%
% \begin{itemize}
% \item A personal name (\textit{praenomen})
% \item A clan name (\textit{nomen})
% \item A distinguishing name, sometimes denoting clan branches
%   (\textit{cognomen}); that could include various affixed names
%   (\textit{agnomina})
% \end{itemize}
%
% In ancient Rome, the family name (\textit{nomen}) was important, helping also to structure society. \href{https://en.wikipedia.org/wiki/Patrician_(ancient_Rome)}{This page} offers a good overview.
% The exact roles of names changed over time. \href{https://en.wikipedia.org/wiki/Roman_naming_conventions}{Another page} gives an overview of Roman naming conventions.
% A very \href{https://www.youtube.com/watch?v=RMLb1jVl_Uo}{helpful video} can be found on the YouTube channel PolýMATHY by \Name[Luke]{Ranieri}.
%
% Some reference works treat the \textit{cognomen} as if it were a Western surname.\footnote{See Geiss, \textit{Geschichte Griffbereit}; Kinder and Hilgemann, \textit{dtv-Atlas zur Weltgeschichte}, 2 vols., 29th printing (1964; Munich: Deutscher Taschenbuch Verlag, 1993). See also \href{https://books.infotoday.com/books/Indexing-names.shtml}{\bfseries this page}.}
% Using this approach, Roman names encoded with \textsf{nameauth} have this form:
%
% \begin{quote}
% Index: \ShowIdxPageref*[\meta{praenomen} \meta{nomen}]
%   {\meta{cognomen} \meta{agnomen}}\\[1ex]
% Macro: |\Name[|\meta{praenomen}| |\meta{nomen}|]{|\meta{cognomen}|,|
%   \meta{agnomen}|}|
% \end{quote}
%
% With both \textit{praenomen} and \textit{nomen} in \meta{FNN}, as well as the \textit{agnomina} in \meta{Affix}, they drop automatically in subsequent name uses. With a \textit{cognomen} as an effective surname, our choices for name components in the text take on this logic:
%
% \begin{itemize}
% \item Display one of the following in \meta{FNN}:
%   \begin{itemize}
%   \item Only the \textit{praenomen}
%   \item Only the \textit{nomen}
%   \item Both \textit{praenomen} and \textit{nomen}
%   \end{itemize}
%
% \item Display one of the following in \meta{SNN}:
%   \begin{itemize}
%   \item Only the \textit{cognomen}
%   \item Both \textit{cognomen} and \textit{agnomina}
%   \end{itemize}
% \end{itemize}
%
% We accomplish this by using macros in the name arguments:
%
% \begin{itemize}
% \item If the macros in the name arguments will be ``segmented'' in some
%   way, as \cmd{\CapThis} does, then use alternate formatting
%   (Sections~\ref{sec:AltFormat}).
%
% \item When using Boolean flags (\texttt{\textbackslash if}\meta{flag}) in
%   the macros that represent name elements, ensure that those flags only change
%   their value within the local scope of the name formatting hooks
%   (Section~\ref{sec:Formatting}).
%
% \item Two Boolean flags are needed for each automated variant in the name. One
%   flag reflects the global state and the name form in the index. The other
%   reflects the local state of the formatting hooks.
% \end{itemize}
%
% \NameArgWarning
%
% Since we have four name components, we need at most eight Boolean flags. Our two examples each use six flags, with four in common and one separate pair each. In the preamble we define all macros and conditionals used in naming macro arguments. Instead of \texttt{\textbackslash ifNoNomen} we use \texttt{\textbackslash ifNoGens} for readability.
%
% We must use \cmd{\noexpand} in the macro arguments. We define macros in both \meta{FNN} and \meta{SNN} that expand conditionally. We use the quick interface to define name shorthands, and we sort the name with \cmd{\PretagName}. False Boolean flags display longer name forms. True flags display shorter forms.
%
% We used \cmd{\PretagName} and \cmd{\TagName} as needed (cf. Section~\ref{sec:NameAncient}. These formatting hooks used with Roman names also work with other name types.
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test11_07.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
%
% \makeindex
%
% % Global Boolean flags need to be defined only once.
% \newif\ifNoPraenomen
% \newif\ifNoCognomen
% \newif\ifNoGens
% \newif\ifNoAgnomen
%
% % Local Boolean flags need to be defined only once.
% \newif\ifXPrae
% \newif\ifXCogn
% \newif\ifXGens
% \newif\ifXAgno
%
% % Name variant macros need to be defined uniquely for each
% % name. First is Scipio. Second is Gracchus.
%
% \newcommand*\SCIPi
% {%
%   \ifXGens Publius\else
%     \ifXPrae Cornelius\else
%       Publius Cornelius%
%     \fi
%   \fi
% }
%
% \newcommand*\SCIPii
% {%
%   \ifXAgno Scipio\else
%     Scipio Africanus%
%   \fi
% }
%
% \newcommand*\TSemp
% {%
%   \ifXGens Tiberius\else
%     \ifXPrae Sempronius\else
%       Tiberius Sempronius%
%     \fi
%   \fi
% }
%
% % Quick interface definitions. The first shows
% % the concept of Roman names without extra features.
% % The second (Gracchus) adds name info tags.
%
% \begin{nameauth}
%   \< Scipio & \noexpand\SCIPi & \noexpand\SCIPii & >
%   \< TGrac & \noexpand\TSemp & Gracchus & >
% \end{nameauth}
%
% % We add the name tag.
% \NameAddInfo[\noexpand\TSemp]{Gracchus}
%   { (consul, 177 \textsc{bc})}
%
% % Sorting and tagging the names
% \PretagName[\noexpand\SCIPi]{\noexpand\SCIPii}
%   {Scipio Africanus}
% \PretagName[\noexpand\TSemp]{Gracchus}
%   {Gracchus, Tiberius Sempronius}
% \TagName[\noexpand\TSemp]{Gracchus}{, consul}
%
% \begin{document}
%
% % Although it is helpful to set everything up
% % In the preamble, it is not absolutely necessary.
% % Here we define the simpler set of formatting hooks
% % for Scipio, although the complex hooks will work
% % for both equally as well.
%
% \renewcommand*\NamesFormat[1]
% {%
%   \ifNoPraenomen\XPraetrue\fi%
%   \ifNoGens\XGenstrue\fi%
%   \ifNoCognomen\XCogntrue\fi%
%   \ifNoAgnomen\XAgnotrue\fi%
%   #1%
%   \global\NoPraenomenfalse%
%   \global\NoGensfalse%
%   \global\NoCognomenfalse%
%   \global\NoAgnomenfalse%
% }
%
% \renewcommand*\MainNameHook[1]
% {%
%   \ifNoPraenomen\XPraetrue\fi%
%   \ifNoGens\XGenstrue\fi%
%   \ifNoCognomen\XCogntrue\fi%
%   \ifNoAgnomen\XAgnotrue\fi%
%   #1%
%   \global\NoPraenomenfalse%
%   \global\NoGensfalse%
%   \global\NoCognomenfalse%
%   \global\NoAgnomenfalse%
% }
%
% \NoAgnomentrue\Scipio\ was born around 236 \textsc{bc}
% into the Scipiones branch of the Cornelii clan.
% \NoAgnomentrue\Scipio\ rose to military fame during the
% Second Punic War. Thereafter he was known as \Scipio.
% He flourished during the Egyptian reigns of
% \Name{Ptolemy, IV}[IV Philopator] and
% \Name{Ptolemy, V}[V Epiphanes], and the Syrian
% reigns of \Name{Seleucus, III}[III Ceraunus] and
% \Name{Antiochus, III}[III the Great].
%
% % We make no change to \MainNameHook, but we do
% % change \NamesFormat to display any extant
% % name tags.
%
% \renewcommand*\NamesFormat[1]
% {%
%   \ifNoPraenomen\XPraetrue\fi%
%   \ifNoGens\XGenstrue\fi%
%   \ifNoCognomen\XCogntrue\fi%
%   \ifNoAgnomen\XAgnotrue\fi%
%   #1%
%   \ifcsname\NameauthPattern!DB\endcsname
%     \expandafter\csname\NameauthPattern!DB\endcsname%
%   \fi
%   \global\NoPraenomenfalse%
%   \global\NoGensfalse%
%   \global\NoCognomenfalse%
%   \global\NoAgnomenfalse%
% }
%
% \TGrac\ served as tribune of the plebs in 184 \textsc{bc}.
% \NoGenstrue\STGrac\ was elected praetor for 180 \textsc{bc},
% after which he was appointed governor of Hispania Citerior,
% serving with the rank of proconsul. In 177 \textsc{bc},
% he was elected consul, again in 163 \textsc{bc}.
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
% \VerbatimInput[gobble=0, lastline=74]{\NameauthTestFile}
% \end{quote}
%
% Formatting hook macros need to be redefined only once. We reset the global Boolean flags to ensure the longest name forms in the index. The local Boolean flags automatically revert to false outside the scope of the formatting hooks.
%
% \renewcommand*\NamesFormat[1]
% {^^A
%   \ifNoPraenomen\XPraetrue\fi^^A
%   \ifNoGens\XGenstrue\fi^^A
%   \ifNoCognomen\XCogntrue\fi^^A
%   \ifNoAgnomen\XAgnotrue\fi^^A
%   #1^^A
%   \global\NoPraenomenfalse^^A
%   \global\NoGensfalse^^A
%   \global\NoCognomenfalse^^A
%   \global\NoAgnomenfalse^^A
% }
%
% \renewcommand*\MainNameHook[1]
% {^^A
%   \ifNoPraenomen\XPraetrue\fi^^A
%   \ifNoGens\XGenstrue\fi^^A
%   \ifNoCognomen\XCogntrue\fi^^A
%   \ifNoAgnomen\XAgnotrue\fi^^A
%   #1^^A
%   \global\NoPraenomenfalse^^A
%   \global\NoGensfalse^^A
%   \global\NoCognomenfalse^^A
%   \global\NoAgnomenfalse^^A
% }
% \begin{quote}
% \VerbatimInput[gobble=0, firstline=75, lastline=87]{\NameauthTestFile}
%
% \newpage
%
% \VerbatimInput[gobble=0, firstline=88, lastline=110]{\NameauthTestFile}
%
% \NoAgnomentrue\Scipio\ was born around 236 \textsc{bc}
% into the Scipiones branch of the Cornelii clan.
% \NoAgnomentrue\Scipio\ rose to military fame during the
% Second Punic War. Thereafter he was known as \Scipio.
% He flourished during the Egyptian reigns of
% \Name{Ptolemy, IV}[IV Philopator] and
% \Name{Ptolemy, V}[V Epiphanes], and the Syrian
% reigns of \Name{Seleucus, III}[III Ceraunus] and
% \Name{Antiochus, III}[III the Great].
% \end{quote}
%
% Below we show more name name variations than were shown above. In addition, we use those same formatting hooks to display non-Roman names:
%
% \begin{Block}
% \ForgetThis\Scipio \dotfill |\ForgetThis\Scipio|\\
% \LScipio \dotfill |\LScipio|\\
% \Scipio \dotfill |\Scipio|\\
% \SScipio \dotfill |\SScipio|\\[2ex]
% \NoAgnomentrue\LScipio \dotfill |\NoAgnomentrue\LScipio|\\
% \NoAgnomentrue\Scipio \dotfill |\NoAgnomentrue\Scipio|\\
% \NoGenstrue\SScipio \dotfill |\NoGenstrue\SScipio|\\
% \NoPraenomentrue\SScipio \dotfill |\NoPraenomentrue\SScipio|\\[2ex]
% \Name*{Ptolemy, IV}[IV Philopator]\dotfill |\Name*{Ptolemy, IV}[IV Philopator]|\\
% \Name*{Ptolemy, IV}\dotfill |\Name*{Ptolemy, IV}|\\
% \Name{Ptolemy, IV}\dotfill |\Name{Ptolemy, IV}|
% \end{Block}
%
% In Section~\ref{sec:NameAncient}, we used name tags instead of \meta{Alternate} in the first-use formatting hook. Here we show the changes needed to add name tags to the first-use formatting hook. Even though we are changing the formatting hooks throughout the document, none of the changes cause different index entries and will be unnoticed in the finished document.
%
% \NameAddInfo[\noexpand\TSemp]{Gracchus}
%   { (consul, 177 \textsc{bc})}
% \renewcommand*\NamesFormat[1]
% {^^A
%   \ifNoPraenomen\XPraetrue\fi^^A
%   \ifNoGens\XGenstrue\fi^^A
%   \ifNoCognomen\XCogntrue\fi^^A
%   \ifNoAgnomen\XAgnotrue\fi^^A
%   #1^^A
%   \ifcsname\NameauthPattern!DB\endcsname
%     \expandafter\csname\NameauthPattern!DB\endcsname^^A
%   \fi
%   \global\NoPraenomenfalse^^A
%   \global\NoGensfalse^^A
%   \global\NoCognomenfalse^^A
%   \global\NoAgnomenfalse^^A
% }
% \begin{quote}
% \VerbatimInput[gobble=0,firstline=111]{\NameauthTestFile}
%
% \TGrac\ served as tribune of the plebs in 184 \textsc{bc}.
% \TGrac\ was elected praetor for 180 \textsc{bc},
% after which he was appointed governor of Hispania Citerior,
% serving with the rank of proconsul. In 177 \textsc{bc},
% he was elected consul, again in 163 \textsc{bc}.
% \end{quote}
%
% Below we show both a Roman name and a different name type working the same way with the formatting hook:
%
% \begin{Block}
%   \ForgetThis\TGrac \dotfill |\ForgetThis\TGrac|\\
%   \LTGrac \dotfill |\LTGrac|\\
%   \NoGenstrue\LTGrac \dotfill |\NoGenstrue\LTGrac|\\
%   \TGrac \dotfill |\TGrac|\\
%   \STGrac \dotfill |\STGrac|\\
%   \NoGenstrue\STGrac \dotfill |\NoGenstrue\STGrac|\\
%   \NoPraenomentrue\STGrac \dotfill |\NoPraenomentrue\STGrac|\\[2ex]
%   \ForgetThis\Dem \dotfill |\ForgetThis\Dem|\\
%   \LDem \dotfill |\LDem|\\
%   \Dem \dotfill |\Dem|
% \end{Block}
%
% \begingroup
% \renewcommand*\NamesFormat[1]{\color{blue}\sffamily #1}
% \renewcommand*\MainNameHook[1]{\sffamily #1}
% \begin{Quote}{\ForgetThis\Scipio\break
% \hbox{}\hfill attributed by \Name[Titus]{Livius} in
% \textit{\la{Ab urbe condita}} B 30 (27–9 \textsc{bc})}
% \la{Bellum parate, quoniam pacem pati non potuistis.}
%
% (Prepare for war, for it seems that you are unable to tolerate peace.)\footnote{Here we enclosed this quote in a group and redefined the formatting hooks locally.}^^A
% \index{Romans, quotes of\noexpand\string|hyperpage}
% \end{Quote}
% \endgroup
%
% \newpage
%
% \subsubsection[Scholarly Reference]{Scholarly Reference Works}
%
% The \textit{Oxford Classical Dictionary} and other scholarly sources index according to the \textit{nomen}. That approach moves the \textit{nomen} from \meta{FNN} to \meta{SNN} thus:
%
% \begin{quote}
% Index: \ShowIdxPageref*[\meta{praenomen}]{\meta{nomen} \meta{cognomen}
%   \meta{agnomen}}\\[1ex]
% Macro: |\Name[|\meta{praenomen}|]{|\meta{nomen} \meta{cognomen}
%   \meta{agnomen}|}|
% \end{quote}
%
% This indexing method is incompatible with the previous section, but we show both in this manual. We retain most of the code used in the last section, but we change the macros used in the name arguments. The logic still shows all names for the index, but we make different choices in the text:
%
% \begin{itemize}
% \item Display the \textit{praenomen} in \meta{FNN}:
% \item Display one of the following in \meta{SNN}:
%   \begin{itemize}
%   \item Only the \textit{cognomen}
%   \item Both the \textit{cognomen} and \textit{agnomina}
%   \item Only the \textit{nomen}
%   \item Both the \textit{nomen} and \textit{cognomen}
%   \item The \textit{nomen}, \textit{cognomen}, and \textit{agnomina}
%   \end{itemize}
% \end{itemize}
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test11_08.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
%
% \makeindex
%
% % Global Boolean flags need to be defined only once.
% \newif\ifNoPraenomen
% \newif\ifNoCognomen
% \newif\ifNoGens
% \newif\ifNoAgnomen
%
% % Local Boolean flags need to be defined only once.
% \newif\ifXPrae
% \newif\ifXCogn
% \newif\ifXGens
% \newif\ifXAgno
%
% % Name variant macros need to be defined
% % uniquely for each name.
%
% \newcommand*\CSB
% {%
%   \ifXGens
%     \ifXAgno Scipio\else
%       Scipio Barbatus\fi
%   \else
%     \ifXCogn Cornelius\else
%       \ifXAgno Cornelius Scipio\else
%         Cornelius Scipio Barbatus%
%       \fi
%     \fi
%   \fi
% }
%
% % Quick interface definition
% \begin{nameauth}
%   \< OScipio & Lucius & \noexpand\CSB & > % O for Oxford
% \end{nameauth}
%
% % Sorting and tagging
% \PretagName[Lucius]{\noexpand\CSB}{Cornelius Scipio Barbatus}
% \TagName[Lucius]{\noexpand\CSB}{, consul}
%
% \renewcommand*\NamesFormat[1]
% {%
%   \ifNoPraenomen\XPraetrue\fi%
%   \ifNoGens\XGenstrue\fi%
%   \ifNoCognomen\XCogntrue\fi%
%   \ifNoAgnomen\XAgnotrue\fi%
%   #1%
%   \ifcsname\NameauthPattern!DB\endcsname
%     \expandafter\csname\NameauthPattern!DB\endcsname%
%   \fi
%   \global\NoPraenomenfalse%
%   \global\NoGensfalse%
%   \global\NoCognomenfalse%
%   \global\NoAgnomenfalse%
% }
%
% \begin{document}
%
% \OScipio\ was born around 337 \textsc{bc} into the
% Scipiones branch of the Cornelii clan, one of the large
% patrician clans. \NoGenstrue\NoAgnomentrue\OScipio\ was
% one of the two elected consuls in 298 \textsc{bc}
% and served during the Third Samnite War.
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
% \VerbatimInput[gobble=0]{\NameauthTestFile}
%
% \OScipio\ was born around 337 \textsc{bc} into the
% Scipiones branch of the Cornelii clan, one of the large
% patrician clans. \NoGenstrue\NoAgnomentrue\OScipio\ was
% one of the two elected consuls in 298 \textsc{bc}
% and served during the Third Samnite War.
% \end{quote}
%
% Instead of relying on some \textsf{nameauth} features that drop some names automatically, in all but \meta{FNN} we have to state explicitly what we want:
%
% \begin{Block}
% \ForgetThis\OScipio \dotfill |\ForgetThis\OScipio|\\
% \LOScipio \dotfill |\LOScipio|\\
% \OScipio \dotfill |\OScipio|\\
% \SOScipio \dotfill |\SOScipio|\\[2ex]
% \NoCognomentrue\OScipio \dotfill |\NoCognomentrue\OScipio|\\
% \NoAgnomentrue\OScipio \dotfill |\NoAgnomentrue\OScipio|\\
% \NoGenstrue\OScipio \dotfill |\NoGenstrue\OScipio|\\
% \NoGenstrue\NoAgnomentrue\OScipio \dotfill |\NoGenstrue\NoAgnomentrue\OScipio|
% \end{Block}
%
% One may create convenience macros instead of using the Boolean flags. Yet this might make things less clear at first glance, for example:
%
% \begin{Block}
% \newcommand*\LucScipio{\NoGenstrue\NoAgnomentrue\OScipio}
% |\newcommand*\LucScipio{\NoGenstrue\NoAgnomentrue\OScipio}|\\
% \ForgetThis\LucScipio \dotfill |\ForgetThis\LucScipio|\\
% \LucScipio \dotfill |\LucScipio|
% \end{Block}
%
% The student and scholarly forms of Roman names are incompatible. Yet we show what the index entries would be in a normal \LaTeX\ document without hyperlinks:
%
% \begin{quote}
% \IndexActual{@}
% \UntagName[\noexpand\SCIPi]{\noexpand\SCIPii}
% \TagName[\noexpand\TSemp]{Gracchus}{, consul}
% \TagName[Lucius]{\noexpand\CSB}{, consul}
% {\normalsize Popular Reference Works:}\\
% |\ShowIdxPageref[\noexpand\SCIPi]{\noexpand\SCIPii}|\\
% \ShowIdxPageref[\noexpand\SCIPi]{\noexpand\SCIPii}\\[1ex]
% |\ShowIdxPageref[\noexpand\TSemp]{Gracchus}|\\
% \ShowIdxPageref[\noexpand\TSemp]{Gracchus}\\[1ex]
% {\normalsize Scholarly Reference Works:}\\
% |\ShowIdxPageref[Lucius]{\noexpand\CSB}|\\
% \ShowIdxPageref[Lucius]{\noexpand\CSB}
% \TagName[\noexpand\SCIPi]{\noexpand\SCIPii}{\string|hyperpage}
% \TagName[\noexpand\TSemp]{Gracchus}{, consul\string|hyperpage}
% \TagName[Lucius]{\noexpand\CSB}{, consul\string|hyperpage}
% \end{quote}
% \endgroup^^A Local format hook redefinition
% \AltFormatInactive
%
% \subsection[Special Uses]{Special Name Uses}
% \label{sec:SpecialUses}
%
% \AltFormatActive
% \begingroup^^A Local format hook redefinition
% Previously, formatting hooks either changed typefaces or mutated their arguments. Now we move beyond parsing the argument as we have received it.
%
% \DescribeMacro{\NameParser}
% The user-accessible parser (Section~\ref{sec:NameParser}) builds a printed name from internal, locally-scoped macros. Its output is affected by a subset of the Boolean flags, namely, those flags that affect long and short forms, as well as name reversal. Within the hooks we can use the user-accessible parser as often as we want. 
%
% \begin{itemize}
% \item |\if@nameauth@FullName| toggles long or short name forms, as in
%    \cmd{\Name} versus \cmd{\Name*}. |\if@nameauth@FirstName| toggles
%    forenames when |\if@nameauth@FullName| is false. When modifying
%   these flags, one must know when they are normally true or false.
% \item |\if@nameauth@RevThis| reverses name order.
%   \cmd{\ForceFN} normally toggles |\if@nameauth@EastFN|.
%   Using |\if@nameauth@RevThis|, reversing without commas,
%   overrides |\if@nameauth@RevThisComma| if both are true.
% \item |\if@nameauth@RevThisComma| creates the form
%   \meta{SNN}, \meta{FNN}.
% \end{itemize}
%
% Two Boolean\Info{\texttt{\textbackslash ifNameauthWestern}\break \texttt{\textbackslash ifNameauthObsolete}} flags are available to users so that they can know quickly what type of name was processed most recently by \cmd{\@nameauth@Choice}, which is called by all macros that take name arguments. These allow hook designers to vary the hook behavior based on the name type.
% 
% These flags also persist after the macro that uses name arguments exits, unlike many other flags. This allows one to poll the last macro that took naming arguments, which may or may not be the last name printed in the text.
%
% To illustrate how one might poll these flags, either in a formatting hook or after a macro that takes name arguments exits, we set up the following macros and show how the flags are set. Notice that the name type is a function solely of the name arguments used, not how the name eventually ends up printed in the text, and not based on the name control sequence.
% 
% \begin{VerbatimOut}{\jobname.tmp}
% \newcommand\ShowType
% {%
%   \ifNameauthWestern Western name\else
%     \ifNameauthObsolete nonwestern name using obsolete syntax\else
%     nonwestern name using current syntax\fi
%   \fi
% }
%
% First, we begin with a Western name:
%
% \Name*[Albert]{Einstein} is a \ShowType.
%
% Even though this name is reversed in the text, it is still Western:
%
% \RevName\Name*[Frenec]{Liszt}\dag\ is a \ShowType.
%
% Here we present the same name twice, but using the two different
% syntax versions for nonwestern names:
%
% \Name*{Henry, VIII} is a \ShowType.
%
% \Name*{Henry}[VIII]\ddag\ is a \ShowType.
%
% Finally, even though we do not print the name,
% \IndexName{Elizabeth, I} we get a \ShowType.
% \end{VerbatimOut}
%
% \begin{quote}
% \VerbatimInput[gobble=0]{\jobname.tmp}
% 
% \newcommand\ShowType
% {%^^A
%   \ifNameauthWestern Western name\else
%     \ifNameauthObsolete nonwestern name using obsolete syntax\else
%     nonwestern name using current syntax\fi
%   \fi
% }
%
% First, we begin with a Western name:
%
% \Name*[Albert]{Einstein} is a \ShowType.
%
% Even though this name is reversed in the text, it is still Western:
%
% \RevName\Name*[Frenec]{Liszt}\dag\ is a \ShowType.
%
% Here we present the same name twice, but using the two different
% syntax versions for nonwestern names:
%
% \Name*{Henry, VIII} is a \ShowType.
%
% \Name*{Henry}[VIII]\ddag\ is a \ShowType.
%
% Finally, even though we do not print the name,
% \IndexName{Elizabeth, I} we get a \ShowType.
% \end{quote}
%
% \subsubsection{Reference Work II}
%
% Below we revisit the idea of a reference work, leveraging the formatting hooks to format headwords, add information from name info tags:
%
% Since we are using the \texttt{altformat} option or \cmd{\AltFormatActive}, we can expect that formatting is activated by default. We design a subsequent-use hook that deactivates alternate formatting inside of it:
%
% \begin{SyntaxBox}
% \cmd{\renewcommand*}\meta{SubsequentHook}\texttt{[1]\{\dots}\cmd
%   {\AltOff}\cmd{\NameParser}\texttt{\dots\}}
% \end{SyntaxBox}
%
% \newpage
%
% If we had used \cmd{\AltFormatActive*}, where the formatting macros are enabled, but \emph{deactivated} by default, then we might want instead a first-use hook that activates the macros:
%
% \begin{SyntaxBox}
% \cmd{\renewcommand*}\meta{FirstHook}\texttt{[1]\{\dots}\cmd{\AltOn}\cmd
%   {\NameParser}\texttt{\dots\}}
% \end{SyntaxBox}
% 
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test11_09.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
%
% \makeindex
%
% % Boolean flags; the first sets up headwords and the second
% % indicates that a nonwestern form should not be reversed.
% \newif\ifHeadword
% \newif\ifAncientName
%
% % Sorting and tagging the names:
% \PretagName[Charles]{\noexpand\textBF{Babbage}}{Babbage, Charles}
% \PretagName{\noexpand\textUC{Kanade}, Takeo}{Kanade Takeo}
% \PretagName[Ada]{\noexpand\textIT{Lovelace}}{Lovelace, Ada}
%
% % Adding name information:
% \NameAddInfo{Aristotle}{ (384--322 \textsc{bc})}
% \NameAddInfo[Charles]{\noexpand\textBF{Babbage}}{ (1791--1871)}
% \NameAddInfo{\noexpand\textUC{Kanade}, Takeo}{ (1945-- )}
% \NameAddInfo[Ada]{\noexpand\textIT{Lovelace}}
%  { (Augusta Ada King, Countess of Lovelace
%    [n\'ee Byron]; 1815--52)}
%
% % Redefining the formatting hooks:
% \makeatletter
% \renewcommand\NamesFormat[1]
% {%
%   \ifHeadword
%     \ifNameauthWestern
%       \@nameauth@RevThisCommatrue%
%       \bfseries \NameParser%
%       \normalfont%
%       \ifcsname\NameauthPattern!DB\endcsname
%         \expandafter\csname\NameauthPattern!DB\endcsname%
%       \fi
%     \else
%       \bgroup%
%         \bfseries \NameParser%
%         \unless\ifAncientName
%           \normalfont; W:\AltOff\space
%           \@nameauth@RevThistrue \NameParser%
%         \fi
%         \normalfont%
%         \ifcsname\NameauthPattern!DB\endcsname
%           \expandafter\csname\NameauthPattern!DB\endcsname%
%         \fi
%       \egroup%
%     \fi
%   \else
%     \NameParser%
%   \fi
%   \global\Headwordfalse%
%   \global\AncientNamefalse%
% }
% \makeatother
% \renewcommand\MainNameHook{\AltOff}
%
% % Define related macros:
% \newcommand\Headword{\Headwordtrue\ForgetThis}
% \newcommand{\RefArticle}[2]
% {%
%   \noindent\Headword #1 #2%
%   
% }
%
% \begin{document}
%
% \RefArticle{\AncientNametrue\Name{Aristotle}}{was the first to offer
% a system of logic, most notably syllogistic logic, that would
% become the basis for discrete states and circuitry of
% digital computers. \Name{Aristotle}\dots}
%
% \RefArticle{\Name[Charles]{\noexpand\textBF{Babbage}}}{designed and
% built the Difference Engine and began work on the Analytical
% Engine. \Name[Charles]{\noexpand\textBF{Babbage}}\dots}
%
% \RefArticle{\Name{\noexpand\textUC{Kanade}, Takeo}}{is one of the
% foremost pioneers in the field of computer vision.
% \Name{\noexpand\textUC{Kanade}, Takeo}\dots}
%
% \RefArticle{\Name[Ada]{\noexpand\textIT{Lovelace}}}{collaborated with
% \Name*[Charles]{\noexpand\textBF{Babbage}}* and wrote what some 
% consider to be the first computer program for the Analytical
% Engine. \Name[Ada]{\noexpand\textIT{Lovelace}}\dots}
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
% \VerbatimInput[gobble=0]{\NameauthTestFile}
%
% \NameAddInfo{Aristotle}{ (384--322 \textsc{bc})}
% \NameAddInfo[Charles]{\noexpand\textBF{Babbage}}{ (1791--1871)}
% \NameAddInfo{\noexpand\textUC{Kanade}, Takeo}{ (1945-- )}
% \NameAddInfo[Ada]{\noexpand\textIT{Lovelace}}
%  { (Augusta Ada King, Countess of Lovelace
%    [n\'ee Byron]; 1815--52)}
%
% \makeatletter
% \renewcommand\NamesFormat[1]
% {^^A
%   \ifHeadword
%     \ifNameauthWestern
%       \@nameauth@RevThisCommatrue^^A
%       \bfseries \NameParser^^A
%       \normalfont^^A
%       \ifcsname\NameauthPattern!DB\endcsname
%         \expandafter\csname\NameauthPattern!DB\endcsname^^A
%       \fi
%     \else
%       \bgroup^^A
%         \bfseries \NameParser^^A
%         \unless\ifAncientName
%           \normalfont; W:\AltOff\space
%           \@nameauth@RevThistrue \NameParser^^A
%         \fi
%         \normalfont^^A
%         \ifcsname\NameauthPattern!DB\endcsname
%           \expandafter\csname\NameauthPattern!DB\endcsname^^A
%         \fi
%       \egroup^^A
%     \fi
%   \else
%     \NameParser^^A
%   \fi
%   \global\Headwordfalse^^A
%   \global\AncientNamefalse^^A
% }
% \makeatother
% \renewcommand\MainNameHook{\AltOff}
%
% \newcommand\Headword{\Headwordtrue\ForgetThis}
% \newcommand{\RefArticle}[2]
% {^^A
%   \noindent\Headword #1 #2^^A
% }
%
% \RefArticle{\AncientNametrue\Name{Aristotle}}{was the first to offer
% a system of logic, most notably syllogistic logic, that would
% become the basis for discrete states and circuitry of
% digital computers. \Name{Aristotle}\dots}
%
% \RefArticle{\Name[Charles]{\noexpand\textBF{Babbage}}}{designed and
% built the Difference Engine and began work on the Analytical
% Engine. \Name[Charles]{\noexpand\textBF{Babbage}}\dots}
%
% \RefArticle{\Name{\noexpand\textUC{Kanade}, Takeo}}{is one of the
% foremost pioneers in the field of computer vision.
% \Name{\noexpand\textUC{Kanade}, Takeo}\dots}
%
% \RefArticle{\Name[Ada]{\noexpand\textIT{Lovelace}}}{collaborated with
% \Name*[Charles]{\noexpand\textBF{Babbage}}* and wrote what some 
% consider to be the first computer program for the Analytical
% Engine. \Name[Ada]{\noexpand\textIT{Lovelace}}\dots}
% \end{quote}
%
% \newpage
%
% \subsubsection{Marginalia}
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test11_10.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
%
% \makeindex
%
% % Global Boolean flags need to be defined only once.
% \newif\ifSpecialFN
% \newif\ifSpecialSN
% \newif\ifRevertSN
%
% % Name variant macros need to be defined
% % uniquely for each name.
%
% % For a long name, we want to use ``William'' in the text
% % and ``Wm.'' in the margin.
%
% \newcommand*\WM
% {%
%   \ifSpecialFN Wm.\else
%   William\fi
% }
%
% % The first surname use will be ``Shakespeare'', but ``the
% % Bard'' thereafter. We allow for alternate caps.
% % We can get ``Shakespeare'' thereafter by toggling a flag.
%
% \newcommand*\SHK
% {%
%   \ifRevertSN
%     \textSC{Shakespeare}\else
%     \ifSpecialSN
%       \noexpand\AltCaps{t}he Bard\else
%       \textSC{Shakespeare}%
%     \fi
%   \fi
% }
%
% % Here is how we toggle that flag.
%
% \newcommand*\Revert{\RevertSNtrue}
%
% % Quick interface name definition:
%
% \begin{nameauth}
%   \< Shak & \noexpand\WM & \noexpand\SHK & >
% \end{nameauth}
%
% % Sorting and tagging the name:
%
% \PretagName[\noexpand\WM]{\noexpand\SHK}
%   {Shakespeare, William}
% \PretagName[Robert]{\textSC{Burns}}{Burns, Robert}
%
% % The ``first-use'' hook prints a name, then tries
% % to insert a margin note using a different name form
% % and the user-accessible parser. Finally it resets
% % the reversion flag, which is only effective in the
% % ``subsequent-use'' hook. Note how macros in the
% % name arguments take the role of what the internal
% % Boolean flags might otherwise handle.
%
% \makeatletter
% \renewcommand*\NamesFormat[1]
% {%
%   \RevertSNfalse\SpecialFNfalse\SpecialSNfalse%
%   #1%
%   \unless\ifinner
%     \marginpar
%     {%
%       \footnotesize\raggedleft%
%       \SpecialFNtrue\SpecialSNfalse%
%       \NameParser%
%     }%
%   \fi
%   \global\RevertSNfalse%
% }
%
% \renewcommand*\MainNameHook[1]
% {%
%   \AltOff\SpecialFNfalse\SpecialSNtrue%
%   #1%
%   \unless\ifinner
%     \unless\ifRevertSN
%       \marginpar
%       {%
%         \footnotesize\raggedleft%
%         \SpecialFNfalse\SpecialSNfalse%
%         \NameParser%
%       }%
%     \fi
%   \fi
%   \global\RevertSNfalse%
% }
% \makeatother
%
% \begin{document}
%
% \ForgetThis\Shak\ is the national poet of England
% in much the same way that \Name[Robert]{\textSC{Burns}}
% is that of Scotland. With the latter's rise of influence
% in the 1800s, \Revert\Shak\ became known as ``\Shak''.
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% Starting where we left off with Roman names, we begin in the document preamble by defining Boolean flags and macros. As with Roman names, their default values produce the name form in the index entry. The default name form aligns with the default Boolean flag setting: false. All non-default values and expansions of these macros occur only in the formatting hooks. We use \cmd{\PretagName} to sort the names. \cmd{\Revert} is used to print a last name without a margin note.
%
% \begin{quote}
% \VerbatimInput[gobble=0,lastline=54]{\NameauthTestFile}
% \end{quote}
%
% Next we define the two formatting hooks that structure the ways in which these macros can expand when printed in the text. We force \cmd{\NamesFormat} to print only allows only the default name via \cmd{\RevertSNfalse}, \cmd{\SpecialFNfalse}, and \cmd{\SpecialSNfalse}. \cmd{\MainNameHook} disables alternate formatting with \cmd{\AltOff}, but it allows variant name forms.
%
% In the hooks we print the default name in the body text. If allowed, we print a margin paragraph with an alternate full name using \cmd{\NameParser}. Both hooks set \cmd{\RevertSNfalse} on exit, so that \cmd{\Revert} works on a per-name basis.
%
% \makeatletter
% \renewcommand*\NamesFormat[1]
% {^^A
%   \RevertSNfalse\SpecialFNfalse\SpecialSNfalse^^A
%   #1^^A
%   \unless\ifinner
%     \marginpar
%     {^^A
%       \footnotesize\raggedleft^^A
%       \SpecialFNtrue\SpecialSNfalse^^A
%       \NameParser^^A
%     }^^A
%   \fi
%   \global\RevertSNfalse^^A
% }
% \renewcommand*\MainNameHook[1]
% {^^A
%   \AltOff\SpecialFNfalse\SpecialSNtrue^^A
%   #1^^A
%   \unless\ifinner
%     \unless\ifRevertSN
%       \marginpar
%       {^^A
%         \footnotesize\raggedleft^^A
%         \SpecialFNfalse\SpecialSNfalse^^A
%         \NameParser^^A
%       }^^A
%     \fi
%   \fi
%   \global\RevertSNfalse^^A
% }
% \makeatother
% \begin{quote}
% \VerbatimInput[gobble=0,firstline=55,lastline=96]{\NameauthTestFile}
% \end{quote}
%
% Finally, we put all these macros to work in the text:
%
% \begin{quote}
% \VerbatimInput[gobble=0,firstline=97]{\NameauthTestFile}
%
% \ForgetThis\Shak\ is the national poet of England
% in much the same way that \Name[Robert]{\textSC{Burns}}
% is that of Scotland. With the latter's rise of influence
% in the 1800s, \Revert\Shak\ became known as ``\Shak''.
% \end{quote}
%
% \endgroup^^A Local format hook redefinition
% \AltFormatInactive
%
% \ReturnLink
%
% \AltFormatActive
% \begin{Quote}{\ForgetThis\Shak\break
% \hbox{}\hfill ``Julius Caesar'', Act III, Scene II (first performed 1599)}
% \textbf{Antony:} Friends, Romans, countrymen, lend me your ears;\\
% I come to bury Caesar, not to praise him.\\
% The evil that men do lives after them;\\
% The good is oft interred with their bones;\\
% So let it be with Caesar. The noble Brutus\\
% Hath told you Caesar was ambitious:\\
% If it were so, it was a grievous fault,\\
% And grievously hath Caesar answer'd it.\\
% Here, under leave of Brutus and the rest---\\
% For Brutus is an honourable man;\\
% So are they all, all honourable men---\\
% Come I to speak in Caesar's funeral.\\
% He was my friend, faithful and just to me:\\
% But Brutus says he was ambitious;\\
% And Brutus is an honourable man.\negmedskip^^A
% \index{creatives, quotes of\noexpand\string|hyperpage}
% \end{Quote}
% \AltFormatInactive
%
% \newpage
%
% \section{Planned Obsolescence}
%
% \subsection[Pseudonyms]{Almost Obsolete: Pseudonym Macros}
% \label{sec:AKA}
%
% The macros described in this section were early features of \textsf{nameauth}. They do not work like many of the other macros that display names and may be removed  in the future. We retain them at present for backward compatibility.
%
% \subsubsection{Special Syntax}
%
% To save space, we show \meta{SAFX} as the equivalent of \meta{SNN|,| Affix}. The macros in this section all take arguments of the form:
%
% \begin{SyntaxBoxii}
%   Target Name & Cross-Reference Name\\\midrule
%   \oarg{FNN}\marg{SAFX} & \oarg{xref FNN}\marg
%     {xref SAFX}\oarg{xref Alternate}\\
% \end{SyntaxBoxii}
%
% \begin{itemize}
% \item The target name comes first, which is the opposite of
%   \cmd{\IndexRef}. There the target name comes last because it is text
%   passed to the index macros.
% \item The cross-reference comes last to allow for the widest range of
%   name forms (again, the opposite of \cmd{\IndexRef}). 
%   We avoid two optional arguments in succession by preventing the target
%   from having a final optional argument. Neither \meta{Alternate} nor
%   the obsolete syntax cannot be used with the target name. Both can be
%   used with the cross-reference.
% \item \meta{SAFX} and \meta{xref SAFX} can have comma-delimited suffixes.
% \item One cannot use \cmd{\TagName} with a cross-reference, but one can
%   sort a cross-reference with \cmd{\PretagName}
%   (Section~\ref{sec:IndexSort}):
% \end{itemize}
%
% \subsubsection{The Macros}
%
% \DescribeMacro{\AKA}
% The \textit{also known as} macro and its starred form display an alias in the text and create a cross-reference in the index.
% \DescribeMacro{\AKA*}
% They format names differently than the naming macros because they use the name patterns for cross-references as a means to account for the name forms that they print in the test.
%
% \begin{SyntaxBox}
%    \cmd{\AKA\ }\oarg{FNN}\marg{SAFX}\oarg{xref FNN}\marg
%      {xref SAFX}\oarg{xref Alternate}\\
%    \cmd{\AKA*}\oarg{FNN}\marg{SAFX}\oarg{xref FNN}\marg
%      {xref SAFX}\oarg{xref Alternate}\\
% \end{SyntaxBox}
% \negmedskip
%
% \begin{itemize}
% \item Both macros create a cross-reference in the index to the
%    target name.
% \item \cmd{\AKA} prints a long form of the cross-reference name in
%   the text. \cmd{\SeeAlso} works with \cmd{\AKA}, \cmd{\AKA*},
%   \cmd{\PName}, and \cmd{\PName*}.
% \item If \meta{xref Alternate} is present in a Western name form, then
%   instead of \meta{xref FNN}, \meta{xref Alternate} will be printed
%   in the text.
% \item If \meta{xref Alternate} is present in a nonwestern name form,
%   then instead of \meta{xref Affix} (if present), \meta{xref Alternate}
%   will be printed in the text.
% \item If \meta{xref Alternate} is present without either \meta{xref FNN}
%   or \meta{xref Affix}, the obsolete syntax is used.
% \item \cmd{\AKA*} is analogous to \cmd{\FName}. \cmd{\ForceFN} works
%   with it. The \texttt{oldAKA} option implies \cmd{\ForceFN} with every
%   use of \cmd{\AKA*}.
% \item Neither \cmd{\AKA} nor its derivatives permit the effects of
%   \cmd{\ForgetThis} and \cmd{\SubvertThis} to ``pass through'' because
%   they produce output in the text. The \texttt{oldreset} option negates
%   this.
% \end{itemize}
%
% Below we make cross-references to \Name[Bob]{Hope} \cmd{\Name[Bob]\{Hope\}}; all of the forms listed create the cross-reference ``\ShowIdxPageref*[Leslie Townes]{Hope} \textit{see} \ShowIdxPageref*[Bob]{Hope}''.
%
% \begin{center}\small
% \vspace{2ex}
% \Info{\strut\footnotesize Name Pattern(s):\hfill \break
%   \ttfamily \ShowPattern[Bob]{Hope}!MN\break
%   \ShowPattern[Leslie Townes]{Hope}!PN}
% \vspace{-2ex}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
%   \AKA[Bob]{Hope}[Leslie Townes]{Hope}&
%   |\AKA[Bob]{Hope}[Leslie Townes]{Hope}|\\
%
%   \RevComma\AKA[Bob]{Hope}[Leslie Townes]{Hope}&
%   |\RevComma\AKA[Bob]{Hope}[Leslie Townes]{Hope}|\\
%
% \rowcolor{nagrey}^^A
%   \AKA[Bob]{Hope}[Leslie Townes]{Hope}[Lester T.]&
%   |\AKA[Bob]{Hope}[Leslie Townes]{Hope}[Lester T.]|\\
%
%   \AKA*[Bob]{Hope}[Leslie Townes]{Hope}&
%   |\AKA*[Bob]{Hope}[Leslie Townes]{Hope}|\\
%
% \rowcolor{nagrey}^^A
%   \AKA*[Bob]{Hope}[Leslie Townes]{Hope}[Lester]&
%   |\AKA*[Bob]{Hope}[Leslie Townes]{Hope}[Lester]|\\\bottomrule
% \end{tabular}
% \end{center}
%
% We display other name forms after referring to some names to ensure that they have sensible page entries:
%
% \begin{quote}
% \begin{tabular}{ll}
%   \ForgetThis\Name{Louis, XIV}&
%   |\ForgetThis\Name{Louis, XIV}|\\
%   \Name{Lao-tzu} & |\Name{Lao-tzu}|\\
%   \Name[Lafcadio]{Hearn} & |\Name[Lafcadio]{Hearn}|\\
%   \Name[Charles]{du~Fresne}&
%   |\Name[Charles]{du~Fresne}|\\
% \end{tabular}
% \end{quote}
% Caps and reversing macros work on the arguments that are printed
% in the text.
%
% \begin{center}
% \vspace{2ex}
% \PatInfo{\ShowPattern{Louis, XIV}!MN\break
%   \ShowPattern{Lao-tzu}!MN\break
%   \ShowPattern[Lafcadio]{Hearn}!MN\break
%   \ShowPattern[Charles]{du~Fresne}!MN\break
%   \ShowPattern{Sun King}!PN\break
%   \ShowPattern{Li, Er}!PN\break
%   \ShowPattern{du~Cange}!PN\break
%   \ShowPattern{Koizumi, Yakumo}!PN}
% \vspace{-2ex}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
%   \AKA{Louis, XIV}{Sun King} & |\AKA{Louis, XIV}{Sun King}|\\
% \rowcolor{nagrey}^^A
%   \AKA{Louis, XIV}{Sun King} & |\AKA*{Louis, XIV}{Sun King}|\\
%
%   \AKA{Lao-tzu}{Li, Er} & |\AKA{Lao-tzu}{Li, Er}|\\
%   \AKA*{Lao-tzu}{Li, Er} & |\AKA*{Lao-tzu}{Li, Er}|\\
%
% \rowcolor{nagrey}^^A
%   \AKA[Charles]{du~Fresne}{du~Cange}&
%   |\AKA[Charles]{du~Fresne}{du~Cange}|\\
% \rowcolor{nagrey}^^A
%   \CapThis\AKA[Charles]{du~Fresne}{du~Cange}&
%   |\CapThis\AKA[Charles]{du~Fresne}{du~Cange}|\\
%
%   \CapName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo}&
%   |\CapName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo}|\\
%   \RevName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo}&
%   |\RevName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo}|\\\bottomrule
% \end{tabular}
% \end{center}
% 
%
% \DescribeMacro{\PName}
% These convenience macros were an early feature of \textsf{nameauth}. They print a main name followed by a cross-reference in parentheses.
% \DescribeMacro{\PName*}
% If one is inclined to view \cmd{\AKA} as rubbish, these two macros are a biological hazard.
%
% \begin{SyntaxBox}
%   \cmd{\PName\ }\oarg{FNN}\marg{SAFX}\oarg{xref\,FNN}\marg
%     {xref\,SAFX}\oarg{xref\,Alternate}\\
%   \cmd{\PName*}\oarg{FNN}\marg{SAFX}\oarg{xref\,FNN}\marg
%     {xref\,SAFX}\oarg{xref\,Alternate}\\
% \end{SyntaxBox}
%
% \cmd{\PName*} is like \cmd{\Name*} to the extent that it prints a long form
% of \meta{FNN}\meta{SAFX}. It does not affect the cross-reference
% \meta{xref FNN}\meta{xref SAFX}\meta{xref Alternate}.
%
% \begin{itemize}
% \item Most prefix macros only affect \meta{FNN}\meta{SAFX},
%   not the cross-reference.
% \item The cross-reference always has a long form.
% \item \cmd{\SkipIndex} keeps both names out of the index.
% \item \meta{Alternate} and the obsolete syntax work only with
%   the cross-reference.
% \end{itemize}
%
% If we attempted to use |\PName*{William, I}[William]{the Conqueror}|, this macro would put ``\SkipIndex\PName*{William, I}[William]{the Conqueror}'' in the body text, but its index entry would be incorrect: ``\ShowIdxPageref*[William]{the Conqueror} \textit{see} \ShowIdxPageref*{William, I}''. We use \cmd{\ForgetName\{William, I\}}^^A
% \ForgetName{William, I} to prepare for the following example. We do not show the name patterns in the margin.
%
% \begingroup\small
% \begin{itemize}[leftmargin=2cm]
% \item[Macro:] \cmd{\PName[Mark]\{Twain\}[Samuel L.]\{Clemens\}}
% \item[Text:] \ForgetThis\PName[Mark]{Twain}[Samuel L.]{Clemens}\\
%   \PName[Mark]{Twain}[Samuel L.]{Clemens}
% \item[Macro:] \cmd{\PName*[Mark]\{Twain\}[Samuel L.]\{Clemens\}}
% \item[Text:] \PName*[Mark]{Twain}[Samuel L.]{Clemens}
% \item[Index:] \ShowIdxPageref*[Samuel L.]{Clemens} \textit{see}
%   \ShowIdxPageref*[Mark]{Twain}
% \item[Macro:] \cmd{\PName\{Voltaire\}[François-Marie]\{Arouet\}}
% \item[Text:] \PName{Voltaire}[François-Marie]{Arouet}
% \item[Index:] \ShowIdxPageref*[François-Marie]{Arouet} \textit{see}
%   \ShowIdxPageref*{Voltaire}
% \item[Macro:] \cmd{\PName\{William, I\}\{William, the Conqueror\}}
% \item[Text:] \PName{William, I}{William, the Conqueror}\\
%   \PName{William, I}{William, the Conqueror}
% \item[Index:] \ShowIdxPageref*{William, the Conqueror} \textit{see}
%   \ShowIdxPageref*{William, I}
% \item[Macro:] \cmd{\PretagName\{}\cmd{\textit\{Doctor mellifluus\}\}^^A
%   \{Doctor mellifluus\}}\\
%   \cmd{\PName\{Bernard, of Clairvaux\}\{}\cmd{\textit\{Doctor mellifluus\}}
% \item[Text:] \PName{Bernard, of Clairvaux}{\textit{Doctor mellifluus}}\\
%   \PName{Bernard, of Clairvaux}{\textit{Doctor mellifluus}}
% \item[Index:] \ShowIdxPageref*{\textit{Doctor mellifluus}} \textit{see}
%   \ShowIdxPageref*{Bernard, of Clairvaux}
% \item[Macro:] \cmd{\ForgetThis}\cmd{\PName\{Lao-tzu\}\{Li, Er\}}
% \item[Text:] \ForgetThis\PName{Lao-tzu}{Li, Er}
% \item[Index:] \ShowIdxPageref*{Li, Er} \textit{see}
%   \ShowIdxPageref*{Lao-tzu}
% \end{itemize}
% \endgroup
%
% While these macros certainly work, much like the obsolete syntax, they can be criticized as a design idea that originally seemed to hold promise, yet disappointed in practice due to using the cross-reference system for name formatting.
%
% \subsubsection[Workarounds]{Formatting Workarounds}
%
% By default, the macros in this section use only the formatting hooks for subsequent instances of names (Section~\ref{sec:Formatting}).
%
% First, the \texttt{formatAKA}\Info{\texttt{formatAKA}} option will permit \cmd{\ForceName} to force the ``first-use'' formatting hooks to be employed, but under different conditions. The name patterns that control these uses (Section~\ref{sec:NamePatterns}) apply only to cross-references; they are a distinct system of patterns that differs from normal names and ignores the difference between main-matter and front-matter name formatting.
%
% \begin{center}
% \makeatletter\@nameauth@AKAFormattrue\makeatother
% \global\NamesInactive
% \begin{tabular}{>{\columncolor{nagrey}}rll}
% \rowcolor{nagrey}^^A
%                & |\ForgetThis\Eliz| & |\AKA{Elizabeth,I}%|\\
% \rowcolor{nagrey}^^A
%                &                    & |[Good Queen]{Bess}|\\[0.5ex]
%
% Front Matter:  & \ForgetThis\Eliz   &
%   \AKA{Elizabeth,I}[Good Queen]{Bess}\\[0.5ex]
% \global\NamesActive^^A
% \strut Main Matter:   & \ForgetThis\Eliz   &
%   \AKA{Elizabeth, I}[Good Queen]{Bess}\\[0.5ex]
% With \cmd{\ForceName}: & &
%   \ForceName\AKA{Elizabeth, I}[Good Queen]{Bess}\\
% \end{tabular}
% \vspace{-14ex}
% \PatInfo{\ShowPattern{Elizabeth, I}!NF\break
%   \ShowPattern[Good Queen]{Bess}!PN\break
%   \ShowPattern{Elizabeth, I}!MN}
% \vspace{14ex}
% \end{center}
%
% The first appearance of \AKA{Elizabeth,I}[Good Queen]{Bess} above uses \cmd{\FrontNamesFormat} as its formatting hook because it is the first occurrence of the alternate name in the front matter. After that, even though \AKA{Elizabeth,I}[Good Queen]{Bess} occurs for the first time in the main matter, it uses the subsequent-use \cmd{\MainNameHook} because we are not using the regular name patterns. We need to use \cmd{\ForceName}, which triggers the expected use of \cmd{\NamesFormat}, the first-use main-matter hook.
%
% Second,\Info{\texttt{alwaysformat}} we can use the \texttt{alwaysformat} option to force only the use of \cmd{\NamesFormat} and \cmd{\FrontNamesFormat}. Of course, this can look like rubbish in certain circumstances.
%
% \begin{quote}
%   \makeatletter\@nameauth@AlwaysFormattrue\makeatother
%   \ForgetThis\LEliz\ was known as ``\AKA{Elizabeth,I}[Good Queen]{Bess}''.
%   Again we mention Queen \Eliz, ``\AKA{Elizabeth, I}[Good Queen]{Bess}''.
%   Using \cmd{\ForceName}: \ForceName\AKA{Elizabeth, I}[Good Queen]{Bess}.
% \end{quote}
%
% \subsection{Obsolete Syntax}
% \label{sec:Obsolete}
%
% This nonwestern syntax limits alternate names and cross-references, prevents the use of comma-delimited names, and complicates indexing. It is a ``ghost of \textsf{nameauth} past'' that remains for the sake of backward compatibility and to prevent ``holes'' where naming macro arguments are discarded without apparent reason.
%
% \begin{SyntaxBox}
%   \cmd{\Name}\marg{SNN}\oarg{Alternate}
% \end{SyntaxBox}
%
% The genesis of this syntax was the use of the \meta{Alternate} field for variant forenames in Western names, personal names in Eastern names, and sobriquets, titles, and so on in ancient names. Yet this prevented using alternate names for nonwestern names and it limited those names to an unacceptable second-tier status. Developing the comma delimiter in \meta{SNN, Affix} presented significant challenges, but it was worth overcoming them to put all name forms on equal footing.
%
% We show this syntax for the sake of completeness, but we strongly encourage using the comma-delimited syntax instead.
%
% \begin{itemize}
% \item One must \emph{leave empty} the first optional \meta{FNN} argument.
% \item One must \emph{never} use the comma-delimited argument \meta{Affix}.
% \item These names \emph{always} use \meta{Alternate}, which acts like
%   \meta{Affix} usually does, and affects both name and index patterns
%   (Section~\ref{sec:NamePatterns}).
% \item These names take the form \meta{SNN Alternate} in the index.
% \item In this manual we designate these names with a double dagger (\ddag).
% \end{itemize}
%
% \begin{quote}
% \begin{Verbatim}
% \Name{Henry}[VIII]                          % Ancient
% \Name{Chiang}[Kai-shek]                     % Eastern
% \begin{nameauth}
%   \< Dagb & & Dagobert & I >                % Ancient
%   \< Yosh & & Yoshida  & Shigeru >          % Eastern
%   \< Fukuyama & &
%      \noexpand\textUC{Fukuyama} & Takeshi > % Alt. format
% \end{nameauth}
% \end{Verbatim}
% \end{quote}
%
% \AltFormatActive
% After studying in the US during the 1930s, in 1954 Rev.
% \Fukuyama\ddag\ \cmd{\Fukuyama}\cmd{\ddag} published
% \textit{Nihon Fukuin R\=uteru Ky\=okai Shi} (History
% of the Evangelical Lutheran Church in Japan).
% \AltFormatInactive
%
% \newpage
%
% \begin{center}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
%  \ForgetThis\Name{Henry}[VIII]\ddag &
% |\ForgetThis\Name{Henry}[VIII]\ddag|\\
% \rowcolor{nagrey}^^A
%  \Name{Henry}[VIII]\ddag &
% |\Name{Henry}[VIII]\ddag|\\
%
%  \ForgetThis\Name{Chiang}[Kai-shek]\ddag &
% |\ForgetThis\Name{Chiang}[Kai-shek]\ddag|\\
%  \Name{Chiang}[Kai-shek]\ddag &
% |\Name{Chiang}[Kai-shek]\ddag|\\
%
% \rowcolor{nagrey}^^A
% \Dagb\ddag & |\Dagb\ddag|\\
% \rowcolor{nagrey}^^A
% \Dagb\ddag & |\Dagb\ddag|\\
%
% \CapName\Yosh\ddag & |\CapName\Yosh\ddag|\\
% \CapName\RevName\LYosh\ddag & |\CapName\RevName\LYosh\ddag|\\
%
% \rowcolor{nagrey}^^A
% & |\AltFormatActive| \AltFormatActive\\
% \rowcolor{nagrey}^^A
% \ForgetThis\Fukuyama\ddag & |\ForgetThis\Fukuyama\ddag|\\
% \rowcolor{nagrey}^^A
% \Fukuyama\ddag & |\Fukuyama\ddag|\\
% \rowcolor{nagrey}^^A
% & |\AltFormatInactive| \AltFormatInactive\\\bottomrule
% \end{tabular}
% \end{center}
%
% Regardless of its flaws, the obsolete syntax shares name patterns, index tags, name tags, and index entries with the current syntax:
%
% \begin{quote}
% \begin{tabular}{@{}lll}
% Obsolete syntax: & \ForgetThis\Name{Henry}[VIII]\ddag &
%   \cmd{\ForgetThis}\cmd{\Name\{Henry\}[VIII]}\cmd{\ddag}\\[1ex]
%   & \ShowPattern{Henry}[VIII] & \cmd{\ShowPattern\{Henry\}[VIII]}\\[1ex]
% Current syntax:  & \Name{Henry, VIII} & \cmd{\Name\{Henry, VIII\}}\\[1ex]
%   & \ShowPattern{Henry, VIII} & \cmd{\ShowPattern\{Henry, VIII\}}\\
% \end{tabular}
% \end{quote}
%
% We do not expect people to use the obsolete syntax much anymore. Here we list more advantages to using the current syntax and avoiding the old.
%
% \begin{itemize}
% \item Only the newer syntax permits such variants:
% \item[] \Name*{Henry, VIII}[Tudor]\dotfill \cmd{\Name*\{Henry, VIII\}[Tudor]}
% \item The proper form for the old syntax is, e.g.:
% \item[] \Name*{Henry}[VIII]\dotfill \cmd{\Name*\{Henry\}[VIII]}
% \IndexInactive
% \item Next we see malformed Western names:
% \item[] \Name[Henry]{VIII}\dotfill \cmd{\Name[Henry]\{VIII\}}\\
%   \Name[Henry]{VIII}\dotfill \cmd{\Name[Henry]\{VIII\}}\\
%   \Name*[Henry]{VIII}[Tudor]\dotfill \cmd{\Name*[Henry]\{VIII\}[Tudor]}\\
%   \Name[Henry]{VIII}[Tudor]\dotfill \cmd{\Name[Henry]\{VIII\}[Tudor]}
% \item These malformed names have the same index entry\dotfill^^A
% \ShowIdxPageref*[Henry]{VIII}
% \IndexActive
% \end{itemize}
%
% \ReturnLink
%
% \begin{Quote}{\Name[Salman]{Rushdie}, \textit{The Satanic Verses} (1988)}
% Names, once they are in common use, quickly become mere sounds, their etymology being buried, like so many of the earth's marvels, beneath the dust of habit.\negmedskip^^A
% \index{creatives, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \begingroup^^A General format hook redefinition.
% \section{Advanced Customization}
% \label{sec:AdvCustomize}
%
% Here we discuss package internals to help users customize and add features. We set aside the common formatting in this manual and reset the formatting hooks to the default settings. We use alternate formatting for much of this section:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \renewcommand*\NamesFormat{}
% \renewcommand*\FrontNamesFormat{}
% \renewcommand*\MainNameHook{\AltOff}
% \renewcommand*\FrontNameHook{\AltOff}
% \end{VerbatimOut}
%
% \begin{quote}
%   \VerbatimInput[gobble=0]{\jobname.tmp}
% \end{quote}
% \input{\jobname.tmp}
%
% \AltFormatActive
% \begingroup^^A Local format hook redefinition
%
% \subsection{Using Package Internals}
%
% We start with alternate formatting (Section~\ref{sec:AltFormat}), changing the ``back-end'' macros to our custom code. Here, we need only check \texttt{\textbackslash if@nameauth@DoAlt}, which is toggled by \cmd{\AltOn} and \cmd{\AltOff}.
% Instead of using \cmd{\textSC} and friends, we define a new macro that works in similar fashion. \cmd{\Fbox} draws a frame around the name:
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test13_01.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
%
% \makeindex
%
% % Alternate formatting macro definition
% \makeatletter
% \newcommand*\Fbox[1]{%
%   \if@nameauth@DoAlt\protect\fbox{#1}\else#1\fi
% }
% \makeatother
%
% % Quick interface definition
% \begin{nameauth}
%   \< deSmet & Pierre-Jean &
%      \noexpand\Fbox{\noexpand\AltCaps{d}e~Smet} & >
% \end{nameauth}
%
% % Sorting and tagging
% \PretagName[Pierre-Jean]%
%   {\noexpand\Fbox{\noexpand\AltCaps{d}e~Smet}}%
%   {de~Smet, Pierre-Jean}
%
% \renewcommand*\MainNameHook{\AltOff}
% \renewcommand*\FrontNameHook{\AltOff}
%
% \begin{document}
%
% \deSmet\ was a Jesuit missionary who arrived in North
% America in 1821 at the age of twenty, after a year of seminary
% education. \CapThis\deSmet\ was ordained in 1827 and worked
% among American Indian nations after 1837. We can show the forms
% \LdeSmet\ and \SdeSmet.
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
% \VerbatimInput[gobble=0,lastline=13]{\NameauthTestFile}
% \end{quote}
%
% Since \cmd{\AltCaps} is part of \textsf{nameauth}, one need not reinvent that wheel. Just use it in the name arguments and sorting macros:
%
% \begin{quote}
% \VerbatimInput[gobble=0,firstline=14,lastline=24]{\NameauthTestFile}
% \end{quote}
%
% \makeatletter
% \newcommand*\Fbox[1]{^^A
%   \if@nameauth@DoAlt\protect\fbox{#1}\else#1\fi
% }^^A
% \makeatother
%
% \begingroup
% \renewcommand*\NamesFormat[1]{\color{blue}\sffamily #1}
% \renewcommand*\MainNameHook[1]{\sffamily #1}
% \begin{Quote}{\ForgetThis\Name{Maimonides},
% \textit{Guide for the Perplexed} (1190)}
% For a truth, once established by proof, does neither gain force nor certainty by the consent of all scholars, nor lose by the general dissent.\footnote{Here we enclosed this quote in a group and redefined the formatting hooks locally.}^^A
% \index{theologians, quotes of\noexpand\string|hyperpage}
% \index{philosophers, quotes of\noexpand\string|hyperpage}
% \end{Quote}
% \endgroup
%
% \newpage
%
% The final step is redefining the hooks, which can be quite simple:
%
% \begin{quote}
% \VerbatimInput[gobble=0,firstline=25]{\NameauthTestFile}
%
% \deSmet\ was a Jesuit missionary who arrived in North
% America in 1821 at the age of twenty, after a year of seminary
% education. \CapThis\deSmet\ was ordained in 1827 and worked
% among American Indian nations after 1837. We can show the forms
% \LdeSmet\ and \SdeSmet.
% \end{quote}
%
% Some formatting, such as the use of \cmd{\textSC}, is fairly standard. Other formatting, such as \cmd{\Fbox} above, is more ornamental.
% \endgroup^^A Local format hook redefinition
% \AltFormatInactive
%
% \AltFormatActive
% \begingroup^^A Local format hook redefinition
%
% \subsection{Using Separate Macros}
%
% \ForgetName[Pierre-Jean]{\noexpand\Fbox{\noexpand\AltCaps{d}e~Smet}}
% Alternate formatting can work with greater customization, but that is more labor-intensive and requires one to keep track of more details. We still recommend using \cmd{\AltFormatActive} to mitigate errors. The following example shows greater customization that remains compatible with package internals.
%
% Three Boolean flags replace package internals. The flag \texttt{\textbackslash ifFbox} activates formatting, \cmd{\CapThis} sets \texttt{\textbackslash ifFirstCap} true, and \texttt{\textbackslash ifInHook} is set manually, instead of being set by the hook dispatcher.
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test13_02.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
%
% \makeindex
%
% \newif\ifFbox     % Replaces \if@nameauth@DoAlt  \AltOn \AltOff
% \newif\ifFirstCap % Replaces \if@nameauth@DoCaps \AltCaps
% \newif\ifInHook   % Replaces \if@nameauth@InHook hook dispatcher
% \Fboxtrue         % Replaces \AltFormatActive
%
% % Alternate formatting macro definition
% \newcommand*\Fbox[1]{%
%   \ifFbox\protect\fbox{#1}\else#1\fi
% }
%
% % Redefinition of \AltCaps and \CapThis
% \renewcommand*\AltCaps[1]{%
%   \ifInHook
%     \ifFirstCap\MakeUppercase{#1}\else#1\fi
%   \else
%     #1%
%   \fi
% }
% \renewcommand*\CapThis{\FirstCaptrue}
%
% \renewcommand*\NamesFormat[1]
%   {\InHooktrue\NameParser\global\FirstCapfalse}
%
% \renewcommand*\MainNameHook[1]
%   {\Fboxfalse\InHooktrue\NameParser\global\FirstCapfalse}
%
% \let\FrontNamesFormat\Namesformat
% \let\FrontNameHook\MainNameHook
%
% % Quick interface definition
% \begin{nameauth}
%   \< deSmet & Pierre-Jean &
%      \noexpand\Fbox{\noexpand\AltCaps{d}e~Smet} & >
% \end{nameauth}
%
% % Sorting and tagging
% \PretagName[Pierre-Jean]%
%   {\noexpand\Fbox{\noexpand\AltCaps{d}e~Smet}}%
%   {de~Smet, Pierre-Jean}
%
% \begin{document}
%
% \deSmet\ was a Jesuit missionary who arrived in North
% America in 1821 at the age of twenty, after a year of seminary
% education. \CapThis\deSmet\ was ordained in 1827 and worked
% among American Indian nations after 1837. We can show the forms
% \LdeSmet\ and \SdeSmet.
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
% \VerbatimInput[gobble=0,lastline=11]{\NameauthTestFile}
% \end{quote}
%
% The formatting macro is like what we have seen, except it refers to \texttt{\textbackslash ifFbox}. We define \cmd{\Fbox} locally in this manual, but \cmd{\noexpand} helps isolate those effects.
%
% \begin{quote}
% \VerbatimInput[gobble=0,firstline=12,lastline=16]{\NameauthTestFile}
% \end{quote}
%
% Our \cmd{\AltCaps} works like the built-in version, except it does not use the internal macros and flags. We redefine \cmd{\CapThis} to use our flag instead of the internal flag:
%
% \begin{quote}
% \VerbatimInput[gobble=0,firstline=17,lastline=26]{\NameauthTestFile}
% \end{quote}
%
% We have to reproduce the logic and macros that the package would have provided. That means defining everything from scratch. To emphasize these differences, instead of displaying the macro argument, we use \cmd{\NameParser} to do that.
%
% Changes to \texttt{\textbackslash ifInHook} (default false) and \texttt{\textbackslash ifFbox} (default true) are local to the scope in which the hook macros are called. \texttt{\textbackslash ifFirstCap} must be set globally. Below we reproduce the logic of \cmd{\AltOff} before \cmd{\NameParser} in \cmd{\MainNameHook}:
%
% \begin{quote}
% \VerbatimInput[gobble=0,firstline=27,lastline=32]{\NameauthTestFile}
% \end{quote}
%
% By using the same hook logic and \cmd{\noexpand}, the same macros used before now use a different ``back end'' without creating spurious index entries.
%
% \newcommand*\Fbox[1]{^^A
%   \ifFbox\protect\fbox{#1}\else#1\fi
% }
% \renewcommand*\AltCaps[1]{^^A
%   \ifInHook
%     \ifFirstCap\MakeUppercase{#1}\else#1\fi
%   \else
%     #1^^A
%   \fi
% }
% \renewcommand*\CapThis{\FirstCaptrue}
% \renewcommand*\NamesFormat[1]
%   {\InHooktrue\NameParser\global\FirstCapfalse}
% \renewcommand*\MainNameHook[1]
%   {\Fboxfalse\InHooktrue\NameParser\global\FirstCapfalse}
% \let\FrontNamesFormat\Namesformat
% \let\FrontNameHook\MainNameHook
%
% \begin{quote}
% \VerbatimInput[gobble=0,firstline=33]{\NameauthTestFile}
%
% \deSmet\ was a Jesuit missionary who arrived in North
% America in 1821 at the age of twenty, after a year of seminary
% education. \CapThis\deSmet\ was ordained in 1827 and worked
% among American Indian nations after 1837. We can show the forms
% \LdeSmet\ and \SdeSmet.
% \end{quote}
%
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test13_03.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
%
% \makeindex
%
% \newif\ifCaps      % Replaces \if@nameauth@DoAlt
% \newif\ifFirstCap  % Replaces \if@nameauth@DoCaps
% \newif\ifInHook    % Replaces \if@nameauth@InHook
% \Capstrue          % Replaces \AltFormatActive
%
% % Alternate formatting macro definition
% \renewcommand*\textSC[1]{\ifCaps\textsc{#1}\else#1\fi}
%
% % Redefinition of \AltCaps and \CapThis
% \renewcommand*\AltCaps[1]{%
%   \ifInHook
%     \ifFirstCap\MakeUppercase{#1}\else#1\fi
%   \else
%     #1%
%   \fi
% }
% \renewcommand*\CapThis{\FirstCaptrue}
%
% \renewcommand*\NamesFormat[1]
%   {\InHooktrue#1\global\FirstCapfalse}
%
% \renewcommand*\MainNameHook[1]
%   {\Capsfalse\InHooktrue#1\global\FirstCapfalse}
%
% \let\FrontNamesFormat\Namesformat
% \let\FrontNameHook\MainNameHook
%
% \begin{nameauth}
%   \< Luth & Martin & \noexpand\textSC{Luther} & >
%   \< Cath & Catherine \noexpand\AltCaps{d}e'
%           & \noexpand\textSC{Medici} & >
% \end{nameauth}
% \PretagName[Martin]{\noexpand\textSC{Luther}}{Luther, Martin}
% \PretagName[Catherine \noexpand\AltCaps{d}e']
%            {\noexpand\textSC{Medici}}{Medici, Catherine de}
%
% \begin{document}
%
% \ForgetThis\Luth\ was a leading figure in the Protestant
% Reformation. \Luth\ believed that one is declared
% righteous in a forensic sense by divine grace through faith
% created by the Holy Spirit via the Gospel and the Sacraments.
%
% \ForgetThis\Cath\ was not only Queen of France in her own right,
% but she also guided the reigns of her three sons.
% \CapThis\LCath[\noexpand\AltCaps{d}e']
% was blamed for the St.\ Bartholomew's Day massacre that saw the
% murder of thousands of Huguenots.
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \Capstrue
% \renewcommand*\textSC[1]{\ifCaps\textsc{#1}\else#1\fi}
% \renewcommand*\AltCaps[1]{^^A
%   \ifInHook
%     \ifFirstCap\MakeUppercase{#1}\else#1\fi
%   \else
%     #1^^A
%   \fi
% }
% \renewcommand*\CapThis{\FirstCaptrue}
% \renewcommand*\NamesFormat[1]
%   {\InHooktrue#1\global\FirstCapfalse}
% \renewcommand*\MainNameHook[1]
%   {\Capsfalse\InHooktrue#1\global\FirstCapfalse}
% \let\FrontNamesFormat\Namesformat
% \let\FrontNameHook\MainNameHook
%
% We can go one step further and use our own ``back-end'' macros with other documents that were designed for the built-in macros used in alternate formatting, as the next example shows:
%
% \begin{quote}
% \VerbatimInput[gobble=0]{\NameauthTestFile}
%
% \ForgetThis\Luth\ was a leading figure in the Protestant
% Reformation. \Luth\ believed that one is declared
% righteous in a forensic sense by divine grace through faith
% created by the Holy Spirit via the Gospel and the Sacraments.
%
% \ForgetThis\Cath\ was not only Queen of France in her own right,
% but she also guided the reigns of her three sons.
% \CapThis\LCath[\noexpand\AltCaps{d}e']
% was blamed for the St.\ Bartholomew's Day massacre that saw the
% murder of thousands of Huguenots.
% \end{quote}
%
% \endgroup^^A Local format hook redefinition
% \AltFormatInactive
%
% \subsection{Full Customization}
% \label{sec:FullCustomize}
%
% One can redesign or augment the core naming macros, then hook those modifications into the \textsf{nameauth} package without needing to patch the style file itself.
%
% \DescribeMacro{\NameauthName}
% All these macros are set by default to \cmd{\@nameauth@Name}, the internal name parser.
% \DescribeMacro{\NameauthLName}
% \cmd{\Name}, or an unmodified shorthand, calls \cmd{\NameauthName}. \cmd{\Name*}, or an L-shorthand, sets \cmd{\@nameauth@FullNametrue}, then calls \cmd{\NameauthLName}.
% \DescribeMacro{\NameauthFName}
% \cmd{\FName}, or an S-shorthand, sets \cmd{\@nameauth@FirstNametrue}, then calls \cmd{\NameauthFName}. One should not modify \cmd{\Name} and \cmd{\FName} directly.
% 
% \subsubsection{Names In Boxes}
%
% Since \textsf{nameauth} uses \textsf{xparse}, the next examples use it also. Here we look at decorationin the sense of putting a name into something around it. This could be useful if, in certain parts of a document, one wanted to turn names into hyperlinks or some other kind of feature. Here we simply put names into colored boxes.
% 
% \ifdefined\NameauthDoTestFiles \edef\NameauthTestFile{test13_04.tex}\else
% \edef\NameauthTestFile{\jobname.tmp}\fi
%
% \begin{VerbatimOut}{\NameauthTestFile}
% \documentclass{article}
% \input{compat.tex} % Included with nameauth; example file aids
% % compatibility across different LaTeX versions and engines.
% \usepackage{makeidx}
% \usepackage[altformat]{nameauth}
% \usepackage{xcolor}
%
% \makeindex
%
% \makeatletter
% % Change the general-case name macro to show
% % a name in a framed, colored box.
%
% \NewDocumentCommand{\MyName}{O{} m O{}}{%
%   \global\@nameauth@toksa\expandafter{#1}%
%   \global\@nameauth@toksb\expandafter{#2}%
%   \global\@nameauth@toksc\expandafter{#3}%
%   \fcolorbox{black}{gray!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
% }
%
% % Likewise change the macro for when names are forced long.
% \NewDocumentCommand{\MyLName}{O{} m O{}}{%
%   \global\@nameauth@toksa\expandafter{#1}%
%   \global\@nameauth@toksb\expandafter{#2}%
%   \global\@nameauth@toksc\expandafter{#3}%
%   \fcolorbox{black}{green!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
% }
%
% % Likewise change the macro when personal names are desired.
% \NewDocumentCommand{\MyFName}{O{} m O{}}{%
%   \global\@nameauth@toksa\expandafter{#1}%
%   \global\@nameauth@toksb\expandafter{#2}%
%   \global\@nameauth@toksc\expandafter{#3}%
%   \fcolorbox{black}{yellow!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
% }
% \makeatother
%
% % Change the formatting hooks, but do not use alternate.
% % formatting, which is separate from that above.
% \renewcommand*\NamesFormat[1]{\scshape#1}
% \renewcommand*\MainNameHook[1]{#1}
%
% % Change the naming macro hooks.
% \renewcommand*\NameauthName{\MyName}
% \renewcommand*\NameauthLName{\MyLName}
% \renewcommand*\NameauthFName{\MyFName}
%
% \begin{document}
%
% \ForgetThis\Name[Adolf]{Harnack} was a theologian who stressed
% the Fatherhood of God and the brotherhood of man.
% \Name[Adolf]{Harnack} flourished in the early twentieth
% century; \Name*[Adolf]{Harnack}[Adolf von]; \FName[Adolf]{Harnack}.
%
% \printindex
% \end{document}
% \end{VerbatimOut}
%
% \begin{quote}
% \VerbatimInput[gobble=0]{\NameauthTestFile}
%
% \makeatletter
% \NewDocumentCommand{\MyName}{O{} m O{}}{^^A
%   \global\@nameauth@toksa\expandafter{#1}^^A
%   \global\@nameauth@toksb\expandafter{#2}^^A
%   \global\@nameauth@toksc\expandafter{#3}^^A
%   \fcolorbox{black}{gray!25!white}{\@nameauth@Name[#1]{#2}[#3]}^^A
% }
%
% \NewDocumentCommand{\MyLName}{O{} m O{}}{^^A
%   \global\@nameauth@toksa\expandafter{#1}^^A
%   \global\@nameauth@toksb\expandafter{#2}^^A
%   \global\@nameauth@toksc\expandafter{#3}^^A
%   \fcolorbox{black}{green!25!white}{\@nameauth@Name[#1]{#2}[#3]}^^A
% }
%
% \NewDocumentCommand{\MyFName}{O{} m O{}}{^^A
%   \global\@nameauth@toksa\expandafter{#1}^^A
%   \global\@nameauth@toksb\expandafter{#2}^^A
%   \global\@nameauth@toksc\expandafter{#3}^^A
%   \fcolorbox{black}{yellow!25!white}{\@nameauth@Name[#1]{#2}[#3]}^^A
% }
%
% \makeatother
% \renewcommand*\NamesFormat[1]{\scshape#1}
% \renewcommand*\MainNameHook[1]{#1}
% \renewcommand*\NameauthName{\MyName}
% \renewcommand*\NameauthLName{\MyLName}
% \renewcommand*\NameauthFName{\MyFName}
%
% \ForgetThis\Name[Adolf]{Harnack} was a theologian who stressed
% the Fatherhood of God and the brotherhood of man.
% \Name[Adolf]{Harnack} flourished in the early twentieth
% century; \Name*[Adolf]{Harnack}[Adolf von]; \FName[Adolf]{Harnack}.
% \end{quote}
%
% After the name is printed in the body text, the internal macros \emph{globally} set \cmd{\@nameauth@FullNamefalse} and \cmd{\@nameauth@FirstNamefalse}, as well as other flags related to the prefix macros. This prevents certain cases of undocumented behavior in versions of \textsf{nameauth} before 3.3, where resetting flags locally could cause unexpected name forms. If an existing document leverages the local resetting of flags, one can use the \texttt{oldreset} option.
%
% Like\Info{\cmd{\global}} many of the macros in this package, these macros can be redefined or used locally within a scope without making global changes to the document unless you specifically use \cmd{\global}.
%
% \newpage
%
% \subsubsection{Change Parsing}
% \label{sec:ChangeParse}
%
% In Section~\ref{sec:FinalOptargs} we saw reasons why \textsf{nameauth} ignores spaces before final optional arguments. Here we show how to change that. With \textsf{xparse} since May 2018, the \texttt{!O\{\}} specifier makes spaces significant before an optional argument. Before then, the example below got the same result through undocumented behavior, now fixed.
%
% \begin{VerbatimOut}{\jobname.tmp}
% \makeatletter
%   \@ifl@t@r\fmtversion{2018/04/30}{\def\nameauthxp{}}{}
% \makeatother
%
% \makeatletter
% \ifdefined\nameauthxp
% \NewDocumentCommand{\MyName}{O{} m !O{}}{%
%   \global\@nameauth@toksa\expandafter{#1}%
%   \global\@nameauth@toksb\expandafter{#2}%
%   \global\@nameauth@toksc\expandafter{#3}%
%   \@nameauth@Name[#1]{#2}[#3]%
% }
% \else
% \NewDocumentCommand{\MyName}{O{} m O{}}{%
%   \global\@nameauth@toksa\expandafter{#1}%
%   \global\@nameauth@toksb\expandafter{#2}%
%   \global\@nameauth@toksc\expandafter{#3}%
%   \@nameauth@Name[#1]{#2}[#3]%
% }
% \fi
% \makeatother
%
% \let\NameauthName\MyName
% \let\NameauthLName\MyName
% \let\NameauthFName\MyName
%
% \ForgetName[Albert]{Einstein}
% \ForgetName{Miyazaki, Hayao}
%
%  We want ``Albert Einstein [reportedly] said'',
%  ``Miyazaki Hayao [supposedly] said'',
%  ``Einstein [reportedly] said'', and
%  ``Miyazaki [supposedly] said''.
%
%  We get ``\Name[Albert]{Einstein} [reportedly] said'',
% ``\Name{Miyazaki, Hayao} [supposedly] said'',
% ``\Name[Albert]{Einstein} [reportedly] said'', and
% ``\Name{Miyazaki, Hayao} [supposedly] said''.
% \end{VerbatimOut}
%
% \begin{quote}
%^^A Display the appropriate verbatim text above.
% \VerbatimInput[gobble=0]{\jobname.tmp}
%^^A Redefine formatting macros.
% \renewcommand\NamesFormat{}
% \renewcommand\MainNameHook{}
%
% \makeatletter
% \ifdefined\nameauthxp
%   \NewDocumentCommand{\MyName}{O{} m !O{}}{%^^A
%     \global\@nameauth@toksa\expandafter{#1}%^^A
%     \global\@nameauth@toksb\expandafter{#2}%^^A
%     \global\@nameauth@toksc\expandafter{#3}%^^A
%     \@nameauth@Name[#1]{#2}[#3]}
% \else
%   \NewDocumentCommand{\MyName}{O{} m O{}}{%^^A
%     \global\@nameauth@toksa\expandafter{#1}%^^A
%     \global\@nameauth@toksb\expandafter{#2}%^^A
%     \global\@nameauth@toksc\expandafter{#3}%^^A
%     \@nameauth@Name[#1]{#2}[#3]}
% \fi
% \makeatother
%
% \let\NameauthName\MyName
% \let\NameauthLName\MyName
% \let\NameauthFName\MyName
%
% \ForgetName[Albert]{Einstein}
% \ForgetName{Miyazaki, Hayao}
%
%  We want ``Albert Einstein [reportedly] said'',
%  ``Miyazaki Hayao [supposedly] said'',
%  ``Einstein [reportedly] said'', and
%  ``Miyazaki [supposedly] said''.
%
%  We get ``\Name[Albert]{Einstein} [reportedly] said'',
% ``\Name{Miyazaki, Hayao} [supposedly] said'',
% ``\Name[Albert]{Einstein} [reportedly] said'', and
% ``\Name{Miyazaki, Hayao} [supposedly] said''.
% \end{quote}
% \endgroup^^A General format hook redefinition
%
% \ReturnLink
%
% \newpage
%
% \section{Technical Notes and Tips}
% \label{sec:TechNotes}
%
% \subsection{Tips: General}
%
% \begin{itemize}
% \item Technical details about package development and testing are in \texttt{README.md}.
% \item Both \texttt{compat.tex} and \texttt{examples.tex} contain useful information.
% \item Do not put naming macros withing a macro defined by \cmd{\edef}.
% Yet naming macros can be passed as arguments to such a macro.
% \item In \texttt{dtx} files, the \texttt{nameauth} environment and initial tagging
% macros work easiest in the \texttt{<driver>} section preamble. Yet if any of these
% contains one or more \cmd{\newif} statements, they must go in the ``commented part''
% since the preamble falls between \texttt{\textbackslash iffalse} and
% \texttt{\textbackslash fi}.
% \end{itemize}
%
% \subsection[Tips: Indexing]{Tips: Indexing and Sorting}
% \label{sec:DebugSort}
%
% \begin{itemize}
% \item Two names may look alike on the page, but their name patterns can
% differ, creating  spurious index entries. Check the \texttt{idx} file
% to be sure.
% \item To fix spurious entries, compare index entries with names in the text.
%   \begin{itemize}
%   \item Check if naming macros always use the same arguments.
%   \item Check sorting tags (\cmd{\PretagName} (Section~\ref{sec:IndexSort}).
%   \item Check use of active Unicode characters (Section~\ref{sec:Unicode}).
%   \item Use \cmd{\ShowPattern}, \cmd{\ShowIdxPageref}, and
%     \cmd{\ShowNameState}.
%   \item Did \cmd{\noexpand} precede macros in name arguments?
%   \end{itemize}
% \item Check \textsf{nameauth} package warnings. Set the \texttt{verbose}
%   option, which will offer a number of ``informational'' warnings that
%   could be of assistance.
% \item If an entry is sorted incorrectly in the index, check the following:
%   \begin{itemize}
%   \item Are there any active characters, spaces, or control sequences
%     in the name arguments? Use \cmd{\PretagName}.
%   \item Is alternate formatting used consistently? Are names used
%     within sections of alternate formatting used outside of them?
%   \item Are macros in the name arguments that can expand differently
%     under different conditions preceded by \cmd{\noexpand}?
%   \end{itemize}
% \end{itemize}
%
% Using \cmd{\protected@edef} in macros can add spaces to index entries. The \textsf{nameauth} macros must use \cmd{\protected@edef} to work with classes that write index entries to \texttt{aux} files. One must check this in the \texttt{idx} file. We show this below:
%
% \begin{quote}
% \begin{Verbatim}
% \makeatletter
% \newcommand\Idx[1]{\protected@edef\arg{#1}\index{\arg}}
% \makeatother
% \end{Verbatim}
%
% \cmd{\Idx\{}\cmd{\textsc\{football\}\}} produces:\\
% \hbox{}\qquad\cmd{\indexentry}\texttt
%   {\{\cmd{\textsc\textvisiblespace\textvisiblespace}\{football\}\}\{}\meta
%   {page}\texttt{\}}\\[1ex]
% The macro \cmd{\index\{}\cmd{\textsc\{football\}\}} produces:\\
% \hbox{}\qquad\cmd{\indexentry}\texttt
%   {\{\cmd{\textsc}\{football\}\}\{}\meta{page}\texttt{\}}
% \end{quote}
%
% \subsection[Tips: Name Args]{Tips: Macros in Name Arguments}
%
% \begin{itemize}
% \item A missing square bracket or curly brace in name arguments can cause errors like
% ``\texttt{Paragraph ended}'' and ``\texttt{Missing} \meta{grouping token}
% \texttt{inserted.}''
% \item Use alternate formatting to avoid potential problems, especially
%   when using \cmd{\CapThis}, which segments arguments (Sections~\ref{sec:AltFormat},
%   \ref{sec:AdvCustomize}).
% \item Use \cmd{\noexpand}\meta{macro} in name macro arguments as
%   a best practice.
% \item Macros used in name arguments must be defined either in the
%   preamble or in the outermost document scope to avoid errors.
% \item Boolean flags (\texttt{\textbackslash if}\meta{flag}) used in
%   formatting hooks must be defined either in the preamble or in the
%   outermost document scope.
% \item The \cmd{\global} modifier does not work with \cmd{\newif} and
%   \cmd{\newcommand}. Yet \cmd{\global} can precede the use of a macro
%   defined with \cmd{\newcommand}.
%   \textit{The \TeX book}, pages 275--277, shows what \cmd{\global} can
%   and cannot do. See more about this issue and \cmd{\newcommand} on
%   \href{https://tex.stackexchange.com/questions/51733/global-renewcommand-equivalent-of-global-def}
%   {\bfseries this page}.
% \item Below we show general aspects of scoping to apply them to this package:
% \end{itemize}
%
% \begin{VerbatimOut}{\jobname.tmp}
% \newif\ifCondA
% \newcommand\MacroA{}
% \begingroup
%   \newif\ifCondB
%   \global\newif\ifCondC
%   \global\newcommand\MacroB{}
%   \newcommand\MacroC{\def\MacroD{}}
%   \global\MacroC
%   \global\CondAtrue
% \endgroup
%
% \begin{itemize}
% \item \ifdefined\CondAtrue \texttt{\textbackslash ifCondA} is defined
%   \else \texttt{\textbackslash ifCondA} is not defined \fi
%   in the outer scope (outer definition).
%
% \item \ifdefined\MacroA \cmd{\MacroA} is defined
%   \else \cmd{\MacroA} is not defined \fi
%   in the outer scope (outer definition).
%
% \item \ifdefined\CondBtrue \texttt{\textbackslash ifCondB} is defined
%   \else \texttt{\textbackslash ifCondB} is not defined \fi
%   in the outer scope (local definition).
%
% \item \ifdefined\CondCtrue \texttt{\textbackslash ifCondC} is defined
%   \else \texttt{\textbackslash ifCondC} is not defined \fi
%   in the outer scope (no \cmd{\global}\cmd{\newif}).
%
% \item \ifdefined\MacroB \cmd{\MacroB} is defined
%   \else \cmd{\MacroB} is not defined \fi
%   in the outer scope (no \cmd{\global}\cmd{\newcommand}).
%
% \item \cmd{\MacroC} \ifdefined\MacroC is defined
%   \else is not defined \fi
%   in the outer scope (local definition).
%
% \item \cmd{\MacroD} \ifdefined\MacroD is defined
%   \else is not defined \fi
%   in the outer scope (\cmd{\global} affects \cmd{\def} in \cmd{\MacroC}).
%
% \item \ifCondA \texttt{\textbackslash ifCondA} is true
%   \else \texttt{\textbackslash ifCondA} is false \fi
%   (\cmd{\global} assignment works, not instantiation).
% \end{itemize}
% \end{VerbatimOut}
%
% \begin{quote}
% \VerbatimInput[gobble=0]{\jobname.tmp}
%
% \input{\jobname.tmp}
% \end{quote}
%
% Any macro that is used in the argument of a naming macro must be defined in all scopes in which that name is used. The names themselves are global, but macros in their arguments are not guaranteed to be so:
%
% \begin{VerbatimOut}{\jobname.tmp}
% \begin{nameauth}
%   \< Testi & & \noexpand\TESTi & >
%   \< Testii & & \noexpand\TESTii & >
% \end{nameauth}
% \def\TESTi{Test One}
% \indent \hbox to 10em{(Outer 1) \Testi\hfill}
% \begingroup
%   (Inner 1) \Testi\\
%   \def\TESTii{Test Two}
%   \hbox to 10em{(Inner 2) \Testii\hfill}
% \endgroup
% (Outer 2) \unless\ifdefined\TESTii \cmd{\TESTii} undefined\fi
% \end{VerbatimOut}
%
% \begin{quote}
% \IndexInactive
% \VerbatimInput[gobble=0]{\jobname.tmp}
%
% \input{\jobname.tmp}
% \end{quote}
%
%
% \subsection[Active Unicode]{Active Unicode Characters}
% \label{sec:Unicode}
%
% \subsubsection{General Information}
%
% Both \texttt{xelatex} and \texttt{lualatex} support Unicode natively. In \texttt{pdflatex}, this happens with active characters. There are features (e.g., in \textsf{microtype}) that require \texttt{pdflatex}. Both \texttt{makeindex} and \texttt{xindy} have their own design choices.
%
% With |\usepackage[T1]{fontenc}|, \texttt{latex} and \texttt{pdflatex} can use many active Unicode characters automatically. Use \cmd{\PretagName} to sort names with these characters (Section~\ref{sec:IndexSort}). More Unicode characters can be made available when using fonts with TS1 glyphs (pages 455--463 in \textit{The Latex Companion}). Compare \href{https://tug.ctan.org/info/symbols/comprehensive/}{\bfseries this page} or type either \texttt{texdoc comprehensive}, \texttt{texdoc symbols-A4}, or \texttt{texdoc symbols-letter} for more information.
%
% Active Unicode characters work much like macros. When using a font with TS1 glyphs and slots, the following preamble snippet is an example of how one might add more Unicode characters, such as a long s (\textit{s-medialis}):
%
% \begin{quote}
% \begin{Verbatim}
% \usepackage[utf8]{inputenc} % For older TL releases
% \usepackage[TS1,T1]{fontenc}
% \usepackage{lmodern}% Contains TS1 glyph 115
% \usepackage{newunicodechar}
% \DeclareTextSymbolDefault{\textlongs}{TS1}
% \DeclareTextSymbol{\textlongs}{TS1}{115}
% \newunicodechar{ſ}{\textlongs}
%
% In Congreſs, July 4, 1776
% \end{Verbatim}
%
% In Congreſs, July 4, 1776
% \end{quote}
%
% Below we group characters that are supported in \texttt{pdflatex}
% without additional modification by accents and diacritical marks:
%
% \begin{center}\large
% \def\Bullet#1{\setbox0\hbox{#1}\raise 0.4ex\hbox
%   to\wd0{\hfil\tiny\textbullet\hfil}}
% \def\bullet#1{\setbox0\hbox{#1}\raise 0.2ex\hbox
%   to\wd0{\hfil\tiny\textbullet\hfil}}
% \begin{tabular}{ll}\toprule
% \rowcolor{nagrey}^^A
% \bfseries Capitals & \strut\\
%
% acute       & Á Ć \Bullet{D} É Ǵ \Bullet{H} Í \Bullet{J} \Bullet{K} Ĺ
%               Ń Ó Ŕ Ś \Bullet{T} Ú \Bullet{W} Ý Ź \strut\\
%
% \rowcolor{nagrey}^^A
% grave       & À \Bullet{C} \Bullet{D} È \Bullet{G} \Bullet{H} Ì \Bullet{J}
%               \Bullet{K} \Bullet{L} \Bullet{N} Ò \Bullet{R} \Bullet{S}
%               \Bullet{T} Ù \Bullet{W} \Bullet{Y} \Bullet{Z} \strut\\
%
% circumflex  & Â Ĉ \Bullet{D} Ê Ĝ Ĥ Î Ĵ \Bullet{K} \Bullet{L}
%               \Bullet{N} Ô \Bullet{R} Ŝ \Bullet{T} Û Ŵ Ŷ
%               \Bullet{Z} \strut\\
%
% \rowcolor{nagrey}^^A
% tilde       & Ã \Bullet{C} \Bullet{D} \Bullet{E} \Bullet{G} \Bullet{H}
%               Ĩ \Bullet{J} \Bullet{K} \Bullet{L} Ñ Õ \Bullet{R}
%               \Bullet{S} \Bullet{T} Ũ \Bullet{W} \Bullet{Y}
%               \Bullet{Z} \strut\\
%
% diaeresis\footnotemark & Ä \Bullet{C} \Bullet{D} Ë \Bullet{G} \Bullet{H}
%               Ï \Bullet{J} \Bullet{K} \Bullet{L} \Bullet{N} Ö \Bullet{R}
%               \Bullet{S} \Bullet{T} Ü \Bullet{W} Ÿ \Bullet{Z} \strut\\
%
% \rowcolor{nagrey}^^A
% cedilla     & \Bullet{A} Ç \Bullet{D} \Bullet{E} Ģ \Bullet{H} \Bullet{I}
%               \Bullet{J} Ķ Ļ Ņ \Bullet{O} Ŗ Ş Ţ \Bullet{U} \Bullet{W}
%               \Bullet{Y} \Bullet{Z} \strut\\
%
% macron      & Ā \Bullet{C} \Bullet{D} Ē Ḡ \Bullet{H} Ī \Bullet{J}
%               \Bullet{K} \Bullet{L} \Bullet{N} Ō \Bullet{R} \Bullet{S}
%               \Bullet{T} Ū Ǣ Ȳ \Bullet{Z} \strut\\
%
% \rowcolor{nagrey}^^A
% breve       & Ă \Bullet{C} \Bullet{D} \Bullet{E} Ğ \Bullet{H} Ĭ \Bullet{J}
%               \Bullet{K} \Bullet{L} \Bullet{N} Ŏ \Bullet{R} \Bullet{S}
%               \Bullet{T} Ŭ \Bullet{W} \Bullet{Y} \Bullet{Z} \strut\\
%
% dot/dotless & Ḃ Ċ \Bullet{D} Ė Ġ \Bullet{H} İ \Bullet{J} \Bullet{K}
%               \Bullet{L} \Bullet{N} \Bullet{O} \Bullet{R} \Bullet{S}
%               \Bullet{T} \Bullet{U} \Bullet{W} \Bullet{Y} Ż \strut\\
%
% \rowcolor{nagrey}^^A
% ogonek      & Ą \Bullet{C} \Bullet{D} Ę \Bullet{G} \Bullet{H} Į \Bullet{J}
%               \Bullet{K} \Bullet{L} \Bullet{N} Ǫ \Bullet{R} \Bullet{S}
%               \Bullet{T} Ų \Bullet{W} \Bullet{Y} \Bullet{Z} \strut\\
%
% caron       & Ǎ Č Ď Ě Ǧ \Bullet{H} Ǐ \Bullet{J} Ǩ Ľ Ň Ǒ Ř Š Ť Ǔ \Bullet{W}
%               \Bullet{Y} Ž \strut\\
%
% \rowcolor{nagrey}^^A
% various     & Å Æ Ð (eth) Đ (stroke) IJ\ Ł
%               Ŋ Ø Œ Ő Ů Ű Ș Ț Þ \strut\\\midrule
%
% \\\midrule
%
% \rowcolor{nagrey}^^A
% \bfseries Lowercase & \strut\\
%
% acute       & á ć \bullet{d} é ǵ \bullet{h} í \bullet{j} \bullet{k} ĺ
%               ń ó ŕ ś \bullet{t} ú \bullet{w} ý ź \strut\\
%
% \rowcolor{nagrey}^^A
% grave       & à \bullet{c} \bullet{d} è \bullet{g} \bullet{h} ì \bullet{j}
%               \bullet{k} \bullet{l} \bullet{n} ò \bullet{r} \bullet{s}
%               \bullet{t} ù \bullet{w} \bullet{y} \bullet{z} \strut\\
%
% circumflex  & â ĉ \bullet{d} ê ĝ ĥ î ĵ \bullet{k} \bullet{l} \bullet{n}
%               ô \bullet{r} ŝ \bullet{t} û ŵ ŷ \bullet{z} \strut\\
%
% \rowcolor{nagrey}^^A
% tilde       & ã \bullet{c} \bullet{d} \bullet{e} \bullet{g} \Bullet{h} ĩ
%               \bullet{j} \bullet{k} \bullet{l} ñ õ \bullet{r} \bullet{s}
%               \bullet{t} ũ \bullet{w} \bullet{y} \bullet{z} \strut\\
%
% diaeresis   & ä \bullet{c} \bullet{d} ë \bullet{g} \bullet{h} ï \bullet{j}
%               \bullet{k} \bullet{l} \bullet{n} ö \bullet{r} \bullet{s}
%               \bullet{t} ü \bullet{w} ÿ \bullet{z} \strut\\
%
% \rowcolor{nagrey}^^A
% cedilla     & \bullet{a} ç \bullet{d} \bullet{e} ģ \bullet{h} \bullet{i}
%               \bullet{j} ķ ļ ņ \bullet{o} ŗ ş ţ \bullet{u} \bullet{w}
%               \bullet{y} \bullet{z} \strut\\
%
% macron      & ā \bullet{c} \bullet{d} ē ḡ \bullet{h} ī \bullet{j}
%               \bullet{k} \bullet{l} \bullet{n} ō \bullet{r}
%               \bullet{s} \bullet{t} ū ǣ ȳ \bullet{z} \strut\\
%
% \rowcolor{nagrey}^^A
% breve       & ă \bullet{c} \bullet{d} \bullet{e} ğ \bullet {h} ĭ
%               \bullet{j} \bullet{k} \bullet{l} \bullet{n} ŏ \bullet{r}
%               \bullet{s} \bullet{t} ŭ \bullet{w} \bullet{y}
%               \bullet{z} \strut\\
%
% dot/dotless & ḃ ċ \bullet{d} ė ġ \bullet{h} ı \bullet{j} \bullet{k}
%               \bullet{l} \bullet{n} \bullet{o} \bullet{r} \bullet{s}
%               \bullet{t} \bullet{u} \bullet{w} \bullet{y} ż \strut\\
%
% \rowcolor{nagrey}^^A
% ogonek      & ą \bullet{c} \bullet{d} ę \bullet{g} \bullet{h} į \bullet{j}
%               \bullet{k} \bullet{l} \bullet{n} ǫ \bullet{r} \bullet{s}
%               \bullet{t} ų \bullet{w} \bullet{y} \bullet{z} \strut\\
%
% caron       & ǎ č ď ě ǧ \bullet{h} ǐ ǰ ǩ ľ ň ǒ ř š ť ǔ \bullet{w}
%               \bullet{y} ž \strut\\
%
% \rowcolor{nagrey}^^A
% various     & å æ ð đ ij\ ł ŋ ø œ ő ů ű ș ß ț þ \strut\\\bottomrule
% \end{tabular}
% \footnotetext{A diaeresis mark is one way to indicate a sound change
% (\textit{Umlaut}). German originally used a superscript \textsf{e} over
% \textsf{a}, \textsf{o}, and \textsf{u}. The cursive form of \textsf{e}
% simplified to a diaeresis in the 1800s. A diaeresis also signals
% pronouncing a diphthong or digraph as two monophthongs, e.g., ``noëtic''.}
% \end{center}
%
% \newpage
%
% \subsubsection[Compatibility]{Compatibility: Old and New}
% \label{sec:CompatON}
%
% Changes in the way that \texttt{pdflatex} and \texttt{latex} handle Unicode characters since 2018 have made indexing simpler and more intuitive, e.g.
%
% \begin{center}
% \begin{tabular}{rllrll}\toprule
% \rowcolor{nagrey}^^A
%   \bfseries Pre-2018 & & \bfseries Index &
%   \bfseries Post-2018 & & \bfseries Index\\
%
%   ä & \textrightarrow & 
%   \texttt{\cmd{\IeC\textvisiblespace}\{\cmd{\"a}\}} &
%   ä & \textrightarrow & \texttt{ä}\\
%
% \rowcolor{nagrey}^^A
%   æ & \textrightarrow &
%   \texttt{\cmd{\IeC\textvisiblespace}\{\cmd{\ae\textvisiblespace}\}} &
%   æ & \textrightarrow & \texttt{æ}\\\bottomrule
% \end{tabular}
% \end{center}
%
% The \cmd{\IeC} macro plus its argument then would expand to \cmd{\T1} plus its argument, which would occur especially if accented characters were written out to a file, then read in again. This could cause a number of problems.
%
% There are two ways to test if one is working with a newer or older version of \texttt{pdflatex} or  \texttt{latex}. The first involves \LaTeX\ kernel macros in the document preamble to check the format date. We check if the date is later than the first use of the file \texttt{utf8-2018.def}, If that is the case, we can define macros or set Boolean flags, which we can test repeatedly. For example, in the document preamble we could have:
%
% \begin{quote}
% \begin{Verbatim}
% \makeatletter
%   \@ifl@t@r\fmtversion{2018/10/05}{\def\nameauthltx{}}{}
%   \@ifl@t@r\fmtversion{2018/04/30}{\def\nameauthxp{}}{}
% \makeatother
% \end{Verbatim}
% \end{quote}
%
% The tests above apply to two things that are pertinent to \textsf{nameauth}. The first is the presence of \texttt{utf8-2018.def}. The second involves changes in \textsf{xparse} that could impact \textsf{nameauth}, which we used silently in Section~\ref{sec:ChangeParse}.
% Another test checks directly for the presence of \texttt{utf8-2018.def}:
%
% \begin{quote}
% \begin{Verbatim}
% \IfFileExists{utf8-2018.def}
%   {do if exists}
%   {do if absent}
% \end{Verbatim}
% \end{quote}
%
% Now we apply the test to an example. Before 2018, some index styles like \texttt{gind.ist} could not work with characters that contained macrons. Since 2018, those restrictions have been removed.
% To create a document that can work with old or new versions of \texttt{pdflatex} and \texttt{latex}, one can choose to use macrons or not. In a recent version, one will see macrons in the following names, otherwise, no macron will be present.
% \begin{quote}
% \begin{Verbatim}
% \ifdefined\nameauthltx \Name{Ghazāli} \else \Name{Ghazali}\fi
%
% \IfFileExists{utf8-2018.def}{\Name{Ghazāli}}{\Name{Ghazali}}
% \end{Verbatim}
% \ifdefined\nameauthltx \Name{Ghazāli} \else \Name{Ghazali}\fi
%
% \IfFileExists{utf8-2018.def}{\Name{Ghazāli}}{\Name{Ghazali}}
% \end{quote}
%
% The challenge of compatibility arises in this manual in a few instances, which we summarize below to mention specific resources without going too far afield.
%
% \begin{itemize}
% \item To use older distributions, one must include the \textsf{textcomp}
%   package for backward compatibility. Otherwise it is not needed in
%   recent \TeX\ distributions, e.g., since 2018.
% \item Use of certain text elements, such as \cmd{\dotfill} within
%   tables, has become more permissive in recent \TeX\ distributions.
% \item The file \texttt{examples.tex} (see \texttt{README.md}) includes
%   additional code snippets that deal with compatibility.
% \item We \cmd{\input} the included snippet \texttt{compat.tex} in
%   \texttt{examples.tex} to permit use with different \LaTeX\ engines
%   and older \TeX\ distributions.
% \end{itemize}\negbigskip
%
% \begin{InfoBox}
% Users are encouraged to view and modify \texttt{compat.tex} to meet their own needs.
% \end{InfoBox}\negbigskip
%
% \subsubsection[Fragility]{Fragility of Active Unicode}
%
% \TeX\ macros that partition their arguments can break active Unicode characters.The simple macro |\def\foo#1#2#3!{<#1#2><#3>}| takes three arguments, groups the first two, then the third, followed by a delimiter that ends the argument list:
%
% \begin{center}
% \def\foo#1#2#3!{<#1#2><#3>}
% \begin{tabular}{llll}\toprule
% \rowcolor{nagrey}^^A
% \bfseries Arg. & \bfseries Macro & \bfseries Engine & \bfseries Result\\
%
% |abc|    & |\foo abc!|    & (any)             & \foo abc!\\
% |{æ}bc|  & |\foo {æ}bc!|  & (any)             & \foo {æ}bc!\\
% |\ae bc| & |\foo \ae bc!| & (any)             & \foo \ae bc!\\
%
% \rowcolor{nagrey}^^A
% |æbc|    & |\foo æbc!|    & \texttt{xelatex}  &
%   \ifxetex\foo æbc!\else<æb><c>\fi\\
% \rowcolor{nagrey}^^A
% |æbc|    & |\foo æbc!|    & \texttt{lualatex} &
%   \ifluatex\foo æbc!\else<æb><c>\fi\\
%
% |æbc|    & |\foo æbc!|    & \texttt{pdflatex} & \foo æbc!\\
% |æbc|    & |\foo æbc!|    & \texttt{latex}    & \foo æbc!\\
% \bottomrule
% \end{tabular}
% \end{center}
%
% The letter \texttt{a} is one argument. Since \texttt{\{æ\}} is in a group, it is one argument. The macro \cmd{\ae} also is one argument. Both \texttt{xelatex} and \texttt{lualatex} likewise treat the Unicode letter \texttt{æ} as one argument. Thus, in all these cases, the first two glyphs are grouped together in |#1#2| and \texttt{c} is left by itself in |#3|. 
%
% In \texttt{latex} and \texttt{pdflatex}, however, \texttt{æ} is an active Unicode control sequence that uses two arguments all by itself: |#1#2|. The rest of the input, \texttt{bc}, is in |#3|. This is not intuitive. Any macro where this |#1#2| pair is divided into |#1| and |#2| will produce one of two errors: \texttt{Unicode char \dots not set up for LaTeX} or \texttt{Argument of \textbackslash UTFviii@two@octets has an extra \}}.
%
% Starting on page \pageref{page:Caps} we show how to test if \cmd{\Umathchar} is not defined. If so, we check if the leading token of the argument matches the start of an active Unicode control sequence. If \cmd{\@car}\meta{test}\cmd{\@nil} is equal to \cmd{\@car ß} \cmd{\@nil} we capitalize |#1#2|, otherwise just |#1|. Should |#1| be a protected macro or something that does not expand to a sequence of letters, we use alternate formatting and \cmd{\AltCaps} (Section~\ref{sec:AltFeatures}).
%
% \ReturnLink
%
% \begin{Quote}{\Name{Plato}, opening statement in \textit{Cratylus} (c. 388 \textsc{bc})}
% \Name{Hermogenes}: I should explain to you, \Name{Socrates}, that our friend \Name{Cratylus} has been arguing about names; he says that they are natural and not conventional; not a portion of the human voice which men agree to use; but that there is a truth or correctness in them, which is the same for Hellenes as for barbarians.^^A
% \index{philosophers, quotes of\noexpand\string|hyperpage}
% \end{Quote}
%
% \newpage
%
% \StopEventually{^^A
%  \let\emph\oldemph
%  \newgeometry{textheight=239mm,left=20mm,right=20mm,nohead}
%  \IndexProtect\PrintChanges\newpage\PrintIndex
% }
% \iffalse
%<*package>
% \fi
%
% \section{Implementation}
%
% This package has been reorganized so that the manual and the package
% have substantially the same ordering. This repetition should aid
% understanding how the components work.
%
% \subsection{Boolean Flags}
%
% The \textsf{nameauth} package is a parser. The flags in this section
% show and change the state of that parser.
%
% \subsubsection{Flow Control}
%
% \subsubsection*{\hfil Who Called Me?}
%
% Let name formatting macros in the core name engine know if they were
% called by the naming macros or by the pseudonym macros.
%
%    \begin{macrocode}
\newif\if@nameauth@InAKA
\newif\if@nameauth@InName
%    \end{macrocode}
%
% \subsubsection*{\hfil Core Macro Locks}
%
% \cmd{\@nameauth@Name}, \cmd{\AKA}, and macros that call them use
% \texttt{\textbackslash if@nameauth@Lock} to avoid a stack overflow.
% Setting \texttt{\textbackslash if@nameauth@BigLock} true will prevent
% the core name engine from executing until it is set false.
%
%    \begin{macrocode}
\newif\if@nameauth@Lock
\newif\if@nameauth@BigLock
%    \end{macrocode}
%
% \subsubsection*{\hfil Formatting Hook Indicator}
%
% Tell alternate formatting control macros that they are in
% a formatting hook.
%
%    \begin{macrocode}
\newif\if@nameauth@InHook
%    \end{macrocode}
%
% \subsubsection*{\hfil Core Name Engine Choices}
%
% \cmd{\JustIndex} toggles this flag, which makes the core name engine
% act like \cmd{\IndexName}.
%
%    \begin{macrocode}
\newif\if@nameauth@JustIndex
%    \end{macrocode}
% These two flags trigger \cmd{\ForgetName} and \cmd{\SubvertName}
% within \cmd{\@nameauth@Name}.
%
%    \begin{macrocode}
\newif\if@nameauth@Forget
\newif\if@nameauth@Subvert
%    \end{macrocode}
%
% \subsubsection[Syntax]{Name Grammar and Syntax}
%
% \subsubsection*{\hfil Name Types}
%
% These flags\Info{\texttt{\textbackslash ifNameauthWestern}\break
% \texttt{\textbackslash ifNameauthObsolete}}
% reflect the last name type evaluated by any macro that takes
% name arguments. The first shows whether or not we have a Western
% or nonwestern name. The second shows the kind of nonwestern
% syntax used. These are not reset after evaluation.
%
%    \begin{macrocode}
\newif\ifNameauthWestern
\newif\ifNameauthObsolete
%    \end{macrocode}
%
% \subsubsection*{\hfil Show/Hide Affix Commas}
%
% The \texttt{comma} and \texttt{nocomma} options toggle the first
% flag below. \cmd{\ShowComma} and \cmd{\NoComma} respectively toggle
% the second and third.
%
%    \begin{macrocode}
\newif\if@nameauth@AlwaysComma
\newif\if@nameauth@ShowComma
\newif\if@nameauth@NoComma
%    \end{macrocode}
%
% \subsubsection*{\hfil Capitalize Entire Surnames}
%
% The first flag is global. The second is for individual names.
%
%    \begin{macrocode}
\newif\if@nameauth@AllCaps
\newif\if@nameauth@AllThis
%    \end{macrocode}
%
% \subsubsection*{\hfil Reverse Name Order}
%
% These flags govern name reversing. The first is global.
% The second is for individual names.
%
%    \begin{macrocode}
\newif\if@nameauth@RevAll
\newif\if@nameauth@RevThis
%    \end{macrocode}
% These flags deals with Western names ordered
% in a list according to surname.
%
%    \begin{macrocode}
\newif\if@nameauth@RevAllComma
\newif\if@nameauth@RevThisComma
%    \end{macrocode}
%
% \subsubsection*{\hfil Full Stop Detection}
%
% This flag is used to prevent double full stops after a name
% is displayed.
%
%    \begin{macrocode}
\newif\if@nameauth@Punct
%    \end{macrocode}
%
% \subsubsection*{\hfil Name Breaking}
%
% \cmd{\KeepAffix} toggles the first flag below, while \cmd{\KeepName}
% toggles the second. Both affect the use of non-breaking spaces
% in the text.
%
%    \begin{macrocode}
\newif\if@nameauth@NBSP
\newif\if@nameauth@NBSPX
%    \end{macrocode}
%
% \subsubsection*{\hfil Long and Short Names}
%
% \texttt{\textbackslash if@nameauth@FullName} is true for a long
% name form. \texttt{\textbackslash if@nameauth@FirstName} causes only
% Western forenames or nonwestern surnames to be displayed when a shorter
% form is used. The default is to reset both globally on a per-name basis.
%
% \texttt{\textbackslash if@nameauth@ShortSNN} is used with
% \cmd{\DropAffix} to suppress the affix of a Western name.
% \texttt{\textbackslash if@nameauth@EastFN} toggles the forced printing
% of Eastern forenames.
%
%    \begin{macrocode}
\newif\if@nameauth@FullName
\newif\if@nameauth@FirstName
\newif\if@nameauth@AltAKA
\newif\if@nameauth@ShortSNN
\newif\if@nameauth@EastFN
%    \end{macrocode}
%
% \subsubsection{Debugging}
%
% When used with the index debugging macros, show complete index entries
% if true, otherwise show simple entries.
%
%    \begin{macrocode}
\newif\if@nameauth@LongIdxDebug
%    \end{macrocode}
%
% \subsubsection{Indexing}
%
% \subsubsection*{\hfil Toggle Indexing}
%
% The indexing flags permit or prevent indexing and tags.
% \cmd{\IndexActive} and \cmd{\IndexInctive} or the \texttt{index} and
% \texttt{noindex} options toggle the first flag; \cmd{\SkipIndex}
% toggles the second.
%
%    \begin{macrocode}
\newif\if@nameauth@DoIndex
\newif\if@nameauth@SkipIndex
%    \end{macrocode}
%
% \subsubsection*{\hfil Toggle Index Sorting}
%
% Allow or prevent the insertion of index sort keys.
%
%    \begin{macrocode}
\newif\if@nameauth@Pretag
%    \end{macrocode}
%
% \subsubsection*{\hfil Verbose Warnings}
%
% Control the number of warnings concerning the index; default is terse.
%
%    \begin{macrocode}
\newif\if@nameauth@Verbose
%    \end{macrocode}
%
% \subsubsection*{\hfil Cross-References}
%
% Tell the index entry formatter to create a cross-reference.
%
%    \begin{macrocode}
\newif\if@nameauth@Xref
%    \end{macrocode}
% Determine whether \cmd{\IndexRef} creates a \textit{see} reference
% or a \textit{see also} reference.
%
%    \begin{macrocode}
\newif\if@nameauth@SeeAlso
%    \end{macrocode}
%
% \subsubsection[Formatting]{Formatting and Name Control Sequences}
%
% \subsubsection*{\hfil Choose Formatting System}
%
% \cmd{\NamesActive} and \cmd{\NamesInactive}, with the
% \texttt{mainmatter} and \texttt{frontmatter} options, toggle
% formatting hooks via \texttt{\textbackslash if@nameauth@MainFormat}.
%
%    \begin{macrocode}
\newif\if@nameauth@MainFormat
%    \end{macrocode}
%
% \subsubsection*{\hfil Modify Pseudonym Formatting}
%
% Permit \cmd{\AKA} and related macros to call the first-use formatting
% hooks once.
%
%    \begin{macrocode}
\newif\if@nameauth@AKAFormat
%    \end{macrocode}
%
% \subsubsection*{\hfil Select Formatting Hooks}
%
% \texttt{\textbackslash if@nameauth@FirstFormat} triggers the first-use
% hooks to be called; otherwise the second-use hooks are called.
% Additionally, \texttt{\textbackslash if@nameauth@AlwaysFormat} forces
% this true, except when \texttt{\textbackslash if@nameauth@AKAFormat}
% is false.
%
%    \begin{macrocode}
\newif\if@nameauth@FirstFormat
\newif\if@nameauth@AlwaysFormat
%    \end{macrocode}
%
% \subsubsection*{\hfil Caps and Alternate Formatting}
%
% The next flags deal with first-letter capitalization. \cmd{\CapThis}
% sets the first Boolean value. The second is triggered by
% \cmd{\@nameauth@UTFtest} when it encounters an active Unicode character.
% The third is a fallback triggered by \cmd{\AccentCapThis}. The fourth
% disables \cmd{\CapThis} for alternate formatting. The fifth toggles
% alternate formatting within formatting hooks.
%
%    \begin{macrocode}
\newif\if@nameauth@DoCaps
\newif\if@nameauth@UTF
\newif\if@nameauth@Accent
\newif\if@nameauth@AltFormat
\newif\if@nameauth@DoAlt
%    \end{macrocode}
%
% \subsubsection{Name Decisions}
%
% \subsubsection*{\hfil Creating and Destroying Name Patterns}
%
% Restrict the creation and destruction of name patters to the current
% name system if true.
%
%    \begin{macrocode}
\newif\if@nameauth@LocalNames
%    \end{macrocode}
%
% \subsubsection*{\hfil Scope of Name Decision Macros}
%
% \cmd{\IfMainName}, \cmd{\IfFrontName}, and \cmd{\IfAKA} use
% locally-scoped paths by default. When true, this flag causes these
% macros to not apply local scope, retaining the current scope.
%
%    \begin{macrocode}
\newif\if@nameauth@GlobalScope
%    \end{macrocode}
%
% \subsubsection[Compatibility]{Version Compatibility}
%
% \texttt{\textbackslash if@nameauth@AltAKA} is toggled respectively
% by \cmd{\AKA} and \cmd{\AKA*} to print a longer or shorter name.
% \texttt{\textbackslash if@nameauth@OldAKA} forces the pre-3.0 behavior
% of \cmd{\AKA*}.
%
%    \begin{macrocode}
\newif\if@nameauth@OldAKA
%    \end{macrocode}
% Determine how strict to be with \textit{see} references.
%
%    \begin{macrocode}
\newif\if@nameauth@OldSee
%    \end{macrocode}
% These three flags are used only for backward compatibility. The first
% broadly determines how per-name flags are reset. The second affects the
% behavior of \cmd{\JustIndex}. The third toggles whether or not the
% name argument token registers are set globally. The fourth toggles the
% inclusion of \textsf{xargs} and \textsf{suffix} for legacy cases where
% user customizations were made.
%
%    \begin{macrocode}
\newif\if@nameauth@OldReset
\newif\if@nameauth@OldPass
\newif\if@nameauth@OldToks
\newif\if@nameauth@OldArgs
%    \end{macrocode}
%
% \subsection[Registers, Hooks, Values]
% {Token Registers, Hooks, and Internal Values}
%
% \subsubsection[Token Registers]{Name Argument Token Registers}
%
% \begin{macro}{\@nameauth@toksa}
% \begin{macro}{\@nameauth@toksb}
% \begin{macro}{\@nameauth@toksc}
% These three token registers contain the current values of the name
% arguments passed to \cmd{\Name}, its variants, and the cross-reference
% arguments of \cmd{\AKA}. Users can access them especially in
% formatting hooks.
%
%    \begin{macrocode}
\newtoks\@nameauth@toksa
\newtoks\@nameauth@toksb
\newtoks\@nameauth@toksc
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% These three token registers contain the current values of the name
% arguments in each line of the \texttt{nameauth} environment, thus, \texttt{@nameauth@e} for that environment.
%
%    \begin{macrocode}
\newtoks\@nameauth@etoksb
\newtoks\@nameauth@etoksc
\newtoks\@nameauth@etoksd
%    \end{macrocode}
%
% \subsubsection{Hooks}
%
% \begin{macro}{\NamesFormat}
% Post-process ``first'' instance of final complete name form in text.
% See Sections~\ref{sec:Formatting} and~\ref{sec:ComplexHooks}. Called when
% both |\@nameauth@MainFormat| and |\@nameauth@FirstFormat| are true.
%
%    \begin{macrocode}
\newcommand*\NamesFormat{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\MainNameHook}
% \changes{2.4}{2016/03/15}{Added}
% Post-process subsequent instance of final complete name form in
% main-matter text. See Sections~\ref{sec:Formatting}
% and~\ref{sec:ComplexHooks}f. Called when |\@nameauth@MainFormat| is true
% and the Boolean flag |\@nameauth@FirstFormat| is false.
%
%    \begin{macrocode}
\newcommand*\MainNameHook{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FrontNamesFormat}
% \changes{2.5}{2016/04/06}{Added}
% Post-process ``first'' instance of final complete name form in
% front-matter text. Called when |\@nameauth@MainFormat| is false
% and |\@nameauth@FirstFormat| is true.
%
%    \begin{macrocode}
\newcommand*\FrontNamesFormat{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FrontNameHook}
% \changes{2.4}{2016/03/15}{Added}
% Post-process subsequent instance of final complete name form in
% front-matter text. Called when |\@nameauth@MainFormat| is false
% and |\@nameauth@FirstFormat| is false.
%
%    \begin{macrocode}
\newcommand*\FrontNameHook{}
%    \end{macrocode}
% \end{macro}
%
% \noindent The following three macros usually point to the core name
% engine, \cmd{\@nameauth@Name}. They allow users to customize the naming
% macros in the fullest sense. See Section~\ref{sec:FullCustomize}.
%
% \begin{macro}{\NameauthName}
% \changes{2.2}{2015/12/01}{Added}
% Hook called when no special name modification is made. 
%
%    \begin{macrocode}
\newcommand*\NameauthName{\@nameauth@Name}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NameauthLName}
% \changes{2.3}{2016/01/05}{Added}
% Hook called after a name is forced long via
% \texttt{\textbackslash if@nameauth@name} being set to true.
%
%    \begin{macrocode}
\newcommand*\NameauthLName{\@nameauth@Name}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NameauthFName}
% \changes{2.2}{2015/12/01}{Added}
% Hook called after \texttt{\textbackslash if@nameauth@FirstName}
% is set true.
%
%    \begin{macrocode}
\newcommand*\NameauthFName{\@nameauth@Name}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NameauthIndex}
% \changes{3.5}{2020/11/23}{Added}
% This hook allows one to redefine what happens when any naming macro
% or indexing macro calls the equivalent of \cmd{\index}. See
% Section~\ref{sec:GeneralIndex}.
%
%    \begin{macrocode}
\newcommand*\NameauthIndex{\index}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NameauthPattern}
% \changes{3.7}{2023/02/03}{Added}
% Gives access to the current name control pattern. This hook can be
% used, e.g., in formatting hooks to recall a name tag
% (Section~\ref{sec:DataTagHooks}). We preset it to an empty value. With
% every call to a macro that takes name arguments
% (Section~\ref{sec:NameArgMacros}), this hook is updated.
%
%    \begin{macrocode}
\let\NameauthPattern\@empty
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Internal Values}
%
% \begin{macro}{\@nameauth@Actual}
% \changes{2.0}{2015/11/11}{Added}
% \changes{3.5}{2020/11/23}{Use \cmd{\def}}
% This sets the ``actual'' character used by \textsf{nameauth} for
% index sorting. This lets one use, for example, |\global\IndexActual{=}|.
%
%    \begin{macrocode}
\def\@nameauth@Actual{@}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@Exclude}
% \changes{3.5}{2020/11/23}{Added}
% This makes an xref into an ``exclusion''. An exclusion is any name
% control sequence ending in \texttt{!PN} that expands to this value.
% See \cmd{\ExcludeName}.
%
%    \begin{macrocode}
\newcommand*\@nameauth@Exclude{!}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@space}
% \changes{3.7}{2023/02/03}{Made global}
% This macro provides a consistent space character for index entries.
%
%    \begin{macrocode}
\def\@nameauth@space{ }
%    \end{macrocode}
% \end{macro}
%
% \subsection{Package Options}
%
% \subsubsection[Syntax]{Name Grammar and Syntax}
%
% Change the way that names are displayed, specifically with respect to their syntactic forms.
%
%    \begin{macrocode}
\DeclareOption{nocomma}{\@nameauth@AlwaysCommafalse}
\DeclareOption{comma}{\@nameauth@AlwaysCommatrue}
\DeclareOption{normalcaps}{\@nameauth@AllCapsfalse}
\DeclareOption{allcaps}{\@nameauth@AllCapstrue}
\DeclareOption{notreversed}%
  {\@nameauth@RevAllfalse\@nameauth@RevAllCommafalse}
\DeclareOption{allreversed}%
  {\@nameauth@RevAlltrue\@nameauth@RevAllCommafalse}
\DeclareOption{allrevcomma}%
  {\@nameauth@RevAllfalse\@nameauth@RevAllCommatrue}
%    \end{macrocode}
%
% \subsubsection{Indexing}
%
% Global setting for enabling indexing, sort tags, and verbose warnings.
%
%    \begin{macrocode}
\DeclareOption{index}{\@nameauth@DoIndextrue}
\DeclareOption{noindex}{\@nameauth@DoIndexfalse}
\DeclareOption{pretag}{\@nameauth@Pretagtrue}
\DeclareOption{nopretag}{\@nameauth@Pretagfalse}
\DeclareOption{verbose}{\@nameauth@Verbosetrue}
%    \end{macrocode}
%
% \subsubsection{Formatting}
%
% Start off in a different naming regime or change formatting behavior in general or for \cmd{\AKA}.
%
%    \begin{macrocode}
\DeclareOption{mainmatter}{\@nameauth@MainFormattrue}
\DeclareOption{frontmatter}{\@nameauth@MainFormatfalse}
\DeclareOption{alwaysformat}{\@nameauth@AlwaysFormattrue}
\DeclareOption{formatAKA}{\@nameauth@AKAFormattrue}
%    \end{macrocode}
%
% \subsubsection[Predefined Hooks]{Predefined Formatting Hooks}
%
%    \begin{macrocode}
\DeclareOption{noformat}{\renewcommand*\NamesFormat{}}
\DeclareOption{smallcaps}{\renewcommand*\NamesFormat{\scshape}}
\DeclareOption{italic}{\renewcommand*\NamesFormat{\itshape}}
\DeclareOption{boldface}{\renewcommand*\NamesFormat{\bfseries}}
%    \end{macrocode}
%
% \subsubsection[Alternate Format]{Alternate Formatting}
%
% Enable alternate formatting.
%
%    \begin{macrocode}
\DeclareOption{altformat}{%
  \@nameauth@AltFormattrue\@nameauth@DoAlttrue}
%    \end{macrocode}
%
% \subsubsection{Scope}
%
% Name test paths are either local or the same scope in which they are called.
%
%    \begin{macrocode}
\DeclareOption{globaltest}{\@nameauth@GlobalScopetrue}
%    \end{macrocode}
%
% \subsubsection[Compatibility]{Version Compatibility}
%
% Revert package behavior to mimic older versions.
%
%    \begin{macrocode}
\DeclareOption{oldAKA}{\@nameauth@OldAKAtrue}
\DeclareOption{oldreset}{\@nameauth@OldResettrue}
\DeclareOption{oldpass}{\@nameauth@OldPasstrue}
\DeclareOption{oldtoks}{\@nameauth@OldTokstrue}
\DeclareOption{oldsee}{\@nameauth@OldSeetrue}
\DeclareOption{oldargs}{\@nameauth@OldArgstrue}
%    \end{macrocode}
%
% \subsection{Package Initialization}
%
% Execute default options and process options passed by the user.
% Load required packages for $\epsilon$-\TeX\ features, trimming
% spaces from arguments, starred commands, and optional arguments.
%
%    \begin{macrocode}
\ExecuteOptions
  {nocomma,mainmatter,index,pretag,
   normalcaps,notreversed,noformat}
\ProcessOptions\relax
\RequirePackage{etoolbox}
\RequirePackage{trimspaces}
\RequirePackage{xparse}
%    \end{macrocode}
% Test for the OldArgs flag and include legacy packages
% if the flag is true.
%
%    \begin{macrocode}
\if@nameauth@OldArgs
  \RequirePackage{xargs}
  \RequirePackage{suffix}
\fi
%    \end{macrocode}
%
% \newpage
%
% \addtocontents{toc}{\protect\goodbreak}
% \subsection{Internal Macros}
% \label{sec:InternalMacros}
%
% \subsubsection{Fundamental Macros}
%
% The following macros are the most essential to the concept of ``name''.
%
% \subsubsection*{\hfil Name Control Sequence: Who Am I?}
%
% \begin{macro}{\@nameauth@Clean}
% Thanks to \Name*[Heiko]{Oberdiek}, this macro produces a ``sanitized''
% string to make a control sequence for a name. Testing the existence of
% that control sequence is the core of \textsf{nameauth}.
%
%    \begin{macrocode}
\newcommand*\@nameauth@Clean[1]
  {\expandafter\zap@space\detokenize{#1} \@empty}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@MakeCS}
% \changes{3.5}{2020/11/23}{Added}
% Unless we are in \cmd{\AKA}, create a name control sequence
% in the core name engine.
%
%    \begin{macrocode}
\newcommand*\@nameauth@MakeCS[1]
{%
  \unless\ifcsname#1\endcsname
    \unless\if@nameauth@InAKA\csgdef{#1}{}\fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Parsing: Root and Suffix}
%
% \begin{macro}{\@nameauth@Root}
% These two macros return everything before a comma in \meta{SNN}.
% We do this with a delimited macro as a helper that determines the
% root, the suffix, and the end of input.
%
%    \begin{macrocode}
\newcommand*\@nameauth@Root[1]{\@nameauth@@Root#1,\\}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@@Root}
% \changes{2.0}{2015/11/11}{Trim spaces}
% \changes{3.0}{2016/10/26}{Redesigned}
% \changes{3.2}{2017/03/22}{Renamed}
% Throw out the comma and suffix, return the radix.
%
%    \begin{macrocode}
\def\@nameauth@@Root#1,#2\\{\trim@spaces{#1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@TrimTag}
% \changes{3.0}{2016/10/26}{Added}
% \changes{3.2}{2017/03/22}{Renamed}
% These two macros return everything before a vertical bar
% (\texttt{\textbar}) in an index tag (for sorting xrefs).
% We do this with a delimited macro as a helper, as above.
%
%    \begin{macrocode}
\newcommand*\@nameauth@TrimTag[1]{\@nameauth@@TrimTag#1|\\}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@@TrimTag}
% \changes{3.0}{2016/10/26}{Added}
% Throw out the bar and suffix, return the radix.
%
%    \begin{macrocode}
\def\@nameauth@@TrimTag#1|#2\\{#1}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@Suffix}
% \changes{0.9}{2012/02/10}{Added}
% These two macros parse \meta{SNN} into a radix and a comma-delimited
% suffix, returning only the suffix after a comma in the argument,\
% or nothing. We do this with a delimited macro as a helper, but more
% complicated this time.
%
%    \begin{macrocode}
\newcommand*\@nameauth@Suffix[1]{\@nameauth@@Suffix#1,,\\}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@@Suffix}
% \changes{0.9}{2012/02/10}{Added}
% \changes{1.5}{2013/02/22}{Trim spaces}
% \changes{3.0}{2016/10/26}{New test}
% \changes{3.2}{2017/03/22}{Renamed}
% Throw out the radix; return the suffix with no leading spaces.
% Used to print the suffix.
%
%    \begin{macrocode}
\def\@nameauth@@Suffix#1,#2,#3\\{%
  \ifx\\#2\\\@empty\else\trim@spaces{#2}\fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@GetSuff}
% \changes{3.2}{2017/03/22}{Added}
% These two macros test the suffix for a leading active Unicode
% character. We use this for capitalization to avoid errors.
%
%    \begin{macrocode}
\newcommand*\@nameauth@GetSuff[1]{\@nameauth@@GetSuff#1,,\\}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@@GetSuff}
% \changes{3.2}{2017/03/22}{Added}
% Throw out the radix; return the suffix.
%
%    \begin{macrocode}
\def\@nameauth@@GetSuff#1,#2,#3\\{#2}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Parsing: Capitalization}
% \label{page:Caps}
%
% \begin{macro}{\@nameauth@TestToks}
% \changes{3.2}{2017/03/22}{Added}
% \changes{3.5}{2020/11/23} {Fix namespace}
% Test if the leading token is the same as the leading token of an
% active Unicode character, using an \textit{Esszett} (\texttt{ß})
% as the control. We only run this macro if we are in the
% \textsf{inputenc} regime (using \texttt{pdflatex} and
% \texttt{latex}). Otherwise we use native Unicode.
%
%    \begin{macrocode}
\newcommand*\@nameauth@TestToks[1]
{%
  \toks@\expandafter{\@car#1\@nil}%
  \edef\@nameauth@one{\the\toks@}%
  \toks@\expandafter{\@carß\@nil}%
  \edef\@nameauth@two{\the\toks@}%
  \ifx\@nameauth@one\@nameauth@two
    \@nameauth@UTFtrue%
  \else
    \@nameauth@UTFfalse%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@UTFtest}
% \changes{3.0}{2016/10/26}{Added}
% \changes{3.1}{2017/01/13}{Can skip test}
% \changes{3.2}{2017/03/22}{Non-suffix only}
% \changes{3.5}{2020/11/23}{Fix namespace}
% We choose how to capitalize a letter by determining if we are using
% native Unicode (\texttt{xelatex} or \texttt{lualatex}). We test for
% \cmd{\Umathchar}. Then we see if \textsf{inputenc} is loaded. We set up
% the comparison and pass off to \cmd{\@nameauth@TestToks}.
%
%    \begin{macrocode}
\newcommand*\@nameauth@UTFtest[1]
{%
  \def\@nameauth@testarg{#1}%
  \ifdefined\Umathchar
    \@nameauth@UTFfalse%
  \else
    \ifdefined\UTFviii@two@octets
      \if@nameauth@Accent
        \@nameauth@UTFtrue\@nameauth@Accentfalse%
      \else
        \expandafter\@nameauth@TestToks
          \expandafter{\@nameauth@testarg}%
      \fi
    \else
      \@nameauth@UTFfalse%
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@UTFtestS}
% \changes{3.2}{2017/03/22}{Added}
% \changes{3.5}{2020/11/23}{Fix namespace}
% This test is like the one above, but a special case when we have
% a suffix. We have to do a bit more in the way of expansion to get
% the comparison to work properly. Moreover, we only use this when
% the regular suffix macro is not \cmd{\@empty}.
%
%    \begin{macrocode}
\newcommand*\@nameauth@UTFtestS[1]
{%
  \expandafter\def\expandafter\@nameauth@testarg%
    \expandafter{\@nameauth@GetSuff{#1}}%
%    \end{macrocode}
%
% \newpage\noindent
%
% This following token register assignment looks weird, but it is
% how we get a test that works.
%
%    \begin{macrocode}
  \expandafter\toks@%
    \expandafter\expandafter\expandafter{\@nameauth@testarg}%
%    \end{macrocode}
% We take that token register and assign its value to a macro
% to do the test.
%
%    \begin{macrocode}
  \expandafter\def\expandafter\@nameauth@test@rg%
    \expandafter{\the\toks@}%
  \ifdefined\Umathchar
    \@nameauth@UTFfalse%
  \else
    \ifdefined\UTFviii@two@octets
      \if@nameauth@Accent
        \@nameauth@UTFtrue\@nameauth@Accentfalse%
      \else
        \expandafter\@nameauth@TestToks%
          \expandafter{\@nameauth@test@rg}%
      \fi
    \else
      \@nameauth@UTFfalse%
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@Cap}
% \changes{3.1}{2017/01/13}{Redesigned}
% \changes{3.2}{2017/03/22}{Non-UTF}
% These two macros cap the first letter of the argument.
% Since they partition the argument into two segments, this can
% break some macro arguments unless one uses \cmd{\noexpand}.
%
%    \begin{macrocode}
\newcommand*\@nameauth@Cap[1]{\@nameauth@C@p#1\\}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@C@p}
% \changes{3.1}{2017/01/13}{Added}
% \changes{3.2}{2017/03/22}{Renamed, use \cmd{\MakeUppercase}}
% Helper macro for the one above.
%
%    \begin{macrocode}
\def\@nameauth@C@p#1#2\\{%
  \expandafter\trim@spaces\expandafter{\MakeUppercase{#1}#2}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@CapUTF}
% \changes{3.2}{2017/03/22}{Added}
% These two macros cap the first active Unicode letter when one
% is using \textsf{inputenc} (an argument ``twice as wide'' as
% normal, native Unicode).
%
%    \begin{macrocode}
\newcommand*\@nameauth@CapUTF[1]{\@nameauth@C@pUTF#1\\}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@C@pUTF}
% \changes{3.1}{2017/01/13}{Added}
% \changes{3.2}{2017/03/22}{Use \cmd{\MakeUppercase}}
% Helper macro for the one above.
%
%    \begin{macrocode}
\def\@nameauth@C@pUTF#1#2#3\\{%
  \expandafter\trim@spaces\expandafter{\MakeUppercase{#1#2}#3}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@CapArgs}
% \changes{3.5}{2020/11/23}{Added}
% Capitalize the first letter of all name arguments. Implements
% capitalization on demand in the body text (not the index) when not
% in alternate formatting. We only use this macro in the local scope
% of \cmd{\@nameauth@Parse}. Uses the foregoing macros.
%
%    \begin{macrocode}
\newcommand*\@nameauth@CapArgs[3]
{%
  \ifdefined\@nameauth@InParser
    \unless\if@nameauth@AltFormat
      \let\carga\arga%
      \let\crootb\rootb%
      \let\csuffb\suffb%
      \let\cargc\argc%
%    \end{macrocode}
% We test \meta{FNN} for active, non-native Unicode
% characters, then cap the first letter.
%
%    \begin{macrocode}
      \unless\ifx\arga\@empty
        \def\test{#1}%
        \expandafter\@nameauth@UTFtest\expandafter{\test}%
%    \end{macrocode}
% Capitalize the first active Unicode character.
%
%    \begin{macrocode}
        \if@nameauth@UTF
          \expandafter\def\expandafter\carga\expandafter{%
            \expandafter\@nameauth@CapUTF\expandafter{\test}}%
%    \end{macrocode}
% Capitalize the first native Unicode character (not active).
%
%    \begin{macrocode}
        \else
          \expandafter\def\expandafter\carga\expandafter{%
            \expandafter\@nameauth@Cap\expandafter{\test}}%
        \fi
      \fi
%    \end{macrocode}
% We test \meta{SNN} for active Unicode characters,
% then cap the first letter.
%
%    \begin{macrocode}
      \def\test{#2}%
      \expandafter\@nameauth@UTFtest\expandafter{\test}%
%    \end{macrocode}
% Capitalize the first active Unicode character.
%
%    \begin{macrocode}
      \if@nameauth@UTF
        \expandafter\def\expandafter\crootb\expandafter{%
          \expandafter\@nameauth@CapUTF\expandafter{\rootb}}%
%    \end{macrocode}
% Capitalize the first native character (not active).
%
%    \begin{macrocode}
      \else
        \expandafter\def\expandafter\crootb\expandafter{%
          \expandafter\@nameauth@Cap\expandafter{\rootb}}%
      \fi
%    \end{macrocode}
% We test \meta{Affix} for active Unicode characters,
% then cap the first letter.
%
%    \begin{macrocode}
      \unless\ifx\suffb\@empty
        \def\test{#2}%
        \expandafter\@nameauth@UTFtestS\expandafter{\test}%
        \protected@edef\test{\@nameauth@GetSuff{#2}}%
%    \end{macrocode}
% Capitalize the first active Unicode character.
%
%    \begin{macrocode}
        \if@nameauth@UTF
          \protected@edef\test{\@nameauth@Suffix{#2}}%
          \expandafter\def\expandafter\csuffb\expandafter{%
            \expandafter\@nameauth@CapUTF\expandafter{\test}}%
%    \end{macrocode}
% Capitalize the first native Unicode character (not active).
%
%    \begin{macrocode}
        \else
          \edef\@nameauth@test{\@nameauth@Suffix{#2}}%
          \expandafter\def\expandafter\csuffb\expandafter{%
            \expandafter\@nameauth@Cap\expandafter{\test}}%
        \fi
      \fi
%    \end{macrocode}
% We test \meta{Alternate} for active Unicode characters,
% then cap the first letter.
%
%    \begin{macrocode}
      \unless\ifx\argc\@empty
        \def\test{#3}%
        \expandafter\@nameauth@UTFtest\expandafter{\test}%
%    \end{macrocode}
% Capitalize the first active Unicode character.
%
%    \begin{macrocode}
        \if@nameauth@UTF
          \expandafter\def\expandafter\cargc\expandafter{%
            \expandafter\@nameauth@CapUTF\expandafter{\test}}%
%    \end{macrocode}
% Capitalize the first native Unicode character (not active).
%
%    \begin{macrocode}
        \else
          \expandafter\def\expandafter\cargc\expandafter{%
            \expandafter\@nameauth@Cap\expandafter{\test}}%
        \fi
      \fi
%    \end{macrocode}
% Let the local arguments be the macros with caps. We cap them all
% and let the macros sort them out because we do not know which will
% be displayed.
%
%    \begin{macrocode}
      \let\arga\carga%
      \let\rootb\crootb%
      \let\suffb\csuffb%
      \let\argc\cargc%
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Parsing: Full Stops}
%
% \begin{macro}{\@nameauth@TestDot}
% \changes{3.5}{2020/11/23}{Redesigned}
% This macro, based on a snippet by \Name*[Uwe]{Lueck}, checks for
% a full stop at the end of its argument using the two internal helper
% macros below.
%
%    \begin{macrocode}
\newcommand*\@nameauth@TestDot[1]
{%
%    \end{macrocode}
% If no full stop is present, \texttt{\#\#1} is associated with the first
% \cmd{\@End.} The second \cmd{\@End} gets absorbed, leaving
% \texttt{\#\#2} empty. If a full stop is present, \texttt{\#\#2}
% will contain it.
%
%    \begin{macrocode}
  \def\@nameauth@TestD@t##1.\@End##2\\{\@nameauth@TestPunct{##2}}%
%    \end{macrocode}
% The two control sequences are equal if \texttt{\#\#1} is empty
% (no full stop). If \texttt{\#\#1} is not empty, it sets
% \cmd{\@nameauth@Puncttrue}, which triggers the call to
% \cmd{\@nameauth@CheckDot} below. One cannot use \cmd{\unless} below.
%
%    \begin{macrocode}
  \def\@nameauth@TestPunct##1%
  {%
    \ifx\@nameauth@TestPunct##1\@nameauth@TestPunct
    \else
      \global\@nameauth@Puncttrue%
    \fi
  }%
  \global\@nameauth@Punctfalse%
  \@nameauth@TestD@t#1\@End.\@End\\%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@CheckDot}
% We assume that \cmd{\expandafter} precedes the invocation of
% \cmd{\@nameauth@CheckDot}, which only is called if the terminal
% character of the input is a period. We evaluate the lookahead
% \cmd{\@nameauth@token} while keeping it on the list of input tokens.
%
%    \begin{macrocode}
\newcommand*\@nameauth@CheckDot
  {\futurelet\@nameauth@token\@nameauth@EvalDot}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@EvalDot}
% If \cmd{\@nameauth@token}, the lookahead, is a full stop, we gobble
% the next token because it is that full stop.
%
%    \begin{macrocode}
\newcommand*\@nameauth@EvalDot
{%
  \let\@nameauth@stop=.%
  \ifx\@nameauth@token\@nameauth@stop
    \expandafter\@gobble \fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Parsing: Breaking, Spaces, and Commas}
%
% \begin{macro}{\@nameauth@AddPunct}
% \changes{3.5}{2020/11/23}{Added}
% Here we govern whether (in the text, not the index) spaces between
% name elements break or not, and whether to add commas or not. Much
% applies only to Western names, thus we check if \meta{FNN} is empty
% or not. We only use this macro in \cmd{\@nameauth@Parse}.
%
%    \begin{macrocode}
\newcommand*\@nameauth@AddPunct
{%
  \ifdefined\@nameauth@InParser
    \def\Space{ }%
    \def\SpaceW{ }%
%    \end{macrocode}
% \cmd{\SpaceW} is used for the space between a Western name and an affix,
% specifically tied to \cmd{\KeepAffix}. \cmd{\Space} is used for all
% other spaces between name elements.
%
%    \begin{macrocode}
    \if@nameauth@NBSP \edef\Space{\nobreakspace}\fi
    \if@nameauth@NBSPX \edef\SpaceW{\nobreakspace}\fi
%    \end{macrocode}
% Western names have a set of comma-use conventions that differ
% from all other name forms, so we only use the following logic
% if \meta{FNN} is not empty, thus, a Western name.
%
%    \begin{macrocode}
    \unless\ifx\arga\@empty
      \if@nameauth@AlwaysComma
        \def\Space{, }%
        \if@nameauth@NBSP\edef\Space{,\nobreakspace}\fi
      \fi
      \if@nameauth@ShowComma
        \def\Space{, }%
        \if@nameauth@NBSP\edef\Space{,\nobreakspace}\fi
      \fi
      \if@nameauth@NoComma
        \def\Space{ }%
        \if@nameauth@NBSP\edef\Space{\nobreakspace}\fi
      \fi
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Parsing: Name Argument Loading}
%
% \begin{macro}{\@nameauth@LoadArgs}
% \changes{3.5}{2020/11/23}{Added}
% Assign name arguments to internal macros to determine name syntax.
% This is used in all macros that take name arguments.
%
%    \begin{macrocode}
\newcommand*\@nameauth@LoadArgs[3]
{%
%    \end{macrocode}
% We want these arguments to expand to \cmd{\@empty} (or not)
% when we test them.
%
%    \begin{macrocode}
  \protected@edef\@nameauth@A{\trim@spaces{#1}}%
  \protected@edef\@nameauth@B{\@nameauth@Root{#2}}%
  \protected@edef\@nameauth@SB{\@nameauth@Suffix{#2}}%
  \protected@edef\@nameauth@C{\trim@spaces{#3}}%
%    \end{macrocode}
% Make (usually) unique control sequence values from the name arguments.
%
%    \begin{macrocode}
  \def\@nameauth@csb{\@nameauth@Clean{#2}}%
  \def\@nameauth@csbc{\@nameauth@Clean{#2,#3}}%
  \def\@nameauth@csab{\@nameauth@Clean{#1!#2}}%
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Parsing: Standard Parsing Logic}
%
% \begin{macro}{\@nameauth@Choice}
% \changes{3.5}{2020/11/23}{Added}
% \changes{3.7}{2023/02/03}{Access name pattern and type; redesigned to
% optimize many macros}
% This standard logic applies to all macros that take name arguments. Here
% we update \cmd{\NameauthPattern},
% \texttt{\textbackslash ifNameauthWestern}, and
% \texttt{\textbackslash ifNameauthObsolete} to show the resulting name
% pattern and type of name, usable in formatting hooks.
%
%    \begin{macrocode}
\newcommand\@nameauth@Choice[3]
{%
  \ifx\@nameauth@A\@empty
    \ifx\@nameauth@C\@empty
%    \end{macrocode}
% This path is for nonwestern names. The \texttt{\#1} argument is
% used both here and below when \cmd{\@nameauth@SB} is present. The
% \texttt{\#1} path always corresponds to the present syntax.
% Thus, when printing names in the text, the \texttt{\#1} argument
% must test both \cmd{\@nameauth@C} and \cmd{\@nameauth@SB}, replacing
% the latter with former ifit exists. With indexing and other macros, 
% one ignores \cmd{\@nameauth@C}.
%
%    \begin{macrocode}
      \let\NameauthPattern\@nameauth@csb%
      \NameauthWesternfalse \NameauthObsoletefalse%
      #1%
    \else
      \ifx\@nameauth@SB\@empty
%    \end{macrocode}
% The \texttt{\#2} argument is only for nonwestern names that use
% the obsolete syntax. Here \cmd{\@nameauth@SB}
% never occurs. For indexing and control sequences, one cannot ignore
% the use of \cmd{\@nameauth@C} in this path.
%
%    \begin{macrocode}
        \let\NameauthPattern\@nameauth@csbc%
        \NameauthWesternfalse \NameauthObsoletetrue%
        #2%
      \else
%    \end{macrocode}
% But if both \cmd{\@nameauth@SB} and \cmd{\@nameauth@C} are present,
% we invoke the \texttt{\#1} argument instead and let it do any further
% testing and processing. That shows we are again using the current
% syntax with a potential name swap.
%
%    \begin{macrocode}
        \let\NameauthPattern\@nameauth@csb%
        \NameauthWesternfalse \NameauthObsoletefalse%
        #1%
      \fi
    \fi
  \else
%    \end{macrocode}
% This decision path is for Western names. When printing
% names in the text, somewhere in the \texttt{\#3}
% argument one must test for \cmd{\@nameauth@C} and swap it for
% \cmd{\@nameauth@A}. One also must check for and handle
% \cmd{\@nameauth@SB}. Otherwise, for indexing and control sequences,
%  one ignores \cmd{\@nameauth@C} in this path and handles
%  \cmd{\@nameauth@SB} appropriately.
%
%    \begin{macrocode}
    \let\NameauthPattern\@nameauth@csab%
    \NameauthWesterntrue \NameauthObsoletefalse%
    #3%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@Flags}
% \changes{3.5}{2020/09/25}{Added}
% Reset flags after the naming macros and \cmd{\AKA} and friends create
% output in the text. Other places in the core naming engine where flags
% are reset are for special cases like \cmd{\JustIndex}.
%
%    \begin{macrocode}
\newcommand*\@nameauth@Flags
{%
  \if@nameauth@OldReset
%    \end{macrocode}
% The \texttt{oldreset} option implies not only a difference
% in scope regarding how flags are reset, but it also lets the effects
% of \cmd{\ForgetThis} and \cmd{\SubvertThis} to pass through \cmd{\AKA}
% and \cmd{\AKA*}. Regardless, we only reset \texttt{\textbackslash
% if@nameauth@AltAKA} here due to macros like \cmd{\PName}.
%
%    \begin{macrocode}
    \if@nameauth@InAKA\@nameauth@AltAKAfalse\fi
    \@nameauth@SkipIndexfalse%
    \if@nameauth@InName
      \@nameauth@Forgetfalse%
      \@nameauth@Subvertfalse%
    \fi
    \@nameauth@NBSPfalse%
    \@nameauth@NBSPXfalse%
    \@nameauth@DoCapsfalse%
    \@nameauth@Accentfalse%
    \@nameauth@AllThisfalse%
    \@nameauth@ShowCommafalse%
    \@nameauth@NoCommafalse%
    \@nameauth@RevThisfalse%
    \@nameauth@RevThisCommafalse%
    \@nameauth@ShortSNNfalse%
    \@nameauth@EastFNfalse%
  \else
%    \end{macrocode}
% The current way that the flags are reset makes them both global
% and more uniform, hopefully eliminating a few chances for errors
% that might be quite difficult to debug.
%
%    \begin{macrocode}
    \if@nameauth@InAKA\global\@nameauth@AltAKAfalse\fi
    \global\@nameauth@SkipIndexfalse%
    \global\@nameauth@Forgetfalse%
    \global\@nameauth@Subvertfalse%
    \global\@nameauth@NBSPfalse%
    \global\@nameauth@NBSPXfalse%
    \global\@nameauth@DoCapsfalse%
    \global\@nameauth@Accentfalse%
    \global\@nameauth@AllThisfalse%
    \global\@nameauth@ShowCommafalse%
    \global\@nameauth@NoCommafalse%
    \global\@nameauth@RevThisfalse%
    \global\@nameauth@RevThisCommafalse%
    \global\@nameauth@ShortSNNfalse%
    \global\@nameauth@EastFNfalse%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection[Errors/Debugging]{Error Detection and Debugging}
%
% \begin{macro}{\@nameauth@Error}
% \changes{3.0}{2016/10/26}{Added}
% \changes{3.01}{2016/10/27}{Fixed}
% \changes{3.5}{2020/11/23}{Fix namespace}
% The \textsf{nameauth} package will halt with a meaningful error
% when a required name argument is empty, expands to empty,
% has an empty root in a malformed root/suffix pair.
%
%    \begin{macrocode}
\newcommand*\@nameauth@Error[2]
{%
  \edef\@nameauth@msga{#2 SNN arg empty}%
  \edef\@nameauth@msgb{#2 SNN arg malformed}%
  \protected@edef\@nameauth@testname{\trim@spaces{#1}}%
  \protected@edef\@nameauth@testroot{\@nameauth@Root{#1}}%
  \ifx\@nameauth@testname\@empty
    \PackageError{nameauth}{\@nameauth@msga}%
  \fi
  \ifx\@nameauth@testroot\@empty
      \PackageError{nameauth}{\@nameauth@msgb}%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@IdxPageref}
% \changes{3.3}{2020/02/20}{Added}
% \changes{3.5}{2020/11/23}{Use index hook, optimize logic,
%   fix name space, use Boolean flags}
% \changes{3.7}{2023/02/03}{Renamed; only show index entries;
%   add warning; optimized}
% Here we set up a local scope because we make changes that would
% otherwise affect normal \textsf{nameauth} output. We redefine
% \cmd{\NameauthIndex} to print an argument in the text instead of
% the index, and we force indexing to occur.
%
%    \begin{macrocode}
\newcommand*\@nameauth@IdxPageref[3]
{%
%    \end{macrocode}
% Warn if \cmd{\SkipIndex} was called before \cmd{\ShowIdxPageref},
% and reset it.
%
%    \begin{macrocode}
  \if@nameauth@SkipIndex
    \PackageWarning{nameauth}
    {\string\SkipIndex precedes \string\ShowIdxPageref; check}%
    \unless\if@nameauth@OldReset
      \@nameauth@SkipIndexfalse%
    \fi
  \fi
%    \end{macrocode}
% Start a local scope to isolate any changes and redefine
% \cmd{\NameauthIndex} (the index macro hook) to print
% an entry in the text.
%
%    \begin{macrocode}
  \begingroup%
    \def\NameauthIndex##1{##1}%
    \@nameauth@DoIndextrue%
%    \end{macrocode}
% We locally delete any tag and xref control sequences as needed.
% They will be restored when the scope ends. If \cmd{\ShowIdxPageref}
% set \cmd{\@nameauth@LongIdxDebugtrue} we produce a full index entry
% that shows all the tags and the ``actual'' character as well as the
% name. Otherwise we produce a short index entry that shows only the name.
%
%    \begin{macrocode}
    \@nameauth@Choice{}{}{}%
    \csundef{\NameauthPattern!PN}%
    \unless\if@nameauth@LongIdxDebug
      \csundef{\NameauthPattern!PRE}%
      \csundef{\NameauthPattern!TAG}%
    \fi
    \IndexName[#1]{#2}[#3]%
%    \end{macrocode}
% We close the scope and reset the flags.
%
%    \begin{macrocode}
  \endgroup%
  \global\@nameauth@LongIdxDebugfalse%
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Core Name Engine}
%
% \subsubsection*{\hfil Argument Processing Layer}
%
% \begin{macro}{\@nameauth@Name}
% \changes{1.5}{2013/02/22}{Reversing/caps}
% \changes{2.0}{2015/11/11}{Trim spaces; fix tags}
% \changes{2.1}{2015/11/24}{Fix Unicode}
% \changes{2.3}{2016/01/05}{Now internal}
% \changes{2.4}{2016/03/15}{Set token regs}
% \changes{2.41}{2016/03/17}{Fix token regs}
% \changes{2.5}{2016/04/06}{Fix old syntax}
% \changes{2.6}{2016/09/19}{Better indexing}
% \changes{3.0}{2016/10/26}{Redesigned}
% \changes{3.1}{2017/01/13}{New workflow}
% \changes{3.3}{2020/02/20}{Global flag reset}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% \Name*[Marc van]{Dongen} provided the original basic structure.
% Parsing, indexing, and formatting are more modularized than
% in earlier versions.
%
%    \begin{macrocode}
\NewDocumentCommand{\@nameauth@Name}{O{} m O{}}
{%
%    \end{macrocode}
% Both \cmd{\@nameauth@Name} and \cmd{\AKA} engage the lock below,
% preventing a stack overflow. Tell the formatting mechanism that
% it is being called from
% \cmd{\@nameauth@Name}.
%
%    \begin{macrocode}
  \if@nameauth@BigLock \@nameauth@Locktrue\fi
  \unless\if@nameauth@Lock
    \@nameauth@Locktrue%
    \@nameauth@InNametrue%
%    \end{macrocode}
% Test for malformed input.
%
%    \begin{macrocode}
    \@nameauth@Error{#2}{macro \string\@nameauth@name}%
%    \end{macrocode}
% If we use \cmd{\JustIndex} then skip everything else.
% The \texttt{oldpass} option restores what we did before
% version 3.3, where we locally reset \cmd{\@nameauth@JustIndexfalse}
% and were done. Now, however, the default is a global reset to avoid
% undocumented behavior.
%
%    \begin{macrocode}
    \if@nameauth@JustIndex
      \IndexName[#1]{#2}[#3]%
      \if@nameauth@OldPass
        \@nameauth@JustIndexfalse%
      \else
        \if@nameauth@OldReset
          \@nameauth@FullNamefalse%
          \@nameauth@FirstNamefalse%
          \@nameauth@JustIndexfalse%
        \else
          \global\@nameauth@FullNamefalse%
          \global\@nameauth@FirstNamefalse%
          \global\@nameauth@JustIndexfalse%
        \fi
      \fi
    \else
%    \end{macrocode}
% Create or delete name pattern if directed. Deletion has priority
% because it occurs after creation. Ensure that names are printed
% in horizontal mode. Wrap the name with two index entries in case
% a page break occurs between them.
%
%    \begin{macrocode}
      \if@nameauth@Subvert \SubvertName[#1]{#2}[#3]\fi
      \if@nameauth@Forget \ForgetName[#1]{#2}[#3]\fi
      \leavevmode\hbox{}%
      \unless\if@nameauth@SkipIndex \IndexName[#1]{#2}[#3]\fi
      \if@nameauth@MainFormat
        \@nameauth@Parse{#1}{#2}{#3}{!MN}%
      \else
        \@nameauth@Parse{#1}{#2}{#3}{!NF}%
      \fi
      \unless\if@nameauth@SkipIndex \IndexName[#1]{#2}[#3]\fi
%    \end{macrocode}
% Reset all the ``per name'' Boolean values after printing a name.
% The default is global.
%
%    \begin{macrocode}
      \@nameauth@Flags%
    \fi
    \@nameauth@Lockfalse%
    \@nameauth@InNamefalse%
%    \end{macrocode}
% Close the ``locked'' branch and complete the full stop detection
% and removal.
%
%    \begin{macrocode}
  \fi
  \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Syntactic Element Layer}
%
% \begin{macro}{\@nameauth@Parse}
% \changes{3.0}{2016/10/26}{Added}
% \changes{3.1}{2017/01/13}{New workflow, caps}
% \changes{3.2}{2017/03/22}{Fix alt. format, affixes,
%   use \cmd{\MakeUppercase}}
% \changes{3.5}{2020/11/23}{Global token regs, optimize logic,
%   fix namespace}
% Parse and print a name in the text. The final required argument tells
% us which naming system we are in (Section~\ref{sec:NamePatterns}).
% Both \cmd{\@nameauth@Name} and \cmd{\AKA} call this parser, which only
% works in a locked state.
%
%    \begin{macrocode}
\newcommand\@nameauth@Parse[4]
{%
  \if@nameauth@BigLock \@nameauth@Lockfalse\fi
  \if@nameauth@Lock
%    \end{macrocode}
% Make token register copies of the current name args
% to be available for the hook macros.
%
%    \begin{macrocode}
    \if@nameauth@OldToks
      \@nameauth@toksa\expandafter{#1}%
      \@nameauth@toksb\expandafter{#2}%
      \@nameauth@toksc\expandafter{#3}%
    \else
      \global\@nameauth@toksa\expandafter{#1}%
      \global\@nameauth@toksb\expandafter{#2}%
      \global\@nameauth@toksc\expandafter{#3}%
    \fi
%    \end{macrocode}
% If global caps. reversing, and commas are true,
% set the per-name flags true.
%
%    \begin{macrocode}
      \if@nameauth@AllCaps     \@nameauth@AllThistrue\fi
      \if@nameauth@RevAll      \@nameauth@RevThistrue\fi
      \if@nameauth@RevAllComma \@nameauth@RevThisCommatrue\fi
%    \end{macrocode}
% Now we enter a local scope where we can use simple control
% strings without needing to worry about collisions. We process
% and load the arguments into the appropriate macros.
%
%    \begin{macrocode}
    \begingroup%
      \def\@nameauth@InParser{}%
      \@nameauth@LoadArgs{#1}{#2}{#3}%
%    \end{macrocode}
% Copy the protected control sequences to local,
% unprotected ones.
%
%    \begin{macrocode}
      \let\arga\@nameauth@A%
      \let\rootb\@nameauth@B%
      \let\suffb\@nameauth@SB%
      \let\argc\@nameauth@C%
%    \end{macrocode}
% Capitalization on demand in the body text
% if not in alternate formatting.
%
%    \begin{macrocode}
      \if@nameauth@DoCaps
        \@nameauth@CapArgs{#1}{#2}{#3}%
      \fi
%    \end{macrocode}
% We capitalize the entire surname when desired;
% different from above and overrides it.
%
%    \begin{macrocode}
      \if@nameauth@AllThis
        \protected@edef\rootb%
          {\MakeUppercase{\@nameauth@Root{#2}}}%
      \fi
%    \end{macrocode}
% Use non-breaking spaces and commas as desired.
%
%    \begin{macrocode}
      \@nameauth@AddPunct%
%    \end{macrocode}
% We parse names by attaching ``meaning'' to patterns
% of macro arguments primarily via \cmd{\FNN} and \cmd{\SNN}.
% Then we call the name printing macros, based on optional arguments.
%
%    \begin{macrocode}
      \let\SNN\rootb%
      \@nameauth@Choice
%    \end{macrocode}
% Nonwestern names, current syntax.
% We test \cmd{\argc} and \cmd{\suffb} as needed.
%
%    \begin{macrocode}
      {%
        \ifx\argc\@empty
          \let\FNN\suffb%
        \else
          \let\FNN\argc%
        \fi
        \@nameauth@NonWest{\@nameauth@csb#4}%
        \@nameauth@MakeCS{\@nameauth@csb#4}%
      }%
%    \end{macrocode}
% Nonwestern names, obsolete syntax. Here \cmd{\argc} is significant.
%
%    \begin{macrocode}
      {%
        \let\FNN\argc%
        \@nameauth@NonWest{\@nameauth@csbc#4}%
        \@nameauth@MakeCS{\@nameauth@csbc#4}%
      }%
%    \end{macrocode}
% Western names.
% We test for \cmd{\argc} and swap it for \cmd{\arga} and
% account for \cmd{\suffb}.
%
%    \begin{macrocode}
      {%
        \ifx\argc\@empty
          \let\FNN\arga%
        \else
          \let\FNN\argc%
        \fi
        \unless\ifx\suffb\@empty
          \def\SNN{\rootb\Space\suffb}%
          \if@nameauth@ShortSNN
            \let\SNN\rootb%
          \fi
        \fi
        \@nameauth@West{\@nameauth@csab#4}%
        \@nameauth@MakeCS{\@nameauth@csab#4}%
      }%
%    \end{macrocode}
% We end the local group and reset the flags for name forms here.
%
%    \begin{macrocode}
    \endgroup%
    \if@nameauth@OldReset
      \@nameauth@FullNamefalse%
      \@nameauth@FirstNamefalse%
      \@nameauth@FirstFormatfalse%
    \else
      \global\@nameauth@FullNamefalse%
      \global\@nameauth@FirstNamefalse%
      \global\@nameauth@FirstFormatfalse%
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Name Display Layer}
%
% \begin{macro}{\@nameauth@NonWest}
% \changes{3.0}{2016/10/26}{Added}
% \changes{3.02}{2016/11/01}{Restrict \cmd{\ForceFN}}
% \changes{3.3}{2020/02/20}{global flag reset}
% Arrange forms of nonwestern names. We inherit macros from
% the parser and only use this macro in the local scope of the parser.
%
%    \begin{macrocode}
\newcommand*\@nameauth@NonWest[1]
{%
  \ifdefined\@nameauth@InParser
    \@nameauth@Form{#1}%
    \ifx\FNN\@empty
      \@nameauth@Hook{\SNN}%
    \else
      \if@nameauth@FullName
        \if@nameauth@RevThis
          \@nameauth@Hook{\FNN\Space\SNN}%
        \else
          \@nameauth@Hook{\SNN\Space\FNN}%
        \fi
      \else
        \if@nameauth@FirstName
          \if@nameauth@EastFN
            \@nameauth@Hook{\FNN}%
          \else
            \@nameauth@Hook{\SNN}%
          \fi
        \else
          \@nameauth@Hook{\SNN}%
        \fi
      \fi
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@West}
% \changes{3.0}{2016/10/26}{Added}
% \changes{3.3}{2020/02/20}{global flag reset}
% \changes{3.7}{2023/02/03}{always define local macros}
% Arrange forms of Western names and ``non-native'' Eastern names.
% We inherit macros from the parser and only use this macro in the
% local scope of the parser.
%
%    \begin{macrocode}
\newcommand*\@nameauth@West[1]
{%
  \ifdefined\@nameauth@InParser
    \@nameauth@Form{#1}%
    \edef\RevSpace{,\SpaceW}%
    \if@nameauth@FullName
      \if@nameauth@RevThis
        \@nameauth@Hook{\SNN\SpaceW\FNN}%
      \else
        \if@nameauth@RevThisComma
          \@nameauth@Hook{\SNN\RevSpace\FNN}%
        \else
          \@nameauth@Hook{\FNN\SpaceW\SNN}%
        \fi
      \fi
    \else
      \if@nameauth@FirstName
        \@nameauth@Hook{\FNN}%
      \else
        \@nameauth@Hook{\rootb}%
      \fi
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@Form}
% \changes{3.5}{2020/11/23}{Added}
% Set up the flags per the formatting rules for first, subsequent, long,
% and short uses. We only use this macro in the local scope of the parser.
%
%    \begin{macrocode}
\newcommand*\@nameauth@Form[1]
{%
  \ifdefined\@nameauth@InParser
%    \end{macrocode}
% If the name does not exist yet or if the \texttt{alwaysformat} option
% is used, force first-use formatting, force a long name,
% and inhibit a short name.
%
%    \begin{macrocode}
    \unless\ifcsname#1\endcsname
      \@nameauth@FirstFormattrue%
      \@nameauth@FullNametrue%
      \@nameauth@FirstNamefalse%
    \else
      \if@nameauth@AlwaysFormat\@nameauth@FirstFormattrue\fi
    \fi
%    \end{macrocode}
% If we are not in \cmd{\AKA}, if a short name form is desired,
% inhibit a long form.
%
%    \begin{macrocode}
    \unless\if@nameauth@InAKA
      \if@nameauth@FirstName\@nameauth@FullNamefalse\fi
    \else
%    \end{macrocode}
% If we are in \cmd{\AKA} use special formatting rules. \cmd{\AKA*}
% acts like \cmd{\FName}, while \cmd{\AKA} acts like \cmd{\Name*}.
% Both prefer using the subsequent-use hooks unless the \texttt{formatAKA}
% option or the \texttt{alwaysformat} option are used.
%
%    \begin{macrocode}
      \if@nameauth@AltAKA
        \if@nameauth@OldAKA\@nameauth@EastFNtrue\fi
        \@nameauth@FullNamefalse%
        \@nameauth@FirstNametrue%
      \else
        \@nameauth@FullNametrue%
        \@nameauth@FirstNamefalse%
      \fi
      \unless\if@nameauth@AlwaysFormat
        \unless\if@nameauth@AKAFormat
          \@nameauth@FirstFormatfalse%
        \fi
      \fi
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Format Hook Dispatcher}
%
% \begin{macro}{\@nameauth@Hook}
% \changes{2.4}{2016/03/15}{Current form}
% \changes{2.5}{2016/04/06}{Improve hooks}
% \changes{3.0}{2016/10/26}{Fix punct. detection}
% \changes{3.5}{2020/11/23} {Fix namespace}
% Boolean flags control which hook is called (first/subsequent use,
% name type). We only use this macro in the local scope of the parser.
%
%    \begin{macrocode}
\newcommand*\@nameauth@Hook[1]
{%
  \ifdefined\@nameauth@InParser
%    \end{macrocode}
% We tell the formatting hooks that they are in the hook dispatcher
% to enable alternate formatting. We test the printed name form to see
% if it has a trailing full stop. The flag \texttt{\textbackslash^^A
% if@nameauth@InHook} will reset outside of the local scope in
%  \cmd{\@nameauth@Parse}.
%    \begin{macrocode}
    \@nameauth@InHooktrue%
    \protected@edef\test{#1}%
    \expandafter\@nameauth@TestDot\expandafter{\test}%
    \if@nameauth@MainFormat
%    \end{macrocode}
% We use the formatting hooks for the main-matter system.
%
%    \begin{macrocode}
      \if@nameauth@FirstFormat
        \bgroup\NamesFormat{#1}\egroup%
      \else
        \bgroup\MainNameHook{#1}\egroup%
      \fi
    \else
%    \end{macrocode}
% We use the formatting hooks for the front-matter system.
%
%    \begin{macrocode}
      \if@nameauth@FirstFormat
        \bgroup\FrontNamesFormat{#1}\egroup%
      \else
        \bgroup\FrontNameHook{#1}\egroup%
      \fi
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Indexing}
%
% \begin{macro}{\@nameauth@Index}
% \changes{0.94}{2012/02/15}{Added}
% \changes{2.0}{2015/11/11}{New tagging}
% \changes{3.3}{2020/02/20}{Support hyperref}
% \changes{3.5}{2020/11/23}{Fix namespace}
% This is the core index mechanism. If the indexing flag is true,
% create an index entry, otherwise do nothing. Add any tags
% automatically if they exist.
%
%    \begin{macrocode}
\newcommand*\@nameauth@Index[2]
{%
  \if@nameauth@DoIndex
%    \end{macrocode}
% If an index tag exists for the entry, get it. Also create
% a short version of the tag without any vertical bar or trailing macro.
% If we are creating a cross-reference, use the short tag, otherwise
% use the long tag.
%
%    \begin{macrocode}
    \ifcsname#1!TAG\endcsname
      \protected@edef\@nameauth@Tag{\csname#1!TAG\endcsname}%
      \expandafter\def\expandafter\@nameauth@ShortTag\expandafter{%
        \expandafter\@nameauth@TrimTag\expandafter{\@nameauth@Tag}}%
%    \end{macrocode}
% Create entries with a sorting tag and an info tag.
%
%    \begin{macrocode}
      \ifcsname#1!PRE\endcsname
        \protected@edef\@nameauth@Pre{\csname#1!PRE\endcsname}%
        \if@nameauth@Xref
          \protected@edef\@nameauth@IdxEntry
            {\@nameauth@Pre#2\@nameauth@ShortTag}%
        \else
          \protected@edef\@nameauth@IdxEntry
            {\@nameauth@Pre#2\@nameauth@Tag}%
        \fi
      \else
%    \end{macrocode}
% Create entries with just an info tag.
%
%    \begin{macrocode}
        \if@nameauth@Xref
          \protected@edef\@nameauth@IdxEntry
            {#2\@nameauth@ShortTag}%
        \else
          \protected@edef\@nameauth@IdxEntry
            {#2\@nameauth@Tag}%
        \fi
      \fi
    \else
%    \end{macrocode}
% Create entries with just a sorting tag.
%
%    \begin{macrocode}
      \ifcsname#1!PRE\endcsname
        \protected@edef\@nameauth@Pre{\csname#1!PRE\endcsname}%
        \protected@edef\@nameauth@IdxEntry{\@nameauth@Pre#2}%
      \else
        \protected@edef\@nameauth@IdxEntry{#2}%
      \fi
    \fi
%    \end{macrocode}
% Create entries with no tag.
%
%    \begin{macrocode}
    \expandafter\NameauthIndex\expandafter{\@nameauth@IdxEntry}%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsection[User Macros: Prefixes]{For Users: Prefix Macros}
% \label{sec:PrefixMacs}
%
% All prefix macros are meant to precede a particular name and only
% affect a particular name.
%
% \subsubsection[Syntax]{Name Syntax}
%
% \subsubsection*{\hfil Commas Before Affixes}
%
% \begin{macro}{\ShowComma}
% \changes{1.4}{2012/07/24}{Added}
% Put comma between name and suffix one time.
%
%    \begin{macrocode}
\newcommand*\ShowComma{\@nameauth@ShowCommatrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NoComma}
% \changes{2.6}{2016/09/19}{Added}
% Remove comma between name and suffix one time
% (with \texttt{comma} option).
%
%    \begin{macrocode}
\newcommand*\NoComma{\@nameauth@NoCommatrue}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Capitalization}
%
% \begin{macro}{\CapThis}
% \changes{0.94}{2012/02/15}{Added}
% Tells the root capping macro to cap the first character
% of all name elements.
%
%    \begin{macrocode}
\newcommand*\CapThis{\@nameauth@DoCapstrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AccentCapThis}
% \changes{2.1}{2015/11/24}{Added}
% Overrides the automatic test for active Unicode characters.
% This is a fall-back in case the automatic test for active
% Unicode characters does not work.
%
%    \begin{macrocode}
\newcommand*\AccentCapThis
  {\@nameauth@Accenttrue\@nameauth@DoCapstrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\CapName}
% \changes{1.5}{2013/02/22}{Added}
% Capitalize entire \meta{SNN}. Overrides \cmd{\CapThis} for surnames.
%
%    \begin{macrocode}
\newcommand*\CapName{\@nameauth@AllThistrue}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Reversing}
%
% \begin{macro}{\RevName}
% \changes{1.5}{2013/02/22}{Added}
% Reverse name order.
%
%    \begin{macrocode}
\newcommand*\RevName{\@nameauth@RevThistrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ForceFN}
% \changes{3.0}{2016/10/26}{Added}
% Force the printing of an Eastern forename or ancient affix
% in the text, but only when using the ``short name'' macro
% \cmd{\FName} and the \cmd{\S}\meta{macro}.
%
%    \begin{macrocode}
\newcommand*\ForceFN{\@nameauth@EastFNtrue}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Reversing with Commas}
%
% \begin{macro}{\RevComma}
% \changes{1.5}{2013/02/22}{Added}
% Last name, comma, first name.
%
%    \begin{macrocode}
\newcommand*\RevComma{\@nameauth@RevThisCommatrue}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Affixes and Breaking}
%
% \begin{macro}{\DropAffix}
% \changes{3.0}{2016/10/26}{Added}
% Suppress the affix in a long Western name.
%
%    \begin{macrocode}
\newcommand*\DropAffix{\@nameauth@ShortSNNtrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\KeepAffix}
% \changes{1.9}{2015/07/09}{Added}
% Trigger a name-suffix pair to be separated by
% a non-breaking space.
%
%    \begin{macrocode}
\newcommand*\KeepAffix{\@nameauth@NBSPtrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\KeepName}
% \changes{3.1}{2017/01/13}{Added}
% Use non-breaking spaces between name syntactic forms.
%
%    \begin{macrocode}
\newcommand*\KeepName
  {\@nameauth@NBSPtrue\@nameauth@NBSPXtrue}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Indexing}
%
% \begin{macro}{\SkipIndex}
% \changes{3.1}{2017/01/13}{Added}
% Turn off the next instance of indexing in \cmd{\Name},
% \cmd{\FName}, and starred forms.
%
%    \begin{macrocode}
\newcommand*\SkipIndex{\@nameauth@SkipIndextrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\JustIndex}
% \changes{3.1}{2017/01/13}{Added}
% Makes the next call to \cmd{\Name}, \cmd{\FName},
% and starred forms act like \cmd{\IndexName}.
% Overrides \cmd{\SkipIndex}.
%
%    \begin{macrocode}
\newcommand*\JustIndex{\@nameauth@JustIndextrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\SeeAlso}
% \changes{3.0}{2016/10/26}{Added}
% Change the type of cross-reference from a \textit{see}
% reference to a \textit{see also} reference. Works once
% per xref, unless one uses \cmd{\Include*}.
%
%    \begin{macrocode}
\newcommand*\SeeAlso{\@nameauth@SeeAlsotrue}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection[Format/Decisions]{Formatting and Name Decisions}
%
% \begin{macro}{\ForceName}
% \changes{3.1}{2017/01/13}{Added}
% Set \cmd{\@nameauth@FirstFormat} to be true even for
% subsequent name uses. Makes the core name engine use
% \cmd{\NamesFormat}. Works for one name only.
%
%    \begin{macrocode}
\newcommand*\ForceName{\@nameauth@FirstFormattrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ForgetThis}
% \changes{3.1}{2017/01/13}{Added}
% Have the naming engine \cmd{\@nameauth@Name}
% call \cmd{\ForgetName} internally.
%
%    \begin{macrocode}
\newcommand*\ForgetThis{\@nameauth@Forgettrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\SubvertThis}
% \changes{3.1}{2017/01/13}{Added}
% Have the naming engine \cmd{\@nameauth@Name}
% call \cmd{\SubvertName} internally.
%
%    \begin{macrocode}
\newcommand*\SubvertThis{\@nameauth@Subverttrue}
%    \end{macrocode}
% \end{macro}
%
% \subsection[User Macros: Helpers]{For Users: Helper Macros}
% \label{sec:Helpers}
%
% Helper macros do not need to precede a particular name and their effects
% endure for multiple names. They tend to affect an entire scope. That is
% why they usually come in pairs.
%
% \subsubsection[Syntax]{Name Syntax}
%
% \subsubsection*{\hfil Capitalization}
%
% \begin{macro}{\AllCapsInactive}
% Turn off global surname capitalization.
% \changes{1.5}{2013/02/22}{Added}
%
%    \begin{macrocode}
\newcommand*\AllCapsInactive{\@nameauth@AllCapsfalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AllCapsActive}
% \changes{1.5}{2013/02/22}{Added}
% Turn on global surname capitalization.
% Activates \cmd{\CapName} for every name.
%
%    \begin{macrocode}
\newcommand*\AllCapsActive{\@nameauth@AllCapstrue}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Reversing}
%
% \begin{macro}{\ReverseInactive}
% Turn off global name reversing.
% \changes{1.5}{2013/02/22}{Added}
%
%    \begin{macrocode}
\newcommand*\ReverseInactive{\@nameauth@RevAllfalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ReverseActive}
% \changes{1.5}{2013/02/22}{Added}
% Turn on global name reversing.
% Activates \cmd{\RevName} for every name.
%
%    \begin{macrocode}
\newcommand*\ReverseActive{\@nameauth@RevAlltrue}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection*{\hfil Reversing with Commas}
%
% \begin{macro}{\ReverseCommaInactive}
% \changes{1.5}{2013/02/22}{Added}
% Turn off global ``last-name-comma-first''.
%
%    \begin{macrocode}
\newcommand*\ReverseCommaInactive{\@nameauth@RevAllCommafalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ReverseCommaActive}
% \changes{1.5}{2013/02/22}{Added}
% Turn on global ``last-name-comma-first''.
% Activates \cmd{\RevComma} for every name. The macro
% \cmd{\ReverseActive} takes priority over this macro
% due to the structure of the parser.
%
%    \begin{macrocode}
\newcommand*\ReverseCommaActive{\@nameauth@RevAllCommatrue}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Indexing}
%
% \begin{macro}{\IndexActual}
% \changes{2.0}{2015/11/11}{Added}
% \changes{3.5}{2020/11/23}{Use \cmd{\def}}
% Change the ``actual'' character from the default.
% This allows one to use, for example,
% |\global\IndexActual{=}| in \texttt{dtx} files.
%
%    \begin{macrocode}
\newcommand*\IndexActual[1]{\def\@nameauth@Actual{#1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\IndexInactive}
% \changes{0.94}{2012/02/15}{Added}
% Turn off global indexing of names.
%
%    \begin{macrocode}
\newcommand*\IndexInactive{\@nameauth@DoIndexfalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\IndexActive}
% \changes{0.94}{2012/02/15}{Added}
% Turn on global indexing of names.
%
%    \begin{macrocode}
\newcommand*\IndexActive{\@nameauth@DoIndextrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\IndexWarnVerbose}
% \changes{3.7}{2023/02/03}{Added}
% Turn on verbose warnings for indexing.
%
%    \begin{macrocode}
\newcommand*\IndexWarnVerbose{\@nameauth@Verbosetrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\IndexWarnTerse}
% \changes{3.7}{2023/02/03}{Added}
% Turn off verbose warnings for indexing.
%
%    \begin{macrocode}
\newcommand*\IndexWarnTerse{\@nameauth@Verbosefalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\IndexProtect}
% \changes{3.3}{2020/02/20}{Added}
% We shut down all output from the naming and indexing macros
% to protect against problems in the index in case a macro in the
% index contains one of the naming macros. This macro is deliberately
% local, so one can use scoping to isolate its effects.
%
%    \begin{macrocode}
\newcommand*\IndexProtect
  {\@nameauth@DoIndexfalse\@nameauth@BigLocktrue}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Formatting}
%
% \begin{macro}{\NamesInactive}
% Switch to the front-matter name system.
%
%    \begin{macrocode}
\newcommand*\NamesInactive{\@nameauth@MainFormatfalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NamesActive}
% Switch to the main-matter name system.
%
%    \begin{macrocode}
\newcommand*\NamesActive{\@nameauth@MainFormattrue}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection[Alternate Format]{Alternate Formatting}
%
% \begin{macro}{\AltFormatActive}
% \changes{3.1}{2017/01/13}{Added}
% \changes{4.0}{2024/02/09}{Combine starred, un-starred macros}
% \begin{macro}{\AltFormatActive*}\end{macro}\vspace{-2.7ex}
% Turn on alternate formatting and
% disengage the formatting macros if using the starred form or
% engage the formatting macros if using the un-starred form.
%
%    \begin{macrocode}
\NewDocumentCommand{\AltFormatActive}{s}
{%
  \global\@nameauth@AltFormattrue%
  \IfBooleanTF{#1}
    {\global\@nameauth@DoAltfalse}
    {\global\@nameauth@DoAlttrue}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AltFormatInactive}
% Turn off alternate formatting altogether.
% \changes{3.1}{2017/01/13}{Added}
%
%    \begin{macrocode}
\newcommand*\AltFormatInactive
  {\global\@nameauth@AltFormatfalse\global\@nameauth@DoAltfalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AltOn}
% Locally turn on alternate formatting.
% \changes{3.1}{2017/01/13}{Added}
%
%    \begin{macrocode}
\newcommand*\AltOn
{%
  \if@nameauth@InHook
    \if@nameauth@AltFormat\@nameauth@DoAlttrue\fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AltOff}
% Locally turn off alternate formatting.
% \changes{3.1}{2017/01/13}{Added}
%
%    \begin{macrocode}
\newcommand*\AltOff
{%
  \if@nameauth@InHook
    \if@nameauth@AltFormat\@nameauth@DoAltfalse\fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AltCaps}
% \changes{3.1}{2017/01/13}{Added}
% \changes{3.2}{2017/03/22}{Use \cmd{\MakeUppercase}}
% Alternate discretionary capping macro triggered by \cmd{\CapThis}.
%
%    \begin{macrocode}
\newcommand*\AltCaps[1]
{%
  \if@nameauth@InHook
    \if@nameauth@DoCaps\MakeUppercase{#1}\else#1\fi
  \else
    #1%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\textSC}
% \changes{3.1}{2017/01/13}{Added}
% Alternate formatting macro: small caps when active.
%
%    \begin{macrocode}
\newcommand*\textSC[1]
  {\if@nameauth@DoAlt\textsc{#1}\else#1\fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\textUC}
% \changes{3.1}{2017/01/13}{Added}
% \changes{3.2}{2017/03/22}{Use \cmd{\MakeUppercase}}
% Alternate formatting macro: uppercase when active.
%
%    \begin{macrocode}
\newcommand*\textUC[1]
  {\if@nameauth@DoAlt\MakeUppercase{#1}\else#1\fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\textIT}
% \changes{3.1}{2017/01/13}{Added}
% Alternate formatting macro: italic when active.
%
%    \begin{macrocode}
\newcommand*\textIT[1]
  {\if@nameauth@DoAlt\textit{#1}\else#1\fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\textBF}
% \changes{3.1}{2017/01/13}{Added}
% Alternate formatting macro: boldface when active.
%
%    \begin{macrocode}
\newcommand*\textBF[1]
  {\if@nameauth@DoAlt\textbf{#1}\else#1\fi}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Name Decisions}
%
% \begin{macro}{\LocalNameTest}
% \changes{3.5}{2020/11/23}{Added}
% Causes decision paths in the name decision macros to be in a local scope.
%
%    \begin{macrocode}
\newcommand*\LocalNameTest{\global\@nameauth@GlobalScopefalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\GlobalNameTest}
% \changes{3.5}{2020/11/23}{Added}
% Causes decision paths in the name decision macros to have no scoping.
%
%    \begin{macrocode}
\newcommand*\GlobalNameTest{\global\@nameauth@GlobalScopetrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LocalNames}
% \changes{2.3}{2016/01/05}{Added}
% \changes{2.4}{2016/03/15}{Ensure global}
% \cmd{\LocalNames} sets |@nameauth@LocalNames| true so \cmd{\ForgetName}
% and \cmd{\SubvertName} do not affect both main and front matter
% name systems at once, only the current one.
%
%    \begin{macrocode}
\newcommand*\LocalNames{\global\@nameauth@LocalNamestrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\GlobalNames}
% \changes{2.3}{2016/01/05}{Added}
% \changes{2.4}{2016/03/15}{Ensure global}
% \cmd{\GlobalNames} restores the default behavior of \cmd{\ForgetName}
% and \cmd{\SubvertName}, which affect both name systems at once.
%
%    \begin{macrocode}
\newcommand*\GlobalNames{\global\@nameauth@LocalNamesfalse}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection[Name Parser]{User-Accessible Name Parser}
% \label{sec:NameParser}
%
% \begin{macro}{\NameParser}
% \changes{3.0}{2016/10/26}{Added}
% \changes{3.03}{2016/11/01}{Restrict first names}
% \changes{3.1}{2017/01/13}{Fix old syntax; add NBSP}
% \changes{3.2}{2017/03/22}{Fix alt. format, affixes}
% \changes{3.5}{2020/11/23}{Optimize logic}
% Print a name form based on the current state of the
% \textsf{nameauth} flags in the locked path. Used only
% in the hook macros, within the local scope of \cmd{\@nameauth@Parse}.
%
%    \begin{macrocode}
\newcommand*\NameParser
{%
  \if@nameauth@InHook
    \let\SNN\rootb%
    \@nameauth@Choice
%    \end{macrocode}
% Nonwestern names.
% We test both \cmd{\argc} and \cmd{\suffb} as needed.
%
%    \begin{macrocode}
    {%
      \ifx\argc\@empty \let\FNN\suffb \else \let\FNN\argc \fi
      \ifx\FNN\@empty
        \SNN%
      \else
        \if@nameauth@FullName
          \if@nameauth@RevThis \FNN\Space\SNN \else \SNN\Space\FNN%
          \fi
        \else
          \if@nameauth@FirstName
            \if@nameauth@EastFN \FNN \else \SNN \fi
          \else
            \SNN%
          \fi
        \fi
      \fi
    }%
%    \end{macrocode}
% Nonwestern names, obsolete syntax.
% Using \cmd{\argc} in this path affects indexing.
%
%    \begin{macrocode}
    {%
      \let\FNN\argc%
      \if@nameauth@FullName%
        \if@nameauth@RevThis \FNN\Space\SNN \else \SNN\Space\FNN \fi
      \else
        \if@nameauth@FirstName
          \if@nameauth@EastFN \FNN \else \SNN \fi
        \else
          \SNN%
        \fi
      \fi
    }%
%    \end{macrocode}
% Western names.
% We test for \cmd{\argc} and swap it for \cmd{\arga},
% and account for \cmd{\suffb}.
%
%    \begin{macrocode}
    {%
      \ifx\argc\@empty \let\FNN\arga \else \let\FNN\argc \fi
      \unless\ifx\suffb\@empty
        \def\SNN{\rootb\Space\suffb}%
        \if@nameauth@ShortSNN \let\SNN\rootb \fi
      \fi
      \if@nameauth@FullName
        \if@nameauth@RevThis
          \SNN\SpaceW\FNN%
        \else
          \if@nameauth@RevThisComma
            \SNN\RevSpace\FNN%
          \else
            \FNN\SpaceW\SNN%
          \fi
        \fi
      \else
        \if@nameauth@FirstName \FNN \else \let\SNN\rootb \SNN \fi
      \fi
    }%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsection[User Macros: Name Args]{For Users: Macros That Take Name Arguments}
% \label{sec:UserInterface}
%
% The rest of the \textsf{nameauth} macros all take name arguments. They all
% update \cmd{\NameauthPattern}, \texttt{\textbackslash ifNameauthWestern},
% and \texttt{\textbackslash ifNameauthObsolete} when called. The file
% \texttt{examples.tex} iterates through all possible argument variations of
% these macros except the debugging macros, the non-printing arguments of
% \cmd{\AKA}, and \cmd{\PName}. It thus tests for spurious spaces and any
% possible bad output.
%
% \subsubsection{Basic Interface}
%
% \begin{macro}{\Name}
% \changes{4.0}{2024/02/09}{Combine starred, un-starred macros}
% \begin{macro}{\Name*}\end{macro}\vspace{-2.7ex}
% \cmd{\Name} calls \cmd{\NameauthName}, the interface hook, printing
% a long name and calling \cmd{\NameauthLName} when using the starred form.
%
%    \begin{macrocode}
\NewDocumentCommand{\Name}{s}
{%
  \IfBooleanTF{#1}
    {\@nameauth@FullNametrue\NameauthLName}
    {\NameauthName}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FName}
% \changes{0.9}{2012/02/10}{Added}
% \changes{4.0}{2024/02/09}{Combine starred, un-starred macros}
% \begin{macro}{\FName*}\end{macro}\vspace{-2.7ex}
% \cmd{\FName} sets up a short name instance and calls \cmd{\NameauthFName},
% the interface hook. Its starred form is identical in function.
%
%    \begin{macrocode}
\NewDocumentCommand{\FName}{s}
  {\@nameauth@FirstNametrue\NameauthFName}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Quick Interface}
%
% \begin{environment}{nameauth}
% \changes{1.6}{2013/03/10}{Environment added}
% \changes{2.0}{2015/11/11}{Better arg handling}
% \changes{2.41}{2016/03/17}{No local \cmd{\newtoks}}
% \changes{3.5}{2020/11/23}{Fix namespace}
% \changes{3.7}{2023/02/03}{Improve warnings}
% Here we create macro shorthands. First we define a macro \cmd{\<} that
% takes four arguments, delimited by three ampersands and \texttt{>}.
% This macro is local to the \texttt{nameauth} environment,
% but the shorthand macros that it creates are global.
%
%    \begin{macrocode}
\newenvironment{nameauth}
{%
  \begingroup%
  \let\ex\expandafter%
  \csdef{<}##1&##2&##3&##4>{%
    \protected@edef\@arga@{\trim@spaces{##1}}%
    \protected@edef\@larga@{L\trim@spaces{##1}}%
    \protected@edef\@sarga@{S\trim@spaces{##1}}%
    \protected@edef\@testb@{\trim@spaces{##2}}%
    \protected@edef\@testd@{\trim@spaces{##4}}%
    \@nameauth@etoksb\ex{##2}%
    \@nameauth@etoksc\ex{##3}%
    \@nameauth@etoksd\ex{##4}%
%    \end{macrocode}
% The first argument must have some text to create a set of control
% sequences with it. The third argument is the required name argument.
% Redefining a shorthand creates a warning.
%
%    \begin{macrocode}
    \ifx\@arga@\@empty
      \PackageError{nameauth}%
      {environment nameauth: Macro name missing;
      \expandafter\detokenize\expandafter{##3}}%
    \fi
    \@nameauth@Error{##3}{macro: \ex\zap@space\string\ \@empty##1}%
    \ifcsname\@arga@\endcsname
      \PackageWarning{nameauth}
      {Environment nameauth: shorthand macro already exists}%
    \fi
%    \end{macrocode}
% Set up shorthands according to name form. We use \cmd{\expandafter}
% due to \cmd{\protected@edef} in the naming macros. We begin with
% nonwestern names that use the new syntax. We use one \cmd{\ex} per
% token because we only have one argument to expand first.
%
%    \begin{macrocode}
    \ifx\@testd@\@empty
      \ifx\@testb@\@empty
        \ex\csgdef\ex{\ex\@arga@\ex}%
          \ex{\ex\NameauthName\ex{\the\@nameauth@etoksc}}%
        \ex\csgdef\ex{\ex\@larga@\ex}%
          \ex{\ex\@nameauth@FullNametrue%
          \ex\NameauthLName\ex{\the\@nameauth@etoksc}}%
        \ex\csgdef\ex{\ex\@sarga@\ex}%
          \ex{\ex\@nameauth@FirstNametrue%
          \ex\NameauthFName\ex{\the\@nameauth@etoksc}}%
      \else
%    \end{macrocode}
% Next we have Western names with no alternate names.
% Here we have two arguments to expand in reverse order,
% so we need three uses, then one use of \cmd{\ex} per token.
%
%    \begin{macrocode}
        \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga@\ex\ex\ex}%
          \ex\ex\ex{\ex\ex\ex\NameauthName%
          \ex\ex\ex[\ex\the\ex\@nameauth@etoksb\ex]%
          \ex{\the\@nameauth@etoksc}}%
        \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@larga@\ex\ex\ex}%
          \ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue%
          \ex\ex\ex\NameauthLName%
          \ex\ex\ex[\ex\the\ex\@nameauth@etoksb\ex]%
          \ex{\the\@nameauth@etoksc}}%
        \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@sarga@\ex\ex\ex}%
          \ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue%
          \ex\ex\ex\NameauthFName%
          \ex\ex\ex[\ex\the\ex\@nameauth@etoksb\ex]%
          \ex{\the\@nameauth@etoksc}}%
      \fi
    \else
%    \end{macrocode}
% Below are ``native'' Eastern names with alternates and
% the older syntax. We again have two arguments to expand first.
%
%    \begin{macrocode}
      \ifx\@testb@\@empty
        \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga@\ex\ex\ex}%
          \ex\ex\ex{\ex\ex\ex\NameauthName%
          \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}%
          \ex[\the\@nameauth@etoksd]}%
        \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@larga@\ex\ex\ex}%
          \ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue%
          \ex\ex\ex\NameauthLName%
          \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}%
          \ex[\the\@nameauth@etoksd]}%
        \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@sarga@\ex\ex\ex}%
          \ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue%
          \ex\ex\ex\NameauthFName%
          \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}%
          \ex[\the\@nameauth@etoksd]}%
      \else
%    \end{macrocode}
% Here are Western names with alternates. We have three arguments
% to expand, so we have seven uses, three uses, and one use of \cmd{\ex}.
%
%    \begin{macrocode}
        \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{%
          \ex\ex\ex\ex\ex\ex\ex\@arga@\ex\ex\ex\ex\ex\ex\ex}%
          \ex\ex\ex\ex\ex\ex\ex{\ex\ex\ex\ex\ex\ex\ex\NameauthName%
          \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the%
          \ex\ex\ex\@nameauth@etoksb\ex\ex\ex]%
          \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}%
          \ex[\the\@nameauth@etoksd]}%
        \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{%
          \ex\ex\ex\ex\ex\ex\ex\@larga@\ex\ex\ex\ex\ex\ex\ex}%
          \ex\ex\ex\ex\ex\ex\ex{%
          \ex\ex\ex\ex\ex\ex\ex\@nameauth@FullNametrue%
          \ex\ex\ex\ex\ex\ex\ex\NameauthLName%
          \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex%
          \@nameauth@etoksb\ex\ex\ex]%
          \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}%
          \ex[\the\@nameauth@etoksd]}%
        \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{%
          \ex\ex\ex\ex\ex\ex\ex\@sarga@\ex\ex\ex\ex\ex\ex\ex}%
          \ex\ex\ex\ex\ex\ex\ex{%
          \ex\ex\ex\ex\ex\ex\ex\@nameauth@FirstNametrue%
          \ex\ex\ex\ex\ex\ex\ex\NameauthFName%
          \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex%
          \@nameauth@etoksb\ex\ex\ex]%
          \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}%
          \ex[\the\@nameauth@etoksd]}%
      \fi
    \fi\ignorespaces%
  }\ignorespaces%
}
{\endgroup\ignorespaces}
%    \end{macrocode}
% \end{environment}
%
% \subsubsection{Debugging Macros}
%
% \begin{macro}{\ShowPattern}
% \changes{3.3}{2020/02/20}{Added}
% \changes{3.7}{2023/02/03}{Redesigned}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This displays the pattern that the name arguments generate;
% useful for debugging. We test for bad input, then load the argument
% values into the appropriate macros. We determine the name type
% and produce the output of the appropriate name control sequence.
%
%    \begin{macrocode}
\NewDocumentCommand{\ShowPattern}{O{} m O{}}
{%
    \@nameauth@Error{#2}{macro: \string\ShowPattern}%
    \@nameauth@LoadArgs{#1}{#2}{#3}%
    \@nameauth@Choice{}{}{}\NameauthPattern%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ShowIdxPageref}
% \changes{3.3}{2020/02/20}{Added}
% \changes{3.5}{2020/11/23}{Fix name space, use Boolean flags}
% \changes{3.7}{2023/02/03}{Use common back-end}
% \changes{4.0}{2024/02/09}{Combine starred, un-starred macros}
% \begin{macro}{\ShowIdxPageref*}\end{macro}\vspace{-2.7ex}
% Show an index page entry appearance for given name parameters.
%    \begin{macrocode}
\NewDocumentCommand{\ShowIdxPageref}{s O{} m O{}}
{%
  \IfBooleanTF {#1}%
%    \end{macrocode}
% The starred form displays a basic index entry with no tag.
% Test for bad input, load the argument values into
% the appropriate macros, then call the back-end.
%
%    \begin{macrocode}
  {%
    \@nameauth@Error{#3}{macro: \string\ShowIdxPageref*}%
    \@nameauth@LoadArgs{#2}{#3}{#4}%
    \@nameauth@IdxPageref{#2}{#3}{#4}%
  }%
%    \end{macrocode}
% The un-starred form displays (expanded, as printed) the index
% entry that will be generated, but not exactly what is in the
% \texttt{idx} file.
% Test for bad input, load the argument values into
% the appropriate macros, then call the back-end.
%
%    \begin{macrocode}
  {%
    \@nameauth@Error{#3}{macro: \string\ShowIdxPageref}%
    \@nameauth@LoadArgs{#2}{#3}{#4}%
    \global\@nameauth@LongIdxDebugtrue%
    \@nameauth@IdxPageref{#2}{#3}{#4}%
  }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ShowNameInfo}
% \changes{3.7}{2023/02/03}{Added}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}, improve output}
% Show how the name arguments are being interpreted by the
% \textsf{nameauth} macros, but as detokenized text,
%
%    \begin{macrocode}
\NewDocumentCommand{\ShowNameInfo}{O{} m O{}}
{%
%    \end{macrocode}
% Test for bad input, then load the argument values into
% the appropriate macros.
%
%    \begin{macrocode}
  \@nameauth@Error{#2}{macro: \string\ShowNameInfo}%
  \@nameauth@LoadArgs{#1}{#2}{#3}%
%    \end{macrocode}
% We produce what we know about the name arguments.
% First is nonwestern names using the current syntax.
%
%    \begin{macrocode}
  \@nameauth@Choice
  {%
    (SNN: \expandafter\detokenize\expandafter{\@nameauth@B})%
    \unless\ifx\@nameauth@SB\@empty
      \ (Affix*:
      \expandafter\detokenize\expandafter{\@nameauth@SB})%
    \fi
    \unless\ifx\@nameauth@C\@empty
      \ (Alt:
      \expandafter\detokenize\expandafter{\@nameauth@C})%
    \fi
  }%
%    \end{macrocode}
% Next is nonwestern names using the obsolete syntax.
%
%    \begin{macrocode}
  {%
    (SNN: \expandafter\detokenize\expandafter{\@nameauth@B})%
    \unless\ifx\@nameauth@C\@empty
      \ (Alt*:
      \expandafter\detokenize\expandafter{\@nameauth@C})%
    \fi
  }%
%    \end{macrocode}
% Finally we have Western names.
%
%    \begin{macrocode}
  {%
    (FNN: \expandafter\detokenize\expandafter{\@nameauth@A})
    (SNN: \expandafter\detokenize\expandafter{\@nameauth@B})%
    \unless\ifx\@nameauth@SB\@empty
      \ (Affix:
      \expandafter\detokenize\expandafter{\@nameauth@SB})%
    \fi
    \unless\ifx\@nameauth@C\@empty
      \ (Alt:
      \expandafter\detokenize\expandafter{\@nameauth@C})%
    \fi
  }%
}  
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ShowNameState}
% \changes{3.7}{2023/02/03}{Added}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This macro tells the user what control sequence patterns
% exist for any given name.
%
%    \begin{macrocode}
\NewDocumentCommand{\ShowNameState}{O{} m O{}}
{%
%    \end{macrocode}
% Create a local scope to kill any local definitions on exit.
% Test for bad input, then load the argument values into
% the appropriate macros.
%
%    \begin{macrocode}
  \begingroup%
  \@nameauth@Error{#2}{macro: \string\NamePatterns}%
  \@nameauth@LoadArgs{#1}{#2}{#3}%
%    \end{macrocode}
% Parse the name arguments and determine name type. We use this method
% instead of examining the Boolean flags because it is more efficient here.
%
%    \begin{macrocode}
  \@nameauth@Choice
    {\def\@nameauth@nametype{nw}}
    {\def\@nameauth@nametype{nw,os}}
    {\def\@nameauth@nametype{w}}
%    \end{macrocode}
% Check to see what control sequences exist and collect the information.
%
%    \begin{macrocode}
  \ifcsname\NameauthPattern!MN\endcsname
    \def\@nameauth@mainname{main}%
  \fi
  \ifcsname\NameauthPattern!NF\endcsname
    \def\@nameauth@frontname{front}%
  \fi
  \ifcsname\NameauthPattern!PN\endcsname
    \edef\@nameauth@testex
      {\csname\NameauthPattern!PN\endcsname}%
    \ifx\@nameauth@testex\@nameauth@Exclude
      \def\@nameauth@excl{excl}%
    \else
      \def\@nameauth@xref{xref}%
    \fi
  \fi
  \ifcsname\NameauthPattern!PRE\endcsname
    \def\@nameauth@pre{pretag}%
  \fi
  \ifcsname\NameauthPattern!TAG\endcsname
    \def\@nameauth@tag{idxtag}%
  \fi
  \ifcsname\NameauthPattern!DB\endcsname
    \def\@nameauth@db{namedb}%
  \fi
%    \end{macrocode}
% If either a main name or a front name exist, create a macro
% that reflects this condition.
%
%    \begin{macrocode}
  \ifdefined \@nameauth@mainname \def\@nameauth@namecs{}\fi
  \ifdefined \@nameauth@frontname \def\@nameauth@namecs{}\fi
%    \end{macrocode}
% If an xref and an exclusion exist for a name, something went wrong.
%
%    \begin{macrocode}
  \ifdefined \@nameauth@xref
    \ifdefined \@nameauth@excl
      \PackageWarning{nameauth}
      {Both xref and exclusion exist for \NameauthPattern}%
    \fi
  \fi
%    \end{macrocode}
% Determine the state of the ``index finite state machine''.
%
%    \begin{macrocode}
  \ifdefined \@nameauth@namecs
    \def\@nameauth@idxstate{2}%
    \ifdefined \@nameauth@xref
      \def\@nameauth@idxstate{4}%
    \fi
    \ifdefined \@nameauth@excl
      \def\@nameauth@idxstate{6}%
    \fi
   \else
    \def\@nameauth@idxstate{1}%
    \ifdefined \@nameauth@xref
      \def\@nameauth@idxstate{3}%
    \fi
    \ifdefined \@nameauth@excl
      \def\@nameauth@idxstate{5}%
    \fi
  \fi
%    \end{macrocode}
% Display the output.
%
%    \begin{macrocode}
  Pattern: {\NameauthPattern}
  Type: {\@nameauth@nametype}
  Index state: {\@nameauth@idxstate}
  Systems:%
  \ifdefined \@nameauth@mainname\ \@nameauth@mainname \fi
  \ifdefined \@nameauth@frontname\ \@nameauth@frontname \fi
  \ifdefined \@nameauth@xref\ \@nameauth@xref \fi
  \ifdefined \@nameauth@excl\ \@nameauth@excl \fi
  \ifdefined \@nameauth@pre\ \@nameauth@pre \fi
  \ifdefined \@nameauth@tag\ \@nameauth@tag \fi
  \ifdefined \@nameauth@db\ \@nameauth@db \fi
  \endgroup%
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Indexing}
%
% \begin{macro}{\IndexName}
% \changes{1.26}{2012/04/24}{Fix affixes}
% \changes{2.0}{2015/11/11}{Fix spaces, tagging}
% \changes{2.6}{2016/09/19}{Fix commas}
% \changes{3.0}{2016/10/26}{Redesigned}
% \changes{3.1}{2017/01/13}{Better tests}
% \changes{3.5}{2020/11/23}{New warnings, new exclusion test,
%   improve logic, fix namespace}
% \changes{3.7}{2023/02/03}{Fix warnings}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This creates an index entry with page entries. It warns if
% the \cmd{\SkipIndex} prefix macro was used before it was called.
% It issues additional warnings if the \texttt{verbose} option is selected.
% It prints nothing.
%
%    \begin{macrocode}
\NewDocumentCommand{\IndexName}{O{} m O{}}
{%
%    \end{macrocode}
% Process and load the arguments into the appropriate macros;
% test for malformed input.
%
%    \begin{macrocode}
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\IndexName}%
%    \end{macrocode}
% Warn if \cmd{\SkipIndex} was called before \cmd{\IndexName} and reset
% it unless the \texttt{oldreset} option was used.
%
%    \begin{macrocode}
  \if@nameauth@SkipIndex
    \PackageWarning{nameauth}
      {\string\SkipIndex precedes \string\IndexName; check for issues}%
    \unless\if@nameauth@OldReset
      \@nameauth@SkipIndexfalse%
    \fi
  \fi
%    \end{macrocode}
% Warn if \cmd{\SeeAlso} was called before \cmd{\IndexName} and reset it.
%
%    \begin{macrocode}
  \unless\if@nameauth@OldReset
    \if@nameauth@SeeAlso
      \global\@nameauth@SeeAlsofalse%
      \PackageWarning{nameauth}{\string\SeeAlso was reset}%
    \fi
  \fi
%    \end{macrocode}
% Create the appropriate index entries, calling \cmd{\@nameauth@Index}
% to handle sorting and tagging. We do not create an index entry for a
% cross-reference or exclusion.
%
%    \begin{macrocode}
  \@nameauth@Choice
%    \end{macrocode}
% Nonwestern names.
% We ignore \cmd{\@nameauth@C} and handle \cmd{\@nameauth@SB} appropriately.
%
%    \begin{macrocode}
  {%
    \def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2}}%
    \ifcsname\@nameauth@csb!PN\endcsname
      \if@nameauth@Verbose
        \edef\@nameauth@testex
          {\csname\@nameauth@csb!PN\endcsname}%
        \ifx\@nameauth@testex\@nameauth@Exclude
          \PackageWarning{nameauth}
            {\string\IndexName: exclusion exists \@nameauth@Temp}%
        \else
          \PackageWarning{nameauth}
            {\string\IndexName: xref exists \@nameauth@Temp}%
        \fi
      \fi
    \else
      \ifx\@nameauth@SB\@empty
        \@nameauth@Index{\@nameauth@csb}{\@nameauth@B}%
      \else
        \@nameauth@Index{\@nameauth@csb}
          {\@nameauth@B\@nameauth@space\@nameauth@SB}%
      \fi
    \fi
  }%
%    \end{macrocode}
% Nonwestern names, obsolete syntax.
% Using \cmd{\@nameauth@C} in this path affects indexing.
%
%    \begin{macrocode}
  {%
    \def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2 #3}}%
    \ifcsname\@nameauth@csbc!PN\endcsname
      \if@nameauth@Verbose
        \edef\@nameauth@testex
          {\csname\@nameauth@csbc!PN\endcsname}%
        \ifx\@nameauth@testex\@nameauth@Exclude
          \PackageWarning{nameauth}
            {\string\IndexName: exclusion exists \@nameauth@Temp}%
        \else
          \PackageWarning{nameauth}
            {\string\IndexName: xref exists \@nameauth@Temp}%
        \fi
      \fi
    \else
      \@nameauth@Index{\@nameauth@csbc}
        {\@nameauth@B\@nameauth@space\@nameauth@C}%
    \fi
  }%
%    \end{macrocode}
% Western names.
% We ignore \cmd{\@nameauth@C} and handle \cmd{\@nameauth@SB} appropriately.
%
%    \begin{macrocode}
  {%
    \def\@nameauth@Temp{\expandafter\detokenize\expandafter{#1 #2}}%
    \ifcsname\@nameauth@csab!PN\endcsname
      \if@nameauth@Verbose
        \edef\@nameauth@testex
          {\csname\@nameauth@csab!PN\endcsname}%
        \ifx\@nameauth@testex\@nameauth@Exclude
          \PackageWarning{nameauth}
            {\string\IndexName: exclusion exists \@nameauth@Temp}%
        \else
          \PackageWarning{nameauth}
            {\string\IndexName: xref exists \@nameauth@Temp}%
        \fi
      \fi
    \else
      \ifx\@nameauth@SB\@empty
        \@nameauth@Index{\@nameauth@csab}
          {\@nameauth@B,\@nameauth@space\@nameauth@A}%
      \else
        \@nameauth@Index{\@nameauth@csab}
          {\@nameauth@B,\@nameauth@space%
           \@nameauth@A,\@nameauth@space\@nameauth@SB}%
      \fi
    \fi
  }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\IndexRef}
% \changes{3.0}{2016/10/26}{Added}
% \changes{3.1}{2017/01/13}{Better tests}
% \changes{3.3}{2020/02/20}{Global flag reset}
% \changes{3.5}{2020/11/23}{Strict \textit{see} refs, new warnings,
%   new exclusion test, improve logic, fix namespace}
% \changes{3.7}{2023/02/03}{Fix warnings}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% Create a cross-reference that is not already an exclusion or
% a cross-reference. Print nothing.
%
%    \begin{macrocode}
\NewDocumentCommand{\IndexRef}{O{} m O{} m}
{%
%    \end{macrocode}
% Process and load the arguments into the appropriate macros.
%
%    \begin{macrocode}
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \protected@edef\@nameauth@Target{#4}%
%    \end{macrocode}
%  Test for malformed input.
%
%    \begin{macrocode}
  \@nameauth@Error{#2}{macro \string\IndexRef}%
  \@nameauth@Xreftrue%
%    \end{macrocode}
%
% Warn if \cmd{\SkipIndex} was called before \cmd{\IndexName},
% and reset it unless the \texttt{oldreset} option was used.
%
%    \begin{macrocode}
  \if@nameauth@SkipIndex
    \PackageWarning{nameauth}
    {\string\SkipIndex preceded \string\IndexRef; check for issues}%
    \unless\if@nameauth@OldReset
      \@nameauth@SkipIndexfalse%
    \fi
  \fi
  \@nameauth@Choice
%    \end{macrocode}
% Nonwestern name, new syntax. First check if
% an xref or excluded, and if so, do nothing except issue
% warnings if so desired.
%
%    \begin{macrocode}
  {%
    \def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2}}%
    \ifcsname\@nameauth@csb!PN\endcsname
      \if@nameauth@Verbose
        \edef\@nameauth@testex
          {\csname\@nameauth@csb!PN\endcsname}%
        \ifx\@nameauth@testex\@nameauth@Exclude
          \PackageWarning{nameauth}
          {\string\IndexRef: exclusion exists \@nameauth@Temp}%
        \else
          \PackageWarning{nameauth}
          {\string\IndexRef: xref exists \@nameauth@Temp}%
        \fi
      \fi
%    \end{macrocode}
% If no xref or exclusion exists, either create a \textit{see also}
% or a \textit{see} reference. We permit the latter when a name exists
% only if the \texttt{oldsee} option is used; then issue a warning.
%
%    \begin{macrocode}
    \else
      \ifx\@nameauth@SB\@empty
        \if@nameauth@SeeAlso
          \@nameauth@Index{\@nameauth@csb}
            {\@nameauth@B|seealso{\@nameauth@Target}}%
          \csgdef{\@nameauth@csb!PN}{}%
        \else
          \unless\if@nameauth@OldSee
            \unless\ifcsname\@nameauth@csb!MN\endcsname
              \unless\ifcsname\@nameauth@csb!NF\endcsname
                \@nameauth@Index{\@nameauth@csb}
                  {\@nameauth@B|see{\@nameauth@Target}}%
                \csgdef{\@nameauth@csb!PN}{}%
              \else
                \PackageWarning{nameauth}
                {\string\IndexRef: extant name;
                 no xref \@nameauth@Temp}%
              \fi
            \else
              \PackageWarning{nameauth}
              {\string\IndexRef: extant name;
               no xref \@nameauth@Temp}%
            \fi
          \else
            \if@nameauth@Verbose
              \PackageWarning{nameauth}
              {\string\IndexRef: non-strict xref \@nameauth@Temp}%
            \fi
            \@nameauth@Index{\@nameauth@csb}
              {\@nameauth@B|see{\@nameauth@Target}}%
            \csgdef{\@nameauth@csb!PN}{}%
          \fi
        \fi
%    \end{macrocode}
% When the suffix is non-empty, either create a \textit{see also}
% or a \textit{see} reference. We permit the latter when a name exists
% only if the \texttt{oldsee} option is used; then issue a warning.
%
%    \begin{macrocode}
      \else
        \if@nameauth@SeeAlso
          \@nameauth@Index{\@nameauth@csb}
            {\@nameauth@B\@nameauth@space%
             \@nameauth@SB|seealso{\@nameauth@Target}}%
          \csgdef{\@nameauth@csb!PN}{}%
        \else
          \unless\if@nameauth@OldSee
            \unless\ifcsname\@nameauth@csb!MN\endcsname
              \unless\ifcsname\@nameauth@csb!NF\endcsname
                \@nameauth@Index{\@nameauth@csb}
                  {\@nameauth@B\@nameauth@space%
                   \@nameauth@SB|see{\@nameauth@Target}}%
                \csgdef{\@nameauth@csb!PN}{}%
              \else
                \PackageWarning{nameauth}
                {\string\IndexRef: extant name;
                 no xref \@nameauth@Temp}%
              \fi
            \else
              \PackageWarning{nameauth}
              {\string\IndexRef: extant name;
               no xref \@nameauth@Temp}%
            \fi
          \else
            \if@nameauth@Verbose
              \PackageWarning{nameauth}
              {\string\IndexRef: non-strict xref \@nameauth@Temp}%
            \fi
            \@nameauth@Index{\@nameauth@csb}
              {\@nameauth@B\@nameauth@space%
               \@nameauth@SB|see{\@nameauth@Target}}%
            \csgdef{\@nameauth@csb!PN}{}%
          \fi
        \fi
      \fi
    \fi
  }%
%    \end{macrocode}
% Eastern or ancient name, obsolete syntax. First check if an xref or excluded.
%
%    \begin{macrocode}
  {%
    \def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2 #3}}%
    \ifcsname\@nameauth@csbc!PN\endcsname
      \if@nameauth@Verbose
        \edef\@nameauth@testex
          {\csname\@nameauth@csbc!PN\endcsname}%
        \ifx\@nameauth@testex\@nameauth@Exclude
          \PackageWarning{nameauth}
          {\string\IndexRef: exclusion exists \@nameauth@Temp}%
        \else
          \PackageWarning{nameauth}
          {\string\IndexRef: xref exists \@nameauth@Temp}%
        \fi
      \fi
%    \end{macrocode}
% If no xref control sequence exists, either create a \textit{see also}
% or a \textit{see} reference. We permit the latter when a name exists
% only if the \texttt{oldsee} option is used; then issue a warning.
%
%    \begin{macrocode}
    \else
      \if@nameauth@SeeAlso
        \@nameauth@Index{\@nameauth@csbc}
          {\@nameauth@B\@nameauth@space%
           \@nameauth@C|seealso{\@nameauth@Target}}%
        \csgdef{\@nameauth@csbc!PN}{}%
      \else
        \unless\if@nameauth@OldSee
          \unless\ifcsname\@nameauth@csbc!MN\endcsname
            \unless\ifcsname\@nameauth@csbc!NF\endcsname
              \@nameauth@Index{\@nameauth@csbc}
                {\@nameauth@B\@nameauth@space%
                 \@nameauth@C|see{\@nameauth@Target}}%
              \csgdef{\@nameauth@csbc!PN}{}%
            \else
              \PackageWarning{nameauth}
              {\string\IndexRef: extant name;
               no xref \@nameauth@Temp}%
            \fi
          \else
            \PackageWarning{nameauth}
            {\string\IndexRef: extant name;
             no xref \@nameauth@Temp}%
          \fi
        \else
          \if@nameauth@Verbose
            \PackageWarning{nameauth}
            {\string\IndexRef: non-strict xref \@nameauth@Temp}%
          \fi
          \@nameauth@Index{\@nameauth@csbc}
            {\@nameauth@B\@nameauth@space%
             \@nameauth@C|see{\@nameauth@Target}}%
          \csgdef{\@nameauth@csbc!PN}{}%
        \fi
      \fi
    \fi
  }%
%    \end{macrocode}
%  Western name, without and with affix. First check if an xref or excluded.
%
%    \begin{macrocode}
  {%
    \def\@nameauth@Temp{\expandafter\detokenize\expandafter{#1 #2}}%
    \ifcsname\@nameauth@csab!PN\endcsname
      \if@nameauth@Verbose
        \edef\@nameauth@testex
          {\csname\@nameauth@csab!PN\endcsname}%
        \ifx\@nameauth@testex\@nameauth@Exclude
          \PackageWarning{nameauth}
          {\string\IndexRef: exclusion exists \@nameauth@Temp}%
        \else
          \PackageWarning{nameauth}
          {\string\IndexRef: xref exists \@nameauth@Temp}%
        \fi
      \fi
%    \end{macrocode}
% If no xref control sequence exists, either create a \textit{see also}
% or a \textit{see} reference. We permit the latter when a name exists
% only if the \texttt{oldsee} option is used; then issue a warning.
%
%    \begin{macrocode}
    \else
      \ifx\@nameauth@SB\@empty
        \if@nameauth@SeeAlso
          \@nameauth@Index{\@nameauth@csab}
            {\@nameauth@B,\@nameauth@space%
             \@nameauth@A|seealso{\@nameauth@Target}}%
          \csgdef{\@nameauth@csab!PN}{}%
        \else
          \unless\if@nameauth@OldSee
            \unless\ifcsname\@nameauth@csab!MN\endcsname
              \unless\ifcsname\@nameauth@csab!NF\endcsname
                \@nameauth@Index{\@nameauth@csab}
                  {\@nameauth@B,\@nameauth@space%
                   \@nameauth@A|see{\@nameauth@Target}}%
                \csgdef{\@nameauth@csab!PN}{}%
              \else
                \PackageWarning{nameauth}
                {\string\IndexRef: extant name;
                 no xref \@nameauth@Temp}%
              \fi
            \else
              \PackageWarning{nameauth}
              {\string\IndexRef: extant name;
               no xref \@nameauth@Temp}%
            \fi
          \else
            \if@nameauth@Verbose
              \PackageWarning{nameauth}
              {\string\IndexRef: non-strict xref \@nameauth@Temp}%
            \fi
            \@nameauth@Index{\@nameauth@csab}
              {\@nameauth@B,\@nameauth@space%
               \@nameauth@A|see{\@nameauth@Target}}%
            \csgdef{\@nameauth@csab!PN}{}%
          \fi
        \fi
%    \end{macrocode}
% When the suffix is non-empty, either create a \textit{see also}
% or a \textit{see} reference. We permit the latter when a name exists
% only if the \texttt{oldsee} option is used; then issue a warning.
%
%    \begin{macrocode}
      \else
        \if@nameauth@SeeAlso
          \@nameauth@Index{\@nameauth@csab}
            {\@nameauth@B,\@nameauth@space%
             \@nameauth@A,\@nameauth@space%
             \@nameauth@SB|seealso{\@nameauth@Target}}%
          \csgdef{\@nameauth@csab!PN}{}%
        \else
          \unless\if@nameauth@OldSee
            \unless\ifcsname\@nameauth@csab!MN\endcsname
              \unless\ifcsname\@nameauth@csab!NF\endcsname
                \@nameauth@Index{\@nameauth@csab}
                  {\@nameauth@B,\@nameauth@space%
                   \@nameauth@A,\@nameauth@space%
                   \@nameauth@SB|see{\@nameauth@Target}}%
                \csgdef{\@nameauth@csab!PN}{}%
              \else
                \PackageWarning{nameauth}
                {\string\IndexRef: extant name;
                 no xref \@nameauth@Temp}%
              \fi
            \else
              \PackageWarning{nameauth}
              {\string\IndexRef: extant name;
               no xref \@nameauth@Temp}%
            \fi
          \else
            \if@nameauth@Verbose
              \PackageWarning{nameauth}
              {\string\IndexRef: non-strict xref \@nameauth@Temp}%
            \fi
            \@nameauth@Index{\@nameauth@csab}
              {\@nameauth@B,\@nameauth@space%
               \@nameauth@A,\@nameauth@space%
               \@nameauth@SB|see{\@nameauth@Target}}%
            \csgdef{\@nameauth@csab!PN}{}%
          \fi
        \fi
      \fi
    \fi
  }%
  \@nameauth@Xreffalse%
  \if@nameauth@OldReset
    \@nameauth@SeeAlsofalse%
  \else
    \global\@nameauth@SeeAlsofalse%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ExcludeName}
% \changes{0.94}{2012/02/15}{Added}
% \changes{2.3}{2016/01/05}{New xref test}
% \changes{3.0}{2016/10/26}{Redesigned}
% \changes{3.3}{2020/02/20}{Better warnings}
% \changes{3.5}{2020/11/23}{New warnings, new exclusion test,
%   fix bug in old syntax, new logic, fix namespace}
% \changes{3.7}{2023/02/03}{Fix warnings, optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% Prevent a name from being indexed by initializing a regular
% cross-reference control sequence with the value of
% \cmd{\@nameauth@Exclude}. 
%
%    \begin{macrocode}
\NewDocumentCommand{\ExcludeName}{O{} m O{}}
{%
%    \end{macrocode}
% Process and load the arguments into the appropriate macros.
%
%    \begin{macrocode}
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\ExcludeName}%
%    \end{macrocode}
% Parse the name arguments and create an excluded xref,
% unless one already exists.
%
%    \begin{macrocode}
  \@nameauth@Choice
    {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2}}}
    {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2 #3}}}
    {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#1 #2}}}%
%    \end{macrocode}
%
% Verbose warnings say that an extant name is being excluded;
% the operation is allowed.
%
%    \begin{macrocode}
  \if@nameauth@Verbose
    \ifcsname\NameauthPattern!MN\endcsname
      \PackageWarning{nameauth}
      {\string\ExcludeName: extant name \@nameauth@Temp}%
    \fi
    \ifcsname\NameauthPattern!NF\endcsname
      \PackageWarning{nameauth}
      {\string\ExcludeName: extant name \@nameauth@Temp}%
    \fi
  \fi
%    \end{macrocode}
% One cannot exclude an extant cross-reference or exclusion.
% Verbose warnings only.
%
%    \begin{macrocode}
  \ifcsname\NameauthPattern!PN\endcsname
    \if@nameauth@Verbose
      \edef\@nameauth@testex
        {\csname\NameauthPattern!PN\endcsname}%
      \ifx\@nameauth@testex\@nameauth@Exclude
        \PackageWarning{nameauth}
        {\string\ExcludeName: exclusion exists \@nameauth@Temp}%
      \else
        \PackageWarning{nameauth}
        {\string\ExcludeName: xref exists \@nameauth@Temp}%
      \fi
    \fi
   \else
    \csxdef{\NameauthPattern!PN}{\@nameauth@Exclude}%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\IncludeName}
% \changes{3.0}{2016/10/26}{Added}
% \changes{3.3}{2020/02/20}{Added warnings}
% \changes{3.5}{2020/11/23}{New exclusion test, optimize logic,
%   fix namespace}
% \changes{3.7}{2023/02/03}{Fix warnings, optimized}
% \changes{4.0}{2024/02/09}{Combine starred, un-starred macros}
% \begin{macro}{\IncludeName*}\end{macro}\vspace{-2.7ex}
% Allow names to be included as page entries, even if they have been
% used as cross-references.
%    \begin{macrocode}
\NewDocumentCommand{\IncludeName}{s O{} m O{}}
{%
  \IfBooleanTF {#1}%
%    \end{macrocode}
% The starred form allows any name to be indexed by voiding any
% exclusion or cross-reference.
% Process and load the arguments into the appropriate macros.
% Check for errors, get the current name pattern, then nuke it.
%
%    \begin{macrocode}
  {%
    \@nameauth@LoadArgs{#2}{#3}{#4}%
    \@nameauth@Error{#3}{macro \string\IncludeName*}%
    \@nameauth@Choice{}{}{}%
    \global\csundef{\NameauthPattern!PN}%
  }%
%    \end{macrocode}
% The un-starred form allows a name to be indexed once again only if
% it had been excluded.
% Process and load the arguments into the appropriate macros.
% Get the current name type, pattern, and contents if a warning
% is needed.
%
%    \begin{macrocode}
  {%
    \@nameauth@LoadArgs{#2}{#3}{#4}%
    \@nameauth@Error{#3}{macro \string\IncludeName}%
    \@nameauth@Choice
      {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#3}}}
      {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#3 #4}}}
      {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2 #3}}}%
%    \end{macrocode}
% Test whether the name is an exclusion or a regular xref.
% If the former, delete its control sequence. If the latter,
% do nothing and issue a warning.
%
%    \begin{macrocode}
    \ifcsname\NameauthPattern!PN\endcsname
      \edef\@nameauth@testex
        {\csname\NameauthPattern!PN\endcsname}%
      \ifx\@nameauth@testex\@nameauth@Exclude
        \global\csundef{\NameauthPattern!PN}%
      \else
        \if@nameauth@Verbose
          \PackageWarning{nameauth}
          {\string\IncludeName: extant xref \@nameauth@Temp}%
        \fi
      \fi
    \fi
  }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PretagName}
% \changes{2.0}{2015/11/11}{Added}
% \changes{3.5}{2020/11/23}{New warnings, new exclusion test,
%   improve logic, fix namespace}
% \changes{3.7}{2023/02/03}{Fix warnings, optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This creates an index entry tag that is applied before a name
% by \cmd{\@nameauth@Index}.
%
%    \begin{macrocode}
\NewDocumentCommand{\PretagName}{O{} m O{} m}
{%
%    \end{macrocode}
% Process and load the arguments into the appropriate macros.
%
%    \begin{macrocode}
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\PretagName}%
%    \end{macrocode}
% Sort only when permitted.
% Get the current name type, pattern, and contents if a warning
% is needed.
%
%    \begin{macrocode}
  \if@nameauth@Pretag
  \@nameauth@Choice
    {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2}}}
    {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2 #3}}}
    {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#1 #2}}}%
%    \end{macrocode}
% Create the sort tag. Verbose warnings let us know if we are
% sorting either exclusions or cross-references.
%
%    \begin{macrocode}
    \if@nameauth@Verbose
      \edef\@nameauth@testex
        {\csname\NameauthPattern!PN\endcsname}%
      \ifx\@nameauth@testex\@nameauth@Exclude
        \PackageWarning{nameauth}
        {\string\PretagName: tag exclusion \@nameauth@Temp}%
      \else
        \PackageWarning{nameauth}
        {\string\PretagName: tag xref \@nameauth@Temp}%
      \fi
    \fi
    \csgdef{\NameauthPattern!PRE}{#4\@nameauth@Actual}%
  \else
    \PackageWarning{nameauth}
      {\string\PretagName: deactivated}%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\TagName}
% \changes{1.2}{2012/02/25}{Added}
% \changes{1.9}{2015/07/09}{Fix cs collisions}
% \changes{2.0}{2015/11/11}{Redesign tagging}
% \changes{3.5}{2020/11/23}{New warnings, new exclusion test,
%   improve logic, fix namespace}
% \changes{3.7}{2023/02/03}{Optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This creates an index entry tag for a name that is not either
% an exclusion or a cross-reference.
%
%    \begin{macrocode}
\NewDocumentCommand{\TagName}{O{} m O{} m}
{%
%    \end{macrocode}
% Process and load the arguments into the appropriate macros.
% Get the current name type, pattern, and contents if a warning
% is needed.
%
%    \begin{macrocode}
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\TagName}%
  \@nameauth@Choice
    {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2}}}
    {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2 #3}}}
    {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#1 #2}}}%
%    \end{macrocode}
% Verbose warnings let us know if we are sorting either
% exclusions or cross-references. Do not create a tag if
% that is the case; otherwise, create a tag.
%
%    \begin{macrocode}
  \ifcsname\NameauthPattern!PN\endcsname
    \if@nameauth@Verbose
      \edef\@nameauth@testex
        {\csname\NameauthPattern!PN\endcsname}%
      \ifx\@nameauth@testex\@nameauth@Exclude
        \PackageWarning{nameauth}
        {\string\TagName: no tag, exclusion \@nameauth@Temp}%
      \else
        \PackageWarning{nameauth}
        {\string\TagName: no tag, xref \@nameauth@Temp}%
      \fi
    \fi
  \else
    \csgdef{\NameauthPattern!TAG}{#4}%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \newpage
%
% \begin{macro}{\UntagName}
% \changes{1.2}{2012/02/25}{Added}
% \changes{1.9}{2015/07/09}{Global undef, no cs collisions}
% \changes{2.0}{2015/11/11}{Redesign tagging}
% \changes{3.5}{2020/11/23}{Improve logic, fix namespace}
% \changes{3.7}{2023/02/03}{Optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This deletes an index tag.
%
%    \begin{macrocode}
\NewDocumentCommand{\UntagName}{O{} m O{}}
{%
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\UntagName}%
  \@nameauth@Choice{}{}{}%
  \global\csundef{\NameauthPattern!TAG}%
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Name Tags}
%
% \begin{macro}{\NameAddInfo}
% \changes{2.4}{2016/03/15}{Added}
% \changes{3.5}{2020/11/23}{Improve logic, fix namespace}
% \changes{3.7}{2023/02/03}{Optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This creates a macro that expands to information associated with
% a given name, similar to an index tag, but usable in the body text.
%
%    \begin{macrocode}
\NewDocumentCommand{\NameAddInfo}{O{} m O{} +m}
{%
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\NameAddInfo}%
  \@nameauth@Choice{}{}{}%
  \csgdef{\NameauthPattern!DB}{#4}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NameQueryInfo}
% \changes{2.4}{2016/03/15}{Added}
% \changes{3.1}{2017/01/13}{Short macro}
% \changes{3.3}{2020/02/20}{Lock added}
% \changes{3.5}{2020/11/23}{Improve logic, fix namespace}
% \changes{3.7}{2023/02/03}{Optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This prints the information created by \cmd{\NameAddInfo} if it exists.
%
%    \begin{macrocode}
\NewDocumentCommand{\NameQueryInfo}{O{} m O{}}
{%
  \unless\if@nameauth@BigLock
    \@nameauth@LoadArgs{#1}{#2}{#3}%
    \@nameauth@Error{#2}{macro \string\NameQueryInfo}%
    \@nameauth@Choice{}{}{}%
    \ifcsname\NameauthPattern!DB\endcsname
      \csname\NameauthPattern!DB\endcsname%
    \fi
  \fi    
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NameClearInfo}
% \changes{2.4}{2016/03/15}{Added}
% \changes{3.5}{2020/11/23}{Improve logic, fix namespace}
% \changes{3.7}{2023/02/03}{Optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This deletes a text tag. It has the same structure as \cmd{\UntagName}.
%
%    \begin{macrocode}
\NewDocumentCommand{\NameClearInfo}{O{} m O{}}
{%
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\NameClearInfo}%
  \@nameauth@Choice{}{}{}%
  \global\csundef{\NameauthPattern!DB}%
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Name Decisions}
%
% \begin{macro}{\IfMainName}
% \changes{2.3}{2016/01/05}{Added}
% \changes{3.5}{2020/11/23}{Improve logic, fix namespace,
%   local or global scope}
% \changes{3.7}{2023/02/03}{Optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This macro expands one path if a main matter name exists, or else the
% other. The state of \texttt{\textbackslash if@nameauth@GlobalScope}
% determines whether or not the paths are in a local scope. First we
% load the arguments into the standard macros, check for error, and
% get the current name pattern.
%
%    \begin{macrocode}
\NewDocumentCommand{\IfMainName}{O{} m O{} +m +m}
{%
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\IfMainName}%
  \@nameauth@Choice{}{}{}%
%    \end{macrocode}
% Take this path if the pattern exists.
%
%    \begin{macrocode}
  \ifcsname\NameauthPattern!MN\endcsname
    \if@nameauth@GlobalScope #4\else {#4}\fi
  \else
%    \end{macrocode}
% Take this path if the pattern does not exist.
%
%    \begin{macrocode}
    \if@nameauth@GlobalScope #5\else {#5}\fi
  \fi
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\IfFrontName}
% \changes{2.3}{2016/01/05}{Added}
% \changes{3.5}{2020/11/23}{Improve logic, fix namespace,
%   local or global scope}
% \changes{3.7}{2023/02/03}{Optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This macro expands one path if a front matter name exists, or else the
% other. The state of \texttt{\textbackslash if@nameauth@GlobalScope}
% determines whether or not the paths are in a local scope. First we
% load the arguments into the standard macros, check for error, and
% get the current name pattern.
%
%    \begin{macrocode}
\NewDocumentCommand{\IfFrontName}{O{} m O{} +m +m}
{%
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\IfFrontName}%
  \@nameauth@Choice{}{}{}%
%    \end{macrocode}
% Take this path if the pattern exists.
%
%    \begin{macrocode}
  \ifcsname\NameauthPattern!NF\endcsname
    \if@nameauth@GlobalScope #4\else {#4}\fi
  \else
%    \end{macrocode}
% Take this path if the pattern does not exist.
%
%    \begin{macrocode}
    \if@nameauth@GlobalScope #5\else {#5}\fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\IfAKA}
% \changes{2.3}{2016/01/05}{Added}
% \changes{2.4}{2016/03/15}{Test for excluded}
% \changes{3.0}{2016/10/26}{Redesigned}
% \changes{3.5}{2020/11/23}{New exclusion test, optimize logic,
%   fix namespace, local or global scope}
% \changes{3.7}{2023/02/03}{Optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This macro expands one path if a cross-reference exists, another if
% it does not exist, and a third if it is excluded. The state of
% \texttt{\textbackslash if@nameauth@GlobalScope} determines whether or not
% the paths are in a local scope. First we load the arguments into
% the standard macros, check for error, and get the current name pattern.
%
%    \begin{macrocode}
\NewDocumentCommand{\IfAKA}{O{} m O{} +m +m +m}
{%
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\IfAKA}%
  \@nameauth@Choice{}{}{}%
  \ifcsname\NameauthPattern!PN\endcsname
    \edef\@nameauth@testex
      {\csname\NameauthPattern!PN\endcsname}%
%    \end{macrocode}
% Take this path if the pattern is an exclusion.
%
%    \begin{macrocode}
    \ifx\@nameauth@testex\@nameauth@Exclude
      \if@nameauth@GlobalScope #6\else {#6}\fi
    \else
%    \end{macrocode}
% Take this path if the pattern exists.
%
%    \begin{macrocode}
      \if@nameauth@GlobalScope #4\else {#4}\fi
    \fi
  \else
%    \end{macrocode}
% Take this path if the pattern does not exist.
%
%    \begin{macrocode}
    \if@nameauth@GlobalScope #5\else {#5}\fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ForgetName}
% \changes{1.9}{2015/07/09}{Global undef}
% \changes{2.3}{2016/01/05}{Global or local}
% \changes{3.5}{2020/11/23}{Improve logic, fix namespace}
% \changes{3.7}{2023/02/03}{Optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This undefines a control sequence to force a ``first use''.
%
%    \begin{macrocode}
\NewDocumentCommand{\ForgetName}{O{} m O{}}
{%
%    \end{macrocode}
% Process and load the arguments into the appropriate macros.
%
%    \begin{macrocode}
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\ForgetName}%
%    \end{macrocode}
% Now we parse the arguments, destroying the control sequences either
% by current name system type or completely. |@nameauth@LocalNames| toggles
% current system or both, while we select the type of name with
% |@nameauth@MainFormat|.
%
%    \begin{macrocode}
  \@nameauth@Choice{}{}{}%
  \if@nameauth@LocalNames
    \if@nameauth@MainFormat
      \global\csundef{\NameauthPattern!MN}%
    \else
      \global\csundef{\NameauthPattern!NF}%
    \fi
  \else
    \global\csundef{\NameauthPattern!MN}%
    \global\csundef{\NameauthPattern!NF}%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\SubvertName}
% \changes{0.9}{2012/02/10}{Added}
% \changes{2.3}{2016/01/05}{Global or local}
% \changes{3.1}{2017/01/13}{Fix old syntax}
% \changes{3.5}{2020/11/23}{Improve logic, fix namespace}
% \changes{3.7}{2023/02/03}{Optimized}
% \changes{4.0}{2024/02/09}{Use \textsf{xparse}}
% This defines a control sequence to force a ``subsequent use''.
%
%    \begin{macrocode}
\NewDocumentCommand{\SubvertName}{O{} m O{}}
{%
  \@nameauth@LoadArgs{#1}{#2}{#3}%
  \@nameauth@Error{#2}{macro \string\SubvertName}%
%    \end{macrocode}
% Now we parse the arguments, defining the control sequences either
% by current name system type or completely. |@nameauth@LocalNames| toggles
% current system or both, while we select the type of name with
% |@nameauth@MainFormat|.
%
%    \begin{macrocode}
  \@nameauth@Choice{}{}{}%
  \if@nameauth@LocalNames
    \if@nameauth@MainFormat
      \csgdef{\NameauthPattern!MN}{}%
    \else
      \csgdef{\NameauthPattern!NF}{}%
    \fi
  \else
    \csgdef{\NameauthPattern!MN}{}%
    \csgdef{\NameauthPattern!NF}{}%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \newpage
%
% \subsubsection{Pseudonyms}
%
% \begin{macro}{\AKA}
% \changes{1.26}{2012/04/24}{Fix affixes}
% \changes{1.5}{2013/02/22}{Reversing/caps}
% \changes{2.0}{2015/11/11}{Trim spaces; fix tags}
% \changes{2.1}{2015/11/24}{Fix Unicode}
% \changes{2.3}{2016/01/05}{Fix starred mode}
% \changes{2.41}{2016/03/17}{Fix token regs}
% \changes{2.6}{2016/09/19}{Fix index commas}
% \changes{3.0}{2016/10/26}{Redesigned}
% \changes{3.1}{2017/01/13}{Can skip index}
% \changes{3.3}{2020/02/20}{Global flag reset}
% \changes{3.5}{2020/11/23}{Fix namespace}
% \changes{4.0}{2024/02/09}{Combine starred, un-starred macros}
% \begin{macro}{\AKA*}\end{macro}\vspace{-2.7ex}
% \cmd{\AKA} prints an alternate name and creates index cross-references.
% The starred form displays the alternate name like \cmd{\FName}.
%
%    \begin{macrocode}
\NewDocumentCommand{\AKA}{s O{} m O{} m O{}}
{%
%    \end{macrocode}
% Prevent entering \cmd{\AKA} via itself or \cmd{\@nameauth@Name}.
%  Prevents and resets \cmd{\JustIndex}. Tell the formatting system
%  that \cmd{\AKA} is running.
%
%    \begin{macrocode}
  \if@nameauth@BigLock
    \@nameauth@Locktrue%
  \fi
  \IfBooleanTF {#1}{\@nameauth@AltAKAtrue}{}%
  \unless\if@nameauth@Lock
    \@nameauth@Locktrue%
    \@nameauth@InAKAtrue%
    \if@nameauth@OldReset
      \@nameauth@JustIndexfalse%
    \else
      \global\@nameauth@JustIndexfalse%
    \fi
%    \end{macrocode}
% Test for malformed input.
%
%    \begin{macrocode}
    \@nameauth@Error{#3}{macro \string\AKA}%
    \@nameauth@Error{#5}{macro \string\AKA}%
%    \end{macrocode}
% Names occur in horizontal mode; we ensure that. Next we make copies
% of the target name arguments and we parse and print the cross-reference name.
%
%    \begin{macrocode}
    \leavevmode\hbox{}%
    \protected@edef\@nameauth@Ai{\trim@spaces{#2}}%
    \protected@edef\@nameauth@Bi{\@nameauth@Root{#3}}%
    \protected@edef\@nameauth@Si{\@nameauth@Suffix{#3}}%
    \@nameauth@Parse{#4}{#5}{#6}{!PN}%
%    \end{macrocode}
% \noindent Create an index cross-reference based on the arguments.
%
%    \begin{macrocode}
    \unless\if@nameauth@SkipIndex
      \ifx\@nameauth@Ai\@empty
        \ifx\@nameauth@Si\@empty
          \IndexRef[#4]{#5}[#6]{\@nameauth@Bi}%
        \else
          \IndexRef[#4]{#5}[#6]
          {\@nameauth@Bi\@nameauth@space\@nameauth@Si}%
        \fi
      \else
        \ifx\@nameauth@Si\@empty
          \IndexRef[#4]{#5}[#6]
          {\@nameauth@Bi,\@nameauth@space\@nameauth@Ai}%
        \else
          \IndexRef[#4]{#5}[#6]
          {\@nameauth@Bi,\@nameauth@space
           \@nameauth@Ai,\@nameauth@space\@nameauth@Si}%
        \fi
      \fi
    \fi
%    \end{macrocode}
% Reset all the ``per name'' Boolean values. The default is global.
%
%    \begin{macrocode}
    \@nameauth@Flags%
    \@nameauth@Lockfalse%
    \@nameauth@InAKAfalse%
%    \end{macrocode}
% Close the ``locked'' branch and call the full stop detection.
% This conditional statement must be on one line.
%
%    \begin{macrocode}
  \fi
  \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PName}
% \changes{2.3}{2016/01/05}{Work with hooks}
% \changes{3.1}{2017/01/13}{Can skip index}
% \changes{3.5}{2020/11/23}{Warning and flag resets added}
% \changes{3.7}{2023/02/03}{Fix warnings}
% \changes{4.0}{2024/02/09}{Combine starred, un-starred macros}
% \begin{macro}{\PName*}\end{macro}\vspace{-2.7ex}
% \cmd{\PName} is a convenience macro that calls \cmd{\NameauthName}, then \cmd{\AKA}. Its starred form prints a long name.
%
%    \begin{macrocode}
\NewDocumentCommand{\PName}{s O{} m O{} m O{}}
{%
%    \end{macrocode}
% If we have a starred form, we will display a long name.
% If we used \cmd{\JustIndex}, we ignore and reset its flag to false.
%
%    \begin{macrocode}
  \IfBooleanTF {#1}{\@nameauth@FullNametrue}{}%
  \if@nameauth@OldReset
    \@nameauth@JustIndexfalse%
  \else
    \global\@nameauth@JustIndexfalse%
  \fi
%    \end{macrocode}
% If we used \cmd{\SkipIndex}, we reset the flag of \cmd{\SeeAlso} and
% activate \cmd{\SkipIndex} for both \cmd{\NameauthName} and \cmd{\AKA}.
%
%    \begin{macrocode}
  \if@nameauth@SkipIndex
    \unless\if@nameauth@OldReset
      \global\@nameauth@SeeAlsofalse%
    \fi
    \NameauthName[#2]{#3} (\SkipIndex\AKA[#2]{#3}[#4]{#5}[#6])%
  \else
%    \end{macrocode}
% Otherwise, if we used \cmd{\SeeAlso} we set the flag of \cmd{\SeeAlso}
% false for \cmd{\NameauthName} and true for \cmd{\AKA}. The ``normal''
% case after that is trivial.
%
%    \begin{macrocode}
    \if@nameauth@SeeAlso
      \@nameauth@SeeAlsofalse\NameauthName[#2]{#3}
      \@nameauth@SeeAlsotrue(\AKA[#2]{#3}[#4]{#5}[#6])%
    \else
      \NameauthName[#2]{#3}
      (\AKA[#2]{#3}[#4]{#5}[#6])%
    \fi
  \fi
%    \end{macrocode}
% Warn if \cmd{\SkipIndex} remains in effect (potentially due to
% the \texttt{oldreset} option). Normally, this state should not occur.
%
%    \begin{macrocode}
  \if@nameauth@SkipIndex
    \PackageWarning{nameauth}
    {\string\SkipIndex still active after \string\PName; check}%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \Finale
% \endinput
%</package>
%<*compat>
%<<compatvb

% This is not a standalone document.
% Use this file only in the document preamble.

\makeatletter

% Do not include the rest of this file
% unless we are in a document preamble.

\ifx\@onlypreamble\@notprerr\else

% Check against the latex version date. Create a macro
% if the date is at least 2018/10/05 because that is
% when Unicode processing changed for the better.

  \@ifl@t@r\fmtversion{2018/10/05}{\def\nameauthltx{}}{}

% Here we check for 2018/04/30 because that is when xparse
% added the ! modifier.

  \@ifl@t@r\fmtversion{2018/04/30}{\def\nameauthxp{}}{}

% Here we assist backward compatibility for older
% distributions of LaTeX and compatibility for multiple
% LaTeX engines. 

% If we want to use TikZ, this flag will help us.

  \newif\ifDoTikZ

% If we couch this statement in a conditional, we avoid
% potential errors in older versions.

  \IfFileExists{iftex.sty}{\usepackage{iftex}}{}

% The presence of \RequireTUTeX means that these older
% packages are not needed (thanks to iftex). Otherwise
% we are using an older version and need these packages.

  \unless\ifdefined\RequireTUTeX
    \usepackage{ifxetex}
    \usepackage{ifluatex}
    \usepackage{ifpdf}
  \fi

% Instead of worrying about older or newer changes, we
% ensure consistency when the LaTeX engine changes.
% The goal is to get the same ``lmodern'' look.
% Users will need to change language and font options
% for their own needs.

  \ifxetex
    \usepackage{fontspec}
    \usepackage{polyglossia}
    \setdefaultlanguage{american}
    \DoTikZtrue % Loading TikZ will work (pdf)
  \else
    \ifluatex
      \ifpdf
        \usepackage{fontspec}
        \usepackage{polyglossia}
        \setdefaultlanguage{american}
        \DoTikZtrue % Loading TikZ will work (pdf)
      \else
        \IfFileExists{utf8-2018.def}{}
        {\usepackage[utf8]{inputenc}}
        \usepackage[TS1,T1]{fontenc}
        \usepackage[american]{babel}
        \usepackage{lmodern}
        % Using dvi-based workflows does not
        % work well with TikZ; pstricks instead
      \fi
    \else
      \IfFileExists{utf8-2018.def}{}
      {\usepackage[utf8]{inputenc}}
      \usepackage[TS1,T1]{fontenc}
      \usepackage[american]{babel}
      \usepackage{lmodern}
      \ifpdf
        \usepackage{tikz}
        \DoTikZtrue % Loading TikZ will work (pdf)
      \fi
      % Using dvi-based workflows does not
      % work well with TikZ; pstricks instead
    \fi
  \fi

% Here one would load TikZ if needed
% \ifDoTikZ \usepackage{tikz} \fi

\fi

\makeatother
%compatvb
%</compat>
%<*examples>
%<<examplesvb

\documentclass[oneside]{article}

\input{compat.tex} % Included with nameauth; needed only if
% compiling on multiple TeX distros or LaTeX engines.

\usepackage[textwidth=137mm,textheight=237mm,
            right=40mm,marginparwidth=40mm]{geometry}

\usepackage{makeidx} % Must have for defining \seealso macro.
\usepackage{index}

\usepackage[oldargs]{nameauth}[2024/02/09]

\usepackage[inline]{enumitem}
\usepackage{fancyvrb}

% Define fancyvrb defaults.
\fvset{gobble=2,numbers=left,fontsize=\small}

\usepackage{xcolor}
\usepackage[colorlinks=true]{hyperref}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set up indexing and put margin paragraphs on the left.
%
\makeindex
\newindex{per}{rdx}{rnd}{Index of Persons}
\renewcommand\NameauthIndex{\index[per]}
\reversemarginpar
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Global definitions of conditionals for examples and
% Global definitions of macros for examples could occur
% here, but we put those instead in the sections where
% they appear.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create name shorthands. Note the use of \noexpand
% in the macro arguments below.
%
\begin{nameauth}
  \< Doug   & Frederick & Douglass &        >
  \< Bailey & Betsey    & Bailey   &        >
\end{nameauth}

\begin{nameauth}
  \< Wash & George & Washington & >
  \< Aris & & Aristotle & >
  \< Plato & & Plato & >
  \< Aeth & & Æthelred, II & >
  \< Sun & & Sun, Yat-sen & >
  \< Linc & Abraham & Lincoln & >
  \< MLK & Martin Luther & King, Jr. & >
  \< Soto & Hernando & de Soto & >
  \< Goethe & J.W. von & Goethe & >
  \< Patton & George S. & Patton, Jr. & >
  \< Ike & Dwight D. & Eisenhower & >
\end{nameauth}

\begin{nameauth}
  \< Luth & Martin & \noexpand\textSC{Luther} & >
  \< Cath & Catherine \noexpand\AltCaps{d}e'
          & \noexpand\textSC{Medici} & >
\end{nameauth}

\begin{nameauth}
  \< Jeff & Thomas &
     \noexpand\textSC{Jefferson}\noexpand\GEN{} & >
\end{nameauth}

\begin{nameauth}
  \< Scipio & \noexpand\SCIPi & \noexpand\SCIPii & >
  \< TGrac & \noexpand\TSemp & Gracchus & >
\end{nameauth}

\begin{nameauth}
  \< OScipio & Lucius & \noexpand\CSB & > % O for Oxford
\end{nameauth}

\begin{nameauth}
  \< Shak & \noexpand\WM & \noexpand\SHK & >
\end{nameauth}

\begin{nameauth}
  \< deSmet & Pierre-Jean &
     \noexpand\Fbox{\noexpand\AltCaps{d}e~Smet} & >
\end{nameauth}

%
% We could add name info database tags (text tags) either
% in the preamble or in the document environment. We will do
% the latter in this example file.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Below we establish sort tags for names.
%
%  Sort these names under: US Presidents.
\PretagName[George]{Washington}{US Presidents!Washington, George}
\PretagName[Abraham]{Lincoln}{US Presidents!Lincoln, Abraham}

%  Sort these names under: Philosophers.
\PretagName{Aristotle}{Philosophers!Aristotle}
\PretagName{Plato}{Philosophers!Plato}

%  Sort these names under: Black Americans, famous.
\PretagName[Frederick]{Douglass}
  {Black Americans, famous!Douglass, Frederick}
\PretagName[Betsey]{Bailey}
  {Black Americans, famous!Bailey, Betsey}
\PretagName[Martin Luther]{King, Jr.}
  {Black Americans, famous!King, Martin Luther, Jr.}

%  Sort these names under: Europeans, historical.
\PretagName{Æthelred, II}{Europeans, historical!Aethelred 2}
\PretagName[Hernando]{de Soto}
  {Europeans, historical!de Soto, Hernando}

\PretagName{Vlad, Ţepeş}{Vlad Tepes} % for accented names

\PretagName[Konrad]{\noexpand\textSC{Zuse}}{Zuse, Konrad}
\PretagName[Ada]{\noexpand\textIT{Lovelace}}{Lovelace, Ada}
\PretagName[Charles]{\noexpand\textBF{Babbage}}
  {Babbage, Charles}
\PretagName{\noexpand\textUC{Kanade}, Takeo}{Kanade Takeo}

\PretagName[Martin]{\noexpand\textSC{Luther}}{Luther, Martin}
\PretagName[Catherine \noexpand\AltCaps{d}e']
           {\noexpand\textSC{Medici}}{Medici, Catherine de}

\PretagName[Thomas]{\noexpand\textSC{Jefferson}\noexpand\GEN{}}
  {Jefferson, Thomas}

\PretagName[Greta]{\noexpand\textSC{Garbo}}{Garbo, Greta}
\PretagName{\noexpand\textSC{Misora}, Hibari}{Misora Hibari}
\PretagName[Heinz]{\noexpand\textSC{R\"uhmann}}{Ruehmann, Heinz}
\PretagName[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}}
  {Ruehmann, Heinrich Wilhelm}

\PretagName[\noexpand\SCIPi]{\noexpand\SCIPii}
  {Scipio Africanus}
\PretagName[\noexpand\TSemp]{Gracchus}
  {Gracchus, Tiberius Sempronius}

\PretagName[Lucius]{\noexpand\CSB}{Cornelius Scipio Barbatus}

\PretagName[\noexpand\WM]{\noexpand\SHK}
  {Shakespeare, William}
\PretagName[Robert]{\textSC{Burns}}{Burns, Robert}

\PretagName[Pierre-Jean]%
  {\noexpand\Fbox{\noexpand\AltCaps{d}e~Smet}}%
  {de~Smet, Pierre-Jean}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Below we establish some index tags for names.
%
\TagName[George S.]{Patton, Jr.}{, general}
\TagName{Vlad, II}{ Dracul}
\TagName{Vlad, III}{ Dracula}
\IndexRef{Dracula}{Vlad III}
\TagName[Thomas]{\noexpand\textSC{Jefferson}\noexpand\GEN{}}
  {, pres.}
\TagName[\noexpand\TSemp]{Gracchus}{, consul}
\TagName[Lucius]{\noexpand\CSB}{, consul}

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

\title{\bfseries Some Examples}
\author{Charles P. Schaum}
\date{2024/02/09}

\begin{document}
\maketitle

\phantomsection
\pdfbookmark[1]{\contentsname}{toc}
\tableofcontents
\newpage

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Minimal Example}

\textbf{Group 1}\\
\begin{enumerate*}
  \item[\textbf{1.}] \Doug\ rose to eminence by sheer force
    of character and talents that neither slavery nor caste
    proscription could crush.
  \item[\textbf{2.}] \Doug's early life is perhaps the most
    complete indictment of the slave system ever presented at
    the bar of public opinion.
  \item[\textbf{3.}] \Doug\ was born in February, l8l7. His
    earliest memories centered around the cabin of his
    grandmother, \Bailey.
\end{enumerate*}

\medskip\noindent\textbf{Group 2}\\
\ForgetName[Frederick]{Douglass}
\ForgetName[Betsey]{Bailey}
\begin{enumerate*}
  \item[\textbf{2.}] \Doug's early life is perhaps the most
    complete indictment of the slave system ever presented at
    the bar of public opinion.
  \item[\textbf{3.}] \Doug\ was born in February, l8l7. His
    earliest memories centered around the cabin of his
    grandmother, \Bailey.
  \item[\textbf{1.}] \Doug\ rose to eminence by sheer force
    of character and talents that neither slavery nor caste
    proscription could crush.
\end{enumerate*}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Multiple Indexes}

The Electric Boogaloo\index{Boogaloo, Electric}\\ %  main index
was created by \Name{Ollie~\& Jerry}.             %  name index
\index{indexes, multiple}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Index Categories}

\subsection{Famous Black Americans}

\ForgetThis\Name[Frederick]{Douglass} rose to eminence by sheer
force of character and talents that neither slavery nor caste
proscription could crush. Circumstances made
\Name[Frederick]{Douglass} a slave, but they could not prevent
him from becoming a freeman and a leader among mankind.\\
We also celebrate \MLK, then \MLK.

\subsection{Patres Patriae}

We mention President \Wash; again, \Wash.
Family and close friends called him \SWash.%
\TagName[George]{Washington}{!as general}
We reminisce about \LWash[General].%
\UntagName[George]{Washington}
When speaking of \Linc, we can refer to \LLinc[Abe].

\subsection{Philosophers}

Among philosophers we consider \Plato\ and \Aris.

\subsection{Historical Figures}

We ponder about \Aeth, then \Aeth.
We speak of \Sun, then \Sun.
We note \Soto, then just \Soto.
\CapThis\Soto{} starts a sentence.

\subsection{Further Discussion}

\TagName[George]{Washington}{!as general}
\TagName[Dwight D.]{Eisenhower}{!as general}
\LWash, \LPatton, and \LIke\ were high-ranking generals.%
\TagName[Dwight D.]{Eisenhower}{!as president}
\UntagName[George]{Washington}%
\Wash\ and \Ike\ also were US presidents.

\small
% Instead of pre-tagging Ike we do the following:
\index[per]{US Presidents!other|see{Eisenhower, Dwight D., president}}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{More Complex Hooks}

% First save main- and front-matter hooks. Then change
% first-use hooks for both main matter and front matter.
\let\OldFormat\NamesFormat
\let\OldFrontNames\FrontNamesFormat

\renewcommand*\NamesFormat[1]{\textbf{#1}\unless\ifinner
   \marginpar{\raggedleft\scriptsize #1}\fi}
\renewcommand*\FrontNamesFormat[1]{\textit{#1}\unless\ifinner
   \marginpar{\raggedleft\scriptsize #1}\fi}
\index{complex hooks, intro}

The new format (front matter):\NamesInactive

\Name{Vlad, III}[III Dracula], known as
\IndexRef{Vlad, Ţepeş}{Vlad III}
\SubvertThis\Name*{Vlad, Ţepeş}
(\Name*{Vlad, Ţepeş}[the Impaler])
after his death, was the son of \Name{Vlad, II}[II Dracul],
a member of the Order of the Dragon. Later instances of
``\Name*{Vlad, III}'' and ``\Name{Vlad, III}'' appear thus.

The new format (main matter):\NamesActive

\Name{Vlad, III}[III Dracula], known as
\IndexRef{Vlad, Ţepeş}{Vlad III}
\SubvertThis\Name*{Vlad, Ţepeş}
(\Name*{Vlad, Ţepeş}[the Impaler])
after his death, was the son of \Name{Vlad, II}[II Dracul],
a member of the Order of the Dragon. Later instances of
``\Name*{Vlad, III}'' and ``\Name{Vlad, III}'' appear thus.

\let\NamesFormat\OldFormat
\let\FrontNamesFormat\OldFrontNames

We are back in the old format.

in the front matter we see: \NamesInactive
\ForgetThis\Name{Vlad, III}[III Dracula],
\Name*{Vlad, III}, and  \Name{Vlad, III}.

in the main matter we see: \NamesActive
\ForgetThis\Name{Vlad, III}[III Dracula],
\Name*{Vlad, III}, and  \Name{Vlad, III}.

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Life Dates in Hooks}

% Add name tags to names.
\NameAddInfo[George]{Washington}{ (1732--99)}
\NameAddInfo[Mustafa]{Kemal}{ (1881--1938)}
\NameAddInfo{Atat\"urk}{ (in 1934, a special surname)}

% Ensure that Atat\"urk is a cross-reference that
% has no page entries in the index.
\IndexRef{Atat\"urk}{Kemal, Mustafa}

% Manually suppress name tag in ``first'' instance
\newif\ifNoTag

% Redesign formatting hook to usually print a tag
% only in ``first'' instance. On exit, It resets
% the flag that suppresses tags, making that flag
% work only once per name use.

\renewcommand*\NamesFormat[1]
{%
  #1%
  \ifcsname\NameauthPattern!DB\endcsname
    \unless\ifNoTag
      \expandafter\csname\NameauthPattern!DB\endcsname%
    \fi
    \global\NoTagfalse%
  \fi
}

\ForgetThis\Name[George]{Washington} held office as the first US
president from 1789 to 1797. \Name[George]{Washington} was the only
president whose term in office was completely in the eighteenth
century. If we need to trigger the first use hook at some point,
we can suppress dates and get an automatic long instance via:
\NoTagtrue\ForgetThis\Name[George]{Washington}. Or we can trigger
the first-use hook in a subsequent name use and still have dates:
\ForceName\Name[George]{Washington}.
\index{life dates}

We can add name info tags to names used only as cross-
references. For example, \Name[Mustafa]{Kemal} was granted
the name \Name{Atat\"urk}. We mention \Name[Mustafa]{Kemal}
and \Name{Atat\"urk} again. Likewise, we can trigger a
first use, but with no name tag tag:
\NoTagtrue\ForgetThis\Name{Atat\"urk}.

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Alternate Formatting}

\AltFormatActive
\renewcommand*\NamesFormat{}
\renewcommand*\MainNameHook{\AltOff}

\noindent
\ForgetThis\Name[Konrad]{\noexpand\textSC{Zuse}};
\Name[Konrad]{\noexpand\textSC{Zuse}}\\
\ForgetThis\Name[Ada]{\noexpand\textIT{Lovelace}};
\Name[Ada]{\noexpand\textIT{Lovelace}}\\
\ForgetThis\Name[Charles]{\noexpand\textBF{Babbage}};
\Name[Charles]{\noexpand\textBF{Babbage}}\\
\ForgetThis\Name{\noexpand\textUC{Kanade}, Takeo};
\Name{\noexpand\textUC{Kanade}, Takeo}
\index{formatting, alternate}

\renewcommand*\MainNameHook{\sffamily\AltOff}

\ForgetThis\Luth\ was a leading figure in the Protestant
Reformation. \Luth\ believed that one is declared
righteous in a forensic sense by divine grace through faith
created by the Holy Spirit via the Gospel and the Sacraments.

\ForgetThis\Cath\ was not only Queen of France in her own right,
but she also guided the reigns of her three sons.
\CapThis\LCath[\noexpand\AltCaps{d}e']
was blamed for the St.\ Bartholomew's Day massacre that saw the
murder of thousands of Huguenots.
\index{formatting, alternate}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Grammatical Inflections in Names}

\newif\ifGenitive
\newif\ifDoGenitive

\newcommand*\GEN{\ifDoGenitive\textSC{'s}\fi}

\renewcommand*\NamesFormat[1]
  {\ifGenitive\DoGenitivetrue\fi#1\global\Genitivefalse}
\renewcommand*\MainNameHook[1]
  {\ifGenitive\DoGenitivetrue\fi\AltOff#1\global\Genitivefalse}

Consider \Genitivetrue\Jeff\ legacy as the author of the
colonies' Declaration of Independence and his impact as third
president of the United States. \Jeff\ was a complex historical
figure whose actions defy a consistent moral compass both in
public policy and in personal affairs.
\index{inflections, grammatical}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Sample Reference Work I}

% Make a cross-reference from a variant name form to the
% form of the head-words

\IndexRef[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}}
  {\noexpand\textSC{R\"uhmann}, Heinz}

% Define the formatting hooks. Since we use the `altformat'
% option, alternate formatting is turned off in later
% name uses.

\renewcommand*\NamesFormat{}
\renewcommand*\MainNameHook{\AltOff}

% Typeset head-words with a slanted font.

\newcommand{\RefArticle}[3]
{%
  \def\check{#2}%
  \ifx\check\empty
    \noindent\ForgetThis\textsl{#1}\ #3
  \else
    \noindent\ForgetThis\textsl{#1}\ #2\ #3
  \fi\medskip
}

\index{reference work}
\RefArticle
  {\RevComma\Name[Greta]{\noexpand\textSC{Garbo}}}
  {}
  {(18 September 1905\,--\,15 April 1990) was a Swedish
   film actress during the 1920s and 1930s.
   \Name[Greta]{\noexpand\textSC{Garbo}}\dots}

\RefArticle
  {\Name{\noexpand\textSC{Misora}, Hibari}}
  {(W:\,``\RevName\Name*{\noexpand\textSC{Misora}, Hibari}'';}
  {29 May 1937\,--\,24 June 1989) was a Japanese singer
   and actress noted for her positive message.
   \Name{\noexpand\textSC{Misora}, Hibari}\dots}

\RefArticle
  {\RevComma\Name[Heinz]{\noexpand\textSC{R\"uhmann}}}
  {(\SubvertThis\ForceName
    \FName[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}};}
  {7 March 1902\,--\,3 October 1994) was a German actor
   in over 100 films.
   \Name[Heinz]{\noexpand\textSC{R\"uhmann}}\dots}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Roman Names: Student Reference}

% Global Boolean flags need to be defined only once.
\newif\ifNoPraenomen
\newif\ifNoCognomen
\newif\ifNoGens
\newif\ifNoAgnomen

% Local Boolean flags need to be defined only once.
\newif\ifXPrae
\newif\ifXCogn
\newif\ifXGens
\newif\ifXAgno

% Name variant macros need to be defined uniquely for each
% name. First is Scipio. Second is Gracchus.

\newcommand*\SCIPi
{%
  \ifXGens Publius\else
    \ifXPrae Cornelius\else
      Publius Cornelius%
    \fi
  \fi
}

\newcommand*\SCIPii
{%
  \ifXAgno Scipio\else
    Scipio Africanus%
  \fi
}

\newcommand*\TSemp
{%
  \ifXGens Tiberius\else
    \ifXPrae Sempronius\else
      Tiberius Sempronius%
    \fi
  \fi
}

% We add the name tag.
\NameAddInfo[\noexpand\TSemp]{Gracchus}
  { (consul, 177 \textsc{bc})}

% Although it is helpful to set everything up
% In the preamble, it is not absolutely necessary.
% Here we define the simpler set of formatting hooks
% for Scipio, although the complex hooks will work
% for both equally as well.

\renewcommand*\NamesFormat[1]
{%
  \ifNoPraenomen\XPraetrue\fi%
  \ifNoGens\XGenstrue\fi%
  \ifNoCognomen\XCogntrue\fi%
  \ifNoAgnomen\XAgnotrue\fi%
  #1%
  \global\NoPraenomenfalse%
  \global\NoGensfalse%
  \global\NoCognomenfalse%
  \global\NoAgnomenfalse%
}

\renewcommand*\MainNameHook[1]
{%
  \ifNoPraenomen\XPraetrue\fi%
  \ifNoGens\XGenstrue\fi%
  \ifNoCognomen\XCogntrue\fi%
  \ifNoAgnomen\XAgnotrue\fi%
  #1%
  \global\NoPraenomenfalse%
  \global\NoGensfalse%
  \global\NoCognomenfalse%
  \global\NoAgnomenfalse%
}

\index{Roman names, student}
\NoAgnomentrue\Scipio\ was born around 236 \textsc{bc}
into the Scipiones branch of the Cornelii clan.
\NoAgnomentrue\Scipio\ rose to military fame during the
Second Punic War. Thereafter he was known as \Scipio.
He flourished during the Egyptian reigns of
\Name{Ptolemy, IV}[IV Philopator] and
\Name{Ptolemy, V}[V Epiphanes], and the Syrian
reigns of \Name{Seleucus, III}[III Ceraunus] and
\Name{Antiochus, III}[III the Great].

% We make no change to \MainNameHook, but we do
% change \NamesFormat to display any extant
% name tags.

\renewcommand*\NamesFormat[1]
{%
  \ifNoPraenomen\XPraetrue\fi%
  \ifNoGens\XGenstrue\fi%
  \ifNoCognomen\XCogntrue\fi%
  \ifNoAgnomen\XAgnotrue\fi%
  #1%
  \ifcsname\NameauthPattern!DB\endcsname
    \expandafter\csname\NameauthPattern!DB\endcsname%
  \fi
  \global\NoPraenomenfalse%
  \global\NoGensfalse%
  \global\NoCognomenfalse%
  \global\NoAgnomenfalse%
}

\TGrac\ served as tribune of the plebs in 184 \textsc{bc}.
\TGrac\ was elected praetor for 180 \textsc{bc},
after which he was appointed governor of Hispania Citerior,
serving with the rank of proconsul. In 177 \textsc{bc},
he was elected consul, again in 163 \textsc{bc}.

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Roman Names: Scholarly Work}

% Name variant macros need to be defined
% uniquely for each name.

\newcommand*\CSB
{%
  \ifXGens
    \ifXAgno Scipio\else
      Scipio Barbatus\fi
  \else
    \ifXCogn Cornelius\else
      \ifXAgno Cornelius Scipio\else
        Cornelius Scipio Barbatus%
      \fi
    \fi
  \fi
}

\index{Roman names, scholar}
\OScipio\ was born around 337 \textsc{bc} into the
Scipiones branch of the Cornelii clan, one of the large
patrician clans. \NoGenstrue\NoAgnomentrue\OScipio\ was
one of the two elected consuls in 298 \textsc{bc}
and served during the Third Samnite War.

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Reference Work II}

% Boolean flags; the first sets up headwords and the second
% indicates that a nonwestern form should not be reversed.
\newif\ifHeadword
\newif\ifAncientName

% Sorting and tagging the names:

% Adding name information:
\NameAddInfo{Aristotle}{ (384--322 \textsc{bc})}
\NameAddInfo[Charles]{\noexpand\textBF{Babbage}}{ (1791--1871)}
\NameAddInfo{\noexpand\textUC{Kanade}, Takeo}{ (1945-- )}
\NameAddInfo[Ada]{\noexpand\textIT{Lovelace}}
 { (Augusta Ada King, Countess of Lovelace
   [née Byron]; 1815--52)}

% Redefining the formatting hooks:
\makeatletter
\renewcommand\NamesFormat[1]
{%
  \ifHeadword
    \ifNameauthWestern
      \@nameauth@RevThisCommatrue%
      \bfseries \NameParser%
      \normalfont%
      \ifcsname\NameauthPattern!DB\endcsname
        \expandafter\csname\NameauthPattern!DB\endcsname%
      \fi
    \else
      \bgroup%
        \bfseries \NameParser%
        \unless\ifAncientName
          \normalfont; W:\AltOff\space
          \@nameauth@RevThistrue \NameParser%
        \fi
        \normalfont%
        \ifcsname\NameauthPattern!DB\endcsname
          \expandafter\csname\NameauthPattern!DB\endcsname%
        \fi
      \egroup%
    \fi
  \else
    \NameParser%
  \fi
  \global\Headwordfalse%
  \global\AncientNamefalse%
}
\makeatother
\renewcommand\MainNameHook{\AltOff}

% Define related macros:
\newcommand\Headword{\Headwordtrue\ForgetThis}
\renewcommand{\RefArticle}[2]
{%
  \noindent\Headword #1 #2%
}
\index{reference work}

\RefArticle{\AncientNametrue\Name{Aristotle}}{was the first to offer
a system of logic, most notably syllogistic logic, that would
become the basis for discrete states and circuitry of
digital computers. \Name{Aristotle}\dots}

\RefArticle{\Name[Charles]{\noexpand\textBF{Babbage}}}{designed and
built the Difference Engine and began work on the Analytical
Engine. \Name[Charles]{\noexpand\textBF{Babbage}}\dots}

\RefArticle{\Name{\noexpand\textUC{Kanade}, Takeo}}{is one of the
foremost pioneers in the field of computer vision.
\Name{\noexpand\textUC{Kanade}, Takeo}\dots}

\RefArticle{\Name[Ada]{\noexpand\textIT{Lovelace}}}{collaborated with
\Name*[Charles]{\noexpand\textBF{Babbage}}* and wrote what some
consider to be the first computer program for the Analytical
Engine. \Name[Ada]{\noexpand\textIT{Lovelace}}\dots}
\index{reference work}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Marginalia}

% Global Boolean flags need to be defined only once.
\newif\ifSpecialFN
\newif\ifSpecialSN
\newif\ifRevertSN

% Name variant macros need to be defined
% uniquely for each name.

% For a long name, we want to use ``William'' in the text
% and ``Wm.'' in the margin.

\newcommand*\WM
{%
  \ifSpecialFN Wm.\else
  William\fi
}

% The first surname use will be ``Shakespeare'', but ``the
% Bard'' thereafter. We allow for alternate caps.
% We can get ``Shakespeare'' thereafter by toggling a flag.

\newcommand*\SHK
{%
  \ifRevertSN
    \textSC{Shakespeare}\else
    \ifSpecialSN
      \noexpand\AltCaps{t}he Bard\else
      \textSC{Shakespeare}%
    \fi
  \fi
}

% Here is how we toggle that flag.

\newcommand*\Revert{\RevertSNtrue}

% The ``first-use'' hook prints a name, then tries
% to insert a margin note using a different name form
% and the user-accessible parser. Finally it resets
% the reversion flag, which is only effective in the
% ``subsequent-use'' hook. Note how macros in the
% name arguments take the role of what the internal
% Boolean flags might otherwise handle.

\makeatletter
\renewcommand*\NamesFormat[1]
{%
  \RevertSNfalse\SpecialFNfalse\SpecialSNfalse%
  #1%
  \unless\ifinner
    \marginpar
    {%
      \footnotesize\raggedleft%
      \SpecialFNtrue\SpecialSNfalse%
      \NameParser%
    }%
  \fi
  \global\RevertSNfalse%
}

\renewcommand*\MainNameHook[1]
{%
  \AltOff\SpecialFNfalse\SpecialSNtrue%
  #1%
  \unless\ifinner
    \unless\ifRevertSN
      \marginpar
      {%
        \footnotesize\raggedleft%
        \SpecialFNfalse\SpecialSNfalse%
        \NameParser%
      }%
    \fi
  \fi
  \global\RevertSNfalse%
}
\makeatother

\index{special uses}
\ForgetThis\Shak\ is the national poet of England
in much the same way that \Name[Robert]{\textSC{Burns}}
is that of Scotland. With the latter's rise of influence
in the 1800s, \Revert\Shak\ became known as ``\Shak''.

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Customization, Easy}

\makeatletter
\newcommand*\Fbox[1]{%
  \if@nameauth@DoAlt\protect\fbox{#1}\else#1\fi
}
\makeatother

\renewcommand*\NamesFormat{}
\renewcommand*\FrontNamesFormat{}
\renewcommand*\MainNameHook{\AltOff}
\renewcommand*\FrontNameHook{\AltOff}

\index{customization, easy}
\deSmet\ was a Jesuit missionary who arrived in North
America in 1821 at the age of twenty, after a year of seminary
education. \CapThis\deSmet\ was ordained in 1827 and worked
among American Indian nations after 1837. We can show the forms
\LdeSmet\ and \SdeSmet.

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Customization, Complicated}

\newif\ifFbox     % Replaces \if@nameauth@DoAlt  \AltOn \AltOff
\newif\ifFirstCap % Replaces \if@nameauth@DoCaps \AltCaps
\newif\ifInHook   % Replaces \if@nameauth@InHook hook dispatcher
\Fboxtrue         % Replaces \AltFormatActive

% Alternate formatting macro definition
\renewcommand*\Fbox[1]{%
  \ifFbox\protect\fbox{#1}\else#1\fi
}

% Redefinition of \AltCaps and \CapThis
\renewcommand*\AltCaps[1]{%
  \ifInHook
    \ifFirstCap\MakeUppercase{#1}\else#1\fi
  \else
    #1%
  \fi
}
\renewcommand*\CapThis{\FirstCaptrue}

\renewcommand*\NamesFormat[1]
  {\InHooktrue\NameParser\global\FirstCapfalse}

\renewcommand*\MainNameHook[1]
  {\Fboxfalse\InHooktrue\NameParser\global\FirstCapfalse}

\let\FrontNamesFormat\Namesformat
\let\FrontNameHook\MainNameHook

\index{customization, complicated}
\ForgetThis\deSmet\ was a Jesuit missionary who arrived in North
America in 1821 at the age of twenty, after a year of seminary
education. \CapThis\deSmet\ was ordained in 1827 and worked
among American Indian nations after 1837. We can show the forms
\LdeSmet\ and \SdeSmet.

\newif\ifCaps      % Replaces \if@nameauth@DoAlt
\Capstrue          % Replaces \AltFormatActive

% Alternate formatting macro definition
\renewcommand*\textSC[1]{\ifCaps\textsc{#1}\else#1\fi}

% Redefinition of \AltCaps and \CapThis
\renewcommand*\AltCaps[1]{%
  \ifInHook
    \ifFirstCap\MakeUppercase{#1}\else#1\fi
  \else
    #1%
  \fi
}
\renewcommand*\CapThis{\FirstCaptrue}

\renewcommand*\NamesFormat[1]
  {\InHooktrue#1\global\FirstCapfalse}

\renewcommand*\MainNameHook[1]
  {\Capsfalse\InHooktrue#1\global\FirstCapfalse}

\let\FrontNamesFormat\Namesformat
\let\FrontNameHook\MainNameHook

\ForgetThis\Luth\ was a leading figure in the Protestant
Reformation. \Luth\ believed that one is declared
righteous in a forensic sense by divine grace through faith
created by the Holy Spirit via the Gospel and the Sacraments.

\ForgetThis\Cath\ was not only Queen of France in her own right,
but she also guided the reigns of her three sons.
\CapThis\LCath[\noexpand\AltCaps{d}e']
was blamed for the St.\ Bartholomew's Day massacre that saw the
murder of thousands of Huguenots.

\renewcommand*\NamesFormat{}
\newcommand*\FrontNamesFormat{}
\renewcommand*\MainNameHook{}
\renewcommand*\FrontNameHook{}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Customization, Complete}

\subsection[With xparse]{With \textsf{xparse}}

\makeatletter

% Change the general-case name macro to show
% a name in a framed, colored box.

\NewDocumentCommand{\MyName}{O{} m O{}}{%
  \global\@nameauth@toksa\expandafter{#1}%
  \global\@nameauth@toksb\expandafter{#2}%
  \global\@nameauth@toksc\expandafter{#3}%
  \fcolorbox{black}{gray!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
}

% Likewise change the macro for when names are forced long.
\NewDocumentCommand{\MyLName}{O{} m O{}}{%
  \global\@nameauth@toksa\expandafter{#1}%
  \global\@nameauth@toksb\expandafter{#2}%
  \global\@nameauth@toksc\expandafter{#3}%
  \fcolorbox{black}{green!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
}

% Likewise change the macro when personal names are desired.
\NewDocumentCommand{\MyFName}{O{} m O{}}{%
  \global\@nameauth@toksa\expandafter{#1}%
  \global\@nameauth@toksb\expandafter{#2}%
  \global\@nameauth@toksc\expandafter{#3}%
  \fcolorbox{black}{yellow!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
}
\makeatother

% Change the formatting hooks, but do not use alternate.
% formatting, which is separate from that above.
\renewcommand*\NamesFormat[1]{\scshape#1}
\renewcommand*\MainNameHook[1]{#1}

% Change the naming macro hooks.
\renewcommand*\NameauthName{\MyName}
\renewcommand*\NameauthLName{\MyLName}
\renewcommand*\NameauthFName{\MyFName}

\index{customization, insane}
\ForgetThis\Name[Adolf]{Harnack} was a theologian who stressed
the Fatherhood of God and the brotherhood of man.
\Name[Adolf]{Harnack} flourished in the early twentieth
century; \Name*[Adolf von]{Harnack}; \FName[Adolf]{Harnack}.
\AltFormatInactive

\makeatletter
\renewcommand*\NameauthName{\@nameauth@Name}
\renewcommand*\NameauthLName{\@nameauth@Name}
\renewcommand*\NameauthFName{\@nameauth@Name}
\makeatother

\renewcommand*\NamesFormat{}
\renewcommand*\MainNameHook{}

\subsection[With xargs]{With \textsf{xargs}}

\makeatletter

% Change the general-case name macro to show
% a name in a framed, colored box.

\renewcommandx\MyName[3][1=\empty, 3=\empty]{%
  \global\@nameauth@toksa\expandafter{#1}%
  \global\@nameauth@toksb\expandafter{#2}%
  \global\@nameauth@toksc\expandafter{#3}%
  \fcolorbox{black}{gray!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
}

% Likewise change the macro for when names are forced long.
\renewcommandx\MyLName[3][1=\empty, 3=\empty]{%
  \global\@nameauth@toksa\expandafter{#1}%
  \global\@nameauth@toksb\expandafter{#2}%
  \global\@nameauth@toksc\expandafter{#3}%
  \fcolorbox{black}{green!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
}

% Likewise change the macro when personal names are desired.
\renewcommandx\MyFName[3][1=\empty, 3=\empty]{%
  \global\@nameauth@toksa\expandafter{#1}%
  \global\@nameauth@toksb\expandafter{#2}%
  \global\@nameauth@toksc\expandafter{#3}%
  \fcolorbox{black}{yellow!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
}
\makeatother

% Change the formatting hooks, but do not use alternate.
% formatting, which is separate from that above.
\renewcommand*\NamesFormat[1]{\scshape#1}
\renewcommand*\MainNameHook[1]{#1}

% Change the naming macro hooks.
\renewcommand*\NameauthName{\MyName}
\renewcommand*\NameauthLName{\MyLName}
\renewcommand*\NameauthFName{\MyFName}

\index{customization, insane}
\ForgetThis\Name[Adolf]{Harnack} was a theologian who stressed
the Fatherhood of God and the brotherhood of man.
\Name[Adolf]{Harnack} flourished in the early twentieth
century; \Name*[Adolf von]{Harnack}; \FName[Adolf]{Harnack}.
\AltFormatInactive

\makeatletter
\renewcommand*\NameauthName{\@nameauth@Name}
\renewcommand*\NameauthLName{\@nameauth@Name}
\renewcommand*\NameauthFName{\@nameauth@Name}
\makeatother

\renewcommand*\NamesFormat{}
\renewcommand*\MainNameHook{}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{\protect\LaTeX\ Engines}

We use \texttt{american} for the language; one should use one's own.
We use Latin Modern for the font; that should be changed at the user's
discretion. We could load \textsf{tikz} using
\texttt{\textbackslash ifDoTikZ} to avoid crashing some \texttt{dvi}
viewers in a \texttt{dvi}-only workflow. Below we list the salient
points from \texttt{compat.tex}, included with \textsf{nameauth}.
\index{\protect\LaTeX\ engines}

\begin{quote}\small
  \VerbatimInput[gobble=0, firstline=29]{compat.tex}
\end{quote}

In the body text we can use something like the test below for:\quad
\fbox{\ifxetex doing \texttt{pdf} things\else
  \ifpdf doing \texttt{pdf} things\else
    doing \texttt{dvi} things\fi
  \fi}

\begin{quote}\small
\begin{Verbatim}
  \ifxetex
    doing \texttt{pdf} things
  \else
    \ifpdf
      doing \texttt{pdf} things
    \else
      doing \texttt{dvi} things
    \fi
  \fi
\end{Verbatim}
\end{quote}

The following equivalent conditional statements can help a macro
or just the body text to work under multiple engines:
\begin{quote}\small
\begin{Verbatim}
  \ifxetex xelatex%
  \else
    \ifluatex
      \ifpdf lualatex (pdf)%
      \else lualatex (dvi)%
      \fi
    \else
      \ifpdf pdflatex%
      \else latex (dvi)%
      \fi
    \fi
  \fi
\end{Verbatim}

\newpage

\begin{Verbatim}
  \unless\ifxetex
    \unless\ifluatex
      \ifpdf pdflatex%
      \else latex (dvi)%
      \fi
    \else
      \ifpdf lualatex (pdf)%
      \else lualatex (dvi)%
      \fi
    \fi
  \else xelatex%
  \fi
\end{Verbatim}
\end{quote}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\section{Miscellaneous Tests: Spaces}

Here we test to see if any unwanted spaces exist in macros that take
name arguments. If everything is OK, one should see two vertical bars 
\texttt{||} where no output in the text is produced, or no spaces
between an enclosed name and the bars. This section also tests if most
possible argument combinations work in most macros that take name arguments.

\begin{quote}
\Verb+\Name[FNNa]{SNNa,Affix}[Alternate]+\dotfill
  |\Name[FNNa]{SNNa,Affix}[Alternate]|\\
\Verb+\Name*[FNNa]{SNNa,Affix}+\dotfill
  |\Name*[FNNa]{SNNa,Affix}|\\
\Verb+\DropAffix\Name*[FNNa]{SNNa,Affix}[Alternate]+\dotfill
  |\DropAffix\Name*[FNNa]{SNNa,Affix}[Alternate]|\\
\Verb+\DropAffix\Name*[FNNa]{SNNa,Affix}+\dotfill
  |\DropAffix\Name*[FNNa]{SNNa,Affix}|\\
\Verb+\Name[FNNa]{SNNa,Affix}[Alternate]+\dotfill
  |\Name[FNNa]{SNNa,Affix}[Alternate]|\\
\Verb+\Name[FNNa]{SNNa,Affix}+\dotfill
  |\Name[FNNa]{SNNa,Affix}|\\
\Verb+\FName[FNNa]{SNNa,Affix}[Alternate]+\dotfill
  |\FName[FNNa]{SNNa,Affix}[Alternate]|\\
\Verb+\FName[FNNa]{SNNa,Affix}+\dotfill
  |\FName[FNNa]{SNNa,Affix}|
\end{quote}

\begin{quote}
\Verb+\Name[FNNb]{SNNb}[Alternate]+\dotfill
  |\Name[FNNb]{SNNb}[Alternate]|\\
\Verb+\Name*[FNNb]{SNNb}+\dotfill
  |\Name*[FNNb]{SNNb}|\\
\Verb+\Name[FNNb]{SNNb}[Alternate]+\dotfill
  |\Name[FNNb]{SNNb}[Alternate]|\\
\Verb+\Name[FNNb]{SNNb}+\dotfill
  |\Name[FNNb]{SNNb}|\\
\Verb+\FName[FNNb]{SNNb}[Alternate]+\dotfill
  |\FName[FNNb]{SNNb}[Alternate]|\\
\Verb+\FName[FNNb]{SNNb}+\dotfill
  |\FName[FNNb]{SNNb}|
\end{quote}

\begin{quote}
\Verb+\Name{SNNc,Affix}[Alternate]+\dotfill
  |\Name{SNNc,Affix}[Alternate]|\\
\Verb+\Name*{SNNc,Affix}+\dotfill
  |\Name*{SNNc,Affix}|\\
\Verb+\Name{SNNc,Affix}[Alternate]+\dotfill
  |\Name{SNNc,Affix}[Alternate]|\\
\Verb+\Name{SNNc,Affix}+\dotfill
  |\Name{SNNc,Affix}|\\
\Verb+\FName{SNNc,Affix}[Alternate]+\dotfill
  |\FName{SNNc,Affix}[Alternate]|\\
\Verb+\FName{SNNc,Affix}+\dotfill
  |\FName{SNNc,Affix}|\\
\Verb+\ForceFN\FName{SNNc,Affix}[Alternate]+\dotfill
  |\ForceFN\FName{SNNc,Affix}[Alternate]|\\
\Verb+\ForceFN\FName{SNNc,Affix}+\dotfill
  |\ForceFN\FName{SNNc,Affix}|
\end{quote}

\begin{quote}
\Verb+\Name{SNNd}[Alternate]+\dotfill
  |\Name{SNNd}[Alternate]|\\
\Verb+\Name*{SNNd}[Alternate]+\dotfill
  |\Name*{SNNd}[Alternate]|\\
\Verb+\Name{SNNd}[Alternate]+\dotfill
  |\Name{SNNd}[Alternate]|\\
\Verb+\FName{SNNd}[Alternate]+\dotfill
  |\FName{SNNd}[Alternate]|\\
\Verb+\ForceFN\FName{SNNd}[Alternate]+\dotfill
  |\ForceFN\FName{SNNd}[Alternate]|
\end{quote}

\begin{quote}
\Verb+\IndexName[FNNe]{SNNe,Affix}[Alternate]+\dotfill
  |\IndexName[FNNe]{SNNe,Affix}[Alternate]|\\
\Verb+\IndexName[FNNe]{SNNe,Affix}+\dotfill
  |\IndexName[FNNe]{SNNe,Affix}|\\
\Verb+\IndexName{SNNf,Affix}[Alternate]+\dotfill
  |\IndexName{SNNf,Affix}[Alternate]|\\
\Verb+\IndexName{SNNf,Affix}+\dotfill
  |\IndexName{SNNf,Affix}|\\
\Verb+\IndexName{SNNf}[Alternate]+\dotfill
  |\IndexName{SNNf}[Alternate]|
\end{quote}

\begin{quote}
\Verb+\IndexRef[FNNg]{SNNg,Affix}[Alternate]{Target}+\dotfill
  |\IndexRef[FNNg]{SNNg,Affix}[Alternate]{Target}|\\
\Verb+\IndexRef[FNNg]{SNNg,Affix}{Target}+\dotfill
  |\IndexRef[FNNg]{SNNg,Affix}{Target}|\\
\Verb+\IndexRef{SNNh,Affix}[Alternate]{Target}+\dotfill
  |\IndexRef{SNNh,Affix}[Alternate]{Target}|\\
\Verb+\IndexRef{SNNh,Affix}{Target}+\dotfill
  |\IndexRef{SNNh,Affix}{Target}|\\
\Verb+\IndexRef{SNNh}[Alternate]{Target}+\dotfill
  |\IndexRef{SNNh}[Alternate]{Target}|
\end{quote}

\begin{quote}
\Verb+\ExcludeName[FNNi]{SNNi,Affix}[Alternate]+\dotfill
  |\ExcludeName[FNNi]{SNNi,Affix}[Alternate]|\\
\Verb+\ExcludeName[FNNi]{SNNi,Affix}+\dotfill
  |\ExcludeName[FNNi]{SNNi,Affix}|\\
\Verb+\ExcludeName{SNNj,Affix}[Alternate]+\dotfill
  |\ExcludeName{SNNj,Affix}[Alternate]|\\
\Verb+\ExcludeName{SNNj,Affix}+\dotfill
  |\ExcludeName{SNNj,Affix}|\\
\Verb+\ExcludeName{SNNj}[Alternate]+\dotfill
  |\ExcludeName{SNNj}[Alternate]|
\end{quote}

\begin{quote}
\Verb+\IncludeName[FNNi]{SNNi,Affix}[Alternate]+\dotfill
  |\IncludeName[FNNi]{SNNi,Affix}[Alternate]|\\
\Verb+\IncludeName[FNNi]{SNNi,Affix}+\dotfill
  |\IncludeName[FNNi]{SNNi,Affix}|\\
\Verb+\IncludeName{SNNj,Affix}[Alternate]+\dotfill
  |\IncludeName{SNNj,Affix}[Alternate]|\\
\Verb+\IncludeName{SNNj,Affix}+\dotfill
  |\IncludeName{SNNj,Affix}|\\
\Verb+\IncludeName{SNNj}[Alternate]+\dotfill
  |\IncludeName{SNNj}[Alternate]|
\end{quote}

\begin{quote}
\Verb+\IncludeName*[FNNi]{SNNi,Affix}[Alternate]+\dotfill
  |\IncludeName*[FNNi]{SNNi,Affix}[Alternate]|\\
\Verb+\IncludeName*[FNNi]{SNNi,Affix}+\dotfill
  |\IncludeName*[FNNi]{SNNi,Affix}|\\
\Verb+\IncludeName*{SNNj,Affix}[Alternate]+\dotfill
  |\IncludeName*{SNNj,Affix}[Alternate]|\\
\Verb+\IncludeName*{SNNj,Affix}+\dotfill
  |\IncludeName*{SNNj,Affix}|\\
\Verb+\IncludeName*{SNNj}[Alternate]+\dotfill
  |\IncludeName*{SNNj}[Alternate]|
\end{quote}

\begin{quote}
\Verb+\PretagName[FNNk]{SNNk,Affix}[Alternate]{Sorta}+\dotfill
  |\PretagName[FNNk]{SNNk,Affix}[Alternate]{Sorta}|\\
\Verb+\PretagName[FNNl]{SNNl,Affix}{Sortb}+\dotfill
  |\PretagName[FNNl]{SNNl,Affix}{Sortb}|\\
\Verb+\PretagName{SNNm,Affix}[Alternate]{Sortc}+\dotfill
  |\PretagName{SNNm,Affix}[Alternate]{Sortc}|\\
\Verb+\PretagName{SNNn,Affix}{Sortd}+\dotfill
  |\PretagName{SNNn,Affix}{Sortd}|\\
\Verb+\PretagName{SNNo}[Alternate]{Sorte}+\dotfill
  |\PretagName{SNNo}[Alternate]{Sorte}|
\end{quote}

\begin{quote}
\Verb+\TagName[FNNa]{SNNa,Affix}[Alternate]{Tag}+\dotfill
  |\TagName[FNNa]{SNNa,Affix}[Alternate]{Tag}|\\
\Verb+\TagName[FNNa]{SNNa,Affix}{Tag}+\dotfill
  |\TagName[FNNa]{SNNa,Affix}{Tag}|\\
\Verb+\TagName[FNNb]{SNNb}[Alternate]{Tag}+\dotfill
  |\TagName[FNNb]{SNNb}[Alternate]{Tag}|\\
\Verb+\TagName[FNNb]{SNNb}{Tag}+\dotfill
  |\TagName[FNNb]{SNNb,Affix}{Tag}|\\
\Verb+\TagName{SNNc,Affix}[Alternate]{Tag}+\dotfill
  |\TagName{SNNc,Affix}[Alternate]{Tag}|\\
\Verb+\TagName{SNNc,Affix}{Tag}+\dotfill
  |\TagName{SNNc,Affix}{Tag}|\\
\Verb+\TagName{SNNd}[Alternate]{Tag}+\dotfill
  |\TagName{SNNd}[Alternate]{Tag}|
\end{quote}

\begin{quote}
\Verb+\UntagName[FNNa]{SNNa,Affix}[Alternate]+\dotfill
  |\UntagName[FNNa]{SNNa,Affix}[Alternate]|\\
\Verb+\UntagName[FNNa]{SNNa,Affix}+\dotfill
  |\UntagName[FNNa]{SNNa,Affix}|\\
\Verb+\UntagName[FNNb]{SNNb}[Alternate]+\dotfill
  |\UntagName[FNNb]{SNNb}[Alternate]|\\
\Verb+\UntagName[FNNb]{SNNb}+\dotfill
  |\UntagName[FNNb]{SNNb,Affix}|\\
\Verb+\UntagName{SNNc,Affix}[Alternate]+\dotfill
  |\UntagName{SNNc,Affix}[Alternate]|\\
\Verb+\UntagName{SNNc,Affix}+\dotfill
  |\UntagName{SNNc,Affix}|\\
\Verb+\UntagName{SNNd}[Alternate]+\dotfill
  |\UntagName{SNNd}[Alternate]|
\end{quote}

\begin{quote}
\Verb+\NameAddInfo[FNNa]{SNNa,Affix}[Alternate]{Info1}+\dotfill
  |\NameAddInfo[FNNa]{SNNa,Affixa}[Alternate]{Info1}|\\
\Verb+\NameAddInfo[FNNa]{SNNa,Affix}{Info2}+\dotfill
  |\NameAddInfo[FNNa]{SNNa,Affix}{Info2}|\\
\Verb+\NameAddInfo[FNNb]{SNNb}[Alternate]{Info3}+\dotfill
  |\NameAddInfo[FNNb]{SNNb}[Alternate]{Info3}|\\
\Verb+\NameAddInfo[FNNb]{SNNb}{Info4}+\dotfill
  |\NameAddInfo[FNNb]{SNNb}{Info4}|\\
\Verb+\NameAddInfo{SNNc,Affix}[Alternate]{Info5}+\dotfill
  |\NameAddInfo{SNNc,Affix}[Alternate]{Info5}|\\
\Verb+\NameAddInfo{SNNc,Affix}{Info6}+\dotfill
  |\NameAddInfo{SNNc,Affix}{Info6}|\\
\Verb+\NameAddInfo{SNNd}[Alternate]{Info7}+\dotfill
  |\NameAddInfo{SNNd}[Alternate]{Info7}|
\end{quote}

\begin{quote}
\Verb+\NameQueryInfo[FNNa]{SNNa,Affix}[Alternate]+\dotfill
  |\NameQueryInfo[FNNa]{SNNa,Affix}[Alternate]|\\
\Verb+\NameQueryInfo[FNNa]{SNNa,Affix}+\dotfill
  |\NameQueryInfo[FNNa]{SNNa,Affix}|\\
\Verb+\NameQueryInfo[FNNb]{SNNb}[Alternate]+\dotfill
  |\NameQueryInfo[FNNb]{SNNb}[Alternate]|\\
\Verb+\NameQueryInfo[FNNb]{SNNb}+\dotfill
  |\NameQueryInfo[FNNb]{SNNb}|\\
\Verb+\NameQueryInfo{SNNc,Affix}[Alternate]+\dotfill
  |\NameQueryInfo{SNNc,Affix}[Alternate]|\\
\Verb+\NameQueryInfo{SNNc,Affix}+\dotfill
  |\NameQueryInfo{SNNc,Affix}|\\
\Verb+\NameQueryInfo{SNNd}[Alternate]+\dotfill
  |\NameQueryInfo{SNNd}[Alternate]|
\end{quote}

\begin{quote}
\Verb+\NameClearInfo[FNNa]{SNNa,Affix}[Alternate]+\dotfill
  |\NameClearInfo[FNNa]{SNNa,Affix}[Alternate]|\\
\Verb+\NameClearInfo[FNNa]{SNNa,Affix}+\dotfill
  |\NameClearInfo[FNNa]{SNNa,Affix}|\\
\Verb+\NameClearInfo[FNNb]{SNNb}[Alternate]+\dotfill
  |\NameClearInfo[FNNb]{SNNb}[Alternate]|\\
\Verb+\NameClearInfo[FNNb]{SNNb}+\dotfill
  |\NameClearInfo[FNNb]{SNNb}|\\
\Verb+\NameClearInfo{SNNc,Affix}[Alternate]+\dotfill
  |\NameClearInfo{SNNc,Affix}[Alternate]|\\
\Verb+\NameClearInfo{SNNc,Affix}+\dotfill
  |\NameClearInfo{SNNc,Affix}|\\
\Verb+\NameClearInfo{SNNd}[Alternate]+\dotfill
  |\NameClearInfo{SNNd}[Alternate]|
\end{quote}

\begin{quote}
\Verb+\ForgetName[FNNa]{SNNa,Affix}[Alternate]+\dotfill
  |\ForgetName[FNNa]{SNNa,Affix}[Alternate]|\\
\Verb+\ForgetName[FNNa]{SNNa,Affix}+\dotfill
  |\ForgetName[FNNa]{SNNa,Affix}|\\
\Verb+\ForgetName[FNNb]{SNNb}[Alternate]+\dotfill
  |\ForgetName[FNNb]{SNNb}[Alternate]|\\
\Verb+\ForgetName[FNNb]{SNNb}+\dotfill
  |\ForgetName[FNNb]{SNNb}|\\
\Verb+\ForgetName{SNNc,Affix}[Alternate]+\dotfill
  |\ForgetName{SNNc,Affix}[Alternate]|\\
\Verb+\ForgetName{SNNc,Affix}+\dotfill
  |\ForgetName{SNNc,Affix}|\\
\Verb+\ForgetName{SNNd}[Alternate]+\dotfill
  |\ForgetName{SNNd}[Alternate]|
\end{quote}

\begin{quote}
\Verb+\LocalNames+\LocalNames\\
\Verb+\SubvertName[FNNa]{SNNa,Affix}[Alternate]+\dotfill
  |\SubvertName[FNNa]{SNNa,Affix}[Alternate]|\\
\Verb+\SubvertName[FNNb]{SNNb}[Alternate]+\dotfill
  |\SubvertName[FNNb]{SNNb}[Alternate]|\\
\Verb+\SubvertName{SNNc,Affix}[Alternate]+\dotfill
  |\SubvertName{SNNc,Affix}[Alternate]|\\
\Verb+\SubvertName{SNNd}[Alternate]+\dotfill
  |\SubvertName{SNNd}[Alternate]|\\
\Verb+\GlobalNames+\GlobalNames
\end{quote}

\begin{quote}
\Verb+\IfMainName[FNNa]{SNNa,Affix}{Y}{N}+\dotfill
  |\IfMainName[FNNa]{SNNa,Affix}{Y}{N}|\\
\Verb+\IfMainName[FNNb]{SNNb}{Y}{N}+\dotfill
  |\IfMainName[FNNb]{SNNb}{Y}{N}|\\
\Verb+\IfMainName{SNNc,Affix}{Y}{N}+\dotfill
  |\IfMainName{SNNc,Affix}{Y}{N}|\\
\Verb+\IfMainName{SNNd}[Alternate]{Y}{N}+\dotfill
  |\IfMainName{SNNd}[Alternate]{Y}{N}|
\end{quote}

\begin{quote}
\Verb+\IfFrontName[FNNa]{SNNa,Affix}[Alternate]{Y}{N}+\dotfill
  |\IfFrontName[FNNa]{SNNa,Affix}[Alternate]{Y}{N}|\\
\Verb+\IfFrontName[FNNb]{SNNb}[Alternate]{Y}{N}+\dotfill
  |\IfFrontName[FNNb]{SNNb}[Alternate]{Y}{N}|\\
\Verb+\IfFrontName{SNNc,Affix}[Alternate]{Y}{N}+\dotfill
  |\IfFrontName{SNNc,Affix}[Alternate]{Y}{N}|\\
\Verb+\IfFrontName{SNNd}[Alternate]{Y}{N}+\dotfill
  |\IfFrontName{SNNd}[Alternate]{Y}{N}|
\end{quote}

\begin{quote}
\Verb+\SeeAlso\IndexRef[FNNp]{SNNp,Affix}{Target}+\dotfill
  |\SeeAlso\IndexRef[FNNp]{SNNp,Affix}{Target}|\\
\Verb+\ExcludeName{SNNq,Affix}+\dotfill
  |\ExcludeName{SNNq,Affix}|\\
\Verb+\IfAKA[FNNp]{SNNp,Affix}[Alternate]{Y}{N}{X}+\dotfill
  |\IfAKA[FNNp]{SNNp,Affix}[Alternate]{Y}{N}{X}|\\
\Verb+\IfAKA[FNNp]{SNNp,Affix}{Y}{N}{X}+\dotfill
  |\IfAKA[FNNp]{SNNp,Affix}{Y}{N}{X}|\\
\Verb+\IfAKA{SNNq,Affix}[Alternate]{Y}{N}{X}+\dotfill
  |\IfAKA{SNNq,Affix}[Alternate]{Y}{N}{X}|\\
\Verb+\IfAKA{SNNq,Affix}{Y}{N}{X}+\dotfill
  |\IfAKA{SNNq,Affix}{Y}{N}{X}|\\
\Verb+\IfAKA{SNNr}[Alternate]{Y}{N}{X}+\dotfill
  |\IfAKA{SNNr}[Alternate]{Y}{N}{X}|
\end{quote}

\begin{quote}
\Verb+\AKA[FNN1]{SNN1,Affix1}%+\\
\Verb+  [FNN2]{SNN2,Affix2}[Alternate2]+\dotfill
  |\AKA[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}[Alternate2]|\\
\Verb+\AKA[FNN1]{SNN1,Affix1}%+\\
\Verb+  [FNN2]{SNN2,Affix2}+\dotfill
  |\AKA[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}|\\
\Verb+\DropAffix\AKA[FNN1]{SNN1,Affix1}%+\\
\Verb+  [FNN2]{SNN2,Affix2}+\dotfill
  |\DropAffix\AKA[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}|\\
\Verb+\AKA*[FNN1]{SNN1,Affix1}%+\\
\Verb+  [FNN2]{SNN2,Affix2}[Alternate2]+\dotfill
  |\AKA*[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}[Alternate2]|\\
\Verb+\AKA*[FNN1]{SNN1,Affix1}%+\\
\Verb+  [FNN2]{SNN2,Affix2}+\dotfill
  |\AKA*[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}|
\end{quote}

\begin{quote}
\Verb+\AKA[FNN1]{SNN1,Affix1}%+\\
\Verb+  {SNN3,Affix3}[Alternate3]+\dotfill
  |\AKA[FNN1]{SNN1,Affix1}{SNN3,Affix3}[Alternate3]|\\
\Verb+\AKA[FNN1]{SNN1,Affix1}%+\\
\Verb+  {SNN3,Affix3}+\dotfill
  |\AKA[FNN1]{SNN1,Affix1}{SNN3,Affix3}|\\
\Verb+\AKA*[FNN1]{SNN1,Affix1}%+\\
\Verb+  {SNN3,Affix3}+\dotfill
  |\AKA*[FNN1]{SNN1,Affix1}{SNN3,Affix3}|\\
\Verb+\ForceFN\AKA*[FNN1]{SNN1,Affix1}%+\\
\Verb+  {SNN3,Affix3}[Alternate3]+\dotfill
  |\ForceFN\AKA*[FNN1]{SNN1,Affix1}{SNN3,Affix3}[Alternate3]|\\
\Verb+\ForceFN\AKA*[FNN1]{SNN1,Affix1}%+\\
\Verb+  {SNN3,Affix3}+\dotfill
  |\ForceFN\AKA*[FNN1]{SNN1,Affix1}{SNN3,Affix3}|
\end{quote}

\begin{quote}
\Verb+\AKA[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]+\dotfill
  |\AKA[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]|\\
\Verb+\AKA*[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]+\dotfill
  |\AKA*[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]|\\
\Verb+\ForceFN\AKA*[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]+\dotfill
  |\ForceFN\AKA*[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]|
\end{quote}

\begin{quote}
\Verb+\AKA{SNN5,Affix5}%+\\
\Verb+  [FNN6]{SNN6,Affix6}[Alternate6]+\dotfill
  |\AKA{SNN5,Affix5}[FNN6]{SNN6,Affix6}[Alternate6]|\\
\Verb+\AKA{SNN5,Affix5}{SNN7,Affix7}+\dotfill
  |\AKA{SNN5,Affix5}{SNN7,Affix7}|\\
\Verb+\AKA{SNN5,Affix5}{SNN8}[Alternate8]+\dotfill
  |\AKA{SNN5,Affix5}{SNN8}[Alternate8]|\\
\end{quote}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\phantomsection
\addcontentsline{toc}{section}{Index of Persons}
\printindex[per]

\renewcommand\indexname{Index of Subjects}
\phantomsection
\addcontentsline{toc}{section}{Index of Subjects}
\printindex

\end{document}
%examplesvb
%</examples>
\endinput