1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
|
%
% \iffalse meta-comment
%
% Copyright 2016 Brian Dunn
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% \fi
%
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{lwarp}
%<package> [2017/02/23 v0.21 Allows LaTeX to directly produce HTML5 output.]
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{lmodern}
% \usepackage{libertine}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provides \degree, \textquotesingle, \textmu
\usepackage{newunicodechar}
\newunicodechar{ff}{ff}
\newunicodechar{fi}{fi}
\newunicodechar{fl}{fl}
\newunicodechar{ffi}{ffi}
\newunicodechar{ffl}{ffl}
% \newunicodechar{°}{\degree}
\newunicodechar{ρ}{\ensuremath{\rho}}
\newunicodechar{⨯}{\texttimes}
\newunicodechar{⁄}{\textfractionsolidus}
% \newunicodechar{®}{\textregistered}
% \newunicodechar{©}{\textcopyright}
\newunicodechar{—}{---}
\newunicodechar{–}{--}
% \newunicodechar{”}{''}
% \newunicodechar{“}{``}
% \newunicodechar{§}{\S}
% \newunicodechar{¶}{\P}
% \newunicodechar{†}{\dag}
\newunicodechar{‡}{\ddag}
\newunicodechar{Á}{\'{A}}
\newunicodechar{è}{\`{e}}
\newunicodechar{ø}{\o{}}
\newunicodechar{Æ}{\AE{}}
\newunicodechar{â}{\^{a}}
\newunicodechar{ô}{\^{o}}
\newunicodechar{Ô}{\^{O}}
\newunicodechar{ê}{\^{e}}
\usepackage[log-declarations=false]{xparse}
\usepackage[lwarpmk]{lwarp-newproject}
\usepackage{lwarp}
\usepackage{needspace}
\usepackage[svgnames]{xcolor}
\definecolor{myurlcolor}{rgb}{0,0,.7}
\definecolor{mylinkcolor}{rgb}{.7,0,0}
\definecolor{codecolor}{rgb}{0,.4,.2}
\definecolor{overviewcolor}{rgb}{0,.2,.4}
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage{enumitem}
\usepackage{array}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage[normalem]{ulem}
\usepackage{fancyvrb}
\usepackage{capt-of}
\usepackage{comment}
\excludecomment{testing}
% \usepackage{morefloats}
% \usepackage{marginfix}
\usepackage{tocloft}
\renewcommand{\cftpartfont}{\Large\bfseries}
\setlength{\cftsecnumwidth}{2.5em}
\setlength{\cftsubsecnumwidth}{3em}
\setlength{\cftsubsubsecindent}{2.8em}
\setlength{\cftsubsubsecnumwidth}{4em}
\usepackage{titleps}
\newpagestyle{pageheadfoot}{
\headrule
\sethead{\pkg{lwarp}}{}{\thepage}
% \renewcommand{\makefootrule}{\rule[2.5ex]{\linewidth}{.4pt}}
\setfoot{}{}{}
}
\pagestyle{pageheadfoot}
\usepackage{dtxdescribe}
\newcommand{\ItemDescribeMacro}[1]{\item[\cmd{#1}:]\DescribeMacro{#1}}
\newcommand{\ItemDescribeEnv}[1]{\item[\env{#1}:]\DescribeEnv{#1}}
\newcommand{\ItemDescribeCounter}[1]{\item[\texttt{#1}:]\DescribeCounter{#1}}
\newcommand{\ItemDescribeBoolean}[1]{\item[\texttt{#1}:]\DescribeBoolean{#1}}
\usepackage{microtype}
\usepackage[all,defaultlines=2]{nowidow}
\usepackage[pdftex,bookmarks=true,hidelinks,%
colorlinks,linkcolor=mylinkcolor,urlcolor=myurlcolor,%
pageanchor=true,hyperindex=true,
]{hyperref}
\hypersetup{%
pdfinfo={%
Title={LaTeX lwarp package},%
Author={Brian Dunn},%
Subject={LaTeX to HTML conversion},%
Keywords={LaTeX, HTML, conversion}%
}}
\usepackage{cleveref}
\renewcommand{\partname}{Package}
\renewcommand*{\thepart}{\arabic{part}}
\newcommand{\lmacro}[1]{\textbackslash#1}
\newcommand{\cmds}[1]{\texttt{#1}}
\newcommand{\env}[1]{\texttt{#1}}
\newcommand{\pkg}[1]{\textsf{#1}}
\newcommand{\acro}[1]{\textsc{\lowercase{#1}}}
\newcommand{\tag}[1]{\texttt{<#1>}}
\newcommand{\codehtml}{\leavevmode\marginpar{\footnotesize\raggedleft\textcolor{codecolor}{\textbf{for HTML output:~}}}\vspace{-5.25ex}}
\newcommand{\codeprint}{\leavevmode\marginpar{\footnotesize\raggedleft\textcolor{codecolor}{\textbf{for PRINT output:~}}}\vspace{-5.25ex}}
\newcommand{\codeall}{\leavevmode\marginpar{\footnotesize\raggedleft\textcolor{codecolor}{\textbf{for HTML \& PRINT:~}}}\vspace{-5.25ex}}
\newcommand{\tikz}{Ti\textit{k}z}
\newcommand{\htmlfive}{\acro{HTML}\oldstylenums{5}}
\newcommand{\cssthree}{\acro{CSS}\oldstylenums{3}}
\newcommand{\goesto}{$\Rightarrow$}
\newcommand{\userentry}[1]{%
\par
\smallskip
\hspace*{2em}{\footnotesize Enter~$\Rightarrow$}\quad\texttt{#1}
\smallskip
}
\newenvironment{docsidebar}[1][]
{\hfill\minipage{.9\linewidth}\raggedright#1\smallskip\hrule\medskip}
{\smallskip\hrule\endminipage\hspace*{\fill}\bigskip}
% \makeatletter
% \newcommand{\watchout}[1][]{%
% \@bsphack%
% \marginpar{\raggedleft\textcolor{blue!70!black}{#1} \quad \includegraphics[height=3ex]{symbol_warning.pdf}}
% \@esphack%
% }
% \makeatother
\newcommand{\pdflatexonly}{
\textcolor{red}{Only pre-loaded if \texttt{pdflatex} is being used.}
\marginpar{\raggedleft\textcolor{blue!70!black}{\texttt{pdflatex} only:}}
}
% \newcommand{\margintag}[1]{%
% \marginpar{\raggedleft\textcolor{blue!70!black}{#1}}%
% }
% The following text is used in multiple places in the documentation:
\newcommand{\documentationnotes}{
The following sections document the actual implementation of the \pkg{lwarp} package.
The small numbers at the left end of a line refer to line numbers
\margintag{line numbers}
in the \texttt{lwarp.sty} file.
Blue-colored tags in the left margin
\margintag{subjects}
aid in quickly identifying the subject of each paragraph.
Black-colored tags in the left marign are used to
\margintag{objects}
identify programming objects such as files, packages,
environments, booleans, and counters.
Items without a tag are command macros.
Each of these also appears in the index as
\margintag{index entries}
individual entries, and are also listed together under ``files'', ``packages'', ``environments'',
``booleans'', and ``counters''.
Special warnings are marked with a warning icon.
\watchout[warnings]
\codehtml\vspace*{5.25ex}\ignorespaces
\codeprint\vspace*{5.25ex}\ignorespaces
\codeall\vspace*{5.25ex}\ignorespaces
Green-colored tags in the left margin show which sections of source
code apply to the generation of \acro{HTML}, print, or both forms of output.
}
\newcommand{\limitstext}{\cs{textbf}, etc.\ are supported,
but \cs{bfseries}, etc.\ are not yet supported.}
\newcommand{\limitsverse}{%
\DescribeMacro{\attrib}
The documentation for the \pkg{verse} and \pkg{memoir} packages suggest
defining an \cs{attrib} command, which may already exist in current documents,
but it will only work for print output.
\pkg{lwarp} provides \cs{attribution}, which
works for both print and \acro{HTML} output. To combine the two so that
\cs{attrib} is used for print and \cs{attribution} is used for \acro{HTML}:
\begin{docsidebar}
\ttfamily
\cs{begin}\{warpHTML\}
\cs{let}\cs{attrib}\cs{attribution}
\cs{end}\{warpHTML\}
\end{docsidebar}
\DescribeLength{vleftskip}
\DescribeLength{vleftmargini}
These lengths are used by \pkg{verse} and \pkg{memoir} to control the left margin,
and they may already be set by the user for print output. New lengths
\DescribeLength{HTMLvleftskip}\DescribeLength{HTMLleftmargini}
\cs{HTMLvleftskip} and \cs{HTMLleftmargini} are provided to control the
margins in \acro{HTML} output. These new lengths may be set by the user
before any \env{verse} environment, and persist until they are manually changed again.
One reason to change \cs{HTMLleftmargini} is if there is a wide
\cs{flagverse} in use, such as the word ``Chorus'', in which case the value of
\cs{HTMLleftmargini} should be set to a wide enough length to contain ``Chorus''.
The default is wide enough for a stanza number.
Horizontal spacing relies on \texttt{pdftotext}'s ability to discern the
\texttt{-layout} of the
text in the \acro{HTML}-tagged \acro{PDF} output. For some settings of
\cs{HTMLleftmargini} or \cs{HTMLleftskip} the horizontal alignment may not work out
exactly, in which case a label may be shifted by one space.
}
\newcommand{\limitslateximagefontsize}{%
The size of the math and text used
\margintag{SVG image font size}
in the \acro{SVG} image may be adjusted
\index{font>size --- lateximage}%
\index{font>size --- math, SVG}%
\index{math>font size --- SVG}%
\index{lateximages>font size}%
by setting \cs{LateximageFontSizeName} to a font size name --- \emph{without the backslash}, for ex: \\
\hspace*{.5in}\texttt{\cs{renewcommand}\{\cs{LateximageFontSizeName}\}\{\textcolor{red}{large}\}}
}
\newcommand{\limitsmath}{%
Math may be rendered as \acro{SVG} graphics or using the \textsc{MathJax} JavaScript display engine.
\index{JavaScript>MathJax}
For \acro{SVG} math,
\margintag{SVG math option}
math is rendered as usual by \LaTeX{} into the initial \acro{PDF} file using the
\index{math>SVG summary}%
\index{SVG>math summary}%
current font\footnote{See \cref{sec:xfrac} regarding fonts and fractions.},
then is captured from the \acro{PDF} and converted to \acro{SVG} graphics
via a number of utility programs.
The \acro{SVG} format is a scalable-vector web format, so math may be typeset by \LaTeX{}
with its fine control and precision, then displayed or printed at any size,
depending on (sometimes broken) browser support.
An \acro{HTML} \texttt{ALT} tag carries the \LaTeX{} code which generated the
math, allowing copy/paste of the \LaTeX{} math expression into other documents.
\limitslateximagefontsize
As currently implemented,
\margintag{SVG files}
each instance of math creates a new \acro{SVG} file. In text with
many references to math variables, this can result in a large number of files with
duplicate content. In the future, some method of content-based naming and checksumming
may be used to remove the need for duplicate files.
Another approach would be
\margintag{SVG inline}
to in-line the \acro{SVG} files directly into the \acro{HTML}.
This avoids having a large number of files and potentially speeds loading the images,
but dis-allows the possibility of sharing one file among many instances without
user intervention.
Others have used \acro{PNG} files,
\margintag{PNG files}
sometimes pre-scaled for print resolution but displayed
on-screen at a scaled down size. This allows high-quality print output at the expense
of larger files, but \acro{SVG} files are also larger as well.
Conversion to Math\acro{ML} might be a better approach,
\margintag{MathML}
among other things
allowing a more compact representation of math than \acro{SVG} drawings.
Problems with Math\acro{ML} include limited browser support and some
issues with the fine control of the appearance of the result.
The popular MathJax alternative (\url{mathjax.org}) may be used to display math.
\margintag{MathJax math option}
\DescribeProgram{MathJax}
\index{math>MathJax summary}
\index{MathJax>summary}
When MathJax is enabled, math is rendered twice:
\begin{enumerate}
\item As regular \LaTeX\ \acro{PDF} output placed inside an \acro{HTML} comment, allowing
equation numbering and cross referencing to be almost entirely under the control of \LaTeX, and
\item As detokenized printed \LaTeX{} commands placed directly into the \acro{HTML} output
for interpretation by the MathJax display scripts. An additional script is used to
pre-set the equation number format and value according to the current \LaTeX\ values,
and the MathJax cross-referencing system is ignored in favor of the \LaTeX\ internal system,
seamlessly integrating with the rest of the \LaTeX\ code.
\end{enumerate}
Limitations when using MathJax include:
\margintag{MathJax limitations}
\DescribeProgram{MathJax}
\begin{itemize}
\item In document classes which have chapters,
\margintag{chapter numbers}%
\index{MathJax>tagged equations}%
\index{tagged equations>Mathjax}%
\cs{tag}ged equations have the chapter number prepended in \acro{HTML} output, unlike \LaTeX.
\cs{tag*} equations (correctly) do not.
This may be improved with future versions of the MathJax support script.
\href{https://groups.google.com/forum/\#!topic/mathjax-users/jUtewUcE2bY}
{\texttt{https://groups.google.com/forum/\#!topic/\\
\hspace*{2em}mathjax-users/jUtewUcE2bY}}
\item MathJax itself does not support subequations.
\margintag{subequations}
\index{MathJax>subequations}%
\index{subequations>MathJax}%
This may be improved by parsing the \LaTeX{}
math expression to manually insert tags, but this has not yet been done.
\item Footnotes inside equations are not yet supported while using MathJax.
\margintag{footnotes in math}
\item Math appearing inside a lateximage,
\margintag{lateximage}
and therefore also inside a \tikz{} or \env{picture}
environment, is rendered as SVG math even if MathJax is used in the rest of the document.
\item Usage of \pkg{siunitx} inside a math equation
\margintag{siunitx}
is supported via a third-party MathJax extension.
While inside a math expression, do not use \cs{SI} or \cs{si} inside \cs{text},
where it will be rendered as normal text.
\watchout[siunitx inside an equation]
\href{https://github.com/mathjax/MathJax-third-party-extensions/tree/master/siunitx}
{\texttt{https://github.com/mathjax/MathJax-third-party-extensions/\\
\hspace*{2em}tree/master/siunitx}}
\item MathJax does not automatically support custom \LaTeX{} macros,
\margintag{\LaTeX{} macros}
but they may be set up by the user.
\end{itemize}
}
\newcommand{\limitsgraphics}{%
\cs{graphicspath} only works for a single directory;
\margintag{\cs{graphicspath}}
all graphics must be in this directory.
For \cs{includegraphics}, avoid \texttt{px} and \% units for width and height, or
\margintag{units}
enclose them inside \env{warpHTML} environments.
For font-proportional image sizes, use \texttt{ex} or \texttt{em}.
For fixed-sized images, use
\texttt{cm}, \texttt{mm}, \texttt{in}, \texttt{pt}, or \texttt{pc}.
Using the keys \cmds{width=.5\lmacro{linewidth}},
or similar for \cmds{\lmacro{textwidth}} or \cmds{\lmacro{textheight}}
to give fixed-sized images proportional to a 6 by 9 inch text area.
\cs{includegraphics} accepts \texttt{width} and \texttt{height},
\margintag{options}
\texttt{origin}, \texttt{rotate} and \texttt{scale},
plus a new \texttt{class} key.
With \acro{HTML} output, \cs{includegraphics} accepts an optional
\margintag{\acro{HTML} class}
\texttt{class=xyz} keyval combination, and if this is given then
the \acro{HTML} output will include that class for the image.
The class is ignored for print output.
For \cs{includegraphics} the user should provide both \texttt{.pdf} and \texttt{.svg}
images, but always refer to
\watchout[image file types]
\texttt{.pdf} images in the document source.
All \cs{includegraphics} references to \texttt{.pdf} will automatically
be changed to \texttt{.svg} for \acro{HTML} output, and will be left as \texttt{.pdf} for print output.
Images may also be \texttt{.jpg} and \texttt{.png}, and will be used as-is for either output.
\cs{rotatebox} accepts the optional \texttt{origin} key.
\margintag{\cs{rotatebox}}
\cs{rotatebox}, \cs{scalebox}, and \cs{reflectbox} depend on modern browser
support.
\watchout[browser support]
The \cssthree{} standard declares that when an object is transformed
the whitespace which they occupied is preserved,
unlike \LaTeX{}, so expect some
ugly results for scaling and rotating.
}
\newcommand{\limitsxcolor}{%
Color definitions, models, and mixing are fully supported
\margintag{support}
without any changes required.
Colored tables are ignored. Use \acro{CSS} to style tables.
\margintag{tables}
\cs{textcolor}, \cs{colorbox}, and \cs{fcolorbox} are supported.
\margintag{colored text and boxes}
\cs{color} and \cs{pagecolor} are ignored.
Use \acro{CSS} or \cs{textcolor} where possible.
\margintag{\cs{color} and \cs{pagecolor}}
}
\newcommand{\limitstabular}{%
\begin{itemize}
\item Vertical rules are not yet supported.
\margintag{column types}
\item \texttt{*} in a column specification is not used (so far).
Repeat the column type the correct number of times.
\item Multirow and multicolumn cannot be used at the same time.
\watchout[\cs{multirow} \& \cs{multicolumn}]
(No rectangular holes wider than one column or taller than one row.)
\item For multirow, insert \cs{mrowcell} into any empty multi-row cells.
This will be a null function for the print output, and is a placeholder for
\watchout[\cs{multirow}]
parsing the table for \acro{HTML} output.
\item If a multirow reaches to the bottom of a table,
and \cs{bottomrule} does not go over to that edge,
\margintag{\cs{multirow} with rules}
try adding a line of empty cells below the \cs{bottomrule}.
This may be a browser bug.
\changes{v0.19}{2016/05/28}{Docs: \env{multirow} browser bug workaround.}
\item If a \cs{midrule} is desired after the last row,
\margintag{rule at last row}
an additional row of blank cells must be used.
\item Multiple paragraphs in one cell of a p, b, m column
must have \cs{newline} between paragraphs.
\watchout[paragraphs]
\item \cs{cmidrule} does not support width or trim options
due to \acro{CSS} limitations.
\margintag{\cs{cmidrule} width, trim}
\item For \pkg{longtable}, place headings and footings which
\margintag{\env{longtable} headings}
do not apply to \acro{HTML} inside \cs{warpprintonly\{\}}.
\item For \cs{toprule} and \cs{bottomrule},
when combined with a \env{warpprint} or \env{warpHTML} environment,
\watchout[\cs{warpprintonly}]
if a ``misplaced \cs{noalign}'' error occurs,
change \\
\hspace*{.375in}\cmds{This \& That \cs{endhead}} \\
to \\
\hspace*{.375in}\cmds{\cs{warpprintonly}\{This \& That \cs{endhead}\}} \\
and likewise with the other \cs{end} headings.
Keep the \cs{endfirsthead} row unchanged, as it is still relevent to \acro{HTML} output.
\item For S columns (from the \pkg{siunitx} package),
\watchout[S columns]
while producing print output,
anything non-numeric must be placed
inside \{ \} braces, including commands such as \cs{multirow}.
While producing \acro{HTML} output, though, anything placed inside
braces is not seen by \pkg{lwarp}'s tabular handling algorithm.
To resolve this problem, make a copy of the row, with one version
for print output, containing the extra braces, and another version
for \acro{HTML} output, without the extra braces, such as: \\
\hspace*{.375in} \cs{warpprintonly}\{\texttt{1 \& 2 \& \textcolor{red}{\{}\cs{multirow}\{2\}\{2cm\}\{Text\}\textcolor{red}{\}} \& 3 \textbackslash\textbackslash\}} \\
\hspace*{.375in} \cs{warpHTMLonly}\{\texttt{1 \& 2 \& \cs{multirow}\{2\}\{2cm\}\{Text\} \& 3 \textbackslash\textbackslash\}}
\end{itemize}
}
\newcommand{\limitsminipage}{%
Minipages and parboxes will be placed side-by-side in \acro{HTML}
unless you place a \cs{newline} between them.
\margintag{placement}
A line of text with an inline minipage
\watchout[inline]
or parbox will have the minipage or parbox placed onto its own line,
because a paragraph is a block element and cannot be made \texttt{inline-block}.
There is limited support for minipages inside an \acro{HTML} \tag{span}.
\margintag{in a span}
An \acro{HTML} \tag{div} cannot appear inside a \tag{span}.
While in a \tag{span}, minipages and parboxes are ignored.
Use \cs{newline} or \cs{par} for an \acro{HTML} break.
When using \cs{linewidth}, \cs{textwidth}, and \cs{textheight},
\margintag{size}
widths and heights are scaled proportionally to a 6\texttimes{}9 inch text area.
A new macro \cs{minipagefullwidth} requests
\margintag{full-width minipages}
that the next minipage be generated
without an \acro{HTML} \texttt{width} tag, allowing it to be the full width of
the display rather than the fixed width given.
Nested minipages adopt their parent's text alignment in \acro{HTML},
whereas in regular \LaTeX{} \acro{PDF} output they do not.
\watchout[text alignment]
Use a \env{flushleft} or similar environment in the child minipage
to force a text alignment.
}
\newcommand{\limitsmdframed}{%
Most basic functionality is supported, including
\margintag{support}
frame background colors and single-border colors and thickness,
title and subtitle background colors and borders and thickness,
border radius, and shadow.
CSS classes are created for \pkg{mdframed} environments and frame titles.
When used, \pkg{lwarp} loads \pkg{mdframed} in HTML with \texttt{framemethod=none}.
\watchout[loading]
For title font, use\\
\hspace*{.25in}\texttt{frametitlefont=\cs{textbf},}\\
\margintag{font}%
instead of\\
\hspace*{.25in}\texttt{frametitlefont=\cs{bfseries},}\\
where \cs{textbf} must appear just before the comma and will receive the
following text as its argument (since the text happens to be between braces
in the \pkg{mdframed} source).
Since \pkg{lwarp} does not support \cs{bfseries} and friends,
only one font selection may be made at a time.
\texttt{theoremtitlefont} is not supported, since the following text is not
\margintag{theoremtitlefont}
in braces in the \pkg{mdframed} source.
Footnotes are currently placed at the bottom of the \acro{HTML} page.
\margintag{footnotes}
\texttt{userdefinedwidth} and \texttt{align} are currently ignored.
\margintag{ignored options}
}
\newcommand{\limitscaption}{%
To ensure proper float numbering, set caption positions
such as:
\hspace*{2em} \texttt{\cs{captionsetup}[table]\{position=top\}} \\
\hspace*{2em} \texttt{\cs{captionsetup}[figure]\{position=bottom\}}
Similarly for \texttt{subtable}, \texttt{subfigure},
and \texttt{longtable}.
}
\newcommand{\limitscombiningfloats}{%
If using \cs{newfloat}, \pkg{trivfloat}, and/or
\pkg{algorithmicx} together, see \cref{sec:combiningfloats}.
\watchout[package conflicts]
}
\newcommand{\limitssubfig}{%
At present, subfigures before the enclosing figure/table's \cs{caption}
\margintag{LOF/LOT}
would appear in the List of Figures/Tables before the enclosing figure/table,
therefore \pkg{lwarp} does not place subfigures in the LOF/LOT.
In the document source, use \cs{hfill} and \cs{hspace*}
\margintag{horizontal spacing}
between subfigures to spread them
apart horizontally. The use of other forms of whitespace may
cause paragraph tags to be generated, resulting in subfigures
appearing on the following lines instead of all on a single line.
}
\newcommand{\limitsfloatrow}{%
The emulation of \pkg{floatrow} does not support \cs{FBwidth} or \cs{FBheight}.
These values are pre-set to \texttt{.3\cs{linewidth}} and \texttt{2in}.
\watchout[\cs{FBwidth}, \cs{FBheight}]
Possible solutions include:
\begin{itemize}
\item Use fixed lengths. \pkg{lwarp} will scale the \acro{HTML} lengths appropriately.
\item Use \env{warpprint} and \env{warpHTML} environments to select appropriate
values for each case.
\item Inside a \env{warpHTML} environment, manually change
\cs{FBwidth} or \cs{FBheight} before the \cs{ffigbox} or \cs{ttabbox}.
Use \cs{FBwidth} or \cs{FBheight} normally afterwards; it will be used as
expected in print output, and will use your custom-selected value in \acro{HTML}
output. This custom value will be used repeatedly,
until it is manually changed to a new value.
\end{itemize}
}
\newcommand{\limitssiunitx}{%
Do not use \cmds{per-mode=fraction}, which cannot be seen by the final \cmds{pdftotext} conversion.
\watchout[per-mode]
}
\newcommand{\limitstikz}{%
For recent versions of \tikz{} (v3.0.0 --- 2013/12/20 and later), include in the document
\watchout[preamble]
preamble: \\
\hspace*{.25in} \texttt{\cs{usetikzlibrary\{babel\}} \% v3.0.0 and up}
For older versions of \tikz{} without the \tikz{} \texttt{babel} library,
\pkg{lwarp} automatically handles the catcode change for the \$ math shift.
}
\newcommand{\limitsbabelone}{%
If using \pkg{babel} with French, use \\
\hspace*{.25in}\cs{frenchbsetup\{StandardLists=true\}} \\
\watchout[French]%
to preserve the special \acro{HTML} and \pkg{enumitem} list handling.
}
\newcommand{\limitsbabeltwo}{%
Also, when French is used, the caption separator is
\margintag{\cs{CaptionSeparator}}
changed to a dash. The following may be used to restore it to a colon: \\
\hspace*{.25in}%
\texttt{\cs{renewcommand}*\{\cs{CaptionSeparator}\}\{:\textasciitilde\}}
}
\newcommand{\limitsnewclude}{%
\pkg{newclude} modifies \cs{label} in a non-adaptive way, so
\pkg{newclude} must be loaded before \pkg{lwarp} is loaded.
\watchout[loading]
\begin{docsidebar}[Ex:]
\cs{documentclass\{article\}} \\
\ldots <font setup> \\
\cs{usepackage\{newclude\}} \\
\cs{usepackage[warpHTML]\{lwarp\}} \\
\ldots
\end{docsidebar}
}
\newcommand{\limitsnewtxmath}{%
\pkg{newtxmath} must be loaded after \pkg{lwarp}.
\watchout[loading]
}
\newcommand{\limitsenumitem}{%
\pkg{enumitem} is pre-loaded during \acro{HTML} output.
\margintag{enumitem}
Many of the spacing options are rendered irrelevant by \cmds{pdftotext} and
\acro{HTML}. Numbering, labels, and \cs{newlist} function correctly.
}
\newcommand{\osportabilityusage}{%
\pkg{lwarp} tries to detect which operating system is being used.
If \textsc{MS-Windows} is not correctly detected,
\DescribeProgram{MS-Windows} \DescribeProgram{Windows}
use the command \cs{warpOSwindows} in the document
\DescribeMacro{\warpOSwindows}
preamble after \pkg{lwarp} is loaded. This modifies the
operating-system path separator used by \pkg{lwarp}.
}
\setlength{\marginparsep}{1em}
\setlength{\marginparpush}{.7ex}
\setlength{\parindent}{0em}
\setlength{\parskip}{2ex}
\setlength{\IndexMin}{40ex}
\setcounter{IndexColumns}{2}
\DisableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{lwarp.dtx}
\end{document}
%</driver>
% \fi
% \iffalse
%<*package>
% \fi
%
% \CheckSum{8282}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
% \changes{v0.10}{2016/03/08}{\ 2016/03/08 Initial version}
% \changes{v0.11}{2016/03/11}{\ 2016/03/11}
% \changes{v0.11}{2016/03/10}{Test Suite: limages and index in README.txt}
% \changes{v0.11}{2016/03/11}{Test Suite: MS-Windows in README.txt}
% \changes{v0.12}{2016/03/14}{\ 2016/03/14}
% \changes{v0.12}{2016/03/14}{Global: Uses \textbackslash{}p@(type) in float captions.}
% \changes{v0.12}{2016/03/14}{Test Suite: Sub-figures}
% \changes{v0.13}{2016/03/24}{\ 2016/03/24}
% \changes{v0.13}{2016/03/23}{Test Suite: Ordinals, Subcaption}
% \changes{v0.13}{2016/03/24}{Removed package: subfig}
% \changes{v0.14}{2016/03/31}{\ 2016/03/31}
% \changes{v0.14}{2016/03/29}{Test Suite: Assigned cleveref name for Test Float.}
% \changes{v0.14}{2016/03/31}{Test Suite: Floatrow}
% \changes{v0.15}{2016/04/06}{\ 2016/04/06}
% \changes{v0.15}{2016/03/31}{Files: lwarp\_formal.css added.}
% \changes{v0.15}{2016/03/31}{Test Suite: test\_suite\_formal.css file added.}
% \changes{v0.16}{2016/04/11}{\ 2016/04/11}
% \changes{v0.16}{2016/04/07}{Test Suite: Supports XeLaTeX, LuaLaTeX.}
% \changes{v0.16}{2016/04/08}{Test Suite: Lwarp no longer selects fonts.}
% \changes{v0.16}{2016/04/08}{Removed package: suffix}
% \changes{v0.17}{2016/04/14}{\ 2016/04/14}
% \changes{v0.17}{2016/04/14}{Test Suite: Mdframed}
% \changes{v0.17}{2016/04/14}{Test Suite: Fix: Print-version front-matter page numbers.}
% \changes{v0.18}{2016/05/19}{\ 2016/05/19}
% \changes{v0.18}{2016/04/23}{Files: lwarp.css and lwarp\_formal.css: Improved responsive design.}
% \changes{v0.18}{2016/04/23}{File: lwarp.css: Improved TOC outline display.}
% \changes{v0.18}{2016/05/13}{Test Suite: Verse package}
% \changes{v0.19}{2016/06/08}{\ 2016/06/08}
% \changes{v0.19}{2016/05/25}{File: \texttt{lwarp\_mathjax.txt} added.}
% \changes{v0.19}{2016/06/01}{File: lwarp.css: \texttt{tnoteitemheader} added}
% \changes{v0.20}{2017/02/09}{\ 2017/02/09}
% \changes{v0.20}{2016/06/27}{Test Suite: HTML meta descriptions.}
% \changes{v0.20}{2016/09/19}{File: lwarp.css: Minor fixes for validation.}
% \changes{v0.20}{2016/12/08}{Docs: Improved index.}
% \changes{v0.20}{2016/12/17}{File: lwarpmk used to compile print, HTML, indexes, and lateximages.}
% \changes{v0.20}{2016/12/17}{Removed reliance on make, grep, gawk.}
% \changes{v0.20}{2016/12/17}{Parallel versions of aux files for print/HTML.}
% \changes{v0.20}{2017/01/03}{Moved sidebar and example code to test suite.}
% \changes{v0.20}{2017/01/25}{\pkg{caption} and \pkg{subcaption} supported.}
% \changes{v0.21}{2017/02/23}{\ 2017/02/23}
% \GetFileInfo{lwarp.sty}
%
% \DoNotIndex{\newcommand,\renewcommand,\addtocounter,\begin,\end,\begingroup,\endgroup}
% \DoNotIndex{\global,\ifbool,\ifthenelse,\isequivalentto,\let}
% \DoNotIndex{\booltrue,\boolfalse}
% \expandafter\DoNotIndex\expandafter{\detokenize{\(,\),\,,\\,\#,\$,\%,\^,\_,\~,\ ,\&,\{,\}}}
%
%
% \thispagestyle{empty}
%
% \begin{center}
% \vfill
% \includegraphics[width=.3\linewidth]{lwarp_logo.pdf}
% \vfill
% {\Huge The \textbf{lwarp} package}
%
% \fileversion{} --- \filedate
%
% \bigskip
%
% {\Large \textup{\LaTeX{} to HTML5}}
%
% \bigskip
%
% {\small\copyright{} 2016} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com}
%
% \bigskip
%
%
% ^^A % \title{The \pkg{lwarp} package\thanks{This document
% ^^A % corresponds to \pkg{lwarp}~\fileversion,
% ^^A % dated \filedate.}}
% ^^A % \author{{\small\copyright{} 2016} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com}}
% ^^A % \published{}
% ^^A % \subtitle{\textup{\LaTeX{} to HTML5}}
% ^^A %
% ^^A % \maketitle
%
% \vfill
%
% \begin{abstract}
% \noindent
% The \pkg{lwarp} package allows \LaTeX\ to directly produce \htmlfive\ output,
% using external utility programs only for the final conversion of text and images.
% Math may be represented by \acro{SVG} files or MathJax.
%
% Documents may be produced by \LaTeX, \LuaLaTeX, or \XeLaTeX.
% A |texlua| script removes the need for system utilities such as |make| and |gawk|,
% and also supports |xindy| and |latexmk|. Configuration is automatic at the
% first manual compile.
%
% Print and \acro{HTML} versions of each document may coexist, each with its own
% set of auxiliary files. Support files are self-generated on request.
%
% A modular package-loading system uses the \pkg{lwarp} version of a package for
% \acro{HTML} when available.
% Several dozen \LaTeX\ packages are supported with these high-level source
% compatibility replacements.
%
% A tutorial is provided to quickly introduce the user to the major components
% of the package.
%
%
% \bigskip
%
% \begin{center}
% \textcolor{blue}{To update existing projects, see \cref{sec:updates},
% \nameref{sec:updates}.}
% \end{center}
%
% \bigskip
%
% \noindent
% \textcolor{red!30!black}{\bfseries
% Note that this is still a ``beta'' version of \pkg{lwarp},
% and some things may change in response to user feedback and
% further project development.
% }
%
% \bigskip
%
% \footnotesize
% \begin{description}
% \item[License:] \
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
% \end{description}
%
%
% \end{abstract}
%
% \vspace*{\fill}
% \vspace*{\fill}
% \vspace*{\fill}
%
% \end{center}
%
% \clearpage
%
%
% \tableofcontents
%
% \clearpage
% \listoffigures
% \listoftables
%
%
% \thispagestyle{pageheadfoot}
%
% \clearpage
%
% \part{lwarp.sty}
%
% \section{Updates}
% \label{sec:updates}
%
% For a detailed list of changes, see the Change History on page \pageref{sec:changehistory}.
%
% \begin{description}
% \item[v0.21:] \
% \begin{itemize}
% \item Documentation for installing on Windows has been updated and improved.
% \item For Windows compatibility, the |lateximages| shell script
% has been replaced with a |lateximages.txt| file, which is parsed
% by |lwarpmk| to generate lateximages.
% This does not require any changes in the user's code.
% \item Windows |lwarpmk again| now functions.
% \item For improved error handling, \pkg{lwarp} now verifies the
% order in which packages are loaded, and signals an error for misplaced packages.
% \pkg{inputenc}, \pkg{fontenc}, \pkg{newunicode}, and \pkg{fontspec}
% must be loaded before \pkg{lwarp}, and the other packages which
% \pkg{lwarp} knows about must be loaded after.
% \item \pkg{lwarp} no longer requires a \cs{title} be assigned.
% \end{itemize}
% \item[v0.20:] \
% \begin{itemize}
% \item The |makefile| and related infrastructure
% has been replaced by the |lwarpmk| utility.
% This provides increased portability, reduced dependencies,
% and much simpler installation and setup.
% \item The |lwarp-newproject| package is now used to locally create
% support files.
% \item The print and \acro{HTML} versions of a document may co-exist with their
% own sets of auxiliary files.
% \item Package handling is now controlled by a modular system which
% looks for and loads an |lwarp-<package>| version if available.
% \item High-level source compatibility is provided for all supported
% packages, almost totally eliminating the need
% for |warpprint| and |warpHTML| environments.
% \item A large number of additional packages are supported.
% \item A new tutorial is included in the documentation, and
% many obsolete sections have been removed.
% \item \cs{NewHTMLdescription} sets the \acro{HTML} meta description tag for each file.
% See \cref{sec:htmldescription}.
% \item \cs{HTMLFileName} may now be empty, allowing filenames without a prefix.
% Lwarp no longer automatically appends a |-| character.
% \watchout
% For existing projects, add a |-| to the end of \cs{HTMLFileName}.
% \item \cs{HomeHTMLFileName} and \cs{HTMLFileName} no longer use
% escaped underscore\watchout\
% characters. Underscores may be used in filenames as-is.
% \item \pkg{lwarp} now tries to auto-detect the operating system,
% and \cs{warpOSwindows} is only needed if the auto-detection
% fails to detect Windows.
% \item Tabular column types |@|, |>|, and |<| are now supported.
% \item |BlockClass| and \cs{InlineClass} add an optional style.
% \item The |sidebar| and |example| environments have been moved to the
% test suite, and are no longer included in \pkg{lwarp}.
% \end{itemize}
% \item[v0.19:] \
% \begin{itemize}
% \item \textsc{MathJax} now may be used to display math via the |mathjax| option.
% See \cref{sec:loading,sec:limitsmath}.
% To use MathJax with a pre-existing project,
% \watchout
% copy or link the file |lwarp_mathjax.txt| to the project's directory.
% \item \cs{rule} added, supporting width, height, raise, \cs{textcolor}.
% \item \cs{LateximageFontSizeName} provides user-adjustable font size for math
% and \env{lateximage}s.
% \item \cs{minipagefullwidth} requests that the next minipage be
% full-width in \acro{HTML}, but still the assigned width in print.
% \item \env{minipage} improved side-by-side rendering.
% \item CSS class |tablenotes| is provided for table note items.
% \item \cs{warpprintonly} replaces \cs{rowprintedonly},
% and \cs{warpHTMLonly} is added. These behave like the \env{warpprint}
% \watchout
% and \env{warpHTML} environments, and are generally useful, so they replace
% the previously table-specific syntax.
% \item \pkg{cleveref} is loaded \cs{AtEndPreamble} for improved reliability.
% See \cref{sec:cleveref}.
% \item \cs{xfracHTMLfontsize} controls \pkg{xfrac} font size in \acro{HTML}.
% \item \tikz\ improved catcode handling.
% \end{itemize}
% \item[v0.18:] \
% \begin{itemize}
% \item The \pkg{verse} package and the verse-related commands from
% the \pkg{memoir} package are now supported.
% \item Responsive web design has been improved for the sideTOC.
% \item \cs{includegraphics} now maintains relative sized for em, ex, and \%.
% \end{itemize}
% \item[v0.17:] \
% \begin{itemize}
% \item \pkg{mdframed} package is supported.
% \end{itemize}
% \item[v0.16:] \
% \begin{itemize}
% \item Font and input encoding are now controlled by the user, and
% \pkg{lwarp} is loaded after fonts have been selected.
% \item Support for \XeLaTeX{} and \LuaLaTeX. See \cref{sec:fonts}.
% \end{itemize}
% \end{description}
%
% \clearpage
%
% \section{Introduction}
% \changes{v0.19}{2016/05/25}{Introduction: MathJax support mentioned.}
%
% The \pkg{lwarp} project aims to allow a rich \LaTeX{} document to be converted to a reasonable \acro{HTML}
% interpretation. No attempt has been made to force \LaTeX{} to provide for every
% \acro{HTML}-related possibility, and \acro{HTML} cannot exactly render every possible \LaTeX{} concept.
% Where compromise is necessary, it is desirable to allow the print output to remain
% typographically rich, and compromise only in the \acro{HTML} conversion.
%
% Several ``modern'' features of \htmlfive, \cssthree, and \acro{SVG}
% are employed to allow a fairly feature-rich document
% without relying on the use of Javascript.
% Limited testing on older browsers show that these new features
% degrade gracefully, although the \acro{SVG} format
% for math may not be available on small cell phones.
%
% |pdflatex|, |xelatex|, or |lualatex| is used, allowing \pkg{lwarp} to process the usual image formats.
% While generating \acro{HTML} output, \acro{SVG} files are used in placed of \acro{PDF}.
% Other formats such as \acro{JPG} are used as-is.
%
% \acro{SVG} images may be used for math,
% and are also used for \env{picture}, and \tikz{} environments,
% as this format has
% better browser and e-book support than Math\acro{ML} (as of this writing),
% while still allowing for the high-quality display and printing of images (again, subject to potentially
% bug-ridden\footnote{Firefox has had an on-again/off-again bug for quite some time regareding
% printing \acro{SVG}s at high resolution.} browser
% support).\footnote{Aside --- The author, being a programmer, believes in the movement towards
% ``logical punctuation''. (Look it up.)
%
% Aside to the aside --- The author also believes that space should be on
% either side of an em-dash, employing the symbol as a separator rather than something looking
% like a chemical \textbf{bond---as} shown here, but is willing to abide by
% Chicago style when necessary.}
% Further, \acro{SVG} images allow math to be presented with
% the same precise formatting as in the print version.
% Math is accompanied by ALT tags holding the \LaTeX{} source for the expression, allowing it to be
% copy/pasted into other documents.\footnote{There seems to be some debate as to whether
% Math\acro{ML} is actually an improvement over \LaTeX{} for sharing math. The author has no
% particular opinion on the matter, except to say that in this case \LaTeX{} is much easier to implement!}
% Custom \LaTeX{} macros may be used as-is in math expressions, since the math is evaluated
% entirely inside \LaTeX.
%
% The \textsc{MathJax} JavaScript display engine may be selected
% for math display instead of using \acro{SVG} images.
% Subject to browser support and Internet access,
% MathJax allows an \acro{HTML} page to display
% math without relying on a large number of external image files,
% one per math expression. \pkg{lwarp} maintains \LaTeX\ control for cross-referencing
% and equation numbering\,/\,formatting.
%
% \hfill\rule[.7ex]{.3\linewidth}{.4pt}\hspace*{\fill}
%
% The \pkg{lwarp} package allows \LaTeX{} to directly generate \htmlfive{} tags from a \LaTeX{}
% source document, with only minor intervention on the user's part.
% A |texlua| program called |lwarpmk| is used to process either the print or \acro{HTML}
% version of the document. A few external utility programs are used to finish
% the conversion from a \LaTeX{}-generated \acro{PDF} file which happens to have \htmlfive{} tags,
% to a number of \htmlfive{} plain-text files and accompanying images.
%
% A special |lwarp-newproject| package is used to set up the auxiliary files necessary for
% the \acro{HTML} conversion. Included is a parallel version of the user's source document,
% |<sourcename>-html.tex|, which selects \acro{HTML} output and then inputs the user's own source.
% This process allows both the printed and \acro{HTML} versions to co-exist side-by-side,
% each with their own auxiliary files.
%
% When requesting packages during \acro{HTML} conversion,
% |lwarp| first looks to see if it has its own modified version
% to use instead of the usual \LaTeX\ version. These |lwarp-packagename.sty| files contain
% code used to emulate or replace functions for \acro{HTML} output.
%
% Enough functionality is provided to convert a typical article containing technical content.
% Not every package has been tested, but many of the most useful ones are known to work,
% either as-is or through emulation with replacement code. (See \cref{tab:supported} on
% page \pageref{tab:supported}.)
%
%
% \subsection{Supported packages and features}
% \changes{v0.15}{2016/04/05}{Docs: Moved the supported functions table to the introduction.}
%
% \Cref{tab:supported} lists the various \LaTeX{} packages and macros which may be used.
% \emph{Supported} means that the package or macro may be used as-is,
% perhaps with minor limitations.
% \emph{Emulated} means that the original package or macro is not used, but similar
% functionality is provided in a way which is intended to be compatible with the
% user's \LaTeX{} code.
% \emph{Ignored} means that the package is not used, but nullified user-level macros
% and related counters, lengths, etc.\ are provided for source-level compatibility.
%
% Any package listed in \cref{tab:supported} probably works with little or no change to the
% user's source code.
% Special environments are provided to mark blocks of code which are for
% print only, \acro{HTML} only, or both, should it be necessary.
%
% \clearpage
%
% \renewcommand{\arraystretch}{1.5}
%
% \begin{longtable}{>{\raggedright}m{.3\linewidth}m{.6\linewidth}}
% \caption{\protect\LaTeX--HTML generation ---
% \protect\pkg{lwarp} package ---
% Supported functions\label{tab:supported}} \endfirsthead
% \warpprintonly{\multicolumn{2}{c}{\pkg{lwarp} Supported Functions --- continued} \\
% Package or Macro & Status \\ \toprule \endhead}
% \toprule
% Package or Macro & Status \\
% \midrule
% Engines: & pdf\LaTeX, \XeLaTeX, \LuaLaTeX \\
% \midrule
% Classes: & \pkg{book}, \pkg{report}, or \pkg{article}. \pkg{memoir} is planned. \\
% \midrule
% Sectioning: & Supported, with hyperlinks.
% Honors \cmds{tocdepth} and \cmds{secnumdepth}.
% Adds \cmds{filedepth} for splitting the \acro{HTML} output.
% Files may be numbered sequentially or named according to section name.
% Common short words and punctuation is removed from the filenames. \\
% \pkg{titlesec} & Ignored. \\
% Table of Contents, Figures, Tables: & Supported, with hyperlinks. \\
% \cs{maketitle}, \env{titlepage}, \pkg{titling}: & Supported, with optional
% \pkg{titling}-based commands for published and subtitle. \\
% \pkg{titletoc} & Ignored. \\
% \pkg{tocloft} & Ignored, with support for \cs{newlistof} and \cs{ctfchapterprecis}.\\
% \pkg{abstract}: & Supported \\
% \midrule
% Cross-references: & Emulated, with hyperlinks. \\
% \pkg{cleverref}: & Supported, including ranges and lists, with hyperlinks. \\
% \pkg{nameref}: & Emulated \\
% \pkg{hyperref}: & Emulated.
% \acro{HTML} hyperlinks are generated for \acro{TOC}, \acro{LOF}, \acro{LOT},
% \cs{nameref}, \cs{ref},
% the \pkg{cleveref} commands, and index entries.\\
% \pkg{bookmark}: & Emulated. \\
% \midrule
% Footnotes: & Supported, emulated as pagenotes per \acro{HTML} page. \\
% \pkg{pagenote}: & Supported. \\
% Indexing: & \cmds{texindy} is used, with hyperlinks. \\
% Bibliography: & Supported, without hyperlinks so far. \\
% \midrule
% \pkg{babel}: & Supported. \\
% \midrule
% Math: & Supported. Converted to \acro{SVG} images with \acro{HTML} \cmds{ALT} tags containing the
% \LaTeX{} source for the math expression.
% MathJax supported as an alternative.
% \AmS{} environments are supported.
% User-defined macros are available during converson,
% due to native \LaTeX{} processing.\\
% \midrule
% Floats: & Supported, appear where declared.
% \pkg{float} is emulated, \pkg{newfloat} is supported,
% \pkg{caption} and \pkg{subcaption} are supported,
% \pkg{capt-of} is supported,
% \pkg{placeins} is ignored,
% \pkg{trivfloat} is supported, \pkg{floatrow} is emulated,
% \pkg{keyfloat} is supported, \pkg{wrapfig} is emulated. \\
% \midrule
% \env{tabular}: & Emulated.
% \cs{multirow} and \cs{multicolumn} are available, but cannot
% be used at the same time.
% Nested tables are not supported. \\
% \pkg{multirow}: & Emulated. \\
% \pkg{longtable}: & Emulated. Converted to a tabular. Captions supported.
% Extra headings and \cs{kill} lines must be enclosed in
% \cs{warpprintonly\{\}} \\
% \cmidrule{2-2}
% \pkg{booktabs}: & Emulated. \cs{toprule} and \cs{bottomrule}
% form black rules, \cs{midrule} forms silver rules, as demonstrated on
% this table.
% \cs{cmidrule}, demonstrated at this line, does not use width or trim options. \\
% \cmidrule{2-2}
% \pkg{threeparttable}: & Emulated \\
% \midrule
% \pkg{geometry}: & Ignored. \\
% \pkg{titleps}: & Used by \pkg{lwarp}, but emulated for the user. \\
% \pkg{fancyhdr}: & Ignored. \\
% \pkg{extramarks}: & Ignored. \\
% \pkg{afterpage}, \pkg{draftwatermark}, \pkg{eso-pic},
% \pkg{everypage}, \pkg{wallpaper}: & Ignored. \\
% \midrule
% \pkg{graphics}, \pkg{graphicx}: & Emulated.
% \cs{includegraphics} supports \cmds{width}, \cmds{height},
% \cmds{origin}, \cmds{angle}, and \cmds{scale} tags, and adds \cmds{class}.
% References to \acro{PDF} files are changed to \acro{SVG}, other image types
% are accepted as well.
% \cs{rotatebox} and \cs{scalebox} are supported as well as \acro{HTML} can handle. \\
% \pkg{rotating}: & Emulated. All objects are displayed unrotated. \\
% \midrule
% Lists: & Supported \\
% \pkg{enumitem}: & Supported, although spacing is still controlled by \acro{CSS}. \\
% \midrule
% Environments: & Standard \LaTeX{} environments are supported. \\
% \pkg{theorem}: & Supported, with added \acro{CSS} tags. \\
% \pkg{epigraph}: & Emulated \\
% \pkg{csquotes}: & Supported \\
% \pkg{verse} and \pkg{memoir}'s verse-related macros & Supported \\
% \pkg{picture} and \pkg{tikz}: & Converted to an \acro{SVG} image. \\
% \env{minipage}: & Supported with some \acro{HTML}5-imposed limitations.
% Nested minipages are supported.
% Footnotes appear at the bottom of the \acro{HTML} page. \\
% \pkg{fancyvrb}: & Supported except for verbatim footnotes. \\
% \pkg{alltt}, \pkg{listings}: & Supported \\
% \pkg{algorithmicx}: & Supported \\
% \pkg{mdframed}: & Supported \\
% \pkg{multicol}: & Emulated, with \acro{CSS}3.
% Converted to up to three columns with an optional heading,
% per browser support. Single-column if unsupported.\\
% \midrule
% \pkg{siunitx}: & Supported except for \cmds{per-mode=fraction}. \\
% \pkg{xfrac}: & Supported \\
% \midrule
% Direct formatting: & \cs{emph}, \cs{textsuperscript},
% \cs{textbf}, etc are supported.
% \cs{bfseries}, etc.\ are not yet supported. \\
% Ordinals: & \pkg{nth}, \pkg{fmtcount}, and \pkg{engord} are supported. \\
% Text ligatures: & Ligatures for symbols are supported.
% Ligatures for f, q, t are intentionally turned off
% because many simpler browsers do not display them correctly.
% Modern full-featured browsers re-create these ligatures on-the-fly.\\
% Horizontal space: &
% \acro{HTML} output for thin-unbreakable, unbreakable,
% \cs{enskip}, \cs{quad}, \cs{qquad}, \cs{hspace}. \\
% Rules: & \cs{rule} with width, height, raise, text color. \\
% \pkg{placeins}, \pkg{setspace}, \pkg{needspace}: & Ignored. \\
% \pkg{textpos}: & Emulated. \\
% \pkg{nowidow}: & Ignored. \\
% \pkg{microtype}, \pkg{letterspace}: & Ignored.
% \pkg{microtype} is used to disable ligatures. \\
% \acro{HTML} reserved characters: & \cs{\&}, \cs{textless}, and
% \cs{textgreater} are converted to \acro{HTML} entities. \\
% \midrule
% \pkg{xcolor}: & \textcolor{DarkGreen}{Supported}.
% Full package color names, any color models,
% and \textcolor{Goldenrod}{mixing} is
% converted to hex web colors via \cs{convertcolorspec}.
% Patched commands are
% \textcolor{Maroon}{\cs{textcolor}},
% \colorbox{LightSteelBlue}{\cs{colorbox}},
% and \fcolorbox{red}{NavajoWhite}{\cs{fcolorbox}}.
% \cs{pagecolor} is not supported. \\
% \midrule
% \pkg{CJKutf8}: & Supported \\
% \midrule
% Where: & \\
% \textbf{Supported:} & The existing \LaTeX{} package is used. \\
% \textbf{Emulated:} & The \LaTeX{} package is not used, but some/all of its
% functions are emulated. Null functions, lengths, and counters are provided
% for source compatibility. \\
% \textbf{Ignored:} & The \LaTeX{} package is not used, but null functions
% are provided for source compatibility. \\
% \bottomrule
% \end{longtable}
%
%
% \clearpage
%
% \section{Alternatives}
%
% Summarized below are several other ways to convert a \LaTeX{} or other document to \acro{HTML}.
% Where an existing \LaTeX{} document is to be converted to \acro{HTML}, \pkg{lwarp} may be
% a good choice. For new projects with a large number of documents, it may be worth
% investigating the alternatives before decided which path to take.
%
% \subsection{Internet class}
%
% \changes{v0.21}{2017/02/15}{Docs: Added \protect\texttt{internet} class.}
%
% The closest to \pkg{lwarp} in design principle is the
% \DescribeClass{internet}
% \verb+internet+ class by Andrew Stacey
% (\url{https://github.com/loopspace/latex-to-internet}),
% an interesting project which directly produces several versions
% of markdown, and also \acro{HTML}\ and \acro{EPUB}.
%
%
%
% \subsection{TeX4ht}
%
% \url{http://tug.org/tex4ht/}\DescribeProgram{TeX4ht}
%
% This system uses native \LaTeX{} processing to produce a DVI file containing special commands,
% and then uses additional post-processing for the \acro{HTML} conversion by way of numerous configuration
% files.
% In some cases, \pkg{lwarp} provides a better \acro{HTML} conversion, and it
% supports a different set of packages.
% TeX4ht produces several other forms of output beyond \acro{HTML}.
%
% \subsection{Translators}
%
% \changes{v0.21}{2017/02/14}{Docs: Added TeX2page, GladTeX.}
%
% These systems use external programs to translate a subset of \LaTeX{} syntax into \acro{HTML}.
% Search for each on CTAN (\url{http:\\ctan.org}).
% \begin{description}
% \item [H\textsuperscript{E}v\textsuperscript{E}a:] \url{http://hevea.inria.fr/}
% \DescribeProgram{Hevea} {\footnotesize(not on CTAN)}
% \item [T\textsubscript{T}H:] \url{http://hutchinson.belmont.ma.us/tth/}
% \DescribeProgram{TtH}
% \item [GELLMU:] \url{http://www.albany.edu/~hammond/gellmu/}
% \DescribeProgram{GELLMU}
% \item [\LaTeX{}ML:] \url{http://dlmf.nist.gov/LaTeXML/}
% \DescribeProgram{LaTeXML}
% \item [PlasTeX:] \url{https://github.com/tiarno/plastex}
% \DescribeProgram{Plastex}
% \item [\LaTeX2HTML:] \url{http://www.latex2html.org/}
% \DescribeProgram{LaTeX2HTML} \\
% and \url{http://ctan.org/pkg/latex2html}.
% \item [\TeX2page:] \url{http://ds26gte.github.io/tex2page/index.html} \DescribeProgram{TeX2page}
% \end{description}
% Finally, Glad\TeX\ may used to directly insert \LaTeX\ math into \acro{HTML}:
% \begin{description}
% \item [Glad\TeX:] \url{http://humenda.github.io/GladTeX/} \DescribeProgram{GladTeX}
% \end{description}
%
% \subsection{AsciiDoc}
%
% AsciiDoc is one of the most capable markup languages, providing enough features to produce
% the typical technical-writing document with cross-references,
% and it writes \LaTeX{} and \acro{HTML}.
% \begin{description}
% \item [Asciidoctor:] \url{http://asciidoctor.org/} (More active.)\DescribeProgram{AsciiDoc}
% \item [AsciiDoc:] \url{http://asciidoc.org/} (The original version.)\DescribeProgram{AsciiDoctor}
% \end{description}
%
% The Asciidoctor-LaTeX project is adding additional \LaTeX{}-related features.
% \begin{description}
% \item [Asciidoctor-LateX:] ~ \\
% \url{http://www.noteshare.io/book/asciidoctor-latex-manual} \\
% \url{https://github.com/asciidoctor/asciidoctor-latex}
% \DescribeProgram{Asciidoctor-LaTeX}
% \end{description}
%
% \subsection{Pandoc}
% \DescribeProgram{Pandoc}
%
% A markup system which also reads and writes \LaTeX{} and \acro{HTML}.
% \begin{description}
% \item [Pandoc:] \url{http://pandoc.org/}
% \end{description}
%
% (Watch for improvements in cross-references to figures and tables.)
%
% \subsection{Word Processors}
%
% It should be noted that the popular word processors
% \DescribeProgram{Word}\DescribeProgram{LibreOffice}\DescribeProgram{OpenOffice}
% have advanced through the years in their abilities
% to represent math with a \LaTeX-ish input syntax, unicode math fonts,
% and high-quality output, and also generate HTML with varying success.
% See recent developments in Microsoft\,\textregistered{} Word\,\textregistered{}
% and LibreOffice\,\texttrademark{} Writer.
%
% \subsection{Commercial Systems}
%
% Likewise, several professional systems exist whose
% \DescribeProgram{Adobe} \DescribeProgram{FrameMaker}
% \DescribeProgram{InDesign} \DescribeProgram{Flare} \DescribeProgram{Madcap}
% abilities have been advancing in the areas of typesetting, cross-referencing, and HTML generation.
% See Adobe\,\textregistered{} FrameMaker\,\textregistered{},
% Adobe\,\textregistered{} InDesign\,\textregistered{},
% and Madcap Flare\,\texttrademark{}.
%
% \subsection{Comparisons}
% \index{markup languages}
%
% AsciiDoc, Pandoc, and various other markup languages typically have a syntax which tries to be
% natural and human-readable, but the use of advanced features tends to require
% many combinations of special characters, resulting in a complicated mess of syntax.
% By contrast, \LaTeX{} spells things out in readable words but takes longer to type, although
% integrated editors exist which can provide faster entry and a graphic user interface.
% For those functions which are covered by the typical markup language
% it is arguable that \LaTeX{} is comparably easy to learn, while \LaTeX{} provides many more advanced
% features where needed, along with a large number of pre-existing packages which provide solutions
% to numerous common tasks.
%
% Text-based document-markup systems share some of the advantages of \LaTeX{} vs.\ a typical word
% processor. Documents formats are stable. The documents themselves are portable,
% work well with revision control,
% do not crash or become corrupted, and are easily generated under program control.
% Formatting commands are visible,
% cross-referencing is automatic, and editing is responsive.
% Search/replace with regular expressions provides a powerful tool for
% the manipulation of both document contents and structure.
% Markup systems and some commercial systems allow printed output
% through a \LaTeX{} back end, yielding high-quality results especially when the \LaTeX{}
% template is adjusted, but they lose the ability to use \LaTeX{} macros and
% other \LaTeX{} source-document features.
%
% The effort required to customize the output of each markup system varies.
% For print output, \LaTeX{} configuration
% files are usually used. For HTML output, a \acro{CSS} file will be available, but additional
% configuration may require editing some form of control file with a different syntax, such as XML.
% In the case of \pkg{lwarp}, CSS is used, and much HTML output is adjusted
% through the usual \LaTeX{} optional macro parameters,
% but further customization may require patching \LaTeX{} code.
%
% The popular word processors and professional document systems each has a large
% base of after-market support including pre-designed styles and templates, and often include
% content-management systems for topic reuse.
%
%
%
%
% \clearpage
%
% \section{Installation}
%
% \Cref{tab:utility} shows the tools which are used for
% the \LaTeX\ to \acro{HTML} conversion.
% In most cases, these will be available via the
% standard package-installation tools.
%
% \index{utility>programs}
% \index{programs>utility}
%
% \begin{table}
% \caption{Required software programs\label{tab:utility}}
% \hrule
% \begin{description}
%
% \item[Provided by your \LaTeX\ distribution:] \
%
% From \TeX{}Live: \url{http://tug.org/texlive/}.
%
% \begin{description}
%
% \item[\LaTeX:] |pdflatex|, |xelatex|, or |lualatex|.
% \DescribeProgram[requirement]{pdfLaTeX}
% \DescribeProgram[requirement]{XeLaTeX}
% \DescribeProgram[requirement]{LuaLaTeX}
%
% \item[The \pkg{lwarp} package:] This package.
%
% \item[The \pkg{lwarp-newproject} package:] Accompanies \pkg{lwarp}, and used
% to create configuration files.
%
% \item[The |lwarpmk| utility:] Provided along with this package. This
% should be an operating-system executable in the same way that
% |pdflatex| or |latexmk| is. It is possible to have the
% \pkg{lwarp-newproject} package generate a local copy of |lwarpmk|
% called |lwarpmk.lua|.
% See \cref{sec:genlatexmk}.
%
% \item[luatex:] Used by the |lwarpmk| program to simplify and automate document generation.
%
% \item [xindy:] The \pkg{xindy} package is used by \pkg{lwarp} to create
% indexes. On a MiK\TeX\ system this may have to be acquired separately,
% but it is part of the regular installer as of mid 2015.
%
% \item[latexmk:] Optionally used by |lwarpmk| to compile \LaTeX\ code.
% On a MiK\TeX\ system, Perl may need to be installed first.
%
% \item[pdfcrop:] Used to pull images out of the \LaTeX{} \acro{PDF}.
% \DescribeProgram[requirement]{pdfcrop}
%
% \end{description}
%
% \item[Poppler PDF utilities:] \
%
% These might be provided by your operating-system package manager.
%
% From Poppler: \url{poppler.freedesktop.org}.
%
% For Windows, also see: \\
% \url{https://sourceforge.net/projects/poppler-win32/} \quad and: \\
% \url{http://blog.alivate.com.au/poppler-windows/}
%
% \begin{description}
%
% \item[pdftotext:] Used to convert \acro{PDF} to text.
% \DescribeProgram[requirement]{pdftotext}\index{Poppler}
%
% \item[pdfseparate:] Used to pull images out of the \LaTeX{} \acro{PDF}.
% \DescribeProgram[requirement]{pdfseparate}
%
% \item[pdftocairo:] Used to convert images to \acro{SVG}.
% \DescribeProgram[requirement]{pdftocairo}
%
% \end{description}
%
% \item[Perl:] \
%
% This may be provided by your operating-system package manager, and is
% required for some of the Poppler \acro{PDF} utilities.
%
% \url{perl.org}, \url{strawberryperl.com}
%
% \item[Automatically downloaded from the internet as required:] \
% \begin{description}
%
% \item[MathJax:] Optionally used to display math.
% Automatically loaded from the MathJax website when needed. \\
% From: \url{mathjax.org}
% \DescribeProgram[requirement]{MathJax}
%
% \end{description}
% \end{description}
%
% \hrule
% \end{table}
%
% \subsection{Installing the \protect\pkg{lwarp} package}
%
% There are several ways to install \pkg{lwarp}. These are listed here
% with the preferred methods listed first:
%
% \begin{description}
% \raggedright
%
% \item [Pre-installed:] Try entering into a command line:
% \userentry{kpsewhich lwarp.sty}
%
% If a path to |lwarp.sty| is shown, then \pkg{lwarp} is already installed.
%
% \item [\TeX\ Live:]If using a \TeX\ Live distribution,
% try installing via |tlmgr|:
% \userentry{tlmgr install lwarp}
%
% \item [MiK\TeX:] If using MiK\TeX, try using the package installer.
%
% \item [Operating-system package:] The operating-system package manager may
% already have |lwarp|, perhaps as part of a set of \TeX-related packages.
%
% \item [CTAN TDS archive:] \pkg{lwarp} may be downloaded from the Comprehensive \TeX\ Archive:
% \begin{enumerate}
% \item See \url{http://ctan.org/pkg/lwarp} for the \pkg{lwarp} package.
% \item Download the TDS archive: |lwarp.tds.zip|
% \item Find the \TeX\ |local| directory:
% \begin{description}
% \item[\TeX\ Live:] \
%
% \userentry{kpsewhich -var-value TEXMFLOCAL}
% \item[MiKTeX:] \
%
% In the ``Settings'' window, ``Roots'' tab, look for a local TDS root.
% \end{description}
% This should be something like: \\
% \hspace*{2em}|/usr/local/texlive/texmf-local/|
% \item Unpack the archive in the TDS local directory.
% \item Renew the cache:
% \userentry{mktexlsr} \quad —\,or\,—
% \userentry{texhash}
%
% Or, for Windows MiK\TeX, start the program called |MiKTeX Settings (Admin)|
% and click on the button called \textsf{Refresh FNDB}.
% \end{enumerate}
%
% \item[CTAN \texttt{.dtx} and \texttt{.ins} files:] Another form of \TeX\ package
% is the |.dtx| and |.ins| source files. These files are used to create
% the documentation and |.sty| files.
%
% \begin{enumerate}
% \item See \url{http://ctan.org/pkg/lwarp} for the \pkg{lwarp} package.
% \item Download the zip archive |lwarp.zip| into your own |lwarp| directory.
% \item Unpack |lwarp.zip|.
% \item Locate the contents |lwarp.dtx| and |lwarp.ins|
% \item Create the documentation: \userentry{pdflatex lwarp.dtx} (several times)
% \item Create the |.sty| files: \userentry{pdflatex lwarp.ins}
% \item Copy the |.sty| files somewhere such as the \TeX\ Live local tree
% found in the previous CTAN TDS section, under the subdirectory: \\
% \hspace*{2em}|<texlocal>/tex/latex/local/lwarp|
% \item Copy the documentation |lwarp.pdf| to a |source| directory in the local tree,
% such as: \\
% \hspace*{2em}|<texlocal>/doc/local/lwarp|
% \item Renew the cache:
% \userentry{mktexlsr} \quad —\,or\,—
% \userentry{texhash}
%
% Or, for Windows MiK\TeX, start the program called |MiKTeX Settings (Admin)|
% and click on the button called \textsf{Refresh FNDB}.
%
% \item See \cref{sec:locallwarpmk} to generate your local copy of |lwarpmk|.
% \item Once the local version of |lwarpmk.lua| is installed, it may be made
% available system-wide as per \cref{sec:installlwarpmk}.
% \end{enumerate}
% \item[Project-local CTAN \texttt{.dtx} and \texttt{.ins} files:] The
% |.dtx| and |.ins| files may be downloaded to a project
% directory, then compiled right there, alongside the
% document source files. The resultant |*.sty| and |lwarpmk.lua| files
% may be used as-is, so long as they are in the same directory
% as the document source. This approach is especially useful if
% you would like to temporarily test\margintag{Just testing!}\
% \pkg{lwarp} before deciding whether to permanently install it.
% \end{description}
%
% \subsection{Installing the \protect\texttt{lwarpmk} utility}
% \label{sec:installlwarpmk}
%
% \changes{v0.21}{2017/02/22}{Docs: Installing on Windows.}
%
% {\small
% (Note: If |lwarpmk| is not already installed,
% it is easiest to use a local copy instead of installing it system-wide.
% See \cref{sec:locallwarpmk}.)
% }
%
% After the \pkg{lwarp} package is installed,
% you may need to setup the |lwarpmk| utility:
% \begin{enumerate}
% \item At a command line, try executing |lwarpmk|. If the |lwarpmk| help message
% appears, then |lwarpmk| is already set up.
% If not, it is easiest to generate and use a local copy.
% See \cref{sec:locallwarpmk}.
%
% Otherwise, continue with the following:
%
% \item Locate the file |lwarpmk.lua|, which should be in the |scripts| directory
% of the TDS tree. On a \TeX\ Live or MiK\TeX\ system you may use
% \userentry{kpsewhich lwarpmk.lua}
%
% (If the file is not found, you may also generate a local copy and use it instead.
% See \cref{sec:locallwarpmk}.)
%
% \item Create |lwarpmk|:
% \begin{description}
% \item [Unix:] Create a symbolic link and make it executable:
% \begin{enumerate}
% \item Locate the \TeX\ Live binaries:
% \userentry{kpsewhich -var-value TEXMFROOT} \\
% This will be something like: \\
% \hspace*{2em}|/usr/local/texlive/<year>| \\
% The binaries are then located in the |bin/<arch>| directory
% under the root: \\
% \hspace*{2em}|/usr/local/texlive/<year>/bin/<architecture>/| \\
% In this directory you will find programs
% such as |pdflatex| and |makeindex|.
% \item In the binaries directory,
% create a new symbolic link from the binaries directory to |lwarpmk.lua|:
% \userentry{ln -s <pathtolwarpmk.lua> lwarpmk}
% \item Make the link executable:
% \userentry{chmod 0755 lwarpmk}
% \end{enumerate}
% \item [Windows \TeX\ Live:] Create a new |lwarpmk.exe| file:
% \begin{enumerate}
% \item Locate the \TeX\ Live binaries as shown above for Unix.
% \item In the binaries directory, make a \emph{copy} of |runscript.exe|
% and call it |lwarpmk.exe|
% This will call the copy of |lwarpmk.lua|
% which is in the |scripts| directory of the distribution.
% \end{enumerate}
% \item [Windows MiK\TeX:] Create a new |lwarpmk.bat| file:
% \begin{enumerate}
% \item Locate the binaries. These will be in a directory such as: \\
% \hspace*{2em}|C:\Program Files\MiKTeX 2.9\miktex\bin\x64| \\
% In this directory you will find programs
% such as |pdflatex.exe| and |makeindex.exe|.
% \item Create a new file named |lwarpmk.bat| containing: \\
% \hspace*{1em}
% |texlua "C:\Program Files\MiKTeX 2.9\scripts\lwarp\lwarp.texlua" %*| \\
% This will call the copy of |lwarpmk.lua|
% which is in the |scripts| directory of the distribution.
% \end{enumerate}
% \end{description}
% \end{enumerate}
%
% \subsubsection{Using a local copy of \protect\pkg{lwarpmk}}
% \label{sec:locallwarpmk}
% It is also possible to use a local version of |lwarpmk|:
% \begin{enumerate}
% \item When compiling the tutorial in \cref{sec:tutorial},
% use the |lwarpmk| option for the \pkg{lwarp-newproject} package: \\
% \hspace*{2em}|\usepackage[lwarpmk]{lwarp-newproject}|
% \item When the tutorial is compiled with |pdflatex|, the file |lwarpmk.lua|
% will be generated along with the other configuration files.
% \item |lwarpmk.lua| may be used for this project:
% \begin{description}
% \item[Unix:] \
% \begin{enumerate}
% \item Make |lwarpmk.lua| executable: \userentry{chmod 0755 lwarpmk.lua}
% \item Compile documents with
% \userentry{./lwarpmk.lua html}
% \userentry{./lwarpmk.lua print} \quad etc.
% \item It may be useful to rename or link to a version without the |.lua| suffix.
% \end{enumerate}
% \item[Windows:] \
%
% Compile documents with either of the following, depending
% on which command shell is being used:
% \userentry{texlua lwarpmk.lua html}
% \userentry{texlua lwarpmk.lua print} \quad etc.
%
% Or:
%
% \userentry{lwarpmk html}
% \userentry{lwarpmk print} \quad etc.
% \end{description}
% \end{enumerate}
%
%
% \subsection{Installing additional utilities}
%
% The \TeX\ utilities |latexmk| and |pdfcrop| may be provided by
% the installation of additional \TeX-relatex operating-system packages.
%
% The tools from the \textsc{Poppler} project may also be provided by your
% operating system's package-installation tools.
% For Windows, see \cref{tab:utility} on \cpageref{tab:utility}.
%
% Perl may require installation as well. See \cref{tab:utility}.
%
% \begin{description}
% \item [To test for the existence of the additional utilities:]
% Enter the following in a command line:
% \userentry{luatex --version}
% \userentry{xindy --version}
% \userentry{latexmk --version}
% \userentry{perl --version}
% \userentry{pdfcrop --version}
% \userentry{pdftotext -v}
% \userentry{pdfseparate --version}
% \userentry{pdftocairo -v}
% \end{description}
%
% Any utilities installed by hand must be added to the |PATH|.
%
% \DescribeProgram[requirement]{pdftotext}\index{Poppler}
% \DescribeProgram[requirement]{pdfseparate}
% \DescribeProgram[requirement]{pdftocairo}
% \begin{description}
% \item [To add the Poppler utilities to a Windows machine:] \
% \begin{enumerate}
% \item Download and extract the Poppler utilities |pdftotext|, |pdfseparate|,
% and |pdftocairo| to a directory, such as |Poppler|.
% \item In the Start window, type "Path" to search for results
% related to Path. Or, open the control panel and search for "Path".
% \item Choose "Edit the system environment variables" in the control panel.
% \item Choose the "Environment Variables" button.
% \item Choose the "Path" variable, then the "Edit" button.
% \item Choose the "New" button to make an additional entry.
% \item Enter the |bin| directory of the Poppler utilities, such as: \\
% \hspace*{2em}|C:\Users\<myname>\Desktop\Poppler\poppler-0.5_x86\poppler-0.5\bin|
%
% Be sure to include |\bin|.
% \item Click "Ok" when done.
% \end{enumerate}
% \end{description}
%
% \DescribeProgram[requirement]{perl}\index{Perl}
% \begin{description}
% \item [To add Perl to a Windows machine:] \
% \begin{enumerate}
% \item Download and install a version of Perl, such as Straweberry Perl,
% to a directory without a space in its name, such as |C:\Strawberry|.
% \item Edit the Path as seen above for the Poppler utilities.
% \item Enter the |bin| directory of the Perl utility, such as: \\
% \hspace*{2em}|C:\Strawberry\perl\bin|
%
% Be sure to include |\bin|.
% \item Click "Ok" when done.
% \end{enumerate}
% \end{description}
%
%
%
% \clearpage
%
% \section{Tutorial}
% \label{sec:tutorial}
%
% This section shows an example of how to create an \pkg{lwarp} document.
%
%
% \subsection{Starting a new project}
%
% \changes{v0.21}{2017/02/23}{File \texttt{lwarp\_tutorial.txt} added.}
%
% \begin{enumerate}
%
% \item Create a new project directory called |tutorial|.
%
% \item Inside the |tutorial| directory,
% \DescribeFile{tutorial.tex}
% create a new file called |tutorial.tex|.
% This may be done several ways:
% \begin{description}
% \item [Copy from the documentation PDF:] \
%
% A listing is in \cref{fig:tutorial},
% which may be copied/pasted from the figure directly into your own editor,
% depending on the quality of the \acro{PDF} viewer and editor, or:
%
% \item [Copy from the \pkg{lwarp} documentation directory:] \
%
% Another copy may be found by entering into a command line:
% \DescribeFile{lwarp_tutorial.txt}
% \userentry{texdoc -l lwarp\_tutorial.txt}
% \watchout[Note: |.txt| suffix!]
%
% This should be in the |doc/latex/lwarp/| directory along
% with this \acro{PDF} documentation.
% Copy |lwarp_tutorial.txt| directly into your |tutorial| directory,
% renamed as |tutorial.tex|.
% \end{description}
%
% \emph{When using Windows, use an editor other than Notepad,
% \watchout[Bad Formatting!]
% since Notepad does not accept the end-of-line from a Unix text file.}
%
% \item Compile the project: \userentry{pdflatex tutorial.tex}
% \quad (several times)
%
% (|xelatex| or |lualatex| may be used as well.)
%
% \end{enumerate}
%
%
% A number of new files are created when |tutorial.tex| is compiled, as
% shown in \cref{fig:newprojectfiles}. These files are created by
% the |lwarp-newproject| package.
%
% (Two of the new files are configuration files for the helper program |lwarpmk|.
% Whenever a print version of the document is created while the |lwarp-newproject|
% package is used, the configuration files for |lwarpmk| are updated to
% record the operating system, \LaTeX\ program (|pdflatex|, |xelatex|, or |lualatex|),
% the filenames of the source code and \acro{HTML} output, and whether
% the additional helper program |latexmk| will be used to compile the document.)
%
%
%
% \clearpage
%
% \begingroup
% \captionof{figure}{tutorial.tex listing}
% \label{fig:tutorial}
%
% \begin{center}
% \footnotesize
% \textcolor{red}{Note: There are two pages!}
% \end{center}
%
% \small
%
% \begin{Verbatim}[gobble=2]
%
% % Save this as tutorial.tex for the lwarp package tutorial.
%
% \documentclass{book}
%
% \usepackage{iftex}
%
% % --- LOAD FONT SELECTION AND ENCODING BEFORE LOADING LWARP ---
% \ifPDFTeX
% \usepackage{lmodern} % pdflatex
% \usepackage[T1]{fontenc}
% \usepackage[utf8]{inputenc}
% \else
% \usepackage{fontspec} % XeLaTeX or LuaLaTeX
% \fi
%
% % --- HTML FILENAME AND LATEXMK SETTINGS ---
% % \newcommand{\HomeHTMLFilename}{index} % Filename of the homepage.
% % \newcommand{\HTMLFileName}{node-} % Filename prefix of other pages.
% % \newcommand{\UseLatexmk}{true}% Uncomment to use latexmk
%
% % --- LWARP IS LOADED NEXT ---
% \usepackage{lwarp-newproject} % Possibly with the [lwarpmk] option.
% \usepackage{lwarp}
% % \boolfalse{FileSectionNames} % If false, numbers the files.
%
% % --- OTHER PACKAGES ARE LOADED AFTER LWARP ---
% \usepackage{makeidx} \makeindex
% \usepackage{xcolor}
%
% \usepackage{hyperref,cleveref} % LOAD THESE LAST!
%
% % --- LATEX AND HTML CUSTOMIZATION ---
% \title{The Lwarp Tutorial}
% \author{Some Author}
% \setcounter{tocdepth}{2} % Include subsections in the TOC.
% \setcounter{secnumdepth}{2} % Number down to subsections.
% \setcounter{FileDepth}{1} % Split HTML files at sections
% \booltrue{CombineHigherDepths} % Combine parts/chapters/sections
% \setcounter{SideTOCDepth}{1} % Include subsections in the sideTOC
% \SetFirstPageTop{Name and \fbox{HOMEPAGE LOGO}}
% \SetPageTop{\fbox{LOGO}}
% \SetPageBottom{Contact Information and Copyright}
% \NewCSS{lwarp_sagebrush.css}
%
% \begin{document}
% \maketitle % (or a titlepage environment)
%
% % --- An abstract may be placed here. ---
%
% \tableofcontents \listoffigures % --- MUST BE BEFORE THE FIRST SECTION.
%
% \chapter{First chapter}
%
% \section{A section}
%
% This is some text which is indexed.\index{Some text.}
%
% \subsection{A subsection}
%
% See \cref{fig:withtext}.
%
% \begin{figure}\begin{center}
% \fbox{\textcolor{blue!50!green}{Text in a figure.}}
% \caption{A figure with text\label{fig:withtext}}
% \end{center}\end{figure}
%
% \section{Some math}
%
% Inline math: $r = r_0 + vt - \frac{1}{2}at^2$
% \begin{equation}
% a^2 + b^2 = c^2
% \end{equation}
%
% \printindex
%
% \end{document}
% \end{Verbatim}
% \endgroup
%
%
% \begin{table}
% \caption{Files created in a new project\label{fig:newprojectfiles}}
% \begin{description}
%
% \item [|tutorial.pdf|:] The \acro{PDF} output from \LaTeX.
%
% \item [|tutorial\_html.tex|:] A small |.tex| file used to create
% a parallel \acro{HTML} version of the document, which co-exists with usual
% the \acro{PDF} version, and which will have its
% own auxiliary files. In this way, both \acro{PDF} and \acro{HTML}
% documents may co-exist side-by-side.
%
% \item [Auxiliary files:] The usual \LaTeX\ files |tutorial.aux|, |tutorial.log|.
% When an \acro{HTML} version of the document is created, |_html| versions
% of the auxiliary files will also be generated.
%
% \item [|lwarpmk.conf|:] A configuration file for |lwarpmk|,
% which is used to automate the compilation of \acro{PDF} or \acro{HTML}
% versions of the document.
%
% \item [|tutorial.lwarpmkconf|:] Another configuration file used by |lwarpmk|,
% which is only useful if you wish to have several projects
% residing in the same directory.
%
% \item [|.css files|:] |lwarp.css|, |lwarp_formal.css|, |lwarp_sagebrush.css|
% These files are standard for \pkg{lwarp}, and are not meant to be modified
% by the user.
%
% \item [|sample\_project.css|:] An example of a user-customized \acro{CSS} file,
% which may be used for project-specific changes to the \pkg{lwarp} defaults.
%
% \item [|lwarp\_html.xdy|:] Used by \pkg{lwarp} while creating an index.
% This file should not need to be modified by the user.
%
% \item [|lwarp\_mathjax.txt|:] Inserted into the \acro{HTML} files when
% |MathJax| is used to display math.
% This file should not need to be modified by the user.
%
% \item [|comment.cut|:] A temporary file used by \pkg{lwarp} to
% conditionally process blocks of text. This file may be ignored.
% \end{description}
%
% \hrule \medskip
% \label{sec:genlatexmk}
% When the |lwarpmk| option is given to the \pkg{lwarp-newproject} package:
% \begin{description}
% \item [|lwarpmk.lua|:] A local copy of the |lwarpmk| utility.
%
% On Unix-related operating systems this file must be made executable: \\
% \hspace*{2em} |chmod u+x lwarpmk.lua|
%
% This may be useful to have to archive with a project for future use.
% \end{description}
% \end{table}
%
%
%
% \clearpage
%
% \subsection{Compiling the print version with \texttt{lwarpmk}}
%
% The |lwarpmk| utility program is used to compile either the printed or
% the \acro{HTML} version of the document.
%
% |lwarpmk print| is used to recompile a printed version of the document.
%
% \begin{enumerate}
%
% \item Re-compile the print version: \userentry{lwarpmk print}
%
% |lwarpmk| prints an introduction then checks to see if the document
% must be recompiled. If it seems that the files are up-to-date, then
% |lwarpmk| informs you of that fact and then exits.
%
% \item Make a small change in the original document,
% such as adding a space character.
%
% \item Recompile again. \userentry{lwarpmk print}
%
% The document is recompiled when a change is seen in the source.
% Several compilations may be necessary to resolve cross-references.
%
% \item Force a recompile to occur.
%
% \userentry{lwarpmk again}
% \userentry{lwarpmk print}
%
% |lwarpmk again| updates the date code for the file,
% triggering a recompile the next time the document is made.\footnote{
% Although, when using the utility |latexmk| (introduced later), the changed date is
% ignored and an actual change in contents must occur to cause a recompile.}
%
% \item Process the index.
% \userentry{lwarpmk printindex}
%
% \item Recompile again to include the index.
% \userentry{lwarpmk print}
%
% \end{enumerate}
%
% Note that the \acro{HTML} customization commands are ignored while making the
% print version.
%
%
% \clearpage
%
% \subsection{Compiling the HTML version with \texttt{lwarpmk}}
%
% |lwarpmk html| is used to recompile an \acro{HTML} version of the document.
%
% \begin{enumerate}
% \item Compile the \acro{HTML} version:
% \userentry{lwarpmk html}
%
% \begin{enumerate}
% \item |lwarpmk| uses \LaTeX\ to process |tutorial_html.tex|
% to create \\
% |tutorial_html.pdf|.
% \item |pdftotext| is then used to convert into the file |tutorial_html.html|.
% This file is a plain-text file containing \acro{HTML} tags and
% content for the entire document.
% \item |lwarpmk| manually splits |tutorial_html.html| into
% individual \acro{HTML} files according to the \acro{HTML} settings.
% For this tutorial, the result is |tutorial.html| (the home page),
% along with |First-chapter.html|\footnote{
% \texttt{First-chapter.html}
% also contains the first section, even though the second
% section is its own \acro{HTML} page. This behavior is
% controlled by the boolean \texttt{CombineHigherDepths}.},
% |Some-math.html|, and the document's
% index in |_Index.html|.\footnote{\texttt{index.html} is commonly
% used as a homepage, so the document index is in \texttt{\_Index.html}.}
% \end{enumerate}
%
% \item View the homepage in a web browser.
%
% \qquad Open the file |tutorial.html| in a web browser.
%
% Note that math is still displayed as its plain-text \LaTeX\ source
% \margintag{math}
% until the
% images of the math expressions have not yet been generated. Math may be
% displayed as \acro{SVG} images or by a MathJax script, as seen in
% \cref{sec:tutorialsvgmath,sec:tutorialmathjax}.
%
% \item Force a recompile:
% \userentry{lwarpmk again}
% \userentry{lwarpmk html}
% \userentry{lwarpmk print}
%
% \item Process the \acro{HTML} index and recompile:
% \userentry{lwarpmk htmlindex}
% \userentry{lwarpmk html}
%
% |_Index.html|, is updated for the new \LaTeX\ index.
%
% \item Reload the web page to see the added index.
% \end{enumerate}
%
%
%
% \clearpage
%
% \subsection{Generating the SVG images}
% \label{sec:tutorialsvgmath}
%
% By default \pkg{lwarp} represents math as \acro{SVG} images with
% \margintag{math as \acro{SVG} images}
% the \LaTeX\ source included in |alt| tags. In this way,
% the math displays as it was drawn by \LaTeX, and the \LaTeX\ source
% may be copied and pasted into some other document.
%
% \pkg{lwarp} uses the same mechanism for |picture| and \tikz\ environments.
% \margintag{\env{picture} and \tikz}
%
% \begin{enumerate}
% \item Create the \acro{SVG} images:
% \userentry{lwarpmk limages}
% \userentry{lwarpmk html}
%
% \item Move to the tutorial's math page and reload.
%
% \item The math images are displayed using the same font and formatting
% as the printed version.
%
% \item Copy/paste a math expression into a text editor to see the \LaTeX\ source.
% \end{enumerate}
%
% When a math expression, |picture|, or \tikz\ environment is added or
% \watchout[Adding/removing]
% removed, the \acro{SVG} images must be re-created with |lwarpmk limages|
% to maintain the proper image file sequence numbers.
%
% Expressing math as \acro{SVG} images has the advantage of representing
% the math exactly as \LaTeX\ would, but has the disadvantage of requiring
% an individual file for each math expression.
% \watchout[Lots of files!]
% There is no attempt at
% reusing the same file each time the same expression occurs, so each
% time \$x\$ is used, for example, yet another file is created.
% For a document with a large amount of math,
% see \cref{sec:tutorialmathjax} to use MathJax instead.
%
% \clearpage
%
% \subsection{Using MathJax for math}
% \label{sec:tutorialmathjax}
%
% Math may also be represented using the MathJax Javascript project.
% \margintag{math with MathJax}
%
% \begin{enumerate}
% \item In the tutorial's source code, change \\
% \hspace*{2em} |\usepackage{lwarp}| \\
% \hspace*{3em} to \\
% \hspace*{2em} |\usepackage[mathjax]{lwarp}|
%
% \item Recompile \userentry{lwarpmk html}
%
% \item Reload the math page.
% \end{enumerate}
%
% MathJax requires web access unless a local copy of MathJax is available,
% \watchout[MathJax requirements]
% and it also requires that Javascript is enabled for the web page.
% The math is rendered by MathJax. Right-click on math to see several
% options for rendering, and for copying the \LaTeX\ source.
%
% While using MathJax has many advantages, it may not be able to represent
% complex expressions or spacing adjustments as well as \LaTeX.
%
%
%
% \clearpage
% \subsection{Changing the CSS style}
%
% \DescribeMacro{\NewCSS}
% \cs{NewCSS} may be used to choose which |.css| file is used to display
% each section of the web page. Use \cs{NewCSS} before |\begin{document}|
% to assign the style of the home page.
% If different parts of the website should have different styles,
% call \cs{NewCSS} again before each section heading which creates a new file.
%
% The styles provided by \pkg{lwarp} include:
% \begin{description}
% \item[|lwarp.css|:] A default style if \cs{NewCSS} is not used. This
% style is comparable to a plain \LaTeX\ document.
% To set this style, you may use |\NewCSS{lwarp.css}|, or no \cs{NewCSS} call at all.
% \item[|lwarp\_formal.css|:] A formal style with a serif fonts and a traditional
% look.
% \item[|lwarp\_sagebrush.css|:] A style with muted colors, gradient backgrounds,
% additional borders, and rounded corners.
% \end{description}
%
% To see each style in use, change the \cs{NewCSS} entry in the tutorial
% |lwarpmk html|, and then reload the webpage.
%
% A customized style may also be created.
% \margintag{Custom \acro{CSS}}
% For each new project a file
% called |sample_project.css| is generated. This may be renamed to
% |<project>.css| then used by assigning |\NewCSS{<project>.css|.
%
% Note that |sample_project.css| is overwritten whenever \pkg{lwarp-newproject}
% is loaded in print mode.
% It is therefore important to rename the file \watchout[Rename it!]
% to something like |<project>.css| before
% using it, so that your own changes are not overwritten.
%
% |<project>.css| has an entry which loads |lwarp.css|, and this
% entry may be changed to load |lwarp_formal.css| or |lwarp_sagebrush.css| if
% desired. Additional changes to the \acro{CSS} may be made by making entries
% later in the |<project>.css| file.
%
% \clearpage
%
% \subsection{Customizing the HTML output}
% \label{sec:htmlsettings}
% \index{settings>HTML conversion}
% \index{HTML>conversion settings}
%
% Several settings may be used to customize the \acro{HTML} output.
% Watch for the correct placement of each!\watchout[Placement!]
%
% Note that if changes are made,
% \watchout[Changes!]
% it is best to first use |lwarpmk clearall| to
% clear all the \acro{HTML}, \acro{PDF}, and auxiliary files.
% Also, if \cs{HomeHTMLFilename}, \cs{HTMLFileName}, or \cs{UseLatexmk} are
% changed, it is necessary to reenable the |lwarp-newproject| package and
% then recompile the print version in order to recreate the configuration
% files for |lwarpmk|.
%
% \begin{description}
%
% \item[Placed in the preamble just before \pkg{lwarp} is loaded:] \
%
% \begin{description}
%
% \ItemDescribeMacro{\HomeHTMLFilename} Filename of the homepage, without
% the ``|.html|'' suffix.
% Defaults to the \cs{BaseJobname}. A common setting is: \\
% \hspace*{2em}|\newcommand{HomeHTMLFilename}{index}| \\
% causing the
% homepage to be the file |index.html|. Underscores are allowed in filenames.
%
% \ItemDescribeMacro{\HTMLFileName} A filename prefix for the rest of the \acro{HTML} web pages.
% Useful for numbered web pages with a common prefix. May be empty.
%
% \ItemDescribeMacro{\UseLatexmk} A macro which controls whether
% \pkg{lwarp} uses |latexmk| to
% compile the document. This setting is written to |lwarpmk|'s configuration
% files. Defaults to false. Set to true with: \\
% \hspace*{2em}|\newcommand*{\UseLatexmk}{true}|
%
% \end{description}
%
% \item[Placed in the preamble before \texttt{\cs{begin}\{document\}}:] \
%
% \begin{description}
%
% \ItemDescribeCounter{tocdepth} Sectioning depth of the table of contents.
% See \cref{sec:stackdepths} for a list of \LaTeX{} stack depths.
%
% \ItemDescribeCounter{SideTOCDepth} Sectioning depth of the side\acro{TOC}.
% Defaults to 1, causing the sidetoc to show sections but not subsections.
%
% Each subpage of the website has its own small table of contents
% \margintag{sideTOC}
% on the side (the ``side\acro{TOC}''). Its depth is set by |SideTOCDepth|.
% This side\acro{TOC} is only shown if the web page is wide enough.
% When using a narrow web browser window,
% ``responsive web design'' is used to show the side\acro{TOC} at the top of the
% page and a link back to ``Home'' at the bottom.
%
% \label{sec:filedepth}
% It is recommended to set: \\
% \hspace*{.25in} |SideTOCDepth|\,=\,|FileDepth|, or \\
% \hspace*{.25in} |SideTOCDepth|\,=\,|FileDepth|+1
%
% If |SideTOCDepth|\,<\,|FileDepth|, web pages will be inaccessible via the
% side\acro{TOC}. \watchout
% \index{files>inaccessible}
% \index{pages>inacessible}
% \index{missing sections}
% \index{section>missing}
%
% \ItemDescribeCounter{FileDepth} Sectioning depth of file splits.
% Defaults to -5, causing the entire \acro{HTML} website to be one single file.
% \begin{itemize}
% \item To place the entire file into one \acro{HTML} page, use: \\
% \hspace*{.25in}|\setcounter{FileDepth}{-5}}|
% \item To split the \acro{HTML} file at \cs{section} depth, use: \\
% \hspace*{.25in}|\setcounter{FileDepth}{1}}|
% \item To ensure that the \acro{HTML} pages/files are accessible:
% \watchout\\
% Place a \cs{tableofcontents} somewhere before the first section
% break (therefore in the ``home page''), and set |tocdepth|\,>=\,|FileDepth|.
% \index{files>inaccessible}
% \index{pages>inacessible}
% \index{missing sections}
% \index{section>missing}
% \end{itemize}
%
% \ItemDescribeBoolean{CombineHigherDepths} Combine a higher section with
% its first lower subsections, down to the |FileDepth|.
% Defaults to true. Set to false to simulate the concept of a chapter
% opening on its own page, for example.
%
% The file splits are controlled by the counter |FileDepth| and
% the boolean |CombineHigherDepths|.
% Setting |FileDepth| to 0 splits the file
% at chapters, 1 at sections, etc. |CombineHigherDepths| controls whether
% to combine pages at levels higher than the chosen |FileDepth|, such as
% in this tutorial where the page which opens the chapter also contains the
% first section.
% Be careful to set |tocdepth| and |SideTOCDepth| to allow
% \watchout[Inaccesible pages!]
% access to each page of the website. Set |tocdepth| and |SideTOCDepth| to be
% greater than or equal to |FileDepth|.
%
% When making changes to the file structure,
% \watchout[Lost in an old page!]
% it is possible to end up
% with the web browser pointing to an old file which is no longer in use.
% When this occurs, changes to the web site will not appear in the browser,
% even if reloading the page, because that page is no longer in use.
% It is best to return to the home page, clean the files (|lwarpmk cleanall|),
% change |FileDepth| and/or |CombineHigherDepths|, then finally recompile and
% renavigate to the desired page using the new file structure.
%
% \ItemDescribeBoolean{FileSectionNames} If true, web page filenames are
% derived from a sanitized version of the section names. If false, web pages
% are numbered. Either way, the \cs{HTMLFileName} is prefixed.
%
% Example HTML filenames:
% \changes{v0.20}{2016/09/11}{Docs: Examples for generating HTML file names.}
% \label{sec:filenameexamples}
% \margintag{HTML filenames}
% \index{HTML>filename generation}
% \begin{description}
% \item[Numbered HTML nodes:] \
%
% Example: Homepage |index.html|, and |node-1|, |node-2|.
% (See \cs{SetHTMLFileNumber} to number grouped by chapter, for example.)
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% \newcommand{\HomeHTMLFileName}{index}
% \newcommand{\HTMLFileName}{node-}
% \usepackage{lwarp}
% \boolfalse{FileSectionNames}
% \end{Verbatim}
%
% \item[Named HTML sections, no prefix:] \
%
% Example: |index.html|, and |About.html|, |Products.html|
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% \newcommand{\HomeHTMLFileName}{index}
% \newcommand{\HTMLFileName}{}
% \usepackage{lwarp}
% \booltrue{FileSectionNames}
% \end{Verbatim}
%
% \item[Named HTML sections, with prefix:] \
%
% Example: Homepage |mywebsite.html|, and additional pages such
% as |mywebsite-About.html|, etc.
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% \newcommand{\HomeHTMLFileName}{mywebsite}
% \newcommand{\HTMLFileName}{mywebsite-}
% \usepackage{lwarp}
% \booltrue{FileSectionNames}
% \end{Verbatim}
% \end{description}
%
% \ItemDescribeMacro{\abstractname} The name of the abstract. This may also be over-written
% by the \pkg{babel} package. Defaults to ``Abstract''.
%
% \ItemDescribeMacro{\MetaLanguage} The \acro{HTML} language meta header.
% Defaults to {en-US}.
%
% \ItemDescribeMacro{\SetFirstPageTop} \marg{contents} \quad
% A user-definable custom action applied
% to the top of the home page. Useful for logos, etc.
% Defaults empty.
% Ignored in print output.
%
% \ItemDescribeMacro{\SetPageTop} \marg{contents} \quad
% A user-definable custom action applied to
% the top of pages other than the home page. Useful for logos, etc.
% Defaults empty.
% |\LinkHome| may be used to place a link back to the homepage.
% Ignored in print output.
%
% \ItemDescribeMacro{\SetPageBottom} \marg{contents} \quad
% A user-definable custom action applied to the
% bottom of each web page.
% Useful for authors, copyright notices, contact information, etc.
% Defaults empty.
% |\LinkHome| may be used to place a link back to the homepage.
% Ignored in print output.
%
% \end{description}
%
% \item[Placed in the home page before the first section break:] \
%
% \begin{description}
% \ItemDescribeMacro{\tableofcontents}
% Used to place a table of contents on the home page.
% This command must be used before the first file split, so that a way is
% available to navigate to other files from the homepage.
%
% Links to each chapter/section are provided, as selected by |tocdepth|.
% \end{description}
%
%
% \item[Placed before any sectioning command which causes a file break:] \
%
% \begin{description}
% \ItemDescribeMacro{\NewCSS} \marg{filename.css} \quad
% Sets the \acro{CSS} file to use for the following
% files. May be changed before each each sectioning command which would
% cause a file split.
%
% The \acro{CSS} styles of the web pages are set by the \cs{NewCSS} command.
% If \cs{NewCSS} is not used, a default plain style is used to mimic printed
% \LaTeX\ output. |lwarp_sagebrush.css| is a semi-fancy colored style as shown
% in this tutorial. Change it to |lwarp_formal.css| for a more formal look,
% or comment out the \cs{NewCSS} command to see the default.
% \cs{NewCSS} may be used before each file break to set the \acro{CSS} for
% individual pagess of the website.
%
% \ItemDescribeMacro{\NewHTMLdescription} \marg{description} \quad
% Sets the \acro{HTML} description tag for
% the following files. May be changed before each each sectioning command which would
% cause a file split.
% \end{description}
%
% \needspace{2\baselineskip}
% \item[Placed in the document wherever necessary:] \
%
% \begin{description}
% \ItemDescribeEnv{warpprint} An environment which is only used
% while generating print output. Place here anything which does not
% apply to \acro{HTML} and which may cause problems with \pkg{lwarp}.
% If \pkg{lwarp} knows about and emulates or supports
% a package then its related macros, lengths, counters, etc. probably won't have
% to be placed inside a \env{warpprint} environment, but unknown packages
% may cause problems which may be isolated from \pkg{lwarp} using this environment.
%
% \ItemDescribeEnv{warpHTML} An environment which is only used
% while generating \acro{HTML} output. This is useful for website logos and
% other items which have no purpose in printed output.
%
% \ItemDescribeMacro{\warpprintonly} \marg{contents} \quad
% A macro version of the \env{warpprint} environment.
%
% \ItemDescribeMacro{\warpHTMLonly} \marg{contents} \quad
% A macro version of the \env{warpHTML} environment.
% \end{description}
%
% \end{description}
%
%
% \clearpage
%
% \subsection{Using \texttt{latexmk}}
%
% |latexmk| is a \LaTeX\ utility used to monitor changes in source files
% and recompile as needed.
%
% \begin{enumerate}
% \item In the tutorial's source code, at ``HTML FILENAME AND LATEXMK SETTINGS'',
% insert the line: \\
% \hspace*{2em}|\newcommand{\UseLatexmk}{true}|
%
% \item Directly recompile the printed version of the document.
% \userentry{pdflatex tutorial.tex} \watchout[NOT \texttt{lwarpmk}!] \\
% \hspace*{2em}(Or |xelatex| or |lualatex|)
%
% \begin{sloppy}
% \pkg{lwarp} updates its own configuration files (|lwarpmk.conf| and \newline
% |tutorial.lwarpmkconf|) whenever the printed version of the document
% is compiled. These configuration files remember that |lwarpmk| should
% use |latexmk| to compile the document.
% \end{sloppy}
%
% \item Recompile the document.
% \userentry{lwarpmk print} \quad and/or
% \userentry{lwarpmk html}
% \end{enumerate}
%
% Changes are detected by comparing checksums
% rather than modification times, so |lwarpmk again| will not trigger a
% recompile, but |latexmk| has a much better awareness of changes than
% the |lwarpmk| utility does and it is likely to correctly know when to
% recompile. A recompile may be forced by making a small change to the source.
%
%
% \clearpage
%
% \subsection{Using XeLaTeX or LuaLaTeX}
%
% \XeLaTeX\ or \LuaLaTeX\ may be used instead of \LaTeX.
%
% \begin{enumerate}
%
% \item Remove the auxiliary files for the project:
% \userentry{lwarpmk cleanall}
%
% \item Be sure that \\
% \hspace*{2em} |\usepackage{lwarp-newproject}| \\
% is still enabled in |tutorial.tex|.
%
% \item Use |xelatex| or |lualatex| to recompile the printed version.
% \userentry{xelatex tutorial.tex} \quad -or-
% \userentry{lualatex tutorial.tex}
%
% When the recompile occurs and \pkg{lwarp-newproject} is loaded,
% the configuration files for |lwarpmk| are modified to remember
% which \TeX\ engine was used. \XeLaTeX\ or \LuaLaTeX\ will be used for
% future runs of |lwarpmk|.
%
% \item To recompile the document:
% \userentry{lwarpmk print} \quad -and-
% \userentry{lwarpmk html}
%
% \item Also rememeber to update the indexes and recompile again.
% \end{enumerate}
%
%
% \clearpage
%
% \subsection{Cleaning auxiliary files}
%
% To remove the auxiliary files |.aux|, |.toc|, |.lof|, |.lot|, |.idx|, |.ind|, and
% |.log|:
% \userentry{lwarpmk clean}
%
%
% \subsection{Cleaning auxiliary and output files}
%
% To remove the auxiliary files, and also remove the |.pdf| and |.html| files:
% \userentry{lwarpmk cleanall}
%
%
% \subsection{Processing multiple projects in the same directory}
%
% It is possible to have several projects in the same directory.
% |lwarpmk| has an optional parameter which is the document to compile.
%
% To create each project:
% \userentry{pdflatex project\_a}
% \userentry{pdflatex project\_b}
%
% Each project is given its own configuration file: \\
% \hspace*{2em}|project_a.lwarpmkconf|, |project_b.lwarpmkconf|
%
% To compile each project with |lwarkmk|:
% \userentry{lwarpmk print project\_a}
% \userentry{lwarpmk html project\_b}
%
%
% \subsection{Using the \texttt{make} utility}
%
% |lwarpmk| has an action which may be useful for integration with the
% common |make| utility:\\
% \hspace*{2em}|lwarpmk pdftohtml [project]|
%
% |make| may be used to compile the code to \acro{PDF} with \acro{HTML}
% tags (|project_html.pdf|), then |lwarpmk| may be used to
% convert each target to \acro{HTML} files.
%
%
% \clearpage
%
% \section{Additional details}
%
% \label{sec:usage}
%
%
%
% \subsection{Font and UTF-8 support}
% \label{sec:fonts}
% \index{font>selection}
% \index{Unicode>selection}
% \index{UTF-8>selection}
% \changes{v0.16}{2016/04/08}{Docs: Font and UTF-8 support.}
% \changes{v0.16}{2016/04/08}{Lwarp no longer selects fonts.}
%
% \pkg{lwarp} uses |pdftotext| to convert \acro{PDF} output into UTF-8-encoded
% text. This process requires that UTF-8 information be embedded in the \acro{PDF}
% file, which usually prevents the use of bit-mapped fonts.
% \index{font>bitmapped}
%
% While using |pdflatex|, if no font-related package is specified, the default
% \margintag{vector fonts}
% bit-mapped Computer Modern font is used,
% \margintag{Computer Modern}%
% \index{font>Computer Modern}\index{Computer Modern}%
% \watchout%
% so simply add \\
% \hspace*{.25in}|usepackage{lmodern}| \\
% to the preamble to enable the related vector font instead, or use\\
% \hspace*{.25in}|\usepackage{dejavu}|
%
% \index{Deja Vu}%
% \index{font>Deja Vu}%
% \index{Unicode>enhanced coverage}%
% \index{UTF-8>enhanced coverage}%
% or other other font packages, which may provide an increased coverage of Unicode mappings.
% Avoid bit-mapped fonts.
%
% \XeLaTeX{} and \LuaLaTeX{} users must use the \pkg{fontspec} package.
% \watchout
% Do NOT use \pkg{fontenc}!
%
% Place \pkg{fontspec} or \pkg{fontenc} and other font and UTF-8 related commands
% after the |\documentclass| command and before |\usepackage{lwarp}|:
%
% \begin{enumerate}
% \item |documentclass{article/book/report}| goes here, followed by any of:
% \item Font and UTF-8 related commands:
% \begin{itemize}
% \item For \XeLaTeX{} or \LuaLaTeX:
% \begin{itemize}
% \item \pkg{fontspec} and font choices
% \DescribePackage{fontspec}
%
% \medskip
% \pkg{lwarp} sets the following to turn off \TeX{} ligatures during
% \margintag{ligatures}
% the generation of \acro{HTML} tags, and turn off common ligatures
% in regular text, since older browsers may not display them correctly
% and newer browsers can automatically re-create them.
% \index{ligatures}\index{font>ligatures}
% \vspace{-1ex}
% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines]
% \defaultfontfeatures[\rmfamily]{Ligatures={NoCommon,TeX}}
% \defaultfontfeatures[\sffamily]{Ligatures={NoCommon,TeX}}
% \defaultfontfeatures[\ttfamily]{Ligatures=NoCommon}
% \end{Verbatim}
% \end{itemize}
% \item For |pdflatex|:
% \begin{itemize}
% \item \pkg{lmodern} or other font-related packages
% \DescribePackage{lmodern}
% \index{font>packages}
% \item \pkg{fontenc}
% \DescribePackage{fontenc}
% \item \pkg{inputenc}
% \DescribePackage{inputenc}
% \item \pkg{newunicodechar}
% \DescribePackage{newunicodechar}
% \item |\input glyphtounicode.tex|
% \DescribeFile{glyphtounicode}
% \item |\input glyphtounicode-cmr.tex% from the pdfx package|
% \item |\pdfgentounicode=1|
% \item \pkg{cmap}
% \DescribePackage{cmap}
% \item \pkg{textcomp}
% \DescribePackage{textcomp}
% \item \pkg{microtype} is automatically used by \pkg{lwarp}
% \DescribePackage{microtype}
% to turn off f,q,t,T,Q ligatures for the same
% \margintag{ligatures}
% browser-related reasons shown above. Also, the monospaced font is used
% during \acro{HTML} tag generation to turn off \TeX{} ligatures.
% \index{ligatures}\index{font>ligatures}
% \end{itemize}
% \end{itemize}
% \item |\usepackage{lwarp}| (\cref{sec:loading}) goes after any of the above, followed by:
% \item \ldots{} the rest of the preamble and the main document.
% \end{enumerate}
%
% \subsection{\protect\pkg{lwarp} package loading and options}
% \label{sec:loading}
% \index{settings>lwarp package options}
%
% \pkg{lwarp} supports |book|, |report|, and |article| classes.
%
% Load the \pkg{lwarp} package immediately after the font and UTF-8 setup commands.
% \changes{v0.16}{2016/04/08}{Docs: Moved location of \cs{usepackage\{lwarp\}}.}
% \changes{v0.19}{2016/05/25}{Docs: Math options.}
% \DescribePackage{lwarp}
% \index{lwarp>loading}\index{lwarp>options}
%
% \DescribeOption[lwarp]{warpprint}
% \DescribeOption[lwarp]{warpHTML}
% Select the |warpprint| option to generate print output (default),
% or the |warpHTML| option to generate \htmlfive{} output.
% The default is print output, so the print version may be
% compiled with the usual |pdflatex|, etc.
% When \pkg{lwarp-newproject} is loaded in print mode, it creates
% |<project>_html.tex|, which sets the |warpHTML| option before calling
% the user's source code |<project>.tex|. In this way, |<project>.tex|
% can |\usepackage{lwarp}| without any options to create a printed version,
% while |<project>_html.tex| will create an HTML version.
%
% \DescribeOption[lwarp]{mathsvg}
% \DescribeOption[lwarp]{mathjax}
% For math display, select |mathsvg| (default), or |mathjax|.
% For more information about the math options, see \cref{sec:limitsmath}.
%
%
% \subsection{Selecting the operating system}
% \label{sec:OSportabilityusage}
% \changes{v0.11}{2016/03/11}{Added section: Selecting the operating system.}
%
% \osportabilityusage
%
%
% \subsection{Selecting actions for print or HTML output}
% \label{sec:selectingoutput}
% \index{settings>selecting output}
% \changes{v0.15}{2016/04/05}{Docs: Clarify print/HTML output.}
%
% The following environments and macros are used to select actions which only apply
% to either traditional \LaTeX{} print-formatted PDF generation,
% or to \acro{HTML} generation.
%
% For most of built-in \LaTeX\ and many additional packages
% there is user-level source code support or emulation,
% so no special handling will be required.
% For those cases which \pkg{lwarp} does not handle by itself, the
% following environments and macros may be used to isolate sections
% of code for print-only or \acro{HTML}-only.
%
% These environments are also useful for creating a special version of
% the titlepage for print and another for \acro{HTML}.
% \DescribeEnv{warpHTML}
% Anything which is to be done only for \htmlfive{} output
% is surrounded by a |warpHTML| environment:
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% \begin{warpHTML}
% ... something to be done only during HTML generation
% \end{warpHTML}
% \end{Verbatim}
%
% \DescribeEnv{warpprint}
% Anything which is to be done only for print output
% is surrounded by a |warpprint| environment:
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% \begin{warpprint}
% ... something to be done only during traditional PDF generation
% \end{warpprint}
% \end{Verbatim}
%
% \DescribeEnv{warpall}
% Anything which is to be done for any output
% may be surrounded by a |warpall| environment. Doing so is optional.
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% \begin{warpall}
% ... something to be done during print PDF or HTML output
% \end{warpall}
% \end{Verbatim}
%
%
% Macros are also provided for print-only or \acro{HTML}-only code:
%
% \DescribeMacro{\warpprintonly} \marg{actions}
%
% Performs the given actions only when print output is being generated.
%
% \DescribeMacro{\warpHTMLonly} \marg{actions}
%
% Performs the given actions only when \acro{HTML} output is being generated.
%
%
%
% \subsection{Commands to be placed into the \env{warpprint} environment}
% \label{sec:printcommands}
%
% \changes{v0.14}{2016/03/26}{Docs: Commands into a warpprint environment.}
%
% Certain print-related commands should always be placed
% inside a \env{warpprint} environment, or may need other special handling.
% These are unrelated to \acro{HTML} output, but are hard to isolate automatically.
% For example:
%
% \begin{itemize}
% \item Paragraph formatting: \cs{parindent} \cs{parskip}
% \item Variable spaces such as \cs{vspace}. \cs{hfill} is turned into a \cs{quad}.
% Fixed spaces such as \cs{quad} are emulated correctly.
% \item Manual page positions such as the \pkg{textpos} package, which is
% emulated but only in a limited way.
% \end{itemize}
%
% Some packages require additional setup commands. Where these packages are emulated
% for \acro{HTML}, setup commands may work for the emulated \acro{HTML} output as well as for print
% output. See the details for each package in this document for more information.
%
% Also see \cref{sec:troubleshooting}: \nameref{sec:troubleshooting}.
%
%
% \subsection{Commands for a successful HTML conversion}
% \label{sec:successfulcommands}
% \index{HTML>commands for a successful conversion}
%
% \changes{v0.14}{2016/03/26}{Docs: Commands for a successful HTML conversion.}
%
% Some commonly-used \LaTeX{} expressions should be modified to allow
% for a smooth conversion to both \acro{HTML} and print-formatted outputs:
%
% \begin{description}
% \item [\cs{bfseries}, etc:] Use \cs{textbf} instead.
% \item [\cs{centering}, \cs{raggedright}, \cs{raggedleft}:] ~
%
% Use the environments \env{center}, \env{flushright}, \env{flushleft} instead.
%
% \item [Superscripts and other non-math uses of math mode:] ~
%
% Use \cs{textsuperscript\{x\}} instead of |$^{x}$|
%
% \item [Empty \cs{item} followed by a new line of text or a nested list:] \
%
% Use a trailing backslash: |\item[label] \|
% \index{item, list, empty}\index{list item, empty}
%
% \item [\cs{fbox} around a minipage:] ~
%
% \cs{fbox} can only be used around inline items during
% \acro{HTML} output.
%
% For an \cs{fbox} around a minipage, you may:
% \index{fbox>around a minipage}
% \index{minipage>in an \cs{fbox}}
% \begin{itemize}
% \item Place the \cs{fbox} command and
% its closing brace inside \env{warpprint} environments.
% \item Use \cs{mdframed} instead.
% ^^A \item Use the \env{example} or \env{sidebar} environments.
% \item Use a custom environment to create a sidebar,
% containing a \env{BlockClass} environment
% with custom \acro{CSS} formatting,
% and |\warpprintonly{\hrule}| command:
% \begin{Verbatim}[gobble=2,frame=lines]
% \begin{BlockClass}{frameminipage}% ignored in print output
% % use CSS to format div class ``framedminipage''
% \warpprintonly{\hrule} % only appears in print output
% Contents
% \warpprintonly{\hrule} % only appears in print output
% \end{BlockClass}
% \end{Verbatim}
% \end{itemize}
% \end{description}
%
% Also see \cref{sec:troubleshooting}: \nameref{sec:troubleshooting}.
%
%
%
%
% \subsection{Title page}
% \label{sec:settitle}
% \index{settings>title page}
%
% In the preamble, place an additional block of code to set the following:
% \vspace{-2em}
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% \title{Document Title} % One line only
% \subtitle{Optional Document Subtitle \\ with optional multiple lines}
% \author{Author One\affiliation{Affiliation One} \and
% Author Two\affiliation{Affiliation Two} }
% \date{Optional date}
% \published{Optional Journal Name \\ Optional multiple lines}
% \end{Verbatim}
%
% The title is used in the meta tags in the \acro{HTML} files, and the rest are used
% in |\maketitle|.
%
%
% \DescribeMacro{\maketitle}
% Use |\maketitle| just after the |\begin{document}|, as this will establish
% the title of the homepage. Optionally, use a |titlepage| environment instead.
%
% \DescribeEnv{titlepage}
% The \env{titlepage} environment may be used to hold a custom title page.
% The titlepage will be set in a div class |titlepage|, and \cs{printtitle}, etc.\ may be used
% inside this environment.
%
% \DescribeEnv{titlingpage}
% Another form of custom title page, where \cs{maketitle} is allowed, and
% additional information may be included as well.
%
% \DescribeMacro{\title} \marg{title}
% Avoid newlines in the |\title|; these will interfere with the
% file break and \acro{CSS} detection.
% \watchout
% Use the |\subtitle| command instead.
% In \acro{HTML}, the title will appear in a heading ``h1''.
%
% \DescribeMacro{\author} \marg{author}
%
% In |\author|, use |\protect| before formatting commands such as |\textsc|.
% \watchout
% In \acro{HTML}, the author will appear in a div class |author|.
% \cs{affiliation} is a new addition to \pkg{lwarp}.
%
% \DescribeMacro{\date} \marg{date}
%
% |\date| works as expected.
% In \acro{HTML}, this will appear in a div class ``titledate''.
%
% \DescribeMacro{\subtitle} \marg{subtitle}
%
% A new command which sets a subtitle. Newlines are allowed.
% The default is empty.
% In \acro{HTML}, this will appear in a div class ``subtitle''.
%
% \DescribeMacro{\published} \marg{published}
%
% A new command which sets a publisher.
% The default is empty.
% In \acro{HTML}, this will appear in a div class ``published''.
%
%
% \DescribeMacro{\thanks} \marg{text}
%
% \cs{thanks} are allowed in the titlepage fields, and will be rendered
% as \acro{HTML} notes at the bottom of the title page.
%
%
% \subsection{HTML page meta descriptions}
%
% \label{sec:htmldescription}
% \index{HTML>meta tag>description}
% \index{description>HTML meta tag}
% \index{meta tag, HTML>description}
% \DescribeMacro{\NewHTMLdescription} \marg{A description of the web page.}
% \quad The default is no description.
%
% Each page of \acro{HTML} output should have its own \acro{HTML} meta description,
% which usually shows up in web search results,
% \margintag{limitations}
% is limited to around
% 150 characters in length, and should not include the \acro{ASCII} double quote character (").
%
% Use \cs{NewHTMLdescription}
% \margintag{placement}
% just before |\begin{document}| to set the description of the home page,
% and also just before each sectioning command such as \cs{chapter} or \cs{section}
% where a new file will be generated, depending on |FileDepth|. For example, if |FileDepth| is 1,
% use \cs{NewHTMLdescription} just before each \cs{section} command, and that description will be
% placed inside the \acro{HTML} page for that \cs{section}. The same descrition will be used for
% all following \acro{HTML} files as well, until reset by a new \cs{NewHTMLdescription}. It is best
% to use a unique description for each \acro{HTML} file.
%
% To disable the generation of \acro{HTML} description meta tags,
% \margintag{disabling}
% use:\\
% \hspace*{1em} |\NewCSSdescription{}|
%
%
% \subsection{CSS}
%
% \label{sec:projectcss}
% \DescribeFile{lwarp.css}\DescribeFile{project.css}\DescribeFile{sample_project.css}\label{sec:lwarpcss}It is best
% to make a local project-specific \acro{CSS} file such as |project.css|, containing only
% things which are different from |lwarp.css|.
% |project.css| should refer to |lwarp.css| as follows:
% \index{CSS>project-specific changes}\index{CSS>lwarp.css}
% \index{settings>\acro{CSS} project-specific}
% \vspace{-2ex}
% \VerbatimInput[frame=lines]{sample_project.css}
%
% An example file called |sample_project.css| is provided, and may be renamed |project.css|.
%
% \label{sec:setcss}
%
% \DescribeMacro{\NewCSS}
% For each section at which \acro{HTML} files are split,
% |\NewCSS| may be used before the sectioning command to select a \acro{CSS} file for that and all
% following sections. This may be changed numerous times throughout the file, resulting in
% different \acro{HTML} pages having different \acro{CSS} files assigned.
% \index{CSS>file selection}
% \index{CSS>per HTML page}
% \index{settings>CSS selection}
%
%
%
% \subsection{Special cases and limitations}
% \label{sec:limitations}
%
% \subsubsection{Text formatting}
%
% \limitstext
%
%
% \subsubsection{Verse and Memoir packages}
%
% \limitsverse
%
%
% \subsubsection{Math}
% \label{sec:limitsmath}
%
% \limitsmath
%
% For an example of using custom \LaTeX\ macros with MathJax,
% \margintag{custom MathJax macros}
% see page \pageref{ex:mathjaxmacros}.
%
%
% \subsubsection{Graphics}
%
% \limitsgraphics
%
%
% \subsubsection{Xcolor}
%
% \limitsxcolor
%
%
% \subsubsection{\tikz}
%
% \limitstikz
%
% See \cref{sec:tikz}.
%
%
% \subsubsection{Tabular}
%
% \limitstabular
%
%
% \subsubsection{Minipages}
%
% \limitsminipage
%
% \subsubsection{Mdframed}
%
% \limitsmdframed
%
% \subsubsection{\pkg{float}, \pkg{trivfloat}, and/or \pkg{algorithmicx} together}
%
% \limitscombiningfloats
%
%
% \subsubsection{\pkg{caption} and \pkg{subcaption} packages}
%
% \limitscaption
%
%
% ^^A \subsubsection{\pkg{subfig} package}
%
% ^^A \limitssubfig
%
%
% \subsubsection{\pkg{floatrow} package}
%
% \limitsfloatrow
%
%
% \subsubsection{\pkg{siunitx} package}
%
% \DescribePackage{siunitx}
% \limitssiunitx
%
%
% \subsubsection{\pkg{newclude} package}
%
% \changes{v0.14}{2016/03/29}{Docs: Newclude limitations.}
%
% \DescribePackage{newclude}
% \limitsnewclude
%
%
% \subsubsection{\pkg{newtxmath} package}
%
% \DescribePackage{newtxmath}
% \limitsnewtxmath
%
%
% \subsubsection{\pkg{babel} package}
%
% \DescribePackage{babel}
% \limitsbabelone
%
% \limitsbabeltwo
%
%
% \subsubsection{\pkg{enumitem} package}
%
% \DescribePackage{enumitem}
% \limitsenumitem
%
%
%
%
% \section{Expanding the code base}
% \pagestyle{pageheadfoot}
%
% Purely text-based packages probably will work as-is when generating
% \acro{HTML}.
%
% Look to existing code for ideas on how to expand into new code.
%
% An environment may be converted to a |lateximage| then displayed
% with an image of the resulting \LaTeX{} output.
% See \cref{sec:picture} for an example of the |picture| environment.
%
% To create a custom \acro{HTML} block or inline \acro{CSS} class,
% see \cref{sec:highlevelclasses}.
%
% \subsection{Creating an lwarp version of a package}
%
% When creating \acro{HTML},
% \pkg{lwarp} redefines the \cs{usepackage} and \cs{RequirePackage}
% macros such that it first looks to see if a |lwarp-<packagename>.sty|
% version exists. If so, the \pkg{lwarp} version is used instead.
% This modular system allows the users to create their own
% versions of packages for \pkg{lwarp} to use for \acro{HTML}, simply by creating
% a new package with a |lwarp-| prefix. If placed in the local
% directory along with the source code, it will be seen by that project
% alone. If placed alongside the other |lwarp-| packages where \TeX\
% can see it, then the user's new package will be seen by any documents
% using \pkg{lwarp}.
%
% An |lwarp-<packagename>.sty| package is only used during \acro{HTML}
% generation. Its purpose is to pretend to be the original package,
% while modify anything necessary to create a successful \acro{HTML} conversion.
% For many packages it is sufficient to simply provide nullified macros,
% lengths, counters, etc. for anything which the original package does,
% while passing the raw text on to be typeset. See the pre-existing
% |lwarp-| packages for examples.
%
% Note that anything the user might expect of the original package
% must be replaced or emulated by the new |lwarp-| package, including
% package options, user-adjustable counters, lengths, and booleans, and
% conditional behaviors.
%
% Each |lwarp-| package should first call either \cs{LWR@ProvidesPackageDrop}
% or \cs{LWR@ProvidesPackagePass}. If dropped, the original print-version
% package is ignored, and only the |lwarp-| version is used.
% Use this where the original print version is useless for \acro{HTML}.
% If passed, the original package is loaded first, with the supplied options, then
% the |lwarp-| version continues loading as well. Use this when \acro{HTML}
% output only requires some modifications of the original package.
% For a case where the original package is usable as-is, there is no
% need to create a |lwarp-| version.
%
%
%
%
%
% \section{Troubleshooting}
% \label{sec:troubleshooting}
% \index{FAQ}\index{Frequently Asked Questions}\index{bugs}
% \index{troubleshooting}\index{problems}\index{error messages}
% \index{debugging}
%
% \subsection{Using the \protect\texttt{lwarp.sty} package}
%
% Also see: \\
% \Cref{sec:successfulcommands}: \nameref{sec:successfulcommands} \\
% \Cref{sec:printcommands}: \nameref{sec:printcommands} \\
% \Cref{sec:limitations}: \nameref{sec:limitations}
%
% \changes{v0.14}{2016/03/26}{Docs: Troubleshooting cross-references.}
% \changes{v0.16}{2016/04/08}{Docs: Text not converting.}
%
% \begin{description}
%
% \item [Text is not converting:] ~
% \begin{itemize}
% \item Font-related UTF-8 information must be embedded in the \acro{PDF} file.
% See \cref{sec:fonts} regarding vector fonts.
% \end{itemize}
%
% \item [Undefined HTML settings:] \
% \item See the warning regarding the placement of the \acro{HTML} settings
% at \cref{sec:htmlsettings}.
%
% \item [Obscure error messages:] ~
% \begin{itemize}
% \item Be sure that a print version of the document compiles and
% that your document's \LaTeX{} code is correct, before attempting
% to generate an \acro{HTML} version.
% \end{itemize}
%
% \item [Missing sections:] ~
% \begin{itemize}
% \item See \cref{sec:filedepth} regarding the
% |FileDepth| and |SideTOCDepth| counters,
% and the use of \cs{tableofcontents} in the home page.
% \end{itemize}
%
% \item [Missing HTML files:] \
% \item See the warning regarding changes to the \acro{HTML} settings
% at \cref{sec:htmlsettings}.
%
% \item [Missing / incorrect cross-references:] ~
% \index{cross-references>missing or incorrect}
% \begin{itemize}
% \item Use |lwarpmk again| followed
% by |lwarpmk html| or |lwarpmk print| to compile the document one more time.
% \end{itemize}
%
% \item [Em-dashes or En-dashes in listing captions and titles:] \
%
% Use \XeLaTeX\ or \LuaLaTeX.
%
% \item [Floats out of sequence:] ~
% \begin{description}
% \item [Mixed ``Here'' and floating:] Floats [H]ere and regular floats may
% become out of order. \cs{clearpage} if necessary.
% \item [Caption setup:] With \cs{captionsetup} set the positions for
% the captions |above| or |below| to match their use in the source code.
% \end{description}
%
% \item [Print document contains HTML tags:] ~
% \begin{itemize}
% \item Be sure that the document
% selects |\usepackage[warpprint]{lwarp}| instead of |[warpHTML]|.
% \end{itemize}
% \item [HTML document contains a single unformatted print
% document:] ~
% \begin{itemize}
% \item Be sure that the document
% selects |\usepackage[warpHTML]{lwarp}| instead of |[warpprint]|.
% \end{itemize}
%
% \item [Images are appearing in strange places:] ~
% \index{images>in strange places}
% \begin{itemize}
% \item |lwarpmk limages| to refresh the |lateximage| images.
% \end{itemize}
%
% \item [``Leaders not followed by proper glue'':] This can be caused by
% a missing |l@<floattype>| or |l@<sectiontype>| definition.
% See \pkg{lwarp}'s definitions for examples.
%
% \item [Plain-looking document:] ~
% \begin{itemize}
% \item The document's \acro{CSS} stylesheet may not be available, or may be
% linked incorrectly. Verify any \cs{NewCSS} statements point to
% a valid \acro{CSS} file.
% \end{itemize}
%
% \item [Broken fragments of HTML:] ~
% \begin{itemize}
% \item Check the \acro{PDF} file used to create \acro{HTML}
% to see if the tags overflowed the margin.
% (This is why such large page size and margins are used.)
% \end{itemize}
%
% \item [Changes do not seem to be taking effect:] ~
% \begin{itemize}
% \item Be sure to |lwarpmk clean|, recompile, then start by reloading the home page.
% You may have been looking at an older version of the document.
% If you changed a section name, you may have been looking at
% the file for the old name.
% \item See the warning regarding changes to the \acro{HTML} settings
% at \cref{sec:htmlsettings}.
% \item Verify that the proper \acro{CSS} is actually being used.
% \item The browser may compensate for some subtle changes, such as
% automatically generating ligatures, reflowing text, etc.
% \end{itemize}
%
% \item [Un-matched conditional compiles:] ~
% \begin{itemize}
% \item Verify the proper |begin|/|end| of |warpprint|, |warpHTML|, and |warpall| environments.
% \end{itemize}
%
% \end{description}
%
%
% \subsubsection{Debug tracing output}
%
% \DescribeMacro{\tracinglwarp}
% When \cs{tracinglwarp} is used, \pkg{lwarp} will add extra
% tracing messages to the |.log| file. The last several messages
% may help track down errors.
%
% Place \cs{tracinglwarp} just after |\usepackage{lwarp}| to
% activate tracing.
%
%
%
%
% \subsection{Compiling the \protect\texttt{lwarp.dtx} file}
%
% \begin{description}
% \item [Illogical error messages caused by an out-of-sync |lwarp.sty| file:] ~
% \begin{enumerate}
% \item Delete the |lwarp.sty| file.
% \item |pdflatex lwarp.ins| to generate a new |lwarp.sty| file.
% \item |pdflatex lwarp.dtx| to recompile the |lwarp.pdf| documentation.
% \end{enumerate}
%
% \item [Un-nested environments:]~
%
% Be sure to properly nest:
% \begin{itemize}
% \item |\begin{macrocode}| and |\end{macrocode}|
% \item |\begin{macro}| and |\end{macro}|
% \item |\begin{environment}| and |\end{environment}|
% \end{itemize}
% \end{description}
%
%
%
%
% \StopEventually{\PrintChanges\PrintIndex}
%
%
%
%
% \section{Implementation}
%
%
% This package is perhaps best described as a large collection of smaller
% individual technical challenges,
% in many cases solved through a number of \sout{crude hacks} clever tricks.
% Reference sources are
% given for many of the solutions, and a quick internet search will provide
% additional possibilities.
%
% Judgement calls were made, and are often commented. Improvements are possible.
% The author is open to ideas and suggestions.
%
% Packages were patched for re-use where they provided significant functionality.
% Examples include \pkg{xcolor} with its color models and conversion to \acro{HTML}
% color output, and \pkg{siunitx} which provides many number and unit-formatting
% options, almost all of which are available in pure-text form, and thus
% easily used by \cmds{pdftotext}.
%
% Packages were emulated where their primary purpose was visual formatting which is not
% relevent to \acro{HTML} output. For example, packages related to sectioning
% are already patched by numerous other packages, creating a difficult number of
% combinations to try to support, and yet in \acro{HTML} output all of the
% formatting is thrown away, so these packages are merely emulated.
%
% Packages with graphical output are allowed as-is, but must be nested inside a
% \env{lateximage} environment to preserve the graphics.
%
% There is still room to improve the factoring of the code, and doing so will become
% important if support for other output formats is added. Rather than wait until the
% code is pristine, the author felt it best to publish early and accept input before
% pushing on towards a perhaps less-than-ideal solution.
%
%
% Testing has primarily been done with the Iceweasel/Firefox browser.
%
%
% \section{Stack depths}
% \label{sec:stackdepths}
% \index{HTML>headings}
% \index{section>depths}\index{stack depths}
%
% Stacks are created to track depth inside the \LaTeX{} document structure.
% This depth is translated to \acro{HTML} headings as shown
% in \cref{tab:depthsheadings}.
% ``Depth'' here is not
% depth in the traditional computer-science stack-usage sense, but rather a
% representation of the nesting depth inside the \LaTeX{} document structure.
%
% When starting a new section, the program first must close out any existing
% sections and lists of a deeper level to keep the \acro{HTML} tags nested correctly.
%
% \begin{table}
% \caption{Section depths and HTML headings\label{tab:depthsheadings}}
% \begin{tabular}{lcl}
% \toprule
% Section & \parbox[c]{.35in}{\LaTeX{} depth} & \acro{HTML} headings \\
% \midrule
% title of the entire website & & h1 \\
% none & -5 & new for this package \\
% book & -2 & \textbf{not yet used} \\
% part & -1 & h2 \\
% chapter & 0 & h3 \\
% section & 1 & h4 \\
% subsection & 2 & h5 \\
% subsubsection & 3 & h6 \\
% paragraph & 4 & span class = "paragraph" \\
% subparagraph & 5 & span class = "subparagraph" \\
% listitem & 7 & new for this package, used for list items \\
% \bottomrule
% \end{tabular}
% \end{table}
%
% Support for the \pkg{memoir} package will require the addition of a \cmds{book}
% level, which will push the \acro{HTML} headings down a step, and also cause \cmds{subsubsection}
% to become a \cmds{div} due to a limit of six \acro{HTML} headings.
%
% It is possible to use \htmlfive{} \cmds{section} and \cmds{H1} for all levels,
% but this may not be well-recognized by older browsers.
%
% \clearpage
%
%
%
% \section{Source Code}
% This is where the documented source code for \pkg{lwarp} begins,
% continuing through the following sections all the way to the
% change log and index at the end of this document.
%
% \index{numbers>left margin}\index{line numbers}
% \index{margin>numbers}\index{margin>tags}
% \documentationnotes
% \index{warning icon}\index{danger icon}\index{icon>warning}
% \index{for>HTML output}\index{for>PRINT output}\index{for>HTML \& PRINT}
% \changes{v0.15}{2016/04/05}{Docs: Added warning icons for items needing
% special attention.}
%
% \vfill
%
% \begin{center}
% \pkg{lwarp} source code begins on the following page.
% \end{center}
%
%
%
% \clearpage
%
%
%
% \section{Detecting the \TeX\ Engine — pdflatex, lualatex, xelatex}
%
% \begin{macrocode}
\RequirePackage{iftex}
\ifLuaTeX
\RequirePackage{luatex85}% until the geometry package is updated
\fi
% \end{macrocode}
%
%
%
% \section{Unicode Input Characters}
% \changes{v0.18}{2016/05/17}{PDF Unicode input characters.}
% \index{Unicode>input characters}
%
% \codeall
%
% If using |pdflatex|, convert a minimal set of Unicode characters.
% Additional characters may be defined by the user, as needed.
%
% A commonly-used multiply symbol is declared to be \cs{texttimes}.
%
% The first arguments of \cs{newunicodechar} below are text ligatures in
% the source code, even though they are not printed in the following
% listing.
% \begin{macrocode}
\RequirePackage{newunicodechar}
\newunicodechar{⨯}{\texttimes}
\ifPDFTeX
\newunicodechar{ff}{ff}% the first arguments are ligatures
\newunicodechar{fi}{fi}
\newunicodechar{fl}{fl}
\newunicodechar{ffi}{ffi}
\newunicodechar{ffl}{ffl}
\newunicodechar{—}{---}
\newunicodechar{–}{--}
% \end{macrocode}
% In PDF\TeX, preserve upright quotes in verbatim text:
% \begin{macrocode}
\RequirePackage{upquote}
\else
\fi
% \end{macrocode}
%
%
%
% \section{Handling package options}
% \label{sec:handlingpackageoptions}
%
%
% \DescribePackage{etoolbox}
% Provides |\ifbool| and other functions.
%
% \begin{macrocode}
\RequirePackage{etoolbox}[2011/01/03]
% requires v2.6 for \BeforeBeginEnvironment, etc.
% \end{macrocode}
% \DescribePackage{ifplatform}
% Provides \cs{ifwindows} to try to automatically detect
% Windows OS.
%
% \begin{macrocode}
\RequirePackage{ifplatform}% sense op-system platform
% \end{macrocode}
%
%
% \DescribePackage{comment}
% Provides conditional code blocks.
%
% \begin{macrocode}
\RequirePackage{comment}
\excludecomment{testing}
% \end{macrocode}
% \DescribePackage{kvoptions}
% Allows key/value package options.
% \begin{macrocode}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=LWR,prefix=LWR@}
% \end{macrocode}
% \DescribeBoolean{warpingprint}
% \DescribeBoolean{warpingHTML}
% \DescribeBoolean{mathjax}
% Set to true/false depending on the package option selections for
% print/\acro{HTML} output and mathsvg/mathjax:
% \begin{macrocode}
\newbool{warpingprint}
\newbool{warpingHTML}
\newbool{mathjax}
% \end{macrocode}
% \begin{macro}{\warpprintonly} \marg{contents}
%
% Only process the contents if producing printed output.
% \changes{v0.19}{2016/06/06}{Replaces \cs{rowprintedonly}.}
% \begin{macrocode}
\newcommand{\warpprintonly}[1]{\ifbool{warpingprint}{#1}{}}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\warpHTMLonly} \marg{contents}
%
% Only process the contents if producing \acro{HTML} output.
% \changes{v0.19}{2016/06/06}{Added.}
% \begin{macrocode}
\newcommand{\warpHTMLonly}[1]{\ifbool{warpingHTML}{#1}{}}
% \end{macrocode}
% \end{macro}
% \begin{environment}{warpall}
% Anything in the |warpall| environment will be generated for print or \acro{HTML} outputs.
% \begin{macrocode}
\includecomment{warpall}
% \end{macrocode}
% \end{environment}
% \begin{environment}{warpprint}
% Anything in the |warpprint| environment will be generated for print output only.
%
% \DescribeOption[lwarp]{warpprint}
% If the |warpprint| option is given, boolean |warpingprint| is true and boolean |warpingHTML| is false,
% and may be used for |\ifbool| tests.
%
% \begin{macrocode}
\DeclareVoidOption{warpprint}{%
\PackageInfo{lwarp}{Using option 'warpprint'}
\includecomment{warpprint}%
\excludecomment{warpHTML}%
\booltrue{warpingprint}%
\boolfalse{warpingHTML}%
}
% \end{macrocode}
% \end{environment}
% \begin{environment}{warpHTML}
% Anything in the |warpHTML| environment will be generated for \acro{HTML} output only.
%
% \DescribeOption[lwarp]{warpHTML}
% If the |warpHTML| option is given, boolean |warpingHTML| is true and boolean |warpingprint| is false,
% and may be used for |\ifbool| tests.
%
% \begin{macrocode}
\DeclareVoidOption{warpHTML}{%
\PackageInfo{lwarp}{Using option 'warpHTML'}
\excludecomment{warpprint}%
\includecomment{warpHTML}%
\booltrue{warpingHTML}%
\boolfalse{warpingprint}%
}
% \end{macrocode}
% \end{environment}
%
%
%
%
% \changes{v0.19}{2016/05/25}{Options: mathsvg and mathjax}
% \DescribeOption[lwarp]{mathsvg}
% Option |mathsvg| selects \acro{SVG} math display:
% \index{math>mathsvg option}
% \index{SVG>mathsvg option}
% If the |mathsvg| option is given, boolean |mathjax| is false, and may be used for |\ifbool| tests.
% \begin{macrocode}
\DeclareVoidOption{mathsvg}{%
\PackageInfo{lwarp}{Using option 'mathsvg'}
\boolfalse{mathjax}%
}
% \end{macrocode}
%
% \DescribeOption[lwarp]{mathjax}
% Option |mathjax| selects MathJax math display:
% \index{math>mathjax option}
% \index{MathJax>mathjax option}
% If the |mathjax| option is given, boolean |mathjax| is true, may be used for |\ifbool| tests.
% \begin{macrocode}
\DeclareVoidOption{mathjax}{%
\PackageInfo{lwarp}{Using option 'mathjax'}
\booltrue{mathjax}%
}
% \end{macrocode}
% \DescribeOption[lwarp]{BaseJobname}
% Option |BaseJobname| sets the \cs{BaseJobname} for this document.
%
% This is the \cs{jobname} of the printed version, even if currently
% compiling the \acro{HTML} version.
% I.e. this is the \cs{jobname} without |_html| appended.
% This is used to set \cs{HomeHTMLFileName} if the user did not provide one.
% \begin{macrocode}
\DeclareStringOption[\jobname]{BaseJobname}
% \end{macrocode}
% The default is print output,
% and \acro{SVG} math if the user chose \acro{HTML} output.
% \begin{macrocode}
\includecomment{warpprint}%
\excludecomment{warpHTML}%
\booltrue{warpingprint}%
\boolfalse{warpingHTML}%
\boolfalse{mathjax}%
% \ExecuteOptions{warpprint,mathsvg}
\ProcessKeyvalOptions*\relax
% \end{macrocode}
% Assign the \cs{BaseJobname} if the user hasn't provided one:
% \begin{macrocode}
\providecommand*{\BaseJobname}{\LWR@BaseJobname}
% \end{macrocode}
% \begin{macro}{\@nameedef} \marg{name} \marg{defn}
%
% Expands |<defn>| before assigning to |<name>|
% \begin{macrocode}
\def\@nameedef#1{\expandafter\edef\csname #1\endcsname}
% \end{macrocode}
% \end{macro}
% \section{Misplaced packages}
%
% \changes{v0.21}{2017/02/22}{Add: Errors for misplaced packages.}
% Several packages should only be loaded before \pkg{lwarp}, and
% others should only be loaded after.
%
% Packages which should only be loaded before \pkg{lwarp} have their own \\
% \hspace*{2em}|lwarp-<packagename>.sty| \\
% which will trigger an error if they are loaded after
% \pkg{lwarp}.
% Examples include \pkg{fontspec}, \pkg{inputenc}, \pkg{fontenc},
% and \pkg{newunicodechar}.
%
%
% \begin{macro}{\LWR@noloadbefore} \marg{packagename} \quad
% Error if loaded before \pkg{lwarp}.
%
% \begin{macrocode}
\newcommand*{\LWR@noloadbefore}[1]{%
\@ifpackageloaded{#1}
{
\PackageError{lwarp}
{Package #1, or one which uses #1, must be loaded after lwarp}
{Move \detokenize{\usepackage}{#1} after \detokenize{\usepackage}{lwarp}.
Package #1 may also be loaded by something else, which must also be moved
after lwarp.}
}
{}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@noloadafter} \marg{packagename} \quad
% Error if loaded after \pkg{lwarp}.
%
% \begin{macrocode}
\newcommand*{\LWR@noloadafter}[1]{%
\PackageError{lwarp}
{Package #1 must be loaded before lwarp}
{Move \detokenize{\usepackage}{#1} before \detokenize{\usepackage}{lwarp}.}
}
% \end{macrocode}
% \end{macro}
% Packages which should only be loaded after \pkg{lwarp} are tested
% here to trip an error of they have already been loaded.
%
% The following packages must be loaded after \pkg{lwarp}:
% \begin{macrocode}
\LWR@noloadbefore{afterpage}
\LWR@noloadbefore{algorithmicx}
\LWR@noloadbefore{alltt}
\LWR@noloadbefore{bookmark}
\LWR@noloadbefore{booktabs}
\LWR@noloadbefore{draftwatermark}
\LWR@noloadbefore{epigraph}
\LWR@noloadbefore{eso-pic}
\LWR@noloadbefore{everypage}
\LWR@noloadbefore{extramarks}
\LWR@noloadbefore{fancyhdr}
\LWR@noloadbefore{floatrow}
\LWR@noloadbefore{float}
\LWR@noloadbefore{geometry}
\LWR@noloadbefore{graphics}
\LWR@noloadbefore{graphicx}
\LWR@noloadbefore{hyperref}
\LWR@noloadbefore{keyfloat}
\LWR@noloadbefore{letterspace}
\LWR@noloadbefore{listings}
\LWR@noloadbefore{longtable}
\LWR@noloadbefore{ltcaption}
\LWR@noloadbefore{mdframed}
\LWR@noloadbefore{microtype}
%\LWR@noloadbefore{multicol}% loaded by ltxdoc
\LWR@noloadbefore{multirow}
\LWR@noloadbefore{needspace}
\LWR@noloadbefore{nowidow}
\LWR@noloadbefore{pagenote}
\LWR@noloadbefore{placeins}
\LWR@noloadbefore{ragged2e}
\LWR@noloadbefore{rotating}
\LWR@noloadbefore{setspace}
\LWR@noloadbefore{textpos}
\LWR@noloadbefore{threeparttable}
\LWR@noloadbefore{titleps}
\LWR@noloadbefore{titlesec}
\LWR@noloadbefore{titletoc}
\LWR@noloadbefore{tocloft}
\LWR@noloadbefore{trivfloat}
\LWR@noloadbefore{wallpaper}
\LWR@noloadbefore{wrapfig}
\LWR@noloadbefore{xcolor}
\LWR@noloadbefore{xfrac}
% \end{macrocode}
% \section{Required packages}
% \label{sec:requiredpackages}
% \index{packages>required}
% \changes{v0.16}{2016/04/08}{Lwarp no longer selects fonts.}
% These packages are automatically loaded by \pkg{lwarp} when generating
% \acro{HTML} output. Some of them are also automatically loaded when
% generating print output, but some are not.
%
% In the document preamble, create a \env{warpprint} environment, and place
% inside it any of the following packages which are required and which
% are labeled as ``Print: OK to Load in a \env{warpprint} environment''.
% Those packages which are labeled as ``Print: Pre-Loaded''
% need not be placed into the document preamble.
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% \changes{v0.16}{2016/04/07}{Added XeLaTeX, LuaLaTeX support.}
% See: \url{http://tex.stackexchange.com/a/47579}.
% Detects \XeTeX{} and \LuaLaTeX:
% \index{XeLaTeX>detection}\index{LuaLaTeX>detection}
% \begin{macrocode}
\RequirePackage{iftex}
\newif\ifxetexorluatex
\ifXeTeX
\xetexorluatextrue
\else
\ifLuaTeX
\xetexorluatextrue
\else
\xetexorluatexfalse
\fi
\fi
% \end{macrocode}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% ^^A
% ^^A
% ^^A % For \XeTeX{} or \LuaLaTeX, use \pkg{fontspec}.
% ^^A % \marginpar{\textcolor{blue}{\XeTeX{} or \LuaLaTeX{} only:}}
% ^^A %
% ^^A % See:\\
% ^^A % \href
% ^^A % {http://tex.stackexchange.com/questions/2984/frequently-loaded-packages-differences-between-pdflatex-and-xelatex}
% ^^A % {http://tex.stackexchange.com/questions/2984/\\
% ^^A % \hspace*{.25in}frequently-loaded-packages-differences-between-pdflatex-and-xelatex}
% ^^A %
% ^^A % \index{font>during conversion}
% ^^A % For \XeLaTeX{} and \LuaLaTeX, uses DejaVu Serif for enhanced Cyrillic and Greek coverage.
% ^^A % \index{Unicode>XeLaTeX \& LuaLaTeX}
% \begin{macrocode}
\ifxetexorluatex
% ^^A \usepackage[no-math]{fontspec}
% \end{macrocode}
% ^^A \defaultfontfeatures{Ligatures=Common}
% ^^A \setmainfont{DejaVu Serif}
% ^^A \setsansfont{DejaVu Sans}
% ^^A \setmonofont{DejaVu Sans Mono}
% The monospaced font is used for \acro{HTML} tags,
% so turn off its TeX ligatures and common ligatures:
% \begin{macrocode}
\defaultfontfeatures[\rmfamily]{Ligatures={NoCommon,TeX}}
\defaultfontfeatures[\sffamily]{Ligatures={NoCommon,TeX}}
\defaultfontfeatures[\ttfamily]{Ligatures=NoCommon}
\else
% \end{macrocode}
% ^^A % For |pdflatex|, use \pkg{fontenc} and \pkg{lmodern}:
% ^^A % \marginpar{\textcolor{blue}{|pdflatex| only:}}
% ^^A % \index{Unicode>pdfLaTeX}
% ^^A % \index{pdfLaTeX>Unicode support}
% ^^A % \begin{macrocode}
% ^^A \RequirePDFTeX % error if not pdflatex
% ^^A
% ^^A \input glyphtounicode.tex
% ^^A \input glyphtounicode-cmr.tex% from the pdfx package
% ^^A \pdfgentounicode=1
% ^^A
% ^^A \usepackage{cmap}% help map Russian to unicode
% ^^A \defaulthyphenchar=127%
% ^^A % \end{macrocode}
% ^^A
% ^^A % \DescribePackage{lmodern}
% ^^A %
% ^^A % \pdflatexonly
% ^^A %
% ^^A % |pdftotext| works better with a vector font.
% ^^A % This font choice does not control the HTML file, but it does appear in the
% ^^A % images generated from math expressions.
% ^^A % \begin{macrocode}
% ^^A \RequirePackage{lmodern}
% ^^A % \end{macrocode}
% ^^A
% ^^A
% ^^A % \DescribePackage{fontenc}
% ^^A %
% ^^A % \pdflatexonly
% ^^A %
% ^^A % \begin{macrocode}
% ^^A \RequirePackage[T1]{fontenc}
% ^^A % \end{macrocode}
% ^^A
% ^^A
% ^^A % \DescribePackage{inputenc}
% ^^A %
% ^^A % \pdflatexonly
% ^^A %
% ^^A % \begin{macrocode}
% ^^A \RequirePackage[utf8]{inputenc}
% ^^A % \end{macrocode}
% ^^A
% \pdflatexonly
%
% \DescribePackage{microtype}
% \changes{v0.18}{2016/05/18}{Microtype disabled during HTML generation}
%
% Older browsers don't
% \index{ligatures}
% display ligatures.
% \margintag{ligatures}
% Turn off letter ligatures, keeping
% \LaTeX{} dash and quote ligatures, which may fail on older browers
% but at least won't corrupt written words.
% \begin{macrocode}
\RequirePackage {microtype}
\microtypesetup{
protrusion=false,
expansion=false,
tracking=false,
kerning=false,
spacing=false}
\DisableLigatures[f,q,t,T,Q]{encoding = *,family = *}
% \end{macrocode}
% ^^A
% ^^A
% ^^A % \DescribePackage{newunicodechar}
% ^^A %
% ^^A %
% ^^A % \pdflatexonly
% ^^A %
% ^^A % Note that the font used by the source code listing may not correctly display the
% ^^A % \watchout
% ^^A % actual Unicode character contained in the \cs{newunicode\{\}} expression.
% ^^A % The listing printout may not display ligatures or the dashes correctly.
% ^^A % \begin{macrocode}
% ^^A \RequirePackage{newunicodechar}
% ^^A \newunicodechar{Í}{\IeC {\'I}}
% ^^A \newunicodechar{ff}{ff}% ligatures
% ^^A \newunicodechar{fi}{fi}
% ^^A \newunicodechar{fl}{fl}
% ^^A \newunicodechar{ffi}{ffi}
% ^^A \newunicodechar{ffl}{ffl}
% ^^A %% \newunicodechar{°}{\degree}
% ^^A \newunicodechar{ρ}{\ensuremath{\rho}}
% ^^A \newunicodechar{⨯}{\texttimes}
% ^^A %% \newunicodechar{®}{\textregistered}
% ^^A %% \newunicodechar{©}{\textcopyright}
% ^^A \newunicodechar{—}{---}% emdash
% ^^A \newunicodechar{–}{--}% endash
% ^^A %% \newunicodechar{”}{''}% closing quote
% ^^A %% \newunicodechar{“}{``}% opening quote
% ^^A %% \newunicodechar{§}{\S}
% ^^A %% \newunicodechar{¶}{\P}
% ^^A %% \newunicodechar{†}{\dag}
% ^^A %% \newunicodechar{‡}{\ddag}
% ^^A % \end{macrocode}
% ^^A
% ^^A
% ^^A % \DescribePackage{textcomp}
% ^^A %
% ^^A %
% ^^A % \pdflatexonly
% ^^A %
% ^^A % Provides \cs{degree}, \cs{textquotesingle}, \cs{textmu}.
% ^^A % \begin{macrocode}
% ^^A \RequirePackage{textcomp}
% ^^A % \end{macrocode}
% ^^A
% \begin{macrocode}
\fi
% \end{macrocode}
% ^^A % \marginpar{\textcolor{blue}{End of \XeLaTeX, \LuaLaTeX, |pdflatex| choices.}}
% ^^A
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \DescribePackage{geometry}
% Tactics to avoid unwanted page breaks and margin overflow:
% \begin{itemize}
% \item Uses a very long and wide page to minimize page breaks and margin overflow.
% \item Will also use a scriptsize font.
% \item Also uses extra space at the margin to avoid \acro{HTML} tag overflow off the page.
% \item Will also force a new page before environments.
% \end{itemize}
%
% \changes{v0.20}{2017/01/12}{Page geometry set to 6in wide with large margins.}
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
\RequirePackage[paperheight=190in,paperwidth=20in,%
left=7in,right=7in,%
top=1in,bottom=1in,%
]{geometry}
\end{warpHTML}
% \end{macrocode}
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% \DescribePackage{xparse}
%
% \LaTeX{}3 command argument parsing
% ^^A \RequirePackage[log-declarations=false]{xparse}
% \begin{macrocode}
\RequirePackage{xparse}
% \end{macrocode}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \DescribePackage{expl3}
%
% \LaTeX{}3 programming
% \begin{macrocode}
\RequirePackage{expl3}
% \end{macrocode}
% ^^A % \DescribePackage{l3regex}
% ^^A %
% ^^A % \LaTeX{}3 regular expression handling
% ^^A % \begin{macrocode}
% ^^A \RequirePackage{l3regex}
% ^^A % \end{macrocode}
% ^^A % \begin{macro}{\EmulatesPackage} \marg{pkg name} \oarg{yyyy/mm/dd and comments}
% ^^A %
% ^^A % Similar to \cs{ProvidesPackage}. Used where the \pkg{lwarp} package emulates
% ^^A % other packages.
% ^^A % For example, \pkg{trivfloat} wants to load \pkg{float}, which is emulated by \pkg{lwarp}.
% ^^A % Since |\EmulatesPackage{float}| is declared by \pkg{lwarp},
% ^^A % \pkg{trivfloat} will not load \pkg{float} on its own.
% ^^A % Doing so would have over-written the \pkg{lwarp} emulation.
% ^^A %
% ^^A % Do not use \cs{EmulatesPackage} for packages which are patched by other
% ^^A % \watchout
% ^^A % packages. The emulated code cannot be patched correctly.
% ^^A %
% ^^A % \begin{macrocode}
% ^^A \NewDocumentCommand{\EmulatesPackage}{m O{}}{%
% ^^A \expandafter\xdef\csname ver@#1.sty\endcsname{#2 ---
% ^^A Emulated by package \@currname.}
% ^^A }
% ^^A \@onlypreamble\EmulatesPackage
% ^^A % \end{macrocode}
% ^^A % \end{macro}
% ^^A
% \DescribePackage{gettitlestring}
%
% Used to emulate \cs{nameref}.
% \begin{macrocode}
\RequirePackage{gettitlestring}
% \end{macrocode}
% \DescribePackage{everyhook}
%
% \pkg{everyhook} is used to patch paragraph handling.
% \begin{macrocode}
\RequirePackage{everyhook}
\end{warpHTML}
% \end{macrocode}
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% \DescribePackage{fancyvrb}
%
% Used for Verbatim, verse.
% \begin{macrocode}
\RequirePackage{fancyvrb}
% \end{macrocode}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \DescribePackage{xifthen}
% \begin{macrocode}
\RequirePackage{xifthen}
% \end{macrocode}
% \DescribePackage{xstring}
% \begin{macrocode}
\RequirePackage{xstring}
% \end{macrocode}
% \DescribePackage{makeidx}
% \begin{macrocode}
\RequirePackage{makeidx}
\makeindex
% \end{macrocode}
% \DescribePackage{calc}
% \begin{macrocode}
\RequirePackage{calc}
% \end{macrocode}
% \DescribePackage{newfloat}
% \begin{macrocode}
\RequirePackage{newfloat}
% \end{macrocode}
% \DescribePackage{caption}
% \begin{macrocode}
\RequirePackage{caption}
% \end{macrocode}
% \DescribePackage{subcaption}
% \begin{macrocode}
\RequirePackage{subcaption}
% \end{macrocode}
% \DescribePackage{enumitem}
%
% \pkg{enumitem} is patched to support |\newlist| with \acro{HTML}.
% \begin{macrocode}
\RequirePackage{enumitem}
\setlist[itemize]{leftmargin=0em}
\setlist[enumerate]{leftmargin=0em}
\setlist[description]{leftmargin=0em}
% \end{macrocode}
% \DescribePackage{pagenote}
%
% Used to convert footnotes into pagenotes.
% \begin{macrocode}
\RequirePackage[continuous]{pagenote}
\makepagenote
\let\LWR@origmakepagenote\makepagenote
\let\LWR@origprintnotes\printnotes
\let\LWR@origpagenote\pagenote
\end{warpHTML}
% \end{macrocode}
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% \DescribePackage{titling}
%
% Used for |\maketitle| and the title page. See \cref{sec:titles}.
% \begin{macrocode}
\RequirePackage{titling}
% \end{macrocode}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \DescribePackage{zref}
%
% Used for cross-references.
% \begin{macrocode}
\RequirePackage{zref}
% \end{macrocode}
% \DescribePackage{amsmath}
% \changes{v0.16}{2016/04/09}{Fix: amsmath options clash}
%
% Equation numbers are placed to the left for \acro{HTML}.
%
% \pkg{newtxmath} automatically loads \pkg{amsmath},
% so the options |leqno| and |fleqn| are passed beforehand to be
% picked up both here and by \pkg{newtxmath} if it is used.
% \changes{v0.16}{2016/04/11}{Fix: newtxmath compatibility.}
%
% \begin{macrocode}
\PassOptionsToPackage{leqno,fleqn}{amsmath}
\RequirePackage{amsmath}
% \end{macrocode}
% \DescribePackage{environ}
%
% Used to encapsulate math environments for re-use in \acro{HTML} ALT text.
%
% \begin{macrocode}
\RequirePackage{environ}
% \end{macrocode}
% \DescribePackage{titleps}
% \changes{v0.19}{2016/05/27}{titleps: null \cs{pagestyle} and \cs{thispagestyle} for HTML.}
%
% Used to place an \acro{HTML} comment into the footer of a page below the footnotes.
% This comment is used for |lateximage| environments, including math.
%
% The |nopatches| option prevents titleps from trying to patch sectioning commands.
%
% \cs{pagestyle} and \cs{thispagestyle} are nullified for \acro{HTML} output.
%
% \begin{macrocode}
\RequirePackage[nopatches]{titleps}
% \end{macrocode}
%
% \begin{macro}{\pagestyle} \marg{style}
% \begin{macrocode}
\let\LWR@origpagestyle\pagestyle
\renewcommand*{\pagestyle}[1]{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\thispagestyle} \marg{style}
% \begin{macrocode}
\let\LWR@origthispagestyle\thispagestyle
\renewcommand*{\thispagestyle}[1]{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pagenumbering} \marg{commands}
% \begin{macrocode}
\let\LWR@origpagenumbering\pagenumbering
\renewcommand*{\pagenumbering}[1]{}
% \end{macrocode}
% \end{macro}
%
% \DescribePackage{xfrac}
%
% Patched for \acro{HTML} use.
% See \cref{sec:xfrac}.
% \begin{macrocode}
\RequirePackage{xfrac}
% \end{macrocode}
%
% Used to convert lengths for image width/height options.
%
% \begin{macrocode}
\RequirePackage{printlen}
% \end{macrocode}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Loading Packages}
%
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% Remember the original \cs{RequirePackage}:
% \begin{macrocode}
\let\LWR@origRequirePackage\RequirePackage
% \end{macrocode}
% \begin{macro}{\LWR@requirepackagenames} Stores the list of required package names.
% \begin{macrocode}
\newcommand*{\LWR@requirepackagenames}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@findword} \oarg{1: separator} \marg{2: list}
% \marg{3: index} \oarg{4: destination}
%
% Note that argument 4 is passed directly to \cs{StrBetween}.
% \begin{macrocode}
\newcommand*\LWR@findword[3][,]{%
\StrBetween[#3,\numexpr#3+1]{#1#2#1}{#1}{#1}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LWR@lookforpackagename} \marg{index}
% If this is a package name, re-direct it to the \pkg{lwarp} version
% by renaming it |lwarp-| followed by the original name.
% \begin{macrocode}
\newcommand*{\LWR@lookforpackagename}[1]{
% \end{macrocode}
% Find the n'th package name from the list:
% \begin{macrocode}
\LWR@findword{\LWR@requirepackagenames}{#1}[\LWR@strresult]
% \end{macrocode}
% See if the package name was found:
% \begin{macrocode}
\IfStrEq{\LWR@strresult}{}
{}% no filename
{% yes filename
% \end{macrocode}
% If found, and if an \pkg{lwarp}-equivalent name exists, use |lwarp-|* instead.
% \begin{macrocode}
\IfFileExists{lwarp-\LWR@strresult.sty}
{% latex_html_ file found
\StrSubstitute
{\LWR@requirepackagenames}
{\LWR@strresult}
{lwarp-\LWR@strresult}[\LWR@requirepackagenames]
}
{}% no latex_html_* file
}% yes filename
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\RequirePackage} \oarg{1: options} \marg{2: package names} \oarg{3: version}
%
% For each of many package names in a comma-separated list,
% if an \pkg{lwarp} version of a package exists,
% select it instead of the \LaTeX\ version.
%
% \begin{macrocode}
\RenewDocumentCommand{\RequirePackage}{o m o}{%
% \end{macrocode}
% Redirect up to nine names:
% \begin{macrocode}
\renewcommand*{\LWR@requirepackagenames}{#2}
\LWR@lookforpackagename{1}
\LWR@lookforpackagename{2}
\LWR@lookforpackagename{3}
\LWR@lookforpackagename{4}
\LWR@lookforpackagename{5}
\LWR@lookforpackagename{6}
\LWR@lookforpackagename{7}
\LWR@lookforpackagename{8}
\LWR@lookforpackagename{9}
% \end{macrocode}
% \cs{RequirePackage} depending on the options and version:
% \begin{macrocode}
\IfValueTF{#1}
{% options given
\IfValueTF{#3}% version given?
{\LWR@origRequirePackage[#1]{\LWR@requirepackagenames}[#3]}
{\LWR@origRequirePackage[#1]{\LWR@requirepackagenames}}
}
{% no options given
\IfValueTF{#3}% version given?
{\LWR@origRequirePackage{\LWR@requirepackagenames}[#3]}
{\LWR@origRequirePackage{\LWR@requirepackagenames}}
}
}
\let\usepackage\RequirePackage
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@ProvidesPackagePass} \marg{pkgname} \oarg{version}
%
% Provides a new package which passes its options to the original.
% \begin{macrocode}
\NewDocumentCommand{\LWR@ProvidesPackagePass}{m o}{
\PackageInfo{lwarp}{Using the lwarp version of package `#1', including options,}%
\IfValueTF{#2}
{\ProvidesPackage{lwarp-#1}[#2]}
{\ProvidesPackage{lwarp-#1}}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{#1}}
\ProcessOptions\relax
\IfValueTF{#2}
{\LWR@origRequirePackage{#1}[#2]}
{\LWR@origRequirePackage{#1}}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@ProvidesPackageDrop} \marg{pkgname} \oarg{version}
%
% Provides a new package which drops/discards its options.
% \begin{macrocode}
\NewDocumentCommand{\LWR@ProvidesPackageDrop}{m o}{
\PackageInfo{lwarp}{Using the lwarp version of package `#1', discarding options,}%
\IfValueTF{#2}
{\ProvidesPackage{lwarp-#1}[#2]}
{\ProvidesPackage{lwarp-#1}}
\DeclareOption*{}
\ProcessOptions\relax
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Copying a file}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@copyfile} \marg{source filename} \marg{destination filename}
%
% Used to copy the |.toc| file to |.sidetoc| to re-print the \acro{TOC} in
% the side\acro{TOC} navigation pane.
% \begin{macrocode}
\newcommand*{\LWR@copyfile}[2]{%
\newwrite\copyfile % open the file to write to
\immediate\openout\copyfile=#2
\newread\file % open the file to read from
\openin\file=#1
\begingroup\endlinechar=-1
\makeatletter
\loop\unless\ifeof\file
\read\file to\fileline % Read one line and store it into \fileline
% \fileline\par % print the content into the pdf
% print the content:
\immediate\write\copyfile{\unexpanded\expandafter{\fileline}}%
\repeat
\closeout\copyfile
\endgroup
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Debugging messages}
% \DescribeBoolean{LWR@tracinglwarp} True if tracing is turned on.
% \begin{macrocode}
\newbool{LWR@tracinglwarp}
% \end{macrocode}
%
% \begin{macro}{\tracinglwarp} Turns on the debug tracing messages.
% \changes{v0.20}{2017/02/07}{Added.}
% \begin{macrocode}
\newcommand{\tracinglwarp}{\booltrue{LWR@tracinglwarp}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LWR@traceinfo} \marg{text} \quad If tracing is turned on, writes
% the text to the |.log| file.
% \begin{macrocode}
\newcommand{\LWR@traceinfo}[1]{%
\ifbool{LWR@tracinglwarp}%
{\PackageInfo{lwarp}{#1 : }}%
{}%
}
% \end{macrocode}
% \end{macro}
% \section{Remembering original formatting macros}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% Remember original definitions of formatting commands.
% Will be changed to \acro{HTML} commands for most uses.
% Will be temporarily restored to original meaning inside any lateximage environment.
% Also nullify unused commands.
% \begin{macrocode}
\let\LWR@origtextit\textit
\let\LWR@origtextbf\textbf
\let\LWR@origtexttt\texttt
\let\LWR@origtextsc\textsc
\let\LWR@origtextsf\textsf
\let\LWR@origtextrm\textrm
\let\LWR@origbfseries\bfseries
\let\LWR@origrmfamily\rmfamily
\let\LWR@origttfamily\ttfamily
\let\LWR@orignormalfont\normalfont
\let\LWR@origraggedright\raggedright
\let\LWR@origonecolumn\onecolumn
\let\LWR@origtextsuperscript\textsuperscript
\let\LWR@origtextsubscript\textsubscript
\let\LWR@origscriptsize\scriptsize
\let\LWR@orignewpage\newpage
\let\LWR@origminipage\minipage
\let\LWR@origendminipage\endminipage
\let\LWR@orignewline\newline
\let\LWR@origitem\item
\let\LWR@origpar\par
\let\LWR@origfootnote\footnote
\let\LWR@orig@mpfootnotetext\@mpfootnotetext
\let\LWR@origclearpage\clearpage
\let\clearpage\relax
\let\cleardoublepage\relax
% \end{macrocode}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Operating-System portability}
% \label{sec:OSportability}
% \changes{v0.11}{2016/03/11}{Added section: Operating-System portability.}
%
% \osportabilityusage
%
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
%
%
% \subsection{Common portability code}
%
% \DescribeBoolean{usingOSwindows}Set if \cs{warpOSwindows}.
% \begin{macrocode}
\newbool{usingOSwindows}
\boolfalse{usingOSwindows}
% \end{macrocode}
%
% \subsection{Unix, Linux, and Mac\,OS}
% \begin{macro}{\OSPathSymbol}
% Symbol used to separate directories in a path.
% \begin{macrocode}
\newcommand*{\OSPathSymbol}{/}
% \end{macrocode}
% \end{macro}
% \subsection{MS-Windows}
% For MS-Windows:
%
% \begin{macro}{\warpOSwindows}
% Set defaults for the MS-Windows operating system.
% \pkg{lwarp} attempts to auto-detect the operatings system,
% so \cs{warpOSwindows} may not be necessary.
%
% \changes{v0.20}{2016/12/19}{Auto-detects operating system.}
%
% \begin{macrocode}
\newcommand*{\warpOSwindows}
{
\booltrue{usingOSwindows}
\renewcommand*{\OSPathSymbol}{\@backslashchar}
}
% \end{macrocode}
% Test for windows during compile. The user may also specify
% \cs{warpOSwindows} later in case this test fails.
% \begin{macrocode}
\ifwindows
\warpOSwindows
\fi
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \section{Stacks}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% Stacks are used to remember how to close sections and list items.
% Before a new section is started, previously nested sections and items must
% be closed out (un-nested) in proper order.
% Note that starting a new section may close several levels of previously
% \watchout
% nested items at the same time.
% For example, starting a new |\section| would close any currently open
% subsection, subsubsection, and paragraph.
% General environments are not nested on the stack since they have their own close
% mechanism. List environments are nested, and items inside those environments
% are nested one level deeper still.
% List environments may be nested inside other list environments, and list items
% are nested inside list environments as well. Thus, the stack may have items
% which are not necessarily in order, since a description may contain an enumerate,
% for example.
% Depths to be recorded in |\LWR@closedepthone|, etc.
% \subsection{Assigning depths}
% initial depths for empty stack entries:
% \begin{macrocode}
\newcommand*{\LWR@depthnone}{-5}
% \end{macrocode}
% all sectioning depths are deeper than |LWR@depthfinished|:
% \begin{macrocode}
\newcommand*{\LWR@depthfinished}{-4}
\newcommand*{\LWR@depthpart}{-1}
\newcommand*{\LWR@depthchapter}{0}
\newcommand*{\LWR@depthsection}{1}
\newcommand*{\LWR@depthsubsection}{2}
\newcommand*{\LWR@depthsubsubsection}{3}
\newcommand*{\LWR@depthparagraph}{4}
\newcommand*{\LWR@depthsubparagraph}{5}
% \end{macrocode}
% used by |\itemize|, |\enumerate|, |\description|:
% \begin{macrocode}
\newcommand*{\LWR@depthlist}{6}
% \end{macrocode}
% used by |\item|:
% \begin{macrocode}
\newcommand*{\LWR@depthlistitem}{7}
% \end{macrocode}
% \subsection{Closing actions}
% A stack to record the action to take to close each nesting level:
% Add more levels of stack if necessary for a very deeply nested document,
% adding to |\pushclose| and |\popclose| as well.
% \begin{macrocode}
\newcommand*{\LWR@closeone}{}% top of the stack
\newcommand*{\LWR@closetwo}{}
\newcommand*{\LWR@closethree}{}
\newcommand*{\LWR@closefour}{}
\newcommand*{\LWR@closefive}{}
\newcommand*{\LWR@closesix}{}
\newcommand*{\LWR@closeseven}{}
\newcommand*{\LWR@closeeight}{}
\newcommand*{\LWR@closenine}{}
\newcommand*{\LWR@closeten}{}
\newcommand*{\LWR@closeeleven}{}
\newcommand*{\LWR@closetwelve}{}
% \end{macrocode}
% \subsection{Closing depths}
% A stack to record the depth of each level:
%
% Note that nested LaTeX structures may push depths which are non-sequential.
% \watchout
% \begin{docsidebar}[Ex:]
% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4]
% \begin{itemize}
% \item{A}
% \begin{description}
% \item{B}
% \end{description}
% \end{itemize}
% \end{Verbatim}
% \end{docsidebar}
% \begin{macrocode}
\newcommand*{\LWR@closedepthone}{\LWR@depthnone}% top of the stack
\newcommand*{\LWR@closedepthtwo}{\LWR@depthnone}
\newcommand*{\LWR@closedepththree}{\LWR@depthnone}
\newcommand*{\LWR@closedepthfour}{\LWR@depthnone}
\newcommand*{\LWR@closedepthfive}{\LWR@depthnone}
\newcommand*{\LWR@closedepthsix}{\LWR@depthnone}
\newcommand*{\LWR@closedepthseven}{\LWR@depthnone}
\newcommand*{\LWR@closedeptheight}{\LWR@depthnone}
\newcommand*{\LWR@closedepthnine}{\LWR@depthnone}
\newcommand*{\LWR@closedepthten}{\LWR@depthnone}
\newcommand*{\LWR@closedeptheleven}{\LWR@depthnone}
\newcommand*{\LWR@closedepthtwelve}{\LWR@depthnone}
% \end{macrocode}
% \subsection{Pushing and popping the stack}
% \begin{macro}{\pushclose} \marg{action} \marg{depth}
% Pushes one return action and its LaTeX depth onto the stacks.
% \begin{macrocode}
\NewDocumentCommand{\pushclose}{m m}
{
\let\LWR@closetwelve\LWR@closeeleven
\let\LWR@closeeleven\LWR@closeten
\let\LWR@closeten\LWR@closenine
\let\LWR@closenine\LWR@closeeight
\let\LWR@closeeight\LWR@closeseven
\let\LWR@closeseven\LWR@closesix
\let\LWR@closesix\LWR@closefive
\let\LWR@closefive\LWR@closefour
\let\LWR@closefour\LWR@closethree
\let\LWR@closethree\LWR@closetwo
\let\LWR@closetwo\LWR@closeone
\let\LWR@closeone#1
\let\LWR@closedepthtwelve\LWR@closedeptheleven
\let\LWR@closedepthelevel\LWR@closedepthten
\let\LWR@closedepthten\LWR@closedepthnine
\let\LWR@closedepthnine\LWR@closedeptheight
\let\LWR@closedeptheight\LWR@closedepthseven
\let\LWR@closedepthseven\LWR@closedepthsix
\let\LWR@closedepthsix\LWR@closedepthfive
\let\LWR@closedepthfive\LWR@closedepthfour
\let\LWR@closedepthfour\LWR@closedepththree
\let\LWR@closedepththree\LWR@closedepthtwo
\let\LWR@closedepthtwo\LWR@closedepthone
\let\LWR@closedepthone#2
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\popclose}
% Pops one action and its depth off the stacks.
% \begin{macrocode}
\newcommand*{\popclose}
{
\let\LWR@closeone\LWR@closetwo
\let\LWR@closetwo\LWR@closethree
\let\LWR@closethree\LWR@closefour
\let\LWR@closefour\LWR@closefive
\let\LWR@closefive\LWR@closesix
\let\LWR@closesix\LWR@closeseven
\let\LWR@closeseven\LWR@closeeight
\let\LWR@closeeight\LWR@closenine
\let\LWR@closenine\LWR@closeten
\let\LWR@closeten\LWR@closeeleven
\let\LWR@closeeleven\LWR@closetwelve
\let\LWR@closedepthone\LWR@closedepthtwo
\let\LWR@closedepthtwo\LWR@closedepththree
\let\LWR@closedepththree\LWR@closedepthfour
\let\LWR@closedepthfour\LWR@closedepthfive
\let\LWR@closedepthfive\LWR@closedepthsix
\let\LWR@closedepthsix\LWR@closedepthseven
\let\LWR@closedepthseven\LWR@closedeptheight
\let\LWR@closedeptheight\LWR@closedepthnine
\let\LWR@closedepthnine\LWR@closedepthten
\let\LWR@closedepthten\LWR@closedeptheleven
\let\LWR@closedeptheleven\LWR@closedepthtwelve
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Data arrays}
% \label{sec:dataarray}
%
% These macros are similar to the \pkg{arrayjobx} package, except
% that \cs{LWR@setexparray}'s argument is expanded only once when assigned.
%
% |name| has no backslash, |index| can be a number or a text name,
% and an empty |value| must be |\relax| instead of empty.
%
% To assign an empty value: \\
% \hspace*{2em}|\LWR@setexparray{name}{index}{\relax}|
%
% \changes{v0.20}{2017/01/07}{Added single-expansion data arrays.}
%
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
%
% \begin{macro}{\LWR@setexparray} \marg{name} \marg{index} \marg{contents}
% \begin{macrocode}
\NewDocumentCommand{\LWR@setexparray}{m m m}{%
\expandafter\edef\csname #1#2\endcsname{\expandonce#3}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LWR@getexparray} \marg{name} \marg{index}
% \begin{macrocode}
\newcommand*{\LWR@getexparray}[2]{\csuse{#1#2}}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{HTML entities}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \acro{HTML} entites and \acro{HTML} Unicode entities:
% \begin{macrocode}
\let\LWR@origampersand\&
% \end{macrocode}
% \begin{macro}{\HTMLentity} \marg{entitytag}
% \begin{macrocode}
\newcommand*{\HTMLentity}[1]{\LWR@origampersand#1;}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\HTMLunicode} \marg{hex\_unicode}
% \begin{macrocode}
\newcommand*{\HTMLunicode}[1]{\HTMLentity{\#x#1}}
% \end{macrocode}
% \end{macro}
% \DescribeMacro{\&}
% \begin{macrocode}
\renewcommand*{\&}{\HTMLentity{amp}}
% \end{macrocode}
% \begin{macro}{\textless}
% \begin{macro}{\textgreater}
% \begin{macrocode}
\let\LWR@origtextless\textless
\renewcommand*{\textless}{\HTMLentity{lt}}
\let\LWR@origtextgreater\textgreater
\renewcommand*{\textgreater}{\HTMLentity{gt}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{HTML filename generation}
%
% The filename of the homepage is set to |\HomeHTMLFileName.html|.
% The filenames of additional sections start with |\HTMLFileName|, to which is
% appended a section number or a simplified section name, depending on |FileSectionNames|.
%
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% \begin{macro}{\BaseJobname}
% The \cs{jobname} of the printed version, even if currently
% compiling the \acro{HTML} version.
% I.e. this is the \cs{jobname} without |_html| appended.
% This is used to set \cs{HomeHTMLFileName} if the user did not provide one.
% \begin{macrocode}
\providecommand*{\BaseJobname}{\jobname}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\HTMLFileName}
% \changes{v0.19}{2016/05/28}{Docs: Escape filename underscores.}
% \changes{v0.20}{2016/12/18}{No longer escape underscores.}
% The prefix for all generated \acro{HTML} files other than the home page,
% defaulting to empty. See \cref{sec:filenameexamples}.
%
% \begin{macrocode}
\providecommand*{\HTMLFileName}{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\HomeHTMLFileName}
% \changes{v0.19}{2016/05/28}{Docs: Escape filename underscores.}
% \changes{v0.20}{2016/12/18}{No longer escape underscores.}
% The filename of the home page, defaulting to the \cs{BaseJobname}.
% See \cref{sec:filenameexamples}.
%
% \begin{macrocode}
\providecommand*{\HomeHTMLFileName}{\BaseJobname}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\SetHTMLFileNumber} \marg{number}
%
% \changes{v0.20}{2016/09/11}{Add: Control file numbers.}
% Sets the file number for the next
% file to be generated. 0 is the home page.
% Use just before the next sectioning command, and set it to one less than the
% desired number of the next section.
% May be used to generate numbered groups of nodes
% such as 100+ for one chapter, 200+ for another chapter, etc.
% \begin{macrocode}
\newcommand*{\SetHTMLFileNumber}[1]{%
\setcounter{LWR@htmlfilenumber}{#1}%
}
% \end{macrocode}
% \end{macro}
% \DescribeBoolean{FileSectionNames}
% Selects how to create \acro{HTML} file names.
%
% Defaults to use section names in the filenames.
% \begin{macrocode}
\newbool{FileSectionNames}
\booltrue{FileSectionNames}
% \end{macrocode}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \DescribeCounter{LWR@htmlfilenumber}
% Records the number of each \acro{HTML} file as it is being created.
% Number 0 is the home page.
% \begin{macrocode}
\newcounter{LWR@htmlfilenumber}
\setcounter{LWR@htmlfilenumber}{0}
% \end{macrocode}
% \begin{macro}{\LWR@htmlsectionfilename} \marg{htmlfilenumber or name}
%
% \changes{v0.14}{2016/03/28}{Fix: Links to home page.}
% \changes{v0.17}{2016/04/11}{Fix: Links when entire doc is one HTML page.}
% \changes{v0.20}{2016/09/11}{HTMLFileName: removed additional trailing '-', and may be empty.}
% \changes{v0.20}{2016/09/11}{Sections called ``Index'' or ``index'' have an underscore
% prepended to their filenames if no prefix.}
%
% Prints the filename for a given section: |\HTMLFileName{}filenumber/name.html|
% \begin{macrocode}
\newcommand*{\LWR@htmlsectionfilename}[1]{%
\LWR@traceinfo{LWR@htmlsectionfilename A}%
% \end{macrocode}
% Section 0 or empty is given the home filename.
% The filename must be detokenized for underscores.
% \begin{macrocode}
\LWR@traceinfo{about to assign temp}%
\edef\LWR@tempone{#1}%
\LWR@traceinfo{about to compare with ??}%
\ifthenelse{\equal{\LWR@tempone}{??}}%
{%
\LWR@traceinfo{found ??}%
}{%
\LWR@traceinfo{not found ??}%
}%
\LWR@traceinfo{about to compare with zero or empty}%
\ifthenelse{%
\equal{\LWR@tempone}{0}%
\OR \equal{\LWR@tempone}{}%
\OR \equal{\LWR@tempone}{??}%
}%
{%
\LWR@traceinfo{LWR@htmlsectionfilename B \HomeHTMLFileName.html}%
\HomeHTMLFileName.html%
}%
% \end{macrocode}
% For a \LaTeX\ section named ``Index'' or ``index'' without a prefix, create a filename
% with a leading underscore to avoid colliding with the HTML filename |index.html|:
% \begin{macrocode}
{%
\LWR@traceinfo{LWR@htmlsectionfilename C}%
\ifthenelse{%
\equal{\HTMLFileName}{} \AND \equal{\LWR@tempone}{Index} \OR \equal{\LWR@tempone}{index}%
}%
{\_#1.html}%
% \end{macrocode}
% Otherwise, create a filename with the chosen prefix:
% \begin{macrocode}
{\HTMLFileName#1.html}%
}%
\LWR@traceinfo{LWR@htmlsectionfilename Z}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmlrefsectionfilename} \marg{label}
%
% Prints the filename for the given label
% \begin{macrocode}
\newcommand*{\LWR@htmlrefsectionfilename}[1]{%
\LWR@traceinfo{LWR@htmlrefsectionfilename A: !#1!}%
\LWR@htmlsectionfilename{\LWR@htmlfileref{#1}}%
\LWR@traceinfo{LWR@htmlrefsectionfilename B}%
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Homepage link}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LinkHome}
% |\LinkHome| may be used wherever you wish to place a link back to the homepage.
% The filename must be detokenized for underscores.
% \begin{macrocode}
\newcommand*{\LinkHome}{%
\LWR@subhyperrefclass{%
\HomeHTMLFileName.html}%
{Home}{linkhome}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@topnavigation}
%
% Creates a link to the homepage at the top of the page for use when the window is too
% narrow for the sidetoc.
% \begin{macrocode}
\newcommand*{\LWR@topnavigation}{
\LWR@htmlelementclassline{nav}{topnavigation}{\LinkHome}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@botnavigation}
%
% Creates a link to the homepage at the bottom of the page for use when the window is too
% narrow for the sidetoc.
% \begin{macrocode}
\newcommand*{\LWR@botnavigation}{
\LWR@htmlelementclassline{nav}{botnavigation}{\LinkHome}
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{\textbackslash{}PrintStack diagnostic tool}
% Diagnostics tool:
% Prints the LaTeX nesting depth values for the stack levels.
% Must have |\LWR@startpars| active while printing the stack, so |\PrintStack| may
% \watchout
% be called from anywhere in the normal text flow.
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\PrintStack} Prints the closedepth stack.
% \begin{macrocode}
\newcommand*{\PrintStack}{
\LWR@startpars
\LWR@closedepthone{} \LWR@closedepthtwo{} \LWR@closedepththree{}
\LWR@closedepthfour{} \LWR@closedepthfive{} \LWR@closedepthsix{}
\LWR@closedepthseven{} \LWR@closedeptheight{} \LWR@closedepthnine{}
\LWR@closedepthten{} \LWR@closedeptheleven{} \LWR@closedepthtwelve{}
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Closing stack levels}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% Close one nested level:
% \begin{macrocode}
\newcommand*{\LWR@closeoneprevious}{%
\LWR@closeone{}
\popclose{}
}
% \end{macrocode}
% \begin{macro}{\LWR@closeprevious} \marg{depth}
% Close everything up to the given depth:
% \begin{macrocode}
\newcommand*{\LWR@closeprevious}[1]{
% \end{macrocode}
% Close any pending paragraph:
% \begin{macrocode}
\LWR@stoppars
% \end{macrocode}
% Close anything nested deeper than the desired depth:
% \begin{macrocode}
\whiledo{\not\(\LWR@closedepthone<#1\)}{\LWR@closeoneprevious}
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{HTML tags, spans, divs, elements}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \subsection{Mapping \LaTeX{} Sections to HTML Sections}
% \begin{macrocode}
\newcommand*{\LWR@tagpart}{h2}
\newcommand*{\LWR@tagpartend}{/h2}
\newcommand*{\LWR@tagchapter}{h3}
\newcommand*{\LWR@tagchapterend}{/h3}
\newcommand*{\LWR@tagsection}{h4}
\newcommand*{\LWR@tagsectionend}{/h4}
\newcommand*{\LWR@tagsubsection}{h5}
\newcommand*{\LWR@tagsubsectionend}{/h5}
\newcommand*{\LWR@tagsubsubsection}{h6}
\newcommand*{\LWR@tagsubsubsectionend}{/h6}
\newcommand*{\LWR@tagparagraph}{span class="paragraph"{}}
\newcommand*{\LWR@tagparagraphend}{/span}
\newcommand*{\LWR@tagsubparagraph}{span class="subparagraph"{}}
\newcommand*{\LWR@tagsubparagraphend}{/span}
\newcommand*{\LWR@tagregularparagraph}{p}
% \end{macrocode}
% \subsection{HTML tags}
% \begin{macro}{\LWR@htmltagc} \marg{tag}
% Break ligatures in \acro{HTML} tags.
%
%|\protect| is in case the tag appears in TOC, LOF, LOT.
% \begin{macrocode}
\newcommand*{\LWR@htmltagc}[1]{%
{%
\LWR@origttfamily%
% \protect\LWR@origtexttt{%
% \protect\LWR@origtextbf{%
\LWR@origtextless#1\LWR@origtextgreater%
% }%
% }%
}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{environment}{LWR@nestspan} Disable \env{minipage}, \cs{parbox} inside a |span|.
%
% |\begin{LWR@nestspan}| must follow the opening |<span>| tag to allow
% \watchout
% a paragraph to start if the span is at the beginning of a new paragraph.
%
% |\end{LWR@nestspan}| must follow the |/span| or an extra |<p>| may appear.
% \watchout
%
% \changes{v0.20}{2016/12/24}{Fix: Minipages inside a span.}
%
% \begin{macrocode}
\newenvironment*{LWR@nestspan}
{%
\addtocounter{LWR@spandepth}{1}%
\RenewDocumentEnvironment{minipage}{O{t} o O{t} m}{}{}%
}%
{\addtocounter{LWR@spandepth}{-1}}
% \end{macrocode}
% \end{environment}
% \begin{macro}{\LWR@htmlspan} \marg{tag} \marg{text}
%
% \cs{LWR@spandepth} is used to ensure that paragraph tags are not
% generated inside a span. The exact sequence of when to add and subtract
% \watchout
% the counter is important to correctly handle the paragraph tags before
% and after the span.
%
% \begin{macrocode}
\NewDocumentCommand{\LWR@htmlspan}{m +m}{%
\LWR@ensuredoingapar%
\LWR@htmltagc{#1}%
\begin{LWR@nestspan}%
#2%
\LWR@htmltagc{/#1}%
\end{LWR@nestspan}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmlspanclass} \marg{class} \oarg{style} \marg{text}
% \begin{macrocode}
\NewDocumentCommand{\LWR@htmlspanclass}{m o +m}{%
\LWR@ensuredoingapar%
\LWR@subhtmlelementclass{span}{#1}[#2]%
\begin{LWR@nestspan}%
#3%
\LWR@htmltagc{/span}%
\end{LWR@nestspan}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmltag} \marg{tag}
% print an HTML tag: \textless{}tag\textgreater{}
% \begin{macrocode}
\newcommand*{\LWR@htmltagb}[1]{%
\LWR@htmltagc{#1}%
\endgroup%
}
\newcommand*{\LWR@htmltag}{%
\begingroup\catcode`\_=12
\LWR@htmltagb%
}
% \end{macrocode}
% \end{macro}
% \subsection{Block tags and comments}
% In the following, |\origtexttt| breaks ligatures, which may not be used for \acro{HTML} codes:
%
% \begin{macro}{\LWR@htmlopencomment}
% \begin{macro}{\LWR@htmlclosecomment}
% \begin{macrocode}
\newcommand*{\LWR@htmlopencomment}{%
% \LWR@origtexttt{\LWR@origtextbf{\LWR@origtextless{}!{-}{-}}}%
\begingroup\LWR@origttfamily\LWR@origtextless{}!{-}{-}\endgroup%
}
\newcommand*{\LWR@htmlclosecomment}{%
% \LWR@origtexttt{\LWR@origtextbf{{-}{-}\LWR@origtextgreater{}}}%
\begingroup\LWR@origttfamily{-}{-}\LWR@origtextgreater{}\endgroup%
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\LWR@htmlcomment} \marg{comment}
% \begin{macrocode}
\newcommand{\LWR@htmlcomment}[1]{%
\LWR@htmlopencomment{}%
\LWR@origtextrm{#1}%
\LWR@htmlclosecomment{}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmlblockcomment} \marg{comment}
% \begin{macrocode}
\newcommand{\LWR@htmlblockcommentb}[1]
{\LWR@stoppars\LWR@htmlcomment{#1}\LWR@startpars\endgroup}
\newcommand{\LWR@htmlblockcomment}
{%
\begingroup\catcode`\_=12%
\LWR@htmlblockcommentb%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmlblocktag} \marg{tag} print a stand-alone \acro{HTML} tag
% \begin{macrocode}
\newcommand*{\LWR@htmlblocktag}[1]{%
\LWR@stoppars%
\LWR@htmltag{#1}%
\LWR@startpars%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmlblocktagcomment} \marg{tag} \marg{HTML comment}
% \begin{macrocode}
\NewDocumentCommand{\LWR@htmlblocktagcomment}{m +m}{%
\LWR@stoppars%
\LWR@htmltag{#1}\LWR@htmlcomment{#2}\LWR@orignewline%
\LWR@startpars%
}
% \end{macrocode}
% \end{macro}
% \subsection{Div class and element class}
% \begin{macro}{\LWR@subhtmlelementclass} \marg{element} \marg{class} \oarg{style}
%
% Factored and reused in several places.
%
% \changes{v0.20}{2017/01/17}{Factored code.}
%
% \begin{macrocode}
\NewDocumentCommand{\LWR@subhtmlelementclass}{m m o}{%
\IfValueTF{#3}%
{% option
\ifthenelse{\equal{#3}{}}%
{\LWR@htmltag{#1 class="#2"}}% empty option
{\LWR@htmltag{#1 class="#2" style="#3"}}% non-empty option
}% option
{\LWR@htmltag{#1 class="#2"}}% no option
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmlelementclass} \marg{element} \marg{class} \oarg{style}
%
% \changes{v0.20}{2017/01/17}{Added optional style.}
%
% \begin{macrocode}
\NewDocumentCommand{\LWR@htmlelementclass}{m m o}{%
\LWR@stoppars%
\LWR@subhtmlelementclass{#1}{#2}[#3]%
\LWR@startpars%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmlelementclassend} \marg{element} \marg{class}
% \begin{macrocode}
\newcommand*{\LWR@htmlelementclassend}[2]{%
\LWR@stoppars%
\LWR@htmltag{/#1}%
\LWR@htmlcomment{End of #1 ``#2''}%
\LWR@startpars%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmldivclass} \marg{class} \oarg{style}
%
% \changes{v0.20}{2017/01/17}{Added optional style.}
%
% \begin{macrocode}
\NewDocumentCommand{\LWR@htmldivclass}{m o}{%
\LWR@htmlelementclass{div}{#1}[#2]%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmldivclassend} \marg{class}
% \begin{macrocode}
\newcommand*{\LWR@htmldivclassend}[1]{%
\LWR@htmlelementclassend{div}{#1}%
}
% \end{macrocode}
% \end{macro}
% \subsection{Single-line elements}
% A single-line element, without a paragraph tag for the line of text:
% \begin{macro}{\LWR@htmlelementclassline}
% \marg{element} \marg{class} \oarg{style} \marg{text}
% \begin{macrocode}
\NewDocumentCommand{\LWR@htmlelementclassline}{m m o +m}{%
\LWR@stoppars
\LWR@subhtmlelementclass{#1}{#2}[#3]%
#4%
\LWR@htmltag{/#1}
\LWR@startpars
}
% \end{macrocode}
% \end{macro}
%
%
% \subsection{HTML5 semantic elements}
% \begin{macro}{\LWR@htmlelement} \marg{element}
% \begin{macrocode}
\newcommand*{\LWR@htmlelement}[1]{%
\LWR@htmlblocktag{#1}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmlelementend} \marg{element}
% \begin{macrocode}
\newcommand*{\LWR@htmlelementend}[1]{%
\LWR@stoppars
\LWR@htmltag{/#1}
\LWR@startpars
}
\end{warpHTML}
% \end{macrocode}
% \end{macro}
% \subsection{High-level block and inline classes}
% \label{sec:highlevelclasses}
%
% These are high-level commands which allow the creation of
% arbitrary block or inline
% sections which may be formatted with \acro{CSS}.
% For other direct-formatting commands, see \cref{sec:directformatting}.
% \begin{environment}{BlockClass} \marg{class} \oarg{style} \quad
% High-level interface for div classes.
%
% \qquad Ex: |\begin{BlockClass}{class}| text |\end{BlockClass}|
%
% \changes{v0.20}{2017/01/03}{Renamed from "blockclass".}
% \changes{v0.20}{2017/01/17}{Added optional style.}
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
\NewDocumentEnvironment{BlockClass}{m o}
{
\LWR@htmldivclass{#1}[#2]
}
{
\LWR@htmldivclassend{#1}
}
\end{warpHTML}
% \end{macrocode}
%
% \codeprint
% \begin{macrocode}
\begin{warpprint}
\NewDocumentEnvironment{BlockClass}{m o}{}{}
\end{warpprint}
% \end{macrocode}
% \end{environment}
%
%
% \begin{macro}{\BlockClassSingle} \marg{class} \marg{text} \quad
% A single-line |div|, without a paragraph tag for the line of text.
%
% \changes{v0.20}{2017/01/03}{Renamed from "LWR@htmldivclassline".}
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
\newcommand{\BlockClassSingle}[2]{%
\LWR@htmlelementclassline{div}{#1}{#2}%
}
\end{warpHTML}
% \end{macrocode}
%
% \codeprint
% \begin{macrocode}
\begin{warpprint}
\newcommand{\BlockClassSingle}[2]{#2}
\end{warpprint}
% \end{macrocode}
%
% \end{macro}
% \begin{macro}{\InlineClass} \marg{class} \oarg{style} \marg{text} \quad
% High-level interface for inline span classes.
%
% \changes{v0.20}{2017/01/03}{Renamed from "inlineclass".}
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
\NewDocumentCommand{\InlineClass}{m o m}{%
\LWR@htmlspanclass{#1}[#2]{#3}%
}
\end{warpHTML}
% \end{macrocode}
% \codeprint
% \begin{macrocode}
\begin{warpprint}
\NewDocumentCommand{\InlineClass}{m o m}{#3}
\end{warpprint}
% \end{macrocode}
% \end{macro}
% \subsection{Closing HTML tags}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% Sections H1, H2, etc.\ do not need a closing \acro{HTML} tag, but we add a comment for readability:
% \begin{macrocode}
\newcommand*{\LWR@printclosepart}
{\LWR@htmlcomment{Closing part}}
\newcommand*{\LWR@printclosechapter}
{\LWR@htmlcomment{Closing chapter}}
\newcommand*{\LWR@printclosesection}
{\LWR@htmlcomment{Closing section}}
\newcommand*{\LWR@printclosesubsection}
{\LWR@htmlcomment{Closing subsection}}
\newcommand*{\LWR@printclosesubsubsection}
{\LWR@htmlcomment{Closing subsubsection}}
\newcommand*{\LWR@printcloseparagraph}
{\LWR@htmlcomment{Closing paragraph}}
\newcommand*{\LWR@printclosesubparagraph}
{\LWR@htmlcomment{Closing subparagraph}}
% \end{macrocode}
% Lists require closing \acro{HTML} tags:
% \begin{macrocode}
\newcommand*{\LWR@printcloselistitem}
{\LWR@htmltag{/li}}
\newcommand*{\LWR@printclosedescitem}
{\LWR@htmltag{/dd}}
\newcommand*{\LWR@printcloseitemize}
{\LWR@htmltag{/ul}}
\newcommand*{\LWR@printcloseenumerate}
{\LWR@htmltag{/ol}}
\newcommand*{\LWR@printclosedescription}
{\LWR@htmltag{/dl}}
% \end{macrocode}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Paragraph handling}
% \label{sec:parhanding}
%
% These commands generate the HTML paragraph tags when allowed and
% required.
%
% Paragraph tags are or are not allowed depending on many conditions.
% \Cref{sec:parstartstop} has high-level commands which allow
% paragraph-tag generation to start/stop.
% Even when allowed (\cs{LWR@doingstartpars}),
% tags are not generated until a \LaTeX{} paragraph
% is being used (\cs{LWR@doingapar}).
% |LWR@lateximagedepth| is used to prevent nesting tags inside
% a |lateximage|.
% |LWR@spandepth| is used to prevent nesting paragraph tags inside
% a paragraph, which became important inside \cs{fbox} commands and other spans.
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \DescribeCounter{LWR@spandepth}
% Do not create paragraph tags inside of an \acro{HTML} span.
% \begin{macrocode}
\newcounter{LWR@spandepth}
\setcounter{LWR@spandepth}{0}
% \end{macrocode}
% \DescribeBoolean{LWR@doingstartpars}
% Tells whether paragraphs may be generated.
% \begin{macrocode}
\newbool{LWR@doingstartpars}
\boolfalse{LWR@doingstartpars}
% \end{macrocode}
% \DescribeBoolean{LWR@doingapar}
% Tells whether have actually generated and are currently processing paragraph text.
% \begin{macrocode}
\newbool{LWR@doingapar}
\global\boolfalse{LWR@doingapar}
% \end{macrocode}
% \begin{macro}{\LWR@ensuredoingapar}
% If are about to print something visible, and
% if allowed to start a new paragraph,
% ensure that are |LWR@doingapar|, so that paragraph tags are placed:
% \begin{macrocode}
\newcommand*{\LWR@ensuredoingapar}{%
\ifbool{LWR@doingstartpars}%
{\global\booltrue{LWR@doingapar}}%
{}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@openparagraph}
% \begin{macrocode}
\newcommand*{\LWR@openparagraph}
{%
% \end{macrocode}
% See if paragraph handling is enabled:
% \begin{macrocode}
\ifbool{LWR@doingstartpars}%
{% handling pars
% \end{macrocode}
% See if have already started a \env{lateximage} or a |span|.
% If so, do not generate nested paragraph tags.
% \begin{macrocode}
\ifthenelse{%
\cnttest{\value{LWR@lateximagedepth}}{>}{0} \OR%
\cnttest{\value{LWR@spandepth}}{>}{0}%
}% nested par tags?
% \end{macrocode}
% If so: Do nothing if already started a \env{lateximage} page. Cannot nest a \env{lateximage}.
% Also do nothing if already inside a |span|. Do not nest paragraph tags
% inside a |span|.
% \begin{macrocode}
{}% no nested par tags
% \end{macrocode}
% Else: No \env{lateximage} or |span| has been started yet,
% so it's OK to generate paragraph tags.
% \begin{macrocode}
{% yes nest par tags
\LWR@htmltagc{\LWR@tagregularparagraph}%
% \end{macrocode}
% Manually indent item list labels to avoid left margin intrustion:
%
% \LaTeX{} default list environments use |\@itemdepth| and |\@enumdepth|, but
% \pkg{lwarp} uses the \pkg{enumitem} package, which uses |\@listdepth|.
%
% See if are nested inside an item list:
% \begin{macrocode}
\ifnumcomp{\@listdepth}{>}{0}%
{%
% \end{macrocode}
% If so, leave some horizontal room in the \LaTeX{} \acro{PDF} output for list labels:
% \begin{macrocode}
\LWR@orighspace{1in}%
}{}%
% \end{macrocode}
% Now have started a paragraph.
% \begin{macrocode}
\global\booltrue{LWR@doingapar}%
% \end{macrocode}
% At the endof each paragraph,
% generate closing tag and do regular |/par| stuff.
% (Attempting to use the \pkg{everyhook} |cr| hook
% for \cs{LWR@closeparagraph} does not work well.)
% \begin{macrocode}
\let\par\LWR@closeparagraph%
}% end of yes nest par tags
}% end of handling pars
{}% not handling pars
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@closeparagraph}
% \changes{v0.20}{2017/01/17}{No break tags in the start/end of a tabular.}
% \changes{v0.20}{2017/01/17}{\cs{unskip} extra spaces.}
% \begin{macrocode}
\newcommand*{\LWR@closeparagraph}
{%
% \end{macrocode}
% See if paragraph handling is enabled:
% \begin{macrocode}
\ifbool{LWR@doingapar}%
% \end{macrocode}
% If currently in paragraph mode:
% \begin{macrocode}
{% handling pars
% \end{macrocode}
% See if already started a \env{lateximage} or a |span|:
% \begin{macrocode}
\ifthenelse{%
\cnttest{\value{LWR@lateximagedepth}}{>}{0} \OR%
\cnttest{\value{LWR@spandepth}}{>}{0}%
}%
% \end{macrocode}
% Do nothing if already started a \env{lateximage} or a |span|,
% but add a parbreak if in a span but not a \env{lateximage}.
% \begin{macrocode}
{% no nested par tags
\ifthenelse{%
\cnttest{\value{LWR@spandepth}}{>}{0}%
\AND%
\cnttest{\value{LWR@lateximagedepth}}{=}{0}%
}%
{%
\ifbool{LWR@intabularmetadata}{}{\unskip\LWR@htmltagc{br /}}%
}%
{}%
}% no nested par tags
% \end{macrocode}
% If have not already started a \env{lateximage} or a |span|:
% \begin{macrocode}
{% yes nest par tags
% \end{macrocode}
% Print a closing tag:
% \begin{macrocode}
\unskip%
\LWR@htmltagc{/\LWR@tagregularparagraph}%
% \end{macrocode}
% No longer doing a paragraph:
% \begin{macrocode}
\global\boolfalse{LWR@doingapar}%
% Disable the special \env{minipage} \& \cs{hspace} interaction
% until a new minipage is found:
% \begin{macrocode}
\global\boolfalse{LWR@minipagethispar}%
}% end of yes nest par tags
}% end of handling pars
% \end{macrocode}
% Add a parbreak if in a span,
% but not in a table outside a row:
% \begin{macrocode}
{% not handling pars
\ifthenelse{\cnttest{\value{LWR@spandepth}}{>}{0}}%
{\ifbool{LWR@intabularmetadata}{}{\unskip\LWR@htmltagc{br /}}}%
{}%
}% not handling pars
% \end{macrocode}
% Finish with regular paragraph processing
% \begin{macrocode}
\LWR@origpar%
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Paragraph start/stop handling}
% \label{sec:parstartstop}
% These commands allow/disallow the generation of \acro{HTML}
% paragraph tags.
%
% \Cref{sec:parhanding} has the commands which actually generate
% the tags.
%
% The |everyhook| package is used to generate the opening
% paragraph tags. The closing tags are generated by |\par|.
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@startpars}
% Begin handling \acro{HTML} paragraphs.
% This allows an \acro{HTML} paragraph to start, but one has not yet begun.
% \begin{macrocode}
\newcommand*{\LWR@startpars}%
{%
% \end{macrocode}
% See if currently handling \acro{HTML} paragraphs:
% \begin{macrocode}
\ifbool{LWR@doingstartpars}%
% \end{macrocode}
% If already in paragraph mode, do nothing.
% \begin{macrocode}
{}%
% \end{macrocode}
% If not currently in paragraph mode:
% \begin{macrocode}
{%
% \end{macrocode}
% At the start of each paragraph, generate an opening tag:
% \begin{macrocode}
\PushPreHook{par}{\LWR@openparagraph}%
% \end{macrocode}
% At the end of each paragraph, generate closing tag and do regular |/par| actions:
% \begin{macrocode}
\let\par\LWR@closeparagraph
}% an intentionally blank line
% \end{macrocode}
% Are now handling paragraphs, but have not yet actually started one:
% \begin{macrocode}
\global\setbool{LWR@doingstartpars}{true}%
% \end{macrocode}
% No <par> tag yet to undo:
% \begin{macrocode}
\global\boolfalse{LWR@doingapar}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@stoppars}
% Stop handling \acro{HTML} paragraphs.
% Any currently open \acro{HTML} paragraph is closed, and no more will be opened.
% \begin{macrocode}
\newcommand*{\LWR@stoppars}%
{%
% \end{macrocode}
% See if currently handling \acro{HTML} paragraphs:
% \begin{macrocode}
\ifbool{LWR@doingapar}%
% \end{macrocode}
% if currently in an \acro{HTML} paragraph:
% \begin{macrocode}
{%
% \end{macrocode}
% Print a closing tag:
% \begin{macrocode}
\unskip%
\LWR@htmltagc{/\LWR@tagregularparagraph}%
% \end{macrocode}
% No longer have an open HTML paragraph:
% \begin{macrocode}
\global\boolfalse{LWR@doingapar}%
% \end{macrocode}
% Disable the special \env{minipage} \& \cs{hspace} interaction
% until a new minipage is found:
% \begin{macrocode}
\global\boolfalse{LWR@minipagethispar}
}% an intentionally blank line
% \end{macrocode}
% If was not in an \acro{HTML} paragraph:
% \begin{macrocode}
{}%
% \end{macrocode}
% See if currently allowing \acro{HTML} paragraphs:
% \begin{macrocode}
\ifbool{LWR@doingstartpars}%
% \end{macrocode}
% If so: clear the |par| hook to no longer catch paragraphs:
% \begin{macrocode}
{%
\ClearPreHook{par}%
}%
% \end{macrocode}
% Else: do nothing
% \begin{macrocode}
{}%
% \end{macrocode}
% no longer in paragraph mode
% \begin{macrocode}
\global\setbool{LWR@doingstartpars}{false}%
% \end{macrocode}
% no |<p>| tag to undo:
% \begin{macrocode}
\global\boolfalse{LWR@doingapar}%
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Page headers and footers}
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% In the following, catcode is manually changes back and forth
% without groups, since new macros are being defined which must
% not be contained within the groups.
% \begin{macrocode}
\newcommand{\LWR@firstpagetop}{} % for the home page alone
\newcommand{\LWR@pagetop}{} % for all other pages
\newcommand{\LWR@pagebottom}{}
\newcommand{\LWR@setfirstpagetopb}[1]{%
\renewcommand{\LWR@firstpagetop}{#1}
\catcode`\_=8
}
% \end{macrocode}
% \begin{macro}{\SetFirstPageTop} \marg{text and logos}
% \begin{macrocode}
\newcommand{\SetFirstPageTop}{%
\catcode`\_=12
\LWR@setfirstpagetopb
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\newcommand{\LWR@setpagetopb}[1]{%
\renewcommand{\LWR@pagetop}{#1}
\catcode`\_=8
}
% \end{macrocode}
% \begin{macro}{\SetPageTop} \marg{text and logos}
% \begin{macrocode}
\newcommand{\SetPageTop}{%
\catcode`\_=12
\LWR@setpagetopb
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\newcommand{\LWR@setpagebottomb}[1]{%
\renewcommand{\LWR@pagebottom}{#1}
\catcode`\_=8
}
% \end{macrocode}
% \begin{macro}{\SetPageBottom} \marg{text and logos}
% \begin{macrocode}
\newcommand{\SetPageBottom}{%
\catcode`\_=12
\LWR@setpagebottomb
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \section{CSS}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@currentcss} The \acro{CSS} filename to use.
% This may be changed mid-document using \cs{NewCSS},
% allowing different \acro{CSS} files to be used
% for different sections of the document.
% \begin{macrocode}
\newcommand*{\LWR@currentcss}{lwarp.css}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\NewCSS} \marg{new-css-filename.css}
%
% Assigns the \acro{CSS} file to be used by the following \acro{HTML} pages.
% \begin{macrocode}
\newcommand*{\LWR@newcssb}[1]{%
\renewcommand*{\LWR@currentcss}{#1}
\catcode`\_=8
}
\newcommand*{\NewCSS}{
\catcode`\_=12
\LWR@newcssb
}
\end{warpHTML}
% \end{macrocode}
%
% \codeprint
% \begin{macrocode}
\begin{warpprint}
\newcommand*{\NewCSS}[1]{}
\end{warpprint}
% \end{macrocode}
% \end{macro}
% \section{HTML meta description}
% \changes{v0.20}{2016/06/27}{Added \cs{NewHTMLdescription}.}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@currentHTMLdescription} The \acro{HTML} meta description to use.
%
% This is placed inside an \acro{HTML} meta tag at the start of each file.
% This may be changed mid-document using \cs{NewHTMLdescription},
% allowing different \acro{HTML} descriptions to be used
% for different sections of the document.
%
% Do not use double quotes, and do not exceed 150 characters.
% \begin{macrocode}
\newcommand{\LWR@currentHTMLdescription}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\NewHTMLdescription} \marg{New \acro{HTML} meta description.}
%
% Assigns the \acro{HTML} file's description meta tag
% \index{HTML>meta tag>description}
% \index{description>HTML meta tag}
% \index{meta tag, HTML>description}
% \begin{macrocode}
\newcommand{\NewHTMLdescription}[1]{%
\renewcommand{\LWR@currentHTMLdescription}{#1}
}
\end{warpHTML}
% \end{macrocode}
%
% \codeprint
% \begin{macrocode}
\begin{warpprint}
\newcommand{\NewHTMLdescription}[1]{}
\end{warpprint}
% \end{macrocode}
% \end{macro}
% \section{Footnotes}
% \label{sec:footnotes}
%
% \index{footnotes}
%
%
% Several kinds of footnotes are used: in a regular page, in a minipage, or
% as thanks in the titlepage. Each of these is handle differently.
%
% \subsection{Regular page footnotes}
% In \LaTeXe{} printed documents, footnotes are placed at the bottom of the printed page.
% For \acro{HTML}, footnotes will be replaced by page notes
% using the \pkg{pagenote} package.
% Footnotes will then appear at the bottom of the \acro{HTML} page.
%
% See \cref{sec:footnotesregular} for the implementation.
%
% \subsection{Minipage footnotes}
% See \cref{sec:footnotesminipage} for minipage footnotes.
%
% \subsection{Titlepage thanks}
% See \cref{sec:titlehtml} for titlepage footnotes.
%
%
% \subsection{Regular page footnote implementation}
% \label{sec:footnotesregular}
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% Delayed in case the user's preamble loaded and adjusted \pkg{pagenote}:
% \begin{macrocode}
\AtEndPreamble{
% \end{macrocode}
% \begin{macro}{\notedivision}
%
% Prints the footnote heading at the end of the page.
% \begin{macrocode}
\renewcommand*{\notedivision}
{\BlockClassSingle{footnoteheader}{}}
% \end{macrocode}
% \end{macro}
% \begin{docsidebar}[To print the word ``Notes:'' at the top of the footnotes:]
% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4]
% \renewcommand*{\notedivision}| \\
% {\BlockClassSingle{footnoteheader}{Notes:}}
% \end{Verbatim}
% \end{docsidebar}
% \begin{macro}{\pagenotesubhead} \marg{num} \marg{title}
%
% Don't print page note headings in \acro{HTML} page notes.
% \begin{macrocode}
\renewcommand{\pagenotesubhead}[2]{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\footnote} \oarg{id} \marg{text}
% Footnotes now become page notes.
% \begin{macrocode}
\let\footnote\LWR@origpagenote
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\notenuminnotes} \marg{number}
%
% Sets the page notes to use superscripts to match standard classes.
% \begin{macrocode}
\renewcommand{\notenuminnotes}[1]{%
\textsuperscript{#1} }
% \end{macrocode}
% \end{macro}
%\begin{macro}{\noteentry} \marg{1: note number} \marg{2: id} \marg{3: text} \marg{4: pagenum}
%
% \changes{v0.14}{2016/03/28}{Fix for label inside a footnote.}
%
% \begin{macrocode}
\let\LWR@orignoteentry\noteentry
\renewcommand{\noteentry}[4]{%
% \end{macrocode}
% \DescribeMacro{\@currentlabel}
% \DescribeMacro{\cref@currentlabel}
% A label may be used inside a note, so the proper \cs{@currentlabel} must be set
% inside a group. Likewise for \pkg{cleveref}'s \cs{cref@currentlabel}.
% \begin{macrocode}
\begingroup%
\renewcommand*{\@currentlabel}{#1}%
\renewcommand*{\cref@currentlabel}{[pagenote][#1][]{#1}}%
% \end{macrocode}
% Re-use \pkg{pageref}'s code, with an extra endgroup:
% \begin{macrocode}
\LWR@orignoteentry{#1}{#2}{#3}{#4}%
\endgroup%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@printpendingnotes}
% Prints the page notes at the end of the section.
% \begin{macrocode}
\newcommand*{\LWR@printpendingnotes}{
% \end{macrocode}
% If there are footnotes to print, open a new |div| and print the notes.
% \begin{macrocode}
\ifthenelse{\cnttest{\value{pagenote}}{>}{0}}%
{
\begin{BlockClass}{footnotes}
% \end{macrocode}
% Print any pending endnotes, allowing new endnotes to accumulate.
% \begin{macrocode}
\LWR@origprintnotes*
% \end{macrocode}
% Start over with new page notes.
% \begin{macrocode}
\setcounter{pagenote}{0}
\end{BlockClass}
}
{}
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
}% \AtEndPreamble
% \end{macrocode}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Marginpars}
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\marginpar} \oarg{left} \marg{right}
%
% \changes{v0.21}{2017/02/11}{Fixed source listing.}
%
% \begin{macrocode}
\renewcommand{\marginpar}[2][]{%
\LWR@htmlspanclass{marginpar}{#2}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Splitting HTML files}
%
% \begin{itemize}
% \item Files are split according to |FileDepth| and |CombineHigherDepths|.
% \item Filenames are sanitized by |\LWR@filenamenoblanks|.
% \item |\LWR@newhtmlfile| finishes an \acro{HTML} page,
% adds a comment to tell where and how to split the file,
% then starts a new \acro{HTML} page.
% \end{itemize}
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% \DescribeCounter{FileDepth} \marg{section depth} determines how deeply
% to break into new \acro{HTML} files, similar to |tocdepth|.
% The default of -5 produces one large \acro{HTML} file.
% \begin{macrocode}
\newcounter{FileDepth}
\setcounter{FileDepth}{-5}
% \end{macrocode}
% \DescribeBoolean{CombineHigherDepths} Combile higher-level sections
% together into one file?
% \begin{macrocode}
\newbool{CombineHigherDepths}
\booltrue{CombineHigherDepths}
% \end{macrocode}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@thisfilename}
% The currently-active filename or number.
% \begin{macrocode}
\newcommand*{\LWR@thisfilename}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@thisnewfilename}
% The filename being sanitized.
% \begin{macrocode}
\newcommand*{\LWR@thisnewfilename}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@filenamenoblanks} \marg{filename}
%
% Convert blanks into dashes, removes short words,
% store result in \\ |\LWR@thisfilename|.
%
% Be sure that this does not result in filename collisions!
% \watchout
% Use the optional TOC caption entry parameter for formatting.
% Remember to |\protect| \LaTeX{} commands which appear in
% section names and TOC captions.
% \begin{macrocode}
\newcommand*{\LWR@filenamenoblanks}[1]{%
\begingroup
% \end{macrocode}
% Locally temporarily disable direct-formatting commands,
% not used in filenames:
% \begin{macrocode}
\renewcommand*{\HTMLunicode}[1]{}
\renewcommand*{\HTMLentity}[1]{##1}
\renewcommand*{\LWR@htmltagc}[1]{}
\DeclareExpandableDocumentCommand{\InlineClass}{m o m}{##3}
% \end{macrocode}
% Ampersand becomes ``and'', which is a short word and is then removed from the filename.
% \begin{macrocode}
\renewcommand*{\&}{and}
\renewcommand{\textit}[1]{##1}
\renewcommand{\textsc}[1]{##1}
\renewcommand{\textsl}[1]{##1}
\renewcommand{\textbf}[1]{##1}
\renewcommand{\texttt}[1]{##1}
\renewcommand{\textsf}[1]{##1}
\renewcommand{\textrm}[1]{##1}
\renewcommand{\textsuperscript}[1]{##1}
\renewcommand{\textsubscript}[1]{##1}
% \end{macrocode}
% Replaces common symbols and short words with hyphens:
%
% \begin{macrocode}
\edef\LWR@thisnewfilename{#1}
\fullexpandarg
% \end{macrocode}
% Convert spaces into hyphens:
% \begin{macrocode}
\StrSubstitute{\LWR@thisnewfilename}{ }{-}[\LWR@thisnewfilename]
% \end{macrocode}
% Convert punctutation into hyphens:
% ^^A \StrSubstitute{\LWR@thisnewfilename}{é}{e}[\LWR@thisnewfilename]
% \begin{macrocode}
\StrSubstitute{\LWR@thisnewfilename}{,}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{'}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}%
{\LWR@origampersand}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{+}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{,}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{/}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{:}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{;}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{=}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{?}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{@}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{"}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}%
{\textless}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}%
{\textgreater}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{\#}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{\%}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{\{}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{\}}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{|}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}%
{\textbackslash}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{^}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{~{}}{-}[\LWR@thisnewfilename]
% "~{}" for babel
\StrSubstitute{\LWR@thisnewfilename}{[}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{]}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{`}{-}[\LWR@thisnewfilename]
% \end{macrocode}
% Convert short words:
% \begin{macrocode}
\StrSubstitute{\LWR@thisnewfilename}{-s-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-S-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-a-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-A-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-an-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-AN-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-to-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-TO-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-by-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-BY-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-of-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-OF-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-and-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-AND-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-for-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-FOR-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-the-}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{-THE-}{-}[\LWR@thisnewfilename]
% \end{macrocode}
% Convert multiple hyphens:
% \begin{macrocode}
\StrSubstitute{\LWR@thisnewfilename}{-----}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{----}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{---}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{--}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{—}{-}[\LWR@thisnewfilename]
% emdash
\StrSubstitute{\LWR@thisnewfilename}{–}{-}[\LWR@thisnewfilename]
% endash
\global\let\LWR@thisfilename\LWR@thisnewfilename% return a global result
\endgroup
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@newhtmlfile} \marg{section name}
% \changes{v0.18}{2016/04/23}{Sidetoc after title, improving responsive design.}
% \changes{v0.21}{2017/02/22}{Skip title if not given.}
%
% Finishes the current \acro{HTML} page with footnotes, footer, navigation,
% then starts a new \acro{HTML} page with an \acro{HTML} comment telling where to
% split the page and what the new filename and \acro{CSS} are, then adds
% navigation, side TOC, header, and starts the text body.
% \begin{macrocode}
\newcommand*{\LWR@newhtmlfile}[1]{
% \end{macrocode}
% At the bottom of the ending file:
% \begin{macrocode}
\LWR@htmlelementclassend{section}{textbody}
\LWR@printpendingnotes
\LWR@htmlelement{footer}
\LWR@pagebottom
\LWR@htmlelementend{footer}
% \end{macrocode}
% No bottom navigation if are finishing the home page:
% Presumably has a table-of-contents printed.
% \begin{macrocode}
\ifnumcomp{\value{LWR@htmlfilenumber}}{>}{0}{\LWR@botnavigation}{}
% \end{macrocode}
% End of this \acro{HTML} file:
% \begin{macrocode}
\LWR@stoppars
\LWR@htmltag{/body}\LWR@orignewline
\LWR@htmltag{/html}\LWR@orignewline
\addtocounter{LWR@htmlfilenumber}{1}%
% \end{macrocode}
% If using a filename, create a version without blanks.
% The filename without blanks will be placed into \cs{LWR@thisfilename}.
% If not using a filename, the file number will be used instead.
% \changes{v0.12}{2016/03/13}{Bugfix: TOC with numbered files.}
% \begin{macrocode}
\ifbool{FileSectionNames}%
{\LWR@filenamenoblanks{#1}}
{\renewcommand*{\LWR@thisfilename}{\theLWR@htmlfilenumber}}
% \end{macrocode}
% Include an \acro{HTML} comment to instruct lwarpmk
% where to split the files apart.
% Uses pipe-separated fields for |split_html.gawk|.
% Uses monospaced font with ligatures disabled for everything except the title.
% \begin{macrocode}
\LWR@htmlblockcomment{%
\LWR@origtexttt{|Start file|%
\LWR@htmlsectionfilename{\LWR@thisfilename}|}%
}
% \end{macrocode}
% At the top of the starting file:
% \begin{macrocode}
\LWR@stoppars
\LWR@filestart{ — #1}% there is an EMdash in front of the #1
\LWR@topnavigation
\LWR@htmlelement{header}
\LWR@pagetop
\LWR@htmlelementend{header}
\ifcsvoid{thetitle}{}{\LWR@printthetitle}
\LWR@sidetoc
\LWR@htmlelementclass{section}{textbody}
\LWR@stoppars
\setcounter{LWR@latestautopage}{\value{page}}
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Sectioning}
%
% Sectioning and cross-references have been emulated from scratch, rather
% than try to patch several layers of existing \LaTeX{} code and packages.
% Formatting is handled by \acro{CSS}, so the emulated code has much less
% work to do than the print versions.
%
% Section names and the resulting filenames with accented characters
% \margintag{Unicode}
% are partially supported, depending on the ability of
% |pdflatex| to generate characters and |pdftotext| to read them.
% If extra symbols appear in the text,
% \watchout
% it may be that |pdflatex| is actually producing a symbol over or under a
% character, resulting in |pdftotext| picking up the accent symbol separately.
%
% \XeLaTeX{} and \LuaLaTeX{} directly support accented section and file names.
% \index{accents}\index{Unicode>file \& section names}\index{UTF-8>file \& section names}
% \index{XeLaTeX>file \& section names}
% \index{LuaLaTeX>file \& section names}
%
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
%
%
% \subsection{Book class commands}
%
%
% \begin{macro}{\mainmatter}
%
% Declare the main matter section of the document. Does not reset the page number,
% \watchout
% which must be consecutive arabic numbers for the \acro{HTML} conversion.
% \begin{macrocode}
\newbool{LWR@mainmatter}
\DeclareDocumentCommand{\mainmatter}{}{%
\booltrue{LWR@mainmatter}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\frontmatter}
%
% Declare the front matter section of the document,
% using arabic numbering for the internal numbering. Does not reset the page number.
% \begin{macrocode}
\DeclareDocumentCommand{\frontmatter}{}{%
\boolfalse{LWR@mainmatter}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\backmatter}
%
% Declare the back matter section of the document. Does not reset the page number.
% \begin{macrocode}
\DeclareDocumentCommand{\backmatter}{}{%
\boolfalse{LWR@mainmatter}
}
% \end{macrocode}
% \end{macro}
%
%
% \subsection{Sectioning support macros}
%
% \begin{macro}{\LWR@sectionumber} \marg{section type}
%
% Typeset a section number and its trailing space with CSS formatting:
% \begin{macrocode}
\newcommand*{\LWR@sectionnumber}[1]{%
\InlineClass{sectionnumber}{#1} %
}
% \end{macrocode}
% \end{macro}
% \DescribeObject{autosec} A tag used by the TOC and index.
%
% \begin{macro}{\LWR@createautosec} \marg{section type}
%
% Create an autosection tag.
% \begin{macrocode}
\newcommand*{\LWR@createautosec}[1]{%
\LWR@htmltag{#1 id="autosec-\thepage"{}}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@pushoneclose} \marg{depth} \marg{printclose}
% Stacks the new sectioning level's closing tag,
% to be used when this section is closed some time later.
%
% |\LWR@stoppars| must be executed first.
% \watchout
% \begin{macrocode}
\NewDocumentCommand{\LWR@pushoneclose}{m m}{\pushclose{#2}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@startnewdepth} \marg{depth} \marg{printclose}
%
% Closes currently stacked tags of a lesser level,
% then opens the new nesting level by saving this new sectioning
% level's closing tag for later use.
%
% |\LWR@stoppars| must be executed first.
% \watchout
% \begin{macrocode}
\NewDocumentCommand{\LWR@startnewdepth}{m m}{%
% \end{macrocode}
% Close any stacked sections up to this new one.
% \begin{macrocode}
\LWR@closeprevious{#1}%
% \end{macrocode}
% Push a new section depth:
% \begin{macrocode}
\LWR@pushoneclose{#1}{#2}%
}
% \end{macrocode}
% \end{macro}
%
%
%
% \DescribeCounter{LWR@prevFileDepth} Remembers the previous |LWR@FileDepth|.
%
% Initialized to a deep level so that any section will trigger a new \acro{HTML}
% page after the home page.
% \begin{macrocode}
\newcounter{LWR@prevFileDepth}
\setcounter{LWR@prevFileDepth}{\LWR@depthsubparagraph}
% \end{macrocode}
%
%
%
% \begin{macro}{\LWR@section} * \oarg{TOC name} \marg{name} \marg{sectiontype}
%
% \changes{v0.20}{2017/01/09}{Combined higher-level sections together into files.}
%
% The common actions for the high-level sectioning commands.
% \begin{macrocode}
\DeclareDocumentCommand{\LWR@section}{m m m m}{%
\LWR@traceinfo{LWR@section}%
\LWR@stoppars%
% \end{macrocode}
% Cancel special \env{minipage} horizontal space interaction:
% \begin{macrocode}
\global\boolfalse{LWR@minipagethispar}%
% \end{macrocode}
% Generate a new LaTeX page so that TOC and index page number points to the section:
% \begin{macrocode}
\LWR@orignewpage%
% \end{macrocode}
% Start a new \acro{HTML} file if not starred, and is a shallow sectioning depth:
% \begin{macrocode}
\LWR@traceinfo{LWR@section: testing about to start a new HTML file}%
\IfBooleanTF{#1}{}{% not starred
\ifthenelse{%
\cnttest{\csuse{LWR@depth#4}}{<=}{\value{FileDepth}}%
\AND%
\(%
\NOT\boolean{CombineHigherDepths}\OR%
\cnttest{\csuse{LWR@depth#4}}{<=}{\value{LWR@prevFileDepth}}%
\)%
}%
% \end{macrocode}
% If so: start a new \acro{HTML} file:
% \begin{macrocode}
{% new file
\LWR@traceinfo{LWR@section: new HTML file}%
% \end{macrocode}
% See if there was an optional TOC name entry:
% \begin{macrocode}
\IfNoValueTF{#2}%
% \end{macrocode}
% If no optional entry
% \begin{macrocode}
{\LWR@newhtmlfile{#3}}%
% \end{macrocode}
% If yes an optional entry
% \begin{macrocode}
{\LWR@newhtmlfile{#2}}%
}% new file
% \end{macrocode}
% Else: No new \acro{HTML} file:
% \begin{macrocode}
{}% not new file
}% not starred
% \end{macrocode}
% Remember this section's name for \cs{nameref}:
% \begin{macrocode}
\LWR@traceinfo{LWR@section: about to LWR@setlatestname}%
\IfValueTF{#2}{\LWR@setlatestname{#2}}{\LWR@setlatestname{#3}}%
% \end{macrocode}
% Print an opening comment with the level and the name;
% ex: ``section'' ``Introduction''
% \begin{macrocode}
\LWR@htmlcomment{Opening #4 ``#3''{}}
% \end{macrocode}
% For inline sections paragraph and subparagraph, start a new paragraph now:
% \begin{macrocode}
\ifthenelse{%
\cnttest{\csuse{LWR@depth#4}}{>=}{\LWR@depthparagraph}%
}%
{\LWR@startpars}
{}
% \end{macrocode}
% Create the opening tag with an autosec:
% \begin{macrocode}
\LWR@createautosec{\csuse{LWR@tag#4}}%
% \end{macrocode}
% If not starred, step counter and add to TOC:
% \begin{macrocode}
\IfBooleanTF{#1}%
{}% starred
{% not starred
% \end{macrocode}
% Only add a numbered TOC entry if section number is not too deep:
% \begin{macrocode}
\ifthenelse{%
\cnttest{\csuse{LWR@depth#4}}{<=}{\value{secnumdepth}}%
}%
{% if secnumdepth
% \end{macrocode}
% If in the main matter, step the counter and add the TOC entry.
% For |article| class, \pkg{lwarp} assumes that all is mainmatter.
% \begin{macrocode}
\LWR@traceinfo{LWR@section: about to test main matter}%
\ifbool{LWR@mainmatter}%
{%
\LWR@traceinfo{LWR@section: yes mainmatter}%
\refstepcounter{#4}%
% \end{macrocode}
% Add main matter numbered TOC entry with the TOC name or the regular name:
% \begin{macrocode}
\LWR@traceinfo{LWR@section: about to addcontentsline}%
\addcontentsline{toc}{#4}%
{\protect\LWR@sectionnumber{\csuse{the#4}}%
\IfValueTF{#2}{#2}{#3}}%
\LWR@traceinfo{LWR@section: finished addcontentsline}%
}% end of if main matter
% \end{macrocode}
% If not main matter, add unnumbered TOC name or regular name:
% \begin{macrocode}
{% not main matter
\LWR@traceinfo{LWR@section: no main matter}%
\addcontentsline{toc}{#4}{\IfValueTF{#2}{#2}{#3}}%
}% end of not main matter
}% end of secnumdepth
% \end{macrocode}
% Deeper than secnumdepth, so add an unnumbered TOC entry:
% \begin{macrocode}
{%
\addcontentsline{toc}{#4}{\IfValueTF{#2}{#2}{#3}}%
}%
% \end{macrocode}
% For part, print the section type:
% \begin{macrocode}
\ifbool{LWR@mainmatter}%
{%
\ifthenelse{%
\(\cnttest{\csuse{LWR@depth#4}}{<=}%
{\value{secnumdepth}}\) \AND
\(\cnttest{\csuse{LWR@depth#4}}{<=}{\LWR@depthpart}\)
}%
{\csuse{#4name}~{}}%
{}%
% \end{macrocode}
% Print the section number:
% \begin{macrocode}
\LWR@traceinfo{LWR@section: about to print section number}%
\ifthenelse{%
\cnttest{\csuse{LWR@depth#4}}{<=}{\value{secnumdepth}}%
}%
{\protect\LWR@sectionnumber{\csuse{the#4}}}%
{}%
\LWR@traceinfo{LWR@section: finished print section number}%
}{}%
}% end of not starred
% \end{macrocode}
% Print the section name:
% \begin{macrocode}
#3
% \end{macrocode}
% close the heading tag, such as /H2
% \begin{macrocode}
\LWR@htmltag{\csuse{LWR@tag#4end}}%
% \end{macrocode}
% Generate a \LaTeX{} label:
% \begin{macrocode}
\label{autopage-\thepage}%
% \end{macrocode}
% Start paragraph handing unless is an inline paragraph or subparagraph:
% \begin{macrocode}
\ifthenelse{%
\cnttest{\csuse{LWR@depth#4}}{<}{\LWR@depthparagraph}}%
{\LWR@startpars}%
{}%
% \end{macrocode}
% If not starred, remember the previous depth to
% possibly trigger a new \acro{HTML} page.
%
% A starred section does not trigger a new \acro{HTML} page at the beginning
% of this macro, so it should not affect it here at the end either.
% This became an issue when a \cs{listoftables} was tested in the middle of
% the document. The \cs{chapter*} for the list was not allowing
% a new \acro{HTML} page for the section following it
% while |CombineHigherDepths| was true.
% \begin{macrocode}
\IfBooleanTF{#1}{}{% not starred
\setcounter{LWR@prevFileDepth}{\csuse{LWR@depth#4}}%
}% not starred
\LWR@traceinfo{LWR@section: done}%
}
% \end{macrocode}
% \end{macro}
% \subsection{\textbackslash{}section and friends}
% \begin{macro}{\part} * \oarg{TOC name} \marg{name}
% \begin{macrocode}
\@ifundefined{chapter}
{}
{%
\DeclareDocumentCommand{\part}{s o m}{%
\LWR@stoppars%
\LWR@startnewdepth{\LWR@depthpart}{\LWR@printclosepart}%
\LWR@section{#1}{#2}{#3}{part}%
}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\chapter} * \oarg{TOC name} \marg{name}
% \begin{macrocode}
\@ifundefined{chapter}
{}
{%
\DeclareDocumentCommand{\chapter}{s o m}{%
\LWR@traceinfo{chapter #3}%
\LWR@stoppars%
\LWR@startnewdepth{\LWR@depthchapter}{\LWR@printclosechapter}%
\LWR@traceinfo{chapter: about to LWR@section}%
\LWR@section{#1}{#2}{#3}{chapter}%
\LWR@traceinfo{chapter: done}%
}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\section} * \oarg{TOC name} \marg{name}
% \begin{macrocode}
\DeclareDocumentCommand{\section}{s o m}{%
\LWR@stoppars%
\LWR@startnewdepth{\LWR@depthsection}{\LWR@printclosesection}%
\LWR@section{#1}{#2}{#3}{section}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\subsection} * \oarg{TOC name} \marg{name}
% \begin{macrocode}
\DeclareDocumentCommand{\subsection}{s o m}{%
\LWR@stoppars%
\LWR@startnewdepth{\LWR@depthsubsection}{\LWR@printclosesubsection}%
\LWR@section{#1}{#2}{#3}{subsection}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\subsubsection} * \oarg{TOC name} \marg{name}
% \begin{macrocode}
\DeclareDocumentCommand{\subsubsection}{s o m}{%
\LWR@stoppars%
\LWR@startnewdepth{\LWR@depthsubsubsection}%
{\LWR@printclosesubsubsection}%
\LWR@section{#1}{#2}{#3}{subsubsection}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\paragraph} * \oarg{TOC name} \marg{name}
% \begin{macrocode}
\DeclareDocumentCommand{\paragraph}{s o m}{%
\LWR@stoppars%
\LWR@startnewdepth{\LWR@depthparagraph}{\LWR@printcloseparagraph}%
\LWR@section{#1}{#2}{#3}{paragraph}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\subparagraph} * \oarg{TOC name} \marg{name}
% \begin{macrocode}
\DeclareDocumentCommand{\subparagraph}{s o m}{%
\LWR@stoppars%
\LWR@startnewdepth{\LWR@depthsubparagraph}{\LWR@printclosesubparagraph}%
\LWR@section{#1}{#2}{#3}{subparagraph}%
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Starting a new file}
% \label{sec:startingfile}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\MetaLanguage} Default language for the \acro{HTML} |lang| tag.
% \index{language HTML metadata}
% \begin{macrocode}
\newcommand*{\MetaLanguage}{en-US}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@filestart} \marg{title\_suffix}
% Creates the opening \acro{HTML} tags.
% \changes{v0.19}{2016/05/25}{lwarp\_mathjax.txt loaded.}
% \changes{v0.20}{2016/06/27}{Adds meta description.}
% \changes{v0.21}{2017/02/22}{Skip title if not given.}
%
% \begin{macrocode}
\newcommand*{\LWR@filestart}[1]{
% \end{macrocode}
% Locally temporarily disable direct-formatting commands:
% \begin{macrocode}
\begingroup
\renewcommand{\textit}[1]{##1}% not used in filenames
\renewcommand{\textsc}[1]{##1}
\renewcommand{\textsl}[1]{##1}
\renewcommand{\textbf}[1]{##1}
\renewcommand{\texttt}[1]{##1}
\renewcommand{\textsf}[1]{##1}
\renewcommand{\textrm}[1]{##1}
\renewcommand{\textsuperscript}[1]{##1}
\renewcommand{\textsubscript}[1]{##1}
\renewcommand*{\HTMLunicode}[1]{}
\renewcommand*{\HTMLentity}[1]{}
\RenewDocumentCommand{\LWR@htmlspanclass}{m o +m}{##3}
\DeclareExpandableDocumentCommand{\InlineClass}{m o m}{##3}
% \end{macrocode}
% Create the page's \acro{HTML} header:
% \begin{macrocode}
\LWR@htmltag{!DOCTYPE html}\LWR@orignewline
% \end{macrocode}
% The language is user-adjustable:
% \begin{macrocode}
\LWR@htmltag{html lang="\MetaLanguage"{}}\LWR@orignewline
% \end{macrocode}
% Start of the meta data:
% \begin{macrocode}
\LWR@htmltag{head}\LWR@orignewline
% \end{macrocode}
% Charset is fixed at UTF-8:
% \begin{macrocode}
\LWR@htmltag{meta charset="UTF-8" /}\LWR@orignewline
% \end{macrocode}
% \pkg{lwarp} is the generator:
% \index{HTML>meta tag>generator}
% \index{generator>HTML meta tag}
% \index{meta tag, HTML>generator}
% \begin{macrocode}
\LWR@htmltag{meta name="generator" content="LaTeX lwarp package" /}%
\LWR@orignewline
% \end{macrocode}
% If there is a description, add it now:
% \begin{macrocode}
\ifdefempty{\LWR@currentHTMLdescription}{}{%
\LWR@htmltag{%
meta name="description" content="\LWR@currentHTMLdescription" /}%
\LWR@orignewline
}%
% \end{macrocode}
% Mobile-friendly viewport:
% \index{HTML>meta tag>viewport}
% \index{viewport>HTML meta tag}
% \index{meta tag, HTML>viewport}
% \begin{macrocode}
\LWR@htmltag{meta name="viewport" %
content="width=device-width, initial-scale=1.0" /}%
\LWR@orignewline
% \end{macrocode}
% IE patch:
% \begin{macrocode}
\LWR@htmltag{!{-}{-}[if lt IE 9]}\LWR@orignewline
\LWR@htmltag{%
script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"{}}%
\LWR@htmltag{/script}\LWR@orignewline
\LWR@htmltag{![endif]{-}{-}}\LWR@orignewline
% \end{macrocode}
% The page's title:
% \begin{macrocode}
\ifcsvoid{thetitle}{}{%
\LWR@htmltag{title}\thetitle#1\LWR@htmltag{/title}\LWR@orignewline%
}%
% \end{macrocode}
% The page's stylesheet:
% \begin{macrocode}
\LWR@htmltag{%
link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}%
\LWR@orignewline
% \end{macrocode}
% Optional MathJax support. The \acro{HTML} tags must be turned off
% during the verbatim input, and the paragraph handling which was
% turned on at the end of verbatim input must be immediately turned off
% again.
% \begin{macrocode}
\ifbool{mathjax}%
{%
\boolfalse{LWR@verbtags}
\VerbatimInput{lwarp_mathjax.txt}%
\booltrue{LWR@verbtags}
\LWR@stoppars
}% end of mathjax
{}%
% \end{macrocode}
% End of the header:
% \begin{macrocode}
\LWR@htmltag{/head}\LWR@orignewline
% \end{macrocode}
% Start of the body:
% \begin{macrocode}
\LWR@htmltag{body}\LWR@orignewline
\endgroup
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Starting HTML output}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@LwarpStart}
% \changes{v0.19}{2016/06/01}{Enabled \textbackslash\textbackslash{} equal to \cs{newline}.}
% \changes{v0.21}{2017/02/22}{Changed \texttt{lateximages} to a \texttt{.txt} file.}
% Executed at the beginning of the entire document.
% \begin{macrocode}
\newcommand*{\LWR@LwarpStart}
{%
% \end{macrocode}
% Expand and detokenize \cs{HomeHTMLFileName} and \cs{HTMLFileName}:
% \begin{macrocode}
\edef\LWR@strresult{\HomeHTMLFileName}
\edef\HomeHTMLFileName{\detokenize\expandafter{\LWR@strresult}}
\edef\LWR@strresult{\HTMLFileName}
\edef\HTMLFileName{\detokenize\expandafter{\LWR@strresult}}
% \end{macrocode}
% Force onecolumn:
% \begin{macrocode}
\LWR@origonecolumn%
% \end{macrocode}
% Reduce chance of line overflow in verbatim environments:
% \begin{macrocode}
\LWR@origscriptsize%
% \end{macrocode}
% In \acro{PDF} output, don't allow line breaks to interfere with \acro{HTML} tags:
% \begin{macrocode}
\LWR@origraggedright%
\let\\\LWR@endofline%
% \end{macrocode}
% Spread the lines for |pdftotext| to read them well:
% \begin{macrocode}
\linespread{1.3}%
% \end{macrocode}
% For |pdftotext| to reliably identify paragraph splits:
% \begin{macrocode}
\setlength{\parindent}{0pt}
\setlength{\parskip}{2ex}
% \end{macrocode}
%
% For the |lateximages| record file:
% \begin{macrocode}
\immediate\openout\LWR@file=lateximages.txt
% \end{macrocode}
%
% Removes space after the caption in the \acro{HTML}:
% \begin{macrocode}
\setlength{\belowcaptionskip}{-3ex}
% \end{macrocode}
% Redefine the plain page style to be empty when used by index pages:
% \begin{macrocode}
\renewcommand{\ps@plain}{}
% \end{macrocode}
% Not used in the \acro{HTML} environment:
% \DescribeMacro{\centering}
% \DescribeMacro{\raggedleft}
% \DescribeMacro{\raggedright}
% \begin{macrocode}
\renewcommand*{\centering}{}
\renewcommand*{\raggedleft}{}
\renewcommand*{\raggedright}{}
% \end{macrocode}
% Plug in some new actions.
% This is done just before the document start
% so that they won't be over-written by some other package.
% \changes{v0.13}{2016/03/23}{\cs{up} and \cs{fup}}
%
% Tabular:
% \begin{macrocode}
\let\LWR@origtabular\tabular
\let\LWR@origendtabular\endtabular
\let\tabular\LWR@tabular
\let\endtabular\endLWR@tabular
% \end{macrocode}
% Float captions:
% \begin{macrocode}
\let\LWR@origcaption\caption
% \end{macrocode}
%
% Labels:
% \cs{ltx@label} is used in \pkg{amsmath} environments and is also
% patched by \pkg{cleveref}.
% \index{label>in HTML}
% \margintag{Label in \acro{HTML}}
% \changes{v0.20}{2017/01/30}{Fix: math cross references.}
% \begin{macrocode}
\let\ltx@label\LWR@htmlmathlabel
% \end{macrocode}
% Logos:
% \begin{macrocode}
\let\TeX\LWR@TeX
\let\LaTeX\LWR@LaTeX
\let\LuaTeX\LWR@LuaTeX
\let\LuaLaTeX\LWR@LuaLaTeX
\let\XeTeX\LWR@XeTeX
\let\XeLaTeX\LWR@XeLaTeX
\let\ConTeXt\LWR@ConTeXt
% \end{macrocode}
% Graphics:
% \begin{macrocode}
\let\textcolor\LWR@textcolor
\let\pagecolor\LWR@pagecolor
\let\colorbox\LWR@colorbox
\let\fcolorbox\LWR@fcolorbox
\let\rotatebox\LWR@rotatebox
\let\scalebox\LWR@scalebox
\let\reflectbox\LWR@reflectbox
% \end{macrocode}
% Not yet started any paragraph handling:
% \begin{macrocode}
\global\boolfalse{LWR@doingapar}
\global\boolfalse{LWR@doingstartpars}
% \end{macrocode}
% Start a new \acro{HTML} file and a header:
% \begin{macrocode}
\LWR@filestart{}
\LWR@htmltag{header}\LWR@orignewline
\LWR@startpars
\LWR@firstpagetop
\LWR@stoppars
\LWR@htmltag{/header}\LWR@orignewline
\LWR@htmltag{section class="textbody"{}}
\LWR@origpagestyle{empty}
% \end{macrocode}
% Document and page settings:
% \begin{macrocode}
\mainmatter
\LWR@origpagenumbering{arabic}
% \end{macrocode}
% Set default titlepage thanks footnote marks. See \cref{sec:titlehtml}.
% \begin{macrocode}
\if@titlepage
\thanksmarkseries{arabic}
\else
\thanksmarkseries{fnsymbol}
\fi
% \end{macrocode}
%
% Initial default patch for fancyvrb:
% \begin{macrocode}
\fvset{frame=none}%
% \end{macrocode}
%
% The ampersand is redefined active, and acts depending
% on whether it is inside a tabular.
% \begin{macrocode}
\catcode`\&=\active
% \end{macrocode}
% Allow \acro{HTML} paragraphs to begin:
% \begin{macrocode}
\LWR@startpars
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Ending HTML output}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@requesttoc} \marg{boolean} \marg{suffix}
% \changes{v0.18}{2016/05/19}{Reorganize \cs{HomeHTMLFilename} logic.}
% Requests that a toc, lof, or lot be generated.
% \begin{macrocode}
\newcommand*{\LWR@requesttoc}[2]{%
\ifbool{#1}
{
\expandafter\newwrite\csuse{tf@#2}
\immediate\openout \csuse{tf@#2} \jobname.#2\relax
}{}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@LwarpEnd}
% Final stop of all \acro{HTML} output:
% \begin{macrocode}
\newcommand*{\LWR@LwarpEnd}
{
\LWR@stoppars
\LWR@closeprevious{\LWR@depthfinished}
% \end{macrocode}
% At the bottom of the ending file:
% Close the textbody:
% \begin{macrocode}
\LWR@htmlelementclassend{section}{textbody}
% \end{macrocode}
% Print any pending footnotes:
% \begin{macrocode}
\LWR@printpendingnotes
% \end{macrocode}
% Create the footer:
% \begin{macrocode}
\LWR@htmlelement{footer}
\LWR@pagebottom
\LWR@htmlelementend{footer}
% \end{macrocode}
% No bottom navigation if are finishing the home page: \\
% Presumably has a table-of-contents printed.
% \begin{macrocode}
\ifnumcomp{\value{LWR@htmlfilenumber}}{>}{0}{\LWR@botnavigation}{}
% \end{macrocode}
% \begin{macrocode}
\LWR@stoppars% final stop of all paragraphs
% \end{macrocode}
% Finish the HTML file:
% \begin{macrocode}
\LWR@htmltag{/body}\LWR@orignewline
\LWR@htmltag{/html}\LWR@orignewline
% \end{macrocode}
% Seems to be required sometimes:
% \begin{macrocode}
\LWR@orignewpage
% \end{macrocode}
% For \env{lateximage} commands:
% \begin{macrocode}
\immediate\closeout\LWR@file
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Titles and the \protect\pkg{titling} package}
% \label{sec:titles}
% Supports and extends the \pkg{titling} package.
%
% Additional functions include \cs{published} and \cs{subtitle}, and the
% \cs{author} command has an additional \cs{affiliation} command to provide
% an affiliation and other additional information for each author in the
% title page. The affiliation information is removed when using \cs{theauthor}
% in the main text.
%
% The \pkg{titling} package maintains the definitions of \cs{thetitle},
% \cs{theauthor}, etc., after the title has been typeset.
% These commands are to be used to refer to the document's title
% and author, etc., in the main text.
% These definitions
% have the \cs{thanks} and \cs{affiliation} removed, and for author the
% \cs{and} is replaced to generate a simple inline list of authors separated
% by commas.
%
% \cs{printtitle}, \cs{printauthor}, etc., are provided for use inside
% the \env{titlepage} or \env{titlingpage} environments, and these retain
% the \cs{thanks} and \cs{affiliation}.
%
% Several additional hooks are provided in addition to \pkg{titling}:
% \begin{description}
% \ItemDescribeMacro{\maketitlehookaa} Between ``published'' and the title.
% \ItemDescribeMacro{\maketitlehookaaa} Between the title and the subtitle.
% \ItemDescribeMacro{\prepublished} Before the ``published'' field.
% \ItemDescribeMacro{\postpublished} After the ``published'' field.
% \ItemDescribeMacro{\presubtitle} Before the subtitle.
% \ItemDescribeMacro{\postsubtitle} After the subtitle.
% \end{description}
%
% \DescribeMacro{\printthanks}
% \cs{printthanks} has been added to force the printing of thanks inside
% a \env{titlingpage} environment when \cs{maketitle} is not used.
%
% Inside a \cs{titlepage} or \cs{titlingpage} environment, use
% \cs{thanks} for footnotes, do not use \cs{footnote}.
% \watchout[No footnotes!]
%
% At the end of the \env{titlingpage} environment, footnote marks are forced to
% reset to zero.
%
% Inside a \env{titlingpage} environment with the |article| document class,
% thanks marks will be |fnsymbol| instead of |arabic|. |arabic| is usually
% used when inside \env{titlepage} environments where the title page is
% on its own page, but is not automatically used
% inside a \env{titlingpage} environment.
%
% To force the thanks marks to
% be |arabic|:
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% \begin{titlingpage}
% \thanksmarkseries{arabic}
% ...
% \end{Verbatim}
%
%
%
% \subsection{Setting the title, etc.}
%
% The following provide setting commands for both \acro{HTML} and print outputs.
%
% \DescribeMacro{@published}
% \DescribeMacro{@title}
% \DescribeMacro{@subtitle}
% \DescribeMacro{@author}
% \DescribeMacro{@date}
% \cs{@title}, \cs{@subtitle}, \cs{@author}, etc.\ store the values
% as originally assigned, including any \cs{thanks}, \cs{and}, or \cs{affiliation}.
% These are low-level macros intended to be used by other macros
% only inside a \env{titlepage} or \env{titlingpage},
% and are used by \cs{maketitle}.
% The author is printed inside a single-column table,
% which becomes multiple single-column tables if multiples authors are included.
%
% \DescribeMacro{\printpublished}
% \DescribeMacro{\printtitle}
% \DescribeMacro{\printsubtitle}
% \DescribeMacro{\printauthor}
% \DescribeMacro{\printdate}
% \cs{printtitle}, \cs{printsubtitle}, etc.\ are user-level macros intended to
% be used in \env{titlepage} and \env{titlingpage} environments in cases where
% \cs{maketitle} is not desired. These commands preserve the \cs{thanks}, etc.,
% and should not be used in the main text.
% The author is printed inside a single-column table,
% which becomes multiple single-column tables if multiples authors are included.
%
% \DescribeMacro{\thepublished}
% \DescribeMacro{\thetitle}
% \DescribeMacro{\thesubtitle}
% \DescribeMacro{\theauthor}
% \DescribeMacro{\thedate}
% \cs{thetitle}, \cs{thesubtitle}, \cs{theauthor}, etc.\ are user-level
% sanitized versions which have removed the \cs{thanks} and \cs{affiliation},
% and \cs{and} is changed for inline text usage.
% The author is printed inline without \cs{affiliation} or \cs{thanks},
% with \cs{and} placing commas between multiple authors.
% Thus, these commands are to be used in the main text whenever the user
% wishes to refer to the document's title and such. One practical use for this
% is to place the authors at the bottom of each \acro{HTML} page, such as:
%
% \DescribeMacro{\SetPageBottom} \marg{text}
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% \SetPageBottom{
% \begin{center}\textcopyright~2016 \theauthor\end{center}
% }
% \end{Verbatim}
%
% \DescribeMacro{\author} \marg{author}
% \DescribeMacro{\and}
% While using \cs{maketitle}, the author is treated as a single-column table
% and the \cs{and} feature finishes the current table then starts a new one for
% the next author. Each author thus is placed into its own table, and an
% affiliation may be placed on its own line such as
%
% |\author{Name \\ Affiliation \and Second Name \\ Second Affiliation}|
%
% After \cs{maketitle} has completed, \cs{theauthor} retains the definition of
% the author, but \cs{and} is changed to become a comma and a space, intending to
% print the authors names separated by spaces. This fails when affiliations are
% included on their own table rows.
%
% A solution, provide here, is to define a macro \cs{affiliation} which
% during \cs{maketitle} starts a new table row and adds the affiliation,
% but after \cs{maketitle} is finished \cs{affiliation} is re-defined
% to throw away its argument, thus printing only the author names
% when \cs{author} is later used inline.
%
%
% \begin{macro}{\affiliation} \marg{text}
%
% Adds the affiliation to the author for use in \cs{maketitle}.
% Nullified when later used for inline use of \cs{theauthor}.
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
\newrobustcmd{\affiliation}[1]{\\ \InlineClass{affiliation}{#1}}
\end{warpHTML}
% \end{macrocode}
% \codeprint
% \begin{macrocode}
\begin{warpprint}
\newrobustcmd{\affiliation}[1]{\\ \textsc{\small#1}}
\end{warpprint}
% \end{macrocode}
% \end{macro}
%
%
%
% The following are based on the original \pkg{titling} code:
%
%
%
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
%
% \begin{macro}{\author} \marg{text}
%
% Redefined to nullify \cs{affiliation}, etc.\ before printing the authors inline.
%
% \cs{@author} retains the entire author with its \cs{thanks}, while
% \cs{theauthor} will have \cs{thanks} removed and \cs{and} simplified.
% \begin{macrocode}
\renewcommand{\author}[1]{%
\gdef\@author{#1}
\begingroup
\renewcommand{\thanks}[1]{}
\renewcommand{\and}{\unskip, }
\renewcommand{\thanksmark}[1]{}
\renewcommand{\thanksgap}[1]{}
\renewcommand{\affiliation}[1]{}
\protected@xdef\theauthor{#1}
\endgroup}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\published} \marg{text}
% \changes{v0.13}{2016/03/23}{Default to empty published.}
% \begin{macrocode}
\newcommand{\published}[1]{%
\gdef\@published{#1}
\begingroup
\renewcommand{\thanks}[1]{}
\renewcommand{\thanksmark}[1]{}
\renewcommand{\thanksgap}[1]{}
\protected@xdef\thepublished{#1}
\endgroup
}
\newcommand{\@published}{}
\newcommand{\thepublished}{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subtitle} \marg{text}
% \changes{v0.13}{2016/03/23}{Default to empty subtitle.}
% \begin{macrocode}
\newcommand{\subtitle}[1]{%
\gdef\@subtitle{#1}
\begingroup
\renewcommand{\thanks}[1]{}
\renewcommand{\thanksmark}[1]{}
\renewcommand{\thanksgap}[1]{}
\protected@xdef\thesubtitle{#1}
\endgroup
}
\newcommand{\@subtitle}{}
\newcommand{\thesubtitle}{}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
%
%
% \subsection{Changes to HTML titlepage and titlingpage}
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
%
%
% \begin{environment}{titlepage}
% Sets up a titlepage div with a \LaTeX{} \acro{PDF} minipage inside.
% \begin{macrocode}
\renewenvironment*{titlepage}
{\BlockClass{titlepage}\LWR@subminipage}
{\LWR@endsubminipage\endBlockClass}
% \end{macrocode}
% \end{environment}
%
% \begin{environment}{titlingpage}
% \begin{macrocode}
\renewenvironment*{titlingpage}
{%
% \end{macrocode}
% Start an HTML titlepage div:
% \begin{macrocode}
\begin{titlepage}
% \end{macrocode}
% Prepare for a custom version of \cs{maketitle} inside the \env{titlingpage}:
% \begin{macrocode}
\LWR@maketitlesetup
\let\maketitle\LWR@titlingmaketitle
}
{
% \end{macrocode}
% At the end of the environment,
% end the HTML titlepage div:
% \begin{macrocode}
\end{titlepage}
% \end{macrocode}
% Reset the footnote counter:
% \begin{macrocode}
\@bscontmark
}
% \end{macrocode}
% \end{environment}
%
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% \DescribeMacro{\printthanks} Forces the \cs{thanks} to be printed.
%
% This is necessary in a \env{titlingpage} environment
% when \cs{maketitle} was not used.
% \begin{macrocode}
\newcommand*{\printthanks}{\@thanks}
% \end{macrocode}
%
% \begin{environment}{titlingpage}
% At the end of the titlingpage for both print and HTML,
% reset footnote markers to zero.
% \begin{macrocode}
\AtEndEnvironment{titlingpage}{\@bscontmark}
% \end{macrocode}
% \end{environment}
%
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \subsection{Printing the title, etc.\ in HTML}
%
% \changes{v0.20}{2017/01/21}{Enhanced \pkg{titling} support.}
%
% The following are for printing the title, etc.
% in a \env{titlepage} or a \env{titlingpage}
% in \acro{HTML}:
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
%
%
%
% Patch the pre/post title/author/date to add \acro{HTML} tags,
% then initilize:
% \begin{macrocode}
\newcommand{\prepublished}[1]{%
\def\@bsprepublished{\BlockClass{published}#1}%
}
\newcommand{\postpublished}[1]{%
\def\@bspostpublished{#1\endBlockClass}%
}
\renewcommand{\pretitle}[1]{%
\def\@bspretitle{#1\LWR@stoppars\LWR@htmltag{h1}}%
}
\renewcommand{\posttitle}[1]{%
\def\@bsposttitle{\LWR@htmltag{/h1}\LWR@startpars#1}%
}
\newcommand{\presubtitle}[1]{%
\def\@bspresubtitle{\BlockClass{subtitle}#1}%
}
\newcommand{\postsubtitle}[1]{%
\def\@bspostsubtitle{#1\endBlockClass}%
}
\renewcommand{\preauthor}[1]{%
\def\@bspreauthor{\BlockClass{author}#1}%
}
\renewcommand{\postauthor}[1]{%
\def\@bspostauthor{#1\endBlockClass}%
}
\renewcommand{\predate}[1]{%
\def\@bspredate{#1\BlockClass{titledate}}%
}
\renewcommand{\postdate}[1]{%
\def\@bspostdate{\endBlockClass#1}%
}
\prepublished{\begin{center}}
\postpublished{\par\end{center}}
\pretitle{\begin{center}}
\posttitle{\par\end{center}}
\presubtitle{\begin{center}}
\postsubtitle{\par\end{center}}
\preauthor{\begin{center}%
\begin{tabular}[t]{c}%
}
\postauthor{\end{tabular}\par\end{center}}
\predate{\begin{center}}
\postdate{\par\end{center}}
% \end{macrocode}
%
%
% \begin{macro}{\printpublished}
% \changes{v0.15}{2015/04/05}{No div if empty.}
% \begin{macrocode}
\newcommand*{\printpublished}{
\ifthenelse{\equal{\thepublished}{}}
{}
{
\begin{BlockClass}{published}
\@published
\end{BlockClass}
}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\printtitle}
% \begin{macrocode}
\newcommand*{\printtitle}
{
\LWR@stoppars
\LWR@htmltag{h1}%
\@title%
\LWR@htmltag{/h1}
\LWR@startpars
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@printthetitle}
%
% A private version which prints the title without footnotes,
% used to title each \acro{HTML} page.
% \begin{macrocode}
\newcommand*{\LWR@printthetitle}
{
\LWR@stoppars
\LWR@htmltag{h1}%
\thetitle%
\LWR@htmltag{/h1}
\LWR@startpars
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\printsubtitle}
% \changes{v0.15}{2015/04/05}{No div if empty.}
% \begin{macrocode}
\newcommand*{\printsubtitle}{
\ifthenelse{\equal{\thesubtitle}{}}
{}
{
\begin{BlockClass}{subtitle}
\@subtitle
\end{BlockClass}
}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\printauthor}
% \begin{macrocode}
\newcommand*{\printauthor}{
\begin{BlockClass}{author}
\begin{tabular}{c}\@author\end{tabular}
\end{BlockClass}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\printdate}
% \begin{macrocode}
\newcommand*{\printdate}{%
\begin{BlockClass}{titledate}
\@date
\end{BlockClass}
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \subsection{Printing the title, etc.\ in print form}
%
% The following are for printing the title, etc.
% in a \env{titlepage} or a \env{titlingpage}
% in print form:
%
% \codeprint
% \begin{macrocode}
\begin{warpprint}
% \end{macrocode}
% \changes{v0.16}{2016/04/07}{\cs{titlingpage}: Improved print-output spacing.}
% \changes{v0.16}{2016/04/07}{Test Suite: Improved titlingpage.}
% \begin{macro}{\printpublished}
% \begin{macrocode}
\newcommand*{\printpublished}{{\Large\scshape\@published}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\printtitle}
% \begin{macrocode}
\newcommand*{\printtitle}{{\Huge\@title}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\printsubtitle}
% \begin{macrocode}
\newcommand*{\printsubtitle}{{\Large\itshape\@subtitle\bigskip}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\printauthor}
% \begin{macrocode}
\newcommand*{\printauthor}
{{\large\begin{tabular}[t]{c}\@author\end{tabular}}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\printdate}
% \begin{macrocode}
\newcommand*{\printdate}{{\small\textit{\@date}}}
% \end{macrocode}
% \end{macro}
%
%
% \subsection{\cs{maketitle} for print output}
%
%
% \DescribeMacro{\maketitle}
% From the \pkg{titling} package, patched to add the publisher and subtitle.
%
% \begin{macrocode}
\providecommand{\maketitle}{}
\if@titlepage
\renewcommand{\maketitle}{\begin{titlepage}%
\let\footnotesize\small
\let\footnoterule\relax
\let \footnote \thanks
\@bsmarkseries
\def\@makefnmark{\rlap{\@textsuperscript{%
\normalfont\@bsthanksheadpre \tamark \@bsthanksheadpost}}}%
\long\def\@makefntext##1{\makethanksmark ##1}
\null\vfil
\vskip 60\p@
\vspace*{\droptitle}
\maketitlehooka
\ifcsempty{@published}
{}
{{\@bsprepublished \@published \@bspostpublished}\maketitlehookaa}
{\@bspretitle \@title \@bsposttitle}
\ifcsempty{@subtitle}
{}
{\maketitlehookaaa{\@bspresubtitle \@subtitle \@bspostsubtitle}}
\maketitlehookb
{\@bspreauthor \@author \@bspostauthor}
\maketitlehookc
{\@bspredate \@date \@bspostdate}
\maketitlehookd
\par
\@thanks
\vfil\null
\end{titlepage}%
\@bscontmark % \setcounter{footnote}{0}%
%%% \@bsmtitlempty
} % end titlepage defs
\else
\renewcommand{\maketitle}{\par
\begingroup
\@bsmarkseries
\def\@makefnmark{\rlap{\@textsuperscript{%
\normalfont\@bsthanksheadpre \tamark \@bsthanksheadpost}}}%
\long\def\@makefntext##1{\makethanksmark ##1}
\if@twocolumn
\ifnum \col@number=\@ne
\@maketitle
\else
\twocolumn[\@maketitle]%
\fi
\else
\newpage
\global\@topnum\z@
\@maketitle
\fi
\thispagestyle{plain}\@thanks
\endgroup
\@bscontmark % \setcounter{footnote}{0}%
%%% \@bsmtitlempty
} % end non-titlepage
\def\@maketitle{%
\newpage
\null
\vskip 2em%
\vspace*{\droptitle}
\maketitlehooka
\ifcsempty{@published}
{}
{{\@bsprepublished \@published \@bspostpublished}\maketitlehookaa}
{\@bspretitle \@title \@bsposttitle}
\ifcsempty{@subtitle}
{}
{\maketitlehookaaa{\@bspresubtitle \@subtitle \@bspostsubtitle}}
\maketitlehookb
{\@bspreauthor \@author \@bspostauthor}
\maketitlehookc
{\@bspredate \@date \@bspostdate}
\maketitlehookd
\par
\vskip 1.5em}
\fi
\providecommand{\maketitlehookaa}{}
\providecommand{\maketitlehookaaa}{}
\newcommand{\prepublished}[1]{%
\def\@bsprepublished{#1}%
}
\newcommand{\postpublished}[1]{%
\def\@bspostpublished{#1}%
}
\newcommand{\presubtitle}[1]{%
\def\@bspresubtitle{#1}%
}
% \end{macrocode}
%
% \DescribeMacro{\presubtitle} Hook after printing the subtitle.
% \begin{macrocode}
\newcommand{\postsubtitle}[1]{%
\def\@bspostsubtitle{#1}%
}
% \end{macrocode}
%
% Initial settings:
%
% \begin{macrocode}
\if@titlepage
\prepublished{
\vspace*{-\baselineskip}\vspace*{-\medskipamount}\vspace*{-2em}
\begin{center}}
\postpublished{\par\end{center}\vskip 2em}
\presubtitle{\unskip\begin{center}\unskip}
\postsubtitle{\par\end{center}\vskip 2em}
\else
\prepublished{\begin{center}}
\postpublished{\par\end{center}\vskip 0.5em}
\presubtitle{\begin{center}\unskip}
\postsubtitle{\par\end{center}\vskip 0.5em}
\fi
% \end{macrocode}
%
% \begin{macrocode}
\end{warpprint}
% \end{macrocode}
%
%
% \subsection{\protect\textbackslash{}maketitle for HTML output}
% \label{sec:titlehtml}
%
% An \acro{HTML} div of class |titlepage| is created, inside of which
% a \LaTeX{} \acro{PDF} minipage is generated (without \acro{HTML} tags),
% allowing the |\thanks| footnotes to be generated immediately at the end
% of the title page during \acro{HTML} output. This is desirable when
% a large table of contents immediately follows the title.
%
% |\thanks| are a form of footnotes used in the title page.
% See \cref{sec:footnotes} for other kinds of footnotes.
%
% See |\thanksmarkseries{series}|, below, to set the style of the footnote marks.
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
%
%\begin{macro}{\LWR@maketitlesetup} Patches \cs{thanks} macros to
% use \LaTeX{} minipage footnotes.
%
% \begin{macrocode}
\newcommand*{\LWR@maketitlesetup}{%
% \end{macrocode}
% Select which kind of footnote marks to use:
% \begin{macrocode}
\@bsmarkseries
\@mpbsmarkseries
% \end{macrocode}
%
% Redefine the footnote mark:
%
% \begin{macrocode}
\def\@makefnmark{\textsuperscript{\thefootnote}}%
% \end{macrocode}
% \begin{center}
% \begin{minipage}{.7\linewidth}
% \cs{thefootnote} \goesto\ \cs{nameuse}\{arabic\}\{footnote\}, or
%
% \cs{thefootnote} \goesto\ \cs{nameuse}\{fnsymbol\}\{footnote\}
% \end{minipage}
% \end{center}
%
% Redefine the footnote text:
%
% \begin{macrocode}
\long\def\@makefntext##1{%
% \end{macrocode}
% Make the footnote mark and some extra horizontal space for the tags:
% \begin{macrocode}
\makethanksmark \LWR@orighspace{1in}
% \end{macrocode}
% \begin{center}
% \begin{minipage}{.7\linewidth}
% \cs{makethanksmark} \goesto\ \cs{thanksfootmark} \goesto\ \cs{tamark} \goesto\
%
% \hfill \cs{@thefnmark} \goesto\ \cs{itshape} a (or similar)
% \end{minipage}
% \end{center}
%
% Print the text and a closing paragraph tag:
% \begin{macrocode}
##1\LWR@htmltagc{/\LWR@tagregularparagraph}%
}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@fnsymbol} \marg{counter}
%
% Re-defined to use an \acro{HTML} entity for the double vertical bar symbol.
% The original definition used \cs{\textbar} which was not being found by \cmds{pdftotext}.
% \begin{macrocode}
\def\@fnsymbol#1{\ensuremath{\ifcase#1\or *\or \dagger\or \ddagger\or
\mathsection\or \mathparagraph\or \text{\HTMLunicode{2016}}\or
**\or \dagger\dagger \or \ddagger\ddagger \else\@ctrerr\fi}}
% \end{macrocode}
% \end{macro}
%
%\begin{macro}{\maketitle} Creates an \acro{HTML} titlepage div
% and typesets the title, etc.
%
% Code from the \pkg{titling} package is adapted, simplified, and
% modified for \acro{HTML} output.
%
% \begin{macrocode}
\renewcommand*{\maketitle}{%
% \end{macrocode}
% An \acro{HTML} titlepage div is used for all classes.
% \begin{macrocode}
\begin{titlepage}
% \end{macrocode}
% Set up special patches:
% \begin{macrocode}
\LWR@maketitlesetup
% \end{macrocode}
% Typeset the title, etc:
% \begin{macrocode}
\@maketitle
% \end{macrocode}
% Immediately generate any |\thanks| footnotes:
% \begin{macrocode}
\@thanks
% \end{macrocode}
% Close the \acro{HTML} titlepage div:
% \begin{macrocode}
\end{titlepage}
% \end{macrocode}
% Reset the footnote counter:
% \begin{macrocode}
\@bscontmark
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@maketitle} Typesets the title, etc. for \acro{HTML}:
% \begin{macrocode}
\DeclareDocumentCommand{\@maketitle}{}{%
\maketitlehooka
\ifcsempty{@published}
{}
{{\@bsprepublished \@published \@bspostpublished}\maketitlehookaa}
{\@bspretitle \@title \@bsposttitle}
\ifcsempty{@subtitle}
{}
{\maketitlehookaaa{\@bspresubtitle \@subtitle \@bspostsubtitle}}
\maketitlehookb
{\@bspreauthor \@author \@bspostauthor}
\maketitlehookc
{\@bspredate \@date \@bspostdate}
\maketitlehookd
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\providecommand{\maketitlehookaa}{}
\providecommand{\maketitlehookaaa}{}
% \end{macrocode}
% \begin{macro}{\LWR@titlingmaketitle}
% \cs{maketitle} for use inside an \acro{HTML} \env{titlingpage} environment.
% \begin{macrocode}
\newcommand*{\LWR@titlingmaketitle}{%
% \end{macrocode}
% Typeset the title, etc:
% \begin{macrocode}
\@maketitle
% \end{macrocode}
% Immediately generate any |\thanks| footnotes:
% \begin{macrocode}
\@thanks
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\thanksmarkseries} \marg{series}
%
% Sets the type of footnote marks used by |\thanks|,
% where type is `arabic', `roman', `fnsymbol', etc. Modified to
% use the \LaTeX{} \acro{PDF} minipage which is included with the title page.
% \begin{macrocode}
\let\LWR@origthanksmarkseries\thanksmarkseries
\renewcommand{\thanksmarkseries}[1]{%
\def\@mpbsmarkseries{%
\renewcommand*{\thempfootnote}{\@nameuse{#1}{mpfootnote}}}
\LWR@origthanksmarkseries{#1}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Abstract}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\abstractname}
% User-redefinable title for the abstract.
%
% Also over-written by the \pkg{babel} package.
% \begin{macrocode}
\providecommand*{\abstractname}{Abstract}
% \end{macrocode}
% \end{macro}
%
% \begin{environment}{abstract}
% \begin{macrocode}
\DeclareDocumentEnvironment{abstract}{}
{
\BlockClass{abstract}
\BlockClassSingle{abstracttitle}{\abstractname}
}
{
\endBlockClass
}
% \end{macrocode}
% \end{environment}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Quote and verse}
% \subsection{Citations and attributions}
% \begin{macro}{\attribution}
% for use inside quote, quotation, verse:
% ex: |\attribution{author name} --- \citetitle{book name}|
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
\newcommand{\attribution}[1]{%
\InlineClass{attribution}{—\,#1}}% emdash
\end{warpHTML}
% \end{macrocode}
% \codeprint
% \begin{macrocode}
\begin{warpprint}
\newcommand{\attribution}[1]{\textsc{---\,#1}}
\end{warpprint}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\citetitle}
% for use inside quote, quotation, verse:
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
\newcommand{\citetitle}[1]{%
\InlineClass{citetitle}{—\,#1}}% emdash
\end{warpHTML}
% \end{macrocode}
%
% \codeprint
% \begin{macrocode}
\begin{warpprint}
\newcommand{\citetitle}[1]{\textsl{---\,#1}}
\end{warpprint}
% \end{macrocode}
% \end{macro}
% \subsection{Quotes, quotations}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
%
% \begin{environment}{quote}
% \begin{macrocode}
\renewenvironment*{quote}
{\LWR@htmlblocktag{blockquote}}
{\LWR@htmlblocktag{/blockquote}}
\renewenvironment*{quotation}
{\LWR@htmlblocktag{blockquotation}}
{\LWR@htmlblocktag{/blockquotation}}
% \end{macrocode}
% \end{environment}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \subsection{Verse}
%
% \limitsverse
%
% \bigskip
%
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
%
% The following lengths may be set in either print or \acro{HTML} output,
% but are only used in \acro{HTML}.
% This allows the user to set \cs{vleftskip} and \cs{leftmargini} for
% print output, and optionally select different values for \acro{HTML}.
%
% \DescribeLength{HTMLvleftskip}
% Sets \cs{vleftskip} inside a \env{verse} environment in \acro{HTML}.
% \begin{macrocode}
\newlength{\HTMLvleftskip}
\setlength{\HTMLvleftskip}{1em}
% \end{macrocode}
% \DescribeLength{HTMLleftmargini}
% Sets \cs{leftmargini} inside a \env{verse} environment in \acro{HTML}.
% \begin{macrocode}
\newlength{\HTMLleftmargini}
\setlength{\HTMLleftmargini}{4.5em}
% \end{macrocode}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
%
%
% \begin{environment}{verse}
% \changes{v0.18}{2016/05/13}{Supports verse, memoir packages.}
% The \env{verse} environment will be placed inside a \acro{HTML} |pre|.
% \begin{macrocode}
\AfterEndPreamble{
% \end{macrocode}
% At the beginning of the \env{verse} environment:
% \begin{macrocode}
\AtBeginEnvironment{verse}
{%
% \end{macrocode}
% \DescribePackage{verse}\DescribePackage{memoir}\index{memoir>verse}
% The \pkg{verse} or \pkg{memoir} packages can place stanza numbers to the left
% with their \cs{flagverse} command. \DescribeMacro{\flagverse}
% Do not allow them to go into the left margin, which would cause |pdfcrop|
% to crop the entire page further to the left:
% \DescribeLength{vleftskip}
% \begin{macrocode}
\ifdef{\vleftskip}{%
\setlength{\vleftskip}{\HTMLvleftskip}
\setlength{\leftmargini}{\HTMLleftmargini}
}{}
\LWR@atbeginverbatim{verse}
\unskip\vspace{-\baselineskip}
}
% \end{macrocode}
% After the end of the \env{verse} environment, which places the |pre| tag at the
% regular left margin:
% \begin{macrocode}
\AfterEndEnvironment{verse}{
\unskip\vspace{-\baselineskip}
\LWR@afterendverbatim
}
% \end{macrocode}
% Patch to place poemtitle inside an \acro{HTML} span of class |poemtitle|:
% \begin{macrocode}
\ifdef{\poemtitle}{
\DeclareDocumentCommand{\@vstypeptitle}{m}{%
\vspace{\beforepoemtitleskip}%
{\InlineClass{poemtitle}{\poemtitlefont #1}\par}%
\vspace{\afterpoemtitleskip}%
}
}{}
}
\end{warpHTML}
% \end{macrocode}
% \end{environment}
% \section{Verbatim}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{environment}{verbatim}
%
% \changes{v0.20}{2016/12/24}{Added.}
%
% \begin{macrocode}
\AfterEndPreamble{
\AtBeginEnvironment{verbatim}{\LWR@atbeginverbatim{verbatim}\unskip\vspace*{-\baselineskip}}
\AfterEndEnvironment{verbatim}{\unskip\vspace*{-\baselineskip}\LWR@afterendverbatim}
}
% \end{macrocode}
% \end{environment}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Fancyvrb}
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
%
%
% \DescribeLength{\VerbatimHTMLWidth} Width to use in HTML Verbatim environment.
%
% This width is used when placing line numbers to the right.
% Ignored during print output.
% \begin{macrocode}
\newlength{\VerbatimHTMLWidth}
\setlength{\VerbatimHTMLWidth}{4in}
\end{warpall}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
%
% \DescribeBoolean{LWR@verbtags} Used to temporarily turn off verbatim tags
% while doing \env{VerbatimInput} in the \acro{HTML} head.
% \begin{macrocode}
\newbool{LWR@verbtags}
\booltrue{LWR@verbtags}
% \end{macrocode}
% For \cs{VerbatimFootnotes}:
% \begin{macrocode}
\renewcommand{\VerbatimFootnotes}{
\PackageError{lwarp}
{Verbatim footnotes are not yet supported by lwarp.}
{This may be improved when lwarp uses LaTeX footnotes instead of pagenotes.}
}
% \end{macrocode}
% \begin{macro}{\LWR@atbeginverbatim} \marg{class}
%
% Encloses a verbatim environment with the given \acro{CSS} class.
% \begin{macrocode}
\newcommand*{\LWR@atbeginverbatim}[1]
{%
% \end{macrocode}
% Avoid excessive space between lines:
% \begin{macrocode}
\setlength{\parskip}{0ex}%
% \end{macrocode}
% Stop generating \acro{HTML} paragraph tags:
% \begin{macrocode}
\LWR@stoppars%
% \end{macrocode}
% Create a new |pre| of the given class:
% \begin{macrocode}
\ifbool{LWR@verbtags}{\LWR@htmltag{pre class="#1"{}}}{}%
% \end{macrocode}
% Use a mono-spaced font to preserve horizontal positioning.
% If horizontal alignment is important for the user, use a mono-spaced font
% in the \acro{CSS} for the |verse| class.
% \begin{macrocode}
\LWR@origttfamily%
% \end{macrocode}
% Do not produce \acro{HTML} tags for \cs{hspace} inside a verse |par|.
% Restore plain \LaTeX{} \cs{hspace} functionality:
% \begin{macrocode}
\let\hspace\LWR@orighspace%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@afterendverbatim} Finishes enclosing a verbatim environment.
% \begin{macrocode}
\newcommand*{\LWR@afterendverbatim}{%
% \end{macrocode}
% Remove excess vertical space at the end of the |pre|:
% \begin{macrocode}
\unskip%
% \end{macrocode}
% At the end of the environment, close the |pre|:
% \begin{macrocode}
\ifbool{LWR@verbtags}{\noindent\LWR@htmltag{/pre}
}{}%
% \end{macrocode}
% Resume regular paragraph handling:
% \begin{macrocode}
\LWR@startpars%
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\LWR@Verbatimclass} Holds the class of the following verbatim.
%
% \begin{macrocode}
\newcommand*{\LWR@Verbatimclass}{fancyvrb}
% \end{macrocode}
% \end{macro}
%
% \begin{environment}{VerbatimClass} \marg{class} \oarg{Verbatim options}
%
% Creates a \env{Verbatim} enclosed in a \acro{DIV} of the given class.
% \begin{macrocode}
\NewDocumentEnvironment{VerbatimClass}{m O{}}
{%
\renewcommand*{\LWR@Verbatimclass}{#1}%
\LWR@origVerbatim[#2]%
}
{\endVerbatim}
% \end{macrocode}
% \end{environment}
%
% After the preamble is loaded, after any patches to \env{Verbatim}:
% \begin{macrocode}
\AfterEndPreamble{
% \end{macrocode}
%
% Remember the original defintion of \env{Verbatim}:
% \begin{macrocode}
\let\LWR@origVerbatim\Verbatim
% \end{macrocode}
%
%
% \begin{environment}{Verbatim}
%
% Patched to place the environment in a |fancyvrb| div,
% and the label in a |fancyvrblabel| div.
% Also corrects the left margin for line numbers.
% Also uses |VerbatimHTMLWidth| to control placement of line numbers on the right.
% Aligning the right margin requires knowing the width.
%
% \changes{v0.20}{2016/12/24}{Added.}
%
% \begin{macrocode}
\renewcommand*{\Verbatim}{%
\renewcommand*{\LWR@Verbatimclass}{fancyvrb}%
\LWR@origVerbatim%
}
% \end{macrocode}
% \end{environment}
%
%
% The following patches to \env{Verbatim} are executed at the
% start and end of the environment, depending on the choice of |frame|.
% Original code is from the \pkg{fancyvrb} package.
% \begin{macrocode}
\newcommand*{\LWR@fvstartnone}{%
\LWR@traceinfo{fvstartnone}%
\ifbool{LWR@verbtags}{\hbox to\z@{\LWR@htmltagc{div class="\LWR@Verbatimclass"}}}{}%
\hbox to\z@{\LWR@atbeginverbatim{verbatim}}%
}
\newcommand*{\LWR@fvendnone}{%
\LWR@traceinfo{fvendnone}%
\hbox to\z@{\LWR@afterendverbatim}%
\ifbool{LWR@verbtags}{\hbox to\z@{\LWR@htmltagc{/div}}}{}%
}
\newcommand*{\LWR@fvstartsingle}{%
\LWR@traceinfo{fvstartsingle}%
\LWR@fvstartnone%
\FV@BeginListFrame@Single%
}
\newcommand*{\LWR@fvendsingle}{%
\LWR@traceinfo{fvendsingle}%
\FV@EndListFrame@Single%
\LWR@fvendnone%
}
\newcommand*{\LWR@fvstartline}{%
\LWR@traceinfo{fvstartline}%
\LWR@fvstartnone%
\FV@BeginListFrame@Lines%
}
\newcommand*{\LWR@fvendline}{%
\LWR@traceinfo{fvendline}%
\FV@EndListFrame@Lines%
\LWR@fvendnone%
}
% \end{macrocode}
%
% The following patches select the start/left/right/end
% behaviors depending on |frame|.
% Original code is from the \pkg{fancyvrb} package.
% \begin{macrocode}
\def\FV@Frame@none{%
\let\FV@BeginListFrame\LWR@fvstartnone%
\let\FV@LeftListFrame\relax%
\let\FV@RightListFrame\relax%
\let\FV@EndListFrame\LWR@fvendnone}
\def\FV@Frame@single{%
\let\FV@BeginListFrame\LWR@fvstartsingle%
\let\FV@LeftListFrame\FV@LeftListFrame@Single%
\let\FV@RightListFrame\FV@RightListFrame@Single%
\let\FV@EndListFrame\LWR@fvendsingle}
\def\FV@Frame@lines{%
\let\FV@BeginListFrame\LWR@fvstartline%
\let\FV@LeftListFrame\relax%
\let\FV@RightListFrame\relax%
\let\FV@EndListFrame\LWR@fvendline}
\def\FV@Frame@topline{%
\let\FV@BeginListFrame\LWR@fvstartline%
\let\FV@LeftListFrame\relax%
\let\FV@RightListFrame\relax%
\let\FV@EndListFrame\LWR@fvendnone}
\def\FV@Frame@bottomline{%
\let\FV@BeginListFrame\LWR@fvstartnone%
\let\FV@LeftListFrame\relax%
\let\FV@RightListFrame\relax%
\let\FV@EndListFrame\LWR@fvendline}
\def\FV@Frame@leftline{%
% To define the \FV@FrameFillLine macro (from \FV@BeginListFrame)
\ifx\FancyVerbFillColor\relax%
\let\FV@FrameFillLine\relax%
\else%
\@tempdima\FV@FrameRule\relax%
\multiply\@tempdima-\tw@%
\edef\FV@FrameFillLine{%
{\noexpand\FancyVerbFillColor{\vrule\@width\number\@tempdima sp}%
\kern-\number\@tempdima sp}}%
\fi%
\let\FV@BeginListFrame\LWR@fvstartnone%
\let\FV@LeftListFrame\FV@LeftListFrame@Single%
\let\FV@RightListFrame\relax%
\let\FV@EndListFrame\LWR@fvendnone}
% \end{macrocode}
%
% Adds the optional label to the top and bottom edges.
% Original code is from the \pkg{fancyvrb} package.
% \begin{macrocode}
\def\FV@SingleFrameLine#1{%
\hbox to\z@{%
% \kern\leftmargin
\ifnum#1=\z@\relax
\let\FV@Label\FV@LabelBegin
\else
\let\FV@Label\FV@LabelEnd
\fi
\ifx\FV@Label\relax
% \FancyVerbRuleColor{\vrule \@width\linewidth \@height\FV@FrameRule}%
\else
\ifnum#1=\z@
% \setbox\z@\hbox{\strut\enspace\FV@LabelBegin\enspace\strut}%
\ifx\FV@LabelPositionTopLine\relax
\else
\LWR@htmltagc{div class="fancyvrblabel"}
\LWR@origtextrm{\FV@LabelBegin}% \textrm preserves emdash
\LWR@htmltagc{/div}
\fi
\else
% \setbox\z@\hbox{\strut\enspace\FV@LabelEnd\enspace\strut}%
\ifx\FV@LabelPositionBottomLine\relax
\else
\LWR@htmltagc{div class="fancyvrblabel"}
\LWR@origtextrm{\FV@LabelEnd}
\LWR@htmltagc{/div}
\fi
\fi
\fi
\hss
}
}
% \end{macrocode}
%
% Processes each line, adding optional line numbers.
% Original code is from the \pkg{fancyvrb} package.
% \begin{macrocode}
\def\FV@ListProcessLine#1{%
\hbox to \hsize{%
% \kern\leftmargin
\hbox to \VerbatimHTMLWidth {%
\ifcsvoid{FV@LeftListNumber}{}{\kern 2.5em}%
\FV@LeftListNumber%
% \FV@LeftListFrame
\FancyVerbFormatLine{#1}%
\hss%
% \FV@RightListFrame
\FV@RightListNumber%
}%
\hss% required to avoid underfull hboxes
}
}
% \end{macrocode}
% \begin{environment}{BVerbatim}
% \begin{macrocode}
\AtBeginEnvironment{BVerbatim}
{
\LWR@atbeginverbatim{bverbatim}
}
\AfterEndEnvironment{BVerbatim}
{
\leavevmode\par\vspace{-\baselineskip}
\LWR@afterendverbatim
}
% \end{macrocode}
% \end{environment}
% \begin{environment}{LVerbatim} No changes required.
% ^^A \begin{macrocode}
% ^^A \AtBeginEnvironment{LVerbatim}
% ^^A {
% ^^A \LWR@atbeginverbatim{lverbatim}
% ^^A \unskip\vspace{-\baselineskip}
% ^^A }
% ^^A \AfterEndEnvironment{LVerbatim}
% ^^A {
% ^^A \unskip\vspace{-\baselineskip}
% ^^A \LWR@afterendverbatim
% ^^A }
% ^^A \end{macrocode}
% \end{environment}
% End of the modifications to make at the end of the preamble:
% \begin{macrocode}
} % \AfterEndPreamble
% \end{macrocode}
%
% \begin{macro}{\UseVerbatim} \marg{text}
%
% No changes required.
% ^^A \begin{macrocode}
% ^^A \let\LWR@origUseVerbatim\UseVerbatim
% ^^A
% ^^A \renewcommand*{\UseVerbatim}[1]{%
% ^^A \LWR@atbeginverbatim{bverbatim}%
% ^^A \unskip\vspace{-\baselineskip}%
% ^^A \LWR@origUseVerbatim{#1}%
% ^^A \unskip%
% ^^A \LWR@afterendverbatim%
% ^^A }
% ^^A \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Theorems}
%
% \DescribeMacro{\newtheorem} \marg{text} \oarg{counter} -or- \oarg{oldname} \marg{text}
%
% A few minor changes are made to supply \acro{HTML} tags.
%
% \begin{itemize}
% \item The entire theorem is placed into a div of class |theorem|.
% \item The label for each theorem is placed inside a span of class |theoremlabel|.
% \item The contents are placed inside a div of class |theoremcontents|.
% \end{itemize}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\@begintheorem} \marg{name} \marg{number}
% \begin{macrocode}
\renewcommand{\@begintheorem}[2]{%
\LWR@htmldivclass{theorem}
\InlineClass{theoremlabel}{#1\ #2\ }
\LWR@htmldivclass{theoremcontents}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@opargbegintheorem} \marg{name} \marg{number} \marg{oparg}
% \begin{macrocode}
\renewcommand{\@opargbegintheorem}[3]{%
\BlockClass{theorem}
\InlineClass{theoremlabel}{#1\ #2\ (#3)\ }
\BlockClass{theoremcontents}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@endtheorem}
% \begin{macrocode}
\renewcommand*{\@endtheorem}{%
\endBlockClass% theoremcontents
\endBlockClass% theorem
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Lists}
%
% \limitsbabelone
%
% \limitsenumitem
%
% \subsection{Itemize}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macrocode}
\let\LWR@origitem\item
% \end{macrocode}
% \begin{macro}{\LWR@itemizeitem} \oarg{label}
%
% Handles |\item| inside an itemize or enumerate.
%
% See |\LWR@openparagraph| where extra |\hspace| is used to
% leave room for the label while inside a list during paragraph construction.
% \begin{macrocode}
\newcommand*{\LWR@itemizeitem}{%
\LWR@stoppars%
\LWR@startnewdepth{\LWR@depthlistitem}{\LWR@printcloselistitem{}}%
\LWR@htmltag{li}%
\LWR@startpars%
\LWR@origitem%
}
% \end{macrocode}
% \end{macro}
% To have a blank item, use |\mbox{}|.
% This forces a new line in print output, matching the new line which
% will appear in \acro{HTML} output.
% Ex:
%\begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
%\begin{itemize}
%\item \mbox{}
% \begin{itemize}
% ...
%\end{Verbatim}
% \begin{environment}{itemize} \oarg{enumitem options}
% \begin{macrocode}
\AtBeginEnvironment{itemize}{\LWR@itemizestart}
\newcommand*{\LWR@itemizestart}{%
\LWR@stoppars%
\LWR@pushoneclose{\LWR@depthlist}{\LWR@printcloseitemize{}}%
\LWR@htmltag{ul style="list-style-type:none"{}}%
\LWR@startpars%
\let\item\LWR@itemizeitem%
}
\AtEndEnvironment{itemize}{\LWR@itemizeend}
\newcommand*{\LWR@itemizeend}{%
\LWR@stoppars%
\LWR@closeprevious{\LWR@depthlistitem}%
\LWR@closeoneprevious{}%
\LWR@startpars%
}
% \end{macrocode}
% \end{environment}
% \subsection{Enumerate}
% An \acro{HTML} unordered list is used with customized \LaTeX-generated labels.
% \begin{environment}{enumerate} \oarg{enumitem options}
% \begin{macrocode}
\AtBeginEnvironment{enumerate}{\LWR@enumeratestart}
\newcommand*{\LWR@enumeratestart}{%
\LWR@stoppars%
\LWR@pushoneclose{\LWR@depthlist}{\LWR@printcloseitemize{}}%
\LWR@htmltag{ul style="list-style-type:none"{}}%
\LWR@startpars%
\let\item\LWR@itemizeitem%
}
\AtEndEnvironment{enumerate}{\LWR@enumerateend}
\newcommand*{\LWR@enumerateend}{%
\LWR@stoppars%
\LWR@closeprevious{\LWR@depthlistitem}%
\LWR@closeoneprevious{}%
\LWR@startpars%
}
% \end{macrocode}
% \end{environment}
% \subsection{Description}
% \begin{macro}{\LWR@descitem} \oarg{label}
% Handles an |\item| inside a description.
% \begin{macrocode}
\newcommand*{\LWR@descitem}[1][]%
{%
\LWR@stoppars%
\LWR@setlatestname{#1}%
\LWR@startnewdepth{\LWR@depthlistitem}{\LWR@printclosedescitem{}}%
\LWR@origitem[]%
% \end{macrocode}
% Be sure the label doesn't print to the left of the rest of the file:
% \begin{macrocode}
\LWR@orighspace{1in}
\LWR@htmltag{dt}#1\LWR@htmltag{/dt}%
\LWR@orignewline%
\LWR@htmltag{dd}%
\LWR@startpars%
}
% \end{macrocode}
% \end{macro}
% \begin{environment}{description} \oarg{enumitem options}
% \begin{macrocode}
\AtBeginEnvironment{description}{\LWR@descriptionstart}
\newcommand*{\LWR@descriptionstart}{%
\LWR@stoppars%
\LWR@pushoneclose{\LWR@depthlist}{\LWR@printclosedescription{}}%
\LWR@htmltag{dl}%
\LWR@startpars%
\let\item\LWR@descitem%
}
\AtEndEnvironment{description}{\LWR@descriptionend}
\newcommand*{\LWR@descriptionend}{%
\LWR@stoppars%
\LWR@closeprevious{\LWR@depthlistitem}%
\LWR@closeoneprevious{}%
\LWR@startpars%
}
% \end{macrocode}
% \end{environment}
% \begin{macro}{\newlist} \marg{name} \marg{type} \marg{maxdepth}
% \begin{macro}{\renewlist} \marg{name} \marg{type} \marg{maxdepth}
%
% For \pkg{enumitem} lists, new lists must have the start and end actions assigned to
% the new environment. Renewed lists already have their actions assigned, and
% thus need no changes.
% \begin{macrocode}
\let\LWR@orignewlist\newlist
\renewcommand*{\newlist}[3]{%
\LWR@orignewlist{#1}{#2}{#3}%
\AtBeginEnvironment{#1}{\csuse{LWR@#2start}}%
\AtEndEnvironment{#1}{\csuse{LWR@#2end}}%
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Tabular}
%
% This is arguably the most complicated part of the entire package.
% Numerous tricks are employed to handle the syntax which is involved.
%
% Limitations:
% \limitstabular
%
% \changes{v0.20}{2017/01/07}{Added @, \protect\textless, \protect\textgreater\ columns.}
% \changes{v0.20}{2017/01/17}{Tabular: \cs{unskip} extra spaces.}
%
% \subsection{Token lookahead}
% Used by |\LWR@futurenonspacelet| to look at the next token.
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@mynexttoken}
% \begin{macrocode}
\newcommand\LWR@mynexttoken\relax
% \end{macrocode}
% \end{macro}
% |\futurelet| copies the next token then executes a function to analyze
% |\LWR@futurenonspacelet| does the same, but ignores intervening white space
% Based on the \pkg{booktabs} style:
% \begin{macro}{\LWR@futurenonspacelet}
% \begin{macrocode}
\def\LWR@futurenonspacelet#1{\def\LWR@cs{#1}%
\afterassignment\LWR@fnslone\let\nexttoken= }
\def\LWR@fnslone{\expandafter\futurelet\LWR@cs\LWR@fnsltwo}
\def\LWR@fnsltwo{%
\expandafter\ifx\LWR@cs\@sptoken\let\next=\@BTfnslthree%
\else\let\next=\nexttoken\fi\next}
\def\@BTfnslthree{\afterassignment\LWR@fnslone\let\next= }
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@getmynexttoken}
% Looks ahead and copies the next token into |\LWR@mynexttoken|.
% \begin{macrocode}
\newcommand*{\LWR@getmynexttoken}{%
% nothing must follow this next line
\LWR@futurenonspacelet\LWR@mynexttoken\LWR@tabledatacolumntag
}
% \end{macrocode}
% \end{macro}
% \subsection{Booleans}
% \DescribeBoolean{LWR@startedrow}
% True if should print a row tag before this column.
% \begin{macrocode}
\newbool{LWR@startedrow}
\boolfalse{LWR@startedrow}
% \end{macrocode}
% \DescribeBoolean{LWR@doinghline}
% True if the next row will have an hline above it.
% \begin{macrocode}
\newbool{LWR@doinghline}
\boolfalse{LWR@doinghline}
% \end{macrocode}
% \DescribeBoolean{LWR@doingtbrule}
% True if the next row will have a top/bottom rule above it.
% \begin{macrocode}
\newbool{LWR@doingtbrule}
\boolfalse{LWR@doingtbrule}
% \end{macrocode}
% \DescribeBoolean{LWR@tableparcell}
% True if are handling a paragraph inside a table cell,
% so must close the paragraph tag before moving on.
% \begin{macrocode}
\newbool{LWR@tableparcell}
% \end{macrocode}
% \DescribeBoolean{LWR@skippingmrowcell}
% True if are doing an empty multi-row cell,
% and thus there is no data tag to close.
% \begin{macrocode}
\newbool{LWR@skippingmrowcell}
% \end{macrocode}
% \DescribeBoolean{LWR@intabularmetadata}
% True if are in a tabular but not in a data cell.
% Used to prevent extra \acro{HTML} breaks if not inside table data.
% \begin{macrocode}
\newbool{LWR@intabularmetadata}
\boolfalse{LWR@intabularmetadata}
% \end{macrocode}
% \subsection{Handling \&}
%
% \begin{minipage}{\linewidth}
% For technical discussion regarding problems redefining |\&|, See: \\
% \href{http://tex.stackexchange.com/questions/11638/where-do-i-find-futurelets-nasty-behaviour-documented/11860#11860}
% {http://tex.stackexchange.com/questions/11638/ \\ \hspace*{.25in} where-do-i-find-futurelets-nasty-behaviour-documented/11860\#11860}
% \end{minipage}
%
% \begin{macro}{\LWR@closetabledatacell}
% If |LWR@skippingmrowcell| then there is no data tag to close.
% Otherwise, close any paragraphs, then close the data tag.
% \begin{macrocode}
\newcommand*{\LWR@closetabledatacell}{%
\global\booltrue{LWR@intabularmetadata}%
\ifbool{LWR@exitingtabular}{}%
{% not exiting tabular
\ifbool{LWR@skippingmrowcell}{}%
{% not skippingmrowcell
% \end{macrocode}
% Insert any |<| then any |@| column contents:
% \begin{macrocode}
\unskip%
\LWR@getexparray{LWR@colafterspec}{\theLWR@tablecolspos}%
\LWR@getexparray{LWR@colatspec}{\theLWR@tablecolspos}%
% \end{macrocode}
% Close paragraphs:
% \begin{macrocode}
\ifbool{LWR@tableparcell}{\LWR@stoppars}{}%
\global\boolfalse{LWR@tableparcell}%
% \end{macrocode}
% Close the table data cell:
% \begin{macrocode}
\unskip\LWR@htmltag{/td}\LWR@orignewline%
}% not skipping mrowcell
}% not exiting tabular
\global\boolfalse{LWR@skippingmrowcell}%
}
% \end{macrocode}
% \end{macro}
% |LWR@tabulardepth| tracks whether |&| is being used inside a \env{tabular}.
% \begin{macrocode}
\newcounter{LWR@tabulardepth}
\setcounter{LWR@tabulardepth}{0}
% \end{macrocode}
% When not used inside a \env{tabular}, |&| performs its original
% function as recorded here ( with catcode 4 ).
% \begin{macrocode}
\def\LWR@origampmacro{&}
% \end{macrocode}
% See below for why the group is used.
% \begin{macrocode}
\begingroup
% \end{macrocode}
%
% \changes{v0.15}{2016/03/31}{Ampersand (\&): Fixed handling when passed as an argument.}
%
% \begin{macro}{&} Will behave depending on whether it is being used inside \env{tabular}.
%
% |&| is redefined to test whether it is inside a tabular environment,
% in which case it performs special processing for \acro{HTML} conversion.
% If not, it behaves normally.
%
% The |\catcode| allows the |&| character to be redefined.
% \begin{macrocode}
\catcode`\&=\active
\gdef&{%
\ifthenelse{\cnttest{\value{LWR@tabulardepth}}{>}{0}}%
{%
% \end{macrocode}
% If not skipping a multirow cell, close the current data cell.
% \begin{macrocode}
\unskip%
\LWR@closetabledatacell%
% \end{macrocode}
% Move to the next column.
% \begin{macrocode}
\addtocounter{LWR@tablecolspos}{1}%
% \end{macrocode}
% Look at the next token to decide multi or single column data tag.
% \begin{macrocode}
\LWR@getmynexttoken%
}%
% \end{macrocode}
% If not inside a tabular, performs the original action:
% \begin{macrocode}
{\LWR@origampmacro}%
}
\endgroup
% \end{macrocode}
% Outside the group, |&| is left its original catcode for now.
%
% \pkg{tikz} package seems to require |&| be left alone until after
% \pkg{tikz} has been loaded.
%
% \cs{LWR@lwarpStart} finally makes |&| active at the beginning of the
% \acro{HTML} conversion.
% \end{macro}
%
% \subsection{Handling \protect\textbackslash\protect\textbackslash}
% Inside tabular, |\\| is redefined to |\LWR@tabularendofline|
%
% Throws away options |\\[dim]| or |\\*|
%
% \begin{macro}{\LWR@tabularendofline}
% \begin{macrocode}
\NewDocumentCommand{\LWR@tabularendofline}{s o}
{%
\LWR@closetabledatacell%
% \end{macrocode}
% Finish the previous row:
% \begin{macrocode}
\LWR@htmltag{/tr}\LWR@orignewline
\global\booltrue{LWR@intabularmetadata}
% \end{macrocode}
% Not yet started a table row:
% \begin{macrocode}
\global\boolfalse{LWR@startedrow}
% \end{macrocode}
% Additional setup:
% \begin{macrocode}
\global\boolfalse{LWR@doinghline}%
\global\boolfalse{LWR@doingtbrule}%
\LWR@clearmidrules%
% \end{macrocode}
% Start at first column:
% \begin{macrocode}
\setcounter{LWR@tablecolspos}{1}
% \end{macrocode}
% Look at the next token to decide between single column data tag
% or a special case:
% \begin{macrocode}
\LWR@getmynexttoken%
}
% \end{macrocode}
% \end{macro}
% \subsection{Variables}
% \begin{macrocode}
\newcommand*{\LWR@colsresult}{}%temp storage for column format results
\newcommand*{\LWR@pposition}{}
\newcommand*{\LWR@pleft}{}
\newcommand*{\LWR@pright}{}
% \end{macrocode}
% \begin{macro}{\LWR@tablecolspec} Holds the parsed column specification,
% of total width |LWR@tabletotalcols|.
%
% Will contain a string such as |llrrccpc|, exactly one letter per column,
% without |@|, |>|, |<|, or the vertical pipe.
% \begin{macrocode}
\newcommand*{\LWR@tablecolspec}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@strresult} Holds the result of |Str| functions.
% \begin{macrocode}
\newcommand*{\LWR@strresult}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@origcolspec} Holds the original column specs given to \env{tabular}.
% \begin{macrocode}
\newcommand*{\LWR@origcolspec}{}
% \end{macrocode}
% \end{macro}
% \DescribeCounter{LWR@tablecolswidth}
% Holds the width of the table specification.
%
% (This is not the total \# columns.)
% \begin{macrocode}
\newcounter{LWR@tablecolswidth}
% \end{macrocode}
% \DescribeCounter{LWR@tablecolspos}
% Where are currently looking into the table column specification.
% \begin{macrocode}
\newcounter{LWR@tablecolspos}
% \end{macrocode}
% \DescribeCounter{LWR@tabletotalcols}
% Holds the final number of table columns.
% \begin{macrocode}
\newcounter{LWR@tabletotalcols}
% \end{macrocode}
% \DescribeCounter{LWR@tabletotalcolsnext}
% Holds the next column while parsing.
% Is one more than |LWR@tabletotalcols|.
% \begin{macrocode}
\newcounter{LWR@tabletotalcolsnext}
% \end{macrocode}
% \DescribeObject{LWR@colatspec}A data array of specifications for |@| columns.
% The leftmost's index is |leftedge|, the others are counter values.
% See \cref{sec:dataarray}.
%
% \DescribeObject{LWR@colbeforespec}A data array of specifications for |>| columns.
%
% \DescribeObject{LWR@colafterspec}A data array of specifications for |<| columns.
% \subsection{Parsing @, >, <, ! columns}
%
% \begin{macro}{\LWR@parseatcolumn}
%
% Handles |@{text}| columns.
%
%
% \begin{macrocode}
\newcommand*{\LWR@parseatcolumn}{%
% \end{macrocode}
% Move to the next token after the '@':
% \begin{macrocode}
\LWR@traceinfo{at column}%
\addtocounter{LWR@tablecolspos}{1}%
% \end{macrocode}
% Read the next token into \cs{LWR@strresult}, expanding once:
% \begin{macrocode}
\LWR@traceinfo{about to read the next token:}%
\expandarg%
\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@strresult]
\fullexpandarg%
% \end{macrocode}
% Store the result into a data array, expanding once out of \cs{LWR@strresult}:
% \begin{macrocode}
\LWR@traceinfo{have now read the next token}%
\ifthenelse{\cnttest{\value{LWR@tabletotalcols}}=0}
{% left edge of the table:
\LWR@traceinfo{at the left edge}%
\LWR@setexparray{LWR@colatspec}{leftedge}{\LWR@strresult}%
\LWR@traceinfo{finished with the def}%
}%
{% not at the left edge:
\LWR@traceinfo{not at the left edge}%
\LWR@setexparray{LWR@colatspec}{\theLWR@tabletotalcols}{\LWR@strresult}%
\LWR@traceinfo{at \theLWR@tabletotalcols: \LWR@colatspec(\theLWR@tabletotalcols)!}%
}%
\let\LWR@strresult\relax%
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\LWR@parsebeforecolumn}
%
% Handles |>{text}| columns.
%
% \begin{macrocode}
\newcommand*{\LWR@parsebeforecolumn}{%
% \end{macrocode}
% Move to the next token after the '>':
% \begin{macrocode}
\addtocounter{LWR@tablecolspos}{1}%
% \end{macrocode}
% Read the next token, expanding once into \cs{LWR@strresult}:
% \begin{macrocode}
\expandarg%
\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@strresult]%
\fullexpandarg%
% \end{macrocode}
% Store the result into a data array, expanding once out of \cs{LWR@strresult}:
% \begin{macrocode}
\LWR@setexparray{LWR@colbeforespec}{\theLWR@tabletotalcolsnext}{\LWR@strresult}%
\let\LWR@strresult\relax%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LWR@parseaftercolumn}
%
% Handles |<{text}| columns.
%
% \begin{macrocode}
\newcommand*{\LWR@parseaftercolumn}{%
% \end{macrocode}
% Move to the next token after the '<':
% \begin{macrocode}
\addtocounter{LWR@tablecolspos}{1}%
% \end{macrocode}
% Read the next token, expanding once into \cs{LWR@strresult}:
% \begin{macrocode}
% \StrChar{#1}{\theLWR@tablecolspos}[\LWR@strresult]
\expandarg%
\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@strresult]%
\fullexpandarg%
% \end{macrocode}
% Store the result into a data array, expanding once out of \cs{LWR@strresult}:
% \begin{macrocode}
\LWR@setexparray{LWR@colafterspec}{\theLWR@tabletotalcols}{\LWR@strresult}%
\let\LWR@strresult\relax%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LWR@parseskipcolumn}
%
% Handles columns to skip, such as !.
%
% \begin{macrocode}
\newcommand*{\LWR@parseskipcolumn}{%
}
% \end{macrocode}
% \end{macro}
%
%
% \subsection{Parsing `l', `c', or `r' columns}
%
% \begin{macro}{\LWR@parsenormalcolumn} \marg{thiscolumn}
%
% Add to the accumulated column specs, advance counters,
% and pre-clear another column of at, before, and after specs.
% \begin{macrocode}
\newcommand*{\LWR@parsenormalcolumn}[1]{%
\appto\LWR@tablecolspec{#1}%
\addtocounter{LWR@tabletotalcols}{1}%
\addtocounter{LWR@tabletotalcolsnext}{1}%
\LWR@setexparray{LWR@colatspec}{\theLWR@tabletotalcolsnext}{\relax}%
\LWR@setexparray{LWR@colbeforespec}{\theLWR@tabletotalcolsnext}{\relax}%
\LWR@setexparray{LWR@colafterspec}{\theLWR@tabletotalcolsnext}{\relax}%
}
% \end{macrocode}
% \end{macro}
% \subsection{Parsing `p', `m', or `b' columns}
% \begin{macro}{\LWR@parsepcolumn} \marg{thiscolumn}
% the width will be ignored
% \begin{macrocode}
\newcommand*{\LWR@parsepcolumn}[1]{%
% \end{macrocode}
% converts to the given column type
% \begin{macrocode}
\LWR@parsenormalcolumn{#1}%
% \end{macrocode}
% skips the following width
% \begin{macrocode}
\addtocounter{LWR@tablecolspos}{1}%
}
% \end{macrocode}
% \end{macro}
% \subsection{Parsing the column specifications}
% \acro{HTML} \acro{CSS} cannot exactly match the \LaTeX{} concept of a baseline for
% a table row.
% \watchout
% \Cref{tab:baseline} shows the \LaTeX{} results for various
% vertical-alignment choices, with the baseline of the first column drawn across
% all the columns for comparison.
% See the |p| column specification in \cref{tab:columnconversions} for details.
%
% \begin{table}
% \caption{Tabular baseline\label{tab:baseline}}
% \index{tabular>baseline}\index{baseline>tabular}
% \centering
% \smallskip
% \begin{tabular}{lp{.25in}m{.25in}b{.25in}r}
% \toprule
% l & p & m & b & r \\
% \midrule
% l \rule{1.65in}{.4pt} \hspace{-1.4in} &
% par \newline par \newline par &
% mid \newline mid \newline mid &
% bot \newline bot \newline bot &
% r \\
% \bottomrule
% \end{tabular}
% \end{table}
%
% \Cref{tab:columnconversions} describes how each kind of column is
% converted to \acro{HTML}.
%
% \begin{table}
% \caption{Tabular \acro{HTML} column conversions\label{tab:columnconversions}}
% \index{tabular>HTML colummn conversion}
% \index{HTML>tabular column conversion}
%
% \medskip
%
% \hrule
% \begin{description}[parsep=.5ex]
% \item [l, r, c:] Converted to table cells without paragraph tags. \\
% Uses \acro{CSS} |vertical-align:middle| so that top or bottom-aligned cells may go above or below this cell.
% \item [p:] Converted to table cells with paragraph tags.
% Ref: \Cref{tab:baseline},
% \LaTeX{} places the top line of a parbox
% aligned with the rest of the text line, so \acro{CSS} |vertical-align:bottom| is used to
% have the \acro{HTML} result appear with the paragraph extending below the L, R, C cells at the middle, if possible.
% This may be confusing as a P cell may not top-align with an L,R,C cell in the \acro{HTML}
% conversion, especially in the presence of a B cell, and two P cells side-by-side will
% be aligned at the bottom instead of the top.
% Some adjustment of the \acro{CSS} may be desired, changing
% |td.tdp|, |td.tdP|, |td.tdprule|, and |td.tdPrule| to |vertical-align: middle|.
% Another possibility is to change L,R,C, and P to |vertical-align: top| and not worry
% about the alignment of B and M cells or trying to approximate \LaTeX{} baselines.
% \item [m:] With paragraph tags, \acro{CSS} |vertical-align:middle|.
% \item [b:] With paragraph tags, \acro{CSS} |vertical-align:top| so that the bottom of the
% text is closest to the middle of the text line.
% \item [P, M, B:] Horizontally-centered versions,
% \item [S:] Converted to 'r'. From the \pkg{siunitx} package.
% \item [@, \textgreater{}, \textless{}:] Ignored so far.
% \end{description}
% \hrule
% \end{table}
%
%
% \begin{macro}{\LWR@parsetablecols} \marg{colspecs}
%
% Scans the column specification left to right.
%
% Builds \cs{LWR@tablecolspec} with the final specification,
% one column per entry. The number of final columns is
% stored in |LWR@tabletotalcols|.
%
% \begin{macrocode}
\newcommand*{\LWR@parsetablecols}[1]{%
\LWR@traceinfo{LWR@parsetablecols started}%
% \end{macrocode}
% Remember the original supplied column spec:
% \begin{macrocode}
\renewcommand*{\LWR@origcolspec}{#1}%
% \end{macrocode}
% Clear the parsed resulting column spec:
% \begin{macrocode}
\renewcommand*{\LWR@tablecolspec}{}%
% \end{macrocode}
% Total number of columns found so far.
% Also pre-initialize the first several columns of specs:
% \begin{macrocode}
\setcounter{LWR@tabletotalcols}{0}%
\setcounter{LWR@tabletotalcolsnext}{1}%
\LWR@setexparray{LWR@colatspec}{leftedge}{\relax}%
\LWR@setexparray{LWR@colatspec}{1}{\relax}%
\LWR@setexparray{LWR@colatspec}{2}{\relax}%
\LWR@setexparray{LWR@colatspec}{3}{\relax}%
\LWR@setexparray{LWR@colbeforespec}{1}{\relax}%
\LWR@setexparray{LWR@colbeforespec}{2}{\relax}%
\LWR@setexparray{LWR@colbeforespec}{3}{\relax}%
\LWR@setexparray{LWR@colafterspec}{1}{\relax}%
\LWR@setexparray{LWR@colafterspec}{2}{\relax}%
\LWR@setexparray{LWR@colafterspec}{3}{\relax}%
% \end{macrocode}
% Starting at the first column specification:
% \begin{macrocode}
\setcounter{LWR@tablecolspos}{1}%
% \end{macrocode}
% Place the colspecs string length into \cs{LWR@strresult},
% and remember the number of characters in the column specification:
% \begin{macrocode}
\LWR@traceinfo{about to StrLen}%
\noexpandarg%
\StrLen{#1}[\LWR@strresult]%
\fullexpandarg%
\LWR@traceinfo{finished StrLen}%
\setcounter{LWR@tablecolswidth}{\LWR@strresult}%
% \end{macrocode}
% Scan through the column specifications:
% \begin{macrocode}
\whiledo{\not\value{LWR@tablecolspos}>\value{LWR@tablecolswidth}}{%
% \end{macrocode}
% Place the next single-character column type into \cs{LWR@strresult}:
% \begin{macrocode}
\noexpandarg%
\StrChar{#1}{\theLWR@tablecolspos}[\LWR@strresult]%
\fullexpandarg%
% \end{macrocode}
% Note that the parameter for a |p{spec}| column is a token list which will NOT match l,c,r,p.
% \watchout
% \begin{macrocode}
\IfStrEq{\LWR@strresult}{l}{\LWR@parsenormalcolumn{l}}{}%
\IfStrEq{\LWR@strresult}{c}{\LWR@parsenormalcolumn{c}}{}%
\IfStrEq{\LWR@strresult}{r}{\LWR@parsenormalcolumn{r}}{}%
\IfStrEq{\LWR@strresult}{S}{\LWR@parsenormalcolumn{r}}{}%
\IfStrEq{\LWR@strresult}{\detokenize{@}}{\LWR@parseatcolumn}{}%
\IfStrEq{\LWR@strresult}{>}{\LWR@parsebeforecolumn}{}%
\IfStrEq{\LWR@strresult}{<}{\LWR@parseaftercolumn}{}%
\IfStrEq{\LWR@strresult}{!}{\LWR@parseskipcolumn}{}%
\IfStrEq{\LWR@strresult}{p}{\LWR@parsepcolumn{p}}{}%
\IfStrEq{\LWR@strresult}{m}{\LWR@parsepcolumn{m}}{}%
\IfStrEq{\LWR@strresult}{b}{\LWR@parsepcolumn{b}}{}%
% \end{macrocode}
% \begin{docsidebar}
% Many people define centered versions ``|P|'', ``|M|'', and ``|B|'': \\
% \hspace*{1em}|\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}|
% \end{docsidebar}
% \begin{macrocode}
\IfStrEq{\LWR@strresult}{P}{\LWR@parsepcolumn{P}}{}%
\IfStrEq{\LWR@strresult}{M}{\LWR@parsepcolumn{M}}{}%
\IfStrEq{\LWR@strresult}{B}{\LWR@parsepcolumn{B}}{}%
\addtocounter{LWR@tablecolspos}{1}%
}%
}%
% \end{macrocode}
% \end{macro}
% \subsection{Starting a new row}
% \begin{macro}{\LWR@maybenewtablerow}
%
% If have not yet started a new table row, begin one now.
% Creates a new row tag, adding a class for |hline| or |tbrule| if
% necessary.
% \begin{macrocode}
\newcommand*{\LWR@maybenewtablerow}
{%
\ifbool{LWR@startedrow}%
{}% started the row
{% not started the row
% \end{macrocode}
% Remember that now have started the row:
% \begin{macrocode}
\global\booltrue{LWR@startedrow}%
% \end{macrocode}
% Create the row tag, with a class if necessary.
% \begin{macrocode}
\global\booltrue{LWR@intabularmetadata}%
\ifbool{LWR@doinghline}%
{\LWR@htmltag{tr class="hline"{}}\LWR@orignewline}%
{% not doing hline
\ifbool{LWR@doingtbrule}%
{\LWR@htmltag{tr class="tbrule"{}}\LWR@orignewline}%
{\LWR@htmltag{tr}\LWR@orignewline}%
}% end of not doing hline
}% end of not started the row
}
% \end{macrocode}
% \end{macro}
% \subsection{Data opening tag}
% \begin{macro}{\LWR@tabledatasinglecolumntag}
% Print a table data opening tag with style for alignment
% \begin{macrocode}
\newcommand*{\LWR@tabledatasinglecolumntag}%
{%
\LWR@maybenewtablerow%
% \end{macrocode}
% If have found the end of tabular command, do not create the next data cell:
% \begin{macrocode}
\ifbool{LWR@exitingtabular}{}%
{% not exiting tabular
% \end{macrocode}
% Fetch the current column's alignment character into |\LWR@strresult|:
% \begin{macrocode}
\StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}[\LWR@strresult]%
% \end{macrocode}
% print the start of a new table data cell:
% \begin{macrocode}
\LWR@htmltag{td class="td%
% \end{macrocode}
% append this column's spec:
% \begin{macrocode}
\LWR@strresult%
% \end{macrocode}
% If this column has a cmidrule, add ``rule'' to the end of the \acro{HTML} class tag:
% \begin{macrocode}
\ifthenelse{\equal{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}{Y}}{rule}{}%
"{}}%
% \end{macrocode}
% If this is a p, m, or b column, allow paragraphs:
% \begin{macrocode}
\ifthenelse{%
\equal{\LWR@strresult}{p}\OR%
\equal{\LWR@strresult}{m}\OR%
\equal{\LWR@strresult}{b}\OR%
\equal{\LWR@strresult}{P}\OR%
\equal{\LWR@strresult}{M}\OR%
\equal{\LWR@strresult}{B}%
}%
{% allow pars
\LWR@startpars%
\global\booltrue{LWR@tableparcell}%
}% allow pars
{}% no pars
% \end{macrocode}
% Print the |@| contents before first column,
% and then the |>| contents:
% \begin{macrocode}
\ifthenelse{\cnttest{\value{LWR@tablecolspos}}=1}%
{\LWR@getexparray{LWR@colatspec}{leftedge}}% left edge
{}% not left edge
\LWR@getexparray{LWR@colbeforespec}{\theLWR@tablecolspos}%
\global\boolfalse{LWR@intabularmetadata}%
}% not exiting tabular
}%
% \end{macrocode}
% \end{macro}
% \subsection{Midrules}
%
% \DescribeObject{LWR@midrules}|LWR@midrules| is a data array
% (\cref{sec:dataarray}) of columns containing
% |Y| if a midrule should be created for each column.
% \DescribeCounter{LWR@midrulecounter}
% Indexes across the |LWR@midrules| data array.
% \begin{macrocode}
\newcounter{LWR@midrulecounter}
% \end{macrocode}
% \begin{macro}{\LWR@clearmidrules}
% Start new midrules. Called at beginning of tabular and also at |\\|.
%
% Clears all |LWR@midrules| markers for this line.
% \begin{macrocode}
\newcommand*{\LWR@clearmidrules}
{%
\setcounter{LWR@midrulecounter}{1}%
\whiledo{%
\cnttest{\value{LWR@midrulecounter}}{<=}{\value{LWR@tablecolswidth}}%
}%
{%
\LWR@setexparray{LWR@midrules}{\theLWR@midrulecounter}{\relax}%
\addtocounter{LWR@midrulecounter}{1}%
}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@subcmidrule} \oarg{width} \marg{trim} \marg{leftcolumn} \marg{rightcolumn}
%
% Marks |LWR@midrules| data array elements to be ``Y'' from left to right columns.
% \begin{macrocode}
\newcommand*{\LWR@subcmidrule}[4]{%
\setcounter{LWR@midrulecounter}{#3}%
\whiledo{\cnttest{\value{LWR@midrulecounter}}{<=}{#4}}%
{%
\LWR@setexparray{LWR@midrules}{\theLWR@midrulecounter}{Y}%
\addtocounter{LWR@midrulecounter}{1}%
}% end of the whiledo
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@docmidrule} \oarg{width} \marg{trim} \marg{leftcolumn-rightcolumn}
%
% Marks |LWR@midrules| array elements to be ``Y'' from left to right columns.
%
% \begin{macrocode}
\NewDocumentCommand{\LWR@docmidrule}{o d() >{\SplitArgument{1}{-}}m}%
{\LWR@subcmidrule{#1}{#2}#3}
% \end{macrocode}
% \end{macro}
% \subsection{Multicolumns}
% \subsubsection{Parsing multicolumns}
% \begin{macrocode}
\newcounter{LWR@tablemulticolswidth}
\newcounter{LWR@tablemulticolspos}
% \end{macrocode}
% \begin{macro}{\LWR@printmccoltype} \marg{colspec}
% Print any valid column type found. Does not print |@|, |>|, or |<| columns
% or their associated tokens.
% \begin{macrocode}
\newcommand*{\LWR@printmccoltype}[1]{%
\LWR@traceinfo{lwr@printmccoltype -#1-}%
% \end{macrocode}
% Get one token of the column spec:
% \begin{macrocode}
\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]%
% \end{macrocode}
% Add to the \acro{HTML} tag depending on which column type is found:
% \begin{macrocode}
\IfStrEq{\LWR@strresult}{l}{l}{}%
\IfStrEq{\LWR@strresult}{c}{c}{}%
\IfStrEq{\LWR@strresult}{r}{r}{}%
\IfStrEq{\LWR@strresult}{p}{p}{}%
\IfStrEq{\LWR@strresult}{m}{m}{}%
\IfStrEq{\LWR@strresult}{b}{b}{}%
\IfStrEq{\LWR@strresult}{P}{P}{}%
\IfStrEq{\LWR@strresult}{M}{M}{}%
\IfStrEq{\LWR@strresult}{B}{B}{}%
\IfStrEq{\LWR@strresult}{S}{r}{}%
\LWR@traceinfo{lwr@printmccoltype done}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@multicolpartext}
% Print the data with paragraph tags:
% \begin{macrocode}
\newcommand*{\LWR@multicolpartext}{%
\LWR@startpars%
\LWR@multicoltext%
\LWR@stoppars%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@multicolother} \marg{colspec}
% For |@|, |>|, |<|, print the next token without paragraph tags:
% \begin{macrocode}
\newcommand*{\LWR@multicolother}[1]{%
\addtocounter{LWR@tablemulticolspos}{1}%
\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]%
\LWR@strresult%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@printmccoldata} \marg{colspec}
% Print the data for any valid column type found.
% \begin{macrocode}
\newcommand*{\LWR@printmccoldata}[1]{%
\LWR@traceinfo{lwr@printmccoldata -#1}%
% \end{macrocode}
% Get one token of the column spec:
% \begin{macrocode}
\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]%
% \end{macrocode}
% Print the text depending on which column type is found.
% Also handles |@|, |>|, |<| as it comes to them.
% \begin{macrocode}
\IfStrEq{\LWR@strresult}{l}{\LWR@multicoltext}{}%
\IfStrEq{\LWR@strresult}{c}{\LWR@multicoltext}{}%
\IfStrEq{\LWR@strresult}{r}{\LWR@multicoltext}{}%
\IfStrEq{\LWR@strresult}{p}{\LWR@multicolpartext}{}%
\IfStrEq{\LWR@strresult}{m}{\LWR@multicolpartext}{}%
\IfStrEq{\LWR@strresult}{b}{\LWR@multicolpartext}{}%
\IfStrEq{\LWR@strresult}{P}{\LWR@multicolpartext}{}%
\IfStrEq{\LWR@strresult}{M}{\LWR@multicolpartext}{}%
\IfStrEq{\LWR@strresult}{B}{\LWR@multicolpartext}{}%
\IfStrEq{\LWR@strresult}{S}{\LWR@multicolpartext}{}%
\IfStrEq{\LWR@strresult}{\detokenize{@}}{\LWR@multicolother{#1}}{}%
\IfStrEq{\LWR@strresult}{\detokenize{>}}{\LWR@multicolother{#1}}{}%
\IfStrEq{\LWR@strresult}{\detokenize{<}}{\LWR@multicolother{#1}}{}%
% \addtocounter{LWR@tablemulticolspos}{1}%
% \StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]%
% \LWR@strresult%
% }{}%
\LWR@traceinfo{lwr@printmccoldata done}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\parsemulticolumnalignment}
% \marg{1: colspec} \marg{2: printresults}
%
% Scan the multicolumn specification and execute the printfunction
% for each entry.
%
% Note that the spec for a |p{spec}| column, or |@|, |>|, |<|, is a token list
% which will NOT match |l|, |c|, |r|, or |p|.
% \begin{macrocode}
\newcommand*{\LWR@parsemulticolumnalignment}[2]{%
\setcounter{LWR@tablemulticolspos}{1}%
\StrLen{#1}[\LWR@strresult]%
\setcounter{LWR@tablemulticolswidth}{\LWR@strresult}%
% \end{macrocode}
% Scan across the tokens in the column spec:
% \begin{macrocode}
\whiledo{%
\not\value{LWR@tablemulticolspos}>\value{LWR@tablemulticolswidth}%
}%
{%
% \end{macrocode}
% Execute the assigned print function for each token in the column spec:
% \begin{macrocode}
#2{#1}%
% \end{macrocode}
% Move to the next token in the column spec:
% \begin{macrocode}
\addtocounter{LWR@tablemulticolspos}{1}%
}%
}
% \end{macrocode}
% \end{macro}
% \subsubsection{High-level multicolumn interface}
% \begin{macro}{\LWR@domulticolumn} \marg{1: numcols} \marg{2: colspec} \marg{3: text}
%
% \begin{macrocode}
\newcommand{\LWR@multicoltext}{}
\NewDocumentCommand{\LWR@domulticolumn}{m m +m}{%
\LWR@traceinfo{lwr@domulticolumn -#1- -#2-}%
\renewcommand{\LWR@multicoltext}{#3}%
\LWR@maybenewtablerow%
% \end{macrocode}
% Begin the opening table data tag:
% \begin{macrocode}
\LWR@htmltag{td colspan="#1"
class="td%
% \end{macrocode}
% Print the column type:
% \begin{macrocode}
\LWR@parsemulticolumnalignment{#2}{\LWR@printmccoltype}%
% \end{macrocode}
% If this column has a cmidrule, add ``rule'' to the end of the \acro{HTML} class tag.
%
% If this position had a ``Y'' then add ``rule''.
% \begin{macrocode}
\ifthenelse{\equal{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}{Y}}{rule}{}%
% \end{macrocode}
% Close the class tag's opening quote:
% \begin{macrocode}
"%
}% end of the opening table data tag
\global\boolfalse{LWR@intabularmetadata}%
\LWR@parsemulticolumnalignment{#2}{\LWR@printmccoldata}%
}
% \end{macrocode}
% \end{macro}
% \subsubsection{Longtable captions}
% \DescribeBoolean{LWR@starredlongtable}
% Per the \pkg{caption} pacakge, step the counter if |longtable*|.
%
% \begin{macrocode}
\newbool{LWR@starredlongtable}
\boolfalse{LWR@starredlongtable}
% \end{macrocode}
%
%
% Per the \pkg{caption} package. User-redefinable float type.
% \begin{macrocode}
\providecommand*{\LTcaptype}{table}
% \end{macrocode}
%
%
% \begin{macro}{\LWR@longtabledatacaptiontag} * \oarg{toc entry} \marg{caption}
%
% \changes{v0.20}{2017/01/08}{Fix: Pars in captions.}
%
% \begin{macrocode}
\NewDocumentCommand{\LWR@longtabledatacaptiontag}{s o +m}
{%
% \end{macrocode}
% Remember the latest name for \cs{nameref}:
% \begin{macrocode}
\IfValueTF{#2}{% optional given?
\ifthenelse{\equal{#2}{}}% optional empty?
{\LWR@setlatestname{#3}}% empty
{\LWR@setlatestname{#2}}% given and non-empty
}% optional given
{\LWR@setlatestname{#3}}% no optional
% \end{macrocode}
% create a multicolumn across all the columns
% \begin{macrocode}
\LWR@domulticolumn{\theLWR@tabletotalcols}{P}{% \LWR@domulticolumn
% \IfBooleanTF{#1}% star?
% {\IfValueTF{#2}{\LWR@origcaption*[#2]{#3}}{\LWR@origcaption*{#3}}}
% {\IfValueTF{#2}{\LWR@origcaption[#2]{#3}}{\LWR@origcaption{#3}}}
\IfBooleanTF{#1}% star?
% \end{macrocode}
% Star version, show a caption but do not make a LOT entry:
% \begin{macrocode}
{% yes star
\LWR@htmlblocktag{figcaption}%
#3%
\LWR@htmlblocktag{/figcaption}%
}%
{% No star:
% \end{macrocode}
% Not the star version:
%
% Don't step the counter if |\caption[]{A caption.}|
% \begin{macrocode}
\ifbool{LWR@starredlongtable}%
{%
\ifthenelse{\equal{#2}{}}% TOC entry
{}%
{%
\refstepcounter{\LTcaptype}%
\protected@edef\@currentlabel{%
\csuse{p@\LTcaptype}\csuse{the\LTcaptype}}%
}%
}{}%
% \end{macrocode}
% Create an \acro{HTML} caption. Afterwards, maybe make a LOT entry.
% \begin{macrocode}
\LWR@htmlblocktag{figcaption}%
\csuse{fnum@\LTcaptype}\CaptionSeparator#3%
\LWR@htmlblocktag{/figcaption}%
% \end{macrocode}
% See if an optional caption was given:
% \begin{macrocode}
\ifthenelse{\equal{#2}{}}% TOC entry empty
% \end{macrocode}
% if the optional caption was given, but empty, do not form a TOC entry
% \begin{macrocode}
{}%
% \end{macrocode}
% If the optional caption was given, but might only be |[]|:
% \begin{macrocode}
{% TOC entry not empty
\IfNoValueTF{#2}% No TOC entry?
% \end{macrocode}
% The optional caption is |[]|:
% \begin{macrocode}
{% No TOC entry
\addcontentsline%
{\csuse{ext@\LTcaptype}}%
{\LTcaptype}%
{%
\protect\numberline%
{\csuse{p@\LTcaptype}\csuse{the\LTcaptype}}%
{\ignorespaces #3\protect\relax}%
}%
}% end of No TOC entry
% \end{macrocode}
% The optional caption has text enclosed:
% \begin{macrocode}
{% yes TOC entry
\addcontentsline%
{\csuse{ext@\LTcaptype}}%
{\LTcaptype}%
{%
\protect\numberline%
{\csuse{p@\LTcaptype}\csuse{the\LTcaptype}}%
{\ignorespaces #2\protect\relax}%
}%
}% end of yes TOC entry
}% end of TOC entry not empty
}% end of no star
}% end of \LWR@domulticolumn
\addtocounter{LWR@tablecolspos}{\theLWR@tabletotalcols}
\addtocounter{LWR@tablecolspos}{-1}
}
% \end{macrocode}
% \end{macro}
% \subsubsection{\textbackslash{}tabledatamulticolumntag}
% \begin{macro}{\LWR@tabledatamulticolumntag} \marg{numcols} \marg{alignment} \marg{text}
% \begin{macrocode}
\NewDocumentCommand{\LWR@tabledatamulticolumntag}{m m +m}%
{%
\LWR@domulticolumn{#1}{#2}{#3}%
\addtocounter{LWR@tablecolspos}{#1}%
\addtocounter{LWR@tablecolspos}{-1}%
}
% \end{macrocode}
% \end{macro}
% \subsection{Multirow}
% \DescribePackage{multirow}
% \begin{macro}{\LWR@tabledatamultirowtag}
% \marg{numrows} \oarg{bigstruts} \marg{width} \oarg{fixup} \marg{text}
% \changes{v0.19}{2015/05/28}{Added optional args.}
% \begin{macrocode}
\NewDocumentCommand{\LWR@tabledatamultirowtag}{m o m o m}%
{%
\LWR@maybenewtablerow%
% \end{macrocode}
% Print the start of a new table data cell:
% \begin{macrocode}
\LWR@htmltag{td rowspan="#1" class="td%
% \end{macrocode}
% Append this column's spec:
% \begin{macrocode}
\StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}%
% \end{macrocode}
% If this column has a cmidrule, add ``rule'' to the end of the \acro{HTML} class tag:
% \begin{macrocode}
\ifthenelse{\equal{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}{Y}}{rule}{}%
"{}}
% \end{macrocode}
% While printing the text, redefine |\\| to generate a new line
% \begin{macrocode}
\begingroup \let\\\LWR@endofline #5 \endgroup
\LWR@stoppars%
\global\boolfalse{LWR@intabularmetadata}%
}%
% \end{macrocode}
% \end{macro}
% \subsection{Utility macros inside a table}
% \begin{macrocode}
\newcommand*{\LWR@donothing}{}
\newcommand*{\LWR@domidrule}{\booltrue{LWR@doinghline}}
\newcommand*{\LWR@dotbrule}{\booltrue{LWR@doingtbrule}}
% \end{macrocode}
% \subsection{Checking for a new table cell}
% \begin{macro}{\LWR@tabledatacolumntag}
% Open a new \acro{HTML} table cell unless the next token is for a macro
% which does not create data, such as |\hline|, |\toprule|, etc:
% \begin{macrocode}
\newbool{LWR@exitingtabular}
\newcommand*{\LWR@tabledatacolumntag}%
{%
% \end{macrocode}
% \hspace*{.5in} |\show\LWR@mynexttoken| to see what tokens to look for
% \begin{macrocode}
% \end{macrocode}
% If not any of the below, start a new table cell:
% \begin{macrocode}
\let\mynext\LWR@tabledatasinglecolumntag%
% \end{macrocode}
% If exiting the tabular:
% \begin{macrocode}
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\end}}%
{\booltrue{LWR@exitingtabular}}{}%
% \end{macrocode}
% \env{longtable} can have a caption in a cell
% \begin{macrocode}
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\caption}}%
{\let\mynext\LWR@donothing}{}%
% \end{macrocode}
% Look for other things which would not start a table cell:
% \begin{macrocode}
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\multicolumn}}%
{\let\mynext\LWR@donothing}{}%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\multirow}}%
{\let\mynext\LWR@donothing}{}%
% \end{macrocode}
% if come to an |\mrowcell|, this is a cell to be skipped over
% \begin{macrocode}
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\mrowcell}}%
{\let\mynext\LWR@donothing}{}%
%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\hline}}%
{\let\mynext\LWR@donothing}{}%
%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\toprule}}%
{%
\let\mynext\LWR@donothing}{}%
%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\midrule}}%
{\let\mynext\LWR@donothing}{}%
%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\cmidrule}}%
{\let\mynext\LWR@donothing}{}%
%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\cline}}%
{\let\mynext\LWR@donothing}{}%
%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\bottomrule}}%
{\let\mynext\LWR@donothing}{}%
%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\warpprintonly}}
{\let\mynext\LWR@donothing}{}%
%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\warpHTMLonly}}
{\let\mynext\LWR@donothing}{}%
% \end{macrocode}
% no action for an |\end| token
%
% Add similar to the above for any other non-data tokens
% which might appear in the table.
%
% Start the new table cell if was not any of the above:
% \begin{macrocode}
\mynext%
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \subsection{\textbackslash{}mrowcell}
% \begin{macro}{\mrowcell}
% The user must insert |\mrowcell| into any multirow cells which must be skipped.
% This command has no action during print output.
% \watchout
% \codeall
% \begin{macrocode}
\begin{warpall}
\newcommand*{\mrowcell}{}
\end{warpall}
% \end{macrocode}
% \end{macro}
% \subsection{New \textbackslash{}tabular definition}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{environment}{LWR@tabular} \oarg{vertposition} \marg{colspecs}
%
% The new tabular environment will be |\let| in |\LWR@LwarpStart|,
% since \pkg{siunitx} might redefine tabular in the user's document.
% \begin{macrocode}
\newenvironment*{LWR@tabular}[2][]
{%
\LWR@traceinfo{tabular started}%
\begingroup%
\addtocounter{LWR@tabulardepth}{1}%
% \end{macrocode}
% Not yet started a table row:
% \begin{macrocode}
\global\boolfalse{LWR@startedrow}%
% \end{macrocode}
% Not yet doing an hline:
% \begin{macrocode}
\global\boolfalse{LWR@doinghline}%
% \end{macrocode}
% Not yet doing a top/bottom rule:
% \begin{macrocode}
\global\boolfalse{LWR@doingtbrule}%
% \end{macrocode}
% Have not yet found the end of tabular command:
% \begin{macrocode}
\boolfalse{LWR@exitingtabular}%
% \end{macrocode}
% Create the |table| tag:
% \begin{macrocode}
\global\booltrue{LWR@intabularmetadata}%
\LWR@htmlblocktag{table}%
% \end{macrocode}
% Parse the table columns:
% \begin{macrocode}
\LWR@parsetablecols{#2}%
% \end{macrocode}
% Table col spec is: \cs{LWR@tablecolspec} which is a string of |llccrr|, etc.
%
% Do not place the table inside a paragraph:
% \begin{macrocode}
\LWR@stoppars%
% \end{macrocode}
% Track column \# for setting text-align:
% \begin{macrocode}
\setcounter{LWR@tablecolspos}{1}%
% \end{macrocode}
% Start looking for midrules:
% \begin{macrocode}
\LWR@clearmidrules%
% \end{macrocode}
% |\\| becomes a macro to end the table row:
% \begin{macrocode}
\let\\\LWR@tabularendofline%
% \end{macrocode}
% The following may appear before a data cell is created,
% so after doing their actions, we look ahead with |\LWR@getmynextoken|
% to see if the next token might create a new data cell:
% \begin{macrocode}
\renewcommand*{\hline}{\LWR@domidrule\LWR@getmynexttoken}%
\newcommand*{\midrule}{\LWR@domidrule\LWR@getmynexttoken}%
\NewDocumentCommand{\cmidrule}{o d() m}%
{\LWR@docmidrule[##1](##2){##3}\LWR@getmynexttoken}%
\RenewDocumentCommand{\cline}{m}%
{\LWR@docmidrule{##1}\LWR@getmynexttoken}%
\newcommand*{\toprule}{\LWR@dotbrule\LWR@getmynexttoken}%
\newcommand*{\bottomrule}{\LWR@dotbrule\LWR@getmynexttoken}%
% \end{macrocode}
% The following create data cells and will have no more data in this cell,
% so we do not want to look ahead for a possible data cell,
% so do not want to use |\LWR@getmynexttoken|.
% \begin{macrocode}
\let\multicolumn\LWR@tabledatamulticolumntag%
\let\multirow\LWR@tabledatamultirowtag%
\renewcommand*{\mrowcell}{\global\booltrue{LWR@skippingmrowcell}}%
\let\caption\LWR@longtabledatacaptiontag%
% \end{macrocode}
% Reset for new processing:
% \begin{macrocode}
\global\boolfalse{LWR@tableparcell}%
\global\boolfalse{LWR@skippingmrowcell}%
% \end{macrocode}
% Look ahead for a possible table data cell:
% \begin{macrocode}
\LWR@getmynexttoken%
}%
% \end{macrocode}
% Ending the environment:
% \begin{macrocode}
{%
\LWR@closetabledatacell%
\LWR@htmlblocktag{/tr}%
\LWR@htmlblocktag{/table}%
\global\boolfalse{LWR@intabularmetadata}%
% \end{macrocode}
% \begin{macrocode}
\addtocounter{LWR@tabulardepth}{-1}%
\endgroup%
}
% \end{macrocode}
% \end{environment}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \subsection{Array}
% \label{sec:array}
% \DescribePackage{array}
%
% \pkg{array} is also automatically loaded by siunitx.
% \section{Cross-references}
%
% Sectioning commands have been emulated from scratch, so the cross-referencing
% commands are custom-written for them.
% Emulating both avoids several layers of patches.
%
% The \pkg{zref} package is used to remember section name, file, and
% lateximage depth and number for each label.
%
% \Cref{tab:crossrefdata} shows the data structures related to cross-referencing.
%
% \changes{v0.14}{2016/03/29}{Docs: Table: Cross-referencing data structures.}
% \changes{v0.19}{2016/05/25}{Docs: Table: Cross-referencing data structures, updated.}
% \begin{table}
% \caption{Cross-referencing data structures\label{tab:crossrefdata}}
% \medskip
% \hrule
% \smallskip
% \begin{description}[nosep]
% \raggedright
% \item [Original \LaTeX:] \hfill (print and \acro{HTML})
% \begin{description}
% \item [\cs{refstepcounter}:] Steps the couunter and sets \cs{@currentlabel}.
% \item [\cs{@currentlabel}:] \cs{p@<ctr>}\cs{the<ctr>} Updated by \cs{refstepcounter}.
% \item [\cs{label}:] Writes to the |.aux| file:
% \qquad |\newlabel{<label>}{{\@currentlabel}{\thepage}}|
% \item [\cs{newlabel}:] When the |.aux| file is read, sets \cs{r@<label>}.
% \item [\cs{r@<label>}:] Set to: |{{\@currentlabel}{\thepage}}|
% \item [\cs{ref}:] Returns the first part of \cs{r@<label>}.
% \item [\cs{pageref}:] Returns the second part of \cs{r@<label>}.
% \end{description}
% \item [Added by \pkg{amsmath}:] \hfill (print and \acro{HTML})
% \begin{description}
% \item [\cs{label}:] Delayed until math is completed.
% \end{description}
% \item [Added by \pkg{lwarp}:] \hfill (\acro{HTML} only)
% \begin{description}
% \item [\cs{nameref}:] Emualted from \pkg{hyperref} for \pkg{lwarp}.
% See \cref{sec:references}.
% \item [\cs{ref} and \cs{nameref}:] Adds \acro{HTML} tags.
% See \cref{sec:references}.
% \end{description}
% \item [Added by \pkg{cleverref}:] \hfill (print and \acro{HTML})
% \begin{description}
% \item [\cs{refstepcounter:}] Added: sets \cs{cref@currentlabel}.
% \item [\cs{cref@currentlabel}:] (|<type>|=|<ctr>| unless an alias is used):
% \qquad |[<type>][\arabic{<ctr>}][<parent ctrs>]{\p@<ctr>\the<ctr>}|
% Also see \cref{sec:footnotesregular} for use with footnotes.
% \item [\cs{label}:] Writes to the |.aux| file:
% \qquad |\newlabel{<label>@cref}{{\cref@currentlabel}{\thepage}}|
% \item [\cs{newlabel}:] (Unchanged.) When the |.aux| file is read, sets \cs{r@<label>@cref}.
% \item [\cs{r@<label>@cref}:] Set to: |{{\cref@currentlabel}{\thepage}}|
% \item [Utility functions:] See \cs{cref@getlabel}, \cs{cref@gettype},
% \cs{cref@getcounter}, \cs{cref@getprefix}.
% \item [Cross-referencing names:] \cs{crefname} and \cs{Crefname} assign
% human-readable names for references to this counter type.
% \end{description}
% \item [Additionally patched by \pkg{lwarp}:] \hfill (\acro{HTML} only)
% \begin{description}
% \item [\cs{cref}, etc.:] Modified for \pkg{lwarp}.
% See \cref{sec:cleveref}.
% \item [\cs{label}:] Adds \acro{HTML} tags (\cref{sec:labels}),
% plus \cs{splabel} data (\cref{sec:zrefsetup}):
% \begin{description}
% \item [zLWR@name:] The section name for this label.
% \item [zLWR@htmlfilenumer:] The filenumber or name for this label.
% \item [zLWR@lateximagedepth:] The |lateximagedepth| for this label.
% \item [zLWR@lateximagenumber:] The |lateximagenumber| for this label.
% \end{description}
% \item [\cs{label} inside math:] See \cref{sec:amsmathsupport}.
% \end{description}
% \item [Footnotes:] See \cs{noteentry} in \cref{sec:footnotesregular}.
% \end{description}
% \hrule
% \end{table}
%
%
% ^^A % See:
% ^^A %
% ^^A % \href{http://tex.stackexchange.com/questions/85956/redefining-label-and-ref-when-using-hyperref}
% ^^A % {\texttt{http://tex.stackexchange.com/questions/85956/redefining-label-and-ref-when-\\using-hyperref}}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \subsection{Setup}
%
%
% \begin{macro}{\@currentlabelname}
% To remember the most recently defined section name,
% description, or caption, for \cs{nameref}.
%
% \begin{macrocode}
\newcommand*{\@currentlabelname}{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LWR@stripperiod} \marg{text} \oarg{.}
%
% Removes a trailing period.
% \begin{macrocode}
\def\LWR@stripperiod#1.\ltx@empty#2\@nil{#1}%
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\LWR@setlatestname} \marg{object name}
%
% Removes \cs{label}, strips any final period, and remembers the result.
% \begin{macrocode}
\newcommand*{\LWR@setlatestname}[1]{%
% \end{macrocode}
% Remove \cs{label} and other commands from the name, the strip any final period.
% See \pkg{zref-titleref} and \pkg{gettitlestring}.
% \begin{macrocode}
\GetTitleStringExpand{#1}%
\edef\@currentlabelname{\detokenize\expandafter{\GetTitleStringResult}}%
\edef\@currentlabelname{%
\expandafter\LWR@stripperiod\@currentlabelname%
\ltx@empty.\ltx@empty\@nil%
}%
}
% \end{macrocode}
% \end{macro}
% \subsection{Zref setup}
% \label{sec:zrefsetup}
% See: \\
% \href{http://tex.stackexchange.com/questions/57194/extract-section-number-from-equation-reference}
% {\ttfamily http://tex.stackexchange.com/questions/57194/ \\
% \hspace*{2em}extract-section-number-from-equation-reference}
%
% Create a new property list called special:
% \begin{macrocode}
\zref@newlist{special}
% \end{macrocode}
% Define a new property which has the name of the most recently declared section:
% \begin{macrocode}
\zref@newprop{zLWR@name}{\@currentlabelname}
% \end{macrocode}
% Define a new property which has either a filename or a file number:
% \begin{macrocode}
\zref@newprop{zLWR@htmlfilenumber}{%
\ifbool{FileSectionNames}{\LWR@thisfilename}{\theLWR@htmlfilenumber}%
}%
% \end{macrocode}
% Additional properties for lateximages:
% \begin{macrocode}
\zref@newprop{zLWR@lateximagedepth}{\arabic{LWR@lateximagedepth}}
\zref@newprop{zLWR@lateximagenumber}{\arabic{LWR@lateximagenumber}}
% \end{macrocode}
%
% |zLWR@htmlfilenumber| property holds the file number or name
%
% Add a |LWR@htmlfilenumber| property, and lateximage properties to special:
% \begin{macrocode}
\zref@addprop{special}{zLWR@name}
\zref@addprop{special}{zLWR@htmlfilenumber}
\zref@addprop{special}{zLWR@lateximagedepth}
\zref@addprop{special}{zLWR@lateximagenumber}
% \end{macrocode}
% Returns the selected field:
% \begin{macrocode}
\newcommand*{\LWR@spref}[2]{%
\zref@extractdefault{#1}{#2}{??}}
% \end{macrocode}
% \begin{macro}{\LWR@nameref} \marg{label}
% Returns the section name for this label:
% \begin{macrocode}
\newcommand*{\LWR@nameref}[1]{%
\LWR@spref{#1}{zLWR@name}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@htmlfileref} \marg{label}
% Returns the file number for this label:
% \begin{macrocode}
\newcommand*{\LWR@htmlfileref}[1]{%
\LWR@traceinfo{LWR@htmlfileref A: !#1!}%
\LWR@spref{#1}{zLWR@htmlfilenumber}%
\LWR@traceinfo{LWR@htmlfileref B}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@lateximagedepthref} \marg{label}
% Returns the |lateximagedepth| for this label:
% \begin{macrocode}
\newcommand*{\LWR@lateximagedepthref}[1]{%
\LWR@spref{#1}{zLWR@lateximagedepth}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@lateximagenumberref} \marg{label}
% Returns the |lateximagenumber| for this label:
% \begin{macrocode}
\newcommand*{\LWR@lateximagenumberref}[1]{%
\LWR@spref{#1}{zLWR@lateximagenumber}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@splabel} \marg{label}
% Sanitize the name and then creates the label:
% \begin{macrocode}
\newcommand*{\LWR@splabel}[1]{%
\LWR@setlatestname{\@currentlabelname}%
\zref@labelbylist{#1}{special}}
% \end{macrocode}
% \end{macro}
% \subsection{Labels}
% \label{sec:labels}
% \begin{macro}{\LWR@subsublabel} \marg{label} \quad
% Creates an \acro{HTML} id tag.
% \begin{macrocode}
\newcommand*{\LWR@subsublabel}[1]{%
% \end{macrocode}
% Create an \acro{HTML} id tag unless are inside a lateximage,
% since it would appear in the image:
% \begin{macrocode}
\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}%
{}%
{% not lateximage
% \end{macrocode}
% If not doing a lateximage, create an \acro{HTML} ID tag:
% (To be factored\dots)
% \begin{macrocode}
\ifbool{LWR@doingstartpars}%
{% pars allowed
\ifbool{LWR@doingapar}
{% par started
\LWR@htmltag{a id="#1"{}}\LWR@htmltag{/a}%
}% par started
{% par not started
\LWR@stoppars%
\LWR@htmltag{a id="#1"{}}\LWR@htmltag{/a}%
\LWR@startpars%
}% par not started
}% pars allowed
{% pars not allowed
\LWR@htmltag{a id="#1"{}}\LWR@htmltag{/a}%
}% pars not allowed
}% not lateximage
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@sublabel} \marg{label}
%
% \cs{label} during \acro{HTML} output.
% Creates a traditional \LaTeX\ label,
% adds a special label with additional information,
% and creates an \acro{HTML} id tag.
%
% Used by \cs{LWR@htmllabel} and \cs{LWR@htmlmathlabel}.
% \begin{macrocode}
\newcommand*{\LWR@sublabel}[1]{%
% \end{macrocode}
% Create a traditional LaTeX label, as modified by \pkg{cleveref}:
% \begin{macrocode}
\LWR@traceinfo{LWR@sublabel: !#1!}%
\LWR@origlabel{#1}%
% \end{macrocode}
% Create a special label which holds the section number,
% |LWR@htmlfilenumber|, |LWR@lateximagedepth|, and |LWR@lateximagenumber|:
% \begin{macrocode}
\LWR@traceinfo{about to splabel}%
\LWR@traceinfo{filesectionnames is \ifbool{FileSectionNames}{true}{false}}%
\LWR@traceinfo{LWR@thisfilename is !\LWR@thisfilename!}%
\LWR@traceinfo{LWR@htmlfilenumber is \theLWR@htmlfilenumber}%
\LWR@splabel{#1}%
\LWR@subsublabel{#1}%
\LWR@traceinfo{finished with LWR@sublabel}%
}
% \end{macrocode}
% \end{macro}
%
%
%
%
% \begin{macro}{\LWR@newlabel} \marg{label}
%
% \cs{label} during \acro{HTML} output when not in math mode,
% removing extra spaces around the label, as done by regular \LaTeX\ \cs{label}.
% \begin{macrocode}
\newcommand*{\LWR@newlabel}[1]{%
\LWR@traceinfo{lwr@newlabel: !#1!}%
% \@bsphack%
\LWR@sublabel{#1}%
% \@esphack%
\LWR@traceinfo{lwr@newlabel: done}%
}
% \end{macrocode}
% \end{macro}
%
% \subsection{References}
% \label{sec:references}
% \begin{macro}{\LWR@startref} \marg{label} \quad
% (Common code for |\ref| and |\nameref|.)
%
% Open an \acro{HTML} tag reference to a filename, \# character, and a label.
%
% \begin{macrocode}
\newcommand*{\LWR@startref}[1]
{%
\edef\LWR@lidref{\LWR@lateximagedepthref{#1}}
\LWR@traceinfo{***LWR@startref A: !#1!}%
% \end{macrocode}
% Create the tag:
% \begin{macrocode}
\LWR@htmltag{a href="%
\LWR@traceinfo{***LWR@startref B}%
\LWR@htmlrefsectionfilename{#1}%
\LWR@traceinfo{***LWR@startref C}%
\#%
% \end{macrocode}
% See if |LWR@lateximagedepth| is unknown:
% \begin{macrocode}
\LWR@traceinfo{***LWR@startref D: !#1!}%
\ifthenelse{\equal{\LWR@lidref}{??}}%
% \end{macrocode}
% ``|??|'' if |LWR@lateximagedepth| is unknown:
% \begin{macrocode}
{??}%
% \end{macrocode}
% If |LWR@lateximagedepth| is known:
% \begin{macrocode}
{%
\LWR@traceinfo{***LWR@startref D1}%
\LWR@traceinfo{***depthref is \LWR@lidref}%
\ifthenelse{\cnttest{\LWR@lidref}{>}{0}}%
{%
\LWR@traceinfo{***LWR@startref D2}%
lateximage\LWR@lateximagenumberref{#1}%
}%
{%
\LWR@traceinfo{***LWR@startref D3}%
#1%
}%
}%
\LWR@traceinfo{***LWR@startref E}%
% \end{macrocode}
% closing quote:
% \begin{macrocode}
"{}}%
\LWR@traceinfo{***LWR@startref F}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ref} * \marg{label} \quad
% Create an internal document reference link,
% or without a link if starred per \pkg{hyperref}.
% \begin{macrocode}
\NewDocumentCommand{\LWR@newref}{s m}{%
\LWR@traceinfo{LWR@newref #2}%
\IfBooleanTF{#1}%
{\LWR@origref{#2}}%
{%
\LWR@startref{#2}%
\LWR@origref{#2}%
\LWR@htmltag{/a}%
}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\pagerefPageFor} Text for starred page references.
%
% \begin{macrocode}
\newcommand*{\pagerefPageFor}{page for}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\pageref} * \marg{label} \quad
% Create an internal document reference,
% or just the unlinked number if starred, per \pkg{hyperref}.
%
% \changes{v0.20}{2017/01/03}{Added.}
%
% \begin{macrocode}
\NewDocumentCommand{\LWR@newpageref}{s m}{%
\IfBooleanTF{#1}%
{(\pagerefPageFor\ \LWR@origref{#2})}%
{(\cpageref{#2})}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\nameref} \marg{label}
% \begin{macrocode}
\newcommand*{\nameref}[1]{%
\LWR@traceinfo{nameref A}%
\LWR@startref{#1}%
\LWR@traceinfo{nameref B}%
\LWR@nameref{#1}%
\LWR@traceinfo{nameref C}%
\LWR@htmltag{/a}%
\LWR@traceinfo{nameref D}%
}
% \end{macrocode}
% \end{macro}
% \subsection{Hyper-references}
%
% Note that the code currently only sanitizes the underscore character.
% \watchout
% Additional characters should be rendered inert as well.
% See the |hyperref.sty| definition of \cs{gdef}\cs{hyper@normalise} for an example.
%
% \DescribePackage{hyperref}
% Do not tell other packages that \pkg{hyperref} is emulated.
% \watchout
% Some packages patch various commands if \pkg{hyperref} is present,
% which will probably break something, and the emulation already handles
% whatever may be emulated anyhow.
%
% Any reference to |\usepackage{hyperref}| must be placed inside a \env{warpprint} environment.
% \watchout
% \begin{macrocode}
% DO NOT TELL OTHER PACKAGES TO ASSUME HYPERREF:
% \EmulatesPackage{hyperref}[2015/08/01]% Disabled. Do not do this.
% \end{macrocode}
% Create a link with a text name:
% \begin{macro}{\LWR@subhyperref} \marg{URL} \marg{text}
% \changes{v0.18}{2016/04/14}{Improved HTML output linebreaks.}
% \begin{macrocode}
\NewDocumentCommand{\LWR@subhyperref}{m +m}{%
\LWR@htmltag{a href="{#1}" target="\_{}blank"\LWR@orignewline}#2\LWR@htmltag{/a}%
\LWR@ensuredoingapar%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@subhyperrefclass} \marg{URL} \marg{text} \marg{htmlclass}
% \changes{v0.18}{2016/04/14}{Improved HTML output linebreaks.}
% \begin{macrocode}
\NewDocumentCommand{\LWR@subhyperrefclass}{m +m m}{%
\LWR@htmltag{a href="{#1}"
class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}%
\LWR@ensuredoingapar%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\href} \oarg{options} \marg{URL} \marg{text}
%
% Create a link with accompanying text:
% \begin{macrocode}
\NewDocumentCommand{\LWR@hrefb}{O{} m +m}{%
\LWR@subhyperref{#2}{#3}%
\endgroup%
\LWR@ensuredoingapar%
}
\newcommand{\href}{%
\LWR@ensuredoingapar%
\begingroup%
\catcode`\_=12
\LWR@hrefb%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\nolinkurl} \marg{URL}
%
% Print the name of the link without creating the link:
% \begin{macrocode}
\newcommand*{\LWR@nolinkurlb}[1]{#1\endgroup\LWR@ensuredoingapar}
\newcommand{\nolinkurl}{%
\LWR@ensuredoingapar%
\begingroup\catcode`\_=12
\LWR@nolinkurlb%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\url} \marg{URL}
%
% Create a link whose text name is the address of the link:
% \begin{macrocode}
\newcommand*{\LWR@urlb}[1]{%
\href{#1}{#1}%
\endgroup%
\LWR@ensuredoingapar%
}
\newcommand{\url}{%
\LWR@ensuredoingapar%
\begingroup\catcode`\_=12
\LWR@urlb%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@subinlineimage} \oarg{alttag} \marg{class}
% \marg{filename} \marg{extension} \marg{style}
%
% \changes{v0.18}{2016/05/18}{Surpress extra space.}
%
% \begin{macrocode}
\newcommand*{\LWR@subinlineimage}[5][]{%
\ifthenelse{\equal{#1}{}}%
{\LWR@htmltag{img src="#3.#4" alt="#3" style="#5" class="#2"{}}}%
{\LWR@htmltag{img src="#3.#4" alt="#1" style="#5" class="#2"{}}}%
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \clearpage
% \section{Floats}
% \label{sec:floats}
% Floats are supported, although partially through emulation.
%
% \Cref{tab:floatdata} shows the data structure associated with each |<type>|
% of float.
% \changes{v0.14}{2016/03/28}{Docs: Table: Float data structures.}
% \begin{table}
% \caption{Float data structures\label{tab:floatdata}}
%
% \bigskip
% For each |<type>| of float (figure, table, etc.) there exists the following:
%
% \hrule
% \begin{description}
% \item [counter <type>:] A counter called |<type>|, such as |figure|, |table|.
% \item [\cs{<type>name}:] Name. \cs{figurename} prints ``Figure'', etc.%
% \item [\cs{ext@<type>}:] File extension. \cs{ext@figure} prints ``lof'', etc.
% \item [\cs{fps@<type>}:] Placement.
% \item [\cs{the<type>}:] Number. \cs{thetable} prints the number of the table, etc.
% \item [\cs{p@<type>}:] Parent's number.
% Prints the number of the [within] figure, etc.
% \item [\cs{fnum@<type>}:] Prints the figure number for the caption. \\
% \cs{<type>name}~\cs{the<type>}, ``Figure 123''.
% \item [\cs{<type>}:] Starts the float environment. |\figure| or \cs{begin}|{figure}|
% \item [\cs{end<type>}:] Ends the float environment. |\endfigure| or \cs{end}|{figure}|
% \item [\cs{tf@<ext>}:] The \LaTeX{} file identifier for the output file.
% \item [\texttt{LWR@have<type>}:] A boolean rememebering whether a \cs{listof} was
% requested for a float of this type.
% \item [File with extension lo<f,t,a-z>:] An output file containing
% the commands to build the
% \cs{listof}{<type>}{<name>} ``table-of-contents'' structure.
% \item [Cross-referencing names:] For \pkg{cleveref}'s \cs{cref} and related,
% \cs{crefname} and \cs{Crefname} assign human-readable names for references to this float type.
% \end{description}
% \hrule
% \end{table}
%
% \cs{@makecaption} is redefined to print the float number and caption text,
% separated by \cs{CaptionSeparator}, which works with the \pkg{babel} package to
% adjust the caption separator according to the language. French, for example,
% uses an en-dash instead of a colon: ``Figure 123 -- Caption text''.
% \subsection{Float captions}
% \label{sec:floatcaptions}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@floatbegin} \marg{type} \oarg{placement}
%
% Begins a \cs{newfloat} environment.
% \begin{macrocode}
\NewDocumentCommand{\LWR@floatbegin}{m o}{%
\LWR@stoppars
% \end{macrocode}
% There is a new float, so increment the unique float counter:
% \begin{macrocode}
\addtocounter{LWR@thisfloat}{1}%
\booltrue{LWR@freezethisfloat}%
% \end{macrocode}
%
% \begin{macrocode}
\begingroup
% \end{macrocode}
% Settings while inside the environment:
% \begin{macrocode}
\LWR@origraggedright
% \end{macrocode}
% Open an \acro{HTML} |figure| tag:
% \begin{macrocode}
\LWR@htmltag{figure id="autofloat-\arabic{LWR@thisfloat}" class="#1"}
% \end{macrocode}
% \begin{macrocode}
\renewcommand*{\@captype}{#1}
\caption@settype{#1}
\LWR@startpars
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@float}
% \begin{macro}{\@dlbfloat} Support packages which create floats directly.
% \begin{macrocode}
\let\@float\LWR@floatbegin
\let\@dblfloat\LWR@floatbegin
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\LWR@floatend}
%
% Ends a \cs{newfloat} environment.
% \begin{macrocode}
\newcommand*{\LWR@floatend}{%
\LWR@stoppars%
\LWR@htmlelementend{figure}%
\endgroup%
\boolfalse{LWR@freezethisfloat}%
\LWR@startpars%
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\end@float}
% \begin{macro}{\end@dlbfloat} Support packages which create floats directly.
% \begin{macrocode}
\let\end@float\LWR@floatend
\let\end@dblfloat\LWR@floatend
% \end{macrocode}
% \end{macro}
% \end{macro}
% \DescribeCounter{LWR@thisfloat}
% A sequential counter for all floats.
% This is used to identify the float then reference it from the List of Figures and
% List of Tables.
% \begin{macrocode}
\newcounter{LWR@thisfloat}
% \end{macrocode}
% \DescribeBoolean{LWR@freezethisfloat}
% Prevents multiple increments of \cs{LWR@thisfloat} inside a float.
% \begin{macrocode}
\newbool{LWR@freezethisfloat}
\boolfalse{LWR@freezethisfloat}
% \end{macrocode}
% \begin{macro}{\LWR@maybeincthisfloat}
% \begin{macrocode}
\newcommand*{\LWR@maybeincthisfloat}{%
\ifbool{LWR@freezethisfloat}{}{\addtocounter{LWR@thisfloat}{1}}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@captype}
% Remembers which float type is in use.
% \begin{macrocode}
\newcommand*{\@captype}{}
% \end{macrocode}
% \end{macro}
% \subsubsection{Caption inside a float environment}
% \begin{macro}{\CaptionSeparator} How to separate the float number and the caption text.
% \changes{v0.13}{2016/03/23}{Fix for newer babel package.}
% \begin{macrocode}
\AtBeginDocument{\providecommand*{\CaptionSeparator}{:~}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@makecaption} \marg{name and num} \marg{text}
%
% Prints the float type and number, the caption separator, and the caption text.
% \begin{macrocode}
\AtBeginDocument{\renewcommand{\@makecaption}[2]{#1\CaptionSeparator#2}}
% \end{macrocode}
% \end{macro}
% \subsubsection{Caption and LOF linking and tracking}
% When a new \acro{HTML} file is marked in the \LaTeX\ \acro{PDF} file,
% the \LaTeX\ page number at that point is stored in |LWR@latestautopage|,
% (and the associated filename is remembered by the special \LaTeX\ labels).
% This page number is used to generate an |autofloat| \acro{HTML} \acro{ID}
% in the \acro{HTML} output at the start of the new \acro{HTML} file.
% Meanwhile, there is a float counter used to generate an \acro{HTML} |autofloat|
% \acro{ID}s at the start of the float itself in the \acro{HTML} file.
% The |autopage| and |autofloat| values to use for each float are written to the
% |.lof|, etc. files just before each float's entry. These values are used
% by \cs{l@figure}, etc. to create the \acro{HTML} links in the List of Figures, etc.
%
% \DescribeCounter{LWR@nextautofloat} Tracks autofloat for floats.
% \DescribeCounter{LWR@nextautopage} Tracks autopage for floats.
%
% These are updated per float as the |.lof| file is read.
% \begin{macrocode}
\newcounter{LWR@nextautofloat}
\newcounter{LWR@nextautopage}
% \end{macrocode}
%
%
% \begin{macro}{\LWRsetnextfloat} \marg{autopage} \marg{autofloat}
%
% This is written to the |.lof| file just before each float's usual entry.
% The autopage and autofloat are remembered for \cs{l@figure} to use when
% creating the \acro{HTML} links.
%
% \begin{macrocode}
\newcommand*{\LWRsetnextfloat}[2]{%
\setcounter{LWR@nextautopage}{#1}%
\setcounter{LWR@nextautofloat}{#2}%
}
% \end{macrocode}
% \end{macro}
% \DescribeCounter{LWR@latestautopage}
% Updated each time a new \acro{HTML} file is begun.
% \cs{LWRsetnextfloat} is written with this and the autofloat
% by the modified \cs{addcontentsline} just before each float's entry.
% \begin{macrocode}
\newcounter{LWR@latestautopage}% updated each new HTML file
\setcounter{LWR@latestautopage}{1}
% \end{macrocode}
% \begin{macrocode}
\let\LWR@origcaption@begin\caption@begin
\let\LWR@origcaption@end\caption@end
\let\LWR@orig@@par\@@par
% \end{macrocode}
% \begin{macro}{\LWR@caption@begin}
% Low-level patches to create \acro{HTML} tags for captions.
% \begin{macrocode}
\newcommand{\LWR@caption@begin}
{
\LWR@traceinfo{LWR@caption@begin}%
% \end{macrocode}
% Keep par and minipage changes local:
% \begin{macrocode}
\begingroup%
% \end{macrocode}
% The \pkg{caption} code was not allowing the closing |par| tag:
% \begin{macrocode}
\renewcommand{\@@par}{\LWR@closeparagraph\LWR@orig@@par}%
% \end{macrocode}
% No need for a minipage inside the caption:
% \begin{macrocode}
\RenewDocumentEnvironment{minipage}{O{t} o O{t} m}{}{}%
% \end{macrocode}
% Enclose the original caption code inside an \acro{HTML} tag:
% \begin{macrocode}
\LWR@htmlblocktag{figcaption}%
\LWR@origcaption@begin%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@caption@end}
% Low-level patches to create \acro{HTML} tags for captions.
% \begin{macrocode}
\newcommand{\LWR@caption@end}
{%
\LWR@origcaption@end%
% \end{macrocode}
% Subcaptions were being over-written by the closing \acro{HTML} tag:
% \begin{macrocode}
\vspace*{\baselineskip}%
% \end{macrocode}
% Closing tag:
% \begin{macrocode}
\LWR@htmlblocktag{/figcaption}%
\endgroup%
% \leavevmode% avoid bad space factor (0) error
\LWR@traceinfo{LWR@caption@end: done}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\caption@begin}
% \begin{macro}{\caption@end}
% Low-level patches to create \acro{HTML} tags for captions.
% \begin{macrocode}
\let\caption@begin\LWR@caption@begin
\let\caption@end\LWR@caption@end
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\captionlistentry}
% Tracks the float number for this caption used outside a float.
% Patched to create an \acro{HTML} anchor.
% \begin{macrocode}
\let\LWR@origcaptionlistentry\captionlistentry
\renewcommand*{\captionlistentry}{%
\LWR@maybeincthisfloat%
\LWR@ensuredoingapar%
\LWR@htmltag{a id="autofloat-\arabic{LWR@thisfloat}"{}}\LWR@htmltag{/a}%
\LWR@origcaptionlistentry%
}
\def\LWR@LTcaptionlistentry{%
\LWR@ensuredoingapar%
\LWR@htmltag{a id="autofloat-\arabic{LWR@thisfloat}"{}}\LWR@htmltag{/a}%
\bgroup
\@ifstar{\egroup\LWR@LT@captionlistentry}% gobble *
{\egroup\LWR@LT@captionlistentry}}%
\def\LWR@LT@captionlistentry#1{%
\caption@listentry\@firstoftwo[\LTcaptype]{#1}}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\addcontentsline}
% Patched to write the autopage and autofloat before each float's entry.
% No changes if writing |.toc|.
% \begin{macrocode}
\let\LWR@origaddcontentsline\addcontentsline
\renewcommand*{\addcontentsline}[3]{%
\ifthenelse{\equal{#1}{toc}}{}{%
\addtocontents{\@nameuse{ext@#2}}{%
\protect\LWRsetnextfloat%
{\arabic{LWR@latestautopage}}%
{\arabic{LWR@thisfloat}}%
}%
}%
\LWR@origaddcontentsline{#1}{#2}{#3}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\captionof}
% Patched to track the float number since this is used outside a float,
% and also create an \acro{HTML} anchor for the virtual float.
% \begin{macrocode}
\AtBeginDocument{
\let\LWR@origcaptionof\captionof
\renewcommand*{\captionof}{%
\LWR@maybeincthisfloat%
\LWR@stoppars
\LWR@htmltag{a id="autofloat-\arabic{LWR@thisfloat}"{}}\LWR@htmltag{/a}%
\LWR@origcaptionof%
}
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Table of Contents, LOF, LOT}
%
% This section controls the generation of the TOC, LOF, LOT.
%
% The |.toc|, |.lof|, and |.lot| files are named by the source code \cs{jobname}.
%
% In \acro{HTML}, the printed tables are placed inside a div of class |.toc|, |.lof|, or |.lot|.
%
% A ``sidetoc'' is provided which prints a subset of the TOC on the side of each page other
% than the homepage.
%
% The regular \LaTeX{} infrastructure is used for TOC,
% along with some patches to generate \acro{HTML} output.
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \subsection{Reading and printing the TOC}
% \begin{macro}{\LWR@myshorttoc} \marg{toc/lof/lot}
% \changes{v0.18}{2016/05/19}{Reorganize \cs{HomeHTMLFilename} logic.}
%
% Reads in and prints the \acro{TOC}/\acro{LOF}/\acro{LOT} at the current position.
% While doing so, makes the |@| character into a normal letter to allow
% formatting commands in the section names.
% Unlike in regular \LaTeX{}, the file is not reset after being read, since
% the \acro{TOC} may be referred to again in each \acro{HTML} page, and is
% used for the side\acro{TOC}.
% \begin{macrocode}
\newcommand*{\LWR@myshorttoc}[1]{
\LWR@ensuredoingapar
% \end{macrocode}
% Only if the file exists:
% \begin{macrocode}
\IfFileExists{\jobname.#1}{
% \end{macrocode}
% Make |@| a regular letter.
% Many of the commands in the file will have |@| characters in them, so |@|
% \watchout
% must be made a regular letter.
%
% For |pdflatex|, also change to |latin1| encoding.
% When reading back a file with accented characters,
% \watchout[disabled]
% the encoding change seems to be required, rather than leaving it |utf8|.
% \begin{macrocode}
\begingroup
% \ifxetexorluatex%
% \else
% \inputencoding{latin1}% currently disabled
% \fi
\makeatletter
% \end{macrocode}
% Read in the \acro{TOC} file:
% \begin{macrocode}
\@input{\jobname.#1}
% \makeatother
\endgroup
}%
{}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@subtableofcontents} \marg{toc/lof/lot} \marg{sectionstarname}
%
% Places a TOC/LOF/LOT at the current position.
% \begin{macrocode}
\NewDocumentCommand{\LWR@subtableofcontents}{m m}{%
% \end{macrocode}
% Closes previous levels:
% \begin{macrocode}
\@ifundefined{chapter}
{\LWR@closeprevious{\LWR@depthsection}}
{\LWR@closeprevious{\LWR@depthchapter}}
% \end{macrocode}
% Prints any pending footnotes so that they appear above the potentially
% large TOC:
% \begin{macrocode}
\LWR@printpendingnotes
% \end{macrocode}
% Place the list into its own chapter (if defined) or section:
% \begin{macrocode}
\@ifundefined{chapter}{\section*{#2}}{\chapter*{#2}}
% \end{macrocode}
% Create a new \acro{HTML} |nav| containing the TOC/LOF/LOT:
% \begin{macrocode}
\LWR@htmlelementclass{nav}{#1}
% \end{macrocode}
% Create the actual list:
% \begin{macrocode}
\LWR@myshorttoc{#1}
% \end{macrocode}
% Close the |nav|:
% \begin{macrocode}
\LWR@htmlelementclassend{nav}{#1}
}
% \end{macrocode}
% \end{macro}
%
% Patch \cs{@starttoc} to encapsulate the \acro{TOC} inside \acro{HTML} tags:
% \begin{macrocode}
\let\LWR@orig@starttoc\@starttoc
\renewcommand{\@starttoc}[1]{
\LWR@htmlelementclass{nav}{#1}
\LWR@orig@starttoc{#1}
\LWR@htmlelementclassend{nav}{#1}
}
% \end{macrocode}
%
% Patch \cs{tableofcontents}, etc. to print footnotes first.
% \pkg{newfloat} uses \cs{listoffigures} for all future float types.
% \begin{macrocode}
\let\LWR@origtableofcontents\tableofcontents
\let\LWR@origlistoffigures\listoffigures
\let\LWR@origlistoftables\listoftables
\renewcommand*{\tableofcontents}{%
% \end{macrocode}
% Copy the |.toc| file to |.sidetoc| for printing the sidetoc.
% The original |.toc| file is renewed when \cs{tableofcontents} is finished.
% \begin{macrocode}
\LWR@copyfile{\jobname.toc}{\jobname.sidetoc}%
\LWR@printpendingnotes%
\LWR@origtableofcontents%
}
\renewcommand*{\listoffigures}{\LWR@printpendingnotes\LWR@origlistoffigures}
\renewcommand*{\listoftables}{\LWR@printpendingnotes\LWR@origlistoftables}
% \end{macrocode}
% \subsection{High-level TOC commands}
% \label{sec:listof}
% \begin{macro}{\listof} \marg{type} \marg{title}
%
% Emulate the \cs{listof} command from the \pkg{float} package (\cref{sec:newfloat}).
% Used to create lists of custom float types. Also used to redefine
% the standard \LaTeX{} \cs{listoffigures} and \cs{listoftables} commands.
% \begin{macrocode}
\NewDocumentCommand{\listof}{m +m}{%
\LWR@subtableofcontents{\@nameuse{ext@#1}}{#2}
\expandafter\newwrite\csname tf@\csname ext@#1\endcsname\endcsname
\immediate\openout \csname tf@\csname ext@#1\endcsname\endcsname
\jobname.\csuse{ext@#1}\relax
}
% \end{macrocode}
% \end{macro}
% \subsection{Side TOC}
% \label{sec:sidetoc}
% The ``side TOC'' is a table-of-contents positioned to the side.
%
% It may be renamed by redefining \cs{sidetocname}, and may contain paragraphs.
%
% \acro{CSS} may be used to format the sideTOC:
%
% \begin{docsidebar}[CSS related to sideTOC:]
% \begin{description}[parsep=0ex]
% \item [|nav.sidetoc|:] The entire sideTOC.
% \item [|div.sidetoctitle|:] The title.
% \item [|div.sidetoccontents|:] The table of contents.
% \end{description}
% \end{docsidebar}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% \DescribeCounter{SideTOCDepth}
% Controls how deep the side-TOC gets. Use a standard \LaTeX{} section level
% similar to |tocdepth|.
% \begin{macrocode}
\newcounter{SideTOCDepth}
\setcounter{SideTOCDepth}{1}
% \end{macrocode}
% \begin{macro}{\sidetocname}
% Holds the default name for the sidetoc.
%
% \begin{macrocode}
\newcommand{\sidetocname}{Contents}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@sidetoc}
% Creates the actual side-TOC.
% \begin{macrocode}
\newcommand*{\LWR@sidetoc}{
\LWR@stoppars
% \end{macrocode}
% The entire sideTOC is placed into a |nav| of class |sidetoc|.
% \begin{macrocode}
\LWR@htmlelementclass{nav}{sidetoc}
\setcounter{tocdepth}{\value{SideTOCDepth}}
% \end{macrocode}
% The title is placed into a div of class |sidetoctitle|, and may
% contain paragraphs.
% \begin{macrocode}
\begin{BlockClass}{sidetoctitle}
\sidetocname
\end{BlockClass}
% \end{macrocode}
% The table of contents is placed into a div of class |sidetoccontents|.
% \begin{macrocode}
\begin{BlockClass}{sidetoccontents}
\LinkHome
\LWR@myshorttoc{sidetoc}
\end{BlockClass}
\LWR@htmlelementclassend{nav}{sidetoc}
}
% \end{macrocode}
% \end{macro}
% \subsection{Low-level TOC line formatting}
% \begin{macro}{\numberline} \marg{number}
%
% (Called from each line in the |.aux|, |.lof| files.)
%
% Record this section number for further use:
% \begin{macrocode}
\renewcommand*{\numberline}[1]{%
\LWR@sectionnumber{#1}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\hypertoc} \marg{1: depth} \marg{2: class} \marg{3: name} \marg{4: page}
%
% Called by \cs{l@section}, etc. to create a hyperlink to a section.
%
% The autopage label is always created just after the section.
%
% \begin{description}
% \item[\#1] is depth
% \item[\#2] \acro{HTML} \acro{CSS} class is tocsection, tocsubsection, etc.
% \item[\#3] the text of the caption
% \item[\#4] page number
% \end{description}
% \begin{macrocode}
\NewDocumentCommand{\hypertoc}{m m +m m}{%
% \end{macrocode}
% Respond to tocdepth:
% \begin{macrocode}
\ifthenelse{\cnttest{#1}{<=}{\value{tocdepth}}}{%
\LWR@startpars%
% \end{macrocode}
% Create an \acro{HTML} link to filename\#autosec-(page), with text of the caption,
% of the given \acro{HTML} class.
% \begin{macrocode}
\LWR@subhyperrefclass{%
\LWR@htmlrefsectionfilename{autopage-#4}\#autosec-#4}{#3}{#2}%
\LWR@stoppars%
}
{}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\hypertocfloat} \marg{1: depth} \marg{2: class}
% \marg{3: caption} \marg{4: page}
%
% \begin{description}
% \item[\#1] is depth
% \item[\#2] \acro{HTML} \acro{CSS} class is tocfigure, toctable
% \item[\#3] the text of the caption
% \item[\#4] page number
% \end{description}
% \begin{macrocode}
\newcommand{\hypertocfloat}[4]{%
\LWR@startpars
% \end{macrocode}
% Create an \acro{HTML} link to
% filename\#autofloat-(float number), with text of the caption,
% of the given \acro{HTML} class.
% \begin{macrocode}
\LWR@subhyperrefclass{%
\LWR@htmlrefsectionfilename{autopage-\arabic{LWR@nextautopage}}%
\#autofloat-\arabic{LWR@nextautofloat}}%
{#3}{#2}%
\LWR@stoppars%
}
% \end{macrocode}
% \end{macro}
% Automatically called by |\contentsline|:
% \begin{macrocode}
\renewcommand{\l@part}[2]{\hypertoc{-1}{tocpart}{#1}{#2}}
\DeclareDocumentCommand{\l@chapter}{m m}
{\hypertoc{0}{tocchapter}{#1}{#2}}
\renewcommand{\l@section}[2]{\hypertoc{1}{tocsection}{#1}{#2}}
\renewcommand{\l@subsection}[2]{\hypertoc{2}{tocsubsection}{#1}{#2}}
\renewcommand{\l@subsubsection}[2]
{\hypertoc{3}{tocsubsubsection}{#1}{#2}}
\renewcommand{\l@paragraph}[2]{\hypertoc{4}{tocparagraph}{#1}{#2}}
\renewcommand{\l@subparagraph}[2]{\hypertoc{5}{tocsubparagraph}{#1}{#2}}
\renewcommand{\l@figure}[2]{\hypertocfloat{1}{tocfigure}{#1}{#2}}
\renewcommand{\l@table}[2]{\hypertocfloat{1}{toctable}{#1}{#2}}
% \end{macrocode}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Index}
% See:\\
% \href{http://tex.stackexchange.com/questions/187038/how-to-mention-section-number-in-index-created-by-imakeidx}
% {\texttt{http://tex.stackexchange.com/questions/187038/\\
% \hspace*{2em}how-to-mention-section-number-in-index-created-by-imakeidx}}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@indexsection}
%
% Controls whether the index will be in a section or a chapter, depending on
% the documentclass.
% \begin{macrocode}
\@ifundefined{chapter}
{\newcommand*{\LWR@indexsection}{\section{\indexname}}}
{\newcommand*{\LWR@indexsection}{\chapter{\indexname}}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\printindex}
% \begin{macrocode}
\let\LWR@origprintindex\printindex
\renewcommand*{\printindex}
{
\LWR@indexsection
\LWR@startpars
\LWR@origprintindex
}
% \end{macrocode}
% \end{macro}
% \begin{environment}{theindex}
% \begin{macrocode}
\renewenvironment*{theindex}{%
\let\item\LWR@indexitem%
\let\subitem\LWR@indexsubitem%
\let\subsubitem\LWR@indexsubsubitem%
}{}
% \end{macrocode}
% \end{environment}
% \begin{macro}{\LWR@indexitem}
% \begin{macrocode}
\newcommand{\LWR@indexitem}{
\InlineClass{indexitem}{}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@indexitem}
% \begin{macrocode}
\newcommand{\LWR@indexsubitem}{
\InlineClass{indexsubitem}{}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@indexitem}
% \begin{macrocode}
\newcommand{\LWR@indexsubsubitem}{
\InlineClass{indexsubsubitem}{}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\hyperindexref} \marg{autosecnumber}
%
% |\hyperindexref{web address}| is inserted into |*.ind| by
% the xindy style file |lwarp_html.xdy|
%
% \changes{v0.20}{2016/12/19}{Print mode provided in case hyperref not used.}
% \begin{macrocode}
\newcommand*{\hyperindexref}[1]{
\LWR@htmltag{a href="%
% \end{macrocode}
% Create an \acro{HTML} reference to the autosection:
% \begin{macrocode}
\LWR@htmlrefsectionfilename{autopage-#1}\#autosec-#1"{}}%
% \end{macrocode}
% Add the section number and section name, then close the tag:
% \begin{macrocode}
\LWR@origref{autopage-#1}\enskip\LWR@nameref{autopage-#1}%
\LWR@htmltag{/a}%
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \codeprint
%
% A null command for print mode, in case \pkg{hyperref} was not used:
% \begin{macrocode}
\begin{warpprint}
\newcommand{\hyperindexref}[1]{#1}
\end{warpprint}
% \end{macrocode}
% \section{Math}
% \label{sec:math}
%
% \limitsmath
%
%
% \label{ex:mathjaxmacros}
% As an example of using custom \LaTeX\ macros with MathJax,
% \margintag{custom MathJax macros}
% place the following at the start of the document,
% after |\begin{document}|:
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% \begin{warpHTML} % Only for HTML output,
% \ifbool{mathjax} % and only for MathJax output:
% {
% \( % New macros for MathJax are placed inside a math expression:
% \newcommand{\expval}[1]{\langle#1\rangle}
% \newcommand{\abs}[1]{\lvert#1\rvert}
% \)
% }{}
% \end{warpHTML}
% \end{Verbatim}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \DescribeMacro{\$}
% Plain dollar signs appearing in the \acro{HTML} output may be interpreted
% by MathJax to be math shifts.
% For a plain text dollar |\$|, print it inside a span to avoid
% it being interpreted by MathJax.
% \changes{v0.19}{2016/06/08}{Avoids MathJax.}
% \begin{macrocode}
\let\LWR@origtextdollar\$
\renewcommand*{\$}{%
\LWR@htmltagc{span}%
\LWR@origtextdollar%
\LWR@htmltagc{/span}%
}
% \end{macrocode}
%
% \DescribeCounter{LWR@externalfilecnt}
% Counter for the external files which are generated and then referenced from the \acro{HTML}:
% \begin{macrocode}
\newcounter{LWR@externalfilecnt}
% \end{macrocode}
% \subsection{Inline and display math}
% \begin{macrocode}
\let\LWR@origdollar=$
\let\secondorigdollar=$% balance for editor syntax highlighting
% \end{macrocode}
% \begin{macrocode}
\let\LWR@origopenparen\(
\let\LWR@origcloseparen\)
% \end{macrocode}
% \DescribeObject{\$}
% \DescribeObject{\$\$}
% Redefine the dollar sign to place math inside a \env{lateximage}, or use MathJax:
% \begin{macrocode}
\begingroup
\catcode`\$=\active%
\protected\gdef${\@ifnextchar$\LWR@doubledollar\LWR@singledollar}%
% \end{macrocode}
% \begin{macro}{\LWR@doubledollar}
% \changes{v0.19}{2016/05/25}{MathJax support.}
% Redefine the double dollar sign to place math inside a \env{lateximage}, or use MathJax:
% \begin{macrocode}
\gdef\LWR@doubledollar$#1$${
\ifbool{mathjax}%
% \end{macrocode}
% For MathJax, print the math between |\[| and |\]|:
% \begin{macrocode}
{\textbackslash[\LWR@HTMLsanitize{#1}\textbackslash]}
% \end{macrocode}
% For SVG, print the math inside a \env{lateximage}, with an ALT tag of the \LaTeX\ code:
% \begin{macrocode}
{% not mathjax
\begin{lateximage}%
[\textbackslash{[} \LWR@HTMLsanitize{#1} \textbackslash{]}]%
\LWR@origdollar\LWR@origdollar#1\LWR@origdollar\LWR@origdollar%
\end{lateximage}
}
}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@singledollar}
% \changes{v0.19}{2016/05/25}{MathJax support.}
% Redefine the single dollar sign to place math inside a \env{lateximage}, or use MathJax:
% \begin{macrocode}
\gdef\LWR@singledollar#1${%
\ifbool{mathjax}%
% \end{macrocode}
% For MathJax, print the math between |\(| and |\)|:
% \begin{macrocode}
{\textbackslash(\LWR@HTMLsanitize{#1}\textbackslash)}
% \end{macrocode}
% For SVG, print the math inside a \env{lateximage}, with an ALT tag of the \LaTeX\ code:
% \begin{macrocode}
{% not mathjax
\begin{lateximage}%
[\textbackslash( \LWR@HTMLsanitize{#1} \textbackslash)]%
\LWR@origdollar#1\LWR@origdollar%
\end{lateximage}%
}%
}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\(}
% \begin{macro}{\)}
% Redefine to the above dollar macros.
% \begin{macrocode}
\gdef\(#1\){$#1$}
\gdef\[#1\]{$$#1$$}
\endgroup
% \end{macrocode}
% \end{macro}
% \end{macro}
% Remove the old |math| and |displaymath| environments:
% \begin{macrocode}
\let\math\relax
\let\endmath\relax
\let\displaymath\relax
\let\enddisplaymath\relax
% \end{macrocode}
% \begin{environment}{math}
% Set math mode then typeset the body of what was between the begin/end.
% See the \pkg{environ} package for \cs{BODY}.
% \begin{macrocode}
\NewEnviron{math}{\expandafter\(\BODY\)}
% \end{macrocode}
% \end{environment}
%
% \begin{environment}{displaymath}
% Set math mode then typeset the body of what was between the begin/end.
% See the \pkg{environ} package for \cs{BODY}.
% \begin{macrocode}
\NewEnviron{displaymath}{\expandafter\[\BODY\]\@ignoretrue}
% \end{macrocode}
% \end{environment}
% When the document begins, the dollar sign must be made active to trigger the new math macros:
% \begin{macrocode}
\AtBeginDocument{\catcode`\$=\active}
% \end{macrocode}
% \subsection{MathJax support}
% \changes{v0.19}{2016/05/25}{MathJax support added.}
%
% \DescribeCounter{LWR@nextequation} Used to add one to compute the next equation number.
% \begin{macrocode}
\newcounter{LWR@nextequation}
% \end{macrocode}
%
%
%
% \begin{macro}{\LWR@syncmathjax} Sets the MathJax equation format
% and number for the following equations.
%
% These MathJax commands are printed inside ``\cs{(}'' and ``\cs{)}'' characters.
% They are printed to \acro{HTML} output, not interpreted by \LaTeX.
% \begin{macrocode}
\newcommand*{\LWR@syncmathjax}{%
% \end{macrocode}
% If using chapters, place the chapter number in front of the equation.
% Otherwise, use the simple equation number.
% \begin{macrocode}
\ifcsdef{thechapter}{
\BlockClassSingle{hidden}{
\textbackslash(
\textbackslash{}seteqsection \{\thechapter\}
\textbackslash)
}
}
{}% not using chapters
% \end{macrocode}
% MathJax doesn't allow setting the equation number to 1:
% \begin{macrocode}
\ifthenelse{\cnttest{\value{equation}}>0}
{
% \end{macrocode}
% Tell MathJax that the next set of equations begins with the current \LaTeX{} equation
% number, plus one.
% \begin{macrocode}
\setcounter{LWR@nextequation}{\value{equation}}
\addtocounter{LWR@nextequation}{1}
% \end{macrocode}
% Place the MathJax command inside ``\cs{(}'' and ``\cs{)}'' characters,
% to be printed to \acro{HTML}, not interpreted by \LaTeX.
% \begin{macrocode}
\BlockClassSingle{hidden}{
\textbackslash(
\textbackslash{}seteqnumber \{\arabic{LWR@nextequation}\}
\textbackslash)
}
}{}% not eq > 1
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\LWR@restoremathlatexformatting}
% While producing math, use regular \LaTeX\ formatting instead of \acro{HTML} tags.
% \begin{macrocode}
\newcommand*{\LWR@restoremathlatexformatting}{%
\let\hspace\LWR@orighspace%
\let\rule\LWR@origrule%
\let\,\LWR@origcomma% disable HTML short unbreakable space
\let\textit\LWR@origtextit%
\let\textbf\LWR@origtextbf%
\let\texttt\LWR@origtexttt%
\let\textsc\LWR@origtextsc%
\let\textsf\LWR@origtextsf%
\let\textrm\LWR@origtextrm%
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}%
\let\textsuperscript\LWR@origtextsuperscript%
\let\textsubscript\LWR@origtextsubscript%
\let~\LWR@origtilde%
\let\enskip\LWR@origenskip%
\let\quad\LWR@origquad%
\let\qquad\LWR@origqquad%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@hidelatexequation} \marg{environment} \marg{contents}
%
% Creates the \LaTeX{} version of the equation
% inside an \acro{HTML} comment.
% \begin{macrocode}
\NewDocumentCommand{\LWR@hidelatexequation}{m +m}{%
% \end{macrocode}
% Stop \acro{HTML} paragraph handling and open an \acro{HTML} comment:
% \begin{macrocode}
\LWR@stoppars
\LWR@htmlopencomment
% \end{macrocode}
% Start the LaTeX math environment inside the \acro{HTML} comment:
% \begin{macrocode}
\begingroup
\csuse{LWR@orig#1}
% \end{macrocode}
% While in the math environment,
% restore various commands to their \LaTeX\ meanings.
% \begin{macrocode}
\LWR@restoremathlatexformatting
% \end{macrocode}
% When a label is encountered, the HTML comment is closed,
% the label is generated in an HTML-output context,
% then the HTML comment is opened again.
% See \cs{LWR@htmlmathlabel} in \cref{sec:amsmathsupport}.
%
% Print the contents of the equation:
% \begin{macrocode}
#2
% \end{macrocode}
% End the \LaTeX{} math environment inside the \acro{HTML} comment:
% \begin{macrocode}
\csuse{LWR@origend#1}
\endgroup
% \end{macrocode}
% Close the \acro{HTML} comment and resume \acro{HTML} paragraph handling:
% \begin{macrocode}
\LWR@htmlclosecomment
\LWR@startpars
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LWR@addmathjax} \marg{environment} \marg{contents}
%
% Given the name of a math environment and its contents,
% create a MathJax instance.
% The contents are printed to \acro{HTML} output, not interpreted by \LaTeX.
% \begin{macrocode}
\NewDocumentCommand{\LWR@addmathjax}{m +m}{%
% \end{macrocode}
% Enclose the MathJax environment inside printed ``\cs{(}'' and ``\cs{)}'' characters.
% \begin{macrocode}
\textbackslash{}begin\{#1\}
% \end{macrocode}
% Print the contents, sanitizing for \acro{HTML} special characters.
% \begin{macrocode}
\LWR@HTMLsanitizeexpand{\detokenize\expandafter{#2}}
% \end{macrocode}
% Close the MathJax environment:
% \begin{macrocode}
\textbackslash{}end\{#1\}
}
% \end{macrocode}
% \end{macro}
% \subsection{Equation environment}
%
% Remember existing \env{equation} environment:
% \begin{macrocode}
\let\LWR@origequation\equation
\let\LWR@origendequation\endequation
% \end{macrocode}
%
% Remove existing \env{equation} environment:
% \begin{macrocode}
\let\equation\relax
\let\endequation\relax
% \end{macrocode}
% \begin{environment}{equation}
% \changes{v0.19}{2016/05/25}{MathJax support.}
% The new \env{equation} environment is created with
% \cs{NewEnviron} (from the \pkg{environ} package),
% which stores the contents of its environment in a
% macro called \cs{BODY}.
%
% For \acro{SVG} math output,
% the contents are typeset using the original \env{equation}
% inside a \env{lateximage}, along with an ALT tag
% containing a detokenized copy of the \LaTeX\ source for
% the math.
%
% For MathJax output, the contents are typeset in an
% original \env{equation} environment placed inside a \acro{HTML}
% comment, with special processing for \cs{label}s.
% The contents are also printed to the \acro{HTML} output
% for processing by the MathJax script.
% \begin{macrocode}
\NewEnviron{equation}{%
\ifbool{mathjax}
% \end{macrocode}
% MathJax output:
% \begin{macrocode}
{
% \end{macrocode}
% Print commands to syncronize MathJax's equation number and format
% to the current \LaTeX\ chapter/section and equation number:
% \begin{macrocode}
\LWR@syncmathjax
% \end{macrocode}
% Print the \LaTeX\ math inside an \acro{HTML} comment:
% \begin{macrocode}
\LWR@hidelatexequation{equation}{\BODY}
}
% \end{macrocode}
% SVG output:
% Create the |lateximage| along with an \acro{HTML} ALT tag
% having an equation number, the \LaTeX{} equation environment
% commmands, and the contents of the environment's \cs{BODY}.
% \begin{macrocode}
{% not mathjax
% \end{macrocode}
% Begin the \env{lateximage} with an ALT tag containing the math source:
% \begin{macrocode}
\begin{lateximage}[(\theequation) \textbackslash{begin\{equation\}}%
\LWR@HTMLsanitizeexpand{\detokenize\expandafter{\BODY}}%
\textbackslash{end\{equation\}}]% alt tag
% \end{macrocode}
% Create the actual \LaTeX-formatted equation inside
% the |lateximage| using the contents of the environment.
% \begin{macrocode}
\LWR@origequation
\BODY% contents collected by NewEnviron
\LWR@origendequation
\end{lateximage}%
}
% \end{macrocode}
% After the environment, if MathJax, print the math to the \acro{HTML} output
% for MathJax processing:
% \begin{macrocode}
}[\ifbool{mathjax}{\LWR@addmathjax{equation}{\BODY}}{}]
% \end{macrocode}
% \end{environment}
% \subsection{AMS Math environments}
% \changes{v0.19}{2016/05/25}{MathJax support added.}
%
% \subsubsection{Support macros}
% \label{sec:amsmathsupport}
%
% \DescribeBoolean{LWR@amsmultline} True if processing a multline environment.
%
% To compensate for \env{multline}-spefific code,
% |LWR@amsmultline| is used to add extra horizontal space in \cs{LWR@htmlmathlabel} if
% is used in an \pkg{amsmath} environment which is
% not a \env{multline} environment and not an \env{equation}.
% \begin{macrocode}
\newbool{LWR@amsmultline}
\boolfalse{LWR@amsmultline}
% \end{macrocode}
% \begin{macro}{\LWR@htmlmathlabel} \marg{label}
% \index{label>math environment}
%
% \cs{label} when called inside a \LaTeX{} AMS math environment's math mode
% which is encased inside an \acro{HTML} comment
% while creating a \acro{HTML} document.
% \begin{macrocode}
\newcommand*{\LWR@htmlmathlabel}[1]{%
\LWR@traceinfo{LWR@htmlmathlabel #1}%
\ifbool{mathjax}{%
% \end{macrocode}
% The combined \LaTeX\ \& \acro{HTML} label is printed in a \cs{text} field:
% \begin{macrocode}
\text{
% \end{macrocode}
% Shift the label over to the right side of the environment to avoid
% over-printing the math:
% \begin{macrocode}
\ifbool{LWR@amsmultline}{}{\hspace*{\totwidth@}}
% \end{macrocode}
% Temporarily end the \acro{HTML} comment,
% insert the \LaTeX{} \& \acro{HTML} label, then
% resume the \acro{HTML} comment.
% \cs{@firstofone} is required to remove extra braces
% introduced by the \pkg{amsmath} package.)
% \begin{macrocode}
\LWR@htmlclosecomment\LWR@sublabel{\@firstofone#1}\LWR@htmlopencomment}%
}%
{\LWR@sublabel{\@firstofone#1}}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@beginhideamsmath}
% Starts hiding \LaTeX\ math inside an \acro{HTML} comment.
% \begin{macrocode}
\newcommand*{\LWR@beginhideamsmath}{
\LWR@stoppars
\LWR@htmlopencomment
\begingroup
\LWR@restoremathlatexformatting
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@endhideamsmath}
% Ends hiding \LaTeX\ math inside an \acro{HTML} comment.
% \begin{macrocode}
\newcommand*{\LWR@endhideamsmath}{
\endgroup
\LWR@htmlclosecomment
\LWR@startpars
}
% \end{macrocode}
% \end{macro}
% \subsubsection{Environment patches}
% \changes{v0.19}{2016/05/25}{MathJax support added.}
% The following \pkg{amsmath} environments already collect their contents
% in \cs{@envbody} for further processing.
%
% For \acro{SVG} math: Each envrionment is encapsulated inside a \env{lateximage} environment,
% along with a special |LWRAMSMATHBODY| argument
% telling \env{lateximage} to use as the \acro{HTML} ALT tag the environment's contents which
% were automatically captured by the \AmS{} environment.
%
% For MathJax: Each environment is syched with \LaTeX's equation numbers,
% typeset with \LaTeX\ inside an \acro{HTML} comment, then
% printed to \acro{HTML} output for MathJax to process.
%
% \begin{environment}{multline}
% \begin{macrocode}
\BeforeBeginEnvironment{multline}{
\ifbool{mathjax}
{
\LWR@syncmathjax
\booltrue{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}
\AfterEndEnvironment{multline}{
\ifbool{mathjax}
{
\LWR@endhideamsmath
\boolfalse{LWR@amsmultline}
\LWR@addmathjax{multline}{\the\@envbody}
}
{\endlateximage}
}
% \end{macrocode}
% \end{environment}
% \begin{environment}{multline*}
% \begin{macrocode}
\BeforeBeginEnvironment{multline*}{
\ifbool{mathjax}
{
\LWR@syncmathjax
\booltrue{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}
\AfterEndEnvironment{multline*}{
\ifbool{mathjax}
{
\LWR@endhideamsmath
\boolfalse{LWR@amsmultline}
\LWR@addmathjax{multline*}{\the\@envbody}
}
{\endlateximage}
}
% \end{macrocode}
% \end{environment}
% \begin{environment}{gather}
% \begin{macrocode}
\BeforeBeginEnvironment{gather}{
\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}
\AfterEndEnvironment{gather}{
\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{gather}{\the\@envbody}
}
{\endlateximage}
}
% \end{macrocode}
% \end{environment}
% \begin{environment}{gather*}
% \begin{macrocode}
\BeforeBeginEnvironment{gather*}{
\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}
\AfterEndEnvironment{gather*}{
\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{gather*}{\the\@envbody}
}
{\endlateximage}
}
% \end{macrocode}
% \end{environment}
% \begin{environment}{align}
% \begin{macrocode}
\BeforeBeginEnvironment{align}{
\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}
\AfterEndEnvironment{align}{
\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{align}{\the\@envbody}
}
{\endlateximage}
}
% \end{macrocode}
% \end{environment}
% \begin{environment}{align*}
% \begin{macrocode}
\BeforeBeginEnvironment{align*}{
\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}
\AfterEndEnvironment{align*}{
\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{align*}{\the\@envbody}
}
{\endlateximage}
}
% \end{macrocode}
% \end{environment}
% \begin{environment}{flalign}
% \begin{macrocode}
\BeforeBeginEnvironment{flalign}{
\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}
\AfterEndEnvironment{flalign}{
\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{flalign}{\the\@envbody}
}
{\endlateximage}
}
% \end{macrocode}
% \end{environment}
% \begin{environment}{flalign*}
% \begin{macrocode}
\BeforeBeginEnvironment{flalign*}{
\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}
\AfterEndEnvironment{flalign*}{
\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{flalign*}{\the\@envbody}
}
{\endlateximage}
}
% \end{macrocode}
% \end{environment}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Lateximages}
% A |\lateximage| is typeset on its own \acro{PDF} page inside an \acro{HTML} comment starting on the preceeding page
% and ending on following page, and instructions are written to
% |lateximage.txt| for |lwarpmk| to extract the |\lateximage| from the page of the \acro{PDF} file
% then generate an accompanying |.svg| file image file. Meanwhile, instructions to
% show this image are placed into the \acro{HTML} file after the comment.
%
% Since the |\lateximage| is placed onto its own \acro{PDF} page, which |pdftotext| will read
% and try to convert to text, an \acro{HTML} open comment is placed onto the bottom of the current
% page, but it must appear below any footnotes on the current page, so
% a special page style (|LWR@commentfooterstyle|) is used.
%
% An \acro{HTML} span is created to hold both the \acro{HTML} comment which will have the |pdftotext| conversion,
% and also the link to the final |.svg| image.
%
% \limitslateximagefontsize
%
%
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
%
% \DescribeObject{LWR@commentfooterstyle}
% \begin{macrocode}
\newpagestyle{LWR@commentfooterstyle}{
\sethead{}{}{}
\setfoot{\LWR@htmlopencomment}{}{}
}
% \end{macrocode}
% \DescribeCounter{LWR@lateximagenumber}
% Sequence the images.
% \begin{macrocode}
\newcounter{LWR@lateximagenumber}
\setcounter{LWR@lateximagenumber}{0}
% \end{macrocode}
% \DescribeCounter{LWR@lateximagedepth}
% Do not create |\lateximage| inside of |\lateximage|.
% \begin{macrocode}
\newcounter{LWR@lateximagedepth}
\setcounter{LWR@lateximagedepth}{0}
% \end{macrocode}
% Declare the |\LWR@file| for writing
% to generate file |lateximages.txt|:
% \begin{macrocode}
\ifcsdef{LWR@file}{}{\newwrite{\LWR@file}}
% \end{macrocode}
% A few utility macros to write special characters:
% \begin{macrocode}
\edef\LWR@hashmark{\string#} % for use in \write
\edef\LWR@percent{\@percentchar} % for use in \write
% \end{macrocode}
% \DescribeCounter{LWR@nextpage}
% Used to count ahead to the next page:
% \begin{macrocode}
\newcounter{LWR@nextpage}
% \end{macrocode}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% \begin{macro}{\LateximageFontSizeName}
% \changes{v0.19}{2016/05/29}{Add: User-adjustable math/lateximage font size.}
% Declares how large to write text in the |\lateximage|. The |.svg| file text size
% should blend well with the surrounding \acro{HTML} text size.
%
% \emph{Do not include the leading backslash in the name.}
% \begin{macrocode}
\newcommand*{\LateximageFontSizeName}{large}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@HTMLsanitize} \marg{text}
%
% Math expressions are converted to |lateximage|s, and some math environments may contain
% ``\&'', ``\textless'', or ``\textgreater'', which should not be allowed
% inside an \acro{HTML} ALT tag, so must convert them to \acro{HTML} entities.
%
% Two versions follow, depending on expansion needs.
% There may be a better way\dots
% \begin{macrocode}
\newcommand{\LWR@HTMLsanitize}[1]{%
\protect\StrSubstitute{\detokenize{#1}}%
{\detokenize{&}}%
{\detokenize{&}}[\LWR@strresult]%
\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}%
{\detokenize{<}}%
{\detokenize{<}}%
[\LWR@strresult]%
\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}%
{\detokenize{>}}%
{\detokenize{>}}%
[\LWR@strresult]%
\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}%
{\detokenize{##}}%
{\#}%
[\LWR@strresult]%
\LWR@strresult%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@HTMLsanitizeexpand} \marg{text}
%
% This version expands the argument before sanitizing it.
% \begin{macrocode}
\newcommand{\LWR@HTMLsanitizeexpand}[1]{%
\protect\StrSubstitute{\detokenize\expandafter{#1}}%
{\detokenize{&}}%
{\detokenize{&}}%
[\LWR@strresult]%
\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}%
{\detokenize{<}}%
{\detokenize{<}}%
[\LWR@strresult]%
\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}%
{\detokenize{>}}%
{\detokenize{>}}%
[\LWR@strresult]%
\LWR@strresult%
}
% \end{macrocode}
% \end{macro}
% \begin{environment}{lateximage} \oarg{alttag}
% \changes{v0.18}{2016/05/18}{Surpress extra space.}
% \changes{v0.18}{2016/05/18}{pdfcrop: -{}-hires added.}
% \changes{v0.18}{2016/05/19}{Reorganize \cs{HomeHTMLFilename} logic.}
% \begin{macrocode}
\NewDocumentEnvironment{lateximage}{O{image}}{%
\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}%
% \end{macrocode}
% If nesting inside an already-existing lateximage, simply record one more level:
% \begin{macrocode}
{%
\addtocounter{LWR@lateximagedepth}{1}%
}%
% \end{macrocode}
% Otherwise, this is the outer-most lateximage:
% \begin{macrocode}
{% start of outer-most lateximage
% \end{macrocode}
% Starting a new lateximage:
% \begin{macrocode}
\addtocounter{LWR@lateximagenumber}{1}%
% \end{macrocode}
% While inside a lateximage, do not use mathjax:
% \begin{macrocode}
\boolfalse{mathjax}
% \end{macrocode}
% Be sure that are doing a paragraph:
% \begin{macrocode}
\LWR@ensuredoingapar%
% \end{macrocode}
% Next file:
% \begin{macrocode}
\addtocounter{LWR@externalfilecnt}{1}%
% \end{macrocode}
% Figure out what the next page number will be:
% \begin{macrocode}
\setcounter{LWR@nextpage}{\thepage}%
\addtocounter{LWR@nextpage}{1}%
% \end{macrocode}
% Create an \acro{HTML} span which will hold the comment which contains the |pdftotext| translation
% of the image's page, and also will hold the link to the |.svg| file:
% \begin{macrocode}
\LWR@htmltag{span id="lateximage\arabic{LWR@lateximagenumber}" %
class="lateximagesource"{}} \LWR@orignewline
% \end{macrocode}
% Write instructions to the |lateximages.txt| file:
% \begin{macrocode}
\immediate\write\LWR@file{|\theLWR@nextpage|\theLWR@externalfilecnt|}%
% \end{macrocode}
% Place an open comment tag at the bottom of page; footnotes will be above this tag.
% This will hide any traces of the lateximage \acro{PDF} page which were picked up by
% |pdftotext|.
% \begin{macrocode}
\LWR@origthispagestyle{LWR@commentfooterstyle}%
\addtocounter{LWR@lateximagedepth}{1}%
% \end{macrocode}
% Start the new \acro{PDF} page:
% \begin{macrocode}
\LWR@orignewpage%
% \end{macrocode}
% Typeset the image in a ``standard'' width page and font size:
% \begin{macrocode}
\LWR@origminipage{6in}%
\csuse{LWR@orig\LateximageFontSizeName}%
% \end{macrocode}
% Temporarily restore formatting to its \acro{PDF} definitions:
% Do not produce \acro{HTML} tags for \cs{hspace}, etc. inside a lateximage.
% \begin{macrocode}
\let\hspace\LWR@orighspace%
\let\rule\LWR@origrule%
\let\,\LWR@origcomma% disable HTML short unbreakable space
\let\textit\LWR@origtextit%
\let\textbf\LWR@origtextbf%
\let\texttt\LWR@origtexttt%
\let\textsc\LWR@origtextsc%
\let\textsf\LWR@origtextsf%
\let\textrm\LWR@origtextrm%
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}%
\let\textsuperscript\LWR@origtextsuperscript%
\let\textsubscript\LWR@origtextsubscript%
\let~\LWR@origtilde%
\let\enskip\LWR@origenskip%
\let\quad\LWR@origquad%
\let\qquad\LWR@origqquad%
\let\tabular\LWR@origtabular%
\let\endtabular\LWR@origendtabular%
\let\newline\LWR@orignewline%
}% end of outer-most lateximage
}% end of \begin{lateximage}
{% start of \end{lateximage}
\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{1}}%
% \end{macrocode}
% If nesting inside an already-existing lateximage, simply record one more level:
% \begin{macrocode}
{%
\addtocounter{LWR@lateximagedepth}{-1}%
}%
% \end{macrocode}
% if this is the outer-most lateximage:
% \begin{macrocode}
{% end of outer-most lateximage
% \end{macrocode}
% Finish the lateximage minipage and start a new \acro{PDF} page:
% \begin{macrocode}
\LWR@origendminipage%
\LWR@orignewpage%
\LWR@origscriptsize%
% \end{macrocode}
% Close the \acro{HTML} comment which encapsulated any traces of the lateximage picked up by |pdftotext|:
% \begin{macrocode}
\LWR@htmlclosecomment{}\LWR@orignewline%
% \end{macrocode}
% Create a link to the lateximage, allowing its natural height:
%
% If the alt tag is given as ``LWRAMSMATHBODY'', then use the text collected by the
% amsmath multline, gather, or align environments.
% \begin{macrocode}
\ifthenelse{\equal{#1}{LWRAMSMATHBODY}}%
{%
\LWR@subinlineimage[%
\LWR@HTMLsanitizeexpand{\detokenize\expandafter{\the\@envbody}}%
]%
{lateximage}%
{lateximages\OSPathSymbol{}lateximage-\theLWR@externalfilecnt}%
{svg}%
{}%
}%
{%
\LWR@subinlineimage[#1]{lateximage}%
{lateximages\OSPathSymbol{}lateximage-\theLWR@externalfilecnt}{svg}{}%
}%
% \LWR@orignewline% Removed to prevent extra space.
% \end{macrocode}
% Be sure that are doing a paragraph:
% \begin{macrocode}
\LWR@ensuredoingapar%
% \end{macrocode}
% Close the \acro{HTML} span which has the |pdftotext| comment and also the link to the |.svg| image:
% \begin{macrocode}
\LWR@htmltag{/span}%
\LWR@htmlcomment{End of lateximage}%
% \LWR@orignewline% Removed to prevent extra space.
% \end{macrocode}
% Undo one lateximage level:
% \begin{macrocode}
\addtocounter{LWR@lateximagedepth}{-1}%
}% end of outer-most lateximage
}%
\end{warpHTML}
% \end{macrocode}
% \codeprint
% \begin{macrocode}
\begin{warpprint}
\newenvironment{lateximage}[1][]{\begingroup}{\endgroup}
\end{warpprint}
% \end{macrocode}
% \end{environment}
% \section{\env{center}, \env{flushleft}, \env{flushright}}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{environment}{center}
% Replace \env{center} functionality with \acro{CSS} tags:
% \begin{macrocode}
\renewenvironment*{center}
{\BlockClass{center}}
{\endBlockClass}
% \end{macrocode}
% \end{environment}
% \begin{environment}{flushright}
% \begin{macrocode}
\renewenvironment*{flushright}
{\BlockClass{flushright}}
{\endBlockClass}
% \end{macrocode}
% \end{environment}
% \begin{environment}{flushleft}
% \begin{macrocode}
\renewenvironment*{flushleft}
{\BlockClass{flushleft}}
{\endBlockClass}
% \end{macrocode}
% \end{environment}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Siunitx}
% \label{sec:siunitx}
% \DescribePackage{siunitx}
%
% \limitssiunitx
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% Options for siunitx:
% \begin{macrocode}
\PassOptionsToPackage{
detect-mode=true,
per-mode=symbol, % fraction is not seen by pdftotext
text-celsius = {\HTMLentity{deg}C},
text-degree = {\HTMLentity{deg}},
}{siunitx}
% \end{macrocode}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Graphics}
% \DescribePackage{graphics}
%
% \DescribePackage{graphicx}
%
% \index{images>graphicx package}
%
% \limitsgraphics
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \subsection{\cs{graphicspath}}
% \begin{macro}{\graphicspath} \marg{path}
% \begin{macrocode}
\newcommand*{\thisgraphicspath}{{}}
\renewcommand*{\graphicspath}[1]{\renewcommand*{\thisgraphicspath}{#1}}
% \end{macrocode}
% \end{macro}
% ^^A \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% ^^A \DeclareGraphicsExtensions{.svg,.gif,.png,.jpg}
% ^^A \DeclareGraphicsRule{.svg}{svg}{.png}{}
% ^^A \end{Verbatim}
% \begin{macro}{\DeclareGraphicsExtensions} \marg{list}
% \begin{macro}{\DeclareGraphicsRule} \marg{} \marg{} \marg{} \marg{}
% \begin{macrocode}
\renewcommand*{\DeclareGraphicsExtensions}[1]{}
\renewcommand*{\DeclareGraphicsRule}[4]{}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \subsection{Length conversions and graphics options}
%
% A scaled image in \LaTeX{} by default takes only as much space
% on the page as it
% requires, but \acro{HTML} browsers use as much space as the
% \watchout[whitespace]
% original unscaled image would have taken,
% with the scaled image over- or under-flowing the area.
% \begin{macrocode}
\renewcommand*{\unitspace}{}
% \end{macrocode}
% Used to store the user's selected dimensions and \acro{HTML} class.
%
% The class defaults to ``inlineimage'' unless changed by a |class=xyx| option.
% \begin{macrocode}
\newlength{\LWR@igwidth}
\newlength{\LWR@igheight}
\newcommand*{\LWR@igwidthstyle}{}
\newcommand*{\LWR@igheightstyle}{}
\newcommand*{\LWR@igorigin}{}
\newcommand*{\LWR@igangle}{}
\newcommand*{\LWR@igxscale}{1}
\newcommand*{\LWR@igyscale}{1}
\newcommand*{\LWR@igclass}{inlineimage}
% \end{macrocode}
% Set the actions of each of the key/value combinations for
% \cs{includegraphics}. Many are ignored.
%
% If an optional width was given, set an \acro{HTML} style:
% \begin{macrocode}
\define@key{igraph}{width}{%
\setlength{\LWR@igwidth}{#1}%
\ifthenelse{\lengthtest{\LWR@igwidth > 0pt}}%
{%
% \end{macrocode}
% Default to use the converted fixed length given:
% \begin{macrocode}
\uselengthunit{PT}%
\renewcommand*{\LWR@igwidthstyle}{width:\rndprintlength{\LWR@igwidth}}%
% \end{macrocode}
% If ex or em dimensions were given, use those instead:
% \begin{macrocode}
\IfEndWith{#1}{ex}%
{\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes ex
{}% not ex
\IfEndWith{#1}{em}%
{\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes em
{}% not em
\IfEndWith{#1}{\%}%
{\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes percent
{}% not percent
\IfEndWith{#1}{px}%
{\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes px
{}% not px
}{}% end of length > 0pt
}
% \end{macrocode}
%
% If an optional height was given, set an \acro{HTML} style:
% \begin{macrocode}
\define@key{igraph}{height}{%
\setlength{\LWR@igheight}{#1}%
\ifthenelse{\lengthtest{\LWR@igheight > 0pt}}%
{%
% \end{macrocode}
% Default to use the converted fixed length given:
% \begin{macrocode}
\uselengthunit{PT}%
\renewcommand*{\LWR@igheightstyle}{%
height:\rndprintlength{\LWR@igheight} %
}%
% \end{macrocode}
% If ex or em dimensions were given, use those instead:
% \begin{macrocode}
\IfEndWith{#1}{ex}%
{\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes ex
{}% not ex
\IfEndWith{#1}{em}%
{\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes em
{}% not em
\IfEndWith{#1}{\%}%
{\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes percent
{}% not percent
\IfEndWith{#1}{px}%
{\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes px
{}% not px
}{}% end of length > 0pt
}
% \end{macrocode}
%
%
% Handle origin key:
% \begin{macrocode}
\define@key{igraph}{origin}{%
\renewcommand*{\LWR@igorigin}{#1}%
}
% \end{macrocode}
%
%
% Handle angle key:
% \begin{macrocode}
\define@key{igraph}{angle}{\renewcommand*{\LWR@igangle}{#1}}
% \end{macrocode}
%
%
% Handle class key:
% \begin{macrocode}
\define@key{igraph}{class}{\renewcommand*{\LWR@igclass}{#1}}
% \end{macrocode}
% ^^A \define@key{igraph}{xscale}{\renewcommand*{\LWR@igxscale}{#1}}
% ^^A \define@key{igraph}{yscale}{\renewcommand*{\LWR@igyscale}{#1}}
% It appears that \pkg{graphicx} does not have separate keys for
% |xscale| and |yscale|. |scale| adjusts both at the same time.
% \begin{macrocode}
\define@key{igraph}{scale}{%
\renewcommand*{\LWR@igxscale}{#1}%
\renewcommand*{\LWR@igyscale}{#1}}
% \end{macrocode}
%
% Numerous ignored keys:
% \begin{macrocode}
\define@key{igraph}{bb}{}
\define@key{igraph}{bbllx}{}
\define@key{igraph}{bblly}{}
\define@key{igraph}{bburx}{}
\define@key{igraph}{bbury}{}
\define@key{igraph}{natwidth}{}
\define@key{igraph}{natheight}{}
\define@key{igraph}{hiresbb}{}
\define@key{igraph}{viewport}{}
\define@key{igraph}{trim}{}
\define@key{igraph}{totalheight}{}
\define@key{igraph}{keepaspectratio}{}
\define@key{igraph}{clip}{}
\define@key{igraph}{draft}{}
\define@key{igraph}{type}{}
\define@key{igraph}{ext}{}
\define@key{igraph}{read}{}
\define@key{igraph}{command}{}
% \end{macrocode}
% \begin{macro}{\LWR@rotstyle} \marg{prefix} \marg{degrees}
%
% Prints the rotate style with the given prefix.
%
% |prefix| is |-ms-| or |-webkit-| or nothing, and is used to generate
% three versions of the |transform:rotate| style.
% \begin{macrocode}
\newcommand*{\LWR@rotstyle}[2]{%
#1transform:rotate(-#2deg);
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@scalestyle} \marg{prefix} \marg{xscale} \marg{yscale}
%
% Prints the scale style with the given prefix.
%
% |prefix| is |-ms-| or |-webkit-| or nothing, and is used to generate
% three versions of the |transform:scale| style.
% \begin{macrocode}
\newcommand*{\LWR@scalestyle}[3]{%
#1transform:scale(#2,#3);
}
% \end{macrocode}
% \end{macro}
% \subsection{\cs{includegraphics}}
% \DescribeBoolean{LWR@infloatrow}
% Used to compute \cs{linewidth}.
% \begin{macrocode}
\newbool{LWR@infloatrow}
\boolfalse{LWR@infloatrow}
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\LWR@imageextension}{}
\newcommand*{\LWR@expgraphicsfilename}{}
% \end{macrocode}
% \begin{macro}{\LWR@includegraphicsb} \oarg{options} \marg{filename}
% \changes{v0.18}{2016/04/14}{Improved HTML output linebreaks.}
% \changes{v0.18}{2016/05/17}{Fix: \cs{linewidth}, \cs{textwidth}, \cs{textheight}
% inside a minipage.}
% \changes{v0.18}{2016/05/17}{em, ex, \%, px dimensions preserved.}
% \changes{v0.18}{2016/05/17}{Add: svgz file extension.}
% \changes{v0.20}{2016/08/20}{Fix: \cs{linewidth} in a floatrow.}
% \changes{v0.20}{2017/01/12}{Fix: Expands filename.}
% \begin{macrocode}
\newcommand*{\LWR@includegraphicsb}[2][]
{%
% \end{macrocode}
% Start the image tag on a new line, allow \acro{PDF} output word wrap:
% \begin{macrocode}
\LWR@origtilde \LWR@orignewline%
% \end{macrocode}
% Temporarily compute |\linewidth|, |\textwidth|, |\textheight| arguments with a 6x9 inch size
% until the next |\endgroup|.
% \begin{macrocode}
\ifthenelse{\cnttest{\value{LWR@minipagedepth}}{=}{0}}{%
\ifbool{LWR@infloatrow}%
{}
{% not in a minipage or a floatrow:
\setlength{\linewidth}{6in}%
\setlength{\textwidth}{6in}%
\setlength{\textheight}{9in}%
}%
}{}%
% \end{macrocode}
% See if can find the image by adding an extension:
%
% Preference is |svgz|, then |svg|, |gif|, |png|, and |jpg|.
%
% |\detokenize\expandafter| allows underscore characters in filenames.
%
% \begin{macrocode}
\edef\LWR@expgraphicsfilename{#2}
\renewcommand*{\LWR@imageextension}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.jpg}%
{\renewcommand*{\LWR@imageextension}{.jpg}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.JPG}%
{\renewcommand*{\LWR@imageextension}{.JPG}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.png}%
{\renewcommand*{\LWR@imageextension}{.png}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.PNG}%
{\renewcommand*{\LWR@imageextension}{.PNG}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.gif}%
{\renewcommand*{\LWR@imageextension}{.gif}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.GIF}%
{\renewcommand*{\LWR@imageextension}{.GIF}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.svg}%
{\renewcommand*{\LWR@imageextension}{.svg}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.SVG}%
{\renewcommand*{\LWR@imageextension}{.SVG}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.svgz}%
{\renewcommand*{\LWR@imageextension}{.svgz}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.SVGZ}%
{\renewcommand*{\LWR@imageextension}{.SVGZ}}{}%
% \end{macrocode}
%
% Convert a \acro{PDF} extension to \acro{SVG}, leave the result in |\LWR@strresult|:
%
% Must also |\detokenize| |.pdf| and |.svg| comparison strings.
% \begin{macrocode}
\StrSubstitute{\detokenize\expandafter{\LWR@expgraphicsfilename}}%
{\detokenize{.pdf}}{\detokenize{.svg}}[\LWR@strresult]%
%
\StrSubstitute{\LWR@strresult}%
{\detokenize{.PDF}}{\detokenize{.SVG}}[\LWR@strresult]%
% \end{macrocode}
% For correct em sizing during the width and height conversions:
% \begin{macrocode}
\large%
% \end{macrocode}
% Reset some defaults, possibly will be changed below if options were given:
% \begin{macrocode}
\setlength{\LWR@igwidth}{0pt}%
\setlength{\LWR@igheight}{0pt}%
\renewcommand*{\LWR@igwidthstyle}{}%
\renewcommand*{\LWR@igheightstyle}{}%
\renewcommand*{\LWR@igorigin}{}%
\renewcommand*{\LWR@igangle}{}%
\renewcommand*{\LWR@igxscale}{1}%
\renewcommand*{\LWR@igyscale}{1}%
\renewcommand*{\LWR@igclass}{inlineimage}%
% \end{macrocode}
%
% Options are in |#1|
%
% \begin{macrocode}
\setkeys{igraph}{#1}%
% \end{macrocode}
% Create the \acro{HTML} reference with the graphicspath, filename, extension,
% alt tag, style, and class.
%
% The \cs{LWR@origtilde} adds space between tags in case this
% is being done inside a \cs{savebox} where \cs{newline} has no effect.
% \begin{macrocode}
\href{\thisgraphicspath\LWR@strresult\LWR@imageextension}%
{% start of href
\LWR@htmltag{% start of image tags
img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline
\LWR@origtilde{} alt="\LWR@strresult" \LWR@orignewline
% \end{macrocode}
% Only include a style tag if a width, height, angle, or scale was given:
% \begin{macrocode}
\ifthenelse{
\NOT\equal{\LWR@igwidthstyle}{} \OR
\NOT\equal{\LWR@igheightstyle}{} \OR
\NOT\equal{\LWR@igorigin}{} \OR
\NOT\equal{\LWR@igangle}{} \OR
\NOT\equal{\LWR@igxscale}{1} \OR
\NOT\equal{\LWR@igyscale}{1}
}%
{\LWR@origtilde{} style="%
\ifthenelse{\NOT\equal{\LWR@igwidthstyle}{}}%
{\LWR@igwidthstyle;}{}%
\ifthenelse{\NOT\equal{\LWR@igheightstyle}{}}%
{\LWR@igheightstyle;}{}%
\ifthenelse{\NOT\equal{\LWR@igorigin}{}}%
{\LWR@origtilde{} transform-origin: \LWR@originnames{\LWR@igorigin}; \LWR@orignewline}{}%
\ifthenelse{\NOT\equal{\LWR@igangle}{}}%
{%
\LWR@rotstyle{-ms-}{\LWR@igangle}%
\LWR@rotstyle{-webkit-}{\LWR@igangle}%
\LWR@rotstyle{}{\LWR@igangle%
}}{}%
\ifthenelse{\NOT\equal{\LWR@igxscale}{1}\OR%
\NOT\equal{\LWR@igyscale}{1}}%
{\LWR@scalestyle{-ms-}{\LWR@igxscale}{\LWR@igyscale}%
\LWR@scalestyle{-webkit-}{\LWR@igxscale}{\LWR@igyscale}%
\LWR@scalestyle{}{\LWR@igxscale}{\LWR@igyscale}}{}%
" \LWR@orignewline}{}%
% \end{macrocode}
% Set the class:
% \begin{macrocode}
\LWR@origtilde{} class="\LWR@igclass" \LWR@orignewline%
}% end of image tags
}% end of href
\endgroup
% \end{macrocode}
% Return to small-sized output:
% \begin{macrocode}
\LWR@origscriptsize
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\includegraphics} \oarg{key=val} \marg{filename}
% Handles width and height, converted to fixed width and heights.
% Converts any |.pdf| references to |.svg| for \acro{HTML}
% The user should always refer to |.pdf| in the document source.
% \begin{macrocode}
\renewcommand*{\includegraphics}
{%
% \end{macrocode}
% This graphic should trigger an \acro{HTML} paragraph even if alone,
% so ensure that are doing paragraph handling:
% \begin{macrocode}
\LWR@ensuredoingapar%
\begingroup%
\LWR@includegraphicsb%
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \codeprint
%
% For print output, accept and then discard the new |class| key:
% \begin{macrocode}
\begin{warpprint}
\define@key{Gin}{class}{}
\end{warpprint}
% \end{macrocode}
% \subsection{\cs{rotatebox}, \cs{scalebox}, \cs{reflectbox}}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@rotboxorigin} Holds the origin key letters.
% \begin{macrocode}
\newcommand*{\LWR@rotboxorigin}{}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\LWR@originname} \marg{letter}
%
% Given one \LaTeX{} origin key value,
% translate into an \acro{HTML} origin word:
% \begin{macrocode}
\newcommand*{\LWR@originname}[1]{%
\ifthenelse{\equal{#1}{t}}{top}{}%
\ifthenelse{\equal{#1}{b}}{bottom}{}%
\ifthenelse{\equal{#1}{c}}{center}{}%
\ifthenelse{\equal{#1}{l}}{left}{}%
\ifthenelse{\equal{#1}{r}}{right}{}%
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\LWR@originnames} \marg{letters}
%
% Given one- or two-letter \LaTeX{} origin key values,
% translate into \acro{HTML} origin words:
% \begin{macrocode}
\newcommand*{\LWR@originnames}[1]{%
\StrChar{#1}{1}[\LWR@strresult]%
\LWR@originname{\LWR@strresult}
\StrChar{#1}{2}[\LWR@strresult]%
\LWR@originname{\LWR@strresult}
}
% \end{macrocode}
% \end{macro}
%
%
% Handle the origin key for \cs{rotatebox}:
% \begin{macrocode}
\define@key{krotbox}{origin}{%
\renewcommand*{\LWR@rotboxorigin}{#1}%
}
% \end{macrocode}
% These keys are ignored:
% \begin{macrocode}
\define@key{krotbox}{x}{}
\define@key{krotbox}{y}{}
\define@key{krotbox}{units}{}
% \end{macrocode}
%
%
% \begin{macro}{\rotatebox} \oarg{keyval list} \marg{angle} \marg{text}
%
% Will \cs{let}\cs{rotatebox}\cs{LWR@rotatebox} at \cs{LWR@LwarpStart},
% in case \cs{rotatebox} was over-written by a later package load.
% \begin{macrocode}
\NewDocumentCommand{\LWR@rotatebox}{O{} m +m}{%
% \end{macrocode}
% Reset the origin to ``none-given'':
% \begin{macrocode}
\renewcommand*{\LWR@rotboxorigin}{}
% \end{macrocode}
% Process the optional keys, which may set \cs{LWR@rotateboxorigin}:
% \begin{macrocode}
\setkeys{krotbox}{#1}%
% \end{macrocode}
% Select |inline-block| so that \acro{HTML} will transform this span:
% \begin{macrocode}
\LWR@htmltagc{span style="display: inline-block;
% \end{macrocode}
% If an origin was given, translate and print the origin information:
% \begin{macrocode}
\ifthenelse{\NOT\equal{\LWR@rotboxorigin}{}}%
{transform-origin: \LWR@originnames{\LWR@rotboxorigin};\LWR@origtilde}{}%
% \end{macrocode}
% Print the rotation information:
% \begin{macrocode}
\LWR@rotstyle{-ms-}{#2} %
\LWR@rotstyle{-webkit-}{#2} %
\LWR@rotstyle{}{#2} %
"{}}\LWR@orignewline%
% \end{macrocode}
% Print the text to be rotated:
% \begin{macrocode}
\begin{LWR@nestspan}%
#3%
% \end{macrocode}
% Close the span:
% \begin{macrocode}
\LWR@htmltagc{/span}%
\end{LWR@nestspan}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\scalebox} \marg{h-scale} \oarg{v-scale} \marg{text}
%
% Will \cs{let}\cs{scalebox}\cs{LWR@scalebox} at \cs{LWR@LwarpStart},
% in case \cs{scalebox} was over-written by a later package load.
% \begin{macrocode}
\NewDocumentCommand{\LWR@scalebox}{m o m}{%
% \end{macrocode}
% Select |inline-block| so that \acro{HTML} will transform this span:
% \begin{macrocode}
\LWR@htmltagc{span style="display: inline-block; %
% \end{macrocode}
% Print the scaling information:
% \begin{macrocode}
\LWR@scalestyle{-ms-}{#1}{\IfNoValueTF{#2}{#1}{#2}} %
\LWR@scalestyle{-webkit-}{#1}{\IfNoValueTF{#2}{#1}{#2}} %
\LWR@scalestyle{}{#1}{\IfNoValueTF{#2}{#1}{#2}} %
"{}}%
% \end{macrocode}
% Print the text to be scaled:
% \begin{macrocode}
\begin{LWR@nestspan}%
#3%
% \end{macrocode}
% Close the span:
% \begin{macrocode}
\LWR@htmltagc{/span}%
\end{LWR@nestspan}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\reflectbox} \marg{text}
%
% Will \cs{let}\cs{reflectbox}\cs{LWR@reflectbox} at \cs{LWR@LwarpStart},
% in case \\
% \cs{reflectbox} was over-written by a later package load.
% \begin{macrocode}
\newcommand{\LWR@reflectbox}[1]{\LWR@scalebox{-1}[1]{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \subsection{Null functions}
%
% These functions are not supported by \pkg{lwarp}'s \acro{HTML} conversion.
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\resizebox} \marg{h-length} \marg{v-length} \marg{text}
%
% Simply prints its text argument.
% \begin{macrocode}
\renewcommand{\resizebox}[3]{#3}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% ^^A \RequirePackage[version=3]{mhchem}
% ^^A
% ^^A
% ^^A % use before and after environment hooks
% ^^A \let\LWR@origce\ce
% ^^A
% ^^A \renewcommand{\ce}[1]{
% ^^A \begin{lateximage}
% ^^A \LWR@origce{#1}
% ^^A \end{lateximage}
% ^^A }
% ^^A
% ^^A
% ^^A \RequirePackage{rsphrase}
% \section{Cleverref}
% \label{sec:cleveref}
% \DescribePackage{cleveref}
% \pkg{cleveref} package is used as-is with minor patches.
%
% \pkg{cleveref} and the following associated macro patches are
% \margintag{loading order}
% automatically preloaded at the end of the preamble via \cs{AtEndPreamble}
% and \cs{AfterEndPreamble}.
% This is done because the \acro{HTML} conversion requires \pkg{cleveref}.
% The user's document may not require \pkg{cleveref}, thus the user
% may never explicitly load it, so during \acro{HTML} output \pkg{lwarp} loads it last.
% If the user's document preamble uses \pkg{cleveref} options, or functions such as
% \cs{crefname}, then \pkg{cleveref} may be loaded in the user's preamble near the
% end, and \pkg{lwarp}'s additional loading of \pkg{cleveref} will have no effect.
%
% \Cref{tab:crossrefdata} on \pageref{tab:crossrefdata}
% shows the data structure of the label/reference system
% as revised by \pkg{lwarp} and \pkg{cleveref}.
% A few patches allow \pkg{cleveref} to work as-is:
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \changes{v0.19}{2016/06/06}{cleveref: Loaded \cs{AtEndPreamble}.}
%
% \cs{AtEndPreable} forces \pkg{cleveref} to be loaded last:
%
% \changes{v0.14}{2016/03/29}{Pagenote: Assigned cleveref name.}
% \changes{v0.19}{2016/06/06}{cleveref: Loaded \cs{AtEndPreamble}.}
%
% \begin{macrocode}
\AtEndPreamble{
\RequirePackage{cleveref}
\crefname{pagenote}{note}{notes}
}
% \end{macrocode}
%
%
% \changes{v0.20}{2017/01/05}{\pkg{cleveref} and referencing patches: Applied \cs{AfterEndPreamble}.}
%
% \begin{flushleft}
% The following patches are applied after \pkg{cleveref} has loaded,
% and after \cs{AtBeginDocument}:
% \end{flushleft}
% \begin{macrocode}
\AfterEndPreamble{
% \end{macrocode}
% \begin{macro}{\@@setcref} \marg{kindofref} \marg{label}
% ^^A |\@templabel| becomes the section number
% ^^A original: \def\@@setcref#1#2{\cref@getlabel{#2}{\@templabel}#1{\@templabel}{}{}}
% \begin{macrocode}
\renewcommand*{\@@setcref}[2]{#1{\ref{#2}}{}{}}
% \end{macrocode}
% \end{macro}
% ^^A orig:
% ^^A \def\@@setcrefrange#1#2#3{%
% ^^A \cref@getlabel{#2}{\@labela}%
% ^^A \cref@getlabel{#3}{\@labelb}%
% ^^A #1{\@labela}{\@labelb}{}{}{}{}}
%\begin{macro}{\@@setcrefrange} \marg{text} \marg{label} \marg{label}
% \begin{macrocode}
\renewcommand{\@@setcrefrange}[3]{%
#1{\ref{#2}}{\ref{#3}}{}{}{}{}}
% \end{macrocode}
% \end{macro}
% ^^A orig:
% ^^A \def\@@setcpageref#1#2{%
% ^^A \cref@getpageref{#2}{\@temppage}#1{\@temppage}{}{}}
% \begin{macro}{\cpagerefFor} Redefinable word between ``page(s)'' and the page numbers.
%
% \changes{v0.20}{2017/01/03}{User-redefinable word for page references.}
%
% \begin{macrocode}
\newcommand*{\cpagerefFor}{for}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@@setcpageref} \marg{typeofref} \marg{label},
% where typeofref is ``page'' or ``pages''
%
% \begin{macrocode}
\renewcommand*{\@@setcpageref}[2]{%
#1{\cpagerefFor\ \cref{#2}}{}{}%
}
% \end{macrocode}
% \end{macro}
% ^^A orig:
% ^^A \def\@@setcpagerefrange#1#2#3{%
% ^^A \cref@getpageref{#2}{\@pagea}%
% ^^A \cref@getpageref{#3}{\@pageb}%
% ^^A #1{\@pagea}{\@pageb}{}{}{}{}}
% \begin{macrocode}
\renewcommand{\@@setcpagerefrange}[3]{%
#1{\cpagerefFor\ \cref{#2}}{\cref{#3}}{}{}{}{}}
% \end{macrocode}
% Remember and patch some label-related defintions.
%
% \begin{macrocode}
\let\LWR@origlabel\label
\let\label\LWR@newlabel
\let\LWR@origref\ref
\let\ref\LWR@newref% \end{ syntax highlighting
\let\LWR@origpageref\pageref
\let\pageref\LWR@newpageref
}% AfterEndPreamble
\end{warpHTML}
% \end{macrocode}
% \section{Picture}
% \label{sec:picture}
% \DescribeEnv{picture} The \env{picture} environment is enclosed
% inside a \cs{lateximage}.
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{environment}{picture}
% \begin{macrocode}
\BeforeBeginEnvironment{picture}{
\lateximage}
\AfterEndEnvironment{picture}{\endlateximage
}
% \end{macrocode}
% \end{environment}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Tikzpicture}
% \label{sec:tikz}
% \DescribePackage{tikz}
%
% \DescribeEnv{tikzpicture} May be used as-is, and its contents will be
% converted to an image.
%
% \limitstikz
%
% (\pkg{lwarp} changes the catcode of |$| for its own use.
% \margintag{catcodes}
% The \tikz{} |babel| library temporarily changes catcodes
% back to normal for \tikz's use, restoring them to their
% \pkg{lwarp} purpose while inside each \tikz{} node.)
% \index{tikz>dollar redefined}
% \index{tikz>catcodes}
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \DescribeBoolean{LWR@tikzbabel}
% \pkg{tikz} v3.0.0 introduced the |babel| library which handles catcode changes.
% For older versions, \pkg{lwarp} must change |$|'s catcode itself.
% \begin{macrocode}
\newbool{LWR@tikzbabel}
\boolfalse{LWR@tikzbabel}
\AtBeginDocument{
\@ifpackageloaded{tikz}{
\@ifpackagelater{tikz}{2013/12/20}% Test for Tikz version v3.0.0
{\booltrue{LWR@tikzbabel}}
{\boolfalse{LWR@tikzbabel}}
}{}
}
% \end{macrocode}
% \begin{environment}{tikzpicture}
% |tikzpicture| environment is enclosed inside a |\lateximage|.
%
% \changes{v0.13}{2016/03/23}{Fix dollar-redefined bug for newer package.}
% \changes{v0.19}{2016/05/29}{Adapts to tikz version.}
%
% \begin{macrocode}
\BeforeBeginEnvironment{tikzpicture}{%
\lateximage
\ifbool{LWR@tikzbabel}
{}
{\catcode`\$=3} % dollar sign is math shift
}
\AfterEndEnvironment{tikzpicture}{%
\endlateximage
\ifbool{LWR@tikzbabel}
{}
{\catcode`\$=\active}
}
% \end{macrocode}
% \end{environment}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Boxes and Minipages}
%
% A \acro{CSS} flexbox is used for minipages and parboxes,
% allowing external and internal vertical positioning.
%
%
% \limitsminipage
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \subsection{Counters and lengths}
% \DescribeCounter{LWR@minipagedepth}
% Used to only reset the line width at the outermost minipage.
% \begin{macrocode}
\newcounter{LWR@minipagedepth}
\setcounter{LWR@minipagedepth}{0}
% \end{macrocode}
%
% \DescribeLength{LWR@minipagewidth}
% Used to convert the width into printable units.
% \begin{macrocode}
\newlength{\LWR@minipagewidth}
% \end{macrocode}
% \DescribeLength{LWR@minipageheight}
% Used to convert the height into printable units.
% \begin{macrocode}
\newlength{\LWR@minipageheight}
% \end{macrocode}
%
% Remember the original definitions:
% \begin{macrocode}
\let\LWR@origminipage\minipage
\let\LWR@origendminipage\endminipage
% \end{macrocode}
%
%
% \subsection{Footnote handling}
% \label{sec:footnotesminipage}
%
% Also see \cref{sec:footnotes} for other forms of footnotes.
%
%
%
% \begin{macro}{\LWR@nullrule} \oarg{raise} \marg{width} \marg{height}
%
% Used to cancel the footnotesep rule during \acro{HTML} output.
% This rule was causing occasional end paragraph tags to be inserted
% for some (so far) undetermined reason, as well
% as adding purposeless code to the \acro{HTML} output.
% \begin{macrocode}
\NewDocumentCommand{\LWR@nullrule}{o m m}{}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\LWR@makefntext} \marg{text}
%
% Adds a paragraph closing tag to the end of each footnote.
% \begin{macrocode}
\newcommand{\LWR@makefntext}[1]{%
\begingroup%
\let\rule\LWR@nullrule%
\textsuperscript{\@thefnmark} #1%
\endgroup%
\LWR@htmltagc{/\LWR@tagregularparagraph}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LWR@makefnmark}
% Creates an \acro{HTML} superscript footnote mark:
% \begin{macrocode}
\newcommand*{\LWR@makefnmark}{\textsuperscript{\@thefnmark}}
% \end{macrocode}
% \end{macro}
%
%
%
% \subsection{Minipage handling}
%
% \begin{macro}{\LWR@endminipage}
% Used to close a minipage.
%
% Copied the \LaTeX{} definition and modified to create a |mpfootnotes| div class:
% \begin{macrocode}
\def\LWR@endminipage{%
\par
\unskip
\ifvoid\@mpfootins\else
\vskip\skip\@mpfootins
\normalcolor
\LWR@htmldivclass{mpfootnotes}
\unvbox\@mpfootins
\LWR@htmldivclassend{mpfootnotes}
\fi
\@minipagefalse
\color@endgroup
\egroup
\expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@subminipage}
% Used to create a \acro{PDF} minipage without creating an \acro{HTML} minipage.
% This allows footnotes to appear at the bottom of the minipage instead of
% the bottom of the \acro{HTML} page.
% \begin{macrocode}
\newcommand*{\LWR@subminipage}{%
\LWR@stoppars
\LWR@origminipage{6in}
% \end{macrocode}
% |\raggedright| cancels hyphenation, which will be done by \acro{HTML} instead.
% \begin{macrocode}
\LWR@origraggedright%
% \end{macrocode}
% Minipage footnotes appear the bottom of the minipage.
% \begin{macrocode}
\let\footnote\LWR@origfootnote%
\let\@makefntext\LWR@makefntext%
\let\@makefnmark\LWR@makefnmark%
% \end{macrocode}
% Resume paragraph tag handling for the contents of the minipage:
% \begin{macrocode}
\LWR@startpars%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@endsubminipage}
% Closes the subminipage.
% \begin{macrocode}
\newcommand*{\LWR@endsubminipage}{%
\LWR@stoppars%
\LWR@endminipage% The following empty line is required:
}
% \end{macrocode}
% \end{macro}
% \DescribeBoolean{LWR@minipagefullwidth} Should the next minipage have no \acro{HTML} |width|?
% \begin{macrocode}
\newbool{LWR@minipagefullwidth}
\boolfalse{LWR@minipagefullwidth}
% \end{macrocode}
%
% \begin{macro}{\minipagefullwidth} Requests that the next minipage
% have no |width| tag in \acro{HTML}:
% \changes{v0.19}{2016/05/28}{Added: No width tag for the next minipage in HTML.}
%
% \codehtml
%
% \begin{macrocode}
\newcommand*{\minipagefullwidth}{\booltrue{LWR@minipagefullwidth}}
\end{warpHTML}
% \end{macrocode}
%
% \codeprint
%
% \begin{macrocode}
\begin{warpprint}
\newcommand*{\minipagefullwidth}{}
\end{warpprint}
% \end{macrocode}
%
% \codehtml
%
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \end{macro}
%
%
% \DescribeBoolean{LWR@minipagethispar}
% Has a minipage been seen this paragraph?
% If true, prevents paragraph tags around horizontal space
% between minipages.
% \begin{macrocode}
\newbool{LWR@minipagethispar}
\boolfalse{LWR@minipagethispar}
% \end{macrocode}
%
%
% \begin{environment}{minipage} \oarg{vert position} \oarg{height} \oarg{inner vert position} \marg{width}
% \changes{v0.18}{2016/05/17}{Fix: \cs{linewidth}, \cs{textwidth}, \cs{textheight} inside a minipage.}
%
% The vertical positions may be 'c', 't', or 'b'.
% The inner position may also be 's'.
%
% When using |\linewidth|, |\textwidth|, or |\textheight|, these are scaled proportionally to a
% 6\texttimes{}9 inch text area.
%
% \begin{macrocode}
\RenewDocumentEnvironment{minipage}{O{t} o O{t} m}
{%
% \end{macrocode}
% Pre-compute the given width and height:
% \begin{macrocode}
% \end{macrocode}
% Reset the text area if are starting the outer-most minipage:
% \begin{macrocode}
\LWR@traceinfo{starting minipage}%
\uselengthunit{in}%
\setlength{\LWR@minipagewidth}{#4}%
\ifthenelse{\cnttest{\value{LWR@minipagedepth}}{=}{0}}{%
\addtolength{\LWR@minipagewidth}{3em}% room for frames
\setlength{\linewidth}{6in}%
\setlength{\textwidth}{6in}%
\setlength{\textheight}{9in}%
}{}%
\addtocounter{LWR@minipagedepth}{1}%
\setlength{\LWR@minipageheight}{\textheight}% default unless specified
\IfValueTF{#2}{\setlength{\LWR@minipageheight}{#2}}{}%
% \end{macrocode}
% \LaTeX{} wants to start a paragraph for the new minipage, then start a paragraph again
% for the contents of the minipage, so cancel the paragraph tag handling
% until the minipage has begun.
% \begin{macrocode}
\LWR@stoppars%
% \end{macrocode}
% Create the |<div>| tag with optional alignment style:
% \begin{macrocode}
\LWR@traceinfo{minipage: creating div class}%
\LWR@htmltag{div class="minipage" style="%
\ifthenelse{\equal{#1}{t}}{vertical-align: bottom ; }{}%
\ifthenelse{\equal{#1}{c}}{vertical-align: middle ; }{}%
\ifthenelse{\equal{#1}{b}}{vertical-align: top ; }{}%
\ifthenelse{\equal{#3}{t}}{justify-content: flex-start ; }{}%
\ifthenelse{\equal{#3}{c}}{justify-content: center ; }{}%
\ifthenelse{\equal{#3}{b}}{justify-content: flex-end ; }{}%
\ifthenelse{\equal{#3}{s}}{justify-content: space-between ; }{}%
% \end{macrocode}
% Print the width and optional height styles:
% \begin{macrocode}
\LWR@traceinfo{minipage: about to print the width}%
\uselengthunit{PT}%
\ifbool{LWR@minipagefullwidth}%
{\boolfalse{LWR@minipagefullwidth}}%
{%
\ifthenelse{\lengthtest{#4}=\linewidth}%
{}%
{width:\rndprintlength{\LWR@minipagewidth} ; }%
}%
\LWR@traceinfo{minipage: about to print the height}%
\IfValueTF{#2}{height:\rndprintlength{\LWR@minipageheight} ; }{}%
"{}}%
% \end{macrocode}
% Finish with an empty line to start \LaTeX{} minipage processing on a new line.
% Use a large minipage area to avoid the unnecessary wrapping of tags.
% \begin{macrocode}
\LWR@origminipage{6in}% The preceding empty line is required.
% \end{macrocode}
% Set the user-accessible minipage and text width and height values inside the minipage.
% These do not affect the actual size of the large minipage created by
% \cs{LWR@origminipage} above, but are used by any reference to \cs{linewidth}, etc.
% inside the \acro{PDF} minipage being created here.
% \begin{macrocode}
\setlength{\linewidth}{#4}% the original width
\setlength{\textwidth}{6in}%
\setlength{\textheight}{9in}%
% \end{macrocode}
% |\raggedright| cancels hyphenation, which will be done by \acro{HTML} instead.
% \begin{macrocode}
\LWR@origraggedright%
\let\footnote\LWR@origfootnote%
\let\@makefntext\LWR@makefntext%
\let\@makefnmark\LWR@makefnmark%
% \end{macrocode}
% Resume paragraph tag handling for the contents of the minipage:
% \begin{macrocode}
\LWR@startpars%
\LWR@traceinfo{minipage: finished starting the minipage}%
}
% \end{macrocode}
% End the environment with \LaTeX{} processing and closing tag:
% \begin{macrocode}
{%
\LWR@stoppars%
\LWR@endminipage% The following empty line is required:
\LWR@htmldivclassend{minipage}%
\vspace{1\baselineskip}% required for subcaption
\addtocounter{LWR@minipagedepth}{-1}%
\LWR@startpars%
% \end{macrocode}
% Prevent paragraph tags around horizontal white space
% until the start of the next paragraph:
% \begin{macrocode}
\global\booltrue{LWR@minipagethispar}%
}
% \end{macrocode}
% \end{environment}
%
%
% \subsection{Parbox, makebox, framebox, fbox, raisebox}
%
%
% \begin{macro}{\parbox} \oarg{pos} \oarg{height} \oarg{inner-pos} \marg{width} \marg{text}
%
% A parbox uses the minipage code:
% \begin{macrocode}
\RenewDocumentCommand{\parbox}{O{t} o O{t} m m}
{
\begin{minipage}[#1][#2][#3]{#4}
#5
\end{minipage}
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\makebox} \oarg{width} \oarg{pos} \marg{text}
%
% Width and position are ignored.
% \begin{macrocode}
\RenewDocumentCommand{\makebox}{o o m}{%
\mbox{#3}
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\framebox} \oarg{width} \oarg{pos} \marg{text}
%
% Width and position are ignored.
% \begin{macrocode}
\RenewDocumentCommand{\framebox}{o o m}{%
\fbox{#3}
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\fbox} \marg{text}
% \begin{macrocode}
\let\LWR@origfbox\fbox
%
\renewcommand*{\fbox}[1]{%
\InlineClass{framebox}{#1}%
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\raisebox} \marg{raiselen} \oarg{height} \oarg{depth} \marg{text}
% \begin{macrocode}
\RenewDocumentCommand{\raisebox}{m o o m}{%
#4%
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Direct formatting}
% \label{sec:directformatting}
%
% \limitstext
%
% For high-level block and inline custom CSS classes,
% see \cref{sec:highlevelclasses}.
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\emph} \marg{text}
% \begin{macrocode}
\renewcommand{\emph}[1]{\LWR@htmlspan{em}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\textmd} \marg{text}
% \begin{macrocode}
\renewcommand{\textmd}[1]{\LWR@htmlspan{textmd}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\textbf} \marg{text}
% \begin{macrocode}
\renewcommand{\textbf}[1]{\LWR@htmlspan{b}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\textrm} \marg{text}
% \begin{macrocode}
\renewcommand{\textrm}[1]{\InlineClass{textrm}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\textsf} \marg{text}
% \begin{macrocode}
\renewcommand{\textsf}[1]{\InlineClass{textsf}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\texttt} \marg{text}
% \begin{macrocode}
\renewcommand{\texttt}[1]{\LWR@htmlspan{kbd}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\textup} \marg{text}
% \begin{macrocode}
\renewcommand{\textup}[1]{\LWR@htmlspan{textup}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\textit} \marg{text}
% \begin{macrocode}
\renewcommand{\textit}[1]{\LWR@htmlspan{i}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\textsc} \marg{text}
% \begin{macrocode}
\renewcommand{\textsc}[1]{\InlineClass{textsc}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\textnormal} \marg{text}
% \begin{macrocode}
\renewcommand{\textnormal}[1]{\textmd{\textrm{\textup{#1}}}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\mdseries}
% \begin{macrocode}
\renewcommand*{\mdseries}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\bfseries}
% \begin{macrocode}
\renewcommand*{\bfseries}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\rmfamily}
% \begin{macrocode}
\renewcommand*{\rmfamily}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\sffamily}
% \begin{macrocode}
\renewcommand*{\sffamily}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ttfamily}
% \begin{macrocode}
\renewcommand*{\ttfamily}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\upshape}
% \begin{macrocode}
\renewcommand*{\upshape}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\itshape}
% \begin{macrocode}
\renewcommand*{\itshape}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\scshape}
% \begin{macrocode}
\renewcommand*{\scshape}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\scshape}
% \begin{macrocode}
\renewcommand*{\normalfont}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\sp} \marg{text}
% For \pkg{siunitx}. Must work in math mode.
% \begin{macrocode}
\renewcommand{\sp}[1]{\text{<sup>#1</sup>}{}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\sb} \marg{text}
% For \pkg{siunitx}. Must work in math mode.
% \begin{macrocode}
\renewcommand{\sb}[1]{\text{<sub>#1</sub>}{}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\textsuperscript} \marg{text}
% \begin{macrocode}
\renewcommand{\textsuperscript}[1]{\LWR@htmlspan{sup}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\textsubscript} \marg{text}
% \begin{macrocode}
\renewcommand{\textsubscript}[1]{\LWR@htmlspan{sub}{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\up} \marg{text} Prints superscript.
%
% This is \cs{let} at the beginning of the document in case some other package
% has changed the definition.
% \begin{macrocode}
\AtBeginDocument{\let\up\textsuperscript}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\fup} \marg{text} Prints superscript.
%
% Supports \pkg{fmtcount} package.
%
% This is \cs{let} at the beginning of the document in case some other package
% has changed the definition.
% \begin{macrocode}
\AtBeginDocument{\let\fup\textsuperscript}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\hfill}
% \changes{v0.20}{2016/12/12}{Inserts a \cs{qquad}.}
% \begin{macrocode}
\renewcommand*{\hfill}{\qquad}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\hrulefill}
% \changes{v0.20}{2017/01/19}{Inserts a short rule.}
% \begin{macrocode}
\renewcommand*{\hrulefill}{\rule{1in}{1pt}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\dotfill}
% \changes{v0.20}{2017/01/19}{Inserts an ellipsis.}
% \begin{macrocode}
\renewcommand*{\dotfill}{\dots}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{Skips, spaces, font sizes}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% |\,| must be redefined after |\RequirePackage{printlen}|
% \begin{macrocode}
\let\LWR@origcomma\,
\let\LWR@origtilde~
\let\LWR@origenskip\enskip
\let\LWR@origquad\quad
\let\LWR@origqquad\qquad
\let\LWR@orighspace\hspace
\let\LWR@origrule\rule
% \end{macrocode}
% Direct-formatting space commands become \acro{HTML} entities:
% \begin{macrocode}
\renewcommand*{\,}{\HTMLunicode{202f}} % HTML thin non-breakable space
% \end{macrocode}
% ^^A \renewcommand*{\,}{\HTMLunicode{2009}} % HTML thin wrappable space
% ^^A \renewcommand*{\,}{\HTMLentity{nbsp}} % regular-width non-breakable space
% \begin{macrocode}
\renewcommand*{~}{\HTMLentity{nbsp}}
\renewcommand*{\textellipsis}{\HTMLunicode{2026}}
% \end{macrocode}
% Direct-formatting font sizes are ignored:
% \begin{macrocode}
\let\LWR@orignormalsize\normalsize
\let\LWR@origsmall\small
\let\LWR@origfootnotesize\footnotesize
\let\LWR@origscriptsize\scriptsize
\let\LWR@origtiny\tiny
\let\LWR@origlarge\large
\let\LWR@origLarge\Large
\let\LWR@origLARGE\LARGE
\let\LWR@orighuge\huge
\let\LWR@origHuge\Huge
\renewcommand*{\normalsize}{}
\renewcommand*{\small}{}
\renewcommand*{\footnotesize}{}
\renewcommand*{\scriptsize}{}
\renewcommand*{\tiny}{}
\renewcommand*{\large}{}
\renewcommand*{\Large}{}
\renewcommand*{\LARGE}{}
\renewcommand*{\huge}{}
\renewcommand*{\Huge}{}
\renewcommand*{\onecolumn}{}
\renewcommand{\twocolumn}[1][]{
#1
}
% \end{macrocode}
% \begin{macro}{\newline}
% Uses \acro{HTML} |<br />| tag
% \begin{macrocode}
\newcommand*{\LWR@newlinebr}{\unskip\LWR@htmltag{br /}\LWR@orignewline}%
\let\newline\LWR@newlinebr
% \end{macrocode}
% \end{macro}
% \DescribeMacro{\\} Redefined to \cs{LWR@endofline} or \cs{LWR@tabularendofline}.
%
% \begin{macro}{\LWR@endofline} * \oarg{len}
% \changes{v0.20}{2016/08/20}{Fix: \protect\textbackslash\protect\textbackslash}
%
% |\\| is assigned to \cs{LWR@endofline} at \cs{LWR@LwarpStart}.
%
% Inside |tabular|, |\\| is temporarily changed to \cs{LWR@tabularendofline}.
% \begin{macrocode}
\NewDocumentCommand{\LWR@endofline}{s o}
{%
\newline%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@minipagestartpars}
% \changes{v0.19}{2016/05/31}{Surpresses paragraph tags between minipages.}
% \index{minipage>horizontal space between}
% \index{space>horizontal between minipages}
% \index{horizontal space>between minipages}
% Minipages are often placed side-by-side inside figures, with a bit of
% horizontal space to separate them. Since \acro{HTML} does not allow
% a |div| to be inside a |p|, paragraphs must be turned off during the
% generation of the minipage, then turned on after the minipage is complete.
% When this occurs between side-by-side minipages, |lwarp| correctly
% surpresses the paragraph tags between the minipages, unless some other
% text is between the minipages. Such text forms its own paragraph, resulting
% in text after a minipage to be on its own line. Since people often place
% \DescribeMacro{\hspace}
% \DescribeMacro{\enskip}
% \DescribeMacro{\quad}
% \DescribeMacro{\qquad}
% small horizontal space between minipages, it is desirable to maintain this
% space if possible. |lwarp| tries to do this by remembering that a minipage
% has been seen, in which case paragraph tags are surpressed around
% \cs{hspace}, \cs{enskip}, \cs{quad}, and \cs{qquad} until the end of the paragraph, when
% the closing |p| tag is created.
%
% When a minipage is seen, the boolean
% |LWR@minipagethispar| is set, telling the following horizontal
% whitespace commands to try to surpress their surrounding paragraph
% tags. |LWR@minipagethispar| is cleared at the next
% end of paragraph, when the \acro{HTML} paragraph closing tag is
% generated.
%
% Placed just before \cs{hspace}, \cs{quad}, or \cs{qquad}'s \acro{HTML} output.
% \begin{macrocode}
\newcommand*{\LWR@minipagestartpars}{%
\ifbool{LWR@minipagethispar}%
{%
\LWR@startpars%
}{}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@minipagestoppars}
% Placed just after \cs{hspace}, \cs{quad}, or \cs{qquad}'s \acro{HTML} output.
% \begin{macrocode}
\newcommand*{\LWR@minipagestoppars}{%
\ifbool{LWR@minipagethispar}%
{%
\LWR@stoppars%
}{}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\quad}
% Handles special minipage \& horizontal space interactions.
% \begin{macrocode}
\renewcommand*{\quad}{%
\LWR@minipagestoppars%
\HTMLunicode{2001}%
\LWR@minipagestartpars%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\qquad}
% Handles special minipage \& horizontal space interactions.
% \begin{macrocode}
\renewcommand*{\qquad}{\quad\quad}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\enskip}
% Handles special minipage \& horizontal space interactions.
% \begin{macrocode}
\renewcommand*{\enskip}{%
\LWR@minipagestoppars%
\HTMLunicode{2000}%
\LWR@minipagestartpars%
}
% \end{macrocode}
% \end{macro}
% \DescribeLength{LWR@tempwidth}
% \DescribeLength{LWR@tempheight}
% \DescribeLength{LWR@tempraise}
% Used to compute span width, height, raise for \cs{hspace} and \cs{rule}:
% \begin{macrocode}
\newlength{\LWR@tempwidth}
\newlength{\LWR@tempheight}
\newlength{\LWR@tempraise}
% \end{macrocode}
%
% \begin{macro}{\LWR@hspace} * \marg{length}
%
% Handles special minipage \& horizontal space interactions.
% \changes{v0.18}{2016/05/13}{\cs{hspace} supported}
% \changes{v0.19}{2016/05/29}{Fix: \cs{hspace} length computations}
% \changes{v0.20}{2016/08/22}{Add: Supports HTML thin breakable space}
%
% Prints a span of a given width. Ignores the optional star.
%
% \cs{fill} is zero-width, so |\hspace{\fill}| is ignored.
% \begin{macrocode}
\NewDocumentCommand{\LWR@hspace}{s m}{%
\setlength{\LWR@tempwidth}{#2}%
% \end{macrocode}
% Only if the width is not zero:
% \begin{macrocode}
\ifthenelse{\dimtest{\LWR@tempwidth}{=}{0pt}}{}{%
% \end{macrocode}
% If had a minipage this paragraph, try to inline the
% white space without generating paragraph tags:
% \begin{macrocode}
\LWR@minipagestoppars%
% \end{macrocode}
% Support the HTML thin wrappable space:
% \begin{macrocode}
\ifthenelse{\dimtest{\LWR@tempwidth}{=}{.16667em}}
{%
\HTMLunicode{2009}% thin breakable space
}%
% \end{macrocode}
% Print the span with the converted width. Not rounded.
% \begin{macrocode}
{%
\uselengthunit{PT}%
\LWR@htmltagc{%
span style="width:\printlength{\LWR@tempwidth}; display:inline-block;"%
}%
\LWR@htmltagc{/span}%
}%
% \end{macrocode}
% If had a minipage this paragraph, try to inline the
% white space without generating paragraph tags:
% \begin{macrocode}
\LWR@minipagestartpars%
}%
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\hspace} * \marg{length}
%
% Handles special minipage \& horizontal space interactions.
% \begin{macrocode}
\let\hspace\LWR@hspace
% \end{macrocode}
% \end{macro}
% \begin{macro}{\linebreak} \oarg{num} \qquad
% Inserts an \acro{HTML} |br| tag.
% \begin{macrocode}
\renewcommand*{\linebreak}[1][]{\newline}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\nolinebreak} \oarg{num}
% \begin{macrocode}
\renewcommand*{\nolinebreak}[1][]{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\pagebreak} \oarg{num} \qquad
% Starts a new paragraph.
% \begin{macrocode}
\renewcommand*{\pagebreak}[1][]{
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\nopagebreak} \oarg{num}
% \begin{macrocode}
\renewcommand*{\nopagebreak}[1][]{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\enlargethispage} * \marg{len}
% \begin{macrocode}
\RenewDocumentCommand{\enlargethispage}{s m}{}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LWR@rule} \oarg{raise} \marg{width} \marg{height}
%
% Handles special minipage \& horizontal space interactions.
%
% Creates a span of a given width and height. Ignores the optional star.
%
% \cs{fill} is zero-width, so |\hspace{\fill}| is ignored.
% \begin{macrocode}
\NewDocumentCommand{\LWR@rule}{o m m}{%
% \end{macrocode}
% The width is copied into a temporary \LaTeX\ length, from which
% comparisons and conversions may be made:
% \begin{macrocode}
\setlength{\LWR@tempwidth}{#2}%
% \end{macrocode}
% If it's zero-width then skip the entire rule:
% \begin{macrocode}
\ifthenelse{\lengthtest{\LWR@tempwidth=0pt}}
{}% zero- width
{% non-zero width
% \end{macrocode}
% If it's non-zero width, set a minimal thickness so that it
% more reliably shows in the browser:
% \begin{macrocode}
\ifthenelse{\lengthtest{\LWR@tempwidth>0pt}\AND%
\lengthtest{\LWR@tempwidth<1pt}}%
{\setlength{\LWR@tempwidth}{1pt}}{}%
% \end{macrocode}
% Likewise with height:
% \begin{macrocode}
\setlength{\LWR@tempheight}{#3}%
\ifthenelse{\lengthtest{\LWR@tempheight>0pt}\AND%
\lengthtest{\LWR@tempheight<1pt}}%
{\setlength{\LWR@tempheight}{1pt}}{}%
% \end{macrocode}
% If had a minipage this paragraph, try to inline the
% rule without generating paragraph tags:
% \begin{macrocode}
\LWR@minipagestoppars%
% \end{macrocode}
% Print the span with the converted width and height.
% The width and height are NOT rounded, since a height of
% less than 1pt is quite common in \LaTeX\ code.
% \begin{macrocode}
\uselengthunit{PT}%
\LWR@htmltagc{%
span
style=" %
% \end{macrocode}
% The background color is used to draw the filled rule.
% The color may be changed by \cs{textcolor}.
% \begin{macrocode}
background:\LWR@currenttextcolor; %
% \end{macrocode}
% The width and height are printed, converted to PT:
% \begin{macrocode}
width:\printlength{\LWR@tempwidth}; %
height:\printlength{\LWR@tempheight}; %
% \end{macrocode}
% The raise height is converted to a \acro{CSS} transform.
% The |*2| raise multiplier is to approximately match \acro{HTML} output's X height.
% Conversion to a \LaTeX\ length allows a typical \LaTeX\ expression to be
% used as an argument for the raise, whereas printing the raise argument
% directly to \acro{HTML} output without conversion to a \LaTeX\ length
% limits the allowable syntax. To do:\ A superior method would compute a
% ratio of \LaTeX\ ex height, then print that to \acro{HTML} with an ex unit.
% \begin{macrocode}
\IfValueTF{#1}%
{%
\setlength{\LWR@tempraise}{0pt-#1}%
\setlength{\LWR@tempraise}{\LWR@tempraise*2}%
\LWR@orignewline%
-ms-transform: translate(0pt,\printlength{\LWR@tempraise}); %
\LWR@orignewline%
-webkit-transform: translate(0pt,\printlength{\LWR@tempraise}); %
\LWR@orignewline%
transform: translate(0pt,\printlength{\LWR@tempraise}); %
\LWR@orignewline%
}{}%
% \end{macrocode}
% Display inline-block to place the span inline with the text:
% \begin{macrocode}
display:inline-block;"%
}%
\LWR@htmltagc{/span}%
% \end{macrocode}
% If had a minipage this paragraph, try to inline the
% white space without generating paragraph tags:
% \begin{macrocode}
\LWR@minipagestartpars%
}% non-zero width
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\rule} \oarg{raise} \marg{width} \marg{height}
% \changes{v0.19}{2016/06/01}{Added}
%
% Handles special minipage \& horizontal space interactions.
% \begin{macrocode}
\let\rule\LWR@rule
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{\textbackslash{}phantomsection}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\phantomsection}
% Emulate the hyperref |\phantomsection| command,
% often used to insert the bibliography into table of contents:
% \begin{macrocode}
\newcommand*{\phantomsection}{\section*{}}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \section{\textbackslash{}LaTeX and other logos}
% Logos for \acro{HTML} and print modes:
%
% Some of these logos may be redefined in a later package,
% so after loading other packages, and at the beginning of the document, their definitions
% are finally |\let| in |\LWR@LwarpStart|.
%
% For \acro{CSS} conversions, see: \\
% \url{http://edward.oconnor.cx/2007/08/tex-poshlet} \\
% \url{http://nitens.org/taraborelli/texlogo}
%
%
%
% \subsection{HTML logos}
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\TeX} \TeX
% \nopagebreak
%
% |latexlogo| is a \acro{CSS} class used to properly typeset the E and A in \LaTeX{} and friends.
%
% |latexlogofont| is a \acro{CSS} class used to select the font for the rest of the logo in
% \LaTeX, \LuaTeX, \ConTeXt, etc.
% \begin{macrocode}
\newcommand*{\LWR@TeX}
{\InlineClass{latexlogofont}%
{\InlineClass{latexlogo}{T\textsubscript{e}X}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LaTeX}
% \begin{macro}{\LaTeXe} \LaTeX, \LaTeXe
% \begin{macrocode}
\newcommand*{\LWR@LaTeX}
{\InlineClass{latexlogofont}%
{\InlineClass{latexlogo}%
{L\textsuperscript{a}T\textsubscript{e}X}}}
\renewcommand*{\LaTeXe}
{\LaTeX\InlineClass{latexlogofont}%
{\,2\textsubscript{\textit{\HTMLunicode{3B5}}}}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\LuaTeX}
% \begin{macro}{\LuaLaTeX} \LuaTeX, \LuaLaTeX
% \begin{macrocode}
\newcommand*{\LWR@LuaTeX}{\InlineClass{latexlogofont}{Lua}\TeX}
\newcommand*{\LWR@LuaLaTeX}{\InlineClass{latexlogofont}{Lua}\LaTeX}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\XeTeX}
% \begin{macro}{\XeLaTeX} \XeTeX, \XeLaTeX
% \nopagebreak
%
% |xetexlogo| is a \acro{CSS} class which aligns the backwards E in \XeTeX{} and spaces \TeX{}
% appropriately.
%
% |xelatexlogo| is a \acro{CSS} class which aligns the backwards E in \XeLaTeX{} and spaces
% \LaTeX{} appropriately.
% \begin{macrocode}
\newcommand*{\Xe}
{X\textsubscript{\HTMLunicode{18e}}}
\newcommand*{\LWR@XeTeX}{\InlineClass{xetexlogo}{\Xe}\TeX}
\newcommand*{\LWR@XeLaTeX}{\InlineClass{xelatexlogo}{\Xe}\LaTeX}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\ConTeXt} \ConTeXt
% \begin{macrocode}
\newcommand*{\LWR@ConTeXt}
{\InlineClass{latexlogofont}{Con}\TeX{}%
\InlineClass{latexlogofont}{t}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\BibTeX}
% \begin{macro}{\MakeIndex} \BibTeX, \MakeIndex
% \begin{macrocode}
\providecommand*{\BibTeX}
{\InlineClass{latexlogofont}{B\textsc{ib}}\TeX}
\newcommand*{\MakeIndex}
{\InlineClass{latexlogofont}{\textit{MakeIndex}}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\AmS} \AmS
% \nopagebreak
%
% |amslogo| is a \acro{CSS} class used for the \AmS logo.
% \begin{macrocode}
\AtBeginDocument{\DeclareDocumentCommand{\AmS}{}
{\InlineClass{amslogo}{\textit{A\textsubscript{M}S}}}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\MiKTeX} \MiKTeX
% \begin{macrocode}
\newcommand*{\MiKTeX}{\InlineClass{latexlogofont}{MiK}\TeX}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\LyX} \LyX
% \nopagebreak
%
% |lyxlogo| is a \acro{CSS} class used for the \LyX logo.
% \begin{macrocode}
\newcommand*{\LyX}{\InlineClass{lyxlogo}{LyX}}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
%
% \subsection{Print logos}
%
% \codeprint
% \begin{macrocode}
\begin{warpprint}
\newcommand*{\XeTeXrevE}
{\hspace{-.1667em}\raisebox{-.5ex}{\reflectbox{E}}\hspace{-.125em}}
\providecommand*{\XeTeX}{\mbox{X\XeTeXrevE\TeX}}
\providecommand*{\XeLaTeX}{\mbox{X\XeTeXrevE\LaTeX}}
\providecommand*{\AmS}{%
\leavevmode\hbox{$\mathcal A\kern-.2em\lower.376ex%
\hbox{$\mathcal M$}\kern-.2em\mathcal S$}}
\newcommand*{\LyX}{\textsf{LyX}}
\providecommand*{\LuaTeX}{\mbox{Lua\TeX}}
\providecommand*{\LuaLaTeX}{\mbox{Lua\LaTeX}}
\providecommand*{\BibTeX}{\mbox{B\textsc{ib}\TeX}}
\providecommand*{\MakeIndex}{\mbox{\textit{MakeIndex}}}
\providecommand*{\ConTeXt}{\mbox{Con\TeX{}t}}
\providecommand*{\MiKTeX}{\mbox{MiK\TeX}}
\end{warpprint}
% \end{macrocode}
% \section{\textbackslash{}AtBeginDocument, \textbackslash{}AtEndDocument}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macro}{\LWR@LwarpStart}
% \begin{macro}{\LWR@LwarpEnd}
% Automatically sets up the \acro{HTML}-related actions for the start and end of the
% document.
% \begin{macrocode}
\AfterEndPreamble{\LWR@LwarpStart}
\AtEndDocument{\LWR@LwarpEnd}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \clearpage
% \section{lwarpmk.conf}
% \DescribeFile{lwarpmk.conf}
% |lwarpmk.conf| is automatically (re-)created by the \pkg{lwarp} package when
% executing\\
% \hspace*{2ex} |pdflatex <project.tex>|,\\
% or similar for |xelatex| or |lualatex|, in print-document generation mode,
% which is the default unless the |warpHTML| option is given.
% |lwarpmk.conf| is then used by the utility |lwarpmk|.
%
% An example |lwarpmk.conf|:
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4,formatcom={\unskip}]
% opsystem = "Unix" -- or "Windows"
% latexname = "pdflatex" -- or "lualatex" or "xelatex"
% sourcename = "projectname" -- your .tex source
% homehtmlfilename = "index" -- or "projectname"
% htmlfilename = "" -- or "projectname" if numbered HTML files
% \end{Verbatim}
%
% Defaults unless already over-ridden by the user:
% \begin{macrocode}
\providecommand*{\HomeHTMLFileName}{\BaseJobname}
\providecommand*{\HTMLFileName}{}
\providecommand*{\UseLatexmk}{false}
% \end{macrocode}
% \codeprint
% \begin{macrocode}
\begin{warpprint}
\ifcsdef{LWR@file}{}{\newwrite{\LWR@file}}
\immediate\openout\LWR@file=lwarpmk.conf
\ifwindows
\immediate\write\LWR@file{opsystem = "Windows"}
\else
\immediate\write\LWR@file{opsystem = "Unix"}
\fi
\ifPDFTeX
\immediate\write\LWR@file{latexname = "pdflatex"}
\fi
\ifXeTeX
\immediate\write\LWR@file{latexname = "xelatex"}
\fi
\ifLuaTeX
\immediate\write\LWR@file{latexname = "lualatex"}
\fi
\immediate\write\LWR@file{sourcename = "\jobname"}
\immediate\write\LWR@file{%
homehtmlfilename = "\HomeHTMLFileName"%
}
\immediate\write\LWR@file{htmlfilename = "\HTMLFileName"}
\immediate\write\LWR@file{uselatexmk = "\UseLatexmk"}
\immediate\closeout\LWR@file
\end{warpprint}
% \end{macrocode}
% \clearpage
% \section{Trademarks}
%
% \changes{v0.14}{2016/03/29}{Docs: Trademarks section.}
%
% \begin{itemize}
% \item Adobe® and Adobe Framemaker® are either registered trademarks or
% trademarks of Adobe Systems Incorporated in the United States and/or other countries.
% \item Linux® is the registered trademark of Linus Torvalds in the U.S.\ and other countries.
% \item Mac\,OS® is a trademark of Apple Inc.
% \item MadCap Flare™ is the property of MadCap Software, Inc.
% \item MathJax is copyright 2009 and later.
% The MathJax Consortium is a joint venture of the American Mathematical Society (AMS)
% and the Society for Industrial and Applied Mathematics (SIAM)
% to advance mathematical and scientific content on the web.
% \item Microsoft®, Encarta, MSN, and Windows® are either registered trademarks or
% trademarks of Microsoft Corporation in the United States and/or other countries.
% \item UNIX® is a registered trademark of The Open Group.
% \end{itemize}
% \iffalse
%</package>
% \fi
% \clearpage
% \iffalse
%<*lwarp-newproject>
% \fi
% \part{lwarp-newproject.sty}
%
% \changes{v0.20}{2016/12/20}{\pkg{lwarp-newproject}: Added.}
%
% \section{lwarp-newproject}
%
% \DescribePackage{lwarp-newproject}
% \pkg{lwarp-newproject} is used to create lwarp-specific
% system files in a new project.
%
% \DescribeOption[lwarp-newproject]{warpprint} Configuration files are only
% created if the |warpprint| option was used. When this is the case,
% \pkg{lwarp-newproject} knows that \cs{jobname} is the source code's filename
% (as opposed to the |<project>_html.tex| filename).
%
% \DescribeOption[lwarp-newproject]{warpHTML} Does not create configuration files.
% |warpprint| or |warpHTML| are passed to both \pkg{lwarp} and
% \pkg{lwarp-newproject} by |lwarpmk|, depending on whether |lwarpmk print|
% or |lwarpmk html| was used.
%
% \DescribeOption[lwarp-newproject]{BaseJobName} |BaseJobname=somename| sets
% \cs{BaseJobname} to |somename|, which is used to set \cs{HomeHTMLFileName},
% which is then written to the |lwarpmk.conf| and |<project>.lwarpmkconf|
% configuration files.
%
% \cs{BaseJobname} is also written to |<project>_html.tex| as an option
% given for the \pkg{lwarp} and \pkg{lwarp-newproject} packages during the
% creation of \acro{HTML} output.
%
% \cs{BaseJobname} is the \cs{jobname} of the printed version, even while compiling
% the \acro{HTML} version, where \cs{jobname} has |_html| appended.
%
% \DescribeOption[lwarp-newproject]{lwarpmk} Tells |lwarp-newproject| to
% generate a local copy of |lwarpmk| called |lwarpmk.lua|.
% Useful for archiving for future use.
% This file may be made executable and acts just like |lwarpmk|.
%
% In the document source:
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4,formatcom={\unskip}]
% \documentclass{article} % or book, report
% ...
% (font selection, input encoding)
% ...
% \newcommand*{\HomeHTMLFileName}{index}, or {projectname}
% \newcommand*{\HTMLFileName}{}
% \usepackage{lwarp-newproject}
% \usepackage{lwarp}
% ...
% (load other packages, the rest of the preamble)
% ...
% \NewCSS{project.css}
% \NewHTMLdescription{Summarize this webpage.}
% ...
% \begin{document}
% ...
% \end{document}
% \end{Verbatim}
%
% Place |\usepackage{lwarp-newproject}| just before |\usepackage{lwarp}| in the
% document source. The operating system and \TeX\ engine will be auto-detected,
% and a customized |lwarpmk.conf| file will be generated, along with
% the other support files (|*.css|, |lwarp_html.xdy|, |lwarp_mathjax.txt|).
% Rename |sample_project.css| to your own custom |projectname.css| and
% edit it if desired.
%
% After the first compile, |\usepackage{lwarp-newproject}|
% may be commented out unless the configuration changes.
% For example, it may be re-enabled
% to switch between |pdflatex|, |xelatex|, and |lualatex|, in which case
% a new manual compile (without using |lwarpmk|) will auto-configure and
% regenerate the files. It may also be left enabled at all times, in which case
% the configuration files will be regenerated each time. Note that your own
% |projectname.css| file will not be over-written by the newly regenerated
% |sample_project.css|.
%
% Discard all options for \pkg{lwarp-newproject}:
% \begin{macrocode}
\ProvidesPackage{lwarp-newproject}
\RequirePackage{etoolbox}
\RequirePackage{comment}
\RequirePackage{fancyvrb}
\RequirePackage{ifplatform}% sense op-system platform
\RequirePackage{iftex}% sense pdflatex/lualatex/xelatex
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=LWRNP,prefix=LWRNP@}
% \end{macrocode}
% Generate config files?
% \begin{macrocode}
\newbool{LWRNP@genconf}
\boolfalse{LWRNP@genconf}
% \end{macrocode}
% Optionally generate a local copy of |lwarpmk|. Default to no:
% \begin{macrocode}
\excludecomment{LWR@createlwarpmk}
% \end{macrocode}
% Process options:
% \begin{macrocode}
\DeclareVoidOption{warpprint}{\booltrue{LWRNP@genconf}}
\DeclareVoidOption{warpHTML}{\boolfalse{LWRNP@genconf}}
\DeclareVoidOption{lwarpmk}{\includecomment{LWR@createlwarpmk}}
\DeclareStringOption[\jobname]{BaseJobname}
\booltrue{LWRNP@genconf}% warpprint
\ProcessKeyvalOptions*\relax
% \end{macrocode}
% Assign the \cs{BaseJobname} if the user hasn't provided one:
% \begin{macrocode}
\providecommand*{\BaseJobname}{\LWRNP@BaseJobname}
% \end{macrocode}
% Defaults unless already over-ridden by the user:
% \begin{macrocode}
% \ifbool{LWRNP@genconf}{
\providecommand*{\HomeHTMLFileName}{\BaseJobname}
% }{}
\providecommand*{\HTMLFileName}{}
\providecommand*{\UseLatexmk}{false}
% \end{macrocode}
%
%
\ifbool{LWRNP@genconf}{\typeout{lwarp-newproject: generating configuration files}}{}
% \subsection{project\_html.tex}
%
% \DescribeFile{project_html.tex} Used to allow an \acro{HTML} version of the
% document to exist alongside the print version.
%
% Only write |\jobname_html.tex| if generating the print version.
% \begin{macrocode}
\ifbool{LWRNP@genconf}{
\ifcsdef{LWR@file}{}{\newwrite{\LWR@file}}
\immediate\openout\LWR@file=\jobname_html.tex
\immediate\write\LWR@file{%
\detokenize{\PassOptionsToPackage}%
{warpHTML,BaseJobname=\jobname}{lwarp}%
}
\immediate\write\LWR@file{%
\detokenize{\PassOptionsToPackage}%
{warpHTML,BaseJobname=\jobname}{lwarp-newproject}%
}
\immediate\write\LWR@file{%
\detokenize{\input}\string{\jobname.tex\string }%
}
\immediate\closeout\LWR@file
}{}
% \end{macrocode}
% \subsection{project.lwarpmkconf}
%
% \DescribeFile{project.lwarpmkconf} The configuration file for |lwarpmk|.
%
%
% \begin{macrocode}
\ifbool{LWRNP@genconf}{
\ifcsdef{LWR@file}{}{\newwrite{\LWR@file}}
\immediate\openout\LWR@file=\jobname.lwarpmkconf
\ifwindows
\immediate\write\LWR@file{opsystem = "Windows"}
\else
\immediate\write\LWR@file{opsystem = "Unix"}
\fi
\ifPDFTeX
\immediate\write\LWR@file{latexname = "pdflatex"}
\fi
\ifXeTeX
\immediate\write\LWR@file{latexname = "xelatex"}
\fi
\ifLuaTeX
\immediate\write\LWR@file{latexname = "lualatex"}
\fi
\immediate\write\LWR@file{sourcename = "\jobname"}
\immediate\write\LWR@file{%
homehtmlfilename = "\HomeHTMLFileName"%
}
\immediate\write\LWR@file{htmlfilename = "\HTMLFileName"}
\immediate\write\LWR@file{uselatexmk = "\UseLatexmk"}
\immediate\closeout\LWR@file
}{}
% \end{macrocode}
% \subsection{lwarp.css}
% \DescribeFile{lwarp.css}
% This is the base \acro{css} layer used by \pkg{lwarp}.
%
% This must be present both when compiling the project
% and also when distributing the \acro{HTML} files.
%
% \begin{macrocode}
\begin{VerbatimOut}{lwarp.css}
/*
CSS stylesheet for the LaTeX lwarp package
Copyright 2016 Brian Dunn — BD Tech Concepts LLC
*/
/* a fix for older browsers: */
header, section, footer, aside, nav, main,
article, figure { display: block; }
A:link {color:#000080 ; text-decoration: none ; }
A:visited {color:#800000 ; }
A:hover {color:#000080 ; text-decoration: underline ;}
A:active {color:#800000 ; }
a.tocpart {display: inline-block ; margin-left: 0em ;
font-weight: bold ;}
a.tocchapter {display: inline-block ; margin-left: 0em ;
font-weight: bold ;}
a.tocsection {display: inline-block ; margin-left: 1em ;
text-indent: -.5em ; font-weight: bold ; }
a.tocsubsection {display: inline-block ; margin-left: 2em ;
text-indent: -.5em ; }
a.tocsubsubsection {display: inline-block ; margin-left: 3em ;
text-indent: -.5em ; }
a.tocparagraph {display: inline-block ; margin-left: 4em ;
text-indent: -.5em ; }
a.tocsubparagraph {display: inline-block ; margin-left: 5em ;
text-indent: -.5em ; }
a.tocfigure {margin-left: 0em}
a.tocsubfigure {margin-left: 2em}
a.toctable {margin-left: 0em}
a.tocsubtable {margin-left: 2em}
a.toclstlisting {margin-left: 0em}
body {
font-family: "DejaVu Serif", "Bitstream Vera Serif",
"Lucida Bright", Georgia, serif;
background: #FAF7F4 ;
color: black ;
margin:0em ;
padding:0em ;
font-size: 100% ;
line-height: 1.2 ;
}
p {margin: 1.5ex 0em 1.5ex 0em ;}
/* Holds a section number to add space between it and the name */
span.sectionnumber { margin-right: .6em }
/* Inserted in front of index lines */
span.indexitem {margin-left: 0em}
span.indexsubitem {margin-left: 2em}
span.indexsubsubitem {margin-left: 4em}
div.hidden { display: none ; }
kbd {
font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console",
"Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono",
"Courier New", monospace;
font-size: 100% ;
}
span.strong { font-weight: bold; }
span.textmd { font-weight: normal; }
span.textsc { font-variant: small-caps; }
span.textup { font-variant: normal; }
span.textrm {
font-family: "DejaVu Serif", "Bitstream Vera Serif",
"Lucida Bright", Georgia, serif;
}
span.textsf {
font-family: "DejaVu Sans", "Bitstream Vera Sans",
Geneva, Verdana, sans-serif ;
}
span.attribution {
margin-left: 1em ; font-size: 80% ; font-variant: small-caps;
}
span.citetitle {
margin-left: 1em ; font-size: 80% ; font-style: oblique;
}
span.poemtitle {
font-size: 120% ; font-weight: bold;
}
blockquote {
margin-left: 0px ;
margin-right: 0px ;
}
blockquote p {
line-height: 1.5;
text-align: left ;
font-size: .85em ;
margin-left: 3em ;
margin-right: 3em ;
}
blockquotation {
margin-left: 0px ;
margin-right: 0px ;
}
blockquotation p {
line-height: 1.5;
text-align: left ;
font-size: .85em ;
margin-left: 3em ;
margin-right: 3em ;
}
div.epigraph {
line-height: 1.2;
text-align: left ;
padding: 3ex 1em 0ex 1em ;
/* margin: 3ex auto 3ex auto ; */ /* Epigraph centered */
margin: 3ex 1em 3ex auto ; /* Epigraph to the right */
/* margin: 3ex 1em 3ex 1em ; */ /* Epigraph to the left */
font-size: .85em ;
max-width: 27em ;
}
div.epigraphsource{
text-align:right ;
margin-left:auto ;
/* max-width: 50% ; */
border-top: 1px solid #A0A0A0 ;
padding-bottom: 3ex ;
line-height: 1.2;
}
div.epigraph p { padding: .5ex ; margin: 0ex ;}
div.epigraphsource p { padding: .5ex 0ex 0ex 0ex ; margin: 0ex ;}
html body {
margin: 0 ;
line-height: 1.2;
}
body div {
margin: 0ex;
}
h1, h2, h3, h4, h5, h6, span.paragraph, span.subparagraph
{
font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
"Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
"Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times,
"Times New Roman", serif;
font-style: normal ;
font-weight: bold ;
text-align: left ;
}
h1 { /* title of the entire website, used on each page */
text-align: center ;
font-size: 2.5em ;
padding: .4ex 0em 0ex 0em ;
}
h2 { font-size: 2.25em }
h3 { font-size: 2em }
h4 { font-size: 1.75em }
h5 { font-size: 1.5em }
h6 { font-size: 1.25em }
span.paragraph {font-size: 1em ; font-variant: normal ;
margin-right: 1em ; }
span.subparagraph {font-size: 1em ; font-variant: normal ;
margin-right: 1em ; }
/* Title of the file */
h1 {
margin: 0ex 0em 0ex 0em ;
line-height: 1.3;
text-align: center ;
}
/* Part */
h2 {
margin: 1ex 0em 1ex 0em ;
line-height: 1.3;
text-align: center ;
}
/* Chapter */
h3 {
margin: 3ex 0em 1ex 0em ;
line-height: 1.3;
}
/* Section */
h4 {
margin: 3ex 0em 1ex 0em ;
line-height: 1.3;
}
/* Sub-Section */
h5 {
margin: 3ex 0em 1ex 0em ;
line-height: 1.3;
}
/* Sub-Sub-Section */
h6 {
margin: 3ex 0em 1ex 0em ;
line-height: 1.3;
}
div.titlepage {
text-align: center ;
}
.footnotes {
font-size: .85em ;
margin: 3ex 1em 0ex 1em ;
padding-bottom: 1ex ;
}
.marginpar {
width:20%; float:right;
text-align:left;
margin: 1ex 0.5em 1ex 1em ;
padding: 1ex 0.5em 1ex 0.5em ;
font-size: 85% ;
border-top: 1px solid silver ;
border-bottom: 1px solid silver ;
overflow-x: auto;
}
.marginpar br { margin-bottom: 2ex ; }
div.marginblock {
width:50%; float:right;
text-align:left;
margin: 1ex 0.5em 1ex 1em ;
padding: 1ex 0.5em 1ex 0.5em ;
overflow-x: auto;
}
div.marginblock div.minipage p { font-size: 85%}
div.marginblock br { margin-bottom: 2ex ; }
section.textbody div.footnotes{
margin: 3ex 0em 0ex 0em ;
border-bottom: 2px solid silver ;
}
.footnoteheader {
border-top: 2px solid silver ;
margin-top: 3ex ;
padding-top: 1ex ;
font-weight: bold ;
}
.mpfootnotes {
text-align: left ;
font-size: .85em ;
margin: 3ex 0em 3ex 0em ;
border-top: 1px solid silver ;
border-bottom: 1px solid silver ;
/* padding-top: 1ex ; */
}
/* Remove footnote top border in the title page. */
div.titlepage div.mpfootnotes {
border-top: none ;
}
ol {
margin: 1ex 1em 1ex 0em;
line-height: 1.2;
}
ul, body dir, body menu {
margin: 1ex 1em 1ex 0em;
line-height: 1.2;
}
li { margin: 0ex 0em 1ex 0em; }
html {
margin: 0;
padding: 0;
}
.programlisting {
font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console",
"Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono",
"Courier New", monospace;
margin: 1ex 0ex 1ex 0ex ;
padding: .5ex 0pt .5ex 0pt ;
overflow-x: auto;
}
section.textbody>pre.programlisting {
border-top: 1px solid silver ;
border-bottom: 1px solid silver ;
}
.inlineprogramlisting {
font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console",
"Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono",
"Courier New", monospace;
overflow-x: auto;
}
div.abstract {
margin: 2em 5% 2em 5% ;
padding: 1ex 1em 1ex 1em ;
/* font-weight: bold ; */
font-size: 90% ;
}
div.abstract dl {line-height:1.5;}
div.abstract dt {color:#304070;}
div.abstracttitle{
font-family: "URW Classico", Optima, "Linux Biolinum O",
"Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L",
"FreeSerif", "Hoefler Text", Times, "Times New Roman", serif;
font-weight:bold;
font-size:1.25em;
text-align: center ;
}
.verbatim {
overflow-x: auto ;
}
.alltt {
overflow-x: auto ;
}
.bverbatim {
margin: 1ex 0pt 1ex 0pt ;
padding: .5ex 0pt .5ex 0pt ;
overflow-x: auto ;
}
.lverbatim {
margin: 1ex 0pt 1ex 0pt ;
padding: .5ex 0pt .5ex 0pt ;
overflow-x: auto ;
}
.fancyvrb {
font-size:.85em ;
margin: 3ex 0pt 3ex 0pt
}
.fancyvrblabel {
font-weight:bold;
text-align: center ;
}
.verse {
font-family: "Linux Libertine Mono O", "Lucida Console",
"Droid Sans Mono", "DejaVu Mono", "Bitstream Vera Mono",
"Liberation Mono", "FreeMono", "Andale Mono",
"Nimbus Mono L", "Courier New", monospace;
margin-left: 1em ;
}
div.singlespace { line-height: 1.2 ; }
div.onehalfspace { line-height: 1.5 ; }
div.doublespace { line-height: 2 ; }
.theorem {
background: #e0e0e0;
padding: 1ex ;
margin: 1em ;
border: 1px solid silver ;
}
.theoremlabel { font-weight: bold ; }
.theoremcontents { font-style: italic; margin-left: 1em ; }
/* Minipage environments, vertically aligned to top, center, bottom: */
.minipage {
/* display: inline-block ; */
/* Mini pages which follow each other will be tiled. */
margin: .25em .25em .25em .25em;
padding: .25em .25em .25em .25em;
display: inline-flex;
flex-direction: column ;
overflow: auto;
}
/* Paragraphs in the flexbox did not collapse their margins. */
/* Have not yet researched this. */
.minipage p {margin: .75ex 0em .75ex 0em ;}
.framebox {
margin: 0ex ;
padding: 0ex ;
border: 1px solid black;
border-radius: 0px ;
padding: .3ex .2em 0ex .2em ;
margin: .1ex ;
display: inline-block ;
}
.mdframed {
/* padding: 0ex ; */
/* border: 1px solid blafck; */
/* border-radius: 0px ; */
padding: 0ex ;
margin: 3ex 5% 3ex 5% ;
/* display: inline-block ; */
}
.mdframed p { padding: 0ex .5em 0ex .5em ; }
.mdframed dl { padding: 0ex .5em 0ex .5em ; }
.mdframedtitle {
padding: .5em ;
display: block ;
font-size: 130%
}
.mdframedsubtitle {
padding: 0ex .5em 0ex .5em ;
display: block ;
font-size: 115% ;
}
.mdframedsubsubtitle {
padding: 0ex .5em 0ex .5em ;
display: block ;
}
.mdtheorem {
padding: 0ex .5em 0ex .5em ;
margin: 3ex 5% 3ex 5% ;
/* display: inline-block ; */
}
dl {
margin: 1ex 2em 1ex 0em;
line-height: 1.3;
}
dl dt {
margin-top: 1ex;
font-weight: bold;
}
dl dd p { margin-top: 0em; }
nav.toc, nav.lof, nav.lot, nav.lol {
font-family: "URW Classico", Optima, "Linux Biolinum O",
"DejaVu Sans", "Bitstream Vera Sans",
Geneva, Verdana, sans-serif ;
margin-bottom: 4ex ;
}
nav.toc p, nav.lof p, nav.lot p, nav.lol p {
line-height: 1.2 ;
margin-top:.5ex ;
margin-bottom:.5ex;
font-size: .9em ;
}
img, img.hyperimage, img.borderimage {
max-width: 600px;
border: 1px solid silver;
box-shadow: 3px 3px 3px #808080 ;
padding: .5% ;
margin: .5% ;
background: none ;
}
img.inlineimage{
padding: 0px ;
box-shadow: none ;
border: none ;
background: none ;
margin: 0px ;
display: inline-block ;
border-radius: 0px ;
}
img.logoimage{
max-width: 300px ;
box-shadow: 3px 3px 3px #808080 ;
border: 1px solid black ;
background:none ;
padding:0 ;
margin:.5ex ;
border-radius: 10px ;
}
.section {
/*
To have each section float relative to each other:
*/
/*
display: block ;
float: left ;
position: relative ;
background: white ;
border: 1px solid silver ;
padding: .5em ;
*/
margin: 0ex .5em 0ex .5em ;
padding: 0 ;
}
figure {
margin: 3ex auto 3ex auto ;
padding: 1ex 1em 1ex 1em ;
overflow-x: auto ;
}
/* To automatically center images in figures: */
/*
figure img.inlineimage {
margin: 0ex auto 0ex auto ;
display: block ;
}
*/
/* To automatically center minipages in figures: */
/*
figure div.minipage, figure div.minipage div.minipage {
margin: 1ex auto 1ex auto ;
display: block ;
}
*/
figure div.minipage p { font-size: 85% ; }
figure.subfigure, figure.subtable {
display: inline-block ; margin: 3ex 1em 3ex 1em ;
}
div.floatrow { text-align: center; }
div.floatrow figure { display: inline-block ; margin: 1ex 2% ; }
div.floatfoot { font-size: .85em ;
border-top: 1px solid silver ; line-height: 1.2 ; }
figcaption , .lstlistingtitle {
font-size: .85em ;
text-align: center ;
font-weight: bold ;
margin-top: 1ex ;
margin-bottom: 1ex ;
}
figure.subfigure figcaption, figure.subtable figcaption {
border-bottom: none ; background: none ;
}
div.nonfloatcaption {
margin: 1ex auto 1ex auto ;
font-size: .85em ;
text-align: center ;
font-weight: bold ;
}
/* For a \RawCaption inside a minipage inside a figure's floatrow: */
figure div.floatrow div.minipage figcaption {
border: none ;
background: none ;
}
table {
margin: 1ex auto 1ex auto ;
border-collapse: collapse ;
border-spacing: 0px ;
line-height: 1.3 ;
}
tr.hline {border-top: 1px solid silver ; margin-top: 0ex ;
margin-bottom: 0ex ; } /* for \hline */
tr.tbrule {border-top: 1px solid black ; margin-top: 0ex ;
margin-bottom: 0ex ; } /* for \toprule, \bottomrule */
td {padding: 1ex .5em 1ex .5em ;}
table td.tdl { text-align: left ; vertical-align: middle ; }
table td.tdc { text-align: center ; vertical-align: middle ; }
table td.tdr { text-align: right ; vertical-align: middle ; }
table td.tdp { text-align: left ; vertical-align: bottom ; }
table td.tdm { text-align: left ; vertical-align: middle ; }
table td.tdb { text-align: left ; vertical-align: top ; }
table td.tdP { text-align: center ; vertical-align: bottom ; }
table td.tdM { text-align: center ; vertical-align: middle ; }
table td.tdB { text-align: center ; vertical-align: top ; }
table td.tdlrule { text-align: left ; border-top: 1px solid silver ;
vertical-align: middle ; } /* for cmidrule */
table td.tdcrule { text-align: center ; border-top: 1px solid silver ;
vertical-align: middle ; }
table td.tdrrule { text-align: right ; border-top: 1px solid silver ;
vertical-align: middle ; }
table td.tdprule { text-align: left ; border-top: 1px solid silver ;
vertical-align: bottom ; }
table td.tdmrule { text-align: left ; border-top: 1px solid silver ;
vertical-align: middle ; }
table td.tdbrule { text-align: left ; border-top: 1px solid silver ;
vertical-align: top ; }
table td.tdPrule { text-align: center ; border-top: 1px solid silver ;
vertical-align: bottom ; }
table td.tdMrule { text-align: center ; border-top: 1px solid silver ;
vertical-align: middle ; }
table td.tdBrule { text-align: center ; border-top: 1px solid silver ;
vertical-align: top ; }
/* Margins of paragraphs inside table cells: */
td.tdp p , td.tdprule p , td.tdP p , td.tdPrule p { padding-top: 1ex ;
padding-bottom: 1ex ; margin: 0ex ; }
td.tdm p , td.tmbrule p , td.tdM p , td.tdMrule p { padding-top: 1ex ;
padding-bottom: 1ex ; margin: 0ex ; }
td.tdb p , td.tdbrule p , td.tdB p , td.tdBrule p { padding-top: 1ex ;
padding-bottom: 1ex ; margin: 0ex ; }
td.tdp , td.tdprule , td.tdP , td.tdPrule
{ padding: 0ex .5em 0ex .5em ; }
td.tdm , td.tdmrule , td.tdM , td.tdMrule
{ padding: 0ex .5em 0ex .5em ; }
td.tdb , td.tdbrule , td.tdB , td.tdBrule
{ padding: 0ex .5em 0ex .5em ; }
/* table notes: */
.tnotes {
margin: 0ex 5% 1ex 5% ;
padding: 0.5ex 1em 0.5ex 1em;
font-size:.85em;
text-align: left ;
}
.tnotes dl dt p {margin-bottom:0px;}
.tnoteitemheader {margin-right: 1em;}
/* center, flushleft, flushright environments */
div.center{text-align:center;}
div.center table {margin-left:auto;margin-right:auto;}
div.flushleft{text-align:left;}
div.flushleft table {margin-left:0em ; margin-right:auto;}
div.flushright{text-align:right;}
div.flushright table {margin-left:auto ; margin-right: 0em ;}
/* program listing callouts: */
span.callout {
font-family: "DejaVu Sans", "Bitstream Vera Sans",
Geneva, Verdana, sans-serif ;
border-radius: .5em;
background-color:black;
color:white;
padding:0px .25em 0px .25em;
margin: 0 ;
font-weight: bold;
font-size:.72em ;
}
div.programlisting pre.verbatim span.callout{
font-size: .85em ;
}
div.published
{
text-align: center ;
font-variant: normal ;
font-style: italic ;
font-size: 1em ;
margin: 3ex 0em 3ex 0em ;
}
div.subtitle
{
text-align: center ;
font-variant: normal ;
font-style: italic ;
font-size: 1.25em ;
margin: 3ex 0em 3ex 0em ;
}
div.subtitle p { margin: 1ex ; }
div.author
{
font-variant: normal ;
font-style: normal ;
font-size: 1em ;
margin: 3ex 0em 3ex 0em ;
}
div.author table {
margin: 3ex auto 0ex auto ;
background: none ;
}
div.author table tbody tr td { padding: .25ex ; }
span.affiliation {font-size: .85em ; font-variant: small-caps; }
div.titledate {
text-align: center ;
font-size: .85em ;
font-style: italic;
margin: 6ex 0em 6ex 0em ;
}
nav.topnavigation{
text-align: left ;
padding: 0.5ex 1em 0.5ex 1em ;
/* margin: 2ex 0em 3ex 0em ; */
margin: 0 ;
border-bottom: 1px solid silver ;
border-top: 1px solid silver ;
clear:right ;
}
nav.botnavigation{
text-align: left ;
padding: 0.5ex 1em 0.5ex 1em ;
/* margin: 3ex 0em 2ex 0em ; */
margin: 0 ;
border-top: 1px solid silver ;
border-bottom: 1px solid silver ;
clear:right ;
}
header{
line-height: 1.2 ;
font-size: 1em ;
/* border-bottom: 2px solid silver ; */
margin: 0px ;
padding: 0ex 1em 0ex 1em ;
text-align:center ;
}
header p {margin:0ex;padding:4ex 0em 2ex 0em ;text-align:center;}
footer{
font-size: .85em ;
line-height: 1.2 ;
margin-top: 1ex ;
border-top: 2px solid silver ;
padding: 2ex 1em 2ex 1em ;
clear:right ;
text-align:left ;
}
a.linkhome { font-weight:bold ; font-size: 1em ;}
div.lateximagesource { padding: 0px ; margin: 0px ; display: none; }
img.lateximage{
padding: 0px 0px 0px 0px ;
box-shadow: none ;
border: none ;
background: none ;
margin: 0px 0px -.15ex 0px ;
/* pdfcrop leaves a slight margin, adjust to baseline */
max-width: 100% ;
border-radius: 0ex ;
border: none ;
}
nav.sidetoc {
font-family: "DejaVu Serif", "Bitstream Vera Serif",
"Lucida Bright", Georgia, serif;
float:right ;
width: 20%;
border-left: 1px solid silver;
border-top: 1px solid silver;
border-bottom: 1px solid silver;
/* border-top: 2px solid #808080 ; */
background: #FAF7F4 ;
padding: 2ex 0em 2ex 1em ;
margin: 0ex 0em 2ex 1em ;
font-size:.9em ;
border-radius: 20px 0px 0px 20px ;
}
div.sidetoccontents {
/* border-top: 1px solid silver ; */
overflow-y: auto ;
width: 100% ;
text-align: left ;
}
nav.sidetoc p {line-height:1.2 ; margin: 1ex .5em 1ex .5em ;
text-indent: 0 ; }
nav.sidetoc p a {color:black ; font-size: .7em ;}
div.sidetoctitle {font-size: 1.2em; font-weight:bold; text-align:center;
border-bottom: 1px solid silver ; }
nav.sidetoc a:hover {text-decoration: underline ; }
section.textbody { margin: 0ex 1em 0ex 1em ;}
div.multicolsheading { -webkit-column-span: all;
-moz-column-span: all; column-span: all; }
div.multicols { -webkit-columns: 3 380px ;
-moz-columns: 3 380px ; columns: 3 380px ; }
div.multicols p {margin-top: 0ex}
/* Used to support algorithmicx: */
span.floatright { float: right ; }
/*
For CSS LaTeX and related logos:
Based on:
http://edward.oconnor.cx/2007/08/tex-poshlet
http://nitens.org/taraborelli/texlogo
*/
.latexlogofont {
font-family: "Linux Libertine O", "Nimbus Roman No 9 L",
"FreeSerif", "Hoefler Text", Times, "Times New Roman", serif;
font-variant: normal ;
}
.latexlogo {
font-family: "Linux Libertine O", "Nimbus Roman No 9 L",
"FreeSerif", "Hoefler Text", Times, "Times New Roman", serif;
letter-spacing: .03em ;
font-size: 1.1em;
}
.latexlogo sup {
text-transform: uppercase;
letter-spacing: .03em ;
font-size: 0.85em;
vertical-align: 0.15em;
margin-left: -0.36em;
margin-right: -0.15em;
}
.latexlogo sub {
text-transform: uppercase;
vertical-align: -0.5ex;
margin-left: -0.1667em;
margin-right: -0.125em;
font-size: 1em;
}
.xetexlogo {
font-family: "Linux Libertine O", "Nimbus Roman No 9 L",
"FreeSerif", "Hoefler Text", Times, "Times New Roman", serif;
letter-spacing: .03em ;
font-size: 1.1em;
}
/* A smaller gap between Xe and Tex v.s. LaTeX: */
.xetexlogo sub {
text-transform: uppercase;
vertical-align: -0.5ex;
margin-left: -0.0667em;
margin-right: -0.2em;
font-size: 1em;
letter-spacing: .03em ;
}
/* A large gap between Xe and LaTeX v.s. TeX: */
.xelatexlogo sub {
text-transform: uppercase;
vertical-align: -0.5ex;
margin-left: -0.0667em;
margin-right: -.05em;
font-size: 1em;
letter-spacing: .03em ;
}
.amslogo {
font-family: "TeXGyreChorus","URW Chancery L",
"Apple Chancery","ITC Zapf Chancery","Monotype Corsiva",
"Linux Libertine O", "Nimbus Roman No 9 L", "FreeSerif",
"Hoefler Text", Times, "Times New Roman", serif;
font-style: italic;
}
.lyxlogo {
font-family: "URW Classico", Optima, "Linux Biolinum O",
"DejaVu Sans", "Bitstream Vera Sans", Geneva,
Verdana, sans-serif ;
}
/* Only display top and bottom navigation if a small screen: */
/* Hide the sidetoc if a small screen: */
nav.topnavigation { display:none; }
nav.botnavigation { display:none; }
@media screen and (max-width: 45em) {
/* nav.sidetoc {display:none;} */
nav.sidetoc {
float: none ;
width: 100% ;
margin: 5ex 0px 5ex 0px ;
padding: 0 ;
border-radius: 0 ;
border-bottom: 1px solid black ;
border-top: 1px solid black ;
box-shadow: none ;
}
/* nav.topnavigation { display:block } */
nav.botnavigation { display:block }
}
@media print {
body {
font-family: "Linux Libertine O",
"DejaVu Serif", "Bitstream Vera Serif",
"Liberation Serif", "Nimbus Roman No 9 L",
"FreeSerif", "Hoefler Text", Times, "Times New Roman", serif;
}
nav.sidetoc { display:none; }
nav.topnavigation { display: none; }
nav.botnavigation { display: none; }
}
@media handheld {
nav.sidetoc { display:none; }
nav.topnavigation { display:block }
nav.botnavigation { display:block }
}
@media projection {
nav.sidetoc { display:none; }
nav.topnavigation { display:block }
nav.botnavigation { display:block }
}
\end{VerbatimOut}
% \end{Verbatim}% for syntax highlighting
% \end{macrocode}
% \subsection{lwarp\_sagebrush.css}
% \DescribeFile{lwarp_sagebrush.css}
% An optional \acro{css} which may be used for
% a semi-modern appearance.
%
% If used, this must be present both when compiling the project
% and also when distributing the \acro{HTML} files.
%
% \begin{macrocode}
\begin{VerbatimOut}{lwarp_sagebrush.css}
@import url("lwarp.css") ;
A:link {color:#105030 ; text-decoration: none ; }
A:visited {color:#705030 ; text-shadow:1px 1px 2px #a0a0a0;}
A:hover {color:#006000 ; text-decoration: underline ; text-shadow:0px 0px 2px #a0a0a0;}
A:active {color:#00C000 ; text-shadow:1px 1px 2px #a0a0a0;}
h1, h2, h3, h4, h5, h6, span.paragraph, span.subparagraph
{
font-family: "URW Classico", Optima, "Linux Biolinum O",
"Linux Libertine O", "Liberation Serif",
"Nimbus Roman No 9 L", "FreeSerif",
"Hoefler Text", Times, "Times New Roman", serif;
font-variant: small-caps ;
font-weight: normal ;
color: #304070 ;
text-shadow: 2px 2px 3px #808080;
}
h1 { /* title of the entire website, used on each page */
font-variant: small-caps ;
color: #304070 ;
text-shadow: 2px 2px 3px #808080;
background-color: #F7F7F0 ;
background-image: linear-gradient(to bottom, #F7F7F0, #C0C0C4);
}
h1 {
border-bottom: 1px solid #304070;
border-top: 2px solid #304070;
}
h2 {
border-bottom: 1px solid #304070;
border-top: 2px solid #304070;
background-color: #F7F7F0 ;
background-image: linear-gradient(to bottom, #F7F7F0, #DAD0C0);
}
div.abstract {
background: #f5f5eb ;
background-image: linear-gradient(to bottom, #f5f5eb, #C8C8B8);
border: 1px solid silver;
border-radius: 1em ;
}
div.abstract dl {line-height:1.5;}
div.abstract dt {color:#304070;}
div.abstracttitle{
font-family: "URW Classico", Optima, "Linux Biolinum O",
"Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L",
"FreeSerif", "Hoefler Text", Times, "Times New Roman", serif;
font-weight:bold;
font-variant: small-caps ;
font-size:1.5em;
border-bottom: 1px solid silver ;
color: #304070 ;
text-align: center ;
text-shadow: 1px 1px 2px #808080;
}
div.epigraph {
background: #f5f5eb ;
background-image: linear-gradient(to bottom, #f5f5eb, #C8C8B8);
border: 1px solid silver ;
border-radius: 1ex ;
box-shadow: 3px 3px 3px #808080 ;
}
.example {
background-color: #f5f5eb ;
background-image: linear-gradient(to bottom, #f5f5eb, #C8C8B8);
}
div.exampletitle{
font-family: "URW Classico", Optima, "Linux Biolinum O",
"Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L",
"FreeSerif", "Hoefler Text", Times, "Times New Roman", serif;
font-weight:bold;
font-variant: small-caps ;
border-bottom: 1px solid silver ;
color: #304070 ;
text-align: center ;
text-shadow: 1px 1px 2px #808080;
}
.sidebar {
background-color: #f5f5eb ;
background-image: linear-gradient(to bottom, #f5f5eb, #C8C8B8);
}
div.sidebartitle{
font-family: "URW Classico", Optima, "Linux Biolinum O",
"Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L",
"FreeSerif", "Hoefler Text", Times, "Times New Roman", serif;
font-weight:bold;
font-variant: small-caps ;
border-bottom: 1px solid silver ;
color: #304070 ;
text-align: center ;
text-shadow: 1px 1px 2px #808080;
}
.fancyvrblabel {
font-family: "URW Classico", Optima, "Linux Biolinum O",
"Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L",
"FreeSerif", "Hoefler Text", Times, "Times New Roman", serif;
font-weight:bold;
font-variant: small-caps ;
font-size: 1.5em ;
color: #304070 ;
text-align: center ;
text-shadow: 1px 1px 2px #808080;
}
.minipage {
background-color: #eeeee7 ;
border: 1px solid silver ;
border-radius: 1ex ;
}
figure.figure .minipage { border: none; }
div.marginblock div.minipage { border: none; }
figure , div.marginblock {
background-color: #eeeee7 ;
border: 1px solid silver ;
border-radius: 1ex ;
box-shadow: 3px 3px 3px #808080 ;
}
figure figure {
border: 1px solid silver ;
margin: 0em ;
box-shadow: none ;
}
/*
figcaption {
border-top: 1px solid silver ;
border-bottom: 1px solid silver ;
background-color: #e8e8e8 ;
}
*/
div.table {
box-shadow: 3px 3px 3px #808080 ;
}
/*
.tnotes {
background: #e8e8e8;
border: 1px solid silver;
}
*/
nav.topnavigation{
background-color: #b0b8b0 ;
background-image: linear-gradient(to bottom,#e0e0e0,#b0b8b0) ;
}
nav.botnavigation{
background-color: #b0b8b0 ;
background-image: linear-gradient(to top,#e0e0e0,#b0b8b0) ;
}
header{
background-color: #F7F7F0 ;
background-image: linear-gradient(to top, #F7F7F0, #b0b8b0);
}
footer{
background-color: #F7F7F0 ;
background-image: linear-gradient(to bottom, #F7F7F0, #b0b8b0);
}
nav.sidetoc {
background-color: #F7F7F0 ;
background-image: linear-gradient(to bottom, #F7F7F0, #C0C0C0);
box-shadow: 3px 3px 3px #808080 ;
border-radius: 0px 0px 0px 20px ;
}
div.sidetoctitle {color: #304070 ; }
nav.sidetoc a:hover {color:#006000 ; text-decoration: none ; text-shadow:0px 0px 2px #a0a0a0;}
@media screen and (max-width: 45em) {
nav.sidetoc { border-radius: 0 ; }
}
\end{VerbatimOut}
% \end{Verbatim}% for syntax highlighting
% \end{macrocode}
% \subsection{lwarp\_formal.css}
% \DescribeFile{lwarp_formal.css}
% An optional \acro{css} which may be used for
% a more formal appearance.
%
% If used, this must be present both when compiling the project
% and also when distributing the \acro{HTML} files.
%
% \begin{macrocode}
\begin{VerbatimOut}{lwarp_formal.css}
@import url("lwarp.css") ;
A:link {color:#802020 ; text-decoration:none; }
A:visited {color:#802020 ; text-shadow:none ;}
A:hover {color:#400000 ; text-shadow:none ;}
A:active {color:#C00000 ; text-shadow:none ;}
body {
font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
"Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
"Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times,
"Times New Roman", serif;
background: #fffcf5;
}
span.textrm {
font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
"Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
"Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times,
"Times New Roman", serif;
}
span.textsf {
font-family: "DejaVu Sans", "Bitstream Vera Sans",
Geneva, Verdana, sans-serif ;
}
h1, h2, h3, h4, h5, h6, span.paragraph, span.subparagraph
{
font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
"Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
"Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times,
"Times New Roman", serif;
color: #800000 ;
text-shadow: none ;
}
h1, h2 {
background-color: #fffcf5 ;
background-image: none ;
border-bottom: 1px solid #808080;
border-top: 2px solid #808080;
}
div.abstracttitle {
font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
"Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
"Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times,
"Times New Roman", serif;
color: black ;
text-shadow: none ;
}
div.abstract { font-size: 100% }
.sidebar {
background: #fffcf5;
background-image: none ;
margin: 2em 5% 2em 5%;
padding: 0.5em 1em;
border: none ;
border-top : 1px solid silver;
border-bottom : 1px solid silver;
font-size: 90% ;
}
div.sidebartitle{
font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
"Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
"Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times,
"Times New Roman", serif;
color: #800000 ;
text-shadow: none ;
border: none ;
}
.example {
background: #fffcf5;
background-image: none ;
margin: 2em 5% 2em 5%;
padding: 0.5em 1em;
border: none ;
border-top : 1px solid silver;
border-bottom : 1px solid silver;
}
div.exampletitle{
font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
"Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
"Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times,
"Times New Roman", serif;
color: #800000 ;
text-shadow: none ;
border: none ;
}
div.fancyvrblabel{
font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
"Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
"Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times,
"Times New Roman", serif;
color: #800000 ;
text-shadow: none ;
border: none ;
}
.verse {
font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
"Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
"Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times,
"Times New Roman", serif;
}
figure {
margin: 3ex 5% 3ex 5% ;
padding: 1ex 1em 1ex 1em ;
background-color: #fffcf5 ;
overflow-x: auto ;
border: none ;
/* border-top: 1px solid silver; */
/* border-bottom: 1px solid silver; */
}
figcaption , .lstlisting {
border: none ;
/* border-top: 1px solid silver ; */
/* border-bottom: 1px solid silver ; */
background-color: #fffcf5 ;
}
.tnotes {
background: #fffcf5 ;
}
.theorem {
background: none ;
}
.minipage {
background-color: #fffcf5 ;
border: none ;
margin: 1em ;
}
div.floatrow figure { border: none ; }
figure figure { border: none ; }
nav.toc, nav.lof, nav.lot, nav.lol {
font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
"Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
"Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times,
"Times New Roman", serif;
}
nav.sidetoc {
font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
"Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
"Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times,
"Times New Roman", serif;
background-image: linear-gradient(to bottom, #fffcf5, #C0C0C0);
border-radius: 0px 0px 0px 20px ;
}
div.sidetoctitle{
color: #800000 ;
}
header{
background-color: #e0e0e0 ;
background-image: linear-gradient(to top, #fffcf5, #b0b0b0);
text-align:center ;
}
footer{
background-color: #e0e0e0 ;
background-image: linear-gradient(to bottom, #fffcf5, #b0b0b0);
padding: 2ex 1em 2ex 1em ;
clear:right ;
text-align:left ;
}
nav.botnavigation {
background: #dedcd5 ;
border-top: 1px solid black ;
}
\end{VerbatimOut}
% \end{Verbatim}% for syntax highlighting
% \end{macrocode}
% \subsection{sample\_project.css}
% \DescribeFile{sample_project.css}
% The project-specific \acro{css} file. Use with \cs{NewCSS}.
%
% If used, this must be present both when compiling the project
% and also when distributing the \acro{HTML} files.
%
% \begin{macrocode}
\begin{VerbatimOut}{sample_project.css}
/* ( --- Start of project.css --- ) */
/* A sample project-specific CSS file for lwarp --- ) */
/* Load default lwarp settings: */
@import url("lwarp.css") ;
/* or lwarp_formal.css, lwarp_sagebrush.css */
/* Project-specific CSS setting follow here. */
/* . . . */
/* ( --- End of project.css --- ) */
\end{VerbatimOut}
% \end{Verbatim}% for syntax highlighting
% \end{macrocode}
% \subsection{lwarp\_html.xdy}
% \DescribeFile{lwarp_html.xdy}
% Used to modify the index for \pkg{lwarp}.
%
% This must be present when compiling the project,
% but does not need to be present when distributing
% the resulting \acro{HTML} files.
%
% \begin{macrocode}
\begin{VerbatimOut}{lwarp_html.xdy}
(require "tex/inputenc/latin.xdy")
(merge-rule "\\PS *" "Postscript")
(require "texindy.xdy")
(require "page-ranges.xdy")
(require "book-order.xdy")
(markup-locref :open "\hyperindexref{" :close "}")
\end{VerbatimOut}
% \end{Verbatim}% for syntax highlighting
% \end{macrocode}
% \subsection{lwarp\_mathjax.txt}
% \DescribeFile{lwarp_mathjax.txt}
% Used by \pkg{lwarp} when using MathJax.
%
% This must be present when compiling the project,
% but does not need to be present when distributing
% the resulting \acro{HTML} files.
% \begin{macrocode}
\begin{VerbatimOut}{lwarp_mathjax.txt}
<!-- https://groups.google.com/forum/#!topic/
mathjax-users/jUtewUcE2bY -->
<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("TeX AMSmath Ready",function () {
var seteqsectionDefault = {name: "", num: 0};
var seteqsections = {}, seteqsection = seteqsectionDefault;
var TEX = MathJax.InputJax.TeX, PARSE = TEX.Parse;
var AMS = MathJax.Extension["TeX/AMSmath"];
TEX.Definitions.Add({
macros: {
seteqsection: "mySection",
seteqnumber: "mySetEqNumber"
}
});
PARSE.Augment({
mySection: function (name) {
seteqsection.num = AMS.number;
var n = this.GetArgument(name);
if (n === "") {
seteqsection = seteqsectionDefault;
} else {
if (!seteqsections["_"+n])
seteqsections["_"+n] = {name:n, num:0};
seteqsection = seteqsections["_"+n];
}
AMS.number = seteqsection.num;
},
mySetEqNumber: function (name) {
var n = this.GetArgument(name);
if (!n || !n.match(/^ *[0-9]+ *$/))
n = ""; else n = parseInt(n)-1;
<!-- $ syntax highlighting -->
if (n === "" || n < 1)
TEX.Error
("Argument to "+name+" should be a positive integer");
AMS.number = n;
}
});
MathJax.Hub.Config({
TeX: {
equationNumbers: {
formatTag: function (n)
{return "("+(seteqsection.name+"."+n).replace(/^\./,"")+")"},
formatID: function (n) {
n = (seteqsection.name+'.'+n).replace
(/[:"'<>&]/g,"").replace(/^\./,"");
return 'mjx-eqn-' + n;
}
}
}
});
});
</script>
<!-- http://docs.mathjax.org/en/latest/options/ThirdParty.html -->
<script type="text/x-mathjax-config">
MathJax.Ajax.config.path["Contrib"] =
"https://cdn.mathjax.org/mathjax/contrib";
</script>
<!-- https://github.com/mathjax/MathJax-third-party-extensions/
tree/master/siunitx -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js","[Contrib]/siunitx/siunitx.js"],
jax: ["input/TeX","output/HTML-CSS"],
tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
TeX: {extensions: ["AMSmath.js","AMSsymbols.js", "sinuitx.js"]}
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
equationNumbers: {
autoNumber: "AMS"
}
}
});
</script>
<script
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full">
</script>
\end{VerbatimOut}
% \end{Verbatim}% for syntax highlighting
% \end{macrocode}
% \subsection{Lwarpmk option}
% The following is only generated if the |lwarpmk| option
% was given to \pkg{lwarp-newproject}.
% \begin{macrocode}
\begin{LWR@createlwarpmk}
% \end{macrocode}
% \DescribeFile{lwarpmk} Creates a local copy of |lwarpmk|:
%
% \changes{v0.21}{2017/02/11}{lwarpmk: Fix: \protect\texttt{lwarpmk again} for Windows.}
% \changes{v0.21}{2017/02/22}{lwarpmk: Fix: \protect\texttt{lwarpmk limages} for Windows.}
% \changes{v0.21}{2017/02/22}{lwarpmk: Fix: \protect\texttt{lwarpmk} uses \texttt{lateximages} text file instead of shell script.}
%
%
% \begin{macrocode}
\begin{VerbatimOut}{lwarpmk.lua}
#!/usr/bin/env texlua
-- Copyright 2016 Brian Dunn
-- Print the usage of the lwarpmk command:
printversion = "v0.21"
function printhelp ()
print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
end
function printusage ()
print ( [[
lwarpmk print [project]: Compile a print version.
lwarpmk printindex [project]: Process the index for the print version.
lwarpmk html [project]: Compile an HTML version.
lwarpmk htmlindex [project]: Process the index for the html version.
lwarpmk again [project]: Touch the source code to trigger recompiles.
lwarpmk limages [project]: Process the "lateximages" created by lwarp.sty.
lwarpmk pdftohtml [project]:
For use with latexmk or a Makefile:
Convert project_html.pdf to project_html.html and
individual HTML files.
lwarpmk clean [project]: Remove project.aux, .toc, .lof, .lot, .idx, .ind, .log
lwarpmk cleanall [project]: Remove auxiliary files and also project.pdf, *.html
lwarpmk -h: Print this help message.
lwarpmk --help: Print this help message.
]] )
printconf ()
end
-- Print the format of the configuration file lwarpmk.conf:
function printconf ()
print ( [[
An example lwarpmk.conf or <project>.lwarpmkconf project file:
--
opsystem = "Unix" (or "Windows")
latexname = "pdflatex" (or "lualatex", or "xelatex")
sourcename = "projectname" (the source-code filename w/o .tex)
homehtmlfilename = "index" (or perhaps the project name)
htmlfilename = "" (or "projectname" - filename prefix)
uselatexmk = "false" (or "true" to use latexmk to build PDFs)
--
Filenames must contain only letters, numbers, underscore, or dash.
Values must be in "quotes".
]] ) ;
end
-- Split one large sourcefile into a number of files,
-- starting with destfile.
-- The file is split at each occurance of <!--|Start file|newfilename|*
function splitfile (destfile,sourcefile)
print ("lwarpmk: Splitting " .. sourcefile .. " into " .. destfile) ;
io.input(sourcefile)
io.output(destfile)
for line in io.lines() do
i,j,copen,cstart,newfilename = string.find (line,"(.*)|(.*)|(.*)|") ;
if ( (i~= nil) and (copen == "<!--") and (cstart == "Start file")) then -- split the file
io.output(newfilename) ;
else -- not a splitpoint
io.write (line .. "\n") ;
end
end -- do
end -- function
-- Incorrect value, so print an error and exit.
function cvalueerror ( line, linenum , cvalue )
print ( linenum .. " : " .. line ) ;
print ("lwarpmk: incorrect variable value \"" .. cvalue .. "\" in lwarpmk.conf.\n" ) ;
printconf () ;
os.exit(1) ;
end
-- Load settings from the project's "lwarpmk.conf" file:
function loadconf ()
-- Default configuration filename:
local conffile = "lwarpmk.conf"
-- Optional configuration filename:
if arg[2] ~= nil then conffile = arg[2]..".lwarpmkconf" end
-- Verify the file exists:
if (lfs.attributes(conffile,"mode")==nil) then -- file not exists
print("lwarpmk: " .. conffile .." does not exist.")
print("lwarpmk: " .. arg[2] .. " does not appear to be a project name.\n")
printhelp () ;
os.exit(1) -- exit the entire lwarpmk script
else -- file exists
-- Read the file:
print ("lwarpmk: Reading " .. conffile ..".")
io.input(conffile) ;
-- Scan each line:
local linenum = 0
for line in io.lines() do -- scan lines
linenum = linenum + 1
i,j,cvarname,cvalue = string.find (line,"([%w-_]*)%s*=%s*\"([%w-_]*)\"") ;
-- Error if incorrect enclosing characters:
if ( i == nil ) then
print ( linenum .. " : " .. line ) ;
print ( "lwarpmk: Incorrect entry in " .. conffile ..".\n" ) ;
printconf () ;
os.exit(1) ;
end
if ( cvarname == "opsystem" ) then
-- Verify choice of opsystem:
if ( (cvalue == "Unix") or (cvalue == "Windows") ) then
opsystem = cvalue
else
cvalueerror ( line, linenum , cvalue )
end
elseif ( cvarname == "latexname" ) then
-- Verify choice of LaTeX compiler:
if (
(cvalue == "pdflatex") or
(cvalue == "xelatex") or
(cvalue == "lualatex")
) then
latexname = cvalue
else
cvalueerror ( line, linenum , cvalue )
end
elseif ( cvarname == "sourcename" ) then sourcename = cvalue
elseif ( cvarname == "homehtmlfilename" ) then homehtmlfilename = cvalue
elseif ( cvarname == "htmlfilename" ) then htmlfilename = cvalue
elseif ( cvarname == "uselatexmk" ) then uselatexmk = cvalue
else
print ( linenum .. " : " .. line ) ;
print ("lwarpmk: Incorrect variable name \"" .. cvarname .. "\" in " .. conffile ..".\n" ) ;
printconf () ;
os.exit(1) ;
end
end -- do scan lines
end -- file exists
-- Select some operating-system commands:
if opsystem=="Unix" then -- For Unix / Linux / Mac OS:
rmname = "rm"
mvname = "mv"
touchnamepre = "touch"
touchnamepost = ""
dirslash = "/"
opquote= "\'"
elseif opsystem=="Windows" then -- For Windows
rmname = "DEL"
mvname = "MOVE"
touchnamepre = "COPY /b"
touchnamepost = "+,,"
dirslash = "\\"
opquote= "\""
else print ( "lwarpmk: Select Unix or Windows for opsystem" )
end --- for Windows
end -- loadconf
function refreshdate ()
os.execute(touchnamepre .. " " .. sourcename .. ".tex " .. touchnamepost)
end
-- Scan the LaTeX log file for the phrase "Rerun to get",
-- indicating that the file should be compiled again.
-- Return true if found.
function reruntoget (filesource)
io.input(filesource)
for line in io.lines() do
if ( string.find(line,"Rerun to get") ~= nil ) then return true end
end
return false
end
-- Compile one time, return true if should compile again.
-- fsuffix is "" for print, "_html" for HTML output.
function onetime (fsuffix)
print("lwarpmk: Compiling with " .. latexname .. " " .. sourcename..fsuffix)
err = os.execute(
-- "echo " ..
latexname .. " " .. sourcename..fsuffix )
if ( err ~= 0 ) then print ( "lwarpmk: Compile error.") ; os.exit(1) ; end
return (reruntoget(sourcename .. fsuffix .. ".log") ) ;
end
-- Compile up to five times.
-- fsuffix is "" for print, "_html" for HTML output
function manytimes (fsuffix)
if onetime(fsuffix) == true then
if onetime(fsuffix) == true then
if onetime(fsuffix) == true then
if onetime(fsuffix) == true then
if onetime(fsuffix) == true then
end end end end end
end
-- Exit if the given file does not exist.
function verifyfileexists (filename)
if (lfs.attributes ( filename , "modification" ) == nil ) then
print ( "lwarpmk: " .. filename .. " not found." ) ;
os.exit (1) ;
end
end
-- Convert <project>_html.pdf into HTML files:
function pdftohtml ()
-- Convert to text:
print ("lwarpmk: Converting " .. sourcename .."_html.pdf to " .. sourcename .. "_html.html")
os.execute("pdftotext -enc UTF-8 -nopgbrk -layout " .. sourcename .. "_html.pdf " .. sourcename .. "_html.html")
-- Split the result into individual HTML files:
splitfile (homehtmlfilename .. ".html" , sourcename .. "_html.html")
end
-- Remove auxiliary files:
function removeaux ()
os.execute ( rmname .. " " ..
sourcename ..".aux " .. sourcename .. "_html.aux " ..
sourcename ..".toc " .. sourcename .. "_html.toc " ..
sourcename ..".lof " .. sourcename .. "_html.lof " ..
sourcename ..".lot " .. sourcename .. "_html.lot " ..
sourcename ..".idx " .. sourcename .. "_html.idx " ..
sourcename ..".ind " .. sourcename .. "_html.ind " ..
sourcename ..".log " .. sourcename .. "_html.log "
)
end
-- Create lateximages based on lateximages.txt:
function createlateximages ()
print ("lwarpmk: Creating lateximages.")
io.input("lateximages.txt")
-- Create the lateximages directory, ignore error if alreadt exists
err = os.execute("mkdir lateximages")
-- Scan lateximages.txt
for line in io.lines() do
-- lwimgpage is the page number in the PDF which has the image
-- lwimgnum is the sequential lateximage number to assign for the image
i,j,lwimgpage,lwimgnum = string.find (line,"|(.*)|(.*)|")
-- For each entry:
if ( (i~=nil) ) then
-- Separate out the image into its own single-page pdf:
err = os.execute(
"pdfseparate -f " .. lwimgpage .. " -l " ..
lwimgpage .. " " .. sourcename .."_html.pdf lateximagetemp-%d.pdf")
-- Crop the image:
err = os.execute(
"pdfcrop --hires lateximagetemp-" .. lwimgpage ..".pdf lateximage-" .. lwimgnum ..".pdf")
if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end
-- Convert the image to svg:
err = os.execute(
"pdftocairo -svg lateximage-" .. lwimgnum ..".pdf lateximage-" .. lwimgnum ..".svg")
if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end
-- Move the result into lateximages/:
err = os.execute(
mvname .. " lateximage-" .. lwimgnum ..".svg lateximages" .. dirslash )
if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end
-- Remove the temporary files:
err = os.execute(
rmname .. " lateximage-" .. lwimgnum ..".pdf lateximagetemp-" .. lwimgpage ..".pdf")
if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end
end
end -- do
end -- function
-- lwarpmk --version :
if (arg[1] == "--version") then
print ( "lwarpmk: " .. printversion )
else -- not -- version
-- print intro:
print ("lwarpmk: " .. printversion .. " Automated make for the LaTeX lwarp package.")
-- lwarpmk print:
if arg[1] == "print" then
loadconf ()
if ( uselatexmk == "true" ) then
os.execute ( "latexmk -pdf -dvi- -ps- -pdflatex=\"" .. latexname .." %O %S\" " .. sourcename ..".tex" ) ;
print ("lwarpmk: Done.")
else -- not latexmk
verifyfileexists (sourcename .. ".tex") ;
-- See if up to date:
if (
( lfs.attributes ( sourcename .. ".pdf" , "modification" ) == nil ) or
(
lfs.attributes ( sourcename .. ".tex" , "modification" ) >
lfs.attributes ( sourcename .. ".pdf" , "modification" )
)
) then
-- Recompile if not yet up to date:
manytimes("")
print ("lwarpmk: Done.") ;
else
print ("lwarpmk: " .. sourcename .. ".pdf is up to date.") ;
end
end -- not latexmk
-- lwarp printindex:
-- Compile the index then touch the source
-- to trigger a recompile of the document:
elseif arg[1] == "printindex" then
loadconf ()
print ("lwarpmk: Processing the index.")
os.execute("texindy -M lwarp_html.xdy " .. sourcename .. ".idx")
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
print ("lwarpmk: Done.")
-- lwarpmk html:
elseif arg[1] == "html" then
loadconf ()
if ( uselatexmk == "true" ) then
-- The recorder option is required to detect changes in <project>.tex
-- while we are loading <project>_html.tex.
err=os.execute ( "latexmk -pdf -dvi- -ps- -recorder "
.. "-e "
.. opquote .. "$makeindex = q/texindy -M lwarp_html.xdy/" .. opquote
.. " -pdflatex=\"" .. latexname .." %O %S\" "
.. sourcename .."_html.tex" ) ;
if ( err ~= 0 ) then print ( "lwarpmk: Compile error.") ; os.exit(1) ; end
pdftohtml ()
print ("lwarpmk: Done.")
else -- not latexmk
verifyfileexists ( sourcename .. ".tex" ) ;
-- See if exists and is up to date:
if (
( lfs.attributes ( homehtmlfilename .. ".html" , "modification" ) == nil ) or
(
lfs.attributes ( sourcename .. ".tex" , "modification" ) >
lfs.attributes ( homehtmlfilename .. ".html" , "modification" )
)
) then
-- Recompile if not yet up to date:
manytimes("_html")
pdftohtml ()
print ("lwarpmk: Done.")
else
print ("lwarpmk: " .. homehtmlfilename .. ".html is up to date.")
end
end -- not latexmk
elseif arg[1] == "pdftohtml" then
loadconf ()
pdftohtml ()
-- lwarpmk htmlindex:
-- Compile the index then touch the source
-- to trigger a recompile of the document:
elseif arg[1] == "htmlindex" then
loadconf ()
print ("lwarpmk: Processing the index.")
os.execute("texindy -M lwarp_html.xdy " .. sourcename .. "_html.idx")
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
print ("lwarpmk: Done.")
-- lwarpmk limages:
-- Scan the lateximages.txt file to create lateximages,
-- then touch the source to trigger a recompile.
elseif arg[1] == "limages" then
loadconf ()
print ("lwarpmk: Processing images.")
createlateximages ()
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
print ("lwarpmk: Done.")
-- lwarpmk again:
-- Touch the source to trigger a recompile.
elseif arg[1] == "again" then
loadconf ()
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
print ("lwarpmk: Done.")
-- lwarpmk clean:
-- Remove project.aux, .toc, .lof, .lot, .idx, .ind, .log
elseif arg[1] == "clean" then
loadconf ()
removeaux ()
print ("lwarpmk: Done.")
-- lwarpmk cleanall
-- Remove project.aux, .toc, .lof, .lot, .idx, .ind, .log
-- and also project.pdf, *.html
elseif arg[1] == "cleanall" then
loadconf ()
removeaux ()
os.execute ( rmname .. " " ..
sourcename .. ".pdf " .. sourcename .. "_html.pdf " ..
"*.html"
)
print ("lwarpmk: Done.")
-- lwarpmk with no argument :
elseif (arg[1] == nil) then
printhelp ()
-- lwarpmk -h or lwarpmk --help :
elseif (arg[1] == "-h" ) or (arg[1] == "--help") then
printusage ()
else
print ("lwarpmk: Unknown command \""..arg[1].."\".\n")
printhelp ()
end
end -- not --version
\end{VerbatimOut}
% \end{Verbatim}% for syntax highlighting
% \end{macrocode}
% \begin{macrocode}
\end{LWR@createlwarpmk}
% \end{macrocode}
% \iffalse
%</lwarp-newproject>
% \fi
% \changes{v0.20}{2016/12/12}{Code factored into independent \texttt{lwarp\_html} files.}
% \iffalse
%<*afterpage>
% \fi
% \part{lwarp-afterpage.sty}
% \section{Afterpage}
%
% \DescribePackage{afterpage}
%
% \changes{v0.20}{2017/01/11}{\pkg{afterpage}: Added.}
%
% \codehtml
%
% Discard all options for \pkg{lwarp-afterpage}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{afterpage}
% \end{macrocode}
% \begin{macrocode}
\newcommand{\afterpage}[1]{#1}
% \end{macrocode}
% \iffalse
%</afterpage>
% \fi
% \clearpage
% \iffalse
%<*algorithmicx>
% \fi
% \part{lwarp-algorithmicx.sty}
% \section{Algorithmicx}
% \label{sec:algorithmicx}
%
% \DescribePackage{algorithmicx}
% \pkg{algorithmicx} is supported with minor adjustments.
%
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackagePass{algorithmicx}
% \end{macrocode}
%
%
% Inside the \env{algorithmic} environment, level indenting is converted to a |span|
% of the required length, and comments are placed inside a |span| which is floated right.
%
% \limitscombiningfloats
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macrocode}
\AtBeginEnvironment{algorithmic}{%
%
\let\origALG@doentity\ALG@doentity%
%
\renewcommand*{\ALG@doentity}{%
\origALG@doentity%
\uselengthunit{PT}%
\LWR@htmltagc{%
span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"%
}%
\LWR@htmltagc{/span}%
}%
%
\let\origComment\Comment%
%
\renewcommand{\Comment}[1]{\InlineClass{floatright}{\origComment{#1}}}%
}
% \end{macrocode}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \iffalse
%</algorithmicx>
% \fi
% \iffalse
%<*alltt>
% \fi
% \part{lwarp-alltt.sty}
% \section{Alltt}
%
% \DescribePackage{alltt}
%
% \changes{v0.20}{2017/01/11}{\pkg{alltt}: Added.}
%
% \codehtml
%
% \pkg{alltt} is patched for use by \pkg{lwarp}.
% \begin{macrocode}
\LWR@ProvidesPackagePass{alltt}
% \end{macrocode}
% \begin{macrocode}
\AfterEndPreamble{
\AtBeginEnvironment{alltt}{\LWR@atbeginverbatim{alltt}\unskip\vspace*{-\baselineskip}}
\AfterEndEnvironment{alltt}{\unskip\vspace*{-\baselineskip}\LWR@afterendverbatim}
}
% \end{macrocode}
% \iffalse
%</alltt>
% \fi
% \clearpage
% \iffalse
%<*bookmark>
% \fi
% \part{lwarp-bookmark.sty}
% \section{Bookmark}
%
% \DescribePackage{bookmark}
% \pkg{bookmark} is emulated during \acro{HTML} output, and
% the \pkg{bookmark} package is ignored.
% \changes{v0.20}{2017/01/03}{\pkg{bookmark}: Added.}
%
% \codehtml
%
% Discard all options for \pkg{lwarp-bookmark}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{bookmark}
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\bookmarksetup}[1]{}
\newcommand*{\bookmarksetupnext}[1]{}
\newcommand*{\bookmark}[2][]{}
\newcommand*{\bookmarkdefinestyle}[2]{}
\newcommand*{\bookmarkget}[1]{}
\newcommand{\BookmarkAtEnd}[1]{}
% \end{macrocode}
% \iffalse
%</bookmark>
% \fi
% \clearpage
% \iffalse
%<*booktabs>
% \fi
% \part{lwarp-booktabs.sty}
% \section{Booktabs}
% \label{sec:booktabs}
%
%
% \DescribePackage{booktabs}
% \pkg{booktabs} is emulated during \acro{HTML} output, and
% the \pkg{booktabs} package is ignored.
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackageDrop{booktabs}
% \end{macrocode}
%
% Booktabs emulation is spread among the tabular code.
%
%
% Emulated for source compatibility.
% \begin{macrocode}
\newcommand*{\addlinespace}[1]{}
\newcommand*{\morecmidrules}{}
\newcommand*{\specialrule}[3]{}
% \end{macrocode}
% \iffalse
%</booktabs>
% \fi
% \iffalse
%<*draftwatermark>
% \fi
% \part{lwarp-draftwatermark.sty}
% \section{Draftwatermark}
% \label{sec:draftwatermark}
%
% \changes{v0.20}{2017/01/11}{\pkg{draftwatermark}: Added.}
%
% \DescribePackage{draftwatermark}
% \pkg{draftwatermark} is emulated during \acro{HTML} output, and
% the \pkg{draftwatermark} package is ignored.
% \begin{macrocode}
\LWR@ProvidesPackageDrop{draftwatermark}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\newcommand{\SetWatermarkAngle}[1]{}
\newcommand{\SetWatermarkColor}[1]{}
\newcommand{\SetWatermarkLightness}[1]{}
\newcommand{\SetWatermarkFontSize}[1]{}
\newcommand{\SetWatermarkScale}[1]{}
\newcommand{\SetWatermarkHorCenter}[1]{}
\newcommand{\SetWatermarkVertCenter}[1]{}
\newcommand{\SetWatermarkText}[1]{}
% \end{macrocode}
% \iffalse
%</draftwatermark>
% \fi
% \iffalse
%<*epigraph>
% \fi
% \part{lwarp-epigraph.sty}
% \section{Epigraph}
% \label{sec:epigraph}
%
%
% \DescribePackage{epigraph}
% \pkg{epigraph} is emulated during \acro{HTML} output, and
% the \pkg{epigraph} package is ignored.
% \begin{macrocode}
\LWR@ProvidesPackageDrop{epigraph}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\newcommand{\qitem}[2]
{
\begin{BlockClass}{qitem}
#1
\begin{BlockClass}{epigraphsource}
#2
\end{BlockClass}
\end{BlockClass}
}
% \end{macrocode}
% \begin{macrocode}
\newcommand{\epigraph}[2]
{
\begin{BlockClass}{epigraph}
\qitem{#1}{#2}
\end{BlockClass}
}
\newenvironment*{epigraphs}
{\BlockClass{epigraph}}
{\endBlockClass}
% \end{macrocode}
%
% Use \acro{CSS} to format epigraphs.
%
% The following are null commands for source compatibility:
% \begin{macrocode}
\newlength{\epigraphwidth}
\setlength{\epigraphwidth}{.5\linewidth}
\newenvironment*{flushepinormal}{}{}
\newcommand{\textflush}[1]{flushepinormal}
\newcommand{\epigraphflush}[1]{flushright}
\newcommand{\sourceflush}[1]{flushright}
\newcommand*{\epigraphsize}{\small}
\newlength{\epigraphrule}
\newlength{\beforeepigraphskip}
\newlength{\afterepigraphskip}
\newcommand{\epigraphhead}[2][0]{#2}
\newcommand{\dropchapter}[1]{}
\newcommand*{\undodrop}{}
\newcommand{\cleartoevenpage}[1][]{}
% \end{macrocode}
% \iffalse
%</epigraph>
% \fi
% \iffalse
%<*eso-pic>
% \fi
% \part{lwarp-eso-pic.sty}
% \section{Eso-pic}
% \label{sec:eso-pic}
%
% \changes{v0.20}{2017/01/11}{\pkg{eso-pic}: Added.}
%
% \DescribePackage{eso-pic}
% \pkg{eso-pic} is emulated during \acro{HTML} output, and
% the \pkg{eso-pic} package is ignored.
% \begin{macrocode}
\LWR@ProvidesPackageDrop{eso-pic}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\newcommand*{\LenToUnit}{}
\newcommand{\AtPageUpperLeft}[1]{}
\newcommand{\AtPageLowerLeft}[1]{}
\newcommand{\AtPageCenter}[1]{}
\newcommand{\AtStockLowerLeft}[1]{}
\newcommand{\AtStockUpperLeft}[1]{}
\newcommand{\AtStockCenter}[1]{}
\newcommand{\AtTextUpperLeft}[1]{}
\newcommand{\AtTextLowerLeft}[1]{}
\newcommand{\AtTextCenter}[1]{}
\NewDocumentCommand{\AddToShipoutPictureBG}{s +m}{}
\let\AddToShipoutPicture\AddToShipoutPictureBG
\NewDocumentCommand{\AddToShipoutPictureFG}{s +m}{}
\newcommand*{\ClearShipoutPictureBG}{}
\newcommand*{\ClearShipoutPicture}{}
\newcommand*{\ClearShipoutPictureFG}{}
\newcommand{\gridSetup}[6][]{}
% \end{macrocode}
% \iffalse
%</eso-pic>
% \fi
% \iffalse
%<*everypage>
% \fi
% \part{lwarp-everypage.sty}
% \section{Everypage}
% \label{sec:everypage}
%
% \changes{v0.20}{2017/01/11}{\pkg{everypage}: Added.}
%
% \DescribePackage{everypage}
% \pkg{everypage} is emulated during \acro{HTML} output, and
% the \pkg{everypage} package is ignored.
% \begin{macrocode}
\LWR@ProvidesPackageDrop{everypage}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\newcommand*{\AddEverypageHook}[1]{}
\newcommand*{\AddThispageHook}[1]{}
% \end{macrocode}
% \iffalse
%</everypage>
% \fi
% \iffalse
%<*extramarks>
% \fi
% \part{lwarp-extramarks.sty}
% \section{Extramarks}
%
% \DescribePackage{extramarks}
%
% \changes{v0.20}{2017/01/11}{\pkg{extramarks}: Added.}
%
% \codehtml
%
% Discard all options for \pkg{lwarp-extramarks}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{extramarks}
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\extramarks}[2]{}
\newcommand*{\firstleftxmark}{}
\newcommand*{\lastleftxmark}{}
\newcommand*{\firstrightxmark}{}
\newcommand*{\lastrightxmark}{}
\newcommand*{\firstxmark}{}
\newcommand*{\lastxmark}{}
\newcommand*{\topxmark}{}
\newcommand*{\topleftxmark}{}
\newcommand*{\firstleftmark}{}
\newcommand*{\lastrightmark}{}
% \end{macrocode}
% \iffalse
%</extramarks>
% \fi
% \iffalse
%<*fancyhdr>
% \fi
% \part{lwarp-fancyhdr.sty}
% \section{Fancyhdr}
%
% \DescribePackage{fancyhdr}
%
% \changes{v0.20}{2017/01/11}{\pkg{fancyhdr}: Added.}
%
% \codehtml
%
% Discard all options for \pkg{lwarp-fancyhdr}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{fancyhdr}
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\fancyhead}[2][]{}
\newcommand*{\fancyfoot}[2][]{}
\newcommand*{\fancyhf}[2][]{}
\newcommand*{\fancypagestyle}[2]{}
\newcommand*{\lhead}[1]{}
\newcommand*{\chead}[1]{}
\newcommand*{\rhead}[1]{}
\newcommand*{\lfoot}[1]{}
\newcommand*{\cfoot}[1]{}
\newcommand*{\rfoot}[1]{}
\newcommand*{\headrulewidth}{}
\newcommand*{\footrulewidth}{}
\newcommand*{\fancyheadoffset}[2][]{}
\newcommand*{\fancyfootoffset}[2][]{}
\newcommand*{\fancyhfoffset}[2][]{}
\newcommand*{\iffloatpage}[2]{#2}
\newcommand*{\ifftopfloat}[2]{#2}
\newcommand*{\iffbotfloat}[2]{#2}
% \end{macrocode}
% \iffalse
%</fancyhdr>
% \fi
% \clearpage
% \iffalse
%<*float>
% \fi
% \part{lwarp-float.sty}
% \section{Float and \cs{newfloat}}
% \label{sec:newfloat}
% \label{sec:float}
%
% \DescribePackage{float}
% \pkg{float} is emulated during \acro{HTML} output, and
% the \pkg{float} package is ignored.
%
% \changes{v0.20}{2017/01/22}{Improved float caption type handling.}
%
%
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackageDrop{float}[2016/03/04]
% \end{macrocode}
%
% \DescribePackage{float}
%
% The \pkg{float} package is emulated.
%
% See \cref{sec:listof} for the \cs{listof} command.
% \begin{macro}{\newfloat} \marg{1: type} \marg{2: placement}
% \marg{3: ext} \oarg{4: within}
%
% Emulates the \cs{newfloat} command from the \pkg{float} package.
%
% ``placement'' is ignored.
%
% \begin{macrocode}
\NewDocumentCommand{\newfloat}{m m m o}{%
\IfValueTF{#4}
{
\DeclareFloatingEnvironment[fileext=#3,within=#4]{#1}
}
{\DeclareFloatingEnvironment[fileext=#3]{#1}}
% \end{macrocode}
% \pkg{newfloat} package automatically creates the \cs{listof} command
% for new floats, but \pkg{float} does not,
% so remove \cs{listof} here in case it is manually created later.
% \begin{macrocode}
\cslet{listof#1s}\relax
\cslet{listof#1es}\relax
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\floatname} \marg{type} \marg{name}
%
% Sets the text name of the float, such as ``Figure''.
% \begin{macrocode}
\NewDocumentCommand{\floatname}{m +m}{%
\SetupFloatingEnvironment{#1}{name=#2}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\floatplacement} \marg{type} \marg{placement}
%
% Float placement is ignored.
% \begin{macrocode}
\newcommand*{\floatplacement}[2]{%
\SetupFloatingEnvironment{#1}{placement=#2}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\floatstyle} \marg{style}
%
% Float styles are ignored.
% \begin{macrocode}
\newcommand{\floatstyle}[1]{%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\restylefloat} * \marg{style}
%
% Float styles are ignored.
% \begin{macrocode}
\NewDocumentCommand{\restylefloat}{s m}{%
}
% \end{macrocode}
% \end{macro}
% \iffalse
%</float>
% \fi
% \clearpage
% \iffalse
%<*floatrow>
% \fi
% \part{lwarp-floatrow.sty}
% \section{Floatrow}
% \label{sec:floatrow}
%
% \DescribePackage{floatrow}
% \pkg{floatrow} is emulated during \acro{HTML} output, and
% the \pkg{floatrow} package is ignored.
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackageDrop{floatrow}
% \end{macrocode}
% \changes{v0.14}{2016/03/31}{floatrow: Added package}
% \DescribePackage{floatrow}
%
% The \pkg{floatrow} package is emulated.
%
% \limitsfloatrow
% ^^A \begin{macro}{\floatbox} \oarg{1 preamble} \marg{2 captype}
% ^^A \oarg{3 width} \oarg{4 height} \oarg{5 vert pos}
% ^^A \marg{6 caption} \marg{7 object}
%
% Only parameters for caption and object are used.
%
% |LWR@insubfloatrow| is true if inside a \env{subfloatrow} environment.
% \begin{macrocode}
\NewDocumentCommand{\floatbox}{o m o o o +m +m}{%
\ifbool{LWR@insubfloatrow}
{
% \end{macrocode}
% Inside a \env{subfloatrow}.
% \env{subfigure} and \env{subtable} take a width argument.
% Defaults to \cs{linewidth} if none is given.
% \begin{macrocode}
\IfValueTF{#3}
{\@nameuse{sub#2}{#3}}
{\@nameuse{sub#2}{\linewidth}}
}
{
% \end{macrocode}
% Not inside a \env{subfloatrow}.
% \env{figure} and \env{table} do not take a width argument.
% \begin{macrocode}
\@nameuse{#2}
}
#6
#7
\ifbool{LWR@insubfloatrow}
{\@nameuse{endsub#2}}
{\@nameuse{end#2}}
}
% \end{macrocode}
% ^^A \end{macro}
% Not used:
% \begin{macrocode}
\newcommand*{\nocapbeside}{}
\newcommand*{\capbeside}{}
\newcommand*{\captop}{}
\newlength{\FBwidth}
\setlength{\FBwidth}{.3\linewidth}
\newlength{\FBheight}
\setlength{\FBheight}{2in}
\newcommand*{\useFCwidth}{}
\newcommand{\floatsetup}[2][]{}
\newcommand{\thisfloatsetup}[1]{}
\newcommand{\clearfloatsetup}[1]{}
\newcommand*{\killfloatstyle}{}
% \end{macrocode}
% ^^A \begin{macro}{\newfloatcommand} \marg{1 command} \marg{2 captype}
% ^^A \oarg{3 preamble} \oarg{4 default width}
%
% Preamble and default width are ignored.
% \begin{macrocode}
\NewDocumentCommand{\newfloatcommand}{m m o o}{%
\@namedef{#1}{
\floatbox{#2}
}
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\renewfloatcommand} \marg{1 command} \marg{2 captype}
% ^^A \oarg{3 preamble} \oarg{4 default width}
%
% Preamble and default width are ignored.
% \begin{macrocode}
\NewDocumentCommand{\renewfloatcommand}{m m o o}{%
\@namedef{#1}{%
\floatbox{#2}
}
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\ffigbox} \oarg{width} \oarg{height} \oarg{vposn}
% ^^A \marg{caption commands} \marg{contents}
% \begin{macrocode}
\newfloatcommand{ffigbox}{figure}[\nocapbeside][]
% \end{macrocode}
% ^^A \end{macro}
%
% ^^A \begin{macro}{\ttabbox} \oarg{width} \oarg{height} \oarg{vposn}
% ^^A \marg{caption commands} \marg{contents}
% \changes{v0.15}{2016/03/31}{Fixed \& handling.}
% \begin{macrocode}
\newfloatcommand{ttabbox}{table}[\captop][\FBwidth]
% \end{macrocode}
% ^^A \end{macro}
%
% ^^A \begin{macro}{\fcapside} \oarg{width} \oarg{height} \oarg{vposn}
% ^^A \marg{caption commands} \marg{contents}
% \begin{macrocode}
\newfloatcommand{fcapside}{figure}[\capbeside][]
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{environment}{floatrow} \oarg{numfloats}
% \changes{v0.20}{2016/08/20}{Fix: \cs{linewidth} in a floatrow.}
%
% The row of floats is placed into a |div| of class |floatrow|.
% \begin{macrocode}
\newenvironment*{floatrow}[1][2]
{
\BlockClass{floatrow}
% \end{macrocode}
% While inside the floatrow, divide the \cs{linewidth} by the number of floats.
% \begin{macrocode}
\booltrue{LWR@infloatrow}
\setlength{\linewidth}{6in/#1}
}
{
\boolfalse{LWR@infloatrow}
\endBlockClass
}
% \end{macrocode}
% ^^A \end{environment}
%
% Keys for \cs{DeclareNewFloatType}:
% \begin{macrocode}
\newcommand*{\LWR@frowkeyplacement}{}
\newcommand*{\LWR@frowkeyname}{}
\newcommand*{\LWR@frowkeyfileext}{}
\newcommand*{\LWR@frowkeywithin}{}
\newcommand*{\LWR@frowkeycapstyle}{}
\define@key{frowkeys}{placement}{}%
\define@key{frowkeys}{name}{\renewcommand{\LWR@frowkeyname}{#1}}%
\define@key{frowkeys}{fileext}{\renewcommand{\LWR@frowkeyfileext}{#1}}%
\define@key{frowkeys}{within}{\renewcommand{\LWR@frowkeywithin}{#1}}%
\define@key{frowkeys}{relatedcapstyle}{}%
% \end{macrocode}
% ^^A \begin{macro}{\DeclareNewFloatType} \marg{type} \marg{options}
%
% Use |\listof{type}{Title}| to print a list of the floats.
% \begin{macrocode}
\newcommand*{\DeclareNewFloatType}[2]{%
% \end{macrocode}
% Reset key values:
% \begin{macrocode}
\renewcommand*{\LWR@frowkeyplacement}{}
\renewcommand*{\LWR@frowkeyname}{}
\renewcommand*{\LWR@frowkeyfileext}{}
\renewcommand*{\LWR@frowkeywithin}{}
\renewcommand*{\LWR@frowkeycapstyle}{}
% \end{macrocode}
% Read new key values:
% \begin{macrocode}
\LWR@traceinfo{about to setkeys frowkeys}%
\setkeys{frowkeys}{#2}%
\LWR@traceinfo{finished setkeys frowkeys}%
% \end{macrocode}
% Create a new float with optional [within]:
% \begin{macrocode}
\ifthenelse{\equal{\LWR@frowkeywithin}{}}
{
\LWR@traceinfo{about to newfloat #1 \LWR@frowkeyplacement\ \LWR@frowkeyfileext}%
\newfloat{#1}{\LWR@frowkeyplacement}{\LWR@frowkeyfileext}
}%
{%
\LWR@traceinfo{about to newfloat #1\ \LWR@frowkeyplacement\ \LWR@frowkeyfileext\ \LWR@frowkeywithin}%
\newfloat{#1}{\LWR@frowkeyplacement}%
{\LWR@frowkeyfileext}[\LWR@frowkeywithin]%
\LWR@traceinfo{*** finished newfloat #1}
}%
% \end{macrocode}
% Rename the float if a name was given:
% \begin{macrocode}
\ifthenelse{\equal{\LWR@frowkeyname}{}}
{}
{\floatname{#1}{\LWR@frowkeyname}}%
}
% \end{macrocode}
% ^^A \end{macro}
% Not used:
% \begin{macrocode}
\newcommand{\buildFBBOX}[2]{}
\newcommand*{\CenterFloatBoxes}{}
\newcommand*{\TopFloatBoxes}{}
\newcommand*{\BottomFloatBoxes}{}
\newcommand*{\PlainFloatBoxes}{}
\newcommand{\capsubrowsettings}{}
\NewDocumentCommand{\RawFloats}{o o}{}
% \end{macrocode}
% ^^A \begin{macro}{\RawCaption} \marg{text}
%
% \changes{v0.15}{2016/03/31}{Fix: steps counter}
%
% To be used inside a minipage or parbox.
% \begin{macrocode}
\newcommand{\RawCaption}[1]{#1}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\floatfoot} \marg{text}
%
% Places additional text inside a float,
% inside a \acro{CSS} |div| of class |floatfoot|.
% \begin{macrocode}
\NewDocumentCommand{\floatfoot}{s +m}{%
\begin{BlockClass}{floatfoot}
#2
\end{BlockClass}
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \DescribeBoolean{LWR@insubfloatrow}
% Used to compute \cs{linewidth}.
% \begin{macrocode}
\newbool{LWR@insubfloatrow}
\boolfalse{LWR@insubfloatrow}
% \end{macrocode}
% ^^A \begin{environment}{subfloatrow} \oarg{num\_floats}
% \changes{v0.15}{2016/04/01}{Added}
% \begin{macrocode}
\newenvironment*{subfloatrow}[1][2]
{
% \end{macrocode}
% The row of floats is placed into a |div| of class |floatrow|:
% \begin{macrocode}
\BlockClass{floatrow}
% \end{macrocode}
% While inside the floatrow, |LWR@insubfloatrow| is set true,
% which tells \cs{floatbox} to use \cs{subfigure} or \cs{subtable}.
% \begin{macrocode}
\begingroup
\booltrue{LWR@insubfloatrow}
}
{
\endgroup
\endBlockClass
\boolfalse{LWR@insubfloatrow}
}
% \end{macrocode}
% ^^A \end{environment}
% \iffalse
%</floatrow>
% \fi
% \clearpage
%
% \iffalse
%<*fontenc>
% \fi
%
% \part{lwarp-fontenc.sty}
%
% \section{Fontenc}
%
% \DescribePackage{fontenc}
% Error if \pkg{fontenc} is loaded after \pkg{lwarp}.
%
% \changes{v0.21}{2017/02/22}{\pkg{fontenc}: Added.}
%
% Discard all options for \pkg{lwarp-fontenc}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{fontenc}
% \end{macrocode}
% \begin{macrocode}
\LWR@noloadafter{fontenc}
% \end{macrocode}
% \iffalse
%</fontenc>
% \fi
% \iffalse
%<*fontspec>
% \fi
%
% \part{lwarp-fontspec.sty}
%
% \section{Fontspec}
%
% \DescribePackage{fontspec}
% Error if \pkg{fontspec} is loaded after \pkg{lwarp}.
%
% \changes{v0.21}{2017/02/22}{\pkg{fontspec}: Added.}
%
% Discard all options for \pkg{lwarp-fontspec}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{fontspec}
% \end{macrocode}
% \begin{macrocode}
\LWR@noloadafter{fontspec}
% \end{macrocode}
% \iffalse
%</fontspec>
% \fi
% \clearpage
%
% \iffalse
%<*geometry>
% \fi
% \part{lwarp-geometry.sty}
% \section{Geometry}
%
% \DescribePackage{geometry}
%
% \codehtml
% Discard all options for \pkg{lwarp-geometry}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{geometry}
% \end{macrocode}
% \iffalse
%</geometry>
% \fi
% \clearpage
%
% \iffalse
%<*graphics>
% \fi
% \part{lwarp-graphics.sty}
% \section{Graphics}
%
% \DescribePackage{graphics}
% \pkg{graphics} is not used.
% The user is required to use \pkg{graphicx} instead.
% \codehtml
% \begin{macrocode}
\PackageError{lwarp-graphics}
{The graphics package is not supported by
the lwarp package's HTML conversion.
Please use graphicx instead. \protect\usepackage{graphicx}}
{Graphicx requires a different syntax but is more flexible,
and it is emulated by lwarp.}
% \end{macrocode}
% \iffalse
%</graphics>
% \fi
% \iffalse
%<*graphicx>
% \fi
% \part{lwarp-graphicx.sty}
% \section{Graphicx}
%
% \DescribePackage{graphicx}
% \pkg{graphicx} is emulated during \acro{HTML} output, and
% the \pkg{graphicx} package is ignored.
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackageDrop{graphicx}
% \end{macrocode}
% \iffalse
%</graphicx>
% \fi
% \clearpage
% \iffalse
%<*hyperref>
% \fi
% \part{lwarp-hyperref.sty}
% \section{Hyperref}
%
% \DescribePackage{hyperref}
% \pkg{hyperref} is emulated during \acro{HTML} output, and
% the \pkg{hyperref} package is ignored.
% \changes{v0.20}{2017/01/03}{\pkg{hyperref}: Additional user macros.}
%
% \codehtml
% \begin{macrocode}
% \LWR@ProvidesPackageDrop{hyperref}
\typeout{Using the lwarp html version of package `hyperref' — discarding options.}
\typeout{ Are not using ProvidesPackage, so that other packages}
\typeout{ do not attempt to patch lwarp's version of `hyperref'.}
% \ProvidesPackage{lwarp-#1-#2}
\DeclareOption*{}
\ProcessOptions\relax
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\hypersetup}[1]{}
\newcommand*{\hyperbaseurl}[1]{}
% \end{macrocode}
% ^^A \begin{macro}{\hyperimage} \marg{url} \marg{alt text}
%
% Insert an image with alt text:
% \begin{macrocode}
\NewDocumentCommand{\LWR@hyperimageb}{m +m}{%
\LWR@htmltag{img src="#1" alt="#2" class="hyperimage"{}}%
\endgroup%
\LWR@ensuredoingapar%
}
\newcommand{\hyperimage}{%
\LWR@ensuredoingapar%
\begingroup\catcode`\_=12
\LWR@hyperimageb%
}
% \end{macrocode}
% ^^A \end{macro}
%
%
% ^^A \begin{macro}{\hyperdef} \marg{1: category} \marg{2: name} \marg{3: text}
% Creates an HTML anchor to |category.name| with the given text.
%
% \begin{macrocode}
\NewDocumentCommand{\hyperdef}{m m +m}{%
\LWR@ensuredoingapar%
\LWR@subsublabel{#1.#2}%
#3%
}
% \end{macrocode}
% ^^A \end{macro}
%
%
% ^^A \begin{macro}{\LWR@hyperrefb} \marg{1: URL} \marg{2: category}
% ^^A \marg{3: name} \marg{4: text}
%
% Creates an HTML link to |URL#category.name| with the given text.
% \begin{macrocode}
\NewDocumentCommand{\LWR@hyperrefb}{m m m +m}{%
\LWR@htmltag{a href="#1\LWR@hashmark#2.#3"}%
#4%
\LWR@htmltag{/a}%
\endgroup%
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\LWR@hyperrefc} \oarg{label} \marg{text}
%
% Creates text as an HTML link to the \LaTeX\ label.
% \begin{macrocode}
\NewDocumentCommand{\LWR@hyperrefc}{O{label} +m}{
\LWR@startref{#1}%
#2%
\LWR@htmltag{/a}%
\endgroup%
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\hyperref}
% ^^A \marg{1: URL} \marg{2: category} \marg{3: name} \marg{4: text} \quad -or-
%
% ^^A \oarg{1: label} \marg{2: text}
%
% \begin{macrocode}
\newcommand{\hyperref}{%
\LWR@ensuredoingapar%
\begingroup\catcode`\_=12
\@ifnextchar[\LWR@hyperrefc\LWR@hyperrefb%
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\hypertarget} \marg{name} \marg{text}
% Creates an anchor to |name| with the given text.
%
% \begin{macrocode}
\NewDocumentCommand{\hypertarget}{m +m}{%
\label{#1}%
#2%
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\hyperlink} \marg{name} \marg{text}
%
% Creates a link to the anchor created by hypertarget,
% with the given link text.
%
% \begin{macrocode}
\NewDocumentCommand{\hyperlink}{m +m}{%
\hyperref[#1]{#2}%
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\autoref} * \marg{label}
%
% For \acro{HTML}, \cs{cleverref} is used instead.
%
% \begin{macrocode}
\NewDocumentCommand{\autoref}{s m}{%
\IfBooleanTF{#1}{\ref{#2}}{\cref{#2}}%
}
% \end{macrocode}
% ^^A \end{macro}
%
%
% ^^A \begin{macro}{\autopageref} \marg{label}
%
% For \acro{HTML}, \cs{cleverref} is used instead.
%
% \begin{macrocode}
\NewDocumentCommand{\autopageref}{s m}{%
\IfBooleanTF{#1}{\cpageref{#2}}{\cref{#2}}%
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\pdfstringdef} \marg{macroname} \marg{\TeX{}string}
%
% \begin{macrocode}
\newcommand{\pdfstringdef}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\pdfbookmark} \oarg{level} \marg{text} \marg{name}
%
% \begin{macrocode}
\newcommand{\pdfbookmark}[3][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\currentpdfbookmark} \marg{text} \marg{name}
%
% \begin{macrocode}
\newcommand{\currentpdfbookmark}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\subpdfbookmark} \marg{text} \marg{name}
%
% \begin{macrocode}
\newcommand{\subpdfbookmark}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\belowpdfbookmark} \marg{text} \marg{name}
%
% \begin{macrocode}
\newcommand{\belowpdfbookmark}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\texorpdfstring} \marg{\TeX{}string} \marg{PDFstring}
%
% \begin{macrocode}
\newcommand{\texorpdfstring}[2]{#2}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\hypercalcbp} \marg{dimen} \quad
% From \pkg{hyperref}.
%
% \begin{macrocode}
\def\hypercalcbp#1{%
\strip@pt\dimexpr 0.99626401\dimexpr(#1)\relax\relax
}%
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\Acrobatmenu} \marg{menuoption} \marg{text}
%
% \begin{macrocode}
\newcommand{\Acrobatmenu}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\TextField} \oarg{parameters} \marg{label}
%
% \begin{macrocode}
\newcommand*{\TextField}[2][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\CheckBox} \oarg{parameters} \marg{label}
%
% \begin{macrocode}
\newcommand*{\CheckBox}[2][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\ChoiceMenu} \oarg{parameters} \marg{label} \marg{choices}
%
% \begin{macrocode}
\newcommand{\ChoiceMenu}[3][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\PushButton} \oarg{parameters} \marg{label}
%
% \begin{macrocode}
\newcommand*{\PushButton}[2][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\Submit} \oarg{parameters} \marg{label}
%
% \begin{macrocode}
\newcommand*{\Submit}[2][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\Reset} \oarg{parameters} \marg{label}
%
% \begin{macrocode}
\newcommand*{\Reset}[2][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\LayoutTextField} \marg{label} \marg{field}
%
% \begin{macrocode}
\newcommand*{\LayoutTextField}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\LayoutChoiceField} \marg{label} \marg{field}
%
% \begin{macrocode}
\newcommand*{\LayoutChoiceField}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\LayoutCheckField} \marg{label} \marg{field}
%
% \begin{macrocode}
\newcommand*{\LayoutCheckField}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\MakeRadioField} \marg{width} \marg{height}
%
% \begin{macrocode}
\newcommand*{\MakeRadioField}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\MakeCheckField} \marg{width} \marg{height}
%
% \begin{macrocode}
\newcommand*{\MakeCheckField}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\MakeTextField} \marg{width} \marg{height}
%
% \begin{macrocode}
\newcommand*{\MakeTextField}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\MakeChoiceField} \marg{width} \marg{height}
%
% \begin{macrocode}
\newcommand*{\MakeChoiceField}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\MakeFieldButton} \marg{text}
%
% \begin{macrocode}
\newcommand{\MakeFieldButton}[1]{}
% \end{macrocode}
% ^^A \end{macro}
% \iffalse
%</hyperref>
% \fi
% \clearpage
%
% \iffalse
%<*inputenc>
% \fi
%
% \part{lwarp-inputenc.sty}
%
% \section{Inputenc}
%
% \DescribePackage{inputenc}
% Error if \pkg{inputenc} is loaded after \pkg{lwarp}.
%
% \changes{v0.21}{2017/02/22}{\pkg{inputenc}: Added.}
%
% Discard all options for \pkg{lwarp-inputenc}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{inputenc}
% \end{macrocode}
% \begin{macrocode}
\LWR@noloadafter{inputenc}
% \end{macrocode}
% \iffalse
%</inputenc>
% \fi
% \clearpage
% \iffalse
%<*keyfloat>
% \fi
% \part{lwarp-keyfloat.sty}
% \section{Keyfloat}
% \label{sec:keyfloat}
%
% \DescribePackage{keyfloat}
% \pkg{keyfloat} is supported with minor adjustments.
%
% \changes{v0.20}{2017/01/16}{\pkg{keyfloat}: Added.}
%
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackagePass{keyfloat}
% \end{macrocode}
% After \pkg{keyfloat} has loaded:
% \begin{macrocode}
\AtBeginDocument{
% \end{macrocode}
% \begin{macrocode}
% \newsavebox{\KFLT@envbox}
\let\KFLT@boxinner\relax
\let\endKFLT@boxinner\relax
\NewEnviron{KFLT@boxinner}
{%
\LWR@traceinfo{kflt@boxinner}%
\LWR@stoppars%
\KFLT@frame{\BODY}%
\LWR@startpars%
\LWR@traceinfo{ended kflt@boxinner}%
}
% \end{macrocode}
% \begin{macrocode}
\RenewDocumentEnvironment{KFLT@marginfloat}{O{-1.2ex} m}
{% start
\LWR@maybeincthisfloat%
% \BlockClass{marginblock}
\LWR@stoppars%
\LWR@htmltag{div class="marginblock" id="autofloat-\arabic{LWR@thisfloat}"}
\LWR@startpars%
\captionsetup{type=#2}%
}
{
% \endBlockClass
\LWR@htmldivclassend{div}
}
% \end{macrocode}
% \begin{macrocode}
}% AtBeginDocument
% \end{macrocode}
% \iffalse
%</keyfloat>
% \fi
% \clearpage
% \iffalse
%<*letterspace>
% \fi
% \part{lwarp-letterspace.sty}
% \section{Letterspace}
%
% \DescribePackage{letterspace}
% \pkg{letterspace} is a subset of microtype, which is pre-loaded by \pkg{lwarp}.
% All user options and macros are ignored and disabled.
% \changes{v0.20}{2017/01/03}{\pkg{letterspace}: User-interface emulated.}
%
% \codehtml
%
% Discard all options for \pkg{lwarp-letterspace}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{letterspace}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\lsstyle{}
\newcommand\textls[2][]{}
\def\textls#1#{}
\newcommand*\lslig[1]{#1}
% \end{macrocode}
% \iffalse
%</letterspace>
% \fi
% \clearpage
% \iffalse
%<*listings>
% \fi
% \part{lwarp-listings.sty}
% \section{Listings}
% \label{sec:listings}
%
% \DescribePackage{listings}
% \pkg{listings} is supported with some limitations.
% Text formatting is not yet supported.
%
% \changes{v0.20}{2017/01/01}{\pkg{listings}: Added.}
%
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
%
%
% \begin{macrocode}
\LWR@ProvidesPackagePass{listings}
% \end{macrocode}
% ^^A For passing optional arguments to an environment, see:
% ^^A \href
% ^^A {http://tex.stackexchange.com/questions/9035/how-to-pass-an-optional-argument-to-an-environment-with-verbatim-content}
% ^^A {\texttt{http://tex.stackexchange.com/questions/9035/ \\
% ^^A \hspace*{3em}how-to-pass-an-optional-argument-to-\\
% ^^A \hspace*{3em}an-environment-with-verbatim-content}}
%
%
%
% Patches to embed listings inside |pre| tags:
%
% \begin{macrocode}
\let\LWR@origlst@Init\lst@Init
\let\LWR@origlst@DeInit\lst@DeInit
\let\LWR@origlsthkEveryPar\lsthk@EveryPar
\renewcommand{\l@lstlisting}[2]{\hypertocfloat{1}{toclstlisting}{#1}{#2}}
% \end{macrocode}
%
%
% ^^A \begin{macro}{\lst@Init} \marg{backslash-processing}
% Done at the start of a listing.
% \begin{macrocode}
\renewcommand{\lst@Init}[1]{%
% \end{macrocode}
% First, perform the \pkg{listings} initialization:
% \begin{macrocode}
\LWR@traceinfo{lst@Init}%
\renewcommand*{\@captype}{lstlisting}%
\LWR@origlst@Init{#1}%
\LWR@traceinfo{finished origlst@Init}%
\lst@ifdisplaystyle%
% \end{macrocode}
% Creating a display.
%
% Disable line numbers,
% produce the |<pre>|, then
% reenable line numbers.
% \begin{macrocode}
\LWR@traceinfo{About to create verbatim.}%
\let\lsthk@EveryPar\relax%
\LWR@atbeginverbatim{programlisting}%
\let\lsthk@EveryPar\LWR@origlsthkEveryPar%
\else%
% \end{macrocode}
% Inline, so open a |<span>|
% \begin{macrocode}
\ifbool{LWR@verbtags}{\LWR@htmltag{span class="inlineprogramlisting"}}{}%
\fi%
}
% \end{macrocode}
% ^^A \end{macro}
%
%
% ^^A \begin{macro}{\lst@DeInit} Done at the end of a listing.
% \begin{macrocode}
\renewcommand*{\lst@DeInit}{%
\lst@ifdisplaystyle%
% \end{macrocode}
% Creating a display.
%
% Disable line numbers,
% produce the |</pre>|, then
% reenable line numbers:
% \begin{macrocode}
\let\lsthk@EveryPar\relax%
\LWR@afterendverbatim%
\let\lsthk@EveryPar\LWR@origlsthkEveryPar%
\else%
% \end{macrocode}
% Inline, so create the closing |</span>|:
% \begin{macrocode}
\ifbool{LWR@verbtags}{\noindent\LWR@htmltag{/span}}{}%
\fi%
% \end{macrocode}
% Final \pkg{listings} deinit:
% \begin{macrocode}
\LWR@origlst@DeInit%
}
% \end{macrocode}
% ^^A \end{macro}
%
%
%
% ^^A \begin{macro}{\lst@MakeCaption} \marg{t/b}
%
% This is called BOTH at the top and at the bottom of each listing.
%
% Patched for \pkg{lwarp}.
% \begin{macrocode}
\def\lst@MakeCaption#1{%
\LWR@traceinfo{MAKING CAPTION at #1}%
\lst@ifdisplaystyle
\LWR@traceinfo{making a listings display caption}%
\ifx #1t%
\ifx\lst@@caption\@empty\expandafter\lst@HRefStepCounter \else
\expandafter\refstepcounter
\fi {lstlisting}%
\LWR@traceinfo{About to assign label: !\lst@label!}%
% \ifx\lst@label\@empty\else
% \label{\lst@label}\fi
\LWR@traceinfo{Finished assigning the label.}%
\let\lst@arg\lst@intname \lst@ReplaceIn\lst@arg\lst@filenamerpl
\global\let\lst@name\lst@arg \global\let\lstname\lst@name
\lst@ifnolol\else
\ifx\lst@@caption\@empty
\ifx\lst@caption\@empty
\ifx\lst@intname\@empty \else \def\lst@temp{ }%
\ifx\lst@intname\lst@temp \else
% \end{macrocode}
% This code places a contents entry for a non-float.
% This would have to be modified for \pkg{lwarp}:
% \begin{macrocode}
\LWR@traceinfo{addcontents lst@name: -\lst@name-}%
% \addcontentsline{lol}{lstlisting}{\lst@name}
\fi\fi
\fi
\else
% \end{macrocode}
% This would have to be modified for \pkg{lwarp}:
% \begin{macrocode}
\LWR@traceinfo{addcontents lst@@caption: -\lst@@caption-}%
\addcontentsline{lol}{lstlisting}%
{\protect\numberline{\thelstlisting}{\protect\ignorespaces \lst@@caption \protect\relax}}%
\fi
\fi
\fi
\ifx\lst@caption\@empty\else
\LWR@traceinfo{lst@caption not empty-}%
\lst@IfSubstring #1\lst@captionpos
{\begingroup
\LWR@traceinfo{at the selected position}%
% \end{macrocode}
% These space and box commands are not needed for \acro{HTML} output:
% \begin{macrocode}
% \let\@@vskip\vskip
% \def\vskip{\afterassignment\lst@vskip \@tempskipa}%
% \def\lst@vskip{\nobreak\@@vskip\@tempskipa\nobreak}%
% \par\@parboxrestore\normalsize\normalfont % \noindent (AS)
% \ifx #1t\allowbreak \fi
\ifx\lst@title\@empty
% \end{macrocode}
% New \pkg{lwarp} code to create a caption:
% \begin{macrocode}
\lst@makecaption\fnum@lstlisting{\ignorespaces \lst@caption}
\else
% \end{macrocode}
% New \pkg{lwarp} code to create a title:
% \begin{macrocode}
% \lst@maketitle\lst@title % (AS)
\LWR@traceinfo{Making title: \lst@title}%
\begin{BlockClass}{lstlistingtitle}% lwarp
\lst@maketitle\lst@title% lwarp
\end{BlockClass}% lwarp
\fi
\LWR@traceinfo{About to assign label: !\lst@label!}%
\ifx\lst@label\@empty\else
\leavevmode% gets rid of bad space factor error
\GetTitleStringExpand{\lst@caption}%
\edef\LWR@lntemp{\GetTitleStringResult}%
\edef\@currentlabelname{\detokenize\expandafter{\LWR@lntemp}}%
\label{\lst@label}\fi
\LWR@traceinfo{Finished assigning the label.}%
% \end{macrocode}
% Not needed for \pkg{lwarp}:
% \begin{macrocode}
% \ifx #1b\allowbreak \fi
\endgroup}{}%
\fi
\LWR@traceinfo{end of making a listings display caption}%
\else
\LWR@traceinfo{INLINE}%
\fi
\LWR@traceinfo{DONE WITH CAPTION at #1}%
}
% \end{macrocode}
% ^^A \end{macro}
%
%
% Patched to keep left line numbers outside of the left margin, and
% place right line numbers in a field \cs{VerbatimHTMLWidth} wide.
%
% ^^A \DescribeKey[listings]{numbers} Activates line numbers.
% \begin{macrocode}
\lst@Key{numbers}{none}{%
\let\lst@PlaceNumber\@empty
\lstKV@SwitchCases{#1}%
{none&\\%
left&\def\lst@PlaceNumber{%
% \llap{
\LWR@orignormalfont%
\lst@numberstyle{\thelstnumber}\kern\lst@numbersep%
% }
}
\\%
right&\def\lst@PlaceNumber{\rlap{\LWR@orignormalfont
\kern\VerbatimHTMLWidth \kern\lst@numbersep
\lst@numberstyle{\thelstnumber}}}%
}{\PackageError{Listings}{Numbers #1 unknown}\@ehc}}
\end{warpHTML}
% \end{macrocode}
% \iffalse
%</listings>
% \fi
% \clearpage
% \iffalse
%<*longtable>
% \fi
% \part{lwarp-longtable.sty}
% \section{Longtable}
% \label{sec:longtable}
%
%
% \DescribePackage{longtable}
% \pkg{longtable} is emulated during \acro{HTML} output, and
% the \pkg{longtable} package is ignored.
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackageDrop{longtable}
% \end{macrocode}
%
% To emulate longtable:
% For longtable |\endhead|, |\endfoot|, and |\endlastfoot| rows, use \\
% \watchout
% \hspace*{.25in}|\warpprintonly{row contents}|\\
% instead of \\
% \hspace*{.25in}|\begin{warpprint}| \ldots |\end{warpprint}|. \\
% Doing so helps avoid ``Misplaced |\noalign|.'' when using |\begin{warpprint}|.
%
% Keep the |\endfirsthead| row, which is still relevent to \acro{HTML} output.
%
% See: \\
% \href{http://tex.stackexchange.com/questions/43006/why-is-input-not-expandable}
% {\texttt{http://tex.stackexchange.com/questions/43006/\\why-is-input-not-expandable}}
%
% \begin{environment}{longtable} * \oarg{horizalignment} \marg{colspec}
% Emulates the \env{longtable} environment.
%
% Per the \pkg{caption} package, the starred version steps the counter per caption.
% The unstarred version steps the counter once at the beginning, but
% not at each caption.
%
% Options [c], [l], and [r] are thrown away.
% \begin{macrocode}
\newenvironment{longtable*}[2][]{%
\LWR@floatbegin{table}%
\setcaptiontype{\LTcaptype}%
\caption@setoptions{longtable}%
\caption@setoptions{@longtable}%
\caption@LT@setup%
\booltrue{LWR@starredlongtable}%
\let\captionlistentry\LWR@LTcaptionlistentry%
\LWR@tabular{#2}
}
{\endLWR@tabular\LWR@floatend}
\newenvironment{longtable}[2][]{%
\LWR@floatbegin{table}%
\setcaptiontype{\LTcaptype}%
\caption@setoptions{longtable}%
\caption@setoptions{@longtable}%
\caption@LT@setup%
\refstepcounter{\LTcaptype}%
\let\captionlistentry\LWR@LTcaptionlistentry%
\LWR@tabular{#2}
}
{\endLWR@tabular\LWR@floatend}
% \end{macrocode}
% \end{environment}
% Provided for compatibility, but ignored:
% \begin{macrocode}
\newcounter{LTchunksize}
\def\endhead{\LWR@tabularendofline}% throws away options //[dim] and //*
\def\endfirsthead{\LWR@tabularendofline}
\def\endfoot{\LWR@tabularendofline}
\def\endlastfoot{\LWR@tabularendofline}
\newcommand\tabularnewline{\LWR@tabularendofline}
\newcommand{\setlongtables}{}% Obsolete command, does nothing.
\newlength{\LTleft}
\newlength{\LTright}
\newlength{\LTpre}
\newlength{\LTpost}
\newlength{\LTcapwidth}
% \end{macrocode}
% |\kill| is ignored, place a |\kill| line inside \\
% \hspace*{2em}|\begin{warpprint}| \ldots |\end{warpprint}|
% or \cs{warpingprintonly}.
% \begin{macrocode}
\renewcommand*{\kill}{\LWR@tabularendofline}
% \end{macrocode}
% \iffalse
%</longtable>
% \fi
% \clearpage
% \iffalse
%<*ltcaption>
% \fi
% \part{lwarp-ltcaption.sty}
% \section{Ltcaption}
% \label{sec:ltcaption}
%
%
% \DescribePackage{ltcaption}
% \pkg{ltcaption} is emulated during \acro{HTML} output, and
% the \pkg{ltcaption} package is ignored.
% \changes{v0.20}{2017/01/29}{\pkg{ltcaption}: Added.}
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackageDrop{ltcaption}
% \end{macrocode}
%
% \cs{LTcaptype} is already defined by \pkg{lwarp}.
%
% \env{longtable*} is already defined by \pkg{lwarp-longtable}.
%
% \begin{macrocode}
\newlength{\LTcapskip}
\newlength{\LTcapleft}
\newlength{\LTcapright}
\newcommand*{\LTcapmarginsfalse}{}
% \end{macrocode}
% \iffalse
%</ltcaption>
% \fi
% \clearpage
% \iffalse
%<*mdframed>
% \fi
% \part{lwarp-mdframed.sty}
% \section{Mdframed}
% \label{sec:mdframed}
%
%
% \DescribePackage{mdframed}
% \pkg{mdframed} is loaded with options forced to
% |framemethod=none|.
%
% \changes{v0.17}{2016/04/14}{\pkg{mdframed}: Added.}
%
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackageDrop{mdframed}
% \end{macrocode}
%
%
%
% \limitsmdframed
%
% Environments created or encapsulated by \pkg{mdframed} are enclosed in a
% \margintag{CSS classes}
% |div| of class |md<environmentname>|, or |mdframed| otherwise.
%
% Frame titles are placed into a |span| of class |mdframedtitle|.
% Subtitles are in a |span| of class |mdframedsubtitle|, and likewise for subsubtitles.
%
% Pre-existing hooks are used to patch extra functions before and after the frames.
%
% \pkg{amsthm} must be loaded before \pkg{mdframed}
% \begin{macrocode}
\LWR@origRequirePackage{amsthm}
% \end{macrocode}
%
% Do not require \tikz{} or pstricks:
% \begin{macrocode}
\LWR@origRequirePackage[framemethod=none]{mdframed}
% \end{macrocode}
%
% ^^A \DescribeMacro{\mdfsetup}
% To handle CSS and paragraphs,
% patch code at start and end of environment and contents:
% \begin{macrocode}
\mdfsetup{
startcode={\LWR@mdframedstart},
endcode={\LWR@mdframedend},
startinnercode={\LWR@startpars},
endinnercode={\LWR@stoppars},
}
% \end{macrocode}
%
%
% ^^A \begin{macro}{\LWR@mdfprintcolor} \marg{mdfcolorkey}
%
% Given the \pkg{mdframed} key, print the color.
% \begin{macrocode}
\newcommand*{\LWR@mdfprintcolor}[1]{%
\convertcolorspec{named}{\csuse{mdf@#1}}{HTML}\LWR@tempcolor%
\#\LWR@tempcolor
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\LWR@mdfprintlength} \marg{mdflengthkey}
%
% Given the \pkg{mdframed} key, print the length.
% \begin{macrocode}
\newcommand*{\LWR@mdfprintlength}[1]{%
\rndprintlength{\csuse{mdf@#1@length}}
}
% \end{macrocode}
% ^^A \end{macro}
%
% ^^A \begin{macro}{\LWR@mdframedstart}
% Actions before an mdframe starts.
%
% Encapsulate a frame inside a |div| of the desired |class|.
% \begin{macrocode}
\newcommand*{\LWR@mdframedstart}{%
% \end{macrocode}
% Turn off paragraph handling during the generation of
% the encapsulating tags:
% \begin{macrocode}
\LWR@stoppars%
% \end{macrocode}
% Below, print HTML pt units:
% \begin{macrocode}
\uselengthunit{PT}%
% \end{macrocode}
% Open a |div| and with custom |class| and custom |style|:
% \begin{macrocode}
\LWR@htmltagc{div class="\LWR@mdthisenv" \LWR@orignewline
style=" \LWR@orignewline
% \end{macrocode}
% Convert and print the background color:
% \begin{macrocode}
background: \LWR@mdfprintcolor{backgroundcolor} ; \LWR@orignewline
% \end{macrocode}
% Convert and print the border color and width:
% \begin{macrocode}
border: \LWR@mdfprintlength{linewidth} solid
\LWR@mdfprintcolor{linecolor} ; \LWR@orignewline
% \end{macrocode}
% Convert and print the border radius:
% \begin{macrocode}
border-radius: \LWR@mdfprintlength{roundcorner} ; \LWR@orignewline
% \end{macrocode}
% Convert and print the shadow:
% \begin{macrocode}
\ifbool{mdf@shadow}{%
box-shadow:
\LWR@mdfprintlength{shadowsize}
\LWR@mdfprintlength{shadowsize}
\LWR@mdfprintlength{shadowsize}
\LWR@mdfprintcolor{shadowcolor} ;
}
{box-shadow: none ;}
\LWR@orignewline
% \end{macrocode}
% \begin{macrocode}
"}
% \LWR@htmldivclass{\LWR@mdthisenv}
% \end{macrocode}
% \env{mdframed} environment may not work with the modified \cs{hspace} and \cs{rule},
% so restore them to their originals while inside \env{mdframed}:
% \begin{macrocode}
\let\hspace\LWR@orighspace%
\let\rule\LWR@origrule%
}
% \end{macrocode}
% ^^A \end{macro}
%
% ^^A \begin{macro}{\LWR@mdframedend}
% Actions after an mdframe ends.
%
% After closing the |div|, globally restore to the default environment type:
% \begin{macrocode}
\newcommand*{\LWR@mdframedend}{
% \end{macrocode}
% Close the custom |div|:
% \begin{macrocode}
\LWR@htmldivclassend{\LWR@mdthisenv}
% \end{macrocode}
% Reset future custom class to the default:
% \begin{macrocode}
\gdef\LWR@mdthisenv{mdframed}
% \end{macrocode}
% Resume paragraph handling:
% \begin{macrocode}
\LWR@startpars%
}
% \end{macrocode}
% ^^A \end{macro}
%
%
% ^^A \begin{macro}{\mdfframedtitleenv} \marg{title}
%
% Encapsulation of the original which places the title
% inside a |span| of class |mdframedtitle|:
% \begin{macrocode}
\let\LWR@origmdfframedtitleenv\mdfframedtitleenv
\newlength{\LWR@titleroundcorner}
\renewrobustcmd\mdfframedtitleenv[1]{%
\LWR@origmdfframedtitleenv{%
% \end{macrocode}
% Below, print HTML pt lengths:
% \begin{macrocode}
\uselengthunit{PT}%
% \end{macrocode}
% Open a |span| with a custom |class| and custom |style|:
% \begin{macrocode}
\LWR@htmltagc{span class="mdframedtitle" \LWR@orignewline
style=" \LWR@orignewline
% \end{macrocode}
% Convert and print the title background color:
% \begin{macrocode}
background:
\LWR@mdfprintcolor{frametitlebackgroundcolor}
; \LWR@orignewline
% \end{macrocode}
% Convert and print the title rule:
% \begin{macrocode}
\ifbool{mdf@frametitlerule}{%
border-bottom:
\LWR@mdfprintlength{frametitlerulewidth}
solid
\LWR@mdfprintcolor{frametitlerulecolor}
; \LWR@orignewline
}{}%
% \end{macrocode}
% The title's top border radius is adjusted for the line width:
% \begin{macrocode}
border-radius:
\setlength{\LWR@titleroundcorner}
{\maxof{\mdf@roundcorner@length-\mdf@linewidth@length}{0pt}}
\rndprintlength{\LWR@titleroundcorner}
\rndprintlength{\LWR@titleroundcorner}
0pt 0pt
\LWR@orignewline
% \end{macrocode}
% Finish the custom style and the opening span tag:
% \begin{macrocode}
" \LWR@orignewline
}% span
% \end{macrocode}
% Restrict paragraph tags inside a span:
% \begin{macrocode}
\begin{LWR@nestspan}%
% \end{macrocode}
% Print the title inside the span:
% \begin{macrocode}
#1%
% \end{macrocode}
% Closee the span and unnest the paragraph tag restriction:
% \begin{macrocode}
\LWR@htmltagc{/span}%
\end{LWR@nestspan}%
}
}
% \end{macrocode}
% ^^A \end{macro}
%
%
% ^^A \begin{macro}{\LWR@mdfsubtitlecommon} \marg{sub -or subsub} \oarg{options} \marg{title}
%
% Common code for \cs{LWR@mdfsubtitle} and \cs{LWR@mdfsubsubtitle}.
%
% Encapsulate the subtitle inside a |span| of class |mdframedsubtitle|:
% \begin{macrocode}
\NewDocumentCommand{\LWR@mdfsubtitlecommon}{m o m}
{% the following empty line is required
% \end{macrocode}
% Special handling for mdframed:
% Subtitles have \cs{par}s around them,
% so temporarily disable them here.
% \begin{macrocode}
\let\par\LWR@origpar%
% \end{macrocode}
% Open a |span| with a custom |class| and custom |style|:
% \begin{macrocode}
\LWR@htmltagc{span class="mdframed#1title"
style=" \LWR@orignewline
% \end{macrocode}
% Convert and print the background color:
% \begin{macrocode}
background:
\LWR@mdfprintcolor{#1titlebackgroundcolor}
; \LWR@orignewline
% \end{macrocode}
% Convert and print the above line:
% \begin{macrocode}
\ifbool{mdf@#1titleaboveline}{%
border-top:
\LWR@mdfprintlength{#1titleabovelinewidth}
solid
\LWR@mdfprintcolor{#1titleabovelinecolor}
; \LWR@orignewline
}{}%
% \end{macrocode}
% Convert and print the below line:
% \begin{macrocode}
\ifbool{mdf@#1titlebelowline}{%
border-bottom:
\LWR@mdfprintlength{#1titlebelowlinewidth}
solid
\LWR@mdfprintcolor{#1titlebelowlinecolor}
; \LWR@orignewline
}{}%
% \end{macrocode}
% Finish the custom style and the opening span tag:
% \begin{macrocode}
"}% span
% \end{macrocode}
% Restrict paragraph tags inside a span:
% \begin{macrocode}
\begin{LWR@nestspan}%
% \end{macrocode}
% Perform the original subtitle action:
% \begin{macrocode}
\IfNoValueTF{#2}
{\csuse{LWR@origmdf#1title}{#3}}%
{\csuse{LWR@origmdf#1title}[#2]{#3}}%
% \end{macrocode}
% Close the span and unnest the paragraph tag restriction:
% \begin{macrocode}
\LWR@htmltagc{/span}% the following empty line is required
\end{LWR@nestspan}% must follow the /span or an extra <p> appears
}
% \end{macrocode}
% ^^A \end{macro}
%
% ^^A \begin{macro}{\LWR@mdfsubtitle} \oarg{options} \marg{title}
% \begin{macrocode}
\let\LWR@origmdfsubtitle\mdfsubtitle
\newcommand*{\LWR@mdfsubtitle}{%
\LWR@mdfsubtitlecommon{sub}%
}
\let\mdfsubtitle\LWR@mdfsubtitle
% \end{macrocode}
% ^^A \end{macro}
%
%
% ^^A \begin{macro}{\LWR@mdfsubsubtitle} \oarg{options} \marg{title}
% \begin{macrocode}
\let\LWR@origmdfsubsubtitle\mdfsubsubtitle
\newcommand*{\LWR@mdfsubsubtitle}{%
\LWR@mdfsubtitlecommon{subsub}%
}
\let\mdfsubsubtitle\LWR@mdfsubsubtitle
% \end{macrocode}
% ^^A \end{macro}
%
%
%
% ^^A \begin{macro}{\LWR@mdthisenv}
% Stores the environment of the frame about to be created:
% \begin{macrocode}
\newcommand*{\LWR@mdthisenv}{mdframed}
% \end{macrocode}
% ^^A \end{macro}
%
%
% ^^A \begin{macro}{\newmdenv} \oarg{options} \marg{env-name}
%
% Modified from the original to remember the environment.
% \begin{macrocode}
\renewrobustcmd*\newmdenv[2][]{%
\newenvironment{#2}%
{%
\mdfsetup{#1}%
\renewcommand*{\LWR@mdthisenv}{md#2}%
\begin{mdframed}%
}
{\end{mdframed}}%
}
% \end{macrocode}
% ^^A \end{macro}
%
% ^^A \begin{macro}{\surroundwithmdframed} \oarg{options} \marg{environment}
%
% Modified from the original to remember the environment.
% \begin{macrocode}
\renewrobustcmd*{\surroundwithmdframed}[2][]{%
\BeforeBeginEnvironment{#2}{%
\renewcommand*{\LWR@mdthisenv}{md#2}%
\begin{mdframed}[#1]}%
\AfterEndEnvironment{#2}{\end{mdframed}}%
}
% \end{macrocode}
% ^^A \end{macro}
%
%
% ^^A \begin{macro}{\mdtheorem} \oarg{mdframed-options}{envname}
% \oarg{numberedlike} \marg{caption} \oarg{within}
%
% Modified from the original to remember the environment.
% \begin{macrocode}
\let\LWR@origmdtheorem\mdtheorem
\DeclareDocumentCommand{\LWR@mdtheorem}{O{} m o m o}{%
\LWR@origmdtheorem[#1]{#2}[#3]{#4}[#5]%
\BeforeBeginEnvironment{#2}{\renewcommand*{\LWR@mdthisenv}{md#2}}%
}
\let\mdtheorem\LWR@mdtheorem
% \end{macrocode}
% ^^A \end{macro}
%
%
% ^^A \begin{macro}{\newmdtheoremenv} \oarg{mdframed-options}{envname}
% \oarg{numberedlike} \marg{caption} \oarg{within}
%
% Modified from the original to remember the environment.
% \begin{macrocode}
\DeclareDocumentCommand\newmdtheoremenv{O{} m o m o }{%
\ifboolexpr{ test {\IfNoValueTF {#3}} and test {\IfNoValueTF {#5}} }%
{\newtheorem{#2}{#4}}{%
\IfValueTF{#3}{\newtheorem{#2}[#3]{#4}}{}%
\IfValueTF{#5}{\newtheorem{#2}{#4}[#5]}{}%
}%
\BeforeBeginEnvironment{#2}{%
\renewcommand*{\LWR@mdthisenv}{md#2}%
\begin{mdframed}[#1]}%
\AfterEndEnvironment{#2}{%
\end{mdframed}}%
}
% \end{macrocode}
% ^^A \end{macro}
% \iffalse
%</mdframed>
% \fi
% \clearpage
% \iffalse
%<*microtype>
% \fi
% \part{lwarp-microtype.sty}
% \section{Microtype}
%
% \DescribePackage{microtype}
% \pkg{microtype} is pre-loaded by \pkg{lwarp}.
% All user options and macros are ignored and disabled.
% \changes{v0.20}{2017/01/03}{\pkg{microtype}: User-interface emulated.}
%
% \codehtml
%
% Discard all options for \pkg{lwarp-microtype}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{microtype}
% \end{macrocode}
% \begin{macrocode}
\renewcommand*\DeclareMicrotypeSet[3][]{}
\renewcommand*\UseMicrotypeSet[2][]{}
\renewcommand*\DeclareMicrotypeSetDefault[2][]{}
\renewcommand*\SetProtrusion[3][]{}
\renewcommand*\SetExpansion[3][]{}
\renewcommand*\SetTracking[3][]{}
\renewcommand*\SetExtraKerning[3][]{}
\renewcommand*\SetExtraSpacing[3][]{}
\renewcommand*\DisableLigatures[2][]{}
\renewcommand*\DeclareCharacterInheritance[3][]{}
\renewcommand*\DeclareMicrotypeVariants[1]{}
\renewcommand*\DeclareMicrotypeAlias[2]{}
\renewcommand*\LoadMicrotypeFile[1]{}
\renewcommand*\DeclareMicrotypeBabelHook[2]{}
\renewcommand*\microtypesetup[1]{}
\renewcommand*\microtypecontext[1]{}
\renewcommand*\textmicrotypecontext[2]{#2}
\@ifpackageloaded{letterspace}{\let\MT@textls\relax}{%
\renewcommand*\lsstyle{}
\renewcommand\textls[2][]{}
\def\textls#1#{}
\renewcommand*\lslig[1]{#1}
}
\def\DeclareMicrotypeSet#1#{\@gobbletwo}
\def\DeclareMicrotypeVariants#1#{\@gobble}
\@onlypreamble\DeclareMicrotypeSet
\@onlypreamble\UseMicrotypeSet
\@onlypreamble\DeclareMicrotypeSetDefault
\@onlypreamble\DisableLigatures
\@onlypreamble\DeclareMicrotypeVariants
\@onlypreamble\DeclareMicrotypeBabelHook
% \end{macrocode}
% \iffalse
%</microtype>
% \fi
% \clearpage
% \iffalse
%<*multicol>
% \fi
% \part{lwarp-multicol.sty}
% \section{Multicol}
% \label{sec:multicol}
%
%
% \DescribePackage{multicol}
% \pkg{multicol} is emulated during \acro{HTML} output, and
% the \pkg{multicol} package is ignored.
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackageDrop{multicol}[2015/09/13]
% \end{macrocode}
% Multicols are converted into a 1--3 column display, browser-supported.
% The optional multicols heading is placed inside a |div| of class |multicolsheading|.
% The content is placed inside a |div| of class |multicols|.
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% ^^A \begin{environment}{multicols} * \marg{numcols} \oarg{heading}
% \begin{macrocode}
\NewDocumentEnvironment{multicols}{s m o}
% \end{macrocode}
% \acro{HTML} div class to contain everything:
% \begin{macrocode}
{\BlockClass{multicols}
% \end{macrocode}
% Optional \acro{HTML} div class for the heading:
% \begin{macrocode}
\IfValueTF{#3}{\begin{BlockClass}{multicolsheading}#3\end{BlockClass}}{}}
% \end{macrocode}
% When done with the environment, close the div:
% \begin{macrocode}
{\endBlockClass}
% \end{macrocode}
% ^^A \end{environment}
% Emulated null functions which are not used in \acro{HTML}:
% \begin{macrocode}
\newcommand*{\columnbreak}{}
\newcommand*{\RLmulticolcolumns}{}
\newcommand*{\LRmulticolcolumns}{}
\newlength{\premulticols}
\newlength{\postmulticols}
\newlength{\multicolsep}
\newlength{\multicolbaselineskip}
\newlength{\multicoltolerance}
\newlength{\multicolpretolerance}
\newcommand*{\columnseprulecolor}{\normalcolor}
\newcounter{columnbadness}
\newcounter{finalcolumnbadness}
\newcounter{collectmore}
\newcounter{unbalance}
\newlength{\multicolovershoot}
\newlength{\multicolundershoot}
% \end{macrocode}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \iffalse
%</multicol>
% \fi
% \clearpage
% \iffalse
%<*multirow>
% \fi
% \part{lwarp-multirow.sty}
% \section{Multirow}
% \label{sec:multirow}
%
% \DescribePackage{multirow}
% \pkg{multirow} is emulated during \acro{HTML} output, and
% the \pkg{multirow} package is ignored.
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackageDrop{multirow}
% \end{macrocode}
% \iffalse
%</multirow>
% \fi
% \iffalse
%<*needspace>
% \fi
% \part{lwarp-needspace.sty}
% \section{Needspace}
%
% \DescribePackage{needspace}
% \pkg{needspace} is not used during HTML conversion.
%
% \changes{v0.20}{2016/12/22}{\pkg{needspace}: Added.}
%
% \codehtml
%
% Discard all options for \pkg{lwarp-needspace}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{needspace}
\newcommand*{\needspace}[1]{}
\DeclareDocumentCommand{\Needspace}{s m}{}
% \end{macrocode}
% \iffalse
%</needspace>
% \fi
% \clearpage
%
% \iffalse
%<*newunicodechar>
% \fi
%
% \part{lwarp-newunicodechar.sty}
%
% \section{Newunicodechar}
%
% \DescribePackage{newunicodechar}
% Error if \pkg{newunicodechar} is loaded after \pkg{lwarp}.
%
% \changes{v0.21}{2017/02/22}{\pkg{newunicodechar}: Added.}
%
% Discard all options for \pkg{lwarp-newunicodechar}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{newunicodechar}
% \end{macrocode}
% \begin{macrocode}
\LWR@noloadafter{newunicodechar}
% \end{macrocode}
% \iffalse
%</newunicodechar>
% \fi
% \iffalse
%<*nowidow>
% \fi
% \part{lwarp-nowidow.sty}
% \section{Nowidow}
%
% \DescribePackage{nowidow}
% \pkg{nowidow} is not used during HTML conversion.
%
% \changes{v0.20}{2017/01/03}{\pkg{nowidow}: Added.}
%
% \codehtml
% Discard all options for \pkg{lwarp-nowidow}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{nowidow}
% \end{macrocode}
% ^^A \begin{macro}{\nowidow} \oarg{lines}
% ^^A \begin{macro}{\setnowidow} \oarg{lines}
% \begin{macrocode}
\newcommand*{\nowidow}[1][]{}
\newcommand*{\setnowidow}[1][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\noclub} \oarg{lines}
% ^^A \begin{macro}{\setnoclub} \oarg{lines}
% \begin{macrocode}
\newcommand*{\noclub}[1][]{}
\newcommand*{\setnoclub}[1][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% \iffalse
%</nowidow>
% \fi
% \iffalse
%<*pagenote>
% \fi
% \part{lwarp-pagenote.sty}
% \section{Pagenote}
%
% \DescribePackage{pagenote}
% \pkg{pagenote} is used by \pkg{lwarp},
% and its user-interface macros have been nullified.
%
% Both footnotes and pagenotes appear as footnotes in the \acro{HTML} output.
%
% Any manipulation of \pkg{pagenote} in the user's document after
% the preamble should be encased within a \env{warpprint} environment.
%
% \changes{v0.20}{2017/01/11}{\pkg{pagenote}: Added.}
%
% \codehtml
% Discard all options for \pkg{lwarp-pagenote}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{pagenote}
% \end{macrocode}
%
% \cs{pagenote} is already modified to work with \pkg{lwarp}.
%
% \begin{macrocode}
\renewcommand*{\makepagenote}{}
\RenewDocumentCommand{\printnotes}{s}{}
\renewcommand{\printnotes}[2][]{}
\renewcommand{\addtonotes}[1]{}
% \end{macrocode}
% \iffalse
%</pagenote>
% \fi
% \clearpage
%
% \iffalse
%<*placeins>
% \fi
%
% \part{lwarp-placeins.sty}
%
% \section{Placeins}
%
% \DescribePackage{placeins}
% \pkg{placeins} is not used during HTML conversion.
%
% \changes{v0.20}{2017/01/19}{\pkg{placeins}: Added.}
%
% \codehtml
% Discard all options for \pkg{lwarp-placeins}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{placeins}
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\FloatBarrier}{}
% \end{macrocode}
% \iffalse
%</placeins>
% \fi
% \clearpage
%
% \iffalse
%<*ragged2e>
% \fi
%
% \part{lwarp-ragged2e.sty}
%
% \section{Ragged2e}
%
% \DescribePackage{ragged2e}
% \pkg{ragged2e} is not used during HTML conversion.
%
% \changes{v0.20}{2017/01/19}{\pkg{ragged2e}: Added.}
%
% \codehtml
% Discard all options for \pkg{lwarp-ragged2e}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{ragged2e}
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\Centering}{\centering}
\newcommand*{\RaggedLeft}{\raggedleft}
\newcommand*{\RaggedRight}{\raggedright}
\newcommand*{\justifying}{}
\newlength{\CenteringLeftskip}
\newlength{\RaggedLeftLeftskip}
\newlength{\RaggedRightLeftskip}
\newlength{\CenteringRightskip}
\newlength{\RaggedLeftRightskip}
\newlength{\RaggedRightRightskip}
\newlength{\CenteringParfillskip}
\newlength{\RaggedLeftParfillskip}
\newlength{\RaggedRightParfillskip}
\newlength{\JustifyingParfillskip}
\newlength{\CenteringParindent}
\newlength{\RaggedLeftParindent}
\newlength{\RaggedRightParindent}
\newlength{\JustifyingParindent}
\newenvironment*{Center}{\center}{\endcenter}
\newenvironment*{FlushLeft}{\flushleft}{\endflushleft}
\newenvironment*{FlushRight}{\flushright}{\endflushright}
\newenvironment*{justify}{\justifying}{\endjustifying}
% \end{macrocode}
% \iffalse
%</ragged2e>
% \fi
% \clearpage
% \iffalse
%<*rotating>
% \fi
% \part{lwarp-rotating.sty}
% \section{Rotating}
%
% \DescribePackage{rotating}
% \pkg{rotating} is emulated during \acro{HTML} output, and
% the \pkg{rotating} package is ignored.
%
% \textcolor{red}{This code is untested.}
%
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackageDrop{rotating}
% \end{macrocode}
% \begin{macrocode}
\let\sidewaystable\table
\let\endsidewaystable\endtable
\let\sidewaysfigure\figure
\let\endsidewaysfigure\endfigure
\newenvironment*{sideways}{}{}
\newenvironment*{turn}[1]{}{}
\newenvironment*{rotate}[1]{}{}
\NewDocumentCommand{\turnbox}{m +m}{#2}
\let\rotcaption\caption
\let\@makerotcaption\@makecaption
% \end{macrocode}
% \iffalse
%</rotating>
% \fi
% \iffalse
%<*setspace>
% \fi
% \part{lwarp-setspace.sty}
% \section{Setspace}
%
% \DescribePackage{setspace}
% \pkg{setspace} is not used during HTML conversion.
%
% \changes{v0.20}{2016/12/22}{\pkg{setspace}: Improved support.}
%
% \codehtml
% Discard all options for \pkg{lwarp-setspace}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{setspace}
\newcommand*{\setstretch}[1]{}
\newcommand*{\SetSinglespace}[1]{}
\newcommand*{\singlespacing}{}
\newcommand*{\onehalfspacing}{}
\newcommand*{\doublespacing}{}
\newenvironment*{singlespace}
{\BlockClass{singlespace}}
{\endBlockClass}
\newenvironment*{singlespace*}
{\BlockClass{singlespace}}
{\endBlockClass}
\newenvironment*{spacing}[1]{
}{
}
\newenvironment*{onehalfspace}
{\BlockClass{onehalfspace}}
{\endBlockClass}
\newenvironment*{doublespace}
{\BlockClass{doublespace}}
{\endBlockClass}
% \end{macrocode}
% \iffalse
%</setspace>
% \fi
% \iffalse
%<*textpos>
% \fi
% \part{lwarp-textpos.sty}
% \section{Textpos}
% \label{sec:textpos}
%
% \changes{v0.20}{2017/01/11}{\pkg{textpos}: Added.}
%
% \DescribePackage{textpos}
% \pkg{textpos} is emulated during \acro{HTML} output, and
% the \pkg{textpos} package is ignored.
% \begin{macrocode}
\LWR@ProvidesPackageDrop{textpos}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\NewDocumentEnvironment{textblock}{m r()}{}{}
\NewDocumentEnvironment{textblock*}{m o r()}{}{}
\newcommand*{\TPGrid}[3][]{}
\NewDocumentCommand{\TPMargin}{s o}{}
\newcommand*{\textblockcolour}[1]{}
\newcommand*{\textblockrulecolour}[1]{}
\newcommand*{\textblockcolor}[1]{}
\newcommand*{\textblockrulecolor}[1]{}
\newcommand*{\tekstblokkulur}[1]{}
\newcommand*{\tekstblokrulekulur}[1]{}
\newlength{\TPHorizModule}
\newlength{\TPVertModule}
\newlength{\TPboxrulesize}
\newcommand{\textblocklabel}[1]{}
\newcommand*{\showtextsize}{}
\newcommand{\textblockorigin}[2]{}
% \end{macrocode}
% \iffalse
%</textpos>
% \fi
% \clearpage
% \iffalse
%<*threeparttable>
% \fi
% \part{lwarp-threeparttable.sty}
% \section{Threeparttable}
% \label{sec:threeparttable}
%
%
% \DescribePackage{threeparttable}
% \pkg{threeparttable} is emulated during \acro{HTML} output, and
% the \pkg{threeparttable} package is ignored.
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackageDrop{threeparttable}
% \end{macrocode}
% ^^A \begin{macro}{\LWR@printtablenote} \marg{text}
%
% Prints the table note item header inside a \acro{CSS} class of |tnoteitemheader|.
% \begin{macrocode}
\newcommand{\LWR@printtablenote}[1]{\InlineClass{tnoteitemheader}{#1}}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{environment}{threeparttable} \oarg{alignment}
% To emulate threeparttable:
% \begin{macrocode}
\newenvironment*{threeparttable}[1][b]{}{}
% \end{macrocode}
% ^^A \end{environment}
% ^^A \begin{environment}{tablenotes} \oarg{options}
% \changes{v0.19}{2016/06/01}{CSS for table note item.}
% \begin{macrocode}
\newenvironment*{tablenotes}[1][]
{%
\BlockClass{tnotes}%
\setlist[description]{format=\LWR@printtablenote}%
\description%
}
{%
\enddescription%
\endBlockClass%
}
% \end{macrocode}
% ^^A \end{environment}
% ^^A \begin{macro}{\tnote}
% \begin{macrocode}
\newcommand{\tnote}[1]{\textsuperscript{#1}}
% \end{macrocode}
% ^^A \end{macro}
% \iffalse
%</threeparttable>
% \fi
% \clearpage
% \iffalse
%<*titleps>
% \fi
% \part{lwarp-titleps.sty}
% \section{Titleps}
%
% \DescribePackage{titleps}
% \pkg{titleps} is loaded and used by \pkg{lwarp} during \acro{HTML} output.
% All user options and macros are ignored and disabled.
% \changes{v0.20}{2017/01/03}{\pkg{titleps}: Added.}
%
% \codehtml
%
% Discard all options for \pkg{lwarp-titleps}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{titleps}
% \end{macrocode}
%
% \cs{pagestyle} and \cs{thispagestyle} are already disabled in the \pkg{lwarp} code.
%
% ^^A \begin{macro}{\newpagestyle} \marg{name} \oarg{style} \marg{commands}
% ^^A \begin{macro}{\renewpagestyle} \marg{name} \oarg{style} \marg{commands}
% \begin{macrocode}
\RenewDocumentCommand{\newpagestyle}{m o m}{}
\RenewDocumentCommand{\renewpagestyle}{m o m}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\sethead} \oarg{el} \oarg{ec} \oarg{er} \marg{ol} \marg{oc} \marg{or}
% ^^A \begin{macro}{\setfoot} \oarg{el} \oarg{ec} \oarg{er} \marg{ol} \marg{oc} \marg{or}
% \begin{macrocode}
\RenewDocumentCommand{\sethead}{o o o m m m}{}
\RenewDocumentCommand{\setfoot}{o o o m m m}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\settitlemarks} * \marg{names}
% \begin{macrocode}
\RenewDocumentCommand{\settitlemarks}{s m}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\headrule}
% ^^A \begin{macro}{\footrule}
% \begin{macrocode}
\renewcommand*{\headrule}{}
\renewcommand*{\footrule}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\setheadrule} \marg{length}
% ^^A \begin{macro}{\setfootrule} \marg{length}
% \begin{macrocode}
\renewcommand*{\setheadrule}[1]{}
\renewcommand*{\setfootrule}[1]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\makeheadrule}
% ^^A \begin{macro}{\makefootrule}
% \begin{macrocode}
\newcommand*{\makeheadrule}{}
\newcommand*{\makefootrule}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\setmarkboth} \marg{code}
% \begin{macrocode}
\renewcommand{\setmarkboth}[1]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\widenhead}
% \begin{macrocode}
\RenewDocumentCommand{\widenhead}{s o o m m}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\bottitlemarks}
% ^^A \begin{macro}{\toptitlemarks}
% ^^A \begin{macro}{\firsttitlemarks}
% ^^A \begin{macro}{\nexttitlemarks}
% ^^A \begin{macro}{\outertitlemarks}
% ^^A \begin{macro}{\innertitlemarks}
% \begin{macrocode}
\renewcommand*{\bottitlemarks}{}
\renewcommand*{\toptitlemarks}{}
\renewcommand*{\firsttitlemarks}{}
\renewcommand*{\nexttoptitlemarks}{}
\renewcommand*{\outertitlemarks}{}
\renewcommand*{\innertitlemarks}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\newtitlemark} * \marg{name}
% \begin{macrocode}
\RenewDocumentCommand{\newtitlemark}{s m}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\pretitlemark} * \marg{section} \marg{text}
% \begin{macrocode}
\RenewDocumentCommand{\pretitlemark}{s m m}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\ifsamemark} \marg{group} \marg{command} \marg{true} \marg{false}
% \begin{macrocode}
\renewcommand{\ifsamemark}[4]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\setfloathead} * \oarg{.} \oarg{.} \oarg{.} \marg{.} \marg{.} \marg{.} \marg{extra} \oarg{which}
% ^^A \begin{macro}{\setfloatfoot} * \oarg{.} \oarg{.} \oarg{.} \marg{.} \marg{.} \marg{.} \marg{extra} \oarg{which}
% \begin{macrocode}
\NewDocumentCommand{\setfloathead}{s o o o m m m m m}{}
\NewDocumentCommand{\setfloatfoot}{s o o o m m m m m}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\nextfloathead} * \oarg{.} \oarg{.} \oarg{.} \marg{.} \marg{.} \marg{.} \marg{extra} \oarg{which}
% ^^A \begin{macro}{\nextfloatfoot} * \oarg{.} \oarg{.} \oarg{.} \marg{.} \marg{.} \marg{.} \marg{extra} \oarg{which}
% \begin{macrocode}
\NewDocumentCommand{\nextfloathead}{s o o o m m m m m}{}
\NewDocumentCommand{\nextfloatfoot}{s o o o m m m m m}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\newmarkset} \marg{markset}
% \begin{macrocode}
\newcommand{\newmarkset}[1]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\newextramark} * \marg{markset} \marg{macro-name}
% \begin{macrocode}
\NewDocumentCommand{\newextramarkset}{s m m}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\botextramarks} \marg{markset}
% ^^A \begin{macro}{\topextramarks} \marg{markset}
% ^^A \begin{macro}{\firstextramarks} \marg{markset}
% ^^A \begin{macro}{\nextextramarks} \marg{markset}
% ^^A \begin{macro}{\outerextramarks} \marg{markset}
% ^^A \begin{macro}{\innerextramarks} \marg{markset}
% \begin{macrocode}
\newcommand{\botextramarks}[1]{}
\newcommand{\topextramarks}[1]{}
\newcommand{\firstextramarks}[1]{}
\newcommand{\nexttopextramarks}[1]{}
\newcommand{\outerextramarks}[1]{}
\newcommand{\innerextramarks}[1]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% \iffalse
%</titleps>
% \fi
% \clearpage
% \iffalse
%<*titlesec>
% \fi
% \part{lwarp-titlesec.sty}
% \section{Titlesec}
%
% \DescribePackage{titlesec}
% \pkg{titlesec} is emulated.
% All user options and macros are ignored and disabled.
% \changes{v0.20}{2017/01/03}{\pkg{titlesec}: Added.}
%
% \codehtml
%
% Discard all options for \pkg{lwarp-titlesec}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{titlesec}
% \end{macrocode}
% ^^A \begin{macro}{\titlelabel} \marg{label-format}
% \begin{macrocode}
\newcommand*{\titlelabel}[1]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\titleformat*} \marg{command} \marg{format}
%
% ^^A \begin{macro}{\titleformat} \marg{command} \oarg{shape} \marg{format}
% ^^A \marg{label} \marg{sep} \marg{begfore} \oarg{after}
% \begin{macrocode}
\newcommand\titleformat{%
\@ifstar{\ttl@format@s}%
{\ttl@format@i}}
\newcommand{\ttl@format@s}[1]{}
\NewDocumentCommand{\ttl@format@i}{m o m m m m o}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\chaptertitlename}
% \begin{macrocode}
\@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}
\newcommand\chaptertitlename{\@chapapp}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\titlespacing} * \marg{command} \marg{left} \marg{before} \marg{after} \oarg{right}
%
% \begin{macrocode}
\NewDocumentCommand{\titlespacing}{s m m m m o}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\filright}
% ^^A \begin{macro}{\filcenter}
% ^^A \begin{macro}{\filleft}
% ^^A \begin{macro}{\fillast}
% ^^A \begin{macro}{\filinner}
% ^^A \begin{macro}{\filouter}
% \begin{macrocode}
\newcommand*{\filright}{}
\newcommand*{\filcenter}{}
\newcommand*{\filleft}{}
\newcommand*{\fillast}{}
\newcommand*{\filinner}{}
\newcommand*{\filouter}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\wordsep}
% \begin{macrocode}
\newcommand\wordsep{\fontdimen\tw@\font \@plus
\fontdimen\thr@@\font \@minus \fontdimen4\font}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\titleline} * \oarg{align} \marg{material}
% \begin{macrocode}
\NewDocumentCommand{\titleline}{s o m}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\titlerule} \oarg{height}
% \begin{macrocode}
\providecommand*\titlerule{\@ifstar{\ttl@row}{\ttl@rule}}
\newcommand*{\ttl@rule}[1][]{}
\newcommand*{\ttl@row}[2][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\iftitlemeasuring} \marg{true} \marg{false}
% \begin{macrocode}
\newcommand{\iftitlemeasuring}[2]{#2}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\assignpagestyle} \marg{command} \marg{pagestyle}
% \begin{macrocode}
\newcommand{\assignpagestyle}[2]{#2}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\titleclass} \marg{name} \oarg{startlevel} \marg{class} \oarg{cmd}
% \begin{macrocode}
\NewDocumentCommand{\titleclass}{m o m o}
% \end{macrocode}
% ^^A \end{macro}
% \iffalse
%</titlesec>
% \fi
% \clearpage
% \iffalse
%<*titletoc>
% \fi
% \part{lwarp-titletoc.sty}
% \section{Titletoc}
%
% \DescribePackage{titletoc}
% \pkg{titletoc} is emulated.
% All user options and macros are ignored and disabled.
% \changes{v0.20}{2017/01/03}{\pkg{titletoc}: Added.}
%
% \codehtml
%
% Discard all options for \pkg{lwarp-titletoc}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{titletoc}
% \end{macrocode}
%
% ^^A \begin{macro}{\dottedcontents} \marg{section} \oarg{left} \marg{above} \marg{label} \marg{leader}
% \begin{macrocode}
\NewDocumentCommand{\dottedcontents}{m o m m m}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\titlecontents} * \marg{section} \oarg{left} \marg{above}
% ^^A \marg{numbered} \marg{numberless} \marg{filler}
% ^^A \oarg{below or begin} \oarg{separator} \oarg{end}
% \begin{macrocode}
\newcommand{\titlecontents}{\@ifstar{\ttl@tcstar}{\ttl@tcnostar}}
\NewDocumentCommand{\ttl@tcstar}{m o m m m m o o o}{}
\NewDocumentCommand{\ttl@tcnostar}{m o m m m m o}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\contentsmargin} \oarg{correction} \marg{right}
% \begin{macrocode}
\newcommand{\contentsmargin}[2][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\thecontentslabel}
% ^^A \begin{macro}{\thecontentspage}
% \begin{macrocode}
\newcommand*{\thecontentslabel}{thecontentslabel}
\newcommand*{\thecontentspage}{thecontentspage}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\contentslabel} \oarg{format} \marg{space}
% ^^A \begin{macro}{\contentspage} \oarg{format}
% \begin{macrocode}
\newcommand{\contentslabel}[2][]{\thecontentslabel}
\newcommand{\contentspage}[1][]{\thecontentspage}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\contentspush} \marg{text}
% \begin{macrocode}
\newcommand{\contentspush}[1]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\contentsuse} \marg{name} \marg{text}
% \begin{macrocode}
\newcommand{\contentsuse}[2]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\startcontents} \oarg{name}
% ^^A \begin{macro}{\stopcontents} \oarg{name}
% ^^A \begin{macro}{\resumecontents} \oarg{name}
% \begin{macrocode}
\newcommand*{\startcontents}[1][]{}
\newcommand*{\stopcontents}[1][]{}
\newcommand*{\resumecontents}[1][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\printcontents} \oarg{name} \marg{prefix} \marg{start} \marg{code}
% \begin{macrocode}
\newcommand{\printcontents}[4][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\startlist} \oarg{name} \marg{list}
% ^^A \begin{macro}{\stoplist} \oarg{name} \marg{list}
% ^^A \begin{macro}{\resumelist} \oarg{name} \marg{list}
% \begin{macrocode}
\newcommand{\startlist}[2][]{}
\newcommand{\stoplist}[2][]{}
\newcommand{\resumelist}[2][]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\printlist} \oarg{name} \marg{list} \marg{prefix} \marg{code}
% \begin{macrocode}
\newcommand{\printlist}[4][]{}
% \end{macrocode}
% ^^A \end{macro}
% \iffalse
%</titletoc>
% \fi
% \clearpage
% \iffalse
%<*titling>
% \fi
% \part{lwarp-titling.sty}
% \section{Titling}
%
% \DescribePackage{titling}
% \pkg{titling} is used by \pkg{lwarp}.
% The following patches are not needed by \pkg{lwarp},
% but are required if the user requests \pkg{titling}.
%
% \pkg{lwarp} uses page notes for footnotes, so the various
% \pkg{titling} footnote restyling commands have no effect.
%
% \changes{v0.20}{2017/01/22}{\pkg{titling}: Improved compatibility.}
%
% \codehtml
%
% Pass all options to \pkg{lwarp-titling}:
% \begin{macrocode}
\LWR@ProvidesPackagePass{titling}
% \end{macrocode}
%
%
% Patch \cs{@bsmtitlempty}:
% \begin{macrocode}
\let\LWR@orig@bsmtitlempty\@bsmtitlempty
\renewcommand*{\@bsmtitlempty}{%
\LWR@orig@bsmtitlempty%
\global\let\published\relax%
\global\let\subtitle\relax%
}
% \end{macrocode}
%
%
% Patch \cs{keepthetitle}:
% \begin{macrocode}
\let\LWR@origkeepthetitle\keepthetitle
\renewcommand*{\keepthetitle}{%
\LWR@orig@keepthetitle%
\global\let\@published\@empty%
\global\let\@subtitle\@empty%
}
% \end{macrocode}
%
%
% Patch \cs{killtitle}:
% \begin{macrocode}
\let\LWR@origkilltitle\killtitle
\renewcommand*{\killtitle}{%
\LWR@orig@killtitle%
\global\let\thepublished\relax%
\global\let\thesubtitle\relax%
}
% \end{macrocode}
%
%
% \iffalse
%</titling>
% \fi
% \clearpage
% \iffalse
%<*tocloft>
% \fi
% \part{lwarp-tocloft.sty}
% \section{Tocloft}
%
% \DescribePackage{tocloft}
% \pkg{tocloft} is emulated.
% Most user options and macros are ignored and disabled.
% \cs{newlistof} and \cs{cftchapterprecis} are supported.
% \changes{v0.20}{2017/01/03}{\pkg{tocloft}: Added.}
%
% \codehtml
%
% Discard all options for \pkg{lwarp-tocloft}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{tocloft}
% \end{macrocode}
%
% ^^A \begin{macro}{\tocloftpagestyle} \marg{style}
% \begin{macrocode}
\newcommand{\tocloftpagestyle}[1]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\cftmarktoc}
% ^^A \begin{macro}{\cfttoctitlefont}
% ^^A \begin{macro}{\cftaftertoctitle}
% \begin{macrocode}
\newcommand*{\cftmarktoc}{}
\newcommand*{\cfttoctitlefont}{}
\newcommand*{\cftaftertoctitle}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% \begin{macrocode}
\newlength{\cftbeforetoctitleskip}
\newlength{\cftaftertoctitleskip}
% \end{macrocode}
% ^^A \begin{macro}{\cftmarklof}
% ^^A \begin{macro}{\cftloftitlefont}
% ^^A \begin{macro}{\cftafterloftitle}
% \begin{macrocode}
\newcommand*{\cftmarklof}{}
\newcommand*{\cftloftitlefont}{}
\newcommand*{\cftafterloftitle}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% \begin{macrocode}
\newlength{\cftbeforeloftitleskip}
\newlength{\cftafterloftitleskip}
% \end{macrocode}
% ^^A \begin{macro}{\cftmarklot}
% ^^A \begin{macro}{\cftlottitlefont}
% ^^A \begin{macro}{\cftafterlottitle}
% \begin{macrocode}
\newcommand*{\cftmarklot}{}
\newcommand*{\cftlottitlefont}{}
\newcommand*{\cftafterlottitle}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% \begin{macrocode}
\newlength{\cftbeforelottitleskip}
\newlength{\cftafterlottitleskip}
% \end{macrocode}
% ^^A \begin{macro}{\cftdot}
% ^^A \begin{macro}{\cftdotsep}
% ^^A \begin{macro}{\cftnodots}
% \begin{macrocode}
\newcommand*{\cftdot}{.}
\providecommand*{\cftdotsep}{1}
\newcommand*{\cftnodots}{5000}
\providecommand{\cftdotfill}[1]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\cftsetpnumwidth} \marg{length}
% ^^A \begin{macro}{\cftsetrmarg} \marg{length}
% \begin{macrocode}
\newcommand*{\cftsetpnumwidth}[1]{}
\newcommand*{\cftsetrmarg}[1]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \end{macro}
% ^^A \begin{macro}{\cftpnumalign} \marg{alignment}
% \begin{macrocode}
\newcommand*{\cftpnumalign}[1]{}
% \end{macrocode}
% ^^A \end{macro}
% \begin{macrocode}
\newlength{\cftparskip}
% \end{macrocode}
% \begin{macrocode}
\newlength{\cftbeforepartskip}
\newlength{\cftpartindent}
\newlength{\cftpartnumwidth}
\newcommand*{\cftpartfont}{}
\newcommand*{\cftpartpresnum}{}
\newcommand*{\cftpartaftersnum}{}
\newcommand*{\cftpartaftersnumb}{}
\newcommand*{\cftpartleader}{}
\newcommand*{\cftpartdotsep}{1}
\newcommand*{\cftpartpagefont}{}
\newcommand*{\cftpartafterpnum}{}
% \end{macrocode}
% \begin{macrocode}
\newlength{\cftbeforechapskip}
\newlength{\cftchapindent}
\newlength{\cftchapnumwidth}
\newcommand*{\cftchapfont}{}
\newcommand*{\cftchappresnum}{}
\newcommand*{\cftchapaftersnum}{}
\newcommand*{\cftchapaftersnumb}{}
\newcommand*{\cftchapleader}{}
\newcommand*{\cftchapdotsep}{1}
\newcommand*{\cftchappagefont}{}
\newcommand*{\cftchapafterpnum}{}
% \end{macrocode}
% \begin{macrocode}
\newlength{\cftbeforesecskip}
\newlength{\cftsecindent}
\newlength{\cftsecnumwidth}
\newcommand*{\cftsecfont}{}
\newcommand*{\cftsecpresnum}{}
\newcommand*{\cftsecaftersnum}{}
\newcommand*{\cftsecaftersnumb}{}
\newcommand*{\cftsecleader}{}
\newcommand*{\cftsecdotsep}{1}
\newcommand*{\cftsecpagefont}{}
\newcommand*{\cftsecafterpnum}{}
% \end{macrocode}
% \begin{macrocode}
\newlength{\cftbeforesubsecskip}
\newlength{\cftsubsecindent}
\newlength{\cftsubsecnumwidth}
\newcommand*{\cftsubsecfont}{}
\newcommand*{\cftsubsecpresnum}{}
\newcommand*{\cftsubsecaftersnum}{}
\newcommand*{\cftsubsecaftersnumb}{}
\newcommand*{\cftsubsecleader}{}
\newcommand*{\cftsubsecdotsep}{1}
\newcommand*{\cftsubsecpagefont}{}
\newcommand*{\cftsubsecafterpnum}{}
% \end{macrocode}
% \begin{macrocode}
\newlength{\cftbeforesubsubsecskip}
\newlength{\cftsubsubsecindent}
\newlength{\cftsubsubsecnumwidth}
\newcommand*{\cftsubsubsecfont}{}
\newcommand*{\cftsubsubsecpresnum}{}
\newcommand*{\cftsubsubsecaftersnum}{}
\newcommand*{\cftsubsubsecaftersnumb}{}
\newcommand*{\cftsubsubsecleader}{}
\newcommand*{\cftsubsubsecdotsep}{1}
\newcommand*{\cftsubsubsecpagefont}{}
\newcommand*{\cftsubsubsecafterpnum}{}
% \end{macrocode}
% \begin{macrocode}
\newlength{\cftbeforeparaskip}
\newlength{\cftparaindent}
\newlength{\cftparanumwidth}
\newcommand*{\cftparafont}{}
\newcommand*{\cftparapresnum}{}
\newcommand*{\cftparaaftersnum}{}
\newcommand*{\cftparaaftersnumb}{}
\newcommand*{\cftparaleader}{}
\newcommand*{\cftparadotsep}{1}
\newcommand*{\cftparapagefont}{}
\newcommand*{\cftparaafterpnum}{}
% \end{macrocode}
% \begin{macrocode}
\newlength{\cftbeforesubparaskip}
\newlength{\cftsubparaindent}
\newlength{\cftsubparanumwidth}
\newcommand*{\cftsubparafont}{}
\newcommand*{\cftsubparapresnum}{}
\newcommand*{\cftsubparaaftersnum}{}
\newcommand*{\cftsubparaaftersnumb}{}
\newcommand*{\cftsubparaleader}{}
\newcommand*{\cftsubparadotsep}{1}
\newcommand*{\cftsubparapagefont}{}
\newcommand*{\cftsubparaafterpnum}{}
% \end{macrocode}
% \begin{macrocode}
\newlength{\cftbeforefigskip}
\newlength{\cftfigindent}
\newlength{\cftfignumwidth}
\newcommand*{\cftfigfont}{}
\newcommand*{\cftfigpresnum}{}
\newcommand*{\cftfigaftersnum}{}
\newcommand*{\cftfigaftersnumb}{}
\newcommand*{\cftfigleader}{}
\newcommand*{\cftfigdotsep}{1}
\newcommand*{\cftfigpagefont}{}
\newcommand*{\cftfigafterpnum}{}
% \end{macrocode}
% \begin{macrocode}
\newlength{\cftbeforesubfigskip}
\newlength{\cftsubfigindent}
\newlength{\cftsubfignumwidth}
\newcommand*{\cftsubfigfont}{}
\newcommand*{\cftsubfigpresnum}{}
\newcommand*{\cftsubfigaftersnum}{}
\newcommand*{\cftsubfigaftersnumb}{}
\newcommand*{\cftsubfigleader}{}
\newcommand*{\cftsubfigdotsep}{1}
\newcommand*{\cftsubfigpagefont}{}
\newcommand*{\cftsubfigafterpnum}{}
% \end{macrocode}
% \begin{macrocode}
\newlength{\cftbeforetabskip}
\newlength{\cfttabindent}
\newlength{\cfttabnumwidth}
\newcommand*{\cfttabfont}{}
\newcommand*{\cfttabpresnum}{}
\newcommand*{\cfttabaftersnum}{}
\newcommand*{\cfttabaftersnumb}{}
\newcommand*{\cfttableader}{}
\newcommand*{\cfttabdotsep}{1}
\newcommand*{\cfttabpagefont}{}
\newcommand*{\cfttabafterpnum}{}
% \end{macrocode}
% \begin{macrocode}
\newlength{\cftbeforesubtabskip}
\newlength{\cftsubtabindent}
\newlength{\cftsubtabnumwidth}
\newcommand*{\cftsubtabfont}{}
\newcommand*{\cftsubtabpresnum}{}
\newcommand*{\cftsubtabaftersnum}{}
\newcommand*{\cftsubtabaftersnumb}{}
\newcommand*{\cftsubtableader}{}
\newcommand*{\cftsubtabdotsep}{1}
\newcommand*{\cftsubtabpagefont}{}
\newcommand*{\cftsubtabafterpnum}{}
% \end{macrocode}
% \begin{macrocode}
\newcommand{\cftsetindents}[3]{}
% \end{macrocode}
% \begin{macrocode}
\newcommand{\pagenumbersoff}[1]{}
\newcommand{\pagenumberson}[1]{}
% \end{macrocode}
% ^^A \begin{macro}{\newlistof} \oarg{within} \marg{type} \marg{ext} \marg{listofname}
%
% Emulated through the \cs{newfloat} mechanism.
% \begin{macrocode}
\NewDocumentCommand{\newlistof}{o m m m}
{%
\IfValueTF{#1}
{\newfloat{#2}{tbp}{#3}[#1]}
{\newfloat{#2}{tbp}{#3}}
\@namedef{listof#2}{\listof{#2}{#4}}
\@namedef{#2depth}{1}
\expandafter\newlength\csuse{cftbefore#2skip}
\expandafter\newlength\csuse{cft#2indent}
\expandafter\newlength\csuse{cft#2numwidth}
\@namedef{cft#2font}{}
\@namedef{cft#2presnum}{}
\@namedef{cft#2aftersnum}{}
\@namedef{cft#2aftersnumb}{}
\@namedef{cft#2leader}{}
\@namedef{cft#2dotsep}{1}
\@namedef{cft#2pagefont}{}
\@namedef{cft#2afterpnum}{}
}
% \end{macrocode}
% ^^A \end{macro}
% \cs{cftchapterprecis} from \pkg{tocloft}:
% \begin{macrocode}
\newcommand{\cftchapterprecis}[1]{%
\cftchapterprecishere{#1}
\cftchapterprecistoc{#1}}
\newcommand{\cftchapterprecishere}[1]{%
\begin{quote}\textit{#1}\end{quote}}
\newcommand{\cftchapterprecistoc}[1]{
\addtocontents{toc}{%
{
\protect\begin{quote}#1\protect\end{quote}}
}
}
% \end{macrocode}
% \iffalse
%</tocloft>
% \fi
% \clearpage
% \iffalse
%<*trivfloat>
% \fi
% \part{lwarp-trivfloat.sty}
% \section{Trivfloat}
% \label{sec:trivfloat}
%
% \DescribePackage{trivfloat}
% \pkg{trivfloat} is forced to use the built-in \pkg{lwarp}
% emulation for floats.
% \codehtml
% Discard all options for \pkg{lwarp-trivfloat}:
% \begin{macrocode}
\LWR@ProvidesPackageDrop{trivfloat}
\LWR@origRequirePackage{trivfloat}
% \end{macrocode}
%
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% Package \pkg{trivfloat} is supported via the \pkg{lwarp} emulation of \pkg{float}.
% For \acro{HTML} usage, use only |\usepackage{trivfloat}|, without any options,
% \watchout
% which tells \pkg{trivfloat} to use the emulated \pkg{float} functions instead
% of using \pkg{floatrow} or \pkg{memoir}.
% ^^A \DescribeMacro{\trivfloat} \marg{type}
%
% To create a new float type and change its name:
% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
% \trivfloat{example}
% \renewcommand{\examplename}{Example Name}
% \crefname{example}{example}{examples}
% \Crefname{example}{Example}{Examples}
% \end{Verbatim}
%
%
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \DescribeMacro{\tfl@chapter@fix}
% Nullified at the beginning of the document.
% Is used by \pkg{trivfloat} to correct float chapter numbers,
% but is not needed for \pkg{lwarp}.
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% \begin{macrocode}
\AtBeginDocument{\DeclareDocumentCommand{\tfl@chapter@fix}{m m}{}}
% \end{macrocode}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \subsection{Combining \cs{newfloat}, \cs{trivfloat}, and \pkg{algorithmicx}}
% \label{sec:combiningfloats}
% \index{newfloat>with trivfloat, algorithmic}
% \index{trivfloat>with newfloat, algorithmic}
% \index{algorithmic>with newfloat, trivfloat}
%
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% \textcolor{red}{For both print and HTML output:}
%
% When using \pkg{float}, \pkg{trivfloat}, or \pkg{algorithmicx} at the same time,
% be aware of conflicting file usage.
% \watchout
% \pkg{algorithmicx} uses |.loa|.
% \pkg{trivfloat} by default starts with |.loa| and goes up for additional floats,
% skipping |.lof| and |.lot|.
%
% When using \cs{newfloat},
% \watchout
% be sure to manually assign higher letters to the \cs{newfloat}
% files to avoid |.loa| used by \pkg{algorithmicx}, and any files used by \pkg{trivfloat}.
% Also avoid using |.lof| and |.lot|.
%
% When using \cs{trivfloat}, you may force it to avoid conflicting with
% \watchout
% \pkg{algorithmicx} by starting \pkg{trivfloat}'s file extensions with |.lob|:
%
% \begin{docsidebar}
% \cs{makeatletter} \\
% \cs{setcounter\{tfl\@float\@cnt\}\{1\}} \% start trivfloats with .lob \\
% \cs{makeatletter}
% \end{docsidebar}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \iffalse
%</trivfloat>
% \fi
% \iffalse
%<*wallpaper>
% \fi
% \part{lwarp-wallpaper.sty}
% \section{Wallpaper}
% \label{sec:wallpaper}
%
% \changes{v0.20}{2017/01/11}{\pkg{wallpaper}: Added.}
%
% \DescribePackage{wallpaper}
% \pkg{wallpaper} is emulated during \acro{HTML} output, and
% the \pkg{wallpaper} package is ignored.
% \begin{macrocode}
\LWR@ProvidesPackageDrop{wallpaper}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\newcommand*{\CenterWallPaper}[2]{}
\newcommand*{\ThisCenterWallPaper}[2]{}
\newcommand*{\TileWallPaper}[3]{}
\newcommand*{\ThisTileWallPaper}[3]{}
\newcommand*{\TileSquareWallPaper}[2]{}
\newcommand*{\ThisTileSquareWallPaper}[2]{}
\newcommand*{\ULCornerWallPaper}[2]{}
\newcommand*{\ThisULCornerWallPaper}[2]{}
\newcommand*{\LLCornerWallPaper}[2]{}
\newcommand*{\ThisLLCornerWallPaper}[2]{}
\newcommand*{\URCornerWallPaper}[2]{}
\newcommand*{\ThisURCornerWallPaper}[2]{}
\newcommand*{\LRCornerWallPaper}[2]{}
\newcommand*{\ThisLRCornerWallPaper}[2]{}
\newcommand*{\ClearWallPaper}{}
\newlength{\wpXoffset}
\newlength{\wpYoffset}
% \end{macrocode}
% \iffalse
%</wallpaper>
% \fi
% \iffalse
%<*wrapfig>
% \fi
% \part{lwarp-wrapfig.sty}
% \section{Wrapfig}
% \label{sec:wrapfig}
%
% \changes{v0.20}{2017/01/11}{\pkg{wrapfig}: Added.}
%
% \DescribePackage{wrapfig}
% \pkg{wrapfig} is emulated during \acro{HTML} output, and
% the \pkg{wrapfig} package is ignored.
% \begin{macrocode}
\LWR@ProvidesPackageDrop{wrapfig}
% \end{macrocode}
% \codehtml
% Computed width of a wrapped object.
% Used to print the \acro{HTML} style.
% \begin{macrocode}
\newlength{\LWR@wrapwidth}
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\LWR@wrapposition}{}
\newcommand*{\LWR@subwrapfigure}[2]{%
\LWR@maybeincthisfloat%
\renewcommand*{\LWR@wrapposition}{}%
\ifthenelse{%
\equal{#1}{r}\OR\equal{#1}{R}\OR%
\equal{#1}{o}\OR\equal{#1}{O}%
}%
{\renewcommand*{\LWR@wrapposition}{float:right}}%
{\renewcommand*{\LWR@wrapposition}{float:left}}%
\setlength{\LWR@wrapwidth}{#2}%
\addtolength{\LWR@wrapwidth}{4em}%
\uselengthunit{PT}%
% \BlockClass{marginblock}[%
% width:\rndprintlength{\LWR@wrapwidth} ; %
% \LWR@wrapposition%
% ]%
\LWR@stoppars%
\LWR@htmltag{div class="marginblock" id="autofloat-\arabic{LWR@thisfloat}"
style="width:\rndprintlength{\LWR@wrapwidth} ; %
\LWR@wrapposition"%
}
\LWR@startpars
}
\NewDocumentEnvironment{wrapfigure}{o m o m}
{%
\LWR@subwrapfigure{#2}{#4}%
\captionsetup{type=figure}%
}
{
\LWR@htmldivclassend{div}
}
\NewDocumentEnvironment{wraptable}{o m o m}
{%
\LWR@subwrapfigure{#2}{#4}%
\captionsetup{type=table}%
}
{
\LWR@htmldivclassend{div}
}
\NewDocumentEnvironment{wrapfloat}{m o m o m}
{%
\LWR@subwrapfigure{#3}{#5}%
\captionsetup{type=#1}%
}
{
\LWR@htmldivclassend{div}
}
\newlength{\wrapoverhang}
% \end{macrocode}
% \iffalse
%</wrapfig>
% \fi
% \clearpage
% \iffalse
%<*xcolor>
% \fi
% \part{lwarp-xcolor.sty}
% \section{Xcolor}
%
% \DescribePackage{xcolor}
%
% \limitsxcolor
% \codehtml
%
% \begin{macrocode}
\LWR@ProvidesPackagePass{xcolor}
% \end{macrocode}
% ^^A \begin{macro}{\LWR@tempcolor} The color converted to \acro{HTML} colorspace.
% \begin{macrocode}
\newcommand*{\LWR@tempcolor}{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\LWR@currenttextcolor} The color to use for text and \cs{rule},
% defaulting to black.
% \begin{macrocode}
\newcommand*{\LWR@currenttextcolor}{black}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\LWR@colorstyle} \marg{1: styletext} \marg{2: model}
% ^^A \marg{3: color} \marg{4: spancontents}
%
% \changes{v0.19}{2016/06/01}{Supports colored \cs{rule}.}
%
% Creates a styled span with a color converted to \acro{HTML} hex colorspace.
% Uses |LWR@spandepth| to prevent paragraph tags inside the span.
% If used for \cs{textcolor}, with a styletext of |color:|, then the new color is
% copied into \\ \cs{LWR@currenttextcolor} for possible re-use in \cs{rule}.
% \begin{macrocode}
\NewDocumentCommand{\LWR@colorstyle}{m m m +m}{%
% \end{macrocode}
% Use the \pkg{xcolor} package to convert to an \acro{HTML} color space:
% \begin{macrocode}
\convertcolorspec{#2}{#3}{HTML}\LWR@tempcolor%
% \end{macrocode}
% If is a \cs{textcolor}, save a copy of this color for use by \cs{rule}:
% \begin{macrocode}
\ifthenelse{\equal{#1}{color:}}%
{\renewcommand*{\LWR@currenttextcolor}{\#\LWR@tempcolor}}{}%
% \end{macrocode}
% Create the \acro{HTML} |span| with the styled color:
% \begin{macrocode}
\LWR@htmltagc{span style="#1\#\LWR@tempcolor"{}}%
\begin{LWR@nestspan}%
% \end{macrocode}
% Prevent additional paragraph tags inside this span:
% \begin{macrocode}
% \end{macrocode}
% Print the contents then close the span:
% \begin{macrocode}
#4%
\LWR@htmltagc{/span}%
\end{LWR@nestspan}%
% \end{macrocode}
% For paragraph-tag handling:
% \begin{macrocode}
\LWR@ensuredoingapar%
}
% \end{macrocode}
% ^^A \end{macro}
% \DescribeMacro{\color} appears in the \LaTeX{} \acro{PDF} output, but is ignored by
% |pdftotext| and thus is ignored in the \acro{HTML} file. Text styling by local group
% is not yet supported.
% Each of the following macros is given a temporary name, and is |\let| to the final
% name once the \acro{HTML} conversion starts.
% ^^A \begin{macro}{\textcolor} \oarg{model} \marg{color} \marg{text}
%
% is converted into an \acro{HTML} hex color span.
% \begin{macrocode}
\NewDocumentCommand{\LWR@textcolor}{O{named} m +m}{%
\begingroup%
\LWR@colorstyle{color:}{#1}{#2}{#3}%
\endgroup%
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\pagecolor} \oarg{model} \marg{color}
%
% Ignored. Use |\NewCSS| instead.
% \begin{macrocode}
\newcommand*{\LWR@pagecolor}[2][named]{}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\colorbox} \oarg{model} \marg{color} \marg{text}
%
% is converted into an \acro{HTML} hex background color span.
%
% \begin{macrocode}
\NewDocumentCommand{\LWR@colorbox}{O{named} m m}{%
\begingroup%
\LWR@colorstyle{background:}{#1}{#2}{#3}%
\endgroup%
}
% \end{macrocode}
% ^^A \end{macro}
% ^^A \begin{macro}{\fcolorbox}
% \oarg{framemodel} \marg{framecolor} \oarg{boxmodel} \marg{boxcolor} \marg{text}
%
% is converted into a framed \acro{HTML} hex background color span.
%
% \begin{macrocode}
\NewDocumentCommand{\LWR@fcolorbox}{O{named} m O{named} m m}{%
\begingroup%
\LWR@colorstyle{border:1px solid }{#1}{#2}%
{\LWR@colorstyle{background:}{#3}{#4}{#5}}%
\endgroup%
}
% \end{macrocode}
% ^^A \end{macro}
% \iffalse
%</xcolor>
% \fi
% \clearpage
% \iffalse
%<*xfrac>
% \fi
% \part{lwarp-xfrac.sty}
% \section{Xfrac}
% \label{sec:xfrac}
%
% \DescribePackage{xfrac} Supported by adding \pkg{xfrac} instances.
%
% \codehtml
% \begin{macrocode}
\LWR@ProvidesPackagePass{xfrac}
% \end{macrocode}
% In the user's document preamble, \pkg{lwarp} should be loaded
% after font-related setup.
% \watchout[font size]
% During \acro{HTML} conversion, this font is used by \pkg{lwarp}
% to generate its initial \acro{PDF} output containing \acro{HTML} tags,
% later to be converted by |pdftotext| to a plain text file.
% While the text may be in any font which |pdftotext| can read, the math is
% directly converted into \acro{SVG} images using this same user-selected font.
% |xfrac| below is set for the Latin Modern (lmr) font.
% If another font is used, it may be desirable to redefine
% \cs{xfracHTMLfontsize} with a different em size.
% \DescribeMacro{\sfrac} \oarg{instance} \marg{num} \oarg{sep} \marg{denom}
%
% A text-mode instance for the default font is provided below.
% The numerator and denominator formats are adjusted to encase everything
% in \acro{HTML} tags. \cs{scalebox} is made null inside the numerator and
% denominator, since the \acro{HTML} tags should not be scaled, and we do not
% want to introduce additional \acro{HTML} tags for scaling.
%
% In math mode, which will appear inside a \env{lateximage}, no adjustments
% are necessary.
% \codeall
% \begin{macrocode}
\begin{warpall}
% \end{macrocode}
% ^^A \begin{macro}{\xfracHTMLfontsize}
% \changes{v0.19}{2016/06/06}{Added.}
% \index{font>size --- xfrac}
% User-redefinable macro which controls the font size of the fraction.
% \begin{macrocode}
\newcommand*{\xfracHTMLfontsize}{.6em}
% \end{macrocode}
% ^^A \end{macro}
% \begin{macrocode}
\end{warpall}
% \end{macrocode}
% \codehtml
% \begin{macrocode}
\begin{warpHTML}
% \end{macrocode}
% A span for a small font, used in the numerator and denominator:
% \margintag{font size}
% \begin{macrocode}
\newcommand*{\LWR@htmlsmallfontstart}{%
\LWR@htmltagc{span style="font-size:\xfracHTMLfontsize"{}}%
\LWR@nestspan%
%
}
\newcommand*{\LWR@htmlsmallfontend}{%
\LWR@htmltagc{/span}%
\endLWR@nestspan%
}
% \end{macrocode}
% A nullified \cs{scalebox} command, to avoid introducing \acro{HTML} scaling tags:
% \margintag{\cs{scalebox}}
% \begin{macrocode}
\NewDocumentCommand{\LWR@noscalebox}{m o m}{#3}
% \end{macrocode}
% Instances of \pkg{xfrac} for various font choices:
% \margintag{instances}
%
% Produce \acro{HTML} tags for a small superscript numerator and
% a small (non-subscript) denominator.
%
% Scaling is turned off so that \cmds{pdftotext} correctly reads the result.
%
% \changes{v0.16}{2016/04/07}{xfrac: Adjusted for the use of any font:}
% \begin{macrocode}
\DeclareInstance{xfrac}{default}{text}{
numerator-format = {%
\let\scalebox\LWR@noscalebox%
\LWR@htmlsmallfontstart\textsuperscript{#1}\,\LWR@htmlsmallfontend},
denominator-format = {%
\let\scalebox\LWR@noscalebox%
\LWR@htmlsmallfontstart{}\,#1\LWR@htmlsmallfontend},
% \end{macrocode}
% For |pdftotext|, do not scale the text:
% \begin{macrocode}
scaling = false
}
\DeclareInstance{xfrac}{lmr}{text}{
numerator-format = {%
\let\scalebox\LWR@noscalebox%
\LWR@htmlsmallfontstart\textsuperscript{#1}\,\LWR@htmlsmallfontend},
denominator-format = {%
\let\scalebox\LWR@noscalebox%
\LWR@htmlsmallfontstart{}\,#1\LWR@htmlsmallfontend},
% \end{macrocode}
% For |pdftotext|, do not scale the text:
% \begin{macrocode}
scaling = false
}
\DeclareInstance{xfrac}{lmss}{text}{
numerator-format = {%
\let\scalebox\LWR@noscalebox%
\LWR@htmlsmallfontstart\textsuperscript{#1}\,\LWR@htmlsmallfontend},
denominator-format = {%
\let\scalebox\LWR@noscalebox%
\LWR@htmlsmallfontstart{}\,#1\LWR@htmlsmallfontend},
% \end{macrocode}
% For |pdftotext|, do not scale the text:
% \begin{macrocode}
scaling = false
}
\DeclareInstance{xfrac}{lmtt}{text}{
numerator-format = {%
\let\scalebox\LWR@noscalebox%
\LWR@htmlsmallfontstart\textsuperscript{#1}\,\LWR@htmlsmallfontend},
denominator-format = {%
\let\scalebox\LWR@noscalebox%
\LWR@htmlsmallfontstart{}\,#1\LWR@htmlsmallfontend},
% \end{macrocode}
% For |pdftotext|, do not scale the text:
% \begin{macrocode}
scaling = false
}
% \end{macrocode}
% \begin{macrocode}
\end{warpHTML}
% \end{macrocode}
% \iffalse
%</xfrac>
% \fi
% \clearpage
% \renewcommand*{\partname}{}
% \renewcommand*{\thepart}{}
% \part{Change History and Index}
% \label{sec:changehistory}
%
% \pagestyle{plain}
%
% \Finale
\endinput
|