summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/babel/babel.dtx
blob: b11d3d5c99d11ad1faef2e5cf56f8cf47b2a0457 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
% \iffalse
% This document requires lualatex
%%
%% Copyright (C) 2012-2018 Javier Bezos and Johannes L. Braams.
%% Copyright (C) 1989-2012 Johannes L. Braams and
%%           any individual authors listed elsewhere in this file. 
%% All rights reserved.
%% 
%% This file is part of the Babel system.
%% --------------------------------------
%% 
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% The Current Maintainer of this work is Javier Bezos.
%% 
%% The list of derived (unpacked) files belonging to the distribution
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension |.ins|) which are part of the distribution.
%%
% \fi
%
% \CheckSum{5011}
%
% \iffalse
%<*filedriver>
\ProvidesFile{babel.dtx}[2018/02/14 v3.18 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
\setmainfont[Scale=.88]{Noto Serif}
\setsansfont[Scale=.88]{Noto Sans}
\setmonofont[Scale=.88,FakeStretch=.95]{Noto Mono}
\raggedright
\addtolength{\textwidth}{25pt}
\addtolength{\textheight}{3.5cm}
\addtolength{\topmargin}{-2cm}
\font\manual=logo10 % font used for the METAFONT logo, etc.
\newcommand*\MF{{\manual META}\-{\manual FONT}}
\newcommand*\babel{\textsf{babel}}
\newcommand*\Babel{\textsf{Babel}}
\newcommand*\xetex{\textsf{xetex}}
\newcommand*\pdftex{\textsf{pdftex}}
\newcommand*\luatex{\textsf{luatex}}
\newcommand*\nb[1]{}
\newcommand*\m[1]{\mbox{$\langle$\normalfont\itshape#1\/$\rangle$}}
\newcommand*\langlist{%
  \meta{language}\texttt{,}\meta{language}\texttt{,}...}
\newcommand*\langvar{\m{lang}}
\newcommand*\Lopt[1]{\textsf{#1}}
\newcommand*\Lenv[1]{\texttt{#1}}
\newcommand*\menv[1]{\char`\{#1\char`\}}
\newcommand*\Eenv[1]{%
  \quad\ldots\quad   
  \texttt{\color{thered}\string\end\menv{#1}}}
\newcommand*\file[1]{\texttt{#1}}
\newcommand*\cls[1]{\texttt{#1}}
\newcommand*\pkg[1]{\texttt{#1}}
\addtolength{\oddsidemargin}{1em}
\setlength{\leftmargini}{1.5em}
\usepackage{framed}
\usepackage{multicol}
\usepackage{color,colortbl}
\usepackage[linkbordercolor={.9 .7 .5}]{hyperref}
\newcommand\New[1]{%
  \colorbox[rgb]{.92, .86, .73}{New #1}\enspace\ignorespaces}
\definecolor{thered}  {rgb}{0.65,0.04,0.07}
\definecolor{thegrey} {gray}{0.8}
\definecolor{shadecolor}{rgb}{1,1,0.97}
\definecolor{messages}{rgb}{.66,.13,.27}
\makeatletter
\def\@begintheorem#1#2{%
  \list{}{}%
  \global\advance\@listdepth\m@ne
  \item[{\sffamily\bfseries\color{messages}\hspace*{1.3em}%
        \MakeUppercase{#1}}]}%
\makeatother
\newtheorem{warning}{Warning}
\newtheorem{note}{Note}
\newtheorem{example}{Example}
\let\bblxv\verbatim
\let\bblexv\endverbatim
\def\verbatim{\begin{shaded*}\bblxv\vskip-\baselineskip\vskip2.5\parsep}
\def\endverbatim{\bblexv\vskip-2\baselineskip\end{shaded*}}
\catcode`\_=\active
\def_{\bgroup\let_\egroup\color{thered}}
\def\MacroFont{\fontencoding \encodingdefault \fontfamily\ttdefault
  \fontseries\mddefault \fontshape\updefault \small \catcode`\_=\active}
\definecolor{shadecolor}{rgb}{0.96,0.96,0.93}
\def\PrintDescribeMacro#1{%
  \strut\MacroFont\color{thered}\normalsize\string#1}
\def\Describe#1{%
  \par\penalty-500\vskip3ex\noindent
  \DescribeMacro{#1}\args}
\def\DescribeOther{\vskip-4ex\Describe}
\makeatletter
\def\trouble#1{\addcontentsline{tsh}{trouble}{#1}}
\def\listoftroubles{\section*{Troubleshoooting}\@starttoc{tsh}}
\let\l@trouble\l@figure
\let\saved@check@percent\check@percent
\let\check@percent\relax
\def\args#1{%
  \def\bbl@tempa{#1}%
  \ifx\bbl@tempa\@empty\else#1\vskip1ex\fi\ignorespaces}
\begingroup % Changes to ltxdoc
  \catcode`\<\active
  \catcode`\>\active
  \gdef\check@plus@etc{%
    \let\bbl@next\pm@module
    \ifx*\next
      \let\bbl@next\star@module
    \else\ifx/\next
      \let\bbl@next\slash@module
    \else\ifx<\next
      \let\bbl@next\var@module
    \fi\fi\fi
    \bbl@next}
  \gdef\var@module#1#2#3>>{%
    $\langle$\pm@module#2#3>$\rangle$%
    \ifx*#2\ $\equiv$\fi}
\endgroup
\renewcommand*\l@section[2]{%
  \ifnum \c@tocdepth >\z@
    \addpenalty\@secpenalty
    \addvspace{1.0em \@plus\p@}%
    \setlength\@tempdima{2em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
    \endgroup
  \fi}
\renewcommand*\l@subsection{\@dottedtocline{2}{2em}{3em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{5em}{4em}}
\renewcommand*\l@paragraph{\@dottedtocline{4}{9em}{4.5em}}
\renewcommand\partname{Part}
\def\@pnumwidth{3em}
\makeatother
\begin{document}
\title{Babel, a multilingual package for use with \LaTeX's standard
   document classes\thanks{During the development ideas from Nico
   Poppelier, Piet van Oostrum and many others have been used.
   Bernd Raichle has provided many helpful suggestions.}}
\author{Johannes Braams\\
        Kersengaarde 33\\
        2723 BP Zoetermeer\\
        The Netherlands\\
        \normalsize From version 3.9 on, Javier Bezos\\
        \normalsize \texttt{www.texnia.com}}

\date{Typeset \today}
\begin{titlepage}
\begin{minipage}[t][0pt]{30cm}
\vspace{-3cm}\hspace{-7cm}
\sffamily
\begin{tabular}{p{8cm}p{15cm}}
\cellcolor[rgb]{.86,.73,.67}
&\cellcolor[rgb]{.95,.95,.95}
\vspace{3.6cm}%
\color[rgb]{.55,.4,.35}
\leftskip5mm
\sffamily\fontsize{72}{72}\selectfont Babel
\vspace{1.8cm}
\\
\cellcolor[rgb]{.95,.95,.95}
\vspace{2cm}\hspace{1.5cm}
\begin{minipage}{5cm}
\Large
Version \csname @gobble\expandafter\endcsname\fileversion\newline
\filedate

\vspace{1cm}
\textit{Original author}\newline
Johannes L. Braams

\vspace{.3cm}
\textit{Current maintainer}\newline
Javier Bezos
\end{minipage}
&\cellcolor[rgb]{.92, .86, .73}
\vspace{2cm}
\leftskip5mm
\begin{minipage}{10cm}
\large\setlength\parskip{3mm}\raggedright
  The standard distribution of \LaTeX\ contains a number of document
  classes that are meant to be used, but also serve as examples for
  other users to create their own document classes.  These document
  classes have become very popular among \LaTeX\ users. But it should
  be kept in mind that they were designed for American tastes and
  typography. At one time they even contained a number of hard-wired
  texts.
  
  This manual describes \babel{}, a package that makes use of the
  capabilities of \TeX\ version 3 and, to some extent, \xetex{} and
  \luatex, to provide an environment in which documents can be typeset
  in a language other than US English, or in more than one language or
  script.

  Current development is focused on Unicode engines (Xe\TeX{} and
  Lua\TeX) and the so-called \textit{complex scripts}.  New features
  related to font selection, bidi writing and the like will be added
  incrementally.

  \Babel{} provides support (total or partial) for about 200
  languages, either as a “classical” package option or as an
  |ini| file. Furthermore, new languages can be created from scratch
  easily.

 \vspace{20cm}
\end{minipage}
\end{tabular}
\end{minipage}
\end{titlepage}

\tableofcontents
\listoftroubles
\clearpage

\part{User guide}

\begin{itemize}
\item This user guide focuses on \LaTeX. There are also some notes on
  its use with Plain \TeX.

\item  Changes and new features with relation to version 3.8 are
  highlighted with \New{X.XX}\hspace{-.5em}. The most recent features
  could be still unstable. Please, report any issues you find.

\item If you are interested in the \TeX{} multilingual support, please
  join the \textsf{kadingira} list on
  \texttt{http://tug.org/mailman/listinfo/kadingira}.  You can follow
  the development of \babel{} on
  \texttt{https://github.com/latex3/latex2e/tree/master/required/babel}
  (which provides some sample files, too).

\item  See section \ref{contribute} for contributing a language.
\end{itemize}

\section{The user interface}\label{U-I}

\subsection{Monolingual documents}

In most cases, a single language is required, and then all you need in
\LaTeX{} is to load the package using its standand mechanism for this
purpose, namely, passing that language as an optional argument. In
addition, you may want to set the font and input encodings.

\begin{example}
  Here is a simple full example for “traditional” \TeX{} engines (see
  below for \xetex{} and \luatex{}). The packages |fontenc| and
  |inputenc| do not belong to \babel, but they are included in the
  example because typically you will need them:
\begin{verbatim}
\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

_\usepackage[french]{babel}_

\begin{document}

Plus ça change, plus c'est la même chose!

\end{document}
\end{verbatim}
\end{example}
\begin{warning} 
A common source of trouble is a wrong setting of the input
encoding. Make sure you set the encoding actually used by your editor.
\end{warning}

Another approach is making the language (\Lopt{french} in the example)
a global option in order to let other packages detect and use it:
\begin{verbatim}
_\documentclass[french]{article}_
\usepackage{babel}
\usepackage{varioref}
\end{verbatim}

In this last example, the package \texttt{varioref} will also see
the option and will be able to use it.

\begin{note}
  Because of the way \babel{} has evolved, ``language'' can refer to
  (1) a set of hyphenation patterns as preloaded into the format, (2)
  a package option, (3) an |ldf| file, and (4) a name used in the
  document to select a language or dialect. So, a package option
  refers to a language in a generic way -- sometimes it is the actual
  language name used to select it, sometimes it is a file name loading
  a language with a different name, sometimes it is a file name
  loading several languages. Please, read the documentation for
  specific languages for further info.
\end{note}

\subsection{Multilingual documents}

In multilingual documents, just use several options. The last one is
considered the main language, activated by default. Sometimes, the 
main language changes the document layout (eg, |spanish| and |french|).

\begin{example}
  In \LaTeX, the preamble of the document:
\begin{verbatim}
\documentclass{article}
\usepackage[dutch,english]{babel}
\end{verbatim}
  would tell \LaTeX\ that the document would be written in two
  languages, Dutch and English, and that English would be the first
  language in use, and the main one.
\end{example}

You can also set the main language explicitly:
\begin{verbatim}
\documentclass{article}
\usepackage[_main=english_,dutch]{babel}
\end{verbatim}

\begin{warning}
  Languages may be set as global and as package option at the same
  time, but in such a case you should set explicitly the main language
  with the package option |main|:
\begin{verbatim}
\documentclass[_italian_]{book}
\usepackage[ngerman,_main=italian_]{babel}
\end{verbatim}
\end{warning}

\begin{warning}
  In the preamble the main language has \textit{not} been selected,
  except hyphenation patterns and the name assigned to |\languagename|
  (in particular, shorthands, captions and date are not activated). If
  you need to define boxes and the like in the preamble, you might
  want to use some of the language selectors described below.
\end{warning}

To switch the language there are two basic macros, decribed below in
detail: |\selectlanguage| is used for blocks of text, while
|\foreignlanguage| is for chunks of text inside paragraphs.

\begin{example}
A full bilingual document follows. The main language is |french|,
which is activated when the document begins.
\begin{verbatim}
\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

_\usepackage[english,french]{babel}_

\begin{document}

Plus ça change, plus c'est la même chose!

_\selectlanguage{english}_

And an English paragraph, with a short text in
_\foreignlanguage{french}{français}_.

\end{document}
\end{verbatim}
\end{example}

\subsection{Modifiers}

\New{3.9c} The basic behavior of some languages can be modified when
loading \babel{} by means of \textit{modifiers}. They are set after
the language name, and are prefixed with a dot (only when the language
is set as package option -- neither global options nor the |main| key
accept them). An example is (spaces are not significant and they can
be added or removed):\footnote{No predefined ``axis'' for modifiers
are provided because languages and their scripts have quite different
needs.}
\begin{verbatim}
\usepackage[latin_.medieval_, spanish_.notilde.lcroman_, danish]{babel}
\end{verbatim}

Attributes (described below) are considered modifiers, ie, you can
set an attribute by including it in the list of modifiers. However,
modifiers is a more general mechanism.

\subsection{\textsf{xelatex} and \textsf{lualatex}}

Many languages are compatible with \textsf{xetex} and \textsf{luatex}.
With them you can use \babel{} to localize the documents.

The Latin script is covered by default in current \LaTeX{} (provided
the document encoding is UTF-8), because the font loader is preloaded
and the font is switched to |lmroman|. Other scripts require loading
\textsf{fontspec}. You may want to set the font attributes with
\textsf{fontspec}, too.

\begin{example}
  The following bilingual, single script document in UTF-8 encoding
  just prints a couple of ‘captions’ and |\today| in Danish and
  Vietnamese. No additional packages are required.
\begin{verbatim}
\documentclass{article}

_\usepackage[vietnamese,danish]{babel}_

\begin{document}

\prefacename{} -- \alsoname{} -- \today

\selectlanguage{vietnamese}

\prefacename{} -- \alsoname{} -- \today

\end{document}
\end{verbatim}
\end{example}

\begin{example}
Here is a simple monolingual document in Russian (text from the
Wikipedia). Note neither \textsf{fontenc} nor \textsf{inputenc} are
necessary, but the document should be encoded in UTF-8 and a
so-called Unicode font must be loaded (in this example |\babelfont| is
used, described below).

\begin{verbatim}
\documentclass{article}

_\usepackage[russian]{babel}_

\babelfont{rm}{DejaVu Serif}

\begin{document}

Россия, находящаяся на пересечении множества культур, а также
с учётом многонационального характера её населения, — отличается
высокой степенью этнокультурного многообразия и способностью к
межкультурному диалогу.

\end{document}
\end{verbatim}
\end{example}

\subsection{Troubleshooting}

\begin{itemize}
\item Loading directly |sty| files in \LaTeX{} (ie,
  |\usepackage|\marg{language}) is deprecated and you will get the
  error:\footnote{In old versions the error read ``You have used an
  old interface to call babel'', not very helpful.}
\trouble{You are loading directly a language style}
\begin{verbatim}
! Package babel Error: You are loading directly a language style.
(babel)                This syntax is deprecated and you must use
(babel)                \usepackage[language]{babel}.
\end{verbatim}

\item  Another typical error when using \babel{} is the
  following:\footnote{In old versions the error read ``You haven't
  loaded the language LANG yet''.}
\trouble{Unknown language `LANG'}
\begin{verbatim}
! Package babel Error: Unknown language `LANG'. Either you have misspelled
(babel)                its name, it has not been installed, or you requested
(babel)                it in a previous run. Fix its name, install it or just
(babel)                rerun the file, respectively
\end{verbatim}
  The most frequent reason is, by far, the latest (for example, you
  included |spanish|, but you realized this language is not used after
  all, and therefore you removed it from the option list). In most
  cases, the error vanishes when the document is typeset again, but in
  more severe ones you will need to remove the |aux| file.

\item The following warning is about hyphenation patterns, which are
  not under the direct control of \babel:
\trouble{No hyphenation patterns were preloaded for (babel) the
  language `LANG' into the format}
\begin{verbatim}
Package babel Warning: No hyphenation patterns were preloaded for
(babel)                the language `LANG' into the format.
(babel)                Please, configure your TeX system to add them and
(babel)                rebuild the format. Now I will use the patterns
(babel)                preloaded for \language=0 instead on input line 57.
\end{verbatim}
  The document will be typeset, but very likely the text will not be
  correctly hyphenated. Some languages may be raising this warning
  wrongly (because they are not hyphenated); it is a bug to be fixed
  -- just ignore it. See the manual of your distribution (Mac\TeX,
  Mik\TeX, \TeX Live, etc.) for further info about how to configure
  it.
\end{itemize}
\subsection{Plain}

In Plain, load languages styles with |\input| and then use
|\begindocument| (the latter is defined by \babel):
\begin{verbatim}
\input estonian.sty
\begindocument
\end{verbatim}

\begin{warning}
  Not all languages provide a |sty| file and some of them are not
  compatible with Plain.\footnote{Even in the \babel{} kernel there
  were some macros not compatible with plain. Hopefully these issues
  will be fixed soon.}
\end{warning}

\subsection{Basic language selectors}

This section describes the commands to be used in the document to
switch the language in multilingual documents. In most cases, only the
two basic macros |\selectlanguage| and |\foreignlanguage| are
necessary. The environments |otherlanguage|, |otherlanguage*| and
|hyphenrules| are auxiliary, and described in the next section.

The main language is selected automatically when the |document|
environment begins. 

\Describe\selectlanguage{\marg{language}}
When a user wants to switch from one language to another he can
do so using the macro |\selectlanguage|. This macro takes the
language, defined previously by a language definition file, as
its argument. It calls several macros that should be defined in
the language definition files to activate the special definitions
for the language chosen:
\begin{verbatim}
\selectlanguage{german}
\end{verbatim}

This command can be used as environment, too.

\begin{note}
  For ``historical reasons'', a macro name is converted to a language
  name without the leading |\|; in other words,
  |\selectlanguage{\german}| is equivalent to |\selectlanguage{german}|.
  Using a macro instead of a ``real'' name is deprecated.
\end{note}

\begin{warning}
  If used inside braces there might be some non-local changes, as this
  would be roughly equivalent to:
\begin{verbatim}
{\selectlanguage{<inner-language>} ...}\selectlanguage{<outer-language>}
\end{verbatim}
  If you want a change which is really local, you must enclose this
  code with an additional grouping level.
\end{warning}

\Describe\foreignlanguage{\marg{language}\marg{text}}
The command |\foreignlanguage| takes two arguments; the second
argument is a phrase to be typeset according to the rules of the
language named in its first one. This command (1) only switches the
extra definitions and the hyphenation rules for the language,
\emph{not} the names and dates, (2) does not send information about
the language to auxiliary files (i.e., the surrounding language is
still in force), and (3) it works even if the language has not been
set as package option (but in such a case it only sets the hyphenation
patterns and a warning is shown).

\subsection{Auxiliary language selectors}

\Describe{\begin\menv{otherlanguage}}{\marg{language}\Eenv{otherlanguage}}

The environment \Lenv{otherlanguage} does basically the same as
|\selectlanguage|, except the language change is (mostly) local to
the environment. 

Actually, there might be some non-local changes, as this environment
is roughly equivalent to:
\begin{verbatim}
\begingroup
\selectlanguage{<inner-language>}
...
\endgroup
\selectlanguage{<outer-language>}
\end{verbatim}
If you want a change which is really local, you must enclose this
environment with an additional grouping, like braces |{}|.

Spaces after the environment are ignored.

\Describe{\begin\menv{otherlanguage*}}%
{\marg{language}\Eenv{otherlanguage*}}

Same as |\foreignlanguage| but as environment. Spaces after the
environment are \textit{not} ignored.

This environment was originally intended for intermixing left-to-right
typesetting with right-to-left typesetting in engines not supporting a
change in the writing direction inside a line. However, by default it never
complied with the documented behavior and it is just a version as
environment of |\foreignlanguage|.

\Describe{\begin\menv{hyphenrules}}{\marg{language}\Eenv{hyphenrules}}

The environment \Lenv{hyphenrules} can be used to select \emph{only}
the hyphenation rules to be used (it can be used as command,
too). This can for instance be used to select `nohyphenation',
provided that in \file{language.dat} the `language'
\textsf{nohyphenation} is defined by loading \file{zerohyph.tex}. It
deactivates language shorthands, too (but not user shorthands).

Except for these simple uses, |hyphenrules| is discouraged and
|otherlanguage*| (the starred version) is preferred, as the former
does not take into account possible changes in encodings of characters
like, say, |'| done by some languages (eg, \textsf{italian},
\textsf{french}, \textsf{ukraineb}). To set hyphenation exceptions,
use |\babelhyphenation| (see below).

\subsection{More on selection}

\Describe\babeltags{\char`\{\m{tag1} \texttt{=} \m{language1}, \m{tag2}
\texttt{=} \m{language2}, \dots\char`\}} 

\New{3.9i} In multilingual documents with many language switches
the commands above can be cumbersome. With this tool shorter names can
be defined. It adds nothing really new -- it is just syntactical
sugar.

It defines |\text|\m{tag1}\marg{text} to be
|\foreignlanguage|\marg{language1}\marg{text}, and |\begin|\marg{tag1}
to be |\begin{otherlanguage*}|\marg{language1}, and so on. Note
|\|\m{tag1} is also allowed, but remember to set it locally inside a
group. 
\begin{example}
With
\begin{verbatim}
\babeltags{de = german}
\end{verbatim}
you can write
\begin{verbatim}
text \textde{German text} text
\end{verbatim}
and
\begin{verbatim}
text
\begin{de}
  German text
\end{de}
text
\end{verbatim}
\end{example}

\begin{note}
  Something like \verb|\babeltags{finnish = finnish}| is legitimate --
  it defines |\textfinnish| and |\finnish| (and, of course,
  |\begin{finnish}|).
\end{note}

\begin{note}
  Actually, there may be another advantage in the ‘short’ syntax |\text|\m{tag},
  namely, it is not affected by |\MakeUppercase| (while
  |\foreignlanguage| is).
\end{note}

\Describe\babelensure{|[include=|\m{commands}|,exclude=|\m{commands}%
  |,fontenc=|\m{encoding}|]|\marg{language}}

\New{3.9i} Except in a few languages, like \textsf{russian},
captions and dates are just strings, and do not switch the
language. That means you should set it explicitly if you want to use
them, or hyphenation (and in some cases the text itself) will be
wrong. For example:
\begin{verbatim}
\foreignlanguage{russian}{text \foreignlanguage{polish}{\seename} text}
\end{verbatim}

Of course, \TeX{} can do it for you. To avoid switching the language
all the while, |\babelensure| redefines the captions for a given
language to wrap them with a selector:
\begin{verbatim}
\babelensure{polish}
\end{verbatim}
By default only the basic captions and |\today| are redefined, but you
can add further macros with the key |include| in the optional argument
(without commas). Macros not to be modified are listed in
|exclude|. You can also enforce a font encoding with
|fontenc|.\footnote{With it encoded string may not work as expected.}
A couple of examples:
\begin{verbatim}
\babelensure[include=\Today]{spanish}
\babelensure[fontenc=T5]{vietnamese}
\end{verbatim}

They are activated when the language is selected (at the |afterextras|
event), and it makes some assumptions which could not be fulfilled in
some languages. Note also you should include only macros defined by
the language, not global macros (eg, |\TeX| of |\dag|).

With |ini| files (see below), captions are ensured by default.

\subsection{Shorthands}

A \textit{shorthand} is a sequence of one or two characters that
expands to arbitrary \TeX{} code.

Shorthands can be used for different kinds of things, as for example:
(1) in some languages shorthands such as |"a| are defined to be able
to hyphenate the word if the encoding is |OT1|; (2) in some languages
shorthands such as |!| are used to insert the right amount of white
space; (3) several kinds of discretionaries and breaks can be inserted
easily with |"-|, |"=|, etc.

The package \textsf{inputenc} as well as \xetex{} an \luatex{} have
alleviated entering non-ASCII characters, but minority languages and
some kinds of text can still require characters not directly available
on the keyboards (and sometimes not even as separated or precomposed
Unicode characters). As to the point 2, now \textsf{pdfTeX} provides
|\knbccode|, and \luatex{} can manipulate the glyph list. Tools for
point 3 can be still very useful in general.

There are three levels of shorthands: \textit{user},
\textit{language}, and \textit{system} (by order of
precedence). Version 3.9 introduces the \textit{language user} level
on top of the user level, as described below. In most cases, you will
use only shorthands provided by languages.

\begin{note} Note the following:
\begin{enumerate}
\item Activated chars used for two-char shorthands cannot be followed
  by a closing brace |}| and the spaces following are gobbled.  With
  one-char shorthands (eg,~|:|), they are preserved.
\item If on a certain level (system, language, user) there is a
  one-char shorthand, two-char ones starting with that 
  char and on the same level are ignored.
\item Since they are active, a shorthand cannot contain the same
  character in its definition (except if it is deactivated with, eg,
  |string|).
\end{enumerate}
\end{note}

A typical error when using shorthands is the following:
\trouble{Argument of \textbackslash language@active@arg"
has an extra \textbraceright}
\begin{verbatim}
! Argument of \language@active@arg" has an extra }.
\end{verbatim}
It means there is a closing brace just after a shorthand, which is not
allowed (eg,~|"}|). Just add |{}| after (eg,~|"{}}|). 

\Describe{\shorthandon}{\marg{shorthands-list}}
\DescribeOther{\shorthandoff}{%
\colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}%
\marg{shorthands-list}}
It is sometimes necessary to switch a shorthand
character off temporarily, because it must be used in an
entirely different way. For this purpose, the user commands
|\shorthandoff| and |\shorthandon| are provided. They each take a
list of characters as their arguments.

The command |\shorthandoff| sets the |\catcode| for each of the
characters in its argument to other (12); the command |\shorthandon|
sets the |\catcode| to active (13). Both commands only work on `known'
shorthand characters. If a character is not known to be a shorthand
character its category code will be left unchanged.

\New{3.9a} However, |\shorthandoff| does not behave as
you would expect with characters like |~| or |^|, because they
usually are not ``other''. For them |\shorthandoff*| is provided,
so that with
\begin{verbatim}
\shorthandoff*{~^}
\end{verbatim}
|~| is still active, very likely with the meaning of a non-breaking
space, and |^| is the superscript character. The catcodes used are
those when the shorthands are defined, usually when language files are
loaded.

\Describe{\useshorthands}{%
\colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}%
\marg{char}}

The command |\useshorthands| initiates the definition of user-defined
shorthand sequences. It has one argument, the character that starts
these personal shorthands.

\New{3.9a} User shorthands are not always alive, as they may
be deactivated by languages (for example, if you use |"| for your user
shorthands and switch from \textsf{german} to \textsf{french}, they
stop working). Therefore, a starred version
|\useshorthands*|\marg{char} is provided, which makes sure shorthands
are always activated.

Currently, if the package option |shorthands| is used, you must include any
character to be activated with |\useshorthands|. This restriction will
be lifted in a future release.

\Describe\defineshorthand{\texttt{[}\langlist\texttt{]}%
     \marg{shorthand}\marg{code}}

The command |\defineshorthand| takes two arguments: the first is
a one- or two-character shorthand sequence, and the second is the
code the shorthand should expand to.

\New{3.9a} An optional argument allows to (re)define language and
system shorthands (some languages do not activate shorthands, so you
may want to add |\languageshorthands|\marg{lang} to the corresponding
|\extras|\m{lang}, as explained below). By default, user shorthands
are (re)defined.

User shorthands override language ones, which in turn override
system shorthands. Language-dependent user shorthands (new in
3.9) take precedence over ``normal'' user shorthands.

\begin{example}
  Let's assume you want a unified set of shorthand for discretionaries
  (languages do not define shorthands consistently, and |"-|, |\-|,
  |"=| have different meanings).  You could start with, say:
\begin{verbatim}
\useshorthands*{"}
\defineshorthand{"*}{\babelhyphen{soft}}
\defineshorthand{"-}{\babelhyphen{hard}}
\end{verbatim}
  However, behavior of hyphens is language dependent. For example, in
  languages like Polish and Portuguese, a hard hyphen inside compound
  words are repeated at the beginning of the next line. You could then
  set:
\begin{verbatim}
\defineshorthand[*polish,*portugese]{"-}{\babelhyphen{repeat}}
\end{verbatim}
  Here, options with |*| set a language-dependent user shorthand,
  which means the generic one above only applies for the rest of
  languages; without |*| they would (re)define the language shorthands
  instead, which are overriden by user ones.

  Now, you have a single unified shorthand (|"-|), with a
  content-based meaning (`compound word hyphen') whose visual behavior
  is that expected in each context.
\end{example}

\Describe\aliasshorthand{\marg{original}\marg{alias}}

The command |\aliasshorthand| can be used to let another
character perform the same functions as the default shorthand
character. If one prefers for example to use the character |/|
over |"| in typing Polish texts, this can be achieved by entering
|\aliasshorthand{"}{/}|. 

\begin{note}
  The substitute character must \textit{not} have been declared before
  as shorthand (in such a case, |\aliashorthands| is ignored).
\end{note}

\begin{example}
  The following example shows how to replace a shorthand by another
\begin{verbatim}
\aliasshorthand{~}{^}
\AtBeginDocument{\shorthandoff*{~}}
\end{verbatim}
\end{example}

\begin{warning}
  Shorthands remember somehow the original character, and the fallback
  value is that of the latter. So, in this example, if no shorthand if
  found, |^| expands to a non-breaking space, because this is the
  value of |~| (internally, |^| still calls |\active@char~| or
  |\normal@char~|). Furthermore, if you change the |system| value of
  |^| with |\defineshorthand| nothing happens.
\end{warning}

\Describe\languageshorthands{\marg{language}} The command
|\languageshorthands| can be used to switch the shorthands on the
language level. It takes one argument, the name of a language or
|none| (the latter does what its name suggests).\footnote{Actually,
any name not corresponding to a language group does the same as
\texttt{none}. However, follow this convention because it might be
enforced in future releases of \babel{} to catch possible errors.}
Note that for this to work the language should have been specified as
an option when loading the \babel\ package.  For example, you can use
in \textsf{english} the shorthands defined by \textsf{ngerman} with
\begin{verbatim}
\addto\extrasenglish{\languageshorthands{ngerman}}
\end{verbatim}
(You may also need to activate them with, for example,
|\useshorthands|.)

Very often, this is a more convenient way to deactivate shorthands
than |\shorthandoff|, as for example if you want to define a macro
to easy typing phonetic characters with \textsf{tipa}:
\begin{verbatim}
\newcommand{\myipa}[1]{{\languageshorthands{none}\tipaencoding#1}}
\end{verbatim}

\Describe\babelshorthand{\marg{shorthand}}
With this command you can use a shorthand even if (1) not activated in
\texttt{shorthands} (in this case only shorthands for the current
language are taken into account, ie, not user shorthands), (2) turned
off with |\shorthandoff| or (3) deactivated with the internal
|\bbl@deactivate|; for example, \verb|\babelshorthand{"u}| or
\verb|\babelshorthand{:}|.  (You can conveniently define your own
macros, or even you own user shorthands provided they do not ovelap.)

For your records, here is a list of shorthands, but you must double
check them, as they may change:\footnote{Thanks to Enrico Gregorio}

\begin{description}
\itemsep=-\parskip
\item[Languages with no shorthands] Croatian, English (any variety),
  Indonesian, Hebrew, Interlingua, Irish, Lower Sorbian, Malaysian,
  North Sami, Romanian, Scottish, Welsh
\item[Languages with only \texttt{"} as defined shorthand character]
  Albanian, Bulgarian, Danish, Dutch, Finnish, German (old and new
  orthography, also Austrian), Icelandic, Italian, Norwegian, Polish,
  Portuguese (also Brazilian), Russian, Serbian (with Latin script),
  Slovene, Swedish, Ukrainian, Upper Sorbian
\item[Basque] |" ' ~|
\item[Breton] |: ; ? !|
\item[Catalan] |" ' `|
\item[Czech] |" -|
\item[Esperanto] |^|
\item[Estonian] |" ~|
\item[French] (all varieties) |: ; ? !|
\item[Galician] |" . ' ~ < >|
\item[Greek] |~|
\item[Hungarian] |`|
\item[Kurmanji] |^|
\item[Latin] |" ^ =|
\item[Slovak] |" ^ ' -|
\item[Spanish] |" . < > '|
\item[Turkish] |: ! =|
\end{description}
In addition, the \babel{} core declares |~| as a one-char shorthand
which is let, like the standard |~|, to a non breaking
space.\footnote{This declaration serves to nothing, but it is
preserved for backward compatibility.}

\subsection{Package options}

\New{3.9a}
These package options are processed before language options, so
that they are taken into account irrespective of its order. The first
three options have been available in previous versions.

\Describe{KeepShorthandsActive}{}
Tells babel not to deactivate shorthands after loading a language
file, so that they are also availabe in the preamble.

\Describe{activeacute}{} For some languages \babel\ supports this
options to set |'| as a shorthand in case it is not done by default.

\Describe{activegrave}{}
Same for |`|.

\Describe{shorthands=}{\meta{char}\meta{char}...
$\string|$ \texttt{off}}
The only language shorthands activated
are those given, like, eg:
\begin{verbatim}
\usepackage[esperanto,french,shorthands=:;!?]{babel}
\end{verbatim} 
If \verb|'| is included, \texttt{activeacute} is set; if \verb|`| is
included, \texttt{activegrave} is set.  Active characters (like
\verb|~|) should be preceded by \verb|\string| (otherwise they will be
expanded by \LaTeX{} before they are passed to the package and
therefore they will not be recognized); however, |t| is provided for
the common case of |~| (as well as |c| for not so common case of the
comma).

With |shorthands=off| no language shorthands are defined,
As some languages use this mechanism for tools not available
otherwise, a macro \verb|\babelshorthand| is defined, which allows
using them; see above.

\Describe{safe=}{\texttt{none} $\string|$ \texttt{ref} $\string|$
\texttt{bib}} Some \LaTeX{} macros are redefined so that using
shorthands is safe. With \texttt{safe=bib} only |\nocite|, |\bibcite|
and |\bibitem| are redefined. With |safe=ref| only |\newlabel|, |\ref|
and |\pageref| are redefined (as well as a few macros from
\textsf{varioref} and \textsf{ifthen}). With |safe=none| no macro is
redefined. This option is strongly recommended, because a good deal of
incompatibilities and errors are related to these redefinitions -- of
course, in such a case you cannot use shorthands in these macros, but
this is not a real problem (just use ``allowed'' characters). 

\Describe{math=}{\texttt{active} $\string|$ \texttt{normal}}
Shorthands are mainly intended for text, not for math. By setting this
option with the value |normal| they are deactivated in math mode
(default is |active|) and things like |${a'}$| (a closing brace after
a shorthand) are not a source of trouble any more.

\Describe{config=}{\meta{file}} Load \meta{file}\texttt{.cfg} instead
of the default config file |bblopts.cfg| (the file is loaded even
with |noconfigs|).

\Describe{main=}{\meta{language}} Sets the main language, as explained
above, ie, this language is always loaded last. If it is not given as
package or global option, it is added to the list of requested
languages.

\Describe{headfoot=}{\meta{language}} By default, headlines and
footlines are not touched (only marks), and if they contain language
dependent macros (which is not usual) there may be unexpected
results. With this option you may set the language in heads and foots.

\Describe{noconfigs}{} Global and language default config files are
not loaded, so you can make sure your document is not spoilt by an
unexpected \texttt{.cfg} file. However, if the key |config| is set,
this file is loaded.

\Describe{showlanguages}{} Prints to the log the list of languages
loaded when the format was created: number (remember dialects can
share it), name, hyphenation file and exceptions file. 

\Describe{nocase}{} \New{3.9l} Language settings for uppercase and
lowercase mapping (as set by |\SetCase|) are ignored. Use only if there
are incompatibilities with other packages.

\Describe{silent}{} \New{3.9l} No warnings and no \textit{infos} are
written to the log file.\footnote{You can use alternatively the
package \textsf{silence}.}

\Describe{strings=}{\texttt{generic} $\string|$ \texttt{unicode}
$\string|$ \texttt{encoded} $\string|$ \meta{label} $\string|$
\meta{font encoding}} Selects the encoding of strings in languages
supporting this feature. Predefined labels are |generic| (for
traditional \TeX, LICR and ASCII strings), |unicode| (for engines like
\xetex{} and \luatex) and |encoded| (for special cases requiring mixed
encodings). Other allowed values are font encoding codes (|T1|, |T2A|,
|LGR|, |L7X|...), but only in languages supporting them. Be aware with
|encoded| captions are protected, but they work in |\MakeUppercase|
and the like (this feature misuses some internal \LaTeX\ tools, so use
it only as a last resort).

\Describe{hyphenmap=}{\texttt{off} $\string|$ \texttt{main}
$\string|$ \texttt{select} $\string|$ \texttt{other} $\string|$
\texttt{other*}}

\New{3.9g} Sets the behavior of case mapping for hyphenation,
provided the language defines it.\footnote{Turned off in plain.} It
can take the following values:
\begin{description}
\renewcommand\makelabel[1]{%
  \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
\itemsep=-\parskip
\item[off] deactivates this feature and no case mapping is applied;
\item[first] sets it at the first switching commands in the
  current or parent scope (typically, when the aux file is first read
  and at |\begin{document}|, but also the first |\selectlanguage| in
    the preamble), and it's the default if a single
    language option has been stated;\footnote{Duplicated options count
    as several ones.}
\item[select] sets it only at |\selectlanguage|;
\item[other] also sets it at |otherlanguage|;
\item[other*] also sets it at |otherlanguage*| as well as in heads and
  foots (if the option |headfoot| is used) and in auxiliary files (ie,
  at |\select@language|), and it's the default if several language
  options have been stated. The option |first| can be regarded as an
  optimized version of \texttt{other*} for monolingual
  documents.\footnote{Providing |foreign| is pointless, because the
  case mapping applied is that at the end of paragraph, but if either
  \xetex{} or \luatex{} change this behavior it might be added. On
  the other hand, |other| is provided even if I [JBL] think it isn't
  really useful, but who knows.}
\end{description}

\Describe{bidi=}{}

\New{3.14} Selects the bidi algorithm to be used in \luatex{} and
\xetex{}. See sec.~\ref{bidi}.

\Describe{layout=}{}

\New{3.16} Selects which layout elements are adapted in bidi
documents. See sec.~\ref{bidi}.

\subsection{The \texttt{base} option}

With this package option \babel{} just loads some basic macros (those
in |switch.def|), defines |\AfterBabelLanguage| and exits. It also
selects the hyphenations patterns for the last language passed as
option (by its name in |language.dat|). There are two main uses:
classes and packages, and as a last resort in case there are, for some
reason, incompatible languages. It can be used if you just want to
select the hyphenations patterns of a single language, too.
% TODO: example

\Describe\AfterBabelLanguage{\marg{option-name}\marg{code}}

This command is currently the only provided by |base|. Executes
\meta{code} when the file loaded by the corresponding package option
is finished (at |\ldf@finish|). The setting is global. So
\begin{verbatim}
\AfterBabelLanguage{french}{...}
\end{verbatim}
does ... at the end of |french.ldf|. It can be used in |ldf| files,
too, but in such a case the code is executed only if
\meta{option-name} is the same as |\CurrentOption| (which could not
be the same as the option name as set in |\usepackage|!). 

\begin{example}
  Consider two languages \textsf{foo} and \textsf{bar} defining the
  same |\macro| with |\newcommand|. An error is raised if you attempt
  to load both. Here is a way to overcome this problem:
\begin{verbatim}
\usepackage[base]{babel}
\AfterBabelLanguage{foo}{%
  \let\macroFoo\macro
  \let\macro\relax}
\usepackage[foo,bar]{babel}
\end{verbatim}
\end{example}

\subsection{\texttt{ini} files}

An alternative approach to define a language is by means of an
\texttt{ini} file. Currently \babel{} provides about 200 of these
files containing the basic data required for a language.

Most of them set the date, and many also the captions (Unicode and
LICR). They will be evolving with the time to add more features
(something to keep in mind if backward compatibility is
important). The following section shows how to make use of them
currently (by means of |\babelprovide|), but a higher interface, based
on package options, in under development.

\begin{example} 
  Although Georgian has its own \texttt{ldf} file, here is how to
  declare this language with an |ini| file in Unicode engines. The
  |nil| language is required, because currently \babel{} raises an
  error if there is no language.
\begingroup
\setmonofont[Scale=.87,Script=Georgian]{DejaVu Sans Mono}
\begin{verbatim}
\documentclass{book}

\usepackage[nil]{babel}
\babelprovide[import=ka, main]{georgian}

\babelfont{rm}{DejaVu Sans}

\begin{document}

\tableofcontents

\chapter{სამზარეულო და სუფრის ტრადიციები}

ქართული ტრადიციული სამზარეულო ერთ-ერთი უმდიდრესია მთელ მსოფლიოში.

\end{document}
\end{verbatim}
\endgroup
\end{example}

Here is the list (u means Unicode captions, and l means LICR
captions):

\begingroup
\bigskip\hrule\nobreak

\makeatletter
\def\tag#1{\par\@hangfrom{\makebox[7em][l]{#1}}\ignorespaces}
\def\hascapu{\textsuperscript{u}}
\def\hascapl{\textsuperscript{l}}

\begin{multicols}{2}

\tag{af} Afrikaans\hascapu\hascapl
\tag{agq} Aghem
\tag{ak} Akan
\tag{am} Amharic\hascapu\hascapl
\tag{ar} Arabic\hascapu\hascapl
\tag{as} Assamese
\tag{asa} Asu
\tag{ast} Asturian\hascapu\hascapl
\tag{az-Cyrl} Azerbaijani
\tag{az-Latn} Azerbaijani
\tag{az} Azerbaijani\hascapu\hascapl
\tag{bas} Basaa
\tag{be} Belarusian\hascapu\hascapl
\tag{bem} Bemba
\tag{bez} Bena
\tag{bg} Bulgarian\hascapu\hascapl
\tag{bm} Bambara
\tag{bn} Bangla\hascapu\hascapl
\tag{bo} Tibetan\hascapu
\tag{brx} Bodo
\tag{bs-Cyrl} Bosnian
\tag{bs-Latn} Bosnian\hascapu\hascapl
\tag{bs} Bosnian\hascapu\hascapl
\tag{ca} Catalan\hascapu\hascapl
\tag{ce} Chechen
\tag{cgg} Chiga
\tag{chr} Cherokee
\tag{ckb} Central Kurdish
\tag{cs} Czech\hascapu\hascapl
\tag{cy} Welsh\hascapu\hascapl
\tag{da} Danish\hascapu\hascapl
\tag{dav} Taita
\tag{de-AT} German\hascapu\hascapl
\tag{de-CH} German\hascapu\hascapl
\tag{de} German\hascapu\hascapl
\tag{dje} Zarma
\tag{dsb} Lower Sorbian\hascapu\hascapl
\tag{dua} Duala
\tag{dyo} Jola-Fonyi
\tag{dz} Dzongkha
\tag{ebu} Embu
\tag{ee} Ewe
\tag{el} Greek\hascapu\hascapl
\tag{en-AU} English\hascapu\hascapl
\tag{en-CA} English\hascapu\hascapl
\tag{en-GB} English\hascapu\hascapl
\tag{en-NZ} English\hascapu\hascapl
\tag{en-US} English\hascapu\hascapl
\tag{en} English\hascapu\hascapl
\tag{eo} Esperanto\hascapu\hascapl
\tag{es-MX} Spanish\hascapu\hascapl
\tag{es} Spanish\hascapu\hascapl
\tag{et} Estonian\hascapu\hascapl
\tag{eu} Basque\hascapu\hascapl
\tag{ewo} Ewondo
\tag{fa} Persian\hascapu\hascapl
\tag{ff} Fulah
\tag{fi} Finnish\hascapu\hascapl
\tag{fil} Filipino
\tag{fo} Faroese
\tag{fr} French\hascapu\hascapl
\tag{fr-BE} French\hascapu\hascapl
\tag{fr-CA} French\hascapu\hascapl
\tag{fr-CH} French\hascapu\hascapl
\tag{fr-LU} French\hascapu\hascapl
\tag{fur} Friulian\hascapu\hascapl
\tag{fy} Western Frisian
\tag{ga} Irish\hascapu\hascapl
\tag{gd} Scottish Gaelic\hascapu\hascapl
\tag{gl} Galician\hascapu\hascapl
\tag{gsw} Swiss German
\tag{gu} Gujarati
\tag{guz} Gusii
\tag{gv} Manx
\tag{ha-GH} Hausa
\tag{ha-NE} Hausa\hascapl
\tag{ha} Hausa
\tag{haw} Hawaiian
\tag{he} Hebrew\hascapu\hascapl
\tag{hi} Hindi\hascapu
\tag{hr} Croatian\hascapu\hascapl
\tag{hsb} Upper Sorbian\hascapu\hascapl
\tag{hu} Hungarian\hascapu\hascapl
\tag{hy} Armenian
\tag{ia} Interlingua\hascapu\hascapl
\tag{id} Indonesian\hascapu\hascapl
\tag{ig} Igbo
\tag{ii} Sichuan Yi
\tag{is} Icelandic\hascapu\hascapl
\tag{it} Italian\hascapu\hascapl
\tag{ja} Japanese
\tag{jgo} Ngomba
\tag{jmc} Machame
\tag{ka} Georgian\hascapu\hascapl
\tag{kab} Kabyle
\tag{kam} Kamba
\tag{kde} Makonde
\tag{kea} Kabuverdianu
\tag{khq} Koyra Chiini
\tag{ki} Kikuyu
\tag{kk} Kazakh
\tag{kkj} Kako
\tag{kl} Kalaallisut
\tag{kln} Kalenjin
\tag{km} Khmer
\tag{kn} Kannada\hascapu\hascapl
\tag{ko} Korean
\tag{kok} Konkani
\tag{ks} Kashmiri
\tag{ksb} Shambala
\tag{ksf} Bafia
\tag{ksh} Colognian
\tag{kw} Cornish
\tag{ky} Kyrgyz
\tag{lag} Langi
\tag{lb} Luxembourgish
\tag{lg} Ganda
\tag{lkt} Lakota
\tag{ln} Lingala
\tag{lo} Lao\hascapu\hascapl
\tag{lrc} Northern Luri
\tag{lt} Lithuanian\hascapu\hascapl
\tag{lu} Luba-Katanga
\tag{luo} Luo
\tag{luy} Luyia
\tag{lv} Latvian\hascapu\hascapl
\tag{mas} Masai
\tag{mer} Meru
\tag{mfe} Morisyen
\tag{mg} Malagasy
\tag{mgh} Makhuwa-Meetto
\tag{mgo} Metaʼ
\tag{mk} Macedonian\hascapu\hascapl
\tag{ml} Malayalam\hascapu\hascapl
\tag{mn} Mongolian
\tag{mr} Marathi\hascapu\hascapl
\tag{ms-BN} Malay\hascapl
\tag{ms-SG} Malay\hascapl
\tag{ms} Malay\hascapu\hascapl
\tag{mt} Maltese
\tag{mua} Mundang
\tag{my} Burmese
\tag{mzn} Mazanderani
\tag{naq} Nama
\tag{nb} Norwegian Bokmål\hascapu\hascapl
\tag{nd} North Ndebele
\tag{ne} Nepali
\tag{nl} Dutch\hascapu\hascapl
\tag{nmg} Kwasio
\tag{nn} Norwegian Nynorsk\hascapu\hascapl
\tag{nnh} Ngiemboon
\tag{nus} Nuer
\tag{nyn} Nyankole
\tag{om} Oromo
\tag{or} Odia
\tag{os} Ossetic
\tag{pa-Arab} Punjabi
\tag{pa-Guru} Punjabi
\tag{pa} Punjabi
\tag{pl} Polish\hascapu\hascapl
\tag{pms} Piedmontese\hascapu\hascapl
\tag{ps} Pashto
\tag{pt-BR} Portuguese\hascapu\hascapl
\tag{pt-PT} Portuguese\hascapu\hascapl
\tag{pt} Portuguese\hascapu\hascapl
\tag{qu} Quechua
\tag{rm} Romansh\hascapu\hascapl
\tag{rn} Rundi
\tag{ro} Romanian\hascapu\hascapl
\tag{rof} Rombo
\tag{ru} Russian\hascapu\hascapl
\tag{rw} Kinyarwanda
\tag{rwk} Rwa
\tag{sah} Sakha
\tag{saq} Samburu
\tag{sbp} Sangu
\tag{se} Northern Sami\hascapu\hascapl
\tag{seh} Sena
\tag{ses} Koyraboro Senni
\tag{sg} Sango
\tag{shi-Latn} Tachelhit
\tag{shi-Tfng} Tachelhit
\tag{shi} Tachelhit
\tag{si} Sinhala
\tag{sk} Slovak\hascapu\hascapl
\tag{sl} Slovenian\hascapu\hascapl
\tag{smn} Inari Sami
\tag{sn} Shona
\tag{so} Somali
\tag{sq} Albanian\hascapu\hascapl
\tag{sr-Cyrl-BA} Serbian\hascapu\hascapl
\tag{sr-Cyrl-ME} Serbian\hascapu\hascapl
\tag{sr-Cyrl-XK} Serbian\hascapu\hascapl
\tag{sr-Cyrl} Serbian\hascapu\hascapl
\tag{sr-Latn-BA} Serbian\hascapu\hascapl
\tag{sr-Latn-ME} Serbian\hascapu\hascapl
\tag{sr-Latn-XK} Serbian\hascapu\hascapl
\tag{sr-Latn} Serbian\hascapu\hascapl
\tag{sr} Serbian\hascapu\hascapl
\tag{sv} Swedish\hascapu\hascapl
\tag{sw} Swahili
\tag{ta} Tamil\hascapu
\tag{te} Telugu\hascapu\hascapl
\tag{teo} Teso
\tag{th} Thai\hascapu\hascapl
\tag{ti} Tigrinya
\tag{tk} Turkmen\hascapu\hascapl
\tag{to} Tongan
\tag{tr} Turkish\hascapu\hascapl
\tag{twq} Tasawaq
\tag{tzm} Central Atlas Tamazight
\tag{ug} Uyghur
\tag{uk} Ukrainian\hascapu\hascapl
\tag{ur} Urdu\hascapu\hascapl
\tag{uz-Arab} Uzbek
\tag{uz-Cyrl} Uzbek
\tag{uz-Latn} Uzbek
\tag{uz} Uzbek
\tag{vai-Latn} Vai
\tag{vai-Vaii} Vai
\tag{vai} Vai
\tag{vi} Vietnamese\hascapu\hascapl
\tag{vun} Vunjo
\tag{wae} Walser
\tag{xog} Soga
\tag{yav} Yangben
\tag{yi} Yiddish
\tag{yo} Yoruba
\tag{yue} Cantonese
\tag{zgh} Standard Moroccan Tamazight
\tag{zh-Hans-HK} Chinese
\tag{zh-Hans-MO} Chinese
\tag{zh-Hans-SG} Chinese
\tag{zh-Hans} Chinese
\tag{zh-Hant-HK} Chinese
\tag{zh-Hant-MO} Chinese
\tag{zh-Hant} Chinese
\tag{zh} Chinese
\tag{zu} Zulu

\end{multicols}
\endgroup
\hrule
\bigskip

In some contexts (currently |\babelfont|) an \texttt{ini} file may be
loaded by its name. Here is the list of the names currently
supported. With these languages, |\babelfont| loads (if not done
before) the language and script names (even if the language is defined
as a package option with an \textsf{ldf} file).

\begingroup
\bigskip\hrule\nobreak

\let\\\par

\begin{multicols}{2}

aghem\\
akan\\
albanian\\
american\\
amharic\\
arabic\\
armenian\\
assamese\\
asturian\\
asu\\
australian\\
austrian\\
azerbaijani-cyrillic\\
azerbaijani-cyrl\\
azerbaijani-latin\\
azerbaijani-latn\\
azerbaijani\\
bafia\\
bambara\\
basaa\\
basque\\
belarusian\\
bemba\\
bena\\
bengali\\
bodo\\
bosnian-cyrillic\\
bosnian-cyrl\\
bosnian-latin\\
bosnian-latn\\
bosnian\\
brazilian\\
breton\\
british\\
bulgarian\\
burmese\\
canadian\\
cantonese\\
catalan\\
centralatlastamazight\\
centralkurdish\\
chechen\\
cherokee\\
chiga\\
chinese-hans-hk\\
chinese-hans-mo\\
chinese-hans-sg\\
chinese-hans\\
chinese-hant-hk\\
chinese-hant-mo\\
chinese-hant\\
chinese-simplified-hongkongsarchina\\
chinese-simplified-macausarchina\\
chinese-simplified-singapore\\
chinese-simplified\\
chinese-traditional-hongkongsarchina\\
chinese-traditional-macausarchina\\
chinese-traditional\\
chinese\\
colognian\\
cornish\\
croatian\\
czech\\
danish\\
duala\\
dutch\\
dzongkha\\
embu\\
english-au\\
english-australia\\
english-ca\\
english-canada\\
english-gb\\
english-newzealand\\
english-nz\\
english-unitedkingdom\\
english-unitedstates\\
english-us\\
english\\
esperanto\\
estonian\\
ewe\\
ewondo\\
faroese\\
filipino\\
finnish\\
french-be\\
french-belgium\\
french-ca\\
french-canada\\
french-ch\\
french-lu\\
french-luxembourg\\
french-switzerland\\
french\\
friulian\\
fulah\\
galician\\
ganda\\
georgian\\
german-at\\
german-austria\\
german-ch\\
german-switzerland\\
german\\
greek\\
gujarati\\
gusii\\
hausa-gh\\
hausa-ghana\\
hausa-ne\\
hausa-niger\\
hausa\\
hawaiian\\
hebrew\\
hindi\\
hungarian\\
icelandic\\
igbo\\
inarisami\\
indonesian\\
interlingua\\
irish\\
italian\\
japanese\\
jolafonyi\\
kabuverdianu\\
kabyle\\
kako\\
kalaallisut\\
kalenjin\\
kamba\\
kannada\\
kashmiri\\
kazakh\\
khmer\\
kikuyu\\
kinyarwanda\\
konkani\\
korean\\
koyraborosenni\\
koyrachiini\\
kwasio\\
kyrgyz\\
lakota\\
langi\\
lao\\
latvian\\
lingala\\
lithuanian\\
lowersorbian\\
lsorbian\\
lubakatanga\\
luo\\
luxembourgish\\
luyia\\
macedonian\\
machame\\
makhuwameetto\\
makonde\\
malagasy\\
malay-bn\\
malay-brunei\\
malay-sg\\
malay-singapore\\
malay\\
malayalam\\
maltese\\
manx\\
marathi\\
masai\\
mazanderani\\
meru\\
meta\\
mexican\\
mongolian\\
morisyen\\
mundang\\
nama\\
nepali\\
newzealand\\
ngiemboon\\
ngomba\\
norsk\\
northernluri\\
northernsami\\
northndebele\\
norwegianbokmal\\
norwegiannynorsk\\
nswissgerman\\
nuer\\
nyankole\\
nynorsk\\
occitan\\
oriya\\
oromo\\
ossetic\\
pashto\\
persian\\
piedmontese\\
polish\\
portuguese-br\\
portuguese-brazil\\
portuguese-portugal\\
portuguese-pt\\
portuguese\\
punjabi-arab\\
punjabi-arabic\\
punjabi-gurmukhi\\
punjabi-guru\\
punjabi\\
quechua\\
romanian\\
romansh\\
rombo\\
rundi\\
russian\\
rwa\\
sakha\\
samburu\\
samin\\
sango\\
sangu\\
scottishgaelic\\
sena\\
serbian-cyrillic-bosniaherzegovina\\
serbian-cyrillic-kosovo\\
serbian-cyrillic-montenegro\\
serbian-cyrillic\\
serbian-cyrl-ba\\
serbian-cyrl-me\\
serbian-cyrl-xk\\
serbian-cyrl\\
serbian-latin-bosniaherzegovina\\
serbian-latin-kosovo\\
serbian-latin-montenegro\\
serbian-latin\\
serbian-latn-ba\\
serbian-latn-me\\
serbian-latn-xk\\
serbian-latn\\
serbian\\
shambala\\
shona\\
sichuanyi\\
sinhala\\
slovak\\
slovene\\
slovenian\\
soga\\
somali\\
spanish-mexico\\
spanish-mx\\
spanish\\
standardmoroccantamazight\\
swahili\\
swedish\\
swissgerman\\
tachelhit-latin\\
tachelhit-latn\\
tachelhit-tfng\\
tachelhit-tifinagh\\
tachelhit\\
taita\\
tamil\\
tasawaq\\
telugu\\
teso\\
thai\\
tibetan\\
tigrinya\\
tongan\\
turkish\\
turkmen\\
ukenglish\\
ukrainian\\
uppersorbian\\
urdu\\
usenglish\\
usorbian\\
uyghur\\
uzbek-arab\\
uzbek-arabic\\
uzbek-cyrillic\\
uzbek-cyrl\\
uzbek-latin\\
uzbek-latn\\
uzbek\\
vai-latin\\
vai-latn\\
vai-vai\\
vai-vaii\\
vai\\
vietnam\\
vietnamese\\
vunjo\\
walser\\
welsh\\
westernfrisian\\
yangben\\
yiddish\\
yoruba\\
zarma\\
zulu
afrikaans\\

\end{multicols}
\endgroup
\hrule

\subsection{Selecting fonts}

\New{3.15} Babel provides a high level interface on top of |fontspec|
to select fonts. There is no need to load \textsf{fontspec} explicitly
-- \babel{} does it for you with the first |\babelfont|.\footnote{See
also the package \textsf{combofont} for a complementary approach.}

\Describe\babelfont{\oarg{language-list}\marg{font-family}%
  \oarg{font-options}\marg{font-name}}

Here \textit{font-family} is |rm|, |sf| or |tt| (or newly defined
ones, as explained below), and \textit{font-name} is the same as in
\textsf{fontspec} and the like.

If no language is given, then it is considered the default font for
the family, activated when a language is selected. On the other hand,
if there is one or more languages in the optional argument, the font
will be assigned to them, overriding the default. Alternatively, you
may set a font for a script -- just precede its name (lowercase) with
a star (eg, |*devanagari|).

\Babel{} takes care of the font language and the font script when
languages are selected (as well as the writing direction); see the
recognized languages above. In most cases, you will not need
\textit{font-options}, which is the same as in \textsf{fontspec}, but
you may add further key/value pairs if necessary.

\begin{example}
  Usage in most cases is very simple. Let us assume you are setting up
  a document in Swedish, with some words in Hebrew, with a font suited
  for both languages.
  \begingroup
% If you are looking at the code to see how it has been written, you
% will be disappointed :-). The following example is built ad hoc to
% emulate the final result to avoid dependencies, and therefore it's
% not "real" code.
\setmonofont[Scale=.87,Script=Hebrew]{DejaVu Sans Mono} \catcode`@=13
\def@#1{\ifcase#1\relax \egroup \or \bgroup\textdir TLT \else
\bgroup\textdir TRT \fontspec[Scale=.87,Script=Hebrew]{Liberation
Mono} \fi}
\begin{verbatim}
\documentclass{article}

\usepackage[swedish, bidi=default]{babel}

\babelprovide[import=he]{hebrew}

_\babelfont{rm}{FreeSerif}_

\begin{document}

Svenska \foreignlanguage{hebrew}{@2עִבְרִית@0} svenska.

\end{document}
\end{verbatim}
\endgroup

If on the other hand you have to resort to different fonts, you could
replace the red line above with, say:
\begin{verbatim}
\babelfont{rm}{Iwona}
\babelfont[hebrew]{rm}{FreeSerif}
\end{verbatim}
\end{example}

|\babelfont| can be used to implicitly define a new font family. Just
write its name instead of |rm|, |sf| or |tt|. This is the preferred way
to select fonts in addition to the three basic ones.

\begin{example}
  Here is how to do it:
\begin{verbatim}
\babelfont{kai}{FandolKai}
\end{verbatim}
  Now, |\kaifamily| and |\kaidefault|, as well as |\textkai| are at
  your disposal.
\end{example}

\begin{note}
  You may load \textsf{fontspec} explicitly. For example:
\begin{verbatim}
\usepackage{fontspec}
\newfontscript{Devanagari}{deva}
\babelfont[hindi]{rm}{Shobhika}
\end{verbatim}
  This makes sure the OpenType script for Devanagari is |deva| and not
  |dev2|.
\end{note}

\begin{note}
  Directionality is a property affecting margins, intentation, column
  order, etc., not just text. Therefore, it is under the direct
  control of the language, which appplies both the script and the
  direction to the text. As a consequence, there is no need to set
  \texttt{Script} when declaring a font (nor \texttt{Language}). In
  fact, it is even discouraged.
\end{note}

\begin{note}
  |\fontspec| is not touched at all, only the preset font families
  (|rm|, |sf|, |tt|, and the like). If a language is switched when an
  \textit{ad hoc} font is active, or you select the font with this
  command, neither the script nor the language are passed. You must
  add them by hand. This is by design, for several reasons (for
  example, each font has its own set of features and a generic setting
  for several of them could be problematic, and also a “lower level”
  font selection is useful).
\end{note}

\begin{note}
  The keys |Language| and |Script| just pass these values to the
  \textit{font}, and do \textit{not} set the script for the
  \textit{language} (and therefore the writing direction). In other
  words, the |ini| file or |\babelprovide| provides default values for
  |\babelfont| if omitted, but the opposite is not true. See the note
  above for the reasons of this behavior.
\end{note}

\begin{warning}
  Do not use |\set|\textit{xxxx}|font| and |\babelfont| at the same
  time.  |\babelfont| follows the standard \LaTeX{} conventions to set
  the basic families -- define |\|\textit{xx}|default|, and activate
  it with |\|\textit{xx}|family|. On the other hand,
  |\set|\textit{xxxx}|font| in \textsf{fontspec} takes a different
  approach, because |\|\textit{xx}|family| is redefined with the
  family name hardcoded (so that |\|\textit{xx}|default| becomes
  no-op). Of course, both methods are incompatible, and if you use
  |\set|\textit{xxxx}|font|, font switching with |\babelfont| just
  does \textit{not} work (nor the standard |\|\textit{xx}|default|,
  for that matter).
\end{warning}

\subsection{Modifying a language}

Modifying the behavior of a language (say, the chapter “caption”), is
sometimes necessary, but not always trivial.
\begin{itemize}
\item The old way, still valid for many languages, to redefine a
  caption is the following:
\begin{verbatim}
\addto\captionsenglish{%
  \renewcommand\contentsname{Foo}%
}
\end{verbatim}
 As of 3.15, there is no need to hide spaces with \texttt{\%}
(\babel{} removes them), but it is advisable to do it.
\item The new way, which is found in |bulgarian|, |azerbaijani|,
  |spanish|, |french|, |turkish|, |icelandic|, |vietnamese| and a few
  more, as well as in languages created with |\babelprovide| and its
  key |import|, is:
\begin{verbatim}
\renewcommand\spanishchaptername{Foo}
\end{verbatim}
\item Macros to be run when a language is selected can be add to
  |\extras|\m{lang}:
\begin{verbatim}
\addto\extrasrussian{\mymacro}
\end{verbatim}
There is a counterpart for code to be run when a language is
unselected: |\noextras|\m{lang}.
\end{itemize}

\begin{note}
  These macros (|\captions|\m{lang}, |\extras|\m{lang}) may be redefined, but
  must not be used as such -- they just pass information to \babel{},
  which executes them in the proper context.
\end{note}

\subsection{Creating a language}

\New{3.10} And what if there is no style for your language or none
fits your needs? You may then define quickly a language with the
help of the following macro in the preamble.

\Describe\babelprovide{\oarg{options}\marg{language-name}}

Defines the internal structure of the language with some defaults: the
hyphen rules, if not available, are set to the current ones, left and
right hyphen mins are set to 2 and 3, but captions and date are not
defined. Conveniently, \babel{} warns you about what to do. Very
likely you will find alerts like that in the |log| file:
\begin{verbatim}
Package babel Warning: \mylangchaptername not set. Please, define
(babel)                it in the preamble with something like:
(babel)                \renewcommand\maylangchaptername{..}
(babel)                Reported on input line 18.
\end{verbatim}

In most cases, you will only need to define a few macros. 

\begin{example}
  If you need a language named |arhinish|:
\begin{verbatim}
\usepackage[danish]{babel}
\babelprovide{arhinish}
\renewcommand\arhinishchaptername{Chapitula}
\renewcommand\arhinishrefname{Refirenke}
\renewcommand\arhinishhyphenmins{22}
\end{verbatim}
\end{example}

The main language is not changed (\texttt{danish} in this example).
So, you must add |\selectlanguage{arhinish}| or other selectors where
necessary.

If the language has been loaded as an argument in |\documentclass| or
|\usepackage|, then |\babelprovide| redefines the requested data.

\Describe{import=}{\meta{language-tag}}
\New{3.13} Imports data from an |ini| file, including captions, date,
and hyphenmins. For example:
\begin{verbatim}
\babelprovide[import=hu]{hungarian}
\end{verbatim}
Unicode engines load the UTF-8 variants, while 8-bit engines load the
LICR (ie, with macros like |\'| or |\ss|) ones.

There are about 200 |ini| files, with data taken from the |ldf| files
and the CLDR provided by Unicode. Not all languages in the latter are
complete, and therefore neither are the |ini| files. A few languages
will show a warning about the current lack of suitability of the date
format (\textsf{hindi}, \textsf{french}, \textsf{breton}, and
\textsf{occitan}).

Besides |\today|, there is a |\<language>date| macro with three
arguments: year, month and day numbers. In fact, |\today| calls
|\<language>today|, which in turn calls
|\<language>date{\the\year}{\the\month}{\the\day}|.

\Describe{captions=}{\meta{language-tag}}
Loads only the strings. For example:
\begin{verbatim}
\babelprovide[captions=hu]{hungarian}
\end{verbatim}

\Describe{hyphenrules=}{\meta{language-list}} With this option, with a
space-separated list of hyphenation rules, \babel{} assigns to the
language the first valid hyphenation rules in the list. For example:
\begin{verbatim}
\babelprovide[hyphenrules=chavacano spanish italian]{chavacano}
\end{verbatim}
If none of the listed hyphenrules exist, the default behavior
applies. Note in this example we set |chavacano| as first option --
without it, it would select |spanish| even if |chavacano| exists.

A special value is |+|, which allocates a new language (in the \TeX{}
sense). It only makes sense as the last value (or the only one; the
subsequent ones are silently ignored). It is mostly useful with
\luatex, because you can add some patterns with |\babelpatterns|, as
for example:
\begin{verbatim}
\babelprovide[hyphenrules=+]{neo}
\babelpatterns[neo]{a1 e1 i1 o1 u1}
\end{verbatim}
In other engines it just supresses hyphenation (because the pattern
list is empty).

\Describe{main}{} This valueless option makes the language the main
one. Only in newly defined languages.

\Describe{script=}{\meta{script-name}} \New{3.15} Sets the script name
to be used by \textsf{fontspec} (eg, |Devanagari|). Overrides the
value in the |ini| file. This value is particularly important because
it sets the writing direction.

\Describe{language=}{\meta{language-name}} \New{3.15} Sets the
language name to be used by \textsf{fontspec} (eg, |Hindi|). Overrides
the value in the |ini| file. Not so important, but sometimes still
relevant.

\begin{note}
  (1) If you need shorthands, you can use |\useshorthands| and
  |\defineshorthand| as described above. (2) Captions and |\today| are
  ``ensured'' with |\babelensure| (this is be the default in
  |ini|-based languages).
\end{note}

\subsection{Getting the current language name}

\Describe\languagename{}
The control sequence |\languagename| contains the name of the
current language. 

\begin{warning}
  Due to some internal inconsistencies in catcodes, it should
  \textit{not} be used to test its value. Use \textsf{iflang}, by
  Heiko Oberdiek.
\end{warning}

\Describe\iflanguage{\marg{language}\marg{true}\marg{false}}

If more than one language is used, it might be necessary to know which
language is active at a specific time. This can be checked by a call
to |\iflanguage|, but note here ``language'' is used in the \TeX\
sense, as a set of hyphenation patterns, and \textit{not} as its
\textsf{babel} name. This macro takes three arguments.  The first
argument is the name of a language; the second and third arguments are
the actions to take if the result of the test is true or false
respectively.

\begin{warning}
  The advice about |\languagename| also applies here -- use
  \textsf{iflang} instead of |\iflanguage| if possible.
\end{warning}

\subsection{Hyphenation tools}

\Describe\babelhyphen{%
  \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}\marg{type}}
\DescribeOther\babelhyphen{%
  \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}\marg{text}}

\New{3.9a} It is customary to classify hyphens in two types: (1)
\textit{explicit} or \textit{hard hyphens}, which in \TeX\ are
entered as \verb|-|, and (2) \textit{optional} or \textit{soft
hyphens}, which are entered as \verb|\-|. Strictly, a \textit{soft
hyphen} is not a hyphen, but just a breaking oportunity or, in
\TeX\ terms, a ``discretionary''; a \textit{hard hyphen} is a hyphen
with a breaking oportunity after it. A further type is a
\textit{non-breaking hyphen}, a hyphen without a breaking
oportunity.

In \TeX, \verb|-| and \verb|\-| forbid further breaking oportunities
in the word. This is the desired behavior very often, but not always,
and therefore many languages provide shorthands for these
cases. Unfortunately, this has not been done consistently: for
example, \verb|"-| in Dutch, Portugese, Catalan or Danish is a hard
hyphen, while in German, Spanish, Norwegian, Slovak or Russian is a
soft hyphen. Furthermore, some of them even redefine |\-|, so that you
cannot insert a soft hyphen without breaking oportunities in the rest
of the word.

Therefore, some macros are provide with a set of basic ``hyphens''
which can be used by themselves, to define a user shorthand, or even
in language files.
\begin{itemize}
\item |\babelhyphen{soft}| and |\babelhyphen{hard}| are self
  explanatory.
\item |\babelhyphen{repeat}| inserts a hard hyphen which is repeated
  at the beginning of the next line, as done in languages like
  Polish, Portugese and Spanish.
\item |\babelhyphen{nobreak}| inserts a hard hyphen without a break
  after it (even if a space follows).
\item |\babelhyphen{empty}| inserts a break oportunity without
  a hyphen at all.
\item |\babelhyphen|\marg{text} is a hard ``hyphen'' using \m{text}
  instead. A typical case is |\babelhyphen{/}|.
\end{itemize}
With all of them hyphenation in the rest of the word is enabled. If
you don't want enabling it, there is a starred counterpart:
|\babelhyphen*{soft}| (which in most cases is equivalent to the
original |\-|), |\babelhyphen*{hard}|, etc.

Note |hard| is also good for isolated prefixes (eg, \textit{anti-})
and |nobreak| for isolated suffixes (eg, \textit{-ism}), but in both
cases |\babelhyphen*{nobreak}| is usually better. 

There are also some differences with \LaTeX: (1) the character used is
that set for the current font, while in \LaTeX{} it is hardwired to
|-| (a typical value); (2) the hyphen to be used in fonts with a
negative |\hyphenchar| is  |-|, like in \LaTeX, but it can be changed to
another value by redefining |\babelnullhyphen|; (3) a break after the
hyphen is forbidden if preceded by a glue ${>}0$~pt (at the beginning
of a word, provided it is not immediately preceded by, say, a
parenthesis).

\Describe\babelhyphenation{\texttt{[}\langlist\texttt{]}%
    \marg{exceptions}}

\New{3.9a} Sets hyphenation exceptions for the languages given
or, without the optional argument, for \textit{all} languages (eg,
proper nouns or common loan words, and of course monolingual
documents). Language exceptions take precedence over global ones.

It can be used only in the preamble, and exceptions are set when the
language is first selected, thus taking into account changes of
|\lccodes|'s done in |\extras|\m{lang} as well as the language specific
encoding (not set in the preamble by default). Multiple
|\babelhyphenation|'s are allowed. For example:
\begin{verbatim}
\babelhyphenation{Wal-hal-la Dar-bhan-ga}
\end{verbatim}

Listed words are saved expanded and therefore it relies on the
LICR. Of course, it also works without the LICR if the input and the
font encodings are the same, like in Unicode based engines.

\Describe\babelpatterns{\texttt{[}\langlist\texttt{]}%
    \marg{patterns}}

\New{3.9m} \textit{In \textsf{luatex} only},\footnote{With
\textsf{luatex} exceptions and patterns can be modified almost
freely. However, this is very likely a task for a separate package
and \texttt{babel} only provides the most basic tools.} adds or
replaces patterns for the languages given or, without the optional
argument, for \textit{all} languages. If a pattern for a certain
combination already exists, it gets replaced by the new one.

It can be used only in the preamble, and patterns are added when the
language is first selected, thus taking into account changes of
|\lccodes|'s done in |\extras|\m{lang} as well as the language specific
encoding (not set in the preamble by default). Multiple
|\babelpatterns|'s are allowed.

Listed patterns are saved expanded and therefore it relies on the
LICR. Of course, it also works without the LICR if the input and the
font encodings are the same, like in Unicode based engines.

\subsection{Selecting scripts}

Currently \babel{} provides no standard interface to select 
scripts, because they are best selected with either |\fontencoding|
(low level) or a language name (high level). Even the Latin script may
require different encodings (ie, sets of glyphs) depending on the
language, and therefore such a switch would be in a sense
incomplete.\footnote{The so-called Unicode fonts do not improve the
situation either. So, a font suited for Vietnamese is not necessarily
suited for, say, the romanization of Indic languages, and the fact it
contains glyphs for Modern Greek does not mean it includes them for
Classic Greek.}

Some languages sharing the same script define macros to switch it (eg,
|\textcyrillic|), but be aware they may also set the language to a
certain default. Even the \babel{} core defined |\textlatin|, but is
was somewhat buggy because in some cases it messed up encodings and
fonts (for example, if the main latin encoding was |LY1|), and
therefore it has been deprecated.\footnote{But still defined for
backwards compatibility.}

\Describe{\ensureascii}{\marg{text}}

\New{3.9i} This macro makes sure \m{text} is typeset with a
LICR-savvy encoding in the ASCII range. It is used to redefine |\TeX|
and |\LaTeX| so that they are correctly typeset even with |LGR| or
|X2| (the complete list is stored in |\BabelNonASCII|, which by default
is |LGR|, |X2|, |OT2|, |OT3|, |OT6|, |LHE|, |LWN|, |LMA|, |LMC|,
|LMS|, |LMU|, but you can modify it). So, in some sense it fixes the
bug described in the previous paragraph.

If non-ASCII encodings are not loaded (or no encoding at all), it is
no-op (also |\TeX| and |\LaTeX| are not redefined); otherwise,
|\ensureascii| switches to the encoding at the beginning of the
document if ASCII-savvy, or else the last ASCII-savvy encoding
loaded. For example, if you load |LY1,LGR|, then it is set to |LY1|,
but if you load |LY1,T2A| it is set to |T2A|. The symbol encodings
|TS1|, |T3|, and |TS3| are not taken into account, since they are not
used for ``ordinary'' text.

The foregoing rules (which are applied ``at begin document'') cover
most of cases. No asumption is made on characters above
127, which may not follow the LICR conventions -- the goal is just
to ensure most of the ASCII letters and symbols are the right ones.

\subsection{Selecting directions}
\label{bidi}

No macros to select the writing direction are provided, either --
writing direction is intrinsic to each script and therefore it is best
set by the language (which could be a dummy one). Furthermore, there
are in fact two right-to-left modes, depending on the language, which
differ in the way `weak' numeric characters are ordered (eg, Arabic
\%123 \textit{vs} Hebrew 123\%).

\begin{warning}
  Setting bidi text has many subtleties (see for example
  <https://www.w3.org/TR/html-bidi/>). \textit{This means the \babel{}
  bidi code may take some time before it is truly stable.}\footnote{A
  basic stable version for \luatex{} is planned before Summer
  2018. Other engines must wait very likely until Winter.} An effort
  is being made to avoid incompatibilities in the future (this one of
  the reason currently bidi must be explicitly requested as a package
  option, with a certain bidi model, and also the |layout| options
  described below).
\end{warning}

There are some package options controlling bidi writing.

\Describe{bidi=}{\texttt{default} $\string|$ \texttt{basic-r}}

\New{3.14} Selects the bidi algorithm to be used. With |default| the
bidi mechanism is just activated (by default it is not), but every
change must by marked up. In \xetex{} and \pdftex{} this is the only
option. In \luatex, |basic-r| provides a simple and fast method for R
text, which handles numbers and unmarked L text within an R context.

\begin{example}
  The following text comes from the Arabic Wikipedia (article about
  Arabia). Copy-pasting some text from the Wikipedia is a good way to
  test this feature, which will be improved in the future. Remember
  |basic-r| is available in \luatex{} only.\footnote{At the time of
  this writing some Arabic fonts are not rendered correctly by the
  default \luatex{} font loader, with misplaced kerns inside some
  words, so double check the resulting text. It seems a fix is on the
  way, but in the meanwhile you could have a look at the workaround
  available on GitHub, under \texttt{/required/babel/samples}}
  \begingroup
% If you are looking at the code to see how it has been written, you
% will be disappointed :-). The following example is built ad hoc to
% emulate the final result to avoid dependencies, and therefore it's
% not "real" code.
\setmonofont[Scale=.87,Script=Arabic]{DejaVu Sans Mono} \catcode`@=13
\def@#1{\ifcase#1\relax \egroup \or \bgroup\textdir TLT \else
\bgroup\textdir TRT \pardir TRT \fi}
\begin{verbatim}
\documentclass{article}

\usepackage[nil, _bidi=basic-r_]{babel}

_\babelprovide[import=ar, main]{arabic}_

\babelfont{rm}{FreeSerif}

\begin{document}

@9وقد عرفت شبه جزيرة العرب طيلة العصر الهيليني )الاغريقي( بـ
@1Arabia@0 أو @1Aravia@0 )بالاغريقية @1Αραβία@0(، استخدم الرومان ثلاث
بادئات بـ@1“Arabia”@0 على ثلاث مناطق من شبه الجزيرة العربية، إلا أنها
حقيقةً كانت أكبر مما تعرف عليه اليوم.

@0\end{document}
\end{verbatim}
\endgroup
\end{example}

\Describe{layout=}{\texttt{sectioning} $\string|$
                   \texttt{counters}  $\string|$
                   \texttt{lists}  $\string|$
                   \texttt{contents}  $\string|$
                   \texttt{footnotes}  $\string|$
                   \texttt{captions}  $\string|$
                   \texttt{columns}}

\New{3.16} \textit{To be expanded}.  Selects which layout elements are
adapted in bidi documents. You may use several options with a
comma-separated list (eg, |layout=counters.contents.sectioning|). This
list will be expanded in future releases (tables, captions,
etc.). Note not all options are required by all engines.

\begin{description}
\renewcommand\makelabel[1]{%
  \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
\itemsep=-\parskip
\item[sectioning] makes sure the sectioning macros are typeset in the
  main language, but with the title text in the current language (see
  below |\BabelPatchSection| for further details);
\item[counters] required in all engines to reorder correctly section
  numbers and the like (eg, \m{subsection}.\m{section}); required in
  \xetex{} and \pdftex{} for counters in general, as well as in
  \luatex{} with |bidi=default|; required in \luatex{} for numeric
  footnote marks $>$9;
\item[lists]  required in \xetex{} and \pdftex{}, but only in
  multilingual documents in \luatex{};
\item[contents] required in \xetex{} and \pdftex{}; in \luatex{} 
  toc entries are R by default if the main language is R;
\item[columns] required in \xetex{} and \pdftex{} to reverse the
  column order (currently only the standard two column mode); in
  \luatex{} they are R by default if the main language is R (including
  \textsf{multicol});
\item[footnotes] not required in monolingual documents, but it may be
  useful in multilingual documents in all engines; you may use
  alternatively |\BabelFootnote| described below (what this options
  does exactly is also explained there).
\item[captions] is similar to |sectioning|, but for |\caption|; not
  required in monolingual documents with \luatex{}, but may be
  required in \xetex{} and \pdftex{} in some styles (support for the
  latter two engines is still experimental); \New{3.18}
\item[tabular] required in \luatex{} for R |tabular| (it has been
  tested only with simple tables, so expect some readjustments in the
  future); ignored in \pdftex{} or \xetex{} (which will not support a
  similar option in the short term). \New{3.18}
\end{description}

\Describe{\babelsublr}{\marg{lr-text}}

Digits in \pdftex{} must be marked up explicitly (unlike \luatex{}
with |bidi=basic-r| and, usually, \xetex{}). Mainly for it (although
available in all engines, because it can be useful), this command is
provided to set \marg{lr-text} in L mode. It's intended for what
Unicode calls weak characters, because words are best set with the
corresponding language. For this reason, there is no |rl| counterpart.

\Describe{\BabelPatchSection}{\marg{section-name}}

Mainly for bidi text, but it could be useful in other
cases. |\BabelPatchSection| and the corresponding option
|layout=sectioning| takes a more logical approach (at least in many
cases) because it applies the global language to the section format
(including the |\chaptername| in |\chapter|), while the section text
is still the current language. The latter is passed to tocs and marks,
too, and with |sectioning| in |layout| they both reset the “global”
language to the main one, while the text uses the “local”
language

With |layout=sectioning| all the standard sectioning
commands are redefined, but with this command you can set them
individually if necessary (but note then tocs and marks are not
touched).

\Describe{\BabelFootnote}{\marg{cmd}\marg{local-language}%
  \marg{before}\marg{after}}

\New{3.17} Something like:
\begin{verbatim}
\BabelFootnote{\parsfootnote}{\languagename}{(}{)}
\end{verbatim}
defines |\parsfootnote| so that |\parsfootnote{note}| is equivalent to:
\begin{verbatim}
\footnote{(\foreignlanguage{\languagename}{note})}
\end{verbatim}
but the footnote itself is typeset in the main language (to unify its
direction). In addition, |\parsfootnotetext| is defined. The option
|footnotes| just does the following:
\begin{verbatim}
\BabelFootnote{\footnote}{\languagename}{}{}%
\BabelFootnote{\localfootnote}{\languagename}{}{}%
\BabelFootnote{\mainfootnote}{}{}{}
\end{verbatim}
(which also redefine |\footnotetext| and define |\localfootnotetext|
and |\mainfootnotetext|). If the language argument is empty, then no
language is selected inside the argument of the footnote. Note this
command is available always in bidi documents, even without
|layout=footnotes|.

\begin{example}
  If you want to preserve directionality in footnotes and there are
  many footnotes entirely in English, you can define:
\begin{verbatim}
\BabelFootnote{\enfootnote}{english}{}{.}
\end{verbatim}
  It adds a period outside the English part, so that it is placed
  at the left in the last line. This means the dot the end of the
  footnote text should be omitted.
\end{example}

\subsection{Language attributes}

\DescribeMacro{\languageattribute}
This is a user-level command, to be used in the preamble of a
document (after |\usepackage[...]{babel}|), that declares which
attributes are to be used for a given language. It takes two
arguments: the first is the name of the language; the second,
a (list of) attribute(s) to be used. Attributes must be set in the
preamble and only once -- they cannot be turned on and off.
The command checks whether the language is known in this document
and whether the attribute(s) are known for this language.

Very often, using a \textit{modifier} in a package option is better.

Several language definition files use their own methods to set
options. For example, \textsf{french} uses |\frenchsetup|,
\textsf{magyar} (1.5) uses |\magyarOptions|; modifiers provided by
|spanish| have no attribute counterparts. Macros settting
options are also used (eg, |\ProsodicMarksOn| in \textsf{latin}).

\subsection{Hooks}

\New{3.9a} A hook is a piece of code to be executed at certain
events. Some hooks are predefined when \luatex{} and \xetex{} are
used.

\Describe\AddBabelHook{\marg{name}\marg{event}\marg{code}}

The same name can be applied to several events.  Hooks may be enabled
and disabled for all defined events with
|\EnableBabelHook|\marg{name}, |\DisableBabelHook|\marg{name}. Names
containing the string |babel| are reserved (they are used, for
example, by |\useshortands*| to add a hook for the event
|afterextras|).

Current events are the following; in some of them you can use one to
three \TeX{} parameters (|#1|, |#2|, |#3|), with the meaning given:
\begin{description}
\renewcommand\makelabel[1]{%
  \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
\itemsep=-\parskip
\item[adddialect] (language name, dialect name) Used by
  \file{luababel.def} to load the patterns if not preloaded.
\item[patterns] (language name, language with encoding) Executed just
  after the |\language| has been set. The second argument has the
  patterns name actually selected (in the form of either |lang:ENC| or
  |lang|).
\item[hyphenation] (language name, language with encoding) Executed
  locally just before exceptions given in |\babelhyphenation| are
  actually set.
\item[defaultcommands] Used (locally) in |\StartBabelCommands|.
\item[encodedcommands] (input, font encodings) Used (locally) in
  |\StartBabelCommands|. Both \xetex{} and \luatex{} make sure the
  encoded text is read correctly.
\item[stopcommands] Used to reset the the above, if necessary.
\item[write] This event comes just after the switching commands are
  written to the |aux| file.
\item[beforeextras] Just before executing |\extras|\m{language}. This
  event and the next one should not contain language-dependent code
  (for that, add it to |\extras|\m{language}).
\item[afterextras] Just after executing |\extras|\m{language}. For
  example, the following deactivates shorthands in all languages:
\begin{verbatim}
\AddBabelHook{noshort}{afterextras}{\languageshorthands{none}}
\end{verbatim}
\item[stringprocess] Instead of a parameter, you can manipulate the
  macro |\BabelString| containing the string to be defined with
  |\SetString|. For example, to use an expanded version of the string
  in the definition, write:
\begin{verbatim}
\AddBabelHook{myhook}{stringprocess}{%
  \protected@edef\BabelString{\BabelString}}
\end{verbatim}
\item[initiateactive] (char as active, char as other, original char)
  \New{3.9i} Executed just after a shorthand has been `initiated'. The three
  parameters are the same character with different catcodes: active,
  other (|\string|'ed) and the original one.
\item[afterreset] \New{3.9i} Executed when selecting a language just after
  |\originalTeX| is run and reset to its base value, before executing
  |\captions|\m{language} and |\date|\m{language}.
\end{description}

Four events are used in \file{hyphen.cfg}, which are handled in a
quite different way for efficiency reasons -- unlike the precedent
ones, they only have a single hook and replace a default definition. 
\begin{description}
\renewcommand\makelabel[1]{%
  \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
\itemsep=-\parskip
\item[everylanguage] (language) Executed before every language patterns are loaded.
\item[loadkernel] (file) By default loads |switch.def|. It can be used
  to load a different version of this files or to load nothing.
\item[loadpatterns] (patterns file) Loads the patterns file. Used by
  \file{luababel.def}.
\item[loadexceptions] (exceptions file) Loads the exceptions
  file. Used by \file{luababel.def}.
\end{description}

\Describe\BabelContentsFiles{}
\New{3.9a} This macro contains a list of ``toc'' types 
requiring a command to switch the language. Its default value is
|toc,lof,lot|, but you may redefine it with |\renewcommand| (it's up
to you to make sure no toc type is duplicated).

\subsection{Languages supported by \babel}

In the following table most of the languages supported by \babel\ are
listed, together with the names of the option  which you can load
\babel\ with for each language. Note this list is open and the
current options may be different. It does not include |ini| files.

\begin{description}
\itemsep=-\parskip
\sffamily
\item[Afrikaans] afrikaans
\item[Azerbaijani] azerbaijani
\item[Basque] basque
\item[Breton] breton
\item[Bulgarian] bulgarian
\item[Catalan] catalan
\item[Croatian] croatian
\item[Czech] czech
\item[Danish] danish
\item[Dutch] dutch
\item[English] english, USenglish, american, UKenglish,
     british, canadian, australian, newzealand
\item[Esperanto] esperanto
\item[Estonian] estonian
\item[Finnish] finnish
\item[French] french, francais, canadien, acadian
\item[Galician] galician
\item[German] austrian, german, germanb, ngerman, naustrian
\item[Greek] greek, polutonikogreek
\item[Hebrew] hebrew
\item[Icelandic] icelandic
\item[Indonesian] bahasa, indonesian, indon, bahasai
\item[Interlingua] interlingua
\item[Irish Gaelic] irish
\item[Italian] italian
\item[Latin] latin
\item[Lower Sorbian] lowersorbian
\item[Malay] bahasam, malay, melayu
\item[North Sami] samin
\item[Norwegian] norsk, nynorsk
\item[Polish] polish
\item[Portuguese] portuges, portuguese, brazilian, brazil
\item[Romanian] romanian 
\item[Russian] russian
\item[Scottish Gaelic] scottish
\item[Spanish]  spanish
\item[Slovakian] slovak
\item[Slovenian]  slovene
\item[Swedish] swedish
\item[Serbian] serbian
\item[Turkish] turkish
\item[Ukrainian] ukrainian
\item[Upper Sorbian] uppersorbian
\item[Welsh] welsh
\end{description}

There are more languages not listed above, including \textsf{hindi,
thai, thaicjk, latvian, turkmen, magyar, mongolian, romansh,
lithuanian, spanglish, vietnamese, japanese, pinyin, arabic, farsi,
ibygreek, bgreek, serbianc, frenchle, ethiop} and \textsf{friulan}.

Most of them work out of the box, but some may require extra fonts,
encoding files, a preprocessor or even a complete framework (like
CJK).  For example, if you have got the \textsf{velthuis/devnag} package,
you can create a file with extension |.dn|:
\begin{verbatim}
\documentclass{article}
\usepackage[hindi]{babel}
\begin{document}
{\dn devaanaa.m priya.h}
\end{document}
\end{verbatim}
Then you preprocess it with |devnag| \m{file}, which creates
\m{file}|.tex|; you can then typeset the latter with \LaTeX.

\subsection{Tips, workarounds, know issues and notes}

\begin{itemize}
\item If you use the document class \cls{book} \emph{and} you use
  |\ref| inside the argument of |\chapter| (or just use |\ref| inside
  |\MakeUppercase|), \LaTeX\ will keep complaining about an undefined
  label.  To prevent such problems, you could revert to using
  uppercase labels, you can use |\lowercase{\ref{foo}}| inside the
  argument of |\chapter|, or, if you will not use shorthands in
  labels, set the |safe| option to |none| or |bib|.

\item\catcode`\|=12\relax Both \textsf{ltxdoc} and \textsf{babel} use
  \verb|\AtBeginDocument| to change some catcodes, and babel reloads
  \textsf{hhline} to make sure \verb|:| has the right one, so if you
  want to change the catcode of \verb/|/ it has to be done using the
  same method at the proper place, with
\begin{verbatim}
\AtBeginDocument{\DeleteShortVerb{\|}}
\end{verbatim}
  \textit{before} loading babel. This way, when the document begins
  the sequence is (1) make \verb/|/ active (\textsf{ltxdoc}); (2) make
  it unactive (your settings); (3) make babel shorthands active
  (\textsf{babel)}; (4) reload \textsf{hhline} (\textsf{babel}, now
  with the correct catcodes for \verb/|/ and
  \verb|:|).\catcode`\|=\active

\item Documents with several input encodings are not frequent, but
  sometimes are useful. You can set different encodings for different
  languages as the following example shows:
\begin{verbatim}
\addto\extrasfrench{\inputencoding{latin1}}
\addto\extrasrussian{\inputencoding{koi8-r}}
\end{verbatim}
   (A recent version of \textsf{inputenc} is required.)
 \item For the hyphenation to work correctly, lccodes cannot change,
   because \TeX{} only takes into account the values when the
   paragraph is hyphenated, i.e., when it has been
   finished.\footnote{This explains why \LaTeX{} assumes the lowercase
   mapping of T1 and does not provide a tool for multiple
   mappings. Unfortunately, \cs{savinghyphcodes} is not a solution
   either, because lccodes for hyphenation are frozen in the format
   and cannot be changed.} So, if you write a chunk of French text
   with |\foreinglanguage|, the apostrophes might not be taken into
   account. This is a limitation of \TeX, not of
   \babel. Alternatively, you may use |\useshorthands| to activate |'|
   and |\defineshorthand|, or redefine |\textquoteright| (the latter
   is called by the non-ASCII right quote).
\item \verb|\bibitem| is out of sync with \verb|\selectlanguage| in
  the \file{.aux} file. The reason is \verb|\bibitem| uses
  \verb|\immediate| (and others, in fact), while
  \verb|\selectlanguage| doesn't. There is no known workaround.
\item Babel does not take into account |\normalsfcodes| and
  (non-)French spacing is not always properly (un)set by
  languages. However, problems are unlikely to happen and therefore
  this part remains untouched in version 3.9 (but it is in the `to
  do' list). 
\item Using a character mathematically active (ie, with math code
  |"8000|) as a shorthand can make \TeX{} enter in an infinite loop in
  some rare cases. (Another issue in the `to do' list, although there
  is a partial solution.)
\end{itemize}

The following packages can be useful, too (the list is still
far from complete):
\begin{description}
\itemsep=-\parskip
\item[csquotes] Logical markup for quotes.
\item[iflang] Tests correctly the current language.
\item[hyphsubst] Selects a different set of patterns for a language.
\item[translator] An open platform for packages that need to be
  localized.
\item[siunitx] Typesetting of numbers and physical quantities.
\item[biblatex] Programmable bibliographies and citations.
\item[bicaption] Bilingual captions.
\item[babelbib] Multilingual bibliographies.
\item[microtype] Adjusts the typesetting according to
some languages (kerning and spacing). Ligatures can be disabled.
\item[substitutefont] Combines fonts in several encodings.
\item[mkpattern] Generates hyphenation patterns.
\item[tracklang] Tracks which languages have been requested.
\end{description}

\subsection{Current and future work}

Current work is focused on the so-called complex scripts in \luatex{}.
In 8-bit engines, \babel{} provided a basic support for bidi text as part
of the style for Hebrew, but it is somewhat unsatisfactory and
internally replaces some hardwired commands by other hardwired
commands (generic changes would be much better).

It is possible now to typeset Arabic or Hebrew with numbers and L
text.  Next on the roadmap are line breaking in Thai and the like,
as well as “non-European” digits. Also on the roadmap are R layouts
(lists, footnotes, tables, column order), page and section numbering,
and maybe kashida justification.

As to Thai line breaking, here is the basic idea of what \luatex{} can
do for us, with the Thai patterns and a little script (the final
version will not be so little, of course). It replaces each
discretionary by the equivalent to ZWJ.

\begingroup
\catcode`\_=13 \def_{\string_}
\begin{verbatim}
\documentclass{article}

\usepackage[nil]{babel}

\babelprovide[import=th, main]{thai}

\babelfont{rm}{FreeSerif}

\directlua{
local GLYF = node.id'glyph'
function insertsp (head)
  local size = 0
  for item in node.traverse(head) do
    local i = item.id
    if i == GLYF then
      f = font.getfont(item.font)
      size = f.size
    elseif i == 7 then
      local n = node.new(12, 0)
      node.setglue(n, 0, size * 1) % 1 is a factor
      node.insert_before(head, item, n)
      node.remove(head, item)
    end
  end
end

luatexbase.add_to_callback('hyphenate',
  function (head, tail)
    lang.hyphenate(head)
    insertsp(head)
  end, 'insertsp')
}

\begin{document}

(Thai text.)

\end{document}
\end{verbatim}
\endgroup

Useful additions would be, for example, time, currency, addresses and
personal names.\footnote{See for example POSIX, ISO 14652 and the
Unicode Common Locale Data Repository (CLDR). Those system, however,
have limited application to \TeX\ because their aim is just to display
information and not fine typesetting.}. But that is the easy
part, because they don't require modifying the \LaTeX{} internals.

Also interesting are differences in the sentence structure or related
to it. For example, in Basque the number precedes the name (including
chapters), in Hungarian ``from (1)'' is ``(1)-b\H{o}l'', but ``from
(3)'' is ``(3)-b\'{o}l'', in Spanish an item labelled
``3.$^{\textrm{\scriptsize o}}$'' may be referred to as either
``\'{\i}tem 3.$^{\textrm{\scriptsize o}}$'' or
``3.$^{\textrm{\scriptsize er}}$ \'{\i}tem'', and so on.

\subsection{Tentative and experimental code}

Handling of \textbf{``Unicode'' fonts} is problematic. There is
\textsf{fontspec}, but special macros are required (not only the NFSS
ones) and it doesn't provide ``orthogonal axis'' for features,
including those related to the language (mainly language and
script). A couple of tentative macros, were provided by \babel{}
($\ge$3.9g) with a partial solution. These macros are now deprecated
-- use |\babelfont|.
\begin{itemize}
\item |\babelFSstore|\marg{babel-language} sets the current three
  basic families (rm, sf, tt) as the default for the language
  given.
\item |\babelFSdefault|\marg{babel-language}\marg{fontspec-features}
  patches |\fontspec| so that the given features are always passed as
  the optional argument or added to it (not an ideal solution). 
\end{itemize}
So, for example:
\begin{verbatim}
\setmainfont[Language=Turkish]{Minion Pro}
\babelFSstore{turkish}
\setmainfont{Minion Pro}
\babelFSfeatures{turkish}{Language=Turkish}
\end{verbatim}

\textbf{Bidi writing} is taking its \textit{first steps}. 
\textit{First steps} means exactly that. For example, in \luatex{} any
Arabic text must be marked up explicitly in L mode. On the other hand,
\xetex{} poses quite different challenges. Document layout (lists,
footnotes, etc.) is not touched at all.

See the code section for |\foreignlanguage*| (a new starred version of
|\foreignlanguage|).

\xetex{} relies on the font to properly handle these unmarked changes,
so it is not under the control of \TeX.

\section{Loading languages with \file{language.dat}}

\TeX{} and most engines based on it (pdf\TeX, \xetex, $\epsilon$-\TeX,
the main exception being \luatex) require hyphenation patterns to be
preloaded when a format is created (eg, \LaTeX, Xe\LaTeX,
pdf\LaTeX). \babel{} provides a tool which has become standand in many
distributions and based on a ``configuration file'' named
\file{language.dat}. The exact way this file is used depends on the
distribution, so please, read the documentation for the latter (note
also some distributions generate the file with some tool).

\New{3.9q} With \luatex, however, patterns are loaded on the fly when
requested by the language (except the ``0th'' language, typically
\textsf{english}, which is preloaded always).\footnote{This feature
was added to 3.9o, but it was buggy. Both 3.9o and 3.9p are
deprecated.} Until 3.9n, this task was delegated to the package
\textsf{luatex-hyphen}, by Khaled Hosny, \'Elie Roux, and Manuel
P\'egouri\'e-Gonnard, and required an extra file named
|language.dat.lua|, but now a new mechanism has been devised based
solely on |language.dat|. \textbf{You must rebuild the formats} if
upgrading from a previous version.  You may want to have a local
|language.dat| for a particular project (for example, a book on
Chemistry).\footnote{The loader for lua(e)tex is slightly different as
it's not based on \babel{} but on \texttt{etex.src}. Until 3.9p it
just didn't work, but thanks to the new code it works by reloading the
data in the \babel{} way, i.e., with \texttt{language.dat}.}

\subsection{Format}

In that file the person who maintains a \TeX\ environment has to record
for which languages he has hyphenation patterns \emph{and} in which
files these are stored\footnote{This is because different operating
systems sometimes use \emph{very} different file-naming
conventions.}. When hyphenation exceptions are stored in a separate
file this can be indicated by naming that file \emph{after} the file
with the hyphenation patterns.

The file can contain empty lines and comments, as well as lines which
start with an equals (\texttt{=}) sign. Such a line will instruct
\LaTeX\ that the hyphenation patterns just processed have to be known
under an alternative name. Here is an example:
\begin{verbatim}
% File    : language.dat
% Purpose : tell iniTeX what files with patterns to load.
english    english.hyphenations
=british

dutch      hyphen.dutch exceptions.dutch % Nederlands
german hyphen.ger
\end{verbatim}

You may also set the font encoding the patterns are intended for by
following the language name by a colon and the encoding
code.\footnote{This in not a new feature, but in former versions it
didn't work correctly.} For example:
\begin{verbatim}
german:T1 hyphenT1.ger
german hyphen.ger
\end{verbatim}
With the previous settings, if the enconding when the language is
selected is |T1| then the patterns in \file{hyphenT1.ger} are
used, but otherwise use those in \file{hyphen.ger} (note the encoding
could be set in |\extras|\m{lang}).

A typical error when using \babel{} is the following:
\begin{verbatim}
No hyphenation patterns were preloaded for
the language `<lang>' into the format.
Please, configure your TeX system to add them and
rebuild the format. Now I will use the patterns
preloaded for english instead}}
\end{verbatim}
It simply means you must reconfigure \file{language.dat}, either by 
hand or with the tools provided by your distribution.

\section{The interface between the core of \babel{} and the language
definition files}

The \textit{language definition files} (ldf) must conform to a
number of conventions, because these files have to fill in the gaps
left by the common code in \file{babel.def}, i.\,e., the
definitions of the macros that produce texts.  Also the
language-switching possibility which has been built into the
\babel{} system has its implications.

The following assumptions are made:
\begin{itemize}
\item Some of the language-specific definitions might be used by plain
  \TeX\ users, so the files have to be coded so that they can be read
  by both \LaTeX\ and plain \TeX. The current format can be checked by
  looking at the value of the macro |\fmtname|.
\item The common part of the \babel{} system redefines a number of
  macros and environments (defined previously in the document style)
  to put in the names of macros that replace the previously hard-wired
  texts.  These macros have to be defined in the language definition
  files.
\item The language definition files must define five macros, used to
  activate and deactivate the language-specific definitions.  These
  macros are |\|\langvar|hyphenmins|, |\captions|\langvar,
  |\date|\langvar, |\extras|\langvar\ and |\noextras|\langvar (the
  last two may be left empty); where \langvar\ is either the name of
  the language definition file or the name of the \LaTeX\ option that
  is to be used. These macros and their functions are discussed
  below. You must define all or none for a language (or a dialect);
  defining, say, |\date|\langvar\ but not |\captions|\langvar\ does
  not raise an error but can lead to unexpected results.
\item When a language definition file is loaded, it can define
  |\l@|\langvar\ to be a dialect of |\language0| when |\l@|\langvar\
  is undefined.
\item Language names must be all lowercase. If an unknow language is
  selected, \babel{} will attempt setting it after lowercasing its
  name.
\item The semantics of modifiers is not defined (on purpose). In
  most cases, they will just be simple separated options (eg,
  \texttt{spanish}), but a language might require, say, a set of
  options organized as a tree with suboptions (in such a case, the
  recommended separator is \verb|/|).
\end{itemize}

Some recommendations:
\begin{itemize}
\item The preferred shorthand is |"|, which is not used in \LaTeX{}
  (quotes are entered as |``| and |''|). Other good choices are
  characters which are not used in a certain context (eg, |=| in an
  ancient language). Note however |=|, |<|, |>|, |:| and the like
  can be dangerous, because they may be used as part of the syntax
  of some elements (numeric expressions, key/value pairs, etc.).
\item Captions should not contain shorthands or encoding dependent
  commands (the latter is not always possible, but should be clearly
  documented). They should be defined using the LICR. You may
  also use the new tools for encoded strings, described below.
\item Avoid adding things to |\noextras|\m{lang} except for umlauthigh
  and friends, |\bbl@deactivate|, |\bbl@(non)frenchspacing|, and
  language specific macros. Use always, if possible, |\bbl@save| and
  |\bbl@savevariable| (except if you still want to have access to the
  previous value). Do not reset a macro or a setting to a hardcoded
  value. Never. Instead save its value in |\extras|\m{lang}.
\item Do not switch scripts. If you want to make sure a set of glyphs
  is used, switch either the font encoding (low level) or the language
  (high level, which in turn may switch the font encoding). Usage of things
  like |\latintext| is deprecated.\footnote{But not removed, for backward
  compatibility.}
\item Please, for ``private'' internal macros do not use the |\bbl@|
  prefix. It is used by \babel{} and it can lead to incompatibilities.
\end{itemize}

There are no special requirements for documenting your language
files. Now they are not included in the base \babel{} manual, so
provide a standalone document suited for your needs, as well as other
files you think can be useful. A PDF and a ``readme'' are strongly
recommended.

\subsection{Guidelines for contributed languages}
\label{contribute}

Now language files are “outsourced” and are located in a separate
directory (\texttt{/macros/latex/contrib/babel-contrib}), so that they
are contributed directly to CTAN (please, do not send to me language
styles just to upload them to CTAN).

Of course, placing your style files in this directory is not mandatory,
but if you want to do it, here are a few guidelines.

\begin{itemize}
\item Do not hesitate stating on the file heads you are the author and the
  maintainer, if you actually are. There is no need to state the babel
  maintainer(s) as authors if they have not contributed significantly
  to your language files. 
\item Fonts are not strictly part of a language, so they are best placed
  in the corresponding TeX tree. This includes not only \texttt{tfm}, \texttt{vf}, \texttt{ps1},
  \texttt{otf}, \texttt{mf} files and the like, but also \texttt{fd} ones.
\item Font and input encodings are usually best placed in the
  corresponding tree, too, but sometimes they belong more naturally to
  the babel style.  Note you may also need to define a LICR.
\item \Babel{} ldf files may just interface a framework, as it happens often
  with Oriental languages/scripts. This framework is best placed in its
  own directory.
\end{itemize}

The following page provides a starting point:
\texttt{http://www.texnia.com/incubator.html}.

If your need further assistance and technical advice in the
development of language styles, I am willing to help you.  And of
course, you can make any suggestion you like.

\subsection{Basic macros}

In the core of the \babel{} system, several macros are defined for use
in language definition files. Their purpose is to make a new language
known. The first two are related to hyphenation patterns.

\DescribeMacro{\addlanguage}
The macro |\addlanguage| is a non-outer version of the macro
|\newlanguage|, defined in \file{plain.tex} version~3.x. For older
versions of \file{plain.tex} and \file{lplain.tex} a substitute
definition is used. Here ``language'' is used in the \TeX{} sense of
set of hyphenation patterns.

\DescribeMacro{\adddialect}
The macro |\adddialect| can be used when two languages can (or
must) use the same hyphenation patterns. This can also be useful
for languages for which no patterns are preloaded in the
format. In such cases the default behavior of the \babel{}
system is to define this language as a `dialect' of the language
for which the patterns were loaded as |\language0|.  Here
``language'' is used in the \TeX{} sense of set of hyphenation
patterns.

\DescribeMacro{\<lang>hyphenmins}
The macro |\|\langvar|hyphenmins| is used to store the values of
the |\lefthyphenmin| and |\righthyphenmin|. Redefine this macro
to set your own values, with two numbers corresponding to these
two parameters. For example:
\begin{verbatim}
\renewcommand\spanishhyphenmins{34}
\end{verbatim}
(Assigning |\lefthyphenmin| and |\righthyphenmin| directly in
|\extras<lang>| has no effect.)

\DescribeMacro{\providehyphenmins}
The macro |\providehyphenmins| should be used in the language
definition files to set |\lefthyphenmin| and
|\righthyphenmin|. This macro will check whether these parameters
were provided by the hyphenation file before it takes any action.
If these values have been already set, this command is ignored
(currenty, default pattern files do \textit{not} set them).

\DescribeMacro{\captions\langvar}
The macro |\captions|\langvar\ defines the macros that
hold the texts to replace the original hard-wired texts.

\DescribeMacro{\date\langvar}
The macro |\date|\langvar\ defines |\today|.

\DescribeMacro{\extras\langvar}
The macro |\extras|\langvar\ contains all the extra definitions needed
for a specific language. This macro, like the following, is a hook --
you can add things to it, but it must not be used directly.

\DescribeMacro{\noextras\langvar}
Because we want to let the user switch
between languages, but we do not know what state \TeX\ might be in
after the execution of |\extras|\langvar, a macro that brings
\TeX\ into a predefined state is needed. It will be no surprise
that the name of this macro is |\noextras|\langvar.

\DescribeMacro{\bbl@declare@ttribute}
This is a command to be used in the language definition files for
declaring a language attribute. It takes three arguments: the
name of the language, the attribute to be defined, and the code
to be executed when the attribute is to be used.

\DescribeMacro{\main@language}
To postpone the activation of the definitions needed for a
language until the beginning of a document, all language
definition files should use |\main@language| instead of
|\selectlanguage|. This will just store the name of the language,
and the proper language will be activated at the start of the
document.

\DescribeMacro{\ProvidesLanguage}
The macro |\ProvidesLanguage| should be used to identify the
language definition files. Its syntax is similar to the syntax
of the \LaTeX\ command |\ProvidesPackage|.

\DescribeMacro{\LdfInit}
The macro |\LdfInit| performs a couple of standard checks that
must be made at the beginning of a language definition file,
such as checking the category code of the @-sign, preventing
the \file{.ldf} file from being processed twice, etc.

\DescribeMacro{\ldf@quit}
The macro |\ldf@quit| does work needed
if a \file{.ldf} file was processed
earlier. This includes resetting the category code
of the @-sign, preparing the language to be activated at
|\begin{document}| time, and ending the input stream.

\DescribeMacro{\ldf@finish}
The macro |\ldf@finish| does work needed
at the end of each \file{.ldf} file. This
includes resetting the category code of the @-sign,
loading a local configuration file, and preparing the language
to be activated at |\begin{document}| time.

\DescribeMacro{\loadlocalcfg}
After processing a language definition file,
\LaTeX\ can be instructed to load a local configuration
file. This file can, for instance, be used to add strings to
|\captions|\langvar\ to support local document
classes. The user will be informed that this
configuration file has been loaded. This macro is called by
|\ldf@finish|.

\DescribeMacro{\substitutefontfamily}
(Deprecated.) This command takes three arguments, a font encoding and
two font family names. It creates a font description file for the
first font in the given encoding. This \file{.fd} file will instruct
\LaTeX\ to use a font from the second family when a font from the
first family in the given encoding seems to be needed.

\subsection{Skeleton}

Here is the basic structure of an |ldf| file, with a language, a
dialect and an attribute. Strings are best defined using the method
explained in in sec. \ref{s:strings} (\babel{} 3.9 and later). 

\begin{verbatim}
\ProvidesLanguage{<language>}
     [2016/04/23 v0.0 <Language> support from the babel system]
\LdfInit{<language>}{captions<language>}

\ifx\undefined\l@<language>
  \@nopatterns{<Language>}
  \adddialect\l@<language>0
\fi

\adddialect\l@<dialect>\l@<language>

\bbl@declare@ttribute{<language>}{<attrib>}{%
  \expandafter\addto\expandafter\extras<language>
  \expandafter{\extras<attrib><language>}%
  \let\captions<language>\captions<attrib><language>}

\providehyphenmins{<language>}{\tw@\thr@@}

\StartBabelCommands*{<language>}{captions}
\SetString\chaptername{<chapter name>}
% More strings

\StartBabelCommands*{<language>}{date}
\SetString\monthiname{<name of first month>}
% More strings

\StartBabelCommands*{<dialect>}{captions}
\SetString\chaptername{<chapter name>}
% More strings

\StartBabelCommands*{<dialect>}{date}
\SetString\monthiname{<name of first month>}
% More strings

\EndBabelCommands

\addto\extras<language>{}
\addto\noextras<language>{}
\let\extras<dialect>\extras<language>
\let\noextras<dialect>\noextras<language>

\ldf@finish{<language>}
\end{verbatim}

\subsection{Support for active characters}

In quite a number of language definition files, active characters are
introduced. To facilitate this, some support macros are provided.

\DescribeMacro{\initiate@active@char}
The internal macro |\initiate@active@char| is used in language
definition files to instruct \LaTeX\ to give a character the category
code `active'. When a character has been made active it will remain
that way until the end of the document. Its definition may vary.

\DescribeMacro{\bbl@activate}
\DescribeMacro{\bbl@deactivate}
The command |\bbl@activate| is used to change the way an active
character expands. |\bbl@activate| `switches on' the active behavior
of the character. |\bbl@deactivate| lets the active character expand
to its former (mostly) non-active self.

\DescribeMacro{\declare@shorthand}
The macro |\declare@shorthand| is used to define the various
shorthands. It takes three arguments: the name for the collection of
shorthands this definition belongs to; the character (sequence) that
makes up the shorthand, i.e.\ |~| or |"a|; and the code to be executed
when the shorthand is encountered. (It does \textit{not} raise an
error if the shorthand character has not been ``initiated''.)

\DescribeMacro{\bbl@add@special}
\DescribeMacro{\bbl@remove@special}
The \TeX book states: ``Plain \TeX\ includes a macro called
|\dospecials| that is essentially a set macro, representing the set of
all characters that have a special category code.'' \cite[p.~380]{DEK}
It is used to set text `verbatim'.  To make this work if more
characters get a special category code, you have to add this character
to the macro |\dospecial|.  \LaTeX\ adds another macro called
|\@sanitize| representing the same character set, but without the
curly braces.  The macros |\bbl@add@special|\meta{char} and
|\bbl@remove@special|\meta{char} add and remove the character
\meta{char} to these two sets.

\subsection{Support for saving macro definitions}

Language definition files may want to \emph{re}define macros that
already exist. Therefore a mechanism for saving (and restoring) the
original definition of those macros is provided. We provide two macros
for this\footnote{This mechanism was introduced by Bernd Raichle.}.

\DescribeMacro{\babel@save}
To save the current meaning of any control sequence, the macro
|\babel@save| is provided. It takes one argument, \meta{csname}, the
control sequence for which the meaning has to be saved.

\DescribeMacro{\babel@savevariable}
A second macro is provided to save the current value of a variable.
In this context, anything that is allowed after the |\the| primitive
is considered to be a variable. The macro takes one argument, the
\meta{variable}.

The effect of the preceding macros is to append a piece of code to
the current definition of |\originalTeX|. When |\originalTeX| is
expanded, this code restores the previous definition of the control
sequence or the previous value of the variable.

\subsection{Support for extending macros}

\DescribeMacro{\addto}
The macro |\addto{|\meta{control sequence}|}{|\meta{\TeX\ code}|}| can
be used to extend the definition of a macro. The macro need not be
defined (ie, it can be undefined or |\relax|). This macro can, for
instance, be used in adding instructions to a macro like
|\extrasenglish|.

Be careful when using this macro, because depending on the case the
assignment could be either global (usually) or local (sometimes). That
does not seem very consistent, but this behavior is preserved for
backward compatibility. If you are using \pkg{etoolbox}, by Philipp
Lehman, consider using the tools provided by this package instead of
|\addto|.

\subsection{Macros common to a number of languages}

\DescribeMacro{\bbl@allowhyphens}
In several languages compound words are used. This means that when
\TeX\ has to hyphenate such a compound word, it only does so at the
`\texttt{-}' that is used in such words. To allow hyphenation in the
rest of such a compound word, the macro |\bbl@allowhyphens| can be
used.

\DescribeMacro{\allowhyphens}
Same as |\bbl@allowhyphens|, but does nothing if the encoding is
|T1|. It is intended mainly for characters provided as real glyphs by
this encoding but constructed with |\accent| in |OT1|.

Note the previous command (|\bbl@allowhyphens|) has different
applications (hyphens and discretionaries) than this one (composite
chars). Note also prior to version 3.7, |\allowhyphens| had the
behavior of |\bbl@allowhyphens|.

\DescribeMacro{\set@low@box}
For some languages, quotes need to be lowered to the baseline. For
this purpose the macro |\set@low@box| is available. It takes one
argument and puts that argument in an |\hbox|, at the baseline. The
result is available in |\box0| for further processing.

\DescribeMacro{\save@sf@q}
Sometimes it is necessary to preserve the |\spacefactor|.  For this
purpose the macro |\save@sf@q| is available. It takes one argument,
saves the current spacefactor, executes the argument, and restores the
spacefactor.

\DescribeMacro{\bbl@frenchspacing}
\DescribeMacro{\bbl@nonfrenchspacing}
The commands |\bbl@frenchspacing| and |\bbl@nonfrenchspacing| can be
used to properly switch French spacing on and off.

\subsection{Encoding-dependent strings}
\label{s:strings}

\New{3.9a} Babel 3.9 provides a way of defining strings in several
encodings, intended mainly for \luatex{} and \xetex. This is the only new
feature requiring changes in language files if you want to make use of
it.

Furthermore, it must be activated explicitly, with the package option
|strings|. If there is no |strings|, these blocks are ignored, except
|\SetCase|s (and except if forced as described below). In other words,
the old way of defining/switching strings still works and it's used by
default.

It consist is a series of blocks started with
|\StartBabelCommands|. The last block is closed with
|\EndBabelCommands|. Each block is a single group (ie, local
declarations apply until the next |\StartBabelCommands| or
|\EndBabelCommands|). An |ldf| may contain several series of this
kind.

Thanks to this new feature, string values and string language
switching are not mixed any more. No need of |\addto|. If the language
is |french|, just redefine |\frenchchaptername|.

\Describe\StartBabelCommands
  {\marg{language-list}\marg{category}\oarg{selector}}

The \m{language-list} specifies which languages the block is
intended for. A block is taken into account only if the
|\CurrentOption| is listed here. Alternatively, you can define
|\BabelLanguages| to a comma-separated list of languages to be
defined (if undefined, |\StartBabelCommands| sets it to
|\CurrentOption|). You may write |\CurrentOption| as the language,
but this is discouraged -- a explicit name (or names) is much better
and clearer.

A ``selector'' is a name to be used as value in package option
|strings|, optionally followed by extra info about the encodings to be
used. The name |unicode| must be used for \xetex{} and \luatex{} (the
key |strings| has also other two special values: |generic| and
|encoded|).

If a string is set several times (because several blocks are read),
the first one take precedence (ie, it works much like
|\providecommand|).

Encoding info is |charset=| followed by a charset, which if given sets
how the strings should be traslated to the internal representation
used by the engine, typically |utf8|, which is the only value
supported currently (default is no traslations). Note |charset| is
applied by \luatex{} and \xetex{} when reading the file, not when the
macro or string is used in the document.

A list of font encodings which the strings are expected to work with
can be given after |fontenc=| (separated with spaces, if two or more) --
recommended, but not mandatory, although blocks without this key are
not taken into account if you have requested |strings=encoded|.

Blocks without a selector are read always if the key |strings| has
been used.  They provide fallback values, and therefore must be the
last blocks; they should be provided always if possible and all
strings should be defined somehow inside it; they can be the only
blocks (mainly LGC scripts using the LICR). Blocks without a selector
can be activated explicitly with |strings=generic| (no block is taken
into account except those). With |strings=encoded|, strings in those
blocks are set as default (internally, |?|). With |strings=encoded|
strings are protected, but they are correctly expanded in
|\MakeUppercase| and the like. If there is no key |strings|, string
definitions are ignored, but |\SetCase|s are still honoured (in a
|encoded| way).

The \m{category} is either |captions|, |date| or |extras|. You must
stick to these three categories, even if no error is raised when using
other name.\footnote{In future releases further categories may be
added.\nb{like `monetary', `time', `address', `name', `case' or
`numeric'}} It may be empty, too, but in such a case using
|\SetString| is an error (but not |\SetCase|).

\begin{verbatim}
\StartBabelCommands{language}{captions}
  [unicode, fontenc=TU EU1 EU2, charset=utf8]
\SetString{\chaptername}{utf8-string}

\StartBabelCommands{language}{captions}
\SetString{\chaptername}{ascii-maybe-LICR-string}

\EndBabelCommands
\end{verbatim}

A real example is:
\begin{verbatim}
\StartBabelCommands{austrian}{date}
  [unicode, fontenc=TU EU1 EU2, charset=utf8]
  \SetString\monthiname{Jänner}

\StartBabelCommands{german,austrian}{date}
  [unicode, fontenc=TU EU1 EU2, charset=utf8]
  \SetString\monthiiiname{März}

\StartBabelCommands{austrian}{date}
  \SetString\monthiname{J\"{a}nner}

\StartBabelCommands{german}{date}
  \SetString\monthiname{Januar}

\StartBabelCommands{german,austrian}{date}
  \SetString\monthiiname{Februar}
  \SetString\monthiiiname{M\"{a}rz}
  \SetString\monthivname{April}
  \SetString\monthvname{Mai}
  \SetString\monthviname{Juni}
  \SetString\monthviiname{Juli}
  \SetString\monthviiiname{August}
  \SetString\monthixname{September}
  \SetString\monthxname{Oktober}
  \SetString\monthxiname{November}
  \SetString\monthxiiname{Dezenber}
  \SetString\today{\number\day.~%
    \csname month\romannumeral\month name\endcsname\space
    \number\year}

\StartBabelCommands{german,austrian}{captions}
  \SetString\prefacename{Vorwort}
  [etc.]

\EndBabelCommands
\end{verbatim}

When used in |ldf| files, previous values of |\|\m{category}\m{language}
are overriden, which means the old way to define strings still works
and used by default (to be precise, is first set to undefined and then
strings are added). However, when used in the preamble or in a
package, new settings are added to the previous ones, if the language
exists (in the \babel{} sense, ie, if |\date|\m{language} exists).

\Describe\StartBabelCommands{%
  \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}%
  \marg{language-list}\marg{category}\oarg{selector}}
The starred version just forces |strings| to take a value -- if not set
as package option, then the default for the engine is used. This is
not done by default to prevent backward incompatibilities, but if you
are creating a new language this version is better. It's up to
the maintainers of the current languages to decide if using it is
appropiate.\footnote{This replaces in 3.9g a short-lived
\texttt{\string\UseStrings} which has been removed because it did
not work.}

\Describe\EndBabelCommands{}
Marks the end of the series of blocks.

\Describe\AfterBabelCommands{\marg{code}}
The code is delayed and executed at the global scope just after |\EndBabelCommands|.

\Describe\SetString{\marg{macro-name}\marg{string}}
Adds \meta{macro-name} to the current category, and defines globally
\meta{lang-macro-name} to \meta{code} (after applying the
transformation corresponding to the current charset or defined with
the hook |stringprocess|).

Use this command to define strings, without including any ``logic'' if
possible, which should be a separated macro. See the example above for
the date.

\Describe\SetStringLoop{\marg{macro-name}\marg{string-list}}
A convenient way to define several ordered names at once. For example,
to define |\abmoniname|, |\abmoniiname|, etc. (and similarly with
|abday|):
\begin{verbatim}
\SetStringLoop{abmon#1name}{en,fb,mr,ab,my,jn,jl,ag,sp,oc,nv,dc}
\SetStringLoop{abday#1name}{lu,ma,mi,ju,vi,sa,do}
\end{verbatim}
|#1| is replaced by the roman numeral.

\Describe\SetCase{\oarg{map-list}\marg{toupper-code}\marg{tolower-code}}
Sets globally code to be executed at |\MakeUppercase| and
|\MakeLowercase|. The code would be typically things like |\let\BB\bb|
and |\uccode| or |\lccode| (although for the reasons explained above,
changes in lc/uc codes may not work). A \meta{map-list} is a series of
macros using the internal format of |\@uclclist| (eg,
|\bb\BB\cc\CC|). The mandatory arguments take precedence over the
optional one. This command, unlike |\SetString|, is executed always
(even without |strings|), and it is intented for minor readjustments
only.

For example, as |T1| is the default case mapping in \LaTeX, we could
set for Turkish:
\begin{verbatim}
\StartBabelCommands{turkish}{}[ot1enc, fontenc=OT1]
\SetCase
  {\uccode"10=`I\relax}
  {\lccode`I="10\relax}

\StartBabelCommands{turkish}{}[unicode, fontenc=TU EU1 EU2, charset=utf8]
\SetCase
  {\uccode`i=`İ\relax
   \uccode`ı=`I\relax}
  {\lccode`İ=`i\relax
   \lccode`I=`ı\relax}

\StartBabelCommands{turkish}{}
\SetCase
  {\uccode`i="9D\relax
   \uccode"19=`I\relax}
  {\lccode"9D=`i\relax
   \lccode`I="19\relax}

\EndBabelCommands
\end{verbatim}
(Note the mapping for |OT1| is not complete.)

\Describe\SetHyphenMap{\marg{to-lower-macros}}
\New{3.9g} Case mapping serves in \TeX{} for two unrelated purposes: case
transforms (upper/lower) and hyphenation. |\SetCase| handles the
former, while hyphenation is handled by |\SetHyphenMap| and controlled
with the package option |hyphenmap|. So, even if internally they are based
on the same \TeX{} primitive (|\lccode|), \babel{} sets them separately.

There are three helper macros to
be used inside |\SetHyphenMap|:
\begin{itemize}
\item |\BabelLower|\marg{uccode}\marg{lccode} is
  similar to |\lccode| but it's ignored if the char has been set and
  saves the original lccode to restore it when switching the language
  (except with |hyphenmap=first|).
\item |\BabelLowerMM|\marg{uccode-from}\marg{uccode-to}%
  \marg{step}\marg{lccode-from} loops though the given uppercase
  codes, using the step, and assigns them the lccode, which is also
  increased (|MM| stands for \textit{many-to-many}).
\item |\BabelLowerMO|\marg{uccode-from}\marg{uccode-to}%
  \marg{step}\marg{lccode} loops though the given uppercase
  codes, using the step, and assigns them the lccode, which is fixed
  (|MO| stands for \textit{many-to-one}).
\end{itemize}
An example is (which is redundant, because these assignments are done
by both \luatex{} and \xetex{}):
\begin{verbatim}
\SetHyphenMap{\BabelLowerMM{"100}{"11F}{2}{"101}}
\end{verbatim}

This macro is not intended to fix wrong mappings done by Unicode
(which are the default in both \xetex{} and \luatex{}) -- if an
assignment is wrong, fix it directly.


\section{Changes}

\subsection{Changes in \babel\ version 3.9}

Most of changes in version 3.9 are related to bugs, either to fix them
(there were lots), or to provide some alternatives. Even new features
like |\babelhyphen| are intended to solve a certain problem (in this
case, the lacking of a uniform syntax and behavior for shorthands
across languages). These changes are described in this manual in the
corresponding place. A selective list follows:
\begin{itemize}
\item |\select@language| did not set |\languagename|. This meant the
  language in force when auxiliary files were loaded was the one used
  in, for example, shorthands -- if the language was |german|, a
  |\select@language{spanish}| had no effect.

\item |\foreignlanguage| and |otherlanguage*| messed up
  |\extras<language>|. Scripts, encodings and many other things were
  not switched correctly.

\item The |:ENC| mechanism for hyphenation patterns used the encoding
  of the \textit{previous} language, not that of the language being
  selected.

\item |'| (with |activeacute|) had the original value when writing to an
  auxiliary file, and things like an infinite loop could happen. It
  worked incorrectly with |^| (if activated) and also if deactivated.

\item Active chars where not reset at the end of language options, and
  that lead to incompatibilities between languages.

\item |\textormath| raised and error with a conditional.

\item |\aliasshorthand| didn't work (or only in a few and very specific
  cases).

\item |\l@english| was defined incorrectly (using |\let| instead of
  |\chardef|).

\item |ldf| files not bundled with babel were not recognized when
  called as global options.
\end{itemize}

\subsection{Changes in \babel\ version 3.7}

In \babel\ version 3.7 a number of bugs that were found in
version~3.6 are fixed. Also a number of changes and additions
have occurred:
\begin{itemize}
\item Shorthands are expandable again. The disadvantage is that
  one has to type |'{}a| when the acute accent is used as a
  shorthand character. The advantage is that a number of other
  problems (such as the breaking of ligatures, etc.) have
  vanished.
\item Two new commands, |\shorthandon| and |\shorthandoff| have
  been introduced to enable to temporarily switch off one or more
  shorthands.
\item Support for typesetting Hebrew (and potential support for
  typesetting other right-to-left written languages) is now
  available thanks to Rama Porrat and Boris Lavva.
\item A language attribute has been added to the |\mark...|
  commands in order to make sure that a Greek header line comes
  out right on the last page before a language switch.
\item Hyphenation pattern files are now read \emph{inside a
  group}; therefore any changes a pattern file needs to make to
  lowercase codes, uppercase codes, and category codes are kept
  local to that group. If they are needed for the language, these
  changes will need to be repeated and stored in |\extras...|
\item The concept of language attributes is introduced. It is intended
  to give the user some control over the features a
  language-definition file provides. Its first use is for the Greek
  language, where the user can choose the πολυτονικό (``polytonikó'' or
  multi-accented) Greek way of typesetting texts.
\item The environment \Lenv{hyphenrules} is introduced.
\item The syntax of the file \file{language.dat} has been
  extended to allow (optionally) specifying the font
  encoding to be used while processing the patterns file.
\item The command |\providehyphenmins| should now be used in
  language definition files in order to be able to keep any
  settings provided by the pattern file.
\end{itemize}

\DocInput{babel.dtx}

\section{Acknowledgements}

I would like to thank all who volunteered as $\beta$-testers for their
time. Michel Goossens supplied contributions for most of the other
languages.  Nico Poppelier helped polish the text of the documentation
and supplied parts of the macros for the Dutch language.  Paul Wackers
and Werenfried Spit helped find and repair bugs.

During the further development of the babel system I received much
help from Bernd Raichle, for which I am grateful.

\begin{thebibliography}{9}
 \bibitem{AT} Huda Smitshuijzen Abifares, \textit{Arabic Typography},
   Saqi, 2001.
 \bibitem{DEK} Donald E. Knuth,
   \emph{The \TeX book}, Addison-Wesley, 1986.
 \bibitem{LLbook} Leslie Lamport,
    \emph{\LaTeX, A document preparation System}, Addison-Wesley,
    1986.
 \bibitem{treebus} K.F. Treebus.
    \emph{Tekstwijzer, een gids voor het grafisch verwerken van
    tekst.}
    SDU Uitgeverij ('s-Gravenhage, 1988). 
 \bibitem{HP} Hubert Partl,
   \emph{German \TeX}, \emph{TUGboat} 9 (1988) \#1, p.~70--72.
  \bibitem{LLth} Leslie Lamport,
    in: \TeX hax Digest, Volume 89, \#13, 17 February 1989.
 \bibitem{BEP} Johannes Braams, Victor Eijkhout and Nico Poppelier,
   \emph{The development of national \LaTeX\ styles},
   \emph{TUGboat} 10 (1989) \#3, p.~401--406.
 \bibitem{FE} Yannis Haralambous,
    \emph{Fonts \& Encodings}, O'Reilly, 2007.
 \bibitem{ilatex} Joachim Schrod,
   \emph{International \LaTeX\ is ready to use},
   \emph{TUGboat} 11 (1990) \#1, p.~87--90.
 \bibitem{STS} Apostolos Syropoulos, Antonis Tsolomitis and Nick
   Sofroniu,  
   \emph{Digital typography using \LaTeX},
   Springer, 2002, p.~301--373.
\end{thebibliography}
\end{document}
%</filedriver>
%
% \fi
%
% \changes{babel~3.8e}{2005/03/24}{Many enhancements to the text by
%    Andrew Young} 
% \changes{babel~3.9c}{2013/04/04}{Added the ``modifiers'' mechanism}
% \changes{babel~3.9g}{2013/06/01}{bbplain merged}
% \changes{babel~3.9k}{2014/03/23}{Code and doc reorganized, and some
%    minor enhancements}
%
%\begingroup
%  \catcode`<=\active%
%  \catcode`>=\active
%  \makeatletter
%  \gdef\MakePrivateLetters{%
%    \catcode`@=11\relax
%    \gdef<##1{\ifx##1@$\langle\langle$\bgroup\itshape\rmfamily
%      \expandafter\bblref
%      \else\string<##1\fi}%
%    \gdef\bblref##1@>{##1\/\egroup$\rangle\rangle$}}%
%  \global\let\check@percent\saved@check@percent
%\endgroup
%
% \part{The code}
%
% \babel{} is being developed incrementally, which means parts of the
% code are under development and therefore incomplete. Only documented
% features are considered complete. In other words, use \babel{} only
% as documented (except, of course, if you want to explore and test
% them -- you can post suggestions about multilingual issues to
% |kadingira@tug.org| on |http://tug.org/mailman/listinfo/kadingira|). 
%
% \section{Identification and loading of required files}
%
%    \textit{Code documentation is still under revision.}
%
%    The \babel{} package after unpacking consists of the following files:
%    \begin{description}
%    \itemsep=-\parskip
%    \item[switch.def] defines macros to set and switch languages.
%    \item[babel.def] defines the rest of macros. It has tow parts: a
%    generic one and a second one only for LaTeX{}.
%    \item[babel.sty] is the \LaTeX{} package, which set options and
%    load language styles.
%  \item[plain.def] defines some \LaTeX{} macros required by
%    \file{babel.def} and provides a few tools for Plain.
%   \item[hyphen.cfg] is the file to be used when generating the
%    formats to load hyphenation patterns. By default it also loads
%    \file{switch.def}.
%    \end{description}
%
%    The \babel{} installer extends \textsf{docstrip} with a few
%    ``pseudo-guards'' to set ``variables'' used at installation time.
%    They are used with |<||@name@>| at the appropiated places in the
%    source code and shown below with
%    $\langle\langle$\textit{name}$\rangle\rangle$. That brings a
%    little bit of literate programming.
%
%    \begin{macrocode}
%<<version=3.18>>
%<<date=2018/02/14>>
%    \end{macrocode}
%
% \section{Tools}
%
% \textbf{Do not use the following macros in ldf files. They may
% change in the future}. This applies mainly to those recently added
% for replacing, trimming and looping. The older ones, like
% |\bbl@afterfi|, will not change.
%
% \changes{babel~3.9t}{2017/04/22}{Added new helper macros. Not all are
%   currently used, but will be in 3.10 -- \cs{bbl@trim},
%   \cs{bbl@ifunset}, \cs{bbl@exp}, \cs{bbl@stripslash}}
%
%    We define some basic macros which just make the code cleaner.
%    |\bbl@add| is now used internally instead of |\addto| because of
%    the unpredictable behavior of the latter. Used in
%    \file{babel.def} and in \file{babel.sty}, which means in \LaTeX{}
%    is executed twice, but we need them when defining options and
%    \file{babel.def} cannot be load until options have been defined.
%    This does not hurt, but should be fixed somehow.
%
% \changes{babel~3.9i}{2014/02/16}{\cs{@for} didn't work with
%    Plain. Added \cs{bbl@loop}}
% \changes{babel~3.15}{2017/10/30}{New convenience macros
%   \cs{bbl@xin@} and \cs{bbl@cs}}
%
%    \begin{macrocode}
%<<*Basic macros>>
\bbl@trace{Basic macros}
\def\bbl@stripslash{\expandafter\@gobble\string}
\def\bbl@add#1#2{%
  \bbl@ifunset{\bbl@stripslash#1}%
    {\def#1{#2}}%
    {\expandafter\def\expandafter#1\expandafter{#1#2}}}
\def\bbl@xin@{\@expandtwoargs\in@}
\def\bbl@csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}%
\def\bbl@cs#1{\csname bbl@#1\endcsname}
\def\bbl@loop#1#2#3{\bbl@@loop#1{#3}#2,\@nnil,}
\def\bbl@loopx#1#2{\expandafter\bbl@loop\expandafter#1\expandafter{#2}}
\def\bbl@@loop#1#2#3,{%
  \ifx\@nnil#3\relax\else
    \def#1{#3}#2\bbl@afterfi\bbl@@loop#1{#2}%
  \fi}
\def\bbl@for#1#2#3{\bbl@loopx#1{#2}{\ifx#1\@empty\else#3\fi}}
%    \end{macrocode}
%
% \changes{babel~3.9t}{2017/04/22}{Use \cs{bbl@ifunset} instead of
%    \cs{@ifundefined}.}
%
%  \begin{macro}{\bbl@add@list}
%    This internal macro adds its second argument to a comma
%    separated list in its first argument. When the list is not
%    defined yet (or empty), it will be initiated. It presumes
%    expandable character strings.
%
% \changes{babel~3.9t}{2017/04/22}{Redefined to avoid infinite loops
%    if the macro is \cs{relax}.}
%
%    \begin{macrocode}
\def\bbl@add@list#1#2{%
  \edef#1{%
    \bbl@ifunset{\bbl@stripslash#1}%
      {}%
      {\ifx#1\@empty\else#1,\fi}%
    #2}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@afterelse}
%  \begin{macro}{\bbl@afterfi}
%    Because the code that is used in the handling of active
%    characters may need to look ahead, we take extra care to `throw'
%    it over the |\else| and |\fi| parts of an
%    |\if|-statement\footnote{This code is based on code presented in
%    TUGboat vol. 12, no2, June 1991 in ``An expansion Power Lemma''
%    by Sonja Maus.}. These macros will break if another |\if...\fi|
%    statement appears in one of the arguments and it is not enclosed
%    in braces.
%
%    \begin{macrocode}
\long\def\bbl@afterelse#1\else#2\fi{\fi#1}
\long\def\bbl@afterfi#1\fi{\fi#1}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
% \begin{macro}{\bbl@trim}
%   The following piece of code is stolen (with some changes) from
%   \textsf{keyval}, by David Carlisle. It defines two macros:
%   |\bbl@trim| and |\bbl@trim@def|. The first one strips the leading
%   and trailing spaces from the second argument and then applies the
%   first argument (a macro, |\toks@| and the like). The second one,
%   as its name suggests, defines the first argument as the stripped
%   second argument.
%
%    \begin{macrocode}
\def\bbl@tempa#1{%
  \long\def\bbl@trim##1##2{%
    \futurelet\bbl@trim@a\bbl@trim@c##2\@nil\@nil#1\@nil\relax{##1}}%
  \def\bbl@trim@c{%
    \ifx\bbl@trim@a\@sptoken
      \expandafter\bbl@trim@b
    \else
      \expandafter\bbl@trim@b\expandafter#1%
    \fi}%
  \long\def\bbl@trim@b#1##1 \@nil{\bbl@trim@i##1}}
\bbl@tempa{ }
\long\def\bbl@trim@i#1\@nil#2\relax#3{#3{#1}}
\long\def\bbl@trim@def#1{\bbl@trim{\def#1}}
%    \end{macrocode}
% \end{macro}
% 
%
% \begin{macro}{\bbl@ifunset}
%   To check if a macro is defined, we create a new macro, which does
%   the same as |\@ifundefined|. However, in an $\epsilon$-tex engine,
%   it is based on |\ifcsname|, which is more efficient, and do not
%   waste memory.
%
%    \begin{macrocode}
\def\bbl@ifunset#1{%
  \expandafter\ifx\csname#1\endcsname\relax
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi}
\bbl@ifunset{ifcsname}%
  {}%
  {\def\bbl@ifunset#1{%
     \ifcsname#1\endcsname
       \expandafter\ifx\csname#1\endcsname\relax
         \bbl@afterelse\expandafter\@firstoftwo
       \else
         \bbl@afterfi\expandafter\@secondoftwo
       \fi
     \else
       \expandafter\@firstoftwo
     \fi}}
%    \end{macrocode}
% \end{macro}
%    
% \begin{macro}{\bbl@ifblank}
%   A tool from \textsf{url}, by Donald Arseneau, which tests if a
%   string is empty or space.
%
%    \begin{macrocode}
\def\bbl@ifblank#1{%
  \bbl@ifblank@i#1\@nil\@nil\@secondoftwo\@firstoftwo\@nil}
\long\def\bbl@ifblank@i#1#2\@nil#3#4#5\@nil{#4}
%    \end{macrocode}
% \end{macro}
%
% For each element in the comma separated <key>|=|<value> list,
% execute <code> with |#1| and |#2| as the key and the value of
% current item (trimmed). In addition, the item is passed verbatim as
% |#3|. With the <key> alone, it passes |\@empty| (ie, the macro thus
% named, not an empty argument, which is what you get with <key>|=|
% and no value).
%
%    \begin{macrocode}
\def\bbl@forkv#1#2{%
  \def\bbl@kvcmd##1##2##3{#2}%
  \bbl@kvnext#1,\@nil,}
\def\bbl@kvnext#1,{%
  \ifx\@nil#1\relax\else
    \bbl@ifblank{#1}{}{\bbl@forkv@eq#1=\@empty=\@nil{#1}}%
    \expandafter\bbl@kvnext
  \fi}
\def\bbl@forkv@eq#1=#2=#3\@nil#4{%
  \bbl@trim@def\bbl@forkv@a{#1}%
  \bbl@trim{\expandafter\bbl@kvcmd\expandafter{\bbl@forkv@a}}{#2}{#4}}
%    \end{macrocode}
%
% A \textit{for} loop. Each item (trimmed), is |#1|.  It cannot be
% nested (it's doable, but we don't need it).
%
%    \begin{macrocode}
\def\bbl@vforeach#1#2{%
  \def\bbl@forcmd##1{#2}%
  \bbl@fornext#1,\@nil,}
\def\bbl@fornext#1,{%
  \ifx\@nil#1\relax\else
    \bbl@ifblank{#1}{}{\bbl@trim\bbl@forcmd{#1}}%
    \expandafter\bbl@fornext
  \fi}
\def\bbl@foreach#1{\expandafter\bbl@vforeach\expandafter{#1}}
%    \end{macrocode}
%
% \begin{macro}{\bbl@replace}
%
%    \begin{macrocode}
\def\bbl@replace#1#2#3{% in #1 -> repl #2 by #3
  \toks@{}%
  \def\bbl@replace@aux##1#2##2#2{%
    \ifx\bbl@nil##2%
      \toks@\expandafter{\the\toks@##1}%
    \else
      \toks@\expandafter{\the\toks@##1#3}%
      \bbl@afterfi
      \bbl@replace@aux##2#2%
    \fi}%
  \expandafter\bbl@replace@aux#1#2\bbl@nil#2% 
  \edef#1{\the\toks@}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bbl@exp}
%
%   Now, just syntactical sugar, but it makes partial expansion of
%   some code a lot more simple and readable. Here |\\| stands for
%   |\noexpand| and |\<..>| for |\noexpand| applied to a built macro
%   name (the latter does not define the macro if undefined to
%   |\relax|, because it is created locally). The result may be
%   followed by extra arguments, if necessary.
%
%    \begin{macrocode}
\def\bbl@exp#1{%
  \begingroup
    \let\\\noexpand
    \def\<##1>{\expandafter\noexpand\csname##1\endcsname}%
    \edef\bbl@exp@aux{\endgroup#1}%
  \bbl@exp@aux}
%    \end{macrocode}
% \end{macro}
% 
% Two further tools.  |\bbl@samestring| first expand its arguments and
% then compare their expansion (sanitized, so that the catcodes do not
% matter). |\bbl@engine| takes the following values: 0 is pdf\TeX, 1
% is \luatex, and 2 is \xetex. You may use the latter it in your
% language style if you want.
%
%    \begin{macrocode}
\def\bbl@ifsamestring#1#2{%
  \begingroup
    \protected@edef\bbl@tempb{#1}%
    \edef\bbl@tempb{\expandafter\strip@prefix\meaning\bbl@tempb}%
    \protected@edef\bbl@tempc{#2}%
    \edef\bbl@tempc{\expandafter\strip@prefix\meaning\bbl@tempc}%
    \ifx\bbl@tempb\bbl@tempc
      \aftergroup\@firstoftwo
    \else
      \aftergroup\@secondoftwo
    \fi
  \endgroup}
\chardef\bbl@engine=%
  \ifx\directlua\@undefined
    \ifx\XeTeXinputencoding\@undefined
      \z@
    \else
      \tw@
    \fi
  \else
    \@ne
  \fi
%<</Basic macros>>
%    \end{macrocode}
%
% Some files identify themselves with a \LaTeX{} macro. The following
% code is placed before them to define (and then undefine) if not in
% \LaTeX.
%
%    \begin{macrocode}
%<<*Make sure ProvidesFile is defined>>
\ifx\ProvidesFile\@undefined
  \def\ProvidesFile#1[#2 #3 #4]{%
    \wlog{File: #1 #4 #3 <#2>}%
    \let\ProvidesFile\@undefined}
\fi
%<</Make sure ProvidesFile is defined>>
%    \end{macrocode}
%
% The following code is used in \file{babel.sty} and
% \file{babel.def}, and loads (only once) the data in |language.dat|.
%
%    \begin{macrocode}
%<<*Load patterns in luatex>>
\ifx\directlua\@undefined\else
  \ifx\bbl@luapatterns\@undefined
    \input luababel.def
  \fi
\fi
%<</Load patterns in luatex>>
%    \end{macrocode}
%
%    The following code is used in \file{babel.def} and
%    \file{switch.def}.
%
%    \begin{macrocode}
%<<*Load macros for plain if not LaTeX>>
\ifx\AtBeginDocument\@undefined
  \input plain.def\relax
\fi
%<</Load macros for plain if not LaTeX>>
%    \end{macrocode}
%
% \subsection{Multiple languages}
%
%  \begin{macro}{\language}
%    Plain \TeX\ version~3.0 provides the primitive |\language| that
%    is used to store the current language. When used with a pre-3.0
%    version this function has to be implemented by allocating a
%    counter. The following block is used in \file{switch.def} and
%    \file{hyphen.cfg}; the latter may seem redundant, but remember
%    \babel{} doesn't requires loading \file{switch.def} in the format.
%
%    \begin{macrocode}
%<<*Define core switching macros>>
\ifx\language\@undefined
  \csname newcount\endcsname\language
\fi
%<</Define core switching macros>>
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\last@language}
%    Another counter is used to store the last language defined.  For
%    pre-3.0 formats an extra counter has to be allocated.
%
%  \begin{macro}{\addlanguage}
%
%    To add languages to \TeX's memory plain \TeX\ version~3.0
%    supplies |\newlanguage|, in a pre-3.0 environment a similar macro
%    has to be provided. For both cases a new macro is defined here,
%    because the original |\newlanguage| was defined to be |\outer|.
%
%    For a format based on plain version~2.x, the definition of
%    |\newlanguage| can not be copied because |\count 19| is used for
%    other purposes in these formats. Therefore |\addlanguage| is
%    defined using a definition based on the macros used to define
%    |\newlanguage| in plain \TeX\ version~3.0.
%
%    For formats based on plain version~3.0 the definition of
%    |\newlanguage| can be simply copied, removing |\outer|.
%    Plain \TeX\ version 3.0 uses |\count 19| for this purpose.
%
%    \begin{macrocode}
%<<*Define core switching macros>>
\ifx\newlanguage\@undefined
  \csname newcount\endcsname\last@language
  \def\addlanguage#1{%
    \global\advance\last@language\@ne
    \ifnum\last@language<\@cclvi
    \else
      \errmessage{No room for a new \string\language!}%
    \fi
    \global\chardef#1\last@language
    \wlog{\string#1 = \string\language\the\last@language}}
\else
  \countdef\last@language=19
  \def\addlanguage{\alloc@9\language\chardef\@cclvi}
\fi
%<</Define core switching macros>>
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%    Now we make sure all required files are loaded.  When the command
%    |\AtBeginDocument| doesn't exist we assume that we are dealing
%    with a plain-based format or \LaTeX2.09. In that case the file
%    \file{plain.def} is needed (which also defines
%    |\AtBeginDocument|, and therefore it is not loaded twice). We
%    need the first part when the format is created, and |\orig@dump|
%    is used as a flag. Otherwise, we need to use the second part, so
%    |\orig@dump| is not defined (\file{plain.def} undefines it).
%
% \changes{babel~3.9a}{2012/12/21}{Use \cs{orig@dump} as flag instead
%    of \cs{adddialect}}
%
%    Check if the current version of \file{switch.def} has been
%    previously loaded (mainly, \file{hyphen.cfg}). If not, load it
%    now. We cannot load |babel.def| here because we first need to
%    declare and process the package options.
%
% \changes{babel~3.9a}{2012/08/11}{Now switch.def is loaded always, so
%    that there is no need to rebuild formats just to update babel}
% \changes{babel~3.9a}{2012/12/13}{But switch.def is loaded only if
%    loaded in a different version (or not loaded)}
% \changes{babel~3.9a}{2013/01/14}{Added the debug option}
% \changes{babel~3.9a}{2013/02/05}{Added \cs{bbl@add}}
%
% \section{The Package File (\LaTeX, \texttt{babel.sty})}
%
%    In order to make use of the features of \LaTeXe, the \babel\
%    system contains a package file, \file{babel.sty}. This file is
%    loaded by the |\usepackage| command and defines all the language
%    options whose name is different from that of the |.ldf| file
%    (like variant spellings). It also takes care of a number of
%    compatibility issues with other packages an defines a few
%    aditional package options.
%
%
%    Apart from all the language options below we also have a few options
%    that influence the behavior of language definition files.
%
%    Many of the following options don't do anything themselves, they
%    are just defined in order to make it possible for babel and
%    language definition files to check if one of them was specified
%    by the user.
%
% \subsection{\texttt{base}}
%
%    The first option to be processed is |base|, which set the
%    hyphenation patterns then resets |ver@babel.sty| so that
%    \LaTeX forgets about the first loading. After |switch.def| has
%    been loaded (above) and |\AfterBabelLanguage| defined, exits.
%
% \changes{babel~3.9a}{2012/10/05}{preset option started,
%    party stolen from fontenc}
% \changes{babel~3.9a}{2012/10/17}{Hooks started}
% \changes{babel~3.9a}{2013/02/07}{Rejected preset, and replaced by
%   base}
% \changes{babel~3.9q}{2016/02/11}{Load patterns with option base.
%    To be improved. Moved showlanguages before base}
% \changes{babel~3.18}{2018/02/14}{Fix - prevent doble input of
%    switch.def}
%
%    \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{babel}[<@date@> <@version@> The Babel package]
\@ifpackagewith{babel}{debug}
  {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}%
   \let\bbl@debug\@firstofone}
  {\providecommand\bbl@trace[1]{}%
   \let\bbl@debug\@gobble}
\ifx\bbl@switchflag\@undefined % Prevent double input
  \let\bbl@switchflag\relax
  \input switch.def\relax
\fi
<@Load patterns in luatex@>
<@Basic macros@>
\def\AfterBabelLanguage#1{%
  \global\expandafter\bbl@add\csname#1.ldf-h@@k\endcsname}%
%    \end{macrocode}
%
% If the format created a list of loaded languages (in
% |\bbl@languages|), get the name of the 0-th to show the actual
% language used.
%
%    \begin{macrocode}
\ifx\bbl@languages\@undefined\else
  \begingroup
    \catcode`\^^I=12
    \@ifpackagewith{babel}{showlanguages}{%
      \begingroup
        \def\bbl@elt#1#2#3#4{\wlog{#2^^I#1^^I#3^^I#4}}%
        \wlog{<*languages>}%
        \bbl@languages
        \wlog{</languages>}%
      \endgroup}{}
  \endgroup
  \def\bbl@elt#1#2#3#4{%
    \ifnum#2=\z@
      \gdef\bbl@nulllanguage{#1}%
      \def\bbl@elt##1##2##3##4{}%
    \fi}%
  \bbl@languages
\fi
\ifodd\bbl@engine
  \@ifpackagewith{babel}{bidi=basic-r}{% must go before any \DeclareOption
    \let\bbl@beforeforeign\leavevmode
    \AtEndOfPackage{\EnableBabelHook{babel-bidi}}%
    \RequirePackage{luatexbase}%
    \directlua{
      require('babel-bidi.lua')
      require('babel-bidi-basic-r.lua')
      luatexbase.add_to_callback('pre_linebreak_filter',
        Babel.pre_otfload,
        'Babel.pre_otfload',
        luatexbase.priority_in_callback('pre_linebreak_filter',
          'luaotfload.node_processor') or nil)
      luatexbase.add_to_callback('hpack_filter',
        Babel.pre_otfload,
        'Babel.pre_otfload',
        luatexbase.priority_in_callback('hpack_filter',
          'luaotfload.node_processor') or nil)}}{}
\fi
%    \end{macrocode}
%
% Now the \texttt{base} option. With it we can define (and load, with
% \luatex) hyphenation patterns, even if we are not interesed in the
% rest of babel. Useful for old versions of \textsf{polyglossia}, too.
%
%    \begin{macrocode}
\bbl@trace{Defining option 'base'}
\@ifpackagewith{babel}{base}{%
  \ifx\directlua\@undefined
    \DeclareOption*{\bbl@patterns{\CurrentOption}}%
  \else
    \DeclareOption*{\bbl@patterns@lua{\CurrentOption}}%
  \fi
  \DeclareOption{base}{}%
  \DeclareOption{showlanguages}{}%
  \ProcessOptions
  \global\expandafter\let\csname opt@babel.sty\endcsname\relax
  \global\expandafter\let\csname ver@babel.sty\endcsname\relax
  \global\let\@ifl@ter@@\@ifl@ter
  \def\@ifl@ter#1#2#3#4#5{\global\let\@ifl@ter\@ifl@ter@@}%
  \endinput}{}%
%    \end{macrocode}
%
% \subsection{\texttt{key=value} options and other general option}
%
%    The following macros extract language modifiers, and only real
%    package options are kept in the option list. Modifiers are saved
%    and assigned to |\BabelModifiers| at |\bbl@load@language|; when
%    no modifiers have been given, the former is |\relax|. How
%    modifiers are handled are left to language styles; they can use
%    |\in@|, loop them with |\@for| or load |keyval|, for example.
%
% \changes{babel~3.9e}{2013/04/15}{Bug fixed - a dot was added in
%    key=value pairs}
%
%    \begin{macrocode}
\bbl@trace{key=value and another general options}
\bbl@csarg\let{tempa\expandafter}\csname opt@babel.sty\endcsname
\def\bbl@tempb#1.#2{%
   #1\ifx\@empty#2\else,\bbl@afterfi\bbl@tempb#2\fi}%
\def\bbl@tempd#1.#2\@nnil{%
  \ifx\@empty#2%
    \edef\bbl@tempc{\ifx\bbl@tempc\@empty\else\bbl@tempc,\fi#1}%
  \else
    \in@{=}{#1}\ifin@
      \edef\bbl@tempc{\ifx\bbl@tempc\@empty\else\bbl@tempc,\fi#1.#2}%
    \else
      \edef\bbl@tempc{\ifx\bbl@tempc\@empty\else\bbl@tempc,\fi#1}%
      \bbl@csarg\edef{mod@#1}{\bbl@tempb#2}%
    \fi
  \fi}
\let\bbl@tempc\@empty
\bbl@foreach\bbl@tempa{\bbl@tempd#1.\@empty\@nnil}
\expandafter\let\csname opt@babel.sty\endcsname\bbl@tempc
%    \end{macrocode}
%
% The next option tells \babel\ to leave shorthand characters active
% at the end of processing the package. This is \emph{not} the default
% as it can cause problems with other packages, but for those who want
% to use the shorthand characters in the preamble of their documents
% this can help.
%
% \changes{babel~3.9a}{2012/08/14}{Implemented the \texttt{noconfigs}
%    option}
% \changes{babel~3.9a}{2012/09/26}{Implemented the
%    \texttt{showlanguages} option}
% \changes{babel~3.9g}{2013/08/07}{Options for hyphenmap}
% \changes{babel~3.9l}{2014/07/29}{Option \texttt{silent}}
%
%    \begin{macrocode}
\DeclareOption{KeepShorthandsActive}{}
\DeclareOption{activeacute}{}
\DeclareOption{activegrave}{}
\DeclareOption{debug}{}
\DeclareOption{noconfigs}{}
\DeclareOption{showlanguages}{}
\DeclareOption{silent}{}
\DeclareOption{shorthands=off}{\bbl@tempa shorthands=\bbl@tempa}
<@More package options@>
%    \end{macrocode}
%
% Handling of package options is done in three passes. (I [JBL] am not
% very happy with the idea, anyway.) The first one processes options
% which has been declared above or follow the syntax |<key>=<value>|,
% the second one loads the requested languages, except the main one if
% set with the key |main|, and the third one loads the latter. First,
% we ``flag'' valid keys with a nil value.
%
% \changes{babel~3.9a}{2012/08/10}{Added the `safe' key, including code
%    below for selecting the redefined macros}
%
%    \begin{macrocode}
\let\bbl@opt@shorthands\@nnil
\let\bbl@opt@config\@nnil
\let\bbl@opt@main\@nnil
\let\bbl@opt@headfoot\@nnil
\let\bbl@opt@layout\@nnil
%    \end{macrocode}
%
% The following tool is defined temporarily to store the values of
% options.
%
%    \begin{macrocode}
\def\bbl@tempa#1=#2\bbl@tempa{%
  \bbl@csarg\ifx{opt@#1}\@nnil
    \bbl@csarg\edef{opt@#1}{#2}%
  \else
    \bbl@error{%
      Bad option `#1=#2'. Either you have misspelled the\\%
      key or there is a previous setting of `#1'}{%
      Valid keys are `shorthands', `config', `strings', `main',\\%
      `headfoot', `safe', `math', among others.}
  \fi}
%    \end{macrocode}
%
% Now the option list is processed, taking into account only currently
% declared options (including those declared with a |=|), and
% |<key>=<value>| options (the former take precedence).  Unrecognized
% options are saved in |\bbl@language@opts|, because they are language
% options.
%
%    \begin{macrocode}
\let\bbl@language@opts\@empty
\DeclareOption*{%
  \bbl@xin@{\string=}{\CurrentOption}%
  \ifin@
    \expandafter\bbl@tempa\CurrentOption\bbl@tempa
  \else
    \bbl@add@list\bbl@language@opts{\CurrentOption}%
  \fi}
%    \end{macrocode}
%
%    Now we finish the first pass (and start over).
%
%    \begin{macrocode}
\ProcessOptions*
%    \end{macrocode}
%
% \subsection{Conditional loading of shorthands}
%
%    If there is no |shorthands=<chars>|, the original \textsf{babel}
%    macros are left untouched, but if there is, these macros are
%    wrapped (in |babel.def|) to define only those given.
%
%    A bit of optimization: if there is no |shorthands=|, then
%    |\bbl@ifshorthands| is always true, and it is always false if
%    |shorthands| is empty. Also, some code makes sense only with
%    |shorthands=...|.
%
% \changes{babel~3.9c}{2013/04/07}{Added t and c for tilde and comma}
%
%    \begin{macrocode}
\bbl@trace{Conditional loading of shorthands}
\def\bbl@sh@string#1{%
  \ifx#1\@empty\else
    \ifx#1t\string~%
    \else\ifx#1c\string,%
    \else\string#1%
    \fi\fi
    \expandafter\bbl@sh@string
  \fi}
\ifx\bbl@opt@shorthands\@nnil
  \def\bbl@ifshorthand#1#2#3{#2}%
\else\ifx\bbl@opt@shorthands\@empty
  \def\bbl@ifshorthand#1#2#3{#3}%
\else
%    \end{macrocode}
%
%    The following macro tests if a shortand is one of the allowed
%    ones.
%
%    \begin{macrocode}
  \def\bbl@ifshorthand#1{%
    \bbl@xin@{\string#1}{\bbl@opt@shorthands}%
    \ifin@
      \expandafter\@firstoftwo
    \else
      \expandafter\@secondoftwo
    \fi}
%    \end{macrocode}
%
%    We make sure all chars in the string are `other', with the help
%    of an auxiliary macro defined above (which also zaps spaces).
%
%    \begin{macrocode}
  \edef\bbl@opt@shorthands{%
    \expandafter\bbl@sh@string\bbl@opt@shorthands\@empty}%
%    \end{macrocode}
%
%    The following is ignored with |shorthands=off|, since it is
%    intended to take some aditional actions for certain chars.
%
%    \begin{macrocode}
  \bbl@ifshorthand{'}%
    {\PassOptionsToPackage{activeacute}{babel}}{}
  \bbl@ifshorthand{`}%
    {\PassOptionsToPackage{activegrave}{babel}}{}
\fi\fi
%    \end{macrocode}
%
% \changes{babel~3.9a}{2012/07/30}{Code setting language in
%    head/foots.  Related to babel/3796}
%
%    With |headfoot=lang| we can set the language used in heads/foots.
%    For example, in babel/3796 just adds |headfoot=english|.  It
%    misuses \cs{@resetactivechars} but seems to work.
%
%    \begin{macrocode}
\ifx\bbl@opt@headfoot\@nnil\else
  \g@addto@macro\@resetactivechars{%
    \set@typeset@protect                  
    \expandafter\select@language@x\expandafter{\bbl@opt@headfoot}%
    \let\protect\noexpand}
\fi
%    \end{macrocode}
%
% For the option safe we use a different approach -- |\bbl@opt@safe|
% says which macros are redefined (B for bibs and R for refs). By
% default, both are set.
%
%    \begin{macrocode}
\ifx\bbl@opt@safe\@undefined
  \def\bbl@opt@safe{BR}
\fi
\ifx\bbl@opt@main\@nnil\else
  \edef\bbl@language@opts{%
    \ifx\bbl@language@opts\@empty\else\bbl@language@opts,\fi
      \bbl@opt@main}
\fi
%    \end{macrocode}
%
% For |layout| an auxiliary macro is provided, available for packages
% and language styles.
%
% \changes{babel~3.16}{2018/01/02}{Added the basic layout stuff and the
%  macro \cs{IfBabelLayout}}
%
%    \begin{macrocode}
\bbl@trace{Defining IfBabelLayout}
\ifx\bbl@opt@layout\@nnil
  \newcommand\IfBabelLayout[3]{#3}%
\else
  \newcommand\IfBabelLayout[1]{%
    \@expandtwoargs\in@{.#1.}{.\bbl@opt@layout.}%
    \ifin@
      \expandafter\@firstoftwo
    \else
      \expandafter\@secondoftwo
    \fi}
\fi
%    \end{macrocode}
%
% \subsection{Language options}
%
% \changes{babel~3.9a}{2012/06/15}{Rewritten the loading mechanism, so
%    that languages not declared are also correctly recognized, even
%    if given as global options} 
% \changes{babel~3.9a}{2012/08/12}{Revised the loading mechanism}
% \changes{babel~3.9i}{2014/03/01}{Removed German options, because
%    they are now loaded directly}
%
%    Languages are loaded when processing the corresponding option
%    \textit{except} if a |main| language has been set. In such a
%    case, it is not loaded until all options has been processed.
%    The following macro inputs the ldf file and does some additional
%    checks (|\input| works, too, but possible errors are not catched).
%
%    \begin{macrocode}
\bbl@trace{Language options}
\let\bbl@afterlang\relax
\let\BabelModifiers\relax
\let\bbl@loaded\@empty
\def\bbl@load@language#1{%
  \InputIfFileExists{#1.ldf}%
    {\edef\bbl@loaded{\CurrentOption
       \ifx\bbl@loaded\@empty\else,\bbl@loaded\fi}%
     \expandafter\let\expandafter\bbl@afterlang
        \csname\CurrentOption.ldf-h@@k\endcsname
     \expandafter\let\expandafter\BabelModifiers
        \csname bbl@mod@\CurrentOption\endcsname}%
    {\bbl@error{%
       Unknown option `\CurrentOption'. Either you misspelled it\\%
       or the language definition file \CurrentOption.ldf was not found}{%
       Valid options are: shorthands=, KeepShorthandsActive,\\%
       activeacute, activegrave, noconfigs, safe=, main=, math=\\%
       headfoot=, strings=, config=, hyphenmap=, or a language name.}}}
%    \end{macrocode}
%
%    Now, we set language options whose names are different from |ldf| files.
% 
% \changes{babel~3.9t}{2017/04/23}{Removed options for English, Indonesian and
%    Malay, now handled with proxy files}
% \changes{babel~3.13}{2017/08/24}{Removed options for French,
%    too. ldf files now takes priority if exist, except Hebrew (to do)}
%
%    \begin{macrocode}
\def\bbl@try@load@lang#1#2#3{%
    \IfFileExists{\CurrentOption.ldf}%
      {\bbl@load@language{\CurrentOption}}%
      {#1\bbl@load@language{#2}#3}}
\DeclareOption{afrikaans}{\bbl@try@load@lang{}{dutch}{}}
\DeclareOption{brazil}{\bbl@try@load@lang{}{portuges}{}}
\DeclareOption{brazilian}{\bbl@try@load@lang{}{portuges}{}}
\DeclareOption{hebrew}{%
  \input{rlbabel.def}%
  \bbl@load@language{hebrew}}
\DeclareOption{hungarian}{\bbl@try@load@lang{}{magyar}{}}
\DeclareOption{lowersorbian}{\bbl@try@load@lang{}{lsorbian}{}}
\DeclareOption{nynorsk}{\bbl@try@load@lang{}{norsk}{}}
\DeclareOption{polutonikogreek}{%
  \bbl@try@load@lang{}{greek}{\languageattribute{greek}{polutoniko}}}
\DeclareOption{portuguese}{\bbl@try@load@lang{}{portuges}{}}
\DeclareOption{russian}{\bbl@try@load@lang{}{russianb}{}}
\DeclareOption{ukrainian}{\bbl@try@load@lang{}{ukraineb}{}}
\DeclareOption{uppersorbian}{\bbl@try@load@lang{}{usorbian}{}}
%    \end{macrocode}
%
%    Another way to extend the list of `known' options for \babel\ was
%    to create the file \file{bblopts.cfg} in which one can add option
%    declarations. However, this mechanism is deprecated -- if you
%    want an alternative name for a language, just create a new |.ldf|
%    file loading the actual one. You can also set the name
%    of the file with the package option |config=<name>|, which will
%    load |<name>.cfg| instead.
%
% \changes{babel~3.9a}{2012/06/28}{Added the \cs{AfterBabelLanguage}
%    mechanism, to be used mainly with the local cfg file.}
% \changes{babel~3.9a}{2012/06/31}{Now you can set the name of the
%    local cfg file.}
%
%    \begin{macrocode}
\ifx\bbl@opt@config\@nnil
  \@ifpackagewith{babel}{noconfigs}{}%
    {\InputIfFileExists{bblopts.cfg}%
      {\typeout{*************************************^^J%
               * Local config file bblopts.cfg used^^J%
               *}}%
      {}}%
\else
  \InputIfFileExists{\bbl@opt@config.cfg}%
    {\typeout{*************************************^^J%
             * Local config file \bbl@opt@config.cfg used^^J%
             *}}%
    {\bbl@error{%
       Local config file `\bbl@opt@config.cfg' not found}{%
       Perhaps you misspelled it.}}%
\fi
%    \end{macrocode}
%
%    Recognizing global options in packages not having a closed set of
%    them is not trivial, as for them to be processed they must be
%    defined explicitly. So, package options not yet taken into
%    account and stored in |bbl@language@opts| are assumed to be
%    languages (note this list also contains the language given with
%    |main|). If not declared above, the name of the option and the
%    file are the same.
%
%    \begin{macrocode}
\bbl@for\bbl@tempa\bbl@language@opts{%
  \bbl@ifunset{ds@\bbl@tempa}%
    {\edef\bbl@tempb{%
       \noexpand\DeclareOption
         {\bbl@tempa}%
         {\noexpand\bbl@load@language{\bbl@tempa}}}%
     \bbl@tempb}%
     \@empty}
%    \end{macrocode}
%
%    Now, we make sure an option is explicitly declared for any
%    language set as global option, by checking if an |ldf|
%    exists. The previous step was, in fact, somewhat redundant, but
%    that way we minimize accesing the file system just to see if the
%    option could be a language.
%
%    \begin{macrocode}
\bbl@foreach\@classoptionslist{%
  \bbl@ifunset{ds@#1}%
    {\IfFileExists{#1.ldf}%
      {\DeclareOption{#1}{\bbl@load@language{#1}}}%
      {}}%
    {}}
%    \end{macrocode}
%
%    If a main language has been set, store it for the third pass.
%
%    \begin{macrocode}
\ifx\bbl@opt@main\@nnil\else
  \expandafter
  \let\expandafter\bbl@loadmain\csname ds@\bbl@opt@main\endcsname
  \DeclareOption{\bbl@opt@main}{}
\fi
%    \end{macrocode}
%
%    And we are done, because all options for this pass has been
%    declared. Those already processed in the first pass are just
%    ignored.
%
% \changes{babel~3.9a}{2012/12/22}{Default option does nothing}
%
%    The options have to be processed in the order in which the user
%    specified them (except, of course, global options, which \LaTeX{}
%    processes before):
%
%    \begin{macrocode}
\def\AfterBabelLanguage#1{%
  \bbl@ifsamestring\CurrentOption{#1}{\global\bbl@add\bbl@afterlang}{}}
\DeclareOption*{}
\ProcessOptions*
%    \end{macrocode}
%
%    This finished the second pass. Now the third one begins, which
%    loads the main language set with the key |main|. A warning is
%    raised if the main language is not the same as the last named
%    one, or if the value of the key |main| is not a language. Then
%    execute directly the option (because it could be used only in
%    |main|). After loading all languages, we deactivate
%    |\AfterBabelLanguage|.
%
%    \begin{macrocode}
\ifx\bbl@opt@main\@nnil
  \edef\bbl@tempa{\@classoptionslist,\bbl@language@opts}
  \let\bbl@tempc\@empty
  \bbl@for\bbl@tempb\bbl@tempa{%
    \bbl@xin@{,\bbl@tempb,}{,\bbl@loaded,}%
    \ifin@\edef\bbl@tempc{\bbl@tempb}\fi}
  \def\bbl@tempa#1,#2\@nnil{\def\bbl@tempb{#1}}
  \expandafter\bbl@tempa\bbl@loaded,\@nnil
  \ifx\bbl@tempb\bbl@tempc\else
    \bbl@warning{%
      Last declared language option is `\bbl@tempc',\\%
      but the last processed one was `\bbl@tempb'.\\%
      The main language cannot be set as both a global\\%
      and a package option. Use `main=\bbl@tempc' as\\%
      option. Reported}%
  \fi
\else
  \DeclareOption{\bbl@opt@main}{\bbl@loadmain}
  \ExecuteOptions{\bbl@opt@main}
  \DeclareOption*{}
  \ProcessOptions*
\fi
\def\AfterBabelLanguage{%
  \bbl@error
    {Too late for \string\AfterBabelLanguage}%
    {Languages have been loaded, so I can do nothing}}
%    \end{macrocode}
%
%    In order to catch the case where the user forgot to specify a
%    language we check whether |\bbl@main@language|, has become
%    defined. If not, no language has been loaded and an error
%    message is displayed.
%
% \changes{babel~3.9a}{2012/06/24}{Now babel is not loaded to prevent
%    the document from raising errors after fixing it}
%
%    \begin{macrocode}
\ifx\bbl@main@language\@undefined
  \bbl@error{%
    You haven't specified a language option}{%
    You need to specify a language, either as a global option\\%
    or as an optional argument to the \string\usepackage\space
    command;\\%
    You shouldn't try to proceed from here, type x to quit.}
\fi
%</package>
%    \end{macrocode}
%
% \section{The kernel of Babel (\texttt{babel.def}, common)}
%
% The kernel of the \babel\ system is stored in either
% \file{hyphen.cfg} or \file{switch.def} and \file{babel.def}.  The
% file \file{babel.def} contains most of the code, while
% \file{switch.def} defines the language switching commands; both can
% be read at run time. The file \file{hyphen.cfg} is a file that can
% be loaded into the format, which is necessary when you want to be
% able to switch hyphenation patterns (by default, it also inputs
% \file{switch.def}, for ``historical reasons'', but it is not
% necessary). When \file{babel.def} is loaded it checks if the current
% version of \file{switch.def} is in the format; if not, it is
% loaded. A further file, \file{babel.sty}, contains \LaTeX-specific
% stuff.
%
% Because plain \TeX\ users might want to use some of the features of
% the \babel{} system too, care has to be taken that plain \TeX\ can
% process the files. For this reason the current format will have to
% be checked in a number of places. Some of the code below is common
% to plain \TeX\ and \LaTeX, some of it is for the \LaTeX\ case only.
%
% Plain formats based on etex (etex, xetex, luatex) don't load
% |hyphen.cfg| but |etex.src|, which follows a different naming
% convention, so we need to define the babel names. It presumes
% |language.def| exists and it is the same file used when formats were
% created.
%
% \changes{babel~3.9a}{2013/01/11}{Added \cs{bbl@for} for loops
%    ignoring empties}
% \changes{babel~3.9c}{2013/04/06}{Normalize \cs{bbl@afterlang} to
%    relax}
% \changes{babel~3.9i}{2014/03/10}{Make sure \cs{bbl@language@opts}
%    is defined.}
% \changes{babel~3.9i}{2014/03/11}{Define \cs{l@} values from
%   \cs{lang@} values set in Plain etex/xetex/luatex}
%
% \subsection{Tools}
%
% \changes{babel~3.9k}{2014/03/24}{Added definition for
%    \cs{uselanguage}}
% \changes{babel~3.9n}{2015/12/21}{Define a few macros for 2.09}
% \changes{babel~3.9p}{2016/02/05}{Added a test for lua(e)tex.}
% \changes{babel~3.9q}{2016/02/12}{Load lua patterns if not lualatex.}
%
%    \begin{macrocode}
%<*core>
\ifx\ldf@quit\@undefined
\else
  \expandafter\endinput
\fi
<@Make sure ProvidesFile is defined@>
\ProvidesFile{babel.def}[<@date@> <@version@> Babel common definitions]
<@Load macros for plain if not LaTeX@>
%    \end{macrocode}
% 
% The file |babel.def| expects some definitions made in the \LaTeXe{}
% style file. So, In \LaTeX2.09 and Plain{} we must provide at least
% some predefined values as well some tools to set them (even if not
% all options are available). There in no package options, and
% therefore and alternative mechanism is provided. For the moment,
% only |\babeloptionstrings| and |\babeloptionmath| are provided,
% which can be defined before loading \babel. |\BabelModifiers| can be
% set too (but not sure it works).
%
%    \begin{macrocode}
\ifx\bbl@ifshorthand\@undefined
  \let\bbl@opt@shorthands\@nnil
  \def\bbl@ifshorthand#1#2#3{#2}%
  \let\bbl@language@opts\@empty
  \ifx\babeloptionstrings\@undefined
    \let\bbl@opt@strings\@nnil
  \else
    \let\bbl@opt@strings\babeloptionstrings
  \fi
  \def\BabelStringsDefault{generic}
  \def\bbl@tempa{normal}
  \ifx\babeloptionmath\bbl@tempa
    \def\bbl@mathnormal{\noexpand\textormath}
  \fi
  \def\AfterBabelLanguage#1#2{}
  \ifx\BabelModifiers\@undefined\let\BabelModifiers\relax\fi
  \let\bbl@afterlang\relax
  \def\bbl@opt@safe{BR}
  \ifx\@uclclist\@undefined\let\@uclclist\@empty\fi
  \ifx\bbl@trace\@undefined\def\bbl@trace#1{}\fi
\fi
%    \end{macrocode}
%
% And continue.
%
%    \begin{macrocode}
\ifx\bbl@switchflag\@undefined % Prevent double input
  \let\bbl@switchflag\relax
  \input switch.def\relax
\fi
\bbl@trace{Compatibility with language.def}
\ifx\bbl@languages\@undefined
  \ifx\directlua\@undefined
    \openin1 = language.def
    \ifeof1
      \closein1
      \message{I couldn't find the file language.def}
    \else
      \closein1
      \begingroup
        \def\addlanguage#1#2#3#4#5{%
          \expandafter\ifx\csname lang@#1\endcsname\relax\else
            \global\expandafter\let\csname l@#1\expandafter\endcsname
              \csname lang@#1\endcsname
          \fi}%
        \def\uselanguage#1{}%
        \input language.def
      \endgroup
    \fi
  \fi
  \chardef\l@english\z@
\fi
<@Load patterns in luatex@>
<@Basic macros@>
%    \end{macrocode}
%
%  \begin{macro}{\addto}
%    For each language four control sequences have to be defined that
%    control the language-specific definitions. To be able to add
%    something to these macro once they have been defined the macro
%    |\addto| is introduced. It takes two arguments, a \meta{control
%    sequence} and \TeX-code to be added to the \meta{control
%    sequence}.
%
%    If the \meta{control sequence} has not been defined before it is
%    defined now.  The control sequence could also expand to |\relax|,
%    in which case a circular definition results. The net result is a
%    stack overflow.  Otherwise the replacement text for the
%    \meta{control sequence} is expanded and stored in a token
%    register, together with the \TeX-code to be added.  Finally the
%    \meta{control sequence} is \emph{re}defined, using the contents
%    of the token register.
%
%    \begin{macrocode}
\def\addto#1#2{%
  \ifx#1\@undefined
    \def#1{#2}%
  \else
    \ifx#1\relax
      \def#1{#2}%
    \else
      {\toks@\expandafter{#1#2}%
       \xdef#1{\the\toks@}}%
    \fi
  \fi}
%    \end{macrocode}
%
%  \end{macro}
%
% \changes{babel~3.9a}{2012/08/10}{Removed the \cs{peek@token} and
%    \textsc{test@token} stuff}
%
%    The macro |\initiate@active@char| takes all the necessary actions
%    to make its argument a shorthand character. The real work is
%    performed once for each character.
%
% \changes{babel~3.9a}{1999/04/30}{Added \cs{bbl@withactive}}
%
%    \begin{macrocode}
\def\bbl@withactive#1#2{%
  \begingroup
    \lccode`~=`#2\relax
    \lowercase{\endgroup#1~}}
%    \end{macrocode}
%
%
%  \begin{macro}{\bbl@redefine}
%    To redefine a command, we save the old meaning of the macro.
%    Then we redefine it to call the original macro with the
%    `sanitized' argument.  The reason why we do it this way is that
%    we don't want to redefine the \LaTeX\ macros completely in case
%    their definitions change (they have changed in the past).
%
%    Because we need to redefine a number of commands we define the
%    command |\bbl@redefine| which takes care of this. It creates a
%    new control sequence, |\org@...|
%
%    \begin{macrocode}
\def\bbl@redefine#1{%
  \edef\bbl@tempa{\bbl@stripslash#1}%
  \expandafter\let\csname org@\bbl@tempa\endcsname#1%
  \expandafter\def\csname\bbl@tempa\endcsname}
%    \end{macrocode}
%
%    This command should only be used in the preamble of the document.
%
%    \begin{macrocode}
\@onlypreamble\bbl@redefine
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@redefine@long}
%    This version of |\babel@redefine| can be used to redefine |\long|
%    commands such as |\ifthenelse|.
%
%    \begin{macrocode}
\def\bbl@redefine@long#1{%
  \edef\bbl@tempa{\bbl@stripslash#1}%
  \expandafter\let\csname org@\bbl@tempa\endcsname#1%
  \expandafter\long\expandafter\def\csname\bbl@tempa\endcsname}
\@onlypreamble\bbl@redefine@long
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@redefinerobust}
%    For commands that are redefined, but which \textit{might} be
%    robust we need a slightly more intelligent macro. A robust
%    command |foo| is defined to expand to |\protect|\verb*|\foo |. So
%    it is necessary to check whether \verb*|\foo | exists. The result
%    is that the command that is being redefined is always robust
%    afterwards.  Therefore all we need to do now is define \verb*|\foo |.
%
%    \begin{macrocode}
\def\bbl@redefinerobust#1{%
  \edef\bbl@tempa{\bbl@stripslash#1}%
  \bbl@ifunset{\bbl@tempa\space}%
    {\expandafter\let\csname org@\bbl@tempa\endcsname#1%
     \bbl@exp{\def\\#1{\\\protect\<\bbl@tempa\space>}}}%
    {\bbl@exp{\let\<org@\bbl@tempa>\<\bbl@tempa\space>}}%
    \@namedef{\bbl@tempa\space}}
%    \end{macrocode}
%
%    This command should only be used in the preamble of the document.
%
%    \begin{macrocode}
\@onlypreamble\bbl@redefinerobust
%    \end{macrocode}
%
%  \end{macro}
%
% \subsection{Hooks}
%
%  Note they are loaded in babel.def. switch.def only provides a
%  ``hook'' for hooks (with a default value which is a no-op,
%  below). Admittedly, the current implementation is a somewhat
%  simplistic and does vety little to catch errors, but it is intended
%  for developpers, after all. |\bbl@usehooks| is the commands used by
%  babel to execute hooks defined for an event.
%
% \changes{babel~3.9k}{2014/03/23}{Removed a \cs{newcommand},
%    undefined in Plain}
%
%    \begin{macrocode}
\bbl@trace{Hooks}
\def\AddBabelHook#1#2{%
  \bbl@ifunset{bbl@hk@#1}{\EnableBabelHook{#1}}{}%
  \def\bbl@tempa##1,#2=##2,##3\@empty{\def\bbl@tempb{##2}}%
  \expandafter\bbl@tempa\bbl@evargs,#2=,\@empty
  \bbl@ifunset{bbl@ev@#1@#2}%
    {\bbl@csarg\bbl@add{ev@#2}{\bbl@elt{#1}}%
     \bbl@csarg\newcommand}%
    {\bbl@csarg\let{ev@#1@#2}\relax
     \bbl@csarg\newcommand}%
  {ev@#1@#2}[\bbl@tempb]}
\def\EnableBabelHook#1{\bbl@csarg\let{hk@#1}\@firstofone}
\def\DisableBabelHook#1{\bbl@csarg\let{hk@#1}\@gobble}
\def\bbl@usehooks#1#2{%
  \def\bbl@elt##1{%
    \@nameuse{bbl@hk@##1}{\@nameuse{bbl@ev@##1@#1}#2}}%
  \@nameuse{bbl@ev@#1}}
%    \end{macrocode}
%
%    To ensure forward compatibility, arguments in hooks are set
%    implicitly. So, if a further argument is added in the future,
%    there is no need to change the existing code. Note events
%    intended for \textsf{hyphen.cfg} are also loaded (just in
%    case you need them for some reason). 
%
%    \begin{macrocode}
\def\bbl@evargs{,% don't delete the comma
  everylanguage=1,loadkernel=1,loadpatterns=1,loadexceptions=1,%
  adddialect=2,patterns=2,defaultcommands=0,encodedcommands=2,write=0,%
  beforeextras=0,afterextras=0,stopcommands=0,stringprocess=0,%
  hyphenation=2,initiateactive=3,afterreset=0,foreign=0,foreign*=0}
%    \end{macrocode}
%
% \begin{macro}{\babelensure}
%
% The user command just parses the optional argument and creates a
% new macro named |\bbl@e@|\m{language}. We register a hook at the
% |afterextras| event which just executes this macro in a
% ``complete'' selection (which, if undefined, is |\relax| and does
% nothing). This part is somewhat involved because we have to make
% sure things are expanded the correct number of times.
%
% The macro |\bbl@e@|\m{language} contains
% |\bbl@ensure|\marg{include}\marg{exclude}\marg{fontenc}, which in in
% turn loops over the macros names in |\bbl@captionslist|, excluding
% (with the help of |\in@|) those in the |exclude| list. If the
% |fontenc| is given (and not |\relax|), the |\fontencoding| is also
% added. Then we loop over the |include| list, but if the macro
% already contains |\foreignlanguage|, nothing is done.  Note this
% macro (1) is not restricted to the preamble, and (2) changes are
% local.
%
% \changes{babel~3.9i}{2014/02/14}{Macro \cs{babelensure} added}
% \changes{babel~3.9k}{2014/03/23}{Encapsulate \cs{foreignlanguage} in
%   \cs{bbl@ensure@}language, to "protect" strings}
% \changes{babel~3.9s}{2017/04/10}{Bug fix - extra spaces because a
%   missing percent}
% \changes{babel~3.9s}{2017/04/10}{\cs{bbl@ensure@lang} defined only
%   once}
% \changes{babel~3.10}{2017/05/06}{\cs{bbl@ensured} renamed to
%   \cs{bbl@captionslist} (for \cs{babelprovide}), which means
%   \cs{today} must be given explicitly in \cs{babelensure}}
%
%    \begin{macrocode}
\bbl@trace{Defining babelensure}
\newcommand\babelensure[2][]{%  TODO - revise test files
  \AddBabelHook{babel-ensure}{afterextras}{%
    \ifcase\bbl@select@type
      \@nameuse{bbl@e@\languagename}%
    \fi}%
  \begingroup
    \let\bbl@ens@include\@empty
    \let\bbl@ens@exclude\@empty
    \def\bbl@ens@fontenc{\relax}%
    \def\bbl@tempb##1{%
      \ifx\@empty##1\else\noexpand##1\expandafter\bbl@tempb\fi}%
    \edef\bbl@tempa{\bbl@tempb#1\@empty}%
    \def\bbl@tempb##1=##2\@@{\@namedef{bbl@ens@##1}{##2}}%
    \bbl@foreach\bbl@tempa{\bbl@tempb##1\@@}%
    \def\bbl@tempc{\bbl@ensure}%
    \expandafter\bbl@add\expandafter\bbl@tempc\expandafter{%
      \expandafter{\bbl@ens@include}}%
    \expandafter\bbl@add\expandafter\bbl@tempc\expandafter{%
      \expandafter{\bbl@ens@exclude}}%
    \toks@\expandafter{\bbl@tempc}%
    \bbl@exp{%
  \endgroup
  \def\<bbl@e@#2>{\the\toks@{\bbl@ens@fontenc}}}}
\def\bbl@ensure#1#2#3{% 1: include 2: exclude 3: fontenc
  \def\bbl@tempb##1{% elt for (excluding) \bbl@captionslist list
    \ifx##1\@empty\else
      \in@{##1}{#2}%
      \ifin@\else
        \bbl@ifunset{bbl@ensure@\languagename}%
          {\bbl@exp{%
            \\\DeclareRobustCommand\<bbl@ensure@\languagename>[1]{%
              \\\foreignlanguage{\languagename}%
              {\ifx\relax#3\else
                \\\fontencoding{#3}\\\selectfont
               \fi
               ########1}}}}%
          {}%
        \toks@\expandafter{##1}%
        \edef##1{%
           \bbl@csarg\noexpand{ensure@\languagename}%
           {\the\toks@}}%
      \fi
      \expandafter\bbl@tempb
    \fi}%
  \expandafter\bbl@tempb\bbl@captionslist\today\@empty
  \def\bbl@tempa##1{% elt for include list
    \ifx##1\@empty\else
      \bbl@csarg\in@{ensure@\languagename\expandafter}\expandafter{##1}%
      \ifin@\else
        \bbl@tempb##1\@empty
      \fi
      \expandafter\bbl@tempa
    \fi}%
  \bbl@tempa#1\@empty} 
\def\bbl@captionslist{%
  \prefacename\refname\abstractname\bibname\chaptername\appendixname
  \contentsname\listfigurename\listtablename\indexname\figurename
  \tablename\partname\enclname\ccname\headtoname\pagename\seename
  \alsoname\proofname\glossaryname}   
%    \end{macrocode}
%
%    \end{macro}
%
% \subsection{Setting up language files}
%
% \begin{macro}{\LdfInit}
%    The second version of |\LdfInit| macro takes two arguments. The first
%    argument is the name of the language that will be defined in the
%    language definition file; the second argument is either a control
%    sequence or a string from which a control sequence should be
%    constructed. The existence of the control sequence indicates that
%    the file has been processed before.
%
%    At the start of processing a language definition file we always
%    check the category code of the at-sign. We make sure that it is
%    a `letter' during the processing of the file. We also save its
%    name as the last called option, even if not loaded.
%
%    Another character that needs to have the correct category code
%    during processing of language definition files is the equals sign,
%    `=', because it is sometimes used in constructions with the
%    |\let| primitive. Therefore we store its current catcode and
%    restore it later on.
%
%    Now we check whether we should perhaps stop the processing of
%    this file. To do this we first need to check whether the second
%    argument that is passed to |\LdfInit| is a control sequence. We
%    do that by looking at the first token after passing |#2| through
%    |string|. When it is equal to |\@backslashchar| we are dealing
%    with a control sequence which we can compare with |\@undefined|.
%
% \changes{babel~3.9a}{2012/08/11}{\cs{ldf@quit} is not delayed any
%   more after \cs{fi} , since \cs{endinput} is not executed
%   immediately}
% \changes{babel~3.9g}{2012/08/11}{Preset the ``family'' of macros
%   \cs{Babel}...}
%
%   If so, we call |\ldf@quit| to set the main language, restore the
%   category code of the @-sign and call |\endinput|
%
%    When |#2| was \emph{not} a control sequence we construct one and
%    compare it with |\relax|.
%
%    Finally we check |\originalTeX|.
%
%    \begin{macrocode}
\bbl@trace{Macros for setting language files up}
\def\bbl@ldfinit{%
  \let\bbl@screset\@empty
  \let\BabelStrings\bbl@opt@string
  \let\BabelOptions\@empty
  \let\BabelLanguages\relax
  \ifx\originalTeX\@undefined
    \let\originalTeX\@empty
  \else
    \originalTeX
  \fi}
\def\LdfInit#1#2{%
  \chardef\atcatcode=\catcode`\@
  \catcode`\@=11\relax
  \chardef\eqcatcode=\catcode`\=
  \catcode`\==12\relax
  \expandafter\if\expandafter\@backslashchar
                 \expandafter\@car\string#2\@nil
    \ifx#2\@undefined\else
      \ldf@quit{#1}%
    \fi
  \else
    \expandafter\ifx\csname#2\endcsname\relax\else
      \ldf@quit{#1}%
    \fi
  \fi
  \bbl@ldfinit}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\ldf@quit}
%    This macro interrupts the processing of a language definition file.
%
%    \begin{macrocode}
\def\ldf@quit#1{%
  \expandafter\main@language\expandafter{#1}%
  \catcode`\@=\atcatcode \let\atcatcode\relax
  \catcode`\==\eqcatcode \let\eqcatcode\relax
  \endinput}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\ldf@finish}
%    This macro takes one argument. It is the name of the language
%    that was defined in the language definition file.
%
%    We load the local configuration file if one is present, we set
%    the main language (taking into account that the argument might be
%    a control sequence that needs to be expanded) and reset the
%    category code of the @-sign.
%
% \changes{babel~3.9a}{2012/10/01}{Added \cs{bbl@afterlang} which
%    executes the code delayed with \cs{AfterBabelLanguage}}
%
%    \begin{macrocode}
\def\bbl@afterldf#1{%
  \bbl@afterlang
  \let\bbl@afterlang\relax
  \let\BabelModifiers\relax
  \let\bbl@screset\relax}%
\def\ldf@finish#1{%
  \loadlocalcfg{#1}%
  \bbl@afterldf{#1}%
  \expandafter\main@language\expandafter{#1}%
  \catcode`\@=\atcatcode \let\atcatcode\relax
  \catcode`\==\eqcatcode \let\eqcatcode\relax}
%    \end{macrocode}
%
%  \end{macro}
%
%    After the preamble of the document the commands |\LdfInit|,
%    |\ldf@quit| and |\ldf@finish| are no longer needed. Therefore
%    they are turned into warning messages in \LaTeX.
%
%    \begin{macrocode}
\@onlypreamble\LdfInit
\@onlypreamble\ldf@quit
\@onlypreamble\ldf@finish
%    \end{macrocode}
%
%  \begin{macro}{\main@language}
%  \begin{macro}{\bbl@main@language}
%    This command should be used in the various language definition
%    files. It stores its argument in |\bbl@main@language|; to be used
%    to switch to the correct language at the beginning of the
%    document.
%
% \changes{babel~3.8l}{2008/07/06}{Use \cs{bbl@patterns}}
%
%    \begin{macrocode}
\def\main@language#1{%
  \def\bbl@main@language{#1}%
  \let\languagename\bbl@main@language
  \bbl@patterns{\languagename}}
%    \end{macrocode}
%
%    We also have to make sure that some code gets executed at the
%    beginning of the document. Languages does not set |\pagedir|, so
%    we set here for the whole document to the main |\bodydir|. 
%
%    \begin{macrocode}
\AtBeginDocument{%
  \expandafter\selectlanguage\expandafter{\bbl@main@language}%
  \ifcase\bbl@engine\or\pagedir\bodydir\fi}  % TODO - a better place
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%   
% A bit of optimization. Select in heads/foots the language only if
% necessary. 
%
%    \begin{macrocode}
\def\select@language@x#1{%
  \ifcase\bbl@select@type
    \bbl@ifsamestring\languagename{#1}{}{\select@language{#1}}%
  \else
    \select@language{#1}%
  \fi}
%    \end{macrocode}
%
% \subsection{Shorthands}
%
%  \begin{macro}{\bbl@add@special}
%    The macro |\bbl@add@special| is used to add a new character (or
%    single character control sequence) to the macro |\dospecials|
%    (and |\@sanitize| if \LaTeX\ is used). It is used only at one
%    place, namely when |\initiate@active@char| is called (which is
%    ignored if the char has been made active before).  Because
%    |\@sanitize| can be undefined, we put the definition inside a
%    conditional.
%
%    Items are added to the lists without checking its existence or
%    the original catcode. It does not hurt, but should be fixed. It's
%    already done with |\nfss@catcodes|, added in 3.10.
%
% \changes{3.10}{2017/05/14}{Refactored. Add to \cs{nfss@catcodes} too.}
%
%    \begin{macrocode}
\bbl@trace{Shorhands}
\def\bbl@add@special#1{% 1:a macro like \", \?, etc.
  \bbl@add\dospecials{\do#1}% test @sanitize = \relax, for back. compat.
  \bbl@ifunset{@sanitize}{}{\bbl@add\@sanitize{\@makeother#1}}%
  \ifx\nfss@catcodes\@undefined\else % TODO - same for above
    \begingroup
      \catcode`#1\active
      \nfss@catcodes
      \ifnum\catcode`#1=\active
        \endgroup
        \bbl@add\nfss@catcodes{\@makeother#1}%
      \else
        \endgroup
      \fi
  \fi}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@remove@special}
%
%    The companion of the former macro is |\bbl@remove@special|.  It
%    removes a character from the set macros |\dospecials| and
%    |\@sanitize|, but it is not used at all in the \babel{} core.
%
%    \begin{macrocode}
\def\bbl@remove@special#1{%
  \begingroup
    \def\x##1##2{\ifnum`#1=`##2\noexpand\@empty
                 \else\noexpand##1\noexpand##2\fi}%
    \def\do{\x\do}%
    \def\@makeother{\x\@makeother}%
  \edef\x{\endgroup
    \def\noexpand\dospecials{\dospecials}%
    \expandafter\ifx\csname @sanitize\endcsname\relax\else
      \def\noexpand\@sanitize{\@sanitize}%
    \fi}%
  \x}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\initiate@active@char}
%    A language definition file can call this macro to make a
%    character active. This macro takes one argument, the character
%    that is to be made active. When the character was already active
%    this macro does nothing. Otherwise, this macro defines the
%    control sequence |\normal@char|\m{char} to expand to the
%    character in its `normal state' and it defines the active
%    character to expand to |\normal@char|\m{char} by default
%    (\m{char} being the character to be made active). Later its
%    definition can be changed to expand to |\active@char|\m{char}
%    by calling |\bbl@activate{|\m{char}|}|.
%
%    For example, to make the double quote character active one could
%    have |\initiate@active@char{"}| in a language definition file.
%    This defines |"| as |\active@prefix "\active@char"| (where the
%    first |"| is the character with its original catcode, when the
%    shorthand is created, and |\active@char"| is a single token). In
%    protected contexts, it expands to |\protect "| or |\noexpand "|
%    (ie, with the original |"|); otherwise |\active@char"| is
%    executed. This macro in turn expands to |\normal@char"| in
%    ``safe'' contexts (eg, |\label|), but |\user@active"| in normal
%    ``unsafe'' ones. The latter search a definition in the user,
%    language and system levels, in this order, but if none is found,
%    |\normal@char"| is used.  However, a deactivated shorthand (with
%    |\bbl@deactivate| is defined as |\active@prefix "\normal@char"|.
%
%    The following macro is used to define shorthands in the three
%    levels. It takes 4 arguments: the (string'ed) character,
%    |\<level>@group|, |<level>@active| and |<next-level>@active|
%    (except in |system|).
%
% \changes{babel~3.9a}{2012/08/18}{New macro, with code from
%    \cs{@initiate@active@char}}
%
%    \begin{macrocode}
\def\bbl@active@def#1#2#3#4{%
  \@namedef{#3#1}{%
    \expandafter\ifx\csname#2@sh@#1@\endcsname\relax
      \bbl@afterelse\bbl@sh@select#2#1{#3@arg#1}{#4#1}%
    \else
      \bbl@afterfi\csname#2@sh@#1@\endcsname
    \fi}%
%    \end{macrocode}
%
%    When there is also no current-level shorthand with an argument we
%    will check whether there is a next-level  defined shorthand for
%    this active character. 
%
%    \begin{macrocode}
  \long\@namedef{#3@arg#1}##1{%
    \expandafter\ifx\csname#2@sh@#1@\string##1@\endcsname\relax
      \bbl@afterelse\csname#4#1\endcsname##1%
    \else
      \bbl@afterfi\csname#2@sh@#1@\string##1@\endcsname
    \fi}}%
%    \end{macrocode}
%
% \changes{babel~3.9a}{2012/08/18}{Removed an extra hash. Now calls
%    \cs{@initiate@active@char} with 3 arguments.}
%
%    |\initiate@active@char| calls |\@initiate@active@char| with 3
%    arguments. All of them are the same character with different
%    catcodes: active, other (|\string|'ed) and the original one.
%    This trick simplifies the code a lot.
%
%    \begin{macrocode}
\def\initiate@active@char#1{%
  \bbl@ifunset{active@char\string#1}%
    {\bbl@withactive
      {\expandafter\@initiate@active@char\expandafter}#1\string#1#1}%
    {}}
%    \end{macrocode}
%
% \changes{babel~3.9e}{2012/08/18}{Introduced the 3-argument
%   \cs{@initiate@active@char}, with different catcodes: active,
%   string'ed, and original. Reorganized}
% \changes{babel~3.9a}{2012/08/19}{The catcode is saved}
% \changes{babel~3.9a}{2012/09/09}{The original definition is saved,
% too}
% \changes{babel~3.9a}{2012/12/27}{Take into account mathematically
%   active chars, to avoid infinite loops}
%
%   The very first thing to do is saving the original catcode and the
%   original definition, even if not active, which is possible
%   (undefined characters require a special treatement to avoid
%   making them |\relax|).  
%
%    \begin{macrocode}
\def\@initiate@active@char#1#2#3{%
  \bbl@csarg\edef{oricat@#2}{\catcode`#2=\the\catcode`#2\relax}%
  \ifx#1\@undefined
    \bbl@csarg\edef{oridef@#2}{\let\noexpand#1\noexpand\@undefined}%
  \else
    \bbl@csarg\let{oridef@@#2}#1%
    \bbl@csarg\edef{oridef@#2}{%
      \let\noexpand#1%
      \expandafter\noexpand\csname bbl@oridef@@#2\endcsname}%
  \fi
%    \end{macrocode}
%
%    If the character is already active we provide the default
%    expansion under this shorthand mechanism. Otherwise we write a
%    message in the transcript file, and define |\normal@char|\m{char}
%    to expand to the character in its default state. If the character
%    is mathematically active when \babel{} is loaded (for example
%    |'|) the normal expansion is somewhat different to avoid an
%    infinite loop (but it does not prevent the loop if the mathcode
%    is set to |"8000| \textit{a posteriori}).
%
%    \begin{macrocode}
  \ifx#1#3\relax
    \expandafter\let\csname normal@char#2\endcsname#3%
  \else
    \bbl@info{Making #2 an active character}%
    \ifnum\mathcode`#2="8000
      \@namedef{normal@char#2}{%
        \textormath{#3}{\csname bbl@oridef@@#2\endcsname}}%
    \else
      \@namedef{normal@char#2}{#3}%
    \fi
%    \end{macrocode}
%
%    To prevent problems with the loading of other packages after
%    \babel\ we reset the catcode of the character to the original one
%    at the end of the package and of each language file (except with
%    \textsf{KeepShorthandsActive}). It is re-activate again at
%    |\begin{document}|.  We also need to make sure that the
%    shorthands are active during the processing of the \file{.aux}
%    file. Otherwise some citations may give unexpected results in
%    the printout when a shorthand was used in the optional argument
%    of |\bibitem| for example. Then we make it active (not strictly
%    necessary, but done for backward compatibility).
%
%    \begin{macrocode}
    \bbl@restoreactive{#2}%
    \AtBeginDocument{%
      \catcode`#2\active
      \if@filesw
        \immediate\write\@mainaux{\catcode`\string#2\active}%
      \fi}%
    \expandafter\bbl@add@special\csname#2\endcsname
    \catcode`#2\active
  \fi
%    \end{macrocode}
%
%    Now we have set |\normal@char|\m{char}, we must define
%    |\active@char|\m{char}, to be executed when the character is
%    activated.  We define the first level expansion of
%    |\active@char|\m{char} to check the status of the |@safe@actives|
%    flag. If it is set to true we expand to the `normal' version of
%    this character, otherwise we call |\user@active|\m{char} to start
%    the search of a definition in the user, language and system
%    levels (or eventually |normal@char|\m{char}).
%
% \changes{babel~3.9a}{2012/12/27}{Added code for option math=normal}
% \changes{babel~3.9i}{2014/02/03}{Don't call directly
%    \cs{user@active}, but with an intermediate step}
%
%    \begin{macrocode}
  \let\bbl@tempa\@firstoftwo
  \if\string^#2%
    \def\bbl@tempa{\noexpand\textormath}%
  \else
    \ifx\bbl@mathnormal\@undefined\else
      \let\bbl@tempa\bbl@mathnormal
    \fi
  \fi
  \expandafter\edef\csname active@char#2\endcsname{%
    \bbl@tempa
      {\noexpand\if@safe@actives
         \noexpand\expandafter
         \expandafter\noexpand\csname normal@char#2\endcsname
       \noexpand\else
         \noexpand\expandafter
         \expandafter\noexpand\csname bbl@doactive#2\endcsname
       \noexpand\fi}%
     {\expandafter\noexpand\csname normal@char#2\endcsname}}%
  \bbl@csarg\edef{doactive#2}{%
    \expandafter\noexpand\csname user@active#2\endcsname}%
%    \end{macrocode}
%
% \changes{babel~3.9a}{2012/12/27}{Shorthands are not defined
%    directly, but with a couple of intermediate macros}
% 
%    We now define the default values which the shorthand is set to
%    when activated or deactivated. It is set to the deactivated form
%    (globally), so that the character expands to
%    \begin{center}
%    |\active@prefix| \m{char} |\normal@char|\m{char}
%    \end{center}
%    (where |\active@char|\m{char} is \emph{one} control sequence!).
%
%    \begin{macrocode}
  \bbl@csarg\edef{active@#2}{%
    \noexpand\active@prefix\noexpand#1%
    \expandafter\noexpand\csname active@char#2\endcsname}%
  \bbl@csarg\edef{normal@#2}{%
    \noexpand\active@prefix\noexpand#1%
    \expandafter\noexpand\csname normal@char#2\endcsname}%
  \expandafter\let\expandafter#1\csname bbl@normal@#2\endcsname
%    \end{macrocode}
%
%    The next level of the code checks whether a user has defined a
%    shorthand for himself with this character. First we check for a
%    single character shorthand. If that doesn't exist we check for a
%    shorthand with an argument.
%
% \changes{babel~3.8b}{2004/04/19}{Now use \cs{bbl@sh@select}}
% \changes{babel~3.9a}{2012/08/18}{Instead of the ``copy-paste pattern''
% a new macro is used}
%
%    \begin{macrocode}
  \bbl@active@def#2\user@group{user@active}{language@active}%
  \bbl@active@def#2\language@group{language@active}{system@active}%
  \bbl@active@def#2\system@group{system@active}{normal@char}%
%    \end{macrocode}
%
%    In order to do the right thing when a shorthand with an argument
%    is used by itself at the end of the line we provide a definition
%    for the case of an empty argument. For that case we let the
%    shorthand character expand to its non-active self. Also, When a
%    shorthand combination such as |''| ends up in a heading \TeX\
%    would see |\protect'\protect'|. To prevent this from happening a
%    couple of shorthand needs to be defined at user level.
%
% \changes{babel~3.9a}{2012/8/18}{Use \cs{user@group}, as above,
%    instead of the hardwired \texttt{user}}
%
%    \begin{macrocode}
  \expandafter\edef\csname\user@group @sh@#2@@\endcsname
    {\expandafter\noexpand\csname normal@char#2\endcsname}%
  \expandafter\edef\csname\user@group @sh@#2@\string\protect@\endcsname
    {\expandafter\noexpand\csname user@active#2\endcsname}%
%    \end{macrocode}
%
%    Finally, a couple of special cases are taken care of.  (1) If we
%    are making the right quote (|'|) active we need to change |\pr@m@s| as
%    well.  Also, make sure that a single |'| in math mode `does the
%    right thing'.  (2) If we are using the caret (|^|) as a shorthand
%    character special care should be taken to make sure math still
%    works. Therefore an extra level of expansion is introduced with a
%    check for math mode on the upper level.
%
% \changes{babel~3.9a}{2012/09/11}{The output routine resets the quote
%   to \cs{active@math@prime}, so we redefine the latter with the new
%  ``normal'' value}
% \changes{babel~3.9a}{2012/06/20}{Added a couple of missing
%    comment characters (PR 4146)}
% \changes{babel~3.9a}{2012/07/29}{Use \cs{textormath} instead of
%    \cs{ifmath}}
% \changes{babel~3.9a}{2012/11/26}{Compare the char, irrespective of
%    its catcode.}
% \changes{babel~3.9a}{2012/12/27}{Removed the redeclaration of
%   \cs{normal@char'} because it is handled in a generic way above}
% \changes{babel~3.9a}{2012/12/29}{Removed the intermediate step of
%   \cs{bbl@act@caret} and moved above} 
% \changes{babel~3.9i}{2012/12/29}{Added the event \cs{initiateactive}} 
%
%    \begin{macrocode}
  \if\string'#2%
    \let\prim@s\bbl@prim@s
    \let\active@math@prime#1%
  \fi
  \bbl@usehooks{initiateactive}{{#1}{#2}{#3}}}
%    \end{macrocode}
%
%    The following package options control the behavior of shorthands
%    in math mode.
%
%    \begin{macrocode}
%<<*More package options>>
\DeclareOption{math=active}{}
\DeclareOption{math=normal}{\def\bbl@mathnormal{\noexpand\textormath}}
%<</More package options>>
%    \end{macrocode}
%
%    Initiating a shorthand makes active the char. That is not
%    strictly necessary but it is still done for backward
%    compatibility. So we need to restore the original catcode at the
%    end of package \textit{and} and the end of the |ldf|.
%
% \changes{babel~3.9a}{2012/07/04}{Catcodes are also restored after
%    each language, to prevent incompatibilities. Use \cs{string} instead
%    of \cs{noexpand} and add \cs{relax}}
% \changes{babel~3.9a}{2012/10/18}{Catcodes are deactivated in a separate
%    macro, which is made no-op when babel exits}
%
%    \begin{macrocode}
\@ifpackagewith{babel}{KeepShorthandsActive}%
  {\let\bbl@restoreactive\@gobble}%
  {\def\bbl@restoreactive#1{%
     \bbl@exp{%
       \\\AfterBabelLanguage\\\CurrentOption
         {\catcode`#1=\the\catcode`#1\relax}%
       \\\AtEndOfPackage
         {\catcode`#1=\the\catcode`#1\relax}}}%
   \AtEndOfPackage{\let\bbl@restoreactive\@gobble}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@sh@select}
%    This command helps the shorthand supporting macros to select how
%    to proceed. Note that this macro needs to be expandable as do all
%    the shorthand macros in order for them to work in expansion-only
%    environments such as the argument of |\hyphenation|.
%
%    This macro expects the name of a group of shorthands in its first
%    argument and a shorthand character in its second argument. It
%    will expand to either |\bbl@firstcs| or |\bbl@scndcs|. Hence two
%    more arguments need to follow it.
%
% \changes{babel~3.8b}{2004/04/19}{Added command}
% \changes{babel~3.9a}{2012/08/18}{Removed \cs{string}s, because the
%   char are already string'ed}
%
%    \begin{macrocode}
\def\bbl@sh@select#1#2{%
  \expandafter\ifx\csname#1@sh@#2@sel\endcsname\relax
    \bbl@afterelse\bbl@scndcs
  \else
    \bbl@afterfi\csname#1@sh@#2@sel\endcsname
  \fi}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\active@prefix}
%    The command |\active@prefix| which is used in the expansion of
%    active characters has a function similar to |\OT1-cmd| in that it
%    |\protect|s the active character whenever |\protect| is
%    \emph{not} |\@typeset@protect|.
%
%    \begin{macrocode}
\def\active@prefix#1{%
  \ifx\protect\@typeset@protect
  \else
%    \end{macrocode}
%
%    When |\protect| is set to |\@unexpandable@protect| we make sure
%    that the active character is als \emph{not} expanded by inserting
%    |\noexpand| in front of it. The |\@gobble| is needed to remove
%    a token such as |\activechar:| (when the double colon was the
%    active character to be dealt with).
%
%    \begin{macrocode}
    \ifx\protect\@unexpandable@protect
      \noexpand#1%
    \else
      \protect#1%
    \fi
    \expandafter\@gobble
  \fi}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\if@safe@actives}
%    In some circumstances it is necessary to be able to change the
%    expansion of an active character on the fly. For this purpose the
%    switch |@safe@actives| is available. The setting of this switch
%    should be checked in the first level expansion of
%    |\active@char|\m{char}.
%
%    \begin{macrocode}
\newif\if@safe@actives
\@safe@activesfalse
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@restore@actives}
%    When the output routine kicks in while the
%    active characters were made ``safe'' this must be undone in
%    the headers to prevent unexpected typeset results. For this
%    situation we define a command to make them ``unsafe'' again.
%
%    \begin{macrocode}
\def\bbl@restore@actives{\if@safe@actives\@safe@activesfalse\fi}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@activate}
%  \begin{macro}{\bbl@deactivate}
%
%  \changes{babel~3.9a}{2013/01/11}{\cs{bbl@withactive} makes sure the
%    catcode is active}
%
%    Both macros take one argument, like |\initiate@active@char|. The
%    macro is used to change the definition of an active character to
%    expand to |\active@char|\m{char} in the case of |\bbl@activate|,
%    or |\normal@char|\m{char} in the case of
%    |\bbl@deactivate|.
%
%    \begin{macrocode}
\def\bbl@activate#1{%
  \bbl@withactive{\expandafter\let\expandafter}#1%
    \csname bbl@active@\string#1\endcsname}
\def\bbl@deactivate#1{%
  \bbl@withactive{\expandafter\let\expandafter}#1%
    \csname bbl@normal@\string#1\endcsname}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\bbl@firstcs}
%  \begin{macro}{\bbl@scndcs}
%    These macros have two arguments. They use one of their arguments
%    to build a control sequence from.
%
%    \begin{macrocode}
\def\bbl@firstcs#1#2{\csname#1\endcsname}
\def\bbl@scndcs#1#2{\csname#2\endcsname}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\declare@shorthand}
%    The command |\declare@shorthand| is used to declare a shorthand
%    on a certain level. It takes three arguments:
%    \begin{enumerate}
%    \item a name for the collection of shorthands, i.e. `system', or
%      `dutch';
%    \item the character (sequence) that makes up the shorthand,
%      i.e. |~| or |"a|;
%    \item the code to be executed when the shorthand is encountered.
%    \end{enumerate}
%
% \changes{babel~3.8b}{2004/04/19}{We need to support shorthands with
%    and without argument in different groups; added the name of the
%    group to the storage macro}
% \changes{babel~3.9a}{2012/07/03}{Check if shorthands are redefined}
%
%    \begin{macrocode}
\def\declare@shorthand#1#2{\@decl@short{#1}#2\@nil}
\def\@decl@short#1#2#3\@nil#4{%
  \def\bbl@tempa{#3}%
  \ifx\bbl@tempa\@empty
    \expandafter\let\csname #1@sh@\string#2@sel\endcsname\bbl@scndcs
    \bbl@ifunset{#1@sh@\string#2@}{}%
      {\def\bbl@tempa{#4}%
       \expandafter\ifx\csname#1@sh@\string#2@\endcsname\bbl@tempa
       \else
         \bbl@info
           {Redefining #1 shorthand \string#2\\%
            in language \CurrentOption}%
       \fi}%
    \@namedef{#1@sh@\string#2@}{#4}%
  \else
    \expandafter\let\csname #1@sh@\string#2@sel\endcsname\bbl@firstcs
    \bbl@ifunset{#1@sh@\string#2@\string#3@}{}%
      {\def\bbl@tempa{#4}%
       \expandafter\ifx\csname#1@sh@\string#2@\string#3@\endcsname\bbl@tempa
       \else
         \bbl@info
           {Redefining #1 shorthand \string#2\string#3\\%
            in language \CurrentOption}%
       \fi}%
    \@namedef{#1@sh@\string#2@\string#3@}{#4}%
  \fi}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\textormath}
%    Some of the shorthands that will be declared by the language
%    definition files have to be usable in both text and mathmode. To
%    achieve this the helper macro |\textormath| is provided.
%
% \changes{babel~3.9a}{2012/12/29}{Failed if an argument had a
%    condicional. Use the more robust mechanism of \cs{XXXoftwo}} 
%
%    \begin{macrocode}
\def\textormath{%
  \ifmmode
    \expandafter\@secondoftwo
  \else
    \expandafter\@firstoftwo
  \fi}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\user@group}
%  \begin{macro}{\language@group}
%  \begin{macro}{\system@group}
%    The current concept of `shorthands' supports three levels or
%    groups of shorthands. For each level the name of the level or
%    group is stored in a macro. The default is to have a user group;
%    use language group `english' and have a system group called
%    `system'.
%
%    \begin{macrocode}
\def\user@group{user}
\def\language@group{english}
\def\system@group{system}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\useshorthands}
%    This is the user level command to tell \LaTeX\ that user level
%    shorthands will be used in the document. It takes one argument,
%    the character that starts a shorthand. First note that this is
%    user level, and then initialize and activate the character for
%    use as a shorthand character (ie, it's active in the
%    preamble). Languages can deactivate shorthands, so a starred
%    version is also provided which activates them always after the
%    language has been switched.
%
% \changes{babel~3.9a}{2012/08/05}{Now \cs{bbl@activate} makes sure
%    the catcode is active, so this part is simplified}
% \changes{babel~3.9a}{2012/08/12}{User shorhands can be
%   defined even with shorthands=off}
%
%    \begin{macrocode}
\def\useshorthands{%
  \@ifstar\bbl@usesh@s{\bbl@usesh@x{}}}
\def\bbl@usesh@s#1{%
  \bbl@usesh@x
    {\AddBabelHook{babel-sh-\string#1}{afterextras}{\bbl@activate{#1}}}%
    {#1}}
\def\bbl@usesh@x#1#2{%
  \bbl@ifshorthand{#2}%
    {\def\user@group{user}%
     \initiate@active@char{#2}%
     #1%
     \bbl@activate{#2}}%
    {\bbl@error
       {Cannot declare a shorthand turned off (\string#2)}
       {Sorry, but you cannot use shorthands which have been\\%
        turned off in the package options}}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\defineshorthand}
%
% \changes{babel~3.9a}{2012/08/05}{Added optional argument, to provide
%    a way to (re)define language shorthands} 
% \changes{babel~3.9a}{2012/08/25}{Extended for language-dependent
%    user macros, with two new auxiliary macros}
%
%    Currently we only support two groups of user level shorthands,
%    named internally |user| and |user@<lang>| (language-dependent
%    user shorthands). By default, only the first one is taken into
%    account, but if the former is also used (in the optional argument
%    of |\defineshorthand|) a new level is inserted for it
%    (|user@generic|, done by |\bbl@set@user@generic|); we make also
%    sure |{}| and |\protect| are taken into account in this new top
%    level.
%
%    \begin{macrocode}
\def\user@language@group{user@\language@group}
\def\bbl@set@user@generic#1#2{%
  \bbl@ifunset{user@generic@active#1}%
    {\bbl@active@def#1\user@language@group{user@active}{user@generic@active}%
     \bbl@active@def#1\user@group{user@generic@active}{language@active}%
     \expandafter\edef\csname#2@sh@#1@@\endcsname{%
       \expandafter\noexpand\csname normal@char#1\endcsname}%
     \expandafter\edef\csname#2@sh@#1@\string\protect@\endcsname{%
       \expandafter\noexpand\csname user@active#1\endcsname}}%
  \@empty}
\newcommand\defineshorthand[3][user]{%
  \edef\bbl@tempa{\zap@space#1 \@empty}%
  \bbl@for\bbl@tempb\bbl@tempa{%
    \if*\expandafter\@car\bbl@tempb\@nil
      \edef\bbl@tempb{user@\expandafter\@gobble\bbl@tempb}%
      \@expandtwoargs
        \bbl@set@user@generic{\expandafter\string\@car#2\@nil}\bbl@tempb
    \fi
    \declare@shorthand{\bbl@tempb}{#2}{#3}}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\languageshorthands}
%    A user level command to change the language from which shorthands
%    are used. Unfortunately, \babel{} currently does not keep track
%    of defined groups, and therefore there is no way to catch a
%    possible change in casing.
%
%    \begin{macrocode}
\def\languageshorthands#1{\def\language@group{#1}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\aliasshorthand}
%    First the new shorthand needs to be initialized,
%
%    \begin{macrocode}
\def\aliasshorthand#1#2{%
  \bbl@ifshorthand{#2}%
    {\expandafter\ifx\csname active@char\string#2\endcsname\relax
       \ifx\document\@notprerr
         \@notshorthand{#2}%
       \else
         \initiate@active@char{#2}%
%    \end{macrocode}
%
% \changes{babel~3.9a}{2012/08/06}{Instead of letting the new shorthand to
%    the original char, which very often didn't work, we define it
%    directly}
% \changes{babel~3.9a}{2012/08/20}{Make sure both characters (old an
%    new) are active}
%
%    Then, we define the new shorthand in terms of the original
%    one, but note with |\aliasshorthands{"}{/}| is
%    |\active@prefix /\active@char/|, so we still need to let the
%    lattest to |\active@char"|.
%
%    \begin{macrocode}
         \expandafter\let\csname active@char\string#2\expandafter\endcsname
           \csname active@char\string#1\endcsname
         \expandafter\let\csname normal@char\string#2\expandafter\endcsname
           \csname normal@char\string#1\endcsname
         \bbl@activate{#2}%
       \fi
     \fi}%
    {\bbl@error
       {Cannot declare a shorthand turned off (\string#2)}
       {Sorry, but you cannot use shorthands which have been\\%
        turned off in the package options}}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\@notshorthand}
%
% \changes{v3.8d}{2004/11/20}{Error message added}
%    
%    \begin{macrocode}
\def\@notshorthand#1{%
  \bbl@error{%
    The character `\string #1' should be made a shorthand character;\\%
    add the command \string\useshorthands\string{#1\string} to
    the preamble.\\%
    I will ignore your instruction}%
   {You may proceed, but expect unexpected results}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\shorthandon}
%  \begin{macro}{\shorthandoff}
%    The first level definition of these macros just passes the
%    argument on to |\bbl@switch@sh|, adding |\@nil| at the end to
%    denote the end of the list of characters.
%
%    \begin{macrocode}
\newcommand*\shorthandon[1]{\bbl@switch@sh\@ne#1\@nnil}
\DeclareRobustCommand*\shorthandoff{%
  \@ifstar{\bbl@shorthandoff\tw@}{\bbl@shorthandoff\z@}}
\def\bbl@shorthandoff#1#2{\bbl@switch@sh#1#2\@nnil}
%    \end{macrocode}
%
%  \begin{macro}{\bbl@switch@sh}
%
%   \changes{babel~3.9a}{2013/02/21}{Code revised}
%
%    The macro |\bbl@switch@sh| takes the list of characters apart one
%    by  one and subsequently switches the category code of the
%    shorthand character according to the first argument of
%    |\bbl@switch@sh|.
%
%    But before any of this switching takes place we make sure that
%    the character we are dealing with is known as a shorthand
%    character. If it is, a macro such as |\active@char"| should
%    exist.
%
%    Switching off and on is easy -- we just set the category
%    code to `other' (12) and |\active|. With the starred version, the
%    original catcode and the original definition, saved
%    in |@initiate@active@char|, are restored. 
%
%    \begin{macrocode}
\def\bbl@switch@sh#1#2{%
  \ifx#2\@nnil\else
    \bbl@ifunset{bbl@active@\string#2}%
      {\bbl@error
         {I cannot switch `\string#2' on or off--not a shorthand}%
         {This character is not a shorthand. Maybe you made\\%
          a typing mistake? I will ignore your instruction}}%
      {\ifcase#1%
         \catcode`#212\relax
       \or
         \catcode`#2\active
       \or
         \csname bbl@oricat@\string#2\endcsname
         \csname bbl@oridef@\string#2\endcsname
       \fi}%
    \bbl@afterfi\bbl@switch@sh#1%
  \fi}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% \changes{babel~3.9a}{2012/06/16}{Added code}
%
% Note the value is that at the expansion time, eg, in the preample
% shorhands are usually deactivated.
%
%    \begin{macrocode}
\def\babelshorthand{\active@prefix\babelshorthand\bbl@putsh}
\def\bbl@putsh#1{%
  \bbl@ifunset{bbl@active@\string#1}%
     {\bbl@putsh@i#1\@empty\@nnil}%
     {\csname bbl@active@\string#1\endcsname}}
\def\bbl@putsh@i#1#2\@nnil{%
  \csname\languagename @sh@\string#1@%
    \ifx\@empty#2\else\string#2@\fi\endcsname}
\ifx\bbl@opt@shorthands\@nnil\else
  \let\bbl@s@initiate@active@char\initiate@active@char
  \def\initiate@active@char#1{%
    \bbl@ifshorthand{#1}{\bbl@s@initiate@active@char{#1}}{}}
  \let\bbl@s@switch@sh\bbl@switch@sh
  \def\bbl@switch@sh#1#2{%
    \ifx#2\@nnil\else
      \bbl@afterfi
      \bbl@ifshorthand{#2}{\bbl@s@switch@sh#1{#2}}{\bbl@switch@sh#1}%
    \fi}
  \let\bbl@s@activate\bbl@activate
  \def\bbl@activate#1{%
    \bbl@ifshorthand{#1}{\bbl@s@activate{#1}}{}}
  \let\bbl@s@deactivate\bbl@deactivate
  \def\bbl@deactivate#1{%
    \bbl@ifshorthand{#1}{\bbl@s@deactivate{#1}}{}}
\fi
%    \end{macrocode}
%
% \changes{babel~3.9a}{2012/12/27}{Removed redundant system declarations}
%
%  \begin{macro}{\bbl@prim@s}
%  \begin{macro}{\bbl@pr@m@s}
%
% \changes{babel~3.9a}{2012/07/29}{\cs{bbl@pr@m@s} rewritten to
%    take into account catcodes for both the quote and the hat}
%
%    One of the internal macros that are involved in substituting
%    |\prime| for each right quote in mathmode is |\prim@s|. This
%    checks if the next character is a right quote. When the right
%    quote is active, the definition of this macro needs to be adapted
%    to look also for an active right quote; the hat could be active,
%    too.
%
%    \begin{macrocode}
\def\bbl@prim@s{%
  \prime\futurelet\@let@token\bbl@pr@m@s}
\def\bbl@if@primes#1#2{%
  \ifx#1\@let@token
    \expandafter\@firstoftwo
  \else\ifx#2\@let@token
    \bbl@afterelse\expandafter\@firstoftwo
  \else
    \bbl@afterfi\expandafter\@secondoftwo
  \fi\fi}
\begingroup
  \catcode`\^=7  \catcode`\*=\active  \lccode`\*=`\^
  \catcode`\'=12 \catcode`\"=\active  \lccode`\"=`\' 
  \lowercase{%
    \gdef\bbl@pr@m@s{%
      \bbl@if@primes"'%
        \pr@@@s
        {\bbl@if@primes*^\pr@@@t\egroup}}}
\endgroup
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%    Usually the |~| is active and expands to \verb*=\penalty\@M\ =.
%    When it is written to the \file{.aux} file it is written
%    expanded. To prevent that and to be able to use the character |~|
%    as a start character for a shorthand, it is redefined here as a
%    one character shorthand on system level. The system declaration
%    is in most cases redundant (when |~| is still a non-break space),
%    and in some cases is inconvenient (if |~| has been redefined);
%    however, for backward compatibility it is maintained (some
%    existing documents may rely on the \babel{} value).
%
% \changes{babel~3.9i}{2014/02/06}{Moved from above, after
%    \cs{bbl@usehook} has been defined}
% \changes{babel~3.9k}{2014/02/06}{Moved again at the original place}
%
%    \begin{macrocode}
\initiate@active@char{~}
\declare@shorthand{system}{~}{\leavevmode\nobreak\ }
\bbl@activate{~}
%    \end{macrocode}
%
%  \begin{macro}{\OT1dqpos}
%  \begin{macro}{\T1dqpos}
%    The position of the double quote character is different for the
%    OT1 and T1 encodings. It will later be selected using the
%    |\f@encoding| macro. Therefore we define two macros here to store
%    the position of the character in these encodings.
%
%    \begin{macrocode}
\expandafter\def\csname OT1dqpos\endcsname{127}
\expandafter\def\csname T1dqpos\endcsname{4}
%    \end{macrocode}
%
%    When the macro |\f@encoding| is undefined (as it is in plain
%    \TeX) we define it here to expand to \texttt{OT1}
%
%    \begin{macrocode}
\ifx\f@encoding\@undefined
  \def\f@encoding{OT1}
\fi
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
% \subsection{Language attributes}
%
%    Language attributes provide a means to give the user control over
%    which features of the language definition files he wants to
%    enable.
%  \begin{macro}{\languageattribute}
%
% \changes{babel~3.9a}{2012/09/07}{Use \cs{@expandtwoargs} with
%   \cs{in@}}
%
%    The macro |\languageattribute| checks whether its arguments are
%    valid and then activates the selected language attribute.
%    First check whether the language is known, and then process each
%    attribute in the list.
%
%    \begin{macrocode}
\bbl@trace{Language attributes}
\newcommand\languageattribute[2]{%
  \def\bbl@tempc{#1}%
  \bbl@fixname\bbl@tempc
  \bbl@iflanguage\bbl@tempc{%
    \bbl@vforeach{#2}{%
%    \end{macrocode}
%
%    We want to make sure that each attribute is selected only once;
%    therefore we store the already selected attributes in
%    |\bbl@known@attribs|. When that control sequence is not yet
%    defined this attribute is certainly not selected before.
%
%    \begin{macrocode}
      \ifx\bbl@known@attribs\@undefined
        \in@false
      \else
%    \end{macrocode}
%
%    Now we need to see if the attribute occurs in the list of
%    already selected attributes.
%
%    \begin{macrocode}
        \bbl@xin@{,\bbl@tempc-##1,}{,\bbl@known@attribs,}%
      \fi
%    \end{macrocode}
%
%    When the attribute was in the list we issue a warning; this might
%    not be the users intention.
%
%    \begin{macrocode}
      \ifin@
        \bbl@warning{%
          You have more than once selected the attribute '##1'\\%
          for language #1}%
      \else
%    \end{macrocode}
%
%    When we end up here the attribute is not selected before. So, we
%    add it to the list of selected attributes and execute the
%    associated \TeX-code.
%
%    \begin{macrocode}
        \bbl@exp{%
          \\\bbl@add@list\\\bbl@known@attribs{\bbl@tempc-##1}}%
        \edef\bbl@tempa{\bbl@tempc-##1}%
        \expandafter\bbl@ifknown@ttrib\expandafter{\bbl@tempa}\bbl@attributes%
        {\csname\bbl@tempc @attr@##1\endcsname}%
        {\@attrerr{\bbl@tempc}{##1}}%
     \fi}}}
%    \end{macrocode}
%
%    This command should only be used in the preamble of a document.
%
%    \begin{macrocode}
\@onlypreamble\languageattribute
%    \end{macrocode}
%
%    The error text to be issued when an unknown attribute is
%    selected.
%
%    \begin{macrocode}
\newcommand*{\@attrerr}[2]{%
  \bbl@error
    {The attribute #2 is unknown for language #1.}%
    {Your command will be ignored, type <return> to proceed}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@declare@ttribute}
%    This command adds the new language/attribute combination to the
%    list of known attributes.
%
%    Then it defines a control sequence to be executed when the
%    attribute is used in a document. The result of this should be
%    that the macro |\extras...| for the current language is extended,
%    otherwise the attribute will not work as its code is removed from
%    memory at |\begin{document}|.
%
%    \begin{macrocode}
\def\bbl@declare@ttribute#1#2#3{%
  \bbl@xin@{,#2,}{,\BabelModifiers,}%
  \ifin@
    \AfterBabelLanguage{#1}{\languageattribute{#1}{#2}}%
  \fi
  \bbl@add@list\bbl@attributes{#1-#2}%
  \expandafter\def\csname#1@attr@#2\endcsname{#3}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@ifattributeset}
%    This internal macro has 4 arguments. It can be used to interpret
%    \TeX\ code based on whether a certain attribute was set. This
%    command should appear inside the argument to |\AtBeginDocument|
%    because the attributes are set in the document preamble,
%    \emph{after} \babel\ is loaded.
%
%    The first argument is the language, the second argument the
%    attribute being checked, and the third and fourth arguments are
%    the true and false clauses.
%
%    \begin{macrocode}
\def\bbl@ifattributeset#1#2#3#4{%
%    \end{macrocode}
%
%    First we need to find out if any attributes were set; if not
%    we're done.
%
%    \begin{macrocode}
  \ifx\bbl@known@attribs\@undefined
    \in@false
  \else
%    \end{macrocode}
%
%    The we need to check the list of known attributes.
%
%    \begin{macrocode}
    \bbl@xin@{,#1-#2,}{,\bbl@known@attribs,}%
  \fi
%    \end{macrocode}
%
%    When we're this far |\ifin@| has a value indicating if the
%    attribute in question was set or not. Just to be safe the code to
%    be executed is `thrown over the |\fi|'.
%
%    \begin{macrocode}
  \ifin@
    \bbl@afterelse#3%
  \else
    \bbl@afterfi#4%
  \fi
  }
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@ifknown@ttrib}
%    An internal macro to check whether a given language/attribute is
%    known. The macro takes 4 arguments, the language/attribute, the
%    attribute list, the \TeX-code to be executed when the attribute
%    is known and the \TeX-code to be executed otherwise.
%
%    \begin{macrocode}
\def\bbl@ifknown@ttrib#1#2{%
%    \end{macrocode}
%
%    We first assume the attribute is unknown.
%
%    \begin{macrocode}
  \let\bbl@tempa\@secondoftwo
%    \end{macrocode}
%
%    Then we loop over the list of known attributes, trying to find a
%    match.
%
%    \begin{macrocode}
  \bbl@loopx\bbl@tempb{#2}{%
    \expandafter\in@\expandafter{\expandafter,\bbl@tempb,}{,#1,}%
    \ifin@
%    \end{macrocode}
%
%    When a match is found the definition of |\bbl@tempa| is changed.
%
%    \begin{macrocode}
      \let\bbl@tempa\@firstoftwo
    \else
    \fi}%
%    \end{macrocode}
%
%    Finally we execute |\bbl@tempa|.
%
%    \begin{macrocode}
  \bbl@tempa
}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@clear@ttribs}
%    This macro removes all the attribute code from \LaTeX's memory at
%    |\begin{document}| time (if any is present).
%
%    \begin{macrocode}
\def\bbl@clear@ttribs{%
  \ifx\bbl@attributes\@undefined\else
    \bbl@loopx\bbl@tempa{\bbl@attributes}{%
      \expandafter\bbl@clear@ttrib\bbl@tempa.
      }%
    \let\bbl@attributes\@undefined
  \fi}
\def\bbl@clear@ttrib#1-#2.{%
  \expandafter\let\csname#1@attr@#2\endcsname\@undefined}
\AtBeginDocument{\bbl@clear@ttribs}
%    \end{macrocode}
%
%  \end{macro}
%
% \subsection{Support for saving macro definitions}
%
%  To save the meaning of control sequences using |\babel@save|, we
%  use temporary control sequences.  To save hash table entries for
%  these control sequences, we don't use the name of the control
%  sequence to be saved to construct the temporary name.  Instead we
%  simply use the value of a counter, which is reset to zero each time
%  we begin to save new values.  This works well because we release
%  the saved meanings before we begin to save a new set of control
%  sequence meanings (see |\selectlanguage| and |\originalTeX|). Note
%  undefined macros are not undefined any more when saved -- they are
%  |\relax|'ed.
%
%  \begin{macro}{\babel@savecnt}
%  \begin{macro}{\babel@beginsave}
%    The initialization of a new save cycle: reset the counter to
%    zero.
%
%    \begin{macrocode}
\bbl@trace{Macros for saving definitions}
\def\babel@beginsave{\babel@savecnt\z@}
%    \end{macrocode}
%
%    Before it's forgotten, allocate the counter and initialize all.
%
%    \begin{macrocode}
\newcount\babel@savecnt
\babel@beginsave
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\babel@save}
%    The macro |\babel@save|\meta{csname} saves the current meaning of
%    the control sequence \meta{csname} to
%    |\originalTeX|\footnote{\cs{originalTeX} has to be
%    expandable, i.\,e.\ you shouldn't let it to \cs{relax}.}.
%    To do this, we let the current meaning to a temporary control
%    sequence, the restore commands are appended to |\originalTeX| and
%    the counter is incremented.
%
%    \begin{macrocode}
\def\babel@save#1{%
  \expandafter\let\csname babel@\number\babel@savecnt\endcsname#1\relax
  \toks@\expandafter{\originalTeX\let#1=}%
  \bbl@exp{%
    \def\\\originalTeX{\the\toks@\<babel@\number\babel@savecnt>\relax}}%
  \advance\babel@savecnt\@ne}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\babel@savevariable}
%
%    The macro |\babel@savevariable|\meta{variable} saves the value of
%    the variable.  \meta{variable} can be anything allowed after the
%    |\the| primitive.
%
%    \begin{macrocode}
\def\babel@savevariable#1{%
  \toks@\expandafter{\originalTeX #1=}%
  \bbl@exp{\def\\\originalTeX{\the\toks@\the#1\relax}}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@frenchspacing}
%  \begin{macro}{\bbl@nonfrenchspacing}
%    Some languages need to have |\frenchspacing| in effect. Others
%    don't want that. The command |\bbl@frenchspacing| switches it on
%    when it isn't already in effect and |\bbl@nonfrenchspacing|
%    switches it off if necessary.
%
%    \begin{macrocode}
\def\bbl@frenchspacing{%
  \ifnum\the\sfcode`\.=\@m
    \let\bbl@nonfrenchspacing\relax
  \else
    \frenchspacing
    \let\bbl@nonfrenchspacing\nonfrenchspacing
  \fi}
\let\bbl@nonfrenchspacing\nonfrenchspacing
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
% \subsection{Short tags}
%
% \begin{macro}{\babeltags}
% This macro is straightforward. After zapping spaces, we
% loop over the list and define the macros |\text|\m{tag} and
% |\|\m{tag}. Definitions are first expanded so that they don't
% contain |\csname| but the actual macro.
%
% \changes{babel~3.9i}{2014/02/21}{Macro \cs{babeltags} added}
%
%   \begin{macrocode}
\bbl@trace{Short tags}
\def\babeltags#1{%
  \edef\bbl@tempa{\zap@space#1 \@empty}%
  \def\bbl@tempb##1=##2\@@{%
    \edef\bbl@tempc{%
      \noexpand\newcommand
      \expandafter\noexpand\csname ##1\endcsname{%
        \noexpand\protect
        \expandafter\noexpand\csname otherlanguage*\endcsname{##2}}
      \noexpand\newcommand
      \expandafter\noexpand\csname text##1\endcsname{%
        \noexpand\foreignlanguage{##2}}}
    \bbl@tempc}%
  \bbl@for\bbl@tempa\bbl@tempa{%
    \expandafter\bbl@tempb\bbl@tempa\@@}}
%    \end{macrocode}
%
% \end{macro}
%
% \subsection{Hyphens}
%
%  \begin{macro}{\babelhyphenation}
%
%     This macro saves hyphenation exceptions. Two macros are used to
%     store them: |\bbl@hyphenation@| for the global ones and
%     |\bbl@hyphenation<lang>| for language ones. See |\bbl@patterns|
%     above for further details. We make sure there is a space between
%     words when multiple commands are used.
%
%     \changes{babel~3.9a}{2012/08/28}{Macro added}
%
%    \begin{macrocode}
\bbl@trace{Hyphens}
\@onlypreamble\babelhyphenation
\AtEndOfPackage{%
  \newcommand\babelhyphenation[2][\@empty]{%
    \ifx\bbl@hyphenation@\relax
      \let\bbl@hyphenation@\@empty
    \fi
    \ifx\bbl@hyphlist\@empty\else
      \bbl@warning{%
        You must not intermingle \string\selectlanguage\space and\\%
        \string\babelhyphenation\space or some exceptions will not\\%
        be taken into account. Reported}%
    \fi
    \ifx\@empty#1%
      \protected@edef\bbl@hyphenation@{\bbl@hyphenation@\space#2}%
    \else
      \bbl@vforeach{#1}{%
        \def\bbl@tempa{##1}%
        \bbl@fixname\bbl@tempa
        \bbl@iflanguage\bbl@tempa{%
          \bbl@csarg\protected@edef{hyphenation@\bbl@tempa}{%
            \bbl@ifunset{bbl@hyphenation@\bbl@tempa}%
              \@empty
              {\csname bbl@hyphenation@\bbl@tempa\endcsname\space}%
            #2}}}%
    \fi}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@allowhyphens}
%
% \changes{babel-3.9a}{2012/07/28}{Replaced many \cs{allowhyphens} by
%    \cs{bbl@allowhyphen}. They were either no-op or executed always.}
% \changes{babel-3.9i}{2014/01/29}{\cs{bbl@allowhyphens} must be
%    ignored at the beginning of a paragraph or table cell.}
% \changes{babel-3.9t}{2017/04/26}{Fixed misplaced \cs{nobreak} -
%    sx366454 - soft hyphens could vanish.}
%
%    This macro makes hyphenation possible. Basically its definition
%    is nothing more than |\nobreak| |\hskip| \texttt{0pt plus
%    0pt}\footnote{\TeX\ begins and ends a word for hyphenation at a
%    glue node. The penalty prevents a linebreak at this glue node.}.
%
%    \begin{macrocode}
\def\bbl@allowhyphens{\ifvmode\else\nobreak\hskip\z@skip\fi}
\def\bbl@t@one{T1}
\def\allowhyphens{\ifx\cf@encoding\bbl@t@one\else\bbl@allowhyphens\fi}
%    \end{macrocode}
%
%  \end{macro}
%
% \changes{babel-3.9a}{2012/08/27}{Added \cs{babelhyphen} and related
%    macros}
%
% \begin{macro}{\babelhyphen}
%
%    Macros to insert common hyphens. Note the space before |@| in
%    |\babelhyphen|. Instead of protecting it with
%    |\DeclareRobustCommand|, which could insert a |\relax|, we use
%    the same procedure as shorthands, with |\active@prefix|.
%
%    \begin{macrocode}
\newcommand\babelnullhyphen{\char\hyphenchar\font}
\def\babelhyphen{\active@prefix\babelhyphen\bbl@hyphen}
\def\bbl@hyphen{%
  \@ifstar{\bbl@hyphen@i @}{\bbl@hyphen@i\@empty}}
\def\bbl@hyphen@i#1#2{%
  \bbl@ifunset{bbl@hy@#1#2\@empty}%
    {\csname bbl@#1usehyphen\endcsname{\discretionary{#2}{}{#2}}}%
    {\csname bbl@hy@#1#2\@empty\endcsname}}
%    \end{macrocode}
%
%    The following two commands are used to wrap the ``hyphen'' and
%    set the behavior of the rest of the word -- the version with a
%    single |@| is used when further hyphenation is allowed, while
%    that with |@@| if no more hyphen are allowed. In both cases, if
%    the hyphen is preceded by a positive space, breaking after the
%    hyphen is disallowed.
%
%    There should not be a discretionaty after a hyphen at the
%    beginning of a word, so it is prevented if preceded by a
%    skip. Unfortunately, this does handle cases like ``(-suffix)''.
%    |\nobreak| is always preceded by |\leavevmode|, in case the
%    shorthand starts a paragraph.
%
%    \begin{macrocode}
\def\bbl@usehyphen#1{%
  \leavevmode
  \ifdim\lastskip>\z@\mbox{#1}\else\nobreak#1\fi
  \nobreak\hskip\z@skip}
\def\bbl@@usehyphen#1{%
  \leavevmode\ifdim\lastskip>\z@\mbox{#1}\else#1\fi}
%    \end{macrocode}
%
%    The following macro inserts the hyphen char.
%
%    \begin{macrocode}
\def\bbl@hyphenchar{%
  \ifnum\hyphenchar\font=\m@ne
    \babelnullhyphen
  \else
    \char\hyphenchar\font
  \fi}
%    \end{macrocode}
%
%    Finally, we define the hyphen ``types''. Their names will not
%    change, so you may use them in |ldf|'s. After a space, the
%    |\mbox| in |\bbl@hy@nobreak| is redundant.
%
%    \begin{macrocode}
\def\bbl@hy@soft{\bbl@usehyphen{\discretionary{\bbl@hyphenchar}{}{}}}
\def\bbl@hy@@soft{\bbl@@usehyphen{\discretionary{\bbl@hyphenchar}{}{}}}
\def\bbl@hy@hard{\bbl@usehyphen\bbl@hyphenchar}
\def\bbl@hy@@hard{\bbl@@usehyphen\bbl@hyphenchar}
\def\bbl@hy@nobreak{\bbl@usehyphen{\mbox{\bbl@hyphenchar}}}
\def\bbl@hy@@nobreak{\mbox{\bbl@hyphenchar}}
\def\bbl@hy@repeat{%
  \bbl@usehyphen{%
    \discretionary{\bbl@hyphenchar}{\bbl@hyphenchar}{\bbl@hyphenchar}}}
\def\bbl@hy@@repeat{%
  \bbl@@usehyphen{%
    \discretionary{\bbl@hyphenchar}{\bbl@hyphenchar}{\bbl@hyphenchar}}}
\def\bbl@hy@empty{\hskip\z@skip}
\def\bbl@hy@@empty{\discretionary{}{}{}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@disc}
%    For some languages the macro |\bbl@disc| is used to ease the
%    insertion of discretionaries for letters that behave `abnormally'
%    at a breakpoint.
%
%    \begin{macrocode}
\def\bbl@disc#1#2{\nobreak\discretionary{#2-}{}{#1}\bbl@allowhyphens}
%    \end{macrocode}
%
%  \end{macro}
% \subsection{Multiencoding strings}
%
% \changes{babel~3.9a}{2012/09/05}{Added tentative code for string
%  declarations}
% \changes{babel~3.9a}{2012/12/24}{Added hooks}
%
% The aim following commands is to provide a commom interface for
% strings in several encodings. They also contains several hooks which
% can be ued by \luatex{} and \xetex. The code is organized here with
% pseudo-guards, so we start with the basic commands.
%
%  \paragraph{Tools}
%
% But first, a couple of tools. The first one makes global a local
% variable. This is not the best solution, but it works.
%
%    \begin{macrocode}
\bbl@trace{Multiencoding strings}
\def\bbl@toglobal#1{\global\let#1#1}
\def\bbl@recatcode#1{%
  \@tempcnta="7F
  \def\bbl@tempa{%
    \ifnum\@tempcnta>"FF\else
      \catcode\@tempcnta=#1\relax
      \advance\@tempcnta\@ne
      \expandafter\bbl@tempa
    \fi}%
  \bbl@tempa}
%    \end{macrocode}
%
% The second one. We need to patch |\@uclclist|, but it is done once
% and only if |\SetCase| is used or if strings are encoded.  The code
% is far from satisfactory for several reasons, including the fact
% |\@uclclist| is not a list any more. Therefore a package option is
% added to ignore it. Instead of gobbling the macro
% getting the next two elements (usually |\reserved@a|), we pass it as
% argument to |\bbl@uclc|. The parser is restarted inside
% |\|\m{lang}|@bbl@uclc| because we do not know how many expansions
% are necessary (depends on whether strings are encoded). The last
% part is tricky -- when uppercasing, we have:
%\begin{verbatim}
% \let\bbl@tolower\@empty\bbl@toupper\@empty
%\end{verbatim}
% and starts over (and similarly when lowercasing).
%
%    \changes{babel~3.9l}{2014/07/29}{Now tries to catch the parsing
%    macro. Removed some redundant code. Option |nocase|.}
%
%    \begin{macrocode}
\@ifpackagewith{babel}{nocase}%
  {\let\bbl@patchuclc\relax}%
  {\def\bbl@patchuclc{%
    \global\let\bbl@patchuclc\relax
    \g@addto@macro\@uclclist{\reserved@b{\reserved@b\bbl@uclc}}%
    \gdef\bbl@uclc##1{%
      \let\bbl@encoded\bbl@encoded@uclc
      \bbl@ifunset{\languagename @bbl@uclc}% and resumes it
        {##1}%
        {\let\bbl@tempa##1\relax % Used by LANG@bbl@uclc
         \csname\languagename @bbl@uclc\endcsname}%
      {\bbl@tolower\@empty}{\bbl@toupper\@empty}}%
    \gdef\bbl@tolower{\csname\languagename @bbl@lc\endcsname}%
    \gdef\bbl@toupper{\csname\languagename @bbl@uc\endcsname}}}
%    \end{macrocode}
%
%    \begin{macrocode}
%<<*More package options>>
\DeclareOption{nocase}{}
%<</More package options>>
%    \end{macrocode}
%
% The following package options control the behavior of |\SetString|.
%
%    \begin{macrocode}
%<<*More package options>>
\let\bbl@opt@strings\@nnil % accept strings=value
\DeclareOption{strings}{\def\bbl@opt@strings{\BabelStringsDefault}}
\DeclareOption{strings=encoded}{\let\bbl@opt@strings\relax}
\def\BabelStringsDefault{generic}
%<</More package options>>
%    \end{macrocode}
%
%    \paragraph{Main command} This is the main command.  With the
%    first use it is redefined to omit the basic setup in subsequent
%    blocks. We make sure strings contain actual letters in the range
%    128-255, not active characters.
%
%    \changes{babel~3.9g}{2013/07/29}{Added starred variant. A bit of
%    clean up. Removed \cs{UseString}, which didn't work.}
%    \changes{babel~3.9g}{2013/08/01}{Now several languages can be
%    processed with \cs{BabelLanguages}, if set in the ldf.}
%
%    \begin{macrocode}
\@onlypreamble\StartBabelCommands
\def\StartBabelCommands{%
  \begingroup   
  \bbl@recatcode{11}%
  <@Macros local to BabelCommands@>
  \def\bbl@provstring##1##2{%
    \providecommand##1{##2}%
    \bbl@toglobal##1}%
  \global\let\bbl@scafter\@empty
  \let\StartBabelCommands\bbl@startcmds
  \ifx\BabelLanguages\relax
     \let\BabelLanguages\CurrentOption
  \fi
  \begingroup
  \let\bbl@screset\@nnil % local flag - disable 1st stopcommands
  \StartBabelCommands}
\def\bbl@startcmds{%
  \ifx\bbl@screset\@nnil\else
    \bbl@usehooks{stopcommands}{}%
  \fi
  \endgroup
  \begingroup
  \@ifstar
    {\ifx\bbl@opt@strings\@nnil
       \let\bbl@opt@strings\BabelStringsDefault
     \fi
     \bbl@startcmds@i}%
    \bbl@startcmds@i}
\def\bbl@startcmds@i#1#2{%
  \edef\bbl@L{\zap@space#1 \@empty}%
  \edef\bbl@G{\zap@space#2 \@empty}%
  \bbl@startcmds@ii}
%    \end{macrocode}
%
%    Parse the encoding info to get the label, input, and font parts.
%
%    Select the behavior of |\SetString|. Thre are two main cases,
%    depending of if there is an optional argument: without it and
%    |strings=encoded|, strings are defined
%    always; otherwise, they are set only if they are still undefined
%    (ie, fallback values). With labelled blocks and
%    |strings=encoded|, define the strings, but with another value,
%    define strings only if the current label or font encoding is the
%    value of |strings|; otherwise (ie, no |strings| or a block whose
%    label is not in |strings=|) do nothing.
%
%    We presume the current block is not loaded, and therefore set
%    (above) a couple of default values to gobble the arguments. Then,
%    these macros are redefined if necessary according to several
%    parameters.
%
% \changes{babel~3.9g}{2013/08/04}{Use \cs{ProvideTextCommand}, which
%   does with encoded strings what the manual says.}
% \changes{babel~3.9h}{2013/11/08}{Tidied up code related to
%  \cs{bbl@scswitch}}
% 
%    \begin{macrocode}
\newcommand\bbl@startcmds@ii[1][\@empty]{%
  \let\SetString\@gobbletwo
  \let\bbl@stringdef\@gobbletwo
  \let\AfterBabelCommands\@gobble
  \ifx\@empty#1%
    \def\bbl@sc@label{generic}%
    \def\bbl@encstring##1##2{%
      \ProvideTextCommandDefault##1{##2}%
      \bbl@toglobal##1%
      \expandafter\bbl@toglobal\csname\string?\string##1\endcsname}%
    \let\bbl@sctest\in@true
  \else
    \let\bbl@sc@charset\space % <- zapped below
    \let\bbl@sc@fontenc\space % <-   "      "
    \def\bbl@tempa##1=##2\@nil{%
      \bbl@csarg\edef{sc@\zap@space##1 \@empty}{##2 }}%
    \bbl@vforeach{label=#1}{\bbl@tempa##1\@nil}%
    \def\bbl@tempa##1 ##2{% space -> comma
      ##1%
      \ifx\@empty##2\else\ifx,##1,\else,\fi\bbl@afterfi\bbl@tempa##2\fi}%
    \edef\bbl@sc@fontenc{\expandafter\bbl@tempa\bbl@sc@fontenc\@empty}%
    \edef\bbl@sc@label{\expandafter\zap@space\bbl@sc@label\@empty}%
    \edef\bbl@sc@charset{\expandafter\zap@space\bbl@sc@charset\@empty}%
    \def\bbl@encstring##1##2{%
      \bbl@foreach\bbl@sc@fontenc{%
        \bbl@ifunset{T@####1}%
          {}%
          {\ProvideTextCommand##1{####1}{##2}%
           \bbl@toglobal##1%
           \expandafter
           \bbl@toglobal\csname####1\string##1\endcsname}}}%
    \def\bbl@sctest{%
      \bbl@xin@{,\bbl@opt@strings,}{,\bbl@sc@label,\bbl@sc@fontenc,}}%
  \fi
  \ifx\bbl@opt@strings\@nnil         % ie, no strings key -> defaults
  \else\ifx\bbl@opt@strings\relax    % ie, strings=encoded
    \let\AfterBabelCommands\bbl@aftercmds
    \let\SetString\bbl@setstring
    \let\bbl@stringdef\bbl@encstring
  \else       % ie, strings=value
  \bbl@sctest
  \ifin@
    \let\AfterBabelCommands\bbl@aftercmds
    \let\SetString\bbl@setstring
    \let\bbl@stringdef\bbl@provstring
  \fi\fi\fi
  \bbl@scswitch
  \ifx\bbl@G\@empty
    \def\SetString##1##2{%
      \bbl@error{Missing group for string \string##1}%
        {You must assign strings to some category, typically\\%
         captions or extras, but you set none}}%
  \fi
  \ifx\@empty#1%
    \bbl@usehooks{defaultcommands}{}%
  \else
    \@expandtwoargs
    \bbl@usehooks{encodedcommands}{{\bbl@sc@charset}{\bbl@sc@fontenc}}%
  \fi}
%    \end{macrocode}
%
%    There are two versions of |\bbl@scswitch|. The first version is
%    used when |ldf|s are read, and it makes sure
%    |\|\m{group}\m{language} is reset, but only once (|\bbl@screset|
%    is used to keep track of this). The second version is used in the
%    preamble and packages loaded after \babel{} and does nothing. The
%    macro |\bbl@forlang| loops |\bbl@L| but its body is executed only
%    if the value is in |\BabelLanguages| (inside \babel) or
%    |\date|\m{language} is defined (after \babel{} has been loaded).
%    There are also two version of |\bbl@forlang|. The first one skips
%    the current iteration if the language is not in |\BabelLanguages|
%    (used in |ldf|s), and the second one skips undefined languages
%    (after \babel{} has been loaded) . 
%
%   \begin{macrocode}
\def\bbl@forlang#1#2{%
  \bbl@for#1\bbl@L{%
    \bbl@xin@{,#1,}{,\BabelLanguages,}%
    \ifin@#2\relax\fi}}
\def\bbl@scswitch{%
  \bbl@forlang\bbl@tempa{%
    \ifx\bbl@G\@empty\else
      \ifx\SetString\@gobbletwo\else
        \edef\bbl@GL{\bbl@G\bbl@tempa}%
        \bbl@xin@{,\bbl@GL,}{,\bbl@screset,}%
        \ifin@\else
          \global\expandafter\let\csname\bbl@GL\endcsname\@undefined
          \xdef\bbl@screset{\bbl@screset,\bbl@GL}%
        \fi
      \fi
    \fi}}
\AtEndOfPackage{%
  \def\bbl@forlang#1#2{\bbl@for#1\bbl@L{\bbl@ifunset{date#1}{}{#2}}}%
  \let\bbl@scswitch\relax}
\@onlypreamble\EndBabelCommands
\def\EndBabelCommands{%
  \bbl@usehooks{stopcommands}{}%
  \endgroup
  \endgroup
  \bbl@scafter}
%    \end{macrocode}
%    
%    Now we define commands to be used inside |\StartBabelCommands|.
%   
%    \paragraph{Strings} The following macro is the actual definition
%    of |\SetString| when it is ``active''
%
%    First save the ``switcher''. Create it if undefined. Strings are
%    defined only if undefined (ie, like |\providescommmand|). With
%    the event |stringprocess| you can preprocess the string by
%    manipulating the value of |\BabelString|. If there are several
%    hooks assigned to this event, preprocessing is done in the same
%    order as defined.  Finally, the string is set.
%
% \changes{babel~3.9g}{2013/07/29}{Added \cs{bbl@forlang} to ignore in
%   the preamble unknown languages, as described in the doc.}
% 
%    \begin{macrocode}
\def\bbl@setstring#1#2{%
  \bbl@forlang\bbl@tempa{%
    \edef\bbl@LC{\bbl@tempa\bbl@stripslash#1}%
    \bbl@ifunset{\bbl@LC}% eg, \germanchaptername
      {\global\expandafter  % TODO - con \bbl@exp ?
       \bbl@add\csname\bbl@G\bbl@tempa\expandafter\endcsname\expandafter
         {\expandafter\bbl@scset\expandafter#1\csname\bbl@LC\endcsname}}%
      {}%
    \def\BabelString{#2}%
    \bbl@usehooks{stringprocess}{}%
    \expandafter\bbl@stringdef
      \csname\bbl@LC\expandafter\endcsname\expandafter{\BabelString}}}
%    \end{macrocode}
%
%     Now, some addtional stuff to be used when encoded strings are
%     used. Captions then include |\bbl@encoded| for string to be
%     expanded in case transformations. It is |\relax| by default, but
%     in |\MakeUppercase| and |\MakeLowercase| its value is a modified
%     expandable |\@changed@cmd|.
% 
% \changes{babel~3.9i}{2014/03/13}{Added code to expand captions in
%     case transformations.}
%
%    \begin{macrocode}
\ifx\bbl@opt@strings\relax
  \def\bbl@scset#1#2{\def#1{\bbl@encoded#2}}
  \bbl@patchuclc
  \let\bbl@encoded\relax    
  \def\bbl@encoded@uclc#1{%
    \@inmathwarn#1%
    \expandafter\ifx\csname\cf@encoding\string#1\endcsname\relax
      \expandafter\ifx\csname ?\string#1\endcsname\relax
        \TextSymbolUnavailable#1%
      \else
        \csname ?\string#1\endcsname
      \fi
    \else
      \csname\cf@encoding\string#1\endcsname
    \fi}
\else
  \def\bbl@scset#1#2{\def#1{#2}}
\fi
%    \end{macrocode}
%
%    Define |\SetStringLoop|, which is actually set inside
%    |\StartBabelCommands|. The current definition is
%    somewhat complicated because we need a count, but |\count@| is
%    not under our control (remember |\SetString| may call hooks).
%    Instead of defining a dedicated count, we just ``pre-expand''
%    its value.
%
% \changes{babel~3.9h}{2013/10/16}{Tidied up and bug fixed - first
%    element expanded prematurely.}
% 
%    \begin{macrocode}
%<<*Macros local to BabelCommands>>
\def\SetStringLoop##1##2{%
    \def\bbl@templ####1{\expandafter\noexpand\csname##1\endcsname}%
    \count@\z@
    \bbl@loop\bbl@tempa{##2}{% empty items and spaces are ok
      \advance\count@\@ne
      \toks@\expandafter{\bbl@tempa}%
      \bbl@exp{%
        \\\SetString\bbl@templ{\romannumeral\count@}{\the\toks@}%
        \count@=\the\count@\relax}}}%
%<</Macros local to BabelCommands>>
%    \end{macrocode}
%
%    \paragraph{Delaying code} Now the definition of
%    |\AfterBabelCommands| when it is activated.
%
%    \begin{macrocode}
\def\bbl@aftercmds#1{%
  \toks@\expandafter{\bbl@scafter#1}%
  \xdef\bbl@scafter{\the\toks@}}
%    \end{macrocode}
%
% \paragraph{Case mapping}
%
% The command |\SetCase| provides a way to change the behavior of
% |\MakeUppercase| and |\MakeLowercase|. |\bbl@tempa| is set by the
% patched |\@uclclist| to the parsing command.
%
% \changes{babel~3.9h}{2013/11/08}{Use \cs{bbl@encstrings} - they
% should be defined always, even if no `strings'}
%
%    \begin{macrocode}
%<<*Macros local to BabelCommands>>
  \newcommand\SetCase[3][]{%
    \bbl@patchuclc
    \bbl@forlang\bbl@tempa{%
      \expandafter\bbl@encstring
        \csname\bbl@tempa @bbl@uclc\endcsname{\bbl@tempa##1}%
      \expandafter\bbl@encstring
        \csname\bbl@tempa @bbl@uc\endcsname{##2}% 
      \expandafter\bbl@encstring
        \csname\bbl@tempa @bbl@lc\endcsname{##3}}}%
%<</Macros local to BabelCommands>>
%    \end{macrocode}
%
% Macros to deal with case mapping for hyphenation. To decide if the
% document is monolingual or multilingual, we make a rough guess --
% just see if there is a comma in the languages list, built in the
% first pass of the package options. 
%
%    \begin{macrocode}
%<<*Macros local to BabelCommands>>
  \newcommand\SetHyphenMap[1]{%
    \bbl@forlang\bbl@tempa{%
      \expandafter\bbl@stringdef
        \csname\bbl@tempa @bbl@hyphenmap\endcsname{##1}}}
%<</Macros local to BabelCommands>>
%    \end{macrocode}
%
%   There are 3 helper macros which do most of the work for you.
%
%   \begin{macrocode}
\newcommand\BabelLower[2]{% one to one.
  \ifnum\lccode#1=#2\else
    \babel@savevariable{\lccode#1}%
    \lccode#1=#2\relax
  \fi}
\newcommand\BabelLowerMM[4]{% many-to-many
  \@tempcnta=#1\relax
  \@tempcntb=#4\relax
  \def\bbl@tempa{%
    \ifnum\@tempcnta>#2\else
      \@expandtwoargs\BabelLower{\the\@tempcnta}{\the\@tempcntb}%
      \advance\@tempcnta#3\relax
      \advance\@tempcntb#3\relax
      \expandafter\bbl@tempa
    \fi}%
  \bbl@tempa}
\newcommand\BabelLowerMO[4]{% many-to-one
  \@tempcnta=#1\relax
  \def\bbl@tempa{%
    \ifnum\@tempcnta>#2\else
      \@expandtwoargs\BabelLower{\the\@tempcnta}{#4}%
      \advance\@tempcnta#3
      \expandafter\bbl@tempa
    \fi}%
  \bbl@tempa}
%    \end{macrocode}
%
%    The following package options control the behavior of
%    hyphenation mapping.
%
% \changes{babel~3.9t}{2017/04/28}{Renamed \cs{bbl@hymapopt} to
%    \cs{bbl@opt@hyphenmap} for consistency}
%
%    \begin{macrocode}
%<<*More package options>>    
\DeclareOption{hyphenmap=off}{\chardef\bbl@opt@hyphenmap\z@}
\DeclareOption{hyphenmap=first}{\chardef\bbl@opt@hyphenmap\@ne}
\DeclareOption{hyphenmap=select}{\chardef\bbl@opt@hyphenmap\tw@}      
\DeclareOption{hyphenmap=other}{\chardef\bbl@opt@hyphenmap\thr@@}
\DeclareOption{hyphenmap=other*}{\chardef\bbl@opt@hyphenmap4\relax}
%<</More package options>>    
%    \end{macrocode}
%
%    Initial setup to provide a default behavior if |hypenmap|
%    is not set.
%
%    \begin{macrocode}
\AtEndOfPackage{%
  \ifx\bbl@opt@hyphenmap\@undefined
    \bbl@xin@{,}{\bbl@language@opts}%
    \chardef\bbl@opt@hyphenmap\ifin@4\else\@ne\fi
  \fi}
%    \end{macrocode}
%
% \subsection{Macros common to a number of languages}
%
%  \begin{macro}{\set@low@box}
%    The following macro is used to lower quotes to the same level as
%    the comma.  It prepares its argument in box register~0.
%
%    \begin{macrocode}
\bbl@trace{Macros related to glyphs}
\def\set@low@box#1{\setbox\tw@\hbox{,}\setbox\z@\hbox{#1}%
    \dimen\z@\ht\z@ \advance\dimen\z@ -\ht\tw@%
    \setbox\z@\hbox{\lower\dimen\z@ \box\z@}\ht\z@\ht\tw@ \dp\z@\dp\tw@}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\save@sf@q}
%    The macro |\save@sf@q| is used to save and reset the current
%    space factor.
%
%    \begin{macrocode}
\def\save@sf@q#1{\leavevmode
  \begingroup 
    \edef\@SF{\spacefactor\the\spacefactor}#1\@SF
  \endgroup}
%    \end{macrocode}
%
%  \end{macro}
%
% \subsection{Making glyphs available}
%
%    This section makes a number of glyphs available that either do not
%    exist in the \texttt{OT1} encoding and have to be `faked', or
%    that are not accessible through \file{T1enc.def}.
%
% \subsubsection{Quotation marks}
%
%  \begin{macro}{\quotedblbase}
%    In the \texttt{T1} encoding the opening double quote at the
%    baseline is available as a separate character, accessible via
%    |\quotedblbase|. In the \texttt{OT1} encoding it is not
%    available, therefore we make it available by lowering the normal
%    open quote character to the baseline.
%
%    \begin{macrocode}
\ProvideTextCommand{\quotedblbase}{OT1}{%
  \save@sf@q{\set@low@box{\textquotedblright\/}%
    \box\z@\kern-.04em\bbl@allowhyphens}}
%    \end{macrocode}
%
%    Make sure that when an encoding other than \texttt{OT1} or
%    \texttt{T1} is used this glyph can still be typeset.
%
%    \begin{macrocode}
\ProvideTextCommandDefault{\quotedblbase}{%
  \UseTextSymbol{OT1}{\quotedblbase}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\quotesinglbase}
%    We also need the single quote character at the baseline.
%
%    \begin{macrocode}
\ProvideTextCommand{\quotesinglbase}{OT1}{%
  \save@sf@q{\set@low@box{\textquoteright\/}%
    \box\z@\kern-.04em\bbl@allowhyphens}}
%    \end{macrocode}
%
%    Make sure that when an encoding other than \texttt{OT1} or
%    \texttt{T1} is used this glyph can still be typeset.
%
%    \begin{macrocode}
\ProvideTextCommandDefault{\quotesinglbase}{%
  \UseTextSymbol{OT1}{\quotesinglbase}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\guillemotleft}
%  \begin{macro}{\guillemotright}
%    The guillemet characters are not available in \texttt{OT1}
%    encoding. They are faked.
%
%    \begin{macrocode}
\ProvideTextCommand{\guillemotleft}{OT1}{%
  \ifmmode
    \ll
  \else
    \save@sf@q{\nobreak
      \raise.2ex\hbox{$\scriptscriptstyle\ll$}\bbl@allowhyphens}%
  \fi}
\ProvideTextCommand{\guillemotright}{OT1}{%
  \ifmmode
    \gg
  \else
    \save@sf@q{\nobreak
      \raise.2ex\hbox{$\scriptscriptstyle\gg$}\bbl@allowhyphens}%
  \fi}
%    \end{macrocode}
%
%    Make sure that when an encoding other than \texttt{OT1} or
%    \texttt{T1} is used these glyphs can still be typeset.
%
%    \begin{macrocode}
\ProvideTextCommandDefault{\guillemotleft}{%
  \UseTextSymbol{OT1}{\guillemotleft}}
\ProvideTextCommandDefault{\guillemotright}{%
  \UseTextSymbol{OT1}{\guillemotright}}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\guilsinglleft}
%  \begin{macro}{\guilsinglright}
%    The single guillemets are not available in \texttt{OT1}
%    encoding. They are faked.
%
%    \begin{macrocode}
\ProvideTextCommand{\guilsinglleft}{OT1}{%
  \ifmmode
    <%
  \else
    \save@sf@q{\nobreak
      \raise.2ex\hbox{$\scriptscriptstyle<$}\bbl@allowhyphens}%
  \fi}
\ProvideTextCommand{\guilsinglright}{OT1}{%
  \ifmmode
    >%
  \else
    \save@sf@q{\nobreak
      \raise.2ex\hbox{$\scriptscriptstyle>$}\bbl@allowhyphens}%
  \fi}
%    \end{macrocode}
%
%    Make sure that when an encoding other than \texttt{OT1} or
%    \texttt{T1} is used these glyphs can still be typeset.
%
%    \begin{macrocode}
\ProvideTextCommandDefault{\guilsinglleft}{%
  \UseTextSymbol{OT1}{\guilsinglleft}}
\ProvideTextCommandDefault{\guilsinglright}{%
  \UseTextSymbol{OT1}{\guilsinglright}}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
% \subsubsection{Letters}
%
%  \begin{macro}{\ij}
%  \begin{macro}{\IJ}
%    The dutch language uses the letter `ij'. It is available in
%    \texttt{T1} encoded fonts, but not in the \texttt{OT1} encoded
%    fonts. Therefore we fake it for the \texttt{OT1} encoding.
%
% \changes{babel~3.9a}{2012/07/28}{Removed the first \cs{allowhyphens}.
%    Moved the second one just after the kern.}
%
%    \begin{macrocode}
\DeclareTextCommand{\ij}{OT1}{%
  i\kern-0.02em\bbl@allowhyphens j}
\DeclareTextCommand{\IJ}{OT1}{%
  I\kern-0.02em\bbl@allowhyphens J}
\DeclareTextCommand{\ij}{T1}{\char188}
\DeclareTextCommand{\IJ}{T1}{\char156}
%    \end{macrocode}
%
%    Make sure that when an encoding other than \texttt{OT1} or
%    \texttt{T1} is used these glyphs can still be typeset.
%
%    \begin{macrocode}
\ProvideTextCommandDefault{\ij}{%
  \UseTextSymbol{OT1}{\ij}}
\ProvideTextCommandDefault{\IJ}{%
  \UseTextSymbol{OT1}{\IJ}}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\dj}
%  \begin{macro}{\DJ}
%    The croatian language needs the letters |\dj| and |\DJ|; they are
%    available in the \texttt{T1} encoding, but not in the
%    \texttt{OT1} encoding by default.
%
%    Some code to construct these glyphs for the \texttt{OT1} encoding
%    was made available to me by Stipcevic Mario,
%    (\texttt{stipcevic@olimp.irb.hr}).
%
%    \begin{macrocode}
\def\crrtic@{\hrule height0.1ex width0.3em}
\def\crttic@{\hrule height0.1ex width0.33em}
\def\ddj@{%
  \setbox0\hbox{d}\dimen@=\ht0
  \advance\dimen@1ex
  \dimen@.45\dimen@
  \dimen@ii\expandafter\rem@pt\the\fontdimen\@ne\font\dimen@
  \advance\dimen@ii.5ex
  \leavevmode\rlap{\raise\dimen@\hbox{\kern\dimen@ii\vbox{\crrtic@}}}}
\def\DDJ@{%
  \setbox0\hbox{D}\dimen@=.55\ht0
  \dimen@ii\expandafter\rem@pt\the\fontdimen\@ne\font\dimen@
  \advance\dimen@ii.15ex %            correction for the dash position
  \advance\dimen@ii-.15\fontdimen7\font %     correction for cmtt font
  \dimen\thr@@\expandafter\rem@pt\the\fontdimen7\font\dimen@
  \leavevmode\rlap{\raise\dimen@\hbox{\kern\dimen@ii\vbox{\crttic@}}}}
%
\DeclareTextCommand{\dj}{OT1}{\ddj@ d}
\DeclareTextCommand{\DJ}{OT1}{\DDJ@ D}
%    \end{macrocode}
%
%    Make sure that when an encoding other than \texttt{OT1} or
%    \texttt{T1} is used these glyphs can still be typeset.
%
%    \begin{macrocode}
\ProvideTextCommandDefault{\dj}{%
  \UseTextSymbol{OT1}{\dj}}
\ProvideTextCommandDefault{\DJ}{%
  \UseTextSymbol{OT1}{\DJ}}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\SS}
%    For the \texttt{T1} encoding |\SS| is defined and selects a
%    specific glyph from the font, but for other encodings it is not
%    available. Therefore we make it available here.
%
%    \begin{macrocode}
\DeclareTextCommand{\SS}{OT1}{SS}
\ProvideTextCommandDefault{\SS}{\UseTextSymbol{OT1}{\SS}}
%    \end{macrocode}
%
%  \end{macro}
%
% \subsubsection{Shorthands for quotation marks}
%
%    Shorthands are provided for a number of different quotation
%    marks, which make them usable both outside and inside mathmode.
%    They are defined with |\ProvideTextCommandDefault|, but this is
%    very likely not required because their definitions are based on
%    encoding dependent macros.
%
% \changes{babel~3.16}{2018/01/02}{Adapted to TU and refactored -
%  redundant code.}
%
%  \begin{macro}{\glq}
%  \begin{macro}{\grq}
%
% \changes{babel~3.8b}{2004/05/02}{Made \cs{glq} fontencoding
%    dependent as well}
%
%    The `german' single quotes.
%
%    \begin{macrocode}
\ProvideTextCommandDefault{\glq}{%
  \textormath{\quotesinglbase}{\mbox{\quotesinglbase}}}
%    \end{macrocode}
%
%    The definition of |\grq| depends on the fontencoding. With
%    \texttt{T1} encoding no extra kerning is needed.
%
%    \begin{macrocode}
\ProvideTextCommand{\grq}{T1}{%
  \textormath{\textquoteleft}{\mbox{\textquoteleft}}}
\ProvideTextCommand{\grq}{TU}{%
  \textormath{\textquoteleft}{\mbox{\textquoteleft}}}
\ProvideTextCommand{\grq}{OT1}{%
  \save@sf@q{\kern-.0125em
    \textormath{\textquoteleft}{\mbox{\textquoteleft}}%
    \kern.07em\relax}}
\ProvideTextCommandDefault{\grq}{\UseTextSymbol{OT1}\grq}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\glqq}
%  \begin{macro}{\grqq}
%
% \changes{babel~3.8b}{2004/05/02}{Made \cs{grqq} fontencoding
%    dependent as well}
%
%    The `german' double quotes.
%
%    \begin{macrocode}
\ProvideTextCommandDefault{\glqq}{%
  \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
%    \end{macrocode}
%
%    The definition of |\grqq| depends on the fontencoding. With
%    \texttt{T1} encoding no extra kerning is needed.
%
%    \begin{macrocode}
\ProvideTextCommand{\grqq}{T1}{%
  \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
\ProvideTextCommand{\grqq}{TU}{%
  \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
\ProvideTextCommand{\grqq}{OT1}{%
  \save@sf@q{\kern-.07em
    \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}%
    \kern.07em\relax}}
\ProvideTextCommandDefault{\grqq}{\UseTextSymbol{OT1}\grqq}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\flq}
%  \begin{macro}{\frq}
%
% \changes{babel~3.8b}{2004/05/02}{Made \cs{flq} and \cs{frq}
%    fontencoding dependent}
%
%    The `french' single guillemets.
%
%    \begin{macrocode}
\ProvideTextCommandDefault{\flq}{%
  \textormath{\guilsinglleft}{\mbox{\guilsinglleft}}}
\ProvideTextCommandDefault{\frq}{%
  \textormath{\guilsinglright}{\mbox{\guilsinglright}}}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\flqq}
%  \begin{macro}{\frqq}
%
% \changes{babel~3.8b}{2004/05/02}{Made \cs{flqq} and \cs{frqq}
%    fontencoding dependent}
%
%    The `french' double guillemets.
%
%    \begin{macrocode}
\ProvideTextCommandDefault{\flqq}{%
  \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
\ProvideTextCommandDefault{\frqq}{%
  \textormath{\guillemotright}{\mbox{\guillemotright}}}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
% \subsubsection{Umlauts and tremas}
%
%    The command |\"| needs to have a different effect for different
%    languages. For German for instance, the `umlaut' should be
%    positioned lower than the default position for placing it over
%    the letters a, o, u, A, O and U. When placed over an e, i, E or I
%    it can retain its normal position. For Dutch the same glyph is
%    always placed in the lower position.
%
%  \begin{macro}{\umlauthigh}
%
% \changes{v3.8a}{2004/02/19}{Use \cs{leavevmode}\cs{bgroup} to
%    prevent problems when this command occurs in vertical mode.}
%
%  \begin{macro}{\umlautlow}
%    To be able to provide both positions of |\"| we provide two
%    commands to switch the positioning, the default will be
%    |\umlauthigh| (the normal positioning).
%
%    \begin{macrocode}
\def\umlauthigh{%
  \def\bbl@umlauta##1{\leavevmode\bgroup%
      \expandafter\accent\csname\f@encoding dqpos\endcsname
      ##1\bbl@allowhyphens\egroup}%
  \let\bbl@umlaute\bbl@umlauta}
\def\umlautlow{%
  \def\bbl@umlauta{\protect\lower@umlaut}}
\def\umlautelow{%
  \def\bbl@umlaute{\protect\lower@umlaut}}
\umlauthigh
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\lower@umlaut}
%    The command |\lower@umlaut| is used to position the |\"| closer
%    to the letter.
%
%    We want the umlaut character lowered, nearer to the letter. To do
%    this we need an extra \meta{dimen} register.
%
%    \begin{macrocode}
\expandafter\ifx\csname U@D\endcsname\relax
  \csname newdimen\endcsname\U@D
\fi
%    \end{macrocode}
%
%    The following code fools \TeX's \texttt{make\_accent} procedure
%    about the current x-height of the font to force another placement
%    of the umlaut character.
%    First we have to save the current x-height of the font, because
%    we'll change this font dimension and this is always done
%    globally.
%
% \changes{v3.8a}{2004/02/19}{Use \cs{leavevmode}\cs{bgroup} to
%    prevent problems when this command occurs in vertical mode.}
%
%    Then we compute the new x-height in such a way that the umlaut
%    character is lowered to the base character.  The value of
%    \texttt{.45ex} depends on the \MF\ parameters with which the
%    fonts were built.  (Just try out, which value will look best.)
%    If the new x-height is too low, it is not changed.
%    Finally we call the |\accent| primitive, reset the old x-height
%    and insert the base character in the argument.
%
%    \begin{macrocode}
\def\lower@umlaut#1{%
  \leavevmode\bgroup
    \U@D 1ex%
    {\setbox\z@\hbox{%
      \expandafter\char\csname\f@encoding dqpos\endcsname}%
      \dimen@ -.45ex\advance\dimen@\ht\z@
      \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
    \expandafter\accent\csname\f@encoding dqpos\endcsname
    \fontdimen5\font\U@D #1%
  \egroup}
%    \end{macrocode}
%
%  \end{macro}
%
%    For all vowels we declare |\"| to be a composite command which
%    uses |\bbl@umlauta| or |\bbl@umlaute| to position the umlaut
%    character. We need to be sure that these definitions override the
%    ones that are provided when the package \pkg{fontenc} with
%    option \Lopt{OT1} is used. Therefore these declarations are
%    postponed until the beginning of the document. Note these
%    definitions only apply to some languages, but 
%    babel sets them for \textit{all} languages -- you may want to
%    redefine |\bbl@umlauta| and/or |\bbl@umlaute| for a language
%    in the corresponding |ldf| (using the babel switching mechanism,
%    of course).
%
%    \begin{macrocode}
\AtBeginDocument{%
  \DeclareTextCompositeCommand{\"}{OT1}{a}{\bbl@umlauta{a}}%
  \DeclareTextCompositeCommand{\"}{OT1}{e}{\bbl@umlaute{e}}%
  \DeclareTextCompositeCommand{\"}{OT1}{i}{\bbl@umlaute{\i}}%
  \DeclareTextCompositeCommand{\"}{OT1}{\i}{\bbl@umlaute{\i}}%
  \DeclareTextCompositeCommand{\"}{OT1}{o}{\bbl@umlauta{o}}%
  \DeclareTextCompositeCommand{\"}{OT1}{u}{\bbl@umlauta{u}}%
  \DeclareTextCompositeCommand{\"}{OT1}{A}{\bbl@umlauta{A}}%
  \DeclareTextCompositeCommand{\"}{OT1}{E}{\bbl@umlaute{E}}%
  \DeclareTextCompositeCommand{\"}{OT1}{I}{\bbl@umlaute{I}}%
  \DeclareTextCompositeCommand{\"}{OT1}{O}{\bbl@umlauta{O}}%
  \DeclareTextCompositeCommand{\"}{OT1}{U}{\bbl@umlauta{U}}%
}
%    \end{macrocode}
%
%    Finally, the default is to use English as the main language.
%
% \changes{babel~3.9a}{2012-05-17}{Languages are best assigned with
%    \cs{chardef}, not \cs{let}}
%
%    \begin{macrocode}
\ifx\l@english\@undefined
  \chardef\l@english\z@
\fi
\main@language{english}
%    \end{macrocode}
%
% \subsection{Layout}
%
% \textbf{Work in progress}.
%
% Layout is mainly intended to set bidi documents, but there is at
% least a tool useful in general.
%
%    \begin{macrocode}
\bbl@trace{Bidi layout}
\providecommand\IfBabelLayout[3]{#3}%
\newcommand\BabelPatchSection[1]{%
  \@ifundefined{#1}{}{%
    \bbl@exp{\let\<bbl@ss@#1>\<#1>}%
    \@namedef{#1}{%
      \@ifstar{\bbl@presec@s{#1}}%
              {\@dblarg{\bbl@presec@x{#1}}}}}}
\def\bbl@presec@x#1[#2]#3{%
  \bbl@exp{%
    \\\select@language@x{\bbl@main@language}%
    \\\@nameuse{bbl@sspre@#1}%
    \\\@nameuse{bbl@ss@#1}%
      [\\\foreignlanguage{\languagename}{\unexpanded{#2}}]%
      {\\\foreignlanguage{\languagename}{\unexpanded{#3}}}%
    \\\select@language@x{\languagename}}}
\def\bbl@presec@s#1#2{%
  \bbl@exp{%
    \\\select@language@x{\bbl@main@language}%
    \\\@nameuse{bbl@sspre@#1}%
    \\\@nameuse{bbl@ss@#1}*%
      {\\\foreignlanguage{\languagename}{\unexpanded{#2}}}%
    \\\select@language@x{\languagename}}}
\IfBabelLayout{sectioning}%
  {\BabelPatchSection{part}%
   \BabelPatchSection{chapter}%
   \BabelPatchSection{section}%
   \BabelPatchSection{subsection}%
   \BabelPatchSection{subsubsection}%
   \BabelPatchSection{paragraph}%
   \BabelPatchSection{subparagraph}%
   \def\babel@toc#1{%
     \select@language@x{\bbl@main@language}}}{}
\IfBabelLayout{captions}%
  {\BabelPatchSection{caption}}{}
%    \end{macrocode}
%
%    Now we load definition files for engines.
%
%    \begin{macrocode}
\bbl@trace{Input engine specific macros}
\ifcase\bbl@engine
  \input txtbabel.def
\or
  \input luababel.def
\or
  \input xebabel.def
\fi
%    \end{macrocode}
%
% \changes{babel~3.18}{2018/02/14}{Moved \cs{babelprovide}, also for
%   plain}
%
% \subsection{Creating languages}
%
% |\babelprovide| is a general purpose tool for creating
% languages. Currently it just creates the language infrastructure,
% but in the future it will be able to read data from |ini| files, as
% well as to create variants. Unlike the \textsf{nil} pseudo-language,
% captions are defined, but with a warning to invite the user to
% provide the real string.
%
% \changes{3.10}{2017/05/19}{Added \cs{babelprovide}}
% \changes{3.13}{2017/08/30}{Added \cs{import}, which also reads
% dates. Some refactoring in the ini reader.}
% \changes{3.15}{2017/10/30}{New keys script, language}
% \changes{3.16}{2018/01/02}{Make sure ensuring works even before
%  the language is selected}
%
%
%    \begin{macrocode}
\bbl@trace{Creating languages and reading ini files}
\newcommand\babelprovide[2][]{%  
  \let\bbl@savelangname\languagename
  \def\languagename{#2}%
  \let\bbl@KVP@captions\@nil
  \let\bbl@KVP@import\@nil
  \let\bbl@KVP@main\@nil
  \let\bbl@KVP@script\@nil
  \let\bbl@KVP@language\@nil
  \let\bbl@KVP@dir\@nil
  \let\bbl@KVP@hyphenrules\@nil
  \bbl@forkv{#1}{\bbl@csarg\def{KVP@##1}{##2}}%  TODO - error handling
  \ifx\bbl@KVP@captions\@nil
    \let\bbl@KVP@captions\bbl@KVP@import
  \fi
  \bbl@ifunset{date#2}%
    {\bbl@provide@new{#2}}%
    {\bbl@ifblank{#1}%
      {\bbl@error
        {If you want to modify `#2' you must tell how in\\%
         the optional argument. Currently there are three\\%
         options: captions=lang-tag, hyphenrules=lang-list\\%
         import=lang-tag}%
        {Use this macro as documented}}%
      {\bbl@provide@renew{#2}}}%
  \bbl@exp{\\\babelensure[exclude=\\\today]{#2}}%
  \bbl@ifunset{bbl@ensure@\languagename}%
    {\bbl@exp{%
      \\\DeclareRobustCommand\<bbl@ensure@\languagename>[1]{%
        \\\foreignlanguage{\languagename}%
        {####1}}}}%
    {}%
  \ifx\bbl@KVP@script\@nil\else
    \bbl@csarg\edef{sname@#2}{\bbl@KVP@script}%
  \fi
  \ifx\bbl@KVP@language\@nil\else
    \bbl@csarg\edef{lname@#2}{\bbl@KVP@language}%
  \fi
  \let\languagename\bbl@savelangname}
%    \end{macrocode}
%
% Depending on whether or not the language exists, we define two macros.
%
%    \begin{macrocode}
\def\bbl@provide@new#1{%
  \@namedef{date#1}{}% marks lang exists - required by \StartBabelCommands
  \@namedef{extras#1}{}%
  \@namedef{noextras#1}{}%
  \StartBabelCommands*{#1}{captions}%
    \ifx\bbl@KVP@captions\@nil %      and also if import, implicit
      \def\bbl@tempb##1{%             elt for \bbl@captionslist
        \ifx##1\@empty\else
          \bbl@exp{%
            \\\SetString\\##1{%
              \\\bbl@nocaption{\bbl@stripslash##1}{\<#1\bbl@stripslash##1>}}}%
          \expandafter\bbl@tempb
        \fi}%  
      \expandafter\bbl@tempb\bbl@captionslist\@empty
    \else
      \bbl@read@ini{\bbl@KVP@captions}%  Here all letters cat = 11
      \bbl@after@ini
      \bbl@savestrings
    \fi
  \StartBabelCommands*{#1}{date}%
    \ifx\bbl@KVP@import\@nil
      \bbl@exp{%
        \\\SetString\\\today{\\\bbl@nocaption{today}{\<#1today>}}}%
    \else
      \bbl@savetoday
      \bbl@savedate
    \fi
  \EndBabelCommands
  \bbl@exp{%
    \def\<#1hyphenmins>{%
      {\bbl@ifunset{bbl@lfthm@#1}{2}{\@nameuse{bbl@lfthm@#1}}}%
      {\bbl@ifunset{bbl@rgthm@#1}{3}{\@nameuse{bbl@rgthm@#1}}}}}%
  \bbl@provide@hyphens{#1}%
  \ifx\bbl@KVP@main\@nil\else
     \expandafter\main@language\expandafter{#1}%
  \fi}
\def\bbl@provide@renew#1{%
  \ifx\bbl@KVP@captions\@nil\else
    \StartBabelCommands*{#1}{captions}%
      \bbl@read@ini{\bbl@KVP@captions}%   Here all letters cat = 11
      \bbl@after@ini
      \bbl@savestrings
    \EndBabelCommands
 \fi
 \ifx\bbl@KVP@import\@nil\else
   \StartBabelCommands*{#1}{date}%
     \bbl@savetoday
     \bbl@savedate
   \EndBabelCommands
  \fi
  \bbl@provide@hyphens{#1}}
%    \end{macrocode}
%
% The |hyphenrules| option is handled with an auxiliary macro.
%
% \changes{3.14}{2017/10/03}{Take into account ini settings for
% hyphenrules if `import'.}
%
%    \begin{macrocode}
\def\bbl@provide@hyphens#1{%
  \let\bbl@tempa\relax
  \ifx\bbl@KVP@hyphenrules\@nil\else
    \bbl@replace\bbl@KVP@hyphenrules{ }{,}%
    \bbl@foreach\bbl@KVP@hyphenrules{%
      \ifx\bbl@tempa\relax    %  if not yet found
        \bbl@ifsamestring{##1}{+}%
          {{\bbl@exp{\\\addlanguage\<l@##1>}}}%
          {}%
        \bbl@ifunset{l@##1}%
           {}%
           {\bbl@exp{\let\bbl@tempa\<l@##1>}}%
      \fi}%
  \fi
  \ifx\bbl@tempa\relax %        if no opt or no language in opt found
    \ifx\bbl@KVP@import\@nil\else % if importing
      \bbl@exp{%                and hyphenrules is not empty
        \\\bbl@ifblank{\@nameuse{bbl@hyphr@#1}}%
          {}%
          {\let\\\bbl@tempa\<l@\@nameuse{bbl@hyphr@\languagename}>}}%
    \fi
  \fi
  \bbl@ifunset{bbl@tempa}%       ie, relax or undefined
    {\bbl@ifunset{l@#1}%         no hyphenrules found - fallback
       {\bbl@exp{\\\adddialect\<l@#1>\language}}%
       {}}%                      so, l@<lang> is ok - nothing to do
    {\bbl@exp{\\\adddialect\<l@#1>\bbl@tempa}}}%  found in opt list or ini
%    \end{macrocode}
%
% The reader of |ini| files. There are 3 possible cases: a section name
% (in the form |[...]|), a comment (starting with |;|) and a
% key/value pair. \textit{TODO - Work in progress.}
%
%    \begin{macrocode}
\def\bbl@read@ini#1{%
  \openin1=babel-#1.ini
  \ifeof1
    \bbl@error
      {There is no ini file for the requested language\\%
       (#1). Perhaps you misspelled it or your installation\\%
       is not complete.}%
      {Fix the name or reinstall babel.}%
  \else
    \let\bbl@section\@empty
    \let\bbl@savestrings\@empty
    \let\bbl@savetoday\@empty
    \let\bbl@savedate\@empty
    \let\bbl@inireader\bbl@iniskip
    \bbl@info{Importing data from babel-#1.ini for \languagename}%
    \loop
    \if T\ifeof1F\fi T\relax % Trick, because inside \loop
      \endlinechar\m@ne
      \read1 to \bbl@line
      \endlinechar`\^^M
      \ifx\bbl@line\@empty\else
        \expandafter\bbl@iniline\bbl@line\bbl@iniline
      \fi
    \repeat
  \fi}
\def\bbl@iniline#1\bbl@iniline{%
  \@ifnextchar[\bbl@inisec{\@ifnextchar;\bbl@iniskip\bbl@inireader}#1\@@}% ]
%    \end{macrocode}
%
% The special cases for comment lines and sections are handled by the
% two following commands. In sections, we provide the posibility to
% take extra actions at the end or at the start (TODO - but note the last
% section is not ended). By default, key=val pairs are ignored. 
%      
%    \begin{macrocode}
\def\bbl@iniskip#1\@@{}%      if starts with ;
\def\bbl@inisec[#1]#2\@@{%    if starts with opening bracket
  \@nameuse{bbl@secpost@\bbl@section}%  ends previous section
  \def\bbl@section{#1}%
  \@nameuse{bbl@secpre@\bbl@section}%   starts current section
  \bbl@ifunset{bbl@secline@#1}%
    {\let\bbl@inireader\bbl@iniskip}%
    {\bbl@exp{\let\\\bbl@inireader\<bbl@secline@#1>}}}
%    \end{macrocode}
%      
% Reads a key=val line and stores the trimmed val in
% |\bbl@@kv@<section>.<key>|.
%
%    \begin{macrocode}
\def\bbl@inikv#1=#2\@@{%     key=value
  \bbl@trim@def\bbl@tempa{#1}%
  \bbl@trim\toks@{#2}%
  \bbl@csarg\edef{@kv@\bbl@section.\bbl@tempa}{\the\toks@}}
%    \end{macrocode}
%  
% The previous assignments are local, so we need to export them. If
% the value is empty, we can provide a default value.
%
%    \begin{macrocode}
\def\bbl@exportkey#1#2#3{%
  \bbl@ifunset{bbl@@kv@#2}%
    {\bbl@csarg\gdef{#1@\languagename}{#3}}%
    {\expandafter\ifx\csname bbl@@kv@#2\endcsname\@empty
       \bbl@csarg\gdef{#1@\languagename}{#3}%
     \else
       \bbl@exp{\global\let\<bbl@#1@\languagename>\<bbl@@kv@#2>}%
     \fi}}
%    \end{macrocode}
%
% Key-value pairs are treated differently depending on the section in
% the |ini| file.  The following macros are the readers for
% |identification| and |typography|.
%
%    \begin{macrocode}
\let\bbl@secline@identification\bbl@inikv
\def\bbl@secpost@identification{%
  \bbl@exportkey{lname}{identification.name.english}{}%
  \bbl@exportkey{lbcp}{identification.tag.bcp47}{}%
  \bbl@exportkey{lotf}{identification.tag.opentype}{dflt}%
  \bbl@exportkey{sname}{identification.script.name}{}%
  \bbl@exportkey{sbcp}{identification.script.tag.bcp47}{}%
  \bbl@exportkey{sotf}{identification.script.tag.opentype}{DFLT}}
\let\bbl@secline@typography\bbl@inikv
\def\bbl@after@ini{%
  \bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}%
  \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}%
  \bbl@exportkey{hyphr}{typography.hyphenrules}{}%
  \def\bbl@tempa{0.9}%
  \bbl@csarg\ifx{@kv@identification.version}\bbl@tempa
    \bbl@warning{%
      The `\languagename' date format may not be suitable\\%
      for proper typesetting, and therefore it very likely will\\%
      change in a future release. Reported}%
  \fi
  \bbl@toglobal\bbl@savetoday
  \bbl@toglobal\bbl@savedate}
%    \end{macrocode}
%      
% Now |captions| and |captions.licr|, depending on the engine. And
% also for dates. They rely on a few auxilary macros.
%
%    \begin{macrocode}
\ifcase\bbl@engine
  \bbl@csarg\def{secline@captions.licr}#1=#2\@@{%
    \bbl@ini@captions@aux{#1}{#2}}
  \bbl@csarg\def{secline@date.gregorian}#1=#2\@@{%       for defaults
    \bbl@ini@dategreg#1...\relax{#2}}
  \bbl@csarg\def{secline@date.gregorian.licr}#1=#2\@@{%  override
    \bbl@ini@dategreg#1...\relax{#2}}
\else
  \def\bbl@secline@captions#1=#2\@@{%
    \bbl@ini@captions@aux{#1}{#2}}
  \bbl@csarg\def{secline@date.gregorian}#1=#2\@@{%
    \bbl@ini@dategreg#1...\relax{#2}}
\fi
%    \end{macrocode}
%      
% The auxiliary macro for captions define |\<caption>name|.
%
%    \begin{macrocode}
\def\bbl@ini@captions@aux#1#2{%
  \bbl@trim@def\bbl@tempa{#1}%
  \bbl@ifblank{#2}%
    {\bbl@exp{%
       \toks@{\\\bbl@nocaption{\bbl@tempa}\<\languagename\bbl@tempa name>}}}%
    {\bbl@trim\toks@{#2}}%
  \bbl@exp{%
    \\\bbl@add\\\bbl@savestrings{%
      \\\SetString\<\bbl@tempa name>{\the\toks@}}}}
%    \end{macrocode}
%
% But dates are more complex. The full date format is stores in
% |date.gregorian|, so we must read it in non-Unicode engines, too.
%
% \changes{3.16}{2018/01/02}{Fix - dates were severely broken.}
%      
%    \begin{macrocode}
\bbl@csarg\def{secpre@date.gregorian.licr}{%
  \ifcase\bbl@engine\let\bbl@savedate\@empty\fi}
\def\bbl@ini@dategreg#1.#2.#3.#4\relax#5{% TODO - ignore with 'captions'
  \bbl@trim@def\bbl@tempa{#1.#2}%
  \bbl@ifsamestring{\bbl@tempa}{months.wide}%
    {\bbl@trim@def\bbl@tempa{#3}%
     \bbl@trim\toks@{#5}%
     \bbl@exp{%
      \\\bbl@add\\\bbl@savedate{%
        \\\SetString\<month\romannumeral\bbl@tempa name>{\the\toks@}}}}%
    {\bbl@ifsamestring{\bbl@tempa}{date.long}% 
      {\bbl@trim@def\bbl@toreplace{#5}%
       \bbl@TG@@date
       \global\bbl@csarg\let{date@\languagename}\bbl@toreplace
       \bbl@exp{%
         \gdef\<\languagename date>{\\\protect\<\languagename date >}%
         \gdef\<\languagename date >####1####2####3{%
           \\\bbl@usedategrouptrue
           \<bbl@ensure@\languagename>{%
             \<bbl@date@\languagename>{####1}{####2}{####3}}}%
         \\\bbl@add\\\bbl@savetoday{%
           \\\SetString\\\today{%
             \<\languagename date>{\\\the\year}{\\\the\month}{\\\the\day}}}}}}%
      {}}
%    \end{macrocode}
%
% Dates will require some macros for the basic formatting. They may be
% redefined by language, so ``semi-public'' names (camel case) are
% used. Oddly enough, the CLDR places particles like “de”
% inconsistenly in either in the date or in the month name.
%
%    \begin{macrocode}
\newcommand\BabelDateSpace{\nobreakspace}
\newcommand\BabelDateDot{.\@}
\newcommand\BabelDated[1]{{\number#1}}
\newcommand\BabelDatedd[1]{{\ifnum#1<10 0\fi\number#1}}
\newcommand\BabelDateM[1]{{\number#1}}
\newcommand\BabelDateMM[1]{{\ifnum#1<10 0\fi\number#1}}
\newcommand\BabelDateMMMM[1]{{%
  \csname month\romannumeral#1name\endcsname}}%
\newcommand\BabelDatey[1]{{\number#1}}%
\newcommand\BabelDateyy[1]{{%
  \ifnum#1<10 0\number#1 %
  \else\ifnum#1<100 \number#1 %
  \else\ifnum#1<1000 \expandafter\@gobble\number#1 %
  \else\ifnum#1<10000 \expandafter\@gobbletwo\number#1 %
  \else
    \bbl@error
      {Currently two-digit years are restricted to the\\
       range 0-9999.}%
      {There is little you can do. Sorry.}%
  \fi\fi\fi\fi}}
\newcommand\BabelDateyyyy[1]{{\number#1}}
\def\bbl@replace@finish@iii#1{%
  \bbl@exp{\def\\#1####1####2####3{\the\toks@}}}
\def\bbl@TG@@date{%
  \bbl@replace\bbl@toreplace{[ ]}{\BabelDateSpace{}}%
  \bbl@replace\bbl@toreplace{[.]}{\BabelDateDot{}}%
  \bbl@replace\bbl@toreplace{[d]}{\BabelDated{####3}}%
  \bbl@replace\bbl@toreplace{[dd]}{\BabelDatedd{####3}}%
  \bbl@replace\bbl@toreplace{[M]}{\BabelDateM{####2}}%
  \bbl@replace\bbl@toreplace{[MM]}{\BabelDateMM{####2}}%
  \bbl@replace\bbl@toreplace{[MMMM]}{\BabelDateMMMM{####2}}%
  \bbl@replace\bbl@toreplace{[y]}{\BabelDatey{####1}}%
  \bbl@replace\bbl@toreplace{[yy]}{\BabelDateyy{####1}}%
  \bbl@replace\bbl@toreplace{[yyyy]}{\BabelDateyyyy{####1}}%
% Note after \bbl@replace \toks@ contains the resulting string.
% TODO - Using this implicit behavior doesn't seem a good idea.
  \bbl@replace@finish@iii\bbl@toreplace}
%    \end{macrocode}
%
% Language and Script values to be used when defining a font or
% setting the direction are set with the following macros.
%
%    \begin{macrocode}
\def\bbl@provide@lsys#1{%
  \bbl@ifunset{bbl@lname@#1}%
    {\bbl@ini@ids{#1}}%
    {}%
  \bbl@csarg\let{lsys@#1}\@empty
  \bbl@ifunset{bbl@sname@#1}{\bbl@csarg\gdef{sname@#1}{Default}}{}%
  \bbl@ifunset{bbl@sotf#1}{\bbl@csarg\gdef{sotf@#1}{DFLT}}{}%
  \bbl@csarg\bbl@add@list{lsys@#1}{Script=\bbl@cs{sname@#1}}%
  \bbl@ifunset{bbl@lname@#1}{}%
    {\bbl@csarg\bbl@add@list{lsys@#1}{Language=\bbl@cs{lname@#1}}}%
  \bbl@csarg\bbl@toglobal{lsys@#1}}%
 %  \bbl@exp{% TODO - should be global
 %    \<keys_if_exist:nnF>{fontspec-opentype/Script}{\bbl@cs{sname@#1}}%
 %      {\\\newfontscript{\bbl@cs{sname@#1}}{\bbl@cs{sotf@#1}}}% 
 %    \<keys_if_exist:nnF>{fontspec-opentype/Language}{\bbl@cs{lname@#1}}%
 %      {\\\newfontlanguage{\bbl@cs{lname@#1}}{\bbl@cs{lotf@#1}}}}}
%    \end{macrocode}
% 
% The following |ini| reader ignores everything but the
% |identification| section. It is called when a font is defined (ie,
% when the language is first selected) to know which script/language
% must be enabled. This means we must make sure a few characters are
% not active. The |ini| is not read directly, but with a proxy |tex|
% file named as the language.
%
% \changes{3.16}{2018/01/02}{Load ids inside a box, to prevent extra
% spaces.}
%
%    \begin{macrocode}
\def\bbl@ini@ids#1{%
  \def\BabelBeforeIni##1##2{%
    \begingroup
      \bbl@add\bbl@secpost@identification{\closein1 }%
      \catcode`\[=12 \catcode`\]=12 \catcode`\==12 
      \bbl@read@ini{##1}%
    \endgroup}%           boxed, to avoid extra spaces:
  {\setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}}}
%    \end{macrocode}
%
% \section{The kernel of Babel (\texttt{babel.def}, only \LaTeX)}
%
% \subsection{The redefinition of the style commands}
%
%    The rest of the code in this file can only be processed by
%    \LaTeX, so we check the current format. If it is plain \TeX,
%    processing should stop here. But, because of the need to limit
%    the scope of the definition of |\format|, a macro that is used
%    locally in the following |\if|~statement, this comparison is done
%    inside a group. To prevent \TeX\ from complaining about an
%    unclosed group, the processing of the command |\endinput| is
%    deferred until after the group is closed. This is accomplished by
%    the command |\aftergroup|.
%
%    \begin{macrocode}
{\def\format{lplain}
\ifx\fmtname\format
\else
  \def\format{LaTeX2e}
  \ifx\fmtname\format
  \else
    \aftergroup\endinput
  \fi
\fi}
%    \end{macrocode}
%
% \subsection{Cross referencing macros}
%
%    The \LaTeX\ book states:
%  \begin{quote}
%    The \emph{key} argument is any sequence of letters, digits, and
%    punctuation symbols; upper- and lowercase letters are regarded as
%    different.
%  \end{quote}
%    When the above quote should still be true when a document is
%    typeset in a language that has active characters, special care
%    has to be taken of the category codes of these characters when
%    they appear in an argument of the cross referencing macros.
%
%    When a cross referencing command processes its argument, all
%    tokens in this argument should be character tokens with category
%    `letter' or `other'.
%
%    The only way to accomplish this in most cases is to use the trick
%    described in the \TeX book~\cite{DEK} (Appendix~D, page~382).
%    The primitive |\meaning| applied to a token expands to the
%    current meaning of this token.  For example, `|\meaning\A|' with
%    |\A| defined as `|\def\A#1{\B}|' expands to the characters
%    `|macro:#1->\B|' with all category codes set to `other' or
%    `space'.
%  \begin{macro}{\newlabel}
%    The macro |\label| writes a line with a |\newlabel| command
%    into the |.aux| file to define labels.
%
%    \begin{macrocode}
%\bbl@redefine\newlabel#1#2{%
%  \@safe@activestrue\org@newlabel{#1}{#2}\@safe@activesfalse}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\@newl@bel}
%    We need to change the definition of the \LaTeX-internal macro
%    |\@newl@bel|. This is needed because we need to make sure that
%    shorthand characters expand to their non-active version.
%
%    The following package options control which macros are to be
%    redefined.
%
%    \begin{macrocode}
%<<*More package options>>
\DeclareOption{safe=none}{\let\bbl@opt@safe\@empty}
\DeclareOption{safe=bib}{\def\bbl@opt@safe{B}}
\DeclareOption{safe=ref}{\def\bbl@opt@safe{R}}
%<</More package options>>
%    \end{macrocode}
%
%    First we open a new group to keep the changed setting of
%    |\protect| local and then we set the |@safe@actives| switch to
%    true to make sure that any shorthand that appears in any of the
%    arguments immediately expands to its non-active self.
%
%    \begin{macrocode}
\bbl@trace{Cross referencing macros}
\ifx\bbl@opt@safe\@empty\else
  \def\@newl@bel#1#2#3{%
   {\@safe@activestrue
    \bbl@ifunset{#1@#2}%
       \relax
       {\gdef\@multiplelabels{%
          \@latex@warning@no@line{There were multiply-defined labels}}%
        \@latex@warning@no@line{Label `#2' multiply defined}}%
    \global\@namedef{#1@#2}{#3}}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\@testdef}
%    An internal \LaTeX\ macro used to test if the labels that have
%    been written on the |.aux| file have changed.  It is called by
%    the |\enddocument| macro. This macro needs to be completely
%    rewritten, using |\meaning|. The reason for this is that in some
%    cases the expansion of |\#1@#2| contains the same characters as
%    the |#3|; but the character codes differ. Therefore \LaTeX\ keeps
%    reporting that the labels may have changed.
%
%    \begin{macrocode}
  \CheckCommand*\@testdef[3]{%
    \def\reserved@a{#3}%
    \expandafter\ifx\csname#1@#2\endcsname\reserved@a
    \else
      \@tempswatrue
    \fi}
%    \end{macrocode}
%
%    Now that we made sure that |\@testdef| still has the same
%    definition we can rewrite it. First we make the shorthands
%    `safe'.
%
%    \begin{macrocode}
  \def\@testdef#1#2#3{%
    \@safe@activestrue
%    \end{macrocode}
%
%    Then we use |\bbl@tempa| as an `alias' for the macro that
%    contains the label which is being checked.
%
%    \begin{macrocode}
    \expandafter\let\expandafter\bbl@tempa\csname #1@#2\endcsname
%    \end{macrocode}
%
%    Then we define |\bbl@tempb| just as |\@newl@bel| does it.
%
%    \begin{macrocode}
    \def\bbl@tempb{#3}%
    \@safe@activesfalse
%    \end{macrocode}
%
%    When the label is defined we replace the definition of
%    |\bbl@tempa| by its meaning.
%
%    \begin{macrocode}
    \ifx\bbl@tempa\relax
    \else
      \edef\bbl@tempa{\expandafter\strip@prefix\meaning\bbl@tempa}%
    \fi
%    \end{macrocode}
%
%    We do the same for |\bbl@tempb|.
%
%    \begin{macrocode}
    \edef\bbl@tempb{\expandafter\strip@prefix\meaning\bbl@tempb}%
%    \end{macrocode}
%
%    If the label didn't change, |\bbl@tempa| and |\bbl@tempb| should
%    be identical macros.
%
%    \begin{macrocode}
    \ifx\bbl@tempa\bbl@tempb
    \else
      \@tempswatrue
    \fi}
\fi
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\ref}
%  \begin{macro}{\pageref}
%    The same holds for the macro |\ref| that references a label
%    and |\pageref| to reference a page. So we redefine |\ref| and
%    |\pageref|. While we change these macros, we make them robust as
%    well (if they weren't already) to prevent problems if they should
%    become expanded at the wrong moment.
%
%    \begin{macrocode}
\bbl@xin@{R}\bbl@opt@safe
\ifin@
  \bbl@redefinerobust\ref#1{%
    \@safe@activestrue\org@ref{#1}\@safe@activesfalse}
  \bbl@redefinerobust\pageref#1{%
    \@safe@activestrue\org@pageref{#1}\@safe@activesfalse}
\else
  \let\org@ref\ref
  \let\org@pageref\pageref
\fi
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\@citex}
%    The macro used to cite from a bibliography, |\cite|, uses an
%    internal macro, |\@citex|.
%    It is this internal macro that picks up the argument(s),
%    so we redefine this internal macro and leave |\cite| alone. The
%    first argument is used for typesetting, so the shorthands need
%    only be deactivated in the second argument.
%
%    \begin{macrocode}
\bbl@xin@{B}\bbl@opt@safe
\ifin@
  \bbl@redefine\@citex[#1]#2{%
    \@safe@activestrue\edef\@tempa{#2}\@safe@activesfalse
    \org@@citex[#1]{\@tempa}}
%    \end{macrocode}
%
%    Unfortunately, the packages \pkg{natbib} and \pkg{cite} need a
%    different definition of |\@citex|...
%    To begin with, \pkg{natbib} has a definition for |\@citex| with
%    \emph{three} arguments... We only know that a package is loaded
%    when |\begin{document}| is executed, so we need to postpone the
%    different redefinition.
%
%    \begin{macrocode}
  \AtBeginDocument{%
    \@ifpackageloaded{natbib}{%
%    \end{macrocode}
%
%    Notice that we use |\def| here instead of |\bbl@redefine| because
%    |\org@@citex| is already defined and we don't want to overwrite
%    that definition (it would result in parameter stack overflow
%    because of a circular definition).
%
%   (Recent versions of natbib change dynamically |\@citex|, so PR4087
%     doesn't seem fixable in a simple way. Just load natbib before.)
%
%    \begin{macrocode}
    \def\@citex[#1][#2]#3{%
      \@safe@activestrue\edef\@tempa{#3}\@safe@activesfalse
      \org@@citex[#1][#2]{\@tempa}}%
    }{}}
%    \end{macrocode}
%
%    The package \pkg{cite} has a definition of |\@citex| where the
%    shorthands need to be turned off in both arguments.
%
%    \begin{macrocode}
  \AtBeginDocument{%
    \@ifpackageloaded{cite}{%
      \def\@citex[#1]#2{%
        \@safe@activestrue\org@@citex[#1]{#2}\@safe@activesfalse}%
      }{}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\nocite}
%    The macro |\nocite| which is used to instruct BiB\TeX\ to
%    extract uncited references from the database.
%
%    \begin{macrocode}
  \bbl@redefine\nocite#1{%
    \@safe@activestrue\org@nocite{#1}\@safe@activesfalse}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bibcite}
%    The macro that is used in the |.aux| file to define citation
%    labels. When packages such as \pkg{natbib} or \pkg{cite} are not
%    loaded its second argument is used to typeset the citation
%    label. In that case, this second argument can contain active
%    characters but is used in an environment where
%    |\@safe@activestrue| is in effect. This switch needs to be reset
%    inside the |\hbox| which contains the citation label. In order to
%    determine during \file{.aux} file processing which definition of
%    |\bibcite| is needed we define |\bibcite| in such a way that it
%    redefines itself with the proper definition.
%
%    \begin{macrocode}
  \bbl@redefine\bibcite{%
%    \end{macrocode}
%
%    We call |\bbl@cite@choice| to select the proper definition for
%    |\bibcite|. This new definition is then activated.
%
%    \begin{macrocode}
    \bbl@cite@choice
    \bibcite}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@bibcite}
%    The macro |\bbl@bibcite| holds the definition of |\bibcite|
%    needed when neither \pkg{natbib} nor \pkg{cite} is loaded.
%
%    \begin{macrocode}
  \def\bbl@bibcite#1#2{%
    \org@bibcite{#1}{\@safe@activesfalse#2}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@cite@choice}
%    The macro |\bbl@cite@choice| determines which definition of
%    |\bibcite| is needed.
%
%    \begin{macrocode}
  \def\bbl@cite@choice{%
%    \end{macrocode}
%
%    First we give |\bibcite| its default definition.
%
%    \begin{macrocode}
    \global\let\bibcite\bbl@bibcite
%    \end{macrocode}
%
%    Then, when \pkg{natbib} is loaded we restore the original
%    definition of |\bibcite|.
%
%    \begin{macrocode}
    \@ifpackageloaded{natbib}{\global\let\bibcite\org@bibcite}{}%
%    \end{macrocode}
%
%    For \pkg{cite} we do the same.
%
%    \begin{macrocode}
    \@ifpackageloaded{cite}{\global\let\bibcite\org@bibcite}{}%
%    \end{macrocode}
%
%    Make sure this only happens once.
%
%    \begin{macrocode}
    \global\let\bbl@cite@choice\relax}
%    \end{macrocode}
%
%    When a document is run for the first time, no \file{.aux} file is
%    available, and |\bibcite| will not yet be properly defined. In
%    this case, this has to happen before the document starts.
%
%    \begin{macrocode}
  \AtBeginDocument{\bbl@cite@choice}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\@bibitem}
%    One of the two internal \LaTeX\ macros called by |\bibitem|
%    that write the citation label on the |.aux| file.
%
%    \begin{macrocode}
  \bbl@redefine\@bibitem#1{%
    \@safe@activestrue\org@@bibitem{#1}\@safe@activesfalse}
\else
  \let\org@nocite\nocite
  \let\org@@citex\@citex
  \let\org@bibcite\bibcite
  \let\org@@bibitem\@bibitem
\fi
%    \end{macrocode}
%
%  \end{macro}
%
% \subsection{Marks}
%
%  \begin{macro}{\markright}
%    Because the output routine is asynchronous, we must
%    pass the current language attribute to the head lines, together
%    with the text that is put into them. To achieve this we need to
%    adapt the definition of |\markright| and |\markboth| somewhat.
%
% \changes{babel~3.8c}{2004/05/26}{No need to add \emph{anything} to
%    an empty mark; prevented this by checking the contents of the
%    argument}
% \changes{babel~3.8f}{2005/05/15}{Make the definition independent of
%    the original definition; expand \cs{languagename} before passing
%    it into the token registers} 
% \changes{babel~3.9t}{2017/04/23}{Refactored \cs{markright} and
%    \cs{markboth}}  
%
%    We check whether the argument is empty; if it is, we just make
%    sure the scratch token register is empty.  Next, we store the
%    argument to |\markright| in the scratch token register. This way
%    these commands will not be expanded later, and we make sure that
%    the text is typeset using the correct language settings. While
%    doing so, we make sure that active characters that may end up in
%    the mark are not disabled by the output routine kicking in while
%    \cs{@safe@activestrue} is in effect.
%
%    \begin{macrocode}
\bbl@trace{Marks}
\IfBabelLayout{sectioning}
  {\ifx\bbl@opt@headfoot\@nnil
     \g@addto@macro\@resetactivechars{%
       \set@typeset@protect                  
       \expandafter\select@language@x\expandafter{\bbl@main@language}%
       \let\protect\noexpand}%
   \fi}
  {\bbl@redefine\markright#1{%
     \bbl@ifblank{#1}%
       {\org@markright{}}%
       {\toks@{#1}%
        \bbl@exp{%
          \\\org@markright{\\\protect\\\foreignlanguage{\languagename}%
            {\\\protect\\\bbl@restore@actives\the\toks@}}}}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\markboth}
%  \begin{macro}{\@mkboth}
%    The definition of |\markboth| is equivalent to that of
%    |\markright|, except that we need two token registers. The
%    documentclasses \cls{report} and \cls{book} define and set the
%    headings for the page. While doing so they also store a copy of
%    |\markboth| in |\@mkboth|. Therefore we need to check whether
%    |\@mkboth| has already been set. If so we neeed to do that again
%    with the new definition of |\markboth|.
%
% \changes{babel~3.8c}{2004/05/26}{No need to add \emph{anything} to
%    an empty mark, prevented this by checking the contents of the
%    arguments} 
% \changes{babel~3.8f}{2005/05/15}{Make the definition independent of
%    the original definition; expand \cs{languagename} before passing
%    it into the token registers} 
% \changes{babel~3.8j}{2008/03/21}{Added setting of \cs{@mkboth} (PR
%    3826)} 
%
%    \begin{macrocode}
   \ifx\@mkboth\markboth
     \def\bbl@tempc{\let\@mkboth\markboth}
   \else
     \def\bbl@tempc{}
   \fi
%    \end{macrocode}
%
%    Now we can start the new definition of |\markboth|
%
%    \begin{macrocode}
   \bbl@redefine\markboth#1#2{%
     \protected@edef\bbl@tempb##1{%
       \protect\foreignlanguage{\languagename}{\protect\bbl@restore@actives##1}}%
     \bbl@ifblank{#1}%
       {\toks@{}}%
       {\toks@\expandafter{\bbl@tempb{#1}}}%
     \bbl@ifblank{#2}%
       {\@temptokena{}}%
       {\@temptokena\expandafter{\bbl@tempb{#2}}}%
     \bbl@exp{\\\org@markboth{\the\toks@}{\the\@temptokena}}}
%    \end{macrocode}
%
%    and copy it to |\@mkboth| if necessary.
%
%    \begin{macrocode}
   \bbl@tempc}  % end \IfBabelLayout
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%
% \subsection{Preventing clashes with other packages}
%
% \subsubsection{\pkg{ifthen}}
%
%  \begin{macro}{\ifthenelse}
%
% \changes{babel~3.9a}{2012/09/07}{Redefine only if `ref' is `safe'}
% \changes{babel~3.9a}{2013/01/03}{Moved to babel.def}
%
%    Sometimes a document writer wants to create a special effect
%    depending on the page a certain fragment of text appears on. This
%    can be achieved by the following piece of code:
%\begin{verbatim}
%    \ifthenelse{\isodd{\pageref{some:label}}}
%               {code for odd pages}
%               {code for even pages}
%\end{verbatim}
%    In order for this to work the argument of |\isodd| needs to be
%    fully expandable. With the above redefinition of |\pageref| it is
%    not in the case of this example. To overcome that, we add some
%    code to the definition of |\ifthenelse| to make things work.
%
%    The first thing we need to do is check if the package
%    \pkg{ifthen} is loaded. This should be done at |\begin{document}|
%    time.
%
%    \begin{macrocode}
\bbl@trace{Preventing clashes with other packages}
\bbl@xin@{R}\bbl@opt@safe
\ifin@
  \AtBeginDocument{%
    \@ifpackageloaded{ifthen}{%
%    \end{macrocode}
%
%    Then we can redefine |\ifthenelse|:
%
% \changes{babel~3.9a}{2012/06/22}{\cs{ref} is also taken into account}
% \changes{babel~3.9n}{2015/12/14}{Don't use generic temp
%    macros. babel/4441}
%
%    \begin{macrocode}
      \bbl@redefine@long\ifthenelse#1#2#3{%
%    \end{macrocode}
%
%    We want to revert the definition of |\pageref| and |\ref| to
%    their original definition for the first argument of |\ifthenelse|,
%    so we first need to store their current meanings.
%
%    \begin{macrocode}
        \let\bbl@temp@pref\pageref
        \let\pageref\org@pageref
        \let\bbl@temp@ref\ref
        \let\ref\org@ref
%    \end{macrocode}
%
%    Then we can set the |\@safe@actives| switch and call the original
%    |\ifthenelse|. In order to be able to use shorthands in the
%    second and third arguments of |\ifthenelse| the resetting of the
%    switch \emph{and} the definition of |\pageref| happens inside
%    those arguments.  When the package wasn't loaded we do nothing.
%
%    \begin{macrocode}
        \@safe@activestrue
        \org@ifthenelse{#1}%
          {\let\pageref\bbl@temp@pref
           \let\ref\bbl@temp@ref
           \@safe@activesfalse
           #2}%
          {\let\pageref\bbl@temp@pref
           \let\ref\bbl@temp@ref
           \@safe@activesfalse
           #3}%
        }%
      }{}%
    }
%    \end{macrocode}
%
%  \end{macro}
%
% \subsubsection{\pkg{varioref}}
%
%  \begin{macro}{\@@vpageref}
%  \begin{macro}{\vrefpagenum}
%  \begin{macro}{\Ref}
%
% \changes{babel~3.8g}{2005/05/21}{We also need to adapt \cs{Ref}
%    which needs to be able to uppercase the first letter of the
%    expansion of \cs{ref}}
%
%    When the package varioref is in use we need to modify its
%    internal command |\@@vpageref| in order to prevent problems when
%    an active character ends up in the argument of |\vref|.
%
%    \begin{macrocode}
  \AtBeginDocument{%
    \@ifpackageloaded{varioref}{%
      \bbl@redefine\@@vpageref#1[#2]#3{%
        \@safe@activestrue
        \org@@@vpageref{#1}[#2]{#3}%
        \@safe@activesfalse}%
%    \end{macrocode}
%
%    The same needs to happen for |\vrefpagenum|.
%
%    \begin{macrocode}
      \bbl@redefine\vrefpagenum#1#2{%
        \@safe@activestrue
        \org@vrefpagenum{#1}{#2}%
        \@safe@activesfalse}%
%    \end{macrocode}
%
%    The package \pkg{varioref} defines |\Ref| to be a robust command
%    wich uppercases the first character of the reference text. In
%    order to be able to do that it needs to access the exandable form
%    of |\ref|. So we employ a little trick here. We redefine the
%    (internal) command \verb*|\Ref | to call |\org@ref| instead of
%    |\ref|. The disadvantgage of this solution is that whenever the
%    derfinition of |\Ref| changes, this definition needs to be updated
%    as well.
%
%    \begin{macrocode}
      \expandafter\def\csname Ref \endcsname#1{%
        \protected@edef\@tempa{\org@ref{#1}}\expandafter\MakeUppercase\@tempa}
      }{}%
    }
\fi
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% \subsubsection{\pkg{hhline}}
%
%  \begin{macro}{\hhline}
%    Delaying the activation of the shorthand characters has introduced
%    a problem with the \pkg{hhline} package. The reason is that it
%    uses the `:' character which is made active by the french support
%    in \babel. Therefore we need to \emph{reload} the package when
%    the `:' is an active character.
%
%    So at |\begin{document}| we check whether \pkg{hhline} is loaded.
%
%    \begin{macrocode}
\AtEndOfPackage{%
  \AtBeginDocument{%
    \@ifpackageloaded{hhline}%
%    \end{macrocode}
%
%    Then we check whether the expansion of |\normal@char:| is not
%    equal to |\relax|.
%
% \changes{babel~3.8b}{2004/04/19}{added \cs{string} to prevent
%    unwanted expansion of the colon}
%
%    \begin{macrocode}
      {\expandafter\ifx\csname normal@char\string:\endcsname\relax
       \else
%    \end{macrocode}
%
%    In that case we simply reload the package. Note that this happens
%    \emph{after} the category code of the @-sign has been changed to
%    other, so we need to temporarily change it to letter again.
%
%    \begin{macrocode}
         \makeatletter
         \def\@currname{hhline}\input{hhline.sty}\makeatother
       \fi}%
      {}}}
%    \end{macrocode}
%
%  \end{macro}
%
% \subsubsection{\pkg{hyperref}}
%
%  \begin{macro}{\pdfstringdefDisableCommands}
%
% \changes{babel~3.8j}{2008/03/16}{Inform \pkg{hyperref} to use
%    shorthands at system level (PR4006)}
%
%    A number of interworking problems between \pkg{babel} and
%    \pkg{hyperref} are tackled by \pkg{hyperref} itself. The
%    following code was introduced to prevent some annoying warnings
%    but it broke bookmarks. This was quickly fixed in \pkg{hyperref},
%    which essentially made it no-op. However, it will not removed for
%    the moment because \pkg{hyperref} is expecting it.
%    
%    \begin{macrocode}
\AtBeginDocument{%
  \ifx\pdfstringdefDisableCommands\@undefined\else
    \pdfstringdefDisableCommands{\languageshorthands{system}}%
  \fi}
%    \end{macrocode}
%
%  \end{macro}
%
% \subsubsection{\pkg{fancyhdr}}
%
%  \begin{macro}{\FOREIGNLANGUAGE}
%    The package \pkg{fancyhdr} treats the running head and fout lines
%    somewhat differently as the standard classes. A symptom of this is
%    that the command |\foreignlanguage| which \babel\ adds to the
%    marks can end up inside the argument of |\MakeUppercase|. To
%    prevent unexpected results we need to define |\FOREIGNLANGUAGE|
%    here.
%
%    \begin{macrocode}
\DeclareRobustCommand{\FOREIGNLANGUAGE}[1]{%
  \lowercase{\foreignlanguage{#1}}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\substitutefontfamily}
%    The command |\substitutefontfamily| creates an
%    \file{.fd} file on the fly. The first argument is an encoding
%    mnemonic, the second and third arguments are font family names.
%
%    \begin{macrocode}
\def\substitutefontfamily#1#2#3{%
  \lowercase{\immediate\openout15=#1#2.fd\relax}%
  \immediate\write15{%
    \string\ProvidesFile{#1#2.fd}%
    [\the\year/\two@digits{\the\month}/\two@digits{\the\day}
     \space generated font description file]^^J
    \string\DeclareFontFamily{#1}{#2}{}^^J
    \string\DeclareFontShape{#1}{#2}{m}{n}{<->ssub * #3/m/n}{}^^J
    \string\DeclareFontShape{#1}{#2}{m}{it}{<->ssub * #3/m/it}{}^^J
    \string\DeclareFontShape{#1}{#2}{m}{sl}{<->ssub * #3/m/sl}{}^^J
    \string\DeclareFontShape{#1}{#2}{m}{sc}{<->ssub * #3/m/sc}{}^^J
    \string\DeclareFontShape{#1}{#2}{b}{n}{<->ssub * #3/bx/n}{}^^J
    \string\DeclareFontShape{#1}{#2}{b}{it}{<->ssub * #3/bx/it}{}^^J
    \string\DeclareFontShape{#1}{#2}{b}{sl}{<->ssub * #3/bx/sl}{}^^J
    \string\DeclareFontShape{#1}{#2}{b}{sc}{<->ssub * #3/bx/sc}{}^^J
    }%
  \closeout15
  }
%    \end{macrocode}
%
%    This command should only be used in the preamble of a document.
%
%    \begin{macrocode}
\@onlypreamble\substitutefontfamily
%    \end{macrocode}
%
%  \end{macro}
%
% \subsection{Encoding and fonts}
%
%  Because documents may use non-ASCII font encodings, we make sure
%  that the logos of \TeX\ and \LaTeX\ always come out in the right
%  encoding. There is a list of non-ASCII encodings. Unfortunately,
%  \textsf{fontenc} deletes its package options, so we must guess
%  which encodings has been loaded by traversing |\@filelist| to
%  search for \m{enc}|enc.def|. If a non-ASCII has been loaded, we
%  define versions of |\TeX| and |\LaTeX| for them using
%  |\ensureascii|. The default ASCII encoding is set, too (in reverse
%  order): the ``main'' encoding (when the document begins), the last
%  loaded, or |OT1|.
%
%  \begin{macro}{\ensureascii}
%
% \changes{babel~3.9i}{2014/02/14}{Macro added, to replace
%    \cs{textlatin} and friends}
% \changes{babel~3.9j}{2014/03/17}{Moved misplaced code - it should be
%    executed only with LaTeX}
%
%    \begin{macrocode}
\bbl@trace{Encoding and fonts}
\newcommand\BabelNonASCII{LGR,X2,OT2,OT3,OT6,LHE,LWN,LMA,LMC,LMS,LMU,}
\let\org@TeX\TeX
\let\org@LaTeX\LaTeX
\let\ensureascii\@firstofone
\AtBeginDocument{%
  \in@false
  \bbl@foreach\BabelNonASCII{% is there a non-ascii enc?
    \ifin@\else
      \lowercase{\bbl@xin@{,#1enc.def,}{,\@filelist,}}%
    \fi}%
  \ifin@ % if a non-ascii has been loaded
    \def\ensureascii#1{{\fontencoding{OT1}\selectfont#1}}%
    \DeclareTextCommandDefault{\TeX}{\org@TeX}%
    \DeclareTextCommandDefault{\LaTeX}{\org@LaTeX}%
    \def\bbl@tempb#1\@@{\uppercase{\bbl@tempc#1}ENC.DEF\@empty\@@}%
    \def\bbl@tempc#1ENC.DEF#2\@@{%
      \ifx\@empty#2\else
        \bbl@ifunset{T@#1}% 
          {}%
          {\bbl@xin@{,#1,}{,\BabelNonASCII,}%
           \ifin@
             \DeclareTextCommand{\TeX}{#1}{\ensureascii{\org@TeX}}%
             \DeclareTextCommand{\LaTeX}{#1}{\ensureascii{\org@LaTeX}}%
           \else
             \def\ensureascii##1{{\fontencoding{#1}\selectfont##1}}%
           \fi}%
      \fi}%
    \bbl@foreach\@filelist{\bbl@tempb#1\@@}%  TODO - \@@ de mas??
    \bbl@xin@{,\cf@encoding,}{,\BabelNonASCII,}%
    \ifin@\else
      \edef\ensureascii#1{{%
        \noexpand\fontencoding{\cf@encoding}\noexpand\selectfont#1}}%
    \fi
  \fi}
%    \end{macrocode}
%
%  \end{macro}
%
%  Now comes the old deprecated stuff (with a little change in 3.9l,
%  for \textsf{fontspec}).  The first thing we need to do is to
%  determine, at |\begin{document}|, which latin fontencoding to use.
%
%  \begin{macro}{\latinencoding}
%    When text is being typeset in an encoding other than `latin'
%    (\texttt{OT1} or \texttt{T1}), it would be nice to still have
%    Roman numerals come out in the Latin encoding.
%    So we first assume that the current encoding at the end
%    of processing the package is the Latin encoding.
%
%    \begin{macrocode}
\AtEndOfPackage{\edef\latinencoding{\cf@encoding}}
%    \end{macrocode}
%
%    But this might be overruled with a later loading of the package
%    \pkg{fontenc}. Therefore we check at the execution of
%    |\begin{document}| whether it was loaded with the \Lopt{T1}
%    option. The normal way to do this (using |\@ifpackageloaded|) is
%    disabled for this package. Now we have to revert to parsing the
%    internal macro |\@filelist| which contains all the filenames
%    loaded.
%
% \changes{babel~3.9l}{2014/08/02}{fontspec used to set
%    \cs{latinencoding} to EUx, but now it doesn't. So, it's done
%    here.}
% \changes{babel~3.9o}{2016/01/27}{With fontspec, first check if
%   \cs{UTFencname} exists.}
%
%    \begin{macrocode}
\AtBeginDocument{%
  \@ifpackageloaded{fontspec}%
    {\xdef\latinencoding{%
       \ifx\UTFencname\@undefined
         EU\ifcase\bbl@engine\or2\or1\fi
       \else
         \UTFencname
       \fi}}%
    {\gdef\latinencoding{OT1}%
     \ifx\cf@encoding\bbl@t@one
       \xdef\latinencoding{\bbl@t@one}%
     \else
       \@ifl@aded{def}{t1enc}{\xdef\latinencoding{\bbl@t@one}}{}%
     \fi}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\latintext}
%    Then we can define the command |\latintext| which is a
%    declarative switch to a latin font-encoding. Usage of this macro
%    is deprecated.
%
%    \begin{macrocode}
\DeclareRobustCommand{\latintext}{%
  \fontencoding{\latinencoding}\selectfont
  \def\encodingdefault{\latinencoding}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\textlatin}
%    This command takes an argument which is then typeset using the
%    requested font encoding. In order to avoid many encoding switches
%    it operates in a local scope.
%
%    \begin{macrocode}
\ifx\@undefined\DeclareTextFontCommand
  \DeclareRobustCommand{\textlatin}[1]{\leavevmode{\latintext #1}}
\else
  \DeclareTextFontCommand{\textlatin}{\latintext}
\fi
%    \end{macrocode}
%
% \end{macro}
%   
% \subsection{Basic bidi support}
%
% \textbf{Work in progress.} This code is currently placed here for
% practical reasons.
%
% It is loosely based on |rlbabel.def|, but most of it has been
% developed from scratch. This \babel{} module (by Johannes Braams and
% Boris Lavva) has served the purpose of typesetting R documents for
% two decades, and despite its flaws I think it is still a good starting
% point (some parts have been copied here almost verbatim), partly
% thanks to its simplicity. I've also looked at \textsc{arabi} (by
% Youssef Jabri), which is compatible with \babel{}.
%
% There are two ways of modifying macros to make them “bidi”, namely,
% by patching the internal low level macros (which is what I have done
% with lists, columns, counters, tocs, much like |rlbabel| did), and
% by introducing a “middle layer” just below the user interface
% (sectioning, footnotes).
%
%    \begin{itemize}
%    \item pdftex provides a minimal support for bidi text, and it
%      must be done by hand. Vertical typesetting is not possible.
%    \item \xetex{} is somewhat better, thanks to its font engine
%      (even if not always reliable) and a few additional tools. However,
%      very little is done at the paragraph level. Another challenging
%      problem is text direction does not honour \TeX{} grouping.
%    \item \luatex{} can provide the most complete solution, as we can
%      manipulate almost freely the node list, the generated lines,
%      and so on, but bidi text does not work out of the box and some
%      development is necessary. It also provides tools to properly
%      set left-to-right and right-to-left page layouts. As Lua\TeX-ja
%      shows, vertical typesetting is posible, too. Its main drawback
%      is font handling is often considered to be less mature than
%      \xetex{}, mainly in Indic scripts (but there are steps to make
%      HarfBuzz, the \xetex{} font engine, available in \luatex{}; see
%      <https://github.com/tatzetwerk/luatex-harfbuzz>).
%    \end{itemize}
%
% \changes{3.15}{2017/10/30}{Use an attribute instead of tex language
%    (reserved for hyphenation).}
% \changes{3.15}{2017/10/30}{Store direction in @wdir@<lang>.}
%
%    \begin{macrocode}
\bbl@trace{Basic (internal) bidi support}
\def\bbl@alscripts{,Arabic,Syriac,Thaana,}
\def\bbl@rscripts{%
  ,Imperial Aramaic,Avestan,Cypriot,Hatran,Hebrew,%
  Old Hungarian,Old Hungarian,Lydian,Mandaean,Manichaean,%
  Manichaean,Meroitic Cursive,Meroitic,Old North Arabian,%
  Nabataean,N'Ko,Orkhon,Palmyrene,Inscriptional Pahlavi,%
  Psalter Pahlavi,Phoenician,Inscriptional Parthian,Samaritan,%
  Old South Arabian,}%
\def\bbl@provide@dirs#1{%
  \bbl@xin@{\csname bbl@sname@#1\endcsname}{\bbl@alscripts\bbl@rscripts}%
  \ifin@
    \global\bbl@csarg\chardef{wdir@#1}\@ne
    \bbl@xin@{\csname bbl@sname@#1\endcsname}{\bbl@alscripts}%
    \ifin@
      \global\bbl@csarg\chardef{wdir@#1}\tw@  % useless in xetex
    \fi
  \else
    \global\bbl@csarg\chardef{wdir@#1}\z@
  \fi}
\def\bbl@switchdir{%
  \bbl@ifunset{bbl@lsys@\languagename}{\bbl@provide@lsys{\languagename}}{}%
  \bbl@ifunset{bbl@wdir@\languagename}{\bbl@provide@dirs{\languagename}}{}%
  \bbl@exp{\\\bbl@setdirs\bbl@cs{wdir@\languagename}}}
\def\bbl@setdirs#1{% TODO - math
  \ifcase\bbl@select@type % TODO - strictly, not the right test
    \bbl@bodydir{#1}%
    \bbl@pardir{#1}%
  \fi
  \bbl@textdir{#1}}
\ifodd\bbl@engine  % luatex=1
  \AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir}
  \DisableBabelHook{babel-bidi}
  \def\bbl@getluadir#1{%
    \directlua{
      if tex.#1dir == 'TLT' then
        tex.sprint('0')
      elseif tex.#1dir == 'TRT' then
        tex.sprint('1')
      end}}
  \def\bbl@setdir#1#2#3{% 1=text/par.. 2=\textdir.. 3=0 lr/1 rl
    \ifcase#3\relax
      \ifcase\bbl@getluadir{#1}\relax\else
        #2 TLT\relax
      \fi
    \else
      \ifcase\bbl@getluadir{#1}\relax
        #2 TRT\relax
      \fi
    \fi}
  \def\bbl@textdir#1{%
    \bbl@setdir{text}\textdir{#1}% TODO - ?\linedir
    \setattribute\bbl@attr@dir{#1}}
  \def\bbl@pardir{\bbl@setdir{par}\pardir}
  \def\bbl@bodydir{\bbl@setdir{body}\bodydir}
  \def\bbl@pagedir{\bbl@setdir{page}\pagedir}
  \def\bbl@dirparastext{\pardir\the\textdir\relax}%   %%%%
\else % pdftex=0, xetex=2
  \AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir}
  \DisableBabelHook{babel-bidi}
  \newcount\bbl@dirlevel
  \chardef\bbl@thetextdir\z@
  \chardef\bbl@thepardir\z@
  \def\bbl@textdir#1{%
    \ifcase#1\relax
       \chardef\bbl@thetextdir\z@
       \bbl@textdir@i\beginL\endL
     \else
       \chardef\bbl@thetextdir\@ne
       \bbl@textdir@i\beginR\endR
    \fi}
  \def\bbl@textdir@i#1#2{%
    \ifhmode
      \ifnum\currentgrouplevel>\z@
        \ifnum\currentgrouplevel=\bbl@dirlevel
          \bbl@error{Multiple bidi settings inside a group}%
            {I'll insert a new group, but expect wrong results.}%
          \bgroup\aftergroup#2\aftergroup\egroup
        \else
          \ifcase\currentgrouptype\or % 0 bottom 
            \aftergroup#2% 1 simple {}
          \or
            \bgroup\aftergroup#2\aftergroup\egroup % 2 hbox
          \or
            \bgroup\aftergroup#2\aftergroup\egroup % 3 adj hbox
          \or\or\or % vbox vtop align
          \or
            \bgroup\aftergroup#2\aftergroup\egroup % 7 noalign
          \or\or\or\or\or\or % output math disc insert vcent mathchoice
          \or
            \aftergroup#2% 14 \begingroup
          \else
            \bgroup\aftergroup#2\aftergroup\egroup % 15 adj
          \fi
        \fi
        \bbl@dirlevel\currentgrouplevel
      \fi
      #1%
    \fi}
  \def\bbl@pardir#1{\chardef\bbl@thepardir#1\relax}
  \let\bbl@bodydir\@gobble
  \let\bbl@pagedir\@gobble
  \def\bbl@dirparastext{\chardef\bbl@thepardir\bbl@thetextdir}
%    \end{macrocode}
%  
% The following command is executed only if there is a right-to-left
% script (once). It activates the |\everypar| hack for \xetex, to
% properly handle the par direction. Note text and par dirs are
% decoupled to some extent (although not completely).
%
% \changes{3.16}{2018/01/02}{Fix - the direction prevented the removal
%   of the indent to be re-placed}
%
%    \begin{macrocode}
  \def\bbl@xebidipar{%
    \let\bbl@xebidipar\relax 
    \TeXXeTstate\@ne
    \def\bbl@xeeverypar{%
      \ifcase\bbl@thepardir
        \ifcase\bbl@thetextdir\else\beginR\fi
      \else
        {\setbox\z@\lastbox\beginR\box\z@}% 
      \fi}%
    \let\bbl@severypar\everypar
    \newtoks\everypar
    \everypar=\bbl@severypar
    \bbl@severypar{\bbl@xeeverypar\the\everypar}}
\fi
%    \end{macrocode}
%  
% A tool for weak L (mainly digits). 
%
% \changes{3.16}{2018/01/02}{New macro \cs{babelsublr}}
%
%    \begin{macrocode}
\DeclareRobustCommand\babelsublr[1]{\leavevmode{\bbl@textdir\z@#1}}
%    \end{macrocode}
%
% \subsection{Local Language Configuration}
%
%  \begin{macro}{\loadlocalcfg}
%    At some sites it may be necessary to add site-specific actions to
%    a language definition file. This can be done by creating a file
%    with the same name as the language definition file, but with the
%    extension \file{.cfg}. For instance the file \file{norsk.cfg}
%    will be loaded when the language definition file \file{norsk.ldf}
%    is loaded.
%
%    For plain-based formats we don't want to override the definition
%    of |\loadlocalcfg| from \file{plain.def}.
%
%    \begin{macrocode}
\bbl@trace{Local Language Configuration}
\ifx\loadlocalcfg\@undefined
  \@ifpackagewith{babel}{noconfigs}%
    {\let\loadlocalcfg\@gobble}%
    {\def\loadlocalcfg#1{%
      \InputIfFileExists{#1.cfg}%
        {\typeout{*************************************^^J%
                       * Local config file #1.cfg used^^J%
                       *}}%
        \@empty}}
\fi
%    \end{macrocode}
%
%    Just to be compatible with \LaTeX$\:$2.09 we add a few more lines
%    of code:
%
%    \begin{macrocode}
\ifx\@unexpandable@protect\@undefined
  \def\@unexpandable@protect{\noexpand\protect\noexpand}
  \long\def\protected@write#1#2#3{%
    \begingroup
      \let\thepage\relax
      #2%
      \let\protect\@unexpandable@protect
      \edef\reserved@a{\write#1{#3}}%
      \reserved@a
    \endgroup
    \if@nobreak\ifvmode\nobreak\fi\fi}
\fi
%</core>
%    \end{macrocode}%
%    \end{macro}
%
% \section{Multiple languages (\texttt{switch.def)}}
%
%    Plain \TeX\ version~3.0 provides the primitive |\language| that
%    is used to store the current language. When used with a pre-3.0
%    version this function has to be implemented by allocating a
%    counter.
%
%    \begin{macrocode}
%<*kernel>
<@Make sure ProvidesFile is defined@>
\ProvidesFile{switch.def}[<@date@> <@version@> Babel switching mechanism]
<@Load macros for plain if not LaTeX@>
<@Define core switching macros@>
%    \end{macrocode}
%
%  \begin{macro}{\adddialect}
%    The macro |\adddialect| can be used to add the name of a dialect
%    or variant language, for which an already defined hyphenation
%    table can be used.
%
%    \begin{macrocode}
\def\bbl@version{<@version@>}
\def\bbl@date{<@date@>}
\def\adddialect#1#2{%
  \global\chardef#1#2\relax
  \bbl@usehooks{adddialect}{{#1}{#2}}%
  \wlog{\string#1 = a dialect from \string\language#2}}
%    \end{macrocode}
%
%  \end{macro}
%
% \changes{babel~3.9a}{2012/09/07}{Added macro}
% \changes{babel~3.9a}{2013/01/23}{New macro to normalize 
%    a macro (eg, \cs{languagename}) to lowercase if necessary}
%
%    |\bbl@iflanguage| executes code only if the language |l@|
%    exists. Otherwise raises and error.
%
%    The argument of |\bbl@fixname| has to be a macro name, as it may get
%    ``fixed'' if casing (lc/uc) is wrong. It's intented to fix a
%    long-standing bug when |\foreignlanguage| and the like appear in
%    a |\MakeXXXcase|. However, a lowercase form is not imposed to
%    improve backward compatibility (perhaps you defined a language
%    named |MYLANG|, but unfortunately mixed case names cannot be
%    trapped). Note |l@| is encapsulated, so that its case does not
%    change.
%
%    \begin{macrocode}
\def\bbl@fixname#1{%
  \begingroup
    \def\bbl@tempe{l@}%
    \edef\bbl@tempd{\noexpand\@ifundefined{\noexpand\bbl@tempe#1}}%
    \bbl@tempd
      {\lowercase\expandafter{\bbl@tempd}%
         {\uppercase\expandafter{\bbl@tempd}%
           \@empty
           {\edef\bbl@tempd{\def\noexpand#1{#1}}%
            \uppercase\expandafter{\bbl@tempd}}}%
         {\edef\bbl@tempd{\def\noexpand#1{#1}}%
          \lowercase\expandafter{\bbl@tempd}}}%
      \@empty
    \edef\bbl@tempd{\endgroup\def\noexpand#1{#1}}%
  \bbl@tempd}
\def\bbl@iflanguage#1{%
  \@ifundefined{l@#1}{\@nolanerr{#1}\@gobble}\@firstofone}
%    \end{macrocode}
%
%  \begin{macro}{\iflanguage}
%    Users might want to test (in a private package for instance)
%    which language is currently active. For this we provide a test
%    macro, |\iflanguage|, that has three arguments.  It checks
%    whether the first argument is a known language. If so, it
%    compares the first argument with the value of |\language|. Then,
%    depending on the result of the comparison, it executes either the
%    second or the third argument.
%
%    \begin{macrocode}
\def\iflanguage#1{%
  \bbl@iflanguage{#1}{%
    \ifnum\csname l@#1\endcsname=\language
      \expandafter\@firstoftwo
    \else
      \expandafter\@secondoftwo
    \fi}}
%    \end{macrocode}
%
%  \end{macro}
%
% \subsection{Selecting the language}
%
%  \begin{macro}{\selectlanguage}
%    The macro |\selectlanguage| checks whether the language is
%    already defined before it performs its actual task, which is to
%    update |\language| and activate language-specific definitions.
%
%    To allow the call of |\selectlanguage| either with a control
%    sequence name or with a simple string as argument, we have to use
%    a trick to delete the optional escape character.
%
%    To convert a control sequence to a string, we use the |\string|
%    primitive.  Next we have to look at the first character of this
%    string and compare it with the escape character.  Because this
%    escape character can be changed by setting the internal integer
%    |\escapechar| to a character number, we have to compare this
%    number with the character of the string.  To do this we have to
%    use \TeX's backquote notation to specify the character as a
%    number.
%
%    If the first character of the |\string|'ed argument is the
%    current escape character, the comparison has stripped this
%    character and the rest in the `then' part consists of the rest of
%    the control sequence name.  Otherwise we know that either the
%    argument is not a control sequence or |\escapechar| is set to a
%    value outside of the character range~$0$--$255$.
%
%    If the user gives an empty argument, we provide a default
%    argument for |\string|.  This argument should expand to nothing.
%
% \changes{babel~3.9a}{2012/11/16}{\cs{bbl@select@type} keep tracks of
%    the selection method: 0 is select, 1 is foreign}
%
%    \begin{macrocode}
\let\bbl@select@type\z@
\edef\selectlanguage{%
  \noexpand\protect
  \expandafter\noexpand\csname selectlanguage \endcsname}
%    \end{macrocode}
%
%    Because the command |\selectlanguage| could be used in a moving
%    argument it expands to \verb*=\protect\selectlanguage =.
%    Therefore, we have to make sure that a macro |\protect| exists.
%    If it doesn't it is |\let| to |\relax|.
%
%    \begin{macrocode}
\ifx\@undefined\protect\let\protect\relax\fi
%    \end{macrocode}
%
%    As \LaTeX$\:$2.09 writes to files \textit{expanded} whereas
%    \LaTeXe\ takes care \textit{not} to expand the arguments of
%    |\write| statements we need to be a bit clever about the way we
%    add information to \file{.aux} files. Therefore we introduce the
%    macro |\xstring| which should expand to the right amount of
%    |\string|'s.
%
%    \begin{macrocode}
\ifx\documentclass\@undefined
  \def\xstring{\string\string\string}
\else
  \let\xstring\string
\fi
%    \end{macrocode}
%
% \end{macro}
%
%    Since version 3.5 \babel\ writes entries to the auxiliary files in
%    order to typeset table of contents etc. in the correct language
%    environment.
%  \begin{macro}{\bbl@pop@language}
%    \emph{But} when the language change happens \emph{inside} a group
%    the end of the group doesn't write anything to the auxiliary
%    files. Therefore we need \TeX's |aftergroup| mechanism to help
%    us. The command |\aftergroup| stores the token immediately
%    following it to be executed when the current group is closed. So
%    we define a temporary control sequence |\bbl@pop@language| to be
%    executed at the end of the group. It calls |\bbl@set@language|
%    with the name of the current language as its argument.
%
%  \begin{macro}{\bbl@language@stack}
%    The previous solution works for one level of nesting groups, but
%    as soon as more levels are used it is no longer adequate. For
%    that case we need to keep track of the nested languages using a
%    stack mechanism. This stack is called |\bbl@language@stack| and
%    initially empty.
%
%    \begin{macrocode}
\def\bbl@language@stack{}
%    \end{macrocode}
%
%    When using a stack we need a mechanism to push an element on the
%    stack and to retrieve the information afterwards.
%  \begin{macro}{\bbl@push@language}
%  \begin{macro}{\bbl@pop@language}
%    The stack is simply a list of languagenames, separated with a `+'
%    sign; the push function can be simple:
%
%    \begin{macrocode}
\def\bbl@push@language{%
  \xdef\bbl@language@stack{\languagename+\bbl@language@stack}}
%    \end{macrocode}
%
%    Retrieving information from the stack is a little bit less simple,
%    as we need to remove the element from the stack while storing it
%    in the macro |\languagename|. For this we first define a helper function.
%  \begin{macro}{\bbl@pop@lang}
%    This macro stores its first element (which is delimited by the
%    `+'-sign) in |\languagename| and stores the rest of the string
%    (delimited by `-') in its third argument.
%
%    \begin{macrocode}
\def\bbl@pop@lang#1+#2-#3{%
  \edef\languagename{#1}\xdef#3{#2}}
%    \end{macrocode}
%
%  \end{macro}
%    The reason for the somewhat weird arrangement of arguments to the
%    helper function is the fact it is called in the following way.
%    This means that before |\bbl@pop@lang| is executed \TeX\ first
%    \emph{expands} the stack, stored in |\bbl@language@stack|. The
%    result of that is that the argument string of |\bbl@pop@lang|
%    contains one or more language names, each followed by a `+'-sign
%    (zero language names won't occur as this macro will only be
%    called after something has been pushed on the stack) followed by
%    the `-'-sign and finally the reference to the stack.
%
%    \begin{macrocode}
\let\bbl@ifrestoring\@secondoftwo
\def\bbl@pop@language{%
  \expandafter\bbl@pop@lang\bbl@language@stack-\bbl@language@stack
  \let\bbl@ifrestoring\@firstoftwo
  \expandafter\bbl@set@language\expandafter{\languagename}%
  \let\bbl@ifrestoring\@secondoftwo}
%    \end{macrocode}
%
%    Once the name of the previous language is retrieved from the stack,
%    it is fed to |\bbl@set@language| to do the actual work of
%    switching everything that needs switching.
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
%    \begin{macrocode}
\expandafter\def\csname selectlanguage \endcsname#1{%
  \ifnum\bbl@hymapsel=\@cclv\let\bbl@hymapsel\tw@\fi
  \bbl@push@language
  \aftergroup\bbl@pop@language
  \bbl@set@language{#1}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@set@language}
% 
%    The macro |\bbl@set@language| takes care of switching the
%    language environment \emph{and} of writing entries on the
%    auxiliary files.  For historial reasons, language names can be
%    either |language| of |\language|. To catch either form a trick is
%    used, but unfortunately as a side effect the catcodes of letters
%    in |\languagename| are not well defined. The list of auxiliary
%    files can be extended by redefining |\BabelContentsFiles|, but
%    make sure they are loaded inside a group (as |aux|, |toc|,
%    |lof|, and |lot| do) or the last language of the document will
%    remain active afterwards.
%
%    We also write a command to change the current language in the
%    auxiliary files.
%
% \changes{babel~3.9a}{2012/09/09}{Added hook}
% \changes{babel~3.9a}{2012/11/07}{Use a loop for contents files, with
%    the help of \cs{BabelContentsFiles}}
% \changes{babel~3.9a}{2013/03/08}{Don't write to aux if language is
%    unknown}
% \changes{babel~3.9h}{2013/11/20}{Error with a more helpful text }
% \changes{babel~3.16}{2018/01/02}{New mechanism to pass the language
% to aux, toc, etc.}
%
%    \begin{macrocode}
\def\BabelContentsFiles{toc,lof,lot}
\def\bbl@set@language#1{%
  \edef\languagename{%
    \ifnum\escapechar=\expandafter`\string#1\@empty
    \else\string#1\@empty\fi}%
  \select@language{\languagename}%
  \expandafter\ifx\csname date\languagename\endcsname\relax\else
    \if@filesw
      \protected@write\@auxout{}{\string\babel@aux{\languagename}{}}%
      \bbl@usehooks{write}{}%
    \fi
  \fi}
\def\select@language#1{%
  \ifnum\bbl@hymapsel=\@cclv\chardef\bbl@hymapsel4\relax\fi
  \edef\languagename{#1}%
  \bbl@fixname\languagename
  \bbl@iflanguage\languagename{%
    \expandafter\ifx\csname date\languagename\endcsname\relax
      \bbl@error
        {Unknown language `#1'. Either you have\\%
         misspelled its name, it has not been installed,\\%
         or you requested it in a previous run. Fix its name,\\%
         install it or just rerun the file, respectively}%
        {You may proceed, but expect wrong results}%
    \else
      \let\bbl@select@type\z@
      \expandafter\bbl@switch\expandafter{\languagename}%
    \fi}}
\def\babel@aux#1#2{%
  \select@language{#1}%
  \bbl@foreach\BabelContentsFiles{%
    \@writefile{##1}{\babel@toc{#1}{#2}}}} %% TODO - ok in plain?
\def\babel@toc#1#2{%
  \select@language{#1}}
%    \end{macrocode}
%    
% A bit of optimization. Select in heads/foots the language only if
% necessary. The real thing is in \texttt{babel.def}.
%
%    \begin{macrocode}
\let\select@language@x\select@language
%    \end{macrocode}
%
%  \end{macro}
%
%    First, check if the user asks for a known language. If so,
%    update the value of |\language| and call |\originalTeX|
%    to bring \TeX\ in a certain pre-defined state.
%
% \changes{babel~3.8l}{2008/07/06}{Use \cs{bbl@patterns}}
% \changes{babel~3.9a}{2012/07/27}{Moved \cs{bbl@patterns} to the
%    correct place, after setting the extras for the current
%    language}
% \changes{babel~3.9a}{2012/08/01}{Created \cs{bbl@switch} with code
%    shared by \cs{select@language} and \cs{foreing@language}}
%
%    The name of the language is stored in the control sequence
%    |\languagename|.
%
%    Then we have to \emph{re}define |\originalTeX| to compensate for
%    the things that have been activated.  To save memory space for
%    the macro definition of |\originalTeX|, we construct the control
%    sequence name for the |\noextras|\langvar\ command at definition
%    time by expanding the |\csname| primitive.
%
%    Now activate the language-specific definitions. This is done by
%    constructing the names of three macros by concatenating three
%    words with the argument of |\selectlanguage|, and calling these
%    macros. \nb{What if \cs{hyphenation} was used in |extras|? Patch
%    temporarily |\set@hyphenmins| and hyphenation. It can be done in
%    hooks if necessary.}
%
%    The switching of the values of |\lefthyphenmin| and
%    |\righthyphenmin| is somewhat different. First we save their
%    current values, then we check if |\|\langvar|hyphenmins| is
%    defined. If it is not, we set default values (2 and 3), otherwise
%    the values in |\|\langvar|hyphenmins| will be used.
%
% \changes{babel~3.9a}{2012/08/01}{Adddd \cs{bbl@iflanguagename} and
%   \cs{select@language@x}, which is no-op if the language is the same}
% \changes{babel~3.9a}{2013/01/23}{\cs{select@language} sets 
%   \textsc{languagename} so that it has the correct value in the aux
%   file (eg, shorthand expansion was wrong)}
% \changes{babel~3.9a}{2012/08/14}{Make sure the save counter is reset
%    even if \cs{originalTeX} is used in other contexts}
% \changes{babel~3.9c}{2013/04/08}{Removed an extra empty line}
% \changes{babel~3.9h}{2013/11/29}{Use \cs{def} instead of
%    \cs{renewcommand} for \cs{BabelLower}}
% \changes{babel~3.9i}{2014/03/04}{Added `afterreset' hook}
% \changes{3.15}{2017/10/30}{Remove spaces inside captions and date.}
%
%    \begin{macrocode}
\newif\ifbbl@usedategroup
\def\bbl@switch#1{%
  \originalTeX
  \expandafter\def\expandafter\originalTeX\expandafter{%
    \csname noextras#1\endcsname
    \let\originalTeX\@empty
    \babel@beginsave}%
  \bbl@usehooks{afterreset}{}%
  \languageshorthands{none}%
  \ifcase\bbl@select@type
    \ifhmode
      \hskip\z@skip % trick to ignore spaces
      \csname captions#1\endcsname\relax
      \csname date#1\endcsname\relax
      \loop\ifdim\lastskip>\z@\unskip\repeat\unskip
    \else
      \csname captions#1\endcsname\relax
      \csname date#1\endcsname\relax
    \fi
  \else\ifbbl@usedategroup
    \bbl@usedategroupfalse
    \ifhmode
      \hskip\z@skip % trick to ignore spaces
      \csname date#1\endcsname\relax
      \loop\ifdim\lastskip>\z@\unskip\repeat\unskip
    \else
      \csname date#1\endcsname\relax
    \fi
  \fi\fi
  \bbl@usehooks{beforeextras}{}%
  \csname extras#1\endcsname\relax
  \bbl@usehooks{afterextras}{}%
  \ifcase\bbl@opt@hyphenmap\or
    \def\BabelLower##1##2{\lccode##1=##2\relax}%
    \ifnum\bbl@hymapsel>4\else
      \csname\languagename @bbl@hyphenmap\endcsname
    \fi
    \chardef\bbl@opt@hyphenmap\z@
  \else
    \ifnum\bbl@hymapsel>\bbl@opt@hyphenmap\else
      \csname\languagename @bbl@hyphenmap\endcsname
    \fi
  \fi
  \global\let\bbl@hymapsel\@cclv
  \bbl@patterns{#1}%
  \babel@savevariable\lefthyphenmin
  \babel@savevariable\righthyphenmin
  \expandafter\ifx\csname #1hyphenmins\endcsname\relax
    \set@hyphenmins\tw@\thr@@\relax
  \else
    \expandafter\expandafter\expandafter\set@hyphenmins
      \csname #1hyphenmins\endcsname\relax
  \fi}
%    \end{macrocode}
%
%  \begin{environment}{otherlanguage}
%    The \Lenv{otherlanguage} environment can be used as an
%    alternative to using the |\selectlanguage| declarative
%    command. When you are typesetting a document which mixes
%    left-to-right and right-to-left typesetting you have to use this
%    environment in order to let things work as you expect them to.
%
%    The |\ignorespaces| command is necessary to hide the environment
%    when it is entered in horizontal mode.
%
% \changes{babel~3.9a}{2012/07/31}{Removed \cs{originalTeX}}
%
%    \begin{macrocode}
\long\def\otherlanguage#1{%
  \ifnum\bbl@hymapsel=\@cclv\let\bbl@hymapsel\thr@@\fi
  \csname selectlanguage \endcsname{#1}%
  \ignorespaces}
%    \end{macrocode}
%
%    The |\endotherlanguage| part of the environment tries to hide
%    itself when it is called in horizontal mode.
%
%    \begin{macrocode}
\long\def\endotherlanguage{%
  \global\@ignoretrue\ignorespaces}
%    \end{macrocode}
%
%  \end{environment}
%
%  \begin{environment}{otherlanguage*}
%    The \Lenv{otherlanguage} environment is meant to be used when a
%    large part of text from a different language needs to be typeset,
%    but without changing the translation of words such as `figure'.
%    This environment makes use of |\foreign@language|.
%
%    \begin{macrocode}
\expandafter\def\csname otherlanguage*\endcsname#1{%
  \ifnum\bbl@hymapsel=\@cclv\chardef\bbl@hymapsel4\relax\fi
  \foreign@language{#1}}
%    \end{macrocode}
%
%    At the end of the environment we need to switch off the extra
%    definitions. The grouping mechanism of the environment will take
%    care of resetting the correct hyphenation rules and ``extras''.
%
%    \begin{macrocode} 
\expandafter\let\csname endotherlanguage*\endcsname\relax
%    \end{macrocode}
%
%  \end{environment}
%
%  \begin{macro}{\foreignlanguage}
%    The |\foreignlanguage| command is another substitute for the
%    |\selectlanguage| command. This command takes two arguments, the
%    first argument is the name of the language to use for typesetting
%    the text specified in the second argument.
%
%    Unlike |\selectlanguage| this command doesn't switch
%    \emph{everything}, it only switches the hyphenation rules and the
%    extra definitions for the language specified. It does this within
%    a group and assumes the |\extras|\langvar\ command doesn't make
%    any |\global| changes. The coding is very similar to part of
%    |\selectlanguage|.
%
%    |\bbl@beforeforeign| is a trick to fix a bug in bidi
%    texts. |\foreignlanguage| is supposed to be a `text' command, and
%    therefore it must emit a |\leavevmode|, but it does not, and
%    therefore the indent is placed on the opposite margin. For
%    backward compatibility, however, it is done only if a
%    right-to-left script is requested; otherwise, it is no-op.
%
%    (3.11) |\foreignlanguage*| is a temporary, experimental macro for
%    a few lines with a different script direction, while preserving
%    the paragraph format (thank the braces around |\par|, things like
%    |\hangindent| are not reset). Do not use it in production,
%    because its semantics and its syntax may change (and very likely
%    will, or even it could be removed altogether). Currently it
%    enters in vmode and then selects the language (which in turn sets the
%    paragraph direction).
%
%    (3.11) Also experimental are the hook |foreign| and
%    |foreign*|. With them you can redefine |\BabelText| which by
%    default does nothing. Its
%    behavior is not well defined yet. So, use it in
%    horizontal mode only if you do not want surprises.
%
%    In other words, at the beginning of a paragraph |\foreignlanguage|
%    enters into hmode with the surrounding lang, and with
%    |\foreignlanguage*| with the new lang.
%
% \changes{babel~3.9a}{2012/07/30}{Removed unnecesary \cs{noextras}
%    just before closing the group}
% \changes{babel~3.9a}{2012/07/31}{Moved \cs{originalTeX} to
%    \cs{foreing@language} so that it's also used in
%    \texttt{otherlanguage*}}
% \changes{babel~3.9a}{2012/12/24}{\cs{foreignlanguage} defined
%    similarly to \cs{selectlanguage}, protecting the whole macro}
% \changes{babel~3.11}{2017/03/04}{\cs{foreignlanguage*},
%    \cs{bbl@beforeforeign} and hooks}
%
%    \begin{macrocode}
\providecommand\bbl@beforeforeign{}
\edef\foreignlanguage{%
  \noexpand\protect
  \expandafter\noexpand\csname foreignlanguage \endcsname}
\expandafter\def\csname foreignlanguage \endcsname{%
  \@ifstar\bbl@foreign@s\bbl@foreign@x}
\def\bbl@foreign@x#1#2{%
  \begingroup
    \let\BabelText\@firstofone
    \bbl@beforeforeign
    \foreign@language{#1}%
    \bbl@usehooks{foreign}{}%
    \BabelText{#2}% Now in horizontal mode!
  \endgroup}
\def\bbl@foreign@s#1#2{% TODO - \shapemode, \@setpar, ?\@@par
  \begingroup
    {\par}%
    \let\BabelText\@firstofone
    \foreign@language{#1}%
    \bbl@usehooks{foreign*}{}%
    \bbl@dirparastext
    \BabelText{#2}% Still in vertical mode!
    {\par}%
  \endgroup}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\foreign@language}
%    This macro does the
%    work for |\foreignlanguage| and the \Lenv{otherlanguage*}
%    environment. First we need to store the name of the language and
%    check that it is a known language. Then it just calls
%    |bbl@switch|.
%
% \changes{babel~3.9h}{2013/11/29}{The warning shows the language
%    actually selected (with fixed case)}
%
%    \begin{macrocode}
\def\foreign@language#1{%
  \edef\languagename{#1}%
  \bbl@fixname\languagename
  \bbl@iflanguage\languagename{%
    \expandafter\ifx\csname date\languagename\endcsname\relax
      \bbl@warning
        {Unknown language `#1'. Either you have\\%
         misspelled its name, it has not been installed,\\%
         or you requested it in a previous run. Fix its name,\\%
         install it or just rerun the file, respectively.\\%
         I'll proceed, but expect wrong results.\\%
         Reported}%
    \fi
    \let\bbl@select@type\@ne
    \expandafter\bbl@switch\expandafter{\languagename}}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\bbl@patterns}
%
% \changes{babel~3.8l}{2008/07/06}{Macro added}
% \changes{babel~3.9a}{2012/08/28}{Extended to set hyphenation
%    exceptions as defined with \cs{babelhyphenation}}
% \changes{babel~3.9m}{2015/07/25}{Preset \cs{bbl@pttnlist} and
%    \cs{bbl@patterns@} to relax, for luatex.}
%
%    This macro selects the hyphenation patterns by changing the
%    \cs{language} register.  If special hyphenation patterns
%    are available specifically for the current font encoding,
%    use them instead of the default.
%
%    It also sets hyphenation exceptions, but only once, because they
%    are global (here language |\lccode|'s has been set,
%    too). |\bbl@hyphenation@| is set to relax until the very first
%    |\babelhyphenation|, so do nothing with this value. If the
%    exceptions for a language (by its number, not its name, so that
%    |:ENC| is taken into account) has been set, then use
%    |\hyphenation| with both global and language exceptions and empty
%    the latter to mark they must not be set again.
%
%    \begin{macrocode}
\let\bbl@hyphlist\@empty
\let\bbl@hyphenation@\relax
\let\bbl@pttnlist\@empty
\let\bbl@patterns@\relax
\let\bbl@hymapsel=\@cclv
\def\bbl@patterns#1{%
  \language=\expandafter\ifx\csname l@#1:\f@encoding\endcsname\relax
      \csname l@#1\endcsname
      \edef\bbl@tempa{#1}%
    \else
      \csname l@#1:\f@encoding\endcsname
      \edef\bbl@tempa{#1:\f@encoding}%
    \fi
  \@expandtwoargs\bbl@usehooks{patterns}{{#1}{\bbl@tempa}}%
  \@ifundefined{bbl@hyphenation@}{}{% Can be \relax!
    \begingroup
      \bbl@xin@{,\number\language,}{,\bbl@hyphlist}%
      \ifin@\else
        \@expandtwoargs\bbl@usehooks{hyphenation}{{#1}{\bbl@tempa}}%
        \hyphenation{%
          \bbl@hyphenation@
          \@ifundefined{bbl@hyphenation@#1}%
            \@empty
            {\space\csname bbl@hyphenation@#1\endcsname}}%
        \xdef\bbl@hyphlist{\bbl@hyphlist\number\language,}%
      \fi
    \endgroup}}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{environment}{hyphenrules}
%    The environment \Lenv{hyphenrules} can be used to select
%    \emph{just} the hyphenation rules. This environment does
%    \emph{not} change |\languagename| and when the hyphenation rules
%    specified were not loaded it has no effect. Note however,
%    |\lccode|'s and font encodings are not set at all, so in most
%    cases you should use |otherlanguage*|.
%
% \changes{babel~3.8j}{2008/03/16}{Also set the hyphenmin parameters to
%    the correct value (PR3997)} 
% \changes{babel~3.8l}{2008/07/06}{Use \cs{bbl@patterns}}
% \changes{3.15}{2017/10/30}{Don't set language name. Use temp macro.}
% \changes{3.15}{2018/02/14}{Fix - didn't work with polyglossia}
%
%    \begin{macrocode}
\def\hyphenrules#1{%
  \edef\bbl@tempf{#1}%
  \bbl@fixname\bbl@tempf
  \bbl@iflanguage\bbl@tempf{%
    \expandafter\bbl@patterns\expandafter{\bbl@tempf}%
    \languageshorthands{none}%
    \expandafter\ifx\csname\bbl@tempf hyphenmins\endcsname\relax
      \set@hyphenmins\tw@\thr@@\relax
    \else
      \expandafter\expandafter\expandafter\set@hyphenmins
      \csname\bbl@tempf hyphenmins\endcsname\relax
    \fi}}
\let\endhyphenrules\@empty
%    \end{macrocode}
%
%  \end{environment}
%
%  \begin{macro}{\providehyphenmins}
%    The macro |\providehyphenmins| should be used in the language
%    definition files to provide a \emph{default} setting for the
%    hyphenation parameters |\lefthyphenmin| and |\righthyphenmin|. If
%    the macro |\|\langvar|hyphenmins| is already defined this command
%    has no effect.
%
%    \begin{macrocode}
\def\providehyphenmins#1#2{%
  \expandafter\ifx\csname #1hyphenmins\endcsname\relax
    \@namedef{#1hyphenmins}{#2}%
  \fi}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\set@hyphenmins}
%    This macro sets the values of |\lefthyphenmin| and
%    |\righthyphenmin|. It expects two values as its argument.
%
%    \begin{macrocode}
\def\set@hyphenmins#1#2{%
  \lefthyphenmin#1\relax
  \righthyphenmin#2\relax}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\ProvidesLanguage}
%    The identification code for each file is something that was
%    introduced in \LaTeXe. When the command |\ProvidesFile| does not
%    exist, a dummy definition is provided temporarily. For use in the
%    language definition file the command |\ProvidesLanguage| is
%    defined by \babel.
%
%    Depending on the format, ie, on if the former is defined, we use
%    a similar definition or not.
%
%    \changes{babel~3.9a}{2012/12/09}{Save info about the babel
%    version in the format (switch.def) so that it can be checked
%    later if necessary}
%
%    \begin{macrocode}
\ifx\ProvidesFile\@undefined
  \def\ProvidesLanguage#1[#2 #3 #4]{%
    \wlog{Language: #1 #4 #3 <#2>}%
    }
\else
  \def\ProvidesLanguage#1{%
    \begingroup
      \catcode`\ 10 %
      \@makeother\/%
      \@ifnextchar[%]
        {\@provideslanguage{#1}}{\@provideslanguage{#1}[]}}
  \def\@provideslanguage#1[#2]{%
    \wlog{Language: #1 #2}%
    \expandafter\xdef\csname ver@#1.ldf\endcsname{#2}%
    \endgroup}
\fi
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\LdfInit}
%    This macro is defined in two versions. The first version is to be
%    part of the `kernel' of \babel, ie. the part that is loaded in
%    the format; the second version is defined in \file{babel.def}.
%    The version in the format just checks the category code of the
%    ampersand and then loads \file{babel.def}.
%
%    The category code of the ampersand is restored and the macro
%    calls itself again with the new definition from
%    \file{babel.def}
%
%    \begin{macrocode}
\def\LdfInit{%
  \chardef\atcatcode=\catcode`\@
  \catcode`\@=11\relax
  \input babel.def\relax
  \catcode`\@=\atcatcode \let\atcatcode\relax
  \LdfInit}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\originalTeX}
%    The macro|\originalTeX| should be known to \TeX\ at this moment.
%    As it has to be expandable we |\let| it to |\@empty| instead of
%    |\relax|.
%
%    \begin{macrocode}
\ifx\originalTeX\@undefined\let\originalTeX\@empty\fi
%    \end{macrocode}
%
%    Because this part of the code can be included in a format, we
%    make sure that the macro which initialises the save mechanism,
%    |\babel@beginsave|, is not considered to be undefined.
%
%    \begin{macrocode}
\ifx\babel@beginsave\@undefined\let\babel@beginsave\relax\fi
%    \end{macrocode}
%
%  \end{macro}
%
% A few macro names are reserved for future releases of \babel, which
% will use the concept of `locale':
%
% \changes{babel~3.9s}{2017/04/13}{Reserved macro names for `locale'}
%
%    \begin{macrocode}
\providecommand\setlocale{%
  \bbl@error
    {Not yet available}%
    {Find an armchair, sit down and wait}}
\let\uselocale\setlocale
\let\locale\setlocale
\let\selectlocale\setlocale
\let\textlocale\setlocale
\let\textlanguage\setlocale
\let\languagetext\setlocale
%    \end{macrocode}
%
% \subsection{Errors}
%
%  \begin{macro}{\@nolanerr}
%  \begin{macro}{\@nopatterns}
%    The \babel\ package will signal an error when a documents tries
%    to select a language that hasn't been defined earlier. When a
%    user selects a language for which no hyphenation patterns were
%    loaded into the format he will be given a warning about that
%    fact. We revert to the patterns for |\language|=0 in that case.
%    In most formats that will be (US)english, but it might also be
%    empty.
%  \begin{macro}{\@noopterr}
%    When the package was loaded without options not everything will
%    work as expected. An error message is issued in that case.
%
%    When the format knows about |\PackageError| it must be \LaTeXe,
%    so we can safely use its error handling interface. Otherwise
%    we'll have to `keep it simple'.
%
% \changes{babel~3.9a}{2012/07/30}{\cs{newcommand}s replaced by
%    \cs{def}'s, so that the file can be loaded twice}
% \changes{babel~3.9a}{2013/01/26}{Define generic variants instead of
%    duplicating each predefined message}    
%
%    \begin{macrocode}
\edef\bbl@nulllanguage{\string\language=0}
\ifx\PackageError\@undefined
  \def\bbl@error#1#2{%
    \begingroup
      \newlinechar=`\^^J
      \def\\{^^J(babel) }%
      \errhelp{#2}\errmessage{\\#1}%
    \endgroup}
  \def\bbl@warning#1{%
    \begingroup
      \newlinechar=`\^^J
      \def\\{^^J(babel) }%
      \message{\\#1}%
    \endgroup}
  \def\bbl@info#1{%
    \begingroup
      \newlinechar=`\^^J
      \def\\{^^J}%
      \wlog{#1}%
    \endgroup}
\else
  \def\bbl@error#1#2{%
    \begingroup
      \def\\{\MessageBreak}%
      \PackageError{babel}{#1}{#2}%
    \endgroup}
  \def\bbl@warning#1{%
    \begingroup
      \def\\{\MessageBreak}%
      \PackageWarning{babel}{#1}%
    \endgroup}
  \def\bbl@info#1{%
    \begingroup
      \def\\{\MessageBreak}%
      \PackageInfo{babel}{#1}%
    \endgroup}
\fi
\@ifpackagewith{babel}{silent}
  {\let\bbl@info\@gobble
   \let\bbl@warning\@gobble}
  {}
\def\bbl@nocaption#1#2{% 1: text to be printed 2: caption macro \langXname
  \gdef#2{\textbf{?#1?}}%
  #2%
  \bbl@warning{%
    \string#2 not set. Please, define\\%
    it in the preamble with something like:\\%
    \string\renewcommand\string#2{..}\\%
    Reported}}
\def\@nolanerr#1{%
  \bbl@error
    {You haven't defined the language #1\space yet}%
    {Your command will be ignored, type <return> to proceed}}
\def\@nopatterns#1{%
  \bbl@warning
    {No hyphenation patterns were preloaded for\\%
     the language `#1' into the format.\\%
     Please, configure your TeX system to add them and\\%
     rebuild the format. Now I will use the patterns\\%
     preloaded for \bbl@nulllanguage\space instead}}
\let\bbl@usehooks\@gobbletwo
%</kernel>
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% \section{Loading hyphenation patterns}
%
%  The following code is meant to be read by ini\TeX\ because it
%  should instruct \TeX\ to read hyphenation patterns. To this end the
%  \texttt{docstrip} option \texttt{patterns} can be used to include
%  this code in the file \file{hyphen.cfg}. Code is written with lower
%  level macros.
%
%    |toks8| stores info to be shown when the program is run.
%
% \changes{babel~3.9g}{2013/05/30}{Code moved from plain.def}
%
%    We want to add a message to the message \LaTeX$\:$2.09 puts in
%    the |\everyjob| register. This could be done by the following
%    code: 
%\begin{verbatim}
%    \let\orgeveryjob\everyjob
%    \def\everyjob#1{%
%      \orgeveryjob{#1}%
%      \orgeveryjob\expandafter{\the\orgeveryjob\immediate\write16{%
%          hyphenation patterns for \the\loaded@patterns loaded.}}%
%      \let\everyjob\orgeveryjob\let\orgeveryjob\@undefined}
%\end{verbatim}
%    The code above redefines the control sequence \cs{everyjob}
%    in order to be able to add something to the current contents of
%    the register. This is necessary because the processing of
%    hyphenation patterns happens long before \LaTeX\ fills the
%    register.
%
%    There are some problems with this approach though.
%  \begin{itemize}
%    \item When someone wants to use several hyphenation patterns with
%    \SliTeX\ the above scheme won't work. The reason is that \SliTeX\
%    overwrites the contents of the |\everyjob| register with its own
%    message.
%    \item Plain \TeX\ does not use the |\everyjob| register so the
%    message would not be displayed.
%  \end{itemize}
%    To circumvent this a `dirty trick' can be used. As this code is
%    only processed when creating a new format file there is one
%    command that is sure to be used, |\dump|. Therefore the original
%    |\dump| is saved in |\org@dump| and a new definition is supplied.
%
%    To make sure that \LaTeX$\:$2.09 executes the
%    |\@begindocumenthook| we would want to alter |\begin{document}|,
%    but as this done too often already, we add the new code at the
%    front of |\@preamblecmds|. But we can only do that after it has
%    been defined, so we add this piece of code to |\dump|.
%
%    This new definition starts by adding an instruction to write a
%    message on the terminal and in the transcript file to inform the
%    user of the preloaded hyphenation patterns.
%
%    Then everything is restored to the old situation and the format
%    is dumped.
%   
%    \begin{macrocode}
%<*patterns>
<@Make sure ProvidesFile is defined@>
\ProvidesFile{hyphen.cfg}[<@date@> <@version@> Babel hyphens]
\xdef\bbl@format{\jobname}
\ifx\AtBeginDocument\@undefined
  \def\@empty{}
  \let\orig@dump\dump
  \def\dump{%
    \ifx\@ztryfc\@undefined
    \else
      \toks0=\expandafter{\@preamblecmds}%
      \edef\@preamblecmds{\noexpand\@begindocumenthook\the\toks0}%
      \def\@begindocumenthook{}%
    \fi
    \let\dump\orig@dump\let\orig@dump\@undefined\dump}
\fi
<@Define core switching macros@>
\toks8{Babel <<@version@>> and hyphenation patterns for }%
%    \end{macrocode}
%
%
%  \begin{macro}{\process@line}
%    Each line in the file \file{language.dat} is processed by
%    |\process@line| after it is read. The first thing this macro does
%    is to check whether the line starts with \texttt{=}.
%    When the first token of a line is an \texttt{=}, the macro
%    |\process@synonym| is called; otherwise the macro
%    |\process@language| will continue.
%
% \changes{babel~3.9a}{2012/12/12}{Use spaces as delimiters, to avoid
%    extra spaces. Once parsed, pass them in the traditional way}
%
%    \begin{macrocode}   
\def\process@line#1#2 #3 #4 {%
  \ifx=#1%
    \process@synonym{#2}%
  \else
    \process@language{#1#2}{#3}{#4}%
  \fi
  \ignorespaces}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\process@synonym}
%
%    This macro takes care of the lines which start with an
%    \texttt{=}. It needs an empty token register to begin with.
%    |\bbl@languages| is also set to empty. 
%
%    \begin{macrocode}
\toks@{}
\def\bbl@languages{}
%    \end{macrocode}
%
%    When no languages have been loaded yet, the name following the
%    \texttt{=} will be a synonym for hyphenation register 0. So, it is stored
%    in a token register and executed when the first pattern file has
%    been processed. (The |\relax| just helps to the |\if| below
%    catching synonyms without a language.)
%
%    Otherwise the name will be a synonym for the language loaded last.
%
%    We also need to copy the hyphenmin parameters for the synonym.
%
% \changes{babel~3.9a}{2012/06/25}{Added \cs{bbl@languages}}
%
%    \begin{macrocode}
\def\process@synonym#1{%
  \ifnum\last@language=\m@ne
    \toks@\expandafter{\the\toks@\relax\process@synonym{#1}}%
  \else
    \expandafter\chardef\csname l@#1\endcsname\last@language
    \wlog{\string\l@#1=\string\language\the\last@language}%
    \expandafter\let\csname #1hyphenmins\expandafter\endcsname
      \csname\languagename hyphenmins\endcsname
    \let\bbl@elt\relax
    \edef\bbl@languages{\bbl@languages\bbl@elt{#1}{\the\last@language}{}{}}%
  \fi}
%    \end{macrocode}
%
%  \end{macro}
%
%  \begin{macro}{\process@language}
%    The macro |\process@language| is used to process a non-empty line
%    from the `configuration file'. It has three arguments, each
%    delimited by white space. The first argument is the `name' of a
%    language; the second is the name of the file that contains the
%    patterns. The optional third argument is the name of a file
%    containing hyphenation exceptions.
%
%    The first thing to do is call |\addlanguage| to allocate a
%    pattern register and to make that register `active'.
%    Then the `name' of the language that will be loaded now is
%    added to the token register |\toks8|. and finally
%    the pattern file is read.
%
% \changes{babel~3.9a}{2012/12/10}{Removed \cs{selectfont} (I presume
%    it was intended to catch wrong encoding codes, but I don't think
%    this is necessary and as a side effect it might preload fonts)}
%
%    For some hyphenation patterns it is needed to load them with a
%    specific font encoding selected. This can be specified in the
%    file \file{language.dat} by adding for instance `\texttt{:T1}' to
%    the name of the language. The macro |\bbl@get@enc| extracts the
%    font encoding from the language name and stores it in
%    |\bbl@hyph@enc|. The latter can be used in hyphenation files if
%    you need to set a behavior depending on the given encoding (it
%    is set to empty if no encoding is given).
%
%    Pattern files may contain assignments to |\lefthyphenmin| and
%    |\righthyphenmin|. \TeX\ does not keep track of these
%    assignments. Therefore we try to detect such assignments and
%    store them in the |\|\langvar|hyphenmins| macro. When no
%    assignments were made we provide a default setting.
%
%    Some pattern files contain changes to the |\lccode| en |\uccode|
%    arrays. Such changes should remain local to the language;
%    therefore we process the pattern file in a group; the |\patterns|
%    command acts globally so its effect will be remembered.
%
%    Then we globally store the settings of |\lefthyphenmin| and
%    |\righthyphenmin| and close the group.
%
%    When the hyphenation patterns have been processed we need to see
%    if a file with hyphenation exceptions needs to be read. This is
%    the case when the third argument is not empty and when it does
%    not contain a space token. (Note however there is no need to save
%    hyphenation exceptions into the format.)
%
% \changes{babel~3.9a}{2012/06/25}{Added \cs{bbl@languages}}
% \changes{babel~3.9f}{2013/05/16}{Restored code to set default
%    hyphenmins, which was deleted mistakenly}
%
%    \cs{bbl@languages} saves a snapshot of the loaded languagues in the
%    form  \cs{bbl@elt}\marg{language-name}\marg{number}%
%    \marg{patterns-file}\marg{exceptions-file}. Note the last 2
%    arguments are empty in `dialects' defined in |language.dat| with
%    |=|. Note also the language name can have encoding info.
%
%    Finally, if the counter |\language| is equal to zero we execute the
%    synonyms stored.
%
%    \begin{macrocode}
\def\process@language#1#2#3{%
  \expandafter\addlanguage\csname l@#1\endcsname
  \expandafter\language\csname l@#1\endcsname
  \edef\languagename{#1}%
  \bbl@hook@everylanguage{#1}%
  \bbl@get@enc#1::\@@@
  \begingroup
    \lefthyphenmin\m@ne
    \bbl@hook@loadpatterns{#2}%
    \ifnum\lefthyphenmin=\m@ne
    \else
      \expandafter\xdef\csname #1hyphenmins\endcsname{%
        \the\lefthyphenmin\the\righthyphenmin}%
    \fi
  \endgroup
  \def\bbl@tempa{#3}%
  \ifx\bbl@tempa\@empty\else
    \bbl@hook@loadexceptions{#3}%
  \fi
  \let\bbl@elt\relax
  \edef\bbl@languages{%
    \bbl@languages\bbl@elt{#1}{\the\language}{#2}{\bbl@tempa}}%
  \ifnum\the\language=\z@
    \expandafter\ifx\csname #1hyphenmins\endcsname\relax
      \set@hyphenmins\tw@\thr@@\relax
    \else
      \expandafter\expandafter\expandafter\set@hyphenmins
        \csname #1hyphenmins\endcsname
    \fi
    \the\toks@
    \toks@{}%
  \fi}
%    \end{macrocode}
%
%  \begin{macro}{\bbl@get@enc}
%
%   \changes{babel~3.9a}{2012/12/11}{Code much simplified}
%
%  \begin{macro}{\bbl@hyph@enc}
%    The macro |\bbl@get@enc| extracts the font encoding from the
%    language name and stores it in |\bbl@hyph@enc|. It uses delimited
%    arguments to achieve this.
%
%    \begin{macrocode}
\def\bbl@get@enc#1:#2:#3\@@@{\def\bbl@hyph@enc{#2}}
%    \end{macrocode}
%
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
%    Now, hooks are defined. For efficiency reasons, they are dealt
%    here in a special way. Besides \luatex, format specific
%    configuration files are taken into account.
%
% \changes{babel~3.9b}{2013/03/25}{Fixed an idiot slip: \cs{def}
%   intead of \cs{let}}
%
%    \begin{macrocode}
\def\bbl@hook@everylanguage#1{}
\def\bbl@hook@loadpatterns#1{\input #1\relax}
\let\bbl@hook@loadexceptions\bbl@hook@loadpatterns
\let\bbl@hook@loadkernel\bbl@hook@loadpatterns
\begingroup
  \def\AddBabelHook#1#2{%
    \expandafter\ifx\csname bbl@hook@#2\endcsname\relax
      \def\next{\toks1}%
    \else
      \def\next{\expandafter\gdef\csname bbl@hook@#2\endcsname####1}%
    \fi
    \next}
  \ifx\directlua\@undefined
    \ifx\XeTeXinputencoding\@undefined\else
      \input xebabel.def
    \fi
  \else
    \input luababel.def
  \fi
  \openin1 = babel-\bbl@format.cfg
  \ifeof1
  \else
    \input babel-\bbl@format.cfg\relax
  \fi
  \closein1
\endgroup
\bbl@hook@loadkernel{switch.def}
%    \end{macrocode}
%
%  \begin{macro}{\readconfigfile}
%    The configuration file can now be opened for reading.
%
%    \begin{macrocode}
\openin1 = language.dat
%    \end{macrocode}
%
%    See if the file exists, if not, use the default hyphenation file
%    \file{hyphen.tex}. The user will be informed about this.
%
%    \begin{macrocode}
\def\languagename{english}%
\ifeof1
  \message{I couldn't find the file language.dat,\space
           I will try the file hyphen.tex}
  \input hyphen.tex\relax
  \chardef\l@english\z@
\else
%    \end{macrocode}
%
%    Pattern registers are allocated using count register
%    |\last@language|. Its initial value is~0. The definition of the
%    macro |\newlanguage| is such that it first increments the count
%    register and then defines the language. In order to have the
%    first patterns loaded in pattern register number~0 we initialize
%    |\last@language| with the value~$-1$.
%
%    \begin{macrocode}
  \last@language\m@ne
%    \end{macrocode}
%
%    We now read lines from the file until the end is found
%
%    \begin{macrocode}
  \loop
%    \end{macrocode}
%
%    While reading from the input, it is useful to switch off
%    recognition of the end-of-line character. This saves us stripping
%    off spaces from the contents of the control sequence.
%
%    \begin{macrocode}
    \endlinechar\m@ne
    \read1 to \bbl@line
    \endlinechar`\^^M
%    \end{macrocode}
%
% \changes{babel~3.9a}{2012/12/14}{Test simplified and moved}
% \changes{babel~3.9a}{2012/12/12}{Use only spaces as delimiters and
%    not /, as previouly done} 
%
%    If the file has reached its end, exit from the loop here. If not,
%    empty lines are skipped. Add 3 space characters to the end of
%    |\bbl@line|. This is needed to be able to recognize the arguments
%    of |\process@line| later on. The default language should be the
%    very first one.
%
%    \begin{macrocode}
    \if T\ifeof1F\fi T\relax
      \ifx\bbl@line\@empty\else
        \edef\bbl@line{\bbl@line\space\space\space}%
        \expandafter\process@line\bbl@line\relax
      \fi
  \repeat
%    \end{macrocode}
%
%    Check for the end of the file. We must reverse the test for
%    |\ifeof| without |\else|. Then reactivate the default patterns.
%
% \changes{babel~3.8m}{2008/07/08}{Also restore the name of the
%    language in \cs{languagename} (PR 4039)} 
%
%    \begin{macrocode}
  \begingroup
    \def\bbl@elt#1#2#3#4{%
      \global\language=#2\relax
      \gdef\languagename{#1}%
      \def\bbl@elt##1##2##3##4{}}%
    \bbl@languages
  \endgroup
\fi
%    \end{macrocode}
%
%    and close the configuration file.
%
%    \begin{macrocode}
\closein1
%    \end{macrocode}
%
%    We add a message about the fact that babel is loaded in the
%    format and with which language patterns to the \cs{everyjob}
%    register.
%
% \changes{babel~3.9a}{2012/09/25}{The list of languages is not
%    printed every job any more (it is saved in \cs{bbl@languages}).} 
% \changes{babel~3.9g}{2013/07/28}{In non-LaTeX formats the number of
%    languages were not printed. Moved from \cs{dump} and cleaned up:
%    now \cs{toks}8 is expanded here.} 
% \changes{babel~3.9o}{2016/01/25}{The number of languages loaded was
%    off by 1.} 
%
%    \begin{macrocode}
\if/\the\toks@/\else
  \errhelp{language.dat loads no language, only synonyms}
  \errmessage{Orphan language synonym}
\fi
\advance\last@language\@ne
\edef\bbl@tempa{%
  \everyjob{%
    \the\everyjob
    \ifx\typeout\@undefined
      \immediate\write16%
    \else
      \noexpand\typeout
    \fi
    {\the\toks8 \the\last@language\space language(s) loaded.}}}
\advance\last@language\m@ne
\bbl@tempa
%    \end{macrocode}
%
%    Also remove some macros from memory and raise an error
%    if |\toks@| is not empty. Finally load \file{switch.def}, but the
%    latter is not required and the line inputting it may be commented
%    out.
%
% \changes{babel~3.9a}{2012/12/11}{Raise error if there are synonyms
%    without languages}
%
%    \begin{macrocode}
\let\bbl@line\@undefined
\let\process@line\@undefined
\let\process@synonym\@undefined
\let\process@language\@undefined
\let\bbl@get@enc\@undefined
\let\bbl@hyph@enc\@undefined
\let\bbl@tempa\@undefined
\let\bbl@hook@loadkernel\@undefined
\let\bbl@hook@everylanguage\@undefined
\let\bbl@hook@loadpatterns\@undefined
\let\bbl@hook@loadexceptions\@undefined
%</patterns>
%    \end{macrocode}
%
%    Here the code for ini\TeX\ ends.
%  \end{macro}
%
% \section{Font handling with fontspec}
%
% \changes{3.15}{2017/10/30}{New way to select fonts, with \cs{babelfont}}
%
% Add the bidi handler just before luaoftload, which is loaded by default
% by LaTeX. Just in case, consider the possibility it has not been
% loaded. First, a couple of definitions related to bidi [misplaced].
%
%    \begin{macrocode}
%<<*More package options>>
\ifodd\bbl@engine
  \DeclareOption{bidi=basic-r}%
    {\let\bbl@beforeforeign\leavevmode
     \newattribute\bbl@attr@dir
     \bbl@exp{\output{\bodydir\pagedir\the\output}}%
     \AtEndOfPackage{\EnableBabelHook{babel-bidi}}}
\else
  \DeclareOption{bidi=basic-r}%
    {\bbl@error
      {The bidi method `basic-r' is available only in\\%
       luatex. I'll continue with `bidi=default', so\\%
       expect wrong results}%
      {See the manual for further details.}%
    \let\bbl@beforeforeign\leavevmode
    \AtEndOfPackage{%
      \EnableBabelHook{babel-bidi}%
      \bbl@xebidipar}}
\fi
\DeclareOption{bidi=default}%
  {\let\bbl@beforeforeign\leavevmode
   \ifodd\bbl@engine
     \newattribute\bbl@attr@dir
     \bbl@exp{\output{\bodydir\pagedir\the\output}}%
   \fi
   \AtEndOfPackage{%
     \EnableBabelHook{babel-bidi}%
     \ifodd\bbl@engine\else
       \bbl@xebidipar
     \fi}}
%<</More package options>>
%    \end{macrocode}
%      
% With explicit languages, we could define the font at once, but we
% don't. Just wait and see if the language is actually activated.
%
%    \begin{macrocode}
%<<*Font selection>>
\bbl@trace{Font handling with fontspec}
\@onlypreamble\babelfont
\newcommand\babelfont[2][]{%  1=langs/scripts 2=fam
  \edef\bbl@tempa{#1}%
  \def\bbl@tempb{#2}%
  \ifx\fontspec\@undefined
    \usepackage{fontspec}%
  \fi
  \EnableBabelHook{babel-fontspec}%
  \bbl@bblfont}
\newcommand\bbl@bblfont[2][]{% 1=features 2=fontname
  \bbl@ifunset{\bbl@tempb family}{\bbl@providefam{\bbl@tempb}}{}%
  \bbl@ifunset{bbl@lsys@\languagename}{\bbl@provide@lsys{\languagename}}{}%
  \expandafter\bbl@ifblank\expandafter{\bbl@tempa}%
    {\bbl@csarg\edef{\bbl@tempb dflt@}{<>{#1}{#2}}% save bbl@rmdflt@
     \bbl@exp{%
       \let\<bbl@\bbl@tempb dflt@\languagename>\<bbl@\bbl@tempb dflt@>%
       \\\bbl@font@set\<bbl@\bbl@tempb dflt@\languagename>%
                      \<\bbl@tempb default>\<\bbl@tempb family>}}%
    {\bbl@foreach\bbl@tempa{% ie bbl@rmdflt@lang / *scrt
       \bbl@csarg\def{\bbl@tempb dflt@##1}{<>{#1}{#2}}}}}% 
%    \end{macrocode}
%
% If the family in the previous command does not exist, it must be
% defined. Here is how:  
%
%    \begin{macrocode}
\def\bbl@providefam#1{%
  \bbl@exp{%
    \\\newcommand\<#1default>{}% Just define it
    \\\bbl@add@list\\\bbl@font@fams{#1}%
    \\\DeclareRobustCommand\<#1family>{%
      \\\not@math@alphabet\<#1family>\relax
      \\\fontfamily\<#1default>\\\selectfont}%
    \\\DeclareTextFontCommand{\<text#1>}{\<#1family>}}}
%    \end{macrocode}
%      
% The following macro is activated when the hook |babel-fontspec| is
% enabled.
%
%    \begin{macrocode}
\def\bbl@switchfont{%
  \bbl@ifunset{bbl@lsys@\languagename}{\bbl@provide@lsys{\languagename}}{}%
  \bbl@exp{%  eg Arabic -> arabic
    \lowercase{\edef\\\bbl@tempa{\bbl@cs{sname@\languagename}}}}%
  \bbl@foreach\bbl@font@fams{%
    \bbl@ifunset{bbl@##1dflt@\languagename}%    (1) language?
      {\bbl@ifunset{bbl@##1dflt@*\bbl@tempa}%   (2) from script?
         {\bbl@ifunset{bbl@##1dflt@}%           2=F - (3) from generic?
           {}%                                  123=F - nothing!
           {\bbl@exp{%                          3=T - from generic
              \global\let\<bbl@##1dflt@\languagename>%
                         \<bbl@##1dflt@>}}}%
         {\bbl@exp{%                            2=T - from script
            \global\let\<bbl@##1dflt@\languagename>% 
                       \<bbl@##1dflt@*\bbl@tempa>}}}%
      {}}%                               1=T - language, already defined
  \def\bbl@tempa{%
    \bbl@warning{The current font is not a standard family.\\%
      Script and Language are not applied. Consider defining\\%
      a new family with \string\babelfont,}}%
  \bbl@foreach\bbl@font@fams{%     don't gather with prev for
    \bbl@ifunset{bbl@##1dflt@\languagename}%
      {\bbl@cs{famrst@##1}%
       \global\bbl@csarg\let{famrst@##1}\relax}%
      {\bbl@exp{% order is relevant
         \\\bbl@add\\\originalTeX{%
           \\\bbl@font@rst{\bbl@cs{##1dflt@\languagename}}%
                          \<##1default>\<##1family>{##1}}%
         \\\bbl@font@set\<bbl@##1dflt@\languagename>% the main part!
                        \<##1default>\<##1family>}}}%
  \bbl@ifrestoring{}{\bbl@tempa}}%
%    \end{macrocode}
%
% Now the macros defining the font with \textsf{fontspec}.
%
% When there are repeated keys in \textsf{fontspec}, the last value
% wins. So, we just place the ini settings at the beginning, and user
% settings will take precedence.
%
%    \begin{macrocode}
\def\bbl@font@set#1#2#3{%
  \bbl@xin@{<>}{#1}%
  \ifin@
    \bbl@exp{\\\bbl@fontspec@set\\#1\expandafter\@gobbletwo#1}%
  \fi
  \bbl@exp{%
    \def\\#2{#1}%        eg, \rmdefault{\bbl@rm1dflt@lang}
    \\\bbl@ifsamestring{#2}{\f@family}{\\#3\let\\\bbl@tempa\relax}{}}}
\def\bbl@fontspec@set#1#2#3{%
  \bbl@exp{\<fontspec_set_family:Nnn>\\#1%
    {\bbl@cs{lsys@\languagename},#2}}{#3}%
  \bbl@toglobal#1}%
%    \end{macrocode}
% 
% font@rst and famrst are only used when there is no global settings,
% to save and restore de previous families. Not really necessary, but
% done for optimization.
%
%    \begin{macrocode}
\def\bbl@font@rst#1#2#3#4{%
  \bbl@csarg\def{famrst@#4}{\bbl@font@set{#1}#2#3}}
%    \end{macrocode}
%
% The default font families. They are eurocentric, but the list can be
% expanded easily with |\babelfont|.
% 
%    \begin{macrocode}
\def\bbl@font@fams{rm,sf,tt}
%    \end{macrocode}
%
% The old tentative way. Short and preverved for compatibility, but
% deprecated. Note there is no direct alternative for
% |\babelFSfeatures|. The reason in explained in the user guide, but
% essentially -- that was not the way to go :-).
%
%    \begin{macrocode}
\newcommand\babelFSstore[2][]{%
  \bbl@ifblank{#1}%
    {\bbl@csarg\def{sname@#2}{Latin}}%
    {\bbl@csarg\def{sname@#2}{#1}}%
  \bbl@provide@dirs{#2}%
  \bbl@csarg\ifnum{wdir@#2}>\z@
    \let\bbl@beforeforeign\leavevmode
    \EnableBabelHook{babel-bidi}%
  \fi
  \bbl@foreach{#2}{%
    \bbl@FSstore{##1}{rm}\rmdefault\bbl@save@rmdefault
    \bbl@FSstore{##1}{sf}\sfdefault\bbl@save@sfdefault
    \bbl@FSstore{##1}{tt}\ttdefault\bbl@save@ttdefault}}
\def\bbl@FSstore#1#2#3#4{%
  \bbl@csarg\edef{#2default#1}{#3}%
  \expandafter\addto\csname extras#1\endcsname{%
    \let#4#3%
    \ifx#3\f@family
      \edef#3{\csname bbl@#2default#1\endcsname}%
      \fontfamily{#3}\selectfont
    \else
      \edef#3{\csname bbl@#2default#1\endcsname}%
    \fi}%
  \expandafter\addto\csname noextras#1\endcsname{%
    \ifx#3\f@family
      \fontfamily{#4}\selectfont
    \fi
    \let#3#4}}
\let\bbl@langfeatures\@empty
\def\babelFSfeatures{% make sure \fontspec is redefined once
  \let\bbl@ori@fontspec\fontspec
  \renewcommand\fontspec[1][]{%
    \bbl@ori@fontspec[\bbl@langfeatures##1]}
  \let\babelFSfeatures\bbl@FSfeatures
  \babelFSfeatures}
\def\bbl@FSfeatures#1#2{%
  \expandafter\addto\csname extras#1\endcsname{%
    \babel@save\bbl@langfeatures
    \edef\bbl@langfeatures{#2,}}}
%<</Font selection>>
%    \end{macrocode}
%      
%
% \section{Hooks for XeTeX and LuaTeX}
%
% \subsection{XeTeX}
%
%    Unfortunately, the current encoding cannot be retrieved and
%    therefore it is reset always to |utf8|, which seems a sensible
%    default.
%
%    \LaTeX{} sets many ``codes'' just before loading
%    \verb|hyphen.cfg|. That is not a problem in luatex, but in xetex
%    they must be reset to the proper value. Most of the work is done in
%    \textsf{xe(la)tex.ini}, so here we just ``undo'' some of the
%    changes done by \LaTeX. Anyway, for consistency Lua\TeX{} also
%    resets the catcodes. 
%
% \changes{bbunicode~1.0c}{2014/03/10}{Reset ``codes'' set by \cs{LaTeX}
%    to what xetex expects. Used also in luatex.}
% \changes{bbunicode~1.0f}{2015/12/06}{This block was assigned to
%    xetex, even in luatex. Fixed here and below.}
%
%    \begin{macrocode}
%<<*Restore Unicode catcodes before loading patterns>>
  \begingroup
      % Reset chars "80-"C0 to category "other", no case mapping:
    \catcode`\@=11 \count@=128
    \loop\ifnum\count@<192
      \global\uccode\count@=0 \global\lccode\count@=0
      \global\catcode\count@=12 \global\sfcode\count@=1000
      \advance\count@ by 1 \repeat
      % Other:
    \def\O ##1 {%
      \global\uccode"##1=0 \global\lccode"##1=0
      \global\catcode"##1=12 \global\sfcode"##1=1000 }%
      % Letter:
    \def\L ##1 ##2 ##3 {\global\catcode"##1=11
      \global\uccode"##1="##2
      \global\lccode"##1="##3
      % Uppercase letters have sfcode=999:
      \ifnum"##1="##3 \else \global\sfcode"##1=999 \fi }%
      % Letter without case mappings:
    \def\l ##1 {\L ##1 ##1 ##1 }%
    \l 00AA
    \L 00B5 039C 00B5
    \l 00BA
    \O 00D7
    \l 00DF
    \O 00F7
    \L 00FF 0178 00FF
  \endgroup
  \input #1\relax
%<</Restore Unicode catcodes before loading patterns>>
%    \end{macrocode}
%
% Some more common code.
%
% \changes{babel 3.17}{2018/01/24}{Tools for bidi footnote}
%
%    \begin{macrocode}
%<<*Footnote changes>>
\bbl@trace{Bidi footnotes}
\ifx\bbl@beforeforeign\leavevmode
  \def\bbl@footnote#1#2#3{%
    \@ifnextchar[%
      {\bbl@footnote@o{#1}{#2}{#3}}%
      {\bbl@footnote@x{#1}{#2}{#3}}}
  \def\bbl@footnote@x#1#2#3#4{%
    \bgroup
      \select@language@x{\bbl@main@language}%
      \bbl@fn@footnote{#2#1{\ignorespaces#4}#3}%
    \egroup}
  \def\bbl@footnote@o#1#2#3[#4]#5{%
    \bgroup
      \select@language@x{\bbl@main@language}%
      \bbl@fn@footnote[#4]{#2#1{\ignorespaces#5}#3}%
    \egroup}
  \def\bbl@footnotetext#1#2#3{%
    \@ifnextchar[%
      {\bbl@footnotetext@o{#1}{#2}{#3}}%
      {\bbl@footnotetext@x{#1}{#2}{#3}}}
  \def\bbl@footnotetext@x#1#2#3#4{%
    \bgroup
      \select@language@x{\bbl@main@language}%
      \bbl@fn@footnotetext{#2#1{\ignorespaces#4}#3}%
    \egroup}
  \def\bbl@footnotetext@o#1#2#3[#4]#5{%
    \bgroup
      \select@language@x{\bbl@main@language}%
      \bbl@fn@footnotetext[#4]{#2#1{\ignorespaces#5}#3}%
    \egroup}
  \def\BabelFootnote#1#2#3#4{%
    \ifx\bbl@fn@footnote\@undefined
      \let\bbl@fn@footnote\footnote
    \fi
    \ifx\bbl@fn@footnotetext\@undefined
      \let\bbl@fn@footnotetext\footnotetext
    \fi
    \bbl@ifblank{#2}%
      {\def#1{\bbl@footnote{\@firstofone}{#3}{#4}}
       \@namedef{\bbl@stripslash#1text}%
         {\bbl@footnotetext{\@firstofone}{#3}{#4}}}%
      {\def#1{\bbl@exp{\\\bbl@footnote{\\\foreignlanguage{#2}}}{#3}{#4}}%
       \@namedef{\bbl@stripslash#1text}%
         {\bbl@exp{\\\bbl@footnotetext{\\\foreignlanguage{#2}}}{#3}{#4}}}}
\fi
%<</Footnote changes>>
%    \end{macrocode}
%
% Now, the code.
%
%    \begin{macrocode}
%<*xetex>
\def\BabelStringsDefault{unicode}
\let\xebbl@stop\relax
\AddBabelHook{xetex}{encodedcommands}{%
  \def\bbl@tempa{#1}%
  \ifx\bbl@tempa\@empty
    \XeTeXinputencoding"bytes"%
  \else
    \XeTeXinputencoding"#1"%
  \fi
  \def\xebbl@stop{\XeTeXinputencoding"utf8"}}
\AddBabelHook{xetex}{stopcommands}{%
  \xebbl@stop
  \let\xebbl@stop\relax}
\AddBabelHook{xetex}{loadkernel}{%
<@Restore Unicode catcodes before loading patterns@>}
\ifx\DisableBabelHook\@undefined\endinput\fi
\AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont}
\DisableBabelHook{babel-fontspec}
<@Font selection@>
\input txtbabel.def
%</xetex>
%    \end{macrocode}
%
% \subsection{Layout}
%
% \changes{babel~3.16}{2018/01/02}{Option layout - first available options:
% sectioning, counters, lists, columns, contents}
%
% \textit{In progress.}
%
% Unfortunately, proper support for \xetex{} requires patching somehow
% lots of macros and packages (and some issues related to |\special|s
% remain, like color and hyperlinks). At least at this stage, \babel{}
% will not do it and therefore a package like \textsf{bidi} (by Vafa
% Khalighi) would be necessary to overcome the limitations of
% \xetex. Any help in making \babel{} and \textsf{bidi} collaborate
% will be welcome, although the underlying concepts in both packages
% seem very different. Note also elements like headlines and margins
% can be modified easily with packages like \textsf{fancyhdr},
% \textsf{typearea} or \textsf{titleps}, and \textsf{geometry}.
%
% |\bbl@startskip| and |\bbl@endskip| are available to package
% authors. Thanks to the \TeX{} expansion mechanism the following
% constructs are valid: |\adim\bbl@startskip|,
% |\advance\bbl@startskip\adim|, |\bbl@startskip\adim|.
%
% Consider |txtbabel| as a shorthand for \textit{tex--xet babel},
% which is the bidi model in both \pdftex{} and \xetex{}. 
%
%    \begin{macrocode}
%<*texxet>
\bbl@trace{Redefinitions for bidi layout}
\def\bbl@sspre@caption{%
  \bbl@exp{\everyhbox{\\\bbl@textdir\bbl@cs{wdir@\bbl@main@language}}}}
\ifx\bbl@opt@layout\@nnil\endinput\fi  % No layout
\def\bbl@startskip{\ifcase\bbl@thepardir\leftskip\else\rightskip\fi}
\def\bbl@endskip{\ifcase\bbl@thepardir\rightskip\else\leftskip\fi}
\ifx\bbl@beforeforeign\leavevmode % A poor test for bidi=
  \def\@hangfrom#1{%
    \setbox\@tempboxa\hbox{{#1}}%
    \hangindent\ifcase\bbl@thepardir\wd\@tempboxa\else-\wd\@tempboxa\fi
    \noindent\box\@tempboxa}
  \def\raggedright{%
    \let\\\@centercr
    \bbl@startskip\z@skip
    \@rightskip\@flushglue
    \bbl@endskip\@rightskip
    \parindent\z@
    \parfillskip\bbl@startskip}
  \def\raggedleft{%
    \let\\\@centercr
    \bbl@startskip\@flushglue
    \bbl@endskip\z@skip
    \parindent\z@
    \parfillskip\bbl@endskip}
\fi
\IfBabelLayout{lists}
  {\def\list#1#2{%
    \ifnum \@listdepth >5\relax
      \@toodeep
    \else
      \global\advance\@listdepth\@ne
    \fi
    \rightmargin\z@
    \listparindent\z@
    \itemindent\z@
    \csname @list\romannumeral\the\@listdepth\endcsname
    \def\@itemlabel{#1}%
    \let\makelabel\@mklab
    \@nmbrlistfalse
    #2\relax
    \@trivlist
    \parskip\parsep
    \parindent\listparindent
    \advance\linewidth-\rightmargin
    \advance\linewidth-\leftmargin
    \advance\@totalleftmargin
      \ifcase\bbl@thepardir\leftmargin\else\rightmargin\fi
    \parshape\@ne\@totalleftmargin\linewidth
    \ignorespaces}%
  \ifcase\bbl@engine
    \def\labelenumii{)\theenumii(}%
    \def\p@enumiii{\p@enumii)\theenumii(}%
  \fi
  \def\@verbatim{%
    \trivlist \item\relax
    \if@minipage\else\vskip\parskip\fi
    \bbl@startskip\textwidth
    \advance\bbl@startskip-\linewidth
    \bbl@endskip\z@skip
    \parindent\z@
    \parfillskip\@flushglue
    \parskip\z@skip
    \@@par
    \language\l@nohyphenation
    \@tempswafalse
    \def\par{%
      \if@tempswa
        \leavevmode\null
        \@@par\penalty\interlinepenalty
      \else
        \@tempswatrue
        \ifhmode\@@par\penalty\interlinepenalty\fi
      \fi}%
    \let\do\@makeother \dospecials
    \obeylines \verbatim@font \@noligs
    \everypar\expandafter{\the\everypar\unpenalty}}}
  {}
\IfBabelLayout{contents}
  {\def\@dottedtocline#1#2#3#4#5{%
     \ifnum#1>\c@tocdepth\else
       \vskip \z@ \@plus.2\p@
       {\bbl@startskip#2\relax
        \bbl@endskip\@tocrmarg
        \parfillskip-\bbl@endskip
        \parindent#2\relax
        \@afterindenttrue
        \interlinepenalty\@M
        \leavevmode
        \@tempdima#3\relax
        \advance\bbl@startskip\@tempdima
        \null\nobreak\hskip-\bbl@startskip
        {#4}\nobreak
        \leaders\hbox{%
          $\m@th\mkern\@dotsep mu\hbox{.}\mkern\@dotsep mu$}%
          \hfill\nobreak
          \hb@xt@\@pnumwidth{\hfil\normalfont\normalcolor#5}%
          \par}%
     \fi}}
  {}
\IfBabelLayout{columns}
  {\def\@outputdblcol{%
     \if@firstcolumn
       \global\@firstcolumnfalse
       \global\setbox\@leftcolumn\copy\@outputbox
       \splitmaxdepth\maxdimen
       \vbadness\maxdimen
       \setbox\@outputbox\vbox{\unvbox\@outputbox\unskip}%
       \setbox\@outputbox\vsplit\@outputbox to\maxdimen
       \toks@\expandafter{\topmark}%
       \xdef\@firstcoltopmark{\the\toks@}%
       \toks@\expandafter{\splitfirstmark}%
       \xdef\@firstcolfirstmark{\the\toks@}%
       \ifx\@firstcolfirstmark\@empty
         \global\let\@setmarks\relax
       \else
         \gdef\@setmarks{%
           \let\firstmark\@firstcolfirstmark
           \let\topmark\@firstcoltopmark}%
       \fi
     \else
       \global\@firstcolumntrue
       \setbox\@outputbox\vbox{%
         \hb@xt@\textwidth{%
           \hskip\columnwidth
           \hfil
           {\normalcolor\vrule \@width\columnseprule}%
           \hfil
           \hb@xt@\columnwidth{\box\@leftcolumn \hss}%
           \hskip-\textwidth
           \hb@xt@\columnwidth{\box\@outputbox \hss}%
           \hskip\columnsep
           \hskip\columnwidth}}%
       \@combinedblfloats
       \@setmarks
       \@outputpage
       \begingroup
         \@dblfloatplacement
         \@startdblcolumn
         \@whilesw\if@fcolmade \fi{\@outputpage
         \@startdblcolumn}%
       \endgroup
     \fi}}%
  {}
<@Footnote changes@>
\IfBabelLayout{footnotes}%
  {\BabelFootnote\footnote\languagename{}{}%
   \BabelFootnote\localfootnote\languagename{}{}%
   \BabelFootnote\mainfootnote{}{}{}}
  {}
%    \end{macrocode}
%
%      Implicitly reverses sectioning labels in |bidi=basic-r|, because
%      the full stop is not in contact with L numbers any more. I
%      think there must be a better way.
%
%    \begin{macrocode}
\IfBabelLayout{counters}%
  {\let\bbl@latinarabic=\@arabic
   \def\@arabic#1{\babelsublr{\bbl@latinarabic#1}}%
   \let\bbl@asciiroman=\@roman
   \def\@roman#1{\babelsublr{\ensureascii{\bbl@asciiroman#1}}}%
   \let\bbl@asciiRoman=\@Roman
   \def\@Roman#1{\babelsublr{\ensureascii{\bbl@asciiRoman#1}}}}{}
%</texxet>
%    \end{macrocode}
%
% \subsection{LuaTeX}
%
% The new loader for luatex is based solely on |language.dat|, which
% is read on the fly. The code shouldn't be executed when the format
% is build, so we check if |\AddBabelHook| is defined. Then comes a
% modified version of the loader in |hyphen.cfg| (without the
% hyphenmins stuff, which is under the direct control of \babel).
%
% The names |\l@<language>| are defined and take some value from the
% beginning because all \texttt{ldf} files assume this for the
% corresponding language to be considered valid, but patterns are not
% loaded (except the first one). This is done later, when the language
% is first selected (which usually means when the \texttt{ldf}
% finishes). If a language has been loaded, |\bbl@hyphendata@<num>|
% exists (with the names of the files read).
%
% The default setup preloads the first language into the format. This
% is intended mainly for `english', so that it's available without
% further intervention from the user.  To avoid duplicating it, the
% following rule applies: if the ``0th'' language and the first
% language in |language.dat| have the same name then just ignore the
% latter. If there are new synonymous, the are added, but note if the
% language patterns have not been preloaded they won't at run time.
%
% Other preloaded languages could be read twice, if they has been
% preloaded into the format. This is not optimal, but it shouldn't
% happen very often -- with \luatex{} patterns are best loaded when
% the document is typeset, and the ``0th'' language is preloaded just
% for backwards compatibility.
%
% As of 1.1b, lua(e)tex is taken into account. Formerly, loading of
% patterns on the fly didn't work in this format, but with the new
% loader it does.  Unfortunately, the format is not based on \babel,
% and data could be duplicated, because languages are reassigned above
% those in the format (nothing serious, anyway). Note even with this
% format |language.dat| is used (under the principle of a single
% source), instead of |language.def|.
%
% Of course, there is room for improvements, like tools to read and
% reassign languages, which would require modifying the language list,
% and better error handling.
%
% We need catcode tables, but no format (targeted by \babel) provide a
% command to allocate them (although there are packages like
% \textsf{ctablestack}). For the moment, a dangerous approach is used
% -- just allocate a high random number and cross the fingers. To
% complicate things, \textsf{etex.sty} changes the way languages are
% allocated.
%
% \changes{bbunicode~1.0b}{2013/04/22}{luatex-hyphen is loaded with
%   require. Changes supplied by \'{E}lie Roux.}
% \changes{bbunicode~1.0c}{2014/03/10}{Defined hook for
%   `initiateactive', to fetch the next token and continue only if
%   letter or other.}
% \changes{bbunicode~1.0d}{2014/03/21}{Removed the `misfeature' for
%   `initiateactive'.}
% \changes{bbunicode~1.0e}{2015/05/10}{Use brackets instead of
%   \cs{luaescapestring}.}
% \changes{bbunicode~1.0e}{2015/07/26}{Added function addpattern
%   and modified the patterns hook.}
% \changes{bbunicode~1.1a}{2016/01/26}{New hyphenation loader for
%   luatex.}
% \changes{bbunicode~1.1b}{2016/02/05}{Also lua(e)tex.}
% \changes{bbunicode~1.1c}{2016/02/08}{Base reading of patterns on
%   number, not in name.}
% \changes{bbunicode~1.1c}{2016/02/08}{Some hacks for polyglossia. To
%   be improved.}
% \changes{bbunicode~1.1c}{2016/02/23}{Thoroughly revised.}
% \changes{bbunicode~1.1d}{2016/4/22}{Lua: Fixed a line break at
%   \cs{foreignlanguage} with unloaded patterns. Added
%   \cs{babelcatcodetablenum}, just in case.}
%
%    \begin{macrocode}
%<*luatex>
\ifx\AddBabelHook\@undefined
\bbl@trace{Read language.dat}
\begingroup
  \toks@{}
  \count@\z@ % 0=start, 1=0th, 2=normal
  \def\bbl@process@line#1#2 #3 #4 {%
    \ifx=#1%
      \bbl@process@synonym{#2}%
    \else
      \bbl@process@language{#1#2}{#3}{#4}%
    \fi
    \ignorespaces}
  \def\bbl@manylang{%
    \ifnum\bbl@last>\@ne
      \bbl@info{Non-standard hyphenation setup}%
    \fi
    \let\bbl@manylang\relax}
  \def\bbl@process@language#1#2#3{%
    \ifcase\count@
      \@ifundefined{zth@#1}{\count@\tw@}{\count@\@ne}%
    \or
      \count@\tw@
    \fi
    \ifnum\count@=\tw@
      \expandafter\addlanguage\csname l@#1\endcsname
      \language\allocationnumber
      \chardef\bbl@last\allocationnumber
      \bbl@manylang
      \let\bbl@elt\relax
      \xdef\bbl@languages{%
        \bbl@languages\bbl@elt{#1}{\the\language}{#2}{#3}}%
    \fi
    \the\toks@
    \toks@{}}
  \def\bbl@process@synonym@aux#1#2{%
    \global\expandafter\chardef\csname l@#1\endcsname#2\relax
    \let\bbl@elt\relax
    \xdef\bbl@languages{%
      \bbl@languages\bbl@elt{#1}{#2}{}{}}}%
  \def\bbl@process@synonym#1{%
    \ifcase\count@
      \toks@\expandafter{\the\toks@\relax\bbl@process@synonym{#1}}%
    \or
      \@ifundefined{zth@#1}{\bbl@process@synonym@aux{#1}{0}}{}%
    \else
      \bbl@process@synonym@aux{#1}{\the\bbl@last}%
    \fi}
  \ifx\bbl@languages\@undefined % Just a (sensible?) guess
    \chardef\l@english\z@
    \chardef\l@USenglish\z@
    \chardef\bbl@last\z@
    \global\@namedef{bbl@hyphendata@0}{{hyphen.tex}{}}
    \gdef\bbl@languages{%
      \bbl@elt{english}{0}{hyphen.tex}{}%
      \bbl@elt{USenglish}{0}{}{}}
  \else
    \global\let\bbl@languages@format\bbl@languages
    \def\bbl@elt#1#2#3#4{% Remove all except language 0
      \ifnum#2>\z@\else
        \noexpand\bbl@elt{#1}{#2}{#3}{#4}%
      \fi}%
    \xdef\bbl@languages{\bbl@languages}%
  \fi
  \def\bbl@elt#1#2#3#4{\@namedef{zth@#1}{}} % Define flags
  \bbl@languages
  \openin1=language.dat
  \ifeof1
    \bbl@warning{I couldn't find language.dat. No additional\\%
                 patterns loaded. Reported}%
  \else
    \loop
      \endlinechar\m@ne
      \read1 to \bbl@line
      \endlinechar`\^^M
      \if T\ifeof1F\fi T\relax
        \ifx\bbl@line\@empty\else
          \edef\bbl@line{\bbl@line\space\space\space}%
          \expandafter\bbl@process@line\bbl@line\relax
        \fi
    \repeat
  \fi
\endgroup
\bbl@trace{Macros for reading patterns files}
\def\bbl@get@enc#1:#2:#3\@@@{\def\bbl@hyph@enc{#2}}
\ifx\babelcatcodetablenum\@undefined
  \def\babelcatcodetablenum{5211}
\fi
\def\bbl@luapatterns#1#2{%
  \bbl@get@enc#1::\@@@
  \setbox\z@\hbox\bgroup
    \begingroup
      \ifx\catcodetable\@undefined
        \let\savecatcodetable\luatexsavecatcodetable
        \let\initcatcodetable\luatexinitcatcodetable
        \let\catcodetable\luatexcatcodetable
      \fi
      \savecatcodetable\babelcatcodetablenum\relax
      \initcatcodetable\numexpr\babelcatcodetablenum+1\relax
      \catcodetable\numexpr\babelcatcodetablenum+1\relax
      \catcode`\#=6  \catcode`\$=3 \catcode`\&=4 \catcode`\^=7
      \catcode`\_=8  \catcode`\{=1 \catcode`\}=2 \catcode`\~=13
      \catcode`\@=11 \catcode`\^^I=10 \catcode`\^^J=12
      \catcode`\<=12 \catcode`\>=12 \catcode`\*=12 \catcode`\.=12
      \catcode`\-=12 \catcode`\/=12 \catcode`\[=12 \catcode`\]=12
      \catcode`\`=12 \catcode`\'=12 \catcode`\"=12
      \input #1\relax
      \catcodetable\babelcatcodetablenum\relax
    \endgroup
    \def\bbl@tempa{#2}%
    \ifx\bbl@tempa\@empty\else
      \input #2\relax
    \fi
  \egroup}%
\def\bbl@patterns@lua#1{%
  \language=\expandafter\ifx\csname l@#1:\f@encoding\endcsname\relax
    \csname l@#1\endcsname
    \edef\bbl@tempa{#1}%
  \else
    \csname l@#1:\f@encoding\endcsname
    \edef\bbl@tempa{#1:\f@encoding}%
  \fi\relax
  \@namedef{lu@texhyphen@loaded@\the\language}{}% Temp
  \@ifundefined{bbl@hyphendata@\the\language}%
    {\def\bbl@elt##1##2##3##4{%
       \ifnum##2=\csname l@\bbl@tempa\endcsname % #2=spanish, dutch:OT1...
         \def\bbl@tempb{##3}%
         \ifx\bbl@tempb\@empty\else % if not a synonymous
           \def\bbl@tempc{{##3}{##4}}%
         \fi
         \bbl@csarg\xdef{hyphendata@##2}{\bbl@tempc}%
       \fi}%
     \bbl@languages
     \@ifundefined{bbl@hyphendata@\the\language}%
       {\bbl@info{No hyphenation patterns were set for\\%
                  language ‘\bbl@tempa’. Reported}}%
       {\expandafter\expandafter\expandafter\bbl@luapatterns
          \csname bbl@hyphendata@\the\language\endcsname}}{}}
\endinput\fi
\begingroup
\catcode`\%=12
\catcode`\'=12
\catcode`\"=12
\catcode`\:=12
\directlua{
  Babel = Babel or {}
  function Babel.bytes(line)
    return line:gsub("(.)",
      function (chr) return unicode.utf8.char(string.byte(chr)) end)
  end
  function Babel.begin_process_input()
    if luatexbase and luatexbase.add_to_callback then
      luatexbase.add_to_callback('process_input_buffer',
                                 Babel.bytes,'Babel.bytes')
    else
      Babel.callback = callback.find('process_input_buffer')
      callback.register('process_input_buffer',Babel.bytes)
    end
  end
  function Babel.end_process_input ()
    if luatexbase and luatexbase.remove_from_callback then
      luatexbase.remove_from_callback('process_input_buffer','Babel.bytes')
    else
      callback.register('process_input_buffer',Babel.callback)
    end
  end
  function Babel.addpatterns(pp, lg)
    local lg = lang.new(lg)
    local pats = lang.patterns(lg) or ''
    lang.clear_patterns(lg)
    for p in pp:gmatch('[^%s]+') do
      ss = ''
      for i in string.utfcharacters(p:gsub('%d', '')) do
         ss = ss .. '%d?' .. i
      end
      ss = ss:gsub('^%%d%?%.', '%%.') .. '%d?'
      ss = ss:gsub('%.%%d%?$', '%%.')
      pats, n = pats:gsub('%s' .. ss .. '%s', ' ' .. p .. ' ')
      if n == 0 then
        tex.sprint(
          [[\string\csname\space bbl@info\endcsname{New pattern: ]]
          .. p .. [[}]])
        pats = pats .. ' ' .. p
      else
        tex.sprint(
          [[\string\csname\space bbl@info\endcsname{Renew pattern: ]]
          .. p .. [[}]])
      end
    end
    lang.patterns(lg, pats)
  end
}
\endgroup
\def\BabelStringsDefault{unicode}
\let\luabbl@stop\relax
\AddBabelHook{luatex}{encodedcommands}{%
  \def\bbl@tempa{utf8}\def\bbl@tempb{#1}%
  \ifx\bbl@tempa\bbl@tempb\else
    \directlua{Babel.begin_process_input()}%
    \def\luabbl@stop{%
      \directlua{Babel.end_process_input()}}%
  \fi}%
\AddBabelHook{luatex}{stopcommands}{%
  \luabbl@stop
  \let\luabbl@stop\relax}
\AddBabelHook{luatex}{patterns}{%
  \@ifundefined{bbl@hyphendata@\the\language}%
    {\def\bbl@elt##1##2##3##4{%
       \ifnum##2=\csname l@#2\endcsname % #2=spanish, dutch:OT1...
         \def\bbl@tempb{##3}%
         \ifx\bbl@tempb\@empty\else % if not a synonymous
           \def\bbl@tempc{{##3}{##4}}%
         \fi
         \bbl@csarg\xdef{hyphendata@##2}{\bbl@tempc}%
       \fi}%
     \bbl@languages
     \@ifundefined{bbl@hyphendata@\the\language}%
       {\bbl@info{No hyphenation patterns were set for\\%
                  language ‘#2’. Reported}}%
       {\expandafter\expandafter\expandafter\bbl@luapatterns
          \csname bbl@hyphendata@\the\language\endcsname}}{}%
  \@ifundefined{bbl@patterns@}{}{%
    \begingroup
      \bbl@xin@{,\number\language,}{,\bbl@pttnlist}%
      \ifin@\else
        \ifx\bbl@patterns@\@empty\else
           \directlua{ Babel.addpatterns(
             [[\bbl@patterns@]], \number\language) }%
        \fi
        \@ifundefined{bbl@patterns@#1}%
          \@empty
          {\directlua{ Babel.addpatterns(
               [[\space\csname bbl@patterns@#1\endcsname]],
               \number\language) }}%
        \xdef\bbl@pttnlist{\bbl@pttnlist\number\language,}%
      \fi
    \endgroup}}
\AddBabelHook{luatex}{everylanguage}{%
  \def\process@language##1##2##3{%
    \def\process@line####1####2 ####3 ####4 {}}}
\AddBabelHook{luatex}{loadpatterns}{%
   \input #1\relax
   \expandafter\gdef\csname bbl@hyphendata@\the\language\endcsname
     {{#1}{}}}
\AddBabelHook{luatex}{loadexceptions}{%
   \input #1\relax
   \def\bbl@tempb##1##2{{##1}{#1}}%
   \expandafter\xdef\csname bbl@hyphendata@\the\language\endcsname
     {\expandafter\expandafter\expandafter\bbl@tempb
      \csname bbl@hyphendata@\the\language\endcsname}}
%    \end{macrocode}
%
%  \begin{macro}{\babelpatterns}
%
%    This macro adds patterns. Two macros are used to store them:
%    |\bbl@patterns@| for the global ones and |\bbl@patterns@<lang>|
%    for language ones. We make sure there is a space between words
%    when multiple commands are used.
% \changes{bbunicode~1.0e}{2015/07/26}{Macro \cs{babelpatterns} added}
%
%    \begin{macrocode}
\@onlypreamble\babelpatterns
\AtEndOfPackage{%
  \newcommand\babelpatterns[2][\@empty]{%
    \ifx\bbl@patterns@\relax
      \let\bbl@patterns@\@empty
    \fi
    \ifx\bbl@pttnlist\@empty\else
      \bbl@warning{%
        You must not intermingle \string\selectlanguage\space and\\%
        \string\babelpatterns\space or some patterns will not\\%
        be taken into account. Reported}%
    \fi
    \ifx\@empty#1%
      \protected@edef\bbl@patterns@{\bbl@patterns@\space#2}%
    \else
      \edef\bbl@tempb{\zap@space#1 \@empty}%
      \bbl@for\bbl@tempa\bbl@tempb{%
        \bbl@fixname\bbl@tempa
        \bbl@iflanguage\bbl@tempa{%
          \bbl@csarg\protected@edef{patterns@\bbl@tempa}{%
            \@ifundefined{bbl@patterns@\bbl@tempa}%
              \@empty
              {\csname bbl@patterns@\bbl@tempa\endcsname\space}%
            #2}}}%
    \fi}}
%    \end{macrocode}
%  \end{macro}
%
% Common stuff.
%
%    \begin{macrocode}
\AddBabelHook{luatex}{loadkernel}{%
<@Restore Unicode catcodes before loading patterns@>}
\ifx\DisableBabelHook\@undefined\endinput\fi
\AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont}
\DisableBabelHook{babel-fontspec}
<@Font selection@>
%    \end{macrocode}
%
% \subsection{Layout}
%
% \textbf{Work in progress}.
%
% Unlike \xetex{}, \luatex{} requires only minimal changes for
% right-to-left layouts, particularly in monolingual documents (the
% engine itself reverses boxes -- including column order or headings
% --, margins, etc.) and with |bidi=basic-r|, without having to patch
% almost any macro where text direction is relevant.
%
% |\@hangfrom| is useful in many contexts and it is redefined always
% with the |layout| option. 
%
% There are, however, a number of issues when the text direction is
% not the same as the box direction (as set by |\bodydir|), and when
% |\parbox| and |\hangindent| are involved. Fortunately, latest
% releases of \luatex{} simplify a lot the solution with |\shapemode|.
%
% \changes{3.18}{2018/02/14}{\cs{bbl@nextfake}, similar to the old
%   \cs{nextfakemath} in Omega}
%
%    \begin{macrocode}
\bbl@trace{Redefinitions for bidi layout}
\ifx\bbl@opt@layout\@nnil\endinput\fi  % if no layout
\ifx\bbl@beforeforeign\leavevmode % A poor test for bidi=
  \def\bbl@nextfake#1{%
    \mathdir\bodydir  % non-local, use always inside a group!
    \bbl@exp{%
      #1%              Once entered in math, set boxes to restore values
      \everyvbox{%
        \the\everyvbox
        \bodydir\the\bodydir
        \mathdir\the\mathdir
        \everyhbox{\the\everyhbox}%
        \everyvbox{\the\everyvbox}}%
      \everyhbox{%
        \the\everyhbox
        \bodydir\the\bodydir
        \mathdir\the\mathdir
        \everyhbox{\the\everyhbox}%
        \everyvbox{\the\everyvbox}}}}%
  \def\@hangfrom#1{%
    \setbox\@tempboxa\hbox{{#1}}%
    \hangindent\wd\@tempboxa
    \ifnum\bbl@getluadir{page}=\bbl@getluadir{par}\else
      \shapemode\@ne
    \fi
    \noindent\box\@tempboxa}
\fi
\IfBabelLayout{tabular}
  {\def\@tabular{% 
     \leavevmode\hbox\bgroup\bbl@nextfake$%
     \let\@acol\@tabacol       \let\@classz\@tabclassz
     \let\@classiv\@tabclassiv \let\\\@tabularcr\@tabarray}}
  {}
\IfBabelLayout{lists}
  {\def\list#1#2{%
     \ifnum \@listdepth >5\relax
       \@toodeep
     \else
       \global\advance\@listdepth\@ne
     \fi
     \rightmargin\z@
     \listparindent\z@
     \itemindent\z@
     \csname @list\romannumeral\the\@listdepth\endcsname
     \def\@itemlabel{#1}%
     \let\makelabel\@mklab
     \@nmbrlistfalse
     #2\relax
     \@trivlist
     \parskip\parsep
     \parindent\listparindent
     \advance\linewidth -\rightmargin
     \advance\linewidth -\leftmargin
     \advance\@totalleftmargin \leftmargin
     \parshape \@ne
     \@totalleftmargin \linewidth
     \ifnum\bbl@getluadir{page}=\bbl@getluadir{par}\else
       \shapemode\tw@
     \fi
     \ignorespaces}}
  {}
%    \end{macrocode}
%
%      Implicitly reverses sectioning labels in bidi=basic-r, because
%      the full stop is not in contact with L numbers any more. I
%      think there must be a better way. Assumes |bidi=basic-r|, but
%      there are some additional readjustments for |bidi=default|.
%
%    \begin{macrocode}
\IfBabelLayout{counters}%
  {\def\@textsuperscript#1{{% lua has separate settings for math
     \m@th
     \mathdir\pagedir % required with basic-r; ok with default, too
     \ensuremath {^{\mbox {\fontsize \sf@size \z@ #1}}}}}%
   \let\bbl@latinarabic=\@arabic
   \def\@arabic#1{\babelsublr{\bbl@latinarabic#1}}%
   \@ifpackagewith{babel}{bidi=default}%
     {\let\bbl@asciiroman=\@roman
      \def\@roman#1{\babelsublr{\ensureascii{\bbl@asciiroman#1}}}%
      \let\bbl@asciiRoman=\@Roman
      \def\@Roman#1{\babelsublr{\ensureascii{\bbl@asciiRoman#1}}}%
      \def\labelenumii{)\theenumii(}%
      \def\p@enumiii{\p@enumii)\theenumii(}}{}}{}
<@Footnote changes@>
\IfBabelLayout{footnotes}%
  {\BabelFootnote\footnote\languagename{}{}%
   \BabelFootnote\localfootnote\languagename{}{}%
   \BabelFootnote\mainfootnote{}{}{}}
  {}
%</luatex>
%    \end{macrocode}
%
% \subsection{Auto bidi with \texttt{basic-r}}
%
% \changes{3.14}{2017/09/30}{LuaTeX - support for R/AL texts - basic-r}
%
% The file \textsf{babel-bidi.lua} currently only contains data. It is
% a large and boring file and it's not shown here. See the generated
% file.
%\iffalse
%    \begin{macrocode}
%<*bidi> 
-- Data from Unicode and ConTeXt

Babel = Babel or {}

Babel.ranges={ 
 {0x0590, 0x05FF, 'r'},
 {0x0600, 0x07BF, 'al'},
 {0x07C0, 0x085F, 'r'},
 {0x0860, 0x086F, 'al'},
 {0x08A0, 0x08FF, 'al'},
 {0xFB1D, 0xFB4F, 'r'},
 {0xFB50, 0xFDFF, 'al'},
 {0xFE70, 0xFEFF, 'al'},
 {0x10800, 0x10C4F, 'r'},
 {0x1E800, 0x1E8DF, 'r'},
 {0x1E900, 0x1E95F, 'r'},
 {0x1F300, 0x1F9FF, 'on'}
}

Babel.characters={
 [0x0]={d='bn'},
 [0x1]={d='bn'},
 [0x2]={d='bn'},
 [0x3]={d='bn'},
 [0x4]={d='bn'},
 [0x5]={d='bn'},
 [0x6]={d='bn'},
 [0x7]={d='bn'},
 [0x8]={d='bn'},
 [0x9]={d='s'},
 [0xA]={d='b'},
 [0xB]={d='s'},
 [0xC]={d='ws'},
 [0xD]={d='b'},
 [0xE]={d='bn'},
 [0xF]={d='bn'},
 [0x10]={d='bn'},
 [0x11]={d='bn'},
 [0x12]={d='bn'},
 [0x13]={d='bn'},
 [0x14]={d='bn'},
 [0x15]={d='bn'},
 [0x16]={d='bn'},
 [0x17]={d='bn'},
 [0x18]={d='bn'},
 [0x19]={d='bn'},
 [0x1A]={d='bn'},
 [0x1B]={d='bn'},
 [0x1C]={d='b'},
 [0x1D]={d='b'},
 [0x1E]={d='b'},
 [0x1F]={d='s'},
 [0x20]={d='ws'},
 [0x21]={d='on'},
 [0x22]={d='on'},
 [0x23]={d='et'},
 [0x24]={d='et'},
 [0x25]={d='et'},
 [0x26]={d='on'},
 [0x27]={d='on'},
 [0x28]={d='on', m=0x29},
 [0x29]={d='on', m=0x28},
 [0x2A]={d='on'},
 [0x2B]={d='es'},
 [0x2C]={d='cs'},
 [0x2D]={d='es'},
 [0x2E]={d='cs'},
 [0x2F]={d='cs'},
 [0x30]={d='en'},
 [0x31]={d='en'},
 [0x32]={d='en'},
 [0x33]={d='en'},
 [0x34]={d='en'},
 [0x35]={d='en'},
 [0x36]={d='en'},
 [0x37]={d='en'},
 [0x38]={d='en'},
 [0x39]={d='en'},
 [0x3A]={d='cs'},
 [0x3B]={d='on'},
 [0x3C]={d='on', m=0x3E},
 [0x3D]={d='on'},
 [0x3E]={d='on', m=0x3C},
 [0x3F]={d='on'},
 [0x40]={d='on'},
 [0x5B]={d='on', m=0x5D},
 [0x5C]={d='on'},
 [0x5D]={d='on', m=0x5B},
 [0x5E]={d='on'},
 [0x5F]={d='on'},
 [0x60]={d='on'},
 [0x7B]={d='on', m=0x7D},
 [0x7C]={d='on'},
 [0x7D]={d='on', m=0x7B},
 [0x7E]={d='on'},
 [0x7F]={d='bn'},
 [0x80]={d='bn'},
 [0x81]={d='bn'},
 [0x82]={d='bn'},
 [0x83]={d='bn'},
 [0x84]={d='bn'},
 [0x85]={d='b'},
 [0x86]={d='bn'},
 [0x87]={d='bn'},
 [0x88]={d='bn'},
 [0x89]={d='bn'},
 [0x8A]={d='bn'},
 [0x8B]={d='bn'},
 [0x8C]={d='bn'},
 [0x8D]={d='bn'},
 [0x8E]={d='bn'},
 [0x8F]={d='bn'},
 [0x90]={d='bn'},
 [0x91]={d='bn'},
 [0x92]={d='bn'},
 [0x93]={d='bn'},
 [0x94]={d='bn'},
 [0x95]={d='bn'},
 [0x96]={d='bn'},
 [0x97]={d='bn'},
 [0x98]={d='bn'},
 [0x99]={d='bn'},
 [0x9A]={d='bn'},
 [0x9B]={d='bn'},
 [0x9C]={d='bn'},
 [0x9D]={d='bn'},
 [0x9E]={d='bn'},
 [0x9F]={d='bn'},
 [0xA0]={d='cs'},
 [0xA1]={d='on'},
 [0xA2]={d='et'},
 [0xA3]={d='et'},
 [0xA4]={d='et'},
 [0xA5]={d='et'},
 [0xA6]={d='on'},
 [0xA7]={d='on'},
 [0xA8]={d='on'},
 [0xA9]={d='on'},
 [0xAB]={d='on', m=0xBB},
 [0xAC]={d='on'},
 [0xAD]={d='bn'},
 [0xAE]={d='on'},
 [0xAF]={d='on'},
 [0xB0]={d='et'},
 [0xB1]={d='et'},
 [0xB2]={d='en'},
 [0xB3]={d='en'},
 [0xB4]={d='on'},
 [0xB6]={d='on'},
 [0xB7]={d='on'},
 [0xB8]={d='on'},
 [0xB9]={d='en'},
 [0xBB]={d='on', m=0xAB},
 [0xBC]={d='on'},
 [0xBD]={d='on'},
 [0xBE]={d='on'},
 [0xBF]={d='on'},
 [0xD7]={d='on'},
 [0xF7]={d='on'},
 [0x2B9]={d='on'},
 [0x2BA]={d='on'},
 [0x2C2]={d='on'},
 [0x2C3]={d='on'},
 [0x2C4]={d='on'},
 [0x2C5]={d='on'},
 [0x2C6]={d='on'},
 [0x2C7]={d='on'},
 [0x2C8]={d='on'},
 [0x2C9]={d='on'},
 [0x2CA]={d='on'},
 [0x2CB]={d='on'},
 [0x2CC]={d='on'},
 [0x2CD]={d='on'},
 [0x2CE]={d='on'},
 [0x2CF]={d='on'},
 [0x2D2]={d='on'},
 [0x2D3]={d='on'},
 [0x2D4]={d='on'},
 [0x2D5]={d='on'},
 [0x2D6]={d='on'},
 [0x2D7]={d='on'},
 [0x2D8]={d='on'},
 [0x2D9]={d='on'},
 [0x2DA]={d='on'},
 [0x2DB]={d='on'},
 [0x2DC]={d='on'},
 [0x2DD]={d='on'},
 [0x2DE]={d='on'},
 [0x2DF]={d='on'},
 [0x2E5]={d='on'},
 [0x2E6]={d='on'},
 [0x2E7]={d='on'},
 [0x2E8]={d='on'},
 [0x2E9]={d='on'},
 [0x2EA]={d='on'},
 [0x2EB]={d='on'},
 [0x2EC]={d='on'},
 [0x2ED]={d='on'},
 [0x2EF]={d='on'},
 [0x2F0]={d='on'},
 [0x2F1]={d='on'},
 [0x2F2]={d='on'},
 [0x2F3]={d='on'},
 [0x2F4]={d='on'},
 [0x2F5]={d='on'},
 [0x2F6]={d='on'},
 [0x2F7]={d='on'},
 [0x2F8]={d='on'},
 [0x2F9]={d='on'},
 [0x2FA]={d='on'},
 [0x2FB]={d='on'},
 [0x2FC]={d='on'},
 [0x2FD]={d='on'},
 [0x2FE]={d='on'},
 [0x2FF]={d='on'},
 [0x300]={d='nsm'},
 [0x301]={d='nsm'},
 [0x302]={d='nsm'},
 [0x303]={d='nsm'},
 [0x304]={d='nsm'},
 [0x305]={d='nsm'},
 [0x306]={d='nsm'},
 [0x307]={d='nsm'},
 [0x308]={d='nsm'},
 [0x309]={d='nsm'},
 [0x30A]={d='nsm'},
 [0x30B]={d='nsm'},
 [0x30C]={d='nsm'},
 [0x30D]={d='nsm'},
 [0x30E]={d='nsm'},
 [0x30F]={d='nsm'},
 [0x310]={d='nsm'},
 [0x311]={d='nsm'},
 [0x312]={d='nsm'},
 [0x313]={d='nsm'},
 [0x314]={d='nsm'},
 [0x315]={d='nsm'},
 [0x316]={d='nsm'},
 [0x317]={d='nsm'},
 [0x318]={d='nsm'},
 [0x319]={d='nsm'},
 [0x31A]={d='nsm'},
 [0x31B]={d='nsm'},
 [0x31C]={d='nsm'},
 [0x31D]={d='nsm'},
 [0x31E]={d='nsm'},
 [0x31F]={d='nsm'},
 [0x320]={d='nsm'},
 [0x321]={d='nsm'},
 [0x322]={d='nsm'},
 [0x323]={d='nsm'},
 [0x324]={d='nsm'},
 [0x325]={d='nsm'},
 [0x326]={d='nsm'},
 [0x327]={d='nsm'},
 [0x328]={d='nsm'},
 [0x329]={d='nsm'},
 [0x32A]={d='nsm'},
 [0x32B]={d='nsm'},
 [0x32C]={d='nsm'},
 [0x32D]={d='nsm'},
 [0x32E]={d='nsm'},
 [0x32F]={d='nsm'},
 [0x330]={d='nsm'},
 [0x331]={d='nsm'},
 [0x332]={d='nsm'},
 [0x333]={d='nsm'},
 [0x334]={d='nsm'},
 [0x335]={d='nsm'},
 [0x336]={d='nsm'},
 [0x337]={d='nsm'},
 [0x338]={d='nsm'},
 [0x339]={d='nsm'},
 [0x33A]={d='nsm'},
 [0x33B]={d='nsm'},
 [0x33C]={d='nsm'},
 [0x33D]={d='nsm'},
 [0x33E]={d='nsm'},
 [0x33F]={d='nsm'},
 [0x340]={d='nsm'},
 [0x341]={d='nsm'},
 [0x342]={d='nsm'},
 [0x343]={d='nsm'},
 [0x344]={d='nsm'},
 [0x345]={d='nsm'},
 [0x346]={d='nsm'},
 [0x347]={d='nsm'},
 [0x348]={d='nsm'},
 [0x349]={d='nsm'},
 [0x34A]={d='nsm'},
 [0x34B]={d='nsm'},
 [0x34C]={d='nsm'},
 [0x34D]={d='nsm'},
 [0x34E]={d='nsm'},
 [0x34F]={d='nsm'},
 [0x350]={d='nsm'},
 [0x351]={d='nsm'},
 [0x352]={d='nsm'},
 [0x353]={d='nsm'},
 [0x354]={d='nsm'},
 [0x355]={d='nsm'},
 [0x356]={d='nsm'},
 [0x357]={d='nsm'},
 [0x358]={d='nsm'},
 [0x359]={d='nsm'},
 [0x35A]={d='nsm'},
 [0x35B]={d='nsm'},
 [0x35C]={d='nsm'},
 [0x35D]={d='nsm'},
 [0x35E]={d='nsm'},
 [0x35F]={d='nsm'},
 [0x360]={d='nsm'},
 [0x361]={d='nsm'},
 [0x362]={d='nsm'},
 [0x363]={d='nsm'},
 [0x364]={d='nsm'},
 [0x365]={d='nsm'},
 [0x366]={d='nsm'},
 [0x367]={d='nsm'},
 [0x368]={d='nsm'},
 [0x369]={d='nsm'},
 [0x36A]={d='nsm'},
 [0x36B]={d='nsm'},
 [0x36C]={d='nsm'},
 [0x36D]={d='nsm'},
 [0x36E]={d='nsm'},
 [0x36F]={d='nsm'},
 [0x374]={d='on'},
 [0x375]={d='on'},
 [0x37E]={d='on'},
 [0x384]={d='on'},
 [0x385]={d='on'},
 [0x387]={d='on'},
 [0x3F6]={d='on'},
 [0x483]={d='nsm'},
 [0x484]={d='nsm'},
 [0x485]={d='nsm'},
 [0x486]={d='nsm'},
 [0x487]={d='nsm'},
 [0x488]={d='nsm'},
 [0x489]={d='nsm'},
 [0x58A]={d='on'},
 [0x58D]={d='on'},
 [0x58E]={d='on'},
 [0x58F]={d='et'},
 [0x591]={d='nsm'},
 [0x592]={d='nsm'},
 [0x593]={d='nsm'},
 [0x594]={d='nsm'},
 [0x595]={d='nsm'},
 [0x596]={d='nsm'},
 [0x597]={d='nsm'},
 [0x598]={d='nsm'},
 [0x599]={d='nsm'},
 [0x59A]={d='nsm'},
 [0x59B]={d='nsm'},
 [0x59C]={d='nsm'},
 [0x59D]={d='nsm'},
 [0x59E]={d='nsm'},
 [0x59F]={d='nsm'},
 [0x5A0]={d='nsm'},
 [0x5A1]={d='nsm'},
 [0x5A2]={d='nsm'},
 [0x5A3]={d='nsm'},
 [0x5A4]={d='nsm'},
 [0x5A5]={d='nsm'},
 [0x5A6]={d='nsm'},
 [0x5A7]={d='nsm'},
 [0x5A8]={d='nsm'},
 [0x5A9]={d='nsm'},
 [0x5AA]={d='nsm'},
 [0x5AB]={d='nsm'},
 [0x5AC]={d='nsm'},
 [0x5AD]={d='nsm'},
 [0x5AE]={d='nsm'},
 [0x5AF]={d='nsm'},
 [0x5B0]={d='nsm'},
 [0x5B1]={d='nsm'},
 [0x5B2]={d='nsm'},
 [0x5B3]={d='nsm'},
 [0x5B4]={d='nsm'},
 [0x5B5]={d='nsm'},
 [0x5B6]={d='nsm'},
 [0x5B7]={d='nsm'},
 [0x5B8]={d='nsm'},
 [0x5B9]={d='nsm'},
 [0x5BA]={d='nsm'},
 [0x5BB]={d='nsm'},
 [0x5BC]={d='nsm'},
 [0x5BD]={d='nsm'},
 [0x5BF]={d='nsm'},
 [0x5C1]={d='nsm'},
 [0x5C2]={d='nsm'},
 [0x5C4]={d='nsm'},
 [0x5C5]={d='nsm'},
 [0x5C7]={d='nsm'},
 [0x600]={d='an'},
 [0x601]={d='an'},
 [0x602]={d='an'},
 [0x603]={d='an'},
 [0x604]={d='an'},
 [0x605]={d='an'},
 [0x606]={d='on'},
 [0x607]={d='on'},
 [0x608]={d='al'},
 [0x609]={d='et'},
 [0x60A]={d='et'},
 [0x60B]={d='al'},
 [0x60C]={d='cs'},
 [0x60D]={d='al'},
 [0x60E]={d='on'},
 [0x60F]={d='on'},
 [0x610]={d='nsm'},
 [0x611]={d='nsm'},
 [0x612]={d='nsm'},
 [0x613]={d='nsm'},
 [0x614]={d='nsm'},
 [0x615]={d='nsm'},
 [0x616]={d='nsm'},
 [0x617]={d='nsm'},
 [0x618]={d='nsm'},
 [0x619]={d='nsm'},
 [0x61A]={d='nsm'},
 [0x64B]={d='nsm'},
 [0x64C]={d='nsm'},
 [0x64D]={d='nsm'},
 [0x64E]={d='nsm'},
 [0x64F]={d='nsm'},
 [0x650]={d='nsm'},
 [0x651]={d='nsm'},
 [0x652]={d='nsm'},
 [0x653]={d='nsm'},
 [0x654]={d='nsm'},
 [0x655]={d='nsm'},
 [0x656]={d='nsm'},
 [0x657]={d='nsm'},
 [0x658]={d='nsm'},
 [0x659]={d='nsm'},
 [0x65A]={d='nsm'},
 [0x65B]={d='nsm'},
 [0x65C]={d='nsm'},
 [0x65D]={d='nsm'},
 [0x65E]={d='nsm'},
 [0x65F]={d='nsm'},
 [0x660]={d='an'},
 [0x661]={d='an'},
 [0x662]={d='an'},
 [0x663]={d='an'},
 [0x664]={d='an'},
 [0x665]={d='an'},
 [0x666]={d='an'},
 [0x667]={d='an'},
 [0x668]={d='an'},
 [0x669]={d='an'},
 [0x66A]={d='et'},
 [0x66B]={d='an'},
 [0x66C]={d='an'},
 [0x670]={d='nsm'},
 [0x6D6]={d='nsm'},
 [0x6D7]={d='nsm'},
 [0x6D8]={d='nsm'},
 [0x6D9]={d='nsm'},
 [0x6DA]={d='nsm'},
 [0x6DB]={d='nsm'},
 [0x6DC]={d='nsm'},
 [0x6DD]={d='an'},
 [0x6DE]={d='on'},
 [0x6DF]={d='nsm'},
 [0x6E0]={d='nsm'},
 [0x6E1]={d='nsm'},
 [0x6E2]={d='nsm'},
 [0x6E3]={d='nsm'},
 [0x6E4]={d='nsm'},
 [0x6E7]={d='nsm'},
 [0x6E8]={d='nsm'},
 [0x6E9]={d='on'},
 [0x6EA]={d='nsm'},
 [0x6EB]={d='nsm'},
 [0x6EC]={d='nsm'},
 [0x6ED]={d='nsm'},
 [0x6F0]={d='en'},
 [0x6F1]={d='en'},
 [0x6F2]={d='en'},
 [0x6F3]={d='en'},
 [0x6F4]={d='en'},
 [0x6F5]={d='en'},
 [0x6F6]={d='en'},
 [0x6F7]={d='en'},
 [0x6F8]={d='en'},
 [0x6F9]={d='en'},
 [0x711]={d='nsm'},
 [0x730]={d='nsm'},
 [0x731]={d='nsm'},
 [0x732]={d='nsm'},
 [0x733]={d='nsm'},
 [0x734]={d='nsm'},
 [0x735]={d='nsm'},
 [0x736]={d='nsm'},
 [0x737]={d='nsm'},
 [0x738]={d='nsm'},
 [0x739]={d='nsm'},
 [0x73A]={d='nsm'},
 [0x73B]={d='nsm'},
 [0x73C]={d='nsm'},
 [0x73D]={d='nsm'},
 [0x73E]={d='nsm'},
 [0x73F]={d='nsm'},
 [0x740]={d='nsm'},
 [0x741]={d='nsm'},
 [0x742]={d='nsm'},
 [0x743]={d='nsm'},
 [0x744]={d='nsm'},
 [0x745]={d='nsm'},
 [0x746]={d='nsm'},
 [0x747]={d='nsm'},
 [0x748]={d='nsm'},
 [0x749]={d='nsm'},
 [0x74A]={d='nsm'},
 [0x7A6]={d='nsm'},
 [0x7A7]={d='nsm'},
 [0x7A8]={d='nsm'},
 [0x7A9]={d='nsm'},
 [0x7AA]={d='nsm'},
 [0x7AB]={d='nsm'},
 [0x7AC]={d='nsm'},
 [0x7AD]={d='nsm'},
 [0x7AE]={d='nsm'},
 [0x7AF]={d='nsm'},
 [0x7B0]={d='nsm'},
 [0x7EB]={d='nsm'},
 [0x7EC]={d='nsm'},
 [0x7ED]={d='nsm'},
 [0x7EE]={d='nsm'},
 [0x7EF]={d='nsm'},
 [0x7F0]={d='nsm'},
 [0x7F1]={d='nsm'},
 [0x7F2]={d='nsm'},
 [0x7F3]={d='nsm'},
 [0x7F6]={d='on'},
 [0x7F7]={d='on'},
 [0x7F8]={d='on'},
 [0x7F9]={d='on'},
 [0x816]={d='nsm'},
 [0x817]={d='nsm'},
 [0x818]={d='nsm'},
 [0x819]={d='nsm'},
 [0x81B]={d='nsm'},
 [0x81C]={d='nsm'},
 [0x81D]={d='nsm'},
 [0x81E]={d='nsm'},
 [0x81F]={d='nsm'},
 [0x820]={d='nsm'},
 [0x821]={d='nsm'},
 [0x822]={d='nsm'},
 [0x823]={d='nsm'},
 [0x825]={d='nsm'},
 [0x826]={d='nsm'},
 [0x827]={d='nsm'},
 [0x829]={d='nsm'},
 [0x82A]={d='nsm'},
 [0x82B]={d='nsm'},
 [0x82C]={d='nsm'},
 [0x82D]={d='nsm'},
 [0x859]={d='nsm'},
 [0x85A]={d='nsm'},
 [0x85B]={d='nsm'},
 [0x8D4]={d='nsm'},
 [0x8D5]={d='nsm'},
 [0x8D6]={d='nsm'},
 [0x8D7]={d='nsm'},
 [0x8D8]={d='nsm'},
 [0x8D9]={d='nsm'},
 [0x8DA]={d='nsm'},
 [0x8DB]={d='nsm'},
 [0x8DC]={d='nsm'},
 [0x8DD]={d='nsm'},
 [0x8DE]={d='nsm'},
 [0x8DF]={d='nsm'},
 [0x8E0]={d='nsm'},
 [0x8E1]={d='nsm'},
 [0x8E2]={d='an'},
 [0x8E3]={d='nsm'},
 [0x8E4]={d='nsm'},
 [0x8E5]={d='nsm'},
 [0x8E6]={d='nsm'},
 [0x8E7]={d='nsm'},
 [0x8E8]={d='nsm'},
 [0x8E9]={d='nsm'},
 [0x8EA]={d='nsm'},
 [0x8EB]={d='nsm'},
 [0x8EC]={d='nsm'},
 [0x8ED]={d='nsm'},
 [0x8EE]={d='nsm'},
 [0x8EF]={d='nsm'},
 [0x8F0]={d='nsm'},
 [0x8F1]={d='nsm'},
 [0x8F2]={d='nsm'},
 [0x8F3]={d='nsm'},
 [0x8F4]={d='nsm'},
 [0x8F5]={d='nsm'},
 [0x8F6]={d='nsm'},
 [0x8F7]={d='nsm'},
 [0x8F8]={d='nsm'},
 [0x8F9]={d='nsm'},
 [0x8FA]={d='nsm'},
 [0x8FB]={d='nsm'},
 [0x8FC]={d='nsm'},
 [0x8FD]={d='nsm'},
 [0x8FE]={d='nsm'},
 [0x8FF]={d='nsm'},
 [0x900]={d='nsm'},
 [0x901]={d='nsm'},
 [0x902]={d='nsm'},
 [0x93A]={d='nsm'},
 [0x93C]={d='nsm'},
 [0x941]={d='nsm'},
 [0x942]={d='nsm'},
 [0x943]={d='nsm'},
 [0x944]={d='nsm'},
 [0x945]={d='nsm'},
 [0x946]={d='nsm'},
 [0x947]={d='nsm'},
 [0x948]={d='nsm'},
 [0x94D]={d='nsm'},
 [0x951]={d='nsm'},
 [0x952]={d='nsm'},
 [0x953]={d='nsm'},
 [0x954]={d='nsm'},
 [0x955]={d='nsm'},
 [0x956]={d='nsm'},
 [0x957]={d='nsm'},
 [0x962]={d='nsm'},
 [0x963]={d='nsm'},
 [0x981]={d='nsm'},
 [0x9BC]={d='nsm'},
 [0x9C1]={d='nsm'},
 [0x9C2]={d='nsm'},
 [0x9C3]={d='nsm'},
 [0x9C4]={d='nsm'},
 [0x9CD]={d='nsm'},
 [0x9E2]={d='nsm'},
 [0x9E3]={d='nsm'},
 [0x9F2]={d='et'},
 [0x9F3]={d='et'},
 [0x9FB]={d='et'},
 [0xA01]={d='nsm'},
 [0xA02]={d='nsm'},
 [0xA3C]={d='nsm'},
 [0xA41]={d='nsm'},
 [0xA42]={d='nsm'},
 [0xA47]={d='nsm'},
 [0xA48]={d='nsm'},
 [0xA4B]={d='nsm'},
 [0xA4C]={d='nsm'},
 [0xA4D]={d='nsm'},
 [0xA51]={d='nsm'},
 [0xA70]={d='nsm'},
 [0xA71]={d='nsm'},
 [0xA75]={d='nsm'},
 [0xA81]={d='nsm'},
 [0xA82]={d='nsm'},
 [0xABC]={d='nsm'},
 [0xAC1]={d='nsm'},
 [0xAC2]={d='nsm'},
 [0xAC3]={d='nsm'},
 [0xAC4]={d='nsm'},
 [0xAC5]={d='nsm'},
 [0xAC7]={d='nsm'},
 [0xAC8]={d='nsm'},
 [0xACD]={d='nsm'},
 [0xAE2]={d='nsm'},
 [0xAE3]={d='nsm'},
 [0xAF1]={d='et'},
 [0xB01]={d='nsm'},
 [0xB3C]={d='nsm'},
 [0xB3F]={d='nsm'},
 [0xB41]={d='nsm'},
 [0xB42]={d='nsm'},
 [0xB43]={d='nsm'},
 [0xB44]={d='nsm'},
 [0xB4D]={d='nsm'},
 [0xB56]={d='nsm'},
 [0xB62]={d='nsm'},
 [0xB63]={d='nsm'},
 [0xB82]={d='nsm'},
 [0xBC0]={d='nsm'},
 [0xBCD]={d='nsm'},
 [0xBF3]={d='on'},
 [0xBF4]={d='on'},
 [0xBF5]={d='on'},
 [0xBF6]={d='on'},
 [0xBF7]={d='on'},
 [0xBF8]={d='on'},
 [0xBF9]={d='et'},
 [0xBFA]={d='on'},
 [0xC00]={d='nsm'},
 [0xC3E]={d='nsm'},
 [0xC3F]={d='nsm'},
 [0xC40]={d='nsm'},
 [0xC46]={d='nsm'},
 [0xC47]={d='nsm'},
 [0xC48]={d='nsm'},
 [0xC4A]={d='nsm'},
 [0xC4B]={d='nsm'},
 [0xC4C]={d='nsm'},
 [0xC4D]={d='nsm'},
 [0xC55]={d='nsm'},
 [0xC56]={d='nsm'},
 [0xC62]={d='nsm'},
 [0xC63]={d='nsm'},
 [0xC78]={d='on'},
 [0xC79]={d='on'},
 [0xC7A]={d='on'},
 [0xC7B]={d='on'},
 [0xC7C]={d='on'},
 [0xC7D]={d='on'},
 [0xC7E]={d='on'},
 [0xC81]={d='nsm'},
 [0xCBC]={d='nsm'},
 [0xCCC]={d='nsm'},
 [0xCCD]={d='nsm'},
 [0xCE2]={d='nsm'},
 [0xCE3]={d='nsm'},
 [0xD01]={d='nsm'},
 [0xD41]={d='nsm'},
 [0xD42]={d='nsm'},
 [0xD43]={d='nsm'},
 [0xD44]={d='nsm'},
 [0xD4D]={d='nsm'},
 [0xD62]={d='nsm'},
 [0xD63]={d='nsm'},
 [0xDCA]={d='nsm'},
 [0xDD2]={d='nsm'},
 [0xDD3]={d='nsm'},
 [0xDD4]={d='nsm'},
 [0xDD6]={d='nsm'},
 [0xE31]={d='nsm'},
 [0xE34]={d='nsm'},
 [0xE35]={d='nsm'},
 [0xE36]={d='nsm'},
 [0xE37]={d='nsm'},
 [0xE38]={d='nsm'},
 [0xE39]={d='nsm'},
 [0xE3A]={d='nsm'},
 [0xE3F]={d='et'},
 [0xE47]={d='nsm'},
 [0xE48]={d='nsm'},
 [0xE49]={d='nsm'},
 [0xE4A]={d='nsm'},
 [0xE4B]={d='nsm'},
 [0xE4C]={d='nsm'},
 [0xE4D]={d='nsm'},
 [0xE4E]={d='nsm'},
 [0xEB1]={d='nsm'},
 [0xEB4]={d='nsm'},
 [0xEB5]={d='nsm'},
 [0xEB6]={d='nsm'},
 [0xEB7]={d='nsm'},
 [0xEB8]={d='nsm'},
 [0xEB9]={d='nsm'},
 [0xEBB]={d='nsm'},
 [0xEBC]={d='nsm'},
 [0xEC8]={d='nsm'},
 [0xEC9]={d='nsm'},
 [0xECA]={d='nsm'},
 [0xECB]={d='nsm'},
 [0xECC]={d='nsm'},
 [0xECD]={d='nsm'},
 [0xF18]={d='nsm'},
 [0xF19]={d='nsm'},
 [0xF35]={d='nsm'},
 [0xF37]={d='nsm'},
 [0xF39]={d='nsm'},
 [0xF3A]={d='on', m=0xF3B},
 [0xF3B]={d='on', m=0xF3A},
 [0xF3C]={d='on', m=0xF3D},
 [0xF3D]={d='on', m=0xF3C},
 [0xF71]={d='nsm'},
 [0xF72]={d='nsm'},
 [0xF73]={d='nsm'},
 [0xF74]={d='nsm'},
 [0xF75]={d='nsm'},
 [0xF76]={d='nsm'},
 [0xF77]={d='nsm'},
 [0xF78]={d='nsm'},
 [0xF79]={d='nsm'},
 [0xF7A]={d='nsm'},
 [0xF7B]={d='nsm'},
 [0xF7C]={d='nsm'},
 [0xF7D]={d='nsm'},
 [0xF7E]={d='nsm'},
 [0xF80]={d='nsm'},
 [0xF81]={d='nsm'},
 [0xF82]={d='nsm'},
 [0xF83]={d='nsm'},
 [0xF84]={d='nsm'},
 [0xF86]={d='nsm'},
 [0xF87]={d='nsm'},
 [0xF8D]={d='nsm'},
 [0xF8E]={d='nsm'},
 [0xF8F]={d='nsm'},
 [0xF90]={d='nsm'},
 [0xF91]={d='nsm'},
 [0xF92]={d='nsm'},
 [0xF93]={d='nsm'},
 [0xF94]={d='nsm'},
 [0xF95]={d='nsm'},
 [0xF96]={d='nsm'},
 [0xF97]={d='nsm'},
 [0xF99]={d='nsm'},
 [0xF9A]={d='nsm'},
 [0xF9B]={d='nsm'},
 [0xF9C]={d='nsm'},
 [0xF9D]={d='nsm'},
 [0xF9E]={d='nsm'},
 [0xF9F]={d='nsm'},
 [0xFA0]={d='nsm'},
 [0xFA1]={d='nsm'},
 [0xFA2]={d='nsm'},
 [0xFA3]={d='nsm'},
 [0xFA4]={d='nsm'},
 [0xFA5]={d='nsm'},
 [0xFA6]={d='nsm'},
 [0xFA7]={d='nsm'},
 [0xFA8]={d='nsm'},
 [0xFA9]={d='nsm'},
 [0xFAA]={d='nsm'},
 [0xFAB]={d='nsm'},
 [0xFAC]={d='nsm'},
 [0xFAD]={d='nsm'},
 [0xFAE]={d='nsm'},
 [0xFAF]={d='nsm'},
 [0xFB0]={d='nsm'},
 [0xFB1]={d='nsm'},
 [0xFB2]={d='nsm'},
 [0xFB3]={d='nsm'},
 [0xFB4]={d='nsm'},
 [0xFB5]={d='nsm'},
 [0xFB6]={d='nsm'},
 [0xFB7]={d='nsm'},
 [0xFB8]={d='nsm'},
 [0xFB9]={d='nsm'},
 [0xFBA]={d='nsm'},
 [0xFBB]={d='nsm'},
 [0xFBC]={d='nsm'},
 [0xFC6]={d='nsm'},
 [0x102D]={d='nsm'},
 [0x102E]={d='nsm'},
 [0x102F]={d='nsm'},
 [0x1030]={d='nsm'},
 [0x1032]={d='nsm'},
 [0x1033]={d='nsm'},
 [0x1034]={d='nsm'},
 [0x1035]={d='nsm'},
 [0x1036]={d='nsm'},
 [0x1037]={d='nsm'},
 [0x1039]={d='nsm'},
 [0x103A]={d='nsm'},
 [0x103D]={d='nsm'},
 [0x103E]={d='nsm'},
 [0x1058]={d='nsm'},
 [0x1059]={d='nsm'},
 [0x105E]={d='nsm'},
 [0x105F]={d='nsm'},
 [0x1060]={d='nsm'},
 [0x1071]={d='nsm'},
 [0x1072]={d='nsm'},
 [0x1073]={d='nsm'},
 [0x1074]={d='nsm'},
 [0x1082]={d='nsm'},
 [0x1085]={d='nsm'},
 [0x1086]={d='nsm'},
 [0x108D]={d='nsm'},
 [0x109D]={d='nsm'},
 [0x135D]={d='nsm'},
 [0x135E]={d='nsm'},
 [0x135F]={d='nsm'},
 [0x1390]={d='on'},
 [0x1391]={d='on'},
 [0x1392]={d='on'},
 [0x1393]={d='on'},
 [0x1394]={d='on'},
 [0x1395]={d='on'},
 [0x1396]={d='on'},
 [0x1397]={d='on'},
 [0x1398]={d='on'},
 [0x1399]={d='on'},
 [0x1400]={d='on'},
 [0x1680]={d='ws'},
 [0x169B]={d='on', m=0x169C},
 [0x169C]={d='on', m=0x169B},
 [0x1712]={d='nsm'},
 [0x1713]={d='nsm'},
 [0x1714]={d='nsm'},
 [0x1732]={d='nsm'},
 [0x1733]={d='nsm'},
 [0x1734]={d='nsm'},
 [0x1752]={d='nsm'},
 [0x1753]={d='nsm'},
 [0x1772]={d='nsm'},
 [0x1773]={d='nsm'},
 [0x17B4]={d='nsm'},
 [0x17B5]={d='nsm'},
 [0x17B7]={d='nsm'},
 [0x17B8]={d='nsm'},
 [0x17B9]={d='nsm'},
 [0x17BA]={d='nsm'},
 [0x17BB]={d='nsm'},
 [0x17BC]={d='nsm'},
 [0x17BD]={d='nsm'},
 [0x17C6]={d='nsm'},
 [0x17C9]={d='nsm'},
 [0x17CA]={d='nsm'},
 [0x17CB]={d='nsm'},
 [0x17CC]={d='nsm'},
 [0x17CD]={d='nsm'},
 [0x17CE]={d='nsm'},
 [0x17CF]={d='nsm'},
 [0x17D0]={d='nsm'},
 [0x17D1]={d='nsm'},
 [0x17D2]={d='nsm'},
 [0x17D3]={d='nsm'},
 [0x17DB]={d='et'},
 [0x17DD]={d='nsm'},
 [0x17F0]={d='on'},
 [0x17F1]={d='on'},
 [0x17F2]={d='on'},
 [0x17F3]={d='on'},
 [0x17F4]={d='on'},
 [0x17F5]={d='on'},
 [0x17F6]={d='on'},
 [0x17F7]={d='on'},
 [0x17F8]={d='on'},
 [0x17F9]={d='on'},
 [0x1800]={d='on'},
 [0x1801]={d='on'},
 [0x1802]={d='on'},
 [0x1803]={d='on'},
 [0x1804]={d='on'},
 [0x1805]={d='on'},
 [0x1806]={d='on'},
 [0x1807]={d='on'},
 [0x1808]={d='on'},
 [0x1809]={d='on'},
 [0x180A]={d='on'},
 [0x180B]={d='nsm'},
 [0x180C]={d='nsm'},
 [0x180D]={d='nsm'},
 [0x180E]={d='bn'},
 [0x1885]={d='nsm'},
 [0x1886]={d='nsm'},
 [0x18A9]={d='nsm'},
 [0x1920]={d='nsm'},
 [0x1921]={d='nsm'},
 [0x1922]={d='nsm'},
 [0x1927]={d='nsm'},
 [0x1928]={d='nsm'},
 [0x1932]={d='nsm'},
 [0x1939]={d='nsm'},
 [0x193A]={d='nsm'},
 [0x193B]={d='nsm'},
 [0x1940]={d='on'},
 [0x1944]={d='on'},
 [0x1945]={d='on'},
 [0x19DE]={d='on'},
 [0x19DF]={d='on'},
 [0x19E0]={d='on'},
 [0x19E1]={d='on'},
 [0x19E2]={d='on'},
 [0x19E3]={d='on'},
 [0x19E4]={d='on'},
 [0x19E5]={d='on'},
 [0x19E6]={d='on'},
 [0x19E7]={d='on'},
 [0x19E8]={d='on'},
 [0x19E9]={d='on'},
 [0x19EA]={d='on'},
 [0x19EB]={d='on'},
 [0x19EC]={d='on'},
 [0x19ED]={d='on'},
 [0x19EE]={d='on'},
 [0x19EF]={d='on'},
 [0x19F0]={d='on'},
 [0x19F1]={d='on'},
 [0x19F2]={d='on'},
 [0x19F3]={d='on'},
 [0x19F4]={d='on'},
 [0x19F5]={d='on'},
 [0x19F6]={d='on'},
 [0x19F7]={d='on'},
 [0x19F8]={d='on'},
 [0x19F9]={d='on'},
 [0x19FA]={d='on'},
 [0x19FB]={d='on'},
 [0x19FC]={d='on'},
 [0x19FD]={d='on'},
 [0x19FE]={d='on'},
 [0x19FF]={d='on'},
 [0x1A17]={d='nsm'},
 [0x1A18]={d='nsm'},
 [0x1A1B]={d='nsm'},
 [0x1A56]={d='nsm'},
 [0x1A58]={d='nsm'},
 [0x1A59]={d='nsm'},
 [0x1A5A]={d='nsm'},
 [0x1A5B]={d='nsm'},
 [0x1A5C]={d='nsm'},
 [0x1A5D]={d='nsm'},
 [0x1A5E]={d='nsm'},
 [0x1A60]={d='nsm'},
 [0x1A62]={d='nsm'},
 [0x1A65]={d='nsm'},
 [0x1A66]={d='nsm'},
 [0x1A67]={d='nsm'},
 [0x1A68]={d='nsm'},
 [0x1A69]={d='nsm'},
 [0x1A6A]={d='nsm'},
 [0x1A6B]={d='nsm'},
 [0x1A6C]={d='nsm'},
 [0x1A73]={d='nsm'},
 [0x1A74]={d='nsm'},
 [0x1A75]={d='nsm'},
 [0x1A76]={d='nsm'},
 [0x1A77]={d='nsm'},
 [0x1A78]={d='nsm'},
 [0x1A79]={d='nsm'},
 [0x1A7A]={d='nsm'},
 [0x1A7B]={d='nsm'},
 [0x1A7C]={d='nsm'},
 [0x1A7F]={d='nsm'},
 [0x1AB0]={d='nsm'},
 [0x1AB1]={d='nsm'},
 [0x1AB2]={d='nsm'},
 [0x1AB3]={d='nsm'},
 [0x1AB4]={d='nsm'},
 [0x1AB5]={d='nsm'},
 [0x1AB6]={d='nsm'},
 [0x1AB7]={d='nsm'},
 [0x1AB8]={d='nsm'},
 [0x1AB9]={d='nsm'},
 [0x1ABA]={d='nsm'},
 [0x1ABB]={d='nsm'},
 [0x1ABC]={d='nsm'},
 [0x1ABD]={d='nsm'},
 [0x1ABE]={d='nsm'},
 [0x1B00]={d='nsm'},
 [0x1B01]={d='nsm'},
 [0x1B02]={d='nsm'},
 [0x1B03]={d='nsm'},
 [0x1B34]={d='nsm'},
 [0x1B36]={d='nsm'},
 [0x1B37]={d='nsm'},
 [0x1B38]={d='nsm'},
 [0x1B39]={d='nsm'},
 [0x1B3A]={d='nsm'},
 [0x1B3C]={d='nsm'},
 [0x1B42]={d='nsm'},
 [0x1B6B]={d='nsm'},
 [0x1B6C]={d='nsm'},
 [0x1B6D]={d='nsm'},
 [0x1B6E]={d='nsm'},
 [0x1B6F]={d='nsm'},
 [0x1B70]={d='nsm'},
 [0x1B71]={d='nsm'},
 [0x1B72]={d='nsm'},
 [0x1B73]={d='nsm'},
 [0x1B80]={d='nsm'},
 [0x1B81]={d='nsm'},
 [0x1BA2]={d='nsm'},
 [0x1BA3]={d='nsm'},
 [0x1BA4]={d='nsm'},
 [0x1BA5]={d='nsm'},
 [0x1BA8]={d='nsm'},
 [0x1BA9]={d='nsm'},
 [0x1BAB]={d='nsm'},
 [0x1BAC]={d='nsm'},
 [0x1BAD]={d='nsm'},
 [0x1BE6]={d='nsm'},
 [0x1BE8]={d='nsm'},
 [0x1BE9]={d='nsm'},
 [0x1BED]={d='nsm'},
 [0x1BEF]={d='nsm'},
 [0x1BF0]={d='nsm'},
 [0x1BF1]={d='nsm'},
 [0x1C2C]={d='nsm'},
 [0x1C2D]={d='nsm'},
 [0x1C2E]={d='nsm'},
 [0x1C2F]={d='nsm'},
 [0x1C30]={d='nsm'},
 [0x1C31]={d='nsm'},
 [0x1C32]={d='nsm'},
 [0x1C33]={d='nsm'},
 [0x1C36]={d='nsm'},
 [0x1C37]={d='nsm'},
 [0x1CD0]={d='nsm'},
 [0x1CD1]={d='nsm'},
 [0x1CD2]={d='nsm'},
 [0x1CD4]={d='nsm'},
 [0x1CD5]={d='nsm'},
 [0x1CD6]={d='nsm'},
 [0x1CD7]={d='nsm'},
 [0x1CD8]={d='nsm'},
 [0x1CD9]={d='nsm'},
 [0x1CDA]={d='nsm'},
 [0x1CDB]={d='nsm'},
 [0x1CDC]={d='nsm'},
 [0x1CDD]={d='nsm'},
 [0x1CDE]={d='nsm'},
 [0x1CDF]={d='nsm'},
 [0x1CE0]={d='nsm'},
 [0x1CE2]={d='nsm'},
 [0x1CE3]={d='nsm'},
 [0x1CE4]={d='nsm'},
 [0x1CE5]={d='nsm'},
 [0x1CE6]={d='nsm'},
 [0x1CE7]={d='nsm'},
 [0x1CE8]={d='nsm'},
 [0x1CED]={d='nsm'},
 [0x1CF4]={d='nsm'},
 [0x1CF8]={d='nsm'},
 [0x1CF9]={d='nsm'},
 [0x1DC0]={d='nsm'},
 [0x1DC1]={d='nsm'},
 [0x1DC2]={d='nsm'},
 [0x1DC3]={d='nsm'},
 [0x1DC4]={d='nsm'},
 [0x1DC5]={d='nsm'},
 [0x1DC6]={d='nsm'},
 [0x1DC7]={d='nsm'},
 [0x1DC8]={d='nsm'},
 [0x1DC9]={d='nsm'},
 [0x1DCA]={d='nsm'},
 [0x1DCB]={d='nsm'},
 [0x1DCC]={d='nsm'},
 [0x1DCD]={d='nsm'},
 [0x1DCE]={d='nsm'},
 [0x1DCF]={d='nsm'},
 [0x1DD0]={d='nsm'},
 [0x1DD1]={d='nsm'},
 [0x1DD2]={d='nsm'},
 [0x1DD3]={d='nsm'},
 [0x1DD4]={d='nsm'},
 [0x1DD5]={d='nsm'},
 [0x1DD6]={d='nsm'},
 [0x1DD7]={d='nsm'},
 [0x1DD8]={d='nsm'},
 [0x1DD9]={d='nsm'},
 [0x1DDA]={d='nsm'},
 [0x1DDB]={d='nsm'},
 [0x1DDC]={d='nsm'},
 [0x1DDD]={d='nsm'},
 [0x1DDE]={d='nsm'},
 [0x1DDF]={d='nsm'},
 [0x1DE0]={d='nsm'},
 [0x1DE1]={d='nsm'},
 [0x1DE2]={d='nsm'},
 [0x1DE3]={d='nsm'},
 [0x1DE4]={d='nsm'},
 [0x1DE5]={d='nsm'},
 [0x1DE6]={d='nsm'},
 [0x1DE7]={d='nsm'},
 [0x1DE8]={d='nsm'},
 [0x1DE9]={d='nsm'},
 [0x1DEA]={d='nsm'},
 [0x1DEB]={d='nsm'},
 [0x1DEC]={d='nsm'},
 [0x1DED]={d='nsm'},
 [0x1DEE]={d='nsm'},
 [0x1DEF]={d='nsm'},
 [0x1DF0]={d='nsm'},
 [0x1DF1]={d='nsm'},
 [0x1DF2]={d='nsm'},
 [0x1DF3]={d='nsm'},
 [0x1DF4]={d='nsm'},
 [0x1DF5]={d='nsm'},
 [0x1DFB]={d='nsm'},
 [0x1DFC]={d='nsm'},
 [0x1DFD]={d='nsm'},
 [0x1DFE]={d='nsm'},
 [0x1DFF]={d='nsm'},
 [0x1FBD]={d='on'},
 [0x1FBF]={d='on'},
 [0x1FC0]={d='on'},
 [0x1FC1]={d='on'},
 [0x1FCD]={d='on'},
 [0x1FCE]={d='on'},
 [0x1FCF]={d='on'},
 [0x1FDD]={d='on'},
 [0x1FDE]={d='on'},
 [0x1FDF]={d='on'},
 [0x1FED]={d='on'},
 [0x1FEE]={d='on'},
 [0x1FEF]={d='on'},
 [0x1FFD]={d='on'},
 [0x1FFE]={d='on'},
 [0x2000]={d='ws'},
 [0x2001]={d='ws'},
 [0x2002]={d='ws'},
 [0x2003]={d='ws'},
 [0x2004]={d='ws'},
 [0x2005]={d='ws'},
 [0x2006]={d='ws'},
 [0x2007]={d='ws'},
 [0x2008]={d='ws'},
 [0x2009]={d='ws'},
 [0x200A]={d='ws'},
 [0x200B]={d='bn'},
 [0x200C]={d='bn'},
 [0x200D]={d='bn'},
 [0x200F]={d='r'},
 [0x2010]={d='on'},
 [0x2011]={d='on'},
 [0x2012]={d='on'},
 [0x2013]={d='on'},
 [0x2014]={d='on'},
 [0x2015]={d='on'},
 [0x2016]={d='on'},
 [0x2017]={d='on'},
 [0x2018]={d='on'},
 [0x2019]={d='on'},
 [0x201A]={d='on'},
 [0x201B]={d='on'},
 [0x201C]={d='on'},
 [0x201D]={d='on'},
 [0x201E]={d='on'},
 [0x201F]={d='on'},
 [0x2020]={d='on'},
 [0x2021]={d='on'},
 [0x2022]={d='on'},
 [0x2023]={d='on'},
 [0x2024]={d='on'},
 [0x2025]={d='on'},
 [0x2026]={d='on'},
 [0x2027]={d='on'},
 [0x2028]={d='ws'},
 [0x2029]={d='b'},
 [0x202A]={d='lre'},
 [0x202B]={d='rle'},
 [0x202C]={d='pdf'},
 [0x202D]={d='lro'},
 [0x202E]={d='rlo'},
 [0x202F]={d='cs'},
 [0x2030]={d='et'},
 [0x2031]={d='et'},
 [0x2032]={d='et'},
 [0x2033]={d='et'},
 [0x2034]={d='et'},
 [0x2035]={d='on'},
 [0x2036]={d='on'},
 [0x2037]={d='on'},
 [0x2038]={d='on'},
 [0x2039]={d='on', m=0x203A},
 [0x203A]={d='on', m=0x2039},
 [0x203B]={d='on'},
 [0x203C]={d='on'},
 [0x203D]={d='on'},
 [0x203E]={d='on'},
 [0x203F]={d='on'},
 [0x2040]={d='on'},
 [0x2041]={d='on'},
 [0x2042]={d='on'},
 [0x2043]={d='on'},
 [0x2044]={d='cs'},
 [0x2045]={d='on', m=0x2046},
 [0x2046]={d='on', m=0x2045},
 [0x2047]={d='on'},
 [0x2048]={d='on'},
 [0x2049]={d='on'},
 [0x204A]={d='on'},
 [0x204B]={d='on'},
 [0x204C]={d='on'},
 [0x204D]={d='on'},
 [0x204E]={d='on'},
 [0x204F]={d='on'},
 [0x2050]={d='on'},
 [0x2051]={d='on'},
 [0x2052]={d='on'},
 [0x2053]={d='on'},
 [0x2054]={d='on'},
 [0x2055]={d='on'},
 [0x2056]={d='on'},
 [0x2057]={d='on'},
 [0x2058]={d='on'},
 [0x2059]={d='on'},
 [0x205A]={d='on'},
 [0x205B]={d='on'},
 [0x205C]={d='on'},
 [0x205D]={d='on'},
 [0x205E]={d='on'},
 [0x205F]={d='ws'},
 [0x2060]={d='bn'},
 [0x2061]={d='bn'},
 [0x2062]={d='bn'},
 [0x2063]={d='bn'},
 [0x2064]={d='bn'},
 [0x2066]={d='lri'},
 [0x2067]={d='rli'},
 [0x2068]={d='fsi'},
 [0x2069]={d='pdi'},
 [0x206A]={d='bn'},
 [0x206B]={d='bn'},
 [0x206C]={d='bn'},
 [0x206D]={d='bn'},
 [0x206E]={d='bn'},
 [0x206F]={d='bn'},
 [0x2070]={d='en'},
 [0x2074]={d='en'},
 [0x2075]={d='en'},
 [0x2076]={d='en'},
 [0x2077]={d='en'},
 [0x2078]={d='en'},
 [0x2079]={d='en'},
 [0x207A]={d='es'},
 [0x207B]={d='es'},
 [0x207C]={d='on'},
 [0x207D]={d='on', m=0x207E},
 [0x207E]={d='on', m=0x207D},
 [0x2080]={d='en'},
 [0x2081]={d='en'},
 [0x2082]={d='en'},
 [0x2083]={d='en'},
 [0x2084]={d='en'},
 [0x2085]={d='en'},
 [0x2086]={d='en'},
 [0x2087]={d='en'},
 [0x2088]={d='en'},
 [0x2089]={d='en'},
 [0x208A]={d='es'},
 [0x208B]={d='es'},
 [0x208C]={d='on'},
 [0x208D]={d='on', m=0x208E},
 [0x208E]={d='on', m=0x208D},
 [0x20A0]={d='et'},
 [0x20A1]={d='et'},
 [0x20A2]={d='et'},
 [0x20A3]={d='et'},
 [0x20A4]={d='et'},
 [0x20A5]={d='et'},
 [0x20A6]={d='et'},
 [0x20A7]={d='et'},
 [0x20A8]={d='et'},
 [0x20A9]={d='et'},
 [0x20AA]={d='et'},
 [0x20AB]={d='et'},
 [0x20AC]={d='et'},
 [0x20AD]={d='et'},
 [0x20AE]={d='et'},
 [0x20AF]={d='et'},
 [0x20B0]={d='et'},
 [0x20B1]={d='et'},
 [0x20B2]={d='et'},
 [0x20B3]={d='et'},
 [0x20B4]={d='et'},
 [0x20B5]={d='et'},
 [0x20B6]={d='et'},
 [0x20B7]={d='et'},
 [0x20B8]={d='et'},
 [0x20B9]={d='et'},
 [0x20BA]={d='et'},
 [0x20BB]={d='et'},
 [0x20BC]={d='et'},
 [0x20BD]={d='et'},
 [0x20BE]={d='et'},
 [0x20D0]={d='nsm'},
 [0x20D1]={d='nsm'},
 [0x20D2]={d='nsm'},
 [0x20D3]={d='nsm'},
 [0x20D4]={d='nsm'},
 [0x20D5]={d='nsm'},
 [0x20D6]={d='nsm'},
 [0x20D7]={d='nsm'},
 [0x20D8]={d='nsm'},
 [0x20D9]={d='nsm'},
 [0x20DA]={d='nsm'},
 [0x20DB]={d='nsm'},
 [0x20DC]={d='nsm'},
 [0x20DD]={d='nsm'},
 [0x20DE]={d='nsm'},
 [0x20DF]={d='nsm'},
 [0x20E0]={d='nsm'},
 [0x20E1]={d='nsm'},
 [0x20E2]={d='nsm'},
 [0x20E3]={d='nsm'},
 [0x20E4]={d='nsm'},
 [0x20E5]={d='nsm'},
 [0x20E6]={d='nsm'},
 [0x20E7]={d='nsm'},
 [0x20E8]={d='nsm'},
 [0x20E9]={d='nsm'},
 [0x20EA]={d='nsm'},
 [0x20EB]={d='nsm'},
 [0x20EC]={d='nsm'},
 [0x20ED]={d='nsm'},
 [0x20EE]={d='nsm'},
 [0x20EF]={d='nsm'},
 [0x20F0]={d='nsm'},
 [0x2100]={d='on'},
 [0x2101]={d='on'},
 [0x2103]={d='on'},
 [0x2104]={d='on'},
 [0x2105]={d='on'},
 [0x2106]={d='on'},
 [0x2108]={d='on'},
 [0x2109]={d='on'},
 [0x2114]={d='on'},
 [0x2116]={d='on'},
 [0x2117]={d='on'},
 [0x2118]={d='on'},
 [0x211E]={d='on'},
 [0x211F]={d='on'},
 [0x2120]={d='on'},
 [0x2121]={d='on'},
 [0x2122]={d='on'},
 [0x2123]={d='on'},
 [0x2125]={d='on'},
 [0x2127]={d='on'},
 [0x2129]={d='on'},
 [0x212E]={d='et'},
 [0x213A]={d='on'},
 [0x213B]={d='on'},
 [0x2140]={d='on'},
 [0x2141]={d='on'},
 [0x2142]={d='on'},
 [0x2143]={d='on'},
 [0x2144]={d='on'},
 [0x214A]={d='on'},
 [0x214B]={d='on'},
 [0x214C]={d='on'},
 [0x214D]={d='on'},
 [0x2150]={d='on'},
 [0x2151]={d='on'},
 [0x2152]={d='on'},
 [0x2153]={d='on'},
 [0x2154]={d='on'},
 [0x2155]={d='on'},
 [0x2156]={d='on'},
 [0x2157]={d='on'},
 [0x2158]={d='on'},
 [0x2159]={d='on'},
 [0x215A]={d='on'},
 [0x215B]={d='on'},
 [0x215C]={d='on'},
 [0x215D]={d='on'},
 [0x215E]={d='on'},
 [0x215F]={d='on'},
 [0x2189]={d='on'},
 [0x218A]={d='on'},
 [0x218B]={d='on'},
 [0x2190]={d='on'},
 [0x2191]={d='on'},
 [0x2192]={d='on'},
 [0x2193]={d='on'},
 [0x2194]={d='on'},
 [0x2195]={d='on'},
 [0x2196]={d='on'},
 [0x2197]={d='on'},
 [0x2198]={d='on'},
 [0x2199]={d='on'},
 [0x219A]={d='on'},
 [0x219B]={d='on'},
 [0x219C]={d='on'},
 [0x219D]={d='on'},
 [0x219E]={d='on'},
 [0x219F]={d='on'},
 [0x21A0]={d='on'},
 [0x21A1]={d='on'},
 [0x21A2]={d='on'},
 [0x21A3]={d='on'},
 [0x21A4]={d='on'},
 [0x21A5]={d='on'},
 [0x21A6]={d='on'},
 [0x21A7]={d='on'},
 [0x21A8]={d='on'},
 [0x21A9]={d='on'},
 [0x21AA]={d='on'},
 [0x21AB]={d='on'},
 [0x21AC]={d='on'},
 [0x21AD]={d='on'},
 [0x21AE]={d='on'},
 [0x21AF]={d='on'},
 [0x21B0]={d='on'},
 [0x21B1]={d='on'},
 [0x21B2]={d='on'},
 [0x21B3]={d='on'},
 [0x21B4]={d='on'},
 [0x21B5]={d='on'},
 [0x21B6]={d='on'},
 [0x21B7]={d='on'},
 [0x21B8]={d='on'},
 [0x21B9]={d='on'},
 [0x21BA]={d='on'},
 [0x21BB]={d='on'},
 [0x21BC]={d='on'},
 [0x21BD]={d='on'},
 [0x21BE]={d='on'},
 [0x21BF]={d='on'},
 [0x21C0]={d='on'},
 [0x21C1]={d='on'},
 [0x21C2]={d='on'},
 [0x21C3]={d='on'},
 [0x21C4]={d='on'},
 [0x21C5]={d='on'},
 [0x21C6]={d='on'},
 [0x21C7]={d='on'},
 [0x21C8]={d='on'},
 [0x21C9]={d='on'},
 [0x21CA]={d='on'},
 [0x21CB]={d='on'},
 [0x21CC]={d='on'},
 [0x21CD]={d='on'},
 [0x21CE]={d='on'},
 [0x21CF]={d='on'},
 [0x21D0]={d='on'},
 [0x21D1]={d='on'},
 [0x21D2]={d='on'},
 [0x21D3]={d='on'},
 [0x21D4]={d='on'},
 [0x21D5]={d='on'},
 [0x21D6]={d='on'},
 [0x21D7]={d='on'},
 [0x21D8]={d='on'},
 [0x21D9]={d='on'},
 [0x21DA]={d='on'},
 [0x21DB]={d='on'},
 [0x21DC]={d='on'},
 [0x21DD]={d='on'},
 [0x21DE]={d='on'},
 [0x21DF]={d='on'},
 [0x21E0]={d='on'},
 [0x21E1]={d='on'},
 [0x21E2]={d='on'},
 [0x21E3]={d='on'},
 [0x21E4]={d='on'},
 [0x21E5]={d='on'},
 [0x21E6]={d='on'},
 [0x21E7]={d='on'},
 [0x21E8]={d='on'},
 [0x21E9]={d='on'},
 [0x21EA]={d='on'},
 [0x21EB]={d='on'},
 [0x21EC]={d='on'},
 [0x21ED]={d='on'},
 [0x21EE]={d='on'},
 [0x21EF]={d='on'},
 [0x21F0]={d='on'},
 [0x21F1]={d='on'},
 [0x21F2]={d='on'},
 [0x21F3]={d='on'},
 [0x21F4]={d='on'},
 [0x21F5]={d='on'},
 [0x21F6]={d='on'},
 [0x21F7]={d='on'},
 [0x21F8]={d='on'},
 [0x21F9]={d='on'},
 [0x21FA]={d='on'},
 [0x21FB]={d='on'},
 [0x21FC]={d='on'},
 [0x21FD]={d='on'},
 [0x21FE]={d='on'},
 [0x21FF]={d='on'},
 [0x2200]={d='on'},
 [0x2201]={d='on'},
 [0x2202]={d='on'},
 [0x2203]={d='on'},
 [0x2204]={d='on'},
 [0x2205]={d='on'},
 [0x2206]={d='on'},
 [0x2207]={d='on'},
 [0x2208]={d='on', m=0x220B},
 [0x2209]={d='on', m=0x220C},
 [0x220A]={d='on', m=0x220D},
 [0x220B]={d='on', m=0x2208},
 [0x220C]={d='on', m=0x2209},
 [0x220D]={d='on', m=0x220A},
 [0x220E]={d='on'},
 [0x220F]={d='on'},
 [0x2210]={d='on'},
 [0x2211]={d='on'},
 [0x2212]={d='es'},
 [0x2213]={d='et'},
 [0x2214]={d='on'},
 [0x2215]={d='on', m=0x29F5},
 [0x2216]={d='on'},
 [0x2217]={d='on'},
 [0x2218]={d='on'},
 [0x2219]={d='on'},
 [0x221A]={d='on'},
 [0x221B]={d='on'},
 [0x221C]={d='on'},
 [0x221D]={d='on'},
 [0x221E]={d='on'},
 [0x221F]={d='on'},
 [0x2220]={d='on'},
 [0x2221]={d='on'},
 [0x2222]={d='on'},
 [0x2223]={d='on'},
 [0x2224]={d='on'},
 [0x2225]={d='on'},
 [0x2226]={d='on'},
 [0x2227]={d='on'},
 [0x2228]={d='on'},
 [0x2229]={d='on'},
 [0x222A]={d='on'},
 [0x222B]={d='on'},
 [0x222C]={d='on'},
 [0x222D]={d='on'},
 [0x222E]={d='on'},
 [0x222F]={d='on'},
 [0x2230]={d='on'},
 [0x2231]={d='on'},
 [0x2232]={d='on'},
 [0x2233]={d='on'},
 [0x2234]={d='on'},
 [0x2235]={d='on'},
 [0x2236]={d='on'},
 [0x2237]={d='on'},
 [0x2238]={d='on'},
 [0x2239]={d='on'},
 [0x223A]={d='on'},
 [0x223B]={d='on'},
 [0x223C]={d='on', m=0x223D},
 [0x223D]={d='on', m=0x223C},
 [0x223E]={d='on'},
 [0x223F]={d='on'},
 [0x2240]={d='on'},
 [0x2241]={d='on'},
 [0x2242]={d='on'},
 [0x2243]={d='on', m=0x22CD},
 [0x2244]={d='on'},
 [0x2245]={d='on'},
 [0x2246]={d='on'},
 [0x2247]={d='on'},
 [0x2248]={d='on'},
 [0x2249]={d='on'},
 [0x224A]={d='on'},
 [0x224B]={d='on'},
 [0x224C]={d='on'},
 [0x224D]={d='on'},
 [0x224E]={d='on'},
 [0x224F]={d='on'},
 [0x2250]={d='on'},
 [0x2251]={d='on'},
 [0x2252]={d='on', m=0x2253},
 [0x2253]={d='on', m=0x2252},
 [0x2254]={d='on', m=0x2255},
 [0x2255]={d='on', m=0x2254},
 [0x2256]={d='on'},
 [0x2257]={d='on'},
 [0x2258]={d='on'},
 [0x2259]={d='on'},
 [0x225A]={d='on'},
 [0x225B]={d='on'},
 [0x225C]={d='on'},
 [0x225D]={d='on'},
 [0x225E]={d='on'},
 [0x225F]={d='on'},
 [0x2260]={d='on'},
 [0x2261]={d='on'},
 [0x2262]={d='on'},
 [0x2263]={d='on'},
 [0x2264]={d='on', m=0x2265},
 [0x2265]={d='on', m=0x2264},
 [0x2266]={d='on', m=0x2267},
 [0x2267]={d='on', m=0x2266},
 [0x2268]={d='on', m=0x2269},
 [0x2269]={d='on', m=0x2268},
 [0x226A]={d='on', m=0x226B},
 [0x226B]={d='on', m=0x226A},
 [0x226C]={d='on'},
 [0x226D]={d='on'},
 [0x226E]={d='on', m=0x226F},
 [0x226F]={d='on', m=0x226E},
 [0x2270]={d='on', m=0x2271},
 [0x2271]={d='on', m=0x2270},
 [0x2272]={d='on', m=0x2273},
 [0x2273]={d='on', m=0x2272},
 [0x2274]={d='on', m=0x2275},
 [0x2275]={d='on', m=0x2274},
 [0x2276]={d='on', m=0x2277},
 [0x2277]={d='on', m=0x2276},
 [0x2278]={d='on', m=0x2279},
 [0x2279]={d='on', m=0x2278},
 [0x227A]={d='on', m=0x227B},
 [0x227B]={d='on', m=0x227A},
 [0x227C]={d='on', m=0x227D},
 [0x227D]={d='on', m=0x227C},
 [0x227E]={d='on', m=0x227F},
 [0x227F]={d='on', m=0x227E},
 [0x2280]={d='on', m=0x2281},
 [0x2281]={d='on', m=0x2280},
 [0x2282]={d='on', m=0x2283},
 [0x2283]={d='on', m=0x2282},
 [0x2284]={d='on', m=0x2285},
 [0x2285]={d='on', m=0x2284},
 [0x2286]={d='on', m=0x2287},
 [0x2287]={d='on', m=0x2286},
 [0x2288]={d='on', m=0x2289},
 [0x2289]={d='on', m=0x2288},
 [0x228A]={d='on', m=0x228B},
 [0x228B]={d='on', m=0x228A},
 [0x228C]={d='on'},
 [0x228D]={d='on'},
 [0x228E]={d='on'},
 [0x228F]={d='on', m=0x2290},
 [0x2290]={d='on', m=0x228F},
 [0x2291]={d='on', m=0x2292},
 [0x2292]={d='on', m=0x2291},
 [0x2293]={d='on'},
 [0x2294]={d='on'},
 [0x2295]={d='on'},
 [0x2296]={d='on'},
 [0x2297]={d='on'},
 [0x2298]={d='on', m=0x29B8},
 [0x2299]={d='on'},
 [0x229A]={d='on'},
 [0x229B]={d='on'},
 [0x229C]={d='on'},
 [0x229D]={d='on'},
 [0x229E]={d='on'},
 [0x229F]={d='on'},
 [0x22A0]={d='on'},
 [0x22A1]={d='on'},
 [0x22A2]={d='on', m=0x22A3},
 [0x22A3]={d='on', m=0x22A2},
 [0x22A4]={d='on'},
 [0x22A5]={d='on'},
 [0x22A6]={d='on', m=0x2ADE},
 [0x22A7]={d='on'},
 [0x22A8]={d='on', m=0x2AE4},
 [0x22A9]={d='on', m=0x2AE3},
 [0x22AA]={d='on'},
 [0x22AB]={d='on', m=0x2AE5},
 [0x22AC]={d='on'},
 [0x22AD]={d='on'},
 [0x22AE]={d='on'},
 [0x22AF]={d='on'},
 [0x22B0]={d='on', m=0x22B1},
 [0x22B1]={d='on', m=0x22B0},
 [0x22B2]={d='on', m=0x22B3},
 [0x22B3]={d='on', m=0x22B2},
 [0x22B4]={d='on', m=0x22B5},
 [0x22B5]={d='on', m=0x22B4},
 [0x22B6]={d='on', m=0x22B7},
 [0x22B7]={d='on', m=0x22B6},
 [0x22B8]={d='on'},
 [0x22B9]={d='on'},
 [0x22BA]={d='on'},
 [0x22BB]={d='on'},
 [0x22BC]={d='on'},
 [0x22BD]={d='on'},
 [0x22BE]={d='on'},
 [0x22BF]={d='on'},
 [0x22C0]={d='on'},
 [0x22C1]={d='on'},
 [0x22C2]={d='on'},
 [0x22C3]={d='on'},
 [0x22C4]={d='on'},
 [0x22C5]={d='on'},
 [0x22C6]={d='on'},
 [0x22C7]={d='on'},
 [0x22C8]={d='on'},
 [0x22C9]={d='on', m=0x22CA},
 [0x22CA]={d='on', m=0x22C9},
 [0x22CB]={d='on', m=0x22CC},
 [0x22CC]={d='on', m=0x22CB},
 [0x22CD]={d='on', m=0x2243},
 [0x22CE]={d='on'},
 [0x22CF]={d='on'},
 [0x22D0]={d='on', m=0x22D1},
 [0x22D1]={d='on', m=0x22D0},
 [0x22D2]={d='on'},
 [0x22D3]={d='on'},
 [0x22D4]={d='on'},
 [0x22D5]={d='on'},
 [0x22D6]={d='on', m=0x22D7},
 [0x22D7]={d='on', m=0x22D6},
 [0x22D8]={d='on', m=0x22D9},
 [0x22D9]={d='on', m=0x22D8},
 [0x22DA]={d='on', m=0x22DB},
 [0x22DB]={d='on', m=0x22DA},
 [0x22DC]={d='on', m=0x22DD},
 [0x22DD]={d='on', m=0x22DC},
 [0x22DE]={d='on', m=0x22DF},
 [0x22DF]={d='on', m=0x22DE},
 [0x22E0]={d='on', m=0x22E1},
 [0x22E1]={d='on', m=0x22E0},
 [0x22E2]={d='on', m=0x22E3},
 [0x22E3]={d='on', m=0x22E2},
 [0x22E4]={d='on', m=0x22E5},
 [0x22E5]={d='on', m=0x22E4},
 [0x22E6]={d='on', m=0x22E7},
 [0x22E7]={d='on', m=0x22E6},
 [0x22E8]={d='on', m=0x22E9},
 [0x22E9]={d='on', m=0x22E8},
 [0x22EA]={d='on', m=0x22EB},
 [0x22EB]={d='on', m=0x22EA},
 [0x22EC]={d='on', m=0x22ED},
 [0x22ED]={d='on', m=0x22EC},
 [0x22EE]={d='on'},
 [0x22EF]={d='on'},
 [0x22F0]={d='on', m=0x22F1},
 [0x22F1]={d='on', m=0x22F0},
 [0x22F2]={d='on', m=0x22FA},
 [0x22F3]={d='on', m=0x22FB},
 [0x22F4]={d='on', m=0x22FC},
 [0x22F5]={d='on'},
 [0x22F6]={d='on', m=0x22FD},
 [0x22F7]={d='on', m=0x22FE},
 [0x22F8]={d='on'},
 [0x22F9]={d='on'},
 [0x22FA]={d='on', m=0x22F2},
 [0x22FB]={d='on', m=0x22F3},
 [0x22FC]={d='on', m=0x22F4},
 [0x22FD]={d='on', m=0x22F6},
 [0x22FE]={d='on', m=0x22F7},
 [0x22FF]={d='on'},
 [0x2300]={d='on'},
 [0x2301]={d='on'},
 [0x2302]={d='on'},
 [0x2303]={d='on'},
 [0x2304]={d='on'},
 [0x2305]={d='on'},
 [0x2306]={d='on'},
 [0x2307]={d='on'},
 [0x2308]={d='on', m=0x2309},
 [0x2309]={d='on', m=0x2308},
 [0x230A]={d='on', m=0x230B},
 [0x230B]={d='on', m=0x230A},
 [0x230C]={d='on'},
 [0x230D]={d='on'},
 [0x230E]={d='on'},
 [0x230F]={d='on'},
 [0x2310]={d='on'},
 [0x2311]={d='on'},
 [0x2312]={d='on'},
 [0x2313]={d='on'},
 [0x2314]={d='on'},
 [0x2315]={d='on'},
 [0x2316]={d='on'},
 [0x2317]={d='on'},
 [0x2318]={d='on'},
 [0x2319]={d='on'},
 [0x231A]={d='on'},
 [0x231B]={d='on'},
 [0x231C]={d='on'},
 [0x231D]={d='on'},
 [0x231E]={d='on'},
 [0x231F]={d='on'},
 [0x2320]={d='on'},
 [0x2321]={d='on'},
 [0x2322]={d='on'},
 [0x2323]={d='on'},
 [0x2324]={d='on'},
 [0x2325]={d='on'},
 [0x2326]={d='on'},
 [0x2327]={d='on'},
 [0x2328]={d='on'},
 [0x2329]={d='on', m=0x232A},
 [0x232A]={d='on', m=0x2329},
 [0x232B]={d='on'},
 [0x232C]={d='on'},
 [0x232D]={d='on'},
 [0x232E]={d='on'},
 [0x232F]={d='on'},
 [0x2330]={d='on'},
 [0x2331]={d='on'},
 [0x2332]={d='on'},
 [0x2333]={d='on'},
 [0x2334]={d='on'},
 [0x2335]={d='on'},
 [0x237B]={d='on'},
 [0x237C]={d='on'},
 [0x237D]={d='on'},
 [0x237E]={d='on'},
 [0x237F]={d='on'},
 [0x2380]={d='on'},
 [0x2381]={d='on'},
 [0x2382]={d='on'},
 [0x2383]={d='on'},
 [0x2384]={d='on'},
 [0x2385]={d='on'},
 [0x2386]={d='on'},
 [0x2387]={d='on'},
 [0x2388]={d='on'},
 [0x2389]={d='on'},
 [0x238A]={d='on'},
 [0x238B]={d='on'},
 [0x238C]={d='on'},
 [0x238D]={d='on'},
 [0x238E]={d='on'},
 [0x238F]={d='on'},
 [0x2390]={d='on'},
 [0x2391]={d='on'},
 [0x2392]={d='on'},
 [0x2393]={d='on'},
 [0x2394]={d='on'},
 [0x2396]={d='on'},
 [0x2397]={d='on'},
 [0x2398]={d='on'},
 [0x2399]={d='on'},
 [0x239A]={d='on'},
 [0x239B]={d='on'},
 [0x239C]={d='on'},
 [0x239D]={d='on'},
 [0x239E]={d='on'},
 [0x239F]={d='on'},
 [0x23A0]={d='on'},
 [0x23A1]={d='on'},
 [0x23A2]={d='on'},
 [0x23A3]={d='on'},
 [0x23A4]={d='on'},
 [0x23A5]={d='on'},
 [0x23A6]={d='on'},
 [0x23A7]={d='on'},
 [0x23A8]={d='on'},
 [0x23A9]={d='on'},
 [0x23AA]={d='on'},
 [0x23AB]={d='on'},
 [0x23AC]={d='on'},
 [0x23AD]={d='on'},
 [0x23AE]={d='on'},
 [0x23AF]={d='on'},
 [0x23B0]={d='on'},
 [0x23B1]={d='on'},
 [0x23B2]={d='on'},
 [0x23B3]={d='on'},
 [0x23B4]={d='on'},
 [0x23B5]={d='on'},
 [0x23B6]={d='on'},
 [0x23B7]={d='on'},
 [0x23B8]={d='on'},
 [0x23B9]={d='on'},
 [0x23BA]={d='on'},
 [0x23BB]={d='on'},
 [0x23BC]={d='on'},
 [0x23BD]={d='on'},
 [0x23BE]={d='on'},
 [0x23BF]={d='on'},
 [0x23C0]={d='on'},
 [0x23C1]={d='on'},
 [0x23C2]={d='on'},
 [0x23C3]={d='on'},
 [0x23C4]={d='on'},
 [0x23C5]={d='on'},
 [0x23C6]={d='on'},
 [0x23C7]={d='on'},
 [0x23C8]={d='on'},
 [0x23C9]={d='on'},
 [0x23CA]={d='on'},
 [0x23CB]={d='on'},
 [0x23CC]={d='on'},
 [0x23CD]={d='on'},
 [0x23CE]={d='on'},
 [0x23CF]={d='on'},
 [0x23D0]={d='on'},
 [0x23D1]={d='on'},
 [0x23D2]={d='on'},
 [0x23D3]={d='on'},
 [0x23D4]={d='on'},
 [0x23D5]={d='on'},
 [0x23D6]={d='on'},
 [0x23D7]={d='on'},
 [0x23D8]={d='on'},
 [0x23D9]={d='on'},
 [0x23DA]={d='on'},
 [0x23DB]={d='on'},
 [0x23DC]={d='on'},
 [0x23DD]={d='on'},
 [0x23DE]={d='on'},
 [0x23DF]={d='on'},
 [0x23E0]={d='on'},
 [0x23E1]={d='on'},
 [0x23E2]={d='on'},
 [0x23E3]={d='on'},
 [0x23E4]={d='on'},
 [0x23E5]={d='on'},
 [0x23E6]={d='on'},
 [0x23E7]={d='on'},
 [0x23E8]={d='on'},
 [0x23E9]={d='on'},
 [0x23EA]={d='on'},
 [0x23EB]={d='on'},
 [0x23EC]={d='on'},
 [0x23ED]={d='on'},
 [0x23EE]={d='on'},
 [0x23EF]={d='on'},
 [0x23F0]={d='on'},
 [0x23F1]={d='on'},
 [0x23F2]={d='on'},
 [0x23F3]={d='on'},
 [0x23F4]={d='on'},
 [0x23F5]={d='on'},
 [0x23F6]={d='on'},
 [0x23F7]={d='on'},
 [0x23F8]={d='on'},
 [0x23F9]={d='on'},
 [0x23FA]={d='on'},
 [0x23FB]={d='on'},
 [0x23FC]={d='on'},
 [0x23FD]={d='on'},
 [0x23FE]={d='on'},
 [0x2400]={d='on'},
 [0x2401]={d='on'},
 [0x2402]={d='on'},
 [0x2403]={d='on'},
 [0x2404]={d='on'},
 [0x2405]={d='on'},
 [0x2406]={d='on'},
 [0x2407]={d='on'},
 [0x2408]={d='on'},
 [0x2409]={d='on'},
 [0x240A]={d='on'},
 [0x240B]={d='on'},
 [0x240C]={d='on'},
 [0x240D]={d='on'},
 [0x240E]={d='on'},
 [0x240F]={d='on'},
 [0x2410]={d='on'},
 [0x2411]={d='on'},
 [0x2412]={d='on'},
 [0x2413]={d='on'},
 [0x2414]={d='on'},
 [0x2415]={d='on'},
 [0x2416]={d='on'},
 [0x2417]={d='on'},
 [0x2418]={d='on'},
 [0x2419]={d='on'},
 [0x241A]={d='on'},
 [0x241B]={d='on'},
 [0x241C]={d='on'},
 [0x241D]={d='on'},
 [0x241E]={d='on'},
 [0x241F]={d='on'},
 [0x2420]={d='on'},
 [0x2421]={d='on'},
 [0x2422]={d='on'},
 [0x2423]={d='on'},
 [0x2424]={d='on'},
 [0x2425]={d='on'},
 [0x2426]={d='on'},
 [0x2440]={d='on'},
 [0x2441]={d='on'},
 [0x2442]={d='on'},
 [0x2443]={d='on'},
 [0x2444]={d='on'},
 [0x2445]={d='on'},
 [0x2446]={d='on'},
 [0x2447]={d='on'},
 [0x2448]={d='on'},
 [0x2449]={d='on'},
 [0x244A]={d='on'},
 [0x2460]={d='on'},
 [0x2461]={d='on'},
 [0x2462]={d='on'},
 [0x2463]={d='on'},
 [0x2464]={d='on'},
 [0x2465]={d='on'},
 [0x2466]={d='on'},
 [0x2467]={d='on'},
 [0x2468]={d='on'},
 [0x2469]={d='on'},
 [0x246A]={d='on'},
 [0x246B]={d='on'},
 [0x246C]={d='on'},
 [0x246D]={d='on'},
 [0x246E]={d='on'},
 [0x246F]={d='on'},
 [0x2470]={d='on'},
 [0x2471]={d='on'},
 [0x2472]={d='on'},
 [0x2473]={d='on'},
 [0x2474]={d='on'},
 [0x2475]={d='on'},
 [0x2476]={d='on'},
 [0x2477]={d='on'},
 [0x2478]={d='on'},
 [0x2479]={d='on'},
 [0x247A]={d='on'},
 [0x247B]={d='on'},
 [0x247C]={d='on'},
 [0x247D]={d='on'},
 [0x247E]={d='on'},
 [0x247F]={d='on'},
 [0x2480]={d='on'},
 [0x2481]={d='on'},
 [0x2482]={d='on'},
 [0x2483]={d='on'},
 [0x2484]={d='on'},
 [0x2485]={d='on'},
 [0x2486]={d='on'},
 [0x2487]={d='on'},
 [0x2488]={d='en'},
 [0x2489]={d='en'},
 [0x248A]={d='en'},
 [0x248B]={d='en'},
 [0x248C]={d='en'},
 [0x248D]={d='en'},
 [0x248E]={d='en'},
 [0x248F]={d='en'},
 [0x2490]={d='en'},
 [0x2491]={d='en'},
 [0x2492]={d='en'},
 [0x2493]={d='en'},
 [0x2494]={d='en'},
 [0x2495]={d='en'},
 [0x2496]={d='en'},
 [0x2497]={d='en'},
 [0x2498]={d='en'},
 [0x2499]={d='en'},
 [0x249A]={d='en'},
 [0x249B]={d='en'},
 [0x24EA]={d='on'},
 [0x24EB]={d='on'},
 [0x24EC]={d='on'},
 [0x24ED]={d='on'},
 [0x24EE]={d='on'},
 [0x24EF]={d='on'},
 [0x24F0]={d='on'},
 [0x24F1]={d='on'},
 [0x24F2]={d='on'},
 [0x24F3]={d='on'},
 [0x24F4]={d='on'},
 [0x24F5]={d='on'},
 [0x24F6]={d='on'},
 [0x24F7]={d='on'},
 [0x24F8]={d='on'},
 [0x24F9]={d='on'},
 [0x24FA]={d='on'},
 [0x24FB]={d='on'},
 [0x24FC]={d='on'},
 [0x24FD]={d='on'},
 [0x24FE]={d='on'},
 [0x24FF]={d='on'},
 [0x2500]={d='on'},
 [0x2501]={d='on'},
 [0x2502]={d='on'},
 [0x2503]={d='on'},
 [0x2504]={d='on'},
 [0x2505]={d='on'},
 [0x2506]={d='on'},
 [0x2507]={d='on'},
 [0x2508]={d='on'},
 [0x2509]={d='on'},
 [0x250A]={d='on'},
 [0x250B]={d='on'},
 [0x250C]={d='on'},
 [0x250D]={d='on'},
 [0x250E]={d='on'},
 [0x250F]={d='on'},
 [0x2510]={d='on'},
 [0x2511]={d='on'},
 [0x2512]={d='on'},
 [0x2513]={d='on'},
 [0x2514]={d='on'},
 [0x2515]={d='on'},
 [0x2516]={d='on'},
 [0x2517]={d='on'},
 [0x2518]={d='on'},
 [0x2519]={d='on'},
 [0x251A]={d='on'},
 [0x251B]={d='on'},
 [0x251C]={d='on'},
 [0x251D]={d='on'},
 [0x251E]={d='on'},
 [0x251F]={d='on'},
 [0x2520]={d='on'},
 [0x2521]={d='on'},
 [0x2522]={d='on'},
 [0x2523]={d='on'},
 [0x2524]={d='on'},
 [0x2525]={d='on'},
 [0x2526]={d='on'},
 [0x2527]={d='on'},
 [0x2528]={d='on'},
 [0x2529]={d='on'},
 [0x252A]={d='on'},
 [0x252B]={d='on'},
 [0x252C]={d='on'},
 [0x252D]={d='on'},
 [0x252E]={d='on'},
 [0x252F]={d='on'},
 [0x2530]={d='on'},
 [0x2531]={d='on'},
 [0x2532]={d='on'},
 [0x2533]={d='on'},
 [0x2534]={d='on'},
 [0x2535]={d='on'},
 [0x2536]={d='on'},
 [0x2537]={d='on'},
 [0x2538]={d='on'},
 [0x2539]={d='on'},
 [0x253A]={d='on'},
 [0x253B]={d='on'},
 [0x253C]={d='on'},
 [0x253D]={d='on'},
 [0x253E]={d='on'},
 [0x253F]={d='on'},
 [0x2540]={d='on'},
 [0x2541]={d='on'},
 [0x2542]={d='on'},
 [0x2543]={d='on'},
 [0x2544]={d='on'},
 [0x2545]={d='on'},
 [0x2546]={d='on'},
 [0x2547]={d='on'},
 [0x2548]={d='on'},
 [0x2549]={d='on'},
 [0x254A]={d='on'},
 [0x254B]={d='on'},
 [0x254C]={d='on'},
 [0x254D]={d='on'},
 [0x254E]={d='on'},
 [0x254F]={d='on'},
 [0x2550]={d='on'},
 [0x2551]={d='on'},
 [0x2552]={d='on'},
 [0x2553]={d='on'},
 [0x2554]={d='on'},
 [0x2555]={d='on'},
 [0x2556]={d='on'},
 [0x2557]={d='on'},
 [0x2558]={d='on'},
 [0x2559]={d='on'},
 [0x255A]={d='on'},
 [0x255B]={d='on'},
 [0x255C]={d='on'},
 [0x255D]={d='on'},
 [0x255E]={d='on'},
 [0x255F]={d='on'},
 [0x2560]={d='on'},
 [0x2561]={d='on'},
 [0x2562]={d='on'},
 [0x2563]={d='on'},
 [0x2564]={d='on'},
 [0x2565]={d='on'},
 [0x2566]={d='on'},
 [0x2567]={d='on'},
 [0x2568]={d='on'},
 [0x2569]={d='on'},
 [0x256A]={d='on'},
 [0x256B]={d='on'},
 [0x256C]={d='on'},
 [0x256D]={d='on'},
 [0x256E]={d='on'},
 [0x256F]={d='on'},
 [0x2570]={d='on'},
 [0x2571]={d='on'},
 [0x2572]={d='on'},
 [0x2573]={d='on'},
 [0x2574]={d='on'},
 [0x2575]={d='on'},
 [0x2576]={d='on'},
 [0x2577]={d='on'},
 [0x2578]={d='on'},
 [0x2579]={d='on'},
 [0x257A]={d='on'},
 [0x257B]={d='on'},
 [0x257C]={d='on'},
 [0x257D]={d='on'},
 [0x257E]={d='on'},
 [0x257F]={d='on'},
 [0x2580]={d='on'},
 [0x2581]={d='on'},
 [0x2582]={d='on'},
 [0x2583]={d='on'},
 [0x2584]={d='on'},
 [0x2585]={d='on'},
 [0x2586]={d='on'},
 [0x2587]={d='on'},
 [0x2588]={d='on'},
 [0x2589]={d='on'},
 [0x258A]={d='on'},
 [0x258B]={d='on'},
 [0x258C]={d='on'},
 [0x258D]={d='on'},
 [0x258E]={d='on'},
 [0x258F]={d='on'},
 [0x2590]={d='on'},
 [0x2591]={d='on'},
 [0x2592]={d='on'},
 [0x2593]={d='on'},
 [0x2594]={d='on'},
 [0x2595]={d='on'},
 [0x2596]={d='on'},
 [0x2597]={d='on'},
 [0x2598]={d='on'},
 [0x2599]={d='on'},
 [0x259A]={d='on'},
 [0x259B]={d='on'},
 [0x259C]={d='on'},
 [0x259D]={d='on'},
 [0x259E]={d='on'},
 [0x259F]={d='on'},
 [0x25A0]={d='on'},
 [0x25A1]={d='on'},
 [0x25A2]={d='on'},
 [0x25A3]={d='on'},
 [0x25A4]={d='on'},
 [0x25A5]={d='on'},
 [0x25A6]={d='on'},
 [0x25A7]={d='on'},
 [0x25A8]={d='on'},
 [0x25A9]={d='on'},
 [0x25AA]={d='on'},
 [0x25AB]={d='on'},
 [0x25AC]={d='on'},
 [0x25AD]={d='on'},
 [0x25AE]={d='on'},
 [0x25AF]={d='on'},
 [0x25B0]={d='on'},
 [0x25B1]={d='on'},
 [0x25B2]={d='on'},
 [0x25B3]={d='on'},
 [0x25B4]={d='on'},
 [0x25B5]={d='on'},
 [0x25B6]={d='on'},
 [0x25B7]={d='on'},
 [0x25B8]={d='on'},
 [0x25B9]={d='on'},
 [0x25BA]={d='on'},
 [0x25BB]={d='on'},
 [0x25BC]={d='on'},
 [0x25BD]={d='on'},
 [0x25BE]={d='on'},
 [0x25BF]={d='on'},
 [0x25C0]={d='on'},
 [0x25C1]={d='on'},
 [0x25C2]={d='on'},
 [0x25C3]={d='on'},
 [0x25C4]={d='on'},
 [0x25C5]={d='on'},
 [0x25C6]={d='on'},
 [0x25C7]={d='on'},
 [0x25C8]={d='on'},
 [0x25C9]={d='on'},
 [0x25CA]={d='on'},
 [0x25CB]={d='on'},
 [0x25CC]={d='on'},
 [0x25CD]={d='on'},
 [0x25CE]={d='on'},
 [0x25CF]={d='on'},
 [0x25D0]={d='on'},
 [0x25D1]={d='on'},
 [0x25D2]={d='on'},
 [0x25D3]={d='on'},
 [0x25D4]={d='on'},
 [0x25D5]={d='on'},
 [0x25D6]={d='on'},
 [0x25D7]={d='on'},
 [0x25D8]={d='on'},
 [0x25D9]={d='on'},
 [0x25DA]={d='on'},
 [0x25DB]={d='on'},
 [0x25DC]={d='on'},
 [0x25DD]={d='on'},
 [0x25DE]={d='on'},
 [0x25DF]={d='on'},
 [0x25E0]={d='on'},
 [0x25E1]={d='on'},
 [0x25E2]={d='on'},
 [0x25E3]={d='on'},
 [0x25E4]={d='on'},
 [0x25E5]={d='on'},
 [0x25E6]={d='on'},
 [0x25E7]={d='on'},
 [0x25E8]={d='on'},
 [0x25E9]={d='on'},
 [0x25EA]={d='on'},
 [0x25EB]={d='on'},
 [0x25EC]={d='on'},
 [0x25ED]={d='on'},
 [0x25EE]={d='on'},
 [0x25EF]={d='on'},
 [0x25F0]={d='on'},
 [0x25F1]={d='on'},
 [0x25F2]={d='on'},
 [0x25F3]={d='on'},
 [0x25F4]={d='on'},
 [0x25F5]={d='on'},
 [0x25F6]={d='on'},
 [0x25F7]={d='on'},
 [0x25F8]={d='on'},
 [0x25F9]={d='on'},
 [0x25FA]={d='on'},
 [0x25FB]={d='on'},
 [0x25FC]={d='on'},
 [0x25FD]={d='on'},
 [0x25FE]={d='on'},
 [0x25FF]={d='on'},
 [0x2600]={d='on'},
 [0x2601]={d='on'},
 [0x2602]={d='on'},
 [0x2603]={d='on'},
 [0x2604]={d='on'},
 [0x2605]={d='on'},
 [0x2606]={d='on'},
 [0x2607]={d='on'},
 [0x2608]={d='on'},
 [0x2609]={d='on'},
 [0x260A]={d='on'},
 [0x260B]={d='on'},
 [0x260C]={d='on'},
 [0x260D]={d='on'},
 [0x260E]={d='on'},
 [0x260F]={d='on'},
 [0x2610]={d='on'},
 [0x2611]={d='on'},
 [0x2612]={d='on'},
 [0x2613]={d='on'},
 [0x2614]={d='on'},
 [0x2615]={d='on'},
 [0x2616]={d='on'},
 [0x2617]={d='on'},
 [0x2618]={d='on'},
 [0x2619]={d='on'},
 [0x261A]={d='on'},
 [0x261B]={d='on'},
 [0x261C]={d='on'},
 [0x261D]={d='on'},
 [0x261E]={d='on'},
 [0x261F]={d='on'},
 [0x2620]={d='on'},
 [0x2621]={d='on'},
 [0x2622]={d='on'},
 [0x2623]={d='on'},
 [0x2624]={d='on'},
 [0x2625]={d='on'},
 [0x2626]={d='on'},
 [0x2627]={d='on'},
 [0x2628]={d='on'},
 [0x2629]={d='on'},
 [0x262A]={d='on'},
 [0x262B]={d='on'},
 [0x262C]={d='on'},
 [0x262D]={d='on'},
 [0x262E]={d='on'},
 [0x262F]={d='on'},
 [0x2630]={d='on'},
 [0x2631]={d='on'},
 [0x2632]={d='on'},
 [0x2633]={d='on'},
 [0x2634]={d='on'},
 [0x2635]={d='on'},
 [0x2636]={d='on'},
 [0x2637]={d='on'},
 [0x2638]={d='on'},
 [0x2639]={d='on'},
 [0x263A]={d='on'},
 [0x263B]={d='on'},
 [0x263C]={d='on'},
 [0x263D]={d='on'},
 [0x263E]={d='on'},
 [0x263F]={d='on'},
 [0x2640]={d='on'},
 [0x2641]={d='on'},
 [0x2642]={d='on'},
 [0x2643]={d='on'},
 [0x2644]={d='on'},
 [0x2645]={d='on'},
 [0x2646]={d='on'},
 [0x2647]={d='on'},
 [0x2648]={d='on'},
 [0x2649]={d='on'},
 [0x264A]={d='on'},
 [0x264B]={d='on'},
 [0x264C]={d='on'},
 [0x264D]={d='on'},
 [0x264E]={d='on'},
 [0x264F]={d='on'},
 [0x2650]={d='on'},
 [0x2651]={d='on'},
 [0x2652]={d='on'},
 [0x2653]={d='on'},
 [0x2654]={d='on'},
 [0x2655]={d='on'},
 [0x2656]={d='on'},
 [0x2657]={d='on'},
 [0x2658]={d='on'},
 [0x2659]={d='on'},
 [0x265A]={d='on'},
 [0x265B]={d='on'},
 [0x265C]={d='on'},
 [0x265D]={d='on'},
 [0x265E]={d='on'},
 [0x265F]={d='on'},
 [0x2660]={d='on'},
 [0x2661]={d='on'},
 [0x2662]={d='on'},
 [0x2663]={d='on'},
 [0x2664]={d='on'},
 [0x2665]={d='on'},
 [0x2666]={d='on'},
 [0x2667]={d='on'},
 [0x2668]={d='on'},
 [0x2669]={d='on'},
 [0x266A]={d='on'},
 [0x266B]={d='on'},
 [0x266C]={d='on'},
 [0x266D]={d='on'},
 [0x266E]={d='on'},
 [0x266F]={d='on'},
 [0x2670]={d='on'},
 [0x2671]={d='on'},
 [0x2672]={d='on'},
 [0x2673]={d='on'},
 [0x2674]={d='on'},
 [0x2675]={d='on'},
 [0x2676]={d='on'},
 [0x2677]={d='on'},
 [0x2678]={d='on'},
 [0x2679]={d='on'},
 [0x267A]={d='on'},
 [0x267B]={d='on'},
 [0x267C]={d='on'},
 [0x267D]={d='on'},
 [0x267E]={d='on'},
 [0x267F]={d='on'},
 [0x2680]={d='on'},
 [0x2681]={d='on'},
 [0x2682]={d='on'},
 [0x2683]={d='on'},
 [0x2684]={d='on'},
 [0x2685]={d='on'},
 [0x2686]={d='on'},
 [0x2687]={d='on'},
 [0x2688]={d='on'},
 [0x2689]={d='on'},
 [0x268A]={d='on'},
 [0x268B]={d='on'},
 [0x268C]={d='on'},
 [0x268D]={d='on'},
 [0x268E]={d='on'},
 [0x268F]={d='on'},
 [0x2690]={d='on'},
 [0x2691]={d='on'},
 [0x2692]={d='on'},
 [0x2693]={d='on'},
 [0x2694]={d='on'},
 [0x2695]={d='on'},
 [0x2696]={d='on'},
 [0x2697]={d='on'},
 [0x2698]={d='on'},
 [0x2699]={d='on'},
 [0x269A]={d='on'},
 [0x269B]={d='on'},
 [0x269C]={d='on'},
 [0x269D]={d='on'},
 [0x269E]={d='on'},
 [0x269F]={d='on'},
 [0x26A0]={d='on'},
 [0x26A1]={d='on'},
 [0x26A2]={d='on'},
 [0x26A3]={d='on'},
 [0x26A4]={d='on'},
 [0x26A5]={d='on'},
 [0x26A6]={d='on'},
 [0x26A7]={d='on'},
 [0x26A8]={d='on'},
 [0x26A9]={d='on'},
 [0x26AA]={d='on'},
 [0x26AB]={d='on'},
 [0x26AD]={d='on'},
 [0x26AE]={d='on'},
 [0x26AF]={d='on'},
 [0x26B0]={d='on'},
 [0x26B1]={d='on'},
 [0x26B2]={d='on'},
 [0x26B3]={d='on'},
 [0x26B4]={d='on'},
 [0x26B5]={d='on'},
 [0x26B6]={d='on'},
 [0x26B7]={d='on'},
 [0x26B8]={d='on'},
 [0x26B9]={d='on'},
 [0x26BA]={d='on'},
 [0x26BB]={d='on'},
 [0x26BC]={d='on'},
 [0x26BD]={d='on'},
 [0x26BE]={d='on'},
 [0x26BF]={d='on'},
 [0x26C0]={d='on'},
 [0x26C1]={d='on'},
 [0x26C2]={d='on'},
 [0x26C3]={d='on'},
 [0x26C4]={d='on'},
 [0x26C5]={d='on'},
 [0x26C6]={d='on'},
 [0x26C7]={d='on'},
 [0x26C8]={d='on'},
 [0x26C9]={d='on'},
 [0x26CA]={d='on'},
 [0x26CB]={d='on'},
 [0x26CC]={d='on'},
 [0x26CD]={d='on'},
 [0x26CE]={d='on'},
 [0x26CF]={d='on'},
 [0x26D0]={d='on'},
 [0x26D1]={d='on'},
 [0x26D2]={d='on'},
 [0x26D3]={d='on'},
 [0x26D4]={d='on'},
 [0x26D5]={d='on'},
 [0x26D6]={d='on'},
 [0x26D7]={d='on'},
 [0x26D8]={d='on'},
 [0x26D9]={d='on'},
 [0x26DA]={d='on'},
 [0x26DB]={d='on'},
 [0x26DC]={d='on'},
 [0x26DD]={d='on'},
 [0x26DE]={d='on'},
 [0x26DF]={d='on'},
 [0x26E0]={d='on'},
 [0x26E1]={d='on'},
 [0x26E2]={d='on'},
 [0x26E3]={d='on'},
 [0x26E4]={d='on'},
 [0x26E5]={d='on'},
 [0x26E6]={d='on'},
 [0x26E7]={d='on'},
 [0x26E8]={d='on'},
 [0x26E9]={d='on'},
 [0x26EA]={d='on'},
 [0x26EB]={d='on'},
 [0x26EC]={d='on'},
 [0x26ED]={d='on'},
 [0x26EE]={d='on'},
 [0x26EF]={d='on'},
 [0x26F0]={d='on'},
 [0x26F1]={d='on'},
 [0x26F2]={d='on'},
 [0x26F3]={d='on'},
 [0x26F4]={d='on'},
 [0x26F5]={d='on'},
 [0x26F6]={d='on'},
 [0x26F7]={d='on'},
 [0x26F8]={d='on'},
 [0x26F9]={d='on'},
 [0x26FA]={d='on'},
 [0x26FB]={d='on'},
 [0x26FC]={d='on'},
 [0x26FD]={d='on'},
 [0x26FE]={d='on'},
 [0x26FF]={d='on'},
 [0x2700]={d='on'},
 [0x2701]={d='on'},
 [0x2702]={d='on'},
 [0x2703]={d='on'},
 [0x2704]={d='on'},
 [0x2705]={d='on'},
 [0x2706]={d='on'},
 [0x2707]={d='on'},
 [0x2708]={d='on'},
 [0x2709]={d='on'},
 [0x270A]={d='on'},
 [0x270B]={d='on'},
 [0x270C]={d='on'},
 [0x270D]={d='on'},
 [0x270E]={d='on'},
 [0x270F]={d='on'},
 [0x2710]={d='on'},
 [0x2711]={d='on'},
 [0x2712]={d='on'},
 [0x2713]={d='on'},
 [0x2714]={d='on'},
 [0x2715]={d='on'},
 [0x2716]={d='on'},
 [0x2717]={d='on'},
 [0x2718]={d='on'},
 [0x2719]={d='on'},
 [0x271A]={d='on'},
 [0x271B]={d='on'},
 [0x271C]={d='on'},
 [0x271D]={d='on'},
 [0x271E]={d='on'},
 [0x271F]={d='on'},
 [0x2720]={d='on'},
 [0x2721]={d='on'},
 [0x2722]={d='on'},
 [0x2723]={d='on'},
 [0x2724]={d='on'},
 [0x2725]={d='on'},
 [0x2726]={d='on'},
 [0x2727]={d='on'},
 [0x2728]={d='on'},
 [0x2729]={d='on'},
 [0x272A]={d='on'},
 [0x272B]={d='on'},
 [0x272C]={d='on'},
 [0x272D]={d='on'},
 [0x272E]={d='on'},
 [0x272F]={d='on'},
 [0x2730]={d='on'},
 [0x2731]={d='on'},
 [0x2732]={d='on'},
 [0x2733]={d='on'},
 [0x2734]={d='on'},
 [0x2735]={d='on'},
 [0x2736]={d='on'},
 [0x2737]={d='on'},
 [0x2738]={d='on'},
 [0x2739]={d='on'},
 [0x273A]={d='on'},
 [0x273B]={d='on'},
 [0x273C]={d='on'},
 [0x273D]={d='on'},
 [0x273E]={d='on'},
 [0x273F]={d='on'},
 [0x2740]={d='on'},
 [0x2741]={d='on'},
 [0x2742]={d='on'},
 [0x2743]={d='on'},
 [0x2744]={d='on'},
 [0x2745]={d='on'},
 [0x2746]={d='on'},
 [0x2747]={d='on'},
 [0x2748]={d='on'},
 [0x2749]={d='on'},
 [0x274A]={d='on'},
 [0x274B]={d='on'},
 [0x274C]={d='on'},
 [0x274D]={d='on'},
 [0x274E]={d='on'},
 [0x274F]={d='on'},
 [0x2750]={d='on'},
 [0x2751]={d='on'},
 [0x2752]={d='on'},
 [0x2753]={d='on'},
 [0x2754]={d='on'},
 [0x2755]={d='on'},
 [0x2756]={d='on'},
 [0x2757]={d='on'},
 [0x2758]={d='on'},
 [0x2759]={d='on'},
 [0x275A]={d='on'},
 [0x275B]={d='on'},
 [0x275C]={d='on'},
 [0x275D]={d='on'},
 [0x275E]={d='on'},
 [0x275F]={d='on'},
 [0x2760]={d='on'},
 [0x2761]={d='on'},
 [0x2762]={d='on'},
 [0x2763]={d='on'},
 [0x2764]={d='on'},
 [0x2765]={d='on'},
 [0x2766]={d='on'},
 [0x2767]={d='on'},
 [0x2768]={d='on', m=0x2769},
 [0x2769]={d='on', m=0x2768},
 [0x276A]={d='on', m=0x276B},
 [0x276B]={d='on', m=0x276A},
 [0x276C]={d='on', m=0x276D},
 [0x276D]={d='on', m=0x276C},
 [0x276E]={d='on', m=0x276F},
 [0x276F]={d='on', m=0x276E},
 [0x2770]={d='on', m=0x2771},
 [0x2771]={d='on', m=0x2770},
 [0x2772]={d='on', m=0x2773},
 [0x2773]={d='on', m=0x2772},
 [0x2774]={d='on', m=0x2775},
 [0x2775]={d='on', m=0x2774},
 [0x2776]={d='on'},
 [0x2777]={d='on'},
 [0x2778]={d='on'},
 [0x2779]={d='on'},
 [0x277A]={d='on'},
 [0x277B]={d='on'},
 [0x277C]={d='on'},
 [0x277D]={d='on'},
 [0x277E]={d='on'},
 [0x277F]={d='on'},
 [0x2780]={d='on'},
 [0x2781]={d='on'},
 [0x2782]={d='on'},
 [0x2783]={d='on'},
 [0x2784]={d='on'},
 [0x2785]={d='on'},
 [0x2786]={d='on'},
 [0x2787]={d='on'},
 [0x2788]={d='on'},
 [0x2789]={d='on'},
 [0x278A]={d='on'},
 [0x278B]={d='on'},
 [0x278C]={d='on'},
 [0x278D]={d='on'},
 [0x278E]={d='on'},
 [0x278F]={d='on'},
 [0x2790]={d='on'},
 [0x2791]={d='on'},
 [0x2792]={d='on'},
 [0x2793]={d='on'},
 [0x2794]={d='on'},
 [0x2795]={d='on'},
 [0x2796]={d='on'},
 [0x2797]={d='on'},
 [0x2798]={d='on'},
 [0x2799]={d='on'},
 [0x279A]={d='on'},
 [0x279B]={d='on'},
 [0x279C]={d='on'},
 [0x279D]={d='on'},
 [0x279E]={d='on'},
 [0x279F]={d='on'},
 [0x27A0]={d='on'},
 [0x27A1]={d='on'},
 [0x27A2]={d='on'},
 [0x27A3]={d='on'},
 [0x27A4]={d='on'},
 [0x27A5]={d='on'},
 [0x27A6]={d='on'},
 [0x27A7]={d='on'},
 [0x27A8]={d='on'},
 [0x27A9]={d='on'},
 [0x27AA]={d='on'},
 [0x27AB]={d='on'},
 [0x27AC]={d='on'},
 [0x27AD]={d='on'},
 [0x27AE]={d='on'},
 [0x27AF]={d='on'},
 [0x27B0]={d='on'},
 [0x27B1]={d='on'},
 [0x27B2]={d='on'},
 [0x27B3]={d='on'},
 [0x27B4]={d='on'},
 [0x27B5]={d='on'},
 [0x27B6]={d='on'},
 [0x27B7]={d='on'},
 [0x27B8]={d='on'},
 [0x27B9]={d='on'},
 [0x27BA]={d='on'},
 [0x27BB]={d='on'},
 [0x27BC]={d='on'},
 [0x27BD]={d='on'},
 [0x27BE]={d='on'},
 [0x27BF]={d='on'},
 [0x27C0]={d='on'},
 [0x27C1]={d='on'},
 [0x27C2]={d='on'},
 [0x27C3]={d='on', m=0x27C4},
 [0x27C4]={d='on', m=0x27C3},
 [0x27C5]={d='on', m=0x27C6},
 [0x27C6]={d='on', m=0x27C5},
 [0x27C7]={d='on'},
 [0x27C8]={d='on', m=0x27C9},
 [0x27C9]={d='on', m=0x27C8},
 [0x27CA]={d='on'},
 [0x27CB]={d='on', m=0x27CD},
 [0x27CC]={d='on'},
 [0x27CD]={d='on', m=0x27CB},
 [0x27CE]={d='on'},
 [0x27CF]={d='on'},
 [0x27D0]={d='on'},
 [0x27D1]={d='on'},
 [0x27D2]={d='on'},
 [0x27D3]={d='on'},
 [0x27D4]={d='on'},
 [0x27D5]={d='on', m=0x27D6},
 [0x27D6]={d='on', m=0x27D5},
 [0x27D7]={d='on'},
 [0x27D8]={d='on'},
 [0x27D9]={d='on'},
 [0x27DA]={d='on'},
 [0x27DB]={d='on'},
 [0x27DC]={d='on'},
 [0x27DD]={d='on', m=0x27DE},
 [0x27DE]={d='on', m=0x27DD},
 [0x27DF]={d='on'},
 [0x27E0]={d='on'},
 [0x27E1]={d='on'},
 [0x27E2]={d='on', m=0x27E3},
 [0x27E3]={d='on', m=0x27E2},
 [0x27E4]={d='on', m=0x27E5},
 [0x27E5]={d='on', m=0x27E4},
 [0x27E6]={d='on', m=0x27E7},
 [0x27E7]={d='on', m=0x27E6},
 [0x27E8]={d='on', m=0x27E9},
 [0x27E9]={d='on', m=0x27E8},
 [0x27EA]={d='on', m=0x27EB},
 [0x27EB]={d='on', m=0x27EA},
 [0x27EC]={d='on', m=0x27ED},
 [0x27ED]={d='on', m=0x27EC},
 [0x27EE]={d='on', m=0x27EF},
 [0x27EF]={d='on', m=0x27EE},
 [0x27F0]={d='on'},
 [0x27F1]={d='on'},
 [0x27F2]={d='on'},
 [0x27F3]={d='on'},
 [0x27F4]={d='on'},
 [0x27F5]={d='on'},
 [0x27F6]={d='on'},
 [0x27F7]={d='on'},
 [0x27F8]={d='on'},
 [0x27F9]={d='on'},
 [0x27FA]={d='on'},
 [0x27FB]={d='on'},
 [0x27FC]={d='on'},
 [0x27FD]={d='on'},
 [0x27FE]={d='on'},
 [0x27FF]={d='on'},
 [0x2900]={d='on'},
 [0x2901]={d='on'},
 [0x2902]={d='on'},
 [0x2903]={d='on'},
 [0x2904]={d='on'},
 [0x2905]={d='on'},
 [0x2906]={d='on'},
 [0x2907]={d='on'},
 [0x2908]={d='on'},
 [0x2909]={d='on'},
 [0x290A]={d='on'},
 [0x290B]={d='on'},
 [0x290C]={d='on'},
 [0x290D]={d='on'},
 [0x290E]={d='on'},
 [0x290F]={d='on'},
 [0x2910]={d='on'},
 [0x2911]={d='on'},
 [0x2912]={d='on'},
 [0x2913]={d='on'},
 [0x2914]={d='on'},
 [0x2915]={d='on'},
 [0x2916]={d='on'},
 [0x2917]={d='on'},
 [0x2918]={d='on'},
 [0x2919]={d='on'},
 [0x291A]={d='on'},
 [0x291B]={d='on'},
 [0x291C]={d='on'},
 [0x291D]={d='on'},
 [0x291E]={d='on'},
 [0x291F]={d='on'},
 [0x2920]={d='on'},
 [0x2921]={d='on'},
 [0x2922]={d='on'},
 [0x2923]={d='on'},
 [0x2924]={d='on'},
 [0x2925]={d='on'},
 [0x2926]={d='on'},
 [0x2927]={d='on'},
 [0x2928]={d='on'},
 [0x2929]={d='on'},
 [0x292A]={d='on'},
 [0x292B]={d='on'},
 [0x292C]={d='on'},
 [0x292D]={d='on'},
 [0x292E]={d='on'},
 [0x292F]={d='on'},
 [0x2930]={d='on'},
 [0x2931]={d='on'},
 [0x2932]={d='on'},
 [0x2933]={d='on'},
 [0x2934]={d='on'},
 [0x2935]={d='on'},
 [0x2936]={d='on'},
 [0x2937]={d='on'},
 [0x2938]={d='on'},
 [0x2939]={d='on'},
 [0x293A]={d='on'},
 [0x293B]={d='on'},
 [0x293C]={d='on'},
 [0x293D]={d='on'},
 [0x293E]={d='on'},
 [0x293F]={d='on'},
 [0x2940]={d='on'},
 [0x2941]={d='on'},
 [0x2942]={d='on'},
 [0x2943]={d='on'},
 [0x2944]={d='on'},
 [0x2945]={d='on'},
 [0x2946]={d='on'},
 [0x2947]={d='on'},
 [0x2948]={d='on'},
 [0x2949]={d='on'},
 [0x294A]={d='on'},
 [0x294B]={d='on'},
 [0x294C]={d='on'},
 [0x294D]={d='on'},
 [0x294E]={d='on'},
 [0x294F]={d='on'},
 [0x2950]={d='on'},
 [0x2951]={d='on'},
 [0x2952]={d='on'},
 [0x2953]={d='on'},
 [0x2954]={d='on'},
 [0x2955]={d='on'},
 [0x2956]={d='on'},
 [0x2957]={d='on'},
 [0x2958]={d='on'},
 [0x2959]={d='on'},
 [0x295A]={d='on'},
 [0x295B]={d='on'},
 [0x295C]={d='on'},
 [0x295D]={d='on'},
 [0x295E]={d='on'},
 [0x295F]={d='on'},
 [0x2960]={d='on'},
 [0x2961]={d='on'},
 [0x2962]={d='on'},
 [0x2963]={d='on'},
 [0x2964]={d='on'},
 [0x2965]={d='on'},
 [0x2966]={d='on'},
 [0x2967]={d='on'},
 [0x2968]={d='on'},
 [0x2969]={d='on'},
 [0x296A]={d='on'},
 [0x296B]={d='on'},
 [0x296C]={d='on'},
 [0x296D]={d='on'},
 [0x296E]={d='on'},
 [0x296F]={d='on'},
 [0x2970]={d='on'},
 [0x2971]={d='on'},
 [0x2972]={d='on'},
 [0x2973]={d='on'},
 [0x2974]={d='on'},
 [0x2975]={d='on'},
 [0x2976]={d='on'},
 [0x2977]={d='on'},
 [0x2978]={d='on'},
 [0x2979]={d='on'},
 [0x297A]={d='on'},
 [0x297B]={d='on'},
 [0x297C]={d='on'},
 [0x297D]={d='on'},
 [0x297E]={d='on'},
 [0x297F]={d='on'},
 [0x2980]={d='on'},
 [0x2981]={d='on'},
 [0x2982]={d='on'},
 [0x2983]={d='on', m=0x2984},
 [0x2984]={d='on', m=0x2983},
 [0x2985]={d='on', m=0x2986},
 [0x2986]={d='on', m=0x2985},
 [0x2987]={d='on', m=0x2988},
 [0x2988]={d='on', m=0x2987},
 [0x2989]={d='on', m=0x298A},
 [0x298A]={d='on', m=0x2989},
 [0x298B]={d='on', m=0x298C},
 [0x298C]={d='on', m=0x298B},
 [0x298D]={d='on', m=0x2990},
 [0x298E]={d='on', m=0x298F},
 [0x298F]={d='on', m=0x298E},
 [0x2990]={d='on', m=0x298D},
 [0x2991]={d='on', m=0x2992},
 [0x2992]={d='on', m=0x2991},
 [0x2993]={d='on', m=0x2994},
 [0x2994]={d='on', m=0x2993},
 [0x2995]={d='on', m=0x2996},
 [0x2996]={d='on', m=0x2995},
 [0x2997]={d='on', m=0x2998},
 [0x2998]={d='on', m=0x2997},
 [0x2999]={d='on'},
 [0x299A]={d='on'},
 [0x299B]={d='on'},
 [0x299C]={d='on'},
 [0x299D]={d='on'},
 [0x299E]={d='on'},
 [0x299F]={d='on'},
 [0x29A0]={d='on'},
 [0x29A1]={d='on'},
 [0x29A2]={d='on'},
 [0x29A3]={d='on'},
 [0x29A4]={d='on'},
 [0x29A5]={d='on'},
 [0x29A6]={d='on'},
 [0x29A7]={d='on'},
 [0x29A8]={d='on'},
 [0x29A9]={d='on'},
 [0x29AA]={d='on'},
 [0x29AB]={d='on'},
 [0x29AC]={d='on'},
 [0x29AD]={d='on'},
 [0x29AE]={d='on'},
 [0x29AF]={d='on'},
 [0x29B0]={d='on'},
 [0x29B1]={d='on'},
 [0x29B2]={d='on'},
 [0x29B3]={d='on'},
 [0x29B4]={d='on'},
 [0x29B5]={d='on'},
 [0x29B6]={d='on'},
 [0x29B7]={d='on'},
 [0x29B8]={d='on', m=0x2298},
 [0x29B9]={d='on'},
 [0x29BA]={d='on'},
 [0x29BB]={d='on'},
 [0x29BC]={d='on'},
 [0x29BD]={d='on'},
 [0x29BE]={d='on'},
 [0x29BF]={d='on'},
 [0x29C0]={d='on', m=0x29C1},
 [0x29C1]={d='on', m=0x29C0},
 [0x29C2]={d='on'},
 [0x29C3]={d='on'},
 [0x29C4]={d='on', m=0x29C5},
 [0x29C5]={d='on', m=0x29C4},
 [0x29C6]={d='on'},
 [0x29C7]={d='on'},
 [0x29C8]={d='on'},
 [0x29C9]={d='on'},
 [0x29CA]={d='on'},
 [0x29CB]={d='on'},
 [0x29CC]={d='on'},
 [0x29CD]={d='on'},
 [0x29CE]={d='on'},
 [0x29CF]={d='on', m=0x29D0},
 [0x29D0]={d='on', m=0x29CF},
 [0x29D1]={d='on', m=0x29D2},
 [0x29D2]={d='on', m=0x29D1},
 [0x29D3]={d='on'},
 [0x29D4]={d='on', m=0x29D5},
 [0x29D5]={d='on', m=0x29D4},
 [0x29D6]={d='on'},
 [0x29D7]={d='on'},
 [0x29D8]={d='on', m=0x29D9},
 [0x29D9]={d='on', m=0x29D8},
 [0x29DA]={d='on', m=0x29DB},
 [0x29DB]={d='on', m=0x29DA},
 [0x29DC]={d='on'},
 [0x29DD]={d='on'},
 [0x29DE]={d='on'},
 [0x29DF]={d='on'},
 [0x29E0]={d='on'},
 [0x29E1]={d='on'},
 [0x29E2]={d='on'},
 [0x29E3]={d='on'},
 [0x29E4]={d='on'},
 [0x29E5]={d='on'},
 [0x29E6]={d='on'},
 [0x29E7]={d='on'},
 [0x29E8]={d='on'},
 [0x29E9]={d='on'},
 [0x29EA]={d='on'},
 [0x29EB]={d='on'},
 [0x29EC]={d='on'},
 [0x29ED]={d='on'},
 [0x29EE]={d='on'},
 [0x29EF]={d='on'},
 [0x29F0]={d='on'},
 [0x29F1]={d='on'},
 [0x29F2]={d='on'},
 [0x29F3]={d='on'},
 [0x29F4]={d='on'},
 [0x29F5]={d='on', m=0x2215},
 [0x29F6]={d='on'},
 [0x29F7]={d='on'},
 [0x29F8]={d='on', m=0x29F9},
 [0x29F9]={d='on', m=0x29F8},
 [0x29FA]={d='on'},
 [0x29FB]={d='on'},
 [0x29FC]={d='on', m=0x29FD},
 [0x29FD]={d='on', m=0x29FC},
 [0x29FE]={d='on'},
 [0x29FF]={d='on'},
 [0x2A00]={d='on'},
 [0x2A01]={d='on'},
 [0x2A02]={d='on'},
 [0x2A03]={d='on'},
 [0x2A04]={d='on'},
 [0x2A05]={d='on'},
 [0x2A06]={d='on'},
 [0x2A07]={d='on'},
 [0x2A08]={d='on'},
 [0x2A09]={d='on'},
 [0x2A0A]={d='on'},
 [0x2A0B]={d='on'},
 [0x2A0C]={d='on'},
 [0x2A0D]={d='on'},
 [0x2A0E]={d='on'},
 [0x2A0F]={d='on'},
 [0x2A10]={d='on'},
 [0x2A11]={d='on'},
 [0x2A12]={d='on'},
 [0x2A13]={d='on'},
 [0x2A14]={d='on'},
 [0x2A15]={d='on'},
 [0x2A16]={d='on'},
 [0x2A17]={d='on'},
 [0x2A18]={d='on'},
 [0x2A19]={d='on'},
 [0x2A1A]={d='on'},
 [0x2A1B]={d='on'},
 [0x2A1C]={d='on'},
 [0x2A1D]={d='on'},
 [0x2A1E]={d='on'},
 [0x2A1F]={d='on'},
 [0x2A20]={d='on'},
 [0x2A21]={d='on'},
 [0x2A22]={d='on'},
 [0x2A23]={d='on'},
 [0x2A24]={d='on'},
 [0x2A25]={d='on'},
 [0x2A26]={d='on'},
 [0x2A27]={d='on'},
 [0x2A28]={d='on'},
 [0x2A29]={d='on'},
 [0x2A2A]={d='on'},
 [0x2A2B]={d='on', m=0x2A2C},
 [0x2A2C]={d='on', m=0x2A2B},
 [0x2A2D]={d='on', m=0x2A2E},
 [0x2A2E]={d='on', m=0x2A2D},
 [0x2A2F]={d='on'},
 [0x2A30]={d='on'},
 [0x2A31]={d='on'},
 [0x2A32]={d='on'},
 [0x2A33]={d='on'},
 [0x2A34]={d='on', m=0x2A35},
 [0x2A35]={d='on', m=0x2A34},
 [0x2A36]={d='on'},
 [0x2A37]={d='on'},
 [0x2A38]={d='on'},
 [0x2A39]={d='on'},
 [0x2A3A]={d='on'},
 [0x2A3B]={d='on'},
 [0x2A3C]={d='on', m=0x2A3D},
 [0x2A3D]={d='on', m=0x2A3C},
 [0x2A3E]={d='on'},
 [0x2A3F]={d='on'},
 [0x2A40]={d='on'},
 [0x2A41]={d='on'},
 [0x2A42]={d='on'},
 [0x2A43]={d='on'},
 [0x2A44]={d='on'},
 [0x2A45]={d='on'},
 [0x2A46]={d='on'},
 [0x2A47]={d='on'},
 [0x2A48]={d='on'},
 [0x2A49]={d='on'},
 [0x2A4A]={d='on'},
 [0x2A4B]={d='on'},
 [0x2A4C]={d='on'},
 [0x2A4D]={d='on'},
 [0x2A4E]={d='on'},
 [0x2A4F]={d='on'},
 [0x2A50]={d='on'},
 [0x2A51]={d='on'},
 [0x2A52]={d='on'},
 [0x2A53]={d='on'},
 [0x2A54]={d='on'},
 [0x2A55]={d='on'},
 [0x2A56]={d='on'},
 [0x2A57]={d='on'},
 [0x2A58]={d='on'},
 [0x2A59]={d='on'},
 [0x2A5A]={d='on'},
 [0x2A5B]={d='on'},
 [0x2A5C]={d='on'},
 [0x2A5D]={d='on'},
 [0x2A5E]={d='on'},
 [0x2A5F]={d='on'},
 [0x2A60]={d='on'},
 [0x2A61]={d='on'},
 [0x2A62]={d='on'},
 [0x2A63]={d='on'},
 [0x2A64]={d='on', m=0x2A65},
 [0x2A65]={d='on', m=0x2A64},
 [0x2A66]={d='on'},
 [0x2A67]={d='on'},
 [0x2A68]={d='on'},
 [0x2A69]={d='on'},
 [0x2A6A]={d='on'},
 [0x2A6B]={d='on'},
 [0x2A6C]={d='on'},
 [0x2A6D]={d='on'},
 [0x2A6E]={d='on'},
 [0x2A6F]={d='on'},
 [0x2A70]={d='on'},
 [0x2A71]={d='on'},
 [0x2A72]={d='on'},
 [0x2A73]={d='on'},
 [0x2A74]={d='on'},
 [0x2A75]={d='on'},
 [0x2A76]={d='on'},
 [0x2A77]={d='on'},
 [0x2A78]={d='on'},
 [0x2A79]={d='on', m=0x2A7A},
 [0x2A7A]={d='on', m=0x2A79},
 [0x2A7B]={d='on'},
 [0x2A7C]={d='on'},
 [0x2A7D]={d='on', m=0x2A7E},
 [0x2A7E]={d='on', m=0x2A7D},
 [0x2A7F]={d='on', m=0x2A80},
 [0x2A80]={d='on', m=0x2A7F},
 [0x2A81]={d='on', m=0x2A82},
 [0x2A82]={d='on', m=0x2A81},
 [0x2A83]={d='on', m=0x2A84},
 [0x2A84]={d='on', m=0x2A83},
 [0x2A85]={d='on'},
 [0x2A86]={d='on'},
 [0x2A87]={d='on'},
 [0x2A88]={d='on'},
 [0x2A89]={d='on'},
 [0x2A8A]={d='on'},
 [0x2A8B]={d='on', m=0x2A8C},
 [0x2A8C]={d='on', m=0x2A8B},
 [0x2A8D]={d='on'},
 [0x2A8E]={d='on'},
 [0x2A8F]={d='on'},
 [0x2A90]={d='on'},
 [0x2A91]={d='on', m=0x2A92},
 [0x2A92]={d='on', m=0x2A91},
 [0x2A93]={d='on', m=0x2A94},
 [0x2A94]={d='on', m=0x2A93},
 [0x2A95]={d='on', m=0x2A96},
 [0x2A96]={d='on', m=0x2A95},
 [0x2A97]={d='on', m=0x2A98},
 [0x2A98]={d='on', m=0x2A97},
 [0x2A99]={d='on', m=0x2A9A},
 [0x2A9A]={d='on', m=0x2A99},
 [0x2A9B]={d='on', m=0x2A9C},
 [0x2A9C]={d='on', m=0x2A9B},
 [0x2A9D]={d='on'},
 [0x2A9E]={d='on'},
 [0x2A9F]={d='on'},
 [0x2AA0]={d='on'},
 [0x2AA1]={d='on', m=0x2AA2},
 [0x2AA2]={d='on', m=0x2AA1},
 [0x2AA3]={d='on'},
 [0x2AA4]={d='on'},
 [0x2AA5]={d='on'},
 [0x2AA6]={d='on', m=0x2AA7},
 [0x2AA7]={d='on', m=0x2AA6},
 [0x2AA8]={d='on', m=0x2AA9},
 [0x2AA9]={d='on', m=0x2AA8},
 [0x2AAA]={d='on', m=0x2AAB},
 [0x2AAB]={d='on', m=0x2AAA},
 [0x2AAC]={d='on', m=0x2AAD},
 [0x2AAD]={d='on', m=0x2AAC},
 [0x2AAE]={d='on'},
 [0x2AAF]={d='on', m=0x2AB0},
 [0x2AB0]={d='on', m=0x2AAF},
 [0x2AB1]={d='on'},
 [0x2AB2]={d='on'},
 [0x2AB3]={d='on', m=0x2AB4},
 [0x2AB4]={d='on', m=0x2AB3},
 [0x2AB5]={d='on'},
 [0x2AB6]={d='on'},
 [0x2AB7]={d='on'},
 [0x2AB8]={d='on'},
 [0x2AB9]={d='on'},
 [0x2ABA]={d='on'},
 [0x2ABB]={d='on', m=0x2ABC},
 [0x2ABC]={d='on', m=0x2ABB},
 [0x2ABD]={d='on', m=0x2ABE},
 [0x2ABE]={d='on', m=0x2ABD},
 [0x2ABF]={d='on', m=0x2AC0},
 [0x2AC0]={d='on', m=0x2ABF},
 [0x2AC1]={d='on', m=0x2AC2},
 [0x2AC2]={d='on', m=0x2AC1},
 [0x2AC3]={d='on', m=0x2AC4},
 [0x2AC4]={d='on', m=0x2AC3},
 [0x2AC5]={d='on', m=0x2AC6},
 [0x2AC6]={d='on', m=0x2AC5},
 [0x2AC7]={d='on'},
 [0x2AC8]={d='on'},
 [0x2AC9]={d='on'},
 [0x2ACA]={d='on'},
 [0x2ACB]={d='on'},
 [0x2ACC]={d='on'},
 [0x2ACD]={d='on', m=0x2ACE},
 [0x2ACE]={d='on', m=0x2ACD},
 [0x2ACF]={d='on', m=0x2AD0},
 [0x2AD0]={d='on', m=0x2ACF},
 [0x2AD1]={d='on', m=0x2AD2},
 [0x2AD2]={d='on', m=0x2AD1},
 [0x2AD3]={d='on', m=0x2AD4},
 [0x2AD4]={d='on', m=0x2AD3},
 [0x2AD5]={d='on', m=0x2AD6},
 [0x2AD6]={d='on', m=0x2AD5},
 [0x2AD7]={d='on'},
 [0x2AD8]={d='on'},
 [0x2AD9]={d='on'},
 [0x2ADA]={d='on'},
 [0x2ADB]={d='on'},
 [0x2ADC]={d='on'},
 [0x2ADD]={d='on'},
 [0x2ADE]={d='on', m=0x22A6},
 [0x2ADF]={d='on'},
 [0x2AE0]={d='on'},
 [0x2AE1]={d='on'},
 [0x2AE2]={d='on'},
 [0x2AE3]={d='on', m=0x22A9},
 [0x2AE4]={d='on', m=0x22A8},
 [0x2AE5]={d='on', m=0x22AB},
 [0x2AE6]={d='on'},
 [0x2AE7]={d='on'},
 [0x2AE8]={d='on'},
 [0x2AE9]={d='on'},
 [0x2AEA]={d='on'},
 [0x2AEB]={d='on'},
 [0x2AEC]={d='on', m=0x2AED},
 [0x2AED]={d='on', m=0x2AEC},
 [0x2AEE]={d='on'},
 [0x2AEF]={d='on'},
 [0x2AF0]={d='on'},
 [0x2AF1]={d='on'},
 [0x2AF2]={d='on'},
 [0x2AF3]={d='on'},
 [0x2AF4]={d='on'},
 [0x2AF5]={d='on'},
 [0x2AF6]={d='on'},
 [0x2AF7]={d='on', m=0x2AF8},
 [0x2AF8]={d='on', m=0x2AF7},
 [0x2AF9]={d='on', m=0x2AFA},
 [0x2AFA]={d='on', m=0x2AF9},
 [0x2AFB]={d='on'},
 [0x2AFC]={d='on'},
 [0x2AFD]={d='on'},
 [0x2AFE]={d='on'},
 [0x2AFF]={d='on'},
 [0x2B00]={d='on'},
 [0x2B01]={d='on'},
 [0x2B02]={d='on'},
 [0x2B03]={d='on'},
 [0x2B04]={d='on'},
 [0x2B05]={d='on'},
 [0x2B06]={d='on'},
 [0x2B07]={d='on'},
 [0x2B08]={d='on'},
 [0x2B09]={d='on'},
 [0x2B0A]={d='on'},
 [0x2B0B]={d='on'},
 [0x2B0C]={d='on'},
 [0x2B0D]={d='on'},
 [0x2B0E]={d='on'},
 [0x2B0F]={d='on'},
 [0x2B10]={d='on'},
 [0x2B11]={d='on'},
 [0x2B12]={d='on'},
 [0x2B13]={d='on'},
 [0x2B14]={d='on'},
 [0x2B15]={d='on'},
 [0x2B16]={d='on'},
 [0x2B17]={d='on'},
 [0x2B18]={d='on'},
 [0x2B19]={d='on'},
 [0x2B1A]={d='on'},
 [0x2B1B]={d='on'},
 [0x2B1C]={d='on'},
 [0x2B1D]={d='on'},
 [0x2B1E]={d='on'},
 [0x2B1F]={d='on'},
 [0x2B20]={d='on'},
 [0x2B21]={d='on'},
 [0x2B22]={d='on'},
 [0x2B23]={d='on'},
 [0x2B24]={d='on'},
 [0x2B25]={d='on'},
 [0x2B26]={d='on'},
 [0x2B27]={d='on'},
 [0x2B28]={d='on'},
 [0x2B29]={d='on'},
 [0x2B2A]={d='on'},
 [0x2B2B]={d='on'},
 [0x2B2C]={d='on'},
 [0x2B2D]={d='on'},
 [0x2B2E]={d='on'},
 [0x2B2F]={d='on'},
 [0x2B30]={d='on'},
 [0x2B31]={d='on'},
 [0x2B32]={d='on'},
 [0x2B33]={d='on'},
 [0x2B34]={d='on'},
 [0x2B35]={d='on'},
 [0x2B36]={d='on'},
 [0x2B37]={d='on'},
 [0x2B38]={d='on'},
 [0x2B39]={d='on'},
 [0x2B3A]={d='on'},
 [0x2B3B]={d='on'},
 [0x2B3C]={d='on'},
 [0x2B3D]={d='on'},
 [0x2B3E]={d='on'},
 [0x2B3F]={d='on'},
 [0x2B40]={d='on'},
 [0x2B41]={d='on'},
 [0x2B42]={d='on'},
 [0x2B43]={d='on'},
 [0x2B44]={d='on'},
 [0x2B45]={d='on'},
 [0x2B46]={d='on'},
 [0x2B47]={d='on'},
 [0x2B48]={d='on'},
 [0x2B49]={d='on'},
 [0x2B4A]={d='on'},
 [0x2B4B]={d='on'},
 [0x2B4C]={d='on'},
 [0x2B4D]={d='on'},
 [0x2B4E]={d='on'},
 [0x2B4F]={d='on'},
 [0x2B50]={d='on'},
 [0x2B51]={d='on'},
 [0x2B52]={d='on'},
 [0x2B53]={d='on'},
 [0x2B54]={d='on'},
 [0x2B55]={d='on'},
 [0x2B56]={d='on'},
 [0x2B57]={d='on'},
 [0x2B58]={d='on'},
 [0x2B59]={d='on'},
 [0x2B5A]={d='on'},
 [0x2B5B]={d='on'},
 [0x2B5C]={d='on'},
 [0x2B5D]={d='on'},
 [0x2B5E]={d='on'},
 [0x2B5F]={d='on'},
 [0x2B60]={d='on'},
 [0x2B61]={d='on'},
 [0x2B62]={d='on'},
 [0x2B63]={d='on'},
 [0x2B64]={d='on'},
 [0x2B65]={d='on'},
 [0x2B66]={d='on'},
 [0x2B67]={d='on'},
 [0x2B68]={d='on'},
 [0x2B69]={d='on'},
 [0x2B6A]={d='on'},
 [0x2B6B]={d='on'},
 [0x2B6C]={d='on'},
 [0x2B6D]={d='on'},
 [0x2B6E]={d='on'},
 [0x2B6F]={d='on'},
 [0x2B70]={d='on'},
 [0x2B71]={d='on'},
 [0x2B72]={d='on'},
 [0x2B73]={d='on'},
 [0x2B76]={d='on'},
 [0x2B77]={d='on'},
 [0x2B78]={d='on'},
 [0x2B79]={d='on'},
 [0x2B7A]={d='on'},
 [0x2B7B]={d='on'},
 [0x2B7C]={d='on'},
 [0x2B7D]={d='on'},
 [0x2B7E]={d='on'},
 [0x2B7F]={d='on'},
 [0x2B80]={d='on'},
 [0x2B81]={d='on'},
 [0x2B82]={d='on'},
 [0x2B83]={d='on'},
 [0x2B84]={d='on'},
 [0x2B85]={d='on'},
 [0x2B86]={d='on'},
 [0x2B87]={d='on'},
 [0x2B88]={d='on'},
 [0x2B89]={d='on'},
 [0x2B8A]={d='on'},
 [0x2B8B]={d='on'},
 [0x2B8C]={d='on'},
 [0x2B8D]={d='on'},
 [0x2B8E]={d='on'},
 [0x2B8F]={d='on'},
 [0x2B90]={d='on'},
 [0x2B91]={d='on'},
 [0x2B92]={d='on'},
 [0x2B93]={d='on'},
 [0x2B94]={d='on'},
 [0x2B95]={d='on'},
 [0x2B98]={d='on'},
 [0x2B99]={d='on'},
 [0x2B9A]={d='on'},
 [0x2B9B]={d='on'},
 [0x2B9C]={d='on'},
 [0x2B9D]={d='on'},
 [0x2B9E]={d='on'},
 [0x2B9F]={d='on'},
 [0x2BA0]={d='on'},
 [0x2BA1]={d='on'},
 [0x2BA2]={d='on'},
 [0x2BA3]={d='on'},
 [0x2BA4]={d='on'},
 [0x2BA5]={d='on'},
 [0x2BA6]={d='on'},
 [0x2BA7]={d='on'},
 [0x2BA8]={d='on'},
 [0x2BA9]={d='on'},
 [0x2BAA]={d='on'},
 [0x2BAB]={d='on'},
 [0x2BAC]={d='on'},
 [0x2BAD]={d='on'},
 [0x2BAE]={d='on'},
 [0x2BAF]={d='on'},
 [0x2BB0]={d='on'},
 [0x2BB1]={d='on'},
 [0x2BB2]={d='on'},
 [0x2BB3]={d='on'},
 [0x2BB4]={d='on'},
 [0x2BB5]={d='on'},
 [0x2BB6]={d='on'},
 [0x2BB7]={d='on'},
 [0x2BB8]={d='on'},
 [0x2BB9]={d='on'},
 [0x2BBD]={d='on'},
 [0x2BBE]={d='on'},
 [0x2BBF]={d='on'},
 [0x2BC0]={d='on'},
 [0x2BC1]={d='on'},
 [0x2BC2]={d='on'},
 [0x2BC3]={d='on'},
 [0x2BC4]={d='on'},
 [0x2BC5]={d='on'},
 [0x2BC6]={d='on'},
 [0x2BC7]={d='on'},
 [0x2BC8]={d='on'},
 [0x2BCA]={d='on'},
 [0x2BCB]={d='on'},
 [0x2BCC]={d='on'},
 [0x2BCD]={d='on'},
 [0x2BCE]={d='on'},
 [0x2BCF]={d='on'},
 [0x2BD0]={d='on'},
 [0x2BD1]={d='on'},
 [0x2BEC]={d='on'},
 [0x2BED]={d='on'},
 [0x2BEE]={d='on'},
 [0x2BEF]={d='on'},
 [0x2CE5]={d='on'},
 [0x2CE6]={d='on'},
 [0x2CE7]={d='on'},
 [0x2CE8]={d='on'},
 [0x2CE9]={d='on'},
 [0x2CEA]={d='on'},
 [0x2CEF]={d='nsm'},
 [0x2CF0]={d='nsm'},
 [0x2CF1]={d='nsm'},
 [0x2CF9]={d='on'},
 [0x2CFA]={d='on'},
 [0x2CFB]={d='on'},
 [0x2CFC]={d='on'},
 [0x2CFD]={d='on'},
 [0x2CFE]={d='on'},
 [0x2CFF]={d='on'},
 [0x2D7F]={d='nsm'},
 [0x2DE0]={d='nsm'},
 [0x2DE1]={d='nsm'},
 [0x2DE2]={d='nsm'},
 [0x2DE3]={d='nsm'},
 [0x2DE4]={d='nsm'},
 [0x2DE5]={d='nsm'},
 [0x2DE6]={d='nsm'},
 [0x2DE7]={d='nsm'},
 [0x2DE8]={d='nsm'},
 [0x2DE9]={d='nsm'},
 [0x2DEA]={d='nsm'},
 [0x2DEB]={d='nsm'},
 [0x2DEC]={d='nsm'},
 [0x2DED]={d='nsm'},
 [0x2DEE]={d='nsm'},
 [0x2DEF]={d='nsm'},
 [0x2DF0]={d='nsm'},
 [0x2DF1]={d='nsm'},
 [0x2DF2]={d='nsm'},
 [0x2DF3]={d='nsm'},
 [0x2DF4]={d='nsm'},
 [0x2DF5]={d='nsm'},
 [0x2DF6]={d='nsm'},
 [0x2DF7]={d='nsm'},
 [0x2DF8]={d='nsm'},
 [0x2DF9]={d='nsm'},
 [0x2DFA]={d='nsm'},
 [0x2DFB]={d='nsm'},
 [0x2DFC]={d='nsm'},
 [0x2DFD]={d='nsm'},
 [0x2DFE]={d='nsm'},
 [0x2DFF]={d='nsm'},
 [0x2E00]={d='on'},
 [0x2E01]={d='on'},
 [0x2E02]={d='on', m=0x2E03},
 [0x2E03]={d='on', m=0x2E02},
 [0x2E04]={d='on', m=0x2E05},
 [0x2E05]={d='on', m=0x2E04},
 [0x2E06]={d='on'},
 [0x2E07]={d='on'},
 [0x2E08]={d='on'},
 [0x2E09]={d='on', m=0x2E0A},
 [0x2E0A]={d='on', m=0x2E09},
 [0x2E0B]={d='on'},
 [0x2E0C]={d='on', m=0x2E0D},
 [0x2E0D]={d='on', m=0x2E0C},
 [0x2E0E]={d='on'},
 [0x2E0F]={d='on'},
 [0x2E10]={d='on'},
 [0x2E11]={d='on'},
 [0x2E12]={d='on'},
 [0x2E13]={d='on'},
 [0x2E14]={d='on'},
 [0x2E15]={d='on'},
 [0x2E16]={d='on'},
 [0x2E17]={d='on'},
 [0x2E18]={d='on'},
 [0x2E19]={d='on'},
 [0x2E1A]={d='on'},
 [0x2E1B]={d='on'},
 [0x2E1C]={d='on', m=0x2E1D},
 [0x2E1D]={d='on', m=0x2E1C},
 [0x2E1E]={d='on'},
 [0x2E1F]={d='on'},
 [0x2E20]={d='on', m=0x2E21},
 [0x2E21]={d='on', m=0x2E20},
 [0x2E22]={d='on', m=0x2E23},
 [0x2E23]={d='on', m=0x2E22},
 [0x2E24]={d='on', m=0x2E25},
 [0x2E25]={d='on', m=0x2E24},
 [0x2E26]={d='on', m=0x2E27},
 [0x2E27]={d='on', m=0x2E26},
 [0x2E28]={d='on', m=0x2E29},
 [0x2E29]={d='on', m=0x2E28},
 [0x2E2A]={d='on'},
 [0x2E2B]={d='on'},
 [0x2E2C]={d='on'},
 [0x2E2D]={d='on'},
 [0x2E2E]={d='on'},
 [0x2E2F]={d='on'},
 [0x2E30]={d='on'},
 [0x2E31]={d='on'},
 [0x2E32]={d='on'},
 [0x2E33]={d='on'},
 [0x2E34]={d='on'},
 [0x2E35]={d='on'},
 [0x2E36]={d='on'},
 [0x2E37]={d='on'},
 [0x2E38]={d='on'},
 [0x2E39]={d='on'},
 [0x2E3A]={d='on'},
 [0x2E3B]={d='on'},
 [0x2E3C]={d='on'},
 [0x2E3D]={d='on'},
 [0x2E3E]={d='on'},
 [0x2E3F]={d='on'},
 [0x2E40]={d='on'},
 [0x2E41]={d='on'},
 [0x2E42]={d='on'},
 [0x2E43]={d='on'},
 [0x2E44]={d='on'},
 [0x2E80]={d='on'},
 [0x2E81]={d='on'},
 [0x2E82]={d='on'},
 [0x2E83]={d='on'},
 [0x2E84]={d='on'},
 [0x2E85]={d='on'},
 [0x2E86]={d='on'},
 [0x2E87]={d='on'},
 [0x2E88]={d='on'},
 [0x2E89]={d='on'},
 [0x2E8A]={d='on'},
 [0x2E8B]={d='on'},
 [0x2E8C]={d='on'},
 [0x2E8D]={d='on'},
 [0x2E8E]={d='on'},
 [0x2E8F]={d='on'},
 [0x2E90]={d='on'},
 [0x2E91]={d='on'},
 [0x2E92]={d='on'},
 [0x2E93]={d='on'},
 [0x2E94]={d='on'},
 [0x2E95]={d='on'},
 [0x2E96]={d='on'},
 [0x2E97]={d='on'},
 [0x2E98]={d='on'},
 [0x2E99]={d='on'},
 [0x2E9B]={d='on'},
 [0x2E9C]={d='on'},
 [0x2E9D]={d='on'},
 [0x2E9E]={d='on'},
 [0x2E9F]={d='on'},
 [0x2EA0]={d='on'},
 [0x2EA1]={d='on'},
 [0x2EA2]={d='on'},
 [0x2EA3]={d='on'},
 [0x2EA4]={d='on'},
 [0x2EA5]={d='on'},
 [0x2EA6]={d='on'},
 [0x2EA7]={d='on'},
 [0x2EA8]={d='on'},
 [0x2EA9]={d='on'},
 [0x2EAA]={d='on'},
 [0x2EAB]={d='on'},
 [0x2EAC]={d='on'},
 [0x2EAD]={d='on'},
 [0x2EAE]={d='on'},
 [0x2EAF]={d='on'},
 [0x2EB0]={d='on'},
 [0x2EB1]={d='on'},
 [0x2EB2]={d='on'},
 [0x2EB3]={d='on'},
 [0x2EB4]={d='on'},
 [0x2EB5]={d='on'},
 [0x2EB6]={d='on'},
 [0x2EB7]={d='on'},
 [0x2EB8]={d='on'},
 [0x2EB9]={d='on'},
 [0x2EBA]={d='on'},
 [0x2EBB]={d='on'},
 [0x2EBC]={d='on'},
 [0x2EBD]={d='on'},
 [0x2EBE]={d='on'},
 [0x2EBF]={d='on'},
 [0x2EC0]={d='on'},
 [0x2EC1]={d='on'},
 [0x2EC2]={d='on'},
 [0x2EC3]={d='on'},
 [0x2EC4]={d='on'},
 [0x2EC5]={d='on'},
 [0x2EC6]={d='on'},
 [0x2EC7]={d='on'},
 [0x2EC8]={d='on'},
 [0x2EC9]={d='on'},
 [0x2ECA]={d='on'},
 [0x2ECB]={d='on'},
 [0x2ECC]={d='on'},
 [0x2ECD]={d='on'},
 [0x2ECE]={d='on'},
 [0x2ECF]={d='on'},
 [0x2ED0]={d='on'},
 [0x2ED1]={d='on'},
 [0x2ED2]={d='on'},
 [0x2ED3]={d='on'},
 [0x2ED4]={d='on'},
 [0x2ED5]={d='on'},
 [0x2ED6]={d='on'},
 [0x2ED7]={d='on'},
 [0x2ED8]={d='on'},
 [0x2ED9]={d='on'},
 [0x2EDA]={d='on'},
 [0x2EDB]={d='on'},
 [0x2EDC]={d='on'},
 [0x2EDD]={d='on'},
 [0x2EDE]={d='on'},
 [0x2EDF]={d='on'},
 [0x2EE0]={d='on'},
 [0x2EE1]={d='on'},
 [0x2EE2]={d='on'},
 [0x2EE3]={d='on'},
 [0x2EE4]={d='on'},
 [0x2EE5]={d='on'},
 [0x2EE6]={d='on'},
 [0x2EE7]={d='on'},
 [0x2EE8]={d='on'},
 [0x2EE9]={d='on'},
 [0x2EEA]={d='on'},
 [0x2EEB]={d='on'},
 [0x2EEC]={d='on'},
 [0x2EED]={d='on'},
 [0x2EEE]={d='on'},
 [0x2EEF]={d='on'},
 [0x2EF0]={d='on'},
 [0x2EF1]={d='on'},
 [0x2EF2]={d='on'},
 [0x2EF3]={d='on'},
 [0x2F00]={d='on'},
 [0x2F01]={d='on'},
 [0x2F02]={d='on'},
 [0x2F03]={d='on'},
 [0x2F04]={d='on'},
 [0x2F05]={d='on'},
 [0x2F06]={d='on'},
 [0x2F07]={d='on'},
 [0x2F08]={d='on'},
 [0x2F09]={d='on'},
 [0x2F0A]={d='on'},
 [0x2F0B]={d='on'},
 [0x2F0C]={d='on'},
 [0x2F0D]={d='on'},
 [0x2F0E]={d='on'},
 [0x2F0F]={d='on'},
 [0x2F10]={d='on'},
 [0x2F11]={d='on'},
 [0x2F12]={d='on'},
 [0x2F13]={d='on'},
 [0x2F14]={d='on'},
 [0x2F15]={d='on'},
 [0x2F16]={d='on'},
 [0x2F17]={d='on'},
 [0x2F18]={d='on'},
 [0x2F19]={d='on'},
 [0x2F1A]={d='on'},
 [0x2F1B]={d='on'},
 [0x2F1C]={d='on'},
 [0x2F1D]={d='on'},
 [0x2F1E]={d='on'},
 [0x2F1F]={d='on'},
 [0x2F20]={d='on'},
 [0x2F21]={d='on'},
 [0x2F22]={d='on'},
 [0x2F23]={d='on'},
 [0x2F24]={d='on'},
 [0x2F25]={d='on'},
 [0x2F26]={d='on'},
 [0x2F27]={d='on'},
 [0x2F28]={d='on'},
 [0x2F29]={d='on'},
 [0x2F2A]={d='on'},
 [0x2F2B]={d='on'},
 [0x2F2C]={d='on'},
 [0x2F2D]={d='on'},
 [0x2F2E]={d='on'},
 [0x2F2F]={d='on'},
 [0x2F30]={d='on'},
 [0x2F31]={d='on'},
 [0x2F32]={d='on'},
 [0x2F33]={d='on'},
 [0x2F34]={d='on'},
 [0x2F35]={d='on'},
 [0x2F36]={d='on'},
 [0x2F37]={d='on'},
 [0x2F38]={d='on'},
 [0x2F39]={d='on'},
 [0x2F3A]={d='on'},
 [0x2F3B]={d='on'},
 [0x2F3C]={d='on'},
 [0x2F3D]={d='on'},
 [0x2F3E]={d='on'},
 [0x2F3F]={d='on'},
 [0x2F40]={d='on'},
 [0x2F41]={d='on'},
 [0x2F42]={d='on'},
 [0x2F43]={d='on'},
 [0x2F44]={d='on'},
 [0x2F45]={d='on'},
 [0x2F46]={d='on'},
 [0x2F47]={d='on'},
 [0x2F48]={d='on'},
 [0x2F49]={d='on'},
 [0x2F4A]={d='on'},
 [0x2F4B]={d='on'},
 [0x2F4C]={d='on'},
 [0x2F4D]={d='on'},
 [0x2F4E]={d='on'},
 [0x2F4F]={d='on'},
 [0x2F50]={d='on'},
 [0x2F51]={d='on'},
 [0x2F52]={d='on'},
 [0x2F53]={d='on'},
 [0x2F54]={d='on'},
 [0x2F55]={d='on'},
 [0x2F56]={d='on'},
 [0x2F57]={d='on'},
 [0x2F58]={d='on'},
 [0x2F59]={d='on'},
 [0x2F5A]={d='on'},
 [0x2F5B]={d='on'},
 [0x2F5C]={d='on'},
 [0x2F5D]={d='on'},
 [0x2F5E]={d='on'},
 [0x2F5F]={d='on'},
 [0x2F60]={d='on'},
 [0x2F61]={d='on'},
 [0x2F62]={d='on'},
 [0x2F63]={d='on'},
 [0x2F64]={d='on'},
 [0x2F65]={d='on'},
 [0x2F66]={d='on'},
 [0x2F67]={d='on'},
 [0x2F68]={d='on'},
 [0x2F69]={d='on'},
 [0x2F6A]={d='on'},
 [0x2F6B]={d='on'},
 [0x2F6C]={d='on'},
 [0x2F6D]={d='on'},
 [0x2F6E]={d='on'},
 [0x2F6F]={d='on'},
 [0x2F70]={d='on'},
 [0x2F71]={d='on'},
 [0x2F72]={d='on'},
 [0x2F73]={d='on'},
 [0x2F74]={d='on'},
 [0x2F75]={d='on'},
 [0x2F76]={d='on'},
 [0x2F77]={d='on'},
 [0x2F78]={d='on'},
 [0x2F79]={d='on'},
 [0x2F7A]={d='on'},
 [0x2F7B]={d='on'},
 [0x2F7C]={d='on'},
 [0x2F7D]={d='on'},
 [0x2F7E]={d='on'},
 [0x2F7F]={d='on'},
 [0x2F80]={d='on'},
 [0x2F81]={d='on'},
 [0x2F82]={d='on'},
 [0x2F83]={d='on'},
 [0x2F84]={d='on'},
 [0x2F85]={d='on'},
 [0x2F86]={d='on'},
 [0x2F87]={d='on'},
 [0x2F88]={d='on'},
 [0x2F89]={d='on'},
 [0x2F8A]={d='on'},
 [0x2F8B]={d='on'},
 [0x2F8C]={d='on'},
 [0x2F8D]={d='on'},
 [0x2F8E]={d='on'},
 [0x2F8F]={d='on'},
 [0x2F90]={d='on'},
 [0x2F91]={d='on'},
 [0x2F92]={d='on'},
 [0x2F93]={d='on'},
 [0x2F94]={d='on'},
 [0x2F95]={d='on'},
 [0x2F96]={d='on'},
 [0x2F97]={d='on'},
 [0x2F98]={d='on'},
 [0x2F99]={d='on'},
 [0x2F9A]={d='on'},
 [0x2F9B]={d='on'},
 [0x2F9C]={d='on'},
 [0x2F9D]={d='on'},
 [0x2F9E]={d='on'},
 [0x2F9F]={d='on'},
 [0x2FA0]={d='on'},
 [0x2FA1]={d='on'},
 [0x2FA2]={d='on'},
 [0x2FA3]={d='on'},
 [0x2FA4]={d='on'},
 [0x2FA5]={d='on'},
 [0x2FA6]={d='on'},
 [0x2FA7]={d='on'},
 [0x2FA8]={d='on'},
 [0x2FA9]={d='on'},
 [0x2FAA]={d='on'},
 [0x2FAB]={d='on'},
 [0x2FAC]={d='on'},
 [0x2FAD]={d='on'},
 [0x2FAE]={d='on'},
 [0x2FAF]={d='on'},
 [0x2FB0]={d='on'},
 [0x2FB1]={d='on'},
 [0x2FB2]={d='on'},
 [0x2FB3]={d='on'},
 [0x2FB4]={d='on'},
 [0x2FB5]={d='on'},
 [0x2FB6]={d='on'},
 [0x2FB7]={d='on'},
 [0x2FB8]={d='on'},
 [0x2FB9]={d='on'},
 [0x2FBA]={d='on'},
 [0x2FBB]={d='on'},
 [0x2FBC]={d='on'},
 [0x2FBD]={d='on'},
 [0x2FBE]={d='on'},
 [0x2FBF]={d='on'},
 [0x2FC0]={d='on'},
 [0x2FC1]={d='on'},
 [0x2FC2]={d='on'},
 [0x2FC3]={d='on'},
 [0x2FC4]={d='on'},
 [0x2FC5]={d='on'},
 [0x2FC6]={d='on'},
 [0x2FC7]={d='on'},
 [0x2FC8]={d='on'},
 [0x2FC9]={d='on'},
 [0x2FCA]={d='on'},
 [0x2FCB]={d='on'},
 [0x2FCC]={d='on'},
 [0x2FCD]={d='on'},
 [0x2FCE]={d='on'},
 [0x2FCF]={d='on'},
 [0x2FD0]={d='on'},
 [0x2FD1]={d='on'},
 [0x2FD2]={d='on'},
 [0x2FD3]={d='on'},
 [0x2FD4]={d='on'},
 [0x2FD5]={d='on'},
 [0x2FF0]={d='on'},
 [0x2FF1]={d='on'},
 [0x2FF2]={d='on'},
 [0x2FF3]={d='on'},
 [0x2FF4]={d='on'},
 [0x2FF5]={d='on'},
 [0x2FF6]={d='on'},
 [0x2FF7]={d='on'},
 [0x2FF8]={d='on'},
 [0x2FF9]={d='on'},
 [0x2FFA]={d='on'},
 [0x2FFB]={d='on'},
 [0x3000]={d='ws'},
 [0x3001]={d='on'},
 [0x3002]={d='on'},
 [0x3003]={d='on'},
 [0x3004]={d='on'},
 [0x3008]={d='on', m=0x3009},
 [0x3009]={d='on', m=0x3008},
 [0x300A]={d='on', m=0x300B},
 [0x300B]={d='on', m=0x300A},
 [0x300C]={d='on', m=0x300D},
 [0x300D]={d='on', m=0x300C},
 [0x300E]={d='on', m=0x300F},
 [0x300F]={d='on', m=0x300E},
 [0x3010]={d='on', m=0x3011},
 [0x3011]={d='on', m=0x3010},
 [0x3012]={d='on'},
 [0x3013]={d='on'},
 [0x3014]={d='on', m=0x3015},
 [0x3015]={d='on', m=0x3014},
 [0x3016]={d='on', m=0x3017},
 [0x3017]={d='on', m=0x3016},
 [0x3018]={d='on', m=0x3019},
 [0x3019]={d='on', m=0x3018},
 [0x301A]={d='on', m=0x301B},
 [0x301B]={d='on', m=0x301A},
 [0x301C]={d='on'},
 [0x301D]={d='on'},
 [0x301E]={d='on'},
 [0x301F]={d='on'},
 [0x3020]={d='on'},
 [0x302A]={d='nsm'},
 [0x302B]={d='nsm'},
 [0x302C]={d='nsm'},
 [0x302D]={d='nsm'},
 [0x3030]={d='on'},
 [0x3036]={d='on'},
 [0x3037]={d='on'},
 [0x303D]={d='on'},
 [0x303E]={d='on'},
 [0x303F]={d='on'},
 [0x3099]={d='nsm'},
 [0x309A]={d='nsm'},
 [0x309B]={d='on'},
 [0x309C]={d='on'},
 [0x30A0]={d='on'},
 [0x30FB]={d='on'},
 [0x31C0]={d='on'},
 [0x31C1]={d='on'},
 [0x31C2]={d='on'},
 [0x31C3]={d='on'},
 [0x31C4]={d='on'},
 [0x31C5]={d='on'},
 [0x31C6]={d='on'},
 [0x31C7]={d='on'},
 [0x31C8]={d='on'},
 [0x31C9]={d='on'},
 [0x31CA]={d='on'},
 [0x31CB]={d='on'},
 [0x31CC]={d='on'},
 [0x31CD]={d='on'},
 [0x31CE]={d='on'},
 [0x31CF]={d='on'},
 [0x31D0]={d='on'},
 [0x31D1]={d='on'},
 [0x31D2]={d='on'},
 [0x31D3]={d='on'},
 [0x31D4]={d='on'},
 [0x31D5]={d='on'},
 [0x31D6]={d='on'},
 [0x31D7]={d='on'},
 [0x31D8]={d='on'},
 [0x31D9]={d='on'},
 [0x31DA]={d='on'},
 [0x31DB]={d='on'},
 [0x31DC]={d='on'},
 [0x31DD]={d='on'},
 [0x31DE]={d='on'},
 [0x31DF]={d='on'},
 [0x31E0]={d='on'},
 [0x31E1]={d='on'},
 [0x31E2]={d='on'},
 [0x31E3]={d='on'},
 [0x321D]={d='on'},
 [0x321E]={d='on'},
 [0x3250]={d='on'},
 [0x3251]={d='on'},
 [0x3252]={d='on'},
 [0x3253]={d='on'},
 [0x3254]={d='on'},
 [0x3255]={d='on'},
 [0x3256]={d='on'},
 [0x3257]={d='on'},
 [0x3258]={d='on'},
 [0x3259]={d='on'},
 [0x325A]={d='on'},
 [0x325B]={d='on'},
 [0x325C]={d='on'},
 [0x325D]={d='on'},
 [0x325E]={d='on'},
 [0x325F]={d='on'},
 [0x327C]={d='on'},
 [0x327D]={d='on'},
 [0x327E]={d='on'},
 [0x32B1]={d='on'},
 [0x32B2]={d='on'},
 [0x32B3]={d='on'},
 [0x32B4]={d='on'},
 [0x32B5]={d='on'},
 [0x32B6]={d='on'},
 [0x32B7]={d='on'},
 [0x32B8]={d='on'},
 [0x32B9]={d='on'},
 [0x32BA]={d='on'},
 [0x32BB]={d='on'},
 [0x32BC]={d='on'},
 [0x32BD]={d='on'},
 [0x32BE]={d='on'},
 [0x32BF]={d='on'},
 [0x32CC]={d='on'},
 [0x32CD]={d='on'},
 [0x32CE]={d='on'},
 [0x32CF]={d='on'},
 [0x3377]={d='on'},
 [0x3378]={d='on'},
 [0x3379]={d='on'},
 [0x337A]={d='on'},
 [0x33DE]={d='on'},
 [0x33DF]={d='on'},
 [0x33FF]={d='on'},
 [0x4DC0]={d='on'},
 [0x4DC1]={d='on'},
 [0x4DC2]={d='on'},
 [0x4DC3]={d='on'},
 [0x4DC4]={d='on'},
 [0x4DC5]={d='on'},
 [0x4DC6]={d='on'},
 [0x4DC7]={d='on'},
 [0x4DC8]={d='on'},
 [0x4DC9]={d='on'},
 [0x4DCA]={d='on'},
 [0x4DCB]={d='on'},
 [0x4DCC]={d='on'},
 [0x4DCD]={d='on'},
 [0x4DCE]={d='on'},
 [0x4DCF]={d='on'},
 [0x4DD0]={d='on'},
 [0x4DD1]={d='on'},
 [0x4DD2]={d='on'},
 [0x4DD3]={d='on'},
 [0x4DD4]={d='on'},
 [0x4DD5]={d='on'},
 [0x4DD6]={d='on'},
 [0x4DD7]={d='on'},
 [0x4DD8]={d='on'},
 [0x4DD9]={d='on'},
 [0x4DDA]={d='on'},
 [0x4DDB]={d='on'},
 [0x4DDC]={d='on'},
 [0x4DDD]={d='on'},
 [0x4DDE]={d='on'},
 [0x4DDF]={d='on'},
 [0x4DE0]={d='on'},
 [0x4DE1]={d='on'},
 [0x4DE2]={d='on'},
 [0x4DE3]={d='on'},
 [0x4DE4]={d='on'},
 [0x4DE5]={d='on'},
 [0x4DE6]={d='on'},
 [0x4DE7]={d='on'},
 [0x4DE8]={d='on'},
 [0x4DE9]={d='on'},
 [0x4DEA]={d='on'},
 [0x4DEB]={d='on'},
 [0x4DEC]={d='on'},
 [0x4DED]={d='on'},
 [0x4DEE]={d='on'},
 [0x4DEF]={d='on'},
 [0x4DF0]={d='on'},
 [0x4DF1]={d='on'},
 [0x4DF2]={d='on'},
 [0x4DF3]={d='on'},
 [0x4DF4]={d='on'},
 [0x4DF5]={d='on'},
 [0x4DF6]={d='on'},
 [0x4DF7]={d='on'},
 [0x4DF8]={d='on'},
 [0x4DF9]={d='on'},
 [0x4DFA]={d='on'},
 [0x4DFB]={d='on'},
 [0x4DFC]={d='on'},
 [0x4DFD]={d='on'},
 [0x4DFE]={d='on'},
 [0x4DFF]={d='on'},
 [0xA490]={d='on'},
 [0xA491]={d='on'},
 [0xA492]={d='on'},
 [0xA493]={d='on'},
 [0xA494]={d='on'},
 [0xA495]={d='on'},
 [0xA496]={d='on'},
 [0xA497]={d='on'},
 [0xA498]={d='on'},
 [0xA499]={d='on'},
 [0xA49A]={d='on'},
 [0xA49B]={d='on'},
 [0xA49C]={d='on'},
 [0xA49D]={d='on'},
 [0xA49E]={d='on'},
 [0xA49F]={d='on'},
 [0xA4A0]={d='on'},
 [0xA4A1]={d='on'},
 [0xA4A2]={d='on'},
 [0xA4A3]={d='on'},
 [0xA4A4]={d='on'},
 [0xA4A5]={d='on'},
 [0xA4A6]={d='on'},
 [0xA4A7]={d='on'},
 [0xA4A8]={d='on'},
 [0xA4A9]={d='on'},
 [0xA4AA]={d='on'},
 [0xA4AB]={d='on'},
 [0xA4AC]={d='on'},
 [0xA4AD]={d='on'},
 [0xA4AE]={d='on'},
 [0xA4AF]={d='on'},
 [0xA4B0]={d='on'},
 [0xA4B1]={d='on'},
 [0xA4B2]={d='on'},
 [0xA4B3]={d='on'},
 [0xA4B4]={d='on'},
 [0xA4B5]={d='on'},
 [0xA4B6]={d='on'},
 [0xA4B7]={d='on'},
 [0xA4B8]={d='on'},
 [0xA4B9]={d='on'},
 [0xA4BA]={d='on'},
 [0xA4BB]={d='on'},
 [0xA4BC]={d='on'},
 [0xA4BD]={d='on'},
 [0xA4BE]={d='on'},
 [0xA4BF]={d='on'},
 [0xA4C0]={d='on'},
 [0xA4C1]={d='on'},
 [0xA4C2]={d='on'},
 [0xA4C3]={d='on'},
 [0xA4C4]={d='on'},
 [0xA4C5]={d='on'},
 [0xA4C6]={d='on'},
 [0xA60D]={d='on'},
 [0xA60E]={d='on'},
 [0xA60F]={d='on'},
 [0xA66F]={d='nsm'},
 [0xA670]={d='nsm'},
 [0xA671]={d='nsm'},
 [0xA672]={d='nsm'},
 [0xA673]={d='on'},
 [0xA674]={d='nsm'},
 [0xA675]={d='nsm'},
 [0xA676]={d='nsm'},
 [0xA677]={d='nsm'},
 [0xA678]={d='nsm'},
 [0xA679]={d='nsm'},
 [0xA67A]={d='nsm'},
 [0xA67B]={d='nsm'},
 [0xA67C]={d='nsm'},
 [0xA67D]={d='nsm'},
 [0xA67E]={d='on'},
 [0xA67F]={d='on'},
 [0xA69E]={d='nsm'},
 [0xA69F]={d='nsm'},
 [0xA6F0]={d='nsm'},
 [0xA6F1]={d='nsm'},
 [0xA700]={d='on'},
 [0xA701]={d='on'},
 [0xA702]={d='on'},
 [0xA703]={d='on'},
 [0xA704]={d='on'},
 [0xA705]={d='on'},
 [0xA706]={d='on'},
 [0xA707]={d='on'},
 [0xA708]={d='on'},
 [0xA709]={d='on'},
 [0xA70A]={d='on'},
 [0xA70B]={d='on'},
 [0xA70C]={d='on'},
 [0xA70D]={d='on'},
 [0xA70E]={d='on'},
 [0xA70F]={d='on'},
 [0xA710]={d='on'},
 [0xA711]={d='on'},
 [0xA712]={d='on'},
 [0xA713]={d='on'},
 [0xA714]={d='on'},
 [0xA715]={d='on'},
 [0xA716]={d='on'},
 [0xA717]={d='on'},
 [0xA718]={d='on'},
 [0xA719]={d='on'},
 [0xA71A]={d='on'},
 [0xA71B]={d='on'},
 [0xA71C]={d='on'},
 [0xA71D]={d='on'},
 [0xA71E]={d='on'},
 [0xA71F]={d='on'},
 [0xA720]={d='on'},
 [0xA721]={d='on'},
 [0xA788]={d='on'},
 [0xA802]={d='nsm'},
 [0xA806]={d='nsm'},
 [0xA80B]={d='nsm'},
 [0xA825]={d='nsm'},
 [0xA826]={d='nsm'},
 [0xA828]={d='on'},
 [0xA829]={d='on'},
 [0xA82A]={d='on'},
 [0xA82B]={d='on'},
 [0xA838]={d='et'},
 [0xA839]={d='et'},
 [0xA874]={d='on'},
 [0xA875]={d='on'},
 [0xA876]={d='on'},
 [0xA877]={d='on'},
 [0xA8C4]={d='nsm'},
 [0xA8C5]={d='nsm'},
 [0xA8E0]={d='nsm'},
 [0xA8E1]={d='nsm'},
 [0xA8E2]={d='nsm'},
 [0xA8E3]={d='nsm'},
 [0xA8E4]={d='nsm'},
 [0xA8E5]={d='nsm'},
 [0xA8E6]={d='nsm'},
 [0xA8E7]={d='nsm'},
 [0xA8E8]={d='nsm'},
 [0xA8E9]={d='nsm'},
 [0xA8EA]={d='nsm'},
 [0xA8EB]={d='nsm'},
 [0xA8EC]={d='nsm'},
 [0xA8ED]={d='nsm'},
 [0xA8EE]={d='nsm'},
 [0xA8EF]={d='nsm'},
 [0xA8F0]={d='nsm'},
 [0xA8F1]={d='nsm'},
 [0xA926]={d='nsm'},
 [0xA927]={d='nsm'},
 [0xA928]={d='nsm'},
 [0xA929]={d='nsm'},
 [0xA92A]={d='nsm'},
 [0xA92B]={d='nsm'},
 [0xA92C]={d='nsm'},
 [0xA92D]={d='nsm'},
 [0xA947]={d='nsm'},
 [0xA948]={d='nsm'},
 [0xA949]={d='nsm'},
 [0xA94A]={d='nsm'},
 [0xA94B]={d='nsm'},
 [0xA94C]={d='nsm'},
 [0xA94D]={d='nsm'},
 [0xA94E]={d='nsm'},
 [0xA94F]={d='nsm'},
 [0xA950]={d='nsm'},
 [0xA951]={d='nsm'},
 [0xA980]={d='nsm'},
 [0xA981]={d='nsm'},
 [0xA982]={d='nsm'},
 [0xA9B3]={d='nsm'},
 [0xA9B6]={d='nsm'},
 [0xA9B7]={d='nsm'},
 [0xA9B8]={d='nsm'},
 [0xA9B9]={d='nsm'},
 [0xA9BC]={d='nsm'},
 [0xA9E5]={d='nsm'},
 [0xAA29]={d='nsm'},
 [0xAA2A]={d='nsm'},
 [0xAA2B]={d='nsm'},
 [0xAA2C]={d='nsm'},
 [0xAA2D]={d='nsm'},
 [0xAA2E]={d='nsm'},
 [0xAA31]={d='nsm'},
 [0xAA32]={d='nsm'},
 [0xAA35]={d='nsm'},
 [0xAA36]={d='nsm'},
 [0xAA43]={d='nsm'},
 [0xAA4C]={d='nsm'},
 [0xAA7C]={d='nsm'},
 [0xAAB0]={d='nsm'},
 [0xAAB2]={d='nsm'},
 [0xAAB3]={d='nsm'},
 [0xAAB4]={d='nsm'},
 [0xAAB7]={d='nsm'},
 [0xAAB8]={d='nsm'},
 [0xAABE]={d='nsm'},
 [0xAABF]={d='nsm'},
 [0xAAC1]={d='nsm'},
 [0xAAEC]={d='nsm'},
 [0xAAED]={d='nsm'},
 [0xAAF6]={d='nsm'},
 [0xABE5]={d='nsm'},
 [0xABE8]={d='nsm'},
 [0xABED]={d='nsm'},
 [0xFB1E]={d='nsm'},
 [0xFB29]={d='es'},
 [0xFD3E]={d='on'},
 [0xFD3F]={d='on'},
 [0xFDFD]={d='on'},
 [0xFE10]={d='on'},
 [0xFE11]={d='on'},
 [0xFE12]={d='on'},
 [0xFE13]={d='on'},
 [0xFE14]={d='on'},
 [0xFE15]={d='on'},
 [0xFE16]={d='on'},
 [0xFE17]={d='on'},
 [0xFE18]={d='on'},
 [0xFE19]={d='on'},
 [0xFE20]={d='nsm'},
 [0xFE21]={d='nsm'},
 [0xFE22]={d='nsm'},
 [0xFE23]={d='nsm'},
 [0xFE24]={d='nsm'},
 [0xFE25]={d='nsm'},
 [0xFE26]={d='nsm'},
 [0xFE27]={d='nsm'},
 [0xFE28]={d='nsm'},
 [0xFE29]={d='nsm'},
 [0xFE2A]={d='nsm'},
 [0xFE2B]={d='nsm'},
 [0xFE2C]={d='nsm'},
 [0xFE2D]={d='nsm'},
 [0xFE2E]={d='nsm'},
 [0xFE2F]={d='nsm'},
 [0xFE30]={d='on'},
 [0xFE31]={d='on'},
 [0xFE32]={d='on'},
 [0xFE33]={d='on'},
 [0xFE34]={d='on'},
 [0xFE35]={d='on'},
 [0xFE36]={d='on'},
 [0xFE37]={d='on'},
 [0xFE38]={d='on'},
 [0xFE39]={d='on'},
 [0xFE3A]={d='on'},
 [0xFE3B]={d='on'},
 [0xFE3C]={d='on'},
 [0xFE3D]={d='on'},
 [0xFE3E]={d='on'},
 [0xFE3F]={d='on'},
 [0xFE40]={d='on'},
 [0xFE41]={d='on'},
 [0xFE42]={d='on'},
 [0xFE43]={d='on'},
 [0xFE44]={d='on'},
 [0xFE45]={d='on'},
 [0xFE46]={d='on'},
 [0xFE47]={d='on'},
 [0xFE48]={d='on'},
 [0xFE49]={d='on'},
 [0xFE4A]={d='on'},
 [0xFE4B]={d='on'},
 [0xFE4C]={d='on'},
 [0xFE4D]={d='on'},
 [0xFE4E]={d='on'},
 [0xFE4F]={d='on'},
 [0xFE50]={d='cs'},
 [0xFE51]={d='on'},
 [0xFE52]={d='cs'},
 [0xFE54]={d='on'},
 [0xFE55]={d='cs'},
 [0xFE56]={d='on'},
 [0xFE57]={d='on'},
 [0xFE58]={d='on'},
 [0xFE59]={d='on', m=0xFE5A},
 [0xFE5A]={d='on', m=0xFE59},
 [0xFE5B]={d='on', m=0xFE5C},
 [0xFE5C]={d='on', m=0xFE5B},
 [0xFE5D]={d='on', m=0xFE5E},
 [0xFE5E]={d='on', m=0xFE5D},
 [0xFE5F]={d='et'},
 [0xFE60]={d='on'},
 [0xFE61]={d='on'},
 [0xFE62]={d='es'},
 [0xFE63]={d='es'},
 [0xFE64]={d='on', m=0xFE65},
 [0xFE65]={d='on', m=0xFE64},
 [0xFE66]={d='on'},
 [0xFE68]={d='on'},
 [0xFE69]={d='et'},
 [0xFE6A]={d='et'},
 [0xFE6B]={d='on'},
 [0xFEFF]={d='bn'},
 [0xFF01]={d='on'},
 [0xFF02]={d='on'},
 [0xFF03]={d='et'},
 [0xFF04]={d='et'},
 [0xFF05]={d='et'},
 [0xFF06]={d='on'},
 [0xFF07]={d='on'},
 [0xFF08]={d='on', m=0xFF09},
 [0xFF09]={d='on', m=0xFF08},
 [0xFF0A]={d='on'},
 [0xFF0B]={d='es'},
 [0xFF0C]={d='cs'},
 [0xFF0D]={d='es'},
 [0xFF0E]={d='cs'},
 [0xFF0F]={d='cs'},
 [0xFF10]={d='en'},
 [0xFF11]={d='en'},
 [0xFF12]={d='en'},
 [0xFF13]={d='en'},
 [0xFF14]={d='en'},
 [0xFF15]={d='en'},
 [0xFF16]={d='en'},
 [0xFF17]={d='en'},
 [0xFF18]={d='en'},
 [0xFF19]={d='en'},
 [0xFF1A]={d='cs'},
 [0xFF1B]={d='on'},
 [0xFF1C]={d='on', m=0xFF1E},
 [0xFF1D]={d='on'},
 [0xFF1E]={d='on', m=0xFF1C},
 [0xFF1F]={d='on'},
 [0xFF20]={d='on'},
 [0xFF3B]={d='on', m=0xFF3D},
 [0xFF3C]={d='on'},
 [0xFF3D]={d='on', m=0xFF3B},
 [0xFF3E]={d='on'},
 [0xFF3F]={d='on'},
 [0xFF40]={d='on'},
 [0xFF5B]={d='on', m=0xFF5D},
 [0xFF5C]={d='on'},
 [0xFF5D]={d='on', m=0xFF5B},
 [0xFF5E]={d='on'},
 [0xFF5F]={d='on', m=0xFF60},
 [0xFF60]={d='on', m=0xFF5F},
 [0xFF61]={d='on'},
 [0xFF62]={d='on', m=0xFF63},
 [0xFF63]={d='on', m=0xFF62},
 [0xFF64]={d='on'},
 [0xFF65]={d='on'},
 [0xFFE0]={d='et'},
 [0xFFE1]={d='et'},
 [0xFFE2]={d='on'},
 [0xFFE3]={d='on'},
 [0xFFE4]={d='on'},
 [0xFFE5]={d='et'},
 [0xFFE6]={d='et'},
 [0xFFE8]={d='on'},
 [0xFFE9]={d='on'},
 [0xFFEA]={d='on'},
 [0xFFEB]={d='on'},
 [0xFFEC]={d='on'},
 [0xFFED]={d='on'},
 [0xFFEE]={d='on'},
 [0xFFF9]={d='on'},
 [0xFFFA]={d='on'},
 [0xFFFB]={d='on'},
 [0xFFFC]={d='on'},
 [0xFFFD]={d='on'},
 [0x10101]={d='on'},
 [0x10140]={d='on'},
 [0x10141]={d='on'},
 [0x10142]={d='on'},
 [0x10143]={d='on'},
 [0x10144]={d='on'},
 [0x10145]={d='on'},
 [0x10146]={d='on'},
 [0x10147]={d='on'},
 [0x10148]={d='on'},
 [0x10149]={d='on'},
 [0x1014A]={d='on'},
 [0x1014B]={d='on'},
 [0x1014C]={d='on'},
 [0x1014D]={d='on'},
 [0x1014E]={d='on'},
 [0x1014F]={d='on'},
 [0x10150]={d='on'},
 [0x10151]={d='on'},
 [0x10152]={d='on'},
 [0x10153]={d='on'},
 [0x10154]={d='on'},
 [0x10155]={d='on'},
 [0x10156]={d='on'},
 [0x10157]={d='on'},
 [0x10158]={d='on'},
 [0x10159]={d='on'},
 [0x1015A]={d='on'},
 [0x1015B]={d='on'},
 [0x1015C]={d='on'},
 [0x1015D]={d='on'},
 [0x1015E]={d='on'},
 [0x1015F]={d='on'},
 [0x10160]={d='on'},
 [0x10161]={d='on'},
 [0x10162]={d='on'},
 [0x10163]={d='on'},
 [0x10164]={d='on'},
 [0x10165]={d='on'},
 [0x10166]={d='on'},
 [0x10167]={d='on'},
 [0x10168]={d='on'},
 [0x10169]={d='on'},
 [0x1016A]={d='on'},
 [0x1016B]={d='on'},
 [0x1016C]={d='on'},
 [0x1016D]={d='on'},
 [0x1016E]={d='on'},
 [0x1016F]={d='on'},
 [0x10170]={d='on'},
 [0x10171]={d='on'},
 [0x10172]={d='on'},
 [0x10173]={d='on'},
 [0x10174]={d='on'},
 [0x10175]={d='on'},
 [0x10176]={d='on'},
 [0x10177]={d='on'},
 [0x10178]={d='on'},
 [0x10179]={d='on'},
 [0x1017A]={d='on'},
 [0x1017B]={d='on'},
 [0x1017C]={d='on'},
 [0x1017D]={d='on'},
 [0x1017E]={d='on'},
 [0x1017F]={d='on'},
 [0x10180]={d='on'},
 [0x10181]={d='on'},
 [0x10182]={d='on'},
 [0x10183]={d='on'},
 [0x10184]={d='on'},
 [0x10185]={d='on'},
 [0x10186]={d='on'},
 [0x10187]={d='on'},
 [0x10188]={d='on'},
 [0x10189]={d='on'},
 [0x1018A]={d='on'},
 [0x1018B]={d='on'},
 [0x1018C]={d='on'},
 [0x10190]={d='on'},
 [0x10191]={d='on'},
 [0x10192]={d='on'},
 [0x10193]={d='on'},
 [0x10194]={d='on'},
 [0x10195]={d='on'},
 [0x10196]={d='on'},
 [0x10197]={d='on'},
 [0x10198]={d='on'},
 [0x10199]={d='on'},
 [0x1019A]={d='on'},
 [0x1019B]={d='on'},
 [0x101A0]={d='on'},
 [0x101FD]={d='nsm'},
 [0x102E0]={d='nsm'},
 [0x102E1]={d='en'},
 [0x102E2]={d='en'},
 [0x102E3]={d='en'},
 [0x102E4]={d='en'},
 [0x102E5]={d='en'},
 [0x102E6]={d='en'},
 [0x102E7]={d='en'},
 [0x102E8]={d='en'},
 [0x102E9]={d='en'},
 [0x102EA]={d='en'},
 [0x102EB]={d='en'},
 [0x102EC]={d='en'},
 [0x102ED]={d='en'},
 [0x102EE]={d='en'},
 [0x102EF]={d='en'},
 [0x102F0]={d='en'},
 [0x102F1]={d='en'},
 [0x102F2]={d='en'},
 [0x102F3]={d='en'},
 [0x102F4]={d='en'},
 [0x102F5]={d='en'},
 [0x102F6]={d='en'},
 [0x102F7]={d='en'},
 [0x102F8]={d='en'},
 [0x102F9]={d='en'},
 [0x102FA]={d='en'},
 [0x102FB]={d='en'},
 [0x10376]={d='nsm'},
 [0x10377]={d='nsm'},
 [0x10378]={d='nsm'},
 [0x10379]={d='nsm'},
 [0x1037A]={d='nsm'},
 [0x1091F]={d='on'},
 [0x10A01]={d='nsm'},
 [0x10A02]={d='nsm'},
 [0x10A03]={d='nsm'},
 [0x10A05]={d='nsm'},
 [0x10A06]={d='nsm'},
 [0x10A0C]={d='nsm'},
 [0x10A0D]={d='nsm'},
 [0x10A0E]={d='nsm'},
 [0x10A0F]={d='nsm'},
 [0x10A38]={d='nsm'},
 [0x10A39]={d='nsm'},
 [0x10A3A]={d='nsm'},
 [0x10A3F]={d='nsm'},
 [0x10AE5]={d='nsm'},
 [0x10AE6]={d='nsm'},
 [0x10B39]={d='on'},
 [0x10B3A]={d='on'},
 [0x10B3B]={d='on'},
 [0x10B3C]={d='on'},
 [0x10B3D]={d='on'},
 [0x10B3E]={d='on'},
 [0x10B3F]={d='on'},
 [0x10C80]={d='r'},
 [0x10C81]={d='r'},
 [0x10C82]={d='r'},
 [0x10C83]={d='r'},
 [0x10C84]={d='r'},
 [0x10C85]={d='r'},
 [0x10C86]={d='r'},
 [0x10C87]={d='r'},
 [0x10C88]={d='r'},
 [0x10C89]={d='r'},
 [0x10C8A]={d='r'},
 [0x10C8B]={d='r'},
 [0x10C8C]={d='r'},
 [0x10C8D]={d='r'},
 [0x10C8E]={d='r'},
 [0x10C8F]={d='r'},
 [0x10C90]={d='r'},
 [0x10C91]={d='r'},
 [0x10C92]={d='r'},
 [0x10C93]={d='r'},
 [0x10C94]={d='r'},
 [0x10C95]={d='r'},
 [0x10C96]={d='r'},
 [0x10C97]={d='r'},
 [0x10C98]={d='r'},
 [0x10C99]={d='r'},
 [0x10C9A]={d='r'},
 [0x10C9B]={d='r'},
 [0x10C9C]={d='r'},
 [0x10C9D]={d='r'},
 [0x10C9E]={d='r'},
 [0x10C9F]={d='r'},
 [0x10CA0]={d='r'},
 [0x10CA1]={d='r'},
 [0x10CA2]={d='r'},
 [0x10CA3]={d='r'},
 [0x10CA4]={d='r'},
 [0x10CA5]={d='r'},
 [0x10CA6]={d='r'},
 [0x10CA7]={d='r'},
 [0x10CA8]={d='r'},
 [0x10CA9]={d='r'},
 [0x10CAA]={d='r'},
 [0x10CAB]={d='r'},
 [0x10CAC]={d='r'},
 [0x10CAD]={d='r'},
 [0x10CAE]={d='r'},
 [0x10CAF]={d='r'},
 [0x10CB0]={d='r'},
 [0x10CB1]={d='r'},
 [0x10CB2]={d='r'},
 [0x10CC0]={d='r'},
 [0x10CC1]={d='r'},
 [0x10CC2]={d='r'},
 [0x10CC3]={d='r'},
 [0x10CC4]={d='r'},
 [0x10CC5]={d='r'},
 [0x10CC6]={d='r'},
 [0x10CC7]={d='r'},
 [0x10CC8]={d='r'},
 [0x10CC9]={d='r'},
 [0x10CCA]={d='r'},
 [0x10CCB]={d='r'},
 [0x10CCC]={d='r'},
 [0x10CCD]={d='r'},
 [0x10CCE]={d='r'},
 [0x10CCF]={d='r'},
 [0x10CD0]={d='r'},
 [0x10CD1]={d='r'},
 [0x10CD2]={d='r'},
 [0x10CD3]={d='r'},
 [0x10CD4]={d='r'},
 [0x10CD5]={d='r'},
 [0x10CD6]={d='r'},
 [0x10CD7]={d='r'},
 [0x10CD8]={d='r'},
 [0x10CD9]={d='r'},
 [0x10CDA]={d='r'},
 [0x10CDB]={d='r'},
 [0x10CDC]={d='r'},
 [0x10CDD]={d='r'},
 [0x10CDE]={d='r'},
 [0x10CDF]={d='r'},
 [0x10CE0]={d='r'},
 [0x10CE1]={d='r'},
 [0x10CE2]={d='r'},
 [0x10CE3]={d='r'},
 [0x10CE4]={d='r'},
 [0x10CE5]={d='r'},
 [0x10CE6]={d='r'},
 [0x10CE7]={d='r'},
 [0x10CE8]={d='r'},
 [0x10CE9]={d='r'},
 [0x10CEA]={d='r'},
 [0x10CEB]={d='r'},
 [0x10CEC]={d='r'},
 [0x10CED]={d='r'},
 [0x10CEE]={d='r'},
 [0x10CEF]={d='r'},
 [0x10CF0]={d='r'},
 [0x10CF1]={d='r'},
 [0x10CF2]={d='r'},
 [0x10CFA]={d='r'},
 [0x10CFB]={d='r'},
 [0x10CFC]={d='r'},
 [0x10CFD]={d='r'},
 [0x10CFE]={d='r'},
 [0x10CFF]={d='r'},
 [0x10E60]={d='an'},
 [0x10E61]={d='an'},
 [0x10E62]={d='an'},
 [0x10E63]={d='an'},
 [0x10E64]={d='an'},
 [0x10E65]={d='an'},
 [0x10E66]={d='an'},
 [0x10E67]={d='an'},
 [0x10E68]={d='an'},
 [0x10E69]={d='an'},
 [0x10E6A]={d='an'},
 [0x10E6B]={d='an'},
 [0x10E6C]={d='an'},
 [0x10E6D]={d='an'},
 [0x10E6E]={d='an'},
 [0x10E6F]={d='an'},
 [0x10E70]={d='an'},
 [0x10E71]={d='an'},
 [0x10E72]={d='an'},
 [0x10E73]={d='an'},
 [0x10E74]={d='an'},
 [0x10E75]={d='an'},
 [0x10E76]={d='an'},
 [0x10E77]={d='an'},
 [0x10E78]={d='an'},
 [0x10E79]={d='an'},
 [0x10E7A]={d='an'},
 [0x10E7B]={d='an'},
 [0x10E7C]={d='an'},
 [0x10E7D]={d='an'},
 [0x10E7E]={d='an'},
 [0x11001]={d='nsm'},
 [0x11038]={d='nsm'},
 [0x11039]={d='nsm'},
 [0x1103A]={d='nsm'},
 [0x1103B]={d='nsm'},
 [0x1103C]={d='nsm'},
 [0x1103D]={d='nsm'},
 [0x1103E]={d='nsm'},
 [0x1103F]={d='nsm'},
 [0x11040]={d='nsm'},
 [0x11041]={d='nsm'},
 [0x11042]={d='nsm'},
 [0x11043]={d='nsm'},
 [0x11044]={d='nsm'},
 [0x11045]={d='nsm'},
 [0x11046]={d='nsm'},
 [0x11052]={d='on'},
 [0x11053]={d='on'},
 [0x11054]={d='on'},
 [0x11055]={d='on'},
 [0x11056]={d='on'},
 [0x11057]={d='on'},
 [0x11058]={d='on'},
 [0x11059]={d='on'},
 [0x1105A]={d='on'},
 [0x1105B]={d='on'},
 [0x1105C]={d='on'},
 [0x1105D]={d='on'},
 [0x1105E]={d='on'},
 [0x1105F]={d='on'},
 [0x11060]={d='on'},
 [0x11061]={d='on'},
 [0x11062]={d='on'},
 [0x11063]={d='on'},
 [0x11064]={d='on'},
 [0x11065]={d='on'},
 [0x1107F]={d='nsm'},
 [0x11080]={d='nsm'},
 [0x11081]={d='nsm'},
 [0x110B3]={d='nsm'},
 [0x110B4]={d='nsm'},
 [0x110B5]={d='nsm'},
 [0x110B6]={d='nsm'},
 [0x110B9]={d='nsm'},
 [0x110BA]={d='nsm'},
 [0x11100]={d='nsm'},
 [0x11101]={d='nsm'},
 [0x11102]={d='nsm'},
 [0x11127]={d='nsm'},
 [0x11128]={d='nsm'},
 [0x11129]={d='nsm'},
 [0x1112A]={d='nsm'},
 [0x1112B]={d='nsm'},
 [0x1112D]={d='nsm'},
 [0x1112E]={d='nsm'},
 [0x1112F]={d='nsm'},
 [0x11130]={d='nsm'},
 [0x11131]={d='nsm'},
 [0x11132]={d='nsm'},
 [0x11133]={d='nsm'},
 [0x11134]={d='nsm'},
 [0x11173]={d='nsm'},
 [0x11180]={d='nsm'},
 [0x11181]={d='nsm'},
 [0x111B6]={d='nsm'},
 [0x111B7]={d='nsm'},
 [0x111B8]={d='nsm'},
 [0x111B9]={d='nsm'},
 [0x111BA]={d='nsm'},
 [0x111BB]={d='nsm'},
 [0x111BC]={d='nsm'},
 [0x111BD]={d='nsm'},
 [0x111BE]={d='nsm'},
 [0x111CA]={d='nsm'},
 [0x111CB]={d='nsm'},
 [0x111CC]={d='nsm'},
 [0x1122F]={d='nsm'},
 [0x11230]={d='nsm'},
 [0x11231]={d='nsm'},
 [0x11234]={d='nsm'},
 [0x11236]={d='nsm'},
 [0x11237]={d='nsm'},
 [0x1123E]={d='nsm'},
 [0x112DF]={d='nsm'},
 [0x112E3]={d='nsm'},
 [0x112E4]={d='nsm'},
 [0x112E5]={d='nsm'},
 [0x112E6]={d='nsm'},
 [0x112E7]={d='nsm'},
 [0x112E8]={d='nsm'},
 [0x112E9]={d='nsm'},
 [0x112EA]={d='nsm'},
 [0x11300]={d='nsm'},
 [0x11301]={d='nsm'},
 [0x1133C]={d='nsm'},
 [0x11340]={d='nsm'},
 [0x11366]={d='nsm'},
 [0x11367]={d='nsm'},
 [0x11368]={d='nsm'},
 [0x11369]={d='nsm'},
 [0x1136A]={d='nsm'},
 [0x1136B]={d='nsm'},
 [0x1136C]={d='nsm'},
 [0x11370]={d='nsm'},
 [0x11371]={d='nsm'},
 [0x11372]={d='nsm'},
 [0x11373]={d='nsm'},
 [0x11374]={d='nsm'},
 [0x11438]={d='nsm'},
 [0x11439]={d='nsm'},
 [0x1143A]={d='nsm'},
 [0x1143B]={d='nsm'},
 [0x1143C]={d='nsm'},
 [0x1143D]={d='nsm'},
 [0x1143E]={d='nsm'},
 [0x1143F]={d='nsm'},
 [0x11442]={d='nsm'},
 [0x11443]={d='nsm'},
 [0x11444]={d='nsm'},
 [0x11446]={d='nsm'},
 [0x114B3]={d='nsm'},
 [0x114B4]={d='nsm'},
 [0x114B5]={d='nsm'},
 [0x114B6]={d='nsm'},
 [0x114B7]={d='nsm'},
 [0x114B8]={d='nsm'},
 [0x114BA]={d='nsm'},
 [0x114BF]={d='nsm'},
 [0x114C0]={d='nsm'},
 [0x114C2]={d='nsm'},
 [0x114C3]={d='nsm'},
 [0x115B2]={d='nsm'},
 [0x115B3]={d='nsm'},
 [0x115B4]={d='nsm'},
 [0x115B5]={d='nsm'},
 [0x115BC]={d='nsm'},
 [0x115BD]={d='nsm'},
 [0x115BF]={d='nsm'},
 [0x115C0]={d='nsm'},
 [0x115DC]={d='nsm'},
 [0x115DD]={d='nsm'},
 [0x11633]={d='nsm'},
 [0x11634]={d='nsm'},
 [0x11635]={d='nsm'},
 [0x11636]={d='nsm'},
 [0x11637]={d='nsm'},
 [0x11638]={d='nsm'},
 [0x11639]={d='nsm'},
 [0x1163A]={d='nsm'},
 [0x1163D]={d='nsm'},
 [0x1163F]={d='nsm'},
 [0x11640]={d='nsm'},
 [0x11660]={d='on'},
 [0x11661]={d='on'},
 [0x11662]={d='on'},
 [0x11663]={d='on'},
 [0x11664]={d='on'},
 [0x11665]={d='on'},
 [0x11666]={d='on'},
 [0x11667]={d='on'},
 [0x11668]={d='on'},
 [0x11669]={d='on'},
 [0x1166A]={d='on'},
 [0x1166B]={d='on'},
 [0x1166C]={d='on'},
 [0x116AB]={d='nsm'},
 [0x116AD]={d='nsm'},
 [0x116B0]={d='nsm'},
 [0x116B1]={d='nsm'},
 [0x116B2]={d='nsm'},
 [0x116B3]={d='nsm'},
 [0x116B4]={d='nsm'},
 [0x116B5]={d='nsm'},
 [0x116B7]={d='nsm'},
 [0x1171D]={d='nsm'},
 [0x1171E]={d='nsm'},
 [0x1171F]={d='nsm'},
 [0x11722]={d='nsm'},
 [0x11723]={d='nsm'},
 [0x11724]={d='nsm'},
 [0x11725]={d='nsm'},
 [0x11727]={d='nsm'},
 [0x11728]={d='nsm'},
 [0x11729]={d='nsm'},
 [0x1172A]={d='nsm'},
 [0x1172B]={d='nsm'},
 [0x11C30]={d='nsm'},
 [0x11C31]={d='nsm'},
 [0x11C32]={d='nsm'},
 [0x11C33]={d='nsm'},
 [0x11C34]={d='nsm'},
 [0x11C35]={d='nsm'},
 [0x11C36]={d='nsm'},
 [0x11C38]={d='nsm'},
 [0x11C39]={d='nsm'},
 [0x11C3A]={d='nsm'},
 [0x11C3B]={d='nsm'},
 [0x11C3C]={d='nsm'},
 [0x11C3D]={d='nsm'},
 [0x11C92]={d='nsm'},
 [0x11C93]={d='nsm'},
 [0x11C94]={d='nsm'},
 [0x11C95]={d='nsm'},
 [0x11C96]={d='nsm'},
 [0x11C97]={d='nsm'},
 [0x11C98]={d='nsm'},
 [0x11C99]={d='nsm'},
 [0x11C9A]={d='nsm'},
 [0x11C9B]={d='nsm'},
 [0x11C9C]={d='nsm'},
 [0x11C9D]={d='nsm'},
 [0x11C9E]={d='nsm'},
 [0x11C9F]={d='nsm'},
 [0x11CA0]={d='nsm'},
 [0x11CA1]={d='nsm'},
 [0x11CA2]={d='nsm'},
 [0x11CA3]={d='nsm'},
 [0x11CA4]={d='nsm'},
 [0x11CA5]={d='nsm'},
 [0x11CA6]={d='nsm'},
 [0x11CA7]={d='nsm'},
 [0x11CAA]={d='nsm'},
 [0x11CAB]={d='nsm'},
 [0x11CAC]={d='nsm'},
 [0x11CAD]={d='nsm'},
 [0x11CAE]={d='nsm'},
 [0x11CAF]={d='nsm'},
 [0x11CB0]={d='nsm'},
 [0x11CB2]={d='nsm'},
 [0x11CB3]={d='nsm'},
 [0x11CB5]={d='nsm'},
 [0x11CB6]={d='nsm'},
 [0x16AF0]={d='nsm'},
 [0x16AF1]={d='nsm'},
 [0x16AF2]={d='nsm'},
 [0x16AF3]={d='nsm'},
 [0x16AF4]={d='nsm'},
 [0x16B30]={d='nsm'},
 [0x16B31]={d='nsm'},
 [0x16B32]={d='nsm'},
 [0x16B33]={d='nsm'},
 [0x16B34]={d='nsm'},
 [0x16B35]={d='nsm'},
 [0x16B36]={d='nsm'},
 [0x16F8F]={d='nsm'},
 [0x16F90]={d='nsm'},
 [0x16F91]={d='nsm'},
 [0x16F92]={d='nsm'},
 [0x1BC9D]={d='nsm'},
 [0x1BC9E]={d='nsm'},
 [0x1BCA0]={d='bn'},
 [0x1BCA1]={d='bn'},
 [0x1BCA2]={d='bn'},
 [0x1BCA3]={d='bn'},
 [0x1D167]={d='nsm'},
 [0x1D168]={d='nsm'},
 [0x1D169]={d='nsm'},
 [0x1D173]={d='bn'},
 [0x1D174]={d='bn'},
 [0x1D175]={d='bn'},
 [0x1D176]={d='bn'},
 [0x1D177]={d='bn'},
 [0x1D178]={d='bn'},
 [0x1D179]={d='bn'},
 [0x1D17A]={d='bn'},
 [0x1D17B]={d='nsm'},
 [0x1D17C]={d='nsm'},
 [0x1D17D]={d='nsm'},
 [0x1D17E]={d='nsm'},
 [0x1D17F]={d='nsm'},
 [0x1D180]={d='nsm'},
 [0x1D181]={d='nsm'},
 [0x1D182]={d='nsm'},
 [0x1D185]={d='nsm'},
 [0x1D186]={d='nsm'},
 [0x1D187]={d='nsm'},
 [0x1D188]={d='nsm'},
 [0x1D189]={d='nsm'},
 [0x1D18A]={d='nsm'},
 [0x1D18B]={d='nsm'},
 [0x1D1AA]={d='nsm'},
 [0x1D1AB]={d='nsm'},
 [0x1D1AC]={d='nsm'},
 [0x1D1AD]={d='nsm'},
 [0x1D200]={d='on'},
 [0x1D201]={d='on'},
 [0x1D202]={d='on'},
 [0x1D203]={d='on'},
 [0x1D204]={d='on'},
 [0x1D205]={d='on'},
 [0x1D206]={d='on'},
 [0x1D207]={d='on'},
 [0x1D208]={d='on'},
 [0x1D209]={d='on'},
 [0x1D20A]={d='on'},
 [0x1D20B]={d='on'},
 [0x1D20C]={d='on'},
 [0x1D20D]={d='on'},
 [0x1D20E]={d='on'},
 [0x1D20F]={d='on'},
 [0x1D210]={d='on'},
 [0x1D211]={d='on'},
 [0x1D212]={d='on'},
 [0x1D213]={d='on'},
 [0x1D214]={d='on'},
 [0x1D215]={d='on'},
 [0x1D216]={d='on'},
 [0x1D217]={d='on'},
 [0x1D218]={d='on'},
 [0x1D219]={d='on'},
 [0x1D21A]={d='on'},
 [0x1D21B]={d='on'},
 [0x1D21C]={d='on'},
 [0x1D21D]={d='on'},
 [0x1D21E]={d='on'},
 [0x1D21F]={d='on'},
 [0x1D220]={d='on'},
 [0x1D221]={d='on'},
 [0x1D222]={d='on'},
 [0x1D223]={d='on'},
 [0x1D224]={d='on'},
 [0x1D225]={d='on'},
 [0x1D226]={d='on'},
 [0x1D227]={d='on'},
 [0x1D228]={d='on'},
 [0x1D229]={d='on'},
 [0x1D22A]={d='on'},
 [0x1D22B]={d='on'},
 [0x1D22C]={d='on'},
 [0x1D22D]={d='on'},
 [0x1D22E]={d='on'},
 [0x1D22F]={d='on'},
 [0x1D230]={d='on'},
 [0x1D231]={d='on'},
 [0x1D232]={d='on'},
 [0x1D233]={d='on'},
 [0x1D234]={d='on'},
 [0x1D235]={d='on'},
 [0x1D236]={d='on'},
 [0x1D237]={d='on'},
 [0x1D238]={d='on'},
 [0x1D239]={d='on'},
 [0x1D23A]={d='on'},
 [0x1D23B]={d='on'},
 [0x1D23C]={d='on'},
 [0x1D23D]={d='on'},
 [0x1D23E]={d='on'},
 [0x1D23F]={d='on'},
 [0x1D240]={d='on'},
 [0x1D241]={d='on'},
 [0x1D242]={d='nsm'},
 [0x1D243]={d='nsm'},
 [0x1D244]={d='nsm'},
 [0x1D245]={d='on'},
 [0x1D300]={d='on'},
 [0x1D301]={d='on'},
 [0x1D302]={d='on'},
 [0x1D303]={d='on'},
 [0x1D304]={d='on'},
 [0x1D305]={d='on'},
 [0x1D306]={d='on'},
 [0x1D307]={d='on'},
 [0x1D308]={d='on'},
 [0x1D309]={d='on'},
 [0x1D30A]={d='on'},
 [0x1D30B]={d='on'},
 [0x1D30C]={d='on'},
 [0x1D30D]={d='on'},
 [0x1D30E]={d='on'},
 [0x1D30F]={d='on'},
 [0x1D310]={d='on'},
 [0x1D311]={d='on'},
 [0x1D312]={d='on'},
 [0x1D313]={d='on'},
 [0x1D314]={d='on'},
 [0x1D315]={d='on'},
 [0x1D316]={d='on'},
 [0x1D317]={d='on'},
 [0x1D318]={d='on'},
 [0x1D319]={d='on'},
 [0x1D31A]={d='on'},
 [0x1D31B]={d='on'},
 [0x1D31C]={d='on'},
 [0x1D31D]={d='on'},
 [0x1D31E]={d='on'},
 [0x1D31F]={d='on'},
 [0x1D320]={d='on'},
 [0x1D321]={d='on'},
 [0x1D322]={d='on'},
 [0x1D323]={d='on'},
 [0x1D324]={d='on'},
 [0x1D325]={d='on'},
 [0x1D326]={d='on'},
 [0x1D327]={d='on'},
 [0x1D328]={d='on'},
 [0x1D329]={d='on'},
 [0x1D32A]={d='on'},
 [0x1D32B]={d='on'},
 [0x1D32C]={d='on'},
 [0x1D32D]={d='on'},
 [0x1D32E]={d='on'},
 [0x1D32F]={d='on'},
 [0x1D330]={d='on'},
 [0x1D331]={d='on'},
 [0x1D332]={d='on'},
 [0x1D333]={d='on'},
 [0x1D334]={d='on'},
 [0x1D335]={d='on'},
 [0x1D336]={d='on'},
 [0x1D337]={d='on'},
 [0x1D338]={d='on'},
 [0x1D339]={d='on'},
 [0x1D33A]={d='on'},
 [0x1D33B]={d='on'},
 [0x1D33C]={d='on'},
 [0x1D33D]={d='on'},
 [0x1D33E]={d='on'},
 [0x1D33F]={d='on'},
 [0x1D340]={d='on'},
 [0x1D341]={d='on'},
 [0x1D342]={d='on'},
 [0x1D343]={d='on'},
 [0x1D344]={d='on'},
 [0x1D345]={d='on'},
 [0x1D346]={d='on'},
 [0x1D347]={d='on'},
 [0x1D348]={d='on'},
 [0x1D349]={d='on'},
 [0x1D34A]={d='on'},
 [0x1D34B]={d='on'},
 [0x1D34C]={d='on'},
 [0x1D34D]={d='on'},
 [0x1D34E]={d='on'},
 [0x1D34F]={d='on'},
 [0x1D350]={d='on'},
 [0x1D351]={d='on'},
 [0x1D352]={d='on'},
 [0x1D353]={d='on'},
 [0x1D354]={d='on'},
 [0x1D355]={d='on'},
 [0x1D356]={d='on'},
 [0x1D6DB]={d='on'},
 [0x1D715]={d='on'},
 [0x1D74F]={d='on'},
 [0x1D789]={d='on'},
 [0x1D7C3]={d='on'},
 [0x1D7CE]={d='en'},
 [0x1D7CF]={d='en'},
 [0x1D7D0]={d='en'},
 [0x1D7D1]={d='en'},
 [0x1D7D2]={d='en'},
 [0x1D7D3]={d='en'},
 [0x1D7D4]={d='en'},
 [0x1D7D5]={d='en'},
 [0x1D7D6]={d='en'},
 [0x1D7D7]={d='en'},
 [0x1D7D8]={d='en'},
 [0x1D7D9]={d='en'},
 [0x1D7DA]={d='en'},
 [0x1D7DB]={d='en'},
 [0x1D7DC]={d='en'},
 [0x1D7DD]={d='en'},
 [0x1D7DE]={d='en'},
 [0x1D7DF]={d='en'},
 [0x1D7E0]={d='en'},
 [0x1D7E1]={d='en'},
 [0x1D7E2]={d='en'},
 [0x1D7E3]={d='en'},
 [0x1D7E4]={d='en'},
 [0x1D7E5]={d='en'},
 [0x1D7E6]={d='en'},
 [0x1D7E7]={d='en'},
 [0x1D7E8]={d='en'},
 [0x1D7E9]={d='en'},
 [0x1D7EA]={d='en'},
 [0x1D7EB]={d='en'},
 [0x1D7EC]={d='en'},
 [0x1D7ED]={d='en'},
 [0x1D7EE]={d='en'},
 [0x1D7EF]={d='en'},
 [0x1D7F0]={d='en'},
 [0x1D7F1]={d='en'},
 [0x1D7F2]={d='en'},
 [0x1D7F3]={d='en'},
 [0x1D7F4]={d='en'},
 [0x1D7F5]={d='en'},
 [0x1D7F6]={d='en'},
 [0x1D7F7]={d='en'},
 [0x1D7F8]={d='en'},
 [0x1D7F9]={d='en'},
 [0x1D7FA]={d='en'},
 [0x1D7FB]={d='en'},
 [0x1D7FC]={d='en'},
 [0x1D7FD]={d='en'},
 [0x1D7FE]={d='en'},
 [0x1D7FF]={d='en'},
 [0x1DA00]={d='nsm'},
 [0x1DA01]={d='nsm'},
 [0x1DA02]={d='nsm'},
 [0x1DA03]={d='nsm'},
 [0x1DA04]={d='nsm'},
 [0x1DA05]={d='nsm'},
 [0x1DA06]={d='nsm'},
 [0x1DA07]={d='nsm'},
 [0x1DA08]={d='nsm'},
 [0x1DA09]={d='nsm'},
 [0x1DA0A]={d='nsm'},
 [0x1DA0B]={d='nsm'},
 [0x1DA0C]={d='nsm'},
 [0x1DA0D]={d='nsm'},
 [0x1DA0E]={d='nsm'},
 [0x1DA0F]={d='nsm'},
 [0x1DA10]={d='nsm'},
 [0x1DA11]={d='nsm'},
 [0x1DA12]={d='nsm'},
 [0x1DA13]={d='nsm'},
 [0x1DA14]={d='nsm'},
 [0x1DA15]={d='nsm'},
 [0x1DA16]={d='nsm'},
 [0x1DA17]={d='nsm'},
 [0x1DA18]={d='nsm'},
 [0x1DA19]={d='nsm'},
 [0x1DA1A]={d='nsm'},
 [0x1DA1B]={d='nsm'},
 [0x1DA1C]={d='nsm'},
 [0x1DA1D]={d='nsm'},
 [0x1DA1E]={d='nsm'},
 [0x1DA1F]={d='nsm'},
 [0x1DA20]={d='nsm'},
 [0x1DA21]={d='nsm'},
 [0x1DA22]={d='nsm'},
 [0x1DA23]={d='nsm'},
 [0x1DA24]={d='nsm'},
 [0x1DA25]={d='nsm'},
 [0x1DA26]={d='nsm'},
 [0x1DA27]={d='nsm'},
 [0x1DA28]={d='nsm'},
 [0x1DA29]={d='nsm'},
 [0x1DA2A]={d='nsm'},
 [0x1DA2B]={d='nsm'},
 [0x1DA2C]={d='nsm'},
 [0x1DA2D]={d='nsm'},
 [0x1DA2E]={d='nsm'},
 [0x1DA2F]={d='nsm'},
 [0x1DA30]={d='nsm'},
 [0x1DA31]={d='nsm'},
 [0x1DA32]={d='nsm'},
 [0x1DA33]={d='nsm'},
 [0x1DA34]={d='nsm'},
 [0x1DA35]={d='nsm'},
 [0x1DA36]={d='nsm'},
 [0x1DA3B]={d='nsm'},
 [0x1DA3C]={d='nsm'},
 [0x1DA3D]={d='nsm'},
 [0x1DA3E]={d='nsm'},
 [0x1DA3F]={d='nsm'},
 [0x1DA40]={d='nsm'},
 [0x1DA41]={d='nsm'},
 [0x1DA42]={d='nsm'},
 [0x1DA43]={d='nsm'},
 [0x1DA44]={d='nsm'},
 [0x1DA45]={d='nsm'},
 [0x1DA46]={d='nsm'},
 [0x1DA47]={d='nsm'},
 [0x1DA48]={d='nsm'},
 [0x1DA49]={d='nsm'},
 [0x1DA4A]={d='nsm'},
 [0x1DA4B]={d='nsm'},
 [0x1DA4C]={d='nsm'},
 [0x1DA4D]={d='nsm'},
 [0x1DA4E]={d='nsm'},
 [0x1DA4F]={d='nsm'},
 [0x1DA50]={d='nsm'},
 [0x1DA51]={d='nsm'},
 [0x1DA52]={d='nsm'},
 [0x1DA53]={d='nsm'},
 [0x1DA54]={d='nsm'},
 [0x1DA55]={d='nsm'},
 [0x1DA56]={d='nsm'},
 [0x1DA57]={d='nsm'},
 [0x1DA58]={d='nsm'},
 [0x1DA59]={d='nsm'},
 [0x1DA5A]={d='nsm'},
 [0x1DA5B]={d='nsm'},
 [0x1DA5C]={d='nsm'},
 [0x1DA5D]={d='nsm'},
 [0x1DA5E]={d='nsm'},
 [0x1DA5F]={d='nsm'},
 [0x1DA60]={d='nsm'},
 [0x1DA61]={d='nsm'},
 [0x1DA62]={d='nsm'},
 [0x1DA63]={d='nsm'},
 [0x1DA64]={d='nsm'},
 [0x1DA65]={d='nsm'},
 [0x1DA66]={d='nsm'},
 [0x1DA67]={d='nsm'},
 [0x1DA68]={d='nsm'},
 [0x1DA69]={d='nsm'},
 [0x1DA6A]={d='nsm'},
 [0x1DA6B]={d='nsm'},
 [0x1DA6C]={d='nsm'},
 [0x1DA75]={d='nsm'},
 [0x1DA84]={d='nsm'},
 [0x1DA9B]={d='nsm'},
 [0x1DA9C]={d='nsm'},
 [0x1DA9D]={d='nsm'},
 [0x1DA9E]={d='nsm'},
 [0x1DA9F]={d='nsm'},
 [0x1DAA1]={d='nsm'},
 [0x1DAA2]={d='nsm'},
 [0x1DAA3]={d='nsm'},
 [0x1DAA4]={d='nsm'},
 [0x1DAA5]={d='nsm'},
 [0x1DAA6]={d='nsm'},
 [0x1DAA7]={d='nsm'},
 [0x1DAA8]={d='nsm'},
 [0x1DAA9]={d='nsm'},
 [0x1DAAA]={d='nsm'},
 [0x1DAAB]={d='nsm'},
 [0x1DAAC]={d='nsm'},
 [0x1DAAD]={d='nsm'},
 [0x1DAAE]={d='nsm'},
 [0x1DAAF]={d='nsm'},
 [0x1E000]={d='nsm'},
 [0x1E001]={d='nsm'},
 [0x1E002]={d='nsm'},
 [0x1E003]={d='nsm'},
 [0x1E004]={d='nsm'},
 [0x1E005]={d='nsm'},
 [0x1E006]={d='nsm'},
 [0x1E008]={d='nsm'},
 [0x1E009]={d='nsm'},
 [0x1E00A]={d='nsm'},
 [0x1E00B]={d='nsm'},
 [0x1E00C]={d='nsm'},
 [0x1E00D]={d='nsm'},
 [0x1E00E]={d='nsm'},
 [0x1E00F]={d='nsm'},
 [0x1E010]={d='nsm'},
 [0x1E011]={d='nsm'},
 [0x1E012]={d='nsm'},
 [0x1E013]={d='nsm'},
 [0x1E014]={d='nsm'},
 [0x1E015]={d='nsm'},
 [0x1E016]={d='nsm'},
 [0x1E017]={d='nsm'},
 [0x1E018]={d='nsm'},
 [0x1E01B]={d='nsm'},
 [0x1E01C]={d='nsm'},
 [0x1E01D]={d='nsm'},
 [0x1E01E]={d='nsm'},
 [0x1E01F]={d='nsm'},
 [0x1E020]={d='nsm'},
 [0x1E021]={d='nsm'},
 [0x1E023]={d='nsm'},
 [0x1E024]={d='nsm'},
 [0x1E026]={d='nsm'},
 [0x1E027]={d='nsm'},
 [0x1E028]={d='nsm'},
 [0x1E029]={d='nsm'},
 [0x1E02A]={d='nsm'},
 [0x1E8D0]={d='nsm'},
 [0x1E8D1]={d='nsm'},
 [0x1E8D2]={d='nsm'},
 [0x1E8D3]={d='nsm'},
 [0x1E8D4]={d='nsm'},
 [0x1E8D5]={d='nsm'},
 [0x1E8D6]={d='nsm'},
 [0x1E944]={d='nsm'},
 [0x1E945]={d='nsm'},
 [0x1E946]={d='nsm'},
 [0x1E947]={d='nsm'},
 [0x1E948]={d='nsm'},
 [0x1E949]={d='nsm'},
 [0x1E94A]={d='nsm'},
 [0x1EE00]={d='al'},
 [0x1EE01]={d='al'},
 [0x1EE02]={d='al'},
 [0x1EE03]={d='al'},
 [0x1EE05]={d='al'},
 [0x1EE06]={d='al'},
 [0x1EE07]={d='al'},
 [0x1EE08]={d='al'},
 [0x1EE09]={d='al'},
 [0x1EE0A]={d='al'},
 [0x1EE0B]={d='al'},
 [0x1EE0C]={d='al'},
 [0x1EE0D]={d='al'},
 [0x1EE0E]={d='al'},
 [0x1EE0F]={d='al'},
 [0x1EE10]={d='al'},
 [0x1EE11]={d='al'},
 [0x1EE12]={d='al'},
 [0x1EE13]={d='al'},
 [0x1EE14]={d='al'},
 [0x1EE15]={d='al'},
 [0x1EE16]={d='al'},
 [0x1EE17]={d='al'},
 [0x1EE18]={d='al'},
 [0x1EE19]={d='al'},
 [0x1EE1A]={d='al'},
 [0x1EE1B]={d='al'},
 [0x1EE1C]={d='al'},
 [0x1EE1D]={d='al'},
 [0x1EE1E]={d='al'},
 [0x1EE1F]={d='al'},
 [0x1EE21]={d='al'},
 [0x1EE22]={d='al'},
 [0x1EE24]={d='al'},
 [0x1EE27]={d='al'},
 [0x1EE29]={d='al'},
 [0x1EE2A]={d='al'},
 [0x1EE2B]={d='al'},
 [0x1EE2C]={d='al'},
 [0x1EE2D]={d='al'},
 [0x1EE2E]={d='al'},
 [0x1EE2F]={d='al'},
 [0x1EE30]={d='al'},
 [0x1EE31]={d='al'},
 [0x1EE32]={d='al'},
 [0x1EE34]={d='al'},
 [0x1EE35]={d='al'},
 [0x1EE36]={d='al'},
 [0x1EE37]={d='al'},
 [0x1EE39]={d='al'},
 [0x1EE3B]={d='al'},
 [0x1EE42]={d='al'},
 [0x1EE47]={d='al'},
 [0x1EE49]={d='al'},
 [0x1EE4B]={d='al'},
 [0x1EE4D]={d='al'},
 [0x1EE4E]={d='al'},
 [0x1EE4F]={d='al'},
 [0x1EE51]={d='al'},
 [0x1EE52]={d='al'},
 [0x1EE54]={d='al'},
 [0x1EE57]={d='al'},
 [0x1EE59]={d='al'},
 [0x1EE5B]={d='al'},
 [0x1EE5D]={d='al'},
 [0x1EE5F]={d='al'},
 [0x1EE61]={d='al'},
 [0x1EE62]={d='al'},
 [0x1EE64]={d='al'},
 [0x1EE67]={d='al'},
 [0x1EE68]={d='al'},
 [0x1EE69]={d='al'},
 [0x1EE6A]={d='al'},
 [0x1EE6C]={d='al'},
 [0x1EE6D]={d='al'},
 [0x1EE6E]={d='al'},
 [0x1EE6F]={d='al'},
 [0x1EE70]={d='al'},
 [0x1EE71]={d='al'},
 [0x1EE72]={d='al'},
 [0x1EE74]={d='al'},
 [0x1EE75]={d='al'},
 [0x1EE76]={d='al'},
 [0x1EE77]={d='al'},
 [0x1EE79]={d='al'},
 [0x1EE7A]={d='al'},
 [0x1EE7B]={d='al'},
 [0x1EE7C]={d='al'},
 [0x1EE7E]={d='al'},
 [0x1EE80]={d='al'},
 [0x1EE81]={d='al'},
 [0x1EE82]={d='al'},
 [0x1EE83]={d='al'},
 [0x1EE84]={d='al'},
 [0x1EE85]={d='al'},
 [0x1EE86]={d='al'},
 [0x1EE87]={d='al'},
 [0x1EE88]={d='al'},
 [0x1EE89]={d='al'},
 [0x1EE8B]={d='al'},
 [0x1EE8C]={d='al'},
 [0x1EE8D]={d='al'},
 [0x1EE8E]={d='al'},
 [0x1EE8F]={d='al'},
 [0x1EE90]={d='al'},
 [0x1EE91]={d='al'},
 [0x1EE92]={d='al'},
 [0x1EE93]={d='al'},
 [0x1EE94]={d='al'},
 [0x1EE95]={d='al'},
 [0x1EE96]={d='al'},
 [0x1EE97]={d='al'},
 [0x1EE98]={d='al'},
 [0x1EE99]={d='al'},
 [0x1EE9A]={d='al'},
 [0x1EE9B]={d='al'},
 [0x1EEA1]={d='al'},
 [0x1EEA2]={d='al'},
 [0x1EEA3]={d='al'},
 [0x1EEA5]={d='al'},
 [0x1EEA6]={d='al'},
 [0x1EEA7]={d='al'},
 [0x1EEA8]={d='al'},
 [0x1EEA9]={d='al'},
 [0x1EEAB]={d='al'},
 [0x1EEAC]={d='al'},
 [0x1EEAD]={d='al'},
 [0x1EEAE]={d='al'},
 [0x1EEAF]={d='al'},
 [0x1EEB0]={d='al'},
 [0x1EEB1]={d='al'},
 [0x1EEB2]={d='al'},
 [0x1EEB3]={d='al'},
 [0x1EEB4]={d='al'},
 [0x1EEB5]={d='al'},
 [0x1EEB6]={d='al'},
 [0x1EEB7]={d='al'},
 [0x1EEB8]={d='al'},
 [0x1EEB9]={d='al'},
 [0x1EEBA]={d='al'},
 [0x1EEBB]={d='al'},
 [0x1EEF0]={d='on'},
 [0x1EEF1]={d='on'},
 [0x1F000]={d='on'},
 [0x1F001]={d='on'},
 [0x1F002]={d='on'},
 [0x1F003]={d='on'},
 [0x1F004]={d='on'},
 [0x1F005]={d='on'},
 [0x1F006]={d='on'},
 [0x1F007]={d='on'},
 [0x1F008]={d='on'},
 [0x1F009]={d='on'},
 [0x1F00A]={d='on'},
 [0x1F00B]={d='on'},
 [0x1F00C]={d='on'},
 [0x1F00D]={d='on'},
 [0x1F00E]={d='on'},
 [0x1F00F]={d='on'},
 [0x1F010]={d='on'},
 [0x1F011]={d='on'},
 [0x1F012]={d='on'},
 [0x1F013]={d='on'},
 [0x1F014]={d='on'},
 [0x1F015]={d='on'},
 [0x1F016]={d='on'},
 [0x1F017]={d='on'},
 [0x1F018]={d='on'},
 [0x1F019]={d='on'},
 [0x1F01A]={d='on'},
 [0x1F01B]={d='on'},
 [0x1F01C]={d='on'},
 [0x1F01D]={d='on'},
 [0x1F01E]={d='on'},
 [0x1F01F]={d='on'},
 [0x1F020]={d='on'},
 [0x1F021]={d='on'},
 [0x1F022]={d='on'},
 [0x1F023]={d='on'},
 [0x1F024]={d='on'},
 [0x1F025]={d='on'},
 [0x1F026]={d='on'},
 [0x1F027]={d='on'},
 [0x1F028]={d='on'},
 [0x1F029]={d='on'},
 [0x1F02A]={d='on'},
 [0x1F02B]={d='on'},
 [0x1F030]={d='on'},
 [0x1F031]={d='on'},
 [0x1F032]={d='on'},
 [0x1F033]={d='on'},
 [0x1F034]={d='on'},
 [0x1F035]={d='on'},
 [0x1F036]={d='on'},
 [0x1F037]={d='on'},
 [0x1F038]={d='on'},
 [0x1F039]={d='on'},
 [0x1F03A]={d='on'},
 [0x1F03B]={d='on'},
 [0x1F03C]={d='on'},
 [0x1F03D]={d='on'},
 [0x1F03E]={d='on'},
 [0x1F03F]={d='on'},
 [0x1F040]={d='on'},
 [0x1F041]={d='on'},
 [0x1F042]={d='on'},
 [0x1F043]={d='on'},
 [0x1F044]={d='on'},
 [0x1F045]={d='on'},
 [0x1F046]={d='on'},
 [0x1F047]={d='on'},
 [0x1F048]={d='on'},
 [0x1F049]={d='on'},
 [0x1F04A]={d='on'},
 [0x1F04B]={d='on'},
 [0x1F04C]={d='on'},
 [0x1F04D]={d='on'},
 [0x1F04E]={d='on'},
 [0x1F04F]={d='on'},
 [0x1F050]={d='on'},
 [0x1F051]={d='on'},
 [0x1F052]={d='on'},
 [0x1F053]={d='on'},
 [0x1F054]={d='on'},
 [0x1F055]={d='on'},
 [0x1F056]={d='on'},
 [0x1F057]={d='on'},
 [0x1F058]={d='on'},
 [0x1F059]={d='on'},
 [0x1F05A]={d='on'},
 [0x1F05B]={d='on'},
 [0x1F05C]={d='on'},
 [0x1F05D]={d='on'},
 [0x1F05E]={d='on'},
 [0x1F05F]={d='on'},
 [0x1F060]={d='on'},
 [0x1F061]={d='on'},
 [0x1F062]={d='on'},
 [0x1F063]={d='on'},
 [0x1F064]={d='on'},
 [0x1F065]={d='on'},
 [0x1F066]={d='on'},
 [0x1F067]={d='on'},
 [0x1F068]={d='on'},
 [0x1F069]={d='on'},
 [0x1F06A]={d='on'},
 [0x1F06B]={d='on'},
 [0x1F06C]={d='on'},
 [0x1F06D]={d='on'},
 [0x1F06E]={d='on'},
 [0x1F06F]={d='on'},
 [0x1F070]={d='on'},
 [0x1F071]={d='on'},
 [0x1F072]={d='on'},
 [0x1F073]={d='on'},
 [0x1F074]={d='on'},
 [0x1F075]={d='on'},
 [0x1F076]={d='on'},
 [0x1F077]={d='on'},
 [0x1F078]={d='on'},
 [0x1F079]={d='on'},
 [0x1F07A]={d='on'},
 [0x1F07B]={d='on'},
 [0x1F07C]={d='on'},
 [0x1F07D]={d='on'},
 [0x1F07E]={d='on'},
 [0x1F07F]={d='on'},
 [0x1F080]={d='on'},
 [0x1F081]={d='on'},
 [0x1F082]={d='on'},
 [0x1F083]={d='on'},
 [0x1F084]={d='on'},
 [0x1F085]={d='on'},
 [0x1F086]={d='on'},
 [0x1F087]={d='on'},
 [0x1F088]={d='on'},
 [0x1F089]={d='on'},
 [0x1F08A]={d='on'},
 [0x1F08B]={d='on'},
 [0x1F08C]={d='on'},
 [0x1F08D]={d='on'},
 [0x1F08E]={d='on'},
 [0x1F08F]={d='on'},
 [0x1F090]={d='on'},
 [0x1F091]={d='on'},
 [0x1F092]={d='on'},
 [0x1F093]={d='on'},
 [0x1F0A0]={d='on'},
 [0x1F0A1]={d='on'},
 [0x1F0A2]={d='on'},
 [0x1F0A3]={d='on'},
 [0x1F0A4]={d='on'},
 [0x1F0A5]={d='on'},
 [0x1F0A6]={d='on'},
 [0x1F0A7]={d='on'},
 [0x1F0A8]={d='on'},
 [0x1F0A9]={d='on'},
 [0x1F0AA]={d='on'},
 [0x1F0AB]={d='on'},
 [0x1F0AC]={d='on'},
 [0x1F0AD]={d='on'},
 [0x1F0AE]={d='on'},
 [0x1F0B1]={d='on'},
 [0x1F0B2]={d='on'},
 [0x1F0B3]={d='on'},
 [0x1F0B4]={d='on'},
 [0x1F0B5]={d='on'},
 [0x1F0B6]={d='on'},
 [0x1F0B7]={d='on'},
 [0x1F0B8]={d='on'},
 [0x1F0B9]={d='on'},
 [0x1F0BA]={d='on'},
 [0x1F0BB]={d='on'},
 [0x1F0BC]={d='on'},
 [0x1F0BD]={d='on'},
 [0x1F0BE]={d='on'},
 [0x1F0BF]={d='on'},
 [0x1F0C1]={d='on'},
 [0x1F0C2]={d='on'},
 [0x1F0C3]={d='on'},
 [0x1F0C4]={d='on'},
 [0x1F0C5]={d='on'},
 [0x1F0C6]={d='on'},
 [0x1F0C7]={d='on'},
 [0x1F0C8]={d='on'},
 [0x1F0C9]={d='on'},
 [0x1F0CA]={d='on'},
 [0x1F0CB]={d='on'},
 [0x1F0CC]={d='on'},
 [0x1F0CD]={d='on'},
 [0x1F0CE]={d='on'},
 [0x1F0CF]={d='on'},
 [0x1F0D1]={d='on'},
 [0x1F0D2]={d='on'},
 [0x1F0D3]={d='on'},
 [0x1F0D4]={d='on'},
 [0x1F0D5]={d='on'},
 [0x1F0D6]={d='on'},
 [0x1F0D7]={d='on'},
 [0x1F0D8]={d='on'},
 [0x1F0D9]={d='on'},
 [0x1F0DA]={d='on'},
 [0x1F0DB]={d='on'},
 [0x1F0DC]={d='on'},
 [0x1F0DD]={d='on'},
 [0x1F0DE]={d='on'},
 [0x1F0DF]={d='on'},
 [0x1F0E0]={d='on'},
 [0x1F0E1]={d='on'},
 [0x1F0E2]={d='on'},
 [0x1F0E3]={d='on'},
 [0x1F0E4]={d='on'},
 [0x1F0E5]={d='on'},
 [0x1F0E6]={d='on'},
 [0x1F0E7]={d='on'},
 [0x1F0E8]={d='on'},
 [0x1F0E9]={d='on'},
 [0x1F0EA]={d='on'},
 [0x1F0EB]={d='on'},
 [0x1F0EC]={d='on'},
 [0x1F0ED]={d='on'},
 [0x1F0EE]={d='on'},
 [0x1F0EF]={d='on'},
 [0x1F0F0]={d='on'},
 [0x1F0F1]={d='on'},
 [0x1F0F2]={d='on'},
 [0x1F0F3]={d='on'},
 [0x1F0F4]={d='on'},
 [0x1F0F5]={d='on'},
 [0x1F100]={d='en'},
 [0x1F101]={d='en'},
 [0x1F102]={d='en'},
 [0x1F103]={d='en'},
 [0x1F104]={d='en'},
 [0x1F105]={d='en'},
 [0x1F106]={d='en'},
 [0x1F107]={d='en'},
 [0x1F108]={d='en'},
 [0x1F109]={d='en'},
 [0x1F10A]={d='en'},
 [0x1F10B]={d='on'},
 [0x1F10C]={d='on'},
 [0x1F16A]={d='on'},
 [0x1F16B]={d='on'},
 [0xE0001]={d='bn'},
 [0xE0020]={d='bn'},
 [0xE0021]={d='bn'},
 [0xE0022]={d='bn'},
 [0xE0023]={d='bn'},
 [0xE0024]={d='bn'},
 [0xE0025]={d='bn'},
 [0xE0026]={d='bn'},
 [0xE0027]={d='bn'},
 [0xE0028]={d='bn'},
 [0xE0029]={d='bn'},
 [0xE002A]={d='bn'},
 [0xE002B]={d='bn'},
 [0xE002C]={d='bn'},
 [0xE002D]={d='bn'},
 [0xE002E]={d='bn'},
 [0xE002F]={d='bn'},
 [0xE0030]={d='bn'},
 [0xE0031]={d='bn'},
 [0xE0032]={d='bn'},
 [0xE0033]={d='bn'},
 [0xE0034]={d='bn'},
 [0xE0035]={d='bn'},
 [0xE0036]={d='bn'},
 [0xE0037]={d='bn'},
 [0xE0038]={d='bn'},
 [0xE0039]={d='bn'},
 [0xE003A]={d='bn'},
 [0xE003B]={d='bn'},
 [0xE003C]={d='bn'},
 [0xE003D]={d='bn'},
 [0xE003E]={d='bn'},
 [0xE003F]={d='bn'},
 [0xE0040]={d='bn'},
 [0xE0041]={d='bn'},
 [0xE0042]={d='bn'},
 [0xE0043]={d='bn'},
 [0xE0044]={d='bn'},
 [0xE0045]={d='bn'},
 [0xE0046]={d='bn'},
 [0xE0047]={d='bn'},
 [0xE0048]={d='bn'},
 [0xE0049]={d='bn'},
 [0xE004A]={d='bn'},
 [0xE004B]={d='bn'},
 [0xE004C]={d='bn'},
 [0xE004D]={d='bn'},
 [0xE004E]={d='bn'},
 [0xE004F]={d='bn'},
 [0xE0050]={d='bn'},
 [0xE0051]={d='bn'},
 [0xE0052]={d='bn'},
 [0xE0053]={d='bn'},
 [0xE0054]={d='bn'},
 [0xE0055]={d='bn'},
 [0xE0056]={d='bn'},
 [0xE0057]={d='bn'},
 [0xE0058]={d='bn'},
 [0xE0059]={d='bn'},
 [0xE005A]={d='bn'},
 [0xE005B]={d='bn'},
 [0xE005C]={d='bn'},
 [0xE005D]={d='bn'},
 [0xE005E]={d='bn'},
 [0xE005F]={d='bn'},
 [0xE0060]={d='bn'},
 [0xE0061]={d='bn'},
 [0xE0062]={d='bn'},
 [0xE0063]={d='bn'},
 [0xE0064]={d='bn'},
 [0xE0065]={d='bn'},
 [0xE0066]={d='bn'},
 [0xE0067]={d='bn'},
 [0xE0068]={d='bn'},
 [0xE0069]={d='bn'},
 [0xE006A]={d='bn'},
 [0xE006B]={d='bn'},
 [0xE006C]={d='bn'},
 [0xE006D]={d='bn'},
 [0xE006E]={d='bn'},
 [0xE006F]={d='bn'},
 [0xE0070]={d='bn'},
 [0xE0071]={d='bn'},
 [0xE0072]={d='bn'},
 [0xE0073]={d='bn'},
 [0xE0074]={d='bn'},
 [0xE0075]={d='bn'},
 [0xE0076]={d='bn'},
 [0xE0077]={d='bn'},
 [0xE0078]={d='bn'},
 [0xE0079]={d='bn'},
 [0xE007A]={d='bn'},
 [0xE007B]={d='bn'},
 [0xE007C]={d='bn'},
 [0xE007D]={d='bn'},
 [0xE007E]={d='bn'},
 [0xE007F]={d='bn'}
}
%</bidi>
%    \end{macrocode}
%\fi
%
% Now the |basic-r| bidi mode. One of the aims is to implement a fast
% and simple bidi algorithm, with a single loop. I managed to do it
% for R texts, with a second smaller loop for a special case. The code
% is still somewhat chaotic, but its behavior is essentially
% correct. I cannot resist copying the following text from
% \textsf{Emacs} |bidi.c| (which also attempts to implement the bidi
% algorithm with a single loop):
%
% \begin{quote}
%   Arrrgh!! The UAX\#9 algorithm is too deeply entrenched in the
%   assumption of batch-style processing [...]. May the fleas of a
%   thousand camels infest the armpits of those who design supposedly
%   general-purpose algorithms by looking at their own
%   implementations, and fail to consider other possible
%   implementations!
% \end{quote}
% 
% Well, it took me some time to guess what the batch rules in UAX\#9
% actually mean (in other word, \textit{what} they do and\textit{why},
% and not only \textit{how}), but I think (or I hope) I've managed to
% understand them.
%
% In some sense, there are two bidi modes, one for numbers, and the
% other for text.  Furthermore, setting just the direction in R text
% is not enough, because there are actually \textit{two} R modes (set
% explicitly in Unicode with RLM and ALM). In \babel{} the dir is set
% by a higher protocol based on the language/script, which in turn
% sets the correct dir (<l>, <r> or <al>).
%
% From UAX\#9: “Where available, markup should be used instead of the
% explicit formatting characters”. So, this simple version just
% ignores formatting characters. Actually, most of that annex is
% devoted to how to handle them. 
%
% BD14-BD16 are not implemented. Unicode (and the W3C) are making a
% great effort to deal with some special problematic cases in
% “streamed” plain text. I don't think this is the way to go --
% particular issues should be fixed by a high level interface taking
% into account the needs of the document. And here is where \luatex{}
% excels, because everything related to bidi writing is under our
% control.
%
% TODO: math mode (as weak L?)
%
%    \begin{macrocode}
%<*basic-r>
Babel = Babel or {}

require('babel-bidi.lua')

local characters = Babel.characters
local ranges = Babel.ranges

local DIR = node.id("dir")

local function dir_mark(head, from, to, outer)
  dir = (outer == 'r') and 'TLT' or 'TRT' -- ie, reverse
  local d = node.new(DIR)
  d.dir = '+' .. dir
  node.insert_before(head, from, d)
  d = node.new(DIR)
  d.dir = '-' .. dir
  node.insert_after(head, to, d)
end

function Babel.pre_otfload(head)
  local first_n, last_n            -- first and last char with nums
  local last_es                    -- an auxiliary 'last' used with nums
  local first_d, last_d            -- first and last char in L/R block
  local dir, dir_real
%    \end{macrocode}
%
%   Next also depends on script/lang (<al>/<r>). To be set by
%   babel.  |tex.pardir| is dangerous, could be (re)set but it
%   should be changed only in vmode. There are two strong's --
%   |strong| = l/al/r and |strong_lr| = l/r (there must be a better
%   way):
%
%    \begin{macrocode}
  local strong = ('TRT' == tex.pardir) and 'r' or 'l'  
  local strong_lr = (strong == 'l') and 'l' or 'r' 
  local outer = strong

  local new_dir = false
  local first_dir = false

  local last_lr

  local type_n = ''

  for item in node.traverse(head) do

    -- three cases: glyph, dir, otherwise
    if item.id == node.id'glyph' then
       
      local chardata = characters[item.char]
      dir = chardata and chardata.d or nil
      if not dir then
        for nn, et in ipairs(ranges) do
          if item.char < et[1] then
            break
          elseif item.char <= et[2] then
            dir = et[3]
            break
          end
        end
      end
      dir = dir or 'l'
%    \end{macrocode}
%
%      Next is based on the assumption babel sets the language AND
%      switches the script with its dir. We treat a language block as
%      a separate Unicode sequence. The following piece of code is
%      executed at the first glyph after a `dir' node. We don't know
%      the current language until then.
%
%    \begin{macrocode}
      if new_dir then
        attr_dir = 0
        for at in node.traverse(item.attr) do
          if at.number == luatexbase.registernumber'bbl@attr@dir' then
            attr_dir = at.value
          end
        end
        if attr_dir == 1 then
          strong = 'r'
        elseif attr_dir == 2 then
          strong = 'al'
        else
          strong = 'l'
        end
        strong_lr = (strong == 'l') and 'l' or 'r' 
        outer = strong_lr
        new_dir = false
      end

      if dir == 'nsm' then dir = strong end             -- W1
%    \end{macrocode}
%
% \textbf{Numbers.} The dual <al>/<r> system for R is somewhat
% cumbersome.
%
%    \begin{macrocode}
      dir_real = dir               -- We need dir_real to set strong below
      if dir == 'al' then dir = 'r' end -- W3
%    \end{macrocode}
%
% By W2, there are no <en> <et> <es> if |strong == <al>|, only
% <an>. Therefore, there are not <et en> nor <en et>, W5 can be
% ignored, and W6 applied:
%
%    \begin{macrocode}
      if strong == 'al' then
        if dir == 'en' then dir = 'an' end                -- W2
        if dir == 'et' or dir == 'es' then dir = 'on' end -- W6
        strong_lr = 'r'                                   -- W3
      end
%    \end{macrocode}
%
% Once finished the basic setup for glyphs, consider the two other
% cases: dir node and the rest.
%
%    \begin{macrocode}
    elseif item.id == node.id'dir' then
      new_dir = true 
      dir = nil
    else
      dir = nil          -- Not a char
    end
%    \end{macrocode}
%
% Numbers in R mode. A sequence of <en>, <et>, <an>, <es> and <cs> is
% typeset (with some rules) in L mode. We store the starting and
% ending points, and only when anything different is found (including
% nil, ie, a non-char), the textdir is set. This means you cannot
% insert, say, a whatsit, but this is what I would expect (with
% \textsf{luacolor} you may colorize some digits). Anyway, this
% behavior could be changed with a switch in the future.  Note in the
% first branch only <an> is relevant if <al>.
%
%    \begin{macrocode}
    if dir == 'en' or dir == 'an' or dir == 'et' then
      if dir ~= 'et' then
        type_n = dir
      end
      first_n = first_n or item
      last_n = last_es or item
      last_es = nil
    elseif dir == 'es' and last_n then -- W3+W6
      last_es = item
    elseif dir == 'cs' then            -- it's right - do nothing
    elseif first_n then -- & if dir = any but en, et, an, es, cs, inc nil
      if strong_lr == 'r' and type_n ~= '' then
        dir_mark(head, first_n, last_n, 'r') 
      elseif strong_lr == 'l' and first_d and type_n == 'an' then
        dir_mark(head, first_n, last_n, 'r') 
        dir_mark(head, first_d, last_d, outer)
        first_d, last_d = nil, nil
      elseif strong_lr == 'l' and type_n ~= '' then
        last_d = last_n
      end
      type_n = ''
      first_n, last_n = nil, nil
    end
%    \end{macrocode}
%
% R text in L, or L text in R. Order of |dir_ mark|'s are relevant: d
% goes outside n, and therefore it's emitted after. See |dir_mark| to
% understand why (but is the nesting actually necessary or is a flat
% dir structure enough?). Only L, R (and AL) chars are taken into
% account -- everything else, including spaces, whatsits, etc., are
% ignored:
%
%    \begin{macrocode}
    if dir == 'l' or dir == 'r' then
      if dir ~= outer then
        first_d = first_d or item
        last_d = item
      elseif first_d and dir ~= strong_lr then
        dir_mark(head, first_d, last_d, outer)
        first_d, last_d = nil, nil
     end
    end  
%    \end{macrocode}
%
% \textbf{Mirroring.}  Each chunk of text in a certain language is
% considered a ``closed'' sequence.  If <r on r> and <l on l>, it's
% clearly <r> and <l>, resptly, but with other combinations depends on
% outer. From all these, we select only those resolving <on> $\to$
% <r>. At the beginning (when |last_lr| is nil) of an R text, they are
% mirrored directly.
%
% TODO - numbers in R mode are processed. It doesn't hurt, but should
% not be done.
%
%    \begin{macrocode}
    if dir and not last_lr and dir ~= 'l' and outer == 'r' then
      item.char = characters[item.char] and
                  characters[item.char].m or item.char
    elseif (dir or new_dir) and last_lr ~= item then
      local mir = outer .. strong_lr .. (dir or outer)
      if mir == 'rrr' or mir == 'lrr' or mir == 'rrl' or mir == 'rlr' then
        for ch in node.traverse(node.next(last_lr)) do
          if ch == item then break end
          if ch.id == node.id'glyph' then
            ch.char = characters[ch.char].m or ch.char
          end
        end
      end
    end
%    \end{macrocode}
%
% Save some values for the next iteration. If the current node is
% `dir', open a new sequence. Since dir could be changed, strong is
% set with its real value (|dir_real|).
%
%    \begin{macrocode}
    if dir == 'l' or dir == 'r' then
      last_lr = item
      strong = dir_real            -- Don't search back - best save now
      strong_lr = (strong == 'l') and 'l' or 'r'
    elseif new_dir then
      last_lr = nil
    end
  end 
%    \end{macrocode}
%
% Mirror the last chars if they are no directed. And make sure any
% open block is closed, too.
%
%    \begin{macrocode}
  if last_lr and outer == 'r' then
    for ch in node.traverse_id(node.id'glyph', node.next(last_lr)) do
      ch.char = characters[ch.char].m or ch.char
    end
  end
  if first_n then 
    dir_mark(head, first_n, last_n, outer)
  end
  if first_d then 
    dir_mark(head, first_d, last_d, outer)
  end
%    \end{macrocode}
%
% In boxes, the dir node could be added before the original head, so
% the actual head is the previous node.
%
%    \begin{macrocode}
  return node.prev(head) or head
end
%</basic-r>
%    \end{macrocode}
%
% \section{The `nil' language}
%
%    This `language' does nothing, except setting the hyphenation patterns to
%    nohyphenation.
%
%    For this language currently no special definitions are needed or
%    available.
%
%    The macro |\LdfInit| takes care of preventing that this file is
%    loaded more than once, checking the category code of the
%    \texttt{@} sign, etc.
%
%    \begin{macrocode}
%<*nil>
\ProvidesLanguage{nil}[<@date@> <@version@> Nil language]
\LdfInit{nil}{datenil}
%    \end{macrocode}
%
%    When this file is read as an option, i.e. by the |\usepackage|
%    command, \texttt{nil} could be an `unknown' language in which
%    case we have to make it known. 
%
%    \begin{macrocode}
\ifx\l@nohyphenation\@undefined
   \@nopatterns{nil}
   \adddialect\l@nil0
\else
   \let\l@nil\l@nohyphenation
\fi
%    \end{macrocode}
%
%    This macro is used to store the values of the hyphenation
%    parameters |\lefthyphenmin| and |\righthyphenmin|.
%
%    \begin{macrocode}
\providehyphenmins{\CurrentOption}{\m@ne\m@ne}
%    \end{macrocode}
%
%    The next step consists of defining commands to switch to (and
%    from) the `nil' language.
% \begin{macro}{\captionnil}
% \begin{macro}{\datenil}
%
%    \begin{macrocode}
\let\captionsnil\@empty
\let\datenil\@empty
%    \end{macrocode}
%
% \end{macro}
% \end{macro}
%  
%    The macro |\ldf@finish| takes care of looking for a
%    configuration file, setting the main language to be switched on
%    at |\begin{document}| and resetting the category code of
%    \texttt{@} to its original value.
%
%    \begin{macrocode}
\ldf@finish{nil}
%</nil>
%    \end{macrocode}
%
%
% \section{Support for Plain \TeX\ (\texttt{plain.def})}
%
% \subsection{Not renaming \file{hyphen.tex}}
%    As Don Knuth has declared that the filename \file{hyphen.tex} may
%    only be used to designate \emph{his} version of the american
%    English hyphenation patterns, a new solution has to be found in
%    order to be able to load hyphenation patterns for other languages
%    in a plain-based \TeX-format. 
%    When asked he responded:
%    \begin{quote}
%      That file name is ``sacred'', and if anybody changes it they will
%      cause severe upward/downward compatibility headaches.
%
%      People can have a file localhyphen.tex or whatever they like,
%      but they mustn't diddle with hyphen.tex (or plain.tex except to
%      preload additional fonts). 
%    \end{quote}
%
%    The files \file{bplain.tex} and \file{blplain.tex} can be used as
%    replacement wrappers around \file{plain.tex} and
%    \file{lplain.tex} to acheive the desired effect, based on the
%    \pkg{babel} package. If you load each of them with ini\TeX, you
%    will get a file called either \file{bplain.fmt} or
%    \file{blplain.fmt}, which you can use as replacements for
%    \file{plain.fmt} and \file{lplain.fmt}.
%
%    As these files are going to be read as the first thing ini\TeX\
%    sees, we need to set some category codes just to be able to
%    change the definition of |\input|
%
%    \begin{macrocode}
%<*bplain|blplain>
\catcode`\{=1 % left brace is begin-group character
\catcode`\}=2 % right brace is end-group character
\catcode`\#=6 % hash mark is macro parameter character
%    \end{macrocode}
%
%    Now let's see if a file called \file{hyphen.cfg} can be found
%    somewhere on \TeX's input path by trying to open it for
%    reading... 
%
%    \begin{macrocode}
\openin 0 hyphen.cfg
%    \end{macrocode}
%
%    If the file wasn't found the following test turns out true.
%
%    \begin{macrocode}
\ifeof0
\else
%    \end{macrocode}
%
%    When \file{hyphen.cfg} could be opened we make sure that
%    \emph{it} will be read instead of the file \file{hyphen.tex}
%    which should (according to Don Knuth's ruling) contain the
%    american English hyphenation patterns and nothing else.
%
%    We do this by first saving the original meaning of |\input| (and
%    I use a one letter control sequence for that so as not to waste
%    multi-letter control sequence on this in the format).
%
%    \begin{macrocode}
  \let\a\input
%    \end{macrocode}
%
%    Then |\input| is defined to forget about its argument and load
%    \file{hyphen.cfg} instead.
%
%    \begin{macrocode}
  \def\input #1 {%
    \let\input\a
    \a hyphen.cfg
%    \end{macrocode}
%
%    Once that's done the original meaning of |\input| can be restored
%    and the definition of |\a| can be forgotten.
%
%    \begin{macrocode}
    \let\a\undefined
  }
\fi
%</bplain|blplain>
%    \end{macrocode}
%
%    Now that we have made sure that \file{hyphen.cfg} will be loaded
%    at the right moment it is time to load \file{plain.tex}.
%
%    \begin{macrocode}
%<bplain>\a plain.tex
%<blplain>\a lplain.tex
%    \end{macrocode}
%
%    Finally we change the contents of |\fmtname| to indicate that
%    this is \emph{not} the plain format, but a format based on plain
%    with the \pkg{babel} package preloaded.
%
%    \begin{macrocode}
%<bplain>\def\fmtname{babel-plain}
%<blplain>\def\fmtname{babel-lplain}
%    \end{macrocode}
%
%    When you are using a different format, based on plain.tex you can
%    make a copy of blplain.tex, rename it and replace \file{plain.tex}
%    with the name of your format file.
%
% \subsection{Emulating some \LaTeX{} features}
%
%    The following code duplicates or emulates parts of \LaTeXe\ that
%    are needed for \babel.
%
% \changes{bbplain-1.0s}{2012/12/21}{\cs{loadlocalcfg} not loaded in
%    the format} 
%
%    \begin{macrocode}
%<*plain>
\def\@empty{}
\def\loadlocalcfg#1{%
  \openin0#1.cfg
  \ifeof0
    \closein0
  \else
    \closein0
    {\immediate\write16{*************************************}%
     \immediate\write16{* Local config file #1.cfg used}%
     \immediate\write16{*}%
     }
    \input #1.cfg\relax
  \fi
  \@endofldf}
%    \end{macrocode}
%
% \subsection{General tools}
%
%    A number of \LaTeX\ macro's that are needed later on.
%
% \changes{bbplain-1.0t}{2013/04/10}{Added \cs{@expandtwoargs}}
% \changes{babel~3.9h}{2013/12/02}{Added \cs{zap@space}}
% \changes{babel~3.9k}{2014/03/22}{Added \cs{@nnil}}
% \changes{babel~3.9k}{2014/03/22}{Added \cs{@gobbletwo}}
% \changes{babel~3.9k}{2014/03/22}{Added \cs{protected@edef}}
%
%    \begin{macrocode}
\long\def\@firstofone#1{#1}
\long\def\@firstoftwo#1#2{#1}
\long\def\@secondoftwo#1#2{#2}
\def\@nnil{\@nil}
\def\@gobbletwo#1#2{}
\def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}}
\def\@star@or@long#1{%
  \@ifstar
  {\let\l@ngrel@x\relax#1}%
  {\let\l@ngrel@x\long#1}}
\let\l@ngrel@x\relax
\def\@car#1#2\@nil{#1}
\def\@cdr#1#2\@nil{#2}
\let\@typeset@protect\relax
\let\protected@edef\edef
\long\def\@gobble#1{}
\edef\@backslashchar{\expandafter\@gobble\string\\}
\def\strip@prefix#1>{}
\def\g@addto@macro#1#2{{%
    \toks@\expandafter{#1#2}%
    \xdef#1{\the\toks@}}}
\def\@namedef#1{\expandafter\def\csname #1\endcsname}
\def\@nameuse#1{\csname #1\endcsname}
\def\@ifundefined#1{%
  \expandafter\ifx\csname#1\endcsname\relax
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi}
\def\@expandtwoargs#1#2#3{%
  \edef\reserved@a{\noexpand#1{#2}{#3}}\reserved@a}
\def\zap@space#1 #2{%
  #1%
  \ifx#2\@empty\else\expandafter\zap@space\fi
  #2}
%    \end{macrocode}
%
%    \LaTeXe\ has the command |\@onlypreamble| which adds commands to
%    a list of commands that are no longer needed after
%    |\begin{document}|.
%
%    \begin{macrocode}
\ifx\@preamblecmds\@undefined
  \def\@preamblecmds{}
\fi
\def\@onlypreamble#1{%
  \expandafter\gdef\expandafter\@preamblecmds\expandafter{%
    \@preamblecmds\do#1}}
\@onlypreamble\@onlypreamble
%    \end{macrocode}
%
%    Mimick \LaTeX's |\AtBeginDocument|; for this to work the user
%    needs to add |\begindocument| to his file.
%
%    \begin{macrocode}
\def\begindocument{%
  \@begindocumenthook
  \global\let\@begindocumenthook\@undefined
  \def\do##1{\global\let##1\@undefined}%
  \@preamblecmds
  \global\let\do\noexpand}
%    \end{macrocode}
%    
%    \begin{macrocode}
\ifx\@begindocumenthook\@undefined
  \def\@begindocumenthook{}
\fi
\@onlypreamble\@begindocumenthook
\def\AtBeginDocument{\g@addto@macro\@begindocumenthook}
%    \end{macrocode}
%
%    We also have to mimick \LaTeX's |\AtEndOfPackage|. Our
%    replacement macro is much simpler; it stores its argument in
%    |\@endofldf|.
%
%  \changes{babel~3.9h}{2013/11/28}{Set \cs{bbl@opt@hyphenmap} to 0 - we
%     presume hyphenmap=off in plain}
%
%    \begin{macrocode}
\def\AtEndOfPackage#1{\g@addto@macro\@endofldf{#1}}
\@onlypreamble\AtEndOfPackage
\def\@endofldf{}
\@onlypreamble\@endofldf
\let\bbl@afterlang\@empty
\chardef\bbl@opt@hyphenmap\z@
%    \end{macrocode}
%
%    \LaTeX\ needs to be able to switch off writing to its auxiliary
%    files; plain doesn't have them by default.
%
%    \begin{macrocode}
\ifx\if@filesw\@undefined
  \expandafter\let\csname if@filesw\expandafter\endcsname
    \csname iffalse\endcsname
\fi
%    \end{macrocode}
%
%    Mimick \LaTeX's commands to define control sequences.
%
%    \begin{macrocode}
\def\newcommand{\@star@or@long\new@command}
\def\new@command#1{%
  \@testopt{\@newcommand#1}0}
\def\@newcommand#1[#2]{%
  \@ifnextchar [{\@xargdef#1[#2]}%
                {\@argdef#1[#2]}}
\long\def\@argdef#1[#2]#3{%
  \@yargdef#1\@ne{#2}{#3}}
\long\def\@xargdef#1[#2][#3]#4{%
  \expandafter\def\expandafter#1\expandafter{%
    \expandafter\@protected@testopt\expandafter #1%
    \csname\string#1\expandafter\endcsname{#3}}%
  \expandafter\@yargdef \csname\string#1\endcsname
  \tw@{#2}{#4}}
\long\def\@yargdef#1#2#3{%
  \@tempcnta#3\relax
  \advance \@tempcnta \@ne
  \let\@hash@\relax
  \edef\reserved@a{\ifx#2\tw@ [\@hash@1]\fi}%
  \@tempcntb #2%
  \@whilenum\@tempcntb <\@tempcnta
  \do{%
    \edef\reserved@a{\reserved@a\@hash@\the\@tempcntb}%
    \advance\@tempcntb \@ne}%
  \let\@hash@##%
  \l@ngrel@x\expandafter\def\expandafter#1\reserved@a}
\def\providecommand{\@star@or@long\provide@command}
\def\provide@command#1{%
  \begingroup
    \escapechar\m@ne\xdef\@gtempa{{\string#1}}%
  \endgroup
  \expandafter\@ifundefined\@gtempa
    {\def\reserved@a{\new@command#1}}%
    {\let\reserved@a\relax
     \def\reserved@a{\new@command\reserved@a}}%
   \reserved@a}%
%    \end{macrocode}
%    
%    \begin{macrocode}
\def\DeclareRobustCommand{\@star@or@long\declare@robustcommand}
\def\declare@robustcommand#1{%
   \edef\reserved@a{\string#1}%
   \def\reserved@b{#1}%
   \edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@b}%
   \edef#1{%
      \ifx\reserved@a\reserved@b
         \noexpand\x@protect
         \noexpand#1%
      \fi
      \noexpand\protect
      \expandafter\noexpand\csname\bbl@stripslash#1 \endcsname
   }%
   \expandafter\new@command\csname\bbl@stripslash#1 \endcsname
}
\def\x@protect#1{%
   \ifx\protect\@typeset@protect\else
      \@x@protect#1%
   \fi
}
\def\@x@protect#1\fi#2#3{%
   \fi\protect#1%
}
%    \end{macrocode}
%
%    The following little macro |\in@| is taken from \file{latex.ltx};
%    it checks whether its first argument is part of its second
%    argument. It uses the boolean |\in@|; allocating a new boolean
%    inside conditionally executed code is not possible, hence the
%    construct with the temporary definition of |\bbl@tempa|.
%
% \changes{bbplain-1.0s}{2013/01/15}{Use \cs{bbl@tempa} as
%    documented}
%
%    \begin{macrocode}
\def\bbl@tempa{\csname newif\endcsname\ifin@}
\ifx\in@\@undefined
  \def\in@#1#2{%
    \def\in@@##1#1##2##3\in@@{%
      \ifx\in@##2\in@false\else\in@true\fi}%
    \in@@#2#1\in@\in@@}
\else
  \let\bbl@tempa\@empty
\fi
\bbl@tempa
%    \end{macrocode}
%
%    \LaTeX\ has a macro to check whether a certain package was loaded
%    with specific options. The command has two extra arguments which
%    are code to be executed in either the true or false case.
%    This is used to detect whether the document needs one of the
%    accents to be activated (\Lopt{activegrave} and
%    \Lopt{activeacute}). For plain \TeX\ we assume that the user
%    wants them to be active by default. Therefore the only thing we
%    do is execute the third argument (the code for the true case).
% 
%    \begin{macrocode}
\def\@ifpackagewith#1#2#3#4{#3}
%    \end{macrocode}
%
%    The \LaTeX\ macro |\@ifl@aded| checks whether a file was
%    loaded. This functionality is not needed for plain \TeX\ but we
%    need the macro to be defined as a no-op.
%
%    \begin{macrocode}
\def\@ifl@aded#1#2#3#4{}
%    \end{macrocode}
%
%    For the following code we need to make sure that the commands
%    |\newcommand| and |\providecommand| exist with some sensible
%    definition. They are not fully equivalent to their \LaTeXe\
%    versions; just enough to make things work in plain~\TeX
%    environments.
%
%    \begin{macrocode}
\ifx\@tempcnta\@undefined
  \csname newcount\endcsname\@tempcnta\relax
\fi
\ifx\@tempcntb\@undefined
  \csname newcount\endcsname\@tempcntb\relax
\fi
%    \end{macrocode}
%
%    To prevent wasting two counters in \LaTeX$\:$2.09 (because
%    counters with the same name are allocated later by it) we reset
%    the counter that holds the next free counter (|\count10|).
%
%    \begin{macrocode}
\ifx\bye\@undefined
  \advance\count10 by -2\relax
\fi
\ifx\@ifnextchar\@undefined
  \def\@ifnextchar#1#2#3{%
    \let\reserved@d=#1%
    \def\reserved@a{#2}\def\reserved@b{#3}%
    \futurelet\@let@token\@ifnch}
  \def\@ifnch{%
    \ifx\@let@token\@sptoken
      \let\reserved@c\@xifnch
    \else
      \ifx\@let@token\reserved@d
        \let\reserved@c\reserved@a
      \else
        \let\reserved@c\reserved@b
      \fi
    \fi
    \reserved@c}
  \def\:{\let\@sptoken= } \:  % this makes \@sptoken a space token
  \def\:{\@xifnch} \expandafter\def\: {\futurelet\@let@token\@ifnch}
\fi
\def\@testopt#1#2{%
  \@ifnextchar[{#1}{#1[#2]}}
\def\@protected@testopt#1{%
  \ifx\protect\@typeset@protect
    \expandafter\@testopt
  \else
    \@x@protect#1%
  \fi}
\long\def\@whilenum#1\do #2{\ifnum #1\relax #2\relax\@iwhilenum{#1\relax
     #2\relax}\fi}
\long\def\@iwhilenum#1{\ifnum #1\expandafter\@iwhilenum
         \else\expandafter\@gobble\fi{#1}}
%    \end{macrocode}
%
% \subsection{Encoding related macros}
%
%    Code from \file{ltoutenc.dtx}, adapted for use in the plain \TeX\
%    environment. 
%
%    \begin{macrocode}
\def\DeclareTextCommand{%
   \@dec@text@cmd\providecommand
}
\def\ProvideTextCommand{%
   \@dec@text@cmd\providecommand
}
\def\DeclareTextSymbol#1#2#3{%
   \@dec@text@cmd\chardef#1{#2}#3\relax
}
\def\@dec@text@cmd#1#2#3{%
   \expandafter\def\expandafter#2%
      \expandafter{%
         \csname#3-cmd\expandafter\endcsname
         \expandafter#2%
         \csname#3\string#2\endcsname
      }%
%   \let\@ifdefinable\@rc@ifdefinable
   \expandafter#1\csname#3\string#2\endcsname
}
\def\@current@cmd#1{%
  \ifx\protect\@typeset@protect\else
      \noexpand#1\expandafter\@gobble
  \fi
}
\def\@changed@cmd#1#2{%
   \ifx\protect\@typeset@protect
      \expandafter\ifx\csname\cf@encoding\string#1\endcsname\relax
         \expandafter\ifx\csname ?\string#1\endcsname\relax
            \expandafter\def\csname ?\string#1\endcsname{%
               \@changed@x@err{#1}%
            }%
         \fi
         \global\expandafter\let
           \csname\cf@encoding \string#1\expandafter\endcsname
           \csname ?\string#1\endcsname
      \fi
      \csname\cf@encoding\string#1%
        \expandafter\endcsname
   \else
      \noexpand#1%
   \fi
}
\def\@changed@x@err#1{%
    \errhelp{Your command will be ignored, type <return> to proceed}%
    \errmessage{Command \protect#1 undefined in encoding \cf@encoding}}
\def\DeclareTextCommandDefault#1{%
   \DeclareTextCommand#1?%
}
\def\ProvideTextCommandDefault#1{%
   \ProvideTextCommand#1?%
}
\expandafter\let\csname OT1-cmd\endcsname\@current@cmd
\expandafter\let\csname?-cmd\endcsname\@changed@cmd
\def\DeclareTextAccent#1#2#3{%
  \DeclareTextCommand#1{#2}[1]{\accent#3 ##1}
}
\def\DeclareTextCompositeCommand#1#2#3#4{%
   \expandafter\let\expandafter\reserved@a\csname#2\string#1\endcsname
   \edef\reserved@b{\string##1}%
   \edef\reserved@c{%
     \expandafter\@strip@args\meaning\reserved@a:-\@strip@args}%
   \ifx\reserved@b\reserved@c
      \expandafter\expandafter\expandafter\ifx
         \expandafter\@car\reserved@a\relax\relax\@nil
         \@text@composite
      \else
         \edef\reserved@b##1{%
            \def\expandafter\noexpand
               \csname#2\string#1\endcsname####1{%
               \noexpand\@text@composite
                  \expandafter\noexpand\csname#2\string#1\endcsname
                  ####1\noexpand\@empty\noexpand\@text@composite
                  {##1}%
            }%
         }%
         \expandafter\reserved@b\expandafter{\reserved@a{##1}}%
      \fi
      \expandafter\def\csname\expandafter\string\csname
         #2\endcsname\string#1-\string#3\endcsname{#4}
   \else
     \errhelp{Your command will be ignored, type <return> to proceed}%
     \errmessage{\string\DeclareTextCompositeCommand\space used on
         inappropriate command \protect#1}
   \fi
}
\def\@text@composite#1#2#3\@text@composite{%
   \expandafter\@text@composite@x
      \csname\string#1-\string#2\endcsname
}
\def\@text@composite@x#1#2{%
   \ifx#1\relax
      #2%
   \else
      #1%
   \fi
}
%
\def\@strip@args#1:#2-#3\@strip@args{#2}
\def\DeclareTextComposite#1#2#3#4{%
   \def\reserved@a{\DeclareTextCompositeCommand#1{#2}{#3}}%
   \bgroup
      \lccode`\@=#4%
      \lowercase{%
   \egroup
      \reserved@a @%
   }%
}
%
\def\UseTextSymbol#1#2{%
%   \let\@curr@enc\cf@encoding
%   \@use@text@encoding{#1}%
   #2%
%   \@use@text@encoding\@curr@enc
}
\def\UseTextAccent#1#2#3{%
%   \let\@curr@enc\cf@encoding
%   \@use@text@encoding{#1}%
%   #2{\@use@text@encoding\@curr@enc\selectfont#3}%
%   \@use@text@encoding\@curr@enc
}
\def\@use@text@encoding#1{%
%   \edef\f@encoding{#1}%
%   \xdef\font@name{%
%      \csname\curr@fontshape/\f@size\endcsname
%   }%
%   \pickup@font
%   \font@name
%   \@@enc@update
}
\def\DeclareTextSymbolDefault#1#2{%
   \DeclareTextCommandDefault#1{\UseTextSymbol{#2}#1}%
}
\def\DeclareTextAccentDefault#1#2{%
   \DeclareTextCommandDefault#1{\UseTextAccent{#2}#1}%
}
\def\cf@encoding{OT1}
%    \end{macrocode}
%
%    Currently we only use the \LaTeXe\ method for accents for those
%    that are known to be made active in \emph{some} language
%    definition file.
%
%    \begin{macrocode}
\DeclareTextAccent{\"}{OT1}{127}
\DeclareTextAccent{\'}{OT1}{19}
\DeclareTextAccent{\^}{OT1}{94}
\DeclareTextAccent{\`}{OT1}{18}
\DeclareTextAccent{\~}{OT1}{126}
%    \end{macrocode}
%
%    The following control sequences are used in \file{babel.def}
%    but are not defined for \textsc{plain} \TeX.
%
%    \begin{macrocode}
\DeclareTextSymbol{\textquotedblleft}{OT1}{92}
\DeclareTextSymbol{\textquotedblright}{OT1}{`\"}
\DeclareTextSymbol{\textquoteleft}{OT1}{`\`}
\DeclareTextSymbol{\textquoteright}{OT1}{`\'}
\DeclareTextSymbol{\i}{OT1}{16}
\DeclareTextSymbol{\ss}{OT1}{25}
%    \end{macrocode}
%
%    For a couple of languages we need the \LaTeX-control sequence
%    |\scriptsize| to be available. Because plain \TeX\ doesn't have
%    such a sofisticated font mechanism as \LaTeX\ has, we just |\let|
%    it to |\sevenrm|.
%
%    \begin{macrocode}
\ifx\scriptsize\@undefined
  \let\scriptsize\sevenrm
\fi
%</plain>
%    \end{macrocode}
%
% \Finale
%
\endinput
%
% Local Variables: 
% mode: doctex
% coding: utf-8
% TeX-engine: luatex
% End: