summaryrefslogtreecommitdiff
path: root/obsolete/macros/latex/contrib/koma-script-obsolete/scrpage2-obsolete.dtx
blob: 41be0d4bcec9787ad9dbfabd2f31b3a7feb59b9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
% \CheckSum{2389}
% \iffalse
% ======================================================================
% scrpage2-obsolete.dtx
% Copyright (c) Markus Kohm, 1995-2020
%
% This file is part of the LaTeX2e KOMA-Script bundle.
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, version 1.3c of the license.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX 
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "not maintained"
% and is deprecated!  It has been replaced by KOMA-Script package
% scrlayer-scrpage.
%
% The author of this work is Markus Kohm.
%
% This work consists of the files `scrpage2-obsolete.dtx' und `README'.
% ----------------------------------------------------------------------
% scrpage2-obsolete.dtx
% Copyright (c) Markus Kohm, 1995-2020
%
% Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
% Version 1.3c, verteilt und/oder veraendert werden.
% Die neuste Version dieser Lizenz ist
%   http://www.latex-project.org/lppl.txt
% und Version 1.3c ist Teil aller Verteilungen von LaTeX
% Version 2005/12/01 oder spaeter.
%
% Dieses Werk hat den LPPL-Verwaltungs-Status "not maintained"
% (nicht verwaltet), ist veralter und wurde durch das KOMA-Script-Paket
% scrlayer-scrpage ersetzt.
%
% Der Autor dieses Werkes ist Markus Kohm.
% 
% Dieses Werk besteht aus den Dateien `scrpage2-obsolete.dtx' und
% `README'.
% ======================================================================
% \fi
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \iffalse
%<scrpage2>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
%<*dtx>
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\ProvidesFile{scrpage2-obsolete.dtx}
%</dtx>
%<scrpage2>\ProvidesPackage{scrpage2} 
%<*dtx|scrpage2>
  [2020/02/27 v3.30 unsupported obsolete former KOMA-Script package]
%</dtx|scrpage2>
%<*insfile>
\ifx\documentclass\undefined
  \def\batchfile{scrpage2-obsolete.dtx}
  \input docstrip.tex
  \Msg{*********************************************************************}
  \Msg{*}
  \Msg{* THIS WIL PRODUCE AN OBSOLETE PACKAGE, THAT IS NOT LONGER SUPPORTED}
  \Msg{* OR PART OF KOMA-SCRIPT!!!}
  \Msg{*}
  \Msg{*********************************************************************}
  \ifToplevel{\keepsilent\askforoverwritefalse}
\preamble

Copyright (c) 1995-2020 by Markus Kohm <komascript(at)gmx.info>

This file has been generated.
-----------------------------

This work may be distributed and/or modified under the conditions of
the LaTeX Project Public License, version 1.3c of the license.
The latest version of this license is in
  http://www.latex-project.org/lppl.txt
and version 1.3c or later is part of all distributions of LaTeX
version 2005/12/01 or later and of this work.

This work has the LPPL maintenance status "not maintained".

This file may only be distributed together with the file
`scrpage2-obsolete.dtx'. You may however distribute the file 
`scrpage2-obsolete.dtx' without this file.

An bilingual (English and German) manual may be generated from the
source file `scrpage2-obsolete.dtx' using:
    pdflatex scrpage2-obsolete.dtx

THIS IS AN OBSOLETE PACKAGE! YOU SHOULD USE THE KOMA-SCRIPT PACKAGE
scrlayer-scrpage INSTEAD OF THIS PACKAGE!

\endpreamble
    
  \generate{\usepreamble\defaultpreamble
    \file{scrpage2.sty}{%
      \from{scrpage2-obsolete.dtx}{scrpage2}%
    }%
  }
  \csname fi\endcsname
\else
  \let\endbatchfile\relax
\fi
\endbatchfile
%</insfile>
%<*dtx>
\documentclass{scrdoc}
\usepackage[ngerman,english]{babel}
\newcommand*{\PageStyle}[1]{\texttt{#1}}
\newcommand*{\FontElement}[1]{\texttt{#1}}
\newcommand*{\rarg}[1]{\texttt{\char`\{#1\char`\}}}
\newcommand*{\PrintDescribePageStyle}[1]{%
  \PrintDescribeMacro\pagestyle\unskip\rarg{#1}%
}
\newcommand*{\SpecialPageStyleIndex}[1]{}% Do not index page styles.
\newDescribe{PageStyle}
\newcommand*{\PrintDescribeFontElement}[1]{%
  \PrintDescribeMacro\setkomafont\unskip\rarg{#1}%
}
\newcommand*{\SpecialFontElementIndex}[1]{}% Do not index page styles.
\newDescribe{FontElement}
\newenvironment{Example}{%
  \labeling{Example:}
  \item[Example:]\ignorespaces
}{%
  \endlabeling
}
\newenvironment{XmpTopPage}
{%
   \begin{center}
     \setlength{\unitlength}{1mm}%
     \begin{picture}(100,39)
       \thinlines
       \qbezier(0,5)(25,7)(50,5)\qbezier(50,5)(75,3)(100,5)
       \put(0,5){\line(0,1){34}}
       \thicklines
       \put(100,5){\line(0,1){34}}\put(0,39){\line(1,0){100}}
       \footnotesize
}{%
     \end{picture}%
   \end{center}\vspace{-1.5\baselineskip}%
}
\newenvironment{XmpBotPage}
{%
  \begin{center}
    \setlength{\unitlength}{1mm}%
    \begin{picture}(100,40)%
      \thinlines
      \qbezier(0,38)(25,40)(50,38)\qbezier(50,38)(75,36)(100,38)
      \put(0,5){\line(0,1){33}}
      \thicklines
      \put(100,5){\line(0,1){33}}\put(0,5){\line(1,0){100}}
      \footnotesize
}{%
    \end{picture}%
  \end{center}\vspace{-1.5\baselineskip}%
}
\newcommand{\XmpHeading}[3][\KOMAScript\hfill 3]{%
  \put(#2){\makebox(#3,0)[l]{#1}}}
\newcommand{\XmpSetText}[2][\XmpText]{%
  \put(#2){\makebox(0,0)[tl]{\parbox{70\unitlength}{\parfillskip=0pt 
        #1}}}}
\newcommand{\XmpMarginNote}[1]{%
  \put(#1){\makebox(0,5)[tl]{\scriptsize\XmpMarginTextA}}
  \put(#1){\makebox(0,5)[bl]{\scriptsize\XmpMarginTextB}}}
\newcommand{\XmpRule}[2]{\put(#1){\line(1,0){#2}}}
\newcommand*{\XmpText}[1][50]{\undefined}
\newcommand*{\XmpTopText}{\XmpText[3]}
\newcommand*{\XmpBotText}{\XmpText[2]}
\newcommand*{\XmpMarginTextA}{\undefined}
\newcommand*{\XmpMarginTextB}{\undefined}
\makeatletter
\g@addto@macro\extrasenglish{%
  \renewcommand*{\XmpText}[1][50]{%
    \ifnum #1<51
      This f\/ill text is currently seized by 130 million receptors
      in your retina.
      \ifnum #1>1
        Thereby the nerve cells are put in a state of stimulation,
        which spreads
        \ifnum #1>2
          into the rear part of your brain originating from
          \ifnum #1>3
            the optic nerve.
            From there the stimulation is transmitted in a split second
            also in other parts of your cerebrum.
            Your frontal lobe becomes stimulated.
            Intention-impulses spread from there, which your
            central nervous\setlength{\parfillskip}{0pt}%
      \fi\fi\fi
    \fi
    \ifnum #1>49
      system transforms in actual deeds.
      Head and eyes already react.
      They follow the text, taking the information present there
      and transmit them via the optic nerve.
    \fi
  }%
  \renewcommand*{\XmpMarginTextA}{Retina}%
  \renewcommand*{\XmpMarginTextB}{}%
}
\g@addto@macro\extrasngerman{%
  \renewcommand*{\XmpText}[1][50]{%
    \ifnum #1<51
      Dieser Blindtext wird gerade von 130 Millionen Rezeptoren
      Ihrer Netzhaut erfasst.
      \ifnum #1>1
        Die Zellen werden dadurch in einen Erregungs\char\defaulthyphenchar
        \kern-1pt\linebreak
        \ifnum #1>2
          zustand versetzt, der sich vom Sehnerv in den
          \ifnum #1>3
            hinteren Teil Ihres Gehirns ausbreitet.
            Von dort aus \"ubertr\"agt sich die Erregung in
            Sekundenbruchteilen auch in andere Bereiche Ihres
            Gro\ss hirns.
            Ihr Stirnlappen wird stimuliert.
            Von dort aus gehen jetzt Willens\char\defaulthyphenchar
            \kern-1pt\linebreak
      \fi\fi\fi
    \fi
    \ifnum #1>49
      impulse aus, die Ihr zentrales Nervensystem in konkrete Handlungen
      umsetzt. Kopf und Augen reagieren bereits.
      Sie folgen dem Text, nehmen die darin enthaltenen Informationen
      auf und leiten diese \"uber den Sehnerv weiter.
    \fi
  }%
  \renewcommand*{\XmpMarginTextA}{Netzhaut}%
  \renewcommand*{\XmpMarginTextB}{(\textit{Retina})}%
}
\makeatother
\CodelineIndex
\RecordChanges
\GetFileInfo{scrpage2-obsolete.dtx}
\begin{document}
  \DocInput{\filename}
\end{document}
%</dtx>
% \fi
%
% \changes{2020/02/27}{v3.30}{Final release}
% \changes{2020/02/27}{v3.30}{Manual integrated into \File{dtx}-file}
%
% \addcontentsline{toc}{part}{English}%
% \title{The Obsolete Package \Package{scrpage2}%
%   \thanks{This file has revision number \fileversion, last revised
%   \filedate.}}
% \date{\filedate}
% \author{Markus Kohm}
% \maketitle
% \begin{abstract}
% This is the former \KOMAScript{} package \Package{scrpage2}.
% The package is deprecated and should not be used any longer.
% You can very easily replace it by the \KOMAScript{} package
% \Package{scrlayer-scrpage} that is documented in the English and the
% German \KOMAScript{} guide.
% \end{abstract}
%
% {\csname @fileswfalse\endcsname\tableofcontents}
%
% \section{Adapting Page Headers and Footers with \Package{scrpage2}}
% \label{sec:scrpage2-en}
%
% From \KOMAScript~3.12 the completely newly implemented package
% \Package{scrlayer-scrpage} replaces the old \Package{scrpage2}. The new
% package is a consequently developed extension of the design of
% \Package{scrpage2}. In difference to \Package{scrpage2} it provides the
% extended option interface of the \KOMAScript{} classes. Because
% \Package{scrlayer-scrpage} predominates \Package{scrpage2} it is recommended
% to not longer use \Package{scrpage2} but \Package{scrlayer-scrpage}. Because
% of this the current version of \Package{scrpage2} is the final one. All
% development resources will go into \Package{scrlayer-scrpage}. For more
% information about \Package{scrlayer-scrpage} see the \KOMAScript{} guide.
%
% In place of \Package{scrpage2} or \Package{scrlayer-scrpage} you can of
% course make use of \Package{fancyhdr}. However, \Package{scrpage2} and
% especially \Package{scrlayer-scrpage} integrated markedly better with the
% {\KOMAScript} bundle. For this reason, and because at the time the
% forerunner to \Package{fancyhdr} was missing many features,
% \Package{scrpage2} was developed. Naturally, \Package{scrpage2} and
% \Package{scrlayer-scrpage} are not limited to use only with the
% {\KOMAScript} classes, but can just as easily be used with other document
% classes.
%
% \subsection{Basic Functionality}\label{sec:scrpage2-en.basics}
%
% To understand the following description, an overview of {\LaTeX}'s fairly
% involved header and footer mechanism is needed.  The {\LaTeX} kernel defines
% the page styles \PageStyle{empty}, which produces a completely empty header
% and footer, and \PageStyle{plain}, which produces usually only a page number
% in the footer and an empty header.  Apart from these, many document classes
% provide the style \PageStyle{headings}, which allows more complex style
% settings and running
% headings\index{headings>running}\index{headings>automatic}.  The
% \PageStyle{headings} style often has a related variant,
% \PageStyle{myheadings}, which is similar except for switching off the
% running headings\index{headings>manual} and reverting them to manual control
% by the user.  A more detailed description is given in the page style section
% of the \KOMAScript{} manual where it is also noted that some {\LaTeX}
% commands automatically switch to another page style\,---\,usually page style
% \PageStyle{plain}\,---\,for the current page.
%
% Package \Package{scrpage2} does not distinguish between page styles with
% automatic, running headings and page styles with manual headings. The way to
% deal with automatic and manual headings is independent from the page style
% and so the page style is independent from the choice of automatic or manual
% headings. More information about this in
% section~\ref{sec:scrpage2-en.basics.mark}.
%
% \subsubsection{Predefined Page Styles}\label{sec:scrpage2-en.basics.buildIn}
%
% One of the basic features of \Package{scrpage2} is a set of predefined,
% configurable page styles.
%
% \bigskip\noindent%
% \DescribePageStyle{scrheadings}%
% \DescribePageStyle{scrplain}%
% Package \Package{scrpage2} delivers its own page style, named
% \PageStyle{scrheadings}, which can be activated with the
% \Macro{pagestyle}\rarg{scrheadings}. When this page style is in use, an
% appropriate \PageStyle{scrplain} page style is used for the plain page
% style.  In this case \emph{appropriate} means that this new plain page style
% is also configureable by the commands introduced in
% section~\ref{sec:scrpage2-en.basics.format}, which, for example, configure
% the header and footer width and complies within the basic layout. Neither
% the activation of \PageStyle{scrheadings} nor the attendant change to the
% appropriate plain page style, \PageStyle{scrplain}, influences the mode of
% manual or automatic
% headings\index{headings>automatic}\index{headings>manual} (see
% section~\ref{sec:scrpage2-en.basics.mark}). The \PageStyle{scrplain} page
% style can also be activated directly with \Macro{pagestyle}.
%
% \bigskip\noindent%
% \DescribeMacro\lehead%
% \DescribeMacro\cehead%
% \DescribeMacro\rehead%
% \DescribeMacro\lefoot%
% \DescribeMacro\cefoot%
% \DescribeMacro\refoot%
% \DescribeMacro\lohead%
% \DescribeMacro\cohead%
% \DescribeMacro\rohead%
% \DescribeMacro\lofoot%
% \DescribeMacro\cofoot%
% \DescribeMacro\rofoot%
% \DescribeMacro\ihead%
% \DescribeMacro\chead%
% \DescribeMacro\ohead%
% \DescribeMacro\ifoot%
% \DescribeMacro\cfoot%
% \DescribeMacro\ofoot%
% The page style of \Package{scrpage2} are defined to have flexible
% configurable header and footer. To achieve this, the page styles include
% three boxes in both the header and the footer. The contents of these boxes
% may be modified easily. The commands modifying the content of these boxes
% can be seen in figure~\ref{fig:scrpage2-en.leheadetall}.  Commands in the
% middle column modify the box contents on both odd and even pages. All of the
% commands have an optional and a mandatory argument. The option argument
% influences the content of corresponding box of the plain page style,
% \PageStyle{scrplain}. The mandatory argument influences the content of the
% corresponding box of the page style \PageStyle{scrheadings}.
% \begin{figure}
%   \centering
%   \setlength{\unitlength}{1.2mm}
%   \begin{picture}(100,65)(0,8)\small
%     \put(0,12){\dashbox{2}(40,56){even page}}
%     \put(60,12){\dashbox{2}(40,56){odd page}}
%^^A                                 % items top left
%     \put(1,63){\framebox(8,4){~}}
%     \put(16,63){\framebox(8,4){~}}
%     \put(31,63){\framebox(8,4){~}}
%^^A                                 % items top right
%     \put(61,63){\framebox(8,4){~}}
%     \put(76,63){\framebox(8,4){~}}
%     \put(91,63){\framebox(8,4){~}}
%^^A                                 % items bottom left
%     \put(1,13){\framebox(8,4){~}}
%     \put(16,13){\framebox(8,4){~}}
%     \put(31,13){\framebox(8,4){~}}
%^^A                                 % items bottom right
%     \put(61,13){\framebox(8,4){~}}
%     \put(76,13){\framebox(8,4){~}}
%     \put(91,13){\framebox(8,4){~}}
%^^A                                 % commands and arrow
%^^A                                 % for twoside
%^^A                                 % 
%     \put(50,65){\makebox(0,0){\cs{ihead}}}
%     \put(44,65){\vector(-1,0){4}}\put(56,65){\vector(1,0){4}}
%     \put(50,58){\makebox(0,0){\cs{chead}}}
%     \put(44,58){\line(-1,0){24}}\put(56,58){\line(1,0){24}}
%     \put(20,58){\vector(0,1){4}}\put(80,58){\vector(0,1){4}}
%     \put(50,51){\makebox(0,0){\cs{ohead}}}
%     \put(44,51){\line(-1,0){40}}\put(56,51){\line(1,0){40}}
%     \put(4,51){\vector(0,1){11}}\put(96,51){\vector(0,1){11}}
%^^A                                 %
%     \put(50,15){\makebox(0,0){\cs{ifoot}}}
%     \put(56,15){\vector(1,0){4}}\put(44,15){\vector(-1,0){4}}
%     \put(50,22){\makebox(0,0){\cs{cfoot}}}
%     \put(44,22){\line(-1,0){24}}\put(56,22){\line(1,0){24}}
%     \put(20,22){\vector(0,-1){4}}\put(80,22){\vector(0,-1){4}}
%     \put(50,29){\makebox(0,0){\cs{ofoot}}}
%     \put(44,29){\line(-1,0){40}}\put(56,29){\line(1,0){40}}
%     \put(4,29){\vector(0,-1){11}}\put(96,29){\vector(0,-1){11}}
%^^A                                 % commands for oneside
%     \put(5,69){\makebox(0,0)[b]{\cs{lehead}}}
%     \put(20,69){\makebox(0,0)[b]{\cs{cehead}}}
%     \put(35,69){\makebox(0,0)[b]{\cs{rehead}}}
%^^A                                 %
%     \put(65,69){\makebox(0,0)[b]{\cs{lohead}}}
%     \put(80,69){\makebox(0,0)[b]{\cs{cohead}}}
%     \put(95,69){\makebox(0,0)[b]{\cs{rohead}}}
%^^A                                 %
%     \put(5,11){\makebox(0,0)[t]{\cs{lefoot}}}
%     \put(20,11){\makebox(0,0)[t]{\cs{cefoot}}}
%     \put(35,11){\makebox(0,0)[t]{\cs{refoot}}}
%^^A                                 %
%     \put(65,11){\makebox(0,0)[t]{\cs{lofoot}}}
%     \put(80,11){\makebox(0,0)[t]{\cs{cofoot}}}
%     \put(95,11){\makebox(0,0)[t]{\cs{rofoot}}}
%   \end{picture}
%   \caption{Commands for modification of page styles \PageStyle{scrheadings}
%     and \PageStyle{scrplain} and their relationship to header and footer
%     elements}
%   \label{fig:scrpage2-en.leheadetall}
% \end{figure}
%
% \begin{Example}
%   If one wants the page number within \PageStyle{scrheadings} be placed in the
%   middle of the footer, then following can be used:
% \begin{verbatim}
%   \cfoot{\pagemark}
% \end{verbatim}\vspace{-\baselineskip}
%   The next example shows how to place both running heading and page
%   number\index{page>number}\index{pagination} in the header; the running
%   heading\index{headings} inside and the page number outside:
% \begin{verbatim}
%   \ohead{\pagemark}
%   \ihead{\headmark}
%   \cfoot{}
% \end{verbatim}\vspace{-\baselineskip}
%   The command |\cfoot{}| is only required in order to empty the item in the
%   middle of the footer, which normally contains the page number.
% \end{Example}
%
% The commands which are associated with only one item can be used for
% more advanced settings.
%
% \begin{Example}
%   Assuming one has the order to write an annual report of a company, one could
%   use commands like this:
% \begin{verbatim}
%   \ohead{\pagemark}
%   \rehead{Annual Report 2001}
%   \lohead{\headmark}
%   \cefoot{TheCompanyName Inc.}
%   \cofoot{Department: Development}
% \end{verbatim}\vspace{-\baselineskip}
%   In order to keep the data in the footer synchronized with the content
%   of the document, the footer has to be updated using \Macro{cofoot}
%   when a new department is discussed in the report.
% \end{Example}
%
% As mentioned above, there is a new plain page style which corresponds to
% \PageStyle{scrheadings}. Since it should also be possible to customize this
% style, the commands support an optional argument with which the contents of
% the appropriate fields of this plain page style can be modified.
%
% \begin{Example}
%   The position of the page number for the page style \PageStyle{scrheadings}
%   can be declared as follows:
% \begin{verbatim}
%   \cfoot[\pagemark]{}
%   \ohead[]{\pagemark}
% \end{verbatim}\vspace{-\baselineskip}
%   When the command \Macro{chapter}, after it has started a new page, now
%   switches to the page style \PageStyle{plain}, then the page number is
%   centered in the footer.
% \end{Example}
%
% \bigskip\noindent
% \DescribeMacro\clearscrheadings
% \DescribeMacro\clearscrplain
% \DescribeMacro\clearscrheadfoot
% If one wants to redefine both the page style \PageStyle{scrheadings} and
% the corresponding plain page style, frequently one must empty
% some already occupied page elements. Since one rarely fills all items
% with new content, in most cases several instructions with empty
% parameters are necessary.  With the help of these three instructions
% the quick and thorough deletion is possible.  While
% \Macro{clearscrheadings} only deletes all fields of the page style
% \PageStyle{scrheadings}, and \Macro{clearscrplain} deletes all fields of
% the corresponding plain page style, \Macro{clearscrheadfoot}
% sets all fields of both page styles to empty.
% \begin{Example}
%   If one wants to reset the page style to the default {\KOMAScript}
%   settings, independent of the actual configuration, only these three
%   commands are sufficient:
% \begin{verbatim}
%   \clearscrheadfoot
%   \ohead{\headmark}
%   \ofoot[\pagemark]{\pagemark}
% \end{verbatim}\vspace{-\baselineskip}
%   Without the commands \Macro{clearscrheadfoot},
%   \Macro{clearscrheadings} and \Macro{clearscrplain}, six commands with
%   additional nine empty arguments would be required:
% \begin{verbatim}
%   \ihead[]{}
%   \chead[]{}
%   \ohead[]{\headmark}
%   \ifoot[]{}
%   \cfoot[]{}
%   \ofoot[\pagemark]{\pagemark}
% \end{verbatim}\vspace{-\baselineskip}
%   Of course, for a specific configuration, some of them could be
%   dropped.%
% \end{Example}%
%
% In the previous examples two commands were used which have not been
% introduced yet. The description of these commands follows.
%
% \bigskip\noindent
% \DescribeMacro\leftmark%
% \DescribeMacro\rightmark%
% These two instructions make it possible to access the running headings, which
% are normally meant for the left or for the right page. These two instruction
% are not made available by \Package{scrpage2}, but directly by the {\LaTeX}
% kernel. When in this section running headings of the left page or the right
% page are mentioned, this refers to the contents of \Macro{leftmark} or
% \Macro{rightmark}, respectively.
%
% \bigskip\noindent%
% \DescribeMacro\headmark%
% This command gives access to the content of running headings.  In
% contrast to \Macro{leftmark} and \Macro{rightmark}, one need not
% regard the proper assignment to left or right page.%
%
% \bigskip\noindent%
% \DescribeMacro\pagemark%
% This command returns the formatted page number. The formatting can be
% controlled by \Macro{pnumfont}, introduced in
% section~\ref{sec:scrpage2-en.basics.format}, which \Macro{pagemark} heeds
% automatically.
% 
% \bigskip\noindent%
% \DescribePageStyle{useheadings}%
% The package \Package{scrpage2} is meant primarily for use of the supplied
% styles or for defining one's own styles. However, it may be necessary to
% shift back also to a style provided by the document class.  It might appear
% that this should be done with |\pagestyle{headings}|, but this has the
% disadvantage that commands \Macro{automark} and \Macro{manualmark}, to be
% discussed shortly, do not function as expected.  For this reason one should
% shift back to the original styles using |\pagestyle{useheadings}|, which
% chooses the correct page styles automatically for both manual and automatic
% running headings.
%
% \subsubsection{Manual and Running Headings}
% \label{sec:scrpage2-en.basics.mark}
%
% Usually there is a \emph{my}-version of the \PageStyle{headings}
% page style.  If such a page style is active, then the running headings
% are no longer updated no longer automatically and become manual
% headings.  With \Package{scrpage2} a different path is taken. Whether
% the headings are running or manual is determined by the instructions
% \Macro{automark} and \Macro{manualmark}, respectively.  The default
% can be set already while loading of the package, with the options
% \Option{automark} and \Option{manualmark} (see
% section~\ref{sec:scrpage2-en.basics.options}).
%
% \bigskip\noindent%
% \DescribeMacro\manualmark%
% As the name suggests, \Macro{manualmark} switches off the updating of
% the running headings and makes them manual. It is left to the user to
% update and provide contents for the headings.  For that purpose the
% instructions \Macro{markboth} and \Macro{markright} are available.
%
% \bigskip\noindent%
% \DescribeMacro\automark%
% The macro \Macro{automark}\oarg{right page}\marg{left page} activates the
% automatic updating, that is, running headings.  For the two parameters the
% designations of the document sectioning level whose title is to appear in
% appropriate place are to be used.  Valid values for the parameters are:
% \texttt{part}, \texttt{chapter},
% \texttt{section}, \texttt{subsection}, \texttt{subsubsection},
% \texttt{paragraph}, and \texttt{subparagraph}.  For most of the classes use
% of \texttt{part} will not produce the expected result. So far only
% {\KOMAScript} classes from version~2.9s up are known to support this
% value. The optional argument \meta{right page} is understandably meant only
% for double-sided documents. In the single-sided case one should normally not
% use it.  With the help of the option
% \Option{autooneside}
% one can also set that the optional argument in single-sided mode is ignored
% automatically (see section~\ref{sec:scrpage2-en.basics.options}).
%
% \begin{Example}
%   Assuming that the document uses a \emph{book} class, whose topmost
%   section level is \emph{chapter}, then after a preceding
%   \Macro{manualmark}
% \begin{verbatim}
%   \automark[section]{chapter}
% \end{verbatim}\vspace{-\baselineskip}
%   restores the original behaviour.  If one prefers lower section levels
%   in running headings, the following can be used:
% \begin{verbatim}
%   \automark[subsection]{section}
% \end{verbatim}
% \end{Example}\vspace{-\baselineskip}
%
% For the upper section level, the data of the headings is set by the command
% \Macro{markboth}, while that for the lower section level by
% \Macro{markright} or \Macro{markleft}.  These commands are called indirectly
% by the sectioning commands.  The macro \Macro{markleft} is provided by the
% package \Package{scrpage2} and is defined similarly to \Macro{markright} in
% the {\LaTeX} kernel.  Although \Macro{markleft} is not defined as an
% internal command, the direct use is not recommended.
%
% \subsubsection{Formatting of Header and Footer}
% \label{sec:scrpage2-en.basics.format}
% The previous section concerned itself mainly with the contents of the
% header and footer. This is of course not sufficient to satisfy
% formative ambitions. Therefore we devote this section exclusively to
% this topic.
%
% \bigskip\noindent%
% \DescribeMacro\headfont%
% \DescribeMacro\footfont%
% \DescribeMacro\pnumfont%
% The command \Macro{headfont} contains the commands which determine the font of
% header and footer lines.  Command \Macro{footfont} contains the difference of
% the footer to that. The difference for the style of the page number is defined
% by the command \Macro{pnumfont}.
% \begin{Example}
%   If, for example, one wants the header to be typeset in bold sans serif, the
%   footer in non-bold sans serif, and the page number in a slanted serif style,
%   then one can use the following definitions:
% \begin{verbatim}
%   \renewcommand{\headfont}{\normalfont\sffamily\bfseries}
%   \renewcommand*{\footfont}{\normalfont\sffamily}
%   \renewcommand{\pnumfont}{\normalfont\rmfamily\slshape}
% \end{verbatim}
% \end{Example}\vspace{-\baselineskip}
%
% \DescribeFontElement{pagehead}%
% \DescribeFontElement{pagefoot}%
% \DescribeFontElement{pagenumber}%
% From version 2.8p of the {\KOMAScript} classes a new unified user interface
% scheme is implemented for font attributes. If \Package{scrpage2} is used
% together with one of these classes, then it is recommended to set up font
% attributes in the manner described in the \KOMAScript{} manual.
%
% Instead of \Macro{renewcommand} the command \Macro{setkomafont}
% should be used to configure the font attributes. The previous
% definitions can then be written as:
% \begin{verbatim}
%   \setkomafont{pagehead}\normalfont\sffamily\bfseries}
%   \setkomafont{pagefoot}{\normalfont\sffamily}
%   \setkomafont{pagenumber}{\normalfont\rmfamily\slshape}
% \end{verbatim}\vspace{-\baselineskip}
%
% \bigskip\noindent%
% \DescribeMacro\setheadwidth%
% \DescribeMacro\setfootwidth%
% Normally the widths of header and footer lines correspond to the width of the
% text body.  The commands
% \Macro{setheadwidth}\oarg{shift}\marg{width} and
% \Macro{setfootwidth}\oarg{shift}\marg{width} enable the user to
% adapt in a simple manner the widths to his needs.  The mandatory argument
% \meta{width} takes the value of the desired width of the page header or
% footer, while \meta{shift} is a length parameter by which amount the
% appropriate item is shifted toward the outside page edge.
%
% For the most common situations the mandatory argument \meta{width}
% accepts the following symbolic values:
% \begin{labeling}[\,--]{\texttt{textwithmarginpar}}
% \item[\texttt{paper}] the width of the paper
% \item[\texttt{page}] the width of the page
% \item[\texttt{text}] the width of the text body
% \item[\texttt{textwithmarginpar}] the width of the text body including margin
% \item[\texttt{head}] the current header width
% \item[\texttt{foot}] the current footer width
% \end{labeling}
% The difference between \texttt{paper} and \texttt{page} is that \texttt{page}
% means the width of the paper less the binding correction if the package
% \Package{typearea} is used (see the chapter about
% \Package{typearea} in the \KOMAScript{} manual). Without \Package{typearea}
% both values are identical.
%
% \begin{Example}
%   Assume that one wants a layout like that of \emph{The
%   {\LaTeX}\,Companion}, where the header projects into the margin. This can
%   be obtained with:
% \begin{verbatim}
%   \setheadwidth[0pt]{textwithmarginpar}
% \end{verbatim}\vspace{-\baselineskip}
%   which appears like this on an odd page:
%   \begin{XmpTopPage}
%     \XmpHeading{10,25}{85}
%     \thinlines\XmpRule{10,23}{85}
%     \XmpSetText[\XmpTopText]{10,21}
%     \XmpMarginNote{83,11.8}
%   \end{XmpTopPage}
%   If the footer line should have the same width and alignment, then two
%   ways to set this up are possible. The first way simply repeats the
%   settings for the case of the footer line:
% \begin{verbatim}
%   \setfootwidth[0pt]{textwithmarginpar}
% \end{verbatim}\vspace{-\baselineskip}
%   In the second way the symbolic value \texttt{head} is used, since the
%   header already has the desired settings.
% \begin{verbatim}
%   \setfootwidth[0pt]{head}
% \end{verbatim}
% \end{Example}\vspace{-\baselineskip}
%
% If no \meta{shift} is indicated, i.\,e., without the optional argument,
% then the header or footer appears arranged symmetrically on the page.
% In other words, a value for the \meta{shift} is determined
% automatically to correspond to the current page shape.
% \begin{Example}
%   Continuing with the previous example, we remove the optional
%   argument:
% \begin{verbatim}
%   \setheadwidth{textwithmarginpar}
% \end{verbatim}\vspace{-\baselineskip}
%   which appears like this on an odd page:
%   \begin{XmpTopPage}
%     \XmpHeading{5,25}{85}
%     \thinlines\XmpRule{5,23}{85}
%     \XmpSetText[\XmpTopText]{10,21}
%     \XmpMarginNote{83,11.8}
%   \end{XmpTopPage}
% \end{Example}
%
% As can be seen, the header is now shifted inward, while the header
% width has not changed. The shift is calculated in a way that the
% configuration of the typearea become visible also here.
%
% \bigskip\noindent%
% \DescribeMacro\setheadtopline%
% \DescribeMacro\setheadsepline%
% \DescribeMacro\setfootsepline%
% \DescribeMacro\setfootbotline%
% Corresponding to the size configuration parameters of header and footer
% there are commands to modify the rules above and below the header and
% footer. But first of all the rules should be activated. See options
% \Option{headtopline}, \Option{headsepline}, \Option{footsepline}, and
% \Option{footbotline} in section~\ref{sec:scrpage2-en.basics.options}
% for this.
%
% \begin{labeling}[\,--]
% {\Macro{setfootsepline}\oarg{length}\mark{thickness}\oarg{commands}}
% \item[\Macro{setheadtopline}\oarg{length}\mark{thickness}\oarg{commands}]
%   configures the line above the header
% \item[\Macro{setheadsepline}\oarg{length}\mark{thickness}\oarg{commands}]
%   configures the line below the header
% \item[\Macro{setfootsepline}\oarg{length}\mark{thickness}\oarg{commands}]
%   configures the line above the footer
% \item[\Macro{setfootbotline}\oarg{length}\mark{thickness}\oarg{commands}]
%   configures the line below the footer
% \end{labeling}
%
% The mandatory argument \meta{thickness} determines how strongly the
% line is drawn. The optional argument \meta{length} accepts the same
% symbolic values as \meta{width} for \Macro{setheadwidth}, as well as
% also a normal length expression.  As long as the optional argument
% \meta{length} is not assigned a value, the appropriate line length
% adapts automatically the width of the header or the footer.
%
% Use \texttt{auto} in the length argument to restore this automation
% for the length of a line.
%
% \DescribeFontElement{headtopline}%
% \DescribeFontElement{headsepline}%
% \DescribeFontElement{footsepline}%
% \DescribeFontElement{footbotline}%
% \DescribeFontElement{footbottomline}%
% The optional argument \meta{commands} may
% be used to specify additional commands to be executed before the respective
% line is drawn.  For example, such commands could be used for changing the
% color\index{header>color}\index{footer>color}%
% \index{head>color}\index{foot>color}%
% \index{color>in header}\index{color>in footer} of the line.  When using a
% {\KOMAScript} class you could also use
% \Macro{setkomafont} to specify commands for one of the
% elements \FontElement{headtopline}, \FontElement{headsepline},
% \FontElement{footsepline}, \FontElement{footbottomline}, or
% \FontElement{footbotline}.  These can then be extended via
% \Macro{addtokomafont}.  See the \KOMAScript{} manual
% for details on the \Macro{setkomafont} and \Macro{addtokomafont} commands.
%
% \begin{sloppypar}
% You may also use symbolic values for \meta{length} and \meta{thickness},
% e.g., |\setheadtopline[auto]{current}|, |\setheadtopline[auto]{}|, or
% |\setheadtopline[auto]{}{}|.  The arguments shown here for the command
% \Macro{setheadtopline} are of course valid for the other three configuration
% commands too.
% \end{sloppypar}
%
% If the mandatory parameter \meta{thickness} has the value \texttt{current}
% or has been left empty, then the line thickness is not changed.  This may be
% used to modify the length of the line without changing its thickness.
%
% If the optional argument \meta{commands} is omitted, then all command
% settings that might have been specified before will remain active,
% while an empty \meta{commands} argument will revoke any previously
% valid commands.
%
% \begin{Example}
%   If the header, for example, is to be contrasted by a strong line of
%   2\,pt above and a normal line of 0.4\,pt between header and body,
%   one can achieve this with:
% \begin{verbatim}
%   \setheadtopline{2pt}
%   \setheadsepline{.4pt}
% \end{verbatim}\vspace{-\baselineskip}
%   Additionally the options \Option{headtopline} and \Option{headsepline}
%   have to be used preferably globally in the optional argument of
%   \Macro{documentclass}. In this case the result may be the following.
% \begin{XmpTopPage}
%         \XmpHeading{10,25}{70}
%         \thinlines\XmpRule{10,23}{70}
%         \thicklines\XmpRule{10,28}{70}
%         \XmpSetText[\XmpTopText]{10,21}
%         \XmpMarginNote{83,11.8}
% \end{XmpTopPage}
%
%   To specify that this line is to be drawn also, e.\,g., in red color, you 
%   would change the commands like this:
% \begin{verbatim}
%   \setheadtopline{2pt}[\color{red}]
%   \setheadsepline{.4pt}[\color{red}]
% \end{verbatim}\vspace{-\baselineskip}
%   In this example, as well as in the following one, line color is activated
%   by applying the syntax of the \Package{color} package, so this package
%   must of course be loaded. Since \Package{scrpage2} comes without built-in
%   color handling, any package providing color support may be used.
%
%   {\KOMAScript} classes also support the following way of color
%   specification:
% \begin{verbatim}
%   \setheadtopline{2pt}
%   \setheadsepline{.4pt}
%   \setkomafont{headtopline}[\color{red}]
%   \setkomafont{headsepline}[\color{red}]
% \end{verbatim}\vspace{-\baselineskip}
%
%   The automatic adjustment to the header and footer width is illustrated
%   in the following example:
% \begin{verbatim}
%   \setfootbotline{2pt}
%   \setfootsepline[text]{.4pt}
%   \setfootwidth[0pt]{textwithmarginpar}
% \end{verbatim}\vspace{-\baselineskip}
%
%   \csname phantomsection\endcsname\label{page:scrpage2-en.autoLineLength}
%   \begin{XmpBotPage}
%     \XmpHeading{10,18}{85}
%     \thinlines\XmpRule{17,21}{70}
%     \thicklines\XmpRule{10,16}{85}
%     \XmpSetText[\XmpBotText]{10,33}
%     \XmpMarginNote{83,24}
%   \end{XmpBotPage}
% \end{Example}
%
% Now not everyone will like the alignment of the line above the footer;
% instead, one would expect the line to be left-aligned. This can only
% be achieved with a global package option, which will be described
% together with other package options in the next
% section~\ref{sec:scrpage2-en.basics.options}.%
%
% \subsubsection{Package Options}
% \label{sec:scrpage2-en.basics.options}
%
% In opposite to the \KOMAScript{} classes, where the most options may be
% changed using \Macro{KOMAoptions} or \Macro{KOMAoption} also after loading
% the class, package \Package{scrpage2} does not provide this feature. All
% options to \Package{scrpage2} have to be global options, i.\,e. be part of
% the optional argument of \Macro{documentclass}, or package option, i.\,e. be
% part of the optional argument of \Macro{usepackage}.
%
% \bigskip\noindent%
% \DescribeOption{headinclude}%
% \DescribeOption{headexclude}%
% \DescribeOption{footinclude}%
% \DescribeOption{footexclude}%
% Since version~2.3 of the package this options should not be passed to
% \Package{scrpage2} any longer using \Macro{PassOptionsToPackage} or the
% optional argument of \Macro{usepackage}. Only for compatibility reason
% \Package{scrpage2} still declares them and pass them as
% \Option{headinclude}, \Option{headinclude=false}, \Option{footinclude}, and
% \Option{footinclude=false} to package \Package{typearea}.
%
% \bigskip\noindent%
% \DescribeOption{headtopline}%
% \DescribeOption{plainheadtopline}%
% \DescribeOption{headsepline}%
% \DescribeOption{plainheadsepline}%
% \DescribeOption{footsepline}%
% \DescribeOption{plainfootsepline}%
% \DescribeOption{footbotline}%
% \DescribeOption{plainfootbotline}%
% Basic adjustment of the lines under and over header and footer can be made
% with these options.  These adjustments are then considered the default for
% all page styles defined with \Package{scrpage2}.  If one of these options is
% used, then a line thickness 0.4\,pt is set.  Since there is a corresponding
% plain page style to the page style \PageStyle{scrheadings}, the
% corresponding line in the plain style can also be configured with the
% \Option{plain\dots} options.  These \Option{plain} options do however work
% only if the corresponding options without \Option{plain} are activated.
% Thus, \Option{plainheadtopline} shows no effect without the
% \Option{headtopline} option set.
%
% With these options, it is to be noted that the appropriate page part, header
% or footer, is considered as a part of the text area for the calculation of
% the type area in case a line has been activated.  This means that, if the
% separation line between header and text is activated with
% \Option{headsepline}, then the package \Package{typearea} calculates the
% type area in such a way that the page header is part of the text block
% automatically.
%
% The conditions for the options of the preceding paragraph apply also to this
% automation. That means that the package \Package{typearea} must be loaded
% after \Package{scrpage2}, or that on use of a {\KOMAScript} class, the
% options \Option{headinclude} and \Option{footinclude} must be set explicitly
% with \Macro{documentclass} in order to transfer header or footer line in the
% text area.
%
% \bigskip\noindent%
% \DescribeOption{ilines}%
% \DescribeOption{clines}%
% \DescribeOption{olines}%
% With\index{rule>alignment}\index{line>alignment} the definition of the line
% lengths the case can arise where the lengths are set correctly, but the
% justification is not as desired because the line will be centered in the
% header or footer area.  With the package options presented here, this
% specification can be modified for all page styles defined with
% \Package{scrpage2}.  The option \Option{ilines} sets the justification in
% such a way that the lines align to the inside edge.  The option
% \Option{clines} behaves like the default justification, and \Option{olines}
% aligns at the outside edge.
%
% \begin{Example}
%   The next example illustrates the influence of the
%   option \Option{ilines}. Please compare to the example for
%   \Macro{setfootsepline} on page~\pageref{page:scrpage2-en.autoLineLength}.
% \begin{verbatim}
%   \usepackage[ilines]{scrpage2}
%   \setfootbotline{2pt}  
%   \setfootsepline[text]{.4pt}
%   \setfootwidth[0pt]{textwithmarginpar}
% \end{verbatim}\vspace{-\baselineskip}
%   The mere use of the option \Option{ilines} leads to the different
%   result shown below:
% \begin{XmpBotPage}
%         \XmpHeading{10,18}{85}
%         \thinlines\XmpRule{10,21}{70}
%         \thicklines\XmpRule{10,16}{85}
%         \XmpSetText[\XmpBotText]{10,33}
%         \XmpMarginNote{83,24}
% \end{XmpBotPage}
%   In contrast to the default configuration, the separation line between
%   text and footer is now left-aligned, not centered.
% \end{Example}
%
% \bigskip\noindent%
% \DescribeOption{automark}%
% \DescribeOption{manualmark}%
% These options set at the beginning of the document whether to use running
% headings or manual ones.  The option \Option{automark} switches the automatic
% updating on, \Option{manualmark} deactivates it.  Without the use of one of
% the two options, the setting which was valid when the package was loaded is
% preserved.
% \begin{Example}
%   You load the package \Package{scrpage2} directly after the document class
%   \Class{scrreprt} without any package options:
% \begin{verbatim}
%   \documentclass{scrreprt}
%   \usepackage{scrpage2}
% \end{verbatim}\vspace{-\baselineskip}
%   Since the default page style of \Class{scrreprt} is \PageStyle{plain},
%   this page style is also now still active.  Futhermore, \PageStyle{plain}
%   means manual headings.  If one now activates the page style
%   \PageStyle{scrheadings} with
% \begin{verbatim}
%   \pagestyle{scrheadings}
% \end{verbatim}\vspace{-\baselineskip}
%   then the manual headings are nevertheless still active.
%
%   If you instead use the document class \Class{scrbook}, then after
% \begin{verbatim}
%   \documentclass{scrbook}
%   \usepackage{scrpage2}
% \end{verbatim}\vspace{-\baselineskip}
%   the page style \PageStyle{headings} is active and the running headings are
%   updated automatically.  Switching to the page style
%   \PageStyle{scrheadings} keeps this setting active.  The marking commands
%   of \Class{scrbook} continue to be used.
%
%   However, the use of
% \begin{verbatim}
%   \usepackage[automark]{scrpage2}
% \end{verbatim}\vspace{-\baselineskip}
%   activates running headings independently of the used document class.  The
%   option does not of course affect the used page style \PageStyle{plain} of
%   the class \Class{scrreprt}. The headings are not visible until the page
%   style is changed to \PageStyle{scrheadings}, \PageStyle{useheadings} or
%   another user-defined page style with headings.%
% \end{Example}
%
% \bigskip\noindent%
% \DescribeOption{autooneside}%
% This option ensures that the optional parameter of \Macro{automark} will be
% ignored automatically in one-sided mode. See also the explanation of the
% command \Macro{automark} in section~\ref{sec:scrpage2-en.basics.mark}.
%
% \bigskip\noindent%
% \DescribeOption{komastyle}%
% \DescribeOption{standardstyle}%
% These options determine the look of the predefined page styles
% \PageStyle{scrheadings} and \PageStyle{scrplain}. The option
% \Option{komastyle} configures a look like that of the {\KOMAScript} classes.
% This is the default for {\KOMAScript} classes and can in this way also be
% set for other classes.
%
% The option \Option{standardstyle} configures a page style as it is
% expected by the standard classes. Furthermore, the option
% \Option{markuppercase} will be activated automatically, but only if
% option \Option{markusedcase} is not given.
%
% \bigskip\noindent%
% \DescribeOption{markuppercase}%
% \DescribeOption{markusedcase}%
% In order to achieve the functionality of \Macro{automark}, the package
% \Package{scrpage2} modifies internal commands which are used by the document
% structuring commands to set the running headings.  Since some classes, in
% contrast to the {\KOMAScript} classes, write the headings in uppercase
% letters, \Package{scrpage2} has to know how the used document class sets the
% headings.
%
% Option \Option{markuppercase} shows \Package{scrpage2} that the document
% class uses uppercase letters.  If the document class does not set the
% headings in uppercase letters, then the option \Option{markusedcase} should
% be given.  These options are not suitable to force a representation; thus,
% unexpected effects may occur if the given option does not match the actual
% behaviour of the document class.%
%
% \bigskip\noindent%
% \DescribeOption{nouppercase}%
% In the previous paragraph dealing with \Option{markuppercase} and
% \Option{markusedcase}, it has been already stated that some document classes
% set the running headings\index{heading} in uppercase letters using the
% commands \Macro{MakeUppercase} or \Macro{uppercase}.  Setting the option
% \Option{nouppercase} allows disabling both these commands in the headers and
% footers.  However, this is valid only for page styles defined by
% \Package{scrpage2}, including \PageStyle{scrheadings} and its corresponding
% plain page style.
%
% The applied method is very brutal and can cause that desired changes
% of normal letters to uppercase letters \index{uppercase letters} do
% not occur.  Since these cases do not occur frequently, the option
% \Option{nouppercase} usually affords a useful solution.
% \begin{Example}
%   Your document uses the standard class \Class{book},
%   but you do not want the uppercase headings but mixed case
%   headings. Then the preamble of your document could start with:
% \begin{verbatim}
%   \documentclass{book}
%   \usepackage[nouppercase]{scrpage2}
%   \pagestyle{scrheadings}
% \end{verbatim}\vspace{-\baselineskip}
%   The selection of the page style \PageStyle{scrheadings} is necessary,
%   since otherwise the page style \PageStyle{headings} is active, which
%   does not respect the settings made by option \Option{nouppercase}.
% \end{Example}
%
% In some cases not only classes but also packages set the running
% headings in uppercase letters.
% Also in these cases the option \Option{nouppercase} should be able
% to switch back to the normal mixed case headings.
%
%
% \subsection{Defining Own Page Styles}\label{sec:scrpage2-en.UI}
% 
% \subsubsection{The Interface for Beginners}\label{sec:scrpage2-en.UI.user}
%
% \DescribeMacro\deftripstyle%
% Now one would not like to remain bound to only the provided page
% styles, but may wish to define one's own page styles.  Sometimes there
% will be a special need, since a specific \emph{Corporate Identity} may
% require the declaration of its own page styles.  The easiest way to
% deal with this is:
% \begin{flushleft}
%   \Macro{deftripstyle}\marg{name}\\*
%   \hphantom{\Macro{deftripstyle}}\oarg{LO}\oarg{LI}\\*
%   \hphantom{\Macro{deftripstyle}}\marg{HI}\marg{HC}\marg{HO}\\*
%   \hphantom{\Macro{deftripstyle}}\marg{FI}\marg{FC}\marg{FO}
% \end{flushleft}%
% The individual parameters have the following meanings:
% \begin{labeling}[\,--]{\meta{Name}}
% \item[\meta{name}] the name of the page style, in order to activate it using
%   the command \Macro{pagestyle}\marg{name}
% \item[\meta{LO}] the thickness of the outside lines, i.\,e., the line above
%   the header and the line below the footer (optional)
% \item[\meta{LI}] the thickness of the separation lines, i.\,e., the line
%   below the header and the line above the foot (optional)
% \item[\meta{HI}] contents of the inside box in the page header for two-sided
%   layout or left for one-sided layout
% \item[\meta{HC}] contents of the centered box in the page header
% \item[\meta{HO}] contents of the outside box in the page header for
%   two-sided layout or right for one-sided layout
% \item[\meta{FI}] contents of the inside box in the page footer for two-sided
%   layout or left for one-sided layout
% \item[\meta{FC}] contents of the centered box in the page footer
% \item[\meta{FO}] contents of the outside box in the page footer for
%   two-sided layout or right for one-sided layout
% \end{labeling}
%
% The command \Macro{deftripstyle} definitely represents the simplest
% possibility of defining page styles.  Unfortunately, there are also
% restrictions connected with this, since in a page range using a page style
% defined via deftripstyle, no modification of the lines above and below
% header and footer can take place.
%
% \begin{Example}
%   Assume a two-sided layout, where the running headings are placed on
%   the inside.  Furthermore, the document title, here ``Report'', shall
%   be placed outside in the header, the page number shall be centered
%   in the footer.
% \begin{verbatim}
%   \deftripstyle{TheReport}%
%                 {\headmark}{}{Report}%
%                 {}{\pagemark}{}
% \end{verbatim}\vspace{-\baselineskip}
%
%   If moreover the lines above the header and below the footer shall be
%   drawn with a thickness of 2\,pt, and the text body be separated from
%   header and footer with 0.4\,pt lines, then the definition has to be
%   extended:
% \begin{verbatim}
%   \deftripstyle{TheReport}[2pt][.4pt]%
%                 {\headmark}{}{Report}%
%                 {}{\pagemark}{}
% \end{verbatim}\vspace{-\baselineskip}
%   See figure~\ref{fig:scrpage2-en.tomuchlines} for the result.
% \begin{figure}
%   \centering
%   \setlength{\unitlength}{1.15mm}%
%   \begin{picture}(85,51)\scriptsize
%     \thinlines
%     \put(0,0){\line(0,1){51}}
%     \put(45,0){\line(0,1){51}}
%     \put(0,51){\line(1,0){40}}
%     \put(45,51){\line(1,0){40}}
%     \thicklines
%     \put(40,0){\line(0,1){51}}
%     \put(85,0){\line(0,1){51}}
%     \put(0,0,){\line(1,0){40}}
%     \put(45,0){\line(1,0){40}}
%     \XmpHeading[Report\hfill 2. The Eye]{6,47}{30}
%     \XmpHeading[2.1 Retina\hfill Report]{49,47}{30}
%     \XmpHeading[\hfill 14\hfill]{6,6.5}{30}
%     \XmpHeading[\hfill 15\hfill]{49,6.5}{30}
%     \put(6,44){\makebox(0,0)[tl]{\parbox{30\unitlength}{\tiny%
%       \textbf{2.1 Retina}\\
%       \XmpText[49]}}}
%     \put(49,44){\makebox(0,0)[tl]{\parbox{30\unitlength}{\tiny%
%       \XmpText[51]}}}
%     \thinlines
%     \XmpRule{6,45.5}{30}\XmpRule{49,45.5}{30}
%     \XmpRule{6,8}{30}\XmpRule{49,8}{30}
%     \linethickness{1pt}
%     \XmpRule{6,49}{30}\XmpRule{49,49}{30}
%     \XmpRule{6,5}{30}\XmpRule{49,5}{30}
%   \end{picture}
%   \caption{Example of a user defined, line dominated page style with a
%   static and a running heading at the page header and a page number centered
%   at the page footer}%
%   \label{fig:scrpage2-en.tomuchlines}%
% \end{figure}
% \end{Example}
%
% \subsubsection{The Interface for Experts}\label{sec:scrpage2-en.UI.expert}
%
% \DescribeMacro\defpagestyle%
% \DescribeMacro\newpagestyle%
% \DescribeMacro\renewpagestyle%
% \DescribeMacro\providepagestyle%
% Simple page styles, as they can be defined with \Macro{deftripstyle}, are
% fairly rare according to experience.  Either a professor requires that the
% thesis looks like his or her own\,---\,and who seriously wants to argue
% against such a wish?\,---\,or a company would like that half the financial
% accounting emerges in the page footer.  No problem, the solution is:
% \begin{flushleft}
%   \Macro{defpagestyle}\marg{name}\marg{header definition}\marg{footer definition}\\
%   \Macro{newpagestyle}\marg{name}\marg{header definition}\marg{footer definition}\\
%   \Macro{renewpagestyle}\marg{name}\marg{header definition}\marg{footer definition}\\
%   \Macro{providepagestyle}\marg{name}\marg{header definition}\marg{footer definition}
% \end{flushleft}%
% These four commands give full access to the capabilities of
% \Package{scrpage2} to define page styles.  Their structure is indentical,
% they differ only in the manner of working.
% \begin{labeling}[\ --]{\Macro{providepagestyle}}
% \item[\Macro{defpagestyle}] defines a new page style.  If a page style with
%   this name already exists it will be overwritten.
% \item[\Macro{newpagestyle}] defines a new page style.  If a page style with
%   this name already exists a error message will be given.
% \item[\Macro{renewpagestyle}] redefines a page style.  If a page style with
%   this name does not exist a error message will be given.
% \item[\Macro{providepagestyle}] defines a new page style only if there is no
%   page style with that name already present.
% \end{labeling}
%
% Using \Macro{defpagestyle} as an example, the syntax of the four
% commands is explained below.
% \begin{labeling}[~--]{\meta{header definition}}
% \item[\meta{name}] the name of the page style for
%   \Macro{pagestyle}\marg{name}
% \item[\meta{header definition}] the declaration of the header, consisting
%   of five element; elements in round parenthesis are optional:\hfill\\
%   \parg{ALL,ALT}\marg{EP}\marg{OP}\marg{OS}\parg{BLL,BLT}
% \item[\meta{footer definition}] the declaration of the footer, consisting
%   of five element; elements in round parenthesis are optional:\hfill\\
%   \parg{ALL,ALT}\marg{EP}\marg{OP}\marg{OS}\parg{BLL,BLT}
% \end{labeling}
%
% As can be seen, header and footer declaration have identical structure.  The
% individual parameters have the following meanings:
% \begin{labeling}[\ --]{\meta{OLD}}
% \item[\meta{ALL}] above line length: (header = outside, footer = separation
%   line)
% \item[\meta{ALT}] above line thickness
% \item[\meta{EP}] definition for \emph{even} pages
% \item[\meta{OP}] definition for \emph{odd} pages
% \item[\meta{OS}] definition for \emph{one-sided} layout
% \item[\meta{BLL}] below line length: (header = separation line, footer =
%   outside)
% \item[\meta{BLT}] below line thickness
% \end{labeling}
%
% If the optional line-parameters are omitted, then the line behaviour remains
% configurable by the commands introduced in
% section~\ref{sec:scrpage2-en.basics.format}.
%
% The three elements \meta{EP}, \meta{OP} and \meta{OS} are boxes with the
% width of page header or footer, as appropriate.  The corresponding definitions
% are set left-justified in the boxes. To set something left- \emph{and}
% right-justified into the boxes, the space between two text elements can be
% stretched using \Macro{hfill}:
% \begin{verbatim}
%   {\headmark\hfill\pagemark}
% \end{verbatim}\vspace{-\baselineskip}
%
% If one would like a third text-element centered in the box, then an
% extended definition must be used. The commands \Macro{rlap} and
% \Macro{llap} simply write the given arguments, but for {\LaTeX} they
% take up no horizontal space. Only in this way is the middle text
% really centered:
% \begin{verbatim}
%   {\rlap{\headmark}\hfill centered text\hfill\llap{\pagemark}}
% \end{verbatim}\vspace{-\baselineskip}
%
% \begin{Example}
%   This examples uses the document class \Class{scrbook}, which means that
%   the default page layout is two-sided.  The package \Package{scrpage2} is
%   loaded with options \Option{automark} and \Option{headsepline}.  The first
%   switches on the automatic update of running headings, the second
%   determines that a separation line between header and text body is drawn in
%   the \PageStyle{scrheadings} page style.
% \begin{verbatim}
%   \documentclass{scrbook}
%   \usepackage[automark,headsepline]{scrpage2}
% \end{verbatim}\vspace{-\baselineskip}
%
%   The expert interface is used to define two page styles.  The page style
%   \texttt{withoutLines} does not define any line parameters.  The second
%   page style \texttt{withLines} defines a line thicknes of 1\,pt for the
%   line above the header and 0\,pt for the separation line between header and
%   text.
%
% \begin{verbatim}
%   \defpagestyle{withoutLines}{%
%     {Example\hfill\headmark}{\headmark\hfill without lines}
%     {\rlap{Example}\hfill\headmark\hfill%
%      \llap{without lines}}
%   }{%
%     {\pagemark\hfill}
%     {\hfill\pagemark}
%     {\hfill\pagemark\hfill}
%   }
%
%   \defpagestyle{withLines}{%
%     (\textwidth,1pt)
%     {with lines\hfill\headmark}{\headmark\hfill with lines}
%     {\rlap{\KOMAScript}\hfill \headmark\hfill%
%      \llap{with lines}}
%     (0pt,0pt)
%   }{%
%     (\textwidth,.4pt)
%     {\pagemark\hfill}
%     {\hfill\pagemark}
%     {\hfill\pagemark\hfill}
%     (\textwidth,1pt)
%   }
% \end{verbatim}\vspace{-\baselineskip}
%
%   Right at the beginning of the document the page style
%   \PageStyle{scrheadings} is activated.  The command \Macro{chapter} starts
%   a new chapter and automatically sets the page rstyle for this page to
%   \PageStyle{plain}. Even though not a prime example, the command
%   \Macro{chead} shows how running headings can be created even on a plain
%   page.  However, in principle running headings on chapter start-pages are
%   to be avoided, since otherwise the special character of the
%   \PageStyle{plain} page style is lost. It is more important to indicate
%   that a new chapter starts here than that a section of this page has a
%   special title.
%
% \begin{verbatim}
%   \begin{document}
%   \pagestyle{scrheadings}
%   \chapter{Thermodynamics}
%   \chead[\leftmark]{}
%   \section{Main Laws}
%   Every system has an extensive state quantity called
%   Energy. In a closed system the energy is constant.
% \end{verbatim}\vspace{-\baselineskip}
%
%   \begin{XmpTopPage}
%     \XmpHeading[\hfill\textsl{1. Thermodynamics}\hfill]{10,27}{70}
%     \put(10,17){\normalsize\textbf{\sffamily 1.Thermodynamics}}
%     \put(10,12){\textbf{\sffamily 1.1 Main Laws}}
%     \XmpSetText[%
%     Every System has an extensive state quantity]{10,9}
%   \end{XmpTopPage}
%
%   After starting a new page the page style \PageStyle{scrheadings} is
%   active and thus the separation line below the header is visible.
% \begin{verbatim}
%   There is a state quatity of a system, called entropy,
%   whose temporal change consists of entropy flow and
%   entropy generation.
% \end{verbatim}\vspace{-\baselineskip}
%   \begin{XmpTopPage}
%     \XmpHeading[\textsl{1. Thermodynamics}\hfill]{20,27}{70}
%     \thinlines\XmpRule{20,25}{70}
%     \XmpSetText[%
%     There is a condition unit of a system, called entropy,
%     whose temporal change consists of entropy flow
%     and entropy generation.]{20,20}
%   \end{XmpTopPage}
%
%   After switching to the next page, the automatic update of the running
%   headings is disabled using \Macro{manualmark}, and the page style
%   \texttt{withoutLines} becomes active.  Since no line parameters are
%   given in the definition of this page style, the default configuration
%   is used, which draws a separation line between header and text body
%   because \Package{scrpage2} was called with \Option{headsepline}.
% \begin{verbatim}
%   \manualmark
%   \pagestyle{withoutLines}
%   \section{Exergy and Anergy}
%   \markright{Energy Conversion}
%   During the transition of a system to an equilibrium
%   state with its environment, the maximum work gainable
%   is called exergy.
% \end{verbatim}\vspace{-\baselineskip}
%   \begin{XmpTopPage}
%     \XmpHeading[\slshape Energy Conversion\hfill without lines]{10,27}{70}
%     \thinlines\XmpRule{10,25}{70}
%     \XmpSetText[\setlength{\parfillskip}{0pt plus 1fil}%
%     \textbf{\sffamily 1.2 Exergy and Anergy}\\
%     During the transition of a system to an equilibrium state
%     with its environment, the maximum work gainable is called
%     exergy.]{10,21}
%   \end{XmpTopPage}
%
%   At the next page of the document, the page style \texttt{withLines} is
%   activated.  The line settings of its definition are taken in account
%   and the lines are drawn accordingly.
% \begin{verbatim}
%   \pagestyle{mitLinien}
%   \renewcommand{\headfont}{\itshape\bfseries}
%   The portion of an energy not convertible in exergy
%   is named anergy \Var{B}.
%   \[ B = U + T (S_1 - S_u) - p (V_1 - V_u)\] 
%   \end{document}
% \end{verbatim}\vspace{-\baselineskip}
%   \begin{XmpTopPage}
%     \XmpHeading[\itshape\bfseries with lines\hfill 1. Thermodynamics]{20,27}{70}
%     \thicklines\XmpRule{20,29}{70}
%     \XmpSetText[\setlength{\parfillskip}{0pt plus 1fil}%
%     The portion of an energy not convertible in exergy
%     is named anergy $B$. 
%     \[ B = U + T (S_1 - S_u) - p (V_1 - V_u)\] ]{20,20}
%   \end{XmpTopPage}
% \end{Example}
%
% \subsubsection{Managing Page Styles}\label{sec:scrpage-en.UI.cfgFile}
%
% Before long the work with different page styles will establish a
% common set of employed page styles, depending on taste and tasks.  In
% order to make the management of page styles easier and avoid
% time-consuming copy operations each time a new project is started,
% \Package{scrpage2} reads the file \File{scrpage.cfg} after
% initialisation.  This file can contain a set of user-defined page
% styles which many projects can share.
%
% \cleardoublepage
% \selectlanguage{ngerman}
% \addcontentsline{toc}{part}{Deutsch}%
% \title{Das obsolete Paket \Package{scrpage2}}
% \author{Markus Kohm\and Jens-Uwe-Morawski}
% \date{2014-06-25}
% \maketitle
% \begin{abstract}
%   Dies ist das frühere \KOMAScript-Paket \Package{scrpage2}. Das Paket is
%   veralter und sollte nicht länger verwendet werden. Sie können es sehr
%   einfach durch das \KOMAScript-Paket \Package{scrlayer-scrpage} ersetzen,
%   das in der englischen und deutschen \KOMAScript-Anleitung dokumentiert
%   ist.
% \end{abstract}
% \tableofcontents
%
% \section{Kopf- und Fußzeilen mit \Package{scrpage2}}
% \label{sec:scrpage2-de}
%
% Mit \KOMAScript~3.12 wurde das komplett neu implementierte Paket
% \Package{scrlayer-scrpage} vorgestellt, das eine konsequente Weiterführung
% des Designs von \Package{scrpage2} mit anderen Mitteln darstellt. Siehe dazu
% das entsprechende Kapitel der \KOMAScript-Anleitung. Während
% \Package{scrpage2} die erweiterte Optionen-Schnittstelle der
% \KOMAScript-Klassen nicht unterstützt, kommt diese in
% \Package{scrlayer-scrpage} selbstverständlich zum Einsatz. Da der Ansatz von
% \Package{scrlayer-scrpage} gegenüber \Package{scrpage2} als überlegen
% betrachtet wird, wird somit empfohlen, \Package{scrlayer-scrpage} an Stelle
% von \Package{scrpage2} zu verwenden. Die aktuelle Version von
% \Package{scrpage2} ist daher auch als final zu betrachten. Sämtliche
% Entwicklungsresourcen im Bereich Kopf- und Fußzeilen werden zukünftig in
% \Package{scrlayer-scrpage} einfließen.
%
% An Stelle von \Package{scrpage2} oder \Package{scrlayer-scrpage} kann
% natürlich auch \Package{fancyhdr} verwendet werden. \Package{scrpage2} und
% insbesondere \Package{scrlayer-scrpage} harmonieren jedoch mit den
% \KOMAScript-Klassen deutlich besser. Genau deshalb und weil der Vorläufer
% von \Package{fancyhdr} damals viele Möglichkeiten vermissen lies, ist
% \Package{scrpage2} entstanden. Natürlich ist das Paket \Package{scrpage2}
% ebenso wie das Paket \Package{scrlayer-scrpage} nicht an eine
% \KOMAScript-Klasse gebunden, sondern kann auch sehr gut mit anderen Klassen
% verwendet werden.
%
%
% \subsection{Grundlegende Funktionen}\label{sec:scrpage2-de.basics}
%
% Um die nachfolgende Beschreibung zu verstehen, muss noch einiges zu \LaTeX{}
% gesagt werden. Im \LaTeX-Kern sind die Standardseitenstile
% \PageStyle{empty}, welcher eine völlig undekorierte Seite erzeugt, und
% \PageStyle{plain}, welcher meist nur die Seitenzahl enthält, definiert. In
% vielen Klassen ist der Stil \PageStyle{headings} zu finden, welcher eine
% komplexe Seitendekoration mit automatischen
% Kolumnentitel\index{Kolumnentitel>automatisch} erzeugt. Die Variante
% \PageStyle{myheadings} gleicht \PageStyle{headings}. Die Kolumnentitel
% müssen dabei aber manuell\index{Kolumnentitel>manuell} gesetzt werden.
% Ausführlicher wird das im Abschnitt über Seitenstile der
% \KOMAScript-Anleitung beschrieben. Dort wird auch erläutert, dass auf
% einigen Seiten der Seitenstil automatisch -- in der Regel zu
% \PageStyle{plain} -- wechselt.
%  
% Das Paket \Package{scrpage2} unterscheidet nicht mehr zwischen Seitenstilen
% mit automatischem und mit manuellem Kolumnentitel. Die Wahl des Seitenstils
% erfolgt unabhängig davon, ob mit automatischem oder manuellem Kolumnentitel
% gearbeitet wird. Näheres dazu finden Sie in
% Abschnitt~\ref{sec:scrpage2-de.basics.mark}.
%
% \subsubsection{Vordefinierte Seitenstile}\label{sec:scrpage2-de.basics.buildIn}
%
% Zu den grundlegenden Funktionen von \Package{scrpage2} gehören unter anderem
% vordefinierte, konfigurierbare Seitenstile.
%
% \bigskip\noindent%
% \DescribePageStyle{scrheadings}%
% \DescribePageStyle{scrplain}%
% Das Paket \Package{scrpage2} liefert für Seiten mit Kolumnentitel einen
% eigenen Seitenstil namens \PageStyle{scrheadings}.  Dieser Seitenstil kann
% mittels |\pagestyle{scrheadings}| aktiviert werden.  Wird dieser Seitenstil
% benutzt, dann wird gleichzeitig der plain-Stil durch den dazu passenden Stil
% \PageStyle{scrplain} ersetzt. Passend bedeutet, dass auch der plain-Stil auf
% in Abschnitt~\ref{sec:scrpage2-de.basics.format} vorgestellte Befehle, die
% beispielsweise die Kopfbreite ändern, reagiert und im Grundlayout
% übereinstimmt. Die Aktivierung des Seitenstils \PageStyle{scrheadings} oder
% des zugehörigen plain-Stils, \PageStyle{scrplain}, hat keine Auswirkung
% darauf, ob mit manuellen oder automatischen
% Kolumnentiteln\index{Kolumnentitel>automatisch}\index{Kolumnentitel>manuell}
% gearbeitet wird (siehe Abschnitt~\ref{sec:scrpage2-de.basics.mark}). Der
% Seitenstil \PageStyle{scrplain} kann auch direkt per \Macro{pagestyle}
% aktiviert werden.
%
% \bigskip\noindent%
% \DescribeMacro\lehead%
% \DescribeMacro\cehead%
% \DescribeMacro\rehead%
% \DescribeMacro\lefoot%
% \DescribeMacro\cefoot%
% \DescribeMacro\refoot%
% \DescribeMacro\lohead%
% \DescribeMacro\cohead%
% \DescribeMacro\rohead%
% \DescribeMacro\lofoot%
% \DescribeMacro\cofoot%
% \DescribeMacro\rofoot%
% \DescribeMacro\ihead%
% \DescribeMacro\chead%
% \DescribeMacro\ohead%
% \DescribeMacro\ifoot%
% \DescribeMacro\cfoot%
% \DescribeMacro\ofoot%
% Die Seitenstile von \Package{scrpage2} sind so definiert, dass ihr Kopf und
% Fuß flexibel angepasst werden kann. Hierzu sind sowohl im Kopf als auch im
% Fuß drei Felder vorhanden, deren Inhalt modifiziert werden kann.  Die
% Befehle zur Modifikation sind in Abbildung~\ref{fig:scrpage2-de.leheadetall}
% verdeutlicht. Die in der Mitte dargestellten Befehle modifizieren sowohl die
% Felder der linken als auch der rechten Seite. Alle Befehle haben sowohl ein
% optionales als auch ein obligatorisches Argument. Das optionale Argument
% bestimmt jeweils das durch den Befehl festgelegte Feld im plain-Seitenstil,
% \PageStyle{scrplain}. Das obligatorische Argument definiert das
% entsprechende Feld im Seitenstil \PageStyle{scrheadings}.
% \begin{figure}
%  \centering
%  \setlength{\unitlength}{1.2mm}
%  \begin{picture}(100,65)(0,8)\small
%    \put(0,12){\dashbox{2}(40,56){linke Seite}}
%    \put(60,12){\dashbox{2}(40,56){rechte Seite}}
%^^A                                 % Felder: oben links
%    \put(1,63){\framebox(8,4){~}}
%    \put(16,63){\framebox(8,4){~}}
%    \put(31,63){\framebox(8,4){~}}
%^^A                                 % Felder: oben rechts
%    \put(61,63){\framebox(8,4){~}}
%    \put(76,63){\framebox(8,4){~}}
%    \put(91,63){\framebox(8,4){~}}
%^^A                                 % Felder: unten links
%    \put(1,13){\framebox(8,4){~}}
%    \put(16,13){\framebox(8,4){~}}
%    \put(31,13){\framebox(8,4){~}}
%^^A                                 % Felder: unten rechts
%    \put(61,13){\framebox(8,4){~}}
%    \put(76,13){\framebox(8,4){~}}
%    \put(91,13){\framebox(8,4){~}}
%^^A                                 % die Befehle und Pfeile
%^^A                                 % für beidseitig
%^^A                                 % 
%    \put(50,65){\makebox(0,0){\cs{ihead}}}
%    \put(44,65){\vector(-1,0){4}}\put(56,65){\vector(1,0){4}}
%    \put(50,58){\makebox(0,0){\cs{chead}}}
%    \put(44,58){\line(-1,0){24}}\put(56,58){\line(1,0){24}}
%    \put(20,58){\vector(0,1){4}}\put(80,58){\vector(0,1){4}}
%    \put(50,51){\makebox(0,0){\cs{ohead}}}
%    \put(44,51){\line(-1,0){40}}\put(56,51){\line(1,0){40}}
%    \put(4,51){\vector(0,1){11}}\put(96,51){\vector(0,1){11}}
%^^A                                %
%    \put(50,15){\makebox(0,0){\cs{ifoot}}}
%    \put(56,15){\vector(1,0){4}}\put(44,15){\vector(-1,0){4}}
%    \put(50,22){\makebox(0,0){\cs{cfoot}}}
%    \put(44,22){\line(-1,0){24}}\put(56,22){\line(1,0){24}}
%    \put(20,22){\vector(0,-1){4}}\put(80,22){\vector(0,-1){4}}
%    \put(50,29){\makebox(0,0){\cs{ofoot}}}
%    \put(44,29){\line(-1,0){40}}\put(56,29){\line(1,0){40}}
%    \put(4,29){\vector(0,-1){11}}\put(96,29){\vector(0,-1){11}}
%^^A                                 % Befehle für einseitig
%    \put(5,69){\makebox(0,0)[b]{\cs{lehead}}}
%    \put(20,69){\makebox(0,0)[b]{\cs{cehead}}}
%    \put(35,69){\makebox(0,0)[b]{\cs{rehead}}}
%^^A                                %    
%    \put(65,69){\makebox(0,0)[b]{\cs{lohead}}}
%    \put(80,69){\makebox(0,0)[b]{\cs{cohead}}}
%    \put(95,69){\makebox(0,0)[b]{\cs{rohead}}}
%^^A                                 %
%    \put(5,11){\makebox(0,0)[t]{\cs{lefoot}}}
%    \put(20,11){\makebox(0,0)[t]{\cs{cefoot}}}
%    \put(35,11){\makebox(0,0)[t]{\cs{refoot}}}
%^^A                                 %
%    \put(65,11){\makebox(0,0)[t]{\cs{lofoot}}}
%    \put(80,11){\makebox(0,0)[t]{\cs{cofoot}}}
%    \put(95,11){\makebox(0,0)[t]{\cs{rofoot}}}
%  \end{picture}
%  \caption{Zuordnung der Befehle zur Manipulation der Seitenstile
%    \PageStyle{scrheadings} und \PageStyle{scrplain} zu den manipulierten
%    Seitenelementen}
%  \label{fig:scrpage2-de.leheadetall}
% \end{figure}
%
% \begin{Example}
%   Angenommen, man möchte bei \PageStyle{scrheadings} zentriert im Seitenfuß
%   die Seitenzahl dargestellt haben, dann benutzt man einfach:
% \begin{verbatim}
%   \cfoot{\pagemark}
% \end{verbatim}\vspace{-\baselineskip}
%   Sollen die Seitenzahlen\index{Paginierung} im Kopf außen und die
%   Kolumnentitel\index{Kolumnentitel} innen stehen, dann erfolgt dies mit:
% \begin{verbatim}
%   \ohead{\pagemark}
%   \ihead{\headmark}
%   \cfoot{}
% \end{verbatim}\vspace{-\baselineskip}
%   Das |\cfoot{}| ist nur notwendig, um eine möglicherweise in der Mitte des
%   Fußes vorhandene Seitenzahl zu entfernen.
% \end{Example}
%
% Die Befehle, die direkt nur einem Feld zugeordnet sind, können für
% anspruchsvollere Vorhaben genutzt werden.
%
% \begin{Example}
%   Angenommen, man hat den Auf"|trag, einen Jahresbericht einer Firma zu
%   erstellen, dann könnte das so angegangen werden:
% \begin{verbatim}
%   \ohead{\pagemark}
%   \rehead{Jahresbericht 2001}
%   \lohead{\headmark}
%   \cefoot{Firma WasWeißIch}
%   \cofoot{Abteilung Entwicklung}
% \end{verbatim}\vspace{-\baselineskip}
%   Natürlich muss man hier dafür sorgen, dass mittels \Macro{cofoot} der Fuß
%   der rechten Seite aktualisiert wird, wenn eine neue Abteilung im Bericht
%   besprochen wird.
% \end{Example}
%
% Wie oben dargestellt, gibt es einen zu \PageStyle{scrheadings}
% korrespondierenden plain-Seitenstil.  Da es auch möglich sein soll, diesen
% Stil anzupassen, unterstüt"-zen die Befehle ein optionales Argument.  Damit
% kann der Inhalt des entsprechenden Feldes im plain-Seitenstil modifiziert
% werden.
%
% \begin{Example}
%   Um für die Nutzung von \PageStyle{scrheadings} die Position der Seitenzahlen
%   festzulegen, kann man folgendes benutzen:
% \begin{verbatim}
%   \cfoot[\pagemark]{}
%   \ohead[]{\pagemark}
% \end{verbatim}\vspace{-\baselineskip}
%   Wird anschließend der Stil \PageStyle{plain} genutzt, beispielsweise weil
%   \Macro{chapter} eine neue Seite beginnt und darauf umschaltet, dann steht
%   die Seitenzahl zentriert im Seitenfuß.
% \end{Example}
%
% \bigskip\noindent%
% \DescribeMacro\clearscrheadings%
% \DescribeMacro\clearscrplain%
% \DescribeMacro\clearscrheadfoot%
% Will man sowohl den Seitenstil \PageStyle{scrheadings} als auch den dazu
% gehörenden plain-Seitenstil von Grund auf neu definieren, muss man häufig
% zusätzlich einige der bereits belegten Seitenelemente löschen.  Da man
% selten alle Elemente mit neuem Inhalt füllt, sind dazu in den meisten Fällen
% mehrere Befehle mit leeren Parametern notwendig.  Mit Hilfe dieser drei
% Befehle ist das Löschen schnell und gründlich möglich. Während
% \Macro{clearscrheadings} lediglich alle Felder des Seitenstils
% \PageStyle{scrheadings} und \Macro{clearscrplain} alle Felder des
% zugehörigen plain-Seitenstils löscht, werden von \Macro{clearscrheadfoot}
% alle Felder beider Seitenstile auf leere Inhalte gesetzt.
% \begin{Example}
%   Sie wollen unabhängig davon, wie die Seitenstile derzeit aussehen,
%   die Standardform der \KOMAScript-Klassen bei zweiseitigem Satz
%   erreichen. Dies ist mit nur drei Befehlen möglich:
% \begin{verbatim}
%   \clearscrheadfoot
%   \ohead{\headmark}
%   \ofoot[\pagemark]{\pagemark}
% \end{verbatim}\vspace{-\baselineskip}
%   Ohne die Befehle \Macro{clearscrheadings}, \Macro{clearscrplain} und
%   \Macro{clearscrheadfoot} wären doppelt so viele Anweisungen und neun weitere
%   leere Argumente notwendig:
% \begin{verbatim}
%   \ihead[]{}
%   \chead[]{}
%   \ohead[]{\headmark}
%   \ifoot[]{}
%   \cfoot[]{}
%   \ofoot[\pagemark]{\pagemark}
% \end{verbatim}\vspace{-\baselineskip}
%   Einige davon könnten natürlich entfallen, wenn man von einer
%   konkreten Vorbelegung ausginge.
% \end{Example}
%
% In den vorausgehenden Beispielen wurden schon zwei Befehle benutzt, die noch
% gar nicht besprochen wurden.  Das soll jetzt nachgeholt werden.
%
% \bigskip\noindent%
% \DescribeMacro\leftmark%
% \DescribeMacro\rightmark%
% Diese beiden Befehle erlauben es, auf die Kolumnentitel zuzugreifen, die
% normalerweise für die linke bzw. die rechte Seite gedacht sind. Diese beiden
% Befehle werden nicht von \Package{scrpage2}, sondern direkt vom \LaTeX-Kern
% zur Verfügung gestellt. Wenn in diesem Kapitel vom Kolumnentitel der linken
% Seite oder vom Kolumnentitel der rechten Seite die Rede ist, dann ist damit
% eigentlich der Inhalt von \Macro{leftmark} und \Macro{rightmark} gemeint.
%
% \bigskip\noindent%
% \DescribeMacro\headmark%
% Dieser Befehl ermöglicht es, auf die Inhalte der Kolumnentitel zuzugreifen.
% Im Gegensatz zu den originalen \LaTeX{}-Befehlen \Macro{leftmark} und
% \Macro{rightmark} braucht man nicht auf die richtige Zuordnung zur linken
% oder rechten Seite zu achten.%
%
% \bigskip\noindent%
% \DescribeMacro\pagemark%
% Dieser Befehl ermöglicht den Zugriff auf die Seitenzahl. Im
% Abschnitt~\ref{sec:scrpage2-de.basics.format} wird der Befehl \Macro{pnumfont}
% zur Formatierung der Seitenzahl vorgestellt, den \Macro{pagemark}
% automatisch berücksichtigt.
%
% \bigskip\noindent%
% \DescribePageStyle{useheadings}%
% Das Paket \Package{scrpage2} ist in erster Linie dafür gedacht, dass die
% bereitgestellten Stile benutzt oder eigene Stile definiert werden.  Jedoch
% kann es notwendig sein, auch auf einen von der Dokumentklasse zur Verfügung
% gestellten Stil zurückzuschalten. Es wäre nahe liegend, dieses mit
% |\pagestyle{headings}| vorzunehmen. Das hätte aber den Nachteil, dass die
% nachfolgend besprochenen Befehle \Macro{automark} und \Macro{manualmark}
% nicht wie erwartet funktionierten. Daher sollte mit
% |\pagestyle{useheadings}| auf die originalen Stile umgeschaltet werden. Eine
% solche Umschaltung hat dann keine Auswirkung darauf, ob mit manuellen oder
% automatischen Kolumnentiteln gearbeitet wird.
%
% \subsubsection{Manuelle und automatische Kolumnentitel}
% \label{sec:scrpage2-de.basics.mark}
%
% Gewöhnlich gibt es zu einem \PageStyle{headings}-Stil eine
% \emph{my}-Variante. Ist ein solcher Stil aktiv, dann werden die
% Kolumnentitel nicht mehr automatisch aktualisiert.  Bei \Package{scrpage2}
% wird ein anderer Weg beschritten.  Ob die Kolumnentitel lebend sind oder
% nicht, bestimmen die Befehle \Macro{automark} und \Macro{manualmark}. Die
% Voreinstellung kann auch bereits beim Laden des Paketes über die Optionen
% \Option{automark} und \Option{manualmark} beeinflusst werden (siehe
% Abschnitt~\ref{sec:scrpage2-de.basics.options}).
%
% \bigskip\noindent%
% \DescribeMacro\manualmark%
% Wie der Name bereits verdeutlicht, schaltet \Macro{manualmark} die
% Aktualisierung der Kolumnentitel aus.  Es bleibt somit dem Nutzer
% überlassen, für eine Aktualisierung bzw. für den Inhalt der Kolumnentitel zu
% sorgen.  Dazu stehen die Befehle \Macro{markboth} und \Macro{markright} aus
% dem \LaTeX-Kern bereit. Diese Anweisungen sind im Abschnitt über Seitenstile
% in der \KOMAScript-Anleitung erklärt.
%
% \bigskip\noindent%
% \DescribeMacro\automark%
% Die Anweisung \Macro{automark}\oarg{rechte Seite}\marg{linke Seite}
% aktiviert die automatische Aktualisierung des Kolumnentitels.  Für die
% beiden Parameter sind die Bezeichnungen der
% Gliederungsebenen\index{Gliederungsebenen} einzusetzen, deren Titel an
% entsprechender Stelle erscheinen soll. Gültige Werte für die Parameter sind:
% \texttt{part}, \texttt{chapter}, \texttt{section}, \texttt{subsection},
% \texttt{subsubsection}, \texttt{paragraph} und \texttt{subparagraph}. Der
% Wert \texttt{part} führt bei Verwendung der meisten Klassen nicht zu dem
% gewünschten Ergebnis. Bisher ist nur von den \KOMAScript-Klassen ab
% Version~2.9s bekannt, dass dieser Wert unterstützt wird.  Das optionale
% Argument \meta{rechte Seite} ist verständlicherweise nur für zweiseitigen
% Satz gedacht. Im einseitigen Satz sollten Sie normalerweise darauf
% verzichten. Mit Hilfe der Option \Option{autooneside} können Sie auch
% einstellen, dass das optionale Argument im einseitigen\index{einseitig} Satz
% automatisch ignoriert wird (siehe
% Abschnitt~\ref{sec:scrpage2-de.basics.options}).
% \begin{Example}
%   Wird beispielsweise mit einer \emph{book}-Klasse gearbeitet, deren höchste
%   Gliederungsebene \emph{chapter} ist, dann stellt nach einem vorhergehenden
%   \Macro{manualmark} der Befehl
% \begin{verbatim}
%   \automark[section]{chapter}
% \end{verbatim}\vspace{-\baselineskip}
%   den Originalzustand wieder her. Bevorzugt man stattdessen, die tieferen
%   Gliederungsebenen angezeigt zu bekommen, dann erfolgt dies mit:
% \begin{verbatim}
%   \automark[subsection]{section}
% \end{verbatim}\vspace{-\baselineskip}
% \end{Example}
%
% Die Markierung der jeweils höheren Gliederungsebene wird mit Hilfe von
% \Macro{markboth} gesetzt. Die Markierung der tieferen Gliederungsebene wird
% mit \Macro{markright} bzw.  \Macro{markleft} gesetzt.  Der entsprechende
% Aufruf erfolgt indirekt über die Gliederungsbefehle. Die Anweisung
% \Macro{markleft} wird von \Package{scrpage2} bereitgestellt und ist
% vergleichbar zu \Macro{markright} aus dem \LaTeX-Kern definiert. Obwohl sie
% nicht als internes Makro definiert ist, wird von einem direkten Gebrauch
% abgeraten.
%
% \subsubsection{Formatierung der Kopf- und Fußzeilen}
% \label{sec:scrpage2-de.basics.format}
% Im vorherigen Abschnitt ging es hauptsächlich um inhaltliche Dinge.  Das
% genügt natürlich nicht, um die gestalterischen Ambitionen zu
% befriedigen. Deshalb soll es sich in diesem Abschnitt ausschließlich darum
% drehen.
%
% \bigskip\noindent%
% \DescribeMacro\headfont%
% \DescribeMacro\footfont%
% \DescribeMacro\pnumfont%
% Die Schriftformatierung für den Seitenkopf und -fuß übernimmt der Befehl
% \Macro{headfont}, \Macro{footfont} die Abweichung davon für den Fuß und
% \Macro{pnumfont} wiederum die Abweichung davon für die Seitenzahl.
% \begin{Example}
%   Um beispielsweise den Kopf in fetter, serifenloser Schrift und den Fuß in
%   nicht fetter, serifenloser Schrift zu setzen und die Seitenzahl geneigt
%   mit Serifen erscheinen zu lassen, nutzt man folgende Definitionen:
% \begin{verbatim}
%   \renewcommand*{\headfont}{%
%     \normalfont\sffamily\bfseries}
%   \renewcommand*{\footfont}{%
%     \normalfont\sffamily}
%   \renewcommand*{\pnumfont}{%
%     \normalfont\rmfamily\slshape}
% \end{verbatim}\vspace{-\baselineskip}
% \end{Example}
%
% \DescribeFontElement{pagehead}%
% \DescribeFontElement{pagefoot}%
% \DescribeFontElement{pagenumber}%
% Ab Version 2.8p der \KOMAScript{}-Klassen wurde die Schnittstelle für
% Schriftattribute vereinheitlicht.  Wird \Package{scrpage2} in Verbindung mit
% einer dieser Klassen verwendet, dann sollte die Zuweisung in der Art erfolgen,
% wie sie in der \KOMAScript-Anleitung beschrieben wird.
% \begin{Example}
%   Statt \Macro{renewcommand} wird bei Verwendung einer \KOMAScript-Klasse
%   vorzugsweise der Befehl \Macro{setkomafont} verwendet. Die vorhergehenden
%   Definitionen lauten damit:
% \begin{verbatim}
%   \setkomafont{pagehead}{%
%     \normalfont\sffamily\bfseries}
%   \setkomafont{pagefoot}{%
%     \normalfont\sffamily}
%   \setkomafont{pagenumber}{%
%     \normalfont\rmfamily\slshape}
% \end{verbatim}\vspace{-\baselineskip}
% \end{Example}
%
% \bigskip\noindent%
% \DescribeMacro\setheadwidth%
% \DescribeMacro\setfootwidth%
% Normalerweise entsprechen die Breiten von Kopf- und Fußzeile der Breite des
% Textbereichs.\index{Kopf>Breite}\index{Fuss=Fuß>Breite} Die beiden Befehle
% \Macro{setheadwidth}\oarg{Verschiebung}\marg{Breite} und
% \Macro{setfootwidth}\oarg{Verschiebung}\marg{Breite} ermöglichen dem
% Anwender, auf einfache Weise die Breiten seinen Bedürfnissen anzupassen.
% Das obligatorische Argument \meta{Breite} nimmt den Wert der Breite des
% Kopfes bzw. des Fußes auf, \meta{Verschiebung} ist ein Längenmaß für die
% Verschiebung des entsprechenden Elements in Richtung des äußeren
% Seitenrandes.
%
% Für die möglichen Standardfälle akzeptiert das obligatorische Argument
% \meta{Breite} auch folgende symbolische Werte:
% \begin{labeling}[\ --]{\texttt{textwithmarginpar}}
% \item[\texttt{paper}] die Breite des Papiers
% \item[\texttt{page}] die Breite der Seite
% \item[\texttt{text}] die Breite des Textbereichs
% \item[\texttt{textwithmarginpar}] die Breite des Textbereichs inklusive
%   Seitenrand
% \item[\texttt{head}] die aktuelle Breite des Seitenkopfes
% \item[\texttt{foot}] die aktuelle Breite des Seitenfußes
% \end{labeling}
% Der Unterschied zwischen \texttt{paper} und \texttt{page} besteht darin,
% dass \texttt{page} die Breite des Papiers abzüglich der Bindekorrektur ist,
% falls das \Package{typearea}-Paket verwendet wird (siehe das Kapitel über
% \Package{typearea} in der \KOMAScript-Anleitung). Ohne Verwendung von
% \Package{typearea} sind \texttt{paper} und \texttt{page}
% identisch.
%
% \begin{Example}
%   Angenommen, man möchte ein Seitenlayout wie im \emph{\LaTeX-Begleiter},
%   bei dem die Kopfzeile in den Rand ragt, dann geschieht das ganz einfach
%   mit:
% \begin{verbatim}
%   \setheadwidth[0pt]{textwithmarginpar}
% \end{verbatim}\vspace{-\baselineskip}
%   und sieht dann auf einer rechten Seite folgendermaßen aus:
%   \begin{XmpTopPage}
%     \XmpHeading{10,29}{85}
%     \thinlines\XmpRule{10,27}{85}
%     \XmpSetText[\XmpTopText]{10,24}
%     \XmpMarginNote{83,14}
%   \end{XmpTopPage}
%   Soll der Seitenfuß die gleiche Breite und Ausrichtung haben, dann hat man
%   jetzt zwei Wege.  Der erste ist, man wiederholt das Gleiche für den
%   Seitenfuß mit:
% \begin{verbatim}
%   \setfootwidth[0pt]{textwithmarginpar}
% \end{verbatim}\vspace{-\baselineskip}
%   oder man greift auf den anderen symbolischen Wert \texttt{head} zurück, da
%   der Kopf bereits die gewünschte Breite hat.
% \begin{verbatim}
%   \setfootwidth[0pt]{head}
% \end{verbatim}\vspace{-\baselineskip}
% \end{Example}
%
% Wird keine Verschiebung angegeben, das heißt auf das optionale Argument
% verzichtet, dann erscheint der Kopf bzw. der Fuß symmetrisch auf der Seite
% angeordnet. Es wird somit ein Wert für die Verschiebung automatisch
% ermittelt, der der aktuellen Seitengestalt entspricht.
%
% \begin{Example}
%   Entsprechend dem vorherigen Beispiel wird hier auf das optionale Argument
%   verzichtet:
% \begin{verbatim}
%   \setheadwidth{textwithmarginpar}
% \end{verbatim}\vspace{-\baselineskip}
%   und sieht dann auf einer rechten Seite folgendermaßen aus:
%   \begin{XmpTopPage}
%         \XmpHeading{5,29}{85}
%         \thinlines\XmpRule{5,27}{85}
%         \XmpSetText[\XmpTopText]{10,24}
%         \XmpMarginNote{83,14}
%   \end{XmpTopPage}
% \end{Example}
%
% Wie zu sehen, ist der Kopf jetzt nach innen verschoben, wobei die Kopfbreite
% sich nicht geändert hat. Die Verschiebung ist so berechnet, dass die
% Seitenproportionen auch hier sichtbar werden.
%
% \bigskip\noindent%
% \DescribeMacro\setheadtopline%
% \DescribeMacro\setheadsepline%
% \DescribeMacro\setfootsepline%
% \DescribeMacro\setfootbotline%
% Entsprechend den Größenparametern für die Kopf- und Fußzeile gibt es auch
% Befehle, die die Dimensionen der Linien im Kopf und Fuß modifizieren
% können. Dazu sollten diese Linien aber zunächst erst einmal eingeschaltet
% werden. Siehe hierzu die Optionen \Option{headtopline},
% \Option{headsepline}, \Option{footsepline}, \Option{footbotline} in
% Abschnitt~\ref{sec:scrpage2-de.basics.options}.
%
% \begin{labeling}[\ --]
% {\Macro{setfootsepline}\oarg{Länge}\marg{Dicke}\oarg{Anweisungen}}
% \item[\Macro{setheadtopline}\oarg{Länge}\marg{Dicke}\oarg{Anweisungen}]
%   modifiziert die Parameter für die Linie über dem Seitenkopf
% \item[\Macro{setheadsepline}\oarg{Länge}\marg{Dicke}\oarg{Anweisungen}]
%   modifiziert die Parameter für die Linie zwischen Kopf und Textkörper
% \item[\Macro{setfootsepline}\oarg{Länge}\marg{Dicke}\oarg{Anweisungen}]
%   modifiziert die Parameter für die Linie zwischen Text und Fuß
% \item[\Macro{setfootbotline}\oarg{Länge}\marg{Dicke}\oarg{Anweisungen}]
%   modifiziert die Parameter für die Linie unter dem Seitenfuß
% \end{labeling}
%
% Das obligatorische Argument \meta{Dicke} bestimmt, wie stark die Linie
% gezeichnet wird.  Das optionale Argument \meta{Länge} akzeptiert die
% gleichen symbolischen Werte wie \meta{Breite} bei \Macro{setheadwidth}, also
% auch einen normalen Längenausdruck.  Solange im Dokument dem optionalen
% Argument \meta{Länge} kein Wert zugewiesen wurde, passt sich die
% entsprechende Linienlänge automatisch der Breite des Kopfes bzw. des Fußes
% an.
%
% Möchte man diesen Automatismus für die Länge einer Linie wieder
% restaurieren, dann nutzt man im Längenargument den Wert \texttt{auto}.
%
% \DescribeFontElement{headtopline}%
% \DescribeFontElement{headsepline}%
% \DescribeFontElement{footsepline}%
% \DescribeFontElement{footbotline}%
% \DescribeFontElement{footbottomline}%
% Mit dem optionalen Argument \meta{Anweisungen} können zusätzliche
% Anweisungen definiert werden, die vor dem Zeichnen der jeweiligen Linie
% auszuführen sind.  Das können beispielsweise Anweisungen sein, um die
% Farbe\index{Kopf>Farbe}\index{Fuss=Fuß>Farbe}\index{Farbe>im
% Kopf}\index{Farbe>im Fuss=im Fuß} der Linie zu ändern.  Bei Verwendung einer
% \KOMAScript-Klasse können diese Anweisungen auch über \Macro{setkomafont}
% für eines der Elemente \FontElement{headtopline}, \FontElement{headsepline},
% \FontElement{footsepline}, \FontElement{footbottomline} oder auch
% \FontElement{footbotline} gesetzt und mit \Macro{addtokomafont} erweitert
% werden. Die beiden Anweisungen \Macro{setkomafont} und \Macro{addtokomafont}
% sind in der \KOMAScript-Anleitung näher beschrieben.
%
% Es sind auch symbolische Werte für \meta{Länge} und \meta{Dicke} möglich,
% beispielsweise |\setheadtopline[auto]{current}|, |\setheadtopline[auto]{}|
% oder |\setheadtopline[auto]{}{}|. Die hier am Befehl \Macro{setheadtopline}
% illustrierten Argumente sind natürlich auch für die anderen drei
% Längenbefehle gültig.
%
% Enthält das obligatorische Argument den Wert \texttt{current} oder wird
% leer gelassen, dann wird die Dicke der Linie nicht verändert.  Das kann
% genutzt werden, wenn die Länge der Linie, aber nicht die Dicke modifiziert
% werden soll.
%
% Wird das optionale Argument \meta{Anweisungen} weggelassen, so bleiben
% eventuell zuvor gesetzte Anweisungen erhalten. Wird hingegen ein leeres
% Argument \meta{Anweisungen} gesetzt, so werden eventuell zuvor gesetzte
% Anweisungen wieder gelöscht.
%
% \begin{Example}
%   Soll beispielsweise der Kopf mit einer kräftigen Linie von 2\,pt darüber
%   und einer normalen von 0,4\,pt zwischen Kopf und Text abgesetzt werden,
%   dann erfolgt das mit:
% \begin{verbatim}
%   \setheadtopline{2pt}
%   \setheadsepline{.4pt}
% \end{verbatim}\vspace{-\baselineskip}
%   Zusätzlich sind unbedingt die Optionen \Option{headtopline} und
%   \Option{headsepline} vorzugsweise global im optionalen Argument von
%   \Macro{documentclass} zu setzen. Das Ergebnis könnte dann wie folgt
%   aussehen.
%   \begin{XmpTopPage}
%         \XmpHeading{10,29}{70}
%         \thinlines\XmpRule{10,27}{70}
%         \thicklines\XmpRule{10,32}{70}
%         \XmpSetText[\XmpTopText]{10,24}
%         \XmpMarginNote{83,14}
%   \end{XmpTopPage}
%
%   Sollen diese Linien zusätzlich in roter Farbe gesetzt werden, dann sind
%   die Anweisungen beispielsweise wie folgt zu ändern:
% \begin{verbatim}
%   \setheadtopline{2pt}[\color{red}]
%   \setheadsepline{.4pt}[\color{red}]
% \end{verbatim}\vspace{-\baselineskip}
%   In diesem und auch dem folgenden Beispiel wurde für die Aktivierung der
%   Farbe die Syntax des \Package{color}-Pakets verwendet, das dann natürlich
%   auch geladen werden muss. \Package{scrpage2} selbst bietet keine direkte
%   Farbunterstützung. Damit ist jedes beliebige Farbunterstützungspaket
%   verwendbar.
%
%   Mit einer \KOMAScript-Klasse kann alternativ
% \begin{verbatim}
%   \setheadtopline{2pt}
%   \setheadsepline{.4pt}
%   \setkomafont{headtopline}{\color{red}}
%   \setkomafont{headsepline}{\color{red}}
% \end{verbatim}\vspace{-\baselineskip}
%   verwendet werden.
%
%   Die automatische Anpassung an die Kopf- und Fußbreiten illustriert
%   folgendes Beispiel, für das die Optionen \Option{footbotline} und
%   \Option{footsepline} gesetzt sein sollten:
% \begin{verbatim}
%   \setfootbotline{2pt}
%   \setfootsepline[text]{.4pt}
%   \setfootwidth[0pt]{textwithmarginpar}
% \end{verbatim}\vspace{-\baselineskip}
%
%   \csname phantomsection\endcsname\label{page:scrpage2-de.autoLineLength}%
%   \begin{XmpBotPage}
%         \XmpHeading{10,18}{85}
%         \thinlines\XmpRule{17,21}{70}
%         \thicklines\XmpRule{10,16}{85}
%         \XmpSetText[\XmpBotText]{10,36}
%         \XmpMarginNote{83,26}
%   \end{XmpBotPage}
% \end{Example}
% Nun mag nicht jedem die Ausrichtung der Linie über der Fußzeile gefallen,
% sondern es wird in einem solchen Fall erwartet, dass sie wie der
% Kolumnentitel linksbündig zum Text ist.  Diese Einstellung kann nur global
% in Form einer Paketoption erfolgen und wird im folgenden
% Abschnitt~\ref{sec:scrpage2-de.basics.options} mit anderen Optionen
% beschrieben.%
%
% \subsubsection{Optionen beim Laden des Paketes}
% \label{sec:scrpage2-de.basics.options}
%
% Während bei den \KOMAScript-Klassen die Mehrzahl der Optionen auch noch nach
% dem Laden der Klasse mit \Macro{KOMAoptions} und \Macro{KOMAoption} geändert
% werden kann, trifft dies für das Paket \Package{scrpage2} nicht zu. Alle
% Optionen für dieses Paket müssen als globale Optionen, also im optionalen
% Argument von \Macro{documentclass}, oder als Paketoptionen, also im
% optionalen Argument von \Macro{usepackage}, angegeben werden.
%
% \bigskip\noindent%
% \DescribeOption{headinclude}%
% \DescribeOption{headexclude}%
% \DescribeOption{footinclude}%
% \DescribeOption{footexclude}%
% Diese Optionen sollten ab Version~2.3 des Pakets nicht mehr beispielsweise
% per optionalem Argument von \Macro{usepackage} oder per
% \Macro{PassOptionsToPackage} direkt an \Package{scrpage2} übergeben
% werden. Lediglich aus Gründen der Kompatibilität sind sie noch in
% \Package{scrpage2} deklariert und werden von diesem als
% \Option{headinclude}, \Option{headinclude=false}, \Option{footinclude} und
% \Option{footinclude=false} an das Paket \Package{typearea} weitergereicht
%
% \bigskip\noindent%
% \DescribeOption{headtopline}%
% \DescribeOption{plainheadtopline}%
% \DescribeOption{headsepline}%
% \DescribeOption{plainheadsepline}%
% \DescribeOption{footsepline}%
% \DescribeOption{plainfootsepline}%
% \DescribeOption{footbotline}%
% \DescribeOption{plainfootbotline}%
% Eine Grundeinstellung für die Linien unter und über den Kopf- und Fußzeilen
% kann mit diesen Optionen vorgenommen werden.  Diese Einstellungen gelten
% dann als Standard für alle mit \Package{scrpage2} definierten Seitenstile.
% Wird eine von diesen Optionen verwendet, dann wird eine Linienstärke von
% 0,4\,pt eingesetzt.  Da es zum Seitenstil \PageStyle{scrheadings} einen
% entsprechenden plain-Stil gibt, kann mit den \Option{plain\dots}-Optionen
% auch die entsprechende Linie des plain-Stils konfiguriert werden. Diese
% \Option{plain}-Optionen wirken aber nur, wenn auch die korrespondierende
% Option ohne \Option{plain} aktiviert wurde.  Somit zeigt die Option
% \Option{plainheadtopline} ohne \Option{headtopline} keine Wirkung.
%
% Bei diesen Optionen ist zu beachten, dass der entsprechende Seitenteil in
% den Textbereich des Satzspiegels mit übernommen wird, wenn eine Linie
% aktiviert wurde.  Wird also mittels \Option{headsepline} die Trennlinie
% zwischen Kopf und Text aktiviert, dann wird automatisch mittels
% \Package{typearea} der Satzspiegel so berechnet, dass der Seitenkopf Teil
% des Textblocks ist.
%
% Die Bedingungen für die Optionen des vorhergehenden Abschnitts gelten auch
% für diesen Automatismus.  Das bedeutet, dass das Paket \Package{typearea}
% nach \Package{scrpage2} geladen werden muss, beziehungsweise, dass bei
% Verwendung einer \KOMAScript{}-Klasse die Optionen \Option{headinclude} und
% \Option{footinclude} explizit bei \Macro{documentclass} gesetzt werden
% müssen, um Kopf- bzw. Fußzeile in den Textblock zu übernehmen.%
%
% \bigskip\noindent%
% \DescribeOption{ilines}%
% \DescribeOption{clines}%
% \DescribeOption{olines}%
% Bei\index{Linienausrichtung} der Festlegung der Linienlängen kann es
% vorkommen, dass die Linie zwar die gewünschte Länge, aber nicht die
% erwünschte Ausrichtung hat, da sie im Kopf- bzw. Fußbereich zentriert
% wird. Mit den hier vorgestellten Paketoptionen kann global für alle mit
% \Package{scrpage2} definierten Seitenstile diese Vorgabe modifiziert werden.
% Dabei setzt \Option{ilines} die Ausrichtung so, dass die Linien an den
% inneren Rand verschoben werden. Die Option \Option{clines} verhält sich wie
% die Standardeinstellung und \Option{olines} richtet am äußeren Rand aus.
%
% \begin{Example}
%   Hier gilt es, das Beispiel zu \Macro{setfootsepline} auf
%   Seite~\pageref{page:scrpage2-de.autoLineLength} mit dem folgenden zu
%   vergleichen, um die Wirkung der Option \Option{ilines} zu sehen.
% \begin{verbatim}
%   \usepackage[ilines,footsepline,footbotline]
%              {scrpage2}
%   \setfootbotline{2pt}  
%   \setfootsepline[text]{.4pt}
%   \setfootwidth[0pt]{textwithmarginpar}
% \end{verbatim}\vspace{-\baselineskip}
%   Allein die Verwendung der Option \Option{ilines} führt dabei zu der
%   geänderten Ausgabe, die nachfolgend veranschaulicht wird:
% \begin{XmpBotPage}
%         \XmpHeading{10,18}{85}
%         \thinlines\XmpRule{10,21}{70}
%         \thicklines\XmpRule{10,16}{85}
%         \XmpSetText[\XmpBotText]{10,36}
%         \XmpMarginNote{83,26}
% \end{XmpBotPage}
%   Die Trennlinie zwischen Text und Fuß wird bündig innen im Fußteil
%   gesetzt und nicht wie bei der Standardeinstellung zentriert.
% \end{Example}
%
% \bigskip\noindent%
% \DescribeOption{automark}%
% \DescribeOption{manualmark}%
% Diese Optionen bestimmen gleich zu Beginn des Dokuments, ob eine
% automatische Aktualisierung der Kolumnentitel erfolgt.  Die Option
% \Option{automark} schaltet die automatische Aktualisierung ein,
% \Option{manualmark} deaktiviert sie.  Ohne Verwendung einer der beiden
% Optionen bleibt die Einstellung erhalten, die beim Laden des Paketes gültig
% war.
% \begin{Example}
%   Sie laden das Paket \Package{scrpage2} unmittelbar nach der Klasse
%   \Class{scrreprt} und ohne weitere Optionen. Dazu schreiben Sie:
% \begin{verbatim}
%   \documentclass{scrreprt}
%   \usepackage{scrpage2}
% \end{verbatim}\vspace{-\baselineskip}
%   Da bei \Class{scrreprt} der Seitenstil \PageStyle{plain} voreingestellt
%   ist, ist dies auch jetzt noch der Fall. Außerdem entspricht die
%   Voreinstellung \PageStyle{plain} manuellen Kolumnentiteln. Wenn Sie
%   also anschließend mit
% \begin{verbatim}
%   \pagestyle{scrheadings}
% \end{verbatim}\vspace{-\baselineskip}
%   auf den Seitenstil \PageStyle{scrheadings} umschalten, sind noch immer
%   manuelle Kolumnentitel eingestellt.
%
%   Verwenden Sie stattdessen die Dokumentklasse \Class{scrbook}, so
%   ist nach
% \begin{verbatim}
%   \documentclass{scrbook}
%   \usepackage{scrpage2}
% \end{verbatim}\vspace{-\baselineskip}
%   der Seitenstil \PageStyle{headings} mit automatischen Kolumnentiteln
%   aktiviert. Bei anschließender Umschaltung auf den Seitenstil
%   \PageStyle{scrheadings} bleiben automatische Kolumnentitel
%   eingeschaltet. Dabei werden dann weiterhin die Markierungsmakros von
%   \Class{scrbook} verwendet.
%
%   Verwenden Sie hingegen
% \begin{verbatim}
%   \usepackage[automark]{scrpage2}
% \end{verbatim}\vspace{-\baselineskip}
%   so wird unabhängig von der verwendeten Klasse auf automatische
%   Kolumnentitel umgeschaltet, wobei die Markierungsmakros von
%   \Package{scrpage2} genutzt werden.  Natürlich wirkt sich dies auf den
%   Seitenstil \PageStyle{plain} von \Class{scrreprt} nicht aus. Die
%   Kolumnentitel werden erst sichtbar, wenn auf den Seitenstil
%   \PageStyle{scrheadings} oder \PageStyle{useheadings} oder einen selbst
%   definierten Seitenstil mit Kolumnentiteln umgeschaltet wird.
% \end{Example}
%
% \bigskip\noindent%
% \DescribeOption{autooneside}%
% Mit dieser Option wird das optionale Argument von
% \Macro{automark}\index{Kolumnentitel>automatisch} im einseitigen Satz
% automatisch ignoriert. Siehe hierzu auch die Erläuterung zum Befehl
% \Macro{automark} in Abschnitt~\ref{sec:scrpage2-de.basics.mark}.
%
% \bigskip\noindent%
% \DescribeOption{komastyle}%
% \DescribeOption{standardstyle}%
% Diese Optionen bestimmen, wie die beiden vordefinierten Seitenstile
% \PageStyle{scrheadings} und \PageStyle{scrplain} gestaltet sind.  Bei
% \Option{komastyle} wird eine Definition vorgenommen, wie sie den
% \KOMAScript-Klassen entspricht.  Bei den \KOMAScript-Klassen ist dies
% die Voreinstellung und kann somit auch für andere Klassen gesetzt werden.
%
% Die Option \Option{standardstyle} definiert die beiden Seitenstile wie es
% von den Standardklassen erwartet wird.  Außerdem wird hier automatisch
% \Option{markuppercase} aktiviert, es sei denn, \Option{markusedcase} wird
% ebenfalls als Option übergeben.
%
% \bigskip\noindent%
% \DescribeOption{markuppercase}%
% \DescribeOption{markusedcase}%
% Für die Funktionalität von \Macro{automark} modifiziert \Package{scrpage2}
% interne Befehle, die die Gliederungsbefehle benutzen, um die lebenden
% Kolumnentitel zu setzen.  Da einige Klassen, im Gegensatz zu den
% \KOMAScript-Klassen, die Kolumnentitel in Großbuchstaben schreiben, muss
% \Package{scrpage2} wissen, wie die genutzte Dokumentklasse die lebenden
% Kolumnentitel darstellt.
%
% Die Option \Option{markuppercase} zeigt \Package{scrpage2}, dass die
% benutzte Klasse die Großschreibweise benutzt.  Die Option
% \Option{markusedcase} sollte angegeben werden, wenn die benutzte
% Dokumentklasse keine Großschreibweise verwendet.  Die Optionen sind nicht
% geeignet, eine entsprechende Darstellung zu erzwingen. Es kann somit zu
% unerwünschten Effekten kommen, wenn die Angabe nicht dem Verhalten der
% Dokumentklasse entspricht.
%
% \bigskip\noindent%
% \DescribeOption{nouppercase}%
% Wie in obiger Erklärung zu \Option{markuppercase} und \Option{markusedcase}
% bereits ausgeführt wurde, gibt es Klassen und auch Pakete, die beim Setzen
% der lebenden Kolumnentitel\index{Kolumnentitel>automatisch} mit Hilfe einer
% der Anweisungen \Macro{uppercase} oder \Macro{MakeUppercase} den gesamten
% Eintrag in Großbuchstaben wandeln. Mit der Option \Option{nouppercase}
% können diese beiden Anweisungen im Kopf und im Fuß außer Kraft gesetzt
% werden. Das gilt aber nur für Seitenstile, die mit Hilfe von
% \Package{scrpage2} definiert werden. Dazu zählen auch
% \PageStyle{scrheadings} und der zugehörige plain-Seitenstil.
%
% Die verwendete Methode ist äußerst brutal und kann dazu führen, dass auch
% erwünschte Änderungen von Klein- in
% Großbuchstaben\index{Grossbuchstaben=Großbuchstaben} unterbleiben. Da diese
% Fälle nicht sehr häufig sind, stellt \Option{nouppercase} aber meist eine
% brauchbare Lösung dar.
% \begin{Example}
%   Sie verwenden die Standardklasse \Class{book}, wollen aber, dass die
%   lebenden Kolumnentitel nicht in Großbuchstaben, sondern in normaler
%   gemischter Schreibweise gesetzt werden. Die Präambel Ihres Dokuments
%   könnte dann wie folgt beginnen:
% \begin{verbatim}
%   \documentclass{book}
%   \usepackage[nouppercase]{scrpage2}
%   \pagestyle{scrheadings}
% \end{verbatim}\vspace{-\baselineskip}
%   Die Umschaltung auf den Seitenstil \PageStyle{scrheadings} ist
%   notwendig, weil sonst der Seitenstil \PageStyle{headings} verwendet
%   wird, der von der Option \Option{nouppercase} nicht behandelt wird.
% \end{Example}
%
% In einigen Fällen setzen nicht nur Klassen, sondern auch Pakete lebende
% Kolumnentitel in Großbuchstaben. Auch in diesen Fällen hilft
% \Option{nouppercase} meist, um zu gemischter Schreibweise zurückzuschalten.
%
% \subsection{Seitenstile selbst gestalten}\label{sec:scrpage2-de.UI}
% \subsubsection{Die Anwenderschnittstelle}\label{sec:scrpage2-de.UI.user}
%
% \DescribeMacro\deftripstyle%
% Nun möchte man ja nicht immer an die vorgegebenen Seitenstile gebunden sein,
% sondern auch seiner Kreativität freien Lauf lassen.
% Manchmal ist man auch dazu gezwungen, weil eine bestimmte
% \emph{Corporate Identity} einer Firma es verlangt.
% Der einfachste Weg damit umzugehen ist
% \begin{flushleft}
%   \Macro{deftripstyle}\marg{Name}\\*
%   \hphantom{\Macro{deftripstyle}}\oarg{LA}\oarg{LI}\\*
%   \hphantom{\Macro{deftripstyle}}\marg{KI}\marg{KM}\marg{KA}\\*
%   \hphantom{\Macro{deftripstyle}}\marg{FI}\marg{FM}\marg{FA}
% \end{flushleft}%
% Die einzelnen Felder haben folgende Bedeutung:
% \begin{labeling}[~--]{\meta{Name}}
% \item[\meta{Name}] die Bezeichnung des Seitenstils, die dann bei der
%   Aktivierung mit \Macro{pagestyle}\marg{Name} oder
%   \Macro{thispagestyle}\marg{Name} verwendet wird
% \item[\meta{LA}] die Dicke der äußeren Linien, d.\,h. der Linien über der
%   Kopfzeile und unter der Fußzeile (optional)
% \item[\meta{LI}] die Dicke der inneren Linie, d.\,h. der Linien die Kopf und
%   Fuß vom Textkörper trennen (optional)
% \item[\meta{KI}] Inhalt des Feldes im Kopf innenseitig oder bei einseitigem
%   Layout links
% \item[\meta{KM}] Inhalt des Feldes im Kopf zentriert
% \item[\meta{KA}] Inhalt des Feldes im Kopf außenseitig oder bei einseitigem
%   Layout rechts
% \item[\meta{FI}] Inhalt des Feldes im Fuß innenseitig oder bei einseitigem
%   Layout links
% \item[\meta{FM}] Inhalt des Feldes im Fuß zentriert
% \item[\meta{FA}] Inhalt des Feldes im Fuß außenseitig oder bei einseitigem
%   Layout rechts
% \end{labeling}
%
% Der Befehl \Macro{deftripstyle} stellt sicherlich die einfachste Möglichkeit
% dar, Seitenstile zu definieren.  Leider sind damit auch Einschränkungen
% verbunden, da in einem Seitenbereich mit einem durch \Macro{deftripstyle}
% deklarierten Seitenstil keine Änderung der Kopf- und Fußlinien erfolgen
% kann.
%
% \begin{Example}
%   Vorgegeben sei ein doppelseitiges Layout, bei dem die Kolumnentitel innen
%   erscheinen sollen.  Weiterhin soll der Dokumenttitel, in diesem Fall kurz
%   \glqq Bericht\grqq, an den Außenrand in den Kopf, die Seitenzahl soll
%   zentriert in den Fuß.
% \begin{verbatim}
%   \deftripstyle{DerBericht}%
%                 {\headmark}{}{Bericht}%
%                 {}{\pagemark}{}
% \end{verbatim}\vspace{-\baselineskip}
%
%   Sollen weiterhin die Linien über dem Kopf und unter dem Fuß
%   mit 2\,pt erscheinen und der ganze Textkörper mit dünnen Linien
%   von 0,4\,pt von Kopf und Fuß abgesetzt werden, dann erweitert
%   man vorherige Definition.
% \begin{verbatim}
%   \deftripstyle{DerBericht}[2pt][.4pt]%
%                 {\headmark}{}{Bericht}%
%                 {}{\pagemark}{}
% \end{verbatim}\vspace{-\baselineskip}
%   Das Ergebnis ist in Abbildung~\ref{fig:scrpage2-de2.tomuchlines} zu sehen.
%   \begin{figure}
%     \centering
%     \setlength{\unitlength}{1.15mm}%
%     \begin{picture}(85,51)\scriptsize
%       \thinlines
%       \put(0,0){\line(0,1){51}}
%       \put(45,0){\line(0,1){51}}
%       \put(0,51){\line(1,0){40}}
%       \put(45,51){\line(1,0){40}}
%       \thicklines
%       \put(40,0){\line(0,1){51}}
%       \put(85,0){\line(0,1){51}}
%       \put(0,0){\line(1,0){40}}
%       \put(45,0){\line(1,0){40}}
%       \XmpHeading[Bericht\hfill 2 Das Auge]{6,47}{30}
%       \XmpHeading[2.1 Netzhaut\hfill Bericht]{49,47}{30}
%       \XmpHeading[\hfill 14\hfill]{6,6.5}{30}
%       \XmpHeading[\hfill 15\hfill]{49,6.5}{30}
%       \put(6,44){\makebox(0,0)[tl]{\parbox{30\unitlength}{\tiny%
%             \textbf{2.1 Netzhaut}\\
%             \XmpText[49]}}}
%       \put(49,44){\makebox(0,0)[tl]{\parbox{30\unitlength}{\tiny%
%             \XmpText[51]}}}
%       \thinlines
%       \XmpRule{6,45.5}{30}\XmpRule{49,45.5}{30}
%       \XmpRule{6,8}{30}\XmpRule{49,8}{30}
%       \linethickness{1pt}
%       \XmpRule{6,49}{30}\XmpRule{49,49}{30}
%       \XmpRule{6,5}{30}\XmpRule{49,5}{30}
%     \end{picture}
%     \caption{Beispiel für einen selbst definierten, von Linien dominierten
%       Seitenstil mit einem statischen und einem lebenden Kolumnentitel im Kopf
%       und der Seitenzahl in der Mitte des Fußes.}
%   \label{fig:scrpage2-de2.tomuchlines}%
% \end{figure}
% \end{Example}
%
% \subsubsection{Die Expertenschnittstelle}\label{sec:scrpage2-de.UI.expert}
%
% Einfache Seitenstile, wie sie mit \Macro{deftripstyle} deklariert
% werden können, sind erfahrungsgemäß selten.
% Entweder verlangt ein Professor, dass die Diplomarbeit so aussieht
% wie seine eigene -- und wer will ihm da \emph{ernsthaft} widersprechen --
% oder eine Firma möchte, dass die halbe Finanzbuchhaltung im
% Seitenfuß auf"|taucht. Alles kein Problem, denn es gibt noch:
% \begin{flushleft}
%   \Macro{defpagestyle}\marg{Name}\marg{Kopfdefinition}\marg{Fußdefinition}\\
%   \Macro{newpagestyle}\marg{Name}\marg{Kopfdefinition}\marg{Fußdefinition}\\
%   \Macro{renewpagestyle}\marg{Name}\marg{Kopfdefinition}\marg{Fußdefinition}\\
%   \Macro{providepagestyle}\marg{Name}\marg{Kopfdefinition}\marg{Fußdefinition}\\
% \end{flushleft}%
% Dies sind die Befehle, die die volle Kontrolle über die Gestaltung eines
% Seitenstils ermöglichen. Der Aufbau ist bei allen vier Definitionen gleich,
% sie unterscheiden sich nur hinsichtlich der Wirkungsweise.
% \begin{labeling}[\ --]{\Macro{providepagestyle}}
% \item[\Macro{defpagestyle}] definiert einen neuen Seitenstil.  Existiert
%   bereits einer mit diesem Namen, wird dieser überschrieben.
% \item[\Macro{newpagestyle}] definiert einen neuen Seitenstil. Wenn schon
%   einer mit diesem Namen existiert, wird ein Fehler ausgegeben.
% \item[\Macro{renewpagestyle}] definiert einen bestehenden Seitenstil
%   um. Wenn noch keiner mit diesem Namen existiert, wird ein Fehler
%   ausgegeben.
% \item[\Macro{providepagestyle}] definiert einen neuen Seitenstil nur dann,
%   wenn dieser vorher noch nicht existiert.
% \end{labeling}
%
% Am Beispiel von \Macro{defpagestyle} soll die Syntax der Definitionen im
% Folgenden erläutert werden.
% \begin{labeling}[~--]{\meta{Kopfdefinition}\,}
% \item[\meta{Name}] die Bezeichnung des Seitenstils
% \item[\meta{Kopfdefinition}] die Deklaration des Seitenkopfes bestehend aus
%   fünf Teilen, wobei die in runden Klammern stehenden Angaben optional
%   sind:\hfill\\
%   \parg{OLL,OLD}\marg{GS}\marg{US}\marg{ES}\parg{ULL,ULD}
% \item[\meta{Fußdefinition}] die Deklaration des Seitenfußes bestehend aus
%   fünf Teilen, wobei die in runden Klammern stehenden Angaben optional
%   sind:\hfill\\
%   \parg{OLL,OLD}\marg{GS}\marg{US}\marg{ES}\parg{ULL,ULD}
% \end{labeling}
%
% Wie zu sehen ist, haben Kopf- und Fußdefinition identischen Aufbau. Die
% einzelnen Parameter haben folgende Bedeutung:
% \begin{labeling}[\ --]{\meta{OLD}}
% \item[\meta{OLL}] obere Linienlänge: Kopf = außen, Fuß = Trennlinie
% \item[\meta{OLD}] obere Liniendicke
% \item[\meta{GS}]  Definition für die \emph{gerade} Seite
% \item[\meta{US}]  Definition für die \emph{ungerade} Seite
% \item[\meta{ES}]  Definition für \emph{einseitiges} Layout
% \item[\meta{ULL}] untere Linienlänge Kopf = Trennlinie, Fuß = außen
% \item[\meta{ULD}] untere Liniendicke
% \end{labeling}
%
% Werden die optionalen Linienargumente nicht gesetzt, dann bleibt das
% Verhalten weiterhin durch die in
% Abschnitt~\ref{sec:scrpage2-de.basics.format} vorgestellten Linienbefehle
% konfigurierbar.
%
% Die drei Felder \meta{GS}, \meta{US} und \meta{ES} entsprechen Boxen, die
% die Breite des Kopf- bzw. Fußteils haben.
% Die entsprechenden Definitionen erscheinen in diesen Boxen linksbündig.
% Um somit etwas links- \emph{und} rechtsseitig in den Boxen zu platzieren,
% kann der Zwischenraum mit \Macro{hfill} gestreckt werden:
% \begin{verbatim}
%   {\headmark\hfill\pagemark}
% \end{verbatim}\vspace{-\baselineskip}
%
% Um zusätzlich etwas zentriert erscheinen zu lassen, ist eine erweiterte
% Definition notwendig.
% Die Befehle \Macro{rlap} und \Macro{llap} setzen die übergebenen Argumente.
% Für \LaTeX{} erscheint es aber so, dass diese Texte eine Breite von Null
% haben. Nur so erscheint der mittlere Text auch wirklich zentriert.
% \begin{verbatim}
%   {\rlap{\headmark}\hfill zentriert\hfill\llap{\pagemark}}
% \end{verbatim}\vspace{-\baselineskip}
%
% \begin{Example}
%   Angenommen es wird die Dokumentklasse \Class{scrbook} genutzt.  Damit
%   liegt ein zweiseitiges Layout vor.  Für das Paket \Package{scrpage2} wird
%   festgelegt, dass mit automatisch aktualisierten Kolumnentiteln gearbeitet
%   wird und dass im Seitenstil \PageStyle{scrheadings} eine Trennlinie
%   zwischen Kopf und Text gezogen wird.
%
% \begin{verbatim}
%   \documentclass{scrbook}
%   \usepackage[automark,headsepline]{scrpage2}
% \end{verbatim}\vspace{-\baselineskip}
%
%   Mit Hilfe der Expertenschnittstelle werden zwei Seitenstile definiert. Der
%   erste legt keine Linienargumente fest, im zweiten wird die Linie über dem
%   Kopf mit einer Dicke von 1\,pt und die Linie unter dem Kopf mit 0\,pt
%   festgelegt.
%
% \begin{verbatim}
%   \defpagestyle{ohneLinien}{%
%     {Beispiel\hfill\headmark}
%     {\headmark\hfill ohne Linien}
%     {\rlap{Beispiel}\hfill\headmark\hfill%
%      \llap{ohne Linien}}
%   }{%
%     {\pagemark\hfill}
%     {\hfill\pagemark}
%     {\hfill\pagemark\hfill}
%   }
%   \defpagestyle{mitLinien}{%
%     (\textwidth,1pt)
%     {mit Linien\hfill\headmark}
%     {\headmark\hfill mit Linien}
%     {\rlap{\KOMAScript}\hfill \headmark\hfill%
%      \llap{mit Linien}}
%     (0pt,0pt)
%   }{%
%     (\textwidth,.4pt)
%     {\pagemark\hfill}
%     {\hfill\pagemark}
%     {\hfill\pagemark\hfill}
%     (\textwidth,1pt)
%   }
% \end{verbatim}\vspace{-\baselineskip}
%   Gleich zu Beginn wird der Seitenstil \PageStyle{scrheadings} aktiviert.
%   Mit \Macro{chapter} wird ein neues Kapitel begonnen.  Weiterhin wird
%   automatisch durch \Macro{chapter} der Seitenstil für diese Seite auf
%   \PageStyle{plain} gesetzt.  Das folgende \Macro{chead} zeigt, wie durch
%   Modifikation des plain-Stils ein Kolumnentitel erzeugt werden kann.
%   Grundsätzlich sollte jedoch davon Abstand genommen werden, da sonst der
%   Markierungscharakter der plain-Seite verloren geht. Es ist wichtiger
%   anzuzeigen, dass hier ein neues Kapitel beginnt, als dass ein Abschnitt
%   dieser Seite einen bestimmten Titel trägt.
%
% \begin{verbatim}
%   \begin{document}
%   \pagestyle{scrheadings}
%   \chapter{Thermodynamik}
%   \chead[\leftmark]{}
%   \section{Hauptsätze}
%   Jedes System besitzt eine extensive Zustandsgröße 
%   Energie. Sie ist in einem abgeschlossenen System 
%   konstant.
% \end{verbatim}\vspace{-\baselineskip}%
%   \begin{XmpTopPage}
%         \XmpHeading[\hfill\textsl{1 Thermodynamik}\hfill]{10,27}{70}
%         \put(10,17){\normalsize\textbf{\sffamily 1 Thermodynamik}}
%         \put(10,12){\textbf{\sffamily 1.1 Hauptsätze}}
%         \XmpSetText[%
%         Jedes System besitzt eine extensive Zustands\char\defaulthyphenchar
%         \linebreak]{10,9}
%   \end{XmpTopPage}
%
%   Nach dem Seitenwechsel ist der Seitenstil \PageStyle{scrheadings}
%   aktiv, und somit auch die Trennlinie aus den Paketoptionen sichtbar.
% \begin{verbatim}
%   Es existiert eine Zustandsgröße, genannt die 
%   Entropie eines Systems, deren zeitliche Änderung
%   sich aus Entropieströmung und Entropieerzeugung
%   zusammensetzt.
% \end{verbatim}\vspace{-\baselineskip}
%   \begin{XmpTopPage}
%         \XmpHeading[\textsl{1 Thermodynamik}\hfill]{20,27}{70}
%         \thinlines\XmpRule{20,25}{70}
%         \XmpSetText[%
%         Es existiert eine Zustandsgröße, genannt die En"-tropie
%      eines Systems, deren zeitliche Änderung sich aus
%      Entropieströmung und Entropie\char\defaulthyphenchar\kern-1pt
%      \linebreak]{20,21}
%   \end{XmpTopPage}
%
%   Wiederum nach einem Seitenwechsel wird auf manuelle Kolumnentitel gewechselt
%   und der Seitenstil \texttt{ohneLinien} aktiviert.  Da keine Linienargumente
%   bei der Definition dieses Stils genutzt wurden, wird die
%   Standard-Linien\-konfiguration verwendet. Diese zeichnet hier eine Linie
%   zwischen Kopf und Text, da \Option{headsepline} als Argument für
%   \Package{scrpage2} angegeben wurde.%
% \begin{verbatim}
%   \manualmark
%   \pagestyle{ohneLinien}
%   \section{Exergie und Anergie}
%   \markright{Energieumwandlung}
%   Man bezeichnet die bei der Einstellung des 
%   Gleichgewichts mit der Umgebung maximal gewinnbare
%   Arbeit als Exergie.
% \end{verbatim}\vspace{-\baselineskip}%
%   \begin{XmpTopPage}
%         \XmpHeading[\slshape Energieumwandlung\hfill ohne Linien]{10,27}{70}
%         \thinlines\XmpRule{10,25}{70}
%         \XmpSetText[{%
%         \textbf{\sffamily 1.2 Exergie und Anergie}\\[2pt]
%         Man bezeichnet die bei der Einstellung des
%         Gleichgewichts mit der Umgebung maximal\linebreak}]{10,21}
%   \end{XmpTopPage}
%
%   Nach dem Wechsel auf die folgende linke Seite wird der Seitenstil
%   \texttt{mitLinien} aktiviert.  Die Linieneinstellungen werden hier nun
%   angewendet und entsprechend der Definition dargestellt.
% \begin{verbatim}
%   \pagestyle{mitLinien}
%   \renewcommand{\headfont}{\itshape\bfseries}
%   Den nicht in Exergie umwandelbaren Anteil einer
%   Energie nennt man Anergie \Var{B}.
%   \[ B = U + T (S_1 - S_u) - p (V_1 - V_u)\] 
%   \end{document}
% \end{verbatim}\vspace{-\baselineskip}
%   \begin{XmpTopPage}
%         \XmpHeading[\itshape\bfseries mit Linien\hfill 1 Thermodynamik]{20,27}{70}
%         \thicklines\XmpRule{20,29}{70}
%         \XmpSetText[%
%         Den nicht in Exergie umwandelbaren Anteil einer
%         Energie nennt man Anergie $B$. 
%         \vspace{-.5ex}\[ B = U + T (S_1 - S_u) - p (V_1 - V_u)\] ]{20,21}
%   \end{XmpTopPage}
% \end{Example}
%
% \subsubsection{Seitenstile verwalten}\label{sec:scrpage2-de.UI.cfgFile}
%
% Bei längerer Arbeit mit verschiedenen Seitenstilen wird sich, je nach
% Geschmack und Aufgabenstellung, ein fester Satz an benutzten Stilen
% etablieren.  Um nicht bei jedem neuen Projekt eine große Kopieraktion von
% den Daten eines Projekts zum neuen Projekt starten zu müssen, liest
% \Package{scrpage2} am Ende seiner Initialisierungsphase die Datei
% \File{scrpage.cfg} ein.  In dieser Datei können dann Seitenstile definiert
% sein, die viele Projekte gemeinsam nutzen können.
%
% \StopEventually{\PrintIndex\PrintChanges}
%
% \selectlanguage{english}
% \section{Implementation}
%
% Currently this package doesn't share any code but the \KOMAScript{} logo
% with other packages.  So all the code of this package but the implementation
% of the \KOMAScript{} logo is at this file and their is nor more code at this
% file.
%
% \changes{v3.24}{2017/05/08}{warning about obsolete package added}
%    \begin{macrocode}
%<*scrpage2>
\PackageWarning{scrpage2}{usage of obsolete package!\MessageBreak
  Package `scrpage2' is obsolete.\MessageBreak
  You should not longer use package `scrpage2'.\MessageBreak
  You should replace usage of package `scrpage2'\MessageBreak
  by `scrlayer-scrpage'}
%    \end{macrocode}
% \changes{v1.1}{1995/06/27}{\cs{hbox to} changed into \cs{hb@xt@}.}
% \changes{v2.2c}{2007/07/23}{a lot of \% added and removed}
%
% \subsection{Options}
% \begin{option}{headinclude}
% \changes{v2.3}{2008/12/08}{obsolete}%
% \begin{option}{headexclude}
% \changes{v2.3}{2008/12/08}{obsolete}%
% \begin{option}{footinclude}
% \changes{v2.3}{2008/12/08}{obsolete}%
% \begin{option}{footexclude}
% \changes{v2.3}{2008/12/08}{obsolete}%
% \texttt{scrpage2} has known some options. They are similar to the
% old \KOMAScript{} classes. To work with and without the \KOMAScript{}
% classes their definitions are not quite simple.
%    \begin{macrocode}
\newcommand*{\@Pass@Obsolete@Option@To@Typearea}[1]{%
  \@expandtwoargs\in@{,\CurrentOption,}{,\@curroptions,}%
  \ifin@
    \PackageWarningNoLine{scrpage2}{%
      deprecated passing option `\CurrentOption' to scrpage2.\MessageBreak
      If you are using package typearea or\MessageBreak
      a KOMA-Script class since version 3.00\MessageBreak
      you may use `\string\KOMAoptions{#1}' and\MessageBreak
      remove passing `\CurrentOption' to scrpage2%
    }%
    \begingroup\expandafter\expandafter\expandafter\endgroup
    \expandafter\ifx\csname KOMAoptions\endcsname\relax
      \PassOptionsToPackage{#1}{typearea}%
    \else
      \KOMAoptions{#1}\csname relcalctypearea\endcsname
    \fi
  \fi
}
\DeclareOption{headinclude}{%
  \@Pass@Obsolete@Option@To@Typearea{headinclude}%
}
\DeclareOption{headexclude}{%
  \@Pass@Obsolete@Option@To@Typearea{headinclude=false}%
}
\DeclareOption{footinclude}{%
  \@Pass@Obsolete@Option@To@Typearea{footinclude}%
}
\DeclareOption{footexclude}{%
  \@Pass@Obsolete@Option@To@Typearea{footinclude=false}%
}
%    \end{macrocode}
% We do so, because we want so set |headinclude|, |footinclude| by
% default at old version (see below)!
% \end{option}
% \end{option}
% \end{option}
% \end{option}
%
% We have additional options designed for the additional interface.
% \begin{option}{mpinclude}
% \changes{v2.8q}{2002/03/28}{New option}
% \begin{option}{mpexclude}
% \changes{v2.8q}{2002/03/28}{New option}
% There are documents where the head and foot should span not only the
% text but also the marginpar. We have an option to do this at
% initialization. This option corresponds with the option of package
% \texttt{typearea} and the classes.
% \begin{macro}{\if@mincl}
% \begin{macro}{\@mincltrue}
% \begin{macro}{\@minclfalse}
% \changes{v2.2g}{2008/11/19}{Test fixed}
%    \begin{macrocode}
\@ifundefined{@mincltrue}{\newif\if@mincl}{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%    \begin{macrocode}
\DeclareOption{mpinclude}{\@mincltrue}
\DeclareOption{mpexclude}{\@minclfalse}
%    \end{macrocode}
% \end{option}
% \end{option}
%
% Other new options redefine macros, so we have to define them first.
% \begin{macro}{\scr@headabove@linethickness}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scr@headbelow@linethickness}
% \changes{v2.0}{2001/03/30}{New}
% \begin{macro}{\scr@footabove@linethickness}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scr@footbelow@linethickness}
% \changes{v2.0}{2001/04/20}{New}
% These macros define the thickness of the line above and below the head
% and the foot.
%    \begin{macrocode}
\newcommand*{\scr@headabove@linethickness}{0pt}
\newcommand*{\scr@headbelow@linethickness}{0pt}
\newcommand*{\scr@footabove@linethickness}{0pt}
\newcommand*{\scr@footbelow@linethickness}{0pt}
%    \end{macrocode}
% \begin{macro}{\scr@headabove@linelength}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scr@headbelow@linelength}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scr@footabove@linelength}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scr@footbelow@linelength}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@headabove@linelength}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@headbelow@linelength}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@footabove@linelength}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@footbelow@linelength}
% \changes{v2.0}{2001/04/20}{New}
% Because we want to have the ``line definitions'' at one place, we
% also define the length of the lines here. We have own length at to
% be used at pagestyle \texttt{scrplain}.
%    \begin{macrocode}
\newcommand*{\scr@headabove@linelength}{\@headwidth}
\newcommand*{\scr@headbelow@linelength}{\@headwidth}
\newcommand*{\scr@footabove@linelength}{\@footwidth}
\newcommand*{\scr@footbelow@linelength}{\@footwidth}
\newcommand*{\scrplain@headabove@linelength}{0pt}
\newcommand*{\scrplain@headbelow@linelength}{0pt}
\newcommand*{\scrplain@footabove@linelength}{0pt}
\newcommand*{\scrplain@footbelow@linelength}{0pt}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% 
% \begin{option}{headtopline}
% \changes{v2.0}{2001/04/20}{New option}
% \begin{option}{headsepline}
% \changes{v2.0}{2001/04/20}{New option}
% \begin{option}{footsepline}
% \changes{v2.0}{2001/04/20}{New option}
% \begin{option}{footbotline}
% \changes{v2.0}{2001/04/20}{New option}
% \begin{option}{plainheadtopline}
% \changes{v2.0}{2001/04/20}{New option}
% \begin{option}{plainheadsepline}
% \changes{v2.0}{2001/04/20}{New option}
% \begin{option}{plainfootsepline}
% \changes{v2.0}{2001/04/20}{New option}
% \begin{option}{plainfootbotline}
% \changes{v2.0}{2001/04/20}{New option}
% The thickness can be set by four simple options:
%    \begin{macrocode}
\DeclareOption{headtopline}{%
  \renewcommand*{\scr@headabove@linethickness}{.4pt}
  \PassOptionsToPackage{headinclude}{typearea}}
\DeclareOption{headsepline}{%
  \renewcommand*{\scr@headbelow@linethickness}{.4pt}
  \PassOptionsToPackage{headinclude}{typearea}}
\DeclareOption{footsepline}{%
  \renewcommand*{\scr@footabove@linethickness}{.4pt}
  \PassOptionsToPackage{footinclude}{typearea}}
\DeclareOption{footbotline}{
  \renewcommand*{\scr@footbelow@linethickness}{.4pt}
  \PassOptionsToPackage{footinclude}{typearea}}
\DeclareOption{plainheadtopline}{%
  \renewcommand*{\scrplain@headabove@linelength}{\scr@headabove@linelength}
  \PassOptionsToPackage{headinclude}{typearea}}
\DeclareOption{plainheadsepline}{%
  \renewcommand*{\scrplain@headbelow@linelength}{\scr@headbelow@linelength}
  \PassOptionsToPackage{headinclude}{typearea}}
\DeclareOption{plainfootsepline}{%
  \renewcommand*{\scrplain@footabove@linelength}{\scr@footabove@linelength}
  \PassOptionsToPackage{footinclude}{typearea}}
\DeclareOption{plainfootbotline}{
  \renewcommand*{\scrplain@footbelow@linelength}{\scr@footbelow@linelength}
  \PassOptionsToPackage{footinclude}{typearea}}
%    \end{macrocode}
% \end{option}
% \end{option}
% \end{option}
% \end{option}
% \end{option}
% \end{option}
% \end{option}
% \end{option}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\hfline@adjust}
% \changes{v2.0f}{2001/06/23}{New}
% \begin{option}{ilines}
% \changes{v2.0f}{2001/06/23}{New}
% \begin{option}{clines}
% \changes{v2.0f}{2001/06/23}{New}
% \begin{option}{olines}
% \changes{v2.0f}{2001/06/23}{New}
% At Version 2 lines may be inner adjusted (0), centered (1) or outer
% adjusted (2):
%    \begin{macrocode}
\newcommand*{\hfline@adjust}{1}
\DeclareOption{ilines}{\renewcommand*{\hfline@adjust}{0}}
\DeclareOption{clines}{\renewcommand*{\hfline@adjust}{1}}
\DeclareOption{olines}{\renewcommand*{\hfline@adjust}{2}}
%    \end{macrocode}
% \end{option}
% \end{option}
% \end{option}
% \end{macro}
%
% \begin{option}{automark}
% \changes{v2.0b}{2001/05/31}{use \cs{AtEndOfPackage} to run not yet
%     defined macro}
% \begin{option}{manualmark}
% \changes{v2.0b}{2001/05/31}{use \cs{AtEndOfPackage} to run not yet
%     defined macro}
% \changes{v2.0i}{2001/08/17}{don't ignore oneside any longer}
% At version 2 we want to distinguish between running headline and
% static headline not only using different pagestyles. We do this with
% options and commands. But here only the options are defined.
%    \begin{macrocode}
\DeclareOption{automark}{%
  \AtEndOfPackage{\if@twoside%
      \if@chapter\automark[section]{chapter}%
      \else\automark[subsection]{section}\fi%
    \else%
      \if@chapter\automark{chapter}\else\automark{section}\fi%
    \fi}}
\DeclareOption{manualmark}{\AtEndOfPackage{\manualmark}}
%    \end{macrocode}
% \end{option}
% \end{option}
%
% \begin{option}{autoonesize}
% \changes{v2.0i}{2001/08/17}{New}
% \begin{macro}{\if@autooneside}
% \changes{v2.0i}{2001/08/17}{New}
% If the optional argument of \cs{automark} should be irgnored at
% onside mode, use this option:
%    \begin{macrocode}
\newif\if@autooneside\@autoonesidefalse
\DeclareOption{autooneside}{\@autoonesidetrue}
%    \end{macrocode}
% \end{macro}
% \end{option}
%
% \begin{option}{markuppercase}
% \changes{v2.0c}{2001/06/07}{New}
% \begin{option}{markusedcase}
% \changes{v2.0c}{2001/06/07}{New}
% For use of running headlines there are also options to say ``class
% uses upper case at the automatic marks'' or ``class use same case at
% the automatic marks like used writing the heading''.  
%    \begin{macrocode}
\DeclareOption{markuppercase}{\let\MakeMarkcase\MakeUppercase}
\DeclareOption{markusedcase}{\let\MakeMarkcase\@empty}
%    \end{macrocode}
% \end{option}
% \end{option}
%
% \begin{macro}{\scr@nouppercase}
% \changes{v2.0j}{2001/08/18}{New}
% \begin{option}{nouppercase}
% \changes{v2.0j}{2001/08/18}{New}
% Sometimes scrpage2 may be used with a class, which uses
% \cs{uppercase} or \cs{MakeUppercase} at \cs{markboth} or
% \cs{markright}. But the author does not want upper case at the
% headlines. So we define an option, that simply deaktivates
% \cs{uppercase} and \cs{MakeUppercase} at all heads and foots,
% defined by scrpage2.
%    \begin{macrocode}
\newcommand*{\scr@nouppercase}{}
\DeclareOption{nouppercase}{\renewcommand*{\scr@nouppercase}{%
    \let\uppercase\relax\let\MakeUppercase\relax
    \expandafter\let\csname MakeUppercase \endcsname\relax}
  \ifx\MakeMarkcase\MakeUppercase
    \PackageWarning{scrpage2}{%
      Option 'markuppercase' will be ignored.\MessageBreak%
      You shouldn't use option 'markuppercase' together\MessageBreak%
      with option 'nouppercase'}
    \let\MakeMarkcase\@empty
  \fi}
%    \end{macrocode}
% \end{option}
% \end{macro}
%
% \begin{option}{komastyle}
% \begin{option}{standardstyle}
% At version 2 there is an predefined pagestyle ``scrheadings''. With
% the two options you may decide, wether it has to behave like
% ``headings'' at the standard classes or the KOMA-Script classes.
% The macro saves the name of the style.
%    \begin{macrocode}
\DeclareOption{komastyle}{\def\scrheadings@style{koma}
  \@ifundefined{MakeMarkcase}{\let\MakeMarkcase\relax}{}}
\DeclareOption{standardstyle}{\def\scrheadings@style{standard}
  \@ifundefined{MakeMarkcase}{\let\MakeMarkcase\MakeUppercase}{}}
%    \end{macrocode}
% \end{option}
% \end{option}
%
%
% We don't need default options.
%    \begin{macrocode}
\ExecuteOptions{}
%    \end{macrocode}
% But you may set other Options:
%    \begin{macrocode}
\ProcessOptions\relax
%    \end{macrocode}
%
%
% \subsection{Some Initialisation}
%
% For easier handling of the differences between article-, report- and
% book-classes we define some more switches.
%
% \begin{macro}{\if@chapter}
% \changes{v2.1b}{2003/05/31}{more save test}
% First distinguish between article and others.
%    \begin{macrocode}
\newif\if@chapter
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname chapter\endcsname\relax 
  \@chapterfalse
\else
  \@chaptertrue
\fi
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@mainmatter}
% \changes{v1.2}{1995/07/08}{Definition changed}
% \changes{v2.1b}{2003/05/31}{more save test}
% \changes{v2.2d}{2007/03/13}{additional \cs{if@mainmatter} test}
% \changes{v2.2g}{2008/11/19}{usage of \cs{if@mainmatter} at message
%     removed}
% Next distinguish between matter- and nomatter-classes.
%    \begin{macrocode}
\def\@tempa{\newif\if@mainmatter\@mainmattertrue}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname mainmatter\endcsname\relax
\else
  \@ifundefined{@mainmattertrue}{%
    \PackageWarningNoLine{scrpage2}{%
      \string\mainmatter\space defined without
      \expandafter\string\csname if@mainmatter\endcsname!\MessageBreak
      This switch is obligatory for scrpage2 to omit\MessageBreak
      running head chapter numbers in front and\MessageBreak
      back matter and will be defined now%
    }%
  }{%
    \let\@tempa\relax
  }%
\fi
\@tempa
%    \end{macrocode}
% \end{macro}
%
%
% \subsection{Predefinitions}
% There are some commands, you can use at pagestyle-definition.
%
% \begin{macro}{\headmark}
% This macro is |\rightmark| or |\leftmark|. But outside
% pagestyle-definition it's nothing.
%    \begin{macrocode}
\let\headmark\relax
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pagemark}
% This macro is the number of the page at the pagenumberfont:
%    \begin{macrocode}
\DeclareRobustCommand\pagemark{{\pnumfont\thepage}}
%    \end{macrocode}
% \end{macro}
%
%
% \subsection{Expert-Pagestyle-Definition-Interface}
% The pagestyle-definition-interface for experts is not as easy as the
% simple interface we'll define later. But it's more flexible. We'll
% later use it to define the pagestyle-definition-interface for users.
%
% \begin{macro}{\if@automark}
% \changes{v2.1}{2002/10/30}{New switch}
% \begin{macro}{\@automarktrue}
% \begin{macro}{\@automarkfalse}
% We need this switch to decide to switch on or off \cs{@mkboth} at the
% pagestyles.
%    \begin{macrocode}
\newif\if@automark\@automarkfalse
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\defpagestyle}
% First we define the simple definition-interface. There's no test, if
% the pagestyle's defined twice.
%
% First there has to be the definition of head and foot.
%    \begin{macrocode}
\def\defpagestyle{%
%    \end{macrocode}
% We have to decide, whether it is a my-version or not:
%    \begin{macrocode}
  \@ifstar
  {\@defpagestyle[-]}%
  {\@defpagestyle[+]}}
%    \end{macrocode}
% \begin{macro}{\@defpagestyle}
% Now the we can define the head and the foot.
% \changes{v1.0b}{1995/05/25}{Dot deleted after number at
%     chapter- and sectionmark}
% \changes{v1.0b}{1995/05/25}{Use CJK at \cs{chaptermark},
%     \cs{sectionmark} and \cs{subsectionmark}}
% \changes{v1.3e}{2008/02/29}{usage of \cs{if@mainmatter} fixed}
% \changes{v2.0}{2001/04/20}{Version 2 uses \cs{automark} and
%     \cs{manualmark}, so star and non-star version are same} 
% \changes{v2.1a}{2002/10/30}{Use \cs{if@automark}}
% \changes{v2.2d}{2007/06/14}{Support of article-classes with
%     \cs{if@mainmatter}}
% \changes{v2.5}{2010/04/22}{moved \cs{if@twoside} inside of definition}
% Before version 2.5 we have distinguished one- and two-side definitions while
% loading the package and have had all the definitions of \cs{@mkboth},
% \cs{chaptermark}, \cs{sectionmark}, and \cs{subsectionmark} at the
% definition of the page style.
% Since version~2.5 the difference of one- and two-side is made at the
% definition of the heads and foots themself and \cs{chaptermark},
% \cs{sectionmark}, and \cs{subsectionmark} are defined by \cs{automark} and
% \cs{manualmark}. So the code is much easier.
%    \begin{macrocode}
\def\@defpagestyle[#1]#2#3#4{%
  \expandafter\def\csname ps@#2\endcsname{%
    \if@automark\let\@mkboth\markboth\else\let\@mkboth\@gobbletwo\fi
    \def@head#3
    \def@foot#4
  }%
}
%    \end{macrocode}
%
% \begin{macro}{\def@head}
% \changes{v2.5}{2010/04/22}{new (internal)}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\def@@head}
% \changes{v2.0}{2001/04/20}{Thickness and length of the lines are
%     optional}
% \changes{v2.0j}{2001/08/18}{Use of \cs{scr@nouppercase}}
% \changes{v2.5}{2010/04/22}{new (internal)}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% This was real simple, but we already have to do the real definition
% of the heads and foots. First the head:
%    \begin{macrocode}
\def\def@head{%
  \kernel@ifnextchar(%)
  {\def@@head}%
  {\def@@head(\scr@headabove@linelength,%
              \scr@headabove@linethickness)}}
\def\def@@head(#1,#2)#3#4#5{%
  \kernel@ifnextchar(%)
  {\def@@@head({#1},{#2}){#3}{#4}{#5}}%
  {\def@@@head({#1},{#2}){#3}{#4}{#5}%
              (\scr@headbelow@linelength,%
               \scr@headbelow@linethickness)}}
\def\def@@@head(#1,#2)#3#4#5(#6,#7){%
  \def\@evenhead{%
    \if@twoside
      \let\headmark\leftmark%
      \hss\hskip\@evenheadshift\vbox{\hsize=\@headwidth\relax%
        \hf@rule{#1}{#2}{\@headwidth}{headabove}%
        \vskip#2
        \vskip\baselineskip
        \hb@xt@\@headwidth{{%
            \scr@nouppercase
            \headfont\strut #3}}%
        \hf@rule{#6}{#7}{\@headwidth}{headbelow}%
      }\hskip\@oddheadshift\hss
    \fi
  }%
  \def\@oddhead{\let\headmark\rightmark
    \hss\hskip\@oddheadshift\vbox{\hsize=\@headwidth\relax
      \hf@rule{#1}{#2}{\@headwidth}{headabove}%
      \vskip#2%
      \vskip\baselineskip
      \hb@xt@\@headwidth{{%
          \scr@nouppercase
          \headfont\strut \if@twoside #4\else #5\fi}}%
      \hf@rule{#6}{#7}{\@headwidth}{headbelow}%
  }\hskip\@evenheadshift\hss}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\def@foot}
% \changes{v2.0}{2001/04/20}{Thickness and length of the lines are
%     optional}  
% \changes{v1.3}{2001/03/30}{Use of \cmd\@footwidth instead of
%     \cs{textwidth}}
% \changes{v2.5}{2010/04/22}{new (internal)}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\def@@foot}
% \changes{v2.5}{2010/04/22}{new (internal)}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\def@@@foot}
% \changes{v2.0j}{2001/08/18}{Use of \cs{scr@nouppercase}}
% \changes{v2.2f}{2008/02/14}{Use of \cs{footfont}}
% \changes{v2.5}{2010/04/22}{new (internal)}
% And last twosided and onesided foot:
%    \begin{macrocode}
\def\def@foot{%
  \kernel@ifnextchar(%)
  {\def@@foot}
  {\def@@foot(\scr@footabove@linelength,%
                     \scr@footabove@linethickness)}}
\def\def@@foot(#1,#2)#3#4#5{%
  \kernel@ifnextchar(%)
  {\def@@@foot({#1},{#2}){#3}{#4}{#5}}%
  {\def@@@foot({#1},{#2}){#3}{#4}{#5}%
                     (\scr@footbelow@linelength,%
                      \scr@footbelow@linethickness)}}
\def\def@@@foot(#1,#2)#3#4#5(#6,#7){%
  \def\@evenfoot{%
    \if@twoside
      \let\headmark\leftmark
      \hss\hskip\@evenfootshift\vbox{\hsize=\@footwidth\relax
        \topfoot@rule{#1}{#2}\hb@xt@\@footwidth{{%
            \scr@nouppercase
            \headfont\footfont\strut #3}}%
        \botfoot@rule{#6}{#7}}\hskip\@oddfootshift\hss
    \fi
  }%
  \def\@oddfoot{\let\headmark\rightmark
    \hss\hskip\@oddfootshift\vbox{\hsize=\@footwidth\relax
      \topfoot@rule{#1}{#2}\hb@xt@\@footwidth{{%
          \scr@nouppercase
          \headfont\footfont\strut \if@twoside #4\else #5\fi}}%
      \botfoot@rule{#6}{#7}}\hskip\@evenfootshift\hss}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% We now define the rules used at head and foot.
% \begin{macro}{\topfoot@rule}
%    \begin{macrocode}
\newcommand\topfoot@rule[2]{%
  \@tempdima\baselineskip\advance\@tempdima by-.7\normalbaselineskip
  \advance\@tempdima by -#2
  \vskip\@tempdima\hf@rule{#1}{#2}{\@footwidth}{footabove}%
  \vskip-\@tempdima}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\botfoot@rule}
%    \begin{macrocode}
\newcommand\botfoot@rule[2]{%
  \@tempdima-\baselineskip\advance\@tempdima by .3\normalbaselineskip
  \advance\@tempdima by #2
  \vskip\@tempdima\hf@rule{#1}{#2}{\@footwidth}{footbelow}%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\hf@rule}
% \changes{v1.3}{2001/03/30}{New, third parameter ``boxwidth''}
% \changes{v2.0f}{2001/06/23}{Rule can be adjusted at inner margine,
%     centered or adjusted at outer margine}
% \changes{v2.2}{2004/07/05}{Last parameter of the rule tells, if it is a
%     headabove, headbelow, footabove or footbelow rule}
% \changes{v2.2}{2005/07/05}{Precommands before the rules are allowed}
% \changes{v2.2}{2005/07/05}{Macro is not longer long}
% \changes{v2.2b}{2005/08/31}{No even alignment at oneside}
%    \begin{macrocode}
\newcommand*{\hf@rule}[4]{%
  \setlength{\@tempdimb}{#1}
  \begingroup
    \csname scr@pre@#4@line\endcsname
    \if@twoside
      \ifodd\c@page
        \edef\@tempa{\hfline@adjust}%
      \else
        \@tempcnta=2\advance\@tempcnta -\hfline@adjust
        \edef\@tempa{\the\@tempcnta}%
      \fi
    \else
      \edef\@tempa{\hfline@adjust}%
    \fi
    \ifnum\@tempa=1
      \setlength{\@tempdimb}{.5\@tempdimb}%
    \fi
    \hb@xt@#3{%
      \ifnum\@tempa>0
        \hfill%
        \llap{\vrule\@depth#2\@height\z@\@width\@tempdimb}%
      \fi
      \ifnum\@tempa<2
        \rlap{\vrule\@depth#2\@height\z@\@width\@tempdimb}%
        \hfill%
      \fi
    }%
  \endgroup
}
%    \end{macrocode}
% \begin{macro}{\scr@pre@headabove@line}
% \changes{v2.2}{2004/07/05}{New internal}
% \begin{macro}{\scr@fnt@headtopline}
% \changes{v2.2}{2004/07/05}{New KOMA-Script font command}
% \begin{macro}{\scr@pre@headbelow@line}
% \changes{v2.2}{2004/07/05}{New internal}
% \begin{macro}{\scr@fnt@headsepline}
% \changes{v2.2}{2004/07/05}{New KOMA-Script font command}
% \begin{macro}{\scr@pre@footabove@line}
% \changes{v2.2}{2004/07/05}{New internal}
% \begin{macro}{\scr@fnt@footsepline}
% \changes{v2.2}{2004/07/05}{New KOMA-Script font command}
% \begin{macro}{\scr@pre@footbelow@line}
% \changes{v2.2}{2004/07/05}{New internal}
% \begin{macro}{\scr@fnt@footbottomrule}
% \changes{v2.2}{2004/07/05}{New KOMA-Script font command}
% \begin{macro}{\scr@fnt@instead@footbotline}
% \changes{v2.2}{2004/07/05}{New KOMA-Script font command}
%    \begin{macrocode}
\newcommand*{\scr@pre@headabove@line}{}
\newcommand*{\scr@fnt@headtopline}{\scr@pre@headabove@line}
\newcommand*{\scr@pre@headbelow@line}{}
\newcommand*{\scr@fnt@headsepline}{\scr@pre@headbelow@line}
\newcommand*{\scr@pre@footabove@line}{}
\newcommand*{\scr@fnt@footsepline}{\scr@pre@footabove@line}
\newcommand*{\scr@pre@footbelow@line}{}
\newcommand*{\scr@fnt@footbottomline}{\scr@pre@footbelow@line}
\newcommand*{\scr@fnt@instead@footbotline}{footbottomline}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% Using these definitions, we can define the testing macros.
%
% \begin{macro}{\newpagestyle}
% First the simple star/starless-selection:
%    \begin{macrocode}
\def\newpagestyle{%
%    \end{macrocode}
% We have to decide, whether it is a my-version or not:
%    \begin{macrocode}
  \@ifstar
  {\@newpagestyle[-]}%
  {\@newpagestyle[+]}}
%    \end{macrocode}
% \begin{macro}{\@newpagestyle}
% There we have to distinguish, whether the pagestyle is already
% defined or not.
%    \begin{macrocode}
\def\@newpagestyle[#1]#2#3#4{%
  \expandafter\ifx\csname ps@#2\endcsname\relax
%    \end{macrocode}
% Then we can use the already defined |\@defpagestyle|.
%    \begin{macrocode}
    \@defpagestyle[#1]{#2}{#3}{#4}%
  \else
    \PackageError
      {scrpage2}%
      {Your command was ignored}%
      {There is already a pagestyle named ``#1''.\MessageBreak%
       Use \protect\defpagestyle\space, \protect\renewpagestyle or
       \protect\providepagestyle.}%
  \fi
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\renewpagestyle}
% First the simple star/starless-selection:
%    \begin{macrocode}
\def\renewpagestyle{%
%    \end{macrocode}
% We have to decide, whether it is a my-version or not:
%    \begin{macrocode}
  \@ifstar
  {\@renewpagestyle[-]}%
  {\@renewpagestyle[+]}}
%    \end{macrocode}
% \begin{macro}{\@renewpagestyle}
% \changes{v1.2a}{1996/12/07}{Avoid to define pagestyle as \cs{relax}
%     if it wasn't defined (Thanks to Bernd).}
% There we have to distinguish, whether the pagestyle is already
% defined or not.
%    \begin{macrocode}
\def\@renewpagestyle[#1]#2#3#4{%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname ps@#2\endcsname\relax
    \PackageError
      {scrpage2}%
      {Your command was ignored}%
      {There is no pagestyle named ``#1''.\MessageBreak%
       Use \protect\defpagestyle, \protect\newpagestyle or
       \protect\providepagestyle.}%
  \else
%    \end{macrocode}
% Then we can use the already defined |\@defpagestyle|.
%    \begin{macrocode}
    \@defpagestyle[#1]{#2}{#3}{#4}%
  \fi
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\providepagestyle}
% First the simple star/starless-selection:
%    \begin{macrocode}
\def\providepagestyle{%
%    \end{macrocode}
% We have to decide, whether it is a my-version or not:
%    \begin{macrocode}
  \@ifstar
  {\@providepagestyle[-]}%
  {\@providepagestyle[+]}}
%    \end{macrocode}
% \begin{macro}{\@providepagestyle}
% There we have to distinguish, whether the pagestyle is already
% defined or not.
%    \begin{macrocode}
\def\@providepagestyle[#1]#2#3#4{%
  \expandafter\ifx\csname ps@#2\endcsname\relax
%    \end{macrocode}
% Then we can use the already defined |\@defpagestyle|.
%    \begin{macrocode}
    \@defpagestyle[#1]{#2}{#3}{#4}%
  \else
    \PackageInfo
      {scrpage2}%
      {\protect\providepagestyle\protect{#1\protect} ignored.}%
  \fi
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
% \subsection{User-Pagestyle-Definition-Interface}
% The pagestyle-definition-interface for users is much easier than the
% expert-version. Using the expert-macros, the definition is easy, too.
%
% \begin{macro}{\deftripstyle}
%    \begin{macrocode}
%    \end{macrocode}
% At version 1 we define the selection of star- or starless-version first:
%    \begin{macrocode}
\def\deftripstyle{%
  \@ifstar
  {\@deftripstyle[-]}%
  {\@deftripstyle[+]}}
%    \end{macrocode}
% \end{macro}
% Next we check, if there is an optional argument:
% \begin{macro}{\@deftripstyle}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
%    \begin{macrocode}
\def\@deftripstyle[#1]#2{%
  \kernel@ifnextchar[%]
  {\@@deftripstyle[#1]{#2}}%
  {\@@deftripstyle[#1]{#2}[\z@]}}
%    \end{macrocode}
% \end{macro}
% or perhaps two optional arguments:
% \begin{macro}{\@@deftripstyle}
%    \begin{macrocode}
\def\@@deftripstyle[#1]#2[#3]{%
%    \end{macrocode}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% Ok, now we have the problem, that there can be only 9 arguments. So we
% have to distinguish the star-versions by a macro:
%    \begin{macrocode}
  \def\@tempa{#1}%
  \kernel@ifnextchar[%]
  {\@@@deftripstyle#2[#3]}%
  {\@@@deftripstyle#2[\z@][#3]}}
%    \end{macrocode}
% \end{macro}
% Now the main-definition:
% \begin{macro}{\@@@deftripstyle}
%    \begin{macrocode}
\def\@@@deftripstyle#1[#2][#3]#4#5#6#7#8#9{%
  \def\@tempb{+}%
  \ifx\@tempa\@tempb
    \defpagestyle{#1}%
      {(\@headwidth,#2)%
       {\rlap{#6}\hfill{#5}\hfill\llap{#4}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       (\@headwidth,#3)}%
      {(\@footwidth,#3)%
       {\rlap{#9}\hfill{#8}\hfill\llap{#7}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       (\@footwidth,#2)}%
  \else
    \defpagestyle*{#1}%
      {(\@headwidth,#2)%
       {\rlap{#6}\hfill{#5}\hfill\llap{#4}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       (\@headwidth,#3)}%
      {(\@footwidth,#3)%
       {\rlap{#9}\hfill{#8}\hfill\llap{#7}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       (\@footwidth,#2)}%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
%
% \subsection{Automark or not}
% This is new since version 2.
% \begin{macro}{\automark}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v2.0c}{2001/06/07}{Use of \cs{MakeMarkcase}}
% \changes{v2.0g}{2001/06/25}{Use of \cs{manualmark}}
% \changes{v2.0i}{2001/08/17}{Warning, if arguments are mixed up}
% \changes{v2.0i}{2001/08/17}{\cs{markboth} behavior fixed}
% \changes{v2.0i}{2001/08/17}{Use of \cs{if@autooneside}}
% \changes{v2.1a}{2002/10/30}{Switch on \cs{if@automark}}
% This macro activates automatic mark. Is has two arguments. The
% first, optional argument is the sectioning level name of the mark at
% left pages, the second, not  optional argument is the same at right
% pages. At oneside mode all pages are right.
% \begin{macro}{\@iflevelok}
% \changes{v2.0i}{2001/08/17}{New}
% \begin{macro}{\markleft}
% \changes{v2.0i}{2001/08/17}{New}
% \begin{macro}{\@markleft}
% \changes{v2.0i}{2001/08/17}{New}
% To define \cs{automark} we also need these three makros. The first
% one decides, if level of second parameter is less than level of
% first parameter and does then third or fourth parameter.
% \cs{markleft} and \cs{@markleft} are similar to \cs{markright} and
% \cs{@markright} at \LaTeX{} kernel.
%    \begin{macrocode}
\newcommand*{\@iflevelok}[4]{%
  \begingroup
    \edef\@tempa{#1}\ifx\@tempa\@empty\def\@tempa{\endgroup #3}\else
      \def\@tempa{\csname #1level\endcsname}%
      \def\@tempb{\csname #2level\endcsname}%
      \ifnum \@tempa>\@tempb
        \def\@tempa{\endgroup#3}%
      \else
        \def\@tempa{\endgroup#4}%
    \fi\fi\@tempa}
\providecommand{\markleft}[1]{%
  \begingroup
    \let\label\relax \let\index\relax \let\glossary\relax
    \expandafter\@markleft\@themark {#1}%
    \@temptokena \expandafter{\@themark}%
    \mark{\the\@temptokena}%
  \endgroup
  \if@nobreak\ifvmode\nobreak\fi\fi}
\providecommand{\@markleft}[3]{\@temptokena {#2}%
  \unrestored@protected@xdef\@themark{{#3}{\the\@temptokena}}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \changes{v2.2a}{2004/09/05}{all changes of helper macros and switches are
%     local to fix e.g.\ twocolumn problem with \cs{part}}
%    \begin{macrocode}
\newcommand*{\automark}[2][\@empty]{%
  \manualmark
  \@automarktrue
  \begingroup
  \edef\@tempa{#2}\ifx\@tempa\@empty
    \endgroup
    \PackageWarning{scrpage2}%
      {\string\automark\space with empty obligatory argument}%
  \else
    \endgroup
    \expandafter\def\csname #2mark\endcsname##1{%
      \begingroup
        \def\@tempa{\csname #2level\endcsname}%
        \@tempswafalse
        \ifnum \c@secnumdepth <\@tempa\else\if@mainmatter
            \@tempswatrue
        \fi\fi
        \edef\@tempa{#1}%
        \if@twoside\edef\@tempb{#2}\else\let\@tempb\@tempa\fi
        \ifx\@tempa\@tempb
          \if@tempswa
            \@mkboth{\MakeMarkcase{\csname #2markformat\endcsname ##1}}%
                    {\MakeMarkcase{\csname #2markformat\endcsname ##1}}%
          \else%
            \@mkboth{\MakeMarkcase{##1}}{\MakeMarkcase{##1}}%
          \fi
        \else
          \if@tempswa
            \@iflevelok{#1}{#2}{%
              \@mkboth{\MakeMarkcase{\csname #2markformat\endcsname
                  ##1}}{}}{%
              \ifx\@mkboth\markboth\markleft{\MakeMarkcase{\csname
                  #2markformat\endcsname ##1}}%
              \fi}
          \else
            \@iflevelok{#1}{#2}{%
              \@mkboth{\MakeMarkcase{##1}}{}}{%
              \ifx\@mkboth\markboth\markleft{\MakeMarkcase{##1}}\fi}%
          \fi
        \fi
      \endgroup
    }
  \fi
  \begingroup
  \edef\@tempa{#1}\edef\@tempb{#2}%
  \if@autooneside\if@twoside\else\let\@tempa\@empty\fi\fi
  \ifx\@tempa\@empty
    \endgroup
  \else
    \ifx\@tempa\@tempb
      \endgroup
    \else
      \endgroup
      \expandafter\def\csname #1mark\endcsname##1{%
        \begingroup
          \def\@tempa{\csname #1level\endcsname}%
          \@tempswafalse
          \ifnum \c@secnumdepth <\@tempa\else\if@mainmatter
              \@tempswatrue
          \fi\fi
          \if@tempswa
            \@iflevelok{#1}{#2}{%
              \ifx\@mkboth\markboth
                \markright{\MakeMarkcase{\csname #1markformat\endcsname
                    ##1}}%
              \fi}{%
              \@mkboth{}{\MakeMarkcase{\csname #1markformat\endcsname
                  ##1}}}%
          \else
            \@iflevelok{#1}{#2}{%
              \ifx\@mkboth\markboth
                \markright{\MakeMarkcase{##1}}%
              \fi}{%
              \@mkboth{}{\MakeMarkcase{##1}}}%
          \fi
        \endgroup
      }
  \fi\fi%
  \let\@mkboth\markboth
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\manualmark}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v2.0g}{2001/06/25}{also deactivating \cs{...mark}}
% \changes{v2.1a}{2002/10/30}{Switch off \cs{if@automark}}
% This macro switchs to the manual set of marks (using \cs{markboth}
% and \cs{markright}. This is very simple, we only have to deaktivate
% the mark macros.
%    \begin{macrocode} 
\newcommand*{\manualmark}{%
  \if@chapter\let\chaptermark\@gobble\fi
  \let\sectionmark\@gobble
  \let\subsectionmark\@gobble
  \let\subsubsectionmark\@gobble
  \let\paragraphmark\@gobble
  \let\subparagraphmark\@gobble
  \let\@mkboth\@gobbletwo
  \@automarkfalse
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\partlevel}
% \changes{v2.2}{2004/07/05}{New}
% \changes{v2.4}{2009/11/11}{part level is always -1}
% \begin{macro}{\chapterlevel}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\sectionlevel}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\subsectionlevel}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\subsubsectionlevel}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\paragraphlevel}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\subparagraphlevel}
% \changes{v2.0}{2001/04/20}{New}
% At \cs{automark} we use some macros to get the numeric level of a
% sectioning name. We simply define these:
%    \begin{macrocode}
\newcommand*{\partlevel}{-1}
\newcommand*{\chapterlevel}{0}
\newcommand*{\sectionlevel}{1}
\newcommand*{\subsectionlevel}{2}
\newcommand*{\subsubsectionlevel}{3}
\newcommand*{\paragraphlevel}{4}
\newcommand*{\subparagraphlevel}{5}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\MakeMarkcase}
% \changes{v2.0m}{2002/02/05}{\texttt{scrlttr2} is a known class}
% At \cs{automark} we use a new macro to enable usability of
% \cs{MakeUppercase} at the head-marks. We set this macro to
% \cs{MakeUppercase} if one of the standard-classes was loaded:
%    \begin{macrocode}
\@ifundefined{MakeMarkcase}{%
  \@ifclassloaded{scrbook}{\let\MakeMarkcase\relax}{%
    \@ifclassloaded{scrreprt}{\let\MakeMarkcase\relax}{%
      \@ifclassloaded{scrartcl}{\let\MakeMarkcase\relax}{%
        \@ifclassloaded{scrlttr2}{\let\MakeMarkcase\relax}{%
          \@ifclassloaded{book}{}{%
            \@ifclassloaded{report}{}{%
              \@ifclassloaded{article}{}{%
                \PackageWarningNoLine{scrpage2}{%
                  use of scrpage2 with unknown class.\MessageBreak
                  Please mail to markus.kohm@gmx.de, if
                  headmarks\MessageBreak
                  are lower case without use of scrpage2}}}}%
          \let\MakeMarkcase\MakeUppercase}}}}}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\scrheadings@style}
% \changes{v2.0g}{2001/06/25}{New}
% \changes{v2.0m}{2002/02/05}{Take care of class \texttt{scrlttr2}}
% This macro defines, which style for scrheadings should be used. If
% it is not defined, we have to define it in a propper way.
%    \begin{macrocode}
\@ifundefined{scrheadings@style}{%
  \@ifclassloaded{scrbook}{\def\scrheadings@style{koma}}{%
    \@ifclassloaded{scrreprt}{\def\scrheadings@style{koma}}{%
      \@ifclassloaded{scrartcl}{\def\scrheadings@style{koma}}{%
        \@ifclassloaded{scrlttr2}{\def\scrheadings@style{koma}}{%
          \def\scrheadings@style{standard}}}}}}{}
%    \end{macrocode}
% \end{macro}
%
%
% \subsection{Width of head and foot}
% \begin{macro}{\setheadwidth}
% \changes{v1.3}{2001/03/30}{New}
% \begin{macro}{\setfootwidth}
% \changes{v1.3}{2001/03/30}{New}
% \begin{macro}{\set@hf@width}
% \changes{v1.3}{2001/03/30}{New}
% \changes{v1.3a}{2001/05/31}{symbolic values ``paper'', ``text'',
%     ``textwidthmarginpar''} 
% \changes{v2.0b}{2001/05/31}{symbolic values ``paper'', ``text'',
%     ``textwidthmarginpar''} 
% \changes{v2.0c}{2001/06/07}{error fix at warning}
% \begin{macro}{\settowidthof}
% \changes{v2.0e}{2001/06/22}{New}
% \begin{macro}{\deftowidthof}
% \changes{v2.0e}{2001/06/22}{New}
% \changes{v2.0f}{2001/06/23}{new symbolic values ``autohead'' and
%     ``autofoot''}
% \changes{v2.0i}{2001/08/17}{new symbolic value ``page''}
% \changes{v2.0k}{2001/09/28}{\cs{pagewidth} korrigiert}
% \changes{v2.1b}{2003/05/31}{more save existance test}
% \changes{v2.2}{2004/07/05}{value ``foot'' fixed}
% Until version 1.3, head and foot of a page had same width like the
% text block. Since version 1.3 this was changed. Now the head and
% foot have their own width and an optional shift relative to the text
% part of the page. This shift can be positive or negative. We set
% the width and shift with one macro and save them at macros. The set
% macros have an optional argument: the shift.
%
% For definition of symbolic length values there is the macro
% \cs{settowidthof}. And to define a macro with this value, there
% is \cs{deftowidthof}.
%    \begin{macrocode}
\newcommand*{\settowidthof}[2]{%
  \edef\@tempa{#2}%
  \edef\@tempb{paper}\ifx\@tempa\@tempb
    \setlength{#1}{\paperwidth}%
  \else\edef\@tempb{text}\ifx\@tempa\@tempb
      \setlength{#1}{\textwidth}%
    \else\edef\@tempb{textwithmarginpar}\ifx\@tempa\@tempb
        \setlength{#1}{\textwidth}%
        \addtolength{#1}{\marginparwidth}%
        \addtolength{#1}{\marginparsep}%
      \else\edef\@tempb{head}\ifx\@tempa\@tempb
          \setlength{#1}{\@headwidth}%
        \else\edef\@tempb{foot}\ifx\@tempa\@tempb
            \setlength{#1}{\@footwidth}%
          \else\edef\@tempb{headtopline}\ifx\@tempa\@tempb
              \setlength{#1}{\scr@headabove@linelength}%
            \else\edef\@tempb{headsepline}\ifx\@tempa\@tempb
                \setlength{#1}{\scr@headbelow@linelength}%
              \else\edef\@tempb{footsepline}\ifx\@tempa\@tempb
                  \setlength{#1}{\scr@footabove@linelength}%
                \else\edef\@tempb{footbotline}\ifx\@tempa\@tempb
                    \setlength{#1}{\scr@footbelow@linelength}%
                  \else\edef\@tempb{page}\ifx\@tempa\@tempb
                      \setlength{#1}{\paperwidth}%
                      \begingroup\expandafter\expandafter\expandafter\endgroup
                      \expandafter\ifx\csname ta@bcor\endcsname\relax\else
                        \addtolength{#1}{-\ta@bcor}%
                      \fi
                    \else
                      \setlength{#1}{#2}%
                    \fi
                  \fi
                \fi
              \fi
            \fi
          \fi
        \fi
      \fi
    \fi
  \fi
}
\newcommand*{\deftowidthof}[2]{%
  \edef\@tempa{#2}\edef\@tempb{autohead}\ifx\@tempa\@tempb
    \expandafter\def\csname #1\endcsname{\@headwidth}%
  \else\edef\@tempb{autofoot}\ifx\@tempa\@tempb
      \expandafter\def\csname #1\endcsname{\@footwidth}%
    \else
      \settowidthof{\@tempdima}{#2}%
      \expandafter\edef\csname #1\endcsname{\the\@tempdima}%
    \fi
  \fi
}
\newcommand*{\setheadwidth}[2][\@empty]{%
  \set@hf@width{head}{#1}{#2} %
}
\newcommand*{\setfootwidth}[2][\@empty]{%
  \set@hf@width{foot}{#1}{#2}%
}
\newcommand*{\set@hf@width}[3]{%
  \settowidthof{\@tempdima}{#3}%
  \ifdim\@tempdima>\paperwidth
    \PackageWarning
      {scrpage2}%
      {You've set width of #1 to a value\MessageBreak
        greater than width of page!\MessageBreak%
        I`ll reduce width of #1 to width of page}%
    \setlength{\@tempdima}{\paperwidth}%
  \else
    \ifdim\@tempdima<\z@
       \PackageWarning
         {scrpage2}%
         {You've set width of #1 to negative value!\MessageBreak%
           I'll set it to 0pt}%
       \setlength{\@tempdima}{\z@}%
     \fi
  \fi
  \expandafter\edef\csname @#1width\endcsname{\the\@tempdima}%
  \edef\@tempa{#2}%
  \setlength{\@tempdima}{\textwidth}%
  \addtolength{\@tempdima}{-\csname @#1width\endcsname}%
  \ifx\@tempa\@empty
    \if@twoside
      \setlength{\@tempdimb}{.3333333333\@tempdima}%
    \else
      \setlength{\@tempdimb}{.5\@tempdima}%
    \fi
  \else
    \setlength{\@tempdimb}{#2}%
  \fi
  \addtolength{\@tempdima}{-\@tempdimb}%
  \ifdim\@tempdimb<\z@
    \setlength{\@tempdimb}{-\@tempdimb}%
    \expandafter\edef\csname @odd#1shift\endcsname{-\the\@tempdimb}%
  \else
    \expandafter\edef\csname @odd#1shift\endcsname{\the\@tempdimb}%
  \fi
  \ifdim\@tempdima<\z@
    \setlength{\@tempdima}{-\@tempdima}%
    \expandafter\edef\csname @even#1shift\endcsname{-\the\@tempdima}%
  \else
    \expandafter\edef\csname @even#1shift\endcsname{\the\@tempdima}%
  \fi
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@headwidth}
% \changes{v1.3}{2001/03/30}{New}
% \changes{v2.1}{2002/03/28}{use of option \texttt{mpinclude}}
% \begin{macro}{\@footwidth}
% \changes{v1.3}{2001/03/30}{New}
% \changes{v2.1}{2002/03/28}{use of option \texttt{mpinclude}}
% \begin{macro}{\@oddheadshift}
% \changes{v1.3}{2001/03/30}{New}
% \begin{macro}{\@evenheadshift}
% \changes{v1.3}{2001/03/30}{New}
% \begin{macro}{\@oddfootshift}
% \changes{v1.3}{2001/03/30}{New}
% \begin{macro}{\@evenfootshift}
% \changes{v1.3}{2001/03/30}{New}
% The values of width and shift of head and foot are saved at internal
% macros. 
%    \begin{macrocode}
\newcommand*{\@headwidth}{\textwidth}%
\newcommand*{\@oddheadshift}{\z@}%
\newcommand*{\@evenheadshift}{\z@}%
\newcommand*{\@footwidth}{\textwidth}%
\newcommand*{\@oddfootshift}{\z@}%
\newcommand*{\@evenfootshift}{\z@}%
%    \end{macrocode}
% If option \texttt{mpinclude} was used, we use a special trick to set
% width of head and foot but only if the user doesn't:
%    \begin{macrocode}
\if@mincl
  \renewcommand*{\@headwidth}{}%
  \renewcommand*{\@footwidth}{}%
  \AtBeginDocument{%
    \ifx\@headwidth\@empty
      \setheadwidth[0pt]{textwithmarginpar}%
    \fi
    \ifx\@footwidth\@empty
      \setfootwidth[0pt]{textwithmarginpar}%
    \fi
    }
\fi
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsection{Fonts}
% \begin{macro}{\pnumfont}
% We have to define a macro defining the font, used by |\pagemark|. Because
% of this macro may already be defined by a \textsf{KOMA}-script-class, we
% have to do this, using |\providecommand|
%    \begin{macrocode}
\providecommand*{\pnumfont}{\normalfont}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\headfont}
% There is also a macro used by |\@evenhead|, |\@oddhead| and |\@evenfoot|,
% |\@oddfoot|:
%    \begin{macrocode}
\providecommand*{\headfont}{\normalfont\slshape}
\def\scr@fnt@wrn@pagehead#1{%
  `pagehead' is only an alias of `pageheadfoot'.\MessageBreak
  Font of page foot may also be changed%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\footfont}
% \changes{v2.2f}{2008/02/14}{New}
% \begin{macro}{\scr@fnt@pagefoot}
% \changes{v2.2f}{2008/02/14}{New (internal)}
% \begin{macro}{\scr@fnt@wrn@pagefoot}
% \changes{v2.2f}{2008/02/14}{deactivated}
% There is also a macro used by |\@evenfoot|, |\@oddfoot| after |\headfont|:
%    \begin{macrocode}
\providecommand*{\footfont}{\normalfont}
\providecommand*{\scr@fnt@pagefoot}{\footfont}
\let\scr@fnt@wrn@pagefoot\relax
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsection{Length and thickness of lines at head and foot}
% \begin{macro}{\setheadtopline}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v2.0d}{2001/06/19}{\texttt{headtop} changed into
%     \texttt{headabove}} 
% \changes{v2.0f}{2001/06/23}{new symbolic value ``auto''}
% \begin{macro}{\setheadsepline}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v2.0d}{2001/06/19}{\texttt{headbot} changed into 
%     \texttt{headbelow}}
% \changes{v2.0f}{2001/06/23}{new symbolic value ``auto''}
% \begin{macro}{\setfootsepline}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v2.0d}{2001/06/19}{\texttt{foottop} changed into 
%     \texttt{footabove}}
% \changes{v2.0f}{2001/06/23}{new symbolic value ``auto''}
% \begin{macro}{\setfootbotline}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v2.0d}{2001/06/19}{\texttt{footbot} changed into 
%     \texttt{footbelow}}
% \changes{v2.0f}{2001/06/23}{new symbolic value ``auto''}
% Since version 2 there are new macros to set the length and
% thickness of the lines at head and foot. Wie use macros not
% dimensions, because the amount of dimensions is very small at \TeX.
%    \begin{macrocode}
\newcommand*{\setheadtopline}{\scr@setline{head}{above}}
\newcommand*{\setheadsepline}{\scr@setline{head}{below}}
\newcommand*{\setfootsepline}{\scr@setline{foot}{above}}
\newcommand*{\setfootbotline}{\scr@setline{foot}{below}}
%    \end{macrocode}
% \begin{macro}{\scr@setline}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\@scr@setline}
% \changes{v2.0d}{2001/06/19}{symbolic values implemented}
% \begin{macro}{\@@scr@setline}
% \changes{v2.0d}{2001/06/18}{macro name fixed}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\@scr@set@pre@line}
% \changes{v2.2}{2004/07/05}{New internal}
% The real change of the lines is done with the macros
% \cs{scr@setline}, \cs{@scr@setline} and \cs{@@scr@setline}:
%    \begin{macrocode}
\def\scr@setline#1#2{%
  \kernel@ifnextchar[%]
  {\@scr@setline{#1}{#2}}{\@@scr@setline{#1#2}}%
}
\def\@scr@setline#1#2[#3]{%
  \edef\@tempa{#3}\edef\@tempa{auto}\ifx\@tempa\@tempb
    \deftowidthof{scr@#1#2@linelength}{#3#1}%
  \else
    \deftowidthof{scr@#1#2@linelength}{#3}%
  \fi
  \@@scr@setline{#1#2}%
}
\def\@@scr@setline#1#2{%
  \edef\@tempa{#2}\edef\@tempb{current}\ifx\@tempa\@empty\else
    \ifx\@tempa\@tempb\else
      \setlength{\@tempdima}{#2}%
      \expandafter\edef\csname scr@#1@linethickness\endcsname%
      {\the\@tempdima}%
  \fi\fi
  \kernel@ifnextchar[%]
  {\@src@set@pre@line{#1}}{}%
}
\def\@src@set@pre@line#1[#2]{%
  \expandafter\def\csname scr@pre@#1@line\endcsname{#2}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsection{Extended multilanguage formats}
% \begin{macro}{\partmarkformat}
% \changes{v2.2}{2004/07/05}{New}
% \begin{macro}{\chaptermarkformat}
% \changes{v1.1}{1995/06/27}{Space after chapternumber increased.}
% \begin{macro}{\sectionmarkformat}
% \changes{v1.1}{1995/06/27}{Space after sectionnumber increased.}
% \begin{macro}{\subsectionmarkformat}
% \changes{v1.1}{1995/06/27}{Space after subsectionnumber increased.}
% \begin{macro}{\subsubsectionmarkformat}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\paragraphmarkformat}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\subparagraphmarkformat}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\@seccntmarkformat}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\@seccntformat}
% \changes{v2.0}{2001/04/20}{New}
% There are some macros to handle languages like Chinese, Japanese or Korean.
% These macros were defined first by Werner Lemberg at his CJK-bundle. See
% |scrclass.dtx| for further information.
%    \begin{macrocode}
\providecommand{\partmarkformat}         {\partname\ \thepart. \ }
\if@chapter
  \providecommand{\chaptermarkformat}    {\@chapapp\ \thechapter. \ }
  \providecommand{\sectionmarkformat}    {\thesection. \ }
  \providecommand{\subsectionmarkformat} {\@seccntmarkformat{subsection}}
\else
  \providecommand{\sectionmarkformat}    {\thesection\quad}
  \providecommand{\subsectionmarkformat} {\thesubsection\quad}
\fi
\providecommand{\subsubsectionmarkformat}{\@seccntmarkformat{subsubsection}}
\providecommand{\paragraphmarkformat}    {\@seccntmarkformat{paragraph}}
\providecommand{\subparagraphmarkformat} {\@seccntmarkformat{subparagraph}}
\providecommand{\@seccntmarkformat}[1]   {\@seccntformat{#1}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsection{Definition of default pagestyles}
%
% \begin{macro}{\ps@save@plain}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v2.0b}{2001/05/31}{use this instead of
%     \cs{ps@standardplain}} 
% We define two default pagestyles, which can be used instead of the
% standard pagestyles. The two pagestyles are something like a
% family. A pagestyle for \emph{normal} pages with head and foot and a
% pagestyle for \emph{plain} pages with not so much head and foot. So
% we have to redefine the standard pagestyle \texttt{plain}. But maybe
% someone want to use the old standard pagestyle. So we first define
% new names for old pagestyles.
%    \begin{macrocode}
\newcommand*{\ps@save@plain}{}
\let\ps@save@plain\ps@plain
\newcommand*{\ps@use@plain}{\let\save@@mkboth\@mkboth
  \ps@save@plain
  \let\@mkboth\save@@mkboth}
\let\ps@plain\ps@use@plain
%    \end{macrocode}
% \begin{macro}{\ps@save@headings}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v2.0b}{2001/05/31}{use this instead of
%     \cs{ps@standardheadings}} 
% \begin{macro}{\ps@save@myheadings}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v2.0b}{2001/05/31}{use this instead of
%     \cs{ps@standardmyheadings}} 
% \begin{macro}{\ps@headings}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\ps@myheadings}
% \changes{v2.0}{2001/04/20}{New}
% If standard pagestyle \texttt{headings} or \texttt{myheadings} is
% used, also standard pagestyle \texttt{use@plain} should be
% used. So we also define new names for the other old pagestyles and
% new pagestyles with the old names, doing the switch back for the
% plain pagestyle. These are defined even if the pagestyles are
% unknown.
%    \begin{macrocode}
\newcommand*{\ps@save@headings}{}
\let\ps@save@headings\ps@headings
\newcommand*{\ps@save@myheadings}{}
\let\ps@save@myheadings\ps@myheadings
\def\ps@headings{%
  \PackageWarning{scrpage2}%
    {you've used pagestyle ``headings''.\MessageBreak
      You should not use this pagestyle with a\MessageBreak
      scrpage2-pagestyle!\MessageBreak 
      You should use pagestyle ``useheadings'' instead\MessageBreak}%
  \let\ps@plain\ps@save@plain%
  \ps@save@headings\@automarktrue}
\def\ps@myheadings{%
  \PackageWarning{scrpage2}%
    {you've used pagestyle ``myheadings''.\MessageBreak
      You should not use this pagestyle with a\MessageBreak
      scrpage2-pagestyle!\MessageBreak 
      You should use pagestyle ``useheadings'' instead\MessageBreak}%
  \let\ps@plain\ps@save@plain%
  \ps@save@myheadings\@automarkfalse}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\ps@useheadings}
% \changes{v2.0b}{2001/05/31}{New}
% \changes{v2.0m}{2002/02/05}{Fatal bug (\cs{mkboth} instead of
%     \cs{@mkboth}) fixed}
% \changes{v2.1a}{2002/10/30}{Use of switch \cs{if@automark}}
% This is the pagestyle, you should use instead of \texttt{headings}
% or \texttt{myheadings}. If you are using manual marks, this behaves
% like pagestyle \texttt{myheadings}. If you are using automatic
% marks, this behaves like headings, but without changing
% \cs{chaptermark}, \cs{sectionmark} or \cs{subsectionmark}.
%    \begin{macrocode}
\newcommand*{\ps@useheadings}{%
  \if@automark\let\@mkboth\markboth\else\let\@mkboth\@gobbletwo\fi
  \let\ps@plain\ps@use@plain
  \let\save@@mkboth\@mkboth
  \let\save@chaptermark\chaptermark
  \let\save@sectionmark\sectionmark
  \let\save@subsectionmark\subsectionmark
  \ifx\@mkboth\markboth\ps@save@headings\else\ps@save@myheadings\fi
  \let\@mkboth\save@@mkboth
  \let\chaptermark\save@chaptermark
  \let\sectionmark\save@sectionmark
  \let\subsectionmark\save@subsectionmark
}
%    \end{macrocode}
% Note: Because of saving \cs{@mkboth}, \cs{chaptermark},
% \cs{sectionmark} and \cs{subsection} before changing the pagestyle
% and restore them after changing the pagestyle it does not matter, if
% we set pagestyle \texttt{headings} or \texttt{myheadings}. So it
% would be possible to remove the \cs{ifx}\dots\cs{fi}-line above and
% simply use \cs{ps@save@headings} or \cs{ps@save@myheadings} instead
% of.
% \end{macro}
%
%
% \begin{macro}{\ps@scrplain}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v2.0a}{2001/04/24}{\cs{strut} inserted}
% \changes{v2.0f}{2001/06/23}{\cs{strut} inserted}
% \changes{v2.1c}{2004/02/07}{thickness of footbelow line fixed}
% \begin{macro}{\scrplain@even@left@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@even@middle@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@even@right@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@odd@left@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@odd@middle@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@odd@right@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@even@left@foot}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@even@middle@foot}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@even@right@foot}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@odd@left@foot}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@odd@middle@foot}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrplain@odd@right@foot}
% \changes{v2.0}{2001/04/20}{New}
% After this, we can define the new pagestyles, first a new plain
% one. It sould be variable and so we use macros to define the parts.
%    \begin{macrocode}
\newcommand*{\ps@scrplain}{\let\ps@plain\ps@@scrplain\ps@plain}
\newpagestyle{@scrplain}
{%
  (\scrplain@headabove@linelength,\scr@headabove@linethickness)%
  {%
    \rlap{\parbox{\@headwidth}{\raggedright
        \strut\scrplain@even@left@head\strut}}%
    \hfill
    \parbox{\@headwidth}{\centering\strut
      \scrplain@even@middle@head\strut}%
    \hfill
    \llap{\parbox{\@headwidth}{\raggedleft
        \strut\scrplain@even@right@head\strut}}}%
  {%
    \rlap{\parbox{\@headwidth}{\raggedright
        \strut\scrplain@odd@left@head\strut}}%
    \hfill
    \parbox{\@headwidth}{\centering
      \strut\scrplain@odd@middle@head\strut}%
    \hfill
    \llap{\parbox{\@headwidth}{\raggedleft
        \strut\scrplain@odd@right@head\strut}}}%
  {%
    \rlap{\parbox{\@headwidth}{\raggedright
        \strut\scrplain@odd@left@head\strut}}%
    \hfill
    \parbox{\@headwidth}{\centering
      \strut\scrplain@odd@middle@head\strut}%
    \hfill
    \llap{\parbox{\@headwidth}{\raggedleft
        \strut\scrplain@odd@right@head\strut}}}%
  (\scrplain@headbelow@linelength,\scr@headbelow@linethickness)
}{%
  (\scrplain@footabove@linelength,\scr@footabove@linethickness)
  {%
    \rlap{\parbox{\@footwidth}{\raggedright
        \strut\scrplain@even@left@foot\strut}}%
    \hfill
    \parbox{\@footwidth}{\centering
      \strut\scrplain@even@middle@foot\strut}%
    \hfill
    \llap{\parbox{\@footwidth}{\raggedleft
        \strut\scrplain@even@right@foot\strut}}}%
  {%
    \rlap{\parbox{\@footwidth}{\raggedright
        \strut\scrplain@odd@left@foot\strut}}%
    \hfill
    \parbox{\@footwidth}{\centering
      \strut\scrplain@odd@middle@foot\strut}%
    \hfill
    \llap{\parbox{\@footwidth}{\raggedleft
        \strut\scrplain@odd@right@foot\strut}}}%
  {%
    \rlap{\parbox{\@footwidth}{\raggedright
        \strut\scrplain@odd@left@foot\strut}}%
    \hfill
    \parbox{\@footwidth}{\centering
      \strut\scrplain@odd@middle@foot\strut}%
    \hfill
    \llap{\parbox{\@footwidth}{\raggedleft
        \strut\scrplain@odd@right@foot\strut}}}%
  (\scrplain@footbelow@linelength,\scr@footbelow@linethickness)
}
\newcommand*{\scrplain@even@left@head}{}
\newcommand*{\scrplain@even@middle@head}{}
\newcommand*{\scrplain@even@right@head}{}
\newcommand*{\scrplain@odd@left@head}{}
\newcommand*{\scrplain@odd@middle@head}{}
\newcommand*{\scrplain@odd@right@head}{}
\newcommand*{\scrplain@even@left@foot}{}
\newcommand*{\scrplain@even@middle@foot}{}
\newcommand*{\scrplain@even@right@foot}{}
\newcommand*{\scrplain@odd@left@foot}{}
\newcommand*{\scrplain@odd@middle@foot}{}
\newcommand*{\scrplain@odd@right@foot}{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\ps@scrheadings}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v2.0a}{2001/04/24}{\cs{strut} inserted}
% \changes{v2.0f}{2001/06/23}{\cs{strut} inserted}
% \begin{macro}{\scrheadings@even@left@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrheadings@even@middle@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrheadings@even@right@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrheadings@odd@left@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrheadings@odd@middle@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrheadings@odd@right@head}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrheadings@even@left@foot}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrheadings@even@middle@foot}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrheadings@even@right@foot}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrheadings@odd@left@foot}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrheadings@odd@middle@foot}
% \changes{v2.0}{2001/04/20}{New}
% \begin{macro}{\scrheadings@odd@right@foot}
% \changes{v2.0}{2001/04/20}{New}
% We also define define a new headings one. It sould be variable and
% so we use macros to define the parts. But we need an \emph{also
% action}, so we first define a inner pagestyle and then use this at a
% outer one (definition is done in reverse order):
%    \begin{macrocode}
\newcommand*{\ps@scrheadings}{\let\ps@plain\ps@scrplain\ps@@scrheadings}
\newpagestyle{@scrheadings}
{%
  {%
    \rlap{\parbox{\@headwidth}{\raggedright
        \strut\scrheadings@even@left@head\strut}}%
    \hfill
    \parbox{\@headwidth}{\centering
      \strut\scrheadings@even@middle@head\strut}%
    \hfill
    \llap{\parbox{\@headwidth}{\raggedleft%
        \strut\scrheadings@even@right@head\strut}}}%
  {%
    \rlap{\parbox{\@headwidth}{\raggedright
        \strut\scrheadings@odd@left@head\strut}}%
    \hfill
    \parbox{\@headwidth}{\centering
      \strut\scrheadings@odd@middle@head\strut}%
    \hfill
    \llap{\parbox{\@headwidth}{\raggedleft%
        \strut\scrheadings@odd@right@head\strut}}}%
  {%
    \rlap{\parbox{\@headwidth}{\raggedright
        \strut\scrheadings@odd@left@head\strut}}%
    \hfill
    \parbox{\@headwidth}{\centering
      \strut\scrheadings@odd@middle@head\strut}%
    \hfill
    \llap{\parbox{\@headwidth}{\raggedleft
        \strut\scrheadings@odd@right@head\strut}}}}%
{%
  {%
    \rlap{\parbox{\@footwidth}{\raggedright
        \strut\scrheadings@even@left@foot\strut}}%
    \hfill
    \parbox{\@footwidth}{\centering
      \strut\scrheadings@even@middle@foot\strut}%
    \hfill
    \llap{\parbox{\@footwidth}{\raggedleft
        \strut\scrheadings@even@right@foot\strut}}}%
  {%
    \rlap{\parbox{\@footwidth}{\raggedright
        \strut\scrheadings@odd@left@foot\strut}}%
    \hfill
    \parbox{\@footwidth}{\centering
      \strut\scrheadings@odd@middle@foot\strut}%
    \hfill
    \llap{\parbox{\@footwidth}{\raggedleft
        \strut\scrheadings@odd@right@foot\strut}}}%
  {%
    \rlap{\parbox{\@footwidth}{\raggedright
        \strut\scrheadings@odd@left@foot\strut}}%
    \hfill
    \parbox{\@footwidth}{\centering
      \strut\scrheadings@odd@middle@foot\strut}%
    \hfill
    \llap{\parbox{\@footwidth}{\raggedleft
        \strut\scrheadings@odd@right@foot\strut}}%
  }%
}
\newcommand*{\scrheadings@even@left@head}{}
\newcommand*{\scrheadings@even@middle@head}{}
\newcommand*{\scrheadings@even@right@head}{}
\newcommand*{\scrheadings@odd@left@head}{}
\newcommand*{\scrheadings@odd@middle@head}{}
\newcommand*{\scrheadings@odd@right@head}{}
\newcommand*{\scrheadings@even@left@foot}{}
\newcommand*{\scrheadings@even@middle@foot}{}
\newcommand*{\scrheadings@even@right@foot}{}
\newcommand*{\scrheadings@odd@left@foot}{}
\newcommand*{\scrheadings@odd@middle@foot}{}
\newcommand*{\scrheadings@odd@right@foot}{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\ihead}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\ohead}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\chead}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\lehead}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\lohead}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\rehead}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\rohead}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\cehead}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\cohead}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\ifoot}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\ofoot}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\cfoot}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\lefoot}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\lofoot}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\refoot}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\rofoot}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\cefoot}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% \begin{macro}{\cofoot}
% \changes{v2.0}{2001/04/20}{New}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
%     \cs{kernel@ifnextchar}}%^^A
% We also need macros to define the contents of the three part head
% and foot. Each macro defines one of the part of head or foot of the
% scrheadings pagestyle and optional of the scrplain pagestyle.
%    \begin{macrocode}
\newcommand{\ihead}{\kernel@ifnextchar[{\@@lhead}{\@lhead}}
\newcommand{\@lhead}[1]{\@rehead{#1}\@lohead{#1}}
\newcommand{\@@lhead}[2][]{\@@rehead[{#1}]{#2}\@@lohead[{#1}]{#2}}
\newcommand{\ohead}{\kernel@ifnextchar[{\@@rhead}{\@rhead}}
\newcommand{\@rhead}[1]{\@lehead{#1}\@rohead{#1}}
\newcommand{\@@rhead}[2][]{\@@lehead[{#1}]{#2}\@@rohead[{#1}]{#2}}
\newcommand{\chead}{\kernel@ifnextchar[{\@@chead}{\@chead}}
\newcommand{\@chead}[1]{\@cehead{#1}\@cohead{#1}}
\newcommand{\@@chead}[2][]{\@@cehead[{#1}]{#2}\@@cohead[{#1}]{#2}}
\newcommand{\lehead}{\kernel@ifnextchar[{\@@lehead}{\@lehead}}
\newcommand{\@lehead}[1]{\renewcommand*{\scrheadings@even@left@head}{#1}}
\newcommand{\@@lehead}[2][]{%
  \renewcommand*{\scrplain@even@left@head}{#1}%
  \renewcommand*{\scrheadings@even@left@head}{#2}}
\newcommand{\lohead}{\kernel@ifnextchar[{\@@lohead}{\@lohead}}
\newcommand{\@lohead}[1]{\renewcommand*{\scrheadings@odd@left@head}{#1}}
\newcommand{\@@lohead}[2][]{%
  \renewcommand*{\scrplain@odd@left@head}{#1}%
  \renewcommand*{\scrheadings@odd@left@head}{#2}}
\newcommand{\rehead}{\kernel@ifnextchar[{\@@rehead}{\@rehead}}
\newcommand{\@rehead}[1]{\renewcommand*{\scrheadings@even@right@head}{#1}}
\newcommand{\@@rehead}[2][]{%
  \renewcommand*{\scrplain@even@right@head}{#1}%
  \renewcommand*{\scrheadings@even@right@head}{#2}}
\newcommand{\rohead}{\kernel@ifnextchar[{\@@rohead}{\@rohead}}
\newcommand{\@rohead}[1]{\renewcommand*{\scrheadings@odd@right@head}{#1}}
\newcommand{\@@rohead}[2][]{%
  \renewcommand*{\scrplain@odd@right@head}{#1}%
  \renewcommand*{\scrheadings@odd@right@head}{#2}}
\newcommand{\cehead}{\kernel@ifnextchar[{\@@cehead}{\@cehead}}
\newcommand{\@cehead}[1]{\renewcommand*{\scrheadings@even@middle@head}{#1}}
\newcommand{\@@cehead}[2][]{%
  \renewcommand*{\scrplain@even@middle@head}{#1}%
  \renewcommand*{\scrheadings@even@middle@head}{#2}}
\newcommand{\cohead}{\kernel@ifnextchar[{\@@cohead}{\@cohead}}
\newcommand{\@cohead}[1]{\renewcommand*{\scrheadings@odd@middle@head}{#1}}
\newcommand{\@@cohead}[2][]{%
  \renewcommand*{\scrplain@odd@middle@head}{#1}%
  \renewcommand*{\scrheadings@odd@middle@head}{#2}}
\newcommand{\ifoot}{\kernel@ifnextchar[{\@@lfoot}{\@lfoot}}
\newcommand{\@lfoot}[1]{\@refoot{#1}\@lofoot{#1}}
\newcommand{\@@lfoot}[2][]{\@@refoot[{#1}]{#2}\@@lofoot[{#1}]{#2}}
\newcommand{\ofoot}{\kernel@ifnextchar[{\@@rfoot}{\@rfoot}}
\newcommand{\@rfoot}[1]{\@lefoot{#1}\@rofoot{#1}}
\newcommand{\@@rfoot}[2][]{\@@lefoot[{#1}]{#2}\@@rofoot[{#1}]{#2}}
\newcommand{\cfoot}{\kernel@ifnextchar[{\@@cfoot}{\@cfoot}}
\newcommand{\@cfoot}[1]{\@cefoot{#1}\@cofoot{#1}}
\newcommand{\@@cfoot}[2][]{\@@cefoot[{#1}]{#2}\@@cofoot[{#1}]{#2}}
\newcommand{\lefoot}{\kernel@ifnextchar[{\@@lefoot}{\@lefoot}}
\newcommand{\@lefoot}[1]{\renewcommand*{\scrheadings@even@left@foot}{#1}}
\newcommand{\@@lefoot}[2][]{%
  \renewcommand*{\scrplain@even@left@foot}{#1}%
  \renewcommand*{\scrheadings@even@left@foot}{#2}}
\newcommand{\lofoot}{\kernel@ifnextchar[{\@@lofoot}{\@lofoot}}
\newcommand{\@lofoot}[1]{\renewcommand*{\scrheadings@odd@left@foot}{#1}}
\newcommand{\@@lofoot}[2][]{%
  \renewcommand*{\scrplain@odd@left@foot}{#1}%
  \renewcommand*{\scrheadings@odd@left@foot}{#2}}
\newcommand{\refoot}{\kernel@ifnextchar[{\@@refoot}{\@refoot}}
\newcommand{\@refoot}[1]{\renewcommand*{\scrheadings@even@right@foot}{#1}}
\newcommand{\@@refoot}[2][]{%
  \renewcommand*{\scrplain@even@right@foot}{#1}%
  \renewcommand*{\scrheadings@even@right@foot}{#2}}
\newcommand{\rofoot}{\kernel@ifnextchar[{\@@rofoot}{\@rofoot}}
\newcommand{\@rofoot}[1]{\renewcommand*{\scrheadings@odd@right@foot}{#1}}
\newcommand{\@@rofoot}[2][]{%
  \renewcommand*{\scrplain@odd@right@foot}{#1}%
  \renewcommand*{\scrheadings@odd@right@foot}{#2}}
\newcommand{\cefoot}{\kernel@ifnextchar[{\@@cefoot}{\@cefoot}}
\newcommand{\@cefoot}[1]{\renewcommand*{\scrheadings@even@middle@foot}{#1}}
\newcommand{\@@cefoot}[2][]{%
  \renewcommand*{\scrplain@even@middle@foot}{#1}%
  \renewcommand*{\scrheadings@even@middle@foot}{#2}}
\newcommand{\cofoot}{\kernel@ifnextchar[{\@@cofoot}{\@cofoot}}
\newcommand{\@cofoot}[1]{\renewcommand*{\scrheadings@odd@middle@foot}{#1}}
\newcommand{\@@cofoot}[2][]{%
  \renewcommand*{\scrplain@odd@middle@foot}{#1}%
  \renewcommand*{\scrheadings@odd@middle@foot}{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\clearscrheadings}
% \changes{v2.0j}{2001/08/18}{New}
% \begin{macro}{\clearscrheadfoot}
% \changes{v2.0j}{2001/08/18}{New}
% \begin{macro}{\clearscrpain}
% \changes{v2.0j}{2001/08/18}{New}
% Maybe you want to clear the currently defined head and foot. First
% let's clear only scrheadings pagestyle but not scrplain pagestyle.
% We do this simply using the already known command:
%    \begin{macrocode}
\newcommand*{\clearscrheadings}{%
  \ihead{}\chead{}\ohead{}\ifoot{}\cfoot{}\ofoot{}}
%    \end{macrocode}
% We can do almost the same to clear scrheadings pagestyle and
% scrplain pagestyle together:
%    \begin{macrocode}
\newcommand*{\clearscrheadfoot}{%
  \ihead[]{}\chead[]{}\ohead[]{}\ifoot[]{}\cfoot[]{}\ofoot[]{}}
%    \end{macrocode}
% But, for only clearing the scrplain pagestyle, we have to do the
% redefinition directly:
%    \begin{macrocode}
\newcommand*{\clearscrplain}{%
  \renewcommand*{\scrplain@even@left@head}{}%
  \renewcommand*{\scrplain@even@middle@head}{}%
  \renewcommand*{\scrplain@even@right@head}{}%
  \renewcommand*{\scrplain@odd@left@head}{}%
  \renewcommand*{\scrplain@odd@middle@head}{}%
  \renewcommand*{\scrplain@odd@right@head}{}%
  \renewcommand*{\scrplain@even@left@foot}{}%
  \renewcommand*{\scrplain@even@middle@foot}{}%
  \renewcommand*{\scrplain@even@right@foot}{}%
  \renewcommand*{\scrplain@odd@left@foot}{}%
  \renewcommand*{\scrplain@odd@middle@foot}{}%
  \renewcommand*{\scrplain@odd@right@foot}{}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% Let's do the default setting:
% \changes{v2.0m}{2002/02/05}{Active support for new letter class
%   \texttt{scrlttr2}}%^^A
% \changes{v3.12}{2013/12/14}{fix \cs{rohead} if page number left at head}%^^A
% \changes{v3.28}{2019/11/23}{\cs{PackageErrorNoLine} durch \cs{PackageError}
%   ersetzt}%^^A
%    \begin{macrocode}
\def\@tempa{koma}\ifx\scrheadings@style\@tempa
  \@ifclassloaded{scrlttr2}{%
    \ifcase\@pageat
      \lehead[\pagemark]{\pagemark}\lohead[\pagemark]{\pagemark}%
      \chead{\rightmark}%
      \rehead{\leftmark}\rohead{\leftmark}%
    \or
      \lehead{\leftmark}\lohead{\leftmark}%
      \chead[\pagemark]{\pagemark}%
      \rehead{\rightmark}\rohead{\rightmark}%
    \or
      \lehead{\leftmark}\lohead{\leftmark}%
      \chead{\rightmark}%
      \rehead[\pagemark]{\pagemark}\rohead[\pagemark]{\pagemark}%
    \or
      \lehead{\leftmark}\lohead{\leftmark}%
      \rehead{\rightmark}\rohead{\rightmark}%
      \lefoot[\pagemark]{\pagemark}\lofoot[\pagemark]{\pagemark}%
    \or
      \lehead{\leftmark}\lohead{\leftmark}%
      \rehead{\rightmark}\rohead{\rightmark}%
      \cfoot[\pagemark]{\pagemark}%
    \or
      \lehead{\leftmark}\lohead{\leftmark}%
      \rehead{\rightmark}\rohead{\rightmark}%
      \refoot[\pagemark]{\pagemark}\rofoot[\pagemark]{\pagemark}%
    \fi
    \let\ps@save@myheadings=\ps@save@headings
    }{%
    \ohead{\if@twoside\headmark\fi}%
    \chead{\if@twoside\else\headmark\fi}%
    \cfoot[\if@twoside\else\pagemark\fi]{\if@twoside\else\pagemark\fi}%
    \ofoot[\if@twoside\pagemark\fi]{\if@twoside\pagemark\fi}%
    }%
\else\def\@tempa{standard}\ifx\scrheadings@style\@tempa
    \ihead{\headmark}
    \ohead{\pagemark}
    \cfoot[\pagemark]{}
  \else\PackageError{scrpage2}{unknown scrheadings style}%
                    {Somehow \string\scrheadings@style was
                      defined\MessageBreak
                      as ``\scrheadings@style''.\MessageBreak
                      scrpage2 doesn't know what to do.
                      If you'll continue, pagestyle
                      ``scrheadings''\MessageBreak 
                      will be predefined empty.}
\fi\fi
\begingroup\expandafter\expandafter\expandafter\endgroup\expandafter
\ifx\csname chaptermark\endcsname\relax
  \begingroup\expandafter\expandafter\expandafter\endgroup\expandafter
  \ifx\csname sectionmark\endcsname\relax
    \ifx\@mkboth\markboth\@automarktrue\fi
  \else
%    \end{macrocode}
% \changes{v2.5a}{2012/11/02}{\cs{@gobble} is long, but \cs{sectionmark} and
%   \cs{chaptermark} may be short}
%    \begin{macrocode}
    \ifx\sectionmark\@gobble\else
      \begingroup
        \def\@gobble#1{}\ifx\sectionmark\@gobble\else
          \aftergroup\@automarktrue
        \fi
      \endgroup
    \fi
  \fi
\else
  \ifx\chaptermark\@gobble\else
    \begingroup
      \def\@gobble#1{}\ifx\chaptermark\@gobble\else
        \aftergroup\@automarktrue
      \fi
    \endgroup
  \fi
\fi
%    \end{macrocode}
%
%
% \subsection{Configurationfile}
% Not last and not least we include the local configuration-file
% \texttt{scrpage.cfg}, if it exists.
%    \begin{macrocode}
\InputIfFileExists{scrpage.cfg}
           {\typeout{*************************************^^J%
                     * Local config file scrpage.cfg used^^J%
                     *************************************}}
           {}
%    \end{macrocode}
%
%
% \subsection{Some checks}
% \changes{v2.0}{2001/04/20}{\cs{headheight}-check}
% Last but not least we do some checks at version 2. Some means one at
% the moment. And the one is a check, if the \cs{headheight} should be
% increased.
%    \begin{macrocode}
\AtBeginDocument{%
  \ifdim\headheight=12pt
    \PackageWarningNoLine{scrpage2}%
      {seems you are using a constant headheight.\MessageBreak
       If you get overfull \string\vbox\space warnings at almost every%
       \MessageBreak
       page, you should increase headheight e.g. writing\MessageBreak
       \space\string\setlength{\string\headheight}{%
       1.1\string\baselineskip}\MessageBreak
       into the preamble of your document.\MessageBreak
       A better solution would be to use typearea package}%
  \else\ifdim\headheight<1.07\baselineskip
    \PackageWarningNoLine{scrpage2}%
      {seems you are using a very small headheight.\MessageBreak
       If you get overfull \string\vbox\space warnings at almost every%
       \MessageBreak
       page, you should increase headheight e.g. writing\MessageBreak
       \space\string\setlength{\string\headheight}{%
       1.1\string\baselineskip}\MessageBreak
       into the preamble of your document.\MessageBreak
       A better solution would be to use typearea package}%
  \fi\fi}
%    \end{macrocode}
%
% \subsection{End}
%    \begin{macrocode}
%</scrpage2>
%    \end{macrocode}
%
% \Finale
%
\endinput
%
% end of file `scrpage2.dtx'
%%% Local Variables:
%%% mode: doctex
%%% TeX-master: t
%%% End: