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
|
%% skrapport Skånings rapportklass
%%
%% Copyright (C) 2012-2016 by Simon Sigurdhsson <sigurdhsson@gmail.com>
%%
%% 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.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Simon Sigurdhsson.
%%
%% This work consists of the file skrapport.tex and the derived files:
%% * skrapport.cls
%% * skrapport-colortheme-default.sty
%% * skrapport-colortheme-unscathed.sty
%% * skrapport-colortheme-violet.sty
%% * skrapport-colortheme-cruelwater.sty
%% * skrapport-colortheme-skdoc.sty
%% * skrapport-size-common.sty
%% * skrapport-size10pt.clo
%% * skrapport-size11pt.clo
%% * skrapport-size12pt.clo
\documentclass{skdoc}
\let\SI\relax
\usepackage{siunitx}
\DeclareSIUnit\point{pt}
\usepackage{hologo,booktabs,xcoffins,calc}
\usepackage[style=authoryear]{biblatex}
\usepackage{csquotes}
\usepackage{varioref,cleveref}
%\usepackage{chslacite}
\ExplSyntaxOn
\cs_set_protected_nopar:Npn\ExplHack{
\char_set_catcode_letter:n{ 58 }
\char_set_catcode_letter:n{ 95 }
}
\ExplSyntaxOff
% Hide the implementation
\OnlyDescription
% Bibliography entries
\begin{filecontents}{skrapport.bib}
@article{kpfonts,
author = {Christophe Caignaert},
title = {KP-Fonts 3.33},
year = {2018},
url = {http://mirror.ctan.org/fonts/kpfonts/doc/kpfonts.pdf}
}
@standard{ISO216,
title = {ISO 216:2007},
subtitle = {Writing paper and certain classes of printed matter -- Trimmed sizes -- A and B series, and indication of machine direction},
author = {{International Organization for Standardization, Technical Committee 6}},
year = {2007}
}
@standard{ISO8601,
title = {ISO 8601:2004},
subtitle = {Data elements and interchange formats -- Information interchange -- Representation of dates and times},
author = {{International Organization for Standardization, Technical Committee 154}},
year = {2004}
}
@article{Flynn,
author = {Peter Flynn},
title = {Rolling your own Document Class: Using \LaTeX{} to
keep away from the Dark Side},
journal = {The Prac\TeX{} Journal},
number = {4},
year = {2006},
url = {http://tug.org/pracjourn/2006-4/flynn/flynn.pdf}
}
\end{filecontents}
\addbibresource{skrapport.bib}
% Declare the target files
\SelfPreambleTo{\mypreamble}
\DeclareFile[key=class,preamble=\mypreamble]{skrapport.cls}
\DeclareFile[key=size-common,preamble=\mypreamble]%
{skrapport-size-common.sty}
\DeclareFile[key=size-10,preamble=\mypreamble]{skrapport-size10pt.clo}
\DeclareFile[key=size-11,preamble=\mypreamble]{skrapport-size11pt.clo}
\DeclareFile[key=size-12,preamble=\mypreamble]{skrapport-size12pt.clo}
\DeclareFile[key=theme-default,preamble=\mypreamble]%
{skrapport-colortheme-default.sty}
\DeclareFile[key=theme-unscathed,preamble=\mypreamble]%
{skrapport-colortheme-unscathed.sty}
\DeclareFile[key=theme-cruelwater,preamble=\mypreamble]%
{skrapport-colortheme-cruelwater.sty}
\DeclareFile[key=theme-violet,preamble=\mypreamble]%
{skrapport-colortheme-violet.sty}
\DeclareFile[key=theme-skdoc,preamble=\mypreamble]%
{skrapport-colortheme-skdoc.sty}
% This is where the documentation begins
\begin{document}
% Change & version info
\version{0.12k}
\changes{0.01}{Initial version}
\changes{0.03}{Removed \cs{rd} and \cs{id}}
\changes{0.04}{Added \pkg{microtype} package}
\changes{0.05}{Improved documentation}
\changes{0.06}{Corrected cheksum, further improved documentation}
\changes{0.07}{Various bugfixes, \hologo{XeLaTeX} compatibility,
better float settings, quote style fix,
\opt{intlimits} option to \pkg{amsmath}}
\changes{0.07a}{Fixed \pkg{kpfonts} issues}
\changes{0.09}{Introduced \pkg{kvoptions},
fixed abstract in twocolumn mode}
\changes{0.10}{Include skmath if exists
and wanted. Gobble optional arguments to
\env{figure} and \env{table} in two-column mode}
\changes{0.10a}{Include \pkg{xparse} (fixes breakage)}
\changes{0.11}{Added \opt{minion} for Adobe Minion Pro font}
\changes{0.11a}{Added \opt{skdoc} font option and \thm{skdoc} color theme}
\changes{0.12}{Deprecated several macros, moved to \LaTeX3. Use of TOC depth above 3 is now unsupported}
\changes{0.12a}{The \pkg{fontspec} package is now only loaded when using the \texttt{word} or \texttt{none} font stacks on \hologo{LuaLaTeX} or \hologo{XeLaTeX}. The \texttt{word} font stack is now
the default font stack on \hologo{XeLaTeX}}
\changes{0.12b}{Minor and major bugfixes to \cs{maketitle}, \opt{ptsize}, \opt{twocolumn} and others}
\changes{0.12c}{Added german language option, fixed sectioning macros in \opt{twocolumn} mode}
\changes{0.12d}{Added \opt{hanging-titles}, latin phrase macros. Load \pkg{isomath}. Don't load \pkg{icomma}. Use \cs{frenchspacing}}
\changes{0.12e}{Replace usage of deprecated \pkg{expl3} macros (thanks for the heads-up, Joseph Wright!)}
\changes{0.12f}{Fix incorrect usage of \pkg{xparse} macros}
\changes{0.12g}{Track \pkg{expl3} changes (thanks to Joseph Wright)}
\changes{0.12h}{Fix incompatibilities with recent \pkg{expl3}}
\changes{0.12i}{Track \pkg{expl3} changes (thanks to Joseph Wright)}
\changes{0.12j}{Track \pkg{expl3} changes (thanks to Phelype Oleinik). Replaces \pkg{opensans} option \opt{osfigures} with \opt{oldstyle}}
\changes{0.12k}{Don't try to generate \texttt{c}-variant macros from \texttt{n}-variant base forms}
% Don't forget to update the version number and release date of
% the package declaration in the implementation!
% Metadata
\package[ctan=skrapport,vcs=https://github.com/urdh/skrapport]{skrapport}
\title{The \textbf{\thepackage} document class}
\author{Simon Sigurdhsson}
\email{sigurdhsson@gmail.com}
% First page
\maketitle
\begin{abstract}
A document class intended for simple documents \emph{e.g.}
reports handed in to courses and such. It is small,
straight-forward and heavily inspired by the Prac\TeX{}
Journal style.
\end{abstract}
\tableofcontents
\section{Documentation}
The \thepackage\ document class aims to make typesetting simple but
stylish documents (mostly reports) as effortless as possible. It
does this by mostly reimplementing the default \pkg{article} class
in \LaTeX3, while making modifications to both form and function
along the way.
Because it is reimplemented in \LaTeX3, it may be incompatible with
any number of packages that patch or otherwise modify internals of
\pkg{article} or other document classes. For commonly used packages
(especially those used frequently by the author), this shouldn't be
a problem. The author gladly accepts reports of any such issues at
the project issue tracker --- see \enquote{Known issues} on
\vpageref{sec:issues}.
\subsection{Options}
As with other document classes, the class is loaded, possibly with
options, by issuing \Macro\documentclass[<options>]{skrapport}.
The class has a number of options controlling both form and function,
by \emph{e.g.} setting the font size, selecting a font stack, setting
the section title style, and so on.
\subsubsection{Layout}
Two options controlling the overall layout of the document are
provided. Collectively they control the paper size and text layout
of the document.
\Option{paper}\WithValues{a4, a5}\AndDefault{a4}
The \opt{paper} option controls the paper size of the document.
Internally, this is set by the \pkg{typearea} package, so in theory
many more paper sizes could be available, but the current options
cover most useful documents.
\Option{twocolumn}
The \opt{twocolumn} option sets up a two-column mode. This is not
provided by internal \LaTeX\ mechanics as in the original
\pkg{article} class, but instead by patching environments and macros
and using a combination of the \pkg{multicol} and \pkg{grid}
packages. In theory, this means that baselines of adjacent columns
should be aligned, and that three- or four-column modes are possible
in the future (but that'd be ridiculous).
\subsubsection{Style}
A couple of options to control the style of the document are
provided. Two of them, \opt{leqno} and \opt{fleqn}, are mainly
provided for compatibility with the \pkg{article} class.
\Option{leqno}
This option makes display math environments typeset their labels on
the left-hand side of the formula instead of the right-hand side.
\Option{fleqn}
This option makes display math environments left-align the entire
formula as opposed to centering it.
\Option{indent}\WithValues{true, false}\AndDefault{false}
The \opt{indent} option enables or disables the indentation of
paragraphs, with the default being not to indent anything. The
default behaviour thus is similar to that obtained using the
\pkg{parskip} package with the \pkg{article} package.
\Option{titles}\WithValues{rm, it, bf, sf}\AndDefault{bf}
Section titles (and a few other elements) are controlled by this
option in that they are typeset either using the regular roman font,
the boldfaced roman font or the sans serif font. For historical
reasons the default is a boldfaced roman font, but the sans serif
option is very handsome.
\Option{hanging-titles}\WithValues{true, false}\AndDefault{false}
This options allow sections to be set as \enquote{hanging} titles,
\emph{i.e.} with the section number in the margin.
\Option{color}\WithValues{\meta{color theme}}\AndDefault{default}
This option tells the class to activate color theme support and
optionally load a color theme. Several color themes are available
(as detailed by \enquote{Color themes} \vpageref{ssec:color}),
and the special value \texttt{false} disables color support
entirely (which only means that the \pkg{xcolor} package isn't
loaded, and that \cs{colortheme} remains undefined).
\subsubsection{Fonts}
Only two options control the font setup of the document class. The
class provides the same point sizes as \pkg{article}, but also
provides a large number of font stacks to choose from.
\Option{ptsize}\WithValues{10pt, 11pt, 12pt}\AndDefault{11pt}
The document class provides the same three point sizes as the
\pkg{article} class. There is room for expansion, but there really
shouldn't be any reason to use other point sizes.
\Option{font}\WithValues{none, kpfonts, lmodern, palatino, minion, skdoc, word}\AndDefault{kpfonts}
Several different font stacks, detailed by \vref{tab:font}, are
provided. Most of these work with \hologo{pdfLaTeX}, but there are
two special font stacks: \texttt{none} and \texttt{word}. The
former, predictably, loads no fonts whatsoever leaving the document
with Computer Modern fonts. This is useful if the fonts are replaced
later anyway, such as when using \hologo{XeLaTeX}.
The \texttt{word}
font stack, however, does load a few fonts. The fonts must be present
and installed on the system as OTF or TTF fonts, and the font stack
requires either \hologo{XeLaTeX} or \hologo{LuaLaTeX}.
Both \texttt{word} and \texttt{none} load the \pkg{fontspec}
package, assuming the document is compiled using \hologo{XeLaTeX}
or \hologo{LuaLaTeX}.
\Notice{The \texttt{skdoc} font stack doesn't have a math font.}
\Warning{Currently, \pkg{fontspec} is always loaded by
\hologo{XeLaTeX} regardless of options due to
the use of \pkg{polyglossia}. This means that
you \emph{have} to use OpenType fonts in your
document, otherwise \emph{only} Latin Modern
Roman (\emph{i.e.} no sans-serif or monospace
fonts) will be available. Therefore, the \texttt{word}
font stack is the default when using \hologo{XeLaTeX}.
\Hologo{LuaLaTeX} is not affected by this.}
\begin{table}[tp]
\centering
\caption{Font stacks provided by \thepackage.}
\label{tab:font}
\NewCoffin\tempcoffin\newlength\templength
\SetHorizontalCoffin\tempcoffin{
\begin{tabular}{lllll}
\toprule
Font stack & Serif font & Math font & Sans serif font & Monospace font \\
\midrule
\texttt{kpfonts} & Kp-Fonts & Kp-Fonts & Kp-Fonts & Kp-Fonts \\
\texttt{lmodern} & Latin Modern & Latin Modern & Latin Modern & Source Code Pro \\
\texttt{palatino} & \TeX\ Gyre & PX & Arev & Source Code Pro \\
\texttt{minion} & Minion Pro & Minion Pro & Myriad Pro & Source Code Pro \\
\texttt{skdoc} & PT Serif & --- & Open Sans & Source Code Pro \\
\texttt{word} & Cambria & Cambria Math & Calibri & Consolas \\
\bottomrule
\end{tabular}
}
\setlength{\templength}{(\textwidth - \CoffinWidth\tempcoffin)/2}
\hspace*{\templength}
\TypesetCoffin\tempcoffin
\end{table}
\subsubsection{Functionality}
The final three options affect functionality in one way or another.
Since \thepackage\ was originally designed for reports written in
either swedish or english, the class always loads either \pkg{babel}
or \pkg{polyglossia} with either of these languages. Additionally,
the class may load the \pkg{skmath} package if desirable.
\Option{nomath}\WithValues{true, false}\AndDefault{false}
When \texttt{false}, the \pkg{skmath} package is loaded, providing
improvements to the math functionality of \pkg{amsmath} and friends.
\Option{lang}\WithValues{en, sv, de}\AndDefault{sv}
This option specifies what main language \pkg{babel} or
\pkg{polyglossia} set up with. English (or swedish, for
\texttt{lang=en}) is loaded as well, for use in constructs
that allow for a second language.
\Option{draft}\WithValues{true, false}\AndDefault{false}
The \opt{draft} option, much like in \pkg{article}, enables
\cs{overfullrule}s and possibly similar functionality in loaded
packages (if they react to the global \opt{draft} option).
\subsection{User-level commands and environments}
The general idea behind the document class is to provide most
(if not all) of the macros provided by the standard \LaTeXe{}
classes, as well as additional macros to simplify and beautify
the documents produced. As such, most of the documentation that
follows details macros that are present in the standard document
classes. Some of them have changed functionality or semantics,
so at least a skim through this section is recommended.
\subsubsection{The front page}
The front page is the part of the document that has seen the most
changes in \thepackage\ compared to \pkg{article}. In addition to
the new, Prac\TeX-inspired layout, there are a few additional
pieces of information in it. Also, the \cs{author} macro has been
dramatically improved.
\DescribeMacro\date{<ISO8601 date>}
The \cs{date} macro now internally employs \pkg{isodate} to typeset
the date of the document. This means that the input must be either
the string \enquote{today}, the token \cs{today} or a date as defined
by ISO8601\footcite{ISO8601}. The mechanisms provided by
\pkg{isodate} can be used to affect the output format.
\DescribeMacro\author[<email>]{<name>}
In contrast with the \pkg{article} package, the \cs{author} macro
should no longer be used to typeset several author names at once.
Instead, one \cs{author} command is to be issued for every author,
optionally providing a corresponding email. These are then combined,
in the order they are given, to form a list of authors and a
corresponding list of email adresses.
\DescribeMacro\regarding{<topic>}
This macro defines a topic or other short message detailing the
purpose of the document. It is typeset along with the date in the
upper left corner of the title page.
\DescribeMacro\license{<license name>}
The \cs{license} macro defines a short license name to be typeset
in the lower right corner of the title page. This mechanism could of
course be used to typeset an institution name or similar as well.
It is only typeset when also using the \env{titlepage} environment
described below.
\DescribeMacro\title{<document title>}
The \cs{title} macro, while not defined by \pkg{skrapport}, is
relevant to describe. It simply sets the title of the document, as
displayed by \cs{maketitle}.
\DescribeMacro\maketitle[hide=\{date,regarding,email\},nopdfinfo]
As in \pkg{article}, the \cs{maketitle} macro typesets the
information provided by \cs{title}, \cs{author} and friends to form
a stylish front page. When combined with \env{abstract},
\env{titlepage} and/or \cs{tableofcontents}, you get a very
good-looking preamble with almost no effort.
The optional argument is a key-value list with two valid entries,
\opt*{hide} and \opt*{nopdfinfo}. The \opt*{hide} entry accepts a
comma-separated list in which the values \opt*{date},
\opt*{regarding} and \opt*{email}
are interpreted as instructions to hide the corresponding entry from
the front page. The \opt*{nopdfinfo} key disables the generation of
PDF information by \pkg{hyperref}.
\DescribeEnv[<abstract text>]{abstract}
The \env{abstract} environment defines an abstract, which is typeset
in a block with the \cs{abstractname} word next to it (see
\emph{e.g.} the title page of this manual for an example).
\DescribeEnv[<title page contents>]{titlepage}
Normally, \cs{maketitle} doesn't reserve its own page. By enclosing
\cs{maketitle} (and \env{abstract} if appropriate) in the
\env{titlepage} environment, the contents are typeset on their
own page, without page numbering and with the \cs{license} text
in the lower right corner (if applicable).
\subsubsection{Sectioning}
\DescribeMacro\section*[<short title>]{<title>}
\DescribeMacro\subsection*[<short title>]{<title>}
\DescribeMacro\subsubsection*[<short title>]{<title>}
\DescribeMacro\paragraph*[<short title>]{<title>}
\DescribeMacro\subparagraph*[<short title>]{<title>}
The sectioning macros are superficially very similar to those
provided by \pkg{article}, but have been completely reimplemented
in \pkg{expl3} code. Additionally, the style of these sectioning
macros, as detailed by the \opt{titles} option documentation above,
can be changed.
All of them have both arguments and behaviour in common, only
differing in style. The starred versions are unnumbered, but still
accept the opional short title (simply discarding it). The optional
short title is used in the table of contents. The
\texttt{secnumdepth} counter limits the depth of section numbering.
The first three macros, being section titles, are typeset as actual
titles on their own line with appropriate spacing above and below.
The paragraph macros instead typeset run-in titles.
\subsubsection{Macros and environments from \pkg{article}}
Aside from the \env{itemize} and \env{enumerate} envionments and the
font selection macros, which are carried without modification from
\LaTeXe, a couple of environments and macros are defined.
The old font macros, whose use has been discouraged for a long time,
are now deprecated. Instead of functioning correctly, they will emit
an error and require user input. Use the \cs*{text??}/\cs*{??family}
macros instead. For emphasis, use the \cs{emph} macro.
\DescribeMacro\emph{<text>}
Emphasized text will be typeset in italic, or bold italic if the
macro is used in a context where italic is already used (such as
inside another \cs{emph} invokation).
\DescribeEnv[\cs*{item}\oarg{item} \meta{description}]{description}
The \env{description} environment behaves as expected, typesetting
a list of descriptions as in the \pkg{article} class.
\DescribeEnv[<short quote>]{quote}
Intended for short quotes, the \env{quote} environment simply
typesets a centered block of italic text.
\DescribeEnv[<long quote>]{quotation}
Longer quoted passages are typeset using the \env{quotation}
environment. This is simply a \env{quote} environment with additional
spacing above and below.
\DescribeEnv[<pretentious poetry>]{verse}
The \env{verse} environment is intended for poetry and other text
where line breaks are critical. Use \verb|\\| to break
lines.
\DescribeMacro\appendix
This macro signals the end of the main matter and the start of
the appendix. In essence, it resets the section numbering counter
and changes the section numbering to the upper-case alphabetic
sequence.
\subsubsection{Floats}
Both the \env{figure} and \env{table} float environments accept an
optional positioning argument. The default positioning is
\texttt{tp}. Both environments also have starred variants, which
do nothing in one-column mode while typesetting the figure across
both columns in two-column mode. As usual, \cs{centering},
\cs{caption} and \cs{label} should be used inside the floats.
\DescribeEnv[<content>]{figure}[position]
This float environment is intended for figures. The most common
contents are \cs{includegraphics} statements or \env{tikzpicture}
environments.
\DescribeEnv[<content>]{table}[position]
A float intended for tables. Probably contains \env{tabular}s.
\DescribeEnv{figcenter}
This environment is useful for wide figures and tables. It typesets
its contents centered horizonally, but allows the content to extend
into the margin. The content is set in a horizontal coffin.
\subsubsection{Table of contents}
\DescribeMacro\tableofcontents
The table of contents are typeset using this macro. The
\texttt{tocdepth} counter limits the depth of the table of
contents, but for stylistic reasons values higher than 3 are
unsupported.
% \subsubsection{Basic bibliography support}
\subsubsection{Miscellaneous}
\DescribeMacro\comment*{<comment>}
\DescribeMacro\note*{<comment>}
\DescribeMacro\com*{<comment>}
These macros, the two latter being aliases of the first one, typeset
an author's comment in the document. The starred variants typeset the
comment inline with a red background, while the unstarred variant
typesets the comment in a \cs{marginpar}.
\DescribeMacro\eg
\DescribeMacro\ie
\DescribeMacro\etc
\DescribeMacro\cf
\DescribeMacro\viz
These macro print the abbreviation of the latin phrases
\emph{exempli gratia}, \emph{id est}, \emph{et cetera},
\emph{confer} and \emph{videlicet}, respectively.
The macros peek ahead to find punctuation marks and spaces, so they
should behave correctly regardless of usage (assuming they're used in
running text and uncomplicated settings). In languages other than
english, appropriate translations are made if applicable.
\DescribeMacro\dash
This macro prints an em-dash surrounded by thin spaces, as discussed
by \textcite[\pno~8]{Flynn}. When \cs*{DeclareUnicodeCharacter} is
available, the real em dash uses this definition.
\subsubsection{Color theme support}
\DescribeMacro\colortheme{<theme>}
The \cs{colortheme} macro, which is only available when the
\opt{color} option is \texttt{true}, applies a color theme to
the document. For a list of available color themes, see
\enquote{Color themes} \vpageref{ssec:color}.
\subsubsection{Font size macros}
The font size macros, expectedly, set the size of the text. They
do not take arguments, instead affecting all subsequent text of the
current \TeX\ group, so use braces to provide and limit context.
Also note that unlike \pkg{article}, these macros are \emph{all}
available, regardless of point size option.
\DescribeMacro\tiny
Typesets {\tiny tiny} text.
\DescribeMacro\scriptsize
Typesets {\scriptsize script-size} text.
\DescribeMacro\footnotesize
Typesets {\footnotesize footnote-sized} text.
\DescribeMacro\small
Typesets {\small small} text.
\DescribeMacro\normalsize
Typesets normal text.
\DescribeMacro\large
Typesets {\large large} text.
\DescribeMacro\Large
Typesets {\Large slightly larger} text.
\DescribeMacro\LARGE
Typesets {\LARGE even larger} text.
\DescribeMacro\huge
Typesets {\huge huge} text.
\DescribeMacro\Huge
Typesets {\Huge really huge} text.
\subsection{Color themes}\label{ssec:color}
\DescribeMacro\colortheme{<theme>}
If the package is loaded with the \opt{color} option, changing the color theme is
possible using \cs{colortheme}, which loads an
appropriate package. At the moment, four color themes are available.
\Theme{default}
The \thm{default} theme is fairly conservative, only coloring
\pkg{hyperef} links with more readable, slightly darker colors than
the standard ones. It should print well even on non-color printers.
\Theme{unscathed}
The \thm{unscathed} theme is based on a palette with the same
name on COLOURlovers%
\footnote{\url{http://www.colourlovers.com/palette/1440498/unscathed}},
and applies a \textcolor[HTML]{463335}{dark brown} color to
emphasized text, a \textcolor[HTML]{CF5D3B}{rusty} color to links,
a \textcolor[HTML]{B34430}{darker rust} color to titles and a
\textcolor[HTML]{70524A}{lighter brown} to quotes.
\Theme{cruelwater}
The \thm{cruelwater} theme is also based on a palette from
COLOURlovers%
\footnote{\url{http://www.colourlovers.com/palette/126030/Cruel_Water_at_Night}},
and applies a \textcolor[HTML]{030C22}{dark blue} color to bold
text and captions, a \textcolor[HTML]{20293F}{slightly less dark
blue} to titles and emphasized text, a \textcolor[HTML]{A9B0B3}{
light gray} color to small print and a \textcolor[HTML]{404749}{
darker gray} to quotes.
\Theme{violet}
The \thm{violet} theme, like \thm{unscathed} and \thm{cruelwater},
is based on a COLOURlovers palette%
\footnote{\url{http://www.colourlovers.com/palette/1831303/Violet_White_Bedrm}}.
It colors all links \textcolor[HTML]{932444}{bright purple}, applies
a \textcolor[HTML]{311A2A}{dark puple} color to titles, bold text
and captions, a \textcolor[HTML]{D6CBCF}{grayish purple} to small
print, a \textcolor[HTML]{463335}{dark brown} color to quotes and a
\textcolor[HTML]{98758D}{pastel violet} color to emphasized text.
\Theme{skdoc}
The \thm{skdoc} theme is loosely based on the \pkg{skdoc} document class, with which this documentation is typeset.
% \subsection{Additional information}
% The document class includes a number of packages by default. This
% is useful to know, since passing explicit options to these packages
% will require you to utilize the \cs{PassOptionsToPackage} macro
% before you load the class using \cs{documentclass}.
% Table~\ref{tab:pkgs} lists the packages included by \thepkg\ along
% with their options (if applicable).
%
% \begin{table}[tbp]
% \centering
% \caption{User-level packages included by \thepkg.}
% \label{tab:pkgs}
% \begin{tabular}{llp{15em}}
% \toprule
% \textbf{Package} & \textbf{Options} & \textbf{Comments} \\
% \midrule
% \pkg{amsmath} & \texttt{intlimits} & Provides \hologo{AmS} commands and environments. \\
% \pkg{amssymb} & & Only if not using \opt{kpfonts}.\\
% \pkg{babel} & see options \opt{swe} and \opt{eng} & Only loaded if \emph{not} using \hologo{XeTeX}.\\
% \pkg{calc} & & \\
% \pkg{fontenc} & \texttt{T1} & Only loaded if \emph{not} using \hologo{XeTeX}. Makes sure we are using a good font encoding for crisp appearance on-screen (OT1 is horrible). \\
% \pkg{fontspec} & \texttt{quiet} & Only loaded if using \hologo{XeTeX}. Provides basic OTF font selection commands.\\
% \pkg{geometry} & \texttt{a4paper} or \texttt{a5paper} & This is used by the \opt{paper} option to set the paper area. \\
% \pkg{icomma} & & \\
% \pkg{inconsolata} & & \\
% \pkg{microtype} & & Provides micro-typographic improvements.\\
% \pkg{multicol} & & Only loaded with the \opt{twocolumn} option. \\
% \pkg{polyglossia} & see options \opt{swe} and \opt{eng} & Only loaded if using \hologo{XeTeX}.\\
% \pkg{skmath} & & Only if it exists and \opt{nomath} isn't set.\\
% \pkg{textcomp} & & Only if not using \opt{kpfonts}.\\
% \pkg{xcolor} & & Only loaded with the \opt{color} option.\\
% \bottomrule
% \end{tabular}
% \end{table}
\section{Known issues}\label{sec:issues}
A list of current issues is available in the Github repository of this
package\footnote{\url{https://github.com/urdh/skrapport/issues}}, but as
of the release of \theversion, there is one known issue:
\begin{description}
% \item[\#6] ???
\item[--] If a \cs{subsubsection} is the last item of the Table
of Contents, it will not be indented properly.
\end{description}
If you discover any bugs in this package, please report them to the issue
tracker in the \thepackage\ Github repository.
\Implementation\ExplHack
\section{Implementation}
Start by including \pkg{expl3}, \pkg{l3keys2e} and some other
useful packages, as well as declaring the class.
\begin{MacroCode}{class}
\RequirePackage{expl3,l3keys2e,xparse,xstring,etoolbox}
\ProvidesExplClass{skrapport}%
{2019/10/15}{0.12k}{stylish report document class}
\end{MacroCode}
\subsection{Messages}
Tons of messages are declared for future use.
\begin{MacroCode}{class}
\msg_new:nnnn{skrapport}{option-deprecated}{Option~`#1'~deprecated!}
{Please~use~`#2'~instead.}
\msg_new:nnnn{skrapport}{option-no-effect}{Option~`#1'~deprecated!}
{It~has~no~effect;~simply~use~nothing~instead.}
\msg_new:nnnn{skrapport}{invalid-paper-size}{Invalid~paper~size~`#1'!}
{\token_to_str:N\__skrapport_setup_paper:n~was~invoked~with~an~
invalid~argument;~paper~size~will~remain~unchanged.}
\msg_new:nnnn{skrapport}{invalid-point-size}{Invalid~point~size~`#1'!}
{\token_to_str:N\__skrapport_setup_ptsize:n~was~invoked~with~an~
invalid~argument;~cannot~continue~without~setting~a~valid~point~
size.~Please~fix~the~issue~before~typesetting~again.}
\msg_new:nnnn{skrapport}{invalid-titles}{Invalid~title~type~`#1'!}
{\token_to_str:N\__skrapport_setup_titles:n~was~invoked~with~an~
invalid~argument;~falling~back~to~`#2'.}
\msg_new:nnnn{skrapport}{invalid-lang}{Invalid~language~`#1'!}
{\token_to_str:N\__skrapport_setup_lang:n~was~invoked~with~an~
invalid~argument;~`babel'~and/or~`polyglossia'~will~remain~
unloaded.}
\msg_new:nnnn{skrapport}{invalid-font}{Invalid~font~`#1'!}
{\token_to_str:N\__skrapport_setup_font:n~was~invoked~with~an~
invalid~argument;~no~font~package~has~been~loaded.~This~may~result~
in~bad~rendering~due~to~old~Computer~Modern~fonts.}
\msg_new:nnnn{skrapport}{noop-call}{No-op~invokation~of~macro!}
{\token_to_str:N#1~was~invoked,~but~circumstances~dictate~that~the~
macro~should~do~nothing.~Will~do~\token_to_str:N\prg_do_nothing:~
instead.}
\msg_new:nnnn{skrapport}{old-font-deprecated}{Deprecated~macro~\token_to_str:N#1!}
{The~old~font~macro~\token_to_str:N#1~is~deprecated!~Use~
\token_to_str:N#2~instead.}
\msg_new:nnnn{skrapport}{color-patch-failed}{Could~not~patch~macro~\token_to_str:N#1!}
{The~macro~\token_to_str:N#1~could~not~be~patched!~Color~theme~
support~may~be~incomplete.}
\msg_new:nnnn{skrapport}{license-not-printed}{Detected~\token_to_str:N\license\ but~no~`titlepage'!}
{The~text~provided~by~\token_to_str:N\license\ is~only~printed~when~
the~`titlepage'~environment~is~used,~but~it~seems~to~be~missing.}
\msg_new:nnnn{skrapport}{font-requires-xetex}{The~`font=#1'~option~requires~XeTeX~or~luaTeX!}
{Please~choose~another~font~setup~or~compile~the~document~with~
either~xelatex~or~lualatex.}
\msg_new:nnnn{skrapport}{tocdepth-too-deep}{TOC~depth~is~too~deep!}
{The~current~tocdepth,~#1,~is~not~supported.~Please~redefine~the~
\token_to_str:N#2~macro~to~enable~support.}
\msg_new:nnnn{skrapport}{caption-in-figcenter}{Cannot~use~\token_to_str:N\caption\ here!}
{The~\token_to_str:N\caption\ macro~can't~be~used~inside~figcenter~environments!~Please~move~the~caption~to~the~enclosing~float~environment.}
\end{MacroCode}
This message should probably not be used at all. Except in
development versions straight off Github, of course.
\begin{MacroCode}{class}
\msg_new:nnn{skrapport}{not-implemented}
{Unimplemented~macro~\token_to_str:N#1!}
\end{MacroCode}
\subsection{Options}
First, a few booleans used by parts of the option handling code.
\begin{macro}{\g__skrapport_draft_bool}
Are we in \opt{draft} mode?
\begin{MacroCode}{class}
\bool_new:N\g__skrapport_draft_bool
\end{MacroCode}
\end{macro}
\begin{macro}{\g__skrapport_color_bool}
Are we supposed to be using \opt{color}s?
\begin{MacroCode}{class}
\bool_new:N\g__skrapport_color_bool
\end{MacroCode}
\end{macro}
\begin{macro}{\g__skrapport_has_polyglossia_bool}
Has \pkg{polyglossia} been loaded?
\begin{MacroCode}{class}
\bool_new:N\g__skrapport_has_polyglossia_bool
\end{MacroCode}
\end{macro}
\subsubsection{Option setup macros}
In this section, all options declared in the previous section are
implemented using setup macros. Some of these may have to be called
in an appropriate order, but I haven't checked that yet.
\begin{macro}{\__skrapport_setup_paper:n}[1]
{Paper size (\texttt{a4} or \texttt{a5})}
\changes{0.12}{Use \pkg{typearea} to set paper size}
Note the extra integer, which is set up for use with \pkg{grid}.
\begin{macro*}{\g__skrapport_grid_lines_int}
\begin{MacroCode}{class}
\int_new:N\g__skrapport_grid_lines_int
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_setup_paper:n#1{
\str_case:nnF{#1}{
\end{MacroCode}
The two options simply consist of passing the appropriate option
to the \pkg{typearea} package. Note that the use of \pkg{typearea}
mean that we theoretically could accept more paper size options.
\begin{MacroCode}{class}
{a4}{
\PassOptionsToPackage{paper=A4}{typearea}
\int_gset:Nn\g__skrapport_grid_lines_int{40}
}
{a5}{
\PassOptionsToPackage{paper=A5}{typearea}
\int_gset:Nn\g__skrapport_grid_lines_int{28}
}
}{
\end{MacroCode}
Invalid paper sizes (such calls should never happen) are
handled by issuing a warning and hoping that the default
paper size is acceptable.
\begin{MacroCode}{class}
\msg_warning:nnn{skrapport}{invalid-paper-size}{#1}
}
\end{MacroCode}
The \pkg{typearea} package is loaded with the options specified
earlier through \cs{PassOptionsToPackage}, and some additional ones.
\begin{MacroCode}{class}
\AtEndOfClass{\RequirePackage[DIV=calc]{typearea}}
\end{MacroCode}
In case the point size changes later, or two column mode is
activated, we recalculate the typearea just before the typesetting
begins.
\begin{MacroCode}{class}
\AtBeginDocument{\recalctypearea}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_ptsize:n}[1]
{Point size (\texttt{10pt}, \texttt{11pt} or \texttt{12pt})}
The standard point sizes are defined much like in the \pkg{article}
class, \emph{i.e.} by saving a number and loading \file{size10.clo},
\file{size11.clo} or \file{size12.clo} as appropriate
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_setup_ptsize:n#1{
\str_case:nnF{#1}{
\end{MacroCode}
\begin{macro*}{\c__skrapport_ptsize_token}
\begin{MacroCode}{class}
{10pt}{\int_const:Nn\c__skrapport_ptsize_int{0}}
{11pt}{\int_const:Nn\c__skrapport_ptsize_int{1}}
{12pt}{\int_const:Nn\c__skrapport_ptsize_int{2}}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
}{
\end{MacroCode}
Invalid point sizes are critical errors, since we can't recover
from them in any reasonable way. Loading a default point size is
unreasonable, since all in-class calls to this macro should know
what sizes are available, and if you're calling it with invalid
parameters from elsewhere, you should be punished.
\begin{MacroCode}{class}
\msg_critical:nnn{skrapport}{invalid-point-size}{#1}
}
\file_input:n{skrapport-size#1.clo}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_twocolumn:}
\changes{0.12c}{Major changes to the sectioning commands, to
override what \pkg{grid} is doing}
Setting up for twocolumn mode is slightly compliacted. Note that this
macro should be called from \cs{AtEndOfClass} to ensure that we patch
everything correctly. Note also that \pkg{multicol} is always loaded
as it is used for the \env{theindex} environment.
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_setup_twocolumn:{
\RequirePackage{etoolbox}
\AtBeginDocument{
\KOMAoptions{twocolumn=false,DIV=12}
}
\end{MacroCode}
We include the \pkg{grid} package in two-column mode, because
it looks way better that way.
\begin{MacroCode}{class}
\int_set:Nn\l_tmpa_int{10+\c__skrapport_ptsize_int}
\int_set:Nn\l_tmpb_int{12*\l_tmpa_int/10}
\RequirePackage[fontsize=\l_tmpa_int pt,
baseline=\l_tmpb_int pt,
lines=\g__skrapport_grid_lines_int]{grid}
\end{MacroCode}
Now, we patch commands. First up is \env{abstract}. Save the old
one in case we need it (we do).
\begin{MacroCode}{class}
\cs_set_eq:Nc\__skrapport_onecol_abstract:{environment~abstract~code}
\cs_set_eq:Nc\__skrapport_end_onecol_abstract:{environment~abstract~end~aux~}
\pretocmd{\__skrapport_onecol_abstract:}{\null}{}{}
\RenewDocumentEnvironment{abstract}{}{\section*{\abstractname}}{}
\end{MacroCode}
Then \env{document} (kind of, at least) and \cs{maketitle}. Again,
save the old \cs{maketitle}.
\begin{MacroCode}{class}
\AfterEndPreamble{\begin{multicols}{2}}
\AtEndDocument{\end{multicols}}
\cs_set_eq:NN\__skrapport_onecol_maketitle:\maketitle
\pretocmd{\maketitle}{\begin{onecol}}{}{}
\apptocmd{\maketitle}{\end{onecol}}{}{}
\end{MacroCode}
Next up is \env{titlepage}. This is where we need the saved
\env{abstract} and \cs{maketitle}.
\begin{MacroCode}{class}
\BeforeBeginEnvironment{titlepage}{
\begin{onecol}
\cs_set_eq:cN{environment~abstract~code}\__skrapport_onecol_abstract:
\cs_set_eq:cN{environment~abstract~end~aux~}\__skrapport_end_onecol_abstract:
\cs_set_eq:NN\maketitle\__skrapport_onecol_maketitle:
}
\AfterEndEnvironment{titlepage}{\end{onecol}}
\end{MacroCode}
Always typeset \env{equation} and friends outside the grid:
\begin{MacroCode}{class}
\BeforeBeginEnvironment{equation}{\begin{gridenv}}
\AfterEndEnvironment{equation}{\end{gridenv}}
\BeforeBeginEnvironment{equation*}{\begin{gridenv}}
\AfterEndEnvironment{equation*}{\end{gridenv}}
\BeforeBeginEnvironment{multline}{\begin{gridenv}}
\AfterEndEnvironment{multline}{\end{gridenv}}
\BeforeBeginEnvironment{multline*}{\begin{gridenv}}
\AfterEndEnvironment{multline*}{\end{gridenv}}
\BeforeBeginEnvironment{gather}{\begin{gridenv}}
\AfterEndEnvironment{gather}{\end{gridenv}}
\BeforeBeginEnvironment{gather*}{\begin{gridenv}}
\AfterEndEnvironment{gather*}{\end{gridenv}}
\BeforeBeginEnvironment{align}{\begin{gridenv}}
\AfterEndEnvironment{align}{\end{gridenv}}
\BeforeBeginEnvironment{align*}{\begin{gridenv}}
\AfterEndEnvironment{align*}{\end{gridenv}}
\BeforeBeginEnvironment{flalign}{\begin{gridenv}}
\AfterEndEnvironment{flalign}{\end{gridenv}}
\BeforeBeginEnvironment{flalign*}{\begin{gridenv}}
\AfterEndEnvironment{flalign*}{\end{gridenv}}
\BeforeBeginEnvironment{alignat}{\begin{gridenv}}
\AfterEndEnvironment{alignat}{\end{gridenv}}
\BeforeBeginEnvironment{alignat*}{\begin{gridenv}}
\AfterEndEnvironment{alignat*}{\end{gridenv}}
\end{MacroCode}
Since \pkg{grid} override the usual sectioning macros, we have to
provide fixed and improved variants that conform to our style
and out public API. This is only necessary for
the \enquote{major} sectioning macros, not \cs*{paragraph} and
\cs*{subparagraph}.
\begin{macro*}{\section}
\begin{MacroCode}{class}
\skip_gset:Nn\c__skrapport_section_pre_skip{-.999\baselineskip}
\skip_gset:Nn\c__skrapport_section_post_skip{0.001\baselineskip}
\dim_gset:Nn \c__skrapport_section_indent_dim{\c_zero_dim}
\cs_set_protected:Nn\__skrapport_section_style:
{\normalfont\__skrapport_title_style:}
\DeclareDocumentCommand\section{som}{
\__skrapport_generic_section:nnnnn{section}{1}{##1}{##2}{##3}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\subsection}
\begin{MacroCode}{class}
\skip_gset:Nn\c__skrapport_subsection_pre_skip{\baselineskip}
\skip_gset:Nn\c__skrapport_subsection_post_skip{-.35\baselineskip}
\dim_gset:Nn \c__skrapport_subsection_indent_dim{\c_zero_dim}
\cs_set_protected:Nn\__skrapport_subsection_style:
{\normalfont\__skrapport_title_style:\unskip}
\DeclareDocumentCommand\subsection{som}{
\__skrapport_generic_section:nnnnn{subsection}{2}{##1}{##2}{##3}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\subsubsection}
\begin{MacroCode}{class}
\skip_gset:Nn\c__skrapport_subsubsection_pre_skip{\baselineskip}
\skip_gset:Nn\c__skrapport_subsubsection_post_skip{-.35\baselineskip}
\dim_gset:Nn \c__skrapport_subsubsection_indent_dim{\c_zero_dim}
\cs_set_protected:Nn\__skrapport_subsubsection_style:
{\normalfont\itshape\__skrapport_title_style:\unskip}
\DeclareDocumentCommand\subsubsection{som}{
\__skrapport_generic_section:nnnnn{subsubsection}{3}{##1}{##2}{##3}
}
\end{MacroCode}
\end{macro*}
We also redefine \cs{l@section} to make the TOC blend in a bit.
\begin{macro*}{\l@section}
\begin{MacroCode}{class}
\DeclareDocumentCommand\l@section{mm}{
\group_begin:
\skip_vertical:n{.75ex}
\__skrapport_title_style:
\__skrapport_toc_line:nnnnn{1}{0em}{1.3em}{##1}{
\__skrapport_title_style: ##2
}
\group_end:
}
\end{MacroCode}
\end{macro*}
The \env{figure} environment is patched\ldots
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_xdblfloat:nn##1##2{\@xdblfloat{##1}[##2]}
\cs_generate_variant:Nn\__skrapport_xdblfloat:nn{nx}
\RenewDocumentEnvironment{figure}{o}{
\begin{gridenv}
\vspace{\intextsep}
\begin{minipage}{\linewidth}
\cs_set:Npn\@captype{figure}
\centering
}{
\end{minipage}
\vspace{\intextsep}
\end{gridenv}
}
\RenewDocumentEnvironment{figure*}{o}{
\__skrapport_xdblfloat:nx{figure}
{\IfNoValueTF{##1}{tp}{##1}}
\dim_set_eq:NN\hsize\textwidth
\dim_set_eq:NN\linewidth\textwidth
\centering
}{
\end@dblfloat
}
\end{MacroCode}
\ldots as is \env{table}.
\begin{MacroCode}{class}
\RenewDocumentEnvironment{table}{o}{%
\begin{gridenv}
\vspace{\intextsep}
\begin{minipage}{\linewidth}
\cs_set:Npn\@captype{table}
\cs_set_eq:NN\__skrapport_old_caption:\caption
\RenewDocumentCommand{\caption}{om}{%
\skip_set_eq:NN\l_tmpa_skip\abovecaptionskip
\skip_set_eq:NN\abovecaptionskip\belowcaptionskip
\skip_set_eq:NN\belowcaptionskip\l_tmpa_skip
\vspace{\abovecaptionskip}
\__skrapport_old_caption:[####1]{####2}
\vspace{\belowcaptionskip}
}
\centering
}{
\end{minipage}
\vspace{\intextsep}
\end{gridenv}
}
\RenewDocumentEnvironment{table*}{o}{
\__skrapport_xdblfloat:nx{table}
{\IfNoValueTF{##1}{tp}{##1}}
\dim_set_eq:NN\hsize\textwidth
\dim_set_eq:NN\linewidth\textwidth
\centering
}{
\end@dblfloat
}
\end{MacroCode}
\begin{environment}{onecol}
\changes{0.10}{Fixed, now not completely broken}
\changes{0.12b}{Reverted to \cs{newenvironment}, because \pkg{xparse} breaks the trickery}
Finally, we define an environment \env{onecol} that typesets
arbitrary material in a single column. This is a bit tricky to
do, and probably cargo-cult as well. We define the start of the
environment to immediately end itself (with the empty ending),
then end the \env{multiols} environment, redefine our end macro
to start \env{multicols} as well as redefining the start of
\env{onecol} to simply reset itself, then start the environment
again only to have it ended at once.
Basically, we trick \LaTeX\ into thinking that we have an empty
\env{onecol} environment at the end of the first \env{multicols},
then some content inside a fake \env{onecol}, then an empty
\env{onecol} at the start of the next \env{multicols}. Voilá, no
wierd group errors!
\begin{MacroCode}{class}
\newenvironment{onecol}{
\end{onecol}
\end{multicols}
\group_begin:
\cs_set:Npn\endonecol{
\group_end:
\begin{multicols}{2}
\cs_set_eq:NN\__skrapport_old_onecol:\onecol
\cs_set:Npn\onecol{
\cs_set_eq:NN\onecol\__skrapport_old_onecol:
}
\begin{onecol}
}
\cs_set:Npn\onecol{}
\begin{onecol}
}{}
\end{MacroCode}
\end{environment}
\begin{MacroCode}{class}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_leqno:}
Instead of loading \file{leqno.clo}, we reimplement the (tiny) file
as LaTeX3 code and include it directly. It's not terribly advanced.
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_setup_leqno:{
\RenewDocumentCommand\@eqnnum{}{
\hbox_to_wd:nn{.01pt}{}
\hbox_overlap_right:n{
\normalfont\normalcolor
\skip_horizontal:n{-\displaywidth}
(\theequation)
}
}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_fleqn:}
The \file{fleqn.clo} functionality is more complex, so we include
the file instead of reimplementing.
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_setup_fleqn:{
\file_input:n{fleqn.clo}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_titles:n}[1]
{Title style (\texttt{rm}, \texttt{it},
\texttt{bf} or \texttt{sf})}
The title styles are implemented by creating a new macro
\cs{__skrapport_title_style:} which will later be used by
\cs{section} and friends.
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_setup_titles:n#1{
\str_case:nnF{#1}{
\end{MacroCode}
\begin{macro*}{\__skrapport_title_style:}
\changes{0.11a}{Removed incorrect \cs{bfseries}, replaced
\cs{relax} with \cs{rmfamily}}
\changes{0.12d}{Added \texttt{it} option}
\begin{MacroCode}{class}
{rm}{\cs_new_protected:Nn\__skrapport_title_style:{\rmfamily}}
{it}{\cs_new_protected:Nn\__skrapport_title_style:{\itshape}}
{bf}{\cs_new_protected:Nn\__skrapport_title_style:{\bfseries}}
{sf}{\cs_new_protected:Nn\__skrapport_title_style:{\sffamily}}
\end{MacroCode}
\end{macro*}
The fall-back for incorrect parameters is an informational message
along with setting up for \cs{rmfamily} titles.
\begin{MacroCode}{class}
}{
\msg_info:nnnn{skrapport}{invalid-titles}{#1}{rm}
\__skrapport_setup_titles:n{rm}
}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_lang:n}[1]
{Language (\texttt{sv}, \texttt{en} or \texttt{de})}
\changes{0.12d}{Use \pkg{babel} mechanisms for language-dependent
strings, so they work correctly in \env{otherlanguage}}
Thus far only two language options are implemented, each of them
setting the other as the \enquote{other} language. We check if
\pkg{polyglossia} has been loaded (this is done by
\cs{__skrapport_setup_xelatex:}): if it has, we use the
\pkg{polyglossia} interface for setting languages, otherwise we
load the \pkg{babel} package with appropriate options.
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_setup_lang:n#1{
\str_case:nnF{#1}{
{sv}{
\bool_if:NTF\g__skrapport_has_polyglossia_bool{
\setmainlanguage{swedish}
\setotherlanguage[variant=british]{english}
}{
\RequirePackage[british,swedish]{babel}
}
\end{MacroCode}
\begin{macro*}{\__skrapport_RFC_language:}
\begin{MacroCode}{class}
\cs_gset:Nn\__skrapport_RFC_language:{swe}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\PassOptionsToPackage{iso,swedish}{isodate}
}
{en}{
\bool_if:NTF\g__skrapport_has_polyglossia_bool{
\setmainlanguage[variant=british]{english}
\setotherlanguage{swedish}
}{
\RequirePackage[swedish,british]{babel}
}
\end{MacroCode}
\begin{macro*}{\__skrapport_RFC_language:}
\begin{MacroCode}{class}
\cs_gset:Nn\__skrapport_RFC_language:{eng}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\PassOptionsToPackage{iso,british}{isodate}
}
{de}{
\bool_if:NTF\g__skrapport_has_polyglossia_bool{
\setmainlanguage{ngerman}
\setotherlanguage[variant=british]{english}
}{
\RequirePackage[british,ngerman]{babel}
}
\end{MacroCode}
\begin{macro*}{\__skrapport_RFC_language:}
\begin{MacroCode}{class}
\cs_gset:Nn\__skrapport_RFC_language:{ger}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\PassOptionsToPackage{iso,ngerman}{isodate}
}
}{
\end{MacroCode}
Fallback prints an informational message and leaves both \pkg{babel}
and \pkg{polyglossia} unloaded.
\begin{MacroCode}{class}
\msg_info:nnn{skrapport}{invalid-lang}{#1}
}
\end{MacroCode}
After loading \pkg{babel} or \pkg{polyglossia}, we provide
translation strings. This is done using the \cs*{addto} and
\cs*{captions<lang>}, which is compatible with both packages.
\begin{macro*}{\captionsswedish}
\changes{0.12e}{Don't redefine standard language strings}
\begin{macro*}{\dateswedish}
\begin{MacroCode}{class}
\addto\captionsswedish{
\cs_gset:Nn\__skrapport_and_word:{och}
\cs_gset:Nn\__skrapport_Email_word:{E-post}
\cs_gset:Nn\__skrapport_Comment_word:{Kommentar}
\cs_gset:Nn\__skrapport_eg_word:{t.ex.}
\cs_gset:Nn\__skrapport_ie_word:{dvs.}
\cs_gset:Nn\__skrapport_etc_word:{\emph{etc.}}
\cs_gset:Nn\__skrapport_cf_word:{jfr.}
\cs_gset:Nn\__skrapport_viz_word:{dvs.}
}
\cs_gset:Npn\dateswedish{
\cs_gset:Npn\today
{\int_use:N\year--\int_use:N\month--\int_use:N\day}
}
\end{MacroCode}
\end{macro*}
\end{macro*}
\begin{macro*}{\captionsbritish}
\changes{0.12e}{Don't redefine standard language strings}
\begin{macro*}{\datebritish}
\begin{MacroCode}{class}
\addto\captionsbritish{
\cs_gset:Nn\__skrapport_and_word:{and}
\cs_gset:Nn\__skrapport_Email_word:{Email}
\cs_gset:Nn\__skrapport_Comment_word:{Comment}
\cs_gset:Nn\__skrapport_eg_word:{\emph{e.g.}}
\cs_gset:Nn\__skrapport_ie_word:{\emph{i.e.}}
\cs_gset:Nn\__skrapport_etc_word:{\emph{etc.}}
\cs_gset:Nn\__skrapport_cf_word:{\emph{cf.}}
\cs_gset:Nn\__skrapport_viz_word:{\emph{viz.}}
}
\cs_gset:Npn\datebritish{
\cs_gset:Npn\today
{\int_use:N\year--\int_use:N\month--\int_use:N\day}
}
\end{MacroCode}
\end{macro*}
\end{macro*}
\begin{macro*}{\captionsngerman}
\changes{0.12e}{Don't redefine standard language strings}
\begin{macro*}{\datengerman}
\begin{MacroCode}{class}
\addto\captionsngerman{
\cs_gset:Nn\__skrapport_and_word:{und}
\cs_gset:Nn\__skrapport_Email_word:{E-Mail}
\cs_gset:Nn\__skrapport_Comment_word:{Kommentar}
\cs_gset:Nn\__skrapport_eg_word:{z.~B.}
\cs_gset:Nn\__skrapport_ie_word:{d.~h.}
\cs_gset:Nn\__skrapport_etc_word:{usw.}
\cs_gset:Nn\__skrapport_cf_word:{vgl.}
\cs_gset:Nn\__skrapport_viz_word:{\emph{viz.}}
}
\cs_gset:Npn\datengerman{
\cs_gset:Npn\today
{\int_use:N\day.\,\int_use:N\month.\,\int_use:N\year}
}
\end{MacroCode}
\end{macro*}
\end{macro*}
\begin{MacroCode}{class}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_font:n}[1]
{Font (\texttt{none}, \texttt{kpfonts}, \texttt{lmodern},
\texttt{palatino}, \texttt{minion} or \texttt{skdoc})}
\changes{0.12a}{Drop the post-\pkg{amsmath} hook entirely.
Load \pkg{fontspec} in \texttt{word} and
\texttt{none}}
We set up the somewhat involved font stack.
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_setup_font:n#1{
\PassOptionsToPackage{intlimits}{amsmath}
\PassOptionsToPackage{full}{textcomp}
\str_case:nnF{#1}{
\end{MacroCode}
The \texttt{none} font stack is special. If we're using
\hologo{XeTeX} or \hologo{LuaTeX}, we load the \pkg{fontspec}
package. Otherwise, we do nothing.
\begin{MacroCode}{class}
{none}{
\bool_if:nT{\sys_if_engine_luatex_p: || \sys_if_engine_xetex_p:}{
\RequirePackage[quiet]{fontspec}
}
}
\end{MacroCode}
The \texttt{kpfonts} font stack simply loads \pkg{kpfonts}...
\begin{MacroCode}{class}
{kpfonts}{
\RequirePackage[easyscsl,intlimits,sumlimits]{kpfonts}
}
\end{MacroCode}
...and the \texttt{lmodern} font stack loads \pkg{lmodern}.
\begin{MacroCode}{class}
{lmodern}{
\RequirePackage{lmodern}
}
\end{MacroCode}
The \texttt{palatino} font stack loads \pkg{tgpagella} if available,
but falls back to \pkg{mathpazo} otherwise.
\begin{MacroCode}{class}
{palatino}{
\file_if_exist:nTF{tgpagella.sty}{
\RequirePackage{arev}
\RequirePackage{pxfonts}
\RequirePackage{tgpagella}
}{
\RequirePackage[osf]{mathpazo}
}
}
\end{MacroCode}
Minion Pro, provided by the \texttt{minion} font stack, loads both
\pkg{minionpro} (the font) and \pkg{MnSymbol} (appropriate math
symbols).
\begin{MacroCode}{class}
{minion}{
\AtEndOfClass{
\cs_set_eq:NN\__skrapport_old_vec:\vec
\cs_undefine:N\vec
\RequirePackage{MyriadPro}
\RequirePackage{MinionPro}
\RequirePackage{MnSymbol}
\cs_set_eq:NN\vec\__skrapport_old_vec:
}
}
\end{MacroCode}
Finally, the \texttt{skdoc} font stack loads \pkg{PTSerif} and
\pkg{opensans}, inspired by the style of the \pkg{skdoc} class.
\begin{MacroCode}{class}
{skdoc}{
\RequirePackage{PTSerif}
\RequirePackage[defaultsans,oldstyle,scale=0.95]{opensans}
}
\end{MacroCode}
The \texttt{word} font stack mimics recent versions of Microsoft
Word, using Cambria, Consolas and Calibri. This requires a modern
engine that supports \pkg{fontspec}.
\begin{MacroCode}{class}
{word}{
\bool_if:nF{\sys_if_engine_luatex_p: || \sys_if_engine_xetex_p:}{
\msg_fatal:nnn{skrapport}{font-requires-xetex}{word}
}
\RequirePackage[quiet]{fontspec}
\setmainfont[Ligatures=TeX]{Cambria}
\setsansfont[Ligatures=TeX]{Calibri}
\setmonofont[Scale=0.95]{Consolas}
\apptocmd{\__skrapport_after_ams_hook:}{
\setmathfont{Cambria Math}
}{}{}
}
}{
\end{MacroCode}
As a fallback, we print a waning and load no font packages.
\begin{MacroCode}{class}
\msg_warning:nnn{skrapport}{invalid-font}{#1}
}
\str_if_eq:nnF{#1}{none}{
\end{MacroCode}
All font stacks except \texttt{none} and \texttt{kpfonts} require
additional packages. Or, rather, \texttt{none} can't load these
packages by definition, and \texttt{kpfonts} already loads them
internally \footcite[p.~1]{kpfonts}. They are always useful.
We also load \pkg{sourcecodepro} as our monospace font.
But we don't load it when using the \texttt{none} font stack.
\begin{MacroCode}{class}
\str_if_eq:nnF{#1}{kpfonts}{
\str_if_eq:nnF{#1}{word}{
\RequirePackage{sourcecodepro}
}
\AtEndOfClass{
\RequirePackage{amsmath}
\end{MacroCode}
The \pkg{mnsymbol} package is incompatible with \pkg{amssymb}.
\begin{MacroCode}{class}
\str_if_eq:nnF{#1}{minion}{
\RequirePackage{amssymb}
}
\RequirePackage{textcomp}
}
}
}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_parskip:}
\changes{0.12a}{Fixed bug where font size reset the \cs{parindent}}
This part mixes \LaTeXe\ and \LaTeX3, which may not be a good thing.
On the other hand, it seems hard to avoid. Most of the code is
half-lifted from \pkg{parskip} and converted to \LaTeX3.
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_setup_parskip:{
\AtEndOfClass{
\skip_gset:Nn\parskip{0.5\baselineskip~plus~2pt}
\dim_gzero:N\parindent
\skip_gset:Nn\parfillskip{30pt~plus~1fil}
\end{MacroCode}
\begin{macro*}{\@listI}
\begin{macro*}{\@listi}
\begin{MacroCode}{class}
\cs_gset:Npn\@listI{
\dim_set_eq:NN\leftmargin\leftmargini
\dim_set_eq:NN\parsep\parskip
\dim_zero:N\topsep
\dim_zero:N\itemsep
}
\cs_gset_eq:NN\@listi\@listI
\end{MacroCode}
\end{macro*}
\end{macro*}
\begin{MacroCode}{class}
\dim_gset_eq:NN\leftmargin\leftmargini
\dim_gset_eq:NN\parsep\parskip
\dim_gzero:N\topsep
\dim_gzero:N\itemsep
\end{MacroCode}
\begin{macro*}{\@listii}
\begin{MacroCode}{class}
\cs_gset:Npn\@listii{
\dim_set_eq:NN\leftmargin\leftmarginii
\dim_set_eq:NN\labelwidth\leftmarginii
\dim_set_eq:NN\parsep\parskip
\dim_sub:Nn\labelwidth{-\labelsep}
\dim_zero:N\topsep
\dim_zero:N\itemsep
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\@listiii}
\begin{MacroCode}{class}
\cs_gset:Npn\@listiii{
\dim_set_eq:NN\leftmargin\leftmarginiii
\dim_set_eq:NN\labelwidth\leftmarginiii
\dim_set_eq:NN\parsep\parskip
\dim_sub:Nn\labelwidth{-\labelsep}
\dim_zero:N\topsep
\dim_zero:N\itemsep
}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\dim_gzero:N\partopsep
\end{MacroCode}
\begin{macro*}{\@starttoc}[1]
{Table of contents extension}
\changes{0.12h}{Replaced use of deprecated \cs{c_job_name_tl}
with \cs{c_sys_jobname_str}}
\begin{MacroCode}{class}
\RenewDocumentCommand\@starttoc{m}{
\group_begin:
\dim_zero:N\parskip
\file_if_exist:nT{\c_sys_jobname_str.##1}{
\file_input:n{\c_sys_jobname_str.##1}
}
\if@filesw
\iow_new:c{tf@##1}
\iow_open:cn{tf@##1}{\c_sys_jobname_str.##1}
\fi
\@nobreakfalse
\group_end:
}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_math:}
This is the simplest option, only loading \pkg{skmath} if it exists.
Also the post-skmath hook is run.
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_setup_math:{
\file_if_exist:nT{skmath.sty}{\RequirePackage{skmath}}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_draft:}
Setting up the \opt{draft} mode is also fairly easy, as we only need
wider (wider than \SI{0}{\point}, that is) \cs{overfullrule}s.
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_setup_draft:{
\bool_if:NTF\g__skrapport_draft_bool{
\dim_gset:Nn\overfullrule{5pt}
}{
\msg_log:nnn{skrapport}{noop-call}{\__skrapport_setup_draft:}
\prg_do_nothing:
}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_color:}
Setting up colors is also fairly easy, as we only have to load the
\pkg{xcolor} package. All the other color-related code is in other
places, utilizing the \cs{g__skdoc_color_bool} boolean.
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_setup_color:{
\bool_if:NTF\g__skrapport_color_bool{
\RequirePackage{xcolor}
\PassOptionsToPackage{
labelfont+={bf,color=skrapport@captioncolor}
}{caption}
}{
\msg_log:nnn{skrapport}{noop-call}{\__skrapport_setup_color:}
\prg_do_nothing:
}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_color:n}
We may also set up a specific color theme using options. This is
easily done by first calling \cs{__skrapport_setup_color:}, then
calling \cs{colortheme} at \cs{BeginDocument}.
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_setup_color:n#1{
\__skrapport_setup_color:
\bool_if:NTF\g__skrapport_color_bool{
\AtBeginDocument{\colortheme{#1}}
}{
\msg_log:nnn{skrapport}{noop-call}{\__skrapport_setup_color:n}
\prg_do_nothing:
}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_xelatex:}
\changes{0.12a}{Don't load \pkg{polyglossia} for \hologo{LuaTeX}.
Don't load \pkg{fontspec} for any engine}
\changes{0.12d}{Force \texttt{quiet} option for \pkg{fontspec}}
This macro contains special setup code for the \hologo{XeTeX} and
\hologo{LuaTeX} engines, such as providing
missing commands (which have been replaced by equivalent Unicode
characters, apparently) and loading \pkg{polyglossia}.
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_setup_xelatex:{
\AtEndOfClass{
\cs_undefine:N\dblcolon
\cs_undefine:N\coloneqq
\cs_undefine:N\Coloneqq
\cs_undefine:N\eqqcolon
\RequirePackage{unicode-math}
\unimathsetup {
math-style = ISO,
bold-style = ISO,
sans-style = italic,
nabla = upright,
partial = italic,
vargreek-shape = unicode
}
}
\end{MacroCode}
\begin{macro}{\nobreakspace}
\begin{MacroCode}{class}
\DeclareDocumentCommand\nobreakspace{}{\leavevmode\nobreak\space}
\end{MacroCode}
\end{macro}
Since apparently \hologo{LuaLaTeX} isn't supported by
\pkg{polyglossia}, we fall back to \pkg{babel} in that engine.
Thus, only load \pkg{polyglossia} for \hologo{XeLaTeX}.
\begin{MacroCode}{class}
\sys_if_engine_xetex:TF{
\PassOptionsToPackage{quiet}{fontspec}
\RequirePackage{polyglossia}
\bool_gset_true:N\g__skrapport_has_polyglossia_bool
}{
\bool_gset_false:N\g__skrapport_has_polyglossia_bool
}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_pdftex:}
\changes{0.12d}{Load \pkg{isomath}}
This macro contains special setup code for the \hologo{pdfTeX}
engine. Currently, it only sets the font encoding to T1.
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_setup_pdftex:{
\RequirePackage[T1]{fontenc}
\AtEndOfClass{
\RequirePackage{isomath}
}
\bool_gset_false:N\g__skrapport_has_polyglossia_bool
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_engine_specific:}
This macro detects the current engine and calls the appropriate
engine setup macro.
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_setup_engine_specific:{
\bool_if:nTF{\sys_if_engine_luatex_p: || \sys_if_engine_xetex_p:}{
\__skrapport_setup_xelatex:
}{
\__skrapport_setup_pdftex:
}
}
\end{MacroCode}
\end{macro}
\paragraph{Variants with expandable arguments}
Some option setup macros accept arguments, but those arguments are
not expanded. Here, we provide variants which expand the parameters
properly using the excellent \pkg{l3prg} functionality.
\begin{macro}{\__skrapport_setup_ptsize:x}
\begin{MacroCode}{class}
\cs_generate_variant:Nn\__skrapport_setup_ptsize:n{ x }
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_titles:x}
\begin{MacroCode}{class}
\cs_generate_variant:Nn\__skrapport_setup_titles:n{ x }
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_lang:x}
\begin{MacroCode}{class}
\cs_generate_variant:Nn\__skrapport_setup_lang:n{ x }
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_setup_font:x}
\begin{MacroCode}{class}
\cs_generate_variant:Nn\__skrapport_setup_font:n{ x }
\end{MacroCode}
\end{macro}
\subsubsection{Key-value system}
Let's define some \pkg{l3keys} corresponding to the options. Note
that most of them just refer to a macro in their \texttt{.code:n}
block --- these macros were defined earlier.
\begin{MacroCode}{class}
\keys_define:nn{skrapport}{
\end{MacroCode}
\begin{option}{paper}{a4paper, a5paper, a4, a5}
\changes{0.12}{Values \texttt{a4paper} and \texttt{a5paper} are
now deprecated}
\begin{option}{a4paper}
\changes{0.12}{Option is now deprecated}
\begin{option}{a5paper}
\changes{0.12}{Option is now deprecated}
Declare the paper size options. Note that having to handle the
deprecated \texttt{a4paper} and \texttt{a5paper} values of the
\opt{paper} option makes the code less readable. In a few
versions, when these options are removed, the code should probably
be refactored to look something like the \opt{ptsize} option below.
\begin{MacroCode}{class}
paper .choice:,
paper / a4 .code:n =
{\__skrapport_setup_paper:n{a4}},
paper / a5 .code:n =
{\__skrapport_setup_paper:n{a5}},
paper / a4paper .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{paper=a4paper}{paper=a4}
\keys_set:nn{skrapport}{paper=a4}},
paper / a5paper .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{paper=a5paper}{paper=a5}
\keys_set:nn{skrapport}{paper=a4}},
paper .value_required:n = true,
a4paper .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{a4paper}{paper=a4}
\keys_set:nn{skrapport}{paper=a4}},
a5paper .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{a5paper}{paper=a5}
\keys_set:nn{skrapport}{paper=a5}},
\end{MacroCode}
\end{option}
\end{option}
\end{option}
\begin{option}{ptsize}{10pt, 11pt, 12pt}
\begin{option}{10pt}
\begin{option}{11pt}
\begin{option}{12pt}
Declare point size options. Note that we don't deprecate the
non-\opt{ptsize} aliases as they are much easier to type.
\begin{MacroCode}{class}
ptsize .choices:nn =
{ 10pt, 11pt, 12pt }
{\__skrapport_setup_ptsize:x{\tl_use:N\l_keys_choice_tl}},
ptsize .value_required:n = true,
10pt .meta:n = {ptsize=10pt},
11pt .meta:n = {ptsize=11pt},
12pt .meta:n = {ptsize=12pt},
\end{MacroCode}
\end{option}
\end{option}
\end{option}
\end{option}
\begin{option}{twocolumn}
\changes{0.08}{Added option \opt{twocolumn}}
\changes{0.12a}{Use \cs{AtEndOfClass} instead of \cs{AtEndClass}}
Declare column options. The code here should be run through
\cs{AtEndOfClass} so that the setup code can patch everythin
properly.
\begin{option}{onecolumn}
\changes{0.12}{Option is now deprecated}
The \opt{onecolumn} option has no effect and is deprecated.
\begin{MacroCode}{class}
twocolumn .code:n =
{\AtEndOfClass{\__skrapport_setup_twocolumn:}},
onecolumn .code:n =
{\msg_warning:nnn{skrapport}{option-no-effect}{onecolumn}},
\end{MacroCode}
\end{option}
\end{option}
\begin{option}{draft}{true, false}
\begin{option}{final}
Declare \opt{draft} and \opt{final} options. Note that even if the
\opt{final} option does absolutely nothing, users may expect it to
be there and as such it is not deprecated.
\begin{MacroCode}{class}
draft .choice:,
draft / true .code:n =
{\bool_gset_true:N\g__skrapport_draft_bool
\__skrapport_setup_draft:},
draft / false .code:n =
{\bool_gset_false:N\g__skrapport_draft_bool},
draft .default:n = true,
final .code:n = {\prg_do_nothing:},
\end{MacroCode}
\end{option}
\end{option}
Declare the \opt{fleqn} and \opt{leqno} options, mainly for
compatibility with the \pkg{article} class.
\begin{option}{leqno}
\begin{MacroCode}{class}
leqno .code:n =
{\__skrapport_setup_leqno:},
\end{MacroCode}
\end{option}
\begin{option}{fleqn}
\begin{MacroCode}{class}
fleqn .code:n =
{\__skrapport_setup_fleqn:},
\end{MacroCode}
\end{option}
\begin{option}{titles}{rm, it, bf, sf}
Declare options for section titles. The old \opt*{??titles} aliases
are deprecated and will be removed in a future version.
\begin{option}{rmtitles}
\changes{0.12}{Option is now deprecated}
\begin{option}{bftitles}
\changes{0.12}{Option is now deprecated}
\begin{option}{sftitles}
\changes{0.09}{Added \opt{sftitles} option}
\changes{0.12}{Option is now deprecated}
\begin{MacroCode}{class}
titles .choices:nn =
{ rm, it, bf, sf }
{\__skrapport_setup_titles:x{\tl_use:N\l_keys_choice_tl}},
titles .value_required:n = true,
rmtitles .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{rmtitles}{titles=rm}
\keys_set:nn{skrapport}{titles=rm}},
bftitles .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{bftitles}{titles=bf}
\keys_set:nn{skrapport}{titles=bf}},
sftitles .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{sftitles}{titles=sf}
\keys_set:nn{skrapport}{titles=sf}},
\end{MacroCode}
\end{option}
\end{option}
\end{option}
\end{option}
\begin{option}{hanging-titles}{true, false}
\changes{0.12d}{Added option to enable \enquote{hanging} titles}
\begin{MacroCode}{class}
hanging-titles .bool_gset:N = \g__skrapport_hanging_titles_bool,
hanging-titles .default:n = true,
hanging-titles .initial:n = false,
\end{MacroCode}
\end{option}
\begin{option}{lang}{sv, en, de}
\changes{0.12c}{Added option value \texttt{de}}
\changes{0.12}{Incompatible change: values \texttt{swe} and
\texttt{eng} are now \texttt{sv} and \texttt{en},
respectively}
\begin{option}{swe}
\changes{0.12}{Option is now deprecated}
\begin{option}{eng}
\changes{0.12}{Option is now deprecated}
Declare options for swedish/english \pkg{babel} or
\pkg{polyglossia} support. Again, the old \opt{swe} and \opt{eng}
aliases are deprecated and will be removed.
\begin{MacroCode}{class}
lang .choices:nn =
{ sv, en, de }
{\__skrapport_setup_lang:x{\tl_use:N\l_keys_choice_tl}},
lang .value_required:n = true,
swe .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{swe}{lang=sv}
\keys_set:nn{skrapport}{lang=sv}},
eng .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{eng}{lang=en}
\keys_set:nn{skrapport}{lang=en}},
\end{MacroCode}
\end{option}
\end{option}
\end{option}
\begin{option}{font}{none, kpfonts, lmodern, palatino, minion, skdoc}
Declare font options. Again, aliases are deprecated.
\begin{option}{kpfonts}
\changes{0.07}{Added option \opt{kpfonts}, set as default
option for fonts}
\changes{0.12}{Option is now deprecated}
\begin{option}{lmodern}
\changes{0.12}{Option is now deprecated}
\begin{option}{palatino}
\changes{0.12}{Option is now deprecated}
\begin{option}{minion}
\changes{0.11}{Added option \opt{minion}}
\changes{0.12}{Option is now deprecated}
\begin{option}{skdoc}
\changes{0.11a}{Added option \opt{skdoc}}
\changes{0.12}{Option is now deprecated}
\begin{option}{nofont}
\changes{0.12}{Option is now deprecated}
\begin{MacroCode}{class}
font .choices:nn =
{ none, kpfonts, lmodern, palatino, minion, skdoc, word }
{\__skrapport_setup_font:x{\tl_use:N\l_keys_choice_tl}},
font .value_required:n = true,
nofont .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{nofont}{font=none}
\keys_set:nn{skrapport}{font=none}},
kpfonts .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{kpfonts}{font=kpfonts}
\keys_set:nn{skrapport}{font=kpfonts}},
lmodern .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{lmodern}{font=lmodern}
\keys_set:nn{skrapport}{font=lmodern}},
palatino .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{palatino}{font=palatino}
\keys_set:nn{skrapport}{font=palatino}},
minion .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{minion}{font=minion}
\keys_set:nn{skrapport}{font=minion}},
skdoc .code:n =
{\msg_warning:nnnn{skrapport}{option-deprecated}
{skdoc}{font=skdoc}
\keys_set:nn{skrapport}{font=skdoc}},
\end{MacroCode}
\end{option}
\end{option}
\end{option}
\end{option}
\end{option}
\end{option}
\end{option}
\begin{option}{indent}{true, false}
\changes{0.02}{Added option of indented paragraphs}
\begin{option}{noindent}
\changes{0.12}{Option is now deprecated}
Declare indentation options. Since the \opt{noindent} option
technically has no effect and is an alias of \opt{indent=false},
it has been deprecated.
\begin{MacroCode}{class}
indent .choice:,
indent / true .code:n = {\prg_do_nothing:},
indent / false .code:n = {\__skrapport_setup_parskip:},
indent .default:n = true,
noindent .code:n =
{\msg_warning:nnn{skrapport}{option-no-effect}{noindent}},
\end{MacroCode}
\end{option}
\end{option}
\begin{option}{color}{true, false}
\changes{0.09}{Added \opt{color} option}
\changes{0.12}{Converted to a key-value option which will load
the specified color theme.}
\begin{option}{nocolor}
Declare color options. Note that we explicitly set the boolean
\cs{g__skrapport_color_bool} as well as setting up the colors
through \cs{__skrapport_setup_color:n}, so that we can keep track
of the color usage even after the options have been set up.
\begin{MacroCode}{class}
color .code:n =
{\str_if_eq:nnTF{#1}{false}
{\bool_gset_false:N\g__skrapport_color_bool}
{\bool_gset_true:N\g__skrapport_color_bool
\str_if_eq:nnTF{#1}{true}
{\__skrapport_setup_color:n{default}}
{\__skrapport_setup_color:n{#1}}}},
color .default:n = true,
nocolor .meta:n = {color=false},
\end{MacroCode}
\end{option}
\end{option}
\begin{option}{nomath}{true, false}
\begin{option}{math}
\changes{0.12}{Option is now deprecated}
Declare math options. As with the \opt{noindent} option, \opt{math}
has been deprecated since it is an alias and has no effect.
\begin{MacroCode}{class}
nomath .choice:,
nomath / false .code:n = {\__skrapport_setup_math:},
nomath / true .code:n = {\prg_do_nothing:},
nomath .default:n = true,
math .code:n =
{\msg_warning:nnn{skrapport}{option-no-effect}{math}},
\end{MacroCode}
\end{option}
\end{option}
That's it, we're done setting up the \pkg{l3keys} for the options.
\begin{MacroCode}{class}
}
\end{MacroCode}
We will now define a \enquote{defaults} key-value system because
\texttt{.initial:n} doesn't work they way we want it to. This
key-value system will be used to set flags with which we will
determine wether to set certain default options.
\begin{macro}{\__skrapport_setup_defaults:}
\changes{0.12a}{\texttt{word} font stack is now the default font stack when using \hologo{XeLaTeX}}
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_setup_defaults:{
\bool_new:N\l__skrapport_has_option_indent_bool
\bool_new:N\l__skrapport_has_option_nomath_bool
\bool_new:N\l__skrapport_has_option_color_bool
\bool_new:N\l__skrapport_has_option_font_bool
\bool_new:N\l__skrapport_has_option_lang_bool
\bool_new:N\l__skrapport_has_option_titles_bool
\bool_new:N\l__skrapport_has_option_draft_bool
\bool_new:N\l__skrapport_has_option_ptsize_bool
\bool_new:N\l__skrapport_has_option_paper_bool
\keys_define:nn{skrapport-default}{
indent .code:n =
{\bool_set_true:N\l__skrapport_has_option_indent_bool},
nomath .code:n =
{\bool_set_true:N\l__skrapport_has_option_nomath_bool},
color .code:n =
{\bool_set_true:N\l__skrapport_has_option_color_bool},
font .code:n =
{\bool_set_true:N\l__skrapport_has_option_font_bool},
lang .code:n =
{\bool_set_true:N\l__skrapport_has_option_lang_bool},
titles .code:n =
{\bool_set_true:N\l__skrapport_has_option_titles_bool},
draft .code:n =
{\bool_set_true:N\l__skrapport_has_option_draft_bool},
ptsize .code:n =
{\bool_set_true:N\l__skrapport_has_option_ptsize_bool},
paper .code:n =
{\bool_set_true:N\l__skrapport_has_option_paper_bool},
\end{MacroCode}
The following keys correspond to deprecated options. They should
be removed when the corresponding options are removed.
\begin{MacroCode}{class}
nofont .code:n = {\keys_set:nn{skrapport-default}{font}},
kpfonts .code:n = {\keys_set:nn{skrapport-default}{font}},
lmodern .code:n = {\keys_set:nn{skrapport-default}{font}},
palatino .code:n = {\keys_set:nn{skrapport-default}{font}},
minion .code:n = {\keys_set:nn{skrapport-default}{font}},
skdoc .code:n = {\keys_set:nn{skrapport-default}{font}},
swe .code:n = {\keys_set:nn{skrapport-default}{lang}},
eng .code:n = {\keys_set:nn{skrapport-default}{lang}},
rmtitles .code:n = {\keys_set:nn{skrapport-default}{titles}},
bftitles .code:n = {\keys_set:nn{skrapport-default}{titles}},
sftitles .code:n = {\keys_set:nn{skrapport-default}{titles}},
10pt .code:n = {\keys_set:nn{skrapport-default}{ptsize}},
11pt .code:n = {\keys_set:nn{skrapport-default}{ptsize}},
12pt .code:n = {\keys_set:nn{skrapport-default}{ptsize}},
a4paper .code:n = {\keys_set:nn{skrapport-default}{paper}},
a5paper .code:n = {\keys_set:nn{skrapport-default}{paper}},
\end{MacroCode}
\begin{MacroCode}{class}
}
\ProcessKeysOptions{skrapport-default}
\bool_if:NF\l__skrapport_has_option_indent_bool{
\keys_set:nn{skrapport}{indent=false}
}
\bool_if:NF\l__skrapport_has_option_nomath_bool{
\keys_set:nn{skrapport}{nomath=false}
}
\bool_if:NF\l__skrapport_has_option_color_bool{
\keys_set:nn{skrapport}{color=true}
}
\bool_if:NF\l__skrapport_has_option_font_bool{
\sys_if_engine_xetex:TF{
\keys_set:nn{skrapport}{font=word}
}{
\keys_set:nn{skrapport}{font=kpfonts}
}
}
\bool_if:NF\l__skrapport_has_option_lang_bool{
\keys_set:nn{skrapport}{lang=sv}
}
\bool_if:NF\l__skrapport_has_option_titles_bool{
\keys_set:nn{skrapport}{titles=bf}
}
\bool_if:NF\l__skrapport_has_option_draft_bool{
\keys_set:nn{skrapport}{draft=false}
}
\bool_if:NF\l__skrapport_has_option_ptsize_bool{
\keys_set:nn{skrapport}{ptsize=11pt}
}
\bool_if:NF\l__skrapport_has_option_paper_bool{
\keys_set:nn{skrapport}{paper=a4}
}
}
\end{MacroCode}
\end{macro}
Finally, we process the class options using the keys defined earlier.
We also run the engine-specific code implemented above, and the fake
key system used to define defaults.
Note that we save and restore \cs{@classoptionslist} around the
engine-specific setup. This is because we might load \pkg{xkeyval},
which apparently removes all key-value options from the list when
loaded (and this is really bad for us).
\begin{MacroCode}{class}
\cs_set_eq:NN\__skrapport_tmpa_cs:\@classoptionslist
\RequirePackage{xkeyval}
\cs_set_eq:NN\__skrapport_tmpb_cs:\@classoptionslist
\cs_set_eq:NN\@classoptionslist\__skrapport_tmpa_cs:
\__skrapport_setup_engine_specific:
\ProcessKeysOptions{skrapport}
\__skrapport_setup_defaults:
\cs_set_eq:NN\@classoptionslist\__skrapport_tmpb_cs:
\cs_undefine:N\__skrapport_tmpa_cs:
\cs_undefine:N\__skrapport_tmpb_cs:
\end{MacroCode}
\subsection{Required packages}
We also include some essential packages per default. The
\pkg{calc} package, for instance, is essential in later
definitions.
\begin{MacroCode}{class}
\RequirePackage{calc,isodate,multicol}
\end{MacroCode}
At the end of the class definition we load a very
useful package that improves typesetting: \pkg{microtype}.
Also set \cs{frenchspacing}.
\begin{MacroCode}{class}
\AtEndOfClass{
\RequirePackage{microtype}
\frenchspacing
}
\end{MacroCode}
When the document starts, we set the URL style if the user has
loaded the \pkg{url} package.
\begin{MacroCode}{class}
\AtBeginDocument{
\cs_if_exist:NT\urlstyle{\urlstyle{same}}
}
\end{MacroCode}
\subsection{Utilities}
We define useful \LaTeX3 replacements of \LaTeXe\ stuff that
hasn't made its way into \pkg{interface3}. This includes
a \cs{settowidth} clone and possibly more stuff later.
\begin{macro}{\dim_set_to_wd:Nn}
\begin{MacroCode}{class}
\cs_new:Npn\dim_set_to_wd:Nn#1#2{
\hbox_set:Nn\l_tmpa_box{#2}
\dim_set:Nn#1{\box_wd:N\l_tmpa_box}
\box_clear:N\l_tmpa_box
}
\end{MacroCode}
\end{macro}
\subsection{Hidden things}
Set some default measurements (should probably be replaced with
simply loading \pkg{typearea}).
\begin{MacroCode}{class}
\dim_add:Nn\textwidth{0.5\oddsidemargin}
\dim_add:Nn\textwidth{0.5\evensidemargin}
\dim_add:Nn\oddsidemargin{-0.5\oddsidemargin}
\dim_add:Nn\evensidemargin{-0.5\evensidemargin}
\dim_gset:Nn\lineskip{1pt}
\dim_gset:Nn\normallineskip{1pt}
\end{MacroCode}
\begin{macro}{\baselinestretch}
Note that we can't use \cs{RenewDocumentCommand} as that yields an
infinite loop before or at \env{document}.
\begin{MacroCode}{class}
\cs_set:Npn\baselinestretch{}
\end{MacroCode}
\end{macro}
\subsubsection{Penalties}
\begin{MacroCode}{class}
\int_gset:Nn\@lowpenalty {51}
\int_gset:Nn\@medpenalty {151}
\int_gset:Nn\@highpenalty{301}
\setcounter{topnumber}{2}
\setcounter{bottomnumber}{1}
\setcounter{totalnumber}{4}
\setcounter{dbltopnumber}{2}
\end{MacroCode}
\begin{macro}{\topfraction}
\begin{MacroCode}{class}
\RenewDocumentCommand\topfraction{}{.75}
\end{MacroCode}
\end{macro}
\begin{macro}{\bottomfraction}
\begin{MacroCode}{class}
\RenewDocumentCommand\bottomfraction{}{.5}
\end{MacroCode}
\end{macro}
\begin{macro}{\textfraction}
\begin{MacroCode}{class}
\RenewDocumentCommand\textfraction{}{.25}
\end{MacroCode}
\end{macro}
\begin{macro}{\floatpagefraction}
\begin{MacroCode}{class}
\RenewDocumentCommand\floatpagefraction{}{.625}
\end{MacroCode}
\end{macro}
\begin{macro}{\dbltopfraction}
\begin{MacroCode}{class}
\RenewDocumentCommand\dbltopfraction{}{.75}
\end{MacroCode}
\end{macro}
\begin{macro}{\dblfloatpagefraction}
\begin{MacroCode}{class}
\RenewDocumentCommand\dblfloatpagefraction{}{.625}
\end{MacroCode}
\end{macro}
\subsection{User-level commands and environments}
\subsubsection{The front page}
\begin{macro}{\title}[1]
{Title of the document}
\begin{macro*}{\g__skrapport_title_tl}
\begin{MacroCode}{class}
\tl_new:N\g__skrapport_title_tl
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\DeclareDocumentCommand\title{m}{
\tl_gset:Nn\g__skrapport_title_tl{#1}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\date}[1]
{Date in ISO8601 format}
The \cs{date} macro sets the current date of the document. It only
accepts dates accepted by \pkg{isodate} (or the special value
\enquote{\texttt{today}}). Dates are always printed using the
current format as specified by the \pkg{isodate} package. The default
value of the date (if \cs{date} isn't used) is \cs{today}.
\begin{macro*}{\g__skrapport_title_tl}
\begin{MacroCode}{class}
\tl_new:N\g__skrapport_date_tl
\tl_gset:Nn\g__skrapport_date_tl{\today}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\DeclareDocumentCommand\date{m}{
\str_if_eq:nnTF{#1}{today}{
\tl_gset:Nn\g__skrapport_date_tl{\today}
}{
\if_meaning:w \today #1
\tl_gset:Nn\g__skrapport_date_tl{\today}
\else:
\tl_gset:Nn\g__skrapport_date_tl{\printdate{#1}}
\fi:
}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\author}[2]
{Optional email address}
{Author name}
\changes{0.10b}{Improved \cs{author} macro}
\changes{0.12}{Use comma-separated lists instead of token list}
The \cs{author} macro is redefined to accept an optional argument
and to be used multiple times.
\begin{macro*}{\__skrapport_email:n}[1]
{Email address}
\changes{0.12a}{Store \cs{textemdash} instead of \cs{NoValue}}
The \cs{skrapport@email} helper macro typesets an email address
using \pkg{hyperref} if that package is used. This is suboptimal,
the macro behaves differently with respect to special characters
depending on wether \pkg{hyperref} is loaded or not.
\begin{MacroCode}{class}
\cs_new_nopar:Npn\__skrapport_email:n#1{
\texttt{#1}
}
\AtBeginDocument{
\cs_if_exist:NT\href{
\cs_gset_nopar:Npn\__skrapport_email:n#1{
\href{mailto:#1}{\nolinkurl{#1}}
}
}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\g__skrapport_author_clist}
\begin{MacroCode}{class}
\clist_new:N\g__skrapport_author_clist
\end{MacroCode}
\end{macro*}
\begin{macro*}{\g__skrapport_email_clist}
\begin{MacroCode}{class}
\clist_new:N\g__skrapport_email_clist
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\DeclareDocumentCommand\author{om}{%
\clist_gput_right:Nn\g__skrapport_author_clist{#2}
\clist_gput_right:Nn\g__skrapport_email_clist
{\IfNoValueTF{#1}{\textemdash}{#1}}
}
\end{MacroCode}
\begin{macro}{\__skrapport_author_list:}
\changes{0.12a}{Use \cs{clist_use:Nnnn}}
This macro lists all the authors in the comma-separated list
\cs{g__skrapport_author_clist}, separating them with a comma
or the word \enquote{and} (in the appropriate language).
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_author_list:{
\clist_use:Nnnn\g__skrapport_author_clist
{~\__skrapport_and_word:{}~}{,~}{~\__skrapport_and_word:{}~}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_email_list:}
\changes{0.12a}{Use \cs{clist_use:Nnnn}}
This macro lists the email addresses in the comma-separated list
\cs{g__skrapport_email_clist} by applying \cs{__skrapport_email:}
if appropriate (or printing an em-dash if no value exists) and
separating them with commas.
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_email_list:{
\int_compare:nT{\clist_count:N\g__skrapport_author_clist>\c_zero_int}{
\clist_use:Nnnn\g__skrapport_email_clist{\\}{\\}{\\}
}
}
\end{MacroCode}
\end{macro}
\end{macro}
\begin{macro}{\regarding}[1]
{Text snippet}
This macro defines a variable used by \cs{maketitle} to insert a
simple text into the header on the title page.
\begin{macro*}{\g__skrapport_regarding_tl}
\begin{MacroCode}{class}
\tl_new:N\g__skrapport_regarding_tl
\DeclareDocumentCommand\regarding{m}{
\tl_gset:Nn\g__skrapport_regarding_tl{#1}
}
\end{MacroCode}
\end{macro*}
\end{macro}
\begin{macro}{\license}[1]
{Short license description}
\changes{0.07}{Added command \cs{license}}
This macro defines a variable used by \cs{maketitle} to insert a
license into the footer on the titlepage.
\begin{macro*}{\g__skrapport_copyright_unprinted_bool}
\begin{MacroCode}{class}
\bool_new:N\g__skrapport_copyright_unprinted_bool
\AtEndDocument{
\bool_if:NT\g__skrapport_copyright_unprinted_bool
{\msg_warning:nn{skrapport}{license-not-printed}}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\g__skrapport_copyright_tl}
\begin{MacroCode}{class}
\tl_new:N\g__skrapport_copyright_tl
\DeclareDocumentCommand\license{m}{
\tl_gset:Nn\g__skrapport_copyright_tl{#1}
\bool_gset_true:N\g__skrapport_copyright_unprinted_bool
}
\end{MacroCode}
\end{macro*}
\end{macro}
\begin{macro}{\maketitle}[1]
{Optional key-value list}
\changes{0.12a}{Added optional key-value argument and PDFinfo}
The standard \cs{maketitle} command as taken from the \pkg{article}
class but with some basic restyling.
\begin{MacroCode}{class}
\keys_define:nn{skrapport/maketitle}{
hide .clist_set:N = \l__skrapport_maketitle_hide_clist,
hide .value_required:n = true,
nopdfinfo .bool_set_inverse:N = \l__skrapport_maketitle_pdfinfo_bool,
nopdfinfo .default:n = true,
nopdfinfo .initial:n = false
}
\end{MacroCode}
\begin{macro*}{\__skrapport_smallprint_style:}
\begin{MacroCode}{class}
\cs_new_protected:Nn\__skrapport_smallprint_style:{}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\__skrapport_abstract_style:}
\begin{MacroCode}{class}
\cs_new_protected:Nn\__skrapport_abstract_style:
{\__skrapport_title_style:}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\DeclareDocumentCommand\maketitle{o}{
\clist_clear:N\l__skrapport_maketitle_hide_clist
\IfNoValueF{#1}{\keys_set:nn{skrapport/maketitle}{#1}}
\bool_if:NT\l__skrapport_maketitle_pdfinfo_bool{
\exp_args:NNx\cs_if_exist_use:NT\hypersetup{{
pdfinfo={
Title={\tl_use:N\g__skrapport_title_tl},
Subject={\tl_use:N\g__skrapport_regarding_tl},
Author={
\clist_use:Nnnn\g__skrapport_author_clist{,~}{,~}{,~}
},
Lang={\__skrapport_RFC_language:}
}
}}
}
\par
\group_begin:
\RenewDocumentCommand\thefootnote{}{
\fnsymbol{footnote}
}
\RenewDocumentCommand\@makefnmark{}{
\hbox_overlap_right:n{
\@textsuperscript{\normalfont\@thefnmark}
}
}
\RenewDocumentCommand\@makefntext{+m}{
\dim_set:Nn\parindent{1em}\noindent
\hbox_to_wd:nn{1.8em}{
\hss\@textsuperscript{\normalfont\@thefnmark}
}
##1
}
\newpage
\int_gzero:N\@topnum
\__skrapport_maketitle:
\thispagestyle{plain}
\group_end:
\setcounter{footnote}{0}
}
\end{MacroCode}
\end{macro}
\begin{macro*}{\__skrapport_maketitle:}
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_maketitle:{
\newpage
\hbox:n{}
\begin{flushleft}
\vspace{-\headsep}
\clist_if_in:NnF\l__skrapport_maketitle_hide_clist{regarding}{
\small\__skrapport_smallprint_style:
\tl_use:N\g__skrapport_regarding_tl
\clist_if_in:NnF\l__skrapport_maketitle_hide_clist{date}{
\tl_if_empty:NF\g__skrapport_regarding_tl{,~}
}
}
\clist_if_in:NnF\l__skrapport_maketitle_hide_clist{date}{
\tl_use:N\g__skrapport_date_tl
}
\clist_if_in:NnTF\l__skrapport_maketitle_hide_clist{regarding}{
\clist_if_in:NnTF\l__skrapport_maketitle_hide_clist{date}
{}{\par}
}{\par}
\vspace{1.5cm}
{
\Huge\__skrapport_title_style:
\tl_use:N\g__skrapport_title_tl
\par
}
\vspace{.125cm}
{
\Large\__skrapport_title_style:
\__skrapport_author_list:
}
\vspace{.75cm}
\end{flushleft}
\par
\clist_if_in:NnF\l__skrapport_maketitle_hide_clist{email}{
\dim_set_to_abstract_or_email_wd:N\l_tmpa_dim
\bool_gset_false:N\g__skrapport_abstract_used
\dim_set:Nn\l_tmpb_dim
{\textwidth-\l_tmpa_dim-\c__skrapport_abstract_separator_dim}
\begin{minipage}[t]{\l_tmpa_dim}
\begin{flushright}
\leavevmode\__skrapport_abstract_style:
\__skrapport_Email_word:
\end{flushright}
\end{minipage}
\hspace{\c__skrapport_abstract_separator_dim}
\begin{minipage}[t]{\l_tmpb_dim}
\__skrapport_email_list:
\end{minipage}
\par
}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\g__skrapport_abstract_used}
This boolean keeps track of wether the \env{abstract} environment has
been used, and is set accordingly in the main auxillary file.
\begin{MacroCode}{class}
\bool_new:N\g__skrapport_abstract_used
\AtEndDocument{
\iow_shipout:Nx\@mainaux{ % !!!
\exp_not:N\ExplSyntaxOn
\bool_if:NTF\g__skrapport_abstract_used
{\exp_not:n{\bool_gset_true:N\g__skrapport_abstract_used}}
{\exp_not:n{\bool_gset_false:N\g__skrapport_abstract_used}}
\exp_not:N\ExplSyntaxOff
}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\dim_set_to_abstract_or_email_wd:N}[1]
{Dimension register}
\changes{0.12a}{Set abstract style before word to fix incorrect width}
This macro sets a dimension to either the width of the email word
or the width of the abstract word depending on the state of
\cs{g__skrapport_abstract_used}.
\begin{MacroCode}{class}
\cs_new:Npn\dim_set_to_abstract_or_email_wd:N#1{
\dim_set_to_wd:Nn\l_tmpa_dim
{\__skrapport_abstract_style:\abstractname}
\dim_set_to_wd:Nn\l_tmpb_dim
{\__skrapport_abstract_style:\__skrapport_Email_word:}
\bool_if:NTF\g__skrapport_abstract_used
{\dim_set:Nn#1{\dim_max:nn{\l_tmpa_dim}{\l_tmpb_dim}}}
{\dim_set_eq:NN#1\l_tmpb_dim}
}
\end{MacroCode}
\end{macro*}
\begin{environment}{abstract}
Standard restyled \env{abstract} environment from the
\pkg{article} class.
\begin{MacroCode}{class}
\dim_const:Nn\c__skrapport_abstract_separator_dim{1em}
\DeclareDocumentEnvironment{abstract}{}{
\bool_gset_true:N\g__skrapport_abstract_used
\dim_set_to_abstract_or_email_wd:N\l_tmpa_dim
\dim_set:Nn\l_tmpb_dim
{\textwidth-\l_tmpa_dim-\c__skrapport_abstract_separator_dim}
\begin{minipage}[t]{\l_tmpa_dim}
\begin{flushright}
\leavevmode\__skrapport_abstract_style:
\abstractname
\end{flushright}
\end{minipage}
\hspace{\c__skrapport_abstract_separator_dim}
\begin{minipage}[t]{\l_tmpb_dim}
}{
\end{minipage}
}
\end{MacroCode}
\end{environment}
\begin{environment}{titlepage}
Titlepage environment.
\begin{macro}{\ps@skrapport@titlepage}
\begin{MacroCode}{class}
\cs_new:Npn\ps@skrapport@titlepage{
\cs_set:Npn\@oddhead{}
\cs_set:Npn\@evenhead{}
\cs_set:Npn\@oddfoot{
\begin{minipage}{\textwidth}
\raggedleft\small\par
\__skrapport_smallprint_style:
\tl_use:N\g__skrapport_copyright_tl
\end{minipage}
}
\cs_set_eq:NN\@evenfoot\@oddfoot
}
\end{MacroCode}
\end{macro}
\begin{MacroCode}{class}
\DeclareDocumentEnvironment{titlepage}{}{
\cleardoublepage\setcounter{page}{1}
}{
\bool_gset_false:N\g__skrapport_copyright_unprinted_bool
\thispagestyle{skrapport@titlepage}
\cleardoublepage\setcounter{page}{1}
}
\end{MacroCode}
\end{environment}
\subsubsection{Sectioning}
Sectioning macros. This is kind of messy. We start with creaiting
some counters using our homemade \LaTeX3 counter macros.
\begin{MacroCode}{class}
\setcounter{secnumdepth}{3}
\newcounter{section}
\newcounter{subsection}[section]
\newcounter{subsubsection}[subsection]
\newcounter{paragraph}[subsubsection]
\newcounter{subparagraph}[paragraph]
\end{MacroCode}
Next up, we have macros to display the section numberings.
\begin{macro*}{\thesection}
\begin{MacroCode}{class}
\cs_gset:Npn\thesection{
\arabic{section}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\thesubsection}
\begin{MacroCode}{class}
\cs_gset:Npn\thesubsection{
\thesection.\arabic{subsection}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\thesubsubsection}
\begin{MacroCode}{class}
\cs_gset:Npn\thesubsubsection{
\thesubsection.\arabic{subsubsection}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\theparagraph}
\begin{MacroCode}{class}
\cs_gset:Npn\theparagraph{
\thesubsubsection.\arabic{paragraph}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\thesubparagraph}
\begin{MacroCode}{class}
\cs_gset:Npn\thesubparagraph{
\theparagraph.\arabic{subparagraph}
}
\end{MacroCode}
\end{macro*}
\paragraph{Pre- and post-section spacing}
Here comes the tricky part. We define two generic macros that add
spacing before and after the section title, to condense the code
a bit. Note that many of the following macros constitute a
reimplementation of \cs{@startsection}, \cs{@ssect}, \cs{@sect} and
friends.
\begin{macro}{\__skrapport_pre_section:n}[1]
{Skip before the section title}
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_pre_section:n#1{
\leavevmode\par
\skip_set:Nn\l_tmpa_skip{#1}
\@afterindenttrue % !!!
\dim_compare:nT{\l_tmpa_skip<\c_zero_skip}{
\skip_set:Nn\l_tmpa_skip{-\l_tmpa_skip}
\@afterindentfalse % !!!
}
\if@nobreak \everypar{} \else
\addpenalty\@secpenalty % !!!
\skip_vertical:N\l_tmpa_skip
\fi
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_post_section:n}[1]
{Space after the section title}
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_post_section:n#1{
\skip_set:Nn\l_tmpa_skip{#1}
\dim_compare:nTF{\l_tmpa_skip>\c_zero_skip}{
\par\nobreak
\skip_vertical:N\l_tmpa_skip
\@afterheading % !!!
}{
\@nobreakfalse
\global\@noskipsectrue
\skip_horizontal:n{-\l_tmpa_skip}
}
\ignorespaces
}
\end{MacroCode}
\end{macro}
\paragraph{Starred sections}
These two macros (the first only being an alias for the second with
its last argument empty) correspond to unnumbered sections. Or,
rather, they do all the typesetting and none of the TOC/counter
stuff. This means that starred sections only call this macro, while
unstarred ones call other macros in addition to this macro.
\begin{macro*}{\__skrapport_section_star:nnn}
\begin{macro}{\__skrapport_section_star:nnnn}[4]
{Indentation of section title}
{Styling of the section title}
{Actual section title}
{Optional code to run in the indentation (\emph{i.e.} section number)}
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_section_star:nnn#1#2#3{
\__skrapport_section_star:nnnn{#1}{#2}{#3}{}
}
\cs_new:Npn\__skrapport_section_star:nnnn#1#2#3#4{
\group_begin:
#2
\hbox_set:Nn\l_tmpa_box{{\skip_horizontal:n{#1}#4}}
\dim_set:Nn\hangindent{#1+\box_wd:N\l_tmpa_box}
\noindent\box_use_drop:N\l_tmpa_box
\interlinepenalty\@M % !!!
#3
\group_end:
}
\end{MacroCode}
\end{macro}
\end{macro*}
\paragraph{Unstarred sections}
This macro typesets an unstarred section, \emph{i.e.} a numbered
one. It defines a temporary macro containing the section number
(maybe, depends on the \cs{c@secnumdepth} counter) which it passes
on to \cs{__skrapport_section_star:nnnn}, and then writes some things
to the TOC.
\begin{macro}{\__skrapport_section_nostar:nnnnnn}[6]
{Section counter name}
{Section level}
{Indentation of section title}
{Styling of the section title}
{Actual section title}
{Section title for TOC}
\changes{0.12d}{Added support for hanging titles}
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_section_nostar:nnnnnn#1#2#3#4#5#6{
\cs_set:Nn\__skrapport_saved_section:{}
\int_compare:nF{#2>\value{secnumdepth}}{
\refstepcounter{#1}
\cs_set:Nn\__skrapport_saved_section:{
\bool_if:NTF\g__skrapport_hanging_titles_bool
{\llap{\use:c{the#1}\hspace{1ex}}}
{\use:c{the#1}~}
}
}
\__skrapport_section_star:nnnn
{#3}{#4}{#5}{\__skrapport_saved_section:}
\use:c{#1mark}{#6}
\addcontentsline{toc}{#1}{
\int_compare:nF{#2>\value{secnumdepth}}{
\protect\numberline{\use:c{the#1}}
}
#6
}
}
\end{MacroCode}
\end{macro}
\paragraph{Generic sectioning macros}
We will now set up a generic sectioning macro. First, we need
version of the above macros that expand their arguments.
\begin{macro*}{\__skrapport_pre_section:v}
\changes{0.12k}{Argument specification changed from \texttt{c} to \texttt{v}}
\begin{MacroCode}{class}
\cs_generate_variant:Nn\__skrapport_pre_section:n{v}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\__skrapport_post_section:v}
\changes{0.12k}{Argument specification changed from \texttt{c} to \texttt{v}}
\begin{MacroCode}{class}
\cs_generate_variant:Nn\__skrapport_post_section:n{v}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\__skrapport_section_star:vvn}
\changes{0.12k}{Argument specification changed from \texttt{ccn} to \texttt{vvn}}
\begin{MacroCode}{class}
\cs_generate_variant:Nn\__skrapport_section_star:nnn{vvn}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\__skrapport_section_nostar:nnvvnn}
\changes{0.12k}{Argument specification changed from \texttt{nnccnn} to \texttt{nnvvnn}}
\begin{MacroCode}{class}
\cs_generate_variant:Nn\__skrapport_section_nostar:nnnnnn{nnvvnn}
\end{MacroCode}
\end{macro*}
Now, the generic sectioning macro basically takes the sectioning
macro arguments straight up (arguments 3--5), additionally
requiring a section counter name and a section level. It expects
that constant dimensions (see definition of \cs{section} below)
and a formatting macro are available, and passes these as arguments
to the underlying sectioning macros as appropriate.
\begin{macro}{\__skrapport_generic_section:nnnnn}[5]
{Section counter name}
{Section level}
{Star (tested with \cs{IfBooleanTF})}
{Optional argument (or \cs{NoValue})}
{Section title text}
\begin{MacroCode}{class}
\cs_set:Nn\__skrapport_generic_section:nnnnn{
\__skrapport_pre_section:v{c__skrapport_#1_pre_skip}
\IfBooleanTF#3{
\__skrapport_section_star:vvn
{c__skrapport_#1_indent_dim}
{__skrapport_#1_style:}
{#5}
}{
\IfNoValueTF{#4}{
\__skrapport_section_nostar:nnvvnn
{#1}{#2}
{c__skrapport_#1_indent_dim}
{__skrapport_#1_style:}
{#5}
{#5}
}{
\__skrapport_section_nostar:nnvvnn
{#1}{#2}
{c__skrapport_#1_indent_dim}
{__skrapport_#1_style:}
{#5}
{#4}
}
}
\__skrapport_post_section:v{c__skrapport_#1_post_skip}
}
\end{MacroCode}
\end{macro}
\paragraph{Public sectioning API}
It's time to define the public sectioning macros. They all follow
the same format: first, two skips and one dimension (used by
\cs{__skrapport_generic_section:nnnnn}) are defined, as well as
a macro defining the text style of the section. Then, the actual
macro is provided.
\begin{macro}{\section}[3]
{Star (tested with \cs{IfBooleanTF})}
{Optional short title (or \cs{NoValue})}
{Sectioning title}
\begin{macro*}{\c__skrapport_section_pre_skip}
This is the skip \emph{before} a section title.
\begin{MacroCode}{class}
\skip_const:Nn\c__skrapport_section_pre_skip{-4ex~plus~1ex~minus~-1ex}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_section_post_skip}
This is the skip \emph{after} a section title.
\begin{MacroCode}{class}
\skip_const:Nn\c__skrapport_section_post_skip{.5ex~plus~.5ex}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_section_indent_dim}
This is the \emph{indentation} of a section title.
\begin{MacroCode}{class}
\dim_const:Nn \c__skrapport_section_indent_dim{\c_zero_dim}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_section_style:}
This is the text style of a section title.
\begin{MacroCode}{class}
\cs_set_protected:Nn\__skrapport_section_style:
{\normalfont\LARGE\__skrapport_title_style:}
\end{MacroCode}
\end{macro*}
Finally, the public macro is provided.
\begin{MacroCode}{class}
\DeclareDocumentCommand\section{som}{
\__skrapport_generic_section:nnnnn{section}{1}{#1}{#2}{#3}
}
\end{MacroCode}
\end{macro}
The other sectioning macros (macros from section to subparagraph are
available) are defined in an analogous manner.
\begin{macro}{\subsection}[3]
{Star (tested with \cs{IfBooleanTF})}
{Optional short title (or \cs{NoValue})}
{Sectioning title}
\begin{macro*}{\c__skrapport_subsection_pre_skip}
\begin{MacroCode}{class}
\skip_const:Nn\c__skrapport_subsection_pre_skip{-3ex~plus~1ex~minus~-1ex}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_subsection_post_skip}
\begin{MacroCode}{class}
\skip_const:Nn\c__skrapport_subsection_post_skip{.25ex~plus~.25ex}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_subsection_indent_dim}
\begin{MacroCode}{class}
\dim_const:Nn \c__skrapport_subsection_indent_dim{\c_zero_dim}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_subsection_style:}
\begin{MacroCode}{class}
\cs_set_protected:Nn\__skrapport_subsection_style:
{\normalfont\Large\__skrapport_title_style:}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\DeclareDocumentCommand\subsection{som}{
\__skrapport_generic_section:nnnnn{subsection}{2}{#1}{#2}{#3}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\subsubsection}[3]
{Star (tested with \cs{IfBooleanTF})}
{Optional short title (or \cs{NoValue})}
{Sectioning title}
\begin{macro*}{\c__skrapport_subsubsection_pre_skip}
\begin{MacroCode}{class}
\skip_const:Nn\c__skrapport_subsubsection_pre_skip{-2ex~plus~.5ex~minus~-.5ex}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_subsubsection_post_skip}
\begin{MacroCode}{class}
\skip_const:Nn\c__skrapport_subsubsection_post_skip{.125ex~plus~.125ex}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_subsubsection_indent_dim}
\begin{MacroCode}{class}
\dim_const:Nn \c__skrapport_subsubsection_indent_dim{\c_zero_dim}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_subsubsection_style:}
\begin{MacroCode}{class}
\cs_set_protected:Nn\__skrapport_subsubsection_style:
{\normalfont\large\__skrapport_title_style:}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\DeclareDocumentCommand\subsubsection{som}{
\__skrapport_generic_section:nnnnn{subsubsection}{3}{#1}{#2}{#3}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\paragraph}[3]
{Star (tested with \cs{IfBooleanTF})}
{Optional short title (or \cs{NoValue})}
{Sectioning title}
\begin{macro*}{\c__skrapport_paragraph_pre_skip}
\begin{MacroCode}{class}
\skip_const:Nn\c__skrapport_paragraph_pre_skip{1ex~plus~.25ex~minus~-.25ex}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_paragraph_post_skip}
\begin{MacroCode}{class}
\skip_const:Nn\c__skrapport_paragraph_post_skip{-1em}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_paragraph_indent_dim}
\begin{MacroCode}{class}
\dim_const:Nn \c__skrapport_paragraph_indent_dim{\c_zero_dim}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_paragraph_style:}
\begin{MacroCode}{class}
\cs_set_protected:Nn\__skrapport_paragraph_style:
{\normalfont\normalsize\__skrapport_title_style:}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\DeclareDocumentCommand\paragraph{som}{
\__skrapport_generic_section:nnnnn{paragraph}{4}{#1}{#2}{#3}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\subparagraph}[3]
{Star (tested with \cs{IfBooleanTF})}
{Optional short title (or \cs{NoValue})}
{Sectioning title}
\begin{macro*}{\c__skrapport_subparagraph_pre_skip}
\begin{MacroCode}{class}
\skip_const:Nn\c__skrapport_subparagraph_pre_skip{1ex~plus~.25ex~minus~-.25ex}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_subparagraph_post_skip}
\begin{MacroCode}{class}
\skip_const:Nn\c__skrapport_subparagraph_post_skip{-1em}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_subparagraph_indent_dim}
\begin{MacroCode}{class}
\dim_const:Nn \c__skrapport_subparagraph_indent_dim{\parindent}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\c__skrapport_subparagraph_style:}
\begin{MacroCode}{class}
\cs_set_protected:Nn\__skrapport_subparagraph_style:
{\normalfont\normalsize\__skrapport_title_style:\itshape}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\DeclareDocumentCommand\subparagraph{som}{
\__skrapport_generic_section:nnnnn{subparagraph}{5}{#1}{#2}{#3}
}
\end{MacroCode}
\end{macro}
\subsubsection{Macros and environments from \pkg{article}}
\paragraph{List environments}
First, several dimensions are provided and three penalties defined.
\begin{MacroCode}{class}
\dim_gset:Nn\leftmargini{2em}
\dim_gset_eq:NN\leftmargin\leftmargini
\dim_gset:Nn\leftmarginii{2em}
\dim_gset:Nn\leftmarginiii{1.5em}
\dim_gset:Nn\leftmarginiv{1.5em}
\dim_gset:Nn\leftmarginv{1em}
\dim_gset:Nn\leftmarginvi{1em}
\dim_gset:Nn\labelsep{.5em}
\dim_gset_eq:NN\labelwidth\leftmargini
\dim_gsub:Nn\labelwidth{-\labelsep}
\int_gset:Nn\@beginparpenalty{-\@lowpenalty}
\int_gset:Nn\@endparpenalty {-\@lowpenalty}
\int_gset:Nn\@itempenalty {-\@lowpenalty}
\end{MacroCode}
Then, we define the appearance of the item numbers.
\begin{macro*}{\theenumi}
The first level consists of arabic numbers (\(1,2,3,\dotsc\)).
\begin{MacroCode}{class}
\cs_set:Npn\theenumi {\arabic{enumi}}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\theenumii}
The second level consists of lower-case alphabetic characters
(\(\text{a},\text{b},\text{c},\dotsc\)).
\begin{MacroCode}{class}
\cs_set:Npn\theenumii {\alph{enumii}}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\theenumiii}
The third level consists of lower-case roman numerals
(\(\text{i},\text{ii},\text{iii},\dotsc\)).
\begin{MacroCode}{class}
\cs_set:Npn\theenumiii{\roman{enumiii}}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\theenumiv}
The fourth level consists of upper-case alphabetic characters
(\(\text{A},\text{B},\text{C},\dotsc\)).
\begin{MacroCode}{class}
\cs_set:Npn\theenumiv {\Alph{enumiv}}
\end{MacroCode}
\end{macro*}
We also need macros that typeset the actual labels. Here, different
levels have a different postfix: all levels except the second are
postfixed by a period, while the second level is postfixed by a
closing bracket.
\begin{macro*}{\labelenumi}
\begin{MacroCode}{class}
\cs_new:Npn\labelenumi{\theenumi.}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\labelenumii}
\begin{MacroCode}{class}
\cs_new:Npn\labelenumii{\theenumii)}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\labelenumiii}
\begin{MacroCode}{class}
\cs_new:Npn\labelenumiii{\theenumiii.}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\labelenumiv}
\begin{MacroCode}{class}
\cs_new:Npn\labelenumiv{\theenumiv.}
\end{MacroCode}
\end{macro*}
We also fix the referencing of lower-level items so that one can
refer to them properly (\emph{i.e.} as 1b(iii) and so on).
\begin{macro*}{\p@enumii}
\begin{MacroCode}{class}
\cs_set:Npn\p@enumii{\theenumi}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\p@enumiii}
\begin{MacroCode}{class}
\cs_set:Npn\p@enumiii{\theenumi(\theenumii)}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\p@enumiiv}
\begin{MacroCode}{class}
\cs_set:Npn\p@enumiv{\p@enumiii\theenumiii}
\end{MacroCode}
\end{macro*}
All that was for numbered lists (\env{enumerate}). Now, we define
the \enquote{labels} of \env{itemize} items. Alternately, they
are a bullet (\textbullet) and a boldfaced dash
({\normalfont\bfseries\textendash}).
\begin{macro*}{\labelitemi}
\begin{MacroCode}{class}
\cs_set:Npn\labelitemi{\textbullet}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\labelitemii}
\begin{MacroCode}{class}
\cs_set:Npn\labelitemii{\normalfont\bfseries\textendash}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\labelitemiii}
\begin{MacroCode}{class}
\cs_set:Npn\labelitemiii{\textbullet}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\labelitemiv}
\begin{MacroCode}{class}
\cs_set:Npn\labelitemiv{\normalfont\bfseries\textendash}
\end{MacroCode}
\end{macro*}
The last of the commonly used list environments is \env{description}.
Defining it is fairly simple --- we define a list with empty item
labels and a bit of hackery for the \cs{makelabel} macro inside.
\begin{environment}{description}
\begin{MacroCode}{class}
\DeclareDocumentEnvironment{description}{}{
\begin{list}{}{
\dim_zero:N\labelwidth
\dim_set:Nn\itemindent{-\leftmargin}
\cs_set_eq:NN\makelabel\descriptionlabel
}
}{
\end{list}
}
\end{MacroCode}
\begin{macro}{\descriptionlabel}
Additionally, the \cs{descriptionlabel} macro is defined.
\begin{MacroCode}{class}
\NewDocumentCommand\descriptionlabel{m}{
\hspace{\labelsep}\normalfont\bfseries #1
}
\end{MacroCode}
\end{macro}
\end{environment}
\paragraph{Quotation environments}
The quotation environments are also fairly simple --- \env{quote}
is just a list with a single item, and \env{quotation} is a
\env{quote} with extra skips around it.
\begin{environment}{quote}
\begin{MacroCode}{class}
\NewDocumentEnvironment{quote}{}{
\begin{list}{}{
\dim_set_eq:NN\rightmargin\leftmargin
}
\item\itshape
}{
\end{list}
}
\end{MacroCode}
\end{environment}
\begin{environment}{quotation}
\begin{MacroCode}{class}
\NewDocumentEnvironment{quotation}{}{
\bigskip
\begin{quote}
}{
\end{quote}
\bigskip
}
\end{MacroCode}
\end{environment}
There's a \env{verse} environment, too, but it's just \env{quote}.
\begin{environment}{verse}
\begin{MacroCode}{class}
\NewDocumentEnvironment{verse}{}{
\begin{quote}
}{
\end{quote}
}
\end{MacroCode}
\end{environment}
\paragraph{Front- and backmatter}
We only define one front/backmatter macro; \cs{appendix}.
\begin{macro}{\appendix}
\begin{MacroCode}{class}
\NewDocumentCommand\appendix{}{
\par
\setcounter{section}{0}
\setcounter{subsection}{0}
\cs_gset:Npn\thesection{\Alph{section}}
}
\end{MacroCode}
\end{macro}
\paragraph{Old font macros}
The old font macros have been deprecated. Do not use!
\begin{macro}{\rm}
\changes{0.12}{Deprecated command}
\begin{MacroCode}{class}
\DeclareDocumentCommand\rm{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\rm}{\textrm}}
\end{MacroCode}
\end{macro}
\begin{macro}{\sf}
\changes{0.12}{Deprecated command}
\begin{MacroCode}{class}
\DeclareDocumentCommand\sf{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\sf}{\textsf}}
\end{MacroCode}
\end{macro}
\begin{macro}{\tt}
\changes{0.12}{Deprecated command}
\begin{MacroCode}{class}
\DeclareDocumentCommand\tt{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\tt}{\texttt}}
\end{MacroCode}
\end{macro}
\begin{macro}{\bf}
\changes{0.12}{Deprecated command}
\begin{MacroCode}{class}
\DeclareDocumentCommand\bf{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\bf}{\textbf}}
\end{MacroCode}
\end{macro}
\begin{macro}{\it}
\changes{0.12}{Deprecated command}
\begin{MacroCode}{class}
\DeclareDocumentCommand\it{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\it}{\textit}}
\end{MacroCode}
\end{macro}
\begin{macro}{\sl}
\changes{0.12}{Deprecated command}
\begin{MacroCode}{class}
\DeclareDocumentCommand\sl{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\sl}{\textsl}}
\end{MacroCode}
\end{macro}
\begin{macro}{\sc}
\changes{0.12}{Deprecated command}
\begin{MacroCode}{class}
\DeclareDocumentCommand\sc{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\sc}{\textsc}}
\end{MacroCode}
\end{macro}
\paragraph{The emphasis macro}
\begin{macro}{\emph}
\changes{0.12}{Changed definition, may have introduced spacing issues}
Redefining the \cs{emph} style to be bold when nested.
\begin{macro*}{\em}
\changes{0.12}{Deprecated command}
\begin{MacroCode}{class}
\DeclareDocumentCommand\em{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\em}{\emph}}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\__skrapport_emphstyle:}
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_emphstyle:{
\itshape
\dim_compare:nF{\fontdimen\c_one_int\font>\c_zero_dim}{\bfseries}
}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\DeclareDocumentCommand\emph{+m}{
\ifmmode
\text{\__skrapport_emphstyle: #1}
\else
{\__skrapport_emphstyle: #1}
\fi
}
\end{MacroCode}
\end{macro}
\paragraph{The footnote rule}
\begin{macro*}{\footnoterule}
\changes{0.12}{Removed footnote rule entirely}
\begin{MacroCode}{class}
\DeclareDocumentCommand\footnoterule{}{}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\@makefntext}
\begin{MacroCode}{class}
\DeclareDocumentCommand\@makefntext{+m}{
\dim_set:Nn\parindent{1em}\noindent
\hbox_to_wd:nn{1.8em}{\hss\@makefnmark}
#1
}
\end{MacroCode}
\end{macro*}
\subsubsection{Floats}
\paragraph{Table- and box-related lengths}
\begin{MacroCode}{class}
\dim_gset:Nn\arraycolsep {5pt}
\dim_gset:Nn\tabcolsep {6pt}
\dim_gset:Nn\arrayrulewidth{.4pt}
\dim_gset:Nn\doublerulesep {2pt}
\dim_gset_eq:NN\tabbingsep\labelsep
\skip_gset_eq:NN{\skip\@mpfootins}{\skip\footins}
\dim_gset:Nn\fboxsep {3pt}
\dim_gset:Nn\fboxrule {.4pt}
\end{MacroCode}
\paragraph{Counters}
\begin{MacroCode}{class}
\newcounter{figure}
\newcounter{table}
\end{MacroCode}
\begin{macro*}{\theequation}
\begin{MacroCode}{class}
\cs_set:Npn\theequation{\arabic{equation}}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\thefigure}
\begin{MacroCode}{class}
\cs_set:Npn\thefigure{\arabic{figure}}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\thetable}
\begin{MacroCode}{class}
\cs_set:Npn\thetable{\arabic{table}}
\end{MacroCode}
\end{macro*}
\paragraph{Defaults}
The default placement, list extension and caption text of all floats.
\begin{MacroCode}{class}
\cs_new:Npn \fps@figure{tb}
\cs_new:Npn\ftype@figure{1}
\cs_new:Npn \ext@figure{lof}
\cs_new:Npn \fnum@figure{\figurename\ \thefigure}
\cs_new:Npn \fps@table {tb}
\cs_new:Npn\ftype@table {2}
\cs_new:Npn \ext@table {lot}
\cs_new:Npn \fnum@table {\tablename\ \thetable}
\end{MacroCode}
\paragraph{Environments}
\begin{macro}{\__skrapport_xfloat:nn}
\begin{macro*}{\__skrapport_xfloat:nx}
This is a helper macro basically replacing the \cs{@float} macro
used by \LaTeXe.
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_xfloat:nn#1#2{\@xfloat{#1}[#2]}
\cs_generate_variant:Nn\__skrapport_xfloat:nn{nx}
\end{MacroCode}
\end{macro*}
\end{macro}
\begin{environment}{figure}
\changes{0.12a}{Figures are now \cs{centering}ed by default}
\begin{environment*}{figure*}
\begin{MacroCode}{class}
\DeclareDocumentEnvironment{figure}{o}{
\__skrapport_xfloat:nx{figure}
{\IfNoValueTF{#1}{\fps@figure}{#1}}
\centering
}{
\end@float
}
\DeclareDocumentEnvironment{figure*}{o}{
\__skrapport_xfloat:nx{figure}
{\IfNoValueTF{#1}{tp}{#1}}
\centering
}{
\end@float
}
\end{MacroCode}
\end{environment*}
\end{environment}
\begin{environment}{table}
\changes{0.12a}{Tables are now \cs{centering}ed by default}
\begin{environment*}{table*}
\begin{MacroCode}{class}
\DeclareDocumentEnvironment{table}{o}{
\__skrapport_xfloat:nx{table}
{\IfNoValueTF{#1}{\fps@table}{#1}}
\centering
}{
\end@float
}
\DeclareDocumentEnvironment{table*}{o}{
\__skrapport_xfloat:nx{table}
{\IfNoValueTF{#1}{tp}{#1}}
\centering
}{
\end@float
}
\end{MacroCode}
\end{environment*}
\end{environment}
In addition to the \env{figure} and \env{table} environments, we
also provide a \env{figcenter} environment that enables centering
of figures or tables that are too wide for the page.
\begin{macro*}{\coffin_typeset:Nnnon}
\begin{MacroCode}{class}
\cs_generate_variant:Nn\coffin_typeset:Nnnnn{Nnnon}
\end{MacroCode}
\end{macro*}
\begin{environment}{figcenter}
\changes{0.12c}{Fixed the x-offset calculation}
\begin{MacroCode}{class}
\DeclareDocumentEnvironment{figcenter}{}{
\cs_set_eq:NN\l__tmpa_cs\caption
\cs_set:Npn\caption{\msg_error:nn{skrapport}{caption-in-figcenter}}
\coffin_clear:N\l_tmpa_coffin
\hcoffin_set:Nw\l_tmpa_coffin
}{
\hcoffin_set_end:
\dim_set:Nn\l_tmpa_dim{(\textwidth - \coffin_wd:N\l_tmpa_coffin)/2}
\coffin_typeset:Nnnon\l_tmpa_coffin{H}{l}{\dim_use:N\l_tmpa_dim}{0pt}
\cs_set_eq:NN\caption\l__tmpa_cs
\cs_undefine:N\l__tmpa_cs
}
\end{MacroCode}
\end{environment}
\paragraph{Captions}
Before we begin, we pass options to \pkg{caption}, in case the user
is loading it or another package based upon it. This fixes an issue
where the custom caption style was overwritten with the ugly default
\pkg{article} caption style.
\begin{MacroCode}{class}
\PassOptionsToPackage{font=small,labelfont+=bf,textfont+=it}{caption}
\end{MacroCode}
\begin{macro*}{\__skrapport_caption_name_style:}
\begin{MacroCode}{class}
\cs_new_protected:Nn\__skrapport_caption_name_style:{\small\bfseries}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\__skrapport_caption_text_style:}
\begin{MacroCode}{class}
\cs_new_protected:Nn\__skrapport_caption_text_style:{\small\itshape}
\end{MacroCode}
\end{macro*}
\begin{MacroCode}{class}
\skip_new:N\abovecaptionskip
\skip_set:Nn\abovecaptionskip{10pt}
\skip_new:N\belowcaptionskip
\skip_set:Nn\belowcaptionskip{10pt}
\end{MacroCode}
\begin{macro*}{\@makecaption}
\changes{0.10c}{Fix missing coloring command for some captions}
\changes{0.12}{Split \cs{@captionstyle} into two macros}
\changes{0.12a}{Fix a bug which applied caption name styling to the
caption text}
This should possibly be redefined already at the \cs{caption} level.
\begin{MacroCode}{class}
\cs_new:Npn\@makecaption#1#2{
\skip_vertical:N\abovecaptionskip
\hbox_set:Nn\l_tmpa_box{
\color@setgroup % !!!
{\__skrapport_caption_name_style:#1:~}
{\__skrapport_caption_text_style:#2}
\color@endgroup % !!!
}
\dim_compare:nTF{\box_wd:N\l_tmpa_box>\hsize}{
{\__skrapport_caption_name_style:#1:~}
{\__skrapport_caption_text_style:#2}
\par
}{
\global\@minipagefalse % !!!
\hbox_to_wd:nn{\hsize}{
\hfil
\box_use_drop:N\l_tmpa_box
\hfil
}
}
\skip_vertical:N\belowcaptionskip
}
\end{MacroCode}
\end{macro*}
\subsubsection{Table of contents}
\begin{MacroCode}{class}
\cs_new:Npn\@pnumwidth{1.55em}
\cs_new:Npn\@tocrmarg{2em}
\cs_new:Npn\@dotsep{1.7}
\setcounter{tocdepth}{3}
\end{MacroCode}
\begin{macro}{\tableofcontents}
\changes{0.12}{Removed spacing and \cs{@mkboth} call}
\begin{MacroCode}{class}
\DeclareDocumentCommand\tableofcontents{}{
\section*{\contentsname}
\makeatletter
\@starttoc{toc}
\makeatother
}
\end{MacroCode}
\end{macro}
The following macros conspire to replace \cs{@dottedtocline}.
\begin{macro*}{\__skrapport_toc_line:nnnnnn}[6]
{TOC line character}
{Table of contents level of the line}
{Indentation at the start of the line}
{Width of the section number}
{Section title}
{Page number}
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_toc_line:nnnnnn#1#2#3#4#5#6{
\int_compare:nF{#2>\value{tocdepth}}{
\skip_vertical:n{0pt~plus~.2pt}
\group_begin:
\skip_set:Nn\leftskip{#3}
\skip_set_eq:NN\rightskip\@tocrmarg
\skip_set:Nn\parfillskip{-\rightskip}
\dim_set:Nn\parindent{#3}
\@afterindenttrue % !!!
\interlinepenalty\@M % !!!
\leavevmode
\end{MacroCode}
This here is pretty dumb. We can't use a \LaTeX3\ temporary skip
register (or skip the temporary), because \texttt{\#5} further down
will contain a \cs{hbox} based on \cs{@tempdima}. The proper thing
to do here would be to rewrite \cs{addcontentsline}, I guess. Bah.
\begin{MacroCode}{class}
\skip_set:Nn\@tempdima{#4} % !!! (dumb)
\skip_add:Nn\leftskip{\@tempdima}
\null\nobreak
\skip_horizontal:n{-\leftskip}
{#5}\nobreak
\str_if_eq:nnTF{#1}{}{
\hfill
}{
\leaders\hbox:n{
\(\mkern\@dotsep mu\hbox{#1}\mkern\@dotsep mu\) % !!!
}
}
\hfill\nobreak
\hbox_to_wd:nn{\@pnumwidth}{ % !!!
\hfil\normalfont\normalcolor #6
}
\par
\group_end:
}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\__skrapport_toc_line:nnnnnn}[5]
{Table of contents level of the line}
{Indentation at the start of the line}
{Width of the section number}
{Section title}
{Page number}
This is a variant of \cs{__skrapport_toc_line:nnnnnn} which
implicitly sets empty space as its TOC line.
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_toc_line:nnnnn#1#2#3#4#5{
\__skrapport_toc_line:nnnnnn{}{#1}{#2}{#3}{#4}{#5}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\l@section}
\changes{0.12}{Now uses \cs{__skrapport_toc_line:nnnnn}}
\begin{MacroCode}{class}
\DeclareDocumentCommand\l@section{mm}{
\group_begin:
\skip_vertical:n{.75ex}
\bfseries
\__skrapport_toc_line:nnnnn{1}{0em}{1.3em}{#1}{#2}
\group_end:
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\l@subsection}
\changes{0.12}{Now uses \cs{__skrapport_toc_line:nnnnnn}}
\begin{MacroCode}{class}
\DeclareDocumentCommand\l@subsection{mm}{
\group_begin:
\skip_vertical:n{.35ex}
\penalty\@secpenalty % !!!
\__skrapport_toc_line:nnnnnn{.}{2}{1.3em}{2em}{#1}{#2}
\group_end:
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\l@subsubsection}
\changes{0.12}{Changed style to match \pkg{skdoc}}
\begin{MacroCode}{class}
\DeclareDocumentCommand\l@subsubsection{mm}{
\skip_set:Nn\leftskip{3.3em}
\dim_set_eq:NN\parindent\c_zero_dim
\group_begin:
\cs_set_eq:NN\numberline\use_none:n
\small #1~[#2]
\group_end:
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\l@paragraph}
\begin{MacroCode}{class}
\DeclareDocumentCommand\l@paragraph{mm}{
\int_compare:nF{4>\value{tocdepth}}{
\msg_warning:nnnn{skrapport}{tocdepth-too-deep}
{4}{\l@paragraph}
}
}
\end{MacroCode}
\end{macro*}
\begin{macro*}{\l@subparagraph}
\begin{MacroCode}{class}
\DeclareDocumentCommand\l@subparagraph{mm}{
\int_compare:nF{5>\value{tocdepth}}{
\msg_warning:nnnn{skrapport}{tocdepth-too-deep}
{5}{\l@subparagraph}
}
}
\end{MacroCode}
\end{macro*}
Fix for \emph{e.g.}~\pkg{tocloft} package.
\begin{MacroCode}{class}
\cs_set:Npn\l@figure{}
\cs_set:Npn\l@table{}
\end{MacroCode}
\subsubsection{Basic bibliography support}
\begin{MacroCode}{class}
\dim_new:N\bibindent
\dim_set:Nn\bibindent{2em}
\end{MacroCode}
\begin{environment}{thebibliography}
\changes{0.12}{Removed \cs{@mkboth}, \cs{@openbib@code} and
\cs{@noitemerr}}
\begin{MacroCode}{class}
\DeclareDocumentEnvironment{thebibliography}{m}{
\section*{\refname}
\list{\@biblabel{\arabic{enumiv}}}{
\dim_set_to_wd:Nn\labelwidth{\@biblabel{#1}}
\dim_set_eq:NN\leftmargin\labelwidth
\dim_add:Nn\leftmargin{\labelsep}
\usecounter{enumiv} % !!!
\cs_set:Nn\p@enumiv{}
\RenewDocumentCommand\theenumiv{}{\arabic{enumiv}}
}
\sloppy
\int_set:Nn\clubpenalty{4000}
\int_set_eq:NN\@clubpenalty\clubpenalty
\int_set:Nn\widowpenalty{4000}
}{
\cs_set:Nn\@noitemerr{}
\endlist
}
\end{MacroCode}
\end{environment}
\begin{macro*}{\newblock}
\begin{MacroCode}{class}
\DeclareDocumentCommand\newblock{}{
\skip_horizontal:n{.11em~plus~.33em~minus~.07em}
}
\end{MacroCode}
\end{macro*}
\begin{environment}{theindex}
\changes{0.12}{Use \pkg{multicol} instead of \cs{twocolumn} mode,
removed \cs{@mkboth} call}
\begin{MacroCode}{class}
\DeclareDocumentEnvironment{theindex}{}{
\begin{multicols}{2}[\section*{\indexname}]
\thispagestyle{plain}
\dim_zero:N\parindent
\skip_set:N\parskip{\c_zero_skip~plus~.3pt}
\dim_zero:N\columnseprule
\dim_set:Nn\columnsep{35pt}
\cs_set_eq:NN\item\@idxitem
}{
\end{multicols}
}
\end{MacroCode}
\end{environment}
\begin{macro*}{\@idxitem}
\begin{MacroCode}{class}
\DeclareDocumentCommand\@idxitem{}{
\par
\dim_set:Nn\hangindent{40pt}
}
\end{MacroCode}
\end{macro*}
\begin{macro}{\subitem}
\begin{MacroCode}{class}
\DeclareDocumentCommand\subitem{}{
\@idxitem
\hspace*{20pt}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\subsubitem}
\begin{MacroCode}{class}
\DeclareDocumentCommand\subsubitem{}{
\@idxitem
\hspace*{30pt}
}
\end{MacroCode}
\end{macro}
\begin{macro*}{\indexspace}
\begin{MacroCode}{class}
\DeclareDocumentCommand\indexspace{}{
\par
\skip_vertical:n{10pt~plus~5pt~minus~3pt}
}
\end{MacroCode}
\end{macro*}
\subsubsection{Miscellaneous}
A macro \cs{comment} (alias \cs{com}/\cs{note}) is defined to let
the user add comments and notes to the document.
\begin{macro}{\__skrapport_comment:n}
\begin{MacroCode}{class}
\cs_new:Npn\__skrapport_comment:n#1{
{\textbf{\__skrapport_Comment_word: :}~#1}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\comment}
\changes{0.10}{Added macro for comments}
\changes{0.12b}{No longer uses \cs{colorbox} if no color package is loaded}
\begin{MacroCode}{class}
\DeclareDocumentCommand\comment{sm}{
\IfBooleanTF{#1}
{
\cs_if_exist_use:NT\colorbox{{red!50}}
{\__skrapport_comment:n{#2}}
}
{\marginpar{\__skrapport_comment:n{#2}}}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\com}
\begin{macro}{\note}
\changes{0.10b}{Fixed a silly error in \cs{com} and \cs{note}}
\begin{MacroCode}{class}
\ProvideDocumentCommand\com{sm}
{\IfBooleanTF{#1}{\comment*{#2}}{\comment{#2}}}
\ProvideDocumentCommand\note{sm}
{\IfBooleanTF{#1}{\comment*{#2}}{\comment{#2}}}
\end{MacroCode}
\end{macro}
\end{macro}
\begin{macro}{\__skrapport_space_if_not_punctuation:}
\begin{MacroCode}{class}
\cs_new:Nn\__skrapport_space_if_not_punctuation:{
\clist_if_in:noF
{{,},:,;,!,?,-,),'}
{\token_to_meaning:N\l_peek_token}
{\ }
}
\end{MacroCode}
\end{macro}
\begin{macro}{\__skrapport_peek_punctuation:n}
\begin{macro*}{\__skrapport_peek_punctuation:x}
\begin{MacroCode}{class}
\cs_new_nopar:Nn\__skrapport_peek_punctuation:n{
\mbox{#1}
\peek_meaning_remove:NTF.{}{
\peek_meaning:NF\ {
\peek_after:Nw\__skrapport_space_if_not_punctuation:
}
}
}
\cs_generate_variant:Nn\__skrapport_peek_punctuation:n{x}
\end{MacroCode}
\end{macro*}
\end{macro}
\begin{macro}{\eg}
\begin{MacroCode}{class}
\DeclareDocumentCommand\eg{}{
\__skrapport_peek_punctuation:x{\__skrapport_eg_word:}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\ie}
\begin{MacroCode}{class}
\DeclareDocumentCommand\ie{}{
\__skrapport_peek_punctuation:x{\__skrapport_ie_word:}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\etc}
\begin{MacroCode}{class}
\DeclareDocumentCommand\etc{}{
\__skrapport_peek_punctuation:x{\__skrapport_etc_word:}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\cf}
\begin{MacroCode}{class}
\DeclareDocumentCommand\cf{}{
\__skrapport_peek_punctuation:x{\__skrapport_cf_word:}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\viz}
\begin{MacroCode}{class}
\DeclareDocumentCommand\viz{}{
\__skrapport_peek_punctuation:x{\__skrapport_viz_word:}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\dash}
\begin{MacroCode}{class}
\DeclareDocumentCommand\dash{}{
\cs_if_exist_use:NT\texorpdfstring
{\unskip\nobreak\thinspace\textemdash\thinspace\ignorespaces}{{ - }}
}
\cs_if_exist_use:NT\DeclareUnicodeCharacter{{2014}{\dash}}
\end{MacroCode}
\end{macro}
\subsubsection{Color theme support}
Color theme setup. Start by patching commands and declaring
default colors. Not implemented: background colors for e.g.
quote environments and sections headings, different colors
for the different sectioning levels.
\begin{MacroCode}{class}
\bool_if:NT\g__skrapport_color_bool{
\apptocmd{\bfseries}
{\color{skrapport@boldcolor}}{}
{\msg_warning:nnn{skrapport}{color-patch-failed}{\bfseries}}
\apptocmd{\itshape}
{\color{skrapport@italiccolor}}{}
{\msg_warning:nnn{skrapport}{color-patch-failed}{\itshape}}
\apptocmd{\__skrapport_title_style:}
{\color{skrapport@titlecolor}}{}
{\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_title_style:}}
\apptocmd{\__skrapport_smallprint_style:}
{\color{skrapport@smallprintcolor}}{}
{\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_smallprint_style:}}
\apptocmd{\__skrapport_abstract_style:}
{\color{skrapport@titlecolor}}{}
{\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_abstract_style:}}
\apptocmd{\quote}
{\color{skrapport@quotecolor}}{}
{\msg_warning:nnn{skrapport}{color-patch-failed}{\quote}}
\apptocmd{\__skrapport_caption_name_style:}
{\color{skrapport@captioncolor}}{}
{\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_caption_name_style:}}
\apptocmd{\__skrapport_emphstyle:}
{\color{skrapport@emphcolor}}{}
{\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_emphstyle:}}
\end{MacroCode}
% I have no idea why this was here or what difference it makes. These
% things should be using \__skrapport_title_style:.
% \ifskrapport@twocolumn\AtBeginDocument{%
% \renewcommand\section{\@startsection {section}{1}{\z@}%
% {-.999\baselineskip}{0.001\baselineskip}{\bfseries\mathversi%on{bold}\color{skrapport@titlecolor}}}
% \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
% {\baselineskip}{-.35\baselineskip}{\bfseries\color{skrapport@titlecolor}\unskip}}
% \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
% {\baselineskip}{-.35\baselineskip}{\itshape\color{skrapport@titlecolor}\unskip}}
% }\fi
% \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
% {1ex \@plus .25ex \@minus -.25ex}{-1em}{\normalfont\normalsize\bfseries\color{skrapport@titlecolor}}}
% \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
% {1ex \@plus .25ex \@minus -.25ex}{-1em}{\normalfont\normalsize\itshape\color{skrapport@titlecolor}}}
\begin{MacroCode}{class}
\AtBeginDocument{\@ifpackageloaded{hyperref}{%
\hypersetup{%
citebordercolor=skrapport@citecolor,citecolor=skrapport@citecolor,%
filebordercolor=skrapport@filecolor,filecolor=skrapport@filecolor,%
linkbordercolor=skrapport@linkcolor,linkcolor=skrapport@linkcolor,%
menubordercolor=skrapport@menucolor,menucolor=skrapport@menucolor,%
urlbordercolor=skrapport@urlcolor,urlcolor=skrapport@urlcolor,%
runbordercolor=skrapport@runcolor,runcolor=skrapport@runcolor%
}
}{}}
\AtBeginDocument{\color{skrapport@defaultcolor}}
\end{MacroCode}
\begin{macro}{\colortheme}
The \cs{colortheme} macro allows the end-user to load color themes
(described later) to customize the colors of the document when the
class is loaded with the \opt{color} option.
\begin{MacroCode}{class}
\DeclareDocumentCommand\colortheme{m}{
\usepackage{skrapport-colortheme-#1}
}
\end{MacroCode}
\end{macro}
\begin{MacroCode}{class}
\colortheme{default}
}
\end{MacroCode}
\subsection{Final class setup}
We end the document class by setting a few lengths along with the
page style and page numbering. Also, activate \cs{raggedbottom} and
\cs{onexolumn} (since we always do all the two-column stuff
ourselves anyway).
\begin{MacroCode}{class}
\dim_set:Nn\columnsep{10pt}
\dim_zero:N\columnseprule
\pagestyle{plain}
\pagenumbering{arabic}
\raggedbottom
\onecolumn
\endinput
\end{MacroCode}
\subsection{Color themes}
As described earlier, the user can load color themes to customize
the appearance of the document if the class was loaded with the
\opt{color} option. Four themes are available by default.
\subsubsection{Default color theme}
\begin{theme}{Default}
\changes{0.09}{Added default color theme}
\begin{MacroCode}{theme-default}
\RequirePackage{expl3}
\ProvidesExplPackage{skrapport-colortheme-default}
{2012/06/07}{1.0}{skrapport color theme default}
\definecolor{skrapport@citecolor}{named}{green}
\definecolor{skrapport@filecolor}{named}{teal}
\definecolor{skrapport@linkcolor}{named}{red}
\definecolor{skrapport@menucolor}{named}{red}
\definecolor{skrapport@urlcolor}{named}{cyan}
\definecolor{skrapport@runcolor}{named}{teal}
\definecolor{skrapport@boldcolor}{named}{black}
\definecolor{skrapport@titlecolor}{named}{black}
\definecolor{skrapport@italiccolor}{named}{black}
\definecolor{skrapport@smallprintcolor}{named}{black}
\definecolor{skrapport@quotecolor}{named}{black}
\definecolor{skrapport@captioncolor}{named}{black}
\definecolor{skrapport@emphcolor}{named}{black}
\definecolor{skrapport@defaultcolor}{named}{black}
\endinput
\end{MacroCode}
\end{theme}
\subsubsection{Unscathed color theme}
\begin{theme}{Unscathed}
\changes{0.09}{Added \enquote{Unschathed} color theme}
\begin{MacroCode}{theme-unscathed}
\RequirePackage{expl3}
\ProvidesExplPackage{skrapport-colortheme-unscathed}
{2012/06/07}{1.0}{skrapport color theme unscathed}
\definecolor{skrapport@citecolor}{named}{skrapport@defaultcolor}
\definecolor{skrapport@filecolor}{named}{skrapport@defaultcolor}
\definecolor{skrapport@menucolor}{named}{skrapport@defaultcolor}
\definecolor{skrapport@runcolor}{named}{skrapport@defaultcolor}
\definecolor{skrapport@emphcolor}{HTML}{463335}
\definecolor{skrapport@linkcolor}{HTML}{CF5D3B}
\definecolor{skrapport@urlcolor}{named}{skrapport@linkcolor}
\definecolor{skrapport@titlecolor}{HTML}{B34430}
\definecolor{skrapport@captioncolor}{named}{skrapport@titlecolor}
\definecolor{skrapport@quotecolor}{HTML}{70524A}
\definecolor{skrapport@smallprintcolor}{named}{skrapport@quotecolor}
\endinput
\end{MacroCode}
\end{theme}
\subsubsection{Cruelwater color theme}
\begin{theme}{Cruelwater}
\changes{0.09}{Added \enquote{Cruelwater} color theme}
\begin{MacroCode}{theme-cruelwater}
\RequirePackage{expl3}
\ProvidesExplPackage{skrapport-colortheme-cruelwater}
{2012/06/07}{1.0}{skrapport color theme cruelwater}
\definecolor{skrapport@citecolor}{named}{black}
\definecolor{skrapport@filecolor}{named}{black}
\definecolor{skrapport@linkcolor}{named}{black}
\definecolor{skrapport@menucolor}{named}{black}
\definecolor{skrapport@urlcolor}{named}{black}
\definecolor{skrapport@runcolor}{named}{black}
\definecolor{skrapport@boldcolor}{HTML}{030C22}
\definecolor{skrapport@titlecolor}{HTML}{20293F}
\definecolor{skrapport@italiccolor}{named}{black}
\definecolor{skrapport@smallprintcolor}{HTML}{A9B0B3}
\definecolor{skrapport@quotecolor}{HTML}{404749}
\definecolor{skrapport@captioncolor}{HTML}{030C22}
\definecolor{skrapport@emphcolor}{HTML}{20293F}
\definecolor{skrapport@defaultcolor}{named}{black}
\endinput
\end{MacroCode}
\end{theme}
\subsubsection{Violet color theme}
\begin{theme}{Violet}
\changes{0.09}{Added \enquote{Violet} color theme}
\begin{MacroCode}{theme-violet}
\RequirePackage{expl3}
\ProvidesExplPackage{skrapport-colortheme-violet}
{2012/06/07}{1.0}{skrapport color theme violet}
\definecolor{skrapport@citecolor}{HTML}{932444}
\definecolor{skrapport@filecolor}{HTML}{932444}
\definecolor{skrapport@linkcolor}{HTML}{932444}
\definecolor{skrapport@menucolor}{HTML}{932444}
\definecolor{skrapport@urlcolor}{HTML}{932444}
\definecolor{skrapport@runcolor}{HTML}{932444}
\definecolor{skrapport@boldcolor}{HTML}{311A2A}
\definecolor{skrapport@titlecolor}{HTML}{311A2A}
\definecolor{skrapport@italiccolor}{named}{black}
\definecolor{skrapport@smallprintcolor}{HTML}{D6CBCF}
\definecolor{skrapport@quotecolor}{HTML}{463335}
\definecolor{skrapport@captioncolor}{HTML}{311A2A}
\definecolor{skrapport@emphcolor}{HTML}{98758D}
\definecolor{skrapport@defaultcolor}{named}{black}
\endinput
\end{MacroCode}
\end{theme}
\subsubsection{skdoc color theme}
\begin{theme}{skdoc}
\changes{0.11a}{Added \enquote{skdoc} color theme}
\begin{MacroCode}{theme-skdoc}
\RequirePackage{expl3}
\ProvidesExplPackage{skrapport-colortheme-skdoc}
{2013/04/10}{1.0}{skrapport color theme skdoc}
\definecolor{skrapport@citecolor}{RGB}{140,35,24}
\definecolor{skrapport@filecolor}{RGB}{73,10,61}
\definecolor{skrapport@linkcolor}{RGB}{140,35,24}
\definecolor{skrapport@menucolor}{RGB}{140,35,24}
\definecolor{skrapport@urlcolor}{RGB}{73,10,61}
\definecolor{skrapport@runcolor}{RGB}{73,10,61}
\definecolor{skrapport@boldcolor}{RGB}{73,10,61}
\definecolor{skrapport@titlecolor}{RGB}{11,72,107}
\definecolor{skrapport@italiccolor}{named}{black}
\definecolor{skrapport@smallprintcolor}{RGB}{11,72,107}
\definecolor{skrapport@quotecolor}{RGB}{140,35,24}
\definecolor{skrapport@captioncolor}{RGB}{11,72,107}
\definecolor{skrapport@emphcolor}{RGB}{73,10,61}
\definecolor{skrapport@defaultcolor}{named}{black}
\endinput
\end{MacroCode}
\end{theme}
\section{Point sizes}
The point size options are pretty much \LaTeX3 translations of the
standard \pkg{article} class option files. There's a lot of duplicate
code here which may be worth to consolidate a bit.
\subsubsection{Common macros}
We first set up a package providing replacements for \LaTeXe\ macros,
common to all the point size files.
\begin{MacroCode}{size-common}
\RequirePackage{expl3}
\ProvidesExplPackage{skrapport-size-common}
{2013/04/29}{1.0}{skrapport point size option common macros}
\end{MacroCode}
\begin{macro}{\__skrapport_set_font_size:nn}[2]
{Font size}
{Baseline skip?} % !!!
\begin{MacroCode}{size-common}
\cs_new:Npn\__skrapport_set_font_size:nn#1#2{
\fontsize{#1}{#2} % !!!
\selectfont
}
\end{MacroCode}
\end{macro}
\begin{MacroCode}{size-common}
\endinput
\end{MacroCode}
\subsubsection{Actual point size files}
\begin{MacroCode}{size-10,size-11,size-12}
\RequirePackage{expl3}
\end{MacroCode}
\begin{MacroCode}{size-10}
\ProvidesExplFile{skrapport-size10pt.clo}
{2013/04/29}{1.0}{skrapport point size option 10pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\ProvidesExplFile{skrapport-size11pt.clo}
{2013/04/29}{1.0}{skrapport point size option 11pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\ProvidesExplFile{skrapport-size12pt.clo}
{2013/04/29}{1.0}{skrapport point size option 12pt}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\RequirePackage{skrapport-size-common}
\end{MacroCode}
\begin{macro}{\normalsize}
\begin{MacroCode}{size-10,size-11,size-12}
\RenewDocumentCommand\normalsize{}{
\end{MacroCode}
\begin{MacroCode}{size-10}
\__skrapport_set_font_size:nn{10}{12}
\skip_gset:Nn \abovedisplayskip {10pt~plus~2pt~minus~5pt}
\skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt}
\skip_gset:Nn \belowdisplayshortskip {6pt ~plus~3pt~minus~3pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\__skrapport_set_font_size:nn{11}{13.2}
\skip_gset:Nn \abovedisplayskip {11pt ~plus~3pt ~minus~6pt}
\skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt}
\skip_gset:Nn \belowdisplayshortskip {6.5pt~plus~3.5pt~minus~3pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\__skrapport_set_font_size:nn{12}{14.5}
\skip_gset:Nn \abovedisplayskip {12pt ~plus~3pt ~minus~7pt}
\skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt}
\skip_gset:Nn \belowdisplayshortskip {6.5pt~plus~3.5pt~minus~3pt}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\skip_gset_eq:NN\belowdisplayskip \abovedisplayskip
\cs_gset_eq:NN\@listi\@listI
}
\end{MacroCode}
\end{macro}
\begin{MacroCode}{size-10,size-11,size-12}
\normalsize
\end{MacroCode}
\begin{macro}{\small}
\begin{MacroCode}{size-10,size-11,size-12}
\NewDocumentCommand\small{}{
\end{MacroCode}
\begin{MacroCode}{size-10}
\__skrapport_set_font_size:nn{9}{11}
\skip_gset:Nn \abovedisplayskip {8.5pt~plus~3pt~minus~4pt}
\skip_gset:Nn \abovedisplayshortskip {0pt ~plus~2pt}
\skip_gset:Nn \belowdisplayshortskip {4pt ~plus~2pt~minus~2pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\__skrapport_set_font_size:nn{10}{12}
\skip_gset:Nn \abovedisplayskip {10pt~plus~2pt~minus~5pt}
\skip_gset:Nn \abovedisplayshortskip {0pt ~plus~2pt}
\skip_gset:Nn \belowdisplayshortskip {6pt ~plus~3pt~minus~3pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\__skrapport_set_font_size:nn{11}{13.6}
\skip_gset:Nn \abovedisplayskip {11pt ~plus~3pt ~minus~6pt}
\skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt}
\skip_gset:Nn \belowdisplayshortskip {6.5pt~plus~3.5pt~minus~3pt}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\skip_gset_eq:NN\belowdisplayskip \abovedisplayskip
\cs_gset:Npn\@listi{
\dim_gset_eq:NN\leftmargin\leftmargini
\end{MacroCode}
\begin{MacroCode}{size-10}
\skip_gset:Nn\topsep{4pt~plus~2pt~minus~2pt}
\skip_gset:Nn\parsep{2pt~plus~1pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\skip_gset:Nn\topsep{6pt~plus~2pt~minus~2pt}
\skip_gset:Nn\parsep{3pt~plus~2pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\skip_gset:Nn\topsep{ 9pt~plus~3pt~minus~5pt}
\skip_gset:Nn\parsep{4.5pt~plus~2pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\skip_gset_eq:NN\itemsep\parsep
}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\footnotesize}
\begin{MacroCode}{size-10,size-11,size-12}
\NewDocumentCommand\footnotesize{}{
\end{MacroCode}
\begin{MacroCode}{size-10}
\__skrapport_set_font_size:nn{8}{9.5}
\skip_gset:Nn \abovedisplayskip {6pt~plus~2pt~minus~4pt}
\skip_gset:Nn \abovedisplayshortskip {0pt~plus~1pt}
\skip_gset:Nn \belowdisplayshortskip {3pt~plus~1pt~minus~2pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\__skrapport_set_font_size:nn{9}{11}
\skip_gset:Nn \abovedisplayskip {8pt~plus~2pt~minus~4pt}
\skip_gset:Nn \abovedisplayshortskip {0pt~plus~1pt}
\skip_gset:Nn \belowdisplayshortskip {4pt~plus~2pt~minus~2pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\__skrapport_set_font_size:nn{10}{12}
\skip_gset:Nn \abovedisplayskip {10pt~plus~2pt~minus~5pt}
\skip_gset:Nn \abovedisplayshortskip { 0pt~plus~3pt}
\skip_gset:Nn \belowdisplayshortskip { 6pt~plus~3pt~minus~3pt}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\skip_gset_eq:NN\belowdisplayskip \abovedisplayskip
\cs_gset:Npn\@listi{
\dim_gset_eq:NN\leftmargin\leftmargini
\end{MacroCode}
\begin{MacroCode}{size-10}
\skip_gset:Nn\topsep{3pt~plus~1pt~minus~1pt}
\skip_gset:Nn\parsep{2pt~plus~1pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\skip_gset:Nn\topsep{4pt~plus~2pt~minus~2pt}
\skip_gset:Nn\parsep{2pt~plus~1pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\skip_gset:Nn\topsep{6pt~plus~2pt~minus~2pt}
\skip_gset:Nn\parsep{3pt~plus~2pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\skip_gset_eq:NN\itemsep\parsep
}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\scriptsize}
\begin{MacroCode}{size-10,size-11,size-12}
\NewDocumentCommand\scriptsize{}{
\end{MacroCode}
\begin{MacroCode}{size-10}
\__skrapport_set_font_size:nn{7}{8}
\end{MacroCode}
\begin{MacroCode}{size-11,size-12}
\__skrapport_set_font_size:nn{8}{9.5}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\tiny}
\begin{MacroCode}{size-10,size-11,size-12}
\NewDocumentCommand\tiny{}{
\end{MacroCode}
\begin{MacroCode}{size-10}
\__skrapport_set_font_size:nn{5}{6}
\end{MacroCode}
\begin{MacroCode}{size-11,size-12}
\__skrapport_set_font_size:nn{6}{7}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\large}
\begin{MacroCode}{size-10,size-11,size-12}
\NewDocumentCommand\large{}{
\end{MacroCode}
\begin{MacroCode}{size-10,size-11}
\__skrapport_set_font_size:nn{12}{14}
\end{MacroCode}
\begin{MacroCode}{size-12}
\__skrapport_set_font_size:nn{14}{18}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\Large}
\begin{MacroCode}{size-10,size-11,size-12}
\NewDocumentCommand\Large{}{
\end{MacroCode}
\begin{MacroCode}{size-10,size-11}
\__skrapport_set_font_size:nn{14}{18}
\end{MacroCode}
\begin{MacroCode}{size-12}
\__skrapport_set_font_size:nn{17}{22}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\LARGE}
\begin{MacroCode}{size-10,size-11,size-12}
\NewDocumentCommand\LARGE{}{
\end{MacroCode}
\begin{MacroCode}{size-10,size-11}
\__skrapport_set_font_size:nn{17}{22}
\end{MacroCode}
\begin{MacroCode}{size-12}
\__skrapport_set_font_size:nn{20}{25}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\huge}
\begin{MacroCode}{size-10,size-11,size-12}
\NewDocumentCommand\huge{}{
\end{MacroCode}
\begin{MacroCode}{size-10,size-11}
\__skrapport_set_font_size:nn{20}{25}
\end{MacroCode}
\begin{MacroCode}{size-12}
\__skrapport_set_font_size:nn{25}{30}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
}
\end{MacroCode}
\end{macro}
\begin{macro}{\Huge}
\begin{MacroCode}{size-10,size-11,size-12}
\NewDocumentCommand\Huge{}{
\end{MacroCode}
\begin{MacroCode}{size-10,size-11}
\__skrapport_set_font_size:nn{25}{30}
\end{MacroCode}
\begin{MacroCode}{size-12}
\__skrapport_set_font_size:nn{30}{36}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
}
\end{MacroCode}
\end{macro}
\begin{MacroCode}{size-10}
\dim_set:Nn\parindent {15pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\dim_set:Nn\parindent {17pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\dim_set:Nn\parindent {1.5em}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\skip_set:Nn\smallskipamount{ 3pt~plus~1pt~minus~1pt}
\skip_set:Nn\medskipamount { 6pt~plus~2pt~minus~2pt}
\skip_set:Nn\bigskipamount {12pt~plus~4pt~minus~4pt}
\dim_set:Nn\headheight{12pt}
\dim_set:Nn\headsep {25pt}
\dim_set:Nn\topskip {10pt}
\dim_set:Nn\footskip {30pt}
\dim_set:Nn\maxdepth { 5pt}
\end{MacroCode}
These (\emph{i.e.} text width and height) are hopefully overwritten
by \pkg{typearea} later, so we don't bother much with them.
\begin{MacroCode}{size-10,size-11,size-12}
\dim_set:Nn\textwidth {\paperwidth-2cm}
\dim_set:Nn\textheight{\paperheight-2cm}
\dim_set:Nn\oddsidemargin {.2cm}
\dim_set:Nn\evensidemargin {1cm}
\dim_set:Nn\marginparsep {11pt}
\dim_set:Nn\marginparpush {5pt}
\dim_set:Nn\marginparwidth {.8cm-\marginparsep}
\dim_set:Nn\topmargin{\paperheight-1cm
-\headheight-\headsep
-\textheight-\footskip
-.5\topmargin}
\end{MacroCode}
\begin{MacroCode}{size-10}
\dim_set:Nn\footnotesep{6.65pt}
\skip_set:Nn{\skip\footins} { 9pt~plus~4pt~minus~2pt}
\skip_set:Nn\floatsep {12pt~plus~2pt~minus~2pt}
\skip_set:Nn\textfloatsep {20pt~plus~2pt~minus~4pt}
\skip_set:Nn\intextsep {12pt~plus~2pt~minus~2pt}
\skip_set:Nn\dblfloatsep {12pt~plus~2pt~minus~2pt}
\skip_set:Nn\dbltextfloatsep{20pt~plus~2pt~minus~4pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\dim_set:Nn\footnotesep{7.7pt}
\skip_set:Nn{\skip\footins} {10pt~plus~4pt~minus~2pt}
\skip_set:Nn\floatsep {12pt~plus~2pt~minus~2pt}
\skip_set:Nn\textfloatsep {20pt~plus~2pt~minus~4pt}
\skip_set:Nn\intextsep {12pt~plus~2pt~minus~2pt}
\skip_set:Nn\dblfloatsep {12pt~plus~2pt~minus~2pt}
\skip_set:Nn\dbltextfloatsep{20pt~plus~2pt~minus~4pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\dim_set:Nn\footnotesep{8.4pt}
\skip_set:Nn{\skip\footins} {10.8pt~plus~4pt~minus~2pt}
\skip_set:Nn\floatsep {12pt ~plus~2pt~minus~4pt}
\skip_set:Nn\textfloatsep {20pt ~plus~2pt~minus~4pt}
\skip_set:Nn\intextsep {14pt ~plus~4pt~minus~4pt}
\skip_set:Nn\dblfloatsep {14pt ~plus~2pt~minus~4pt}
\skip_set:Nn\dbltextfloatsep{20pt ~plus~2pt~minus~4pt}
\end{MacroCode}
These six have been changed slightly compared to \LaTeXe.
\begin{MacroCode}{size-10,size-11,size-12}
\skip_set:Nn\@fptop{ 5pt}
\end{MacroCode}
\begin{MacroCode}{size-10}
\skip_set:Nn\@fpsep{10pt~plus~2fil}
\end{MacroCode}
\begin{MacroCode}{size-11}
\skip_set:Nn\@fpsep{11pt~plus~2fil}
\end{MacroCode}
\begin{MacroCode}{size-12}
\skip_set:Nn\@fpsep{12pt~plus~2fil}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\skip_set:Nn\@fpbot{ 5pt}
\skip_set:Nn\@dblfptop{ 5pt}
\end{MacroCode}
\begin{MacroCode}{size-10}
\skip_set:Nn\@dblfpsep{10pt~plus~2fil}
\end{MacroCode}
\begin{MacroCode}{size-11}
\skip_set:Nn\@dblfpsep{11pt~plus~2fil}
\end{MacroCode}
\begin{MacroCode}{size-12}
\skip_set:Nn\@dblfpsep{12pt~plus~2fil}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\skip_set:Nn\@dblfpbot{ 5pt}
\end{MacroCode}
\begin{MacroCode}{size-10}
\skip_set:Nn\partopsep{2pt~plus~1pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\skip_set:Nn\partopsep{3pt~plus~1pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\skip_set:Nn\partopsep{3pt~plus~2pt~minus~2pt}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\cs_set:Npn\@listi{
\dim_set_eq:NN\leftmargin\leftmargini
\end{MacroCode}
\begin{MacroCode}{size-10}
\skip_set:Nn\parsep {4pt~plus~2pt~minus~1pt}
\skip_set:Nn\topsep {8pt~plus~2pt~minus~4pt}
\skip_set:Nn\itemsep{4pt~plus~2pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\skip_set:Nn\parsep {4.5pt~plus~2pt~minus~1pt}
\skip_set:Nn\topsep { 9pt~plus~3pt~minus~5pt}
\skip_set:Nn\itemsep{4.5pt~plus~2pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\skip_set:Nn\parsep { 5pt~plus~2.5pt~minus~1pt}
\skip_set:Nn\topsep {10pt~plus~4pt ~minus~6pt}
\skip_set:Nn\itemsep{ 5pt~plus~2.5pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
}
\cs_set_eq:NN\@listI\@listi
\dim_gset_eq:NN\leftmargin\leftmargini
\end{MacroCode}
\begin{MacroCode}{size-10}
\skip_gset:Nn\parsep {4pt~plus~2pt~minus~1pt}
\skip_gset:Nn\topsep {8pt~plus~2pt~minus~4pt}
\skip_gset:Nn\itemsep{4pt~plus~2pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\skip_gset:Nn\parsep {4.5pt~plus~2pt~minus~1pt}
\skip_gset:Nn\topsep { 9pt~plus~3pt~minus~5pt}
\skip_gset:Nn\itemsep{4.5pt~plus~2pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\skip_gset:Nn\parsep { 5pt~plus~2.5pt~minus~1pt}
\skip_gset:Nn\topsep {10pt~plus~4pt ~minus~6pt}
\skip_gset:Nn\itemsep{ 5pt~plus~2.5pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\cs_set:Npn\@listii{
\dim_set_eq:NN\leftmargin\leftmarginii
\dim_set:Nn\labelwidth{\leftmarginii-\labelsep}
\end{MacroCode}
\begin{MacroCode}{size-10}
\skip_set:Nn\parsep {2pt~plus~1pt~minus~1pt}
\skip_set:Nn\topsep {4pt~plus~2pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-11}
\skip_set:Nn\parsep { 2pt~plus~1pt~minus~1pt}
\skip_set:Nn\topsep {4.5pt~plus~2pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\skip_set:Nn\parsep {2.5pt~plus~1pt ~minus~1pt}
\skip_set:Nn\topsep { 5pt~plus~2.5pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\skip_set_eq:NN\itemsep\parsep
}
\cs_set:Npn\@listiii{
\dim_set_eq:NN\leftmargin\leftmarginiii
\dim_set:Nn\labelwidth{\leftmarginiii-\labelsep}
\skip_set_eq:NN\parsep\c_zero_skip
\end{MacroCode}
\begin{MacroCode}{size-10,size-11}
\skip_set:Nn\topsep {2pt~plus~1pt~minus~1pt}
\skip_set:Nn\partopsep{1pt~plus~0pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-12}
\skip_set:Nn\topsep {2.5pt~plus~1pt~minus~1pt}
\skip_set:Nn\partopsep{ 1pt~plus~0pt~minus~1pt}
\end{MacroCode}
\begin{MacroCode}{size-10,size-11,size-12}
\skip_set_eq:NN\itemsep\topsep
}
\cs_set:Npn\@listiv{
\dim_set_eq:NN\leftmargin\leftmarginiv
\dim_set:Nn\labelwidth{\leftmarginiv-\labelsep}
}
\cs_set:Npn\@listv{
\dim_set_eq:NN\leftmargin\leftmarginv
\dim_set:Nn\labelwidth{\leftmarginv-\labelsep}
}
\cs_set:Npn\@listvi{
\dim_set_eq:NN\leftmargin\leftmarginvi
\dim_set:Nn\labelwidth{\leftmarginvi-\labelsep}
}
\endinput
\end{MacroCode}
\Finale
\section{Installation}
The easiest way to install this package is using the package
manager provided by your \LaTeX\ installation if such a program
is available. Failing that, provided you have obtained the package
source (\file{skrapport.tex} and \file{Makefile}) from either CTAN
or Github, running \texttt{make install} inside the source directory
works well. This will extract the documentation and code from
\file{skrapport.tex}, install all files into the TDS tree at
\texttt{TEXMFHOME} and run \texttt{mktexlsr}.
If you want to extract code and documentation without installing
the package, run \texttt{make all} instead. If you insist on not
using \texttt{make}, remember that packages distributed using
\pkg{skdoc} must be extracted using \texttt{pdflatex}, \emph{not}
\texttt{tex} or \texttt{latex}.
\PrintChanges
\PrintIndex
\printbibliography
\end{document}
|