summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/koma-script/doc/scrpage2.tex
blob: fe7c62a504731ec7076a679307eb6917e8d85ec2 (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
% ======================================================================
% scrpage2.tex
% Copyright (c) Markus Kohm, 2001-2018
%
% 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 and of this work.
%
% This work has the LPPL maintenance status "author-maintained".
%
% The Current Maintainer and author of this work is Markus Kohm.
%
% This work consists of all files listed in manifest.txt.
% ----------------------------------------------------------------------
% scrpage2.tex
% Copyright (c) Markus Kohm, 2001-2018
%
% 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 und dieses Werks.
%
% Dieses Werk hat den LPPL-Verwaltungs-Status "author-maintained"
% (allein durch den Autor verwaltet).
%
% Der Aktuelle Verwalter und Autor dieses Werkes ist Markus Kohm.
% 
% Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien.
% ======================================================================
%
% Chapter about scrpage2
% Maintained by Markus Kohm
%
% ----------------------------------------------------------------------
%
% Kapitel über scrpage2
% Verwaltet von Markus Kohm
%
% ============================================================================

\begin{filecontents*}{\jobname-ngerman.tex}
\input{ngerman/guide-ngerman.tex}
% \section{Jens-Uwe's Example Text}
%
% TODO: These should be merged with other example text.
% \begin{macro}{\XmpText}
%   Example text command; the default definition (50) returns the whole text.
%    \begin{macrocode}
\newcommand*{\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
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\XmpTopText}
% \begin{macro}{\XmpBotText}
%   These two commands are language-dependent, since in some languages
%   additional commands may required.
%    \begin{macrocode}
\newcommand*{\XmpTopText}{\XmpText[3]}
\newcommand*{\XmpBotText}{\XmpText[2]}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\XmpMarginTextA}
% \begin{macro}{\XmpMarginTextB}
%   Margin notes.
%    \begin{macrocode}
\newcommand*{\XmpMarginTextA}{Netzhaut}
\newcommand*{\XmpMarginTextB}{(\textit{Retina})}
%    \end{macrocode}
% \end{macro}
% \end{macro}
\end{filecontents*}

\begin{filecontents*}{\jobname-english.tex}
\input{english/guide-english.tex}
% \begin{macro}{\XmpText}
%   Example text command; the default definition (50) returns the whole text.
%    \begin{macrocode}
\newcommand*{\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
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\XmpTopText}
% \begin{macro}{\XmpBotText}
%   These two commands are language-dependent, since in some languages
%   additional commands may required.
%    \begin{macrocode}
\newcommand*{\XmpTopText}{\XmpText[3]}
\newcommand*{\XmpBotText}{\XmpText[2]}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\XmpMarginTextA}
% \begin{macro}{\XmpMarginTextB}
%   Margin notes.
%    \begin{macrocode}
\newcommand*{\XmpMarginTextA}{Retina}
\newcommand*{\XmpMarginTextB}{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
\end{filecontents*}

\documentclass[ngerman,english]{scrguide}

\makeatletter
\renewcommand*{\@pnumwidth}{2em}
\makeatother

\KOMAProvidesFile{scrpage2.tex}%
                 [$Date: 2013-07-22 $
                  a user guide to obsolete package scrpage2]

\begin{document}

\addparttocentry{}{English}
\def\theHchapter{E.\thechapter}
\setcounter{chapter}{0}
\renewcommand*{\thepage}{E.\arabic{page}}
\title{The Obsolete Package \Package{scrpage2}}
\subtitle{Extract from former versions of the \KOMAScript{} Manual}
\author{Markus Kohm\and Jens-Uwe-Morakswi}
\date{2018-02-07}
\maketitle

\tableofcontents

\translator{Jens-Uwe Morawski\and Karl-Heinz Zimmer\and Christoph Bier\and
  Gernot Hassenpflug\and Markus Kohm}

\chapter{Adapting Page Headers and Footers with \Package{scrpage2}}
\labelbase{scrpage-en}

%
\BeginIndexGroup
\BeginIndex{Package}{scrpage2}%
\BeginIndex{}{page>style}
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{} manual.

\begin{Explain}
  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.
\end{Explain}


\section{Basic Functionality}\label{sec:scrpage-en.basics}

\begin{Explain}% Introduction to headings
  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.
\end{Explain}


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 \autoref{sec:scrpage-en.basics.mark}.

  
\subsection{Predefined Page Styles}\label{sec:scrpage-en.basics.buildIn}

One of the basic features of \Package{scrpage2} is a set of predefined,
configurable page styles.

% \lehead ...
% scrheadings
% \headmark \pagemark 

\begin{Declaration}
  \PageStyle{scrheadings}%
  \PageStyle{scrplain}
\end{Declaration}%
Package \Package{scrpage2} delivers its own page style, named
\PageStyle{scrheadings}, which can be activated with the
\Macro{pagestyle}\PParameter{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
\autoref{sec:scrpage-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
\autoref{sec:scrpage-en.basics.mark}). The \PageStyle{scrplain} page style can
also be activated directly with \Macro{pagestyle}.


\begin{Declaration}
  \Macro{lehead}%
    \OParameter{scrplain-left-even}\Parameter{scrheadings-left-even}%
  \Macro{cehead}%
    \OParameter{scrplain-center-even}\Parameter{scrheadings-center-even}%
  \Macro{rehead}%
    \OParameter{scrplain-right-even}\Parameter{scrheadings-right-even}%
  \Macro{lefoot}%
    \OParameter{scrplain-left-even}\Parameter{scrheadings-left-even}%
  \Macro{cefoot}%
    \OParameter{scrplain-center-even}\Parameter{scrheadings-center-even}%
  \Macro{refoot}%
    \OParameter{scrplain-right-even}\Parameter{scrheadings-right-even}%
  \Macro{lohead}%
    \OParameter{scrplain-left-odd}\Parameter{scrheadings-left-odd}%
  \Macro{cohead}%
    \OParameter{scrplain-center-odd}\Parameter{scrheadings-center-odd}%
  \Macro{rohead}%
    \OParameter{scrplain-right-odd}\Parameter{scrheadings-right-odd}%
  \Macro{lofoot}%
    \OParameter{scrplain-left-odd}\Parameter{scrheadings-left-odd}%
  \Macro{cofoot}%
    \OParameter{scrplain-center-odd}\Parameter{scrheadings-center-odd}%
  \Macro{rofoot}%
    \OParameter{scrplain-right-odd}\Parameter{scrheadings-right-odd}%
  \Macro{ihead}%
    \OParameter{scrplain-inside}\Parameter{scrheadings-inside}%
  \Macro{chead}%
    \OParameter{scrplain-centered}\Parameter{scrheadings-centered}%
  \Macro{ohead}%
    \OParameter{scrplain-outside}\Parameter{scrheadings-outside}%
  \Macro{ifoot}%
    \OParameter{scrplain-inside}\Parameter{scrheadings-inside}%
  \Macro{cfoot}%
    \OParameter{scrplain-centered}\Parameter{scrheadings-centered}%
  \Macro{ofoot}%
    \OParameter{scrplain-outside}\Parameter{scrheadings-outside}
\end{Declaration}%
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
\autoref{fig:scrpage-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
  \setcapindent{0pt}%
  \begin{captionbeside}
    [Commands for modification of \Package{scrpage2} page styles elements]%
    {Commands for modification of page styles \PageStyle{scrheadings} and
      \PageStyle{scrplain} and their relationship to header and footer
      elements}
    [l]
  \setlength{\unitlength}{.95mm}\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}}
                                % items top left
    \put(1,63){\framebox(8,4){~}}
    \put(16,63){\framebox(8,4){~}}
    \put(31,63){\framebox(8,4){~}}
                                % items top right
    \put(61,63){\framebox(8,4){~}}
    \put(76,63){\framebox(8,4){~}}
    \put(91,63){\framebox(8,4){~}}
                                % items bottom left
    \put(1,13){\framebox(8,4){~}}
    \put(16,13){\framebox(8,4){~}}
    \put(31,13){\framebox(8,4){~}}
                                % items bottom right
    \put(61,13){\framebox(8,4){~}}
    \put(76,13){\framebox(8,4){~}}
    \put(91,13){\framebox(8,4){~}}
                                % commands and arrow
                                % for twoside
                                % 
    \put(50,65){\makebox(0,0){\DescRef{scrpage-en.cmd.ihead}}}
    \put(44,65){\vector(-1,0){4}}\put(56,65){\vector(1,0){4}}
    \put(50,58){\makebox(0,0){\DescRef{scrpage-en.cmd.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){\DescRef{scrpage-en.cmd.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}}
                                %
    \put(50,15){\makebox(0,0){\DescRef{scrpage-en.cmd.ifoot}}}
    \put(56,15){\vector(1,0){4}}\put(44,15){\vector(-1,0){4}}
    \put(50,22){\makebox(0,0){\DescRef{scrpage-en.cmd.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){\DescRef{scrpage-en.cmd.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}}
                                % commands for oneside
    \put(5,69){\makebox(0,0)[b]{\DescRef{scrpage-en.cmd.lehead}}}
    \put(20,69){\makebox(0,0)[b]{\DescRef{scrpage-en.cmd.cehead}}}
    \put(35,69){\makebox(0,0)[b]{\DescRef{scrpage-en.cmd.rehead}}}
                                %
    \put(65,69){\makebox(0,0)[b]{\DescRef{scrpage-en.cmd.lohead}}}
    \put(80,69){\makebox(0,0)[b]{\DescRef{scrpage-en.cmd.cohead}}}
    \put(95,69){\makebox(0,0)[b]{\DescRef{scrpage-en.cmd.rohead}}}
                                %
    \put(5,11){\makebox(0,0)[t]{\DescRef{scrpage-en.cmd.lefoot}}}
    \put(20,11){\makebox(0,0)[t]{\DescRef{scrpage-en.cmd.cefoot}}}
    \put(35,11){\makebox(0,0)[t]{\DescRef{scrpage-en.cmd.refoot}}}
                                %
    \put(65,11){\makebox(0,0)[t]{\DescRef{scrpage-en.cmd.lofoot}}}
    \put(80,11){\makebox(0,0)[t]{\DescRef{scrpage-en.cmd.cofoot}}}
    \put(95,11){\makebox(0,0)[t]{\DescRef{scrpage-en.cmd.rofoot}}}
  \end{picture}
  \end{captionbeside}
%  \caption[Commands for modification of \Package{scrpage2} page styles
%  elements]%
%  {Commands for modification of page styles \PageStyle{scrheadings} and
%    \PageStyle{scrplain} and their relationship to header and footer
%    elements}
  \label{fig:scrpage-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{lstcode}
  \cfoot{\pagemark}
\end{lstcode}
  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{lstcode}
  \ohead{\pagemark}
  \ihead{\headmark}
  \cfoot{}
\end{lstcode}
  The command \Macro{cfoot}\PParameter{} 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{lstcode}
  \ohead{\pagemark}
  \rehead{Annual Report 2001}
  \lohead{\headmark}
  \cefoot{TheCompanyName Inc.}
  \cofoot{Department: Development}
\end{lstcode}
  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{lstcode}
  \cfoot[\pagemark]{}
  \ohead[]{\pagemark}
\end{lstcode}
  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}
%
\EndIndexGroup


\begin{Declaration}
  \Macro{clearscrheadings}%
  \Macro{clearscrplain}%
  \Macro{clearscrheadfoot}
\end{Declaration}%
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{lstcode}
  \clearscrheadfoot
  \ohead{\headmark}
  \ofoot[\pagemark]{\pagemark}
\end{lstcode}
  Without the commands \Macro{clearscrheadfoot},
  \Macro{clearscrheadings} and \Macro{clearscrplain}, six commands with
  additional nine empty arguments would be required:
\begin{lstcode}
  \ihead[]{}
  \chead[]{}
  \ohead[]{\headmark}
  \ifoot[]{}
  \cfoot[]{}
  \ofoot[\pagemark]{\pagemark}
\end{lstcode}
  Of course, for a specific configuration, some of them could be
  dropped.%
\end{Example}%
%
\EndIndexGroup
%
\EndIndexGroup


In the previous examples two commands were used which have not been
introduced yet. The description of these commands follows.

\begin{Declaration}
  \Macro{leftmark}%
  \Macro{rightmark}
\end{Declaration}%
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.
%
\EndIndexGroup


\begin{Declaration}
  \Macro{headmark}
\end{Declaration}%
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.%
%
\EndIndexGroup


\begin{Declaration}
  \Macro{pagemark}
\end{Declaration}%
This command returns the formatted page number. The formatting can be
controlled by \DescRef{scrpage-en.cmd.pnumfont}, introduced in
\autoref{sec:scrpage-en.basics.format}, \DescPageRef{scrpage-en.cmd.pnumfont},
which \Macro{pagemark} heeds automatically.%
%
\EndIndexGroup


\begin{Declaration}
  \PageStyle{useheadings}
\end{Declaration}%
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
\Macro{pagestyle}\PParameter{headings}\IndexCmd{pagestyle}, but this has the
disadvantage that commands \DescRef{scrpage-en.cmd.automark} and \DescRef{scrpage-en.cmd.manualmark}, to be
discussed shortly, do not function as expected.  For this reason one should
shift back to the original styles using
\Macro{pagestyle}\PParameter{useheadings}\IndexCmd{pagestyle}, which chooses
the correct page styles automatically for both manual and automatic running
headings.%
%
\EndIndexGroup


\subsection{Manual and Running Headings}
\label{sec:scrpage-en.basics.mark}
% \automark \manualmark
\BeginIndexGroup
\BeginIndex{}{headings>running}%
\BeginIndex{}{headings>automatic}%
\BeginIndex{}{headings>manual}%
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
\DescRef{scrpage-en.cmd.automark} and \DescRef{scrpage-en.cmd.manualmark}, respectively.  The default
can be set already while loading of the package, with the options
\DescRef{scrpage-en.option.automark} and \DescRef{scrpage-en.option.manualmark} (see
\autoref{sec:scrpage-en.basics.options},
\DescPageRef{scrpage-en.option.automark}).


\begin{Declaration}
  \Macro{manualmark}
\end{Declaration}%
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}\IndexCmd{markboth} and
\Macro{markright}\IndexCmd{markright} are available.%
%
\EndIndexGroup


\begin{Declaration}
  \Macro{automark}\OParameter{right page}\Parameter{left page}
\end{Declaration}%
The macro \Macro{automark} 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:
\PValue{part}\ChangedAt{v2.2}{\Package{scrpage2}}, \PValue{chapter},
\PValue{section}, \PValue{subsection}, \PValue{subsubsection},
\PValue{paragraph}, and \PValue{subparagraph}.  For most of the classes use of
\PValue{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 \PName{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
\DescRef{scrpage-en.option.autooneside}\IndexOption{autooneside}\important{\DescRef{scrpage-en.option.autooneside}}
one can also set that the optional argument in single-sided mode is ignored
automatically (see \autoref{sec:scrpage-en.basics.options},
\DescPageRef{scrpage-en.option.autooneside}).
%
\begin{Example}
  Assuming that the document uses a \emph{book} class, whose topmost
  section level is \emph{chapter}, then after a preceding
  \DescRef{scrpage-en.cmd.manualmark}
\begin{lstcode}
  \automark[section]{chapter}
\end{lstcode}
  restores the original behaviour.  If one prefers lower section levels
  in running headings, the following can be used:
\begin{lstcode}
  \automark[subsection]{section}
\end{lstcode}
%  How useful the last declaration is, everybody has to decide
%  for themselves.
\end{Example}

\begin{Explain}
  For the upper section level, the data of the headings is set by the command
  \Macro{markboth}\IndexCmd{markboth}, while that for the lower section level
  by \Macro{markright}\IndexCmd{markright} or
  \Macro{markleft}\IndexCmd[indexmain]{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.
\end{Explain}
\EndIndexGroup
%
\EndIndexGroup


\subsection{Formatting of Header and Footer}
\label{sec:scrpage-en.basics.format}
% \headfont \pnumfont
% \setheadwidth \setfootwidth
% \set(head|foot)(top|sep|bot)line
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.

\begin{Declaration}
  \Macro{headfont}%
  \Macro{footfont}%
  \Macro{pnumfont}
\end{Declaration}%
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{lstcode}
  \renewcommand{\headfont}{\normalfont\sffamily\bfseries}
  \renewcommand*{\footfont}{\normalfont\sffamily}
  \renewcommand{\pnumfont}{\normalfont\rmfamily\slshape}
\end{lstcode}
\end{Example}

\BeginIndex{FontElement}{pagehead}%
\BeginIndex{FontElement}{pagefoot}%
\BeginIndex{FontElement}{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.
\begin{Example}
  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{lstcode}
  \setkomafont{pagehead}\normalfont\sffamily\bfseries}
  \setkomafont{pagefoot}{\normalfont\sffamily}
  \setkomafont{pagenumber}{\normalfont\rmfamily\slshape}
\end{lstcode}
\end{Example}
\EndIndexGroup


\begin{Declaration}
\Macro{setheadwidth}\OParameter{shift}\Parameter{width}%
\Macro{setfootwidth}\OParameter{shift}\Parameter{width}
\end{Declaration}%
Normally the widths of header and footer lines correspond to the width of the
text body.  The commands
\Macro{setheadwidth}\Index{header>width}\Index{head>width} and
\Macro{setfootwidth}\Index{footer>width}\Index{foot>width} enable the user to
adapt in a simple manner the widths to his needs.  The mandatory argument
\PName{width} takes the value of the desired width of the page header or
footer, while \PName{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 \PName{width}
accepts the following symbolic values:
\begin{labeling}[\,--]{\PValue{textwithmarginpar}}
\item[\PValue{paper}] the width of the paper
\item[\PValue{page}] the width of the page
\item[\PValue{text}] the width of the text body
\item[\PValue{textwithmarginpar}] the width of the text body including margin
\item[\PValue{head}] the current header width
\item[\PValue{foot}] the current footer width
\end{labeling}
The difference between \PValue{paper} and \PValue{page} is that \PValue{page}
means the width of the paper less the binding correction if the package
\Package{typearea}\IndexPackage{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{lstcode}
  \setheadwidth[0pt]{textwithmarginpar}
\end{lstcode}
%
  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{lstcode}
  \setfootwidth[0pt]{textwithmarginpar}
\end{lstcode}
%
  In the second way the symbolic value \PValue{head} is used, since the
  header already has the desired settings.
\begin{lstcode}
  \setfootwidth[0pt]{head}
\end{lstcode}
\end{Example}

If no \PName{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 \PName{shift} is determined
automatically to correspond to the current page shape.
%
\begin{Example}
  Continuing with the previous example, we remove the optional
  argument:
\begin{lstcode}
  \setheadwidth{textwithmarginpar}
\end{lstcode}
%
  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.%
%
\EndIndexGroup


\begin{Declaration}
  \Macro{setheadtopline}\OParameter{length}\Parameter{thickness}%
                        \OParameter{commands}%
  \Macro{setheadsepline}\OParameter{length}\Parameter{thickness}%
                        \OParameter{commands}%
  \Macro{setfootsepline}\OParameter{length}\Parameter{thickness}%
                        \OParameter{commands}%
  \Macro{setfootbotline}\OParameter{length}\Parameter{thickness}%
                        \OParameter{commands}
\end{Declaration}%
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  
\DescRef{scrpage-en.option.headtopline}, \DescRef{scrpage-en.option.headsepline},
\DescRef{scrpage-en.option.footsepline}, and \DescRef{scrpage-en.option.footbotline} in
\autoref{sec:scrpage-en.basics.options},
\DescPageRef{scrpage-en.option.headsepline} for this.

\begin{labeling}[\,--]{\Macro{setfootsepline}}
\item[\Macro{setheadtopline}] configures the line above the header
\item[\Macro{setheadsepline}] configures the line below the header
\item[\Macro{setfootsepline}] configures the line above the footer
\item[\Macro{setfootbotline}] configures the line below the footer
\end{labeling}

The mandatory argument \PName{thickness} determines how strongly the
line is drawn. The optional argument \PName{length} accepts the same
symbolic values as \PName{width} for \DescRef{scrpage-en.cmd.setheadwidth}, as well as
also a normal length expression.  As long as the optional argument
\PName{length} is not assigned a value, the appropriate line length
adapts automatically the width of the header or the footer.

Use \PValue{auto} in the length argument to restore this automation
for the length of a line.

\BeginIndexGroup
\BeginIndex{FontElement}{headtopline}%
\BeginIndex{FontElement}{headsepline}%
\BeginIndex{FontElement}{footsepline}%
\BeginIndex{FontElement}{footbotline}%
\BeginIndex{FontElement}{footbottomline}%
The\ChangedAt{v2.2}{\Package{scrpage2}} optional argument \PName{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}\IndexCmd{setkomafont} to specify commands for one of the
elements \FontElement{headtopline}\important[i]{\FontElement{headtopline}\\
  \FontElement{headsepline}\\
  \FontElement{footsepline}\\
  \FontElement{footbottomline}}, \FontElement{headsepline},
\FontElement{footsepline}, \FontElement{footbottomline}, or
\FontElement{footbotline}.  These can then be extended via
\Macro{addtokomafont}\IndexCmd{addtokomafont}.  See the \KOMAScript{} manual
for details on the \Macro{setkomafont} and \Macro{addtokomafont} commands.
\EndIndexGroup


\begin{Declaration}
  \labelsuffix[auto+current]
  \Macro{setheadtopline}\POParameter{auto}%
                        \PParameter{current}%
  \labelsuffix[auto]
  \Macro{setheadtopline}\POParameter{auto}%
                        \Parameter{}%
  \labelsuffix[auto+]
  \Macro{setheadtopline}\POParameter{auto}%
                        \Parameter{}\OParameter{}
\end{Declaration}%
The arguments shown here for the command \DescRef{scrpage-en.cmd.setheadtopline} are of
course valid for the other three configuration commands too.

If the mandatory parameter has the value \PValue{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 \PName{commands} is omitted, then all command
settings that might have been specified before will remain active,
while an empty \PName{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{lstcode}
  \setheadtopline{2pt}
  \setheadsepline{.4pt}
\end{lstcode}
  Additionally\textnote{Attention!} the options \DescRef{scrpage-en.option.headtopline} and
  \DescRef{scrpage-en.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{lstcode}
  \setheadtopline{2pt}[\color{red}]
  \setheadsepline{.4pt}[\color{red}]
\end{lstcode}
  In this example, as well as in the following one, line color is
  activated by applying the syntax of the
  \Package{color}\IndexPackage{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{lstcode}
  \setheadtopline{2pt}
  \setheadsepline{.4pt}
  \setkomafont{headtopline}[\color{red}]
  \setkomafont{headsepline}[\color{red}]
\end{lstcode}

  The automatic adjustment to the header and footer width is illustrated
  in the following example:
\begin{lstcode}
  \setfootbotline{2pt}
  \setfootsepline[text]{.4pt}
  \setfootwidth[0pt]{textwithmarginpar}
\end{lstcode}

% \phantomsection for hyperref-\pageref-links jum-2001/11/24
  \phantomsection\label{page:scrpage-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
\autoref{sec:scrpage-en.basics.options}.%
%
\EndIndexGroup
\EndIndexGroup


\subsection{Package Options}
\label{sec:scrpage-en.basics.options}
% head(in|ex)clude foot(in|ex)clude --> typearea
% headtopline headsepline footbotline footsepline (plain...)
% komastyle standardstyle
% markuppercase markusecase
% automark manualmark

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\iffree{
  currently}{}. 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}.

\begin{Declaration}
  \Option{headinclude}%
  \Option{headexclude}%
  \Option{footinclude}%
  \Option{footexclude}
\end{Declaration}%
Since\textnote{Attention!} \KOMAScript~3\ChangedAt{v2.3}{\Package{scrpage2}}
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},
\OptionValue{headinclude}{false}, \Option{footinclude}, and
\OptionValue{footinclude}{false} to package \Package{typearea}.
\EndIndexGroup


\begin{Declaration}
  \Option{headtopline}%
  \Option{plainheadtopline}%
  \Option{headsepline}%
  \Option{plainheadsepline}%
  \Option{footsepline}%
  \Option{plainfootsepline}%
  \Option{footbotline}%
  \Option{plainfootbotline}
\end{Declaration}%
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\textnote{Attention!} 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 \DescRef{scrpage-en.option.headinclude} and \DescRef{scrpage-en.option.footinclude} must be set
explicitly with \Macro{documentclass} in order to transfer header or footer
line in the text area.%
%
\EndIndexGroup


\begin{Declaration}
\Option{ilines}%
\Option{clines}%
\Option{olines}
\end{Declaration}%
\Index{rule>alignment}\Index{line>alignment}%
With 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
  \DescRef{scrpage-en.cmd.setfootsepline} on \autopageref{page:scrpage-en.autoLineLength}.
\begin{lstcode}
  \usepackage[ilines]{scrpage2}
  \setfootbotline{2pt}  
  \setfootsepline[text]{.4pt}
  \setfootwidth[0pt]{textwithmarginpar}
\end{lstcode}
  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}%
\EndIndexGroup


\begin{Declaration}
  \Option{automark}%
  \Option{manualmark}
\end{Declaration}%
\BeginIndex{}{headings>automatic}%
\BeginIndex{}{headings>manual}%
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{lstcode}
  \documentclass{scrreprt}
  \usepackage{scrpage2}
\end{lstcode}
  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{lstcode}
  \pagestyle{scrheadings}
\end{lstcode}
  then the manual headings are nevertheless still active.

  If you instead use the document class \Class{scrbook}, then after
\begin{lstcode}
  \documentclass{scrbook}
  \usepackage{scrpage2}
\end{lstcode}
  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{lstcode}
  \usepackage[automark]{scrpage2}
\end{lstcode}
  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}\IndexPagestyle{scrheadings}, \PageStyle{useheadings}
  or another user-defined page style with headings.%
\end{Example}%
\EndIndexGroup


\begin{Declaration}
  \Option{autooneside}
\end{Declaration}%
\BeginIndex{}{headings>manual}%
\BeginIndex{}{headings>automatic}%
This option ensures that the optional parameter of
\DescRef{scrpage-en.cmd.automark}\IndexCmd{automark} will be ignored automatically in
one-sided mode. See also the explanation of the command
\DescRef{scrpage-en.cmd.automark} in \autoref{sec:scrpage-en.basics.mark},
\DescPageRef{scrpage-en.cmd.automark}.%
%
\EndIndexGroup


\begin{Declaration}
  \Option{komastyle}%
  \Option{standardstyle}
\end{Declaration}%
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
\DescRef{scrpage-en.option.markuppercase} will be activated automatically, but only if
option \DescRef{scrpage-en.option.markusedcase} is not given.%
\EndIndexGroup


\begin{Declaration}
  \Option{markuppercase}%
  \Option{markusedcase}
\end{Declaration}%
In order to achieve the functionality of \DescRef{scrpage-en.cmd.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\textnote{Attention!} 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.%
\EndIndexGroup


\begin{Declaration}
  \Option{nouppercase}
\end{Declaration}%
In the previous paragraph dealing with \DescRef{scrpage-en.option.markuppercase} and
\DescRef{scrpage-en.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}\IndexCmd{MakeUppercase}\important{\Macro{MakeUppercase}}
or \Macro{uppercase}\IndexCmd{uppercase}\important{\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}\IndexClass{book},
  but you do not want the uppercase headings but mixed case
  headings. Then the preamble of your document could start with:
\begin{lstcode}
  \documentclass{book}
  \usepackage[nouppercase]{scrpage2}
  \pagestyle{scrheadings}
\end{lstcode}
  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.%
%
\EndIndexGroup


\section{Defining Own Page Styles}\label{sec:scrpage-en.UI}
 
\subsection{The Interface for Beginners}\label{sec:scrpage-en.UI.user}
% \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{Declaration}
  \Macro{deftripstyle}\Parameter{name}%
  \OParameter{LO}\OParameter{LI}%
  \Parameter{HI}\Parameter{HC}\Parameter{HO}%
  \Parameter{FI}\Parameter{FC}\Parameter{FO}
\end{Declaration}%
The individual parameters have the following meanings:
\begin{labeling}[\,--]{\PName{Name}}
\item[\PName{name}] the name of the page style, in order to activate it
        using the command \Macro{pagestyle}\Parameter{name}
\item[\PName{LO}] the thickness of the outside lines,
        i.\,e., the line above the header
        and the line below the footer (optional)
\item[\PName{LI}] the thickness of the separation lines,
        i.\,e., the line below the header
        and the line above the foot (optional)
\item[\PName{HI}] contents of the inside box in the page header for two-sided
        layout or left for one-sided layout
\item[\PName{HC}] contents of the centered box in the page header
\item[\PName{HO}] contents of the outside box in the page header for two-sided
        layout or right for one-sided layout
\item[\PName{FI}] contents of the inside box in the page footer for two-sided
        layout or left for one-sided layout
\item[\PName{FC}] contents of the centered box in the page footer
\item[\PName{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{lstcode}
  \deftripstyle{TheReport}%
                {\headmark}{}{Report}%
                {}{\pagemark}{}
\end{lstcode}

  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{lstcode}
  \deftripstyle{TheReport}[2pt][.4pt]%
                {\headmark}{}{Report}%
                {}{\pagemark}{}
\end{lstcode}
  See \autoref{fig:scrpage2.tomuchlines} for the result.
%
\begin{figure}
  \typeout{^^J--- Ignore underfull and overfull \string\hbox:}
  \setcapindent{0pt}%
%  \begin{center}
  \begin{captionbeside}
    [{%
      Example of a user defined, line dominated page style%
    }]{%
      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.tomuchlines}%
    }
    [l]
    \iffree{\setlength{\unitlength}{1.15mm}}{\setlength{\unitlength}{1mm}}%
    \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}
%  \end{center}
  \end{captionbeside}
  \typeout{^^J--- Don't ignore underfull and overfull \string\hbox:^^J}
\end{figure}
\end{Example}
\EndIndexGroup


\subsection{The Interface for Experts}\label{sec:scrpage-en.UI.expert}
% \defpagestyle \newpagestyle \providepagestyle \renewpagestyle
Simple page styles, as they can be defined with \DescRef{scrpage-en.cmd.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{Declaration}
  \Macro{defpagestyle}\Parameter{name}\Parameter{header definition}\Parameter{footer definition}%
  \Macro{newpagestyle}\Parameter{name}\Parameter{header definition}\Parameter{footer definition}%
  \Macro{renewpagestyle}\Parameter{name}\Parameter{header definition}\Parameter{footer definition}%
  \Macro{providepagestyle}\Parameter{name}\Parameter{header definition}\Parameter{footer definition}
\end{Declaration}%
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}[~--]{\PName{head definition}}
\item[\PName{name}] the name of the page style for
  \Macro{pagestyle}\Parameter{name}
\item[\PName{header definition}] the declaration of the header, consisting
  of five element; elements in round parenthesis are optional:\hfill\\
  \hspace*{1em}\AParameter{ALL,ALT}%
  \Parameter{EP}\Parameter{OP}\Parameter{OS}\AParameter{BLL,BLT}
\item[\PName{footer definition}]  the declaration of the footer, consisting
  of five element; elements in round parenthesis are optional:\hfill\\  
  \hspace*{1em}\AParameter{ALL,ALT}%
  \Parameter{EP}\Parameter{OP}\Parameter{OS}\AParameter{BLL,BLT}
\end{labeling}

As can be seen, header and footer declaration have identical
structure.  The individual parameters have the following meanings:
\begin{labeling}[\ --]{\PName{OLD}}
\item[\PName{ALL}] above line length: (header = outside, footer = separation
  line)
\item[\PName{ALT}] above line thickness
\item[\PName{EP}]  definition for \emph{even} pages
\item[\PName{OP}]  definition for \emph{odd} pages
\item[\PName{OS}]  definition for \emph{one-sided} layout
\item[\PName{BLL}] below line length: (header = separation line, footer =
  outside)
\item[\PName{BLT}] below line thickness
\end{labeling}

If the optional line-parameters are omitted, then the line behaviour remains
configurable by the commands introduced in
\autoref{sec:scrpage-en.basics.format},
\DescPageRef{scrpage-en.cmd.setheadtopline}.

The three elements \PName{EP}, \PName{OP} and \PName{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{lstcode}[belowskip=\dp\strutbox]
  {\headmark\hfill\pagemark}
\end{lstcode}

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{lstcode}
  {\rlap{\headmark}\hfill centered text\hfill\llap{\pagemark}}
\end{lstcode}

\iffalse% Umbruchkorrekturtext
This and the use of the expert interface in connection with other
commands provided by \Package{scpage2} follows now in the final
example.
\fi

\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 \DescRef{scrpage-en.option.automark} and
  \DescRef{scrpage-en.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{lstcode}
  \documentclass{scrbook}
  \usepackage[automark,headsepline]{scrpage2}
\end{lstcode}

  The expert interface is used to define two page styles.  The page
  style \PValue{withoutLines} does not define any line parameters.  The
  second page style \PValue{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{lstcode}
  \defpagestyle{withoutLines}{%
    {Example\hfill\headmark}{\headmark\hfill without lines}
    {\rlap{Example}\hfill\headmark\hfill%
     \llap{without lines}}
  }{%
    {\pagemark\hfill}
    {\hfill\pagemark}
    {\hfill\pagemark\hfill}
  }
\end{lstcode}

\begin{lstcode}
  \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{lstcode}

  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
  \DescRef{scrpage-en.cmd.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{lstcode}
  \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{lstcode}

  \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{lstcode}
  There is a state quatity of a system, called entropy, whose temporal
  change consists of entropy flow and entropy generation.
\end{lstcode}
  \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 \DescRef{scrpage-en.cmd.manualmark}, and the page style
  \PValue{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 \DescRef{scrpage-en.option.headsepline}.
\begin{lstcode}
  \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{lstcode}
  \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 \PValue{withLines} is
  activated.  The line settings of its definition are taken in account
  and the lines are drawn accordingly.
\begin{lstcode}
  \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{lstcode}
  \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}
\EndIndexGroup


\subsection{Managing Page Styles}\label{sec:scrpage-en.UI.cfgFile}
% scrpage.cfg
\BeginIndex{File}{scrpage.cfg}
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.
\EndIndex{File}{scrpage.cfg}
\EndIndexGroup


% ============================================================================

\cleardoubleoddpage

\selectlanguage{ngerman}
\let\savednewcommand\newcommand
\let\newcommand\renewcommand
\input{\jobname-ngerman.tex}
\let\newcommand\savednewcommand
\def\theHchapter{D.\thechapter}
\setcounter{chapter}{0}
\renewcommand*{\thepage}{D.\arabic{page}}

\phantomsection
\addparttocentry{}{Deutsch}

\title{Das obsolete Paket \Package{scrpage2}}
\subtitle{Auszug aus früheren Versionen der \KOMAScript-Anleitung}
\author{Markus Kohm\and Jens-Uwe-Morawski}
\date{2014-06-25}
\maketitle


\chapter{Kopf- und Fußzeilen mit \Package{scrpage2}}
\labelbase{scrpage-de}
%
\BeginIndexGroup
\BeginIndex{Package}{scrpage2}%
\BeginIndex{}{Seitenstil}
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.

\begin{Explain}
  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.
\end{Explain}

\section{Grundlegende Funktionen}\label{sec:scrpage-de.basics}

\begin{Explain}
  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.
\end{Explain}
  
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 \autoref{sec:scrpage-de.basics.mark}.


\subsection{Vordefinierte Seitenstile}\label{sec:scrpage-de.basics.buildIn}

Zu den grundlegenden Funktionen von \Package{scrpage2} gehören unter anderem
vordefinierte, konfigurierbare Seitenstile.

% \lehead ...
% scrheadings
% \headmark \pagemark 

\begin{Declaration}
  \PageStyle{scrheadings}%
  \PageStyle{scrplain}
\end{Declaration}%
Das Paket \Package{scrpage2} liefert für Seiten mit Kolumnentitel einen
eigenen Seitenstil namens \PageStyle{scrheadings}.  Dieser Seitenstil kann
mittels \Macro{pagestyle}\PParameter{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 \autoref{sec:scrpage-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 \autoref{sec:scrpage-de.basics.mark}). Der Seitenstil
\PageStyle{scrplain} kann auch direkt per \Macro{pagestyle} aktiviert werden.


\begin{Declaration}
  \Macro{lehead}%
    \OParameter{scrplain-links-gerade}\Parameter{scrheadings-links-gerade}%
  \Macro{cehead}%
    \OParameter{scrplain-mittig-gerade}\Parameter{scrheadings-mittig-gerade}%
  \Macro{rehead}%
    \OParameter{scrplain-rechts-gerade}\Parameter{scrheadings-rechts-gerade}%
  \Macro{lefoot}%
    \OParameter{scrplain-links-gerade}\Parameter{scrheadings-links-gerade}%
  \Macro{cefoot}%
    \OParameter{scrplain-mittig-gerade}\Parameter{scrheadings-mittig-gerade}%
  \Macro{refoot}%
    \OParameter{scrplain-rechts-gerade}\Parameter{scrheadings-rechts-gerade}%
  \Macro{lohead}%
    \OParameter{scrplain-links-ungerade}\Parameter{scrheadings-links-ungerade}%
  \Macro{cohead}%
    \OParameter{scrplain-mittig-ungerade}\Parameter{scrheadings-mittig-ungerade}%
  \Macro{rohead}%
    \OParameter{scrplain-rechts-ungerade}\Parameter{scrheadings-rechts-ungerade}%
  \Macro{lofoot}%
    \OParameter{scrplain-links-ungerade}\Parameter{scrheadings-links-ungerade}%
  \Macro{cofoot}%
    \OParameter{scrplain-mittig-ungerade}\Parameter{scrheadings-mittig-ungerade}%
  \Macro{rofoot}%
    \OParameter{scrplain-rechts-ungerade}\Parameter{scrheadings-rechts-ungerade}%
  \Macro{ihead}%
    \OParameter{scrplain-innen}\Parameter{scrheadings-innen}%
  \Macro{chead}%
    \OParameter{scrplain-zentriert}\Parameter{scrheadings-zentriert}%
  \Macro{ohead}%
    \OParameter{scrplain-außen}\Parameter{scrheadings-außen}%
  \Macro{ifoot}%
    \OParameter{scrplain-innen}\Parameter{scrheadings-innen}%
  \Macro{cfoot}%
    \OParameter{scrplain-zentriert}\Parameter{scrheadings-zentriert}%
  \Macro{ofoot}%
    \OParameter{scrplain-außen}\Parameter{scrheadings-außen}
\end{Declaration}%
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 \autoref{fig:scrpage-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
  \setcapindent{0pt}%
  \begin{captionbeside}
    [Befehle zur Manipulation der \Package{scrpage2}-Seitenstile]%
    {\hspace{0pt plus 1ex}%
      Zuord\-nung der Befehle zur Manipulation der beiden Seiten\-stile
      \PageStyle{scrheadings} und \PageStyle{scrplain} zu den Feldern im
      Kopf und Fuß der Seiten}
    [l]
  \setlength{\unitlength}{.95mm}\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}}
                                % Felder: oben links
    \put(1,63){\framebox(8,4){~}}
    \put(16,63){\framebox(8,4){~}}
    \put(31,63){\framebox(8,4){~}}
                                % Felder: oben rechts
    \put(61,63){\framebox(8,4){~}}
    \put(76,63){\framebox(8,4){~}}
    \put(91,63){\framebox(8,4){~}}
                                % Felder: unten links
    \put(1,13){\framebox(8,4){~}}
    \put(16,13){\framebox(8,4){~}}
    \put(31,13){\framebox(8,4){~}}
                                % Felder: unten rechts
    \put(61,13){\framebox(8,4){~}}
    \put(76,13){\framebox(8,4){~}}
    \put(91,13){\framebox(8,4){~}}
                                % die Befehle und Pfeile
                                % für beidseitig
                                % 
    \put(50,65){\makebox(0,0){\DescRef{scrpage-de.cmd.ihead}}}
    \put(44,65){\vector(-1,0){4}}\put(56,65){\vector(1,0){4}}
    \put(50,58){\makebox(0,0){\DescRef{scrpage-de.cmd.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){\DescRef{scrpage-de.cmd.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}}
                                %
    \put(50,15){\makebox(0,0){\DescRef{scrpage-de.cmd.ifoot}}}
    \put(56,15){\vector(1,0){4}}\put(44,15){\vector(-1,0){4}}
    \put(50,22){\makebox(0,0){\DescRef{scrpage-de.cmd.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){\DescRef{scrpage-de.cmd.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}}
                                % Befehle für einseitig
    \put(5,69){\makebox(0,0)[b]{\DescRef{scrpage-de.cmd.lehead}}}
    \put(20,69){\makebox(0,0)[b]{\DescRef{scrpage-de.cmd.cehead}}}
    \put(35,69){\makebox(0,0)[b]{\DescRef{scrpage-de.cmd.rehead}}}
                                %
    \put(65,69){\makebox(0,0)[b]{\DescRef{scrpage-de.cmd.lohead}}}
    \put(80,69){\makebox(0,0)[b]{\DescRef{scrpage-de.cmd.cohead}}}
    \put(95,69){\makebox(0,0)[b]{\DescRef{scrpage-de.cmd.rohead}}}
                                %
    \put(5,11){\makebox(0,0)[t]{\DescRef{scrpage-de.cmd.lefoot}}}
    \put(20,11){\makebox(0,0)[t]{\DescRef{scrpage-de.cmd.cefoot}}}
    \put(35,11){\makebox(0,0)[t]{\DescRef{scrpage-de.cmd.refoot}}}
                                %
    \put(65,11){\makebox(0,0)[t]{\DescRef{scrpage-de.cmd.lofoot}}}
    \put(80,11){\makebox(0,0)[t]{\DescRef{scrpage-de.cmd.cofoot}}}
    \put(95,11){\makebox(0,0)[t]{\DescRef{scrpage-de.cmd.rofoot}}}
  \end{picture}
  \end{captionbeside}
%  \caption[Befehle zur Manipulation der \Package{scrpage2}-Seitenstile]%
%  {Zuordnung der Befehle zur Manipulation der Seitenstile
%    \PageStyle{scrheadings} und \PageStyle{scrplain} zu den manipulierten
%    Seitenelementen}
  \label{fig:scrpage-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{lstcode}
  \cfoot{\pagemark}
\end{lstcode}
  Sollen die Seitenzahlen\Index{Paginierung} im Kopf außen und die
  Kolumnentitel\Index{Kolumnentitel} innen stehen, dann erfolgt dies mit:
\begin{lstcode}
  \ohead{\pagemark}
  \ihead{\headmark}
  \cfoot{}
\end{lstcode}
  Das \Macro{cfoot}\PParameter{} 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{lstcode}
  \ohead{\pagemark}
  \rehead{Jahresbericht 2001}
  \lohead{\headmark}
  \cefoot{Firma WasWeißIch}
  \cofoot{Abteilung Entwicklung}
\end{lstcode}
  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{lstcode}
  \cfoot[\pagemark]{}
  \ohead[]{\pagemark}
\end{lstcode}
  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}
%
\EndIndexGroup


% Die folgende Deklaration und Erklaerung wurde eingefuegt von
% mjk 2001-08-18
\begin{Declaration}
  \Macro{clearscrheadings}%
  \Macro{clearscrplain}%
  \Macro{clearscrheadfoot}
\end{Declaration}%
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{lstcode}
  \clearscrheadfoot
  \ohead{\headmark}
  \ofoot[\pagemark]{\pagemark}
\end{lstcode}
  Ohne die Befehle \Macro{clearscrheadings}, \Macro{clearscrplain} und
  \Macro{clearscrheadfoot} wären doppelt so viele Anweisungen und neun weitere
  leere Argumente notwendig:
\begin{lstcode}
  \ihead[]{}
  \chead[]{}
  \ohead[]{\headmark}
  \ifoot[]{}
  \cfoot[]{}
  \ofoot[\pagemark]{\pagemark}
\end{lstcode}
  Einige davon könnten natürlich entfallen, wenn man von einer
  konkreten Vorbelegung ausginge.
\end{Example}
%
\EndIndexGroup
%
\EndIndexGroup


% Satz leicht geaendert: mjk 2001-08-18
In den vorausgehenden Beispielen wurden schon zwei Befehle benutzt, die noch
gar nicht besprochen wurden.  Das soll jetzt nachgeholt werden.

% Die folgende Deklaration und Erklaerung wurde eingefuegt von
% mjk 2001-08-17
\begin{Declaration}
  \Macro{leftmark}%
  \Macro{rightmark}
\end{Declaration}%
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.
%
\EndIndexGroup


\begin{Declaration}
\Macro{headmark}
\end{Declaration}%
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.%
%
\EndIndexGroup


\begin{Declaration}
  \Macro{pagemark}
\end{Declaration}%
Dieser Befehl ermöglicht den Zugriff auf die Seitenzahl. Im
\autoref{sec:scrpage-de.basics.format}, \DescPageRef{scrpage-de.cmd.pnumfont}
wird der Befehl \DescRef{scrpage-de.cmd.pnumfont} zur Formatierung der Seitenzahl vorgestellt,
den \Macro{pagemark} automatisch berücksichtigt.%
%
\EndIndexGroup


\begin{Declaration}
  \PageStyle{useheadings}
\end{Declaration}%
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
\Macro{pagestyle}\PParameter{headings} vorzunehmen. Das hätte aber den
Nachteil, dass die nachfolgend besprochenen Befehle \DescRef{scrpage-de.cmd.automark} und
\DescRef{scrpage-de.cmd.manualmark} nicht wie erwartet funktionierten. Daher sollte mit
\Macro{pagestyle}\PParameter{useheadings}\IndexCmd{pagestyle} auf die
originalen Stile umgeschaltet werden. Eine solche Umschaltung hat dann keine
Auswirkung darauf, ob mit manuellen oder automatischen Kolumnentiteln
gearbeitet wird.%
%
\EndIndexGroup


\subsection{Manuelle und automatische Kolumnentitel}
\label{sec:scrpage-de.basics.mark}
% \automark \manualmark 
%
\BeginIndexGroup
\BeginIndex{}{Kolumnentitel>automatisch}%
\BeginIndex{}{Kolumnentitel>manuell}%
Gewöhnlich\textnote{Achtung!} 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 \DescRef{scrpage-de.cmd.automark} und \DescRef{scrpage-de.cmd.manualmark}. Die Voreinstellung kann auch
bereits beim Laden des Paketes über die Optionen \DescRef{scrpage-de.option.automark} und
\DescRef{scrpage-de.option.manualmark} beeinflusst werden (siehe
\autoref{sec:scrpage-de.basics.options},
\DescPageRef{scrpage-de.option.automark}).


\begin{Declaration}
\Macro{manualmark}
\end{Declaration}%
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}\IndexCmd{markboth} und
\Macro{markright}\IndexCmd{markright} aus dem \LaTeX-Kern bereit. Diese
Anweisungen sind im Abschnitt über Seitenstile in der \KOMAScript-Anleitung
erklärt.%
%
\EndIndexGroup


% Ergaenzt mjk 2001-07-17
\begin{Declaration}
  \Macro{automark}\OParameter{rechte Seite}\Parameter{linke Seite}
\end{Declaration}%
Die Anweisung \Macro{automark} 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:
\PValue{part}\ChangedAt{v2.2}{\Package{scrpage2}}, \PValue{chapter},
\PValue{section}, \PValue{subsection}, \PValue{subsubsection},
\PValue{paragraph} und \PValue{subparagraph}. Der Wert \PValue{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 \PName{rechte Seite} ist
ver\-ständlicherweise nur für zweiseitigen Satz gedacht. Im einseitigen Satz
sollten Sie normalerweise darauf verzichten. Mit Hilfe der Option
\DescRef{scrpage-de.option.autooneside}\IndexOption{autooneside}\important{\DescRef{scrpage-de.option.autooneside}}
können Sie auch einstellen, dass das optionale Argument im
einseitigen\Index{einseitig} Satz automatisch ignoriert wird (siehe
\autoref{sec:scrpage-de.basics.options},
\DescPageRef{scrpage-de.option.autooneside}).
\begin{Example}
  Wird beispielsweise mit einer \emph{book}-Klasse gearbeitet, deren höch\-ste
  Gliederungsebene \emph{chapter} ist, dann stellt nach einem vorhergehenden
  \DescRef{scrpage-de.cmd.manualmark} der Befehl
\begin{lstcode}
  \automark[section]{chapter}
\end{lstcode}
  den Originalzustand wieder her. Bevorzugt man stattdessen, die tieferen
  Gliederungsebenen angezeigt zu bekommen, dann erfolgt dies mit:
\begin{lstcode}
  \automark[subsection]{section}
\end{lstcode}
\end{Example}

\begin{Explain}
  Die Markierung der jeweils höheren Gliederungsebene wird mit Hilfe von
  \Macro{markboth}\IndexCmd{markboth} gesetzt. Die Markierung der
  tieferen Gliederungsebene wird mit \Macro{markright}\IndexCmd{markright}
  bzw.  \Macro{markleft}\IndexCmd{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.
\end{Explain}
\EndIndexGroup
\EndIndexGroup


\subsection{Formatierung der Kopf- und Fußzeilen}
\label{sec:scrpage-de.basics.format}
% \headfont \pnumfont
% \setheadwidth \setfootwidth
% \set(head|foot)(top|sep|bot)line
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.

\begin{Declaration}
  \Macro{headfont}%
  \Macro{footfont}%
  \Macro{pnumfont}
\end{Declaration}%
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{lstcode}
  \renewcommand*{\headfont}{%
    \normalfont\sffamily\bfseries}
  \renewcommand*{\footfont}{%
    \normalfont\sffamily}
  \renewcommand*{\pnumfont}{%
    \normalfont\rmfamily\slshape}
\end{lstcode}
\end{Example}

\BeginIndexGroup
\BeginIndex{FontElement}{pagehead}%
\BeginIndex{FontElement}{pagefoot}%
\BeginIndex{FontElement}{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{lstcode}
  \setkomafont{pagehead}{%
    \normalfont\sffamily\bfseries}
  \setkomafont{pagefoot}{%
    \normalfont\sffamily}
  \setkomafont{pagenumber}{%
    \normalfont\rmfamily\slshape}
\end{lstcode}
\end{Example}
\EndIndexGroup
\EndIndexGroup


\begin{Declaration}
\Macro{setheadwidth}\OParameter{Verschiebung}\Parameter{Breite}%
\Macro{setfootwidth}\OParameter{Verschiebung}\Parameter{Breite}
\end{Declaration}%
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} und \Macro{setfootwidth} ermöglichen dem Anwender, auf
einfache Weise die Breiten seinen Bedürfnissen anzupassen.  Das obligatorische
Argument \PName{Breite} nimmt den Wert der Breite des Kopfes bzw. des Fußes
auf, \PName{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
\PName{Breite} auch folgende symbolische Werte:
\begin{labeling}[\ --]{\PValue{textwithmarginpar}}
\item[\PValue{paper}] die Breite des Papiers
\item[\PValue{page}] die Breite der Seite
\item[\PValue{text}] die Breite des Textbereichs
\item[\PValue{textwithmarginpar}] die Breite des Textbereichs inklusive
Seitenrand
\item[\PValue{head}] die aktuelle Breite des Seitenkopfes
\item[\PValue{foot}] die aktuelle Breite des Seitenfußes
\end{labeling}
Der Unterschied zwischen \PValue{paper} und \PValue{page} besteht darin, dass
\PValue{page} die Breite des Papiers abzüglich der Bindekorrektur ist, falls
das \Package{typearea}-Paket\IndexPackage{typearea} verwendet wird (siehe das
Kapitel über \Package{typearea} in der \KOMAScript-Anleitung). Ohne Verwendung
von \Package{typearea} sind \PValue{paper} und \PValue{page}
identisch.%mjk-2001-08-17

\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{lstcode}
  \setheadwidth[0pt]{textwithmarginpar}
\end{lstcode}
%
  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{lstcode}
  \setfootwidth[0pt]{textwithmarginpar}
\end{lstcode}
%
  oder man greift auf den anderen symbolischen Wert \PValue{head} zurück, da
  der Kopf bereits die gewünschte Breite hat.
\begin{lstcode}
  \setfootwidth[0pt]{head}
\end{lstcode}
\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{lstcode}
  \setheadwidth{textwithmarginpar}
\end{lstcode}
%
  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.
\EndIndexGroup


\begin{Declaration}
  \Macro{setheadtopline}\OParameter{Länge}\Parameter{Dicke}%
                        \OParameter{Anweisungen}%
  \Macro{setheadsepline}\OParameter{Länge}\Parameter{Dicke}%
                        \OParameter{Anweisungen}%
  \Macro{setfootsepline}\OParameter{Länge}\Parameter{Dicke}%
                        \OParameter{Anweisungen}%
  \Macro{setfootbotline}\OParameter{Länge}\Parameter{Dicke}%
                        \OParameter{Anweisungen}
\end{Declaration}%
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 \DescRef{scrpage-de.option.headtopline}, \DescRef{scrpage-de.option.headsepline},
\DescRef{scrpage-de.option.footsepline}, \DescRef{scrpage-de.option.footbotline} in
\autoref{sec:scrpage-de.basics.options},
\DescPageRef{scrpage-de.option.headsepline}.

\begin{labeling}[\ --]{\Macro{setfootsepline}}
\item[\Macro{setheadtopline}] modifiziert die Parameter für die Linie
über dem Seitenkopf
\item[\Macro{setheadsepline}] modifiziert die Parameter für die Linie
zwischen Kopf und Textkörper
\item[\Macro{setfootsepline}] modifiziert die Parameter für die Linie
zwischen Text und Fuß
\item[\Macro{setfootbotline}] modifiziert die Parameter für die Linie
unter dem Seitenfuß
\end{labeling}

Das obligatorische Argument \PName{Dicke} bestimmt, wie stark die Linie
gezeichnet wird.  Das optionale Argument \PName{Länge} akzeptiert die gleichen
symbolischen Werte wie \PName{Breite} bei \DescRef{scrpage-de.cmd.setheadwidth}, also auch einen
normalen Längenausdruck.  Solange im Dokument dem optionalen Argument
\PName{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 \PValue{auto}.

Mit\ChangedAt{v2.2}{\Package{scrpage2}} dem optionalen Argument
\PName{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}\IndexCmd{setkomafont} für eines der Elemente
\FontElement{headtopline}\IndexFontElement[indexmain]{headtopline}%
\important[i]{\FontElement{headtopline}\\
  \FontElement{headsepline}\\
  \FontElement{footsepline}\\
  \FontElement{footbottomline}},
\FontElement{headsepline}\IndexFontElement[indexmain]{headsepline},
\FontElement{footsepline}\IndexFontElement[indexmain]{footsepline},
\FontElement{footbottomline}\IndexFontElement[indexmain]{footbottomline} oder
auch \FontElement{footbotline}\IndexFontElement[indexmain]{footbotline}
gesetzt und mit \Macro{addtokomafont}\IndexCmd{addtokomafont} erweitert
werden. Die beiden Anweisungen \Macro{setkomafont} und \Macro{addtokomafont}
sind in der \KOMAScript-Anleitung näher beschrieben.


\begin{Declaration}
  \labelsuffix[auto+current]%
  \Macro{setheadtopline}\POParameter{auto}
                        \PParameter{current}%
  \labelsuffix[auto]
  \Macro{setheadtopline}\POParameter{auto}\Parameter{}%
  \labelsuffix[auto+]
  \Macro{setheadtopline}\POParameter{auto}\Parameter{}\OParameter{}
\end{Declaration}%
Die hier am Befehl \DescRef{scrpage-de.cmd.setheadtopline} illustrierten Argumente
sind natürlich auch für die anderen drei Längenbefehle gültig.

Enthält das obligatorische Argument den Wert \PValue{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 \PName{Anweisungen} weggelassen, so bleiben
eventuell zuvor gesetzte Anweisungen erhalten. Wird hingegen ein leeres
Argument \PName{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{lstcode}
  \setheadtopline{2pt}
  \setheadsepline{.4pt}
\end{lstcode}
Zusätzlich\textnote{Achtung!} sind unbedingt die Optionen
\DescRef{scrpage-de.option.headtopline} und \DescRef{scrpage-de.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{lstcode}
  \setheadtopline{2pt}[\color{red}]
  \setheadsepline{.4pt}[\color{red}]
\end{lstcode}
  In diesem und auch dem folgenden Beispiel wurde für die Aktivierung der
  Farbe die Syntax des \Package{color}\IndexPackage{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{lstcode}
  \setheadtopline{2pt}
  \setheadsepline{.4pt}
  \setkomafont{headtopline}{\color{red}}
  \setkomafont{headsepline}{\color{red}}
\end{lstcode}
  verwendet werden.

  Die automatische Anpassung an die Kopf- und Fußbreiten illustriert folgendes
  Beispiel, für das die Optionen \DescRef{scrpage-de.option.footbotline} und \DescRef{scrpage-de.option.footsepline}
  gesetzt sein sollten:
\begin{lstcode}
  \setfootbotline{2pt}
  \setfootsepline[text]{.4pt}
  \setfootwidth[0pt]{textwithmarginpar}
\end{lstcode}

%\phantomsection für hyperref-\pageref-Link jum-2001/11/24
  \phantomsection\label{page:scrpage-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
\autoref{sec:scrpage-de.basics.options} mit anderen Optionen beschrieben.%
%
\EndIndexGroup
\EndIndexGroup


\subsection{Optionen beim Laden des Paketes}
\label{sec:scrpage-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} \iffree{derzeit noch
}{}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.

% head(in|ex)clude foot(in|ex)clude --> typearea
% headtopline headsepline footbotline footsepline (plain...)
% komastyle standardstyle
% markuppercase markusecase
% automark manualmark
\begin{Declaration}
  \Option{headinclude}%
  \Option{headexclude}%
  \Option{footinclude}%
  \Option{footexclude}
\end{Declaration}%
Diese\textnote{Achtung!} Optionen sollten bei Verwendung von
\KOMAScript~3\ChangedAt{v2.3}{\Package{scrpage2}} 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},
\OptionValue{headinclude}{false}, \Option{footinclude} und
\OptionValue{footinclude}{false} an das Paket \Package{typearea}
weitergereicht.
\EndIndexGroup


\begin{Declaration}
  \Option{headtopline}%
  \Option{plainheadtopline}%
  \Option{headsepline}%
  \Option{plainheadsepline}%
  \Option{footsepline}%
  \Option{plainfootsepline}%
  \Option{footbotline}%
  \Option{plainfootbotline}
\end{Declaration}%
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\textnote{Achtung!} 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
\DescRef{scrpage-de.option.headinclude} und \DescRef{scrpage-de.option.footinclude} explizit bei
\Macro{documentclass} gesetzt werden müssen, um Kopf- bzw. Fußzeile in den
Textblock zu übernehmen.%
%
\EndIndexGroup


\begin{Declaration}
  \Option{ilines}%
  \Option{clines}%
  \Option{olines}
\end{Declaration}%
\Index{Linienausrichtung}%
Bei 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 \DescRef{scrpage-de.cmd.setfootsepline} auf
  \autopageref{page:scrpage-de.autoLineLength} mit dem folgenden zu
  vergleichen, um die Wirkung der Option \Option{ilines} zu sehen.
\begin{lstcode}
  \usepackage[ilines,footsepline,footbotline]
             {scrpage2}
  \setfootbotline{2pt}  
  \setfootsepline[text]{.4pt}
  \setfootwidth[0pt]{textwithmarginpar}
\end{lstcode}
% Der folgende Text wurde erg"anzt um den Seitenumbruch zu verbessern,
% mjk-2001-10-05:
%  \enlargethispage*{2\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}
\EndIndexGroup


% \phantomsection für hyperref-\pageref-Link jum-2001/11/24
\begin{Declaration}
  \Option{automark}%
  \Option{manualmark}
\end{Declaration}%
\BeginIndex{}{Kolumnentitel>automatisch}%
\BeginIndex{}{Kolumnentitel>manuell}%
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.
% Das Folgende wurde ergaenzt, weil dazu die haeufigsten Fragen
% bzw. falschen Bug-Reports im Support kamen.
% mjk-2001-09-21:
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{lstcode}
  \documentclass{scrreprt}
  \usepackage{scrpage2}
\end{lstcode}
  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{lstcode}
  \pagestyle{scrheadings}
\end{lstcode}
  auf den Seitenstil \PageStyle{scrheadings} umschalten, sind noch immer
  manuelle Kolumnentitel eingestellt.

  Verwenden Sie stattdessen die Dokumentklasse \Class{scrbook}, so
  ist nach
\begin{lstcode}
  \documentclass{scrbook}
  \usepackage{scrpage2}
\end{lstcode}
  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{lstcode}
  \usepackage[automark]{scrpage2}
\end{lstcode}
  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}\IndexPagestyle{scrheadings} oder
  \PageStyle{useheadings} oder einen selbst definierten Seitenstil mit
  Kolumnentiteln umgeschaltet wird.
\end{Example}
\EndIndexGroup


% Folgende Deklaration und Erklaerung wurde eingefügt von
% mjk 2001-08-17:
\begin{Declaration}
  \Option{autooneside}
\end{Declaration}%
\BeginIndex{}{Kolumnentitel>automatisch}%
\BeginIndex{}{Kolumnentitel>manuell}%
Mit dieser Option wird das optionale Argument von
\DescRef{scrpage-de.cmd.automark}\IndexCmd{automark}\Index{Kolumnentitel>automatisch} im
einseitigen Satz automatisch ignoriert. Siehe hierzu auch die Erläuterung
zum Befehl \DescRef{scrpage-de.cmd.automark} in \autoref{sec:scrpage-de.basics.mark},
\DescPageRef{scrpage-de.cmd.automark}.%
%
\EndIndexGroup


\begin{Declaration}
  \Option{komastyle}%
  \Option{standardstyle}
\end{Declaration}%
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 \DescRef{scrpage-de.option.markuppercase} aktiviert,
es sei denn, \DescRef{scrpage-de.option.markusedcase} wird ebenfalls als Option übergeben.%
\EndIndexGroup


\begin{Declaration}
  \Option{markuppercase}%
  \Option{markusedcase}
\end{Declaration}%
Für die Funktionalität von \DescRef{scrpage-de.cmd.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\textnote{Achtung!} 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.%
\EndIndexGroup


% Die folgende Deklaration und Erklaerung wurde eingefuegt von
% mjk 2001-08-18
\begin{Declaration}
  \Option{nouppercase}
\end{Declaration}%
Wie in obiger Erklärung zu \DescRef{scrpage-de.option.markuppercase} und \DescRef{scrpage-de.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}\IndexCmd{uppercase}\important{\Macro{uppercase}}
oder
\Macro{MakeUppercase}\IndexCmd{MakeUppercase}\important{\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}\IndexClass{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{lstcode}
  \documentclass{book}
  \usepackage[nouppercase]{scrpage2}
  \pagestyle{scrheadings}
\end{lstcode}
  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.%
%
\EndIndexGroup


\section{Seitenstile selbst gestalten}\label{sec:scrpage-de.UI}
%
% 
\subsection{Die Anwenderschnittstelle}\label{sec:scrpage-de.UI.user}
% \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{Declaration}
  \Macro{deftripstyle}\Parameter{Name}%
  \OParameter{LA}\OParameter{LI}%
  \Parameter{KI}\Parameter{KM}\Parameter{KA}%
  \Parameter{FI}\Parameter{FM}\Parameter{FA}
\end{Declaration}%
Die einzelnen Felder haben folgende Bedeutung:
\begin{labeling}[~--]{\PName{Name}}
\item[\PName{Name}] die Bezeichnung des Seitenstils, die dann bei der
  Aktivierung mit \Macro{pagestyle}\Parameter{Name} oder
  \Macro{thispagestyle}\Parameter{Name} verwendet wird
\item[\PName{LA}] die Dicke der äußeren Linien, d.\,h. der Linien über der
  Kopfzeile und unter der Fußzeile (optional)
\item[\PName{LI}] die Dicke der inneren Linie, d.\,h. der Linien die Kopf und
  Fuß vom Textkörper trennen (optional)
\item[\PName{KI}] Inhalt des Feldes im Kopf innenseitig oder bei einseitigem
  Layout links
\item[\PName{KM}] Inhalt des Feldes im Kopf zentriert
\item[\PName{KA}] Inhalt des Feldes im Kopf außenseitig oder bei einseitigem
  Layout rechts
\item[\PName{FI}] Inhalt des Feldes im Fuß innenseitig oder bei einseitigem
  Layout links
\item[\PName{FM}] Inhalt des Feldes im Fuß zentriert
\item[\PName{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{lstcode}
  \deftripstyle{DerBericht}%
                {\headmark}{}{Bericht}%
                {}{\pagemark}{}
\end{lstcode}

  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{lstcode}
  \deftripstyle{DerBericht}[2pt][.4pt]%
                {\headmark}{}{Bericht}%
                {}{\pagemark}{}
\end{lstcode}
  Das Ergebnis ist in \autoref{fig:scrpage-de2.tomuchlines} zu sehen.
%
\begin{figure}
  \typeout{^^J--- Ignore underfull and overfull \string\hbox:}%
  \setcapindent{0pt}%
  \begin{captionbeside}
    [{%
      Beispiel eines selbst definierten, von Linien dominierten Seitenstils%
    }]{%
      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:scrpage-de2.tomuchlines}%
    }
    [l]
    \iffree{\setlength{\unitlength}{1.15mm}}{\setlength{\unitlength}{1mm}}%
    \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}
  \end{captionbeside}
  \typeout{^^J--- Don't ignore underfull and overfull \string\hbox:^^J}%
\end{figure}
\end{Example}
\EndIndexGroup


\subsection{Die Expertenschnittstelle}\label{sec:scrpage-de.UI.expert}
% \defpagestyle \newpagestyle \providepagestyle \renewpagestyle
Einfache Seitenstile, wie sie mit \DescRef{scrpage-de.cmd.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{Declaration}
  \Macro{defpagestyle}\Parameter{Name}\Parameter{Kopfdefinition}\Parameter{Fußdefinition}%
  \Macro{newpagestyle}\Parameter{Name}\Parameter{Kopfdefinition}\Parameter{Fußdefinition}%
  \Macro{renewpagestyle}\Parameter{Name}\Parameter{Kopfdefinition}\Parameter{Fußdefinition}%
  \Macro{providepagestyle}\Parameter{Name}\Parameter{Kopfdefinition}\Parameter{Fußdefinition}
\end{Declaration}%
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}[~--]{\PName{Kopfdefinition}\,}
\item[\PName{Name}] die Bezeichnung des Seitenstils
\item[\PName{Kopfdefinition}] die Deklaration des Seitenkopfes bestehend aus
  fünf Teilen, wobei die in runden Klammern stehenden Angaben optional
  sind:\hfill\\
  \hspace*{1em}\AParameter{OLL,OLD}%
  \Parameter{GS}\Parameter{US}\Parameter{ES}\AParameter{ULL,ULD}
\item[\PName{Fußdefinition}] die Deklaration des Seitenfußes bestehend aus
  fünf Teilen, wobei die in runden Klammern stehenden Angaben optional
  sind:\hfill\\
  \hspace*{1em}\AParameter{OLL,OLD}%
  \Parameter{GS}\Parameter{US}\Parameter{ES}\AParameter{ULL,ULD}
\end{labeling}

Wie zu sehen ist, haben Kopf- und Fußdefinition identischen Aufbau. Die
einzelnen Parameter haben folgende Bedeutung:
\begin{labeling}[\ --]{\PName{OLD}}
\item[\PName{OLL}] obere Linienlänge: Kopf = außen, Fuß = Trennlinie
\item[\PName{OLD}] obere Liniendicke
\item[\PName{GS}]  Definition für die \emph{gerade} Seite
\item[\PName{US}]  Definition für die \emph{ungerade} Seite
\item[\PName{ES}]  Definition für \emph{einseitiges} Layout
\item[\PName{ULL}] untere Linienlänge Kopf = Trennlinie, Fuß = außen
\item[\PName{ULD}] untere Liniendicke
\end{labeling}

Werden die optionalen Linienargumente nicht gesetzt, dann bleibt das Verhalten
weiterhin durch die in \autoref{sec:scrpage-de.basics.format},
\DescPageRef{scrpage-de.cmd.setheadtopline} vorgestellten Linienbefehle
konfigurierbar.

Die drei Felder \PName{GS}, \PName{US} und \PName{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{lstcode}[belowskip=\dp\strutbox]
  {\headmark\hfill\pagemark}
\end{lstcode}

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{lstcode}
  {\rlap{\headmark}\hfill zentriert\hfill\llap{\pagemark}}
\end{lstcode}

\iffalse% Umbruchkorrekturtext
Dies und die Verwendung der Expertenschnittstelle in Zusammenhang mit
anderen Befehlen von \Package{scrpage2} nun als abschließendes Beispiel.
\fi

\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{lstcode}
  \documentclass{scrbook}
  \usepackage[automark,headsepline]{scrpage2}
\end{lstcode}

  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{lstcode}
  \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{lstcode}

  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 \DescRef{scrpage-de.cmd.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{lstcode}
  \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{lstcode}%
  \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{lstcode}
  Es existiert eine Zustandsgröße, genannt die 
  Entropie eines Systems, deren zeitliche Änderung
  sich aus Entropieströmung und Entropieerzeugung
  zusammensetzt.
\end{lstcode}
  \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 \PValue{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 \DescRef{scrpage-de.option.headsepline} als Argument für
  \Package{scrpage2} angegeben wurde.%
\begin{lstcode}
  \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{lstcode}%
  \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
  \PValue{mitLinien} aktiviert.  Die Linieneinstellungen werden hier nun
  angewendet und entsprechend der Definition dargestellt.
\begin{lstcode}
  \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{lstcode}
  \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}
\EndIndexGroup


\subsection{Seitenstile verwalten}\label{sec:scrpage-de.UI.cfgFile}
% scrpage.cfg
\BeginIndex{File}{scrpage.cfg}
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.
\EndIndex{File}{scrpage.cfg}
%
\EndIndexGroup

\end{document}

%%% Local Variables:
%%% mode: latex
%%% coding: utf-8
%%% TeX-master: t
%%% End: