summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/soul/soul.dtx
blob: 064634cf1110997a014e0aa7c7f747fa8a74d68e (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
% \iffalse
%% File: soul.dtx  Copyright (C) 1998--2003  Melchior FRANZ
%% $Id: soul.dtx,v 1.128 2003/11/17 22:57:24 m Rel $
%% $Version: 2.4 $
%
%<*batchfile>
%
% on Unix/Linux just run "make" to get the style file and the documentation,
% else generate the driver soul.ins (if you don't already have it):
%
%     $ latex soul.dtx
%
% You'll probably get an error message that you may ignore. Now generate
% the style file:
%
%     $ tex soul.ins
%
% And finally to produce the documentation run LaTeX three times:
%
%     $ latex soul.dtx
%
%
%
%
% DISCLAIMER: note that a Makefile could actually contain malign commands
% that erase your whole account, so having a look at it before won't hurt!
% I take no responsibility for any damage, but I do what I can to make
% using the original Makefile safe.
%
% COPYRIGHT NOTICE:
% This package is free software that can be redistributed and/or modified
% under the terms of the LaTeX Project Public License as specified
% in the file macros/latex/base/lppl.txt on any CTAN archive server,
% such as ftp://ftp.dante.de/.
%
%$
%% ====================================================================
%%  @LaTeX-package-file{
%%     author          = "Melchior FRANZ",
%%     version         = "2.4",
%%     date            = "17 November 2003",
%%     filename        = "soul.dtx",
%%     address         = "Melchior FRANZ
%%                        Rieder Hauptstrasse 52
%%                        A-5212 SCHNEEGATTERN
%%                        AUSTRIA",
%%     telephone       = "++43 7746 3109",
%%     URL             = "http://www.unet.univie.ac.at/~a8603365/",
%%     email           = "a8603365@unet.univie.ac.at",
%%     codetable       = "ISO/ASCII",
%%     keywords        = "spacing out, letterspacing, underlining, striking out,
%%                        highlighting",
%%     supported       = "yes",
%%     docstring       = "This article describes the `soul' package, which
%%                        provides hyphenatable letterspacing (spacing out),
%%                        underlining, and some derivatives.
%%                        All features are based upon a common mechanism
%%                        that allows to typeset text syllable by syllable,
%%                        where the excellent TeX hyphenation algorithm is
%%                        used to find the proper hyphenation points.
%%                        Two examples show how to use the provided interface to
%%                        implement things such as `an-a-lyz-ing syl-la-bles'.
%%                        Although the package is optimized for LaTeX2e,
%%                        it works with Plain TeX and with other
%%                        packages, too.",
%%  }
%% ====================================================================
%
%
%
%
%
\begin{filecontents}{soul.ins}
\def\batchfile{soul.ins}
\input docstrip.tex
\askforoverwritefalse
\keepsilent   % <-- this is for you, Christina   ;-)
\generate{\file{soul.sty}{\from{soul.dtx}{package}}}
\endbatchfile
\end{filecontents}
%</batchfile>
%
%
%
%
%
%<*driver>
\def\fileversion{2.4}
\def\filedate{2003/11/17}
%
%
%
\documentclass{ltxdoc}
%
%
%
\makeatletter\let\SOUL@sethyphenchar\relax\makeatother
\IfFileExists{soul.sty}{%
    \usepackage{soul}[2002/01/10]
    \expandafter\ifx\csname sloppyword\endcsname\relax  % old version?
        \def\sloppyword{\textbf{?? [obsolete soul version]}}
    \fi
    \let\SOULSTYfound\active
}{%
    \GenericWarning{soul.dtx}{%
        Package file `soul.sty' couldn't be found. You should however find^^J^^A
        a file `soul.ins' in the current directory. If you type "tex soul.ins"^^J^^A
        on the command line, `soul.sty' will be generated. After that
        run "latex soul.dtx" again and you won't see this message again.
    }%
}%
%
%
%
\ifx\makehyperref\SOULundefined
    \newcommand*\texorpdfstring[2]{#1}
\else   ^^A for "make hyper"
    \usepackage{hyperref}
    \hypersetup{
        bookmarksopen,
        colorlinks,
        pdftitle={The soul package},
        pdfauthor={Melchior FRANZ},
        pdfsubject={${}$Id: soul.dtx,v 1.128 2003/11/17 22:57:24 m Rel ${}$},
        pdfkeywords={space out, letterspacing, underlining, overstriking, highlighting}
    }
    \usepackage[pdftex]{graphicx,color}
\fi
%
%
%
%\RecordChanges
%
\begin{document}
\setcounter{tocdepth}{2}
\DocInput{soul.dtx}
\end{document}
%</driver>
% \fi
%
%
%
%
%
%
%
% \CheckSum{2006}
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
%
%
% \title{The \texttt{soul} package}
%
% \author{Melchior \caps{FRANZ}}
%
% \date{November 17, 2003}
%
%^^A=====================================================
%
%^^A  These messy macros allow to typeset the `example' sections
%^^A  conveniently. You'd better ignore them. I do!   :-)
%
% \makeatletter
%
% \def\squarebull{\rule[.2ex]{.8ex}{.8ex}}
%
% \newenvironment{examples}
%   {\parindent\z@\small\fontencoding{OT1}\selectfont}
%   {\rule{\hsize}{.4pt}}
%
% \def\soultest#1|{\bgroup\rule[.5ex]{\hsize}{.4pt}\par
%   \parbox[t]{.34\hsize}{\raggedright\textit{#1\unskip.}}%
%   \hspace{1.5em}$\vtop\bgroup\hb@xt@.4\hsize\bgroup
%   \llap{\squarebull\hspace{.4em}}\soulttest}
%
% {\catcode`\|=13\gdef\soulttest{%
%   \bgroup\def\do##1{\catcode`##1=12}\dospecials\ttfamily
%   \catcode`\|=13\unskip\def|{\hss\egroup\egroup\soultttest}}}
%
% \def\soultttest#1{\hbox{\vtop{\hsize.4\hsize\hbadness\@M
%   \leavevmode\llap{\squarebull\hspace{.4em}}#1\null}}%
%   \egroup$\hspace{1.5em}\parbox[t]{1mm}{\hyphenpenalty-\@M
%   \exhyphenpenalty-\@M\hbadness\@M\hfuzz\maxdimen
%   \strut\llap{\squarebull\hspace{.4em}}#1\null}%
%   \goodbreak\vspace{2ex}
%   \egroup}
%
% \newcommand*\DescribeOption[1]{\marginpar{\raggedleft\textsf{#1}\ignorespaces}}
%
%
%^^A  similar to the `description' environment
%
% \def\describemacro{^^A
%   \bgroup
%   \let\do\@makeother
%   \dospecials
%   \catcode`{=1
%   \catcode`}=2
%   \SOUL@@@descmacro
% }
%
% \def\SOUL@@@descmacro#1{^^A
%   \texttt{#1}^^A
%   \DescribeMacro{#1}^^A
%   \expandafter\edef\expandafter\x\expandafter{\expandafter\@gobble#1}^^A
%   \expandafter\label{cmd:\x}^^A
%   \egroup
% }
%
%
% \def\SOUL@@@verbitem[#1: {^^A
%   \bgroup
%   \let\do\@makeother
%   \dospecials
%   \SOUL@@@verbscan{#1}^^A
% }
%
% \def\SOUL@@@verbscan#1#2]{^^A
%   \egroup
%   \goodbreak
%   \def\@currentlabel{\S\,\the\SOUL@@@itemnr}^^A
%   \label{par:#1}^^A
%   \SOUL@@@item[\textbf{\@currentlabel\hskip.6em#1:}]\hfil\break
%   Example: \texttt{#2}\hfil\break^^A
%   \advance\SOUL@@@itemnr1
% }
%
% \let\SOUL@@@item\item
% \newcount\SOUL@@@itemnr
%
% \newenvironment{verblist}[1]{^^A
%   \SOUL@@@itemnr=#1
%   \list{}{^^A
%       \settowidth{\labelwidth}{\indent\indent}^^A
%       \leftmargin\labelwidth
%       \advance\leftmargin\labelsep
%       \def\makelabel##1{##1}^^A
%       \let\item\SOUL@@@verbitem
%   }^^A
% }{^^A
%   \endlist
% }
%
% \newenvironment{labeling}[1]{^^A
%   \list{}{^^A
%       \settowidth{\labelwidth}{\textbf{#1}}^^A
%       \leftmargin\labelwidth\advance\leftmargin\labelsep
%       \def\makelabel##1{\textbf{##1}\hfil}^^A
%   }^^A
% }{^^A
%   \endlist
% }
%
% \newenvironment{syntax}{^^A
%   \par\medskip\def\<##1>{$\langle$\syn{##1}$\rangle$}^^A
%       \indent\begin{tabular}{l}^^A
%   }{^^A
%       \end{tabular}^^A
%       \noindentafter\medbreak
%   }
%
%
% \newenvironment{example}[1][.9\textwidth]
%   {\par\medskip\indent\begin{tabular}{p{#1}l}}
%   {\end{tabular}\noindentafter\medbreak}
%
% \newcommand*\noindentafter{^^A
%   \global\everypar{{\setbox\z@\lastbox}\everypar{}}}
%
% \newcommand*\errsquare{\leavevmode\vrule height.8em depth.2em width1em\relax}
%
%
% \ifx\SOULSTYfound\active
%^^A  analyze syllables---described somewhere below
%
% \DeclareRobustCommand*\sy{^^A
%   \SOUL@setup
%   \def\SOUL@preamble{\lefthyphenmin0\righthyphenmin0}^^A
%   \def\SOUL@everysyllable{\the\SOUL@syllable}^^A
%   \def\SOUL@everyspace##1{##1\space}^^A
%   \def\SOUL@everyhyphen{^^A
%       \discretionary{^^A
%           \SOUL@setkern\SOUL@hyphkern
%           \SOUL@sethyphenchar
%       }{}{^^A
%           \hbox{\kern1pt$\cdot$}^^A
%       }^^A
%   }^^A
%   \def\SOUL@everyexhyphen##1{^^A
%       \SOUL@setkern\SOUL@hyphkern
%       \hbox{##1}^^A
%       \discretionary{}{}{^^A
%           \SOUL@setkern\SOUL@charkern
%       }^^A
%   }^^A
%   \SOUL@}
%
%^^A  analyze the engine---described somewhere below, too
%
% \DeclareRobustCommand*\an{^^A
%   \def\SOUL@preamble{$^{^P}$}^^A
%   \def\SOUL@everyspace##1{##1\texttt{\char`\ }}^^A
%   \def\SOUL@postamble{$^{^E}$}^^A
%   \def\SOUL@everyhyphen{$^{^-}$}^^A
%   \def\SOUL@everyexhyphen##1{##1$^{^=}$}^^A
%   \def\SOUL@everysyllable{$^{^S}$}^^A
%   \def\SOUL@everytoken{\the\SOUL@token$^{^T}$}^^A
%   \def\SOUL@everylowerthan{$^{^L}$}^^A
%   \SOUL@}
%
%^^A  magazine-like (truly awful) paragraphs
%^^A  If you know what you're doing, you can copy it to your personal `soul.cfg' file.
%
%  \DeclareRobustCommand*\magstylepar{\SOUL@sosetup
%    \def\SOUL@preamble{^^A
%      \edef\SOUL@soletterskip{\z@\@plus\fontdimen2\font\@minus\z@}^^A
%      \edef\SOUL@soinnerskip{\the\fontdimen2\font
%        \@plus\the\fontdimen3\font\@minus\the\fontdimen4\font}^^A
%      \let\SOUL@soouterskip\SOUL@soinnerskip
%      \SOUL@sopreamble}^^A
%    \lefthyphenmin2\righthyphenmin2\SOUL@}
%
%\else
%
%^^A  The package has not been found, so we're providing some dummies, just
%^^A  to avoid all these `Undefined command sequence' messages.
%
%   \def\SOUL@@@X#1{\textbf{??}}%
%   \let\so\SOUL@@@X
%   \let\textso\SOUL@@@X
%   \let\caps\SOUL@@@X
%   \let\textcaps\SOUL@@@X
%   \let\ul\SOUL@@@X
%   \let\textul\SOUL@@@X
%   \let\st\SOUL@@@X
%   \let\textst\SOUL@@@X
%   \let\hl\SOUL@@@X
%   \let\texthl\SOUL@@@X
%   \let\sy\SOUL@@@X
%   \let\an\SOUL@@@X
%   \let\magstylepar\SOUL@@@X
%   \let\sloppyword\SOUL@@@X
%   \def\sodef#1#2#3#4{\let#1\relax\SOUL@@@X}%
% \fi
%
% \newcommand*\xpath{^^A
%   \bgroup
%   \let\do\@makeother
%   \dospecials
%   \catcode`\{=1
%   \catcode`\}=2
%   \def\{{\char"7B}^^A
%   \def\}{\char"7D}^^A
%   \SOUL@@@code
% }
%
% \newcommand*\SOUL@@@code[1]{\normalfont\texttt{#1}\egroup}
%
% \let\cs\xpath
% \let\option\textsf
% \def\package#1{{\normalfont\texttt{#1}}}
% \let\program\texttt
% \let\bibtitle\textit
% \let\syn\textit
%
% \sodef\person{\scshape}{0.06em}{0.45em}{0.4em}
% \sodef\SOUL@@@versal{\upshape}{0.125em}{0.4583em}{0.5833em}
% \DeclareRobustCommand*\versal[1]{^^A
%   \MakeUppercase{\SOUL@@@versal{#1}}^^A
% }
%
% \def\ConTeXt{Con\TeX t}
% \def\CTAN{{\small\caps{CTAN}}}
% \def\soul{\package{soul}}
%
% ^^A  set some parameters as used in Plain TeX
% \def\plainsetup{^^A
%   \pretolerance100
%   \tolerance200
%   \hbadness1000
%   \linepenalty10
%   \hyphenpenalty50
%   \exhyphenpenalty50
%   \doublehyphendemerits10000
%   \finalhyphendemerits5000
%   \adjdemerits10000
%   \hfuzz.1pt
%   \overfullrule5pt
% }
%
% \def\FIXME#1{\message{<FIXME>}#1}
%
% \makeatother
%
%
% \lefthyphenmin2
% \righthyphenmin3
% \hyphenation{Le-se-ty-po-gra-phie Ver-bin-dung fak-si-mi-le}
%
%
%^^A=====================================================
%
%
% \changes{v1.0}{1998/10/16}{Initial version}%
%^^A  due to an error in the documentation of v1.0, there's no v1.1    :-(
% \changes{v1.1a}{1998/12/08}{fixed a bunch of bugs; `magstylepar command
%   banned; `caps introduced; `so and `caps recognize following spaces;
%   error message added; `so parameters are mandatory}
%
% \changes{v1.2}{1999/01/11}{fixed the newline bug; added the `\(>\) command}
%
% \changes{v1.3}{1999/05/15}{changed allowhyphen, preambles; added a paragraph
%   in the `features' section}
%
% \changes{v2.0}{2002/01/03}{(almost) complete rewrite}
%
% \changes{v2.1}{2002/01/10}{Happy (64th) birthday, Don!
%   ``The now-traditional fix for the
%   now-traditional brown-paper-bag major release.''
%   as Eric S. RAYMOND commented on his CML2.0.1 release. ;-)}
%
% \changes{v2.2}{2002/05/12}{fixed a couple of bugs; added support for
%   the Plain TeX color.sty wrapper}
%
% \changes{v2.3}{2002/05/29}{compatibility with cmbright/ccfonts}
%
% \changes{v2.4}{2003/11/17}{Fix the font bug. Fix a scanner bug.
%   Other bugfixes; change caps set handling; add footnote and
%   textsuperscript support}
%
%
%
%
%
% \maketitle
%
%
%
% \begin{abstract}
% This article describes the \soul\ package^^A
%^^A%%
%   \footnote{This file has version number \fileversion, last revised \filedate.},
%^^A%%
% which provides \so{hyphenatable letterspacing (spacing out),} \ul{underlining}
% and some derivatives such as \st{overstriking} and highlighting.
% Although the package is optimized for \LaTeXe, it also works with
% Plain \TeX\ and with other flavors of \TeX\ like, for instance, \ConTeXt.
% By the way, the package name |soul| is only a combination
% of the two macro names \cs{\so} (space out) and \cs{\ul}
% (underline)---nothing poetic at all.^^A  :-(
% \end{abstract}
%
%
% {\setlength\parskip{0pt}\tableofcontents }
% \addtocontents{toc}{\protect\begin{multicols}{2}}
%
%
%
%
%
%
%
%
%
% \section{Typesetting rules}
% \label{sec:typesetting}
%
% There are several possibilities to emphasize parts of a paragraph,
% not all of which are considered good style. While underlining
% is commonly rejected, experts dispute about whether letterspacing
% should be used or not, and in which cases. If you are not interested
% in such debates, you may well skip to the next section.
%
%
% \subsection*{Theory \dots}
% \label{sec:theory}
%
% To understand the experts' arguments we have to know about the
% conception of \emph{page grayness.} The sum of all characters on
% a page represents a certain amount of grayness, provided that
% the letters are printed black onto white paper.
%
% \person{Jan Tschichold} \cite{Tschichold}, a well known and recognized
% typographer, accepts only forms of emphasizing, which do not disturb this
% grayness. This is only true of italic shape, caps, and
% caps-and-small-caps fonts, but not of ordinary letterspacing, underlining,
% bold face type and so on, all of which appear as either dark or light
% spots in the text area. In his opinion emphasized text shall not catch the eye when
% running over the text, but rather when actually reading the respective words.
%
% Other, less restrictive typographers \cite{Willberg} call this kind of emphasizing
% `integrated' or `aesthetic', while they describe `active' emphasizing apart from it,
% which actually \emph{has} to catch the reader's eye. To the latter group belong commonly
% despised things like letterspacing, demibold face type and even underlined and colored text.
%
% On the other hand, \person{Tschichold} suggests
% to space out caps and caps-and-small-caps fonts on title pages, headings and running headers from
% 1\,pt up to 2\,pt.
% Even in running text legibility of uppercase letters should be improved with slight
% letterspacing, since (the Roman) majuscules don't look right, if they are spaced
% like (the Carolingian) minuscules.\footnote{This suggestion is followed throughout this article,
% although Prof.~\person{Knuth} already considered slight letterspacing with his |cmcsc| fonts.}
%
%
%
%\subsection*{\dots\ and Practice}
%
% However, in the last centuries letterspacing was excessively used,
% underlining at least sometimes, because capitals and italic shape could
% not be used together with the \emph{Fraktur} font and other black-letter fonts,
% which are sometimes also called ``old German'' fonts.
% This tradition is widely continued until today. The same limitations apply still today
% to many languages with non-latin glyphs, which is why letterspacing has a strong
% tradition in eastern countries where Cyrillic fonts are used.
%
% The \person{Duden} \cite{Duden}, a well known German dictionary, explains how to space out properly:
% \emph{Punctuation marks are spaced out like letters, except quotation marks and periods.
% Numbers are never spaced out. The German syllable \mbox{\emph{-sche}} is not spaced
% out in cases like \emph{``der {\so{Virchow{sche}}} Versuch''}\footnote{the \person{Virchow} experiment}.
% In the old German \emph{Fraktur} fonts the ligatures \emph{|ch|, |ck|, |sz|~(\ss)} and~\emph{|tz|} are
% not broken within spaced out text.}
%
% While some books follow all these rules \cite{Muszynski}, others don't
% \cite{Reglement}. In fact, most books in my personal library do \emph{not} space out commas.
%
%
%
%
%
%
%
%
%
% \section{Short introduction and common rules}
%
% The \soul\ package provides five commands that are aimed at emphasizing
% text parts. Each of the commands takes one argument that can either be
% the text itself or the name of a macro that contains text (e.\,g.~|\so\text|)^^A
% ^^A
% \footnote{See~\ref{par:Unexpandable material in command sequences} for
%    some additional information about the latter mode.}^^A
% ^^A
% .
% See table~\ref{tab:survey} for a complete command survey.
%
% {\catcode`\|=12
% \begin{center}
% \begin{tabular}{r@{\hspace{1.5em}}l}
% \verb+\so{letterspacing}+&\so{letterspacing}\\
% \verb+\caps{CAPITALS, Small Capitals}+&\caps{CAPITALS, Small Capitals}\\
% \verb+\ul{underlining}+&\ul{underlining}\\
% \verb+\st{overstriking}+&\st{overstriking}\\
% \verb+\hl{highlighting}+&highlighting\footnotemark\\
% \end{tabular}
% \end{center}
% \footnotetext{The look of highlighting is nowhere demonstrated
%   in this documentation, because it requires a Postscript aware
%   output driver and would come out as ugly black bars on other
%   devices, looking very much like censoring bars. Think of it as
%   the effect of one of those coloring text markers.}
% }
%
% \noindent
% The \cs{\hl} command does only highlight if the \package{color} package
% was loaded, otherwise it falls back to underlining.\footnote{Note that
% you can also use \LaTeX's \package{color} package with Plain \TeX.
% See~\ref{sec:plain} for details.} The highlighting
% color is by default yellow, underlines and overstriking lines are by
% default black. The colors can be changed using the following commands:
%
% {\catcode`\|=12
% \begin{center}
% \begin{tabular}{r@{\hspace{1.5em}}l}
% \verb+\setulcolor{red}+&set underlining color\\
% \verb+\setstcolor{green}+&set overstriking color\\
% \verb+\sethlcolor{blue}+&set highlighting color\\
% \end{tabular}
% \end{center}
% }
%
% \noindent
% |\setulcolor{}| and |\setstcolor{}|  turn coloring off.
% There are only few colors predefined by the \package{color}
% package, but you can easily add custom color definitions.
% See the \package{color} package documentation~\cite{color} for further
% information.
%
% \begin{example}
% |\usepackage{color,soul}|\\
% |\definecolor{lightblue}{rgb}{.90,.95,1}|\\
% |\sethlcolor{lightblue}|\\
% |...|\\
% |\hl{this is highlighted in light blue color}|\\
% \end{example}
%
%
%
%
%
%
%
% \subsection[Some things work]{Some things work \dots}
%
% The following examples may look boring and redundant, because they describe
% nothing else than common \LaTeX\ notation with a few exceptions, but this is
% only the half story: The \soul\ package has to pre-process the argument
% before it can split it into characters and syllables, and all described
% constructs are only allowed because the package explicitly implements them.
%
% \begin{verblist}{1}
% \item[Accents: \so{na\"\i ve}]
%   Accents can be used naturally.
%   Support for the following accents is built-in: |\`|, |\'|, |\^|, |\"|, |\~|,
%   |\=|, |\.|, |\u|, |\v|, |\H|, |\t|, |\c|, |\d|, |\b|, and |\r|. Additionally,
%   if the \package{german} package \cite{german} is loaded you can also use the |"|
%   accent command and write |\so{na"ive}|. See section~\ref{sec:soulaccent} for how to add
%   further accents.
% \item[Quotes: \so{``quotes''}]
%   The \soul\ package recognizes the quotes ligatures |``|, |''| and |,,|.
%   The Spanish ligatures |!`| and |?`| are not recognized and have, thus,
%   to be written enclosed in braces like in |\caps{{!`}Hola!}|.
% \item[Mathematics: \so{foo$x^3$bar}]
%   Mathematic formulas are allowed, as long as they are
%   surrounded by~\texttt\$. Note that the \LaTeX\
%   equivalent |\(...\)| does not work.
% \item[Hyphens and dashes: \so{re-sent}]
%   Explicit hyphens as well as en-dashes~(|--|), em-dashes~(|---|)
%   and the |\slash| command work as usual.
% \item[Newlines: \so{new\\line}]
%   The |\\|~command fills the current line with white space
%   and starts a new line. Spaces or linebreaks afterwards are ignored.
%   Unlike the original \LaTeX\ command \soul's version does not handle
%   optional parameters like in |\\*[1ex]|.
% \item[Breaking lines: \so{foo\linebreak bar}]
%   The \cs{\linebreak} command breaks the line without
%   filling it with white space at the end. \soul's version
%   does not handle optional parameters like in |\linebreak[1]|.
%   \cs{\break} can be used as a synonym.
% \item[Unbreakable spaces: \so{don't~break}]
%   The |~|~command sets an unbreakable space.
% \item[Grouping: \so{Virchow{sche}}]
%   A pair of braces can be used to let a group of characters
%   be seen as one entity, so that \soul\ does
%   for instance not space it out. The contents must, however,
%   not contain potential hyphenation points. (See~\ref{par:Protecting})
% \item[Protecting: \so{foo \mbox{little} bar}]
%   An \cs{\mbox} also lets \soul\ see the contents as one
%   item, but these may even contain hyphenation points. \cs{\hbox} can
%   be used as a synonym.
% \item[Omitting: \so{\soulomit{foo}}]
%   The contents of \cs{\soulomit} bypass the soul core and are typeset
%   as is, without being letterspaced or underlined. Hyphenation points are
%   allowed within the argument. The current font remains active, but can be
%   overridden with \cs{\normalfont} etc.
% \item[Font switching commands: \so{foo \texttt{bar}}]
%   All standard \TeX\ and \LaTeX\ font switching commands are allowed, as
%   well as the \package{yfonts} package \cite{yfonts} font commands like \cs{\textfrak} etc.
%   Further commands have to be registered using the \cs{\soulregister}
%   command (see section~\ref{sec:soulregister}).
% \item[Breaking up ligatures: \ul{Auf{}lage}]
%   Use |{}| or \cs{\null} to break up ligatures like `fl' in \cs{\ul}, \cs{\st} and \cs{\hl}
%   arguments.
%   This doesn't make sense for \cs{\so} and \cs{\caps}, though, because they break up
%   every unprotected (ungrouped\slash unboxed) ligature, anyway, and would
%   then just add undesirable extra space around the additional item.
% \end{verblist}
%
%
%
%
% \subsection{\texorpdfstring{\dots\ }{... }others don't}
%
% Although the new \soul\ is much more robust and forgiving than
% versions prior to~2.0, there are
% still some things that are not allowed in arguments.
% This is due to the complex engine, which has to read and inspect every
% character before it can hand it over to \TeX's paragraph builder.
%
% \begin{verblist}{20}
% \item[Grouping hyphenatable material: \so{foo {little} bar}]
%   Grouped characters must not contain hyphenation points. Instead of
%   |\so{foo {little}}| write |\so{foo \mbox{little}}|. You get a
%   \texttt{`Re\-con\-struction failed'} error and a black square like
%   \errsquare\ in the \caps{DVI} file where you violated this rule.
% \item[Discretionary hyphens: \so{Zu\discretionary{k-}{}{c}ker}]
%   The argument must not contain discretionary hyphens. Thus, you have to
%   handle cases like the German word |Zu\discretionary{k-}{}{c}ker| by yourself.
% \item[Nested soul commands: \ul{foo \so{bar} baz}]
%   \soul\ commands must not be nested. If you really
%   need such, put the inner stuff in a box and use this box. It will, of
%   course, not get broken then.\\
%   \null\qquad|\newbox\anyboxname|\\
%   \null\qquad|\sbox\anyboxname{ \so{the worst} }|\\
%   \null\qquad|\ul{This is by far{\usebox\anyboxname}example!}|\\
%   yields:\\
%   \newbox\anyboxname
%   \sbox\anyboxname{ \so{the worst} }
%   \null\qquad\ul{This is by far{\usebox\anyboxname}example!}
% \item[Leaking font switches: \def\foo{\bf bar} \so{\foo baz}]
%   A hidden font switching command that leaks into its neighborship
%   causes a \texttt{`Reconstruction failed'} error. To avoid this either
%   register the `container' (|\soulregister{\foo}{0}|), or limit its
%   scope as in |\def\foo{{\bf bar}}|. Note that both
%   solutions yield slightly different results.
% \item[Material that needs expansion: \so{\romannumeral\year}]
%   In this example \cs{\so} would try to put space between \cs{\romannumeral}
%   and \cs{\year}, which can, of course, not work.
%   You have to expand the argument before you feed it to \soul, or even better:
%   Wrap the material up in a command sequence and let \soul\ expand it:
%   |\def\x{\romannumeral\year}| |\so\x|. \soul\ tries hard to expand
%   enough, yet not too much.
% \item[Unexpandable material in command sequences: \def\foo{\bar} \so\foo]
%   Some macros might not be expandable in an \cs{\edef} definition^^A
%   \footnote{Try \texttt{\string\edef\string\x\char`\{\string\copyright\char`\}}.
%   Yet \texttt{\string\copyright} works in \soul\ arguments, because it is
%   explicitly taken care of by the package}
%   and have to be protected with \cs{\noexpand} in front. This is automatically done
%   for the following tokens: |~|, \cs{\,}, \cs{\TeX}, \cs{\LaTeX},
%   \cs{\S}, \cs{\slash}, \cs{\textregistered}, \cs{\textcircled}, and \cs{\copyright},
%   as well as for all registered fonts and accents. Instead of putting \cs{\noexpand}
%   manually in front of such commands, as in |\def\foo{foo {\noexpand\bar} bar}| |\so\foo|,
%   you can also register them as special (see section \ref{sec:soulregister}).
% \item[Other weird stuff: \so{foo \verb|\bar| baz}]
%   \soul\ arguments must not contain \LaTeX\ environments, command definitions,
%   and fancy stuff like |\vadjust|. \soul's |\footnote| command replacement
%   does not support optional arguments. As long as you are writing simple,
%   ordinary `horizontal' material, you are on the safe side.
% \end{verblist}
%
%
%
%
%
%
%
% \begin{table}
% \begin{center}
% \catcode`\|=12
% \newcommand*\pref[1]{{\footnotesize\pageref{cmd:#1}}}
% \newcommand*\Ast{\rlap{$^\ast$}}
% \let\m\cs
% \let\ti\textit
% \begin{tabular}{r@{\hspace{.6em}}c@{\hspace{.6em}}l}
% &\hbox to0pt{\hss\footnotesize page\hss}&\\[.5ex]
% \verb+\so{letterspacing}+&                \pref{so}           &\so{letterspacing}\\
% \verb+\caps{CAPITALS, Small Capitals}+&   \pref{caps}         &\caps{CAPITALS, Small Capitals}\\
% \verb+\ul{underlining}+&                  \pref{ul}           &\ul{underlining}\\
% \verb+\st{striking out}+&                 \pref{st}           &\st{striking out}\\
% \verb+\hl{highlighting}+&                 \pref{hl}           &highlighting\\
% \\
% \verb+\soulaccent{\cs}+&                  \pref{soulaccent}   &\ti{add accent} \cs{\cs} \ti{to accent list}\\
% \verb+\soulregister{\cs}{0}+&             \pref{soulregister} &\ti{register command} \m{\cs}\\
% \verb+\sloppyword{text}+&                 \pref{sloppyword}   &\ti{typeset} \m{text} \ti{with stretchable spaces}\\
% \\
% \verb+\sodef\cs{1em}{2em}{3em}+&          \pref{sodef}        &\ti{define new spacing command} \m{\cs}\\
% \verb+\resetso+&                          \pref{resetso}      &\ti{reset} \m{\so} \ti{dimensions}\\
% \verb+\capsdef{////}{1em}{2em}{3em}+\Ast& \pref{capsdef}      &\ti{define (default)} \m{\caps} \ti{data entry}\\
% \verb+\capssave{name}+\Ast&               \pref{capssave}     &\ti{save} \m{\caps} \ti{database under name} \rlap{\texttt{name}}\\
% \verb+\capsselect{name}+\Ast&             \pref{capssave}     &\ti{restore} \m{\caps} \ti{database of name} \rlap{\texttt{name}}\\
% \verb+\capsreset+\Ast&                    \pref{capsreset}    &\ti{clear caps database}\\
% \verb+\setul{1ex}{2ex}+&                  \pref{setul}        &\ti{set} \m{\ul} \ti{dimensions}\\
% \verb+\resetul+&                          \pref{resetul}      &\ti{reset} \m{\ul} \ti{dimensions}\\
% \verb+\setuldepth{y}+&                    \pref{setuldepth}   &\ti{set underline depth to depth of an} y\\
% \verb+\setuloverlap{1pt}+&                \pref{setuloverlap} &\ti{set underline overlap width}\\
% \verb+\setulcolor{red}+&                  \pref{setulcolor}   &\ti{set underline color}\\
% \verb+\setstcolor{green}+&                \pref{setstcolor}   &\ti{set overstriking color}\\
% \verb+\sethlcolor{blue}+&                 \pref{sethlcolor}   &\ti{set highlighting color}\\
% \end{tabular}
% \caption{List of all available commands. The number points to the
%          page where the command is described. Those marked
%          with a little asterisk are only available when the package
%          is used together with \LaTeX, because they rely on the
%          \emph{New Font Selection Scheme (NFSS)} used in \LaTeX.}
% \label{tab:survey}
% \end{center}
% \end{table}
%
%
%
%
%
%
%
% \subsection{Troubleshooting}
%
% Unfortunately, there's just one helpful error message provided by
% the \soul\ package, that actually describes the underlying problem. All other
% messages are generated directly by \TeX\ and show the low-level
% commands that \TeX\ wasn't happy with. They'll hardly point you
% to the violated rule as described in the paragraphs above.
% If you get such a mysterious error message for a line that contains
% a \soul\ statement, then comment that statement out and see if the message
% still appears.
% \texttt{`Incomplete }\cs{\ifcat}\texttt{'} is such a non-obvious message.
% If the message doesn't appear now, then check the argument for
% violations of the rules as listed in~\S\S\,20--26.
%
%
%
% \subsubsection{\texttt{`Reconstruction failed'}}
%
% This message appears, if \ref{par:Grouping hyphenatable material} or
% \ref{par:Leaking font switches} was
% violated. It is caused by the fact that the reconstruction pass
% couldn't collect tokens with an overall width of the syllable that
% was measured by the analyzer. This does either occur when you
% grouped hyphenatable text or used an unregistered command
% that influences the syllable width. Font switching commands belong
% to the latter group. See the above cited sections for how to fix
% these problems.
%
%
%
% \subsubsection{Missing characters}
%
% If you have redefined the internal font as described in section \ref{sec:internalfont},
% you may notice that some characters are omitted without any error message
% being shown. This happens if you have chosen, let's say, a font with
% only 128~characters like the |cmtt10| font, but are using characters
% that aren't represented in this font, e.\,g.~characters with codes
% greater than~127.
%
%
%
%
%
%
%
%
%
% \section{\texorpdfstring{\so{Letterspacing}}{Letterspacing}}
%
% \subsection{How it works}
% \label{sec:so}
%
% The base macro for letterspacing is called \describemacro{\so}.
% It typesets the given argument with \syn{inter-letter space}
% between every two characters, \syn{inner space} between words
% and \syn{outer space} before and after the spaced out text.
% If we let ``$\cdot$'' stand for \syn{inter-letter space}, ``$\ast$''
% for \syn{inner spaces} and ``$\bullet$'' for \syn{outer
% spaces,} then the input on the left side of the following table
% will yield the schematic output on the right side:
%
% \begin{center}
% \def\.{$\cdot$}
% \def\-{\kern1pt$\ast$\kern1pt}
% \def\*{$\bullet$}
% \def\_{\texttt{\char"20}}
% \begin{tabular}{ccc}
% 1.& \verb*|XX\so{aaa bbb ccc}YY|&            \textsf{XXa\.a\.a\-b\.b\.b\-c\.c\.cYY}\\
% 2.& \verb*|XX \so{aaa bbb ccc} YY|&          \textsf{XX\*a\.a\.a\-b\.b\.b\-c\.c\.c\*\kern-1ptYY}\\
% 3.& \verb*|XX {\so{aaa bbb ccc}} YY|&        \textsf{XX\*a\.a\.a\-b\.b\.b\-c\.c\.c\*\kern-1ptYY}\\
% 4.& \verb*|XX \null{\so{aaa bbb ccc}}{} YY|& \textsf{XX\_a\.a\.a\-b\.b\.b\-c\.c\.c\_YY}\\
% \end{tabular}
% \end{center}
% ^^A* %                     fool vim (fixes syntax highlighting)
%
% \noindent
% Case~1 shows how letterspacing macros (\cs{\so} and \cs{\caps}) behave if
% they aren't following or followed by a space: they omit outer space around
% the \soul\ statement. Case~2 is what you'll mostly need---letterspaced
% text amidst running text. Following and leading space get replaced by
% \syn{outer space}. It doesn't matter if there are opening braces before
% or closing braces afterwards. \soul\ can see through both of them (case~3).
% Note that leading space has to be at least |5sp| wide to be recognized as
% space, because \LaTeX\ uses tiny spaces generated by |\hskip1sp| as marker.
% Case~4 shows how to enforce normal spaces instead of \syn{outer spaces:}
% Preceding space can be hidden by |\kern0pt| or \cs{\null} or any character.
% Following space can also be hidden by any token, but note that a typical macro name
% like \cs{\relax} or \cs{\null} would also hide the space thereafter.
%
%
% The values are predefined for typesetting facsimiles mainly with
% \emph{Fraktur} fonts.
% You can define your own spacing
% macros or overwrite the original \cs{\so} meaning using the macro
% \describemacro{\sodef}:
%
% \begin{syntax}
% |\sodef|\<cmd>|{|\<font>|}{|\<inter-letter space>|}{|\<inner space>|}{|\<outer space>|}|
% \end{syntax}
%
% The space dimensions, all of which are mandatory, should be defined in terms of |em|
% letting them grow and shrink with the respective fonts.
%
% \begin{example}
% |\sodef\an{}{.4em}{1em plus1em}{2em plus.1em minus.1em}|
% \end{example}
%
% After that you can type `|\an{example}|' to get
% {\sodef\an{}{.4em}{1em plus1em}{2em plus.1em minus.1em}^^A
% `\an{example}'.}
% The \describemacro{\resetso} command resets \cs{\so}
% to the default values.
%
%
%
%
% \subsection{Some examples}
%
%^^A=====================================================
% \begin{examples}
%
% \soultest{Ordinary text}
%   |\so{electrical industry}|
%   {\so{electrical industry}}
%
% \soultest{Use \texttt{\string\-} to mark hyphenation points}
%   |\so{man\-u\-script}|
%   {\so{man\-u\-script}}
%
% \soultest{Accents are recognized}
%   |\so{le th\'e\^atre}|
%   {\so{le th\'e\^atre}}
%
% \soultest{\texttt{\string\mbox} and \texttt{\string\hbox} protect material that
%   contains hyphenation points. The contents are treated as one, unbreakable entity}
%   |\so{just an \mbox{example}}|
%   {\so{just an \mbox{example}}}
%
% \soultest{Punctuation marks are spaced out, if they are
%   put into the group}
%   |\so{inside.} \& \so{outside}.|
%   {\so{inside.} \& \so{outside}.}
%
% \soultest{Space-out skips may be removed by typing \texttt{\string\<}.
% It's, however, desirable to put the quotation marks out of
% the argument}
%   |\so{``\<Pennsylvania\<''}|
%   {\so{``\<Pennsylvania\<''}}
%
% \soultest{Numbers should never be spaced out}
%   |\so{1\<3 December {1995}}|
%   {\so{1\<3 December {1995}}}
%
% \soultest{Explicit hyphens like |-|, |--| and |---| are recognized.
%   \texttt{\string\slash} outputs a slash and enables \TeX\ to break the line
%   afterwards}
%   |\so{input\slash output}|
%   {\so{input\slash output}}
%
% \soultest{To keep \TeX\ from breaking lines between the hyphen and `jet'
%   you have to protect the hyphen. This is no \soul\ restriction
%   but normal \TeX\ behavior}
%   |\so{\dots and \mbox{-}jet}|
%   {\so{\dots and \mbox{-}jet}}
%
% \soultest{The \texttt{\~} command inhibits line breaks}
%   |\so{unbreakable~space}|
%   {\so{unbreakable~space}}
%
% \soultest{\texttt{\string\\} works as usual. Additional arguments
%   like \texttt{*} or vertical space are not accepted, though}
%   |\so{broken\\line}|
%   {\so{broken\\line}}
%
% \soultest{\texttt{\string\break} breaks the line without filling it with white space}
%   |\so{pretty awful\break test}|
%   {\so{pretty awful\break test}}
%
% \end{examples}
%^^A=====================================================
%
%
%
%
%
%
%
%
%
%
%
% \subsection[Typesetting \texorpdfstring{\caps{caps-and-small-caps}}{caps-and-small-caps} fonts]
%       {Typesetting capitals-and-small-capitals fonts}
%
% There is a special letterspacing command called \describemacro{\caps},
% which differs from \cs{\so} in that it switches to caps-and-small-caps
% font shape, defines only slight spacing and is able to select spacing
% value sets from a database. This is a requirement for high-quality
% typesetting \cite{Tschichold}. The following lines show the effect
% of \cs{\caps} in comparison with the normal textfont and with
% small-capitals shape:
%
% \def\sampletext{DONAUDAMPFSCHIFFAHRTSGESELLSCHAFT}
% \medskip\noindent
% \begin{tabular}{rl}
% |\normalfont|&\sampletext\\
% |\scshape|&{\scshape\sampletext}\\
% |\caps|&\caps\sampletext\\
% ^^A|\person|&\person\sampletext\\
% \end{tabular}
%
% \medbreak\noindent
% The \cs{\caps} font database is by default empty, i.\,e., it contains
% just a single default entry, which yields the result as shown in the
% example above.
% New font entries may be added \emph{on top} of this list using the \describemacro{\capsdef}
% command, which takes five arguments: The first argument describes the font with
% \emph{encoding, family, series, shape,} and \emph{size,}^^A
% \footnote{as defined by the \caps{NFSS}, the ``New Font Selection Scheme''}
% each optionally
% (e.\,g.~|OT1/cmr/m/n/10| for this very font, or only |/ppl///12| for all
% \emph{palatino} fonts at size 12\,pt). The \emph{size} entry may also contain
% a size range (\texttt{5-10}), where zero is assumed for an omitted lower
% boundary (\texttt{-10}) and a very, very big number for an omitted upper
% boundary (\texttt{5-}). The
% upper boundary is not included in the range, so, in the example below, all
% fonts with sizes greater or equal 5\,pt and smaller than 15\,pt are accepted
% ($5\,\mbox{pt}\le size<15\,\mbox{pt}$).
% The second argument may contain font switching commands such as \cs{\scshape},
% it may as well be empty or contain debugging commands (e.\,g.~|\message{*}|).
% The remaining three, mandatory arguments are the spaces as described in
% section~\ref{sec:so}.
%
% \begin{example}
% |\capsdef{T1/ppl/m/n/5-15}{\scshape}{.16em}{.4em}{.2em}|
% \end{example}
%
% The \cs{\caps} command goes through the data list from top to bottom
% and picks up the first matching set, so the order of definition is essential.
% The last added entry is examined first, while the pre-defined default entry
% will be examined last and will match any font, if no entry was taken before.
%
% To override the default values, just define a new default entry using
% the identifier |{////}|. This entry should be defined first, because no
% entry after it can be reached.
%
% The \cs{\caps} database can be cleared with the \describemacro{\capsreset}
% command and will only contain the default entry thereafter. The
% \describemacro{\capssave} command saves the whole current database
% under the given name. \describemacro{\capsselect} restores such a database.
% This allows to predefine different groups of \cs{\caps} data sets:
%
% \begin{example}
% |\capsreset|\\
% |\capsdef{/cmss///12}{}{12pt}{23pt}{34pt}|\\
% |\capsdef{/cmss///}{}{1em}{2em}{3em}|\\
% |...|\\
% |\capssave{wide}|\\
% \end{example}
% \indent
% \begin{example}
% |%---------------------------------------|\\
% |\capsreset|\\
% |\capsdef{/cmss///}{}{.1em}{.2em}{.3em}|\\
% |...|\\
% |\capssave{narrow}|\\
% \end{example}
% \indent
% \begin{example}
% |%---------------------------------------|\\
% |{\capsselect{wide}|\\
% |\title{\caps{Yet Another Silly Example}}|\\
% |}|\\
% \end{example}
%
% See the `|example.cfg|' file for a detailed example.
% If you have defined a bunch of sets for different fonts and sizes,
% you may lose control over what fonts are used by the package. With the
% package option \DescribeOption{capsdefault}\option{capsdefault} selected,
% \cs{\caps} prints its argument underlined, if no set was specified for a
% particular font and the default set had to be used.
%
%
%
%
%
%
%
%
%
%
%
% \subsection{Typesetting Fraktur}
% \label{sec:fraktur}
%
% Black letter fonts^^A
%^^A%%
%   \footnote{See the great black letter fonts, which \person{Yannis Haralambous}
%   kindly provided, and the \package{oldgerm} and \package{yfonts} package~\cite{yfonts}
%   as their \LaTeX\ interfaces.}
%^^A%%
% deserve some additional considerations. As stated in section~\ref{sec:typesetting},
% the ligatures |ch|, |ck|, |sz|~(\cs{\ss}), and~|tz| have to remain unbroken in spaced out
% \emph{Fraktur} text.  This may look strange at first glance, but you'll get used to it:
%
% \begin{example}
% |\textfrak{\so{S{ch}u{tz}vorri{ch}tung}}|
% \end{example}
%
% You already know that grouping keeps the |soul| mechanism from separating such ligatures.
% This is quite important for |s:|, |a*|, and~|"a|. As hyphenation is stronger than
% grouping, especially the |sz| may cause an error, if hyphenation happens to occur between
% the letters |s| and~|z|. (\TeX\ hyphenates the German word |auszer| wrongly like
% |aus-zer| instead of like |au-szer|, because the German hyphenation patterns
% do, for good reason, not see |sz| as `\cs{\ss}'.) In such cases you can protect tokens with the
% sequence e.\,g.~|\mbox{sz}| or a properly defined command. The \cs{\ss} command,
% which is defined by the \package{yfonts} package, and similar commands will suffice as well.
%
%
%
%
%
%
%
% \subsection{Dirty tricks}
% \label{sec:dirtytricks}
%
% Narrow columns are hard to set, because they don't allow much spacing
% flexibility, hence long words often cause overfull boxes. A macro
% could use \cs{\so} to insert stretchability between the single
% characters. Table~\ref{tab:dirtytricks} shows some text typeset with such
% a macro at the left side and under \emph{plain} conditions at
% the right side, both with a width of~6\,pc.
%
% \def\sampletext{Some magazines and newspapers prefer this kind of spacing
% because it reduces hyphenation problems to a minimum\<. Unfortunately\<, such
% paragraphs aren't especially beautiful\<.}
% \newbox\dirtytrick
% \setbox\dirtytrick\vbox{
% \batchmode     ^^A  we don't want to see all these overfull boxes ...
% \leavevmode\hspace{0ptplus1fil}
% \hbox{\parindent0pt\plainsetup\let\<\relax
%   \vtop{\hsize6pc\raggedright\sampletext}\hskip1em
%   \vtop{\hsize6pc\magstylepar\sampletext}\hskip1em
%   \vtop{\hsize6pc\sampletext}\hss}
% \errorstopmode}
%
% \begin{table}
% \begin{center}
% \overfullrule5pt
% \usebox\dirtytrick
% \caption{Ragged-right, magazine style (using \soul), and block-aligned
%          in comparison. But, frankly, none of them is really acceptable.
%          (Don't do this at home, children!)}
% \label{tab:dirtytricks}
% \end{center}
% \end{table}
%
%
%
%
%
%
%
% \section{\texorpdfstring{\ul{Underlining}}{Underlining}}
%
% The underlining macros are my answer to Prof.~\person{Knuth'{\normalfont s}}
% exercise 18.26 from his \TeX{}book~\cite{DEK}. \texttt{:-)} Most of what
% is said about the macro \describemacro{\ul} is also true of the
% striking out macro \describemacro{\st} and the highlighting macro \describemacro{\hl},
% both of which are in fact derived from the former.
%
%
%
%
% \subsection{Settings}
%
% \subsubsection{Underline depth and thickness}
%
% The predefined \syn{underline depth} and \syn{thickness}
% work well with most fonts. They can be changed using the macro \describemacro{\setul}.
%
% \begin{syntax}
% |\setul{|\<underline depth>|}{|\<underline thickness>|}|
% \end{syntax}
%
% Either dimension can be omitted, in which case there has to be
% an empty pair of braces.
% Both values should be defined in terms of |ex|, letting them
% grow and shrink with the respective fonts.
% The \describemacro{\resetul} command restores the standard values.
%
% Another way to set the \syn{underline depth} is to use the macro
% \describemacro{\setuldepth}. It sets the depth such that the
% underline's upper edge lies 1\,pt beneath the given argument's
% deepest depth. If the argument is empty, all
% letters---i.\,e.\ all characters whose \cs{\catcode} currently
% equals 11---are taken. Examples:
%
% \begin{example}
% |\setuldepth{ygp}|\\
% |\setuldepth\strut|\\
% |\setuldepth{}|\\
% \end{example}
%
%
%
% \subsubsection{Line color}
%
% The underlines are by default black. The color can be changed by
% using the \describemacro{\setulcolor} command. It takes one argument that can be any
% of the color specifiers as described in the |color| package. This package
% has to be loaded explicitly.
%
% \indent
% \begin{example}
% |\documentclass{article}|\\
% |\usepackage{color,soul}|\\
% |\definecolor{darkblue}{rgb}{0,0,0.5}|\\
% |\setulcolor{darkblue}|\\
% \end{example}
%
% \indent
% \begin{example}
% |\begin{document}|\\
% |...|\\
% |\ul{Cave: remove all the underlines!}|\\
% |...|\\
% |\end{document}|\\
% \end{example}
%
%
% The colors for overstriking lines and highlighting are likewise set
% with \describemacro{\setstcolor} (default: black) and \describemacro{\sethlcolor}
% (default: yellow). If the \package{color} package wasn't loaded,
% underlining and overstriking color are black, while highlighting
% is replaced by underlining.
%
%
%
%
%
%
%
% \subsubsection{The \program{dvips} problem}
% \label{sec:dvips}
%
% \ul{Underlining}, \st{striking out} and highlighting build up
% their lines with many short line segments. If you used the `\program{dvips}'
% program with default settings, you would get little gaps on some places, because
% the \emph{maxdrift} parameter allows the single objects to drift
% this many pixels from their real positions.
% \bigbreak
%
% \noindent
% There are two ways to avoid the problem, where the \soul\ package
% chooses the second by default:
% \begin{enumerate}
% \item
%   Set the \emph{maxdrift} value to zero, e.\,g.: |dvips -e 0 file.dvi|.
%   This is probably not a good idea, since the letters may then no longer be
%   spaced equally on low resolution printers.
% \item
%   Let the lines stick out by a certain amount on each side so that they
%   overlap. This overlap amount can be set using the \describemacro{\setuloverlap}
%   command. It is set to 0.25\,pt by default. |\setuloverlap{0pt}| turns overlapping off.
% \end{enumerate}
%
%
%
%
%
%
% \subsection{Some examples}
%
%^^A=====================================================
% \begin{examples}
%
% \soultest{Ordinary text}
%   |\ul{electrical industry}|
%   {\ul{electrical industry}}
%
% \soultest{Use \texttt{\string\-} to mark hyphenation points}
%   |\ul{man\-u\-script}|
%   {\ul{man\-u\-script}}
%
% \soultest{Accents are recognized}
%   |\ul{le th\'e\^atre}|
%   {\ul{le th\'e\^atre}}
%
% \soultest{\texttt{\string\mbox} and \texttt{\string\hbox} protect material that
%   contains hyphenation points. The contents are treated as one, unbreakable entity}
%   |\ul{just an \mbox{example}}|
%   {\ul{just an \mbox{example}}}
%
% \soultest{Explicit hyphens like |-|, |--| and |---| are recognized.
%   \texttt{\string\slash} outputs a slash and enables \TeX\ to break the line
%   afterwards}
%   |\ul{input\slash output}|
%   {\ul{input\slash output}}
%
% \soultest{To keep \TeX\ from breaking lines between the hyphen and `jet'
%   you have to protect the hyphen. This is no \soul\ restriction
%   but normal \TeX\ behavior}
%   |\ul{\dots and \mbox{-}jet}|
%   {\ul{\dots and \mbox{-}jet}}
%
% \soultest{The \texttt{\~} command inhibits line breaks}
%   |\ul{unbreakable~space}|
%   {\ul{unbreakable~space}}
%
% \soultest{\texttt{\string\\} works as usual. Additional arguments
%   like \texttt{*} or vertical space are not accepted, though}
%   |\ul{broken\\line}|
%   {\ul{broken\\line}}
%
% \soultest{\texttt{\string\break} breaks the line without filling it with white space}
%   |\ul{pretty awful\break test}|
%   {\ul{pretty awful\break test}}
%
% \soultest{Italic correction needs to be set manually}
%   |\ul{foo \emph{bar\/} baz}|
%   {\ul{foo \emph{bar\/} baz}}
%
% \end{examples}
%^^A=====================================================
%
%
%
%
%
%
%
%
%
%
%
%
%
% \section{Customization}
%
% \subsection{Adding accents}
% \label{sec:soulaccent}
%
% The \soul\ scanner generally sees every input token separately.
% It has to be taught that some tokens belong together. For accents this is done
% by registering them via the \describemacro{\soulaccent} macro.
%
% \begin{syntax}
% |\soulaccent{|\<accent command>|}|
% \end{syntax}
%
% The standard accents, however, are already pre-registered:
% |\`|, |\'|, |\^|, |\"|, |\~|, |\=|, |\.|, |\u|, |\v|, |\H|, |\t|,
% |\c|, |\d|, |\b|, and |\r|. If used together with the \package{german}
% package, \soul\ automatically adds the |"| command.
% Let's assume you have defined |\%| to put some weird accent on
% the next character. Simply put the following line into your |soul.cfg|
% file (see section~\ref{sec:config}):
%
% \begin{example}
% |\soulaccent{\%}|
% \end{example}
%
% Note that active characters like the |"| command have already
% to be \cs{\active} when they are stored or they won't be recognized
% later. This can be done temporarily, as in |{\catcode\`"\active\soulaccent{"}}|.
%
%
%
%
% \subsection{Adding font commands}
% \label{sec:soulregister}
%
% To convince \soul\ not to feed font switching (or other)
% commands to the analyzer, but rather to execute them immediately,
% they have to be registered, too. The \describemacro{\soulregister} macro
% takes the name of a command name and either |0| or |1| for the number
% of arguments:
%
% \begin{syntax}
% |\soulregister{|\<command name>|}{|\<number of arguments>|}|
% \end{syntax}
%
% If \cs{\bf} and \cs{\emph} weren't already registered, you would
% write the following into your |soul.cfg| configuration file:
%
% \begin{example}
% |\soulregister{\bf}{0}        % {\bf foo}| \\
% |\soulregister{\emph}{1}      % \emph{bar}|\\
% \end{example}
%
%
% All standard \TeX\ and \LaTeX\ font commands, as well as the
% \package{yfonts} commands are already pre-registered:
%
% \begin{example}
% |\em, \rm, \bf, \it, \tt, \sc, \sl, \sf, \emph, \textrm,|\\
% |\textsf, \texttt, \textmd, \textbf, \textup, \textsl,|\\
% |\textit, \textsc, \textnormal, \rmfamily, \sffamily,|\\
% |\ttfamily, \mdseries, \upshape, \slshape, \itshape,|\\
% |\scshape, \normalfont, \tiny, \scriptsize, \footnotesize,|\\
% |\small, \normalsize, \large, \Large, \LARGE, \huge, \Huge,|\\
% |\MakeUppercase, \textsuperscript, \footnote,|\\
% |\textfrak, \textswab, \textgoth, \frakfamily,|\\
% |\swabfamily, \gothfamily|\\
% \end{example}
%
% You can also register other commands as fonts, so the
% analyzer won't see them. This may be necessary for some
% macros that \soul\ refuses to typeset correctly.
% But note, that \cs{\so} and \cs{\caps} won't put their
% letter-skips around then.
%
%
%
%
%
%
% \subsection{Changing the internal font}
% \label{sec:internalfont}
%
% The \soul\ package uses the |ectt1000| font while it analyzes
% the syllables. This font is used, because it
% has 256~mono-spaced characters without any kerning.
% It belongs to \person{J\"org Knappen'\textrm{s}}
% \caps{EC}-fonts, which should be part of every modern \TeX\ installation.
% If \TeX\ reports ``\texttt{I can't find file `ectt1000'}'' you don't
% seem to have this font installed. It is recommended that
% you install at least the file |ectt1000.tfm| which has less than 1.4\,kB\null.
% Alternatively, you can let the \soul\ package use the |cmtt10| font that
% is part of any installation, or some other mono-spaced font:
%
% \begin{example}
% |\font\SOUL@tt=cmtt10|
% \end{example}
%
% Note, however, that \soul\ does only handle characters,
% for which the internal font has a character with the same
% character code. As |cmtt10| contains only characters with codes
% 0 to~127, you can't typeset characters with codes 128 to~255.
% These 8-bit character codes are used by many fonts with non-ascii
% glyphs. So the |cmtt10| font will, for example, not work for |T2A|
% encoded cyrillic characters.
%
%
%
%
%
%
%
% \subsection{The configuration file}
% \label{sec:config}
%
% If you want to change the predefined settings or add new features,
% then create a file named `|soul.cfg|' and put it in a directory, where \TeX\
% can find it. This configuration file will then be loaded
% at the end of the |soul.sty| file, so you may redefine
% any settings or commands therein, select package options and even
% introduce new ones. But if you intend to give
% your documents to others, don't forget to give them the
% required configuration files, too! That's how such a file
% could look like:
%
% \indent
% \begin{example}
% |% define macros for logical markup|\\
% |\sodef\person{\scshape}{0.125em}{0.4583em}{0.5833em}|\\
% \\
% |\sodef\SOUL@@@versal{\upshape}{0.125em}{0.4583em}{0.5833em}|\\
% |\DeclareRobustCommand*\versal[1]{%|\\
% |    \MakeUppercase{\SOUL@@@versal{#1}}%|\\
% |}|\\
% \end{example}
%
% \indent
% \begin{example}
% |% load the color package and set|\\
% |% a different highlighting color|\\
% |\RequirePackage{color}|\\
% |\definecolor{lightblue}{rgb}{.90,.95,1}|\\
% |\sethlcolor{lightblue}|\\
% |\endinput|
% \end{example}
%
% You can safely use the |\SOUL@@@| namespace for internal macros---it
% won't be used by the \soul\ package in the future.
%
%
%
%
%
%
%
%
%
%
% \section{Miscellaneous}
%
% \subsection{Using \texorpdfstring{\soul\ }{soul }with other flavors of \texorpdfstring{\TeX}{TeX}}
% \label{sec:plain}
%
% This documentation describes how to use \soul\ together
% with \LaTeXe, for which it is optimized. It works, however, with
% all other flavors of \TeX, too. There are just some minor restrictions
% for Non-\LaTeX\ use:
%
% The \cs{\caps} command doesn't use a database, it is only a dumb
% definition with fixed values. It switches to \cs{\capsfont}, which---unless
% defined explicitly like in the following example---won't really change
% the used font at all. The commands \cs{\capsreset} and \cs{\capssave}
% do nothing.
%
% \begin{example}
% |\font\capsfont=cmcsc10|\\
% |\caps{Tschichold}|\\
% \end{example}
%
% None of the commands are made `robust', so they have to be
% explicitly protected in fragile environments like in \cs{\write}
% statements.
% To make use of colored underlines or highlighting you have to
% use the \package{color} package wrapper from \caps{CTAN}^^A
% \footnote{\texttt{CTAN:/macros/plain/graphics/\char`\{miniltx.tex,color.tex\char`\}}},
% instead of the \package{color} package directly:
%
% \begin{example}
% |\input color|\\
% |\input soul.sty|\\
% |\hl{highlighted}|\\
% |\bye|\\
% \end{example}
%
% The \option{capsdefault} package option is mapped to a simple command
% \describemacro{\capsdefault}.
%
%
%
%
%
%
%
% \subsection{Using \texorpdfstring{\soul\ }{soul }commands for logical markup}
% \label{sec:markup}
%
% It's generally a bad idea to use font style commands like \cs{\textsc}
% in running text. There should always be some reasoning behind changing
% the style, such as ``names of persons shall be typeset in a caps-and-small-caps
% font''. So you declare in your text just that some words are the name of a
% person, while you define in the preamble or, even better, in a separate
% style file how to deal with persons:
%
% \begin{example}
% |\newcommand*\person{\textsc}|\\
% |...|\\
% |``I think it's a beautiful day to go to the zoo and feed|\\
% |the ducks. To the lions.'' --~\person{Brian Kantor}|\\
% \end{example}
%
% It's quite simple to use \soul\ commands that way:
%
% \begin{example}
% |\newcommand\comment*{\ul}             % or \let\comment=\ul|\\
% |\sodef\person{\scshape}{0.125em}{0.4583em}{0.5833em}|\\
% \end{example}
%
% Letterspacing commands like \cs{\so} and \cs{\caps} have to
% check whether they are followed by white space, in which case
% they replace that space by \syn{outer space}. Note that \soul\
% does look through closing braces. Hence you can conveniently bury
% a \soul\ command within another macro like in the following
% example. Use any other token to hide following space if necessary,
% for example the \cs{\null} macro.
%
% \begin{example}
% |\DeclareRobustCommand*\versal[1]{%|\\
% |    \MakeUppercase{\SOUL@@@versal{#1}}%|\\
% |}|\\
% |\sodef\SOUL@@@versal{\upshape}{0.125em}{0.4583em}{0.5833em}|\\
% \end{example}
%
%
% But what if the \soul\ command is for some reason not the last one
% in that macro definition and thus cannot look ahead at the following token?
%
%
% \begin{example}
% |\newcommand*\somsg[1]{\so{#1}\message{#1}}|\\
% |...|\\
% |foo \somsg{bar} baz       % wrong spacing after `bar'!|\\
% \end{example}
%
% In this case you won't get the following space replaced by \emph{outer space}
% because when \soul\ tries to look ahead, it only sees the token
% \cs{\message} and consequently decides that there is no space to replace.
% You can get around this by explicitly calling the space scanner again.
%
% \begin{example}
% |\newcommand*\somsg[1]{{%|\\
% |    \so{#1}%|\\
% |    \message{bar}%|\\
% |    \let\\\SOUL@socheck|\\
% |    \\%|\\
% |}}|\\
% \end{example}
%
% However, \cs{\SOUL@socheck} can't be used directly, because it would discard
% any normal space. \cs{\\} doesn't have this problem.
% The additional pair of braces avoids that its definition leaks out
% of this macro. In the example above you could, of course, simply
% have put \cs{\message} in front, so you hadn't needed to
% use the scanner macro \cs{\SOUL@socheck} at all.
%
% Many packages do already offer logical markup commands that default
% to some standard \LaTeX\ font commands or to \cs{\relax}. One example
% is the \package{jurabib} package~\cite{jurabib}, which makes the use of
% \soul\ a challenge. This package implements lots of
% formatting macros. Let's have a look at one of them, \cs{\jbauthorfont},
% which is used to typeset author names in citations.
% The attempt to simply
% define |\let\jbauthorfont\caps| fails, because the macro isn't directly
% applied to the author name as in |\jbauthorfont{Don Knuth}|, but
% to another command sequence: |\jbauthorfont{\jb@@author}|. Not even
% \cs{\jb@@author} contains the name, but instead further commands that
% at last yield the requested name. That's why we have to expand
% the contents first. This is quite tricky, because we must not
% expand too much, either. Fortunately, we can offer the contents
% wrapped up in yet another macro, so that \soul\ knows that it has to
% use its own macro expansion mechanism:
%
% \begin{example}
% |\renewcommand*\jbauthorfont[1]{{%|\\
% |    \def\x{#1}%|\\
% |    \caps\x|\\
% |}}|\\
% \end{example}
%
% Some additional kerning after |\caps\x| wouldn't hurt, because
% the look-ahead scanner is blinded by further commands that follow
% in the \package{jurabib} package. Now we run into the next problem:
% cited names may contain commands
% that must not get expanded. We have to register them as special
% command:
%
% \begin{example}
% |\soulregister\jbbtasep{0}|\\
% |...|\\
% \end{example}
%
% But such registered commands bypass \soul's kernel and we don't
% get the correct spacing before and afterwards. So we end up
% redefining \cs{\jbbtasep}, whereby you should, of course, use
% variables instead of numbers:
%
% \begin{example}
% |\renewcommand*\jbbtasep{%|\\
% |    \kern.06em|\\
% |    \slash|\\
% |    \hskip.06em|\\
% |    \allowbreak|\\
% |}|\\
% \end{example}
%
% Another problem arises: bibliography entries that must not get
% teared apart are supposed to be enclosed in additional braces.
% This, however, won't work with \soul\ because of
% \ref{par:Grouping hyphenatable material}. A simple trick will
% get you around that problem: define a dummy command that only
% outputs its argument, and register that command:
%
% \begin{example}
% |\newcommand*\together[1]{#1}|\\
% |\soulregister\together{1}|\\
% \end{example}
%
% Now you can write ``|Author = {\together{Don Knuth}}|'' and
% \package{jurabib} won't dare to reorder the parts of the name.
% And what if some name shouldn't get letterspaced at all? Overriding
% a conventional font style like \cs{\textbf} that was globally
% set is trivial, you just have to specify the style that you
% prefer in that very bibliography entry. In our example, if we
% wanted to keep \soul\ from letterspacing a particular entry,
% although they are all formatted by our \cs{\jbauthorfont}
% and hence fed to \cs{\caps}, we'd use the following construction:
%
% \begin{example}
% |Author = {\soulomit{\normalfont\huge Donald E. Knuth}}|\\
% \end{example}
%
% The \package{jurabib} package is probably one of the more
% demanding packages to collaborate with \soul. Everything else
% can just become easier.
%
%
%
%
%
%
%
%
% \subsection{Typesetting long words in narrow columns}
% \label{sec:sloppyword}
%
% Narrow columns are best set |flushleft|, because not even the best
% hyphenation algorithm can guarantee acceptable line breaks without
% overly stretched spaces.
% However, in some rare cases one may be \emph{forced} to typeset
% block aligned. When typesetting in languages like German, where
% there are really long words, the \describemacro{\sloppyword} macro
% might help a little bit. It adds enough stretchability between the
% single characters to make the hyphenation algorithm happy, but
% is still not as ugly as the example in section~\ref{sec:dirtytricks}
% demonstrates. In the following example the left column was typeset
% as ``|Die \sloppyword{Donau...novelle} wird ...|'':
%
% \begin{center}
% \def\word{Do\-nau\-dampf\-schiff\-fahrts\-ge\-sell\-schafts\-^^A
%   ka\-pi\-t\"ans\-wit\-wen\-pen\-si\-ons\-ge\-setz\-no\-vel\-le}
% \begin{minipage}{1.5in}
% \plainsetup
% Die
% \expandafter\sloppyword\expandafter{\word}
% wird mit sofortiger Wirkung au\ss er Kraft gesetzt.
% \end{minipage}
% \hspace{1em}
% \batchmode
% \begin{minipage}{1.5in}
% \plainsetup
% Die \word\ wird mit sofortiger Wirkung au\ss er Kraft gesetzt.
% \end{minipage}
% \errorstopmode
% \end{center}
%
%
%
%
%
%
%
% \subsection{Using \texorpdfstring{\soul\ }{soul }commands in section headings}
%
% Letterspacing was often used for section titles in the past,
% mostly centered and with a closing period. The following example
% shows how to achieve this using the \package{titlesec}
% package \cite{titlesec}:
%
% \begin{example}
% |\newcommand*\periodafter[2]{#1{#2}.}|\\
% |\titleformat{\section}[block]|\\
% |    {\normalfont\centering}|\\
% |    {\thesection.}|\\
% |    {.66em}|\\
% |    {\periodafter\so}|\\
% |...|\\
% |\section{Von den Maassen und Maassst\"aben}|\\
% \end{example}
%
% \bigbreak
% This yields the following output:
%
% \bigskip
% \newbox\examplebox
% \sbox\examplebox{
% \begin{minipage}{.9\textwidth}
% \small
% \bigskip
% \begin{center}
% \so{1\<. Von den Maassen und Maassst\"aben}.
% \bigskip
% \end{center}
% \end{minipage}}
% \fbox{\usebox\examplebox}
% \bigbreak
%
% \noindent
% The \cs{\periodafter} macro adds a period to the title, but not to
% the entry in the table of contents. It takes the name of a command as
% argument, that shall be applied to the title, for example~\cs{\so}.
% Here's a more complicated and complete example:
%
% \begin{example}
% |\documentclass{article}|\\
% |\usepackage[latin1]{inputenc}|\\
% |\usepackage[T1]{fontenc}|\\
% |\usepackage{german,soul}|\\
% |\usepackage[indentfirst]{titlesec}|\\
% \end{example}
%
% \indent
% \begin{example}
% |\newcommand*\sectitle[1]{%|\\
% |    \MakeUppercase{\so{#1}.}\\[.66ex]|\\
% |    \rule{13mm}{.4pt}}|\\
% |\newcommand*\periodafter[2]{#1{#2.}}|\\
% \end{example}
%
% \indent
% \begin{example}
% |\titleformat{\section}[display]|\\
% |    {\normalfont\centering}|\\
% |    {\S. \thesection.}|\\
% |    {2ex}|\\
% |    {\sectitle}|\\
% \end{example}
%
% \indent
% \begin{example}
% |\titleformat{\subsection}[block]|\\
% |    {\normalfont\centering\bfseries}|\\
% |    {\thesection.}|\\
% |    {.66em}|\\
% |    {\periodafter\relax}|\\
% \end{example}
%
% \indent
% \begin{example}
% |\begin{document}|\\
% |\section{Von den Maassen und Maassst\"aben}|\\
% |\subsection{Das L\"angenmaass im Allgemeinen}|\\
% \\
% |Um L\"angen genau messen und vergleichen zu k\"onnen,|\\
% |bedarf es einer gewissen, bestimmten Einheit, mit der|\\
% |man untersucht, wie oft sie selbst, oder ihre Theile,|\\
% |in der zu bestimmenden L\"ange enthalten sind.|\\
% |...|\\
% |\end{document}|
% \end{example}
%
% \bigbreak
% This example gives you roughly the following output,
% which is a facsimile from~\cite{Muszynski}.
%
% \bigskip
% \sbox\examplebox{
% \begin{minipage}{.9\textwidth}
% \small
% \bigskip
% \begin{center}
% \S. 1.\\[2ex]
% \so{VON DEN MAASSEN UND MAASSST\"ABEN}.\\[.66ex]
% \rule{12mm}{.4pt}\\[1.66ex]
% \textbf{1. Das L\"angenmaass im Allgemeinen.}\\[.66em]
% \end{center}
% \leavevmode\qquad
% Um L\"angen genau messen und vergleichen zu k\"onnen,
% bedarf es einer gewissen, bestimmten Einheit, mit der
% man untersucht, wie oft sie selbst, oder ihre Theile,
% in der zu bestimmenden L\"ange enthalten sind.
% \bigskip
% \end{minipage}}
% \fbox{\usebox\examplebox}
% \bigbreak
%
% \noindent
% Note that the definition of \cs{\periodafter} decides if
% the closing period shall be spaced out with the title (1), or
% follow without space (2):
%
% \begin{example}
% 1.\qquad|\newcommand*\periodafter[2]{#1{#2.}}|\\
% 2.\qquad|\newcommand*\periodafter[2]{#1{#2}.}|\\
% \end{example}
%
%
%
% \noindent
% If you need to underline section titles, you can easily
% do it with the help of the \package{titlesec} package. The following
% example underlines the section title, but not the section
% number:
%
% \begin{example}
% |\titleformat{\section}|\\
% |    {\LARGE\titlefont}|\\
% |    {\thesection}|\\
% |    {.66em}|\\
% |    {\ul}|\\
% \end{example}
%
% \noindent
% The \cs{\titlefont} command is provided by the \caps{``\small{KOMA}}~script''
% package. You can write |\normalfont\sffamily\bfseries| instead.
% The following example does additionally underline the section number:
%
% \begin{example}
% |\titleformat{\section}|\\
% |    {\LARGE\titlefont}|\\
% |    {\ul{\thesection{\kern.66em}}}|\\
% |    {0pt}|\\
% |    {\ul}|\\
% \end{example}
%
%
%
%
%
%
%
%
%
%
%
% \section{How the package works}
%
% \subsection{The kernel}
% \so{Letterspacing,} \ul{underlining}, \st{striking out} and highlighting
% use the same kernel. It lets a \emph{word scanner} run over the given argument,
% which inspects every token. If a token is a command registered via \cs{\soulregister},
% it is executed immediately. Other tokens are only counted and trigger some action
% when a certain number is reached (quotes and dashes). Three subsequent `|-|', for example,
% trigger |\SOUL@everyexhyphen{---}|. A third group leads to special actions,
% like |\mbox| that starts reading-in a whole group to protect its contents and let them be
% seen as one entity. All other tokens, mostly characters and digits, are collected in
% a word register, which is passed to the analyzer, whenever a whole word was read in.
%
% The analyzer typesets the word in a 1\,sp ($=\frac1{65536}$\,pt) wide \cs{\vbox},
% hence encouraging \TeX\ to break lines at every possible hyphenation point. It
% uses the mono-spaced \cs{\SOUL@tt} font (|ectt1000|), so as to avoid any inter-character
% kerning. Now the \cs{\vbox} is decomposed splitting off \cs{\hbox} after \cs{\hbox}
% from the bottom. All boxes, each of which contains one syllable, are pushed onto a
% stack, which is provided by \TeX's grouping mechanism. When returning from the
% recursion, box after box is fetched from the stack, its width measured and fed to the
%``reconstructor''.
%
% This reconstruction macro (\cs{\SOUL@dosyllable}) starts to read tokens
% from the just analyzed word until the given syllable
% width is obtained. This is repeated for each syllable. Every time the engine
% reaches a relevant state, the corresponding driver macro is executed
% and, if necessary, provided with some data. There is a macro that is
% executed for each token, one for each syllable, one for each space etc\null.
%
% The engine itself doesn't know how to letterspace or to underline. It
% just tells the selected driver about the structure of the given argument.
% There's a default driver (\cs{\SOUL@setup}) that does only set the
% interface macros to a reasonable default state, but doesn't really do anything.
% Further drivers can safely inherit these settings and only need to
% redefine what they want to change.
%
%
%
%
%
% \subsection{The interface}
% \label{sec:interface}
%
% \subsubsection{The registers}
%
% The package offers eight interface macros that can be used to define
% the required actions. Some of the macros receive data as macro parameter
% or in special \emph{token} or \emph{dimen} registers. Here is a list of
% all available registers:
%
% \begin{labeling}{\hspace{.36\hsize}}
% \item[\texttt{\string\SOUL@token}]
%   This token register contains the current token. It has to be used as |\the\SOUL@token|.
%   The macro \cs{\SOUL@gettoken} reads the next token into \cs{\SOUL@token} and
%   can be used in any interface macro. If you don't want to lose the old meaning,
%   you have to save it explicitly. \cs{\SOUL@puttoken} pushes the token
%   back into the queue, without changing \cs{\SOUL@token}. You can only
%   put one token back, otherwise you get an error message.
% \item[\texttt{\string\SOUL@lasttoken}]
%   This token register contains the last token.
% \item[\texttt{\string\SOUL@syllable}]
%   This token register contains all tokens that were already collected for
%   the current syllable. When used in \cs{\SOUL@everysyllable}, it
%   contains the \emph{whole} syllable.
% \item[\texttt{\string\SOUL@charkern}]
%   This dimen register contains the kerning value between the current and the next character.
%   Since most character pairs don't require a kerning value to be applied and the
%   output in the logfile shouldn't be cluttered with |\kern0pt| it is
%   recommended to write |\SOUL@setkern\SOUL@charkern|, which sets
%   kerning for non-zero values only.
% \item[\texttt{\string\SOUL@hyphkern}]
%   This dimen register contains the kerning value between the current character
%   and the hyphen character or, when used in \cs{\SOUL@everyexhyphen}, the
%   kerning between the last character and the explicit hyphen.
% \end{labeling}
%
%
%
%
%
%
% \subsubsection{The interface macros}
%
% The following list describes each of the interface macros and which
% registers it can rely on. The mark between label and description
% will be used in section \ref{sec:interfaceexamples} to show when
% the macros are executed. The addition |#1| means that the macro
% takes one argument.
%
% \begin{labeling}{\hspace{.36\hsize}}
% \def\m#1{\leavevmode\llap{\hbox to1em{\hss#1\hss}\hskip.7em}}
% \item[\texttt{\string\SOUL@preamble}]\m{$P$}^^A
%   executed once at the beginning
% \item[\texttt{\string\SOUL@postamble}]\m{$E$}^^A
%   executed once at the end
% \item[\texttt{\string\SOUL@everytoken}]\m{$T$}^^A
%   executed after scanning a token; It gets that
%   token in \cs{\SOUL@token} and has to care for inserting
%   the kerning value \cs{\SOUL@charkern} between this and the next character.
%   To look at the next character, execute \cs{\SOUL@gettoken}, which
%   replaces \cs{\SOUL@token} by the next token. This token has to
%   be put back into the queue using \cs{\SOUL@puttoken}.
% \item[\texttt{\string\SOUL@everysyllable}]\m{$S$}^^A
%   This macro is executed after scanning a whole syllable. It gets the
%   syllable in \cs{\SOUL@syllable}.
% \item[\texttt{\string\SOUL@everyhyphen}]\m{$-$}^^A
%   This macro is executed at every implicit hyphenation point.
%   It is responsible for setting the hyphen and will likely do this
%   in a \cs{\discretionary} statement. It has to care about the
%   kerning values. The registers \cs{\SOUL@lasttoken}, \cs{\SOUL@syllable},
%   \cs{\SOUL@charkern} and \cs{\SOUL@hyphkern} contain useful information.
%   Note that \cs{\discretionary} inserts \cs{\exhyphenpenalty}
%   if the first part of the discretionary is empty, and
%   \cs{\hyphenpenalty} else.
% \item[\texttt{\string\SOUL@everyexhyphen\#1}]\m{$=$}^^A
%   This macro is executed at every explicit hyphenation point. The
%   hyphen `character' (one of hyphen, en-dash, em-dash or \cs{\slash})
%   is passed as parameter |#1|. A minimal implementation
%   would be |{#1\penalty\exhyphenpenalty}|. The kerning value
%   between the last character and the hyphen is passed in \cs{\SOUL@hyphkern},
%   that between the hyphen and the next character in \cs{\SOUL@charkern}.
%   The last syllable can be found in \cs{\SOUL@syllable}, the last
%   character in \cs{\SOUL@lasttoken}.
% \item[\texttt{\string\SOUL@everyspace\#1}]\m{\texttt{\char`\ }}^^A
%   This macro is executed between every two words. It is responsible for
%   setting the space. The engine submits a \cs{\penalty} setting as
%   parameter |#1| that should be put in front of the space. The
%   macro should at least do |{#1\space}|. Further information can be found in
%   \cs{\SOUL@lasttoken} and \cs{\SOUL@syllable}. Note that this macro does not
%   care for the leading and trailing space. This is the job of
%   \cs{\SOUL@preamble} and \cs{\SOUL@postamble}.
% \end{labeling}
%
%
%
%
%
%
% \subsubsection{Some examples}
% \label{sec:interfaceexamples}
%
% The above list's middle column shows a mark that indicates in the
% following examples, when the respective macros are executed:\nopagebreak
%
% \begin{labeling}{\hspace{.36\hsize}}
% \item[\normalfont\an{word}]
%   \cs{\SOUL@everytoken}$^T$ is executed for every token. \cs{\SOUL@everysyllable}$^S$
%   is \emph{additionally} executed for every syllable. You will mostly just
%   want to use either of them.
% \item[\normalfont\an{one two}]
%   The macro |\SOUL@everyspace| is executed at every space within
%   the \soul\ argument. It has to take one argument, that can either
%   be empty or contain a penalty, that should be applied to the space.
% \item[\normalfont\an{example}\kern-1em]
%   The macro |\SOUL@everyhyphen| is executed at every possible
%   implicit hyphenation point.
% \item[\normalfont\an{beta-test}]
%   Explicit hyphens trigger \cs{\SOUL@everyexhyphen}.
% \end{labeling}
%
%
%
% \bigbreak
% \noindent
% It's only natural that these examples, too,
% were automatically typeset by the |soul| package
% using a special driver:
%
% \begin{example}
% |\DeclareRobustCommand*\an{%|\\
% |    \def\SOUL@preamble{$^{^P}$}%|\\
% |    \def\SOUL@everyspace##1{##1\texttt{\char`\ }}%|\\
% |    \def\SOUL@postamble{$^{^E}$}%|\\
% |    \def\SOUL@everyhyphen{$^{^-}$}%|\\
% |    \def\SOUL@everyexhyphen##1{##1$^{^=}$}%|\\
% |    \def\SOUL@everysyllable{$^{^S}$}%|\\
% |    \def\SOUL@everytoken{\the\SOUL@token$^{^T}$}%|\\
% |    \def\SOUL@everylowerthan{$^{^L}$}%|\\
% |    \SOUL@}|\\
% \end{example}
%
%
%
%
%
%
%
%
% \subsection{A driver example}
%
% Let's define a \soul\ driver that allows to typeset text
% with a \cs{\cdot} at every potential hyphenation point. The name of
% the macro shall be \cs{\sy} (for \emph{syllables}).
% Since the \soul\ mechanism is highly fragile, we use the \LaTeX\
% command \cs{\DeclareRobustCommand}, so that the \cs{\sy} macro
% can be used even in section headings etc. The \cs{\SOUL@setup}
% macro sets all interface macros to reasonable default definitions.
% This could of course be done manually, too. As we won't
% make use of \cs{\SOUL@everytoken} and \cs{\SOUL@postamble}
% and both default to \cs{\relax}, anyway, we don't have to
% define them here.
%
% \begin{example}
% |\DeclareRobustCommand*\sy{%|\\
% |    \SOUL@setup|\\
% \end{example}
%
% We only set \cs{\lefthyphenmin} and \cs{\righthyphenmin} to zero
% at the beginning. All changes are restored automatically,
% so there's nothing to do at the end.
%
% \begin{example}
% |    \def\SOUL@preamble{\lefthyphenmin=0 \righthyphenmin=0 }%|\\
% \end{example}
%
% We only want simple spaces. Note that these are not provided
% by default! \cs{\SOUL@everyspace} may get a penalty to be
% applied to that space, so we set it before.
%
% \begin{example}
% |    \def\SOUL@everyspace##1{##1\space}%|\\
% \end{example}
%
% There's nothing to do for \cs{\SOUL@everytoken}, we rather let
% \cs{\SOUL@everysyllable} handle a whole syllable at once.
% This has the advantage, that we don't have to deal with
% kerning values, because \TeX\ takes care of that.
%
% \begin{example}
% |    \def\SOUL@everysyllable{\the\SOUL@syllable}|\\
% \end{example}
%
% The \TeX\ primitive \cs{\discretionary}
% takes three arguments: 1.~pre-hyphen material
% 2.~post-hyphen material, and 3.~no-hyphenation material.
%
% \begin{example}
% |    \def\SOUL@everyhyphen{%|\\
% |        \discretionary{%|\\
% |            \SOUL@setkern\SOUL@hyphkern|\\
% |            \SOUL@sethyphenchar|\\
% |        }{}{%|\\
% |            \hbox{\kern1pt$\cdot$}%|\\
% |        }%|\\
% |    }%|\\
%\end{example}
%
% Explicit hyphens like dashes and slashes shall be set normally.
% We just have to care for kerning. The hyphen has to be put in
% a box, because, as \cs{\hyphenchar}, it would yield its own, internal
% \cs{\discretionary}. We need to set ours instead, though.
%
% \begin{example}
% |    \def\SOUL@everyexhyphen##1{%|\\
% |        \SOUL@setkern\SOUL@hyphkern|\\
% |        \hbox{##1}%|\\
% |        \discretionary{}{}{%|\\
% |            \SOUL@setkern\SOUL@charkern|\\
% |        }%|\\
% |    }|%\\
% \end{example}
%
% Now that the interface macros are defined, we can start the scanner.
%
% \begin{example}
% |    \SOUL@|\\
% |}|\\
% \end{example}
%
% \hyphenation{al-go-rithm lin-guists ex-cel-lent} ^^A correct?
% \noindent
% \emph{\sy{This little macro will hardly be good enough
% for linguists, although it uses {\TeX's} excellent hyphenation algorithm,
% but it is at least a nice alternative to the}} \cs{\showhyphens} \emph{\sy{command}.}
%
%
%
%
%
%
%
% \section*{Acknowledgements}
%
% A big thank you goes to \person{Stefan Ulrich} for his tips and bug reports
% during the development of versions 1.\lower2pt\hbox{*} and for his lessons on high quality
% typesetting. The \cs{\caps} mechanism was very much influenced by his
% suggestions. Thanks to \person{Alexander Shibakov} and \person{Frank Mittelbach,}
% who sent me a couple of bug reports and feature requests, and finally encouraged
% me to (almost) completely rewrite \soul. \person{Thorsten Manegold} contributed
% a series of bug reports, helping to fix \soul's macro expander and hence making
% it work together with the \package{jurabib} package.
% Thanks to \person{Axel Reichert, Anshuman Pandey,} and \person{Peter Kreynin} for
% detailed bug reports.
% \person{Rowland McDonnel} gave useful hints for how to improve the documentation,
% but I'm afraid he will still not be satisfied, and rightfully so. If only documentation
% writing weren't that boring.~~\texttt{;-)}
%
%
%
%
%
%
%
% \begin{thebibliography}{00}
% \raggedright
%
% \bibitem{jurabib}{\person{Berger, Jens:} \bibtitle{The jurabib package.} \CTAN-Archive, 2002, v0.52h.}
%
% \bibitem{titlesec}{\person{Bezos, Javier:} \bibtitle{The titlesec and titletoc package.}
%   \CTAN-Archive, 1999, v2.1.}
%
% \bibitem{color}{\person{Carlisle, D. P.:} \bibtitle{The color package.} \CTAN-Archive, 1997, v1.0d.}
%
% \bibitem{Duden}{Duden, Volume 1. \bibtitle{Die Rechtschreibung.} Bibliographisches Institut,
%   Mann\-heim--\hskip0pt Wien--Z\"urich, 1986, 19th~edition.}
%
% \bibitem{DEK}{\person{Knuth, Donald E.:} \bibtitle{The \TeX book.}
%   Addison--Wesley Publishing Company, Reading/Massachusetts, 1989, 16th~edition.}
%
% \bibitem{Muszynski}{\person{Muszynski, Carl} and \person{P\v rihoda, Eduard:}
%   \bibtitle{Die Terrainlehre in Verbindung mit der Darstellung, Beurtheilung und
%   Beschreibung des Terrains vom milit\"arischen
%   Standpunkte.}
%   L.\,W.~Seidel \&\ Sohn, Wien, 1872.}
%
% \bibitem{Reglement}{Normalverordnungsblatt f\"ur das k.\,u.\,k.~Heer.
%   \bibtitle{Exercier-Reglement f\"ur die k.\,u.\,k.~Cavallerie, I. Theil.}
%   Wien, k.\,k.~Hof- und Staatsdruckerei, 1898, 4th~edition.}
%
% \bibitem{german}{\person{Raichle, Bernd:} \bibtitle{The german package.} \CTAN-Archive, 1998, v2.5e.}
%
% \bibitem{yfonts}{\person{Schmidt, Walter:} \bibtitle{Ein Makropaket f\"ur die gebrochenen
%   Schriften.} \CTAN-Archive, 1998, v1.2.}
%
% \bibitem{Tschichold}{\person{Tschichold, Jan:} \bibtitle{Ausgew\"ahlte Aufs\"atze \"uber Fragen
%   der Gestalt des Buches und der Typographie.} Birkh\"auser, Basel,
%   1987, 2nd~edition.}
%
% \bibitem{Willberg}{\person{Willberg, Hans Peter} and \person{Forssmann, Friedrich:}
%   \bibtitle{Lesetypographie.} H. Schmidt, Mainz, 1997.}
%
% \end{thebibliography}
%
%
% \StopEventually{\addtocontents{toc}{\protect\end{multicols}}}
%
%
%
%
%
%
%
%
%^^A max 72 columns
%^^A--------------------------------------------------------------------
%
%
%
%
% \section{The implementation}
%
% \subsection*{The package preamble}
%
% This piece of code makes sure that the package is only loaded
% once. While this is guaranteed by \LaTeX, we have to do it
% manually for all other flavors of \TeX.
%
%    \begin{macrocode}
\expandafter\ifx\csname SOUL@\endcsname\relax\else
    \expandafter\endinput
\fi
%    \end{macrocode}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \noindent
% Fake some of the \LaTeX\ commands if we were loaded by another flavor
% of \TeX. This might break some previously loaded packages, though,
% if e.\,g.~\cs{\mbox} was already in use. But we don't care \dots
%
%    \begin{macrocode}
\ifx\documentclass\SOULundefined
    \chardef\atcode=\catcode`@
    \catcode`\@=11
    \def\DeclareRobustCommand*{\def}
    \let\newcommand\DeclareRobustCommand
    \def\DeclareOption#1#2{\expandafter\def\csname#1\endcsname{#2}}
    \def\PackageError#1#2#3{{%
        \newlinechar`^^J%
        \errorcontextlines\z@
        \edef\\{\errhelp{#3}}\\%
        \errmessage{Package #1 error: #2}%
    }}
    \def\@height{height}
    \def\@depth{depth}
    \def\@width{width}
    \def\@plus{plus}
    \def\@minus{minus}
    \font\SOUL@tt=ectt1000
    \let\@xobeysp\space
    \let\linebreak\break
    \let\mbox\hbox
%    \end{macrocode}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \noindent
% \soul\ tries to be a good \LaTeX\ citizen if used under \LaTeX\ and
% declares itself properly. Most command sequences in the package
% are protected by the |SOUL@| namespace, all other macros are first
% defined to be empty. This will give us an error message \emph{now}
% if one of those was already used by another package.
%
%    \begin{macrocode}
\else
    \NeedsTeXFormat{LaTeX2e}
    \ProvidesPackage{soul}
        [2003/11/17 v2.4 letterspacing/underlining  (mf)]
    \newfont\SOUL@tt{ectt1000}
    \newcommand*\sodef{}
    \newcommand*\resetso{}
    \newcommand*\capsdef{}
    \newcommand*\capsfont{}
    \newcommand*\setulcolor{}
    \newcommand*\setuloverlap{}
    \newcommand*\setul{}
    \newcommand*\resetul{}
    \newcommand*\setuldepth{}
    \newcommand*\setstcolor{}
    \newcommand*\sethlcolor{}
    \newcommand*\so{}
    \newcommand*\ul{}
    \newcommand*\st{}
    \newcommand*\hl{}
    \newcommand*\caps{}
    \newcommand*\soulaccent{}
    \newcommand*\soulregister{}
    \newcommand*\soulfont{}
    \newcommand*\soulomit{}
\fi
%    \end{macrocode}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \noindent
% Other packages wouldn't be happy if we reserved piles of \cs{\newtoks} and
% \cs{\newdimen}, so we try to get away with their \cs{\...def} counterparts
% where possible.
% Local registers are always even, while global ones are odd---this is a
% \TeX\ convention.
%
%    \begin{macrocode}
\newtoks\SOUL@word
\newtoks\SOUL@lasttoken
\toksdef\SOUL@syllable\z@
\newtoks\SOUL@cmds
\newtoks\SOUL@buffer
\newtoks\SOUL@token
\dimendef\SOUL@syllgoal\z@
\dimendef\SOUL@syllwidth\tw@
\dimendef\SOUL@charkern=4
\dimendef\SOUL@hyphkern=6
\countdef\SOUL@minus\z@
\countdef\SOUL@comma\tw@
\countdef\SOUL@apo=4
\countdef\SOUL@grave=6
\newskip\SOUL@spaceskip
\newif\ifSOUL@ignorespaces
%    \end{macrocode}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% ^^A\FIXME{\newpage}
% \begin{macro}{\soulomit}
% \begin{macro}{\SOUL@ignorem}
% \begin{macro}{\SOUL@ignore}
% \begin{macro}{\SOUL@stopm}
% \begin{macro}{\SOUL@stop}
% \begin{macro}{\SOUL@relaxm}
% \begin{macro}{\SOUL@lowerthanm}
% \begin{macro}{\SOUL@hyphenhintm}
% These macros are used as markers. To be able to check for such a
% marker with \cs{\ifx} we have also to create a macro that contains
% the marker. \cs{\SOUL@spc} shall contain a normal space with a
% \cs{\catcode} of~10.
%
%    \begin{macrocode}
\def\soulomit#1{#1}
\def\SOUL@stopM{\SOUL@stop}
\let\SOUL@stop\relax
\def\SOUL@lowerthan{}
\def\SOUL@lowerthanM{\<}
\def\SOUL@hyphenhintM{\-}
\def\SOUL@n*{\let\SOUL@spc= }\SOUL@n* %
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The kernel}
%
% \begin{macro}{\SOUL@}
% This macro is the entry to \soul. Using it does only make
% sense after setting up a \soul\ driver. The next token after
% the \soul\ command will be assigned to \cs{\SOUL@@}. This can be
% some text enclosed in braces, or the name of a macro that contains text.
%
%    \begin{macrocode}
\def\SOUL@{%
    \futurelet\SOUL@@\SOUL@expand
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@expand}
% If the first token after the \soul\ command was an opening
% brace we start scanning. Otherwise,
% if the first token was a macro name, we expand that macro and
% call \cs{\SOUL@} with its contents again. Unfortunately, we have to
% exclude some macros therein from expansion.
%
%    \begin{macrocode}
\def\SOUL@expand{%
    \ifcat\bgroup\noexpand\SOUL@@
        \let\SOUL@n\SOUL@start
    \else
        \bgroup
            \def\\##1##2{\def##2{\noexpand##2}}%
            \the\SOUL@cmds
            \SOUL@buffer={%
                \\\TeX\\\LaTeX\\\soulomit\\\mbox\\\hbox\\\textregistered
                \\\slash\\\textcircled\\\copyright\\\S\\\,\\\<\\\>\\~%
                \\\\%
            }%
            \def\\##1{\def##1{\noexpand##1}}%
            \the\SOUL@buffer
            \let\protect\noexpand
            \xdef\SOUL@n##1{\noexpand\SOUL@start{\SOUL@@}}%
        \egroup
    \fi
    \SOUL@n
}
\long\def\SOUL@start#1{{%
    \let\<\SOUL@lowerthan
    \let\>\empty
    \def\soulomit{\noexpand\soulomit}%
    \gdef\SOUL@eventuallyexhyphen##1{}%
    \let\SOUL@soeventuallyskip\relax
    \SOUL@spaceskip=\fontdimen\tw@\font\@plus\fontdimen\thr@@\font
        \@minus\fontdimen4\font
    \SOUL@ignorespacesfalse
    \leavevmode
    \SOUL@preamble
    \SOUL@lasttoken={}%
    \SOUL@word={}%
    \SOUL@minus\z@
    \SOUL@comma\z@
    \SOUL@apo\z@
    \SOUL@grave\z@
    \SOUL@do{#1}%
    \SOUL@postamble
}}
\long\def\SOUL@do#1{%
    \SOUL@scan#1\SOUL@stop
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The scanner}
%
% \begin{macro}{\SOUL@scan}
% This is the entry point for the scanner. It calls \cs{\SOUL@eval}
% and will in turn be called by \cs{\SOUL@eval} again for every
% new token to be scanned.
%
%    \begin{macrocode}
\def\SOUL@scan{%
    \futurelet\SOUL@@\SOUL@eval
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@eval}
% And here it is: the scanner's heart. It cares for quotes and dashes
% ligatures and handles all commands that must not be fed to the
% analyzer.
%
%    \begin{macrocode}
\def\SOUL@eval{%
    \def\SOUL@n*##1{\SOUL@scan}%
    \if\noexpand\SOUL@@\SOUL@spc
    \else
        \SOUL@ignorespacesfalse
    \fi
    \ifnum\SOUL@minus=\thr@@
        \SOUL@flushminus
    \else\ifnum\SOUL@comma=\tw@
        \SOUL@flushcomma
    \else\ifnum\SOUL@apo=\tw@
        \SOUL@flushapo
    \else\ifnum\SOUL@grave=\tw@
        \SOUL@flushgrave
    \fi\fi\fi\fi
    \ifx\SOUL@@-\else\SOUL@flushminus\fi
    \ifx\SOUL@@,\else\SOUL@flushcomma\fi
    \ifx\SOUL@@'\else\SOUL@flushapo\fi
    \ifx\SOUL@@`\else\SOUL@flushgrave\fi
    \ifx\SOUL@@-%
        \advance\SOUL@minus\@ne
    \else\ifx\SOUL@@,%
        \advance\SOUL@comma\@ne
    \else\ifx\SOUL@@'%
        \advance\SOUL@apo\@ne
    \else\ifx\SOUL@@`%
        \advance\SOUL@grave\@ne
    \else
        \SOUL@flushminus
        \SOUL@flushcomma
        \SOUL@flushapo
        \SOUL@flushgrave
        \ifx\SOUL@@\SOUL@stop
            \def\SOUL@n*{%
                \SOUL@doword
                \SOUL@eventuallyexhyphen\null
            }%
        \else\ifx\SOUL@@\par
            \def\SOUL@n*\par{\par\leavevmode\SOUL@scan}%
        \else\if\noexpand\SOUL@@\SOUL@spc
            \SOUL@doword
            \SOUL@eventuallyexhyphen\null
            \ifSOUL@ignorespaces
            \else
                \SOUL@everyspace{}%
            \fi
            \def\SOUL@n* {\SOUL@scan}%
        \else\ifx\SOUL@@\\%
            \SOUL@doword
            \SOUL@eventuallyexhyphen\null
            \SOUL@everyspace{\unskip\nobreak\hfil\break}%
            \SOUL@ignorespacestrue
        \else\ifx\SOUL@@~%
            \SOUL@doword
            \SOUL@eventuallyexhyphen\null
            \SOUL@everyspace{\nobreak}%
        \else\ifx\SOUL@@\slash
            \SOUL@doword
            \SOUL@eventuallyexhyphen{/}%
            \SOUL@exhyphen{/}%
        \else\ifx\SOUL@@\mbox
            \def\SOUL@n*{\SOUL@addprotect}%
        \else\ifx\SOUL@@\hbox
            \def\SOUL@n*{\SOUL@addprotect}%
        \else\ifx\SOUL@@\soulomit
            \def\SOUL@n*\soulomit##1{%
                \SOUL@doword
                {\spaceskip\SOUL@spaceskip##1}%
                \SOUL@scan
            }%
        \else\ifx\SOUL@@\break
            \SOUL@doword
            \break
        \else\ifx\SOUL@@\linebreak
            \SOUL@doword
            \SOUL@everyspace{\linebreak}%
        \else\ifcat\bgroup\noexpand\SOUL@@
            \def\SOUL@n*{\SOUL@addgroup{}}%
        \else\ifcat$\noexpand\SOUL@@
            \def\SOUL@n*{\SOUL@addmath}%
        \else
            \def\SOUL@n*{\SOUL@dotoken}%
        \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
    \fi\fi\fi\fi
    \SOUL@n*%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@flushminus}
% \begin{macro}{\SOUL@flushcomma}
% \begin{macro}{\SOUL@flushapo}
% \begin{macro}{\SOUL@flushgrave}
% As their names imply, these macros flush special tokens or token
% groups to the word register. They don't do anything if the respective
% counter equals zero. \cs{\SOUL@minus} does also flush the word
% register, because hyphens disturb the analyzer.
%
%    \begin{macrocode}
\def\SOUL@flushminus{%
    \ifcase\SOUL@minus
    \else
        \SOUL@doword
        \SOUL@eventuallyexhyphen{-}%
        \ifcase\SOUL@minus
        \or
            \SOUL@exhyphen{-}%
        \or
            \SOUL@exhyphen{--}%
        \or
            \SOUL@exhyphen{---}%
        \fi
        \SOUL@minus\z@
    \fi
}
\def\SOUL@flushcomma{%
    \ifcase\SOUL@comma
    \or
        \edef\x{\SOUL@word={\the\SOUL@word,}}\x
    \or
        \edef\x{\SOUL@word={\the\SOUL@word{{,,}}}}\x
    \fi
    \SOUL@comma\z@
}
\def\SOUL@flushapo{%
    \ifcase\SOUL@apo
    \or
        \edef\x{\SOUL@word={\the\SOUL@word'}}\x
    \or
        \edef\x{\SOUL@word={\the\SOUL@word{{''}}}}\x
    \fi
    \SOUL@apo\z@
}
\def\SOUL@flushgrave{%
    \ifcase\SOUL@grave
    \or
        \edef\x{\SOUL@word={\the\SOUL@word`}}\x
    \or
        \edef\x{\SOUL@word={\the\SOUL@word{{``}}}}\x
    \fi
    \SOUL@grave\z@
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@dotoken}
% Command sequences from the \cs{\SOUL@cmds} list are handed over
% to \cs{\SOUL@docmd}, everything else is added to \cs{\SOUL@word},
% which will be fed to the analyzer every time a word is completed.
% Since \emph{robust} commands come with an additional space, we
% have also to examine if there's a space variant. Otherwise we
% couldn't detect pre-expanded formerly robust commands.
%
%    \begin{macrocode}
\def\SOUL@dotoken#1{%
    \def\SOUL@@{\SOUL@addtoken{#1}}%
    \def\\##1##2{%
        \edef\SOUL@x{\string#1}%
        \edef\SOUL@n{\string##2}%
        \ifx\SOUL@x\SOUL@n
            \def\SOUL@@{\SOUL@docmd{##1}{#1}}%
        \else
            \edef\SOUL@n{\string##2\space}%
            \ifx\SOUL@x\SOUL@n
                \def\SOUL@@{\SOUL@docmd{##1}{#1}}%
            \fi
        \fi
    }%
    \the\SOUL@cmds
    \SOUL@@
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@docmd}
% Here we deal with commands that were registered with \cs{\soulregister}
% or \cs{\soulaccent} or were already predefined in \cs{\SOUL@cmds}.
% Commands with identifier |9| are accents that are put in a
% group with their argument. Identifier |8| is reserved for the \cs{\footnote}
% command, and |7| for the \cs{\textsuperscript} or similar commands.
% The others are mostly (but not necessarily)
% font switching commands, which may (|1|) or may not (|0|) take
% an argument. A registered command leads to the current word
% buffer being flushed to the analyzer, after which the command
% itself is executed.
%
% Font switching commands which take an argument need special
% treatment: They need to increment the level counter, so that
% \cs{\SOUL@eval} knows where to stop scanning. Furthermore the
% scanner has to be enabled to see the next token after the opening
% brace.
%
%
%    \begin{macrocode}
\def\SOUL@docmd#1#2{%
    \ifx9#1%
        \def\SOUL@@{\SOUL@addgroup{#2}}%
    \else\ifx8#1%
        \SOUL@doword
        \def\SOUL@@##1{%
            \SOUL@token={\footnotemark}%
            \SOUL@everytoken
            \SOUL@syllable={\footnotemark}%
            \SOUL@everysyllable
            \footnotetext{##1}%
            \SOUL@doword
            \SOUL@scan
        }%
    \else\ifx7#1%
        \SOUL@doword
        \def\SOUL@@##1{%
            \SOUL@token={#2{##1}}%
            \SOUL@everytoken
            \SOUL@syllable={#2{##1}}%
            \SOUL@everysyllable
            \SOUL@doword
            \SOUL@scan
        }%
    \else\ifx1#1%
        \SOUL@doword
        \def\SOUL@@##1{%
            #2{\protect\SOUL@do{##1}}%
            \SOUL@scan
        }%
    \else
        \SOUL@doword
        #2%
        \let\SOUL@@\SOUL@scan
    \fi\fi\fi\fi
    \SOUL@@
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@addgroup}
% \begin{macro}{\SOUL@addmath}
% \begin{macro}{\SOUL@addprotect}
% \begin{macro}{\SOUL@addtoken}
% The macro names say it all. Each of these macros adds some
% token to the word buffer \cs{\SOUL@word}. Setting \cs{\protect}
% is necessary to make things like |\so{{a\itshape b}}| work.
%
%    \begin{macrocode}
\def\SOUL@addgroup#1#2{%
    {\let\protect\noexpand
    \edef\x{\global\SOUL@word={\the\SOUL@word{{\noexpand#1#2}}}}\x}%
    \SOUL@scan
}
\def\SOUL@addmath$#1${%
    {\let\protect\noexpand
    \edef\x{\global\SOUL@word={\the\SOUL@word{{\hbox{$#1$}}}}}\x}%
    \SOUL@scan
}
\def\SOUL@addprotect#1#2{%
    {\let\protect\noexpand
    \edef\x{\global\SOUL@word={\the\SOUL@word{{\hbox{#2}}}}}\x}%
    \SOUL@scan
}
\def\SOUL@addtoken#1{%
    \edef\x{\SOUL@word={\the\SOUL@word\noexpand#1}}\x
    \SOUL@scan
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@exhyphen}
% Dealing with explicit hyphens can't be done before we know the
% following character, because we need to know if a kerning value
% has to be inserted, hence we delay the \cs{\SOUL@everyexhyphen} call.
% Unfortunately, the word scanner has no look-ahead mechanism.
%
%    \begin{macrocode}
\def\SOUL@exhyphen#1{%
    \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@hyphkern}{#1}%
    \gdef\SOUL@eventuallyexhyphen##1{%
        \SOUL@getkern{#1}{\SOUL@charkern}{##1}%
        \SOUL@everyexhyphen{#1}%
        \gdef\SOUL@eventuallyexhyphen####1{}%
    }%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@cmds}
% Here is a list of pre-registered commands that the analyzer
% cannot handle, so the scanner has to look after them. Every
% entry consists of a handle (\cs{\\}), an identifier and the
% macro name. The class identifier can be |9| for accents,
% |8| for the \cs{\footnote} command, |7| for the
% \cs{\textsuperscript} command,
% |0| for commands without arguments and |1| for commands that
% take one argument. Commands with two or more arguments are
% not supported.
%
%    \begin{macrocode}
\SOUL@cmds={%
    \\9\`\\9\'\\9\^\\9\"\\9\~\\9\=\\9\.%
    \\9\u\\9\v\\9\H\\9\t\\9\c\\9\d\\9\b\\9\r
    \\1\emph\\1\textrm\\1\textsf\\1\texttt\\1\textmd\\1\textbf
    \\1\textup\\1\textsl\\1\textit\\1\textsc\\1\textnormal
    \\0\rmfamily\\0\sffamily\\0\ttfamily\\0\mdseries\\0\upshape
    \\0\slshape\\0\itshape\\0\scshape\\0\normalfont
    \\0\em\\0\rm\\0\bf\\0\it\\0\tt\\0\sc\\0\sl\\0\sf
    \\0\tiny\\0\scriptsize\\0\footnotesize\\0\small
    \\0\normalsize\\0\large\\0\Large\\0\LARGE\\0\huge\\0\Huge
    \\1\MakeUppercase\\7\textsuperscript\\8\footnote
    \\1\textfrak\\1\textswab\\1\textgoth
    \\0\frakfamily\\0\swabfamily\\0\gothfamily
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\soulregister}
% \begin{macro}{\soulfont}
% \begin{macro}{\soulaccent}
% Register a font switching command (or some other command) for the
% scanner. The first argument is the macro name, the second is
% the number of arguments (|0|~or~|1|). Example: |\soulregister{\bold}{0}|.
% \cs{\soulaccent} has only one argument---the accent macro name.
% Example: |\soulaccent{\~}|. It is a shortcut for |\soulregister{\~}{9}|.
% The \cs{\soulfont} command is a synonym for \cs{\soulregister}
% and is kept for compatibility reasons.
%
%    \begin{macrocode}
\def\soulregister#1#2{{%
    \edef\x{\global\SOUL@cmds={\the\SOUL@cmds
        \noexpand\\#2\noexpand#1}}\x
}}
\def\soulaccent#1{\soulregister{#1}9}
\let\soulfont\soulregister
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The analyzer}
%
% \begin{macro}{\SOUL@doword}
% The only way to find out, where a given word can be broken into
% syllables, is to let \TeX\ actually typeset the word under conditions
% that enforce every possible hyphenation. The result is a paragraph with one
% line for every syllable.
%
%    \begin{macrocode}
\def\SOUL@doword{%
    \edef\x{\the\SOUL@word}%
    \ifx\x\empty
    \else
        \SOUL@buffer={}%
        \setbox\z@\vbox{%
            \SOUL@tt
            \hyphenchar\font`\-
            \hfuzz\maxdimen
            \hbadness\@M
            \pretolerance\m@ne
            \tolerance\@M
            \leftskip\z@
            \rightskip\z@
            \hsize1sp
            \everypar{}%
            \parfillskip\z@\@plus1fil
            \hyphenpenalty-\@M
            \noindent
            \hskip\z@
            \relax
            \the\SOUL@word}%
        \let\SOUL@errmsg\SOUL@error
        \let\-\relax
        \count@\m@ne
        \SOUL@analyze
        \SOUL@word={}%
    \fi
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \noindent
% We store the hyphen width of the |ectt1000| font,
% because we will need it in |\SOUL@doword|. (|ectt1000| is a mono-spaced
% font, so every other character would have worked, too.)
%
%    \begin{macrocode}
\setbox\z@\hbox{\SOUL@tt-}
\newdimen\SOUL@ttwidth
\SOUL@ttwidth\wd\z@
\def\SOUL@sethyphenchar{%
    \ifnum\hyphenchar\font=\m@ne
    \else
        \char\hyphenchar\font
    \fi
}
%    \end{macrocode}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@analyze}
% This macro decomposes the box that |\SOUL@doword| has built.
% Because we have to start at the bottom, we put every
% syllable onto the stack and execute ourselves recursively. If there
% are no syllables left, we return from the recursion and pick syllable
% after syllable from the stack again---this time from top to bottom---and
% hand the syllable width |\SOUL@syllgoal| over to |\SOUL@dosyllable|.
% All but the last syllable end with the hyphen character, hence
% we subtract the hyphen width accordingly. After processing a
% syllable we calculate the hyphen kern (i.\,e.~the kerning amount
% between the last character and the hyphen). This might be needed
% by \cs{\SOUL@everyhyphen}, which we call now.
%
%    \begin{macrocode}
\def\SOUL@analyze{{%
    \setbox\z@\vbox{%
        \unvcopy\z@
        \unskip
        \unpenalty
        \global\setbox\@ne=\lastbox}%
    \ifvoid\@ne
    \else
        \setbox\@ne\hbox{\unhbox\@ne}%
        \SOUL@syllgoal=\wd\@ne
        \advance\count@\@ne
        \SOUL@analyze
        \SOUL@syllwidth\z@
        \SOUL@syllable={}%
        \ifnum\count@>\z@
            \advance\SOUL@syllgoal-\SOUL@ttwidth
            \SOUL@dosyllable
            \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@hyphkern}%
                {\SOUL@sethyphenchar}%
            \SOUL@everyhyphen
        \else
            \SOUL@dosyllable
        \fi
    \fi
}}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@dosyllable}
% This macro typesets token after token from \cs{\SOUL@word}
% until \cs{\SOUL@syllwidth} has reached
% the requested width \cs{\SOUL@syllgoal}. Furthermore the kerning
% values are prepared in case \cs{\SOUL@everytoken} needs them.
% The \cs{\<} command used by \cs{\so} and \cs{\caps} needs some
% special treatment: It has to be checked for, even before
% we can end a syllable.
%
%    \begin{macrocode}
\def\SOUL@dosyllable{%
    \SOUL@gettoken
    \SOUL@eventuallyexhyphen{\the\SOUL@token}%
    \edef\x{\the\SOUL@token}%
    \ifx\x\SOUL@hyphenhintM
        \let\SOUL@n\SOUL@dosyllable
    \else\ifx\x\SOUL@lowerthanM
        \SOUL@gettoken
        \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@charkern}
            {\the\SOUL@token}%
        \SOUL@everylowerthan
        \SOUL@puttoken
        \let\SOUL@n\SOUL@dosyllable
    \else\ifdim\SOUL@syllwidth=\SOUL@syllgoal
        \SOUL@everysyllable
        \SOUL@puttoken
        \let\SOUL@n\relax
    \else\ifx\x\SOUL@stopM
        \SOUL@errmsg
        \global\let\SOUL@errmsg\relax
        \let\SOUL@n\relax
    \else
        \setbox\tw@\hbox{\SOUL@tt\the\SOUL@token}%
        \advance\SOUL@syllwidth\wd\tw@
        \global\SOUL@lasttoken=\SOUL@token
        \SOUL@gettoken
        \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@charkern}
            {\the\SOUL@token}%
        \SOUL@puttoken
        \global\SOUL@token=\SOUL@lasttoken
        \SOUL@everytoken
        \edef\x{\SOUL@syllable={\the\SOUL@syllable\the\SOUL@token}}\x
        \let\SOUL@n\SOUL@dosyllable
    \fi\fi\fi\fi
    \SOUL@n
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@gettoken}
% Provide the next token in \cs{\SOUL@token}. If there's already one
% in the buffer, use that one first.
%
%    \begin{macrocode}
\def\SOUL@gettoken{%
    \edef\x{\the\SOUL@buffer}%
    \ifx\x\empty
        \SOUL@nexttoken
    \else
        \global\SOUL@token=\SOUL@buffer
        \global\SOUL@buffer={}%
    \fi
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@puttoken}
% The possibility to put tokens back makes the scanner design much
% cleaner. There's only room for one token, though, so we issue
% an error message if \cs{\SOUL@puttoken} is told to put a token
% back while the buffer is still in use. Note that \cs{\SOUL@debug}
% is actually undefined. This won't hurt as it can only happen
% during driver design. No user will ever see this message.
%
%    \begin{macrocode}
\def\SOUL@puttoken{%
    \edef\x{\the\SOUL@buffer}%
    \ifx\x\empty
        \global\SOUL@buffer=\SOUL@token
        \global\SOUL@token={}%
    \else
        \SOUL@debug{puttoken called twice}%
    \fi
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@nexttoken}
% \begin{macro}{\SOUL@splittoken}
% If the word buffer \cs{\SOUL@word} is empty, deliver a \cs{\SOUL@stop},
% otherwise take the next token.
%
%    \begin{macrocode}
\def\SOUL@nexttoken{%
    \edef\x{\the\SOUL@word}%
    \ifx\x\empty
        \SOUL@token={\SOUL@stop}%
    \else
        \expandafter\SOUL@splittoken\the\SOUL@word\SOUL@stop
    \fi
}
\def\SOUL@splittoken#1#2\SOUL@stop{%
    \global\SOUL@token={#1}%
    \global\SOUL@word={#2}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@getkern}
% Assign the kerning value between the first and the third argument
% to the second, which has to be a \cs{\dimen} register.
% |\SOUL@getkern{A}{\dimen0}{V}| will assign the kerning value
% between `A' and `V' to |\dimen0|.
%
%    \begin{macrocode}
\def\SOUL@getkern#1#2#3{%
    \setbox\tw@\hbox{#1#3}%
    #2\wd\tw@
    \setbox\tw@\hbox{#1\null#3}%
    \advance#2-\wd\tw@
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@setkern}
% Set a kerning value if it doesn't equal 0\,pt. Of course, we could
% also set a zero value, but that would needlessly clutter the
% logfile.
%
%    \begin{macrocode}
\def\SOUL@setkern#1{\ifdim#1=\z@\else\kern#1\fi}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@error}
% This error message will be shown once for every word that couldn't
% be reconstructed by \cs{\SOUL@dosyllable}.
%
%    \begin{macrocode}
\def\SOUL@error{%
    \vrule\@height.8em\@depth.2em\@width1em
    \PackageError{soul}{Reconstruction failed}{%
        I came across hyphenatable material enclosed in group
        braces,^^Jwhich I can't handle. Either drop the braces or
        make the material^^Junbreakable using an \string\mbox\space
        (\string\hbox). Note that a space^^Jalso counts as possible
        hyphenation point. See page 4 of the manual.^^JI'm leaving
        a black square so that you can see where I am right now.%
    }%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@setup}
% This is a null driver, that will be used as the basis for
% other drivers. These have then to redefine only interface commands
% that shall differ from the default.
%
%    \begin{macrocode}
\def\SOUL@setup{%
    \let\SOUL@preamble\relax
    \let\SOUL@postamble\relax
    \let\SOUL@everytoken\relax
    \let\SOUL@everysyllable\relax
    \def\SOUL@everyspace##1{##1\space}%
    \let\SOUL@everyhyphen\relax
    \def\SOUL@everyexhyphen##1{##1}%
    \let\SOUL@everylowerthan\relax
}
\SOUL@setup
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The \texorpdfstring{\so{letterspacing}}{letterspacing} driver}
%
% \begin{macro}{\SOUL@sosetletterskip}
% A handy helper macro that sets the inter-letter skip with a
% draconian \cs{\penalty}.
%
%    \begin{macrocode}
\def\SOUL@sosetletterskip{\nobreak\hskip\SOUL@soletterskip}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@sopreamble}
% If letterspacing (\cs{\so} or \cs{\caps}) follows a white space, we
% replace it with our \syn{outer space}. \LaTeX\ uses |\hskip1sp| as
% marker in tabular entries, so we ignore tiny skips.
%
%    \begin{macrocode}
\def\SOUL@sopreamble{%
    \ifdim\lastskip>5sp
        \unskip
        \hskip\SOUL@soouterskip
    \fi
    \spaceskip\SOUL@soinnerskip
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@sopostamble}
% Start the look-ahead scanner \cs{\SOUL@socheck} outside the \cs{\SOUL@}
% scope. That's why we make the \syn{outer space} globally available in
% \cs{\skip@}.
%
%    \begin{macrocode}
\def\SOUL@sopostamble{%
    \global\skip@=\SOUL@soouterskip
    \aftergroup\SOUL@socheck
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@socheck}
% \begin{macro}{\SOUL@sodoouter}
% Read the next token after the \soul\ command into \cs{\SOUL@@}
% and examine it. If it's some kind of space, replace it with
% \syn{outer space} and the appropriate penalty, else if it's
% a closing brace, continue scanning. If it is neither: do nothing.
%
%    \begin{macrocode}
\def\SOUL@socheck{%
    \futurelet\SOUL@@\SOUL@sodoouter
}
\def\SOUL@sodoouter{%
    \def\SOUL@n*##1{\hskip\skip@}%
    \ifcat\egroup\noexpand\SOUL@@
        \unkern
        \egroup
        \def\SOUL@n*{\afterassignment\SOUL@socheck\let\SOUL@x=}%
    \else\ifx\SOUL@spc\SOUL@@
        \def\SOUL@n* {\hskip\skip@}%
    \else\ifx~\SOUL@@
        \def\SOUL@n*~{\nobreak\hskip\skip@}%
    \else\ifx\ \SOUL@@
    \else\ifx\space\SOUL@@
    \else\ifx\@xobeysp\SOUL@@
    \else
        \def\SOUL@n*{}%
        \let\SOUL@@\relax
    \fi\fi\fi\fi\fi\fi
    \SOUL@n*%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@soeverytoken}
% Typeset the token and put an unbreakable inter-letter skip
% thereafter. If the token is \cs{\<} then remove the last skip instead.
% Gets the character kerning value between the actual and the
% next token in \cs{\SOUL@charkern}.
%
%    \begin{macrocode}
\def\SOUL@soeverytoken{%
    \edef\x{\the\SOUL@token}%
    \ifx\x\SOUL@lowerthanM
    \else
        \global\let\SOUL@soeventuallyskip\SOUL@sosetletterskip
        \the\SOUL@token
        \SOUL@gettoken
        \edef\x{\the\SOUL@token}%
        \ifx\x\SOUL@stopM
        \else
            \SOUL@setkern\SOUL@charkern
            \SOUL@sosetletterskip
            \SOUL@puttoken
        \fi
    \fi
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@soeveryspace}
% This macro sets an \syn{inner space}. The argument may contain
% penalties and is used for the |~| command. This construction was
% needed to make colored underlines work, without having to put
% any of the coloring commands into the core. |\kern\z@| prevents
% in subsequent \cs{\so} commands that the second discards the
% \syn{outer space} of the first. To remove the space simply
% use |\unkern\unskip|.
%
%    \begin{macrocode}
\def\SOUL@soeveryspace#1{#1\space\kern\z@}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@soeveryhyphen}
% Sets implicit hyphens. The kerning value between the current token
% and the hyphen character is passed in \cs{\SOUL@hyphkern}.
%
%    \begin{macrocode}
\def\SOUL@soeveryhyphen{%
    \discretionary{%
        \unkern
        \SOUL@setkern\SOUL@hyphkern
        \SOUL@sethyphenchar
    }{}{}%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@soeveryexhyphen}
% Sets the explicit hyphen that is passed as argument.
% \cs{\SOUL@soeventuallyskip} equals \cs{\SOUL@sosetletterskip},
% except when a \cs{\<} had been detected. This is necessary because
% \cs{\SOUL@soeveryexhyphen} wouldn't know otherwise, that it
% follows a~\cs{\<}.
%
%    \begin{macrocode}
\def\SOUL@soeveryexhyphen#1{%
    \SOUL@setkern\SOUL@hyphkern
    \SOUL@soeventuallyskip
    \hbox{#1}%
    \discretionary{}{}{%
        \SOUL@setkern\SOUL@charkern
    }%
    \SOUL@sosetletterskip
    \global\let\SOUL@soeventuallyskip\relax
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@soeverylowerthan}
% Let \cs{\<} remove the last inter-letter skip. Set the kerning value
% between the token before and that after the \cs{\<} command.
%
%
%    \begin{macrocode}
\def\SOUL@soeverylowerthan{%
    \unskip
    \unpenalty
    \global\let\SOUL@soeventuallyskip\relax
    \SOUL@setkern\SOUL@charkern
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@sosetup}
% Override all interface macros by our letterspacing versions. The
% only unused macro is \cs{\SOUL@everysyllable}.
%
%    \begin{macrocode}
\def\SOUL@sosetup{%
    \SOUL@setup
    \let\SOUL@preamble\SOUL@sopreamble
    \let\SOUL@postamble\SOUL@sopostamble
    \let\SOUL@everytoken\SOUL@soeverytoken
    \let\SOUL@everyspace\SOUL@soeveryspace
    \let\SOUL@everyhyphen\SOUL@soeveryhyphen
    \let\SOUL@everyexhyphen\SOUL@soeveryexhyphen
    \let\SOUL@everylowerthan\SOUL@soeverylowerthan
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@setso}
% A handy macro for internal use.
%
%    \begin{macrocode}
\def\SOUL@setso#1#2#3{%
    \def\SOUL@soletterskip{#1}%
    \def\SOUL@soinnerskip{#2}%
    \def\SOUL@soouterskip{#3}%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\sodef}
% This macro assigns the letterspacing skips as well as an optional
% font switching command to a command sequence name. \cs{\so} itself
% will be defined using this macro.
%
%    \begin{macrocode}
\def\sodef#1#2#3#4#5{%
    \DeclareRobustCommand*#1{\SOUL@sosetup
        \def\SOUL@preamble{%
            \SOUL@setso{#3}{#4}{#5}%
            #2%
            \SOUL@sopreamble
        }%
        \SOUL@
    }%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\resetso}
% Let \cs{\resetso} define reasonable default values for letterspacing.
%
%    \begin{macrocode}
\def\resetso{%
    \sodef\textso{}{.25em}{.65em\@plus.08em\@minus.06em}%
        {.55em\@plus.275em\@minus.183em}%
}
\resetso
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\sloppyword}
% Set up a letterspacing macro that inserts slightly stretchable
% space between the characters. This can be used to typeset long
% words in narrow columns, where ragged paragraphs are undesirable.
% See section~\ref{sec:sloppyword}.
%
%    \begin{macrocode}
\sodef\sloppyword{%
    \linepenalty10
    \hyphenpenalty10
    \adjdemerits\z@
    \doublehyphendemerits\z@
    \finalhyphendemerits\z@
    \emergencystretch.1em}%
    {\z@\@plus.1em}%
    {.33em\@plus.11em\@minus.11em}%
    {.33em\@plus.11em\@minus.11em}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection[The \texorpdfstring{\caps{caps}}{caps} driver]{The caps driver}
%
% \begin{macro}{\caps}
% Unless run under \LaTeX, make \cs{\caps} just another simple letterspacing
% macro that selects a font \cs{\capsfont} (defaulting to \cs{\relax}) but
% doesn't have any special capabilities.
%
%    \begin{macrocode}
\ifx\documentclass\@undefined
\let\capsfont\relax
\let\capsreset\relax
\def\capsdef#1#2#3#4#5{}
\def\capssave#1{}
\def\capsselect#1{}
\sodef\textcaps{\capsfont}
    {.028em\@plus.005em\@minus.01em}%
    {.37em\@plus.1667em\@minus.111em}%
    {.37em\@plus.1em\@minus.14em}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\capsreset}
% \dots\ else, if run under \LaTeX\ prepare a set of macros that
% maintain a database with certain letterspacing values for different
% fonts. \cs{\capsreset} clears the database and inserts a default rule.
%
%    \begin{macrocode}
\else
\DeclareRobustCommand*\capsreset{%
    \let\SOUL@capsbase\empty
    \SOUL@capsdefault
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\capsdef}
% Add an entry to the database, which is of course nothing else than
% a \TeX\ macro. See section ``List macros'' of appendix~D in the
% \TeX{}book~\cite{DEK} for details.
%
%    \begin{macrocode}
\def\capsdef#1#2#3#4#5{{%
    \toks\z@{\\{#1/#2/#3/#4/#5}}%
    \toks\tw@=\expandafter{\SOUL@capsbase}%
    \xdef\SOUL@capsbase{\the\toks\z@\the\toks\tw@}%
}}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\capssave}
% \begin{macro}{\capsselect}
% Save the current database in a macro within the |SOUL@| namespace
% and let |\capsselect| restore this database.
%
%    \begin{macrocode}
\DeclareRobustCommand*\capssave[1]{%
    \expandafter\global\expandafter\let
        \csname SOUL@db@#1\endcsname\SOUL@capsbase
}
\DeclareRobustCommand*\capsselect[1]{%
    \expandafter\let\expandafter\SOUL@capsbase
        \csname SOUL@db@#1\endcsname
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@capsfind}
% \begin{macro}{\SOUL@caps}
% Go through the database entries and pick the first entry that matches
% the currently active font. Then define an internal macro that uses
% the respective spacing values in a macro that is equivalent to the
% \cs{\textso} command.
%
%    \begin{macrocode}
\def\SOUL@capsfind#1/#2/#3/#4/#5/#6/#7/#8/#9/{%
    \let\SOUL@match=1%
    \SOUL@chk{#1}\f@encoding
    \SOUL@chk{#2}\f@family
    \SOUL@chk{#3}\f@series
    \SOUL@chk{#4}\f@shape
    \SOUL@dimchk{#5}\f@size
    \if\SOUL@match1%
        \let\\\@gobble
        \gdef\SOUL@caps{%
            \SOUL@sosetup
            \def\SOUL@preamble{\SOUL@setso{#7}{#8}{#9}#6%
                \SOUL@sopreamble}%
            \SOUL@}%
    \fi
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@chk}
% Sets the \cs{\SOUL@match} flag if both parameters are equal.
% This is used for all \caps{\small NFSS} elements except the font size.
%
%    \begin{macrocode}
\def\SOUL@chk#1#2{%
    \if$#1$%
    \else
        \def\SOUL@n{#1}%
        \ifx#2\SOUL@n\else\let\SOUL@match=0\fi
    \fi
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@dimchk}
% \begin{macro}{\SOUL@rangechk}
% We do not only want to check if a given font size |#1| matches |#2|,
% but also if it fits into a given range. An omitted lower boundary
% is replaced by \cs{\z@} and an omitted upper boundary by \cs{\maxdimen}.
% The first of a series of \cs{\SOUL@chk} and \cs{\SOUL@dimchk}
% statements, which detects that the arguments don't match, sets the
% \cs{\SOUL@match} flag to zero. A value of~1 indicates that an
% entry in the font database matches the currently used font.
%
%    \begin{macrocode}
\def\SOUL@dimchk#1#2{\if$#1$\else\SOUL@rangechk{#2}#1--\@ne\@@\fi}
\def\SOUL@rangechk#1#2-#3-#4\@@{%
    \count@=#4%
    \ifnum\count@>\z@
        \ifdim#1\p@=#2\p@\else\let\SOUL@match=0\fi
    \else
        \dimen@=\if$#2$\z@\else#2\p@\fi
        \ifdim#1\p@<\dimen@\let\SOUL@match=0\fi
        \dimen@=\if$#3$\maxdimen\else#3\p@\fi
        \ifdim#1\p@<\dimen@\else\let\SOUL@match=0\fi
    \fi
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\textcaps}
% Find a matching entry in the database and start the letterspacing
% mechanism with the given spacing values.
%
%    \begin{macrocode}
\DeclareRobustCommand*\textcaps{{%
    \def\\##1{\expandafter\SOUL@capsfind##1/}%
    \SOUL@capsbase
    \aftergroup\SOUL@caps
}}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@capsdefault}
% Define a default database entry and a default font.
%
%    \begin{macrocode}
\def\SOUL@capsdefault{%
    \capsdef{////}%
    \SOUL@capsdfltfnt
    {.028em\@plus.005em\@minus.01em}%
    {.37em\@plus.1667em\@minus.1em}%
    {.37em\@plus.111em\@minus.14em}%
}
\let\SOUL@capsdfltfnt\scshape
\capsreset
\fi
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The \texorpdfstring{\ul{underlining}}{underlining} driver}
%
% \begin{macro}{\SOUL@ulleaders}
% This macro sets the underline under the following \cs{\hskip}.
%
%    \begin{macrocode}
\newdimen\SOUL@uldp
\newdimen\SOUL@ulht
\def\SOUL@ulleaders{%
    \leaders\hrule\@depth\SOUL@uldp\@height\SOUL@ulht\relax
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@ulunderline}
% Set an underline under the given material. It draws the line first,
% and the given material afterwards. This is needed for highlighting,
% but gives less than optimal results for colored overstriking, which,
% however, will hardly ever be used, anyway.
%
%    \begin{macrocode}
\def\SOUL@ulunderline#1{{%
    \setbox\z@\hbox{#1}%
    \dimen@=\wd\z@
    \dimen@i=\SOUL@uloverlap
    \advance\dimen@2\dimen@i
    \rlap{%
        \null
        \kern-\dimen@i
        \SOUL@ulcolor{\SOUL@ulleaders\hskip\dimen@}%
    }%
    \unhcopy\z@
}}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@ulpreamble}
% Just set up the line dimensions and the space skip. Normally,
% \cs{\spaceskip} is unset and not used by \TeX. We need it, though,
% because we feed it to the \cs{\leaders} primitive.
%
%    \begin{macrocode}
\def\SOUL@ulpreamble{%
    \SOUL@uldp=\SOUL@uldepth
    \SOUL@ulht=-\SOUL@uldp
    \advance\SOUL@uldp\SOUL@ulthickness
    \spaceskip\SOUL@spaceskip
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@uleverysyllable}
% By using \cs{\SOUL@everysyllable} we don't have to care about
% kerning values and get better results for highlighting, where
% negative kerning values would otherwise cut off characters.
%
%    \begin{macrocode}
\def\SOUL@uleverysyllable{%
    \SOUL@ulunderline{%
        \the\SOUL@syllable
        \SOUL@setkern\SOUL@charkern
    }%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@uleveryspace}
% Set a given penalty and an underlined \cs{\space} equivalent.
% The \cs{\null} prevents a nasty gap in |\textfrak| |{a \textswab{b}}|,
% while it doesn't seem to hurt in all other cases. I didn't investigate
% this.
%
%    \begin{macrocode}
\def\SOUL@uleveryspace#1{%
    \SOUL@ulcolor{%
        #1%
        \SOUL@ulleaders
        \hskip\spaceskip
    }%
    \null
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@uleveryhyphen}
% If hyphenation takes place, output an underlined hyphen with the
% required hyphen kerning value.
%
%    \begin{macrocode}
\def\SOUL@uleveryhyphen{%
    \discretionary{%
        \unkern
        \SOUL@ulunderline{%
            \SOUL@setkern\SOUL@hyphkern
            \SOUL@sethyphenchar
        }%
    }{}{}%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@uleveryexhyphen}
% Underline the given hyphen, en-dash, em-dash or \cs{\slash} and care
% for kerning.
%
%    \begin{macrocode}
\def\SOUL@uleveryexhyphen#1{%
    \SOUL@setkern\SOUL@hyphkern
    \SOUL@ulunderline{#1}%
    \discretionary{}{}{%
        \SOUL@setkern\SOUL@charkern
    }%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@ulcolor}
% \begin{macro}{\setulcolor}
% Define the underline color or turn off coloring, in which case the lines are not
% just colored black, but remain uncolored. This makes them appear
% black, nevertheless, and has the advantage, that no Postscript
% \cs{\specials} are cluttering the output.
%
%    \begin{macrocode}
\let\SOUL@ulcolor\relax
\def\setulcolor#1{%
    \if$#1$
        \let\SOUL@ulcolor\relax
    \else
        \def\SOUL@ulcolor{\textcolor{#1}}%
    \fi
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\setuloverlap}
% \begin{macro}{\SOUL@uloverlap}
% Set the overlap amount, that helps to avoid gaps on sloppy output
% devices.
%
%    \begin{macrocode}
\def\setuloverlap#1{\def\SOUL@uloverlap{#1}}
\setuloverlap{.25pt}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@ulsetup}
% The underlining driver is quite simple. No need for \cs{\SOUL@postamble}
% and \cs{\SOUL@everytoken}.
%
%    \begin{macrocode}
\def\SOUL@ulsetup{%
    \SOUL@setup
    \let\SOUL@preamble\SOUL@ulpreamble
    \let\SOUL@everysyllable\SOUL@uleverysyllable
    \let\SOUL@everyspace\SOUL@uleveryspace
    \let\SOUL@everyhyphen\SOUL@uleveryhyphen
    \let\SOUL@everyexhyphen\SOUL@uleveryexhyphen
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@textul}
% Describing self-explanatory macros is \emph{so} boring!
%
%    \begin{macrocode}
\DeclareRobustCommand*\textul{\SOUL@ulsetup\SOUL@}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\setul}
% \begin{macro}{\SOUL@uldepth}
% \begin{macro}{\SOUL@ulthickness}
% Set the underlining dimensions. Either value may be omitted and
% lets the respective macro keep its current contents.
%
%    \begin{macrocode}
\def\setul#1#2{%
    \if$#1$\else\def\SOUL@uldepth{#1}\fi
    \if$#2$\else\def\SOUL@ulthickness{#2}\fi
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\resetul}
% Set reasonable default values that fit most latin fonts.
%
%    \begin{macrocode}
\def\resetul{\setul{.65ex}{.1ex}}
\resetul
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\setuldepth}
% This macro sets all designated ``letters'' (\cs{\catcode=11}) or the
% given material in a box and sets the underlining dimensions according
% to the box depth.
%
%    \begin{macrocode}
\def\setuldepth#1{{%
    \def\SOUL@n{#1}%
    \setbox\z@\hbox{%
        \tracinglostchars\z@
        \ifx\SOUL@n\empty
            \count@\z@
            \loop
                \ifnum\catcode\count@=11\char\count@\fi
            \ifnum\count@<\@cclv
                \advance\count@\@ne
            \repeat
        \else
            #1%
        \fi
    }%
    \dimen@\dp\z@
    \advance\dimen@\p@
    \xdef\SOUL@uldepth{\the\dimen@}%
}}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The \texorpdfstring{\st{overstriking}}{overstriking} driver}
%
% \begin{macro}{\SOUL@stpreamble}
% Striking out is just underlining with a raised line of a different
% color. Hence we only need to define the preamble accordingly and
% let the underlining preamble finally do its job. Not that colored
% overstriking was especially useful, but we want at least to keep
% it black while we might want to set underlines in some fancy color.
%
%    \begin{macrocode}
\def\SOUL@stpreamble{%
    \dimen@\SOUL@ulthickness
    \dimen@i=-.5ex
    \advance\dimen@i-.5\dimen@
    \edef\SOUL@uldepth{\the\dimen@i}%
    \let\SOUL@ulcolor\SOUL@stcolor
    \SOUL@ulpreamble
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@stsetup}
% We re-use the whole underlining setup and just replace the preamble
% with our modified version.
%
%    \begin{macrocode}
\def\SOUL@stsetup{%
    \SOUL@ulsetup
    \let\SOUL@preamble\SOUL@stpreamble
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\textst}
% These pretzels are making me thirsty \dots
%
%    \begin{macrocode}
\DeclareRobustCommand*\textst{\SOUL@stsetup\SOUL@}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@stcolor}
% \begin{macro}{\setstcolor}
% Set the overstriking color. This won't be used often, but is required
% in cases, where the underlines are colored. You wouldn't want to
% overstrike in the same color. Note that overstriking lines are
% drawn \emph{beneath} the text, hence bright colors won't look good.
%
%    \begin{macrocode}
\let\SOUL@stcolor\relax
\def\setstcolor#1{%
    \if$#1$
        \let\SOUL@stcolor\relax
    \else
        \def\SOUL@stcolor{\textcolor{#1}}%
    \fi
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The highlighting driver}
%
% \begin{macro}{\SOUL@hlpreamble}
% This is nothing else than overstriking with very thick lines.
%
%    \begin{macrocode}
\def\SOUL@hlpreamble{%
    \setul{}{2.5ex}%
    \let\SOUL@stcolor\SOUL@hlcolor
    \SOUL@stpreamble
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\SOUL@hlsetup}
% No need to re-invent the wheel. Just use the overstriking setup
% with a different preamble.
%
%    \begin{macrocode}
\def\SOUL@hlsetup{%
    \SOUL@stsetup
    \let\SOUL@preamble\SOUL@hlpreamble
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\texthl}
% \begin{macro}{\sethlcolor}
% \begin{macro}{\SOUL@hlcolor}
% Define the highlighting macro and the color setting macro with a
% simple default color. Yellow isn't really pleasing, but it's already
% predefined by the \package{color} package.
%
%    \begin{macrocode}
\DeclareRobustCommand*\texthl{\SOUL@hlsetup\SOUL@}
\def\sethlcolor#1{\if$#1$\else\def\SOUL@hlcolor{\textcolor{#1}}\fi}
\sethlcolor{yellow}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection*{The package postamble}
%
% \begin{macro}{\so}
% \begin{macro}{\ul}
% \begin{macro}{\st}
% \begin{macro}{\hl}
% \begin{macro}{\caps}
% OK, I lied. The short macro names are just abbreviations for their
% longer counterpart. Some people might be used to |\text*| style commands
% to select a certain font. And then it doesn't hurt to reserve
% these early enough.
%
%    \begin{macrocode}
\let\so\textso
\let\ul\textul
\let\st\textst
\let\hl\texthl
\let\caps\textcaps
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \noindent
% When used in an environment other than \LaTeX\ and the \package{german}
% package was already loaded, define the double quotes as accent.
%
%    \begin{macrocode}
\ifx\documentclass\@undefined
    \ifx\mdqoff\@undefined
    \else
        \soulaccent{"}%
    \fi
    \catcode`\@=\atcode
%    \end{macrocode}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \noindent
% If we have been loaded by a \LaTeX\ environment and the \package{color}
% package wasn't also loaded, we disable all colors. Then we add the umlaut accent
% |"| if the \package{german} package is present. The quotes character has to
% be \cs{\catcode}'d \cs{\active} now, or it won't get recognized later.
% The \option{capsdefault}
% option overrides the \cs{\caps} driver and lets \cs{\SOUL@} set an underline.
% Finally load the local configuration, process the |capsdefault|
% option and exit.
%
%    \begin{macrocode}
\else
    \bgroup
        \catcode`\"\active
        \AtBeginDocument{%
            \@ifundefined{color}{%
                \let\SOUL@color\relax
                \let\setulcolor\@gobble
                \let\setstcolor\@gobble
                \let\sethlcolor\@gobble
                \let\hl\ul
            }{}
            \@ifundefined{mdqoff}{}{\soulaccent{"}}
        }
    \egroup
    \DeclareOption{capsdefault}{%
        \AtBeginDocument{%
            \def\SOUL@capsdfltfnt#1{%
                \SOUL@ulsetup
                \SOUL@ulpreamble
                \scshape
            }%
        }%
    }
    \InputIfFileExists{soul.cfg}%
        {\PackageInfo{soul}{Local config file soul.cfg used}}{}
    \ProcessOptions
\fi
\endinput
%    \end{macrocode}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \vspace{2explus1fill}
%\begin{verbatim}
%$Id: soul.dtx,v 1.128 2003/11/17 22:57:24 m Rel $
%\end{verbatim}
% \Finale
%
%
%                                                       ^^A.E.I.O.U.^^
%^^A vim:ts=4:sw=4:et