summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/varindex/varindex.dtx
blob: f4714ea472f09dbc137e65697ca1b16a55df87d9 (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
% \def\fileversion{2.3}\def\filedate{2001/05/06}\def\docdate{2013/11/26}
%\iffalse These lines are necessary for the doc and docstrip utilities
%<*asciidocu>

%%#
%%# Author:
%%#
%%# M. V\"ath      martin@mvath.de
%%#
%%# This package bases on ideas of indextwo.sty which was written jointly with
%%#
%%# O. Karch       karch@informatik.uni-wuerzburg.de
%%# H.-C. Wirth    wirth@informatik.uni-wuerzburg.de

%%# The package may be distributed and/or modified under the conditions of
%%# the LaTeX Project Public License (version 1.3c or later).

%%#############################################################################
%%#
%%#  This LaTeX package provides a luxury front-end for the \index command.
%%#  For example, it allows to generate multiple \index entries in
%%#  almost any form by a single command. Extremely customizable.
%%#  Works with all versions of LaTeX and probably most other TeX formats, too.
%%#  This package requires the toolbox package at least in version 3.1.
%%#
%%#############################################################################

%%#
%%# This package was tested with LaTeX 2.09 and LaTeX 2e and should work
%%# with all other (future) versions of LaTeX and friends, too.
%%# It should even run with other (non-LaTeX) formats if an \index command
%%# with LaTeX-Syntax is provided.
%%#

% If you have access to (reasonable new) docstrip TeXfiles, you should run
% tex/latex on the file
%   `varindex.ins'
% to produce the files `varindex.sty', `varindex.txt' and `varindex.tex'.
% (In case `varindex.ins' is lost: You can find its content in the last
%  few lines of the file you are currently reading between the
%  lines %<*insfile> and %</insfile>;
%  BTW: You should name this file here `varindex.dtx' before you run tex
%  on varindex.ins).
%
% The file `varindex.txt' contains a `brief' (but complete) ascii
% documentation. If you have additionally access to LaTeX2e, you may run
% latex on the generated file `varindex.tex' to produce `varindex.dvi' which
% contains a more luxury documentation. (If you want an index or
% implementation details in the documentation read the comments in
% `varindex.tex' before running it through latex).
%
% If you do not have access to the docstrip TeXfiles you may simply
% copy/rename this file here into
%   `varindex.sty'
% to use the package and read the ascii documentation in this file.
% The ascii documentation (the content of `varindex.txt') consists of all
% lines in this file which start with %%# (this is the above block and another
% (very large) block which follows soon).
%
% But I do not recommended this, because TeX will need more time to read this
% longer file, and because there might be a (very slight) incompatibility if
% you use it (namely if you load `varindex.sty' with some *extremely* strange
% catcodes).
% I recommend in this case instead to generate the file `varindex.sty' as
% anything between the lines %<*package> and %</package> by hand.
% (This is not precisely the file which you get with the docstrip TeXfiles,
% but a reasonable good substitute. To speed up loading, you may also
% eliminate all lines starting with `% ' in `varindex.sty').
% For your information: The file `varindex.tex' produced by the docstrip
% TeXfiles is anything between the lines %<*driver> and %</driver>
% (with a line containing \endinput and two comment lines appended)
%
%
% In any case, you end up with the file `varindex.sty'.
%
% If you can generate `varindex.tex', you will probably want to stop
% reading now and instead read the `luxury' documentation in `varindex.dvi'.
%
% Otherwise, you have to make due with the following ascii documentation.
%
%
% \fi\catcode\#14\relax\iffalse  (This line is needed for the doc utility)
%

%%# To use varindex, you have to put `varindex.sty' in a path where TeX looks
%%# for its input files. You must also have the file `toolbox.sty' of the
%%# toolbox package in your path. The TeX documents using varindex need the
%%# following modifications in their header:
%%#
%%# a) If you use LaTeX2.09, use varindex as a style option, e.g.
%%#      \documentstyle[varindex]{article}
%%#    or
%%#      \documentstyle[varindex,12pt]{article}
%%# b) If you use LaTeX2e, put in the preamble the command
%%#      \usepackage{varindex}
%%# c) If you use some other (non-LaTeX) format, you will probably have to
%%#    insert a line like
%%#          \catcode`\@=11\input varindex.sty\catcode`\@=12\relax
%%#
%%# For TeX insiders: LaTeX-specific commands used in `varindex.sty' are only:
%%#
%%#   \makeatother
%%#   \makeatletter
%%#   \typeout
%%#   \RequirePackage
%%#   \newcommand (only in the form \newcommand{\command}{} to ensure that
%%#                 \command was not defined before)
%%#   \ProvidesPackage
%%#
%%#   The above commands are used only if they are defined (otherwise,
%%#   natural substitutes are used (\newcommand and \Provides package are
%%#   then not used at all))


%%#
%%# I strongly recommend to have additionally a look at the documentation
%%# of the "toolbox" package, in particular the \toolboxMakeDef command
%%# (provided since toolbox v3.1) which supplements \varindex.
%%#

%%#
%%# The \varindex command is highly customizable.
%%# So the following examples can only give you a rough impression of what
%%# you can actually do with it. You do not need to understand them now:
%%# The general usage is explained later. (Maybe you want to look up the
%%# examples afterwards).
%%#
%%#
%%# 1. Typical example of usage (using the \varindextwo macros):
%%#
%%#
%%#
%%# Suppose the following customization of the \varindex command was defined:
%%#     \def\Index{\varindex(){\varindextwoScan}{\varindextwo}[\emph]}
%%# Since we used the \varindextwo macros here, by default
%%# TWO index entries are generated with a single command:
%%#
%%# \Index{ring with $1$@one}
%%#
%%# ring
%%#    ~ with $1$            [sorted like: "with one"]
%%#
%%# $1$                      [sorted like: "one" ]
%%#    ring with ~           [sorted like: "ring with" (without " ~") ]
%%#
%%# DIFFERENT entries may be generated by your own rules. E.g.:
%%#
%%# \Index{Hausdorff measure of noncompactness}[4,23 2!~34!1= ]
%%#
%%# generates THREE index entries:
%%#
%%# noncompactness, measure of ~ (sorted like "noncompactness, measure of")
%%#
%%# measure
%%#   ~ of noncompactness
%%#         Hausdorff =    (here, = stands for the $\approx$ symbol)
%%#
%%# Hausdorff measure of noncompactness
%%#
%%# The last of these entries occurs only, because the last character in
%%# the format argument [...] was a space.
%%#
%%# If you want only slight modification(s) of the default, you need also just
%%# slight modifications of the command, e.g.
%%#
%%# \Index*,{ring with $1$@one} is as above, just that the second entry reads
%%#
%%# $1$, ring with ~  [sorted like "one, ring with" ]
%%#
%%# Moreover, since the `*' occured in the previous command, additionally
%%#
%%# \emph{ring with $1$}
%%#
%%# appears in the running text. Praxis shows that changes in the entries as
%%# above have to be made frequently in the `fine tuning' of the index of a
%%# book. Note that with the original \index the command would have to be
%%# changed completely for the above entries, because we have a "sort" entry
%%# for which a different rule applies if we use a subitem instead of a ",".
%%# (BTW: \varindex produces sort entries only if they are necessary).
%%#
%%# Of course, you may combine the default with your own format:
%%#
%%# \Index{internal integrable function}[23,1~ +]  generates
%%#
%%# integrable function, internal ~
%%#
%%# internal
%%#    ~ integrable function
%%#
%%# function
%%#    internal integrable ~
%%#
%%#
%%# 2. A simple example without the \varindextwo macros:
%%#
%%# \varindex*{topology of a normed space}{5!4~!1= 45,12}[|see{norm}]
%%#
%%# produces the two index entries:
%%#
%%#  space
%%#     normed ~
%%#         topology =
%%#
%%#  normed space, topology of
%%#
%%# In both entries not the pagenumber is cited, but the text "see also norm".
%%# Additionally, the tokens {topology of a normed space} are
%%# inserted into the running text (this would not happen if
%%# \varindex is used in place of \varindex*).
%%# Only in the first of the above entries, an `@' part will be added to the
%%# *.idx file: This entry is sorted as if " ~" resp. " =" would not exist.
%%#
%%#
%%# 3. Another example without the \varindextwo macros:
%%#
%%# \varindex[\emph][|textbf]%
%%#     {$\sigma$@sigma!$(\sigma-)$ finite {measure space}}%
%%#     {*1.23 23 23,1- 1-23}
%%#
%%# generates the three index entries:
%%#
%%#  finite measure space
%%#
%%#  finite measure space, $\sigma$- (sorted as "finite measure space, sigma-")
%%#
%%#  $\sigma$-finite measure space   (sorted as "sigma-finite measure space")
%%#
%%# In all three entries the pages are printed using \textbf.
%%#
%%# Moreover, the tokens
%%#   \emph{($\sigma$-)finite measure space}
%%# are put into the running text.
%%#
%%#
%%# 4. A simple example using a flag (without the \varindextwo macros):
%%#
%%# \varindex1{$L$ and $M$@L and M}{}
%%#          ^
%%#
%%# generates the index entry "$L$ and $M$" which is sorted like "L and M".
%%# In the form
%%#   \varindex1*{$L$ and $M$@L and M}{}
%%# or
%%#   \varindex*1{$L$ and $M$@L and M}{}
%%# additionally, {$L$ and $M$} is output into the running text.
%%#
%%# Note that without the `1', the index generated were
%%# "$L$ and $M$ and M" which were sorted like "$L$ and L and M".
%%#
%%#
%%# 5. An example for very primitive customized index commands (without the
%%#    \varindextwo macros):
%%#
%%# \def\myindexA{\varindex[\emph][|textbf]*}
%%# \def\myindexB{\varindex(){}{}[\emph][|textbf]}
%%#
%%# \myindexA{Foo1}{}
%%# \myindexB{Foo2}[][]
%%# \myindexB*{Foo3!{Foo 3}}
%%#
%%# Generates the index entries Foo1, Foo2, and Foo3. Moreover, \emph{Foo1}
%%# and \emph{Foo 3} is put into the running text. The pagenumber of Foo 2 in
%%# the index is printed normal, the others with \textbf.
%%#
%%#
%%# 6. An example of a primitive customized index command (without the
%%#    \varindextwo macros):
%%#
%%# \def\myindex{\varindex(\ifnum\varindexCount=2 1!2 2,1\fi){}{}[\emph]}
%%#
%%# \myindex{Foo Bar}
%%#    generates the index entries
%%#     Foo
%%#        Bar
%%#
%%#     Bar, Foo
%%#
%%# \myindex*{Foo Bar}
%%#    generates the same index entries as above and additionally outputs
%%#    \emph{Foo Bar} into the running text.
%%#
%%# \myindex*{other format}[21]
%%#   generates the index entry
%%#     format other
%%#   and outputs \emph{other format} into the running text.
%%#
%%# \myindex[|textbf]*{BoBo}
%%#   generates the index entry
%%#      BoBo
%%#   where the pagenumber is printed with \textbf.
%%#   Moreover, \emph{BoBo} is output into the running text.
%%#
%%#
%%# 7. A primitive varying customized index command (without the \varindextwo
%%#    macros):
%%#
%%# \def\myindex{\varindex(\ifnum\varindexCount=2 1!2 2,1\fi)%
%%#     (\ifnum\varindexCount=2*2,1 1!2 2,1\fi){}{}[\emph]}
%%#
%%# With the same commands as in 6. the same index entries are generated,
%%# but the tokens \emph{Far, Boo}, \emph{other format}, and \emph{Bobo}
%%# are output into the running text.
%%#
%%#
%%# 8. Examples with the \varindextwo macros:
%%#    We use a similar definition for \Index as in 1., and define an \iemph
%%#    macro which has `*' as a default and outputs with \emph.
%%#    Both sort of definitions are highly recommended for you private style.
%%#
%%# \def\Index{\varindex(){\varindextwoScan}{\varindextwo}[]}
%%# \def\iemph{\varindex(){\varindextwoScan\def\varindexStarPos{}}%
%%#              {\varindextwo}[\emph]}
%%# (note that \def\iemph{\varindex(){\varindextwoScan}{\varindextwo}[\emph]*}
%%#  is not so good as the above definition of \iemph as is explained below).
%%#
%%# \Index*{measure of $\gamma$-noncompactness@gamma-noncompactness!FOO}
%%#
%%#   generates the index entries
%%#
%%#   measure
%%#      ~ of $\gamma$-noncompactness   (sorted as "of gamma-noncompactness")
%%#
%%#   $\gamma$-noncompacntess
%%#      measure of ~
%%#
%%#   and outputs the tokens {measure of FOO} into the running text.
%%#
%%# \Index*,?_'{flic of flac}  generates
%%#
%%#   flic of flac
%%#
%%#   flac, flic
%%#
%%#   and outputs {flic of flac}.
%%#
%%# \Index^={$\sigma$@sigma algebra} generates
%%#
%%#   $\sigma$ (sorted as "sigma")
%%#      ~-algebra   (sorted as "algebra" resp. "-algebra", see below)
%%#
%%#   algebra
%%#      $\sigma$-~  (sorted as "sigma-")
%%#
%%# Here, the sorting "-algebra" is chosen when you used
%%#    \let\varindexOutSortDashBeg\varindexOutSortDash
%%# as described later.
%%#
%%# \Index-^>{$\sigma$@sigma algebra} generates
%%#
%%#   $\sigma$- (sorted as "sigma-")
%%#      ~ algebra   (sorted as "algebra")
%%#
%%# \Index^.,:{ultra filter} generates
%%#
%%#   ultra
%%#      ~filter        (no space following ~)
%%#   filter, ultra~    (no space in front of ~)
%%#
%%# \iemph[|see{recursive recursion}],_{recursive recursion}  generates
%%#
%%#  recursive recursion, \see{recursive recursion}
%%#
%%#  recursion, recursive ~, \see{recursive recursion}
%%#
%%#  and outputs \emph{recursive recursion}. If we would have used instead the
%%#  definition \def\iemph{\varindex(){\varindextwoScan}{\varindextwo}[]*},
%%#  the above call were not possible, since the optional arguments [|see...]
%%#  must occur in front of the flag `*'.
%%#
%%# \Index-;*{Flip Flop}   generates
%%#
%%#    Flip-Flop
%%#
%%#    FlopFlip
%%#
%%#    and outputs {Flip-Flop}  (!!!!!!!)
%%#
%%# \Index>{Flippy Flop!GO}[*2-1-2 2!1-1 1-12 +]
%%#
%%#   generates
%%#
%%#     Flop
%%#        Flippy-Flippy (no tilde!)
%%#
%%#     Flippy-Flippy Flop
%%#
%%#     Flippy
%%#        ~ Flop
%%#
%%#   and outputs {GO-Flippy-GO} (!!!)
%%#
%%# \Index*_,{shape {of a} of star}  generates
%%#
%%#    shape of a star
%%#
%%#    star, shape of ~ (sorted like "star, shape of")
%%#
%%# and outputs {shape of a star}.
%%#
%%# \Index1*{$L$ feature@L feature}
%%# \Index,{No $L$@L feature}
%%# generate
%%#
%%# $L$ feature (sorted like "L feature")
%%#
%%# No
%%#   ~ $L$ feature   (sorted like "L feature")
%%#
%%# feature, No $L$ ~ (sorted like "feature, No L")
%%#
%%# and outputs {$L$ feature}.
%%#
%%#
%%# 9. Example of a simple modification of the \varindextwo macros:
%%#
%%# \def\myindextwoScan{%
%%#      \varindextwoScan
%%#      \varindexNewFlag ~\vxtSpaceA
%%#      \varindexNewFlag 1\vxtSpaceB
%%#      \varindexNewFlag !\varindexOneEntry
%%#      \varindexMakeSplitExpand{/}{vxtSplitAtMagic}%
%%#      \def\varindexStarPos{}%
%%# }
%%# \def\myIndex{\varindex(){\myindextwoScan}{\varindextwo}[]}
%%#
%%# \myIndex behaves similar to the previous example with
%%# the following differences:
%%# 1. The flag `1' now has the previous meaning of "~".
%%# 2. One may now use "~" and "_" equivalently.
%%# 3. The flag `!' now has the originial meaning of the flag `1'.
%%# 4. Instead of `+' in the format string, the character `/' has to be used.

%%#
%%#
%%# Description:
%%#
%%# There are two possible calls:
%%#
%%# a) \varindex[textstyle][pagestyleA]flags{main entries}{format}[pagestyleB]
%%#
%%#    Here, [textstyle], [pagestyleA], [pagestyleB], and flags are optional.
%%#    (If [textstyle] is omitted, also [pagestyleA] must be omitted).
%%#
%%#    textstyle: describes the textstyle used for the output into the
%%#               running text (typically, textstyle is \emph or empty).
%%#    pagestyle: describes the pagestyle used for the output of the pagenumber
%%#               (you may also use a construct like |see{...} here).
%%#               If [pagestyleB] is present, this is the value used.
%%#               Otherwise, the value of [pagestyleA] is used (resp. nothing).
%%#    flags can be one (or both) of the following tokens:
%%#      `*': "Output into running text":
%%#           If no * is used in the format string (see below),
%%#           then the format is automatically prepended by the tokens `* '
%%#           resp. `*' (depending whether format starts with ` ' or not)
%%#      `1': The content of {main entries} is considered as a single entry
%%#           (see below).
%%#    {main entries} and
%%#    {format} are explained later.
%%#
%%# b) \varindex(formatA)(format*A){scanprogram}{mainprogram}
%%#         [textstyle][pagestyleA]flags{main entries}[formatB][pagestyleB]
%%#
%%#    Concerning [textstyle], [pagestyleA], flags, [pagestyleB], the same
%%#    remarks as in a) hold. Also (format*A) and (formatA) are optional.
%%#    (if (formatA) is omitted, also (format*A) must be omitted).
%%#
%%#    The "default" format is formatA resp. format*A (depending whether the
%%#    flag "*" has been used or not). If [formatB] is given, then this is
%%#    used as the format (i.e. it overrides the default).
%%#
%%#    scanprogram is executed immediately when \varindex reads it.
%%#    This can be used to introduce FURTHER flags (other than '*' and `1'),
%%#    see below.
%%#    mainprogram is executed AFTER the format string(s) has been expanded.
%%#
%%#
%%#
%%# It is recommended to define personal macros which contain all parameters up
%%# to the place where the flags occur (either with or without some flags,
%%# depending on the intention). See the examples above.
%%#
%%#
%%#
%%#
%%# The main argument (called {main entries} above) has the form
%%#
%%# entry1[`space' entry2][`space' entry3] ...
%%#
%%# where each of entry1 entry2 entry3 ...  in turn has the form
%%#   indextext@sorttext!outputtext or
%%#   indextext!outputtext@sorttext
%%# In each of these forms, @sorttext and !outputtext are optional.
%%# Here,
%%#   indextext  is the text which is put into the index for the entry
%%#   sorttext   is what is used as a sort criterion for the entry
%%#   outputtext is what is output into the running text for the entry
%%#
%%# Note that the symbol @ has in a sense the opposite meaning as in the
%%# original \index command:
%%# BEFORE that symbol, the desired text appears, and
%%# AFTER the symbol the place where it has to be sorted.
%%# However, we chose the symbols @ and !, because these two
%%# symbols are forbidden anyway (otherwise, makeindex will become confused).
%%#
%%# As usual, multiple spaces are considered as ONE space and do not generate
%%# empty "ghost" entries. Moreover, a space after a TeX-command like \LaTeX
%%# is eliminated by TeX and thus also not considered as a separator.
%%# You may use braces {...} either around a whole entry or
%%# around indextext resp. sorttext resp. outputtext to allow spaces
%%# which do not act as "separators" in the corresponding part. The braces
%%# around these parts will vanish. In particular, you may generate an
%%# empty entry with {} or ! or @ (bordered by spaces).
%%# If you want that braces occur in the OUTPUT, you have to add an
%%# additional pair of braces. Be aware that you write sufficiently
%%# many braces, if you really should need them: For example,
%%# the command \varindex{{{{A B}}}}{} produces the index entry {A B}:
%%# The outermost pair of braces is eliminated immediately by TeX. The second
%%# pair is eliminated, because this is a pair around a complete entry.
%%# Finally, another pair is eliminated, because it is a brace around
%%# indextext.
%%# With the flag `1', {main entries} is considered as one single entry.
%%# Nevertheless, also with this flag, an additional pair of braces around
%%# main entry is eliminated.
%%#
%%#
%%# The format string  has one of the following three forms
%%#   indexa[`space' indexb][`space' indexc] ... [*outputa][*outputb] ...
%%#   [*outputa][`space' indexa][`space' indexb][*outputc] ...
%%#   *
%%# where the order of arguments can be arbitrarily mixed (except for the first
%%# indexa in the first form). indexa indexb ... outputa ... describe the
%%# format of the index entries resp. of the output into the running text.
%%# The output is generated in the given order (this might be important, if
%%# a pagebreak occurs during the output into the running text).
%%# The last case is exceptional and equivalent to `*space'.
%%# The following characters/strings describe the format:
%%#
%%#  1-9: entry1-9
%%#  0:   entry 10
%%#  ~:   a placeholder sign
%%#  =:   alternative placeholder sign
%%#  _:   a space character
%%#  s:   The token \space (but _ is used for the sort entry)
%%#  .:   No space will follow
%%#  ,:   The character , (space will follow)
%%#  -:   The character - (no space will follow)
%%#  !:   Create a new sublevel
%%# All other tokens in this argument are forbidden.
%%# The token ! makes no sense for the output in the running text and thus
%%# is forbidden behind *.
%%#
%%# By a heuristic rule, a space is automatically inserted between two entries
%%# which generate non-empty text.  If the heuristic rule fails, you may always
%%# force a space by either "_" or "s", or forbid a space by ".".
%%#
%%# If a format is empty, all entries are taken in the order of input.
%%# Note that TeX eliminates concatenated spaces, and so you are able to
%%# produce an empty format entry only at the end or in front of a `*'.
%%# If you want to force an empty OUTPUT (is this ever useful?), you may use
%%# just "." as the entry.
%%#
%%# A sort entry is only written to the *.idx file if it differs from the
%%# text entry.

%%#
%%#
%%# Description of the \varindextwo macros:
%%#
%%# The macros
%%#
%%#   \varindextwoScan \varindextwo
%%#
%%# can be used together as parameters {scanprogram} resp. {mainprogram}
%%# for the \varindex command.
%%# If \varindex is called with these macros, and no
%%# explicit format argument is given, these macros generate a format
%%# depending on the number of entries in {main entries}:
%%#
%%# a) If there is only one entry in {main entries},
%%#    then the format "1" resp. "*1 1" is generated
%%#    (depending whether the * flag was used or not), i.e. the
%%#    entry is put into the index, and printed if \varindex was
%%#    called with the * flag.
%%#
%%# b) If there are two main entries like {graulty bazola},
%%#    then the format becomes { 1!~2 1!2~}, i.e. the index entries
%%#
%%#    graulty
%%#      ~ bazola
%%#
%%#    bazola
%%#       graulty ~
%%#
%%#    are produced.
%%#
%%#    You can modify the first format entry with the following flags:
%%#     flags  format used:           If used with `*' additionally:
%%#      _     12                     *12
%%#      -     1-2                    *1-2
%%#      ^     1!~-2 resp.  1!-2      *1-2
%%#      -^    1-!~.2 resp. 1-!~2     *1-2
%%#      .     1.2                    *1.2
%%#      .^    1!~.2                  *1.2
%%#      /     1!2   (without ~)      *12
%%#      <     no entry               *12
%%#
%%#    Here, the combinations -^ and .^ mean that both flags are used
%%#    (the order plays no role).
%%#    The output for ^ respectively -^ is determined by the switches
%%#        \varindextwoDashTildetrue (default)
%%#        \varindextwoDashTildefalse
%%#        \varindextwoDashSpacetrue
%%#        \varindextwoDashSpacefalse   (default)
%%#
%%#    You can modify the second format entry with the following flags:
%%#     flags  format used:
%%#      ,     2,1~ resp. 2,1
%%#      ~     21
%%#      =     2!1-~
%%#      ,=    2,1-~ resp. 2,1-
%%#      +     2-1
%%#      :     2!1.~
%%#      ,:    2,1.~ resp. 2,1
%%#      ;     2.1
%%#      >     no entry
%%#      !     Append ~ (if not already there)
%%#      ?     Without ~
%%#
%%#    Whether the first or the second alternatives in the above forms is used
%%#    depends on the status of the switch
%%#          \varindextwoCommaTildetrue   (default)
%%#          \varindextwoCommaTildefalse
%%#    We point out that "\varindextwoCommaTildefalse" was in earlier versions
%%#    of "varindex" the default (and could not be changed).
%%#    Note that this switch has no effect if the ! or ? flags are used.
%%#
%%#    HINT for remembering the symbols: The symbols _ . - for the first entry
%%#    are the same flags as for the output and the same flags which are used
%%#    in the format string. The corresponding symbols ~ : (and ;) = (and +)
%%#    for the second entry "look similar". The "," is only useful in the
%%#    second entry (and is the same symbol as in the format string).
%%#    The two exceptional symbols ">" and "<" can be read as "generate only
%%#    the forward-directed resp. backward-directed entry".
%%#
%%# c) If there are three main entries like {graulty of bazola}, then the
%%#    format becomes { 1!~23 3!12~}, i.e. the output becomes
%%#
%%#    graulty
%%#      ~ of bazola
%%#
%%#    bazola
%%#      graulty of ~
%%#
%%#    The flags have an analogous effect to b).
%%#    In addition, if the flags  ` resp. ' are used, the second word
%%#    (in our example: `of') is omitted from the output in the first resp.
%%#    in the second index entry. If the * flag and ` are used together, the
%%#    second entry is also omitted from the output into the running text.
%%#
%%# d) If there are four main entries like {graulty of OF bazola}, then the
%%#    format becomes { 1!~24 4!31~}, i.e. the output becomes
%%#
%%#    graulty
%%#      ~ of bazola
%%#
%%#    bazola
%%#      graulty OF ~
%%#
%%#    i.e. we have a similar effect as in c) except that for the first entry
%%#    the third word is skipped, and for the second entry the second word is
%%#    skipped. All flags as in c) can be used with an analogous meaning.
%%#    Also if the * flag is used, the output into the running text is
%%#    analogous to c) (the third word is skipped).
%%#
%%# e) If there are more than four main entries, then
%%#    (formatA) resp. (format*A) is used.
%%#
%%# If an explicit format argument is provided, then this is used except
%%# when it contains the symbol +. In this case, this symbol is replaced by the
%%# output which would be generated "normally". If additionally the `*'-flag
%%# is used, there is a special rule:
%%# If the explicit format contains a `*', then no additional `*'-output is
%%# produced. Otherwise, the `*'-output from a)-e) is prepended to the given
%%# format string (with a space at the end, unless the format string is empty).
%%# This means that `normally' you have the output from a)-e),
%%# unless you write an own `*'-part in the argument.
%%#
%%# If you do not like the tokens chosen for the default symbols, you can
%%# easily choose your own tokens by just replacing \varindextwoScan with your
%%# own macro (or defining your own ``magic'' tokens after \varindextwoScan,
%%# see Example 9. above).

%%#
%%#
%%# Primitive customization:
%%#
%%#
%%# You may use the command
%%#     \varindexUsePlaceholderAfalse
%%#     \varindexUsePlaceholderBfalse
%%# to ignore the sign ~ resp. = in the format entry.
%%# You can easily restore the default by
%%#     \varindexUsePlaceholderAtrue
%%#     \varindexUsePlaceholderBtrue
%%#
%%# If you want to switch off the placeholder only at the beginning of
%%# a new entry (resp. of a new subentry), you can use the commands
%%#     \varindexLeadingPlaceholderAfalse
%%#     \varindexLeadingPlaceholderBfalse
%%# The default is restored with
%%#     \varindexLeadingPlaceholderAtrue
%%#     \varindexLeadingPlaceholderBtrue
%%#
%%# By default, the "," in the format string is in this connection
%%# treated as a symbol generating a new "subentry". You can change this
%%# default with the command
%%#  \varindexCommaLeadsfalse
%%# You may switch back with
%%#  \varindexCommaLeadstrue
%%#
%%#
%%# The content of the macro
%%#   \varindexPlaceholderAText
%%#   \varindexPlaceholderASort
%%#   \varindexPlaceholderBText
%%#   \varindexPlaceholderBSort
%%# is used as the placeholder ~ resp. =  in the index resp. sort entry.
%%# Note that if one of these entries expands empty, different rules for
%%# the automatic insertion of spaces apply (for the index and sort entry
%%# separately).
%%#
%%# You may prefer that the placeholder text resp. sort content changes at
%%# run time to the context of the previous ! entry. For example, you may
%%# want that the command \varindex{Gibble Gobble}{2!~2} produces the index
%%# entry
%%#   Gibble
%%#     Gibble Gobble
%%# (or is at least SORTED as such an entry).
%%#
%%# You can achieve this with the commands
%%#  \varindexPreviousATexttrue
%%#  \varindexPreviousASorttrue
%%#  \varindexPreviousBTexttrue
%%#  \varindexPreviousBSorttrue
%%# for the text and sort entry and the placeholders ~ and =, respectively.
%%# With these commands, the content of \varindexPlaceholderAText etc
%%# is only used as the default if no previous ! entry was given.
%%# You can switch back to the default mode with the respective commands
%%#  \varindexPreviousATextfalse
%%#  \varindexPreviousASortfalse
%%#  \varindexPreviousBTextfalse
%%#  \varindexPreviousBSortfalse
%%#
%%# By default, the ',' in the format entry is considered in this connection
%%# similar to '!'. If you want to change this, use the command
%%#  \varindexCommaExpandfalse
%%# You may switch back with
%%#  \varindexCommaExpandtrue
%%#
%%# Since version 2.2, the dash "-" occurring at the beginning of entry
%%# (or after "!" or even after "," if \varindexCommaExpandtrue is in effect)
%%# is ignored for sorting. You can switch off this feature with the command
%%#
%%#   \let\varindexOutSortDashBeg\varindexOutSortDash
%%#
%%# To restore the new default, use
%%#
%%#   \let\varindexOutSortDashBeg\toolboxEmpty
%%#
%%#
%%# The commands
%%#
%%#   \varindexSetWordString{|}     % Use | as separator for entries instead
%%#                                 % of spaces.
%%#   \varindexSetSortString{>}     % default: @
%%#   \varindexSetPlainString{<}    % default: !
%%#
%%# set the default "magic" strings used for the main argument.
%%# The argument of the above macros is intentionally NOT expanded (so that
%%# you do not have troubles with active characters like ~).
%%# To force expansion, use e.g.
%%#   \expandafter\varindexSetWordString\expandafter{\MacroToExpand}
%%# or some similar construct.
%%#
%%# If you use a different separator than `space' for the entries, you may want
%%# to change the rule how braces are eliminated. With the commands
%%#   \varindexEliminateOuterBracetrue
%%#   \varindexEliminateInnerBracetrue
%%#   \varindexEliminateOuterBracefalse
%%#   \varindexEliminateInnerBracefalse
%%# you may allow resp. forbid the elimination of braces around the entries
%%# resp. around {indextext} {sorttext} and {outputtext}
%%# With the flag `1', {main entries} is considered as one single entry,
%%# but if \varindexEliminateOuterBracetrue is set (which is the default)
%%# also in this case an additional pair of braces around main entry is
%%# eliminated.
%%#
%%# Similarly as above,
%%#
%%#   \varindexSetIndexString{|}    % default: space
%%#   \varindexSetOutputString{<}   % default: *
%%#   \varindexSetTildeAString{~}   % (is default)
%%#   \varindexSetTildeBString{=}   % (is default)
%%#   \varindexSetSpaceString{_}    % (is default)
%%#   \varindexSetSpaceTokString{s} % (is default)
%%#   \varindexSetOmitString{.}     % (is default)
%%#   \varindexSetCommaString{,}    % (is default)
%%#   \varindexSetDashString{-}     % (is default)
%%#   \varindexSetExclamString{!}   % (is default)
%%#   \varindexSetStringForNr 1{a}  % default: 1
%%#   \varindexSetStringForNr{11}{b}% No default!
%%#
%%# sets the default "magic" strings used for the format argument.
%%# In contrast to before, the arguments are fully expanded (with
%%# \varindexedef, see below).
%%# Note that the last command provides a way to access more than 10 entries!
%%#
%%# If you use \varindexSetIndexString{|} (with some non-space token),
%%# you may still use spaces in the format which then are just ignored.
%%#
%%#
%%# Avoid that one string is a prefix of another string: In this case,
%%# strange effects may happen, and this behavior may even change in
%%# future releases of this package.
%%# Note that the above effect may arise unintentionally if you use active
%%# chars. For this reason, `~' is defined to expand to the letter `~',
%%# before the expansion is executed. Maybe in later releases of this package
%%# there will be further such redefinitions.
%%# You can explicitly use this feature in your own macros by using
%%# \varindexedef instead of the usual \edef, see below.
%%#
%%#
%%# You can change the output for the text resp sort entry of the various
%%# symbols used in the format string. More precisely, you can redefine
%%#
%%#     \varindexOutExclam     % Text output for !
%%#     \varindexFollowsExclam % Decide whether magic space after ! is inserted
%%#     \varindexOutTextComma  % Text output for ,
%%#     \varindexOutSortComma  % Sort output for ,
%%#     \varindexFollowsComma  % Decide whether magic space after , is inserted
%%#     \varindexPreceedsComma % Decide whether magic space before , is erased
%%#     \varindexOutTextSpace  % Text output for _
%%#     \varindexOutSortSpace  % Sort output for _
%%#     \varindexFollowsSpace  % Decide whether magic space after _ is inserted
%%#     \varindexPreceedsSpace % Decide whether magic space before _ is erase
%%#     \varindexOutTextSpTok  % Text output for s
%%#     \varindexOutSortSpTok  % Sort output for s
%%#     \varindexFollowsSpTok  % Decide whether magic space after s is inserted
%%#     \varindexPreceedsSpTok % Decide whether magic space before s is erased
%%#     \varindexOutTextDash   % Text output for -
%%#     \varindexOutSortDash   % Sort output for -
%%#     \varindexOutSortDashBeg% Sort output for - if nothing preceeds
%%#     \varindexFollowsDash   % Decide whether magic space after - is inserted
%%#     \varindexPreceedsDash  % Decide whether magic space before - is erased
%%#     \varindexOutTextOmit   % Text output for .
%%#     \varindexOutSortOmit   % Sort output for .
%%#     \varindexFollowsOmit   % Decide whether magic space after . is inserted
%%#     \varindexPreceedsOmit  % Decide whether magic space before . is erased
%%#
%%# The meaning is as follows: \varindexOut... should just expand to the
%%# tokens which should be written into the text resp. sort output.
%%# The corresponding macro \varindexFollows... is typically defined with
%%# one of the following commands:
%%#     \let\varindexFollows...\varindexNextSpace
%%#     \let\varindexFollows...\varindexNoNextSpace
%%# In the first case, a space is `magically' inserted in front of a
%%# subsequent token (unless this token erases the magic space).
%%# In the second case, no space follows, of course.
%%# There is an alternative call:
%%#     \def\varindexFollows...{\varindexSpaceTexttrue\varindexSpaceSortfalse}
%%# This definition achieves that for the text output a space should follow,
%%# but not for the sort output. Of course, you can also use similarly the
%%# commands \varindexSpaceTextfalse and/or \varindexSpaceSorttrue
%%# in the above definition (the effect should be obvious).
%%# In particular, \varindexNextSpace is equivalent to
%%# \varindexSpaceTexttrue\varindexSorttrue.
%%#
%%# The macro \varindexPreceeds... is similarly as \varindexFollows... with
%%# the difference that it is executed BEFORE the token in question is
%%# output. In particular, you can ignore a previous `magic space'.
%%# All of the `magic space' commands are defined by default with
%%#      \let\varindexFollows...\toolboxEmpty
%%#      \let\varindexPreceeds...\varindexNoNextSpace
%%# with the following two exceptions:
%%#      \let\varindexFollowsExclam\varindexNoNextSpace
%%#      \let\varindexFollowsComma\varindexNextSpace
%%#
%%# Documented Features (in later versions, these will still be available,
%%#  and if they contain a bug now, they will be repaired to work this way):
%%#
%%# (In a future release, varindex will cook your coffee, too)
%%#
%%#
%%#
%%# The main argument is NOT expanded, so you can actually write macros
%%# into the *.idx file. The command actually used to write the index is
%%#
%%#      \varindexIndex
%%#
%%# (which by default is of course defined as \index).
%%# Since some implementations of the \index command still (partially) expand
%%# their argument (which might be considered as a bug), the argument of
%%# \varindexIndex is translated before the actual call with the aid of
%%# \toolboxMakeHarmless.
%%# If you want to redefine \varindexIndex to a personal \index-output
%%# function, you might want to skip the \toolboxMakeHarmless step.
%%# This is arranged with the command
%%#
%%#    \varindexNoConvert
%%#
%%# You can cancel the effect of this command with
%%#
%%#    \varindexDoConvert
%%#
%%# Even if \varindexNoConvert is not in effect, the main argument is not
%%# expanded (and in particular, the argument of \varindexIndex consists of
%%# the corresponding entries in an unexpanded form).
%%#
%%# The whole \varindex... procedure takes place in a group, so all your
%%# variables are local to a single call (unless you use \gdef...
%%# (and friends) of course).
%%#
%%# There are no \global directives in any macro related with this package.
%%# In particular, if you call the above macros in a group (or redefine
%%# \varindexIndex), the effect holds only until the end of the group.
%%#
%%# In contrast to the main argument, the format argument is expanded
%%# (with \varindexedef, see below)
%%# (and also formatA resp. format*A is expanded before),
%%# so you can define abbreviations (even simple conditional abbreviations)
%%# for the format. Note, however, that the expansion is essentially only
%%# evaluated with \edef. So, you will probably not want to use e.g. \relax,
%%# since this command expands to itself (and  not into nothing - use
%%# \toolboxEmpty if you want the latter).
%%# If you want more complex abbreviations, use {mainprogram} instead.
%%#
%%# In order to help you write conditional abbreviations, the
%%# following variables are defined when your macro is expanded (and in
%%# particular also in {mainprogram}). You may of course redefine them
%%# appropriately:
%%#
%%#    \varindexAppend     The argument pagestyleA resp. pagestyleB.
%%#    \varindexCount      a TeX counter containing the number of entries in
%%#                        the main argument.
%%#    \varindexLastEntry  This is a macro (NOT a counter) which is usually
%%#                        the value of \the\varindexCount. See below.
%%#    \varindexEntry1-... The (index) text occuring in entry 1-...
%%#    \varindexSort1-...  The corresponding sort entry. If no sort entry was
%%#                        given, this is the same as the corresponding
%%#                        \varindexEntry1-...
%%#    \varindexPlain1-... The text which should be output in the text. If no
%%#                        such entry was given, this is the same as the
%%#                        corresponding \varindexEntry1-...
%%#
%%# \varindexCount may be larger than 10, and correspondingly there may be
%%# also more than 10 different \varindexEntry/Sort/Plain macros.
%%# If you ADD entries, you have to increase \varindexCount correspondingly,
%%# otherwise an error is produced if the format string contains an entry
%%# larger then \varindexCount. However, your additional entries are NOT
%%# output for EMPTY formats: For empty formats the number used is
%%# \varindexLastEntry. So if you want to output also your additional entries
%%# in empty formats, you have to set \varindexLastEntry to your modified
%%# value of \varindexCount in mainprogram. You may e.g. achieve this with
%%# the following lines:
%%#   \expandafter
%%#   \def\expandafter\varindexLastEntry\expandafter{\the\varindexCount}%
%%# It is admissible that \varindexLastEntry is larger than \varindexCount:
%%# In this case all entries until \varindexLastEntry are
%%# output in empty formats without producing an error (provided, of course,
%%# that the corresponding variables \varindexEntry.../Sort.../Plain... are
%%# defined).
%%#
%%# Note that numbers in TeX command names require special handling,
%%# i.e., you have to use something like 
%%#
%%# \csname varindexPlain2\endcsname
%%#
%%# to access variables. To avoid this, you may want to use the macros
%%# \toolboxLet and \toolboxWithNr of the toolbox package. Examples are
%%#   \toolboxWithNr 1\let{varindexEntry}\toolboxEmpty
%%#   \toolboxWithNr {10}\def{varindexSort}{Foo}
%%#   \toolboxLet    \mymacro{varindexPlain\the\mycount}
%%# These commands set \varindexEntry1 to \toolboxEmpty, \varindexSort10 to
%%# Foo, and \mymacro to the content of \varindexPlain5 (if \mycount=5).
%%#
%%# All these variables are also available when {mainprogram} is expanded.
%%# In {mainprogram} also the following functions are useful:
%%#
%%# \varindexFormat
%%#    This macro expands to the actual format string which is used.
%%#    The main purpose of {mainprogram} will usually be to (re)define
%%#    this macro. After {mainprogram} has been called, this macro is
%%#    modified in several ways:
%%#    1. \varindexFormat is expanded (with \varindexedef, see below).
%%#       (thus, \varindexFormat is expanded BEFORE AND AFTER the call
%%#        of {mainprogram}).
%%#    2. \ifvarindexStar is true (see below) a `*' resp. `* ' is prepended.
%%#    3. If it is only "*", it is replaced by "* ".
%%#    Note that before execution of {mainprogram}, no tests on the
%%#    validity of the format are done: You may use your own symbols to
%%#    `communicate' with {mainprogram} (if {mainprogram} eliminates these
%%#    symbols afterwards).
%%#
%%# \varindexFormatDefault
%%#    This macro expands to formatA resp format*A (in the expanded form)
%%#    depending whether the * flag has been used in the call.
%%#    Note that this expansion was executed BEFORE the optional format
%%#    argument is expanded for the first time.
%%#
%%# \ifvarindexStar ifpart [ \else elsepart] \fi
%%#    If the optional * was given, the ifpart is executed, otherwise the
%%#    else-part. This is a TeX-if-command. In particular, by
%%#    \varindexStarfalse resp. \varindexStartrue
%%#    you may change the behavior for future if's. This can be used
%%#    to prevent/force that a `*' resp. `* ' is prepended to the format
%%#    after the execution of {mainprogram}.
%%#    Setting of this variable has no effect in {scanprogram}
%%#
%%# \ifvarindexExplicitFormat
%%#    This is a TeX-if-command (see above) which is true if the optional
%%#    format argument [formatB] was given.
%%#
%%#
%%# To "compose" the format, you may want to use the macros
%%#
%%# \toolboxDef\macrotodefine{argumentlist}
%%# \toolboxAppend\macrotoappend{argumentlist}
%%# \varindexedef\macrotodefine{argumentlist}
%%#
%%# All commands work similar to \def resp. \edef with two differences:
%%#
%%# For \toolboxDef\macro the argumentlist is expanded precisely by one level
%%# (for details, see the documentation of the toolbox package).
%%# Of course, for \toolboxAppend, the new definition is appended to the old
%%# definition of \macro.
%%#
%%# \varindexedef fully expands argumentlist. However, some active symbols
%%# (currently only ~, but additional symbols might follow in a future release)
%%# are deactivated before expansion, so that ~ actually expands to ~ and not
%%# to a strange command sequence.
%%#
%%#
%%# To "decompose" the format, you may want to use one of the macros
%%#
%%# \toolboxSplitAt{arg}{critical}{\before}{\after}
%%# \toolboxMakeSplit{critical}{command} resp.
%%# \varindexMakeSplitExpand{\MacrosWhichExpandToCritical}{command}
%%# \varindexMakeVarSplit\variable{\MacrosWhichExpandToCritical}{command}
%%#
%%# The first two macros are described in the toolbox package.
%%# The remaining two macros are similar to \varindexMakeSplit with the
%%# difference that the argument {critical} is obtained by expanding
%%# \MacrosWhichExpandToCritical with the aid of \varindexedef.
%%# In the last form, additionally \variable is (re)defined to expand to
%%# the value of critical.
%%#
%%# The following instances of a command created by \toolboxMakeSplit
%%# exist (the content of "critical" should be obvious):
%%#
%%# \varindexSplitAtIndex   (generated by \varindexSetIndexString)
%%# \varindexSplitAtOutput
%%# \varindexSplitAtTildeA
%%# \varindexSplitAtTildeB
%%# \varindexSplitAtSpace   <- Here the default content of "critical" is "_"
%%# \varindexSplitAtSpaceTok<- Here the default content of "critical" is "s"
%%# \varindexSplitAtOmit
%%# \varindexSplitAtComma
%%# \varindexSplitAtDash
%%# \varindexSplitAtExclam
%%# \varindexSplitAtNr?? (here, ?? is the number as a string; use
%%#    \csname ....\endcsname to call this macro. Only those numbers are
%%#    admissible which have been introduced with \varindexSetStringForNr
%%#    (this is the case for 1-10)).
%%#
%%# There is also the instance
%%# \varindexSplitSpace (to be distinguished from \varindexSplitAtSpace)
%%# where "critical" is the space symbol.
%%#
%%#
%%# In addition, you may use the variables
%%#   \varindexIndexString
%%#   \varindexOutputString
%%#   \varindexTildeAString
%%#   ....
%%#   \varindexNr??String
%%# which expand to the corresponding strings.
%%#
%%# All the previous macros should not be redefined `by hand'.
%%# They are implicitly redefined by the \varindexSet... commands.
%%#
%%#
%%#
%%#
%%# To drop possible braces, use the command
%%#
%%#   \toolboxDropBrace\variable
%%#
%%# of the toolbox package.
%%#
%%#
%%# In {scanprogram} you may already want to call \toolboxMakeSplit:
%%# In this way many choices for the tokens are put into {scanprogram},
%%# and in this sense, you can consider {mainprogram} as `customizable'.
%%# Anyway, the main task of {scanprogram} is to introduce new flags with
%%#
%%#   \varindexNewFlag\token\position[program\varindexEndOfFlag]
%%# or
%%#   \varindexNewFlag\token\position[\programmacro]
%%#
%%# Here, \position is an (undefined) macro, and \token an arbitrary token.
%%# The [program(macro)] part is optional and is explained later.
%%# If token is entered in the current call of \varindex instead (or in
%%# addition to) the star, then \position is defined to expand to a
%%# (literally) number, namely the (last) position where token was given
%%# inside the "*-argument-list" (counting from 0). For example, if
%%#   \varindexNewFlag ,\commapos
%%#   \varindexNewFlag -\minuspos
%%#   \varindexNewFlag .\pointpos
%%# are used in \programA, then in the call
%%# \varindex(){\programA}{\programB},-**-{}
%%# the variable \commapos will expand in \programB to `0', while
%%# \minuspos will expand to `4' (the last position is taken). Finally,
%%# \pointpos is \undefined (unless you defined \pointpos differently AFTER
%%# the call of \varindexNewFlag; in this case, this is the default).
%%# If \varindexNewFlag is called multiple times with the same token,
%%# only the LAST call with this token takes effect.
%%#
%%# The flags `*' and `1' are introduced in this way with
%%#
%%# \varindexNewFlag *\varindexStarPos
%%# \varindexNewFlag 1\varindexOneEntry
%%#
%%# BEFORE {scanprogram} is executed. This means:
%%# 1. Usually, \varindexStarPos contains the (last) position of `*'
%%#    (resp. is undefined). Moreover, if you define \varindexStarPos in
%%#    {scanprogram} or in some flag, you get the same effect as if `*'
%%#    had been used.
%%#    An analogous remark holds for \varindexOneEntry.
%%# 2. If you introduce `*' with \varindexNewFlag, the `*' looses its
%%#    original meaning. The same holds for `1'.
%%#
%%# If you have added a [program(macro)] part, this part is expanded
%%# whenever the flag introduced by \token is used in the call of \varindex
%%# (note that it is not excluded that this happens several times within one
%%# call). More precisely, program is expanded AFTER the variable \position has
%%# been set to the corresponding value, so you may already use \position in
%%# the program part.
%%#
%%# IMPORTANT: The last token expanded in program MUST be \varindexEndOfFlag.
%%# This is not nice but has to do with the way TeX parses its arguments.
%%# Also if you use the form \programmacro, the VERY LAST token expanded
%%# must be \varindexEndOfFlag. Even a construction like
%%# \def\myprogrammacro{\ifx....
%%#   \CallSomeMacroWithvarindexEndOfFlagAtTheEnd
%%# \fi
%%# \varindexEndOfFlag}
%%# is forbidden: In \CallSomeMacroWithvarindexEndOfFlagAtTheEnd an error
%%# would occur at the end, since still the tokens \fi\varindexEndOfFlag
%%# are in the tokenlist when EndOfFlag is reached there.
%%# As a workaround, you may e.g. use
%%# \def\myprogrammacro{\ifx...
%%#    \def\execute{....\varindexEndOfFlag}%
%%# \else
%%#    \def\execute{\varindexEndOfFlag}%
%%# \execute}
%%#
%%# If you use the form [\programmacro], your macro may even read additional
%%# parameters. These parameters are expected in the call of \varindex BEHIND
%%# the flag you have introduced. So you may actually use flags with
%%# parameters. For example, if \scanprogram contains a macro like
%%#    \varindexNewFlag -\minuspos[\readpara]
%%# and you have defined
%%#    \def\readpara#1{\def\merk{#1}\varindexEndOfFlag}
%%# then the call \varindex(){\scanprogram}{\mainprg}*-{Foo}-{Foo 2}*{Entries}
%%# is admissible, and in mainprogram, \merk will have the value Foo 2.
%%#
%%# If you are more familiar with TeX, you can even allow OPTIONAL arguments
%%# following your flag: The value of the next (non-space) token is at the
%%# call of \programmacro already saved into the variable
%%#     \varindexNextToken,
%%# so you can just use it to test for e.g. [. In this connection, you may
%%# also want to use the commands
%%#     \varindexTestAndExec
%%#     \varindexSkipAndExec
%%# Please, see the program text how these commands are applied.

%%# Since version 2.1 you can also hack in personal extensions of the format
%%# string. To do this, use the command
%%#
%%#    \varindexNewFormat\splitcommand{action}
%%#
%%# Here, \splitcommand is a command generated by \toolboxMakeSplit or
%%# friends (preferably by \varindexMakeSplitExpand, because the command should
%%# act on the format string which is expand with \varindexedef).
%%# The string where it splits is the new string you can use
%%# in the format argument after this call. For each
%%# occurrence of the corresponding string in the format argument,
%%# action will be executed. If \splitcommand splits at a string which already
%%# had a previous meaning in the format string (or which is a prefix to
%%# such a string), the old meaning of these tokens in the format string is
%%# overridden.
%%#
%%# Typically, action will contain the following commands:
%%# One action will probably be to output a desired token (sequence) via
%%#
%%#    \varindexTokensOut{TextToken}{SortToken}
%%# or
%%#    \varindexTokensOutExpand\MacroForTextToken\MacroForSortToken
%%#
%%# In the first form, TextToken resp. SortToken is the token sequence put
%%# into the index or running text respectively into the sort entry of the
%%# index for the corresponding format entry. The second form is similar with
%%# the only difference that the arguments must be single macros which expand
%%# to TextToken and SortToken, respectively.
%%#
%%# The variable \ifvarindexIndexMode can be used to test whether the
%%# output goes into the running text or into the index (i.e. whether a `*'
%%# preceeded the current entry). For output into the text, SortToken is
%%# ignored, of course).
%%#
%%# Another action in \varindexNewFormat will probably be to take care of the
%%# magic space flags. This is achieved by a call to \varindexNextSpace or
%%# \varindexNoNextSpace (or separately via \varindexSpaceTexttrue/false resp.
%%# \varindexSpaceTexttrue/false); see the earlier description.
%%# The magic space flags are taken into account in "\varindexTokensOut".
%%# Thus, if you want to ignore the previous flag for some reason you should
%%# set them correspondingly before this call.
%%# However, after the call you should also set them correspondingly for
%%# further processing.
%%#
%%# Example:
%%#   \varindexMakeSplitExpand{:}{splitAtColon}
%%#   \varindexNewFormat\splitAtColon{%
%%#      \varindexNoNextSpace
%%#      \ifvarindexIndexMode
%%#         \varindexTokensOut{:}{}\varindexSpaceTexttrue
%%#      \else
%%#         \varindexTokensOut{---}{}\varindexNoNextSpace
%%#      \fi}
%%#
%%# defines a new format entry `:' which has the meaning that a colon
%%# (automagically followed by a space) is put into the index but not into
%%# the sort entry. Moreover, in the running text, the colon appears as a
%%# long dash with no space followed. In any case, there is no magic space
%%# output in front of the colon.
%%# 

%%# As an alternative action in \varindexNewFormat, you can also call the
%%# default commands for the format entries. The corresponding macros are
%%#
%%#        \varindexAddSpace           _
%%#        \varindexAddSpTok           s
%%#        \varindexAddOmit            .
%%#        \varindexAddDash            -
%%#        \varindexAddComma           ,
%%#        \varindexAddExclam          !
%%#        \varindexAddTildeA          ~
%%#        \varindexAddTildeB          =
%%#        \varindexAddNumber{number}  0-9 (the argument is 1-...)
%%#
%%# The precise meaning of these macros is intentionally NOT documented,
%%# because some details or side effects might change in a future release of
%%# "varindex". But just for this reason, it might be advantageous to use the
%%# above macros instead of writing personal substitutes which may fail to
%%# have such side effects.
%%#
%%# Example:
%%#    \varindexMakeSplitExpand{~-}{splitPhrase}% It is important to expand
%%#                                             % (to have correct ~ catcode)
%%#    \varindexNewFormat\splitPhrase{%
%%#       \varindexAddTildeA
%%#       \let\remember\varindexPreceedsDash
%%#       \let\varindexPreceedsDash\toolboxEmpty
%%#       \varindexAddDash
%%#       \let\varindexPreceedsDash\remember}
%%#
%%# After the above command, "~" and "-" have their usual meaning in
%%# the format string except when they follow immediately in the form "~-".
%%# In this case, the behavior of "-" changes as if \varindexPreceedsDash
%%# were empty (which has the effect that the output looks like "~ -" instead
%%# of "~-".
%%# Note that although "~" is a prefix to "~-", the converse is not true:
%%# Thus, the above command does not change the previous meaning of "~"
%%# (and of course also not of "-").

%%#
%%# Some hack:
%%# Tex ignores leading spaces in the argument list of a `normal' macro.
%%# This has the effect that you should be able to insert spaces BETWEEN any
%%# of your arguments without any trouble.
%%# If this does not work the expected way, you can use the command
%%# 
%%#    \let\varindexArgumentSpace\varindexSkipTricky
%%#
%%# which implements an own macro which does this task. Sadly, this can only
%%# be done with some catcode trickery which in turn might bring you in trouble
%%# with some (VERY) exotic packages. You can restore the default with
%%#
%%#    \let\varindexArgumentSpace\varindexSkipDefault
%%#
%%#
%%# All above custamization commands/variables may be used anytime between
%%# two \varindex calls. They take effect with the next \varindex call.



%%# The macros \varindextwoScan and \varindextwo are considered as a
%%# (very useful) EXAMPLE for the customization of the \varindex command.
%%# If you need further customization, have a look at their definition first.

%  This is the end of the ascii documentation
%</asciidocu>
%\fi\catcode\#6\relax
%
% \iffalse
%<*metainfo>
% \fi

% \def\basename{varindex}

%% \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         \~}

% \CheckSum{2042}

% \iffalse
%   \RecordChanges
% \fi
% \def\mypar{}
% \def\ChangesTab{}\let\orichanges\changes
%   \def\changes#1#2#3{\orichanges{#1}{#2}{#3}%
%   \expandafter\def\expandafter\ChangesTab\expandafter{\ChangesTab
%   \item[v#1 {\mdseries(\emph{#2})}] {#3.}}}
% \newcommand{\cmdcite}[1]{\texttt{\textbackslash#1}}

% \changes{2.3}{2013/11/26}{Update email, add license. Date/version remains the
%              same since only commments and documentation are modified}
% \changes{2.3}{2001/05/06}{Introduced new macros \cmdcite{varindexIndex},
%              \cmdcite{varindexDoConvert}, \cmdcite{varindexNoConvert}.
%              The layout of the documentation was slightly improved.
%              Moreover, a completely new section was added (on
%              \cmdcite{toolboxMakeDef}).\mypar
%              Use \cmdcite{typeout} instead of \cmdcite{message},
%              but provide a workaround for plain \TeX. Avoid error with
%              plain \TeX\ and \LaTeX 2.09 (because \cmdcite{newcount} is
%              defined there as \cmdcite{outer} which is rather annoying).
%              Since \texttt{toolbox} works around this problem, finally also
%              the local \cmdcite{if}'s now actually \emph{are} local}
% \changes{2.2}{2001/05/01}{Introduced \texttt{=:\^} flags into
%              \cmdcite{varindextwo}. Changed sorting of entries
%              starting with ``\texttt{-}''
%              (see \cmdcite{varindexOutSortDashBeg}).\mypar
%              Improved documentation, in particular of \cmdcite{varindextwo}
%              and \cmdcite{varindexNewFormat}.
%              Also new examples were added for both commands}
% \changes{2.1}{2001/04/30}{Finally implemented placeholder replacement
%              (\cmdcite{varindexPreviousATexttrue} and friends) such that
%              it works also in the expected way with commas.\mypar
%              Introduced separated command \cmdcite{varindexCommaExpandtrue}
%              which was in earlier versions automatically coupled with
%              \cmdcite{varindexCommaLeadstrue}. Changed the default of both
%              values to `true'.\mypar
%              Introduced \cmdcite{varindexOutText...} and friends and enabled
%              a hook into the format string processing via
%              \cmdcite{varindexNewFormat}.\mypar
%              Reordered documentation such that the more interesting
%              customization parts are now mentioned earlier}
% \changes{1.21}{2001/03/29}{Divided package into two: Many macros which are
%              of independent interest have been put into the \texttt{toolbox}
%              package. For the user visible is that the macros are now called
%              e.\,g.\ \cmdcite{toolboxMakeSplit} instead of
%              \cmdcite{varindexMakeSplit}. For backward compatibility,
%              the old (now obsolete) names are still available, although not
%              documented anymore}
% \changes{1.20}{2001/01/13}{Changed \cmdcite{varindextwo}:
%              Added the \cmdcite{varindextwoCommaTilde} functionality and the
%              corresponding three flags \texttt{?!/}. Moreover, changed the
%              default to \cmdcite{varindextwoCommaTildetrue}. Note that due to
%              this change the generated index entries may differ from those
%              of earlier versions. To get a backward compatible output,
%              you have to use \cmdcite{varindextwoCommaTildefalse}.\mypar
%              Also use now the symbols \texttt{`} and \texttt{'}
%              instead of the (now obsolete) \texttt{P} and \texttt{p} flags.
%              The reason for the latter is that \texttt{P} and \texttt{p}
%              could not be used immediately after a command without a space}
% \changes{1.19}{2000/12/07}{Eliminated a bug in the \texttt{P} flag}
% \changes{1.18}{2000/11/30}{Eliminated a bug in \cmdcite{SkipTricky}}
% \changes{1.17}{2000/11/21}{\cmdcite{varindexNr??String} is now defined
%              as documented}
% \changes{1.16}{2000/11/19}{Documentation rewritten
%              for doc and docstrip utilities (required files are now
%              \texttt{varindex.dtx} and \texttt{varindex.ins})}
% \changes{1.15}{2000/10/10}{Fixed harmless bug which always caused a warning}
% \changes{1.14}{2000/06/01}{First version released into public
%              (as \texttt{varindex.sty})}
%
% \iffalse
%
% The following part is the code needed to compile the documentation.
% We do some trickery here, because we want that this file here could be used
% for *both*: Compiling the documentation *and* as `varindex.sty'
% (if really required).
% Everything between the lines %<*driver> and %</driver>
% goes to the file `varindex.tex'.
%
% \fi
\ifcat @a% If this test is positive, then `@' has letter catcode which means
%          that this file is loaded as a style file (or as described in the
%          install section of the documentation).
\def\TemporaryDummy{}
\else\long\def\TemporaryDummy{%
%
%
% \iffalse
%</metainfo>
%<*driver>
\documentclass{ltxdoc}
\OnlyDescription%% Comment this out, or
%%\AlsoImplementation%% uncomment this line, if you want to see the source.

%% If you want an index, uncomment one of the following lines.
%% After running latex a first time, you have to use
%%      makeindex -s gind.ist varindex
%% Then run latex again.
%%\CodelineIndex% comment this out if you want an index referring to codelines
%%\PageIndex% comment this out if you want an index referring to pages
%%\OldMakeindex% uncomment this line, if your MakeIndex is pre-v2.9

\setlength\hfuzz{15pt}
\hbadness=7000
\begin{document}
\DocInput{varindex.dtx}
\end{document}
%</driver>
%<*metainfo>
% \fi
}
\fi\TemporaryDummy\let\TemporaryDummy\undefined
%
% \iffalse
%          Personal macros used for the doc utility:
% \fi
% \MakeShortVerb{"}
% \def\bracemeta#1{\texttt{\{}\meta{#1}\texttt{\}}}
% \def\nocomment{}
% \def\myspace{\texttt{\textvisiblespace}}
% \parindent0pt

%
% \newenvironment{myquote}{\begin{quote}\begin{raggedright}\relax
%}{\end{raggedright}\end{quote}}
% \newenvironment{myindex}{\begin{myquote}}{\end{myquote}}
% \def\myi{\par\hangindent 40pt\relax}
% \def\mys{\myi\hspace*{20pt}}
% \def\myss{\myi\hspace*{30pt}}
% \def\pnoa#1{, #1}
% \def\pno{\pnoa{17}}
% \def\mysee#1{\pnoa{\emph{see also} #1}}
% \def\sortedlike#1{\hspace*{10pt}(\emph{sorted like} #1)}
% \def\sortedlikeq#1{\sortedlike{``#1''}}
% \def\proz{\texttt{\%}}
% \def\ppari{\proz\\\hspace*{20pt}}
% \def\pari{\\\hspace*{20pt}}
% \def\myquad{\mbox{$\qquad$}}
% \def\macrott#1{{\mdseries\cmdcite{#1}}}

% \sloppy
% \title{The \texttt{varindex} package\thanks
%   {This package has version number \fileversion{}, last revised \filedate.
%   The package may be distributed and/or modified under the conditions of the
%   LaTeX Project Public License, either version 1.3c of this license or (at
%   your option) any later version. The latest version of this license is in
%   \texttt{http://www.latex-project.org/lppl.txt}, and version 1.3c or later
%   is part of all distributions of LaTeX version 2005/12/01 or later.}}
% \author{Martin V\"ath\thanks{This package bases on ideas of
%   \texttt{indextwo.sty} which was written jointly with
%   O.~Karch \texttt{karch@informatik.uni-wuerzburg.de} and
%   H.-C.~Wirth \texttt{wirth@informatik.uni-wuerzburg.de}}\\
%       {\texttt{martin@mvath.de}}}
% \date{\docdate}
% \maketitle          

% \begin{abstract}
% This \LaTeX\ package provides a luxury front-end for the "\index" command.
% For example, it allows to generate multiple \index entries in
% almost any form by a single command. It is extremely customizable, and works
% with all versions of \LaTeX\ and probably most other \TeX\ formats, too.
% \end{abstract}

% You may copy this package freely, as long as you distribute only unmodified
% and complete versions.

% \tableofcontents

% \section{Changes}
%
% \begin{description}
%    \def\mypar{\par}\ChangesTab
% \end{description}
%

% \section{Introduction}
%
% If you have to write an index for a larger scientific text, you will probably
% sooner or later have the problem that you want to put certain texts into the
% index which consist of more than one word like \emph{Theorem of Picard}.
% \par
% There are several reasonable ways how one might do this: One might put the
% text "Theorem of Picard" in the index, or "Picard theorem".
% An alternative way is "Picard, Theorem", or "Picard's Theorem"
% or "Theorem!Picard"
% (here, "!" is the symbol used by "makeindex" to separate a
% subindex, i.\,e.\ the output will actually look like
% \begin{myindex}
% \myi Theorem
% \mys Picard\pno
% \end{myindex}
% This is useful if one also has other entries starting with \emph{Theorem}).
% Several other natural alternatives are also possible.
% \par
% One may choose some or all of the above alternatives and then code them into
% \TeX. However, if more than one of these alternatives is desired in the
% index, this requires several "\index" commands (which are similar but not
% identical). Moreover, if later another choice of the above alternatives
% is required, the index entries must be completely rewritten.
% This rewriting may be very cumbersome if one makes use of subindices
% for two reasons.
% \par
% First, it may happen that one has to change even entries which are
% apparently not affected. For example, assume there were just two subindices
% for the index entry \emph{Theorem}, namely "Theorem!Picard" and
% "Theorem!Riemann". If the theorem of Picard is eliminated from the main
% text, one not only has to delete the entry "Theorem!Picard": The single
% subindex "Theorem!Riemann" does not make much sense -- one should replace
% it by "Theorem, Riemann". One could write a program to do this task
% automatically, but my experience shows that it is better to do such things
% by hand, because there are some situations where exceptions are desirable.
% \par
% However, things become really cumbersome, if one also has to sort the
% entries in a different way than they are written. For example, suppose
% that instead of \emph{Theorem} in the above example, one has the text
% \emph{$\zeta$-function} which one wants to have sorted like
% \emph{zeta-function}. In this case, the "\index"
% command must be changed from
% \begin{verbatim}
%   \index{zeta-function@$\zeta$-function!Riemann}\end{verbatim}
%
% into
% \begin{verbatim}
%   \index{zeta-function, Riemann@$\zeta$-function, Riemann}\end{verbatim}
%
% which is rather different!
% \par
% Moreover, one may also want to have a placeholder. For example, instead of
% generating the entries
% \begin{myindex}
% \myi Theorem
% \mys Liouville\pno
% \mys Open Mapping\pno
% \mys Picard\pno
% \end{myindex}
% One might like to have entries like
% \begin{myindex}
% \myi Theorem
% \mys $\sim$ of Liouville\pno
% \mys Open Mapping $\sim$\pno
% \mys $\sim$ of Picard\pno
% \end{myindex}
% One might use the symbol "$\sim$" for the placeholder, but this needs of
% course its own sort entry in the "\index" command (in the above example,
% we sorted by \emph{Liouville}, \emph{Open Mapping}, and \emph{Picard},
% respectively, which is perhaps the most natural choice).
% \par
% With the package "varindex" it is rather simple to generate any of the
% above "\index" entries, and it is easy to modify them, e.\,g.\ the above
% placeholders can be introduced easily and then activated or deactivated by
% a switch. Moreover, several "\index" entries like "Picard, Theorem of"
% and "Theorem of Picard" can be generated simultaneously with a
% \emph{single} command (i.\,e.\ you have to write the phrase
% "Theorem of Picard" only once). In addition, it is also possible to produce
% not only corresponding "\index" commands but also to output the content
% into the running text.
% \par
% Since my experience shows that in each new book there arise new special cases
% for the "\index" command, I was trying to provide a
% \emph{highly customizable} solution which can be modified for all
% needs (I hope).

% \section{Installation}
%
% This package was tested with \LaTeX 2.09 and \LaTeXe\ and should work
% with all other (future) versions of \LaTeX\ and friends, too.
% It should even run with other (non-\LaTeX) formats if an "\index" command
% (with \LaTeX-Syntax) is provided.
%
% To use ``varindex'', you have to put the file "varindex.sty" in a path where
% \TeX\ looks for its input files. You must also have the file "toolbox.sty"
% of the ``toolbox'' package in your path (toolbox~v3.1 or newer is required).
% The \TeX\ documents using  varindex need the
% following modifications in their header:
%
% \begin{itemize}
% \item If you use \LaTeXe, put in the preamble the command
%   \begin{verbatim}
%     \usepackage{varindex}\end{verbatim}
%
% \item If you use \LaTeX 2.09, use "varindex" as a style option, e.\,g.\
%   \begin{verbatim}
%     \documentstyle[varindex]{article}\end{verbatim}
%    or
%   \begin{verbatim}
%     \documentstyle[varindex,12pt]{article}\end{verbatim}
%
% \item If you use some other (non-\LaTeX) format, you will probably have to
%    insert a line like
% \begin{verbatim}
% \catcode`\@=11\relax\input varindex.sty\catcode`\@=12\relax\end{verbatim}
%
% \end{itemize}
%
% For \TeX\ insiders: \LaTeX-specific commands used in "varindex.sty" are only:
%
% \begin{itemize}
% \item "\makeatother"
% \item "\makeatletter"
% \item "\typeout"
% \item "\RequirePackage"
% \item "\newcommand" (used only in the form "\newcommand{"\meta{command}"}{}"
%       to ensure that \meta{command} was not defined before)
% \item "\ProvidesPackage"
% \end{itemize}
% The above commands are used only if they are defined (otherwise,
% natural substitutes are used ("\newcommand" and "\ProvidesPackage" are
% then not used at all)).\bigskip

% \section{Additional hint}
%
% Although this package provides a convenient way to write "\index" commands,
% this may not be sufficient: Also with this package, the "\index" commands
% may still be rather complex. For some books, it might be necessary to write
% the same "\index" entries several times (to get various page numbers).
% The first idea that one might have in this case is to define a list of the
% used "\index" commands near the beginning of the document e.\,g.\ as:
% \begin{verbatim}
% \newcommand{\Index}{\varindex(){\varindextwoScan}{\varindextwo}[]}
% \newcommand{\Riemann}{\Index{Riemann Stieltjes integral}[1-23 2,1-~3 3!1-2~]}
% \newcommand{\sigmaa}{\Index-={$\sigma$@sigma algebra}}\end{verbatim}
% (the first line and the usage of "\Index" is explained in later sections;
% here, it is sufficient to know that "\Index" produces in the above form
% several "\index" entries).
% To produce the corresponding "\index" entries in the
% running text, one then just needs to use "\Riemann" resp.\ "\sigmaa".
% However, this method has some disadvantages:
% \begin{enumerate}
% \item If one has many "\index" entries, it is easy to forget that e.\,g.\
%       "\sigmaa" is a command which should produce an index entry.
%       Then "\sigmaa" in the main text might be rather confusing.
% \item One has to take care of macros already provided by \TeX, \LaTeX\ or
%       some packages. For example, it is not possible to use the name
%       "\sigma" for the above purpose.
% \end{enumerate}
% To avoid these problems, one may be very disciplinary and call the
% involved macros systematically e.\,g.\ "\IndexRiemann" "\Indexsigmaa" etc.
% However, this produces terrible long and unreadable macro names in the main
% text.\par
% The "toolbox" package (version 3.1 or newer) provides a more convenient
% solution: You can use the command
% \begin{verbatim}
%   \newcommand{\Index}{\varindex(){\varindextwoScan}{\varindextwo}[]}
%   \toolboxMakeDef{Idx}{#1}\end{verbatim}
% and afterwards
% \begin{verbatim}
%   \NewIdx{R-S}{\Index{Riemann Stieltjes integral}[1-23 2,1-~3 3!1-2~]}
%   \NewIdx{sigma-algebra}{\Index-={$\sigma$@sigma algebra}}\end{verbatim}
% After these definitions, you can use the intuitive commands
% "\Idx{R-S}" and "\Idx{sigma-algebra}" to produce the corresponding
% index entries.\par
% Note also the symbol ``-'' in the above names which is usually not allowed
% in \TeX\ macros.\par
%
% If several page numbers occur for one index entry, it may be convenient for
% the reader if the ``main page number(s)'' (e.\,g.\ the place(s)
% where the corresponding notion is defined) is written in a different style.
% Of course, this is supported by "\varindex" (as explained later). To use this
% feature in connection with "\toolboxMakeDef", there are several
% possibilities. A straightforward way is to add in addition to the above
% commands also
% \begin{verbatim}
%   \NewIdx{R-S*}{\Index[|textbf]%
%     {Riemann Stieltjes integral}[1-23 2,1-~3 3!1-2~]}
%   \NewIdx{sigma-algebra*}{\Index[|textbf]%
%     -={$\sigma$@sigma algebra}}\end{verbatim}
% Then "\Idx{R-S*}" and "\Idx{sigma-algebra*}" produce index entries
% with boldface page numbers. Of course, you can automatize the task of
% generating macros which produce normal and boldface page numbers
% e.\,g.\ as follows:
% \begin{verbatim}
%   \newcommand{\Index}{\varindex(){\varindextwoScan}{\varindextwo}[]}
%   \toolboxMakeDef{Idx}{#1}
%   \newcommand{\MakeIdx}[2]{%
%     \NewIdx{#1}{\Index#2}%
%     \NewIdx{#1*}{\Index[|textbf]#2}}
%
%   \MakeIdx{R-S}{{Riemann Stieltjes integral}[1-23 2,1-~3 3!1-2~]}
%   \MakeIdx{sigma-algebra}{-={$\sigma$@sigma algebra}}\end{verbatim}
% This provides the commands "\Idx{R-S}" "\Idx{R-S*}"
% "\Idx{sigma-algebra}" and "\Idx{sigma-algebra*}" with the same functionality
% as explained before.\par
%
% The above approach has the disadvantage that the names ``$\ldots$"*"'' have
% automatically a fixed meaning. Alternatively, you can also generate different
% main commands. This is immediately supported by "\toolboxMakDef":
% \begin{verbatim}
%   \newcommand{\Index}{\varindex(){\varindextwoScan}{\varindextwo}[]}
%   \toolboxMakeDef{Idx}{\Index#1}
%   \toolboxMakeDef{IdxMain}{\Index[|textbf]#1}
%
%   \NewIdx{R-S}{{Riemann Stieltjes integral}[1-23 2,1-~3 3!1-2~]}
%   \NewIdxMain{R-S}{%
%     {Riemann Stieltjes integral}[1-23 2,1-~3 3!1-2~]}\end{verbatim}
% Now you can use "\Idx{R-S}" and "\IdxMain{R-S}" to produce the
% normal respectively boldface page numbers. Of course, you can also automatize
% in this case the task of generating these commands:
% \begin{verbatim}
%   \newcommand{\Index}{\varindex(){\varindextwoScan}{\varindextwo}[]}
%   \toolboxMakeDef{Idx}{\Index#1}
%   \toolboxMakeDef{IdxMain}{\Index[|textbf]#1}
%   \newcommand{\NewIdxBoth}[2]{%
%     \NewIdx{#1}{#2}%
%     \NewIdxMain{#1}{#2}}
%
%   \NewIdxBoth{R-S}{{Riemann Stieltjes integral}[1-23 2,1-~3 3!1-2~]}
%   \NewIdxBoth{sigma-algebra}{-={$\sigma$@sigma algebra}}\end{verbatim}
% After the above commands, you can use "\Idx{R-S}", "\IdxMain{R-S}",
% "\Idx{sigma-algebra}" and "\IdxMain{sigma-algebra}" with their obvious
% meaning.\par\bigskip
%
% \textbf{Summarizing}: The last of the above solutions is the one which
% I recommend.\par\bigskip
%
% For further possibilities of the "\toolboxMakeDef" command (like making
% copies of entries, redefining entries, etc.), please read the
% original documentation of the "toolbox" package.

% \section{Examples}
%
% Probably you are very impatient and want to see some examples.
% So, here you are -- but be warned that the examples are not explained in
% detail. You have to read the later sections to understand more precisely
% why the examples work the way they do.
% \par
% Since the "\varindex" command is highly customizable,
% the following examples can only give you a rough impression of what
% you can actually do with it.
%
% \subsection{Typical example of usage (using the \texttt{varindextwo} macros)}
% \label{s:firstex}
%
% Suppose the following customization of the "\varindex" command was defined:
% \begin{verbatim}
% \def\Index{\varindex(){\varindextwoScan}{\varindextwo}[\emph]}\end{verbatim}
%
% Since we used the "varindextwo" macros here, by default
% \emph{two} "\index" entries are generated with a single command.
% After the above definition, the command
% \begin{verbatim}
%   \Index{ring with $1$@one}\end{verbatim}
%
% will produces the "\index" entries for:
%
% \begin{myindex}
% \myi ring
% \mys $\sim$ with $1$\pno\sortedlikeq{with one}
% \myi $1$\sortedlikeq{one}
% \mys ring with $\sim$\pno\sortedlike
%     {``ring with'' (without \mbox{``$\sim$''!})}
% \end{myindex}
%
% One of the examples of the introduction can be generated with
% \begin{verbatim}
%   \Index*{Theorem of@ Picard}\end{verbatim}
% which produces the two "\index" entries for
%
% \begin{myindex}
% \myi Theorem
% \mys $\sim$ of Picard\pno\sortedlikeq{Picard}
% \myi Picard
% \mys Theorem of $\sim$\pno\sortedlikeq{Theorem}
% \end{myindex}
% In this example, the word "of" is ignored for the sorting, because we put
% the symbol "@"\meta{nothing} behind it which means that it should be sorted
% as the empty string (in cases like this, also the space in front of "Picard"
% is automatically ignored for the sort entry).
%
% Since we used in the above example the form "\Index*" instead of "\Index",
% additionally the text "\emph{Theorem of Picard}" is output into the running
% text (the string "\emph" stems from our customization of "\Index" defined
% in the beginning).
% \bigskip
%
% \emph{Completely} different entries may be generated by your own rules.
% To this end, an optional parameter "["\meta{format}"]" can be appended.
% Internally, the main argument is splitted into words which are numbered
% $1,2,\ldots$; in \meta{format}, you can refer to these words simply
% by using the corresponding numbers. An ``empty'' entry in \meta{format}
% means all words in the original order (i.\,e.\ it is essentially equivalent
% to $12345\ldots$). Some other symbols besides numbers are also allowed
% which are listed later.
%
% \begin{verbatim*}
%\Index{Hausdorff measure of noncompactness}[4,23 2!~34!1= ]\end{verbatim*}
% generates \emph{three} index entries:
%
% \begin{myindex}
% \myi noncompactness, measure of\pno
% \myi measure
% \mys $\sim$ of noncompactness
% \myss Hausdorff $\approx$\pno
% \myi Hausdorff measure of noncompactness\pno
% \end{myindex}
%
% The last of these entries occurs only, because the last character in
% the \meta{format} argument "[4,23"\myspace"2!~34!1="\myspace"]" is a space
% (the space following "=" tells "varindex" that another (empty) entry is
% desired).
% \par
%
% If you want only slight modification(s) of the default, you need also just
% slight modification(s) of the command, e.\,g.
% \begin{verbatim}
% \Index*,{ring with $1$@one}\end{verbatim}
%
% has the same effect as in our earlier example,
% just that the second entry reads
%
% \begin{myindex}
% \myi $1$, ring with $\sim$\pno\sortedlikeq{one, ring with}
% \end{myindex}
% Moreover, since the `"*"' occurred in the previous command, additionally
%
% \begin{verbatim}
%   \emph{ring with $1$}\end{verbatim}
%
% appears in the running text. Praxis shows that changes in the entries as
% above have to be made frequently in the `fine tuning' of the index of a
% book. Note that with the original "\index", the command would have to be
% changed completely for the above entries, because we have a ``sort'' entry
% for which a different rule applies if we use a subitem (``"!"'')
% instead of a ``","\myspace''.
% (BTW: "\varindex" produces sort entries only if they are necessary).
% \par
%
% Of course, you may combine the default with your own format:
% \begin{verbatim*}\Index{internal integrable function}[23,1~ +]\end{verbatim*}
%
% generates
% \begin{myindex}
% \myi internal function, integrable $\sim$\pno
% \myi internal
% \mys $\sim$ integrable function\pno
% \myi function
% \mys internal integrable $\sim$\pno
% \end{myindex}
% In this example, the first entry is generated by the symbols "23,1~" in the
% \meta{format} argument, and the last two entries are those entries which
% would have been generated by the "varindextwo" macros if no \meta{format}
% argument had been given -- the magic symbol "+" instructs the "varindextwo"
% macros to not suppress these entries.
%
%
% \subsection{A simple example without the \texttt{varindextwo} macros}
%
% As known from "\index", a "|see{...}" can be used to produce a reference to
% another index entry instead of a page number. Such a command may optionally
% be appended.
% \begin{verbatim*}
%\varindex*{topology of a normed space}{5!4~!1= 45,12}[|see{norm}]
%\end{verbatim*}
% \begin{myindex}
% \myi space
% \mys normed $\sim$
% \myss topology $\approx$\mysee{norm}
% \myi normed space, topology of\mysee{norm}
% \end{myindex}
% (the precise appearance of ``\emph{see also} '' depends on how the "\see"
% macro is defined in your style). The above command additionally inserts the
% tokens "{topology of a normed space}" into the running text (this would not
% happen if "\varindex" is used in place of "\varindex*").
% Only in the first of the above entries, an `"@"' part will be added to the
% "*.idx" file: This entry is sorted as if ``\myspace$\sim$'' resp.\
% ``\myspace$\approx$'' would not exist.
%
%
% \subsection{Another example without the \texttt{varindextwo} macros}
%
% The appearance of the cited page number and the appearance in the
% running text (only available with ``"*"'') can be customized easily.
%
% \begin{verbatim}
% \varindex[\emph][|textbf]%
%     {$\sigma$@sigma!$(\sigma-)$ finite {measure space}}%
%     {*1.23 23 23,1- 1-23}\end{verbatim}
%
% generates the three index entries
% \begin{myindex}
% \myi finite measure space\pnoa{\textbf{42}}
% \myi finite measure space, $\sigma$-\pnoa{\textbf{42}}\sortedlikeq
%   {finite measure space, \mbox{sigma-}}
% \myi $\sigma$-finite measure space\pnoa{\textbf{42}}\sortedlikeq
%   {sigma-finite measure space}
% \end{myindex}
% In all three entries the pages are printed using "\textbf".
% Moreover, the tokens
% \begin{verbatim}
%   \emph{($\sigma$-)finite measure space}\end{verbatim}
%
% are put into the running text.
%
% \subsection{A simple example using a flag
%    (without the \texttt{varindextwo} macros)}
%
% Note the token "1" in the following command:
% \begin{verbatim}
%  \varindex1{$L$ and $M$@L and M}{}\end{verbatim}
%
% This command generates the index entry
% \begin{myindex}
%   \myi $L$ and $M$\pno\sortedlikeq{L and M}
% \end{myindex}
% With the command
% \begin{verbatim}
%   \varindex1*{$L$ and $M$@L and M}{}\end{verbatim}
% or
% \begin{verbatim}
%   \varindex*1{$L$ and $M$@L and M}{}\end{verbatim}
%
% additionally, "{$L$ and $M$}" is output into the running text.
%
% Note that without the `"1"', the index generated were
% \begin{myindex}
%   \myi "$L$ and $M$ and M"\pno\sortedlikeq{"\$L\$ and L and M"}
% \end{myindex}
%
% \subsection{An example for very primitive customized index commands
%   (without the \texttt{varindextwo} macros)}
%
% If you defined your ``default'' shortcuts appropriately, you can still
% override some of your own defaults.
%
% \begin{verbatim}
% \def\myindexA{\varindex[\emph][|textbf]*}
% \def\myindexB{\varindex(){}{}[\emph][|textbf]}
%
% \myindexA{Foo1}{}
% \myindexB{Foo2}[][]
% \myindexB*{Foo3!{Foo 3}}\end{verbatim}
%
% Generates the index entries "Foo1", "Foo2", and "Foo3". Moreover,
% "\emph{Foo1}" and "\emph{Foo 3}" is put into the running text.
% The page number of "Foo 2" in the index is printed normal (i.\,e.\ "|textbf"
% is overridden), the others with "\textbf". Note that by using braces,
% it was possible to include a space into the text "Foo 3".
%
%
% \subsection{An example of a primitive customized index command
%   (without the \texttt{varindextwo} macros)}\label{s:myindex}
%
% \TeX\ code can be inserted to customize the default formatting string.
% \begin{verbatim}
% \def\myindex{\varindex(\ifnum\varindexCount=2 1!2 2,1\fi){}{}[\emph]}
%
% \myindex{Foo Bar}\end{verbatim}
%
%    generates the index entries
% \begin{myindex}
% \myi Foo
% \mys Bar\pno
% \myi Bar, Foo\pno
% \end{myindex}
%
% \begin{verbatim}
% \myindex*{Foo Bar}\end{verbatim}
%
% generates the same index entries as above and additionally outputs
% "\emph{Foo Bar}" into the running text.
%
% \begin{verbatim}
% \myindex*{other format}[21]\end{verbatim}
%
% generates the index entry
% \begin{myindex}
% \myi format other\pno
% \end{myindex}
% and outputs "\emph{other format}" into the running text.
%
% \begin{verbatim}
% \myindex[|textbf]*{BoBo}\end{verbatim}
%
% generates the index entry
% \begin{myindex}
% \myi BoBo\pnoa{\textbf{42}}
% \end{myindex}
%  where the page number is printed with "\textbf".
%  Moreover, "\emph{BoBo}" is output into the running text.
%
% \subsection{A primitive varying customized index command
%     (without the \texttt{varindextwo} macros)}
%
% \begin{verbatim}
% \def\myindex{\varindex(\ifnum\varindexCount=2 1!2 2,1\fi)%
%     (\ifnum\varindexCount=2*2,1 1!2 2,1\fi){}{}[\emph]}\end{verbatim}
%
% With the same commands as in Section~\ref{s:myindex}, the same index entries
% are generated, but the tokens "\emph{Far, Boo}", "\emph{other format}",
% and "\emph{Bobo}" are output into the running text.
%
%
% \subsection{Examples with the \texttt{varindextwo} macros}
%
% As mentioned earlier, if the "varindextwo" macros are used (and if
% the main arguments contains at least two entries), then two
% "\index" entries are generated by default. Roughly speaking, one "\index"
% entry is the argument in its given order and the other is the argument in
% reverse order (this is not precise, but explains the idea).\par
%
% For the following examples,
% we use a similar definition for "\Index" as in Section~\ref{s:firstex},
% and define an "\iemph" macro which has `"*"' as a default and outputs with
% "\emph". I recommend to put both sort of definitions into the preamble of
% all of your files which should use "varindex" (the names are of course
% subject to your personal taste).
%
% \begin{verbatim}
% \def\Index{\varindex(){\varindextwoScan}{\varindextwo}[]}
% \def\iemph{\varindex(){\varindextwoScan\def\varindexStarPos{}}%
%              {\varindextwo}[\emph]}\end{verbatim}
%
% (note that the apparently simpler definition
% \begin{verbatim}
% \def\iemph{\varindex(){\varindextwoScan}{\varindextwo}[\emph]*}\end{verbatim}
%  is not as good as the above definition of "\iemph" as is explained below).
%
% After the above customization, you may use the following commands.
% \begin{verbatim}
% \Index*{measure of $\gamma$-noncompactness@gamma-noncompactness!FOO}
% \end{verbatim}
% generates the index entries
% \begin{myindex}
% \myi measure
% \mys $\sim$ of $\gamma$-noncompactness\pno\sortedlikeq
%        {of gamma-noncompactness}
% \myi $\gamma$-noncompactness\sortedlike{gamma-noncompactness}
% \mys measure of $\sim$\pno
% \end{myindex}
% and outputs the tokens "{measure of FOO}" into the running text.
% Note the order of the words!
%
% \begin{verbatim}
%   \Index*,?_'{flic of flac}\end{verbatim}
%
% generates
% \begin{myindex}
% \myi flic of flac\pno
% \myi flac, flic\pno
% \end{myindex}
% and outputs "{flic of flac}". Here, the two tokens "_" and "," had the
% effect that a space resp.\ ``","\myspace'' was used instead of a subentry
% in the first resp.\ second "\index" entry; the token "'" caused the
% preposition "of" to disappear in the second entry, and the token "?"
% suppressed a trailing $\sim$ in the second entry.\par
%
% A more realistic example is
% \begin{verbatim}
%   \Index^={$\sigma$@sigma algebra}\end{verbatim}
%
% which in both entries inserts a ``-'':
%
% \begin{myindex}
% \myi $\sigma$\sortedlikeq{sigma}
% \mys $\sim$-algebra\sortedlike{``algebra'' or ``-algebra'', see below}
% \myi algebra
% \mys $\sigma$-$\sim$\pno\sortedlikeq{sigma-}
% \end{myindex}
% Here, the sorting ``-algebra'' is chosen when you used
% \begin{verbatim}
%   \let\varindexOutSortDashBeg\varindexOutSortDash\end{verbatim}
% as described later.\par
%
% The flag "^" in conjunction with "-" has a special meaning:
% \begin{verbatim}
%   \Index^->{$\sigma$@sigma algebra}\end{verbatim}
% Then the first entry reads instead (the second is canceled because of ">"):
%
% \begin{myindex}
% \myi $\sigma$-\sortedlikeq{sigma-}
% \mys $\sim$ algebra\pno\sortedlikeq{algebra}
% \end{myindex}
%
% Similarly, the conjunction "^" and "." has a special meaning:
% \begin{verbatim}
%   \Index^.,:{ultra filter}\end{verbatim}
%
% generates entries without a space following $\sim$ (and in view of the flag
% "," no new subentry is used for the second entry but instead a ``,''):
%
% \begin{myindex}
% \myi ultra
% \mys $\sim$filter\pno\sortedlike{filter}
% \myi filter, ultra$\sim$\pno\sortedlike{filter, ultra}
% \end{myindex}
%
% For crossreferences, one may use something like
% \begin{verbatim}
%   \iemph[|see{recursive recursion}],_{recursive recursion}\end{verbatim}
%
% which generates
% \begin{myindex}
% \myi recursive recursion\mysee{recursive recursion}
% \myi recursion, recursive $\sim$\mysee{recursive recursion}
% \end{myindex}
% and outputs "\emph{recursive recursion}". If we would have used instead the
% definition
% \begin{verbatim}
%   \def\iemph{\varindex(){\varindextwoScan}{\varindextwo}[]*}\end{verbatim}
%
% the above call were not possible, since the optional arguments "[|see...]"
%  must occur in front of the flag `"*"'.
%
% \begin{verbatim}
%   \Index-;*{Flip Flop}\end{verbatim}
%
% generates
% \begin{myindex}
% \myi Flip-Flop\pno
% \myi FlopFlip\pno
% \end{myindex}
% and outputs "{Flip-Flop}" (note that the symbol "-" which is caused by the
% flag "-" occurs also in the output).
% 
% One may freely create other entries:
% \begin{verbatim}
%   \Index>{Flippy Flop!GO}[*2-1-2 2!1-1 1-12 +]\end{verbatim}
%
% generates
% \begin{myindex}
% \myi Flop
% \mys Flippy-Flippy\pno\qquad\emph{(no ``$\sim$''!)}
% \myi Flippy-Flippy Flop\pno
% \myi Flippy
% \mys $\sim$ Flop\pno
% \end{myindex}
% and outputs "{GO-Flippy-GO}" (note that even without an explicit "*" flag,
% we were able to generate this output, just by using the "*" in
% \meta{format}).
%
% \begin{verbatim}
%   \Index*_,{shape {of a} of star}\end{verbatim}
%
% generates
% \begin{myindex}
% \myi shape of a star\pno
% \myi star, shape of $\sim$\pno\sortedlike{star, shape of}
% \end{myindex}
% and outputs "{shape of a star}". Note that for the first entry the
% proposition ``"of a"'' was chosen while for the second entry the
% alternative proposition "of" was chosen.
%
% Also with the "varindextwo" macros the other flags keep their old meaning.
% For example, the flag "1" still means that the main argument is
% considered as a single entry.
% \begin{verbatim}
%   \Index1*{$L$ feature@L feature}
%   \Index,{No $L$@L feature}\end{verbatim}
%
% generate
% \begin{myindex}
% \myi $L$ feature\pno\sortedlikeq{"L feature"}
% \myi No
% \mys $\sim$ $L$ feature\pno\sortedlikeq{"L feature"}
% \myi feature, No $L$ $\sim$\pno\sortedlikeq{"feature, No L"}
% \end{myindex}
%  and outputs "{$L$ feature}".
%
%
% \subsection{Example of a simple modification of the
%     \texttt{varindextwo} macros}\label{ss:expatch}
%
% All flags and magic tokens in "varindextwo" can be customized to fit your
% own taste, just by modifying "\varindextwoScan".
% 
% \begin{verbatim}
% \def\myindextwoScan{%
%      \varindextwoScan
%      \varindexNewFlag ~\vxtSpaceA
%      \varindexNewFlag 1\vxtSpaceB
%      \varindexNewFlag !\varindexOneEntry
%      \varindexMakeSplitExpand{/}{vxtSplitAtMagic}%
%      \def\varindexStarPos{}%
% }
% \def\myIndex{\varindex(){\myindextwoScan}{\varindextwo}[]}\end{verbatim}
%
%
% "\myIndex" behaves similar to the previous example with
% the following differences:
% \begin{enumerate}
% \item The flag "1" now has the previous meaning of "~".
% \item One may now use "~" and "_" equivalently.
% \item The flag "!" now has the original meaning of the flag "1".
% \item Instead of "+" in the format string, the character "/" has to be used.
% \end{enumerate}

%
% \section{Main Description}
%
% Without additional customization, there are two possible calls for the
% \DescribeMacro{\varindex}"\varindex" command:
%
% \begin{enumerate}
% \item[a)] The first call has the form
% \begin{myquote}
% "\varindex["\meta{textstyle}"]["\meta{pagestyleA}"]"\meta{flags}\ppari
% \bracemeta{main entries}\bracemeta{format}"["\meta{pagestyleB}"]"
% \end{myquote}
% Here, "["\meta{textstyle}"]", "["\meta{pagestyleA}"]",
% "["\meta{pagestyleB}"]", and \meta{flags} are optional.
% (But if "["\meta{textstyle}"]" is omitted, also "["\meta{pagestyleA}"]"
% must be omitted).
%
% The meaning of the arguments is as follows:
% \begin{description}
% \item[\mdseries\meta{textstyle}] describes the textstyle used for the output
%     into the running text (typically, textstyle is "\emph" or empty).
% \item[\mdseries\meta{pagestyle}] describes the pagestyle used for the output
%     of the page number (you may also use a construct like "|see{...}" here).
%     If "["\meta{pagestyleB}"]" is present, this is the value used.
%     Otherwise, the value of "["\meta{pagestyleA}"]" is used
%     (resp.\ nothing).
% \item[\mdseries\meta{flags}] can be one (or both) of the following tokens:
%   \begin{description}
%   \item[\mdseries "*"] If this token appears in \meta{flag}, it has roughly
%              the meaning ``Output into running text''. More precisely, if no
%              "*" is occurs in \meta{format} (see below), then \meta{format}
%              is automatically prepended by the tokens ``"*"\myspace'' resp.\
%              ``"*"'' (depending whether \meta{format} starts with a space
%              or not).
%   \item[\mdseries "1"] With this flag, the content of \meta{main entries} is
%              considered as a single entry (see below).
%   \end{description}
% \item[\mdseries\meta{main entries}] and
% \item[\mdseries\meta{format}] are explained later.
% \end{description}
%
% \item[b)] The alternative form to call "\varindex" is
% \begin{myquote}
%   "\varindex("\meta{formatA}")("\meta{format*A}")"\relax
%   \bracemeta{scan program}\ppari
%   \bracemeta{main program}"["\meta{textstyle}"]["\meta{pagestyleA}"]"\relax
%\meta{flags}\ppari
%   \bracemeta{main entries}"["\meta{formatB}"]["\meta{pagestyleB}"]"
% \end{myquote}
% The arguments "["\meta{textstyle}"]", "["\meta{pagestyleA}"]", \meta{flags},
% and "["\meta{pagestyleB}"]" have the same meaning as in a) (in particular,
% they are optional, but if "["\meta{textstyle}"]" is omitted, also
% "["\meta{pagestyleA}"]" must be omitted).
%
% Also "("\meta{format*A}")" and "("\meta{formatA}")" are optional,
% but if "("\meta{formatA}")" is omitted, also "("\meta{format*A}")"
% must be omitted.
%
% The ``default'' value for \meta{format} is \meta{formatA} resp.\
% \meta{format*A} (depending whether the flag "*" has been used or not).
% If "["\meta{formatB}"]" is given, then this is used as the format (i.\,e.\
% the optional argument \meta{formatB} can be used to override the default).
%
% The other values are:
% \begin{description}
% \item[\mdseries\meta{scan program}] is executed (i.\,e.\ expanded)
%    immediately when "\varindex" reads it. This parameter can be used
%    to introduce \emph{further} flags (other than "*" and "1"), see below.
% \item[\mdseries\meta{main program}] is executed \emph{after} the
%    \meta{format} string(s)  has been expanded.
% \end{description}
% \end{enumerate}
%
% It is recommended to define personal macros which contain all parameters up
% to the place where \meta{flags} occurs (either with or without some flags,
% depending on the intention). See the examples section.
% \bigskip\par
%
% \meta{main entries} is the main argument which has the following form
%
% \begin{myquote}
% \meta{entry1}[\myspace\meta{entry2}][\myspace\meta{entry3}]$\ldots$
% \end{myquote}
%
% where each of \meta{entry1} \meta{entry2} \meta{entry3} $\ldots$
% in turn has the form
% \begin{myquote}
%   \meta{indextext}"@"\meta{sorttext}"!"\meta{outputtext}
% \end{myquote}
% or
% \begin{myquote}
%   \meta{indextext}"!"\meta{outputtext}"@"\meta{sorttext}
% \end{myquote}
% In each of these forms, "@"\meta{sorttext} and "!"\meta{outputtext}
% are optional. Here,
% \begin{description}
% \item[\mdseries\meta{indextext}]
%     is the text which is put into the index for the entry
% \item[\mdseries\meta{sorttext}]
%     is what is used as a sort criterion for the entry
% \item[\mdseries\meta{outputtext}]
%     is what is output into the running text for the entry
% \end{description}
%
% Note that the symbol "@" has in a sense the opposite meaning as in the
% original "\index" command:
% \emph{Before} that symbol, the desired text appears, and
% \emph{after} the symbol the place where it has to be sorted.
% However, we chose the symbols "@" and "!", because these two
% symbols are forbidden anyway (otherwise, "makeindex" will become confused).
%
% As usual, multiple spaces are considered as \emph{one} space and do not
% generate empty ``ghost'' entries. Moreover, a space after a \TeX-command
% like "\LaTeX" is eliminated by \TeX\ and thus also not considered as a
% separator. You may use braces"{"$\ldots$"}" either around a whole entry or
% around \meta{indextext} or \meta{sorttext} or \meta{outputtext} to allow
% spaces which do not act as ``separators'' in the corresponding part.
% The braces around these parts will vanish. In particular, you may generate an
% empty entry with "{}" or "!" or "@" (bordered by spaces).
% If you want that braces occur in the \emph{output}, you have to add an
% additional pair of braces. Be aware that you write sufficiently
% many braces, if you really should need them: For example,
% the command "\varindex{{{{A"\myspace"B}}}}{}" produces the index entry
% "{A"\myspace"B}": The outermost pair of braces is eliminated immediately
% by \TeX. The second pair is eliminated, because this is a pair around a
% complete entry in \meta{main entries}. Finally, another pair is eliminated,
% because it is a brace around \meta{indextext}.
% With the flag `"1"', \meta{main entries} is considered as one single entry.
% Nevertheless, also with this flag, an additional pair of braces around
% \meta{main entry} is eliminated.\bigskip
%
%
% The \meta{format} has one of the following three forms:
% \begin{myquote}
% \meta{IndexA}[\myspace\meta{IndexB}][\myspace\meta{IndexC}]$\ldots$\relax
%["*"\meta{OutputA}]["*"\meta{OutputB}]$\ldots$\\\relax
%["*"\meta{OutputA}][\myspace\meta{IndexA}][\myspace
%\meta{IndexB}]["*"\meta{OutputC}]$\ldots$\\
%  "*"
% \end{myquote}
% where the order of arguments can be arbitrarily mixed (except for the first
% \meta{IndexA} in the first form). \meta{IndexA} \meta{IndexB} $\ldots$
% \meta{OutputA} $\ldots$ describe the format of the index entries resp.\
% of the output into the running text.
% The output is generated in the given order (this might be important, if
% a pagebreak occurs during the output into the running text).
% The last case is exceptional and equivalent to ``"*"\myspace''.
% The following characters/strings are allowed in the format entries:
% \par\bigskip
%
% \begin{tabular}[t]{ll}
% token   &meaning\\\hline
% "1"--"9"&\meta{entry1}--\meta{entry9}\\
% "0"     &\meta{entry10}\\
% "~"     &a placeholder sign (default is $\sim$)\\
% "="     &a secondary placeholder sign (default is $\approx$)\\
% "_"     &the space character ``\myspace''\\
% "s"     &The token ``"\space"''
%          (but ``\myspace'' is used for the sort entry)\\
% "."     &No space will follow (see below)\\
% ","     &The character ``","'' (space will follow)\\
% "-"     &The character ``"-"'' (no space will follow)\\
% "!"     &Create a new sublevel (subitem).
% \end{tabular}\par\bigskip
%
% All other tokens in this argument are forbidden. (Note that the magic
% symbol "+" in \meta{format} is handled by the "varindextwo" macros, and
% not by "varindex").\par
% The token ``"!"'' above makes no sense for the output in the running text
% and thus is forbidden behind "*".\par
%
% By a heuristic rule, a space is automatically inserted between two entries
% which generate non-empty text. If the heuristic rule fails, you may always
% force a space by either ``"_"'' or ``"s"'', or forbid a space by ``"."''.
%
% If a format is empty, all entries are taken in the order of input.
% Note that \TeX\ eliminates concatenated spaces, and so you are able to
% produce an empty format entry only at the end of \meta{format} or in front
% of a ``"*"''. If you want to force an empty \emph{output}
% (is this ever useful?), you may use just ``"."'' as the entry.\\
%
% A sort entry is only written to the "*.idx" file if it differs from the
% text entry.

%
% \section{Description of the \texttt{varindextwo} macros}
%
% The macros
% \DescribeMacro{\varindextwoScan}
% \DescribeMacro{\varindextwo}
% \begin{verbatim}
%   \varindextwoScan \varindextwo\end{verbatim}
%
% can be used together as parameters \meta{scan program} resp.\
% \meta{main program} for the "\varindex" command.
% If "\varindex" is called with these macros, and no
% explicit format argument is given, these macros generate a format
% depending on the number of entries in \meta{main entries}:
%
% \begin{enumerate}
% \item[a)] If there is only one entry in \meta{main entries}, then the format
%    ``"1"'' resp.\ ``"*1"\myspace"1"'' is
%    generated (depending whether the "*" flag was used or not), i.\,e.\ the
%    entry is put into the index, and printed if "\varindex" was
%    called with the "*" flag.
%
% \item[b)] If there are two entries in \meta{main entries}, then
%    \meta{format} becomes ``\myspace"1!~2"\myspace"1!2~"''. For example, if
%    \meta{main entries} is ``"graulty bazola"'', then the "\index" entries
%
%   \begin{myindex}
%   \myi graulty
%   \mys $\sim$ bazola\pno
%   \myi bazola
%   \mys graulty $\sim$\pno
%   \end{myindex}
%
%   are produced.\par
%   You can modify the first format entry with the following flags:\par
%   \bigskip
%
%   \begin{tabular}[t]{lll}
%   flags&format used&with ``"*"'' additionally\\\hline
%   "_" &"12"                   &"*12"\\
%   "-" &"1-2"                  &"*1-2"\\
%   "^" &"1!~-2"  resp.\ "1!-2" &"*1-2"\\
%   "-^"&"1-!~.2" resp.\ "1-!~2"&"*1-2"\\
%   "." &"1.2"                  &"*1.2"\\
%   ".^"&"1!~.2"                &"*1.2"\\
%   "/" &"1!2" (without "~")    &"*12"\\
%   "<" &no entry               &"*12"
%   \end{tabular}\par\bigskip
%
%   Here, the combinations "-^" and ".^" mean that both flags are used
%   (the order plays no role).
%   The output for "^" respectively "-^" is determined by the switches
%   \begin{myquote}
%   \DescribeMacro{\varindextwoDashTildetrue}"\varindextwoDashTildetrue"
%   (default)\par
%   \DescribeMacro{\varindextwoDashTildefalse}"\varindextwoDashTildefalse"
%   \end{myquote}
%   and
%   \begin{myquote}
%   \DescribeMacro{\varindextwoDashSpacetrue}"\varindextwoDashSpacetrue"\\
%   \DescribeMacro{\varindextwoDashSpacefalse}"\varindextwoDashSpacefalse"
%   (default)
%   \end{myquote}
%   respectively. The last entry in the above table is an additional format
%   entry which is generated if also the ``"*"'' flag is used.\par
%
%   You can modify the second format entry with the following flags:\par
%   \bigskip
%
%   \begin{tabular}[t]{ll}
%   flags&format used\\\hline
%   "," &"2,1~" resp.\ "2,1"\\
%   "~" &"21"\\
%   "=" &"2!1-~"\\
%   ",="&"2,1-~" resp.\ "2,1-"\\
%   "+" &"2-1"\\
%   ":" &"2!1.~"\\
%   ",:"&"2,1.~" resp.\ "2,1"\\
%   ";" &"2.1"\\
%   ">" &no entry\\
%   "!" &Append "~" (if not already there)\\
%   "?" &Without trailing "~"
%   \end{tabular}\par\bigskip
%
%   Whether the first or the second alternatives in the above forms is used
%   depends on the status of the switch
%   \begin{myquote}
%   \DescribeMacro{\varindextwoCommaTildetrue}"\varindextwoCommaTildetrue"
%   (default)\\
%   \DescribeMacro{\varindextwoCommaTildefalse}"\varindextwoCommaTildefalse"
%   \end{myquote}
%   We point out that "\varindextwoCommaTildefalse" was in earlier versions of
%   "varindex" the default (and could not be changed).
%   Note that this switch has no effect if the ! or ? flags are used.\par
%
%   \textbf{Hint} for remembering the symbols: The symbols "_" "." "-"
%   for the first entry are the same flags as for the output and the same
%   flags which are used in the \meta{format} argument.
%   The corresponding symbols "~" ":" (and ";") "=" (and "+") for the second
%   entry ``look similar''. The "," flag is only useful in the second entry
%   (and is the same symbol as in the \meta{format} argument).
%   The two exceptional symbols ">" and "<" can be read as ``generate only the
%   `forward-directed' resp.\ `backward-directed entry'\,''.\par
%
%
% \item[c)] If there are three entries in \meta{main entries}, then
%   \meta{format} becomes ``\myspace"1!~23"\myspace"3!12~"''.
%   For example, if \meta{main entries} is ``"graulty of bazola"'', then
%   the following two "\index" entries are produced.
%
%   \begin{myindex}
%   \myi graulty
%   \mys $\sim$ of bazola\pno
%   \myi bazola
%   \mys graulty of $\sim$\pno
%   \end{myindex}
%
%    The flags have an analogous effect to~b).
%    In addition, if the flags "`" resp.\ "'" are used, the second entry
%    (in our example: ``of'') is omitted from the output in the first
%    resp.\ in the second index entry. If the flags "*" and "`"
%    are used together, the second entry is also omitted from the output
%    into the running text.
%
% \item[d)] If there are four entries in \meta{main entries}, then
%    \meta{format} becomes ``\myspace"1!~24"\myspace"4!31~"''. For example, if
%    \meta{main entries} is ``"graulty of@ OF bazola"'', then the following
%    two "\index" entries are produced.
%
%   \begin{myindex}
%   \myi graulty
%   \mys $\sim$ of bazola\pno\sortedlikeq{bazola}
%   \myi bazola
%   \mys graulty OF $\sim$\pno\sortedlikeq{graulty OF}
%   \end{myindex}
%    In other words, we have a similar effect as in~c) except that for the
%    first entry the third word is skipped, and for the second entry the
%    second word is skipped. All flags as in~c) can be used with an
%    analogous meaning.
%    Also, if the "*" flag is used, the output into the running text is
%    analogous to~c) (the third word is skipped).
%
% \item[e)] If there are more than four entries in \meta{main entries}, then
%    \meta{formatA} resp.\ \meta{format*A} is used.
% \end{enumerate}
%
% If an explicit \meta{format} argument is given to "\varindex" (together with
% the "\varindextwo" macro as \meta{main program}), then this format is used,
% except when it contains the symbol "+". In this case, this symbol "+" is
% replaced by the format which would be generated by the rules~a)--e).
% If additionally the "*" flag is used, there is a special rule:
% If the explicit format contains a "*", then no additional "*"-output is
% produced. Otherwise, the "*"-output from~a)--e) is prepended to the given
% \meta{format} (with a space at the end, unless the format string is empty).
% This means that ``normally'' you have the output from a)--e),
% unless you write an own explicit "*"-part in the \meta{format}.
%
% If you do not like the tokens chosen for the default symbols, you can
% easily choose your own tokens by just replacing "\varindextwoScan" with your
% own macro (or defining your own ``magic'' tokens after "\varindextwoScan",
% see the example in Section~\ref{ss:expatch}).

%
% \section{Primitive customization}
%
%
% You may use the command
% \DescribeMacro{\varindexUsePlaceholderAfalse}
% \DescribeMacro{\varindexUsePlaceholderBfalse}
% \begin{verbatim}
%     \varindexUsePlaceholderAfalse
%     \varindexUsePlaceholderBfalse\end{verbatim}
% to ignore the symbol "~" resp.\ "=" in the format entry.
% You can easily restore the default by
% \DescribeMacro{\varindexUsePlaceholderAtrue}
% \DescribeMacro{\varindexUsePlaceholderBtrue}
% \begin{verbatim}
%     \varindexUsePlaceholderAtrue
%     \varindexUsePlaceholderBtrue\end{verbatim}
%
% If you want to switch off the placeholder only at the beginning of
% a new entry (resp.\ of a new subentry), you can use the commands
% \DescribeMacro{\varindexLeadingPlaceholderAfalse}
% \DescribeMacro{\varindexLeadingPlaceholderBfalse}
% \begin{verbatim}
%     \varindexLeadingPlaceholderAfalse
%     \varindexLeadingPlaceholderBfalse\end{verbatim}
% The default is restored with
% \DescribeMacro{\varindexLeadingPlaceholderAtrue}
% \DescribeMacro{\varindexLeadingPlaceholderBtrue}
% \begin{verbatim}
%     \varindexLeadingPlaceholderAtrue
%     \varindexLeadingPlaceholderBtrue\end{verbatim}
%
% By default, the ``","'' in the format string is in this connection
% treated as a symbol generating a new ``subentry''. You can change this
% default with the command
% \DescribeMacro{\varindexCommaLeadsfalse}
% \begin{verbatim}
%  \varindexCommaLeadsfalse\end{verbatim}
% You may switch back with
% \DescribeMacro{\varindexCommaLeadstrue}
% \begin{verbatim}
%  \varindexCommaLeadstrue\end{verbatim}
%
%
% The content of the macros
% \DescribeMacro{\varindexPlaceholderAText}
% \DescribeMacro{\varindexPlaceholderASort}
% \DescribeMacro{\varindexPlaceholderBText}
% \DescribeMacro{\varindexPlaceholderBSort}
% \begin{verbatim}
%   \varindexPlaceholderAText
%   \varindexPlaceholderASort
%   \varindexPlaceholderBText
%   \varindexPlaceholderBSort\end{verbatim}
% is used as the placeholder "~" resp.\ "="  in the index resp.\ sort entry.
% Note that if one of these entries expands empty, different rules for
% the automatic insertion of spaces apply (for the index and sort entry
% separately).
%
% You may prefer that the placeholder text resp.\ sort content changes at
% run time to the context of the previous "!" entry. For example, you may
% want that the command "\varindex{Gibble Gobble}{2!~2}" produces the index
% entry
%  \begin{myindex}
%  \myi Gibble
%  \mys Gibble Gobble\pno
%  \end{myindex}
% (or is at least \emph{sorted} as such an entry).
%
% You can achieve this with the commands
% \DescribeMacro{\varindexPreviousATexttrue}
% \DescribeMacro{\varindexPreviousASorttrue}
% \DescribeMacro{\varindexPreviousBTexttrue}
% \DescribeMacro{\varindexPreviousBSorttrue}
% \begin{verbatim}
%  \varindexPreviousATexttrue
%  \varindexPreviousASorttrue
%  \varindexPreviousBTexttrue
%  \varindexPreviousBSorttrue\end{verbatim}
% for the text and sort entry and the placeholders "~" and "=", respectively.
% With these commands, the content of "\varindexPlaceholderAText" etc
% is only used as the default if no previous "!" entry was given.
% You can switch back to the default mode with the respective commands
% \DescribeMacro{\varindexPreviousATextfalse}
% \DescribeMacro{\varindexPreviousASortfalse}
% \DescribeMacro{\varindexPreviousBTextfalse}
% \DescribeMacro{\varindexPreviousBSortfalse}
% \begin{verbatim}
%  \varindexPreviousATextfalse
%  \varindexPreviousASortfalse
%  \varindexPreviousBTextfalse
%  \varindexPreviousBSortfalse\end{verbatim}
% By default, the ``","'' in the format entry is considered in this connection
% similar to ``"!"''. If you want to change this, use the command
% \DescribeMacro{\varindexCommaExpandfalse}
% \begin{verbatim}
%   \varindexCommaExpandfalse\end{verbatim}
% You may switch back with
% \DescribeMacro{\varindexCommaExpandtrue}
% \begin{verbatim}
%  \varindexCommaExpandtrue\end{verbatim}
%
% Since version 2.2, the dash ``"-"'' occurring at the beginning of entry
% (or after ``"!"'' or even after ``","'' if "\varindexCommaExpandtrue" is in
% effect) is ignored for sorting.
% You can switch off this feature with the command
% \DescribeMacro{\varindexOutSortDashBeg}
% \begin{verbatim}
%   \let\varindexOutSortDashBeg\varindexOutSortDash\end{verbatim}
% To restore the new default, use
% \begin{verbatim}
%   \let\varindexOutSortDashBeg\toolboxEmpty\end{verbatim}
% \bigskip
% The commands
% \begin{myquote}
% \DescribeMacro{\varindexSetWordString}
% "\varindexSetWordString{|}"\myquad
% (Use "|" as separator for entries instead of spaces)\par
% \DescribeMacro{\varindexSetSortString}
% "\varindexSetSortString{>}"\myquad(default: "@")\par
% \DescribeMacro{\varindexSetPlainString}
% "\varindexSetPlainString{<}"\myquad(default: "!")
% \end{myquote}
% set the default ``magic'' strings used for \meta{main entries}.
% The argument of the above macros is intentionally \emph{not} expanded (so
% that you do not have troubles with active characters like "~").
% To force expansion, use e.\,g.
% \begin{verbatim}
% \expandafter\varindexSetWordString\expandafter{\MacroToExpand}\end{verbatim}
% or some similar construct.
%
% If you use a different separator than ``space'' for the entries, you may
% want to change the rule how braces are eliminated. With the commands
% \DescribeMacro{\varindexEliminateOuterBracetrue}
% \DescribeMacro{\varindexEliminateInnerBracetrue}
% \DescribeMacro{\varindexEliminateOuterBracefalse}
% \DescribeMacro{\varindexEliminateInnerBracefalse}
% \begin{verbatim}
%   \varindexEliminateOuterBracetrue
%   \varindexEliminateInnerBracetrue
%   \varindexEliminateOuterBracefalse
%   \varindexEliminateInnerBracefalse\end{verbatim}
% you may allow resp.\ forbid the elimination of braces around the entries
% resp.\ around \meta{indextext} \meta{sorttext} and \meta{outputtext}
% With the flag ``"1"'', \meta{main entries} is considered as one single entry,
% but if "\varindexEliminateOuterBracetrue" is set (which is the default)
% also in this case an additional pair of braces around main entry is
% eliminated.
%
% Similarly as above,
% \begin{myquote}
% \DescribeMacro{\varindexSetIndexString}
%   "\varindexSetIndexString{|}"   \myquad default: space\par
% \DescribeMacro{\varindexSetOutputString}
%   "\varindexSetOutputString{<}"  \myquad default: "*"\par
% \DescribeMacro{\varindexSetTildeAString}
%   "\varindexSetTildeAString{~}"  \myquad (is default)\par
% \DescribeMacro{\varindexSetTildeBString}
%   "\varindexSetTildeBString{=}"  \myquad (is default)\par
% \DescribeMacro{\varindexSetSpaceString}
%   "\varindexSetSpaceString{_}"   \myquad (is default)\par
% \DescribeMacro{\varindexSetSpaceTokString}
%   "\varindexSetSpaceTokString{s}"\myquad (is default)\par
% \DescribeMacro{\varindexSetOmitString}
%   "\varindexSetOmitString{.}"    \myquad (is default)\par
% \DescribeMacro{\varindexSetCommaString}
%   "\varindexSetCommaString{,}"   \myquad (is default)\par
% \DescribeMacro{\varindexSetDashString}
%   "\varindexSetDashString{-}"    \myquad (is default)\par
% \DescribeMacro{\varindexSetExclamString}
%   "\varindexSetExclamString{!}"  \myquad (is default)\par
% \DescribeMacro{\varindexSetStringForNr}
%   "\varindexSetStringForNr 1{a}" \myquad default: "1"\par
%   "\varindexSetStringForNr{11}{b}"\myquad No default!
% \end{myquote}
% set the default ``magic'' strings used for \meta{format}.
% In contrast to before, the arguments are fully expanded (with
% "\varindexedef", see Section~\ref{s:docufeature}).
% Note that the last command provides a way to access more than $10$ entries!
%
% If you use "\varindexSetIndexString{|}" (with some non-space token),
% you may still use spaces in the format which then are just ignored.
%
%
% Avoid that one string is a prefix of another string: In this case,
% strange effects may happen, and this behavior may even change in
% future releases of this package.
% Note that the above effect may arise unintentionally if you use active
% chars. For this reason, ``"~"'' is defined to expand to the letter ``"~"'',
% before the expansion is executed. Maybe in later releases of this package
% there will be further such redefinitions.
% You can explicitly use this feature in your own macros by using
% "\varindexedef" instead of the usual "\edef",
% see Section~\ref{s:docufeature}.
%
% You can change the output for the text resp sort entry of the various
% symbols used in the format string. More precisely, you can redefine
%
% \begin{myquote}
% \DescribeMacro{\varindexOutExclam}
%    "\varindexOutExclam"      \myquad Text output for "!"\par
% \DescribeMacro{\varindexFollowsExclam}
%    "\varindexFollowsExclam"  \myquad
%Decide whether magic space after "!" is inserted\par
% \DescribeMacro{\varindexOutTextComma}
%    "\varindexOutTextComma"   \myquad Text output for ","\par
% \DescribeMacro{\varindexOutSortComma}
%    "\varindexOutSortComma"   \myquad Sort output for ","\par
% \DescribeMacro{\varindexFollowsComma}
%    "\varindexFollowsComma"   \myquad
%Decide whether magic space after "," is inserted\par
% \DescribeMacro{\varindexPreceedsComma}
%    "\varindexPreceedsComma"   \myquad
%Decide whether magic space before "," is erased\par
% \DescribeMacro{\varindexOutTextSpace}
%    "\varindexOutTextSpace"   \myquad Text output for "_"\par
% \DescribeMacro{\varindexOutSortSpace}
%    "\varindexOutSortSpace"   \myquad Sort output for "_"\par
% \DescribeMacro{\varindexFollowsSpace}
%    "\varindexFollowsSpace"   \myquad
%Decide whether magic space after "_" is inserted\par
% \DescribeMacro{\varindexPreceedsSpace}
%    "\varindexPreceedsSpace"   \myquad
%Decide whether magic space before "_" is erased\par
% \DescribeMacro{\varindexOutTextSpTok}
%    "\varindexOutTextSpTok"   \myquad Text output for "s"\par
% \DescribeMacro{\varindexOutSortSpTok}
%   "\varindexOutSortSpTok"   \myquad Sort output for "s"\par
% \DescribeMacro{\varindexFollowsSpTok}
%    "\varindexFollowsSpTok"   \myquad
%Decide whether magic space after "s" is inserted\par
% \DescribeMacro{\varindexPreceedsSpTok}
%    "\varindexPreceedsSpTok"   \myquad
%Decide whether magic space before "s" is erased\par
% \DescribeMacro{\varindexOutTextDash}
%    "\varindexOutTextDash"    \myquad Text output for "-"\par
% \DescribeMacro{\varindexOutSortDash}
%    "\varindexOutSortDash"    \myquad Sort output for "-"\par
% \DescribeMacro{\varindexOutSortDashBeg}
%    "\varindexOutSortDashBeg"    \myquad Sort output for "-"
%if nothing preceeds.\par
% \DescribeMacro{\varindexFollowsDash}
%    "\varindexFollowsDash"    \myquad
%Decide whether magic space after "-" is inserted\par
% \DescribeMacro{\varindexPreceedsDash}
%    "\varindexPreceedsDash"   \myquad
%Decide whether magic space before "-" is erased\par
% \DescribeMacro{\varindexOutTextOmit}
%    "\varindexOutTextOmit"    \myquad Text output for "."\par
% \DescribeMacro{\varindexOutSortOmit}
%    "\varindexOutSortOmit"    \myquad Sort output for "."\par
% \DescribeMacro{\varindexFollowsOmit}
%    "\varindexFollowsOmit"    \myquad
%Decide whether magic space after "." is inserted\par
% \DescribeMacro{\varindexPreceedsOmit}
%    "\varindexPreceedsOmit"   \myquad
%Decide whether magic space before "." is erased
% \end{myquote}
%
% The meaning is as follows: "\varindexOut..." should just expand to the
% tokens which should be written into the text resp.\ sort output.
% The corresponding macro "\varindexFollows..." is typically defined with
% one of the following commands:
% \begin{verbatim}
%     \let\varindexFollows...\varindexNextSpace
%     \let\varindexFollows...\varindexNoNextSpace\end{verbatim}
% In the first case, a space is `magically' inserted in front of a
% subsequent token (unless this token erases the magic space).
% In the second case, no space follows, of course.
% There is an alternative call:
% \begin{myquote}
% \DescribeMacro{\varindexSpaceTexttrue}
% \DescribeMacro{\varindexSpaceTextfalse}
% \DescribeMacro{\varindexSpaceSorttrue}
% \DescribeMacro{\varindexSpaceSortfalse}
% "\def\varindexFollows...{\varindexSpaceTexttrue\varindexSpaceSortfalse}"
% \end{myquote}
% This definition achieves that for the text output a space should follow,
% but not for the sort output. Of course, you can also use similarly the
% commands "\varindexSpaceTextfalse" and/or "\varindexSpaceSorttrue" in the
% above definition (the effect should be obvious).
% In particular, "\varindexNextSpace" is equivalent to
% "\varindexSpaceTexttrue\varindexSorttrue".\par
%
% The macro "\varindexPreceeds..." is similarly as "\varindexFollows..." with
% the difference that it is executed \emph{before} the token in question is
% output. In particular, you can ignore a previous `magic space'.
% All of the `magic space' commands are defined by default with
% \begin{verbatim}
%     \let\varindexFollows...\toolboxEmpty
%     \let\varindexPreceeds...\varindexNoNextSpace\end{verbatim}
% with the following two exceptions:
% \begin{verbatim}
%     \let\varindexFollowsExclam\varindexNextSpace
%     \let\varindexFollowsComma\varindexNextSpace\end{verbatim}
%
% \section{Documented Features}\label{s:docufeature}
%
% The title ``documented features'' means that these are hacks which allow
% further customization but which are ``documented'' in the sense that these
% hacks will also be available in later versions. (You use an ``undocumented''
% feature if you must use a macro name of the "varindex" package which
% contains the symbol "@"). If a feature described in this section does not
% work in the documented way, this is a bug and might be repaired in a
% later version of "\varindex".
%
% (In a future release, "varindex" will cook your coffee, too).\bigskip
%
%
% The argument \meta{main entries} is \emph{never} expanded, so you can
% actually write macros into the "*.idx" file.
% The command actually used to write the index is
% \begin{myquote}
% \DescribeMacro{\varindexIndex}"\varindexIndex"
% \end{myquote}
% (which by default is of course defined as "\index").
% Since some implementations of the "\index" command still (partially) expand
% their argument (which might be considered as a bug), the argument of
% "\varindexIndex" is translated before the actual call with the aid of
% "\toolboxMakeHarmless".
% If you want to redefine "\varindexIndex" to a personal "\index"-output
% function, you might want to skip the "\toolboxMakeHarmless" step.
% This is arranged with the command
% \begin{myquote}
% \DescribeMacro{\varindexNoConvert}"\varindexNoConvert"
% \end{myquote}
% You can cancel the effect of this command with
% \begin{myquote}
% \DescribeMacro{\varindexNoConvert}"\varindexNoConvert"
% \end{myquote}
% Even if "\varindexNoConvert" is not in effect, \meta{main entries} is not
% expanded (and in particular, the argument of "\varindexIndex" consists of
% the corresponding entries in an unexpanded form).\par\bigskip
%
% The whole "\varindex" expansion takes place in a group, so all your
% variables are local to a single call (unless you use "\gdef"
% (and friends) of course).\par
%
% There are no "\global" directives used in any macro of this package.
% In particular, if you call the above macros in a group (or redefine
% "\varindexIndex"), the effect holds only until the end of the group.
% \par\bigskip
%
% In contrast to \meta{main entries}, the \meta{format} argument is expanded
% (with "\varindexedef", see below) (and also \meta{formatA} resp.\
% \meta{format*A} is expanded before), so you can define abbreviations
% (even simple conditional % abbreviations) for \meta{format}.
% Note, however, that the expansion is essentially only evaluated with "\edef".
% So, you will probably not want to use e.\,g.\ "\relax", since this command
% expands to itself (and not into nothing -- use "\toolboxEmpty" if you want
% the latter).
% If you want more complex abbreviations, use \meta{main program} instead.
%
% In order to help you write conditional abbreviations, the
% following variables are defined when your macro is expanded (and in
% particular also in \meta{main program}). You may of course redefine them
% appropriately:
%
% \begin{description}
% \item[\macrott{varindexAppend}]\DescribeMacro{\varindexAppend}
%    The argument \meta{pagestyleA} resp.\ \meta{pagestyleB}.
% \item[\macrott{varindexCount}]\DescribeMacro{\varindexCount}
%    A \TeX\ counter containing the number of entries in \meta{main entries}.
% \item[\macrott{varindexLastEntry}]\DescribeMacro{\varindexLastEntry}
%   This is a macro (\emph{not} a counter) which is usually the value of
%   "\the\varindexCount". See below.
% \item[\macrott{varindexEntry1} \macrott{varindexEntry2} \mdseries$\ldots$]
%\DescribeMacro{\varindexEntry1-...}
%    The (index) text occurring in \meta{Entry1} \meta{Entry2} $\ldots$
% \item[\macrott{varindexSort1} \macrott{varindexSort2} \mdseries$\ldots$]
%\DescribeMacro{\varindexSort1-...}
%    The corresponding sort entry. If no sort entry was given, this is
%    the same as the corresponding "\varindexEntry1-..."
% \item[\macrott{varindexPlain1} \macrott{varindexPlain2} \mdseries$\ldots$]
%\DescribeMacro{\varindexPlain1-...}
%    The text which should be output in the text. If no such entry was given,
%    this is the same as the corresponding "\varindexEntry1-..."
% \end{description}
% "\varindexCount" may be larger than $10$, and correspondingly there may be
% also more than $10$ different "\varindexEntry"/"Sort"/"Plain" macros.
% If you \emph{add} entries, you have to increase "\varindexCount"
% correspondingly, otherwise an error is produced if the format string
% contains an entry larger then "\varindexCount". However, your additional
% entries are \emph{not} output for \emph{empty} formats:
% For empty formats the entries output are $1$--"\varindexLastEntry".
% So if you want to output also your additional entries
% in empty formats, you have to set "\varindexLastEntry" to your modified
% value of "\varindexCount" in \meta{main program}. You may e.\,g.\ achieve
% this with the following lines:
% \begin{myquote}
%  "\expandafter"\\
%  "\def\expandafter\varindexLastEntry\expandafter{\the\varindexCount}"\proz
% \end{myquote}
% It is admissible that "\varindexLastEntry" is larger than "\varindexCount":
% In this case all entries until "\varindexLastEntry" are
% output in empty formats without producing an error (provided, of course,
% that the corresponding variables "\varindexEntry..."/"Sort..."/"Plain..." are
% defined).
%
% Note that numbers in \TeX\ command names require special handling,
% i.\,e., you have to use something like 
%
% \begin{verbatim}
% \csname varindexPlain2\endcsname\end{verbatim}
%
% to access variables. To avoid this, you may want to use the macros
% \DescribeMacro{\toolboxLet}"\toolboxLet" and
% \DescribeMacro{\toolboxWithNr}"\toolboxWithNr" of the "toolbox" package.
% Examples are
% \begin{verbatim}
%   \toolboxWithNr 1\let{varindexEntry}\toolboxEmpty
%   \toolboxWithNr {10}\def{varindexSort}{Foo}
%   \toolboxLet    \mymacro{varindexPlain\the\mycount}\end{verbatim}
% These commands set "\varindexEntry1" to "\toolboxEmpty", "\varindexSort10"
% to Foo, and "\mymacro" to the content of "\varindexPlain5" (if "\mycount=5").
%
% All these variables are also available when \meta{main program} is expanded.
% In \meta{main program} also the following functions are useful:
%
% \begin{description}
% \item[\macrott{varindexFormat}]\DescribeMacro{\varindexFormat}
%    This macro expands to the actual \meta{format} which is used.
%    The main purpose of \meta{main program} will usually be to (re)define
%    this macro. After \meta{main program} has been called, this macro is
%    modified in several ways:
%    \begin{enumerate}
%    \item "\varindexFormat" is expanded (with "\varindexedef", see below).
%       (thus, "\varindexFormat" is expanded \emph{before and after} the call
%        of \meta{main program}).
%    \item "\ifvarindexStar" is true (see below)
%        a ``"*"'' resp.\ ``"*"\myspace'' is prepended.
%    \item If it is only ``"*"'', it is replaced by ``"*"\myspace''.
%    \end{enumerate}
%    Note that before execution of \meta{main program}, no tests on the
%    validity of the format are done: You may use your own symbols to
%    `communicate' with \meta{main program} (provided that \meta{main program}
%    eliminates these symbols afterwards).
% \item[\macrott{varindexFormatDefault}]\DescribeMacro{\varindexFormatDefault}
%    This macro expands to \meta{formatA} resp.\ \meta{format*A}
%    (in the expanded form) depending whether the "*" flag has been used in
%    the call. Note that this expansion was executed \emph{before}
%    the optional format argument is expanded for the first time.
% \item[\macrott{ifvarindexstar}]\DescribeMacro{\ifvarindexstar}
%    \meta{ifpart} [ "\else" \meta{elsepart} ] "\fi"\par
%    If the optional "*" was given, \meta{ifpart} is executed, otherwise
%    \meta{elsepart}. This is a \TeX\ "if" command. In particular, by
%    \DescribeMacro{\varindexStarfalse}\DescribeMacro{\varindexStartrue}
%    "\varindexStarfalse" resp.\ "\varindexStartrue"
%    you may change the behavior for future "if"'s. This can be used
%    to prevent/force that a ``"*"'' resp.\ ``"*"\myspace'' is prepended to
%    the format after the execution of \meta{main program}.
%    Setting of this variable has no effect in \meta{scan program}.
% \item[\macrott{ifvarindexExplicitFormat}]
%    \DescribeMacro{\ifvarindexExplicitFormat}
%    This is a \TeX\ "if" command (see above) which is true if the optional
%    format argument \meta{formatB} was given.
% \end{description}
%
% To ``compose'' the format, you may want to use the macros
% \begin{myquote}
% \DescribeMacro{\toolboxDef}
% "\toolboxDef\macrotodefine"\bracemeta{argumentlist}\par
% \DescribeMacro{\toolboxAppend}
% "\toolboxAppend\macrotoappend"\bracemeta{argumentlist}\par
% \DescribeMacro{\varindexedef}
% "\varindexedef\macrotodefine"\bracemeta{argumentlist}
% \end{myquote}
% All commands work similar to "\def" resp.\ "\edef" with two differences:
%
% For "\toolboxDef\macro", \meta{argumentlist} is expanded precisely by one
% level (for details, see the documentation of the "toolbox" package).
% Of course, for "\toolboxAppend", the new definition is appended to the old
% definition of "\macro".
%
% "\varindexedef" fully expands \meta{argumentlist}. However, some active
% symbols (currently only "~", but additional symbols might follow in a
% future release) are deactivated before expansion, so that "~" actually
% expands to "~" and not to a strange command sequence.
%
%
% To ``decompose'' the format, you may want to use one of the macros
%
% \begin{myquote}
% \DescribeMacro{\toolboxSplitAt}
% "\toolboxSplitAt"\bracemeta{arg}\bracemeta{critical}\bracemeta{command}\par
% \DescribeMacro{\toolboxMakeSplit}
% "\toolboxMakeSplit"\bracemeta{critical}\bracemeta{command}\par
% \DescribeMacro{\varindexMakeSplitExpand}
% "\varindexMakeSplitExpand"\relax
%\bracemeta{macros expanding to critical}\bracemeta{command}\par
% \DescribeMacro{\varindexMakeVarSplit}
% "\varindexMakeVarSplit\variable"\relax
%\bracemeta{macros expanding to critical}\bracemeta{command}
% \end{myquote}
% The first two macros are described in the "toolbox" package.
% The remaining two macros are similar to "\varindexMakeSplit" with the
% difference that the argument \meta{critical} is obtained by expanding
% \meta{macros expanding to critical} with the aid of "\varindexedef".
% In the last form, additionally "\variable" is (re)defined to expand to
% \meta{critical} ("\variable" is any free name).
%
% The following instances of a command created by "\toolboxMakeSplit"
% exist (the content of \meta{critical} should be obvious):
%
% \begin{myquote}
% \DescribeMacro{\varindexSplitAtIndex}
% "\varindexSplitAtIndex"\myquad(generated by "\varindexSetIndexString")\par
% \DescribeMacro{\varindexSplitAtOutput}
% "\varindexSplitAtOutput"\myquad(generated by "\varindexSetOutputString")\par
% \DescribeMacro{\varindexSplitAtTildeA}
% "\varindexSplitAtTildeA"\myquad(generated by "\varindexSetTildeAString")\par
% \DescribeMacro{\varindexSplitAtTildeB}
% "\varindexSplitAtTildeB"\myquad(generated by "\varindexSetTildeBString")\par
% \DescribeMacro{\varindexSplitAtSpace}
% "\varindexSplitAtSpace"\myquad(generated by "\varindexSetSpaceString";
% by default, \meta{critical} is "_")\par
% \DescribeMacro{\varindexSplitAtSpaceTok}
% "\varindexSplitAtSpaceTok"\myquad
%  (generated by "\varindexSetSpaceTokString";
%  by default, \meta{critical} is "s")\par
% \DescribeMacro{\varindexSplitAtOmit}
% "\varindexSplitAtOmit"\myquad(generated by "\varindexSetOmitString")\par
% \DescribeMacro{\varindexSplitAtComma}
% "\varindexSplitAtComma"\myquad(generated by "\varindexSetCommaString")\par
% \DescribeMacro{\varindexSplitAtDash}
% "\varindexSplitAtDash"\myquad(generated by "\varindexSetDashString")\par
% \DescribeMacro{\varindexSplitAtExclam}
% "\varindexSplitAtExclam"\myquad(generated by "\varindexSetExclamString")\par
% \DescribeMacro{\varindexSplitAtNr??}
% "\varindexSplitAtNr1"\myquad(generated by "\varindexSetStringForNr")\par
% "\varindexSplitAtNr2"\par
% $\ldots$
% \end{myquote}
% Note that you must use "\csname ....\endcsname" to call e.\,g.\ the macro
% "\varindexSplitAtNr1". Only those numbers are admissible for
% "\varindexSplitAtNr??" which have been introduced with
% "\varindexSetStringForNr" (by default, this is the case for $1$--$10$).
%
% There is also the instance
% \DescribeMacro{\varindexSplitSpace}
% \begin{myquote}
% "\varindexSplitSpace"\myquad
% (to be distinguished from "\varindexSplitAtSpace")
% \end{myquote}
% where \meta{critical} is the space symbol.
%
%
% In addition, you may use the variables
% \begin{myquote}
% \DescribeMacro{\varindexIndexString}"\varindexIndexString"\par
% \DescribeMacro{\varindexOutputString}"\varindexOutputString"\par
% \DescribeMacro{\varindexTildeAString}"\varindexTildeAString"\par
% \DescribeMacro{\varindexTildeBString}"\varindexTildeBString"\par
% \DescribeMacro{\varindexSpaceString}"\varindexSpaceString"\par
% \DescribeMacro{\varindexSpaceTokString}"\varindexSpaceTokString"\par
% \DescribeMacro{\varindexOmitString}"\varindexOmitString"\par
% \DescribeMacro{\varindexCommaString}"\varindexCommaString"\par
% \DescribeMacro{\varindexDashString}"\varindexDashString"\par
% \DescribeMacro{\varindexExclamString}"\varindexExclamString"\par
% \DescribeMacro{\varindexNr??String}\relax
%"\varindexNr1String \varindexNr2String ..."
% \end{myquote}
% which expand to the corresponding strings.\par
%
% All the previous macros should not be redefined ``by hand''.
% They are implicitly redefined by the "\varindexSet..." commands
% (which partially also do other tasks).\par
%
%
%
% To drop possible braces, use the command
% \DescribeMacro{\toolboxDropBrace}
% \begin{verbatim}
%   \toolboxDropBrace\variable\end{verbatim}
% of the "toolbox" package.\par
%
% In \meta{scan program} you may already want to call "\toolboxMakeSplit":
% In this way, the choices for the ``magic'' tokens are made in the
% (usually small) argument \meta{scan program}, and in this sense, you can
% keep your (possibly rather complex) macro \meta{main program}
% ``customizable'' (i.\,e.\ you can use the same macro also with a different
% set of ``magic'' strings).
% However, the main task of \meta{scan program} is to introduce
% new flags with
%
% \begin{myquote}
% \DescribeMacro{\varindexNewFlag}
%"\varindexNewFlag"\meta{token}"\position["\meta{program}"\varindexEndOfFlag]"
% \end{myquote}
% or
% \begin{myquote}
%   "\varindexNewFlag"\meta{token}"\position[\programmacro]"
% \end{myquote}
% Here, "\position" is an (undefined) macro, and \meta{token} an arbitrary
% token. The "[program(macro)]" part is optional and is explained later.
% If \meta{token} appears in \meta{flags}, then "\position" is defined to
% expand to a (literally) number, namely the (last) position where token
% was given inside the \meta{flags} list (counting from $0$). For example, if
% \begin{verbatim}
%   \varindexNewFlag ,\commapos
%   \varindexNewFlag -\minuspos
%   \varindexNewFlag .\pointpos\end{verbatim}
% are used in "\programA", then in the call
% \begin{verbatim}
% \varindex(){\programA}{\programB},-**-{}\end{verbatim}
% the variable "\commapos" will expand in "\programB" to "0", while
% "\minuspos" will expand to "4" (the last position is taken). Finally,
% "\pointpos" is "\undefined" (unless you defined "\pointpos" differently
% \emph{after} the call of "\varindexNewFlag"; in this case, this is the
% default).
% If "\varindexNewFlag" is called multiple times with the same token,
% only the \emph{last} call with this token takes effect.
%
% The flags "*" and "1" are introduced in this way with
% \DescribeMacro{\varindexStarPos}
% \DescribeMacro{\varindexOneEntry}
% \begin{verbatim}
% \varindexNewFlag *\varindexStarPos
% \varindexNewFlag 1\varindexOneEntry\end{verbatim}
% \emph{before} \meta{scan program} is executed. This means:
% \begin{enumerate}
% \item Usually, "\varindexStarPos" contains the (last) position of "*"
%    (resp.\ is "\undefined"). Moreover, if you define "\varindexStarPos" in
%    \meta{scan program} or in some flag, you get the same effect as if "*"
%    had been used.
%    An analogous remark holds for "\varindexOneEntry".
% \item If you introduce "*" with "\varindexNewFlag", the "*" looses its
%    original meaning. The same holds for "1".
% \end{enumerate}
%
% If you have added a "[program(macro)]" part in the call of
% "\varindexNewFlag", this part is expanded whenever the flag introduced
% by "\token" is used in the call of "\varindex"
% (note that it is not excluded that this happens several times within one
% call). More precisely, program is expanded \emph{after} the variable
% "\position" has been set to the corresponding value, so you may already
% use "\position" in the program part.
%
% \textbf{Important:} The last token expanded in program \emph{must} be
% \DescribeMacro{\varindexEndOfFlag}"\varindexEndOfFlag".
% This is not nice but has to do with the way \TeX\ parses its arguments.
% Also if you use the form "\programmacro", the \emph{very last} token expanded
% must be "\varindexEndOfFlag". Even a construction like
% \begin{verbatim}
% \def\myprogrammacro{\ifx....
%   \CallSomeMacroWithvarindexEndOfFlagAtTheEnd
% \fi
% \varindexEndOfFlag}\end{verbatim}
% is forbidden: In "\CallSomeMacroWithvarindexEndOfFlagAtTheEnd" an error
% would occur at the end, since still the tokens "\fi\varindexEndOfFlag"
% are in the tokenlist when EndOfFlag is reached there.
% As a workaround, you may e.\,g.\ use
% \begin{myquote}
% "\def\myprogrammacro{\ifx..."\pari
%    "\def\execute{....\varindexEndOfFlag}"\ppari
% "\else"\pari
%    "\def\execute{\varindexEndOfFlag}"\ppari
% "\execute}"
% \end{myquote}
%
% If you use the form "[\programmacro]", your macro may even read additional
% parameters. These parameters are expected in the call of "\varindex"
% \emph{behind} the flag you have introduced. So you may actually use flags
% with parameters. For example, if "\scanprogram" contains a macro like
% \begin{verbatim}
%    \varindexNewFlag -\minuspos[\readpara]\end{verbatim}
% and you have defined
% \begin{verbatim}
%    \def\readpara#1{\def\merk{#1}\varindexEndOfFlag}\end{verbatim}
% then the call
% \begin{verbatim}
%   \varindex(){\scanprogram}{\mainprg}*-{Foo}-{Foo 2}*{Entries}\end{verbatim}
% is admissible, and in \meta{main program},
% "\merk" will have the value ``Foo 2''.
%
% If you are more familiar with \TeX, you can even allow \emph{optional}
% arguments following your flag: The value of the next (non-space) token is
% at the call of "\programmacro" already saved into the macro
% \DescribeMacro{\varindexNextToken}
% \begin{verbatim}
%     \varindexNextToken\end{verbatim}
% so you can just use it to test for e.\,g.\ ``"["''. In this connection,
% you may also want to use the commands
% \DescribeMacro{\varindexTestAndExec}
% \DescribeMacro{\varindexSkipAndExec}
% \begin{verbatim}
%     \varindexTestAndExec
%     \varindexSkipAndExec\end{verbatim}
% Please, see the program text how these commands are applied.\bigskip
%
% Since version 2.1 you can also hack in personal extensions of the format
% string. To do this, use the command
% \begin{myquote}
% \DescribeMacro{\varindexNewFormat}
% "\varindexNewFormat\"\meta{splitcommand}\bracemeta{action}
% \end{myquote}
% Here, "\"\meta{splitcommand} is a command generated by "\toolboxMakeSplit" or
% friends (preferably by "\varindexMakeSplitExpand", because the command should
% act on the format string which is expand with "\varindexedef").
% The string where it splits is the new string you can use
% in the format argument after this call. For each
% occurrence of the corresponding string in the format argument,
% \meta{action} will be executed. If "\"\meta{splitcommand} splits at a string
% which already had a previous meaning in the format string (or which is a
% prefix to such a string) the old meaning of this string in the format string
% is overridden.
%
% Typically, action will contain the following commands:
% One action will probably be to output a desired token (sequence) via
% \begin{myquote}
% \DescribeMacro{\varindexTokensOut}
% "\varindexTokensOut"\bracemeta{text token}\bracemeta{sort token}
% \end{myquote}
% or
% \begin{myquote}
% \DescribeMacro{\varindexTokensOutExpand}
% "\varindexTokensOutExpand"\meta{macro for text token}\relax
%\meta{macro for sort token}
% \end{myquote}
% In the first form, \meta{text token} resp.\ \meta{sort token} is the token
% sequence put into the index or running text respectively into the sort entry
% of the index for the corresponding format entry. The second form is similar
% with the only difference that the arguments must be single macros which
% expand to \meta{text token} and \meta{sort token}, respectively.\par
%
% The variable \DescribeMacro{\ifvarindexIndexMode}
% \begin{verbatim}
%   \ifvarindexIndexMode\end{verbatim}
% can be used to test whether the output goes into the running text or into
% the index (i.\,e.\ whether a ``"*"'' preceeded the current entry).
% For output into the text, \meta{sort token} is ignored, of course).
%
% Another action in "\varindexNewFormat" will probably be to take care of
% the magic space flags. This is achieved by a call of "\varindexNextSpace" or
% "\varindexNoNextSpace" (or separately via "\varindexSpaceTexttrue"/"false"
% resp.\ "\varindexSpaceTexttrue"/"false"); see the earlier description.
% The magic space flags are taken into account in "\varindexTokensOut".
% Thus, if you want to ignore the previous flag for some reason you should set
% them correspondingly before this call.
% However, after the call you should also set them correspondingly for
% further processing.\par
%
% Example:
% \begin{verbatim}
%   \toolboxMakeSplit{:}{splitAtColon}
%     \varindexNewFormat\splitAtColon{%
%        \varindexNoNextSpace
%        \ifvarindexIndexMode
%           \varindexTokensOut{:}{}\varindexSpaceTexttrue
%        \else
%           \varindexTokensOut{---}{}\varindexNoNextSpace
%        \fi}\end{verbatim}
% defines a new format entry ``":"'' which has the meaning that a colon
% (automagically followed by a space) is put into the index but not into
% the sort entry. Moreover, in the running text, the colon appears as a
% long dash with no space followed. In any case, there is no magic space output
% in front of the colon.\bigskip
%
% As an alternative action in "\varindexNewFormat", you can also call the
% default commands for the format entries. The corresponding macros are
% \begin{myquote}
% \DescribeMacro{\varindexAddSpace}"\varindexAddSpace"\myquad"_"\par
% \DescribeMacro{\varindexAddSpTok}"\varindexAddSpTok"\myquad"s"\par
% \DescribeMacro{\varindexAddOmit}"\varindexAddOmit"\myquad"."\par
% \DescribeMacro{\varindexAddDash}"\varindexAddDash"\myquad"-"\par
% \DescribeMacro{\varindexAddComma}"\varindexAddComma"\myquad","\par
% \DescribeMacro{\varindexAddExclam}"\varindexAddExclam"\myquad"!"\par
% \DescribeMacro{\varindexAddTildeA}"\varindexAddTildeA"\myquad"~"\par
% \DescribeMacro{\varindexAddTildeB}"\varindexAddTildeB"\myquad"="\par
% \DescribeMacro{\varindexAddNumber}"\varindexAddNumber"\bracemeta{number}
%\myquad"0-9" (\meta{number} is "1", "2", $\ldots$)
% \end{myquote}
% The precise meaning of these macros is intentionally \emph{not} documented,
% because some details or side effects might change in a future release of
% "varindex". But just for this reason, it might be advantageous to use the
% above macros instead of writing personal substitutes which may fail to
% have such side effects.\par
%
% Example:
% \begin{verbatim}
%    \varindexMakeSplitExpand{~-}{splitPhrase}% It is important to expand
%                                             % (to have correct ~ catcode)
%    \varindexNewFormat\splitPhrase{%
%       \varindexAddTildeA
%       \let\remember\varindexPreceedsDash
%       \let\varindexPreceedsDash\toolboxEmpty
%       \varindexAddDash
%       \let\varindexPreceedsDash\remember}\end{verbatim}
% After the above command, ``"~"'' and ``"-"'' have their usual meaning in
% the format string except when they follow immediately in the form ``"~-"''.
% In this case, the behavior of "-" changes as if "\varindexPreceedsDash"
% were empty (which has the effect that the output looks like~``$\sim$~-''
% instead of~``$\sim$-'').\par
% Note that although "~" is a prefix to "~-", the converse is not true:
% Thus, the above command does not change the previous meaning of~"~"
% (and of course also not of~"-").\par
% \bigskip
%
% \textbf{Some hack:}
% \TeX\ ignores leading spaces in the argument list of a ``normal'' macro.
% This has the effect that you should be able to insert spaces \emph{between}
% any of your arguments without any trouble.
% If this does not work the expected way, you can use the command
% \DescribeMacro{\varindexArgumentSpace}
% \DescribeMacro{\varindexSkipTricky}
% \begin{verbatim}
%    \let\varindexArgumentSpace\varindexSkipTricky\end{verbatim}
% which implements an own macro which does this task. Sadly, this can only
% be done with some catcode trickery which in turn might bring you in trouble
% with some (\emph{very}) exotic packages. You can restore the default with
% \DescribeMacro{\varindexSkipDefault}
% \begin{verbatim}
%    \let\varindexArgumentSpace\varindexSkipDefault\end{verbatim}
%
% All above customization commands/variables may be used anytime between
% two "\varindex" calls. They take effect with the next "\varindex" call.

%
% The macros "\varindextwoScan" and "\varindextwo" are considered as a
% (very useful) \emph{example} for the customization of the "\varindex"
% command. If you need further customization, have a look at their
% definition first.


% \iffalse
%</metainfo>
% \fi
% \iffalse--------------------------------------------------------------\fi
% \StopEventually{\PrintChanges}
%                     \section{Implementation}
%
% \iffalse--------------------------------------------------------------
%
%
%<*package>
% \fi
%    \begin{macrocode}
%%
%% This file was generated by the docstrip utility from varindex.dtx.
%% You may distribute this file only together with the source varindex.dtx
%% (and if possible with varindex.ins) and only if these files are unmodified.
%%
%% Author:
%%
%% M. V\"ath      martin@mvath.de
%%

\ifx\typeout\undefined
  \def\vx@tmp{\immediate\write17}
\else
  \let\vx@tmp\typeout
\fi\vx@tmp{varindex.sty by M. Vaeth: Release 2.3}
\ifx\ProvidesPackage\undefined\else
  \ProvidesPackage{varindex}[2001/05/06 v2.3]
\fi
\ifx\RequirePackage\undefined
  \ifx\toolboxDef\undefined
    \input toolbox.sty
  \fi
  \ifx\toolboxNewifFalse\undefined
    \errmessage{varindex.sty requires toolbox.sty version 3.1 or higher}
  \fi
\else
  \RequirePackage{toolbox}[2001/05/06]
\fi

%    \end{macrocode}
%
% \subsection{The \texttt{varindextwo} (sample) macros and their ``submacros''}
% \begin{macro}{\varindextwo...}\nocomment
%
%    \begin{macrocode}
%%
%% The file starts with the documented (sample) macros with their "sub"macros:
%%

\ifx\newcommand\undefined\else
  \newcommand{\varindextwoScan}{}
  \newcommand{\varindextwo}{}
  \newcommand{\vxtAddmyStar}{}
  \newcommand{\vxtMakemyFormat}{}
\fi

%    \end{macrocode}
%
%  \begin{macro}{\varindextwoScan}
% The demo ``scan'' macro. It provides some new flags.
%    \begin{macrocode}
\def\varindextwoScan{%
  \varindexNewFlag _\vxtSpaceA
  \varindexNewFlag -\vxtDashA
  \varindexNewFlag .\vxtDotA
  \varindexNewFlag <\vxtOmitA
  \varindexNewFlag /\vxtNoTildeA
  \varindexNewFlag `\vxtNopropA
  \varindexNewFlag P\vxtNopropA% Now obsolete; only for backward compatibility
  \varindexNewFlag ^\vxtBreakifyA
  \varindexNewFlag ,\vxtCommaB
  \varindexNewFlag ~\vxtSpaceB
  \varindexNewFlag +\vxtDashB
  \varindexNewFlag ;\vxtDotB
  \varindexNewFlag >\vxtOmitB
  \varindexNewFlag !\vxtTildeB
  \varindexNewFlag ?\vxtNoTildeB
  \varindexNewFlag p\vxtNopropB% Now obsolete; only for backward compatibility
  \varindexNewFlag '\vxtNopropB
  \varindexNewFlag =\vxtDashifyB
  \varindexNewFlag :\vxtOmitifyB
  \varindexMakeSplitExpand{+}{vxtSplitAtMagic}% + is the magic symbol
}

%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\varindextwo}
% The ``main'' demo macro which generates two "\index" commands
% whose format depends on the number of entries in \meta{main entries}
%    \begin{macrocode}
\def\varindextwo{%
  \let\vxtStarFormat\undefined
  \def\vxtexecute{\let\vxtmyFormat\varindexFormatDefault}%
  \ifcase\varindexCount
    % We have 0 entries (this cannot happen: {} generates one (empty) entry)
  \or% 1 entry:
    \def\vxtexecute{%
      \toolboxDef\vxtmyFormat{1}%
      \toolboxDef\vxtStarFormat{\varindexOutputString 1}}%
  \or% 2 entries:
    \def\vxtentryAa{1}%
    \def\vxtentryAb{2}%
    \def\vxtentryBa{2}%
    \def\vxtentryBb{1}%
    \let\vxtexecute\vxtMakemyFormat
  \or% 3 entries:
    \def\vxtentryAa{1}%
    \ifx\vxtNopropA\undefined
      \def\vxtentryAb{23}%
    \else
      \def\vxtentryAb{3}%
    \fi
    \def\vxtentryBa{3}%
    \ifx\vxtNopropB\undefined
      \def\vxtentryBb{12}%
    \else
      \def\vxtentryBb{1}%
    \fi
    \let\vxtexecute\vxtMakemyFormat
  \or% 4 entries:
    \def\vxtentryAa{1}%
    \ifx\vxtNopropA\undefined
      \def\vxtentryAb{24}%
    \else
      \def\vxtentryAb{4}%
    \fi
    \def\vxtentryBa{4}%
    \ifx\vxtNopropB\undefined
      \def\vxtentryBb{13}%
    \else
      \def\vxtentryBb{1}%
    \fi
    \let\vxtexecute\vxtMakemyFormat
  \else% more than 4 entries:
    \def\vxtexecute{\let\vxtmyFormat\varindexFormatDefault}%
  \fi
  \ifvarindexExplicitFormat% the optional format string was given:
    \expandafter\vxtSplitAtMagic\expandafter{\varindexFormat}\vxttmp\vxttmpa
    \ifx\vxttmpa\undefined
      % If the Magic symbol does not occur, we do nothing
    \else% Otherwise:
      % We generate our format and insert it at the place of the Magic symbol:
      \vxtexecute
      \toolboxDef\varindexFormat{\vxttmp\vxtmyFormat\vxttmpa}%
      \vxtAddmyStar
    \fi
  \else% without an optional format string, we generate our own format
    \vxtexecute
    \let\varindexFormat\vxtmyFormat
    \vxtAddmyStar
  \fi
}

%    \end{macrocode}
%  \end{macro}
%  Some flags used for the "varindextwo" macros.
%  \begin{macro}{\ifvarindextwoCommaTilde}\nocomment
%    \begin{macrocode}
\toolboxNewiftrue{varindextwoCommaTilde}
%    \end{macrocode}
%  \end{macro}
%  \begin{macro}{\ifvarindextwoDashTilde}\nocomment
%    \begin{macrocode}
\toolboxNewiftrue{varindextwoDashTilde}
%    \end{macrocode}
%  \end{macro}
%  \begin{macro}{\ifvarindextwoDashSpace}\nocomment
%    \begin{macrocode}
\toolboxNewiffalse{varindextwoDashSpace}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\vxtAddmyStar}
% A submacro needed by "\varindextwo"
%    \begin{macrocode}
\def\vxtAddmyStar{%
  \ifvarindexStar% With the * flag, and
    \ifx\vxtStarFormat\undefined\else% if we have our own StarFormat:
      \varindexStarfalse% <- No further prepending of `*' desired afterwards
      \expandafter\varindexSplitAtOutput\expandafter{\varindexFormat}%
        \vxttmp\vxttmp
      \ifx\vxttmp\undefined% Did no `*' occur in the format string yet?
        \ifx\varindexFormat\toolboxEmpty% Empty format means: Only the * part:
          \let\varindexFormat\vxtStarFormat
        \else%Normally, we prepend our *-format and a space
          \toolboxDef\varindexFormat{%
            \vxtStarFormat\varindexIndexString\varindexFormat}%
        \fi
      \fi
    \fi
  \fi
}

%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\vxtAddmyStar}
% A submacro needed by "\varindextwo"
%    \begin{macrocode}
\def\vxtMakemyFormat{%
  \let\vxtstarseparator\toolboxEmpty
  \ifx\vxtBreakifyA\undefined
    \ifx\vxtSpaceA\undefined
      \ifx\vxtDashA\undefined
        \ifx\vxtDotA\undefined
          \vxtExclamSeparator
        \else
          \let\vxtseparator\varindexOmitString
          \let\vxtstarseparator\vxtseparator
        \fi
      \else
        \let\vxtseparator\varindexDashString
        \let\vxtstarseparator\vxtseparator
      \fi
    \else
      \let\vxtseparator\toolboxEmpty
    \fi
  \else% With ^
    \ifx\vxtDotA\undefined
      \let\vxtstarseparator\varindexDashString
      \ifx\vxtDashA\undefined% -^
        \ifvarindextwoDashTilde
          \vxtExclamSeparator
          \toolboxAppend\vxtseparator\vxtstarseparator
        \else
           \toolboxDef\vxtseparator{\varindexExclamString\vxtstarseparator}%
        \fi
      \else% Plain ^
        \vxtExclamSeparator
        \ifvarindextwoDashSpace
          \toolboxDef\vxtseparator{\vxtstarseparator\vxtseparator}%
        \else
          \toolboxDef\vxtseparator{%
            \vxtstarseparator\vxtseparator\varindexOmitString}%
        \fi
      \fi
    \else% .^
      \let\vxtstarseparator\varindexOmitString
      \vxtExclamSeparator
      \toolboxAppend\vxtseparator\vxtstarseparator
    \fi
  \fi
  \ifx\vxtOmitA\undefined
    % We define now the string "\vxtentryAa?\vxtentryAb" where
    % ? is determined by the flags.
    \toolboxDef\vxtmyFormat{\vxtentryAa\vxtseparator\vxtentryAb}%
  \else
    \let\vxtmyFormat\toolboxEmpty
  \fi
  % The *-format is calculated similarly:
  \toolboxDef\vxtStarFormat{\varindexOutputString
    \vxtentryAa\vxtstarseparator\vxtentryAb}%
  \ifx\vxtOmitB\undefined
    \let\vxtappend\toolboxEmpty
    \ifx\vxtSpaceB\undefined
      \ifx\vxtDashB\undefined
        \ifx\vxtDotB\undefined
          \ifx\vxtCommaB\undefined
            \let\vxtseparator\varindexExclamString
            \let\vxtappend\varindexTildeAString
          \else
            \let\vxtseparator\varindexCommaString
            \ifvarindextwoCommaTilde
              \let\vxtappend\varindexTildeAString
            \fi
          \fi
          \ifx\vxtDashifyB\undefined
            \ifx\vxtOmitifyB\undefined\else
              \toolboxDef\vxtappend{\varindexOmitString\vxtappend}%
            \fi
          \else
            \toolboxDef\vxtappend{\varindexDashString\vxtappend}%
          \fi
        \else
          \let\vxtseparator\varindexOmitString
        \fi
      \else
        \let\vxtseparator\varindexDashString
      \fi
    \else
      \let\vxtseparator\toolboxEmpty
    \fi
    \ifx\vxtTildeB\undefined\else
      \let\vxtappend\varindexTildeAString
    \fi
    \ifx\vxtNoTildeB\undefined\else
      \let\vxtappend\toolboxEmpty
    \fi
    % In all cases, we prepend now the string "\vxtentryBa?\vxtentryBb??"
    % where ? and ?? are determined by the flags
    \ifx\vxtmyFormat\toolboxEmpty% If the previous string was empty: no space
      \toolboxDef\vxtmyFormat{\vxtentryBa\vxtseparator\vxtentryBb\vxtappend}%
    \else
      \toolboxAppend\vxtmyFormat{%
        \varindexIndexString\vxtentryBa\vxtseparator\vxtentryBb\vxtappend}%
    \fi
  \fi
}
%    \end{macrocode}
%  \end{macro}
%  \begin{macro}{\vxtAddmyStar}
% A submacro needed by "\vxtMakemyFormat"
%    \begin{macrocode}
\def\vxtExclamSeparator{%
  \ifx\vxtNoTildeA\undefined
    \toolboxDef\vxtseparator{\varindexExclamString\varindexTildeAString}%
  \else
    \let\vxtseparator\varindexExclamString
  \fi}

%    \end{macrocode}
%  \end{macro}
% \end{macro}
%
%    \begin{macrocode}
%% --------------------------------------------------------------------
%    \end{macrocode}
% \subsection{The main implementation of \texttt{varindex}}
%    \begin{macrocode}
%%
%% Now the implementation of \varindex.
%%
%    \end{macrocode}
%
%
% Counters and default variables:\par
%
% We cannot use "\toolboxIf" for "\newcount", because in plain \TeX\ and
% \LaTeX 2.09 the command "\newcount" is defined with the annoying "\outer"
% flag.
%    \begin{macrocode}

\ifx\varindexCount\undefined
  \newcount\varindexCount
\fi

%    \end{macrocode}
% \begin{macro}{\varindexPlaceholderAText}\nocomment
%    \begin{macrocode}
\toolboxIf\undefined\def\varindexPlaceholderAText{$\sim$}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexPlaceholderASort}\nocomment
%    \begin{macrocode}
\toolboxIf\undefined\let\varindexPlaceholderASort\toolboxEmpty
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexPlaceholderBText}\nocomment
%    \begin{macrocode}
\toolboxIf\undefined\def\varindexPlaceholderBText{$\approx$}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexPlaceholderBSort}\nocomment
%    \begin{macrocode}
\toolboxIf\undefined\let\varindexPlaceholderBSort\toolboxEmpty

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexUsePlaceholderA}\nocomment
%    \begin{macrocode}
\toolboxNewiftrue{varindexUsePlaceholderA}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexUsePlaceholderB}\nocomment
%    \begin{macrocode}
\toolboxNewiftrue{varindexUsePlaceholderB}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexLeadingPlaceholderA}\nocomment
%    \begin{macrocode}
\toolboxNewiftrue{varindexLeadingPlaceholderA}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexLeadingPlaceholderB}\nocomment
%    \begin{macrocode}
\toolboxNewiftrue{varindexLeadingPlaceholderB}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexCommaLeads}\nocomment
%    \begin{macrocode}
\toolboxNewiftrue{varindexCommaLeads}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexCommaExpand}\nocomment
%    \begin{macrocode}
\toolboxNewiftrue{varindexCommaExpand}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexPreviousAText}\nocomment
%    \begin{macrocode}
\toolboxNewiffalse{varindexPreviousAText}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexPreviousASort}\nocomment
%    \begin{macrocode}
\toolboxNewiffalse{varindexPreviousASort}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexPreviousBText}\nocomment
%    \begin{macrocode}
\toolboxNewiffalse{varindexPreviousBText}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexPreviousBSort}\nocomment
%    \begin{macrocode}
\toolboxNewiffalse{varindexPreviousBSort}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexEliminateInnerBrace}\nocomment
%    \begin{macrocode}
\toolboxNewiftrue{varindexEliminateInnerBrace}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexEliminateOuterBrace}\nocomment
%    \begin{macrocode}
\toolboxNewiftrue{varindexEliminateOuterBrace}

%    \end{macrocode}
% \end{macro}
%
%
% The non-local macros (they should not exist already):
%
%    \begin{macrocode}
\ifx\newcommand\undefined\else
  \newcommand{\varindex}{}
  \newcommand{\varindexNewFlag}{}
  \newcommand{\varindexTestAndExec}{}
  \newcommand{\varindexSkipAndExec}{}
  \newcommand{\varindexSkipDefault}{}
  \newcommand{\varindexSkipTricky}{}
  \newcommand{\varindexMakeVarSplit}{}
  \newcommand{\varindexMakeSplitExpand}{}
  \newcommand{\varindexSetWordString}{}
  \newcommand{\varindexSetSortString}{}
  \newcommand{\varindexSetPlainString}{}
  \newcommand{\varindexSetIndexString}{}
  \newcommand{\varindexSetOutputString}{}
  \newcommand{\varindexSetTildeAString}{}
  \newcommand{\varindexSetTildeBString}{}
  \newcommand{\varindexSetSpaceString}{}
  \newcommand{\varindexSetSpaceTokString}{}
  \newcommand{\varindexSetOmitString}{}
  \newcommand{\varindexSetCommaString}{}
  \newcommand{\varindexSetDashString}{}
  \newcommand{\varindexSetExclamString}{}
  \newcommand{\varindexSetStringForNr}{}
  \newcommand{\varindexedef}{}
  \newcommand{\varindexArgumentSpace}{}
  \newcommand{\varindexNewFormat}{}
  \newcommand{\varindexTokensOut}{}
  \newcommand{\varindexTokensOutExpand}{}
  \newcommand{\varindexAddNumber}{}
  \newcommand{\varindexAddComma}{}
  \newcommand{\varindexAddTildeA}{}
  \newcommand{\varindexAddTildeB}{}
  \newcommand{\varindexAddExclam}{}
  \newcommand{\varindexAddSpace}{}
  \newcommand{\varindexAddSpTok}{}
  \newcommand{\varindexAddOmit}{}
  \newcommand{\varindexAddDash}{}
  \newcommand{\varindexDoConvert}{}
  \newcommand{\varindexNoConvert}{}
%% Obsolete names (only provided for backward compatibility):
  \newcommand{\varindexdef}{}
  \newcommand{\varindexspace}{}
  \newcommand{\varindexDropBrace}{}
  \newcommand{\varindexMakeSplit}{}
  \newcommand{\varindexLet}{}
  \newcommand{\varindexWithNr}{}
\fi
\let\varindexdef\toolboxDef
\let\varindexspace\toolboxSpace
\let\varindexDropBrace\toolboxDropBrace
\let\varindexMakeSplit\toolboxMakeSplit
\let\varindexLet\toolboxLet
\let\varindexWithNr\toolboxWithNr

%    \end{macrocode}
%
% \begin{macro}{\varindex}
%
% The essential ``flow'' is easy:
%
% "\varindex" reads the arguments (using lots of auxiliary macros)
% and then calls "\vx@Main".
%
%    \begin{macrocode}
\def\varindex{\begingroup
%    \end{macrocode}
% Before "toolbox" 3.1 the following "\if"'s could not be made local.
% The reason is that in plain \TeX\ and \LaTeX 2.09 the command "\newif" is
% "\outer". Due to this stupid restriction, we had to define them before.
% "toolbox" 3.1 has now implemented its own "\newif" command for this
% reason.\par\bigskip
%
% "\if"'s for scanning of the parameters:
%
% \begin{macro}{\ifvarindexStar}\nocomment
%    \begin{macrocode}
  \toolboxNewifFalse{varindexStar}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexExplicitFormat}\nocomment
%    \begin{macrocode}
  \toolboxNewifFalse{varindexExplicitFormat}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvx@atespace}
% is true if a space was ate during skipping
%    \begin{macrocode}
  \toolboxNewifFalse{vx@atespace}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvx@savespace}
% is true if we must ``put back'' an eaten space
%    \begin{macrocode}
  \toolboxNewifFalse{vx@savespace}%
%    \end{macrocode}
% \end{macro}
% "\if"'s for "\vx@main" and its submacros:
% \begin{macro}{\ifvx@ffound}\nocomment
%    \begin{macrocode}
  \toolboxNewifFalse{vx@ffound}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexIndexMode}\nocomment
% "\ifvarindexIndexMode" is true if the currently parsed format corresponds
% to an index entry (in contrast to the output into the running text).
%    \begin{macrocode}
  \toolboxNewifTrue{varindexIndexMode}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexSpaceText}\nocomment
%    \begin{macrocode}
  \toolboxNewifFalse{varindexSpaceText}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvarindexSpaceSort}\nocomment
%    \begin{macrocode}
  \toolboxNewifFalse{varindexSpaceSort}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvx@firstiter}\nocomment
%    \begin{macrocode}
  \toolboxNewifTrue{vx@firstiter}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvx@tildeLead}
% Decides whether we have a leading tilde
%    \begin{macrocode}
  \toolboxNewifFalse{vx@tildeLead}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvx@commaTextLead}
% True if "\ifvarindexCommaExpand" is true and we have no token after comma.
%    \begin{macrocode}
  \toolboxNewifFalse{vx@commaTextLead}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifvx@commaSortLead}\nocomment
% True if "\ifvarindexCommaExpand" is true and we have no token after comma.
%    \begin{macrocode}
  \toolboxNewifFalse{vx@commaSortLead}%
%    \end{macrocode}
% \end{macro}
% We use "\varindexCount" also for generic flags to save counters.
%    \begin{macrocode}
  \varindexCount=0\relax
  \let\varindexStyle\toolboxEmpty
  \let\varindexAppend\toolboxEmpty
  \let\vx@text\toolboxEmpty
  \let\vx@mainprogram\undefined
  \let\vx@formatA\undefined
  \let\vx@formatAstar\undefined
  \let\varindexFormat\undefined
  \let\varindexFormatDefault\undefined
  \varindexNewFlag 1\varindexOneEntry
  \varindexNewFlag *\varindexStarPos
  \varindexTestAndExec(%optional formatA)
    \vx@ReadFormatA%else
    \vx@TestTextStyle}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ReadFormatA}\nocomment
%    \begin{macrocode}
\def\vx@ReadFormatA(#1){%
  \def\vx@formatA{#1}%
  \varindexTestAndExec(%optional formatAstar)
    \vx@ReadFormatAstar%else
    \vx@SkipAndReadScan}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ReadFormatAstar}\nocomment
%    \begin{macrocode}
\def\vx@ReadFormatAstar(#1){%
  \def\vx@formatAstar{#1}\vx@SkipAndReadScan}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@SkipAndReadScan}\nocomment
%    \begin{macrocode}
\def\vx@SkipAndReadScan{\varindexSkipAndExec\vx@ReadScan}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ReadScan}\nocomment
%    \begin{macrocode}
\def\vx@ReadScan#1{#1\toolboxEmpty\varindexSkipAndExec\vx@ReadProgram}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ReadProgram}\nocomment
%    \begin{macrocode}
\def\vx@ReadProgram#1{\def\vx@mainprogram{#1}\vx@TestTextStyle}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@TestTextStyle}\nocomment
%    \begin{macrocode}
\def\vx@TestTextStyle{%
  \varindexTestAndExec[%textstyle]
    \vx@ReadTextStyle%else
    \vx@TestFlags}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ReadTextStyle}\nocomment
%    \begin{macrocode}
\def\vx@ReadTextStyle[#1]{%
  \def\varindexStyle{#1}%
  \varindexTestAndExec[%pagestyleA]
    \vx@ReadPageStyleA%else
    \vx@TestFlags}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ReadTextStyleA}\nocomment
%    \begin{macrocode}
\def\vx@ReadPageStyleA[#1]{\def\varindexAppend{#1}\vx@TestFlags}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vx@TestFlags}
% This macro starts the flag read loop.
%    \begin{macrocode}
\def\vx@TestFlags{%
%    \end{macrocode}
% In this loop, we use "\varindexCount" for the flag position.
%    \begin{macrocode}
  \varindexCount=0\relax
  \varindexEndOfFlag}

%    \end{macrocode}
% "\varindexEndOfFlag" is the value of the `first to call' TestFlag...
% (which is actually the last TestFlag... defined)
% Let us first initialize it to TestFlag0:
%    \begin{macrocode}
\varindexCount=0\relax
\expandafter
\def\expandafter\varindexEndOfFlag\expandafter{%
  \csname vx@TestFlag\the\varindexCount\endcsname}
%    \end{macrocode}
%Initialize the `last' "\vx@TestFlag0" as a macro with the meaning
%``start to read \meta{main entries}''.
%    \begin{macrocode}
\expandafter
\def\varindexEndOfFlag{\varindexSkipAndExec\vx@ReadMain}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vx@TestFlag0}
% "\vx@TestFlag0" is the first macro generated by "\varindexNewFlag".
%
%  \begin{macro}{\varindexNewFlag}
%  "\varindexNewFlag" calls "\vx@MakeNewFlag" with appropriate arguments:
%
%    \begin{macrocode}
\def\varindexNewFlag#1#2{%
  \let#2\undefined
  \expandafter
  \def\expandafter\vx@tmp\expandafter{%
    \csname vx@TestFlag\the\varindexCount\endcsname #1#2}%
  \advance\varindexCount by 1\relax
%    \end{macrocode}
% A bug in \TeX? Without this "\relax", the next "\expandafter"
% is executed \emph{before} the counter is actually increased.
%    \begin{macrocode}
  \expandafter
    \toolboxSurround\expandafter{%
      \csname vx@TestFlag\the\varindexCount\expandafter\endcsname
      \csname vx@ReadFlag\the\varindexCount\endcsname}{}\vx@tmp
  \varindexTestAndExec[%program]
    \vx@ReadFlagProgram%else
    {\vx@MakeFlagProgram\varindexEndOfFlag}%
}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\vx@ReadFlagProgram}\nocomment
%    \begin{macrocode}
\def\vx@ReadFlagProgram[#1]{\vx@MakeFlagProgram{#1}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@MakeFlagProgram}\nocomment
%    \begin{macrocode}
\def\vx@MakeFlagProgram#1{\expandafter\vx@MakeNewFlag\vx@tmp{#1}}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vx@MakeNewFlag}
% Usage:
% "\vx@MakeNewFlag\TestMacro\ReadMacro\PrevMacro\token\pos"\bracemeta{program}
%    \begin{macrocode}
\def\vx@MakeNewFlag#1#2#3#4#5#6{%
  \def\varindexEndOfFlag{#1}%
  \def#1{\varindexTestAndExec#4{#2}{#3}}%
  \def#2#4{\expandafter
    \def\expandafter#5\expandafter{\the\varindexCount}%
    \advance\varindexCount by 1\relax
    \varindexSkipAndExec{#6}}%
}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ReadMain}\nocomment
%    \begin{macrocode}
\long\def\vx@ReadMain#1{\def\vx@text{#1}%
  \ifx\vx@formatA\undefined
    \def\vx@exec{\varindexSkipAndExec\vx@ReadFormatB}%
  \else
    \def\vx@exec{%
      \varindexTestAndExec[%FormatB]
        \vx@ReadOptFormatB%else
        {\ifvx@atespace\vx@savespacetrue\fi\vx@TestAppend}}%
  \fi
  \vx@exec}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ReadFormatB}\nocomment
%    \begin{macrocode}
\def\vx@ReadFormatB#1{\def\varindexFormat{#1}\vx@TestAppend}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ReadOptFormatB}\nocomment
%    \begin{macrocode}
\def\vx@ReadOptFormatB[#1]{\def\varindexFormat{#1}\vx@TestAppend}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@TestAppend}\nocomment
%    \begin{macrocode}
\def\vx@TestAppend{%
  \varindexTestAndExec[%Append]
    {\vx@savespacefalse\vx@ReadAppend}%else
    {\ifvx@atespace\vx@savespacetrue\fi\vx@Main}}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ReadAppend}\nocomment
%    \begin{macrocode}
\def\vx@ReadAppend[#1]{\def\varindexAppend{#1}\vx@Main}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\varindexTestAndExec}
% "\varindexTestAndExec\Token"\bracemeta{ifpart}\bracemeta{elsepart}
% at the end of a macro:
% Steps forward in the token list as long as there are spaces.
% If a space is eaten, "\vx@atespace" is set true.
% The next (non-space) token is put into "\varindexNextToken".
% If this token is "\Token", then \meta{ifpart} is executed, otherwise
% \meta{elsepart}.
%    \begin{macrocode}
\def\varindexTestAndExec#1#2#3{%
  \varindexSkipAndExec{%
    \ifx\varindexNextToken#1%
      \def\vx@exec{#2}%
    \else
      \def\vx@exec{#3}%
    \fi
    \vx@exec}}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexSkipAndExec}
% "\varindexSkipAndExec"\bracemeta{commands}  at the end of a macro:
% Steps forward in the token list as long as there are spaces.
% The next (non-space) token is put into "\varindexNextToken".
% Then commands are executed.
%    \begin{macrocode}
\def\varindexSkipAndExec#1{%
  \vx@atespacefalse
  \def\vx@skipexec{#1}%
  \varindexArgumentSpace}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexSkipDefault}\nocomment
%    \begin{macrocode}
\def\varindexSkipDefault{\futurelet\varindexNextToken\vx@skipexec}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexSkipTrickery}\nocomment
%    \begin{macrocode}
\def\varindexSkipTricky{%
  \vx@MakeSpaceOther\futurelet\varindexNextToken\vx@SkipLoopTest}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexSkipLoopTest}\nocomment
%    \begin{macrocode}
\def\vx@SkipLoopTest{%
  \vx@MakeSpaceSpace
  \ifx\varindexNextToken\vx@spaceothertok
    \def\vx@skipnext{\vx@gobblespace a}%
  \else
    \let\vx@skipnext\vx@skipexec
  \fi
  \vx@skipnext}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@gobblespace}\nocomment
%    \begin{macrocode}
\def\vx@gobblespace a#1{\vx@atespacetrue\varindexSkipTricky}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vx@Main}
% This macro is called after all arguments are read into appropriate macros.
% Now the macros will be parsed (possibly using the argument
% \meta{mainprogram}), and then the output is produced.
% Finally, the group is closed and a possible ``eaten space'' is put back.
%    \begin{macrocode}
\def\vx@Main{%
  \ifx\varindexStarPos\undefined
    \varindexStarfalse
  \else
    \varindexStartrue
  \fi
  \ifx\vx@formatA\undefined
%    \end{macrocode}
% The default format is empty if no default format is given
%    \begin{macrocode}
    \let\varindexFormatDefault\toolboxEmpty
  \else
    \ifvarindexStar
      \ifx\vx@formatAstar\undefined
        \let\varindexFormatDefault\vx@formatA
      \else
        \let\varindexFormatDefault\vx@formatAstar
      \fi
    \else
      \let\varindexFormatDefault\vx@formatA
    \fi
  \fi
%    \end{macrocode}
% Now we parse \meta{main entries}:
%    \begin{macrocode}
  \toolboxDef\vx@toparse{\vx@text\vx@word\vx@endparse}%
  \ifx\varindexOneEntry\undefined
    \varindexCount=0\relax
    \let\vx@NextLoop\vx@TextLoop
    \vx@TextLoop
  \else
    \varindexCount=1\relax
    \ifvarindexEliminateOuterBrace
      \toolboxDropBrace\vx@text
    \fi
    \expandafter\vx@TextEntry\expandafter{\vx@text}%
  \fi
  \expandafter
  \def\expandafter\varindexLastEntry\expandafter{\the\varindexCount}%
%    \end{macrocode}
% Now we expand the format(s):
%    \begin{macrocode}
  \varindexedef\varindexFormatDefault{\varindexFormatDefault}%
  \ifx\varindexFormat\undefined
    \varindexExplicitFormatfalse
    \let\varindexFormat\varindexFormatDefault
  \else
    \varindexExplicitFormattrue
    \varindexedef\varindexFormat{\varindexFormat}%
  \fi
%    \end{macrocode}
% Now we execute \meta{mainprogram}, and expand "\varindexFormat" again:
%    \begin{macrocode}
  \ifx\vx@mainprogram\undefined\else
    \vx@mainprogram
    \varindexedef\varindexFormat{\varindexFormat}%
  \fi
%    \end{macrocode}
% Still modify "\varindexFormat":
%    \begin{macrocode}
  \ifvarindexStar
%    \end{macrocode}
% Prepend `"*"' resp. `"*"\myspace'
%    \begin{macrocode}
    \expandafter\varindexSplitAtOutput\expandafter{\varindexFormat}\vx@fa\vx@fb
    \ifx\vx@fb\undefined
%    \end{macrocode}
% The `"*"' does not occur in "\varindexFormat"
%    \begin{macrocode}
      \expandafter\varindexSplitAtIndex\expandafter{\varindexFormat}%
        \vx@fa\vx@fb
      \ifx\vx@fb\undefined
%    \end{macrocode}
% We did not find a `space'
%    \begin{macrocode}
        \let\vx@fa\undefined
      \fi
      \ifx\vx@fa\toolboxEmpty
%    \end{macrocode}
% Did we find a `space' immediately at the start?
% Then prepend only `"*"'
%    \begin{macrocode}
        \toolboxDef\varindexFormat{\varindexOutputString\varindexFormat}%
      \else
%    \end{macrocode}
%         prepend `"*"\myspace'
%    \begin{macrocode}
        \toolboxDef\varindexFormat{%
          \varindexOutputString\varindexIndexString\varindexFormat}%
      \fi
    \fi
  \fi
  \ifx\varindexFormat\varindexOutputString
%    \end{macrocode}
% Replace `"*"' by `"*"\myspace'
%    \begin{macrocode}
    \toolboxDef\varindexFormat{\varindexOutputString\varindexIndexString}%
  \fi
%    \end{macrocode}
% Now we interpret "\varindexFormat" and produce the output:
%    \begin{macrocode}
  \ifx\varindexFormat\toolboxEmpty
    \vx@FormatAll
  \else
    \toolboxDef\vx@toparse{\varindexFormat\varindexIndexString\vx@endparse}%
    \let\vx@NextLoop\vx@FormLoop
    \vx@FormLoop
  \fi
  \ifvx@savespace\aftergroup\space\fi
\endgroup}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@endparse}
% "\vx@endparse" is the end of the string to parse:
%    \begin{macrocode}
\def\vx@endparse{\vx@endparse}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vx@TextLoop}
% This is the (recursive) macro which parses \meta{main entries}.
% For each entry (separated by "\vx@word"), possibly with braces
% eliminated, the macro "\vx@TextEntry" is called.
%
%    \begin{macrocode}
\def\vx@TextLoop{%
  \ifx\vx@toparse\vx@endparse
    \let\vx@NextLoop\toolboxEmpty
  \else
    \advance\varindexCount by 1\relax
    \expandafter\vx@SplitAtWord\expandafter{\vx@toparse}%
      \vx@textentry\vx@toparse
    \ifvarindexEliminateOuterBrace
      \toolboxDropBrace\vx@textentry
    \fi
    \expandafter\vx@TextEntry\expandafter{\vx@textentry}%
  \fi
  \vx@NextLoop}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@FormLoop}
% This is the (recursive) macro which parses the \meta{format}.
% For each entry (separated by space or by "*") the function
% "\vx@Format" is called with "\varindexIndexMode" set correspondingly.
%    \begin{macrocode}
\def\vx@FormLoop{%
  \ifx\vx@toparse\vx@endparse
    \let\vx@NextLoop\toolboxEmpty
  \else
    \expandafter\varindexSplitAtIndex\expandafter{\vx@toparse}\vx@fa\vx@fb
    \expandafter\varindexSplitAtOutput\expandafter{\vx@fa}\vx@fa\vx@fc
    \ifx\vx@fa\toolboxEmpty
%    \end{macrocode}
% Have we reached an empty entry in the format string?
%    \begin{macrocode}
      \ifvx@firstiter%%       In the first iteration,
%%      \ifx\vx@fc\undefined% if 'space' is the very first sign,
%%        \vx@FormatAll%      we output everything
%%      \fi
      \else
%    \end{macrocode}
% Later, we always output everything.
%    \begin{macrocode}
        \vx@FormatAll
      \fi
    \else
%    \end{macrocode}
% Usually, we just work with our current entry
%    \begin{macrocode}
      \expandafter\vx@Format\expandafter{\vx@fa}%
    \fi
    \vx@firstiterfalse
    \ifx\vx@fc\undefined
%    \end{macrocode}
% If the first separating sign is 'space':
%    \begin{macrocode}
      \varindexIndexModetrue
      \let\vx@toparse\vx@fb
    \else
%    \end{macrocode}
% If the first separating sign is "*":
%    \begin{macrocode}
      \varindexIndexModefalse
      \expandafter
      \varindexSplitAtOutput\expandafter{\vx@toparse}\vx@fa\vx@toparse
    \fi
  \fi
  \vx@NextLoop}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vx@FormatAll}
% This macro is as "\vx@Format", just that everything is output:
%    \begin{macrocode}
\def\vx@FormatAll{%
  \vx@FormatInit
  \expandafter
  \def\expandafter\vx@Count\expandafter{\the\varindexCount}\relax
  \varindexCount=0\relax
  \let\vx@NextFormatAllLoop\vx@FormatAllLoop
  \vx@FormatAllLoop
  \expandafter\varindexCount\expandafter=\vx@Count\relax
  \vx@Write}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@FormatAllLoop}\nocomment
%    \begin{macrocode}
\def\vx@FormatAllLoop{%
  \advance\varindexCount by 1\relax
  \expandafter
  \varindexAddNumber\expandafter{\the\varindexCount}%
  \expandafter
  \ifnum\varindexLastEntry=\varindexCount
    \let\vx@NextFormatAllLoop\toolboxEmpty
  \fi
  \vx@NextFormatAllLoop}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@AppendwithCount}
% The content of the variable "#2\the\varindexCount" is appended to "#1".
% If both, "#1" and "#2\the\varindexCount" are nonempty, a space
% is inserted between.
%    \begin{macrocode}
\def\vx@AppendWithCount#1#2{%
  \toolboxLet\vx@tmp{#2\the\varindexCount}%
  \ifx#1\toolboxEmpty
    \let#1\vx@tmp
  \else
    \ifx\vx@tmp\toolboxEmpty\else\toolboxAppend#1{\toolboxSpace\vx@tmp}\fi
  \fi}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vx@Format}
% This is the macro which parses the format string "#1" for one single
% output, either into index or into running text, depending on
% "\ifvarindexIndexMode".
%
%    \begin{macrocode}
\def\vx@Format#1{%
  \vx@FormatInit
  \def\vx@fparse{#1}%
  \toolboxAppend\vx@fparse\vx@endparse
  \let\vx@FormatNextLoop\vx@FormatLoop
  \vx@FormatLoop
  \vx@Write
}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@FormatInit}\nocomment
%    \begin{macrocode}
\def\vx@FormatInit{%
  \let\vx@outputlist\toolboxEmpty
  \let\vx@textlist\toolboxEmpty
  \let\vx@sortlist\toolboxEmpty
  \let\vx@textlistBefore\toolboxEmpty
  \let\vx@sortlistBefore\toolboxEmpty
  \let\vx@tildeAText\varindexPlaceholderAText
  \let\vx@tildeASort\varindexPlaceholderASort
  \let\vx@tildeBText\varindexPlaceholderBText
  \let\vx@tildeBSort\varindexPlaceholderBSort
  \vx@tildeLeadtrue
  \ifvarindexCommaExpand
    \vx@commaTextLeadtrue
    \vx@commaSortLeadtrue
  \else
    \vx@commaTextLeadfalse
    \vx@commaSortLeadfalse
  \fi
  \varindexNoNextSpace
}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@FormatLoop}
% "\vx@FormatLoop" is the main loop which parses one (space-separated) entry
% in the format string. The essential part here is the command
% "\vx@HandleFormat" which is described below.
% Essentially, "\vx@HandleFormat" is a list of subsequent calls to
% "\vx@condexec"
%    \begin{macrocode}
\def\vx@FormatLoop{%
  \vx@ffoundfalse
  \ifx\vx@fparse\vx@endparse
    \let\vx@FormatNextLoop\toolboxEmpty
  \else
    \vx@HandleFormat
    \ifvx@ffound\else
      \expandafter\vx@ErrorFormat\vx@fparse
      \let\vx@FormatNextLoop\toolboxEmpty
    \fi
  \fi
  \vx@FormatNextLoop
}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@condexec}\nocomment
%    \begin{macrocode}
\def\vx@condexec#1#2{\ifvx@ffound\else
  \expandafter #1\expandafter{\vx@fparse}\vx@fparseA\vx@fparseB
  \ifx\vx@fparseB\undefined\else
    \ifx\vx@fparseA\toolboxEmpty
      \let\vx@fparse\vx@fparseB
      \vx@ffoundtrue
      #2%
    \fi
  \fi
\fi}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@HandleFormat}
%  "\vx@HandleFormat" is a list of commands of the form
%  "\vx@condexec"\bracemeta{splitcommand}\bracemeta{action}.
%  The idea is that if \meta{splitcommand} splits at the `current' token
%  of the format string then \meta{action} is executed.
%  For details, see "\vx@condexec".
%  The list "\vx@Handle" format is generated by "\varindexNewFormat".
%    \begin{macrocode}
\let\vx@HandleFormat\toolboxEmpty

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexNewFormat}
%    \begin{macrocode}
\def\varindexNewFormat#1#2{%
  \toolboxSurround{\vx@condexec{#1}{#2}}{}\vx@HandleFormat}

%    \end{macrocode}
% \end{macro}
% Now we initialize the default actions for the format string. However,
% it is necessary to postpone the expansion of the "\vx@NewStdFormat" commands
% (which call "\varindexNewFormat") until "\varindexOutExclam" etc.\ have
% been initialized: In fact, the macro "\vx@NewStdFormat" uses "\csname"
% and thus implicitly sets those variables to "\relax" which conflicts with
% our initialization, because we define "\varindexOutExclam" and friends
% only if they are "\undefined" (so that we do not override previous user
% definitions of these macros).\par
%    \begin{macrocode}
%% This macro is executed near the end of this file.
\def\varindexAddOmit{% The name is a fake: The macro redefines this macro
%    \end{macrocode}
% \begin{macro}{\varindexAddSpace}
% "\varindexAddSpace" is made by a scheme from "\vx@NewStdFormat"
%    \begin{macrocode}
  \vx@NewStdFormat\varindexSplitAtSpace{Space}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexAddSpTok}
% "\varindexAddSpTok" is made by a scheme from "\vx@NewStdFormat"
%    \begin{macrocode}
  \vx@NewStdFormat\varindexSplitAtSpaceTok{SpTok}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexAddOmit}
% "\varindexAddOmit" is made by a scheme from "\vx@NewStdFormat"
%    \begin{macrocode}
  \vx@NewStdFormat\varindexSplitAtOmit{Omit}%
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
  \varindexNewFormat\varindexSplitSpace{}% Spaces in inner format are ignored
  \varindexNewFormat\varindexSplitAtDash\varindexAddDash
  \varindexNewFormat\varindexSplitAtTildeB\varindexAddTildeB
  \varindexNewFormat\varindexSplitAtTildeA\varindexAddTildeA
  \varindexNewFormat\varindexSplitAtComma\varindexAddComma
  \varindexNewFormat\varindexSplitAtExclam\varindexAddExclam
  \let\vx@NewStdFormat\undefined% We do not need this generic macro anymore
}

%    \end{macrocode}
% \begin{macro}{\vx@NewStdFormat}
% \begin{myquote}
% "\vx@NewStdFormat\"\meta{splitcmd}\bracemeta{name}
% \end{myquote}
% calls
% \begin{myquote}
% "\varindexNewFormat\"\meta{splitcmd}"\varindexAdd"\meta{name}
% \end{myquote}
% and defines the corresponding macro "\varindexAdd"\meta{name} by
% \begin{myquote}
% "\def\varindexAdd"\meta{name}"{\varindexPreceeds"\meta{name}\\
% "  \varindexTokensOutExpand"\\
% "    \varindexOutText"\meta{name}\\
% "    \varindexOutSort"\meta{name}\\
% "  \varindexFollows"\meta{name}"}"
% \end{myquote}
%    \begin{macrocode}
\def\vx@NewStdFormat#1#2{%
  \expandafter
  \varindexNewFormat\expandafter#1\csname varindexAdd#2\endcsname
  \expandafter
  \def\expandafter\vx@tmp\expandafter{%
    \csname varindexPreceeds#2\expandafter\endcsname
    \expandafter
    \varindexTokensOutExpand
      \csname varindexOutText#2\expandafter\endcsname
      \csname varindexOutSort#2\expandafter\endcsname
    \csname varindexFollows#2\endcsname}
  \expandafter\let\csname varindexAdd#2\endcsname\vx@tmp}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexAddNumber}\nocomment
%    \begin{macrocode}
\def\varindexAddNumber#1{%
  \ifnum\varindexCount<#1%
    \expandafter\vx@ErrorNumber\expandafter{\the\varindexCount}{#1}%
  \fi
  \ifvarindexIndexMode
    \toolboxLet\vx@adda{varindexEntry#1}%
    \toolboxLet\vx@addb{varindexSort#1}%
  \else
    \toolboxLet\vx@adda{varindexPlain#1}%
  \fi
  \vx@Addit\varindexSpaceTexttrue\varindexSpaceSorttrue}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexAddDash}
%    \begin{macrocode}
\def\varindexAddDash{%
  \varindexPreceedsDash
  \ifx\vx@sortlist\toolboxEmpty
    \varindexTokensOutExpand\varindexOutTextDash\varindexOutSortDashBeg
  \else
    \varindexTokensOutExpand\varindexOutTextDash\varindexOutSortDash
  \fi
  \varindexFollowsDash}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexAddComma}\nocomment
%    \begin{macrocode}
\def\varindexAddComma{%
  \ifvarindexCommaLeads
    \vx@tildeLeadtrue
  \fi
  \ifvarindexCommaExpand
    \let\vx@tildeAText\vx@textlist
    \let\vx@tildeBText\vx@textlist
    \ifvarindexIndexMode
      \let\vx@tildeASort\vx@sortlist
      \let\vx@tildeBSort\vx@sortlist
    \fi
  \fi
  \varindexPreceedsComma
  \varindexTokensOutExpand\varindexOutTextComma\varindexOutSortComma
  \vx@flushToBefore
  \ifvarindexCommaExpand
    \vx@commaTextLeadtrue\vx@commaSortLeadtrue
  \fi
  \varindexFollowsComma}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@flushToBefore}\nocomment
%    \begin{macrocode}
\def\vx@flushToBefore{%
  \ifvarindexCommaExpand
    \toolboxAppend\vx@textlistBefore\vx@textlist
    \let\vx@textlist\toolboxEmpty
    \ifvarindexIndexMode
      \toolboxAppend\vx@sortlistBefore\vx@sortlist
      \let\vx@sortlist\toolboxEmpty
    \fi
  \fi}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexAddTildeA}\nocomment
%    \begin{macrocode}
\def\varindexAddTildeA{%
  \ifvarindexUsePlaceholderA
    \ifvx@tildeLead
      \ifvarindexLeadingPlaceholderA
        \vx@AddingTildeA
      \fi
    \else
      \vx@AddingTildeA
    \fi
  \fi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@AddingTildeA}\nocomment
%    \begin{macrocode}
\def\vx@AddingTildeA{%
  \ifvarindexPreviousAText
    \let\vx@adda\vx@tildeAText
  \else
    \let\vx@adda\varindexPlaceholderAText
  \fi
  \ifvarindexPreviousASort
    \let\vx@addb\vx@tildeASort
  \else
    \let\vx@addb\varindexPlaceholderASort
  \fi
  \vx@Addit\varindexSpaceTexttrue\varindexSpaceSorttrue}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@AddTildeB}\nocomment
%    \begin{macrocode}
\def\varindexAddTildeB{%
  \ifvarindexUsePlaceholderB
    \ifvx@tildeLead
      \ifvarindexLeadingPlaceholderB
        \vx@AddingTildeB
      \fi
    \else
      \vx@AddingTildeB
    \fi
  \fi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@AddingTildeB}\nocomment
%    \begin{macrocode}
\def\vx@AddingTildeB{%
  \ifvarindexPreviousBText
    \let\vx@adda\vx@tildeBText
  \else
    \let\vx@adda\varindexPlaceholderBText
  \fi
  \ifvarindexPreviousBSort
    \let\vx@addb\vx@tildeBSort
  \else
    \let\vx@addb\varindexPlaceholderBSort
  \fi
  \vx@Addit\varindexSpaceTexttrue\varindexSpaceSorttrue}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexNextSpace}\nocomment
%    \begin{macrocode}
\def\varindexNextSpace{\varindexSpaceTexttrue\varindexSpaceSorttrue}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexNoNextSpace}\nocomment
%    \begin{macrocode}
\def\varindexNoNextSpace{\varindexSpaceTextfalse\varindexSpaceSortfalse}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexTokensOut}\nocomment
%    \begin{macrocode}
\long\def\varindexTokensOut#1#2{\def\vx@adda{#1}\def\vx@addb{#2}\vx@Addit{}{}}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexTokensOutExpand}\nocomment
%    \begin{macrocode}
\def\varindexTokensOutExpand#1#2{\let\vx@adda#1\let\vx@addb#2\vx@Addit{}{}}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@Addit}
% \begin{myquote}
% "\vx@Addit"\bracemeta{command A}\bracemeta{command B}
% \end{myquote}
% Does the following if "\vx@adda"/"\vx@addb" is nonempty:
% \begin{myquote}
% Add (space +) "\vx@adda"/"\vx@addb" to "\vx@textlist"/"\vx@sortlist"\\
% (Shift space to "\vx@...listBefore" if "\ifvx@comma...Lead" is true).\\
% "\vx@tildeLeadfalse" (only if "\vx@adda" is nonempty)\\
% "\varindexSpace...false"\\
% "\vx@comma...Leadfalse"\\
% Execute \meta{command A/B}
% \end{myquote}
%    \begin{macrocode}
\def\vx@Addit#1#2{%
  \ifx\vx@adda\toolboxEmpty\else
    \vx@tildeLeadfalse
    \ifvarindexSpaceText
      \varindexSpaceTextfalse
      \ifvx@commaTextLead
        \toolboxAppend\vx@textlistBefore\toolboxSpace
        \let\vx@textlist\vx@adda
      \else
        \toolboxAppend\vx@textlist{\toolboxSpace\vx@adda}%
      \fi
    \else
      \toolboxAppend\vx@textlist\vx@adda
    \fi
    \vx@commaTextLeadfalse
    #1%
  \fi
  \ifvarindexIndexMode
    \ifx\vx@addb\toolboxEmpty\else
      \ifvarindexSpaceSort
        \varindexSpaceSortfalse
        \ifvx@commaSortLead
          \toolboxAppend\vx@sortlistBefore\toolboxSpace
          \let\vx@sortlist\vx@addb
        \else
          \toolboxAppend\vx@sortlist{\toolboxSpace\vx@addb}%
        \fi
      \else
        \toolboxAppend\vx@sortlist\vx@addb
      \fi
      \vx@commaSortLeadfalse
      #2%
    \fi
  \fi}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexAddExclam}\nocomment
%    \begin{macrocode}
\def\varindexAddExclam{%
  \ifvarindexIndexMode
    \vx@Flush
    \toolboxAppend\vx@outputlist\varindexOutExclam
  \else
    \errmessage{\string\varindex: %
      Subitem can only be used for index, not for running text}%
  \fi
  \varindexFollowsExclam
}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ErrorFormat}\nocomment
% "\vx@ErrorFormat" outputs the format until the content of "\vx@endparse" is
% reached.
%    \begin{macrocode}
\expandafter
\def\expandafter\vx@ErrorFormat\expandafter#\expandafter 1\vx@endparse
  {\errmessage{\string\varindex: Error in format `#1'}}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@ErrorNumber}\nocomment
%    \begin{macrocode}
\def\vx@ErrorNumber#1#2{\errmessage{\string\varindex: %
  Entry `#2' does not exist (only #1 entries)}}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vx@Write}
% The main output macro (either into "\index" or into running text):
%
%    \begin{macrocode}
\def\vx@Write{%
  \vx@Flush
  \ifvarindexIndexMode
    \toolboxAppend\vx@outputlist\varindexAppend
    \vx@MakeHarmless\vx@outputlist
    \expandafter
    \varindexIndex\expandafter{\vx@outputlist}%
  \else
    \expandafter
    \varindexStyle\expandafter{\vx@outputlist}%
  \fi}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@Flush}
% Put the text buffered in "\vx@textlistBefore\vx@textlist" and
% "\vx@sortlistBefore\vx@sortlist" to "\vx@outputlist" in the way appropriate
% fot the output, and delete the buffers.
% Moreover, prepare "\vx@tilde?Text" and friends correspondingly.
%
%    \begin{macrocode}
\def\vx@Flush{%
  \vx@tildeLeadtrue
  \vx@commaTextLeadtrue
  \vx@commaSortLeadtrue
  \let\vx@tildeAText\vx@textlist
  \let\vx@tildeBText\vx@textlist
  \ifvarindexIndexMode
    \let\vx@tildeASort\vx@sortlist
    \let\vx@tildeBSort\vx@sortlist
    \toolboxDef\vx@textlist{\vx@textlistBefore\vx@textlist}%
    \toolboxDef\vx@sortlist{\vx@sortlistBefore\vx@sortlist}%
    \ifx\vx@textlist\vx@sortlist
      \toolboxAppend\vx@outputlist\vx@textlist
    \else
      \toolboxAppend\vx@outputlist{\vx@sortlist\vx@otherat\vx@textlist}%
    \fi
    \let\vx@sortlistBefore\toolboxEmpty
    \let\vx@sortlist\toolboxEmpty
  \else
    \toolboxAppend\vx@outputlist{\vx@textlistBefore\vx@textlist}%
  \fi
  \let\vx@textlistBefore\toolboxEmpty
  \let\vx@textlist\toolboxEmpty}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vx@TextEntry}
% "\vx@TextEntry"\bracemeta{\texttt{\#1}} defines
% "\varindexEntry"/"Sort"/"Plain1-..."
% with the values corresponding to entry "#1". Here, "1-..." is
% "\the\varindexCount". If necessary, inner braces are eliminated
%
%    \begin{macrocode}
\def\vx@TextEntry#1{%
  \vx@SplitAtSort{#1}\vx@textEntryA\vx@textEntryB
  \expandafter\vx@SplitAtPlain\expandafter{\vx@textEntryA}%
    \vx@textEntryA\vx@textEntryC
  \vx@LetEliminated{varindexEntry}\vx@textEntryA
  \ifx\vx@textEntryB\undefined
%    \end{macrocode}
% No sort entry:
%    \begin{macrocode}
    \vx@LetEliminated{varindexSort}\vx@textEntryA
    \ifx\vx@textEntryC\undefined
      \vx@LetEliminated{varindexPlain}\vx@textEntryA
    \else
      \vx@LetEliminated{varindexPlain}\vx@textEntryC
    \fi
  \else
%    \end{macrocode}
% Sort entry:
%    \begin{macrocode}
    \ifx\vx@textEntryC\undefined
      \expandafter\vx@SplitAtPlain\expandafter{\vx@textEntryB}%
        \vx@textEntryB\vx@textEntryC
    \fi
    \vx@LetEliminated{varindexSort}\vx@textEntryB
    \ifx\vx@textEntryC\undefined
      \vx@LetEliminated{varindexPlain}\vx@textEntryA
    \else
      \vx@LetEliminated{varindexPlain}\vx@textEntryC
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@LetEliminated}\nocomment
%    \begin{macrocode}
\def\vx@LetEliminated#1#2{%
  \let\vx@tmp#2%
  \ifvarindexEliminateInnerBrace
    \toolboxDropBrace\vx@tmp
  \fi
  \toolboxWithNr{\the\varindexCount}\let{#1}\vx@tmp}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexMakeVarSplit}\nocomment
%    \begin{macrocode}
\def\varindexMakeVarSplit#1#2#3{\varindexedef#1{#2}\expandafter
  \toolboxMakeSplit\expandafter{#1}{#3}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexMakeSplitExpand}\nocomment
%    \begin{macrocode}
\def\varindexMakeSplitExpand#1#2{\varindexMakeVarSplit\vx@tmp{#1}{#2}}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexSetWordString}
%  \begin{macro}{\vx@SplitAtWord}\nocomment
%    \begin{macrocode}
\def\varindexSetWordString#1{\def\vx@word{#1}%
  \toolboxMakeSplit{#1}{vx@SplitAtWord}}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetSortString}
%  \begin{macro}{\vx@SplitAtSort}\nocomment
%    \begin{macrocode}
\def\varindexSetSortString#1{%
  \toolboxMakeSplit{#1}{vx@SplitAtSort}}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetPlainString}
%  \begin{macro}{\vx@SplitAtPlain}\nocomment
%    \begin{macrocode}
\def\varindexSetPlainString#1{%
  \toolboxMakeSplit{#1}{vx@SplitAtPlain}}

%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\vx@tmp}
% Temporarily, we define a generic command:
% \begin{myquote}
% "\vx@tmp"\bracemeta{name}
% \end{myquote}
% is (temporarily) a call which is equivalent to:
% \begin{myquote}
% "\def\varindexSet"\meta{name}"String#1{%"\\
% "  \varindexMakeVarSplit"\relax
%"\varindex"\meta{name}"String{#1}{varindexSplitAt"\meta{name}"}}"
% \end{myquote}
%    \begin{macrocode}
\def\vx@tmp#1{%
  \expandafter
  \def\expandafter\vx@adda\expandafter##\expandafter 1\expandafter{%
    \expandafter
    \varindexMakeVarSplit\csname varindex#1String\endcsname
    {##1}{varindexSplitAt#1}}%
  \expandafter
  \let\csname varindexSet#1String\endcsname\vx@adda}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexSetIndexString}
%  \begin{macro}{\varindexSplitAtIndex}\nocomment
%    \begin{macrocode}
\vx@tmp{Index}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetOutputString}
%  \begin{macro}{\varindexSplitAtOutput}\nocomment
%    \begin{macrocode}
\vx@tmp{Output}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetTildeAString}
%  \begin{macro}{\varindexSplitAtTildeA}\nocomment
%    \begin{macrocode}
\vx@tmp{TildeA}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetTildeBString}
%  \begin{macro}{\varindexSplitAtTildeB}\nocomment
%    \begin{macrocode}
\vx@tmp{TildeB}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetSpaceString}
%  \begin{macro}{\varindexSplitAtSpace}\nocomment
%    \begin{macrocode}
\vx@tmp{Space}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetSpaceTokString}
%  \begin{macro}{\varindexSplitAtSpaceTok}\nocomment
%    \begin{macrocode}
\vx@tmp{SpaceTok}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetOmitString}
%  \begin{macro}{\varindexSplitAtOmit}\nocomment
%    \begin{macrocode}
\vx@tmp{Omit}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetCommaString}
%  \begin{macro}{\varindexSplitAtComma}\nocomment
%    \begin{macrocode}
\vx@tmp{Comma}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetDashString}
%  \begin{macro}{\varindexSplitAtDash}\nocomment
%    \begin{macrocode}
\vx@tmp{Dash}
%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetExclamString}
%  \begin{macro}{\varindexSplitAtExclam}\nocomment
%    \begin{macrocode}
\vx@tmp{Exclam}

%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\varindexSetStringForNr}
%  \begin{macro}{\varindexSplitAtNr}\nocomment
%    \begin{macrocode}
\def\varindexSetStringForNr#1#2{%
  \edef\vx@adda{#1}%
  \expandafter
    \vx@AddToHandleNrs\csname varindexSplitAtNr\vx@adda\endcsname
%    \end{macrocode}
% It is important to define the instance only \emph{after} the call of
% "\vx@AddToHandleNrs" (because this macro tests the existence).
%    \begin{macrocode}
  \expandafter
    \varindexMakeVarSplit\csname varindexNr\vx@adda String\endcsname
      {#2}{varindexSplitAtNr\vx@adda}}

%    \end{macrocode}
%  \end{macro}
% \end{macro}
%
% \begin{macro}{\vx@AddToHandleNrs}
% "\vx@AddToHandleNrs{\vx@HandleNr1}"
% tests whether "\vx@HandleNr1" is already defined:
% If not (i.\,e.\ "\relax" because we use it with "\csname") the call
% \begin{myquote}
%  "\varindexNewFormat\varindexSplitAtNr1{\varindexAddNumber"\relax
%\bracemeta{content of \cmdcite{vx@adda}}"}"
% \end{myquote}
%  is executed.
%    \begin{macrocode}
\def\vx@AddToHandleNrs#1{%
  \ifx#1\relax
    \expandafter
      \varindexNewFormat\expandafter#1\expandafter{\expandafter
        \varindexAddNumber\expandafter{\vx@adda}}%
  \fi}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\varindexedef}
% This macro is described in the main documentation.
%    \begin{macrocode}
\def\varindexedef#1#2{%
  \let\vx@tildemerk~%
  \let~\vx@nicetilde
  \edef#1{#2}%
  \let~\vx@tildemerk}

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\varindexDoConvert}\nocomment
%    \begin{macrocode}
\def\varindexDoConvert{\let\vx@MakeHarmless\toolboxMakeHarmless}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexNoConvert}\nocomment
%    \begin{macrocode}
\def\varindexNoConvert{\def\vx@MakeHarmless##1{}}

%    \end{macrocode}
% \end{macro}
%
%
% \par\hrule\par\null\par
% Finally, some definitions which require catcode-trickery:
%
%
% \begin{macro}{\vx@nicetilde}
% "\vx@nicetilde" expands to a tilde with a nonactive catcode.
%
%    \begin{macrocode}
\def\vx@tmp{\catcode`\~=13\relax}
\catcode`\~=11\relax\def\vx@nicetilde{~}\vx@tmp

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@spaceothertok}
%  \begin{macro}{\vx@MakeSpaceOther}\nocomment
%    \begin{macrocode}
\def\vx@MakeSpaceOther{\catcode`\ =13\relax}
%    \end{macrocode}
%  \end{macro}
%  \begin{macro}{\vx@MakeSpaceSpace}\nocomment
%    \begin{macrocode}
\def\vx@MakeSpaceSpace{\catcode`\ =10\relax}
\vx@MakeSpaceOther%<- This % is important
\let\vx@spaceothertok= %<- This ` %' is important
\vx@MakeSpaceSpace

%    \end{macrocode}
%  \end{macro}
% \end{macro}
% \begin{macro}{\vx@otherat}
% "\def\vx@otherat{@}" is a bad idea, since then
% "@" has the wrong catcode. So we use a temporary macro to define it:
% We misuse the name "\varindexArgumentSpace" to this purpose.
% Of course, we must redefine the latter afterwards.
%    \begin{macrocode}
\def\varindexArgumentSpace#1{\def\vx@otherat{#1}}
\ifx\makeatother\undefined\catcode`\@=12\relax\else\makeatother\fi
\varindexArgumentSpace{@}

%    \end{macrocode}
% \end{macro}
%
% Initialize default values (you should have the `usual' catcodes here.
% In particular, "\makeatother" must be called before if `"@"'
% is used as argument).
% \begin{macro}{\varindexArgumentSpace}\nocomment
%    \begin{macrocode}
\let\varindexArgumentSpace\varindexSkipDefault

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\varindexIndex}
% We use "\def" for "\varindexIndex" so that a redefinition of "\index" also
% redefines our command.
%    \begin{macrocode}
\toolboxIf\undefined\def\varindexIndex{\index}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\vx@MakeHarmless}\nocomment
%    \begin{macrocode}
\varindexDoConvert

%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
\toolboxIf\undefined\def\varindexOutExclam{!}
\toolboxIf\undefined\let\varindexFollowsExclam\varindexNoNextSpace
\toolboxIf\undefined\def\varindexOutTextComma{,}
\toolboxIf\undefined\def\varindexOutSortComma{,}
\toolboxIf\undefined\let\varindexFollowsComma\varindexNextSpace
\toolboxIf\undefined\let\varindexPreceedsComma\varindexNoNextSpace
\toolboxIf\undefined\def\varindexOutTextSpace{ }
\toolboxIf\undefined\def\varindexOutSortSpace{ }
\toolboxIf\undefined\let\varindexFollowsSpace\toolboxEmpty
\toolboxIf\undefined\let\varindexPreceedsSpace\varindexNoNextSpace
\toolboxIf\undefined\def\varindexOutTextSpTok{\space}
\toolboxIf\undefined\def\varindexOutSortSpTok{ }
\toolboxIf\undefined\let\varindexFollowsSpTok\toolboxEmpty
\toolboxIf\undefined\let\varindexPreceedsSpTok\varindexNoNextSpace
\toolboxIf\undefined\def\varindexOutTextDash{-}
\toolboxIf\undefined\def\varindexOutSortDash{-}
\toolboxIf\undefined\let\varindexOutSortDashBeg\toolboxEmpty
\toolboxIf\undefined\let\varindexFollowsDash\toolboxEmpty
\toolboxIf\undefined\let\varindexPreceedsDash\varindexNoNextSpace
\toolboxIf\undefined\let\varindexOutTextOmit\toolboxEmpty
\toolboxIf\undefined\let\varindexOutSortOmit\toolboxEmpty
\toolboxIf\undefined\let\varindexFollowsOmit\toolboxEmpty
\toolboxIf\undefined\let\varindexPreceedsOmit\varindexNoNextSpace
%    \end{macrocode}
% For the following macro, see the remarks in the definition of
% the fake name "\varindexAddOmit" (after definition of "\varindexNewFormat")
%    \begin{macrocode}
%% It is important that the following is after all \toolboxIf\undefined...
\varindexAddOmit% Execute the fake macro and redefine \varindexAddOmit

%    \end{macrocode}
%
% \begin{macro}{\varindexSplitSpace}\nocomment
%    \begin{macrocode}
\toolboxMakeSplit{ }{varindexSplitSpace}

%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\varindexSetWordString{ }
\varindexSetSortString{@}
\varindexSetPlainString{!}

\varindexSetIndexString{ }
\varindexSetOutputString{*}

\varindexSetTildeAString{~}
\varindexSetTildeBString{=}
\varindexSetSpaceString{_}
\varindexSetSpaceTokString{s}
\varindexSetOmitString{.}
\varindexSetCommaString{,}
\varindexSetDashString{-}
\varindexSetExclamString{!}
\varindexSetStringForNr{10}{0}
\varindexSetStringForNr 9{9}
\varindexSetStringForNr 8{8}
\varindexSetStringForNr 7{7}
\varindexSetStringForNr 6{6}
\varindexSetStringForNr 5{5}
\varindexSetStringForNr 4{4}
\varindexSetStringForNr 3{3}
\varindexSetStringForNr 2{2}
\varindexSetStringForNr 1{1}

\ifx\makeatletter\undefined\catcode`\@=11\relax\else\makeatletter\fi

%    \end{macrocode}
% \iffalse
%</package>
% \fi
% \Finale\PrintIndex
%
%
%
% \iffalse
%<*metainfo>
% \fi
\iffalse -------------------------------------------------------------
%
% Just in case that for some reason the file `varindex.ins' got lost:
% The content of this file is between the lines %<*insfile> and %</insfile>:
%
%\iffalse
%</metainfo>
%<*insfile>
\def\batchfile{varindex.ins}
\input docstrip.tex
\keepsilent
\nopreamble
\generateFile{varindex.sty}{f}{\from{varindex.dtx}{package}}
\generateFile{varindex.txt}{f}{\from{varindex.dtx}{asciidocu}}
\generateFile{varindex.tex}{f}{\from{varindex.dtx}{driver}}
%%\generateFile{varindex.ins.dup}{f}{\from{varindex.dtx}{insfile}}

\Msg{***************************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the}
\Msg{* file 'varindex.sty' into a directory searched by TeX.}
\Msg{*}
\Msg{*}
\Msg{* Run the file varindex.tex through LaTeX to produce the}
\Msg{* documentation or read the ascii documentation in varindex.txt}
\Msg{*}
\Msg{*}
\Msg{***************************************************************}
\endbatchfile
%</insfile>
%<*metainfo>
% \fi
\fi
% \iffalse
%</metainfo>
% \fi
\endinput

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "varindex.tex"
%%% End: