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
|
%%
%% This is file `scrlayer.sty',
%% generated with the docstrip utility, extended by scrdocstrip.
%%
%% The original source files were:
%%
%% scrlayer.dtx (with options: `package,trace,scrlayer,identify')
%% scrlayer.dtx (with options: `package,trace,scrlayer,init')
%% scrlayer.dtx (with options: `package,trace,scrlayer,options')
%% scrlayer.dtx (with options: `package,trace,scrlayer,body')
%% scrlayer.dtx (with options: `package,trace,scrlayer,final')
%% scrlogo.dtx (with options: `logo')
%%
%% Copyright (c) 2012-2019 Markus Kohm [komascript at gmx info]
%%
%% This file was generated from file(s) of the KOMA-Script bundle.
%% ---------------------------------------------------------------
%%
%% It may be distributed under the conditions of the
%% LaTeX Project Public License in the version distributed together
%% with KOMA-Script, see file `lppl.txt' or `lppl-de.txt'.
%%
%% This file may only be distributed together with a copy of the
%% KOMA-Script bundle. You may however distribute the
%% KOMA-Script bundle without all such generated files. See also
%% `lppl.txt' or `lppl-de.txt' for additional information.
%%
%% The list of files belonging to KOMA-Script distribution is given in
%% the file `manifest.txt'. See also `lppl.txt' or `lppl-de.txt' for
%% additional information.
%%
%% If this file is a beta version, you may not be allowed to distribute
%% it. Look at the comments below to see if this is the case.
%%
%% English and German manuals are part of KOMA-Script bundle.
%% ----------------------------------------------------------
%%
%% See `README'.
%%
%% The KOMA-Script bundle (but maybe not this file) was based upon the
%% LaTeX 2.09 Script family created by Frank Neukam 1993 and the LaTeX2e
%% standard classes created by The LaTeX3 Project 1994-1996. You can
%% find a complete unmodified copy of LaTeX2e at
%% <http://mirror.ctan.org/tex-archive/macros/latex/base/>.
%%
%%% From File: $Id: scrlayer.dtx 3533 2020-09-11 13:32:10Z kohm $
%%% (run: identify)
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{scrlayer}[%
2020/09/21 v3.32 KOMA-Script
package
(defining layers and page styles)]
%%% From File: $Id: scrlayer.dtx 3533 2020-09-11 13:32:10Z kohm $
%%% (run: init)
\RequirePackage{scrkbase}[2013/03/05]
\scr@ifundefinedorrelax{scrlayer@AtEndOfPackage}{%
\AtEndOfPackage{\let\scrlayer@AtEndOfPackage\@firstofone}%
}{%
\ifx\scrlayer@AtEndOfPackage\@firstofone
\AtEndOfPackage{\let\scrlayer@AtEndOfPackage\@firstofone}%
\fi
}
\let\scrlayer@AtEndOfPackage\AtEndOfPackage
\newcommand*{\scrlayer@testunexpectedarg}[2]{%
\ifx\relax#2\relax\else
\PackageError{scrlayer}{unexpected value to `#1'}{%
Option `#1' doesn't expect any value.\MessageBreak
If you'll continue, the value `#2' will be ignored.%
}%
\fi
}
\scr@ifundefinedorrelax{if@chapter}{%
\newif\if@chapter
\scr@ifundefinedorrelax{chapter}{\@chapterfalse}{\@chaptertrue}%
}{}
\scr@ifundefinedorrelax{if@mainmatter}{%
\scr@ifundefinedorrelax{mainmatter}{%
\newif\if@mainmatter\@mainmattertrue
}{%
\PackageWarningNoLine{scrlayer}{%
\string\mainmatter\space defined without
\string\if@mainmatter!\MessageBreak
Note, that several packages need
\string\if@mainmatter\space\MessageBreak
to detect whether or no the main matter has been\MessageBreak
entered. So does scrlayer. Because of this\MessageBreak
it will extend \string\mainmatter, now%
}%
\newif\if@mainmatter\@mainmattertrue
\expandafter\def\expandafter\mainmatter\expandafter{%
\expandafter\@mainmattertrue\mainmatter}%
\scr@ifundefinedorrelax{frontmatter}{}{%
\expandafter\def\expandafter\frontmatter\expandafter{%
\expandafter\@mainmatterfalse\frontmatter}
}%
\scr@ifundefinedorrelax{backmatter}{}{%
\expandafter\def\expandafter\backmatter{%
\expandafter\@mainmatterfalse\backmattter}%
}%
}%
}{}
\@ifundefined{footheight}{%
\newlength{\footheight}%
\setlength{\footheight}{-12345sp}%
}{%
\PackageInfo{scrlayer}{Using already defined \string\footheight\MessageBreak
hoping, that this is a length and\MessageBreak
not only a macro}%
}
\AtBeginDocument{%
\ifdim\footheight=-12345sp
\PackageInfo{scrlayer}{Setting magic \string\footheight\space to
\string\baselineskip\space while\MessageBreak
\string\begin{document}}%
\setlength{\footheight}{\baselineskip}
\fi
}
\newcommand*{\scrlayer@report@deprecated}[2]{%
\@ifundefined{scrlayer@deprecated@reported@for@#1}{%
\PackageWarning{scrlayer}{%
Deprecated interface detected for `#1'.\MessageBreak
There isn't any support for using, e.g.,\MessageBreak
`\string #2'%
}%
\@namedef{scrlayer@deprecated@reported@for@#1}{\string #2}%
}{}%
}
%%% From File: $Id: scrlayer.dtx 3533 2020-09-11 13:32:10Z kohm $
%%% (run: options)
\KOMA@key{markcase}{%
\begingroup
\KOMA@set@ncmdkey{markcase}{reserved@a}{%
{upper}{0},{lower}{1},{used}{2},%
{ignoreuppercase}{3},{nouppercase}{3},%
{ignoreupper}{3},{noupper}{3}%
}{#1}%
\ifx\FamilyKeyState\FamilyKeyStateProcessed
\aftergroup\FamilyKeyStateProcessed
\ifnum \reserved@a>\m@ne
\aftergroup\let\aftergroup\MakeMarkcase
\ifcase \reserved@a
\aftergroup\MakeUppercase
\aftergroup\scrlayer@forceignoreuppercasefalse
\or
\aftergroup\MakeLowercase
\aftergroup\scrlayer@forceignoreuppercasefalse
\or
\aftergroup\@firstofone
\aftergroup\scrlayer@forceignoreuppercasefalse
\else
\aftergroup\scrlayer@ignoreuppercase
\aftergroup\scrlayer@forceignoreuppercasetrue
\fi
\fi
\else
\aftergroup\FamilyKeyStateUnknownValue
\fi
\endgroup
\ifx\FamilyKeyState\FamilyKeyStateProcessed
\KOMA@kav@removekey{.scrlayer.sty}{markcase}%
\KOMA@kav@xadd{.scrlayer.sty}{markcase}{#1}%
\fi
}
\@ifundefined{MakeMarkcase}{\let\MakeMarkcase\@firstofone}{}
\ifx\MakeMarkcase\@firstofone
\KOMA@kav@replacevalue{.scrlayer.sty}{markcase}{used}%
\else\ifx\MakeMarkcase\MakeUppercase
\KOMA@kav@replacevalue{.scrlayer.sty}{markcase}{upper}%
\else\ifx\MakeMarkcase\MakeLowercase
\KOMA@kav@replacevalue{.scrlayer.sty}{markcase}{lower}%
\else\ifx\MakeMarkcase\scr@ignoreuppercase
\KOMA@kav@replacevalue{.scrlayer.sty}{markcase}{ignoreuppercase}%
\fi\fi\fi\fi
\DeclareRobustCommand*{\scrlayer@ignoreuppercase}[1]{%
\begingroup
\let\uppercase\@firstofone
\let\MakeUppercase\@firstofone
\expandafter\let\csname MakeUppercase \endcsname\@firstofone
#1%
\endgroup
}
\newif\ifscrlayer@forceignoreuppercase
\KOMA@ifkey{autooneside}{scrlayer@autooneside}\scrlayer@autoonesidetrue
\KOMA@kav@replacebool{.scrlayer.sty}{autooneside}{scrlayer@autooneside}
\KOMA@key{automark}[]{%
\scrlayer@testunexpectedarg{automark}{#1}%
\scrlayer@AtEndOfPackage{%
\if@chapter
\scr@ifundefinedorrelax{section}{%
\automark{chapter}%
}{%
\automark[section]{chapter}%
}%
\else
\scr@ifundefinedorrelax{section}{%
\automark{}%
}{%
\scr@ifundefinedorrelax{subsection}{%
\automark{section}%
}{%
\automark[subsection]{section}%
}
}%
\fi
}%
\FamilyKeyStateProcessed
\KOMA@kav@removekey{.scrlayer.sty}{automark}%
\KOMA@kav@removekey{.scrlayer.sty}{manualmark}%
\KOMA@kav@add{.scrlayer.sty}{automark}{}%
}
\KOMA@key{manualmark}[]{%
\scrlayer@testunexpectedarg{manualmark}{#1}%
\scrlayer@AtEndOfPackage{\manualmark}%
\FamilyKeyStateProcessed
\KOMA@kav@removekey{.scrlayer.sty}{automark}%
\KOMA@kav@removekey{.scrlayer.sty}{manualmark}%
\KOMA@kav@add{.scrlayer.sty}{manualmark}{}%
}
\KOMA@key{onpsselect}{%
\l@addto@macro{\@ps@initialhook}{#1}%
\FamilyKeyStateProcessed
\KOMA@kav@add{.scrlayer.sty}{onpsselect}{#1}%
}
\newcommand*{\@ps@initialhook}{}
\KOMA@kav@add{.scrlayer.sty}{onpsselect}{}
\KOMA@key{onpsinit}{%
\l@addto@macro{\@ps@hook}{#1}%
\FamilyKeyStateProcessed
\KOMA@kav@add{.scrlayer.sty}{onpsinit}{#1}%
}
\newcommand*{\@ps@hook}{}
\KOMA@kav@add{.scrlayer.sty}{onpsinit}{}
\KOMA@key{onpsoneside}{%
\l@addto@macro{\@ps@onesidehook}{#1}%
\FamilyKeyStateProcessed
\KOMA@kav@add{.scrlayer.sty}{onpsoneside}{#1}%
}
\newcommand*{\@ps@onesidehook}{}
\KOMA@kav@add{.scrlayer.sty}{onpsoneside}{}
\KOMA@key{onpstwoside}{%
\l@addto@macro{\@ps@twosidehook}{#1}%
\FamilyKeyStateProcessed
\KOMA@kav@add{.scrlayer.sty}{onpstwoside}{#1}%
}
\newcommand*{\@ps@twosidehook}{}
\KOMA@kav@add{.scrlayer.sty}{onpstwoside}{}
\KOMA@key{onpsoddpage}{%
\l@addto@macro{\@ps@oddpagehook}{#1}%
\FamilyKeyStateProcessed
\KOMA@kav@add{.scrlayer.sty}{onpsoddpage}{#1}%
}
\newcommand*{\@ps@oddpagehook}{}
\KOMA@kav@add{.scrlayer.sty}{onpsoddpage}{}
\KOMA@key{onpsevenpage}{%
\l@addto@macro{\@ps@evenpagehook}{#1}%
\FamilyKeyStateProcessed
\KOMA@kav@add{.scrlayer.sty}{onpsevenpage}{#1}%
}
\newcommand*{\@ps@evenpagehook}{}
\KOMA@kav@add{.scrlayer.sty}{onpsevenpage}{}
\KOMA@key{onpsfloatpage}{%
\l@addto@macro{\@ps@floatpagehook}{#1}%
\FamilyKeyStateProcessed
\KOMA@kav@add{.scrlayer.sty}{onpsfloatpage}{#1}%
}
\newcommand*{\@ps@floatpagehook}{}
\KOMA@kav@add{.scrlayer.sty}{onpsfloatpage}{}
\KOMA@key{onpsnonfloatpage}{%
\l@addto@macro{\@ps@nonfloatpagehook}{#1}%
\FamilyKeyStateProcessed
\KOMA@kav@add{.scrlayer.sty}{onpsnonfloatpage}{#1}%
}
\newcommand*{\@ps@nonfloatpagehook}{}
\KOMA@kav@add{.scrlayer.sty}{onpsnonfloatpage}{}
\KOMA@key{onpsbackground}{%
\l@addto@macro{\@ps@backgroundhook}{#1}%
\FamilyKeyStateProcessed
\KOMA@kav@add{.scrlayer.sty}{onpsbackground}{#1}%
}
\newcommand*{\@ps@backgroundhook}{}
\KOMA@kav@add{.scrlayer.sty}{onpsbackground}{}
\KOMA@key{onpsforeground}{%
\l@addto@macro{\@ps@foregroundhook}{#1}%
\FamilyKeyStateProcessed
\KOMA@kav@add{.scrlayer.sty}{onpsforeground}{#1}%
}
\newcommand*{\@ps@foregroundhook}{}
\KOMA@kav@add{.scrlayer.sty}{onpsforeground}{}
\KOMA@ifkey{singlespacing}{@ps@singlespacing}
\KOMA@ifkey{deactivatepagestylelayers}{scrlayer@deactivate@layers}
\KOMA@ifkey{draft}{scrlayer@draft}
\KOMA@ifkey{forceoverwrite}{scrlayer@forceoverwrite}
\KOMA@ifkey{autoremoveinterfaces}{scrlayer@autoremoveinterfaces}
%%% From File: $Id: scrlayer.dtx 3533 2020-09-11 13:32:10Z kohm $
%%% (run: body)
\KOMAProcessOptions\relax
\newcommand*{\rightfirstmark}{\expandafter\@rightmark\firstmark\@empty\@empty}
\newcommand*{\rightbotmark}{\expandafter\@rightmark\botmark\@empty\@empty}
\newcommand*{\righttopmark}{\expandafter\@rightmark\topmark\@empty\@empty}
\newcommand*{\leftfirstmark}{\expandafter\@leftmark\firstmark\@empty\@empty}
\newcommand*{\leftbotmark}{\expandafter\@leftmark\botmark\@empty\@empty}
\newcommand*{\lefttopmark}{\expandafter\@leftmark\topmark\@empty\@empty}
\@ifundefined{headmark}{}{%
\PackageWarningNoLine{scrlayer}{%
\string\headmark\space detected!\MessageBreak
\string\headmark\space will either be set to
\string\rightmark\MessageBreak
or \string\leftmark inside of page styles.\MessageBreak
This means, that \string\headmark\space will be overwritten\MessageBreak
at every page layer usage!\MessageBreak
Nevertheless it will stay unchanged outside\MessageBreak
of page layers.\MessageBreak
I hope, this won't break your document%
}%
}
\@ifundefined{pagemark}{%
\DeclareRobustCommand\pagemark{{\pnumfont{\thepage}}}%
}{}%
\@ifundefined{pnumfont}{%
\newcommand{\pnumfont}{\normalfont}%
}{}
\@ifundefined{scr@fnt@pagenumber}{%
\newcommand{\scr@fnt@pagenumber}{\pnumfont}%
}{}
\providecommand*{\partmarkformat}{\partname\ \thepart. \ }%
\if@chapter
\providecommand*{\@chapapp}{\chaptername}%
\providecommand*{\chaptermarkformat}{\@chapapp\ \thechapter. \ }%
\providecommand*{\sectionmarkformat}{\thesection. \ }%
\else
\providecommand*{\sectionmarkformat}{\GenericMarkFormat{section}}%
\fi
\scr@ifundefinedorrelax{@seccntmarkformat}{%
\providecommand*{\GenericMarkFormat}{\@seccntformat}%
}{%
\providecommand*{\GenericMarkFormat}[1]{\@seccntmarkformat{#1}}%
}
\providecommand*{\@mkleft}{%
\IfActiveMkBoth{\markleft}{\@gobble}%
}%
\providecommand*{\@mkright}{%
\IfActiveMkBoth{\markright}{\@gobble}%
}%
\providecommand{\@mkdouble}[1]{%
\@mkboth{#1}{#1}%
}
\@ifundefined{markleft}{%
\DeclareRobustCommand{\markleft}[1]{%
\begingroup
\let\label\relax \let\index\relax \let\glossary\relax
\expandafter\@markleft\@themark {#1}%
\@temptokena \expandafter{\@themark}%
\mark{\the\@temptokena}%
\endgroup
\if@nobreak\ifvmode\nobreak\fi\fi
}%
\providecommand{\@markleft}[3]{%
\@temptokena {#2}%
\unrestored@protected@xdef\@themark{{#3}{\the\@temptokena}}%
}%
}{}
\providecommand{\markdouble}[1]{\markboth{#1}{#1}}
\newcommand*{\manualmark}{%
\begingroup
\def\@elt##1{%
\aftergroup\let\expandafter\aftergroup\csname ##1mark\endcsname
\aftergroup\@gobble
}%
\scrlayer@level@list
\endgroup
\let\@mkleft\@gobble
\let\@mkright\@gobble
\let\@mkdouble\@gobble
\let\@mkboth\@gobbletwo
}
\newcommand*{\automark}{%
\kernel@ifstar{\@automark}{\manualmark\@automark}%
}
\newcommand*{\@automark}[2][]{%
\Ifstr{#2}{}{%
\Ifstr{#1}{}{%
\automark@basics
}{%
\automark@basics
\automark@righthigh{#1}%
}%
}{%
\Ifstr{#1}{}{%
\automark@basics
\automark@leftlow{#2}%
}{%
\automark@basics
\automark@both{#1}{#2}%
}%
}%
}
\newcommand*{\automark@basics}{%
\let\@mkleft\markleft
\let\@mkright\markright
\let\@mkboth\markboth
\def\@mkdouble##1{\@mkboth{##1}{##1}}%
}
\newcommand*{\automark@righthigh}[1]{%
\ifscrlayer@level@prepared{#1}{%
\expandafter\def\csname #1mark\endcsname##1{%
\begingroup
\@tempswafalse
\if@twoside\@tempswatrue
\else\ifscrlayer@autooneside\else\@tempswatrue\fi\fi
\expandafter\endgroup
\if@tempswa
\@mkright{%
\MakeMarkcase{%
\ifnum \c@secnumdepth<\numexpr \csname #1numdepth\endcsname +0\relax
\else\if@mainmatter \csname #1markformat\endcsname\fi\fi
##1%
}%
}%
\fi
}%
}{}%
}
\newcommand*{\automark@leftlow}[1]{%
\ifscrlayer@level@prepared{#1}{%
\expandafter\def\csname #1mark\endcsname ##1{%
\if@twoside
\expandafter\@mkboth
\else
\expandafter\@mkdouble
\fi
{%
\MakeMarkcase{%
\ifnum \c@secnumdepth<\numexpr \csname #1numdepth\endcsname +0\relax
\else\if@mainmatter \csname #1markformat\endcsname\fi\fi
##1%
}%
}{}%
}%
}{}%
}
\newcommand*{\automark@both}[2]{%
\ifscrlayer@level@prepared{#1}{%
\ifscrlayer@level@prepared{#2}{%
\ifnum \numexpr \csname #1numdepth\endcsname +0\relax
> \numexpr \csname #2numdepth\endcsname +0\relax
\automark@leftlow{#2}%
\automark@righthigh{#1}%
\else \ifnum \numexpr \csname #1numdepth\endcsname +0\relax
= \numexpr \csname #2numdepth\endcsname +0\relax
\expandafter\def\csname #2mark\endcsname##1{%
\@mkdouble{%
\MakeMarkcase{%
\ifnum \c@secnumdepth<\numexpr
\csname #2numdepth\endcsname +0\relax
\else
\if@mainmatter \csname #2markformat\endcsname\fi
\fi
##1%
}%
}%
}%
\else
\expandafter\def\csname #1mark\endcsname##1{%
\begingroup
\@tempswafalse
\if@twoside\@tempswatrue
\else\ifscrlayer@autooneside\else\@tempswatrue\fi\fi
\expandafter\endgroup
\if@tempswa
\@mkleft{%
\MakeMarkcase{%
\ifnum \c@secnumdepth
< \numexpr\csname #1numdepth\endcsname +0\relax
\else
\if@mainmatter \csname #1markformat\endcsname\fi
\fi
##1%
}%
}%
\fi
}%
\expandafter\def\csname #2mark\endcsname##1{%
\@mkboth{}{%
\MakeMarkcase{%
\ifnum \c@secnumdepth
< \numexpr \csname #2numdepth\endcsname +0\relax
\else\if@mainmatter \csname #2markformat\endcsname\fi\fi
##1%
}%
}%
}%
\fi
\fi
}{}%
}{}%
}
\newcommand*{\ifscrlayer@level@prepared}[1]{%
\typeout{1: \detokenize{#1}}%
\scr@ifundefinedorrelax{#1numdepth}{%
\PackageError{scrlayer}{numbering depth of `#1' unknown}{%
Someone told me to use a section mark for level `#1',\MessageBreak
but the numbering depth hasn't been declared before. You may solve this
using\MessageBreak
\string\DeclareSectionNumberDepth{#1}{NUMBER}.%
}%
\@secondoftwo
}{%
\@firstoftwo
}%
}
\newcommand*{\DeclareSectionNumberDepth}[2]{%
\expandafter\edef\csname #1numdepth\endcsname{\the\numexpr #2\relax}%
\@ifundefined{#1mark}{%
\expandafter\let\csname #1mark\endcsname\@gobble
}{}%
\@ifundefined{#1markformat}{%
\@namedef{#1markformat}{\GenericMarkFormat{#1}}%
}{}%
\begingroup
\@tempswatrue
\def\@elt##1{\Ifstr{#1}{##1}{\@tempswafalse}{}}%
\scrlayer@level@list
\if@tempswa
\aftergroup\@firstofone
\else
\aftergroup\@gobble
\fi
\endgroup
{%
\l@addto@macro\scrlayer@level@list{\@elt{#1}}%
}%
}
\newcommand*{\scrlayer@level@list}{}
\scr@ifundefinedorrelax{part}{}{%
\DeclareSectionNumberDepth{part}{-1}%
}
\if@chapter
\DeclareSectionNumberDepth{chapter}{0}%
\fi
\newcommand*{\scrlayer@level@init}{%
\@tempcnta=1
\def\reserved@b##1{%
\@tempswatrue
\def\reserved@a{##1}%
\@whilesw \if@tempswa \fi {%
\scr@ifundefinedorrelax{\reserved@a}{%
\@tempswafalse
}{%
\@ifundefined{\reserved@a numdepth}{%
\expandafter\DeclareSectionNumberDepth
\expandafter{\reserved@a}{\@tempcnta}%
}{%
\expandafter\DeclareSectionNumberDepth
\expandafter{\reserved@a}{\csname \reserved@a numdepth\endcsname}%
}%
\advance \@tempcnta by \@ne
\edef\reserved@a{sub\reserved@a}%
}%
}%
}%
\reserved@b{section}%
\reserved@b{paragraph}%
\reserved@b{minisec}%
}
\scrlayer@level@init
\AtBeginDocument{%
\scrlayer@level@init
}
\DefineFamily{KOMAarg}
\DefineFamilyMember[.definelayer]{KOMAarg}
\newcommand*{\def@scr@l@pos}[4]{%
\@namedef{scr@l@\scr@current@layer @x}{#1}%
\@namedef{scr@l@\scr@current@layer @y}{#2}%
\@namedef{scr@l@\scr@current@layer @w}{#3}%
\@namedef{scr@l@\scr@current@layer @h}{#4}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{mode}{%
\scr@ifundefinedorrelax{layer#1mode}{\FamilyKeyStateUnknownValue}{%
\@namedef{scr@l@\scr@current@layer @mode}{#1}%
\FamilyKeyStateProcessed
}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{hoffset}{%
\@namedef{scr@l@\scr@current@layer @x}{\dimexpr #1\relax}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{voffset}{%
\@namedef{scr@l@\scr@current@layer @y}{\dimexpr #1\relax}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{width}{%
\@namedef{scr@l@\scr@current@layer @w}{\dimexpr #1\relax}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{height}{%
\@namedef{scr@l@\scr@current@layer @h}{\dimexpr #1\relax}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{align}{%
\@namedef{scr@l@\scr@current@layer @align}{#1}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{contents}{%
\long\@namedef{scr@l@\scr@current@layer @contents}{#1}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{background}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{background}{#1}%
\csname @scr@l@\scr@current@layer @backgroundtrue\endcsname
\csname @scr@l@\scr@current@layer @foregroundfalse\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{foreground}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{foreground}{#1}%
\csname @scr@l@\scr@current@layer @backgroundfalse\endcsname
\csname @scr@l@\scr@current@layer @foregroundtrue\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{backandforeground}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{backandforeground}{#1}%
\csname @scr@l@\scr@current@layer @backgroundtrue\endcsname
\csname @scr@l@\scr@current@layer @foregroundtrue\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{oddpage}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{oddpage}{#1}%
\csname @scr@l@\scr@current@layer @oddtrue\endcsname
\csname @scr@l@\scr@current@layer @evenfalse\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{evenpage}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{evenpage}{#1}%
\csname @scr@l@\scr@current@layer @oddfalse\endcsname
\csname @scr@l@\scr@current@layer @eventrue\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{oddorevenpage}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{oddorevenpage}{#1}%
\csname @scr@l@\scr@current@layer @oddtrue\endcsname
\csname @scr@l@\scr@current@layer @eventrue\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{evenoroddpage}[\relax]{%
\PackageWarning{scrlayer}{Option `evenoroddpage' unknown.\MessageBreak
Using `oddorevenpage' instead}%
\ExecuteFamilyOptions[.definelayer]{KOMAarg}{oddorevenpage=#1}
}
\DefineFamilyKey[.definelayer]{KOMAarg}{oddandevenpages}[\relax]{%
\PackageWarning{scrlayer}{Option `oddandevenpages' unknown.\MessageBreak
Using `oddorevenpage' instead}%
\ExecuteFamilyOptions[.definelayer]{KOMAarg}{oddorevenpage=#1}
}
\DefineFamilyKey[.definelayer]{KOMAarg}{evenandoddpages}[\relax]{%
\PackageWarning{scrlayer}{Option `evenandoddpages' unknown.\MessageBreak
Using `oddorevenpage' instead}%
\ExecuteFamilyOptions[.definelayer]{KOMAarg}{oddorevenpage=#1}
}
\DefineFamilyKey[.definelayer]{KOMAarg}{floatpage}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{floatpage}{#1}%
\csname @scr@l@\scr@current@layer @nonfloatpagefalse\endcsname
\csname @scr@l@\scr@current@layer @floatpagetrue\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{nonfloatpage}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{nonfloatpage}{#1}%
\csname @scr@l@\scr@current@layer @nonfloatpagetrue\endcsname
\csname @scr@l@\scr@current@layer @floatpagefalse\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{floatornonfloatpage}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{floatornonfloatpage}{#1}%
\csname @scr@l@\scr@current@layer @nonfloatpagetrue\endcsname
\csname @scr@l@\scr@current@layer @floatpagetrue\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{nonfloatorfloatpage}[\relax]{%
\PackageWarning{scrlayer}{Option `nonfloatorfloatpage' unknown.\MessageBreak
Using `floatornonfloatpage' instead}%
\FamilyExecuteOptions[.definelayer]{KOMAarg}{floatornonfloatpage=#1}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{floatandnonfloatpages}[\relax]{%
\PackageWarning{scrlayer}{Option `floatandnonfloatpages' unknown.\MessageBreak
Using `floatornonfloatpage' instead}%
\FamilyExecuteOptions[.definelayer]{KOMAarg}{floatornonfloatpage=#1}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{nonfloatandfloatpages}[\relax]{%
\PackageWarning{scrlayer}{Option `nonfloatandfloatpages' unknown.\MessageBreak
Using `floatornonfloatpage' instead}%
\FamilyExecuteOptions[.definelayer]{KOMAarg}{floatornonfloatpage=#1}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{everypage}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{everypage}{#1}%
\csname @scr@l@\scr@current@layer @oddtrue\endcsname
\csname @scr@l@\scr@current@layer @eventrue\endcsname
\csname @scr@l@\scr@current@layer @nonfloatpagetrue\endcsname
\csname @scr@l@\scr@current@layer @floatpagetrue\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{oneside}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{oneside}{#1}%
\csname @scr@l@\scr@current@layer @twosidefalse\endcsname
\csname @scr@l@\scr@current@layer @onesidetrue\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{twoside}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{twoside}{#1}%
\csname @scr@l@\scr@current@layer @twosidetrue\endcsname
\csname @scr@l@\scr@current@layer @onesidefalse\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{everyside}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{everyside}{#1}%
\csname @scr@l@\scr@current@layer @twosidetrue\endcsname
\csname @scr@l@\scr@current@layer @onesidetrue\endcsname
}
\DefineFamilyKey[.definelayer]{KOMAarg}{unrestricted}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{unrestricted}{#1}%
\csname @scr@l@\scr@current@layer @oddtrue\endcsname
\csname @scr@l@\scr@current@layer @eventrue\endcsname
\csname @scr@l@\scr@current@layer @backgroundtrue\endcsname
\csname @scr@l@\scr@current@layer @foregroundtrue\endcsname
\csname @scr@l@\scr@current@layer @nonfloatpagetrue\endcsname
\csname @scr@l@\scr@current@layer @floatpagetrue\endcsname
\csname @scr@l@\scr@current@layer @twosidetrue\endcsname
\csname @scr@l@\scr@current@layer @onesidetrue\endcsname
}
\FamilyCSKey[.definelayer]{KOMAarg}{beforecontents}
{scr@l@\scr@current@layer @precontents@hook}
\FamilyCSKey[.definelayer]{KOMAarg}{aftercontents}
{scr@l@\scr@current@layer @postcontents@hook}
\DefineFamilyKey[.definelayer]{KOMAarg}{artifact}[true]{%
\FamilySetBool{KOMAarg}{artifact}{@tempswa}{#1}%
\ifx\FamilyKeyState\FamilyKeyStateProcessed
\if@tempswa
\expandafter\let\csname scr@l@\scr@current@layer @artifact\endcsname
\@empty
\else
\expandafter\let\csname scr@l@\scr@current@layer @artifact\endcsname
\relax
\fi
\else
\FamilyKeyStateProcessed
\@namedef{scr@l@\scr@current@layer @artifact}{#1}%
\fi
}
\DefineFamilyKey[.definelayer]{KOMAarg}{addhoffset}{%
\expandafter\edef\csname scr@l@\scr@current@layer @x\endcsname{%
\noexpand\dimexpr \unexpanded\expandafter\expandafter\expandafter{%
\csname scr@l@\scr@current@layer @x\endcsname + (#1)\relax}}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{addvoffset}{%
\expandafter\edef\csname scr@l@\scr@current@layer @y\endcsname{%
\noexpand\dimexpr \unexpanded\expandafter\expandafter\expandafter{%
\csname scr@l@\scr@current@layer @y\endcsname + (#1)\relax}}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{addwidth}{%
\expandafter\edef\csname scr@l@\scr@current@layer @w\endcsname{%
\noexpand\dimexpr \unexpanded\expandafter\expandafter\expandafter{%
\csname scr@l@\scr@current@layer @w\endcsname + (#1)\relax}}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{addheight}{%
\expandafter\edef\csname scr@l@\scr@current@layer @h\endcsname{%
\noexpand\dimexpr \unexpanded\expandafter\expandafter\expandafter{%
\csname scr@l@\scr@current@layer @h\endcsname + (#1)\relax}}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{addcontents}{%
\expandafter\edef\csname scr@l@\scr@current@layer @contents\endcsname{%
\unexpanded\expandafter\expandafter\expandafter{%
\csname scr@l@\scr@current@layer @contents\endcsname #1}}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{pretocontents}{%
\expandafter\edef\csname scr@l@\scr@current@layer @contents\endcsname{%
\unexpanded{#1}\unexpanded\expandafter\expandafter\expandafter{%
\csname scr@l@\scr@current@layer @contents\endcsname}}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{addbeforecontents}{%
\scr@ifundefinedorrelax{scr@l@\scr@current@layer @precontents@hook}{%
\expandafter\def
\csname scr@l@\scr@current@layer @precontents@hook\endcsname{#1}%
}{%
\expandafter\edef
\csname scr@l@\scr@current@layer @precontents@hook\endcsname{%
\unexpanded\expandafter\expandafter\expandafter{%
\csname scr@l@\scr@current@layer @precontents@hook\endcsname}%
\unexpanded{#1}
}%
}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{addaftercontents}{%
\scr@ifundefinedorrelax{scr@l@\scr@current@layer @postcontents@hook}{%
\expandafter\def
\csname scr@l@\scr@current@layer @postcontents@hook\endcsname{#1}%
}{%
\expandafter\edef
\csname scr@l@\scr@current@layer @postcontents@hook\endcsname{%
\unexpanded{#1}%
\unexpanded\expandafter\expandafter\expandafter{%
\csname scr@l@\scr@current@layer @postcontents@hook\endcsname}%
}%
}%
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{page}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{page}{#1}%
\def@scr@l@pos{\z@}{\z@}{\paperwidth}{\paperheight}%
\@namedef{scr@l@\scr@current@layer @align}{tl}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{topmargin}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{topmargin}{#1}%
\def@scr@l@pos{\z@}{\z@}{\paperwidth}{\dimexpr \topmargin+1in\relax}%
\@namedef{scr@l@\scr@current@layer @align}{tl}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{head}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{head}{#1}%
\def@scr@l@pos{%
\dimexpr
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi
\else\oddsidemargin\fi
+1in
\relax
}{%
\dimexpr \topmargin+1in+\headheight\relax
}{\textwidth}{\headheight}%
\@namedef{scr@l@\scr@current@layer @align}{bl}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{headsep}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{head}{#1}%
\def@scr@l@pos{%
\dimexpr
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi
\else\oddsidemargin\fi
+1in
\relax
}{%
\dimexpr \topmargin+1in+\headheight\relax
}{\textwidth}{\headsep}%
\@namedef{scr@l@\scr@current@layer @align}{tl}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{textarea}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{textarea}{#1}%
\def@scr@l@pos{%
\dimexpr
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi
\else\oddsidemargin\fi
+1in
\relax
}{%
\dimexpr \topmargin+1in+\headheight+\headsep\relax
}{\textwidth}{\textheight}%
\@namedef{scr@l@\scr@current@layer @align}{tl}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{foot}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{foot}{#1}%
\def@scr@l@pos{%
\dimexpr
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi
\else\oddsidemargin\fi
+1in
\relax
}{%
\dimexpr \topmargin+1in+\headheight+\headsep+\textheight
+\footskip+\dp\strutbox-\footheight\relax
}{\textwidth}{\footheight}%
\@namedef{scr@l@\scr@current@layer @align}{tl}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{footskip}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{foot}{#1}%
\def@scr@l@pos{%
\dimexpr
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi
\else\oddsidemargin\fi
+1in
\relax
}{%
\dimexpr \topmargin+1in+\headheight+\headsep+\textheight\relax
}{\textwidth}{\dimexpr\footskip+\dp\strutbox-\footheight\relax}%
\@namedef{scr@l@\scr@current@layer @align}{tl}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{bottommargin}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{bottommargin}{#1}%
\def@scr@l@pos{\z@}{%
\dimexpr \topmargin+1in+\headheight+\headsep
+\textheight
+\footskip+\dp\strutbox\relax
}{\paperwidth}{\dimexpr\paperheight-\layeryoffset\relax}%
\@namedef{scr@l@\scr@current@layer @align}{tl}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{leftmargin}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{leftmargin}{#1}%
\def@scr@l@pos{\z@}{\z@}{%
\dimexpr
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi
\else\oddsidemargin\fi
+1in
\relax
}{\paperheight}%
\@namedef{scr@l@\scr@current@layer @align}{tl}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{rightmargin}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{rightmargin}{#1}%
\def@scr@l@pos{\paperwidth}{\z@}{%
\dimexpr \paperwidth-1in-\textwidth
-\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi
\else\oddsidemargin\fi\relax
}{\paperheight}%
\@namedef{scr@l@\scr@current@layer @align}{tr}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{innermargin}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{innermargin}{#1}%
\def@scr@l@pos{%
\if@twoside
\ifodd\value{page} \z@
\else \dimexpr \evensidemargin+1in+\textwidth\relax
\fi
\else \z@\fi
}{\z@}{%
\dimexpr
\if@twoside\ifodd\value{page} \oddsidemargin+1in
\else \paperwidth-\layerxoffset\fi
\else \oddsidemargin+1in\fi
\relax
}{\paperheight}%
\@namedef{scr@l@\scr@current@layer @align}{tl}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{outermargin}[\relax]{%
\FamilyKeyStateProcessed
\scrlayer@testunexpectedarg{outermargin}{#1}%
\def@scr@l@pos{%
\dimexpr
\if@twoside\ifodd\value{page} \oddsidemargin+1in+\textwidth
\else \z@\fi
\else \oddsidemargin+1in+\textwidth\fi
\relax
}{\z@}{%
\dimexpr
\if@twoside\ifodd\value{page}\paperwidth-\layerxoffset
\else \evensidemargin+1in\fi
\else \paperwidth-\layerxoffset\fi
\relax
}{\paperheight}%
\@namedef{scr@l@\scr@current@layer @align}{tl}%
}
\DefineFamilyKey[.definelayer]{KOMAarg}{area}{%
\def@scr@l@pos#1
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayer]{KOMAarg}{clone}{%
\scr@ifundefinedorrelax{scr@l@#1@x}{%
\FamilyKeyStateUnknownValue
\PackageError{scrlayer}{layer `#1' undefined}{%
You can clone only already defined layers.\MessageBreak
If you'll continue, `clone=#1' will be ignored.%
}%
}{%
\FamilyKeyStateProcessed
\scrlayer@clone@attribute{\scr@current@layer}{#1}{mode}%
\scrlayer@clone@attribute{\scr@current@layer}{#1}{x}%
\scrlayer@clone@attribute{\scr@current@layer}{#1}{y}%
\scrlayer@clone@attribute{\scr@current@layer}{#1}{w}%
\scrlayer@clone@attribute{\scr@current@layer}{#1}{h}%
\scrlayer@clone@attribute{\scr@current@layer}{#1}{align}%
\scrlayer@clone@attribute{\scr@current@layer}{#1}{contents}%
\scrlayer@clone@switch{\scr@current@layer}{#1}{background}%
\scrlayer@clone@switch{\scr@current@layer}{#1}{foreground}%
\scrlayer@clone@switch{\scr@current@layer}{#1}{odd}%
\scrlayer@clone@switch{\scr@current@layer}{#1}{even}%
\scrlayer@clone@switch{\scr@current@layer}{#1}{oneside}%
\scrlayer@clone@switch{\scr@current@layer}{#1}{twoside}%
\scrlayer@clone@switch{\scr@current@layer}{#1}{floatpage}%
\scrlayer@clone@switch{\scr@current@layer}{#1}{nonfloatpage}%
\scrlayer@clone@attribute{\scr@current@layer}{#1}{precontents@hook}%
\scrlayer@clone@attribute{\scr@current@layer}{#1}{postcontents@hook}%
\scrlayer@clone@attribute{\scr@current@layer}{#1}{artifact}%
}%
}
\newcommand*{\scrlayer@clone@attribute}[3]{%
\expandafter\let\csname scr@l@#1@#3\expandafter\endcsname
\csname scr@l@#2@#3\expandafter\endcsname
}
\newcommand*{\scrlayer@clone@switch}[3]{%
\expandafter\let\csname if@scr@l@#1@#3\expandafter\endcsname
\csname if@scr@l@#2@#3\expandafter\endcsname
}
\newcommand{\DeclareLayer}[2][]{%
\def\scr@current@layer{#2}%
\@namedef{scr@l@#2@mode}{text}%
\@namedef{scr@l@#2@x}{\z@}%
\@namedef{scr@l@#2@y}{\z@}%
\@namedef{scr@l@#2@w}{\paperwidth}%
\@namedef{scr@l@#2@h}{\paperheight}%
\@namedef{scr@l@#2@align}{tl}%
\@namedef{scr@l@#2@contents}{}%
\expandafter\newif\csname if@scr@l@#2@background\endcsname
\csname @scr@l@#2@backgroundtrue\endcsname
\expandafter\newif\csname if@scr@l@#2@foreground\endcsname
\csname @scr@l@#2@foregroundtrue\endcsname
\expandafter\newif\csname if@scr@l@#2@odd\endcsname
\csname @scr@l@#2@oddtrue\endcsname
\expandafter\newif\csname if@scr@l@#2@even\endcsname
\csname @scr@l@#2@eventrue\endcsname
\expandafter\newif\csname if@scr@l@#2@oneside\endcsname
\csname @scr@l@#2@onesidetrue\endcsname
\expandafter\newif\csname if@scr@l@#2@twoside\endcsname
\csname @scr@l@#2@twosidetrue\endcsname
\expandafter\newif\csname if@scr@l@#2@floatpage\endcsname
\csname @scr@l@#2@floatpagetrue\endcsname
\expandafter\newif\csname if@scr@l@#2@nonfloatpage\endcsname
\csname @scr@l@#2@nonfloatpagetrue\endcsname
\FamilyExecuteOptions[.definelayer]{KOMAarg}{#1}%
\let\scr@current@layer\@empty
}
\newcommand*{\scr@current@layer}{}
\newcommand*{\IfLayerExists}[1]{%
\scr@ifundefinedorrelax{scr@l@#1@mode}{%
\expandafter\@secondoftwo
}{%
\expandafter\@firstoftwo
}%
}
\newcommand{\DeclareNewLayer}[2][]{%
\IfLayerExists{#2}{%
\PackageError{scrlayer}{layer `#2' already defined}{%
You may declare only layer, that haven't been declared previously
using\MessageBreak
\string\DeclareNewLayer. See also the alternatives
\string\RedeclareLayer,\MessageBreak
\string\ModifyLayer\space and \string\ProvideLayer.\MessageBreak
If you'll continue, declaration will be ignored.}%
}{\DeclareLayer[{#1}]{#2}}%
}
\newcommand{\ProvideLayer}[2][]{%
\IfLayerExists{#2}{%
\PackageInfo{scrlayer}{\string\ProvideLayer{#2} ignored,\MessageBreak
because of already defined layer}%
}{\DeclareNewLayer[{#1}]{#2}}%
}
\newcommand{\RedeclareLayer}[2][]{%
\IfLayerExists{#2}{}{%
\PackageError{scrlayer}{layer `#2' not yet defined}{%
You may declare only already declared layers using
\string\RedeclareLayer.\MessageBreak
See also the alternatives
\string\DeclareLayer and \string\ProvideLayer.\MessageBreak
Nevertheless, if you'll continue, declaration will be done.}%
}%
\DeclareLayer[{#1}]{#2}%
}
\newcommand{\ModifyLayer}[2][]{%
\IfLayerExists{#2}{%
\def\scr@current@layer{#2}%
\edef\reserved@a{%
\unexpanded{%
\FamilyExecuteOptions[.definelayer]{KOMAarg}{#1}%
\Ifstr{\csname scr@l@#2@mode\endcsname}%
}{\csname scr@l@#2@mode\endcsname}%
}\reserved@a{}{%
\PackageWarning{scrlayer}{%
change of layer mode could result in unexpected\MessageBreak
output and errors%
}%
}%
\let\scr@current@layer\@empty
}{%
\PackageError{scrlayer}{layer `#2' not yet defined}{%
You may modify only already declared layers using
\string\ModifyLayer.\MessageBreak
See also the alternatives
\string\DeclareLayer and \string\ProvideLayer.\MessageBreak
Nevertheless, if you'll continue, declaration will be done.}%
\DeclareLayer[{#1}]{#2}%
}%
}
\newcommand{\ModifyLayers}[2][]{%
\edef\scr@current@layer{#2}%
\@for\scr@current@layer:=\scr@current@layer\do{%
\scr@trim@spaces\scr@current@layer
\ifx\scr@current@layer\@emtpy\else
\edef\scr@current@layer{%
\unexpanded{\ModifyLayer[{#1}]}{\scr@current@layer}%
}%
\scr@current@layer
\fi
}%
\let\scr@current@layer\@empty
}
\newcommand*{\GetLayerContents}[1]{%
\IfLayerExists{#1}{\@nameuse{scr@l@#1@contents}}{%
\PackageError{scrlayer}{unknown layer `#1'}{%
You can ask only for the contents of an existing layer.}%
}%
}
\newcommand*{\DestroyLayer}[1]{%
\IfLayerExists{#1}{%
\expandafter\let\csname scr@l@#1@mode\endcsname\relax
\expandafter\let\csname scr@l@#1@x\endcsname\relax
\expandafter\let\csname scr@l@#1@y\endcsname\relax
\expandafter\let\csname scr@l@#1@w\endcsname\relax
\expandafter\let\csname scr@l@#1@h\endcsname\relax
\expandafter\let\csname scr@l@#1@align\endcsname\relax
\expandafter\let\csname scr@l@#1@contents\endcsname\relax
\expandafter\let\csname if@scr@l@#1@background\endcsname\relax
\expandafter\let\csname @scr@l@#1@backgroundfalse\endcsname\relax
\expandafter\let\csname @scr@l@#1@backgroundtrue\endcsname\relax
\expandafter\let\csname if@scr@l@#1@foreground\endcsname\relax
\expandafter\let\csname @scr@l@#1@foregroundfalse\endcsname\relax
\expandafter\let\csname @scr@l@#1@foregroundtrue\endcsname\relax
\expandafter\let\csname if@scr@l@#1@odd\endcsname\relax
\expandafter\let\csname @scr@l@#1@oddfalse\endcsname\relax
\expandafter\let\csname @scr@l@#1@oddtrue\endcsname\relax
\expandafter\let\csname if@scr@l@#1@even\endcsname\relax
\expandafter\let\csname @scr@l@#1@evenfalse\endcsname\relax
\expandafter\let\csname @scr@l@#1@eventrue\endcsname\relax
\expandafter\let\csname if@scr@l@#1@oneside\endcsname\relax
\expandafter\let\csname @scr@l@#1@onesidefalse\endcsname\relax
\expandafter\let\csname @scr@l@#1@onesidetrue\endcsname\relax
\expandafter\let\csname if@scr@l@#1@twoside\endcsname\relax
\expandafter\let\csname @scr@l@#1@twosidefalse\endcsname\relax
\expandafter\let\csname @scr@l@#1@twosidetrue\endcsname\relax
\expandafter\let\csname if@scr@l@#1@floatpage\endcsname\relax
\expandafter\let\csname @scr@l@#1@floatpagefalse\endcsname\relax
\expandafter\let\csname @scr@l@#1@floatpagetrue\endcsname\relax
\expandafter\let\csname if@scr@l@#1@nonfloatpage\endcsname\relax
\expandafter\let\csname @scr@l@#1@nonfloatpagefalse\endcsname\relax
\expandafter\let\csname @scr@l@#1@nonfloatpagetrue\endcsname\relax
\expandafter\let\csname scr@l@#1@precontents@hook\relax
\expandafter\let\csname scr@l@#1@postcontents@hook\relax
\expandafter\let\csname scr@l@#1@artifact\relax
}{%
\PackageInfo{scrlayer}{\string\DestroyLayer{#1} ignored,\MessageBreak
because that layer doesn't exist\MessageBreak
(any longer)%
}%
}%
}
\newcommand*{\layercontentsmeasure}{%
\smash{\begin{picture}(0,0)
(0,\LenToUnit{%
\if t\layervalign -\ht\strutbox
\else
\if b\layervalign -\dimexpr\layerheight-\dp\strutbox\relax
\else -.5\dimexpr\layerheight+\ht\strutbox-\dp\strutbox\relax
\fi
\fi})
\setlength{\unitlength}{1mm}%
\put(0,0){\line(1,0){\LenToUnit{\layerwidth}}}%
\@tempcnta=\numexpr \dimexpr\layerwidth + .5mm\relax/\dimexpr 1mm\relax\relax
\multiput(0,0)(1,0){\@tempcnta}{%
\line(0,-1){1}%
}%
\@tempcnta=\numexpr \dimexpr\layerwidth + 2.5mm\relax/\dimexpr 5mm\relax\relax
\multiput(0,0)(5,0){\@tempcnta}{%
\line(0,-1){2}%
}%
\@tempcnta=\numexpr \dimexpr\layerwidth + .5cm\relax/\dimexpr 1cm\relax\relax
\multiput(0,0)(10,0){\@tempcnta}{%
\put(0,0){\line(0,-1){3}}%
\put(0,-3.5){%
\makebox(0,0)[ct]{\the\numexpr\@tempcnta-\@multicnt\relax}}%
}%
\put(0,\LenToUnit{-\layerheight}){\line(1,0){\LenToUnit{\layerwidth}}}%
\@tempcnta=\numexpr \dimexpr\layerwidth + .05in\relax/\dimexpr .1in\relax\relax
\multiput(0,\LenToUnit{-\layerheight})(2.54,0){\@tempcnta}{%
\line(0,1){1}%
}%
\@tempcnta=\numexpr \dimexpr\layerwidth + .25in\relax/\dimexpr .5in\relax\relax
\multiput(0,\LenToUnit{-\layerheight})(12.7,0){\@tempcnta}{%
\line(0,1){2}%
}%
\@tempcnta=\numexpr \dimexpr\layerwidth + .5in\relax/\dimexpr 1in\relax\relax
\multiput(0,\LenToUnit{-\layerheight})(25.4,0){\@tempcnta}{%
\put(0,0){\line(0,1){3}}%
\put(0,3.5){%
\makebox(0,0)[cb]{\the\numexpr\@tempcnta-\@multicnt\relax}}%
}%
\put(0,0){\line(0,-1){\LenToUnit{\layerheight}}}%
\@tempcnta\numexpr \dimexpr\layerheight + .5mm\relax/\dimexpr 1mm\relax\relax
\multiput(0,0)(0,-1){\@tempcnta}{%
\line(1,0){1}%
}%
\@tempcnta\numexpr \dimexpr\layerheight + 2.5mm\relax/\dimexpr 5mm\relax\relax
\multiput(0,0)(0,-5){\@tempcnta}{%
\line(1,0){2}%
}%
\@tempcnta\numexpr \dimexpr\layerheight + .5cm\relax/\dimexpr 1cm\relax\relax
\multiput(0,0)(0,-10){\@tempcnta}{%
\put(0,0){\line(1,0){3}}%
\put(3.5,0){%
\makebox(0,0)[cl]{\the\numexpr\@tempcnta-\@multicnt\relax}}%
}%
\put(\LenToUnit{\layerwidth},0){\line(0,-1){\LenToUnit{\layerheight}}}%
\@tempcnta\numexpr \dimexpr\layerheight + .05in\relax/\dimexpr .1in\relax\relax
\multiput(\LenToUnit{\layerwidth},0)(0,-2.54){\@tempcnta}{%
\line(-1,0){1}%
}%
\@tempcnta\numexpr \dimexpr\layerheight + .25in\relax/\dimexpr .5in\relax\relax
\multiput(\LenToUnit{\layerwidth},0)(0,-12.7){\@tempcnta}{%
\line(-1,0){2}%
}%
\@tempcnta\numexpr \dimexpr\layerheight + .5in\relax/\dimexpr 1in\relax\relax
\multiput(\LenToUnit{\layerwidth},0)(0,-25.4){\@tempcnta}{%
\put(0,0){\line(-1,0){3}}%
\put(-3.5,0){%
\makebox(0,0)[cr]{\the\numexpr\@tempcnta-\@multicnt\relax}}%
}%
\end{picture}}%
}
\providecommand*{\LenToUnit}[1]{\strip@pt\dimexpr#1*\p@/\unitlength}
\DefineFamily{KOMAarg}
\DefineFamilyMember[.definelayerpagestyle]{KOMAarg}
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onselect}{%
\expandafter\l@addto@macro
\csname @ps@\scrlayer@current@pagestyle @initialhook\endcsname
{#1}%
\let\scr@opt@marker@initialhook\FamilyKeyStateProcssed
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{oninit}{%
\expandafter\l@addto@macro
\csname @ps@\scrlayer@current@pagestyle @hook\endcsname
{#1}%
\let\scr@opt@marker@hook\FamilyKeyStateProcssed
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{ononeside}{%
\expandafter\l@addto@macro
\csname @ps@\scrlayer@current@pagestyle @onesidehook\endcsname
{#1}%
\let\scr@opt@marker@onesidehook\FamilyKeyStateProcssed
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{ontwoside}{%
\expandafter\l@addto@macro
\csname @ps@\scrlayer@current@pagestyle @twosidehook\endcsname
{#1}%
\let\scr@opt@marker@twosidehook\FamilyKeyStateProcssed
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onoddpage}{%
\expandafter\l@addto@macro
\csname @ps@\scrlayer@current@pagestyle @oddpagehook\endcsname
{#1}%
\let\scr@opt@marker@oddpagehook\FamilyKeyStateProcssed
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onevenpage}{%
\expandafter\l@addto@macro
\csname @ps@\scrlayer@current@pagestyle @evenpagehook\endcsname
{#1}%
\let\scr@opt@marker@evenpagehook\FamilyKeyStateProcssed
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onfloatpage}{%
\expandafter\l@addto@macro
\csname @ps@\scrlayer@current@pagestyle @floatpagehook\endcsname
{#1}%
\let\scr@opt@marker@floatpagehook\FamilyKeyStateProcssed
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onnonfloatpage}{%
\expandafter\l@addto@macro
\csname @ps@\scrlayer@current@pagestyle @nonfloatpagehook\endcsname
{#1}%
\let\scr@opt@marker@nonfloatpagehook\FamilyKeyStateProcssed
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onbackground}{%
\expandafter\l@addto@macro
\csname @ps@\scrlayer@current@pagestyle @backgroundhook\endcsname
{#1}%
\let\scr@opt@marker@backgroundhook\FamilyKeyStateProcssed
\FamilyKeyStateProcessed
}
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onforeground}{%
\expandafter\l@addto@macro
\csname @ps@\scrlayer@current@pagestyle @foregroundhook\endcsname
{#1}%
\let\scr@opt@marker@foregroundhook\FamilyKeyStateProcssed
\FamilyKeyStateProcessed
}
\newcommand*{\DeclarePageStyleByLayers}[3][]{%
\edef\scrlayer@current@pagestyle{\GetRealPageStyle{#2}}%
\expandafter\scrlayer@declare@ps@by@layers\expandafter{%
\scrlayer@current@pagestyle
}{#1}{#3}%
}
\newcommand*{\scrlayer@declare@ps@by@layers}[3]{%
\@namedef{@ps@#1@initialhook}{\@ps@initialhook}%
\@namedef{@ps@#1@hook}{\@ps@hook}%
\@namedef{@ps@#1@backgroundhook}{\@ps@backgroundhook}%
\@namedef{@ps@#1@foregroundhook}{\@ps@foregroundhook}%
\@namedef{@ps@#1@oddpagehook}{\@ps@oddpagehook}%
\@namedef{@ps@#1@evenpagehook}{\@ps@evenpagehook}%
\@namedef{@ps@#1@onesidehook}{\@ps@onesidehook}%
\@namedef{@ps@#1@twosidehook}{\@ps@twosidehook}%
\@namedef{@ps@#1@floatpagehook}{\@ps@floatpagehook}%
\@namedef{@ps@#1@nonfloatpagehook}{\@ps@nonfloatpagehook}%
\FamilyExecuteOptions[.definelayerpagestyle]{KOMAarg}{#2}%
\@namedef{ps@#1}{%
\renewcommand*{\currentpagestyle}{#1}%
\@nameuse{@ps@@everystyle@@initialhook}%
\@nameuse{@ps@#1@initialhook}%
\renewcommand*{\currentpagestyle}{#1}%
\renewcommand*{\@oddhead}{%
\begingroup
\let\headmark\rightmark
\if@ps@singlespacing\linespread{1}\selectfont\fi
\@nameuse{@ps@@everystyle@@hook}%
\@nameuse{@ps@#1@hook}%
\@nameuse{@ps@@everystyle@@\if@twoside two\else one\fi sidehook}%
\@nameuse{@ps@#1@\if@twoside two\else one\fi sidehook}%
\@nameuse{@ps@@everystyle@@oddpagehook}%
\@nameuse{@ps@#1@oddpagehook}%
\@nameuse{@ps@@everystyle@@\if@fcolmade\else non\fi floatpagehook}%
\@nameuse{@ps@#1@\if@fcolmade\else non\fi floatpagehook}%
\@nameuse{@ps@@everystyle@@backgroundhook}%
\@nameuse{@ps@#1@backgroundhook}%
\parbox[b][\headheight][t]{\textwidth}{%
\vskip \dimexpr -\topmargin-1in
-\ht\strutbox\relax
\hskip \dimexpr -\oddsidemargin-1in\relax
\strut\makebox[\z@][l]{%
\ForEachLayerOfPageStyle{@everystyle@}{%
\scrlayer@do@page@style@element@layer{background}{odd}%
{########1}%
}%
\ForEachLayerOfPageStyle{#1}{%
\scrlayer@do@page@style@element@layer{background}{odd}%
{########1}%
}%
}%
}%
\endgroup
}%
\renewcommand*{\@evenhead}{%
\begingroup
\let\headmark\leftmark
\if@ps@singlespacing\linespread{1}\selectfont\fi
\@nameuse{@ps@@everystyle@@hook}%
\@nameuse{@ps@#1@hook}%
\@nameuse{@ps@@everystyle@@twosidehook}%
\@nameuse{@ps@#1@twosidehook}%
\@nameuse{@ps@@everystyle@@evenpagehook}%
\@nameuse{@ps@#1@evenpagehook}%
\@nameuse{@ps@@everystyle@@\if@fcolmade\else non\fi floatpagehook}%
\@nameuse{@ps@#1@\if@fcolmade\else non\fi floatpagehook}%
\@nameuse{@ps@@everystyle@@backgroundhook}%
\@nameuse{@ps@#1@backgroundhook}%
\parbox[b][\headheight][t]{\textwidth}{%
\vskip \dimexpr -\topmargin-1in
-\ht\strutbox\relax
\hskip \dimexpr-\evensidemargin-1in\relax
\strut\makebox[\z@][l]{%
\ForEachLayerOfPageStyle{@everystyle@}{%
\scrlayer@do@page@style@element@layer{background}{even}%
{########1}%
}%
\ForEachLayerOfPageStyle{#1}{%
\scrlayer@do@page@style@element@layer{background}{even}%
{########1}%
}%
}%
}%
\endgroup
}%
\renewcommand*{\@oddfoot}{%
\begingroup
\let\headmark\rightmark
\if@ps@singlespacing\linespread{1}\selectfont\fi
\@nameuse{@ps@@everystyle@@hook}%
\@nameuse{@ps@#1@hook}%
\@nameuse{@ps@@everystyle@@\if@twoside two\else one\fi sidehook}%
\@nameuse{@ps@#1@\if@twoside two\else one\fi sidehook}%
\@nameuse{@ps@@everystyle@@oddpagehook}%
\@nameuse{@ps@#1@oddpagehook}%
\@nameuse{@ps@@everystyle@@\if@fcolmade\else non\fi floatpagehook}%
\@nameuse{@ps@#1@\if@fcolmade\else non\fi floatpagehook}%
\@nameuse{@ps@@everystyle@@foregroundhook}%
\@nameuse{@ps@#1@foregroundhook}%
\parbox[t][\headheight][t]{\textwidth}{%
\vskip \dimexpr -\topmargin-1in
-\headheight
-\headsep
-\textheight
-\footskip
-\ht\strutbox\relax
\hskip \dimexpr -\oddsidemargin-1in\relax
\strut\makebox[\z@][l]{%
\ForEachLayerOfPageStyle{@everystyle@}{%
\scrlayer@do@page@style@element@layer{foreground}{odd}%
{########1}%
}%
\ForEachLayerOfPageStyle{#1}{%
\scrlayer@do@page@style@element@layer{foreground}{odd}%
{########1}%
}%
}%
}%
\endgroup
}%
\renewcommand*{\@evenfoot}{%
\begingroup
\let\headmark\leftmark
\if@ps@singlespacing\linespread{1}\selectfont\fi
\@nameuse{@ps@@everystyle@@hook}%
\@nameuse{@ps@#1@hook}%
\@nameuse{@ps@@everystyle@@twosidehook}%
\@nameuse{@ps@#1@twosidehook}%
\@nameuse{@ps@@everystyle@@evenpagehook}%
\@nameuse{@ps@#1@evenpagehook}%
\@nameuse{@ps@@everystyle@@\if@fcolmade\else non\fi floatpagehook}%
\@nameuse{@ps@#1@\if@fcolmade\else non\fi floatpagehook}%
\@nameuse{@ps@@everystyle@@foregroundhook}%
\@nameuse{@ps@#1@foregroundhook}%
\parbox[t][\headheight][t]{\textwidth}{%
\vskip \dimexpr -\topmargin-1in
-\headheight
-\headsep
-\textheight
-\footskip
-\ht\strutbox\relax
\hskip \dimexpr-\evensidemargin-1in\relax
\strut\makebox[\z@][l]{%
\ForEachLayerOfPageStyle{@everystyle@}{%
\scrlayer@do@page@style@element@layer{foreground}{even}%
{########1}%
}%
\ForEachLayerOfPageStyle{#1}{%
\scrlayer@do@page@style@element@layer{foreground}{even}%
{########1}%
}%
}%
}%
\endgroup
}%
}%
\@namedef{@ps@#1@layers}{}%
\@for \reserved@a:=#3\do {%
\scr@trim@spaces\reserved@a
\Ifstr\reserved@a\@empty{}{%
\expandafter\@cons\csname @ps@#1@layers\endcsname{{\reserved@a}}%
}%
}%
}
\newcommand*{\ForEachLayerOfPageStyle}{%
\kernel@ifstar {\@s@ForEachLayerOfPageStyle}{\@ForEachLayerOfPageStyle}%
}
\newcommand*{\@ForEachLayerOfPageStyle}[2]{%
\begingroup
\edef\reserved@a{\GetRealPageStyle{#1}}%
\def\@elt##1{\ifscrlayer@deactivate@layers\else #2\fi}%
\@nameuse{@ps@\reserved@a @layers}%
\endgroup
}
\newcommand*{\@s@ForEachLayerOfPageStyle}[2]{%
\begingroup
\edef\reserved@a{\GetRealPageStyle{#1}}%
\def\reserved@b{\endgroup}%
\def\@elt##1{%
\l@addto@macro\reserved@b{%
\ifscrlayer@deactivate@layers\else #2\fi
}%
}%
\@nameuse{@ps@\reserved@a @layers}%
\reserved@b
}
\newcommand*{\scrlayer@do@page@style@element@layer}[3]{%
\begingroup
\expandafter\ifx\csname if@scr@l@#3@\if@fcolmade\else non\fi floatpage%
\expandafter\endcsname\csname iftrue\endcsname
\expandafter\ifx\csname if@scr@l@#3@\if@twoside two\else one\fi side%
\expandafter\endcsname\csname iftrue\endcsname
\expandafter
\ifx\csname if@scr@l@#3@#1\expandafter\endcsname
\csname iftrue\endcsname
\expandafter
\ifx\csname if@scr@l@#3@#2\expandafter\endcsname
\csname iftrue\endcsname
\ifscrlayer@draft
\scr@layerbox(\csname scr@l@#3@x\endcsname,%
\csname scr@l@#3@y\endcsname)%
(\csname scr@l@#3@w\endcsname,%
\csname scr@l@#3@h\endcsname)%
[\csname scr@l@#3@align\endcsname]%
{%
\scrlayer@predraftmeasure@hook
\scrlayer@beginartifact{}%
\layercontentsmeasure
\scrlayer@endartifact{}%
\scrlayer@postdraftmeasure@hook
}%
\fi
\scr@layerbox(\csname scr@l@#3@x\endcsname,%
\csname scr@l@#3@y\endcsname)%
(\csname scr@l@#3@w\endcsname,%
\csname scr@l@#3@h\endcsname)%
[\csname scr@l@#3@align\endcsname]%
{\csname layer\csname scr@l@#3@mode\endcsname
mode\expandafter\endcsname{%
\csname scr@l@#3@precontents@hook\endcsname
\scr@ifundefinedorrelax{scr@l@#3@artifact}{}{%
\expandafter\expandafter\expandafter
\scrlayer@beginartifact
\expandafter\expandafter\expandafter{%
\csname scr@l@#3@artifact\endcsname
}%
\csname scr@l@#3@contents\endcsname
\expandafter\expandafter\expandafter
\scrlayer@endartifact
\expandafter\expandafter\expandafter{%
\csname scr@l@#3@artifact\endcsname
}%
}{%
\csname scr@l@#3@contents\endcsname
}%
\csname scr@l@#3@postcontents@hook\endcsname
}%
}%
\fi
\fi
\fi
\fi
\endgroup
}
\newcommand*{\scrlayer@predraftmeasure@hook}{}
\newcommand*{\BeforeDraftMeasuringLayer}[1]{%
\edef\scrlayer@predraftmeasure@hook{%
\unexpanded{#1}\unexpanded\expandafter{\scrlayer@predraftmeasure@hook}%
}%
}
\newcommand*{\scrlayer@postdraftmeasure@hook}{}
\newcommand*{\AfterDraftMeasuringLayer}[1]{%
\expandafter\def\expandafter\scrlayer@postdraftmeasure@hook\expandafter{%
\scrlayer@postdraftmeasure@hook #1%
}%
}
\def\scr@layerbox(#1,#2)(#3,#4){%
\kernel@ifnextchar [%]
{\scr@@layerbox(#1,#2)(#3,#4)}{\scr@@layerbox(#1,#2)(#3,#4)[]}%
}
\def\scr@@layerbox(#1,#2)(#3,#4)[#5]#6{%
\begingroup
\protected@edef\layerxoffset{\noexpand\dimexpr #1\relax}%
\protected@edef\layeryoffset{\noexpand\dimexpr #2\relax}%
\protected@edef\layerwidth{\noexpand\dimexpr #3\relax}%
\protected@edef\layerheight{\noexpand\dimexpr #4\relax}%
\def\layervalign{t}%
\def\layerhalign{l}%
\edef\reserved@b{#5}%
\expandafter\@tfor\expandafter\reserved@a\expandafter:\expandafter=%
\reserved@b\do{%
\if t\reserved@a
\def\layervalign{t}%
\else
\if c\reserved@a
\def\layervalign{c}%
\def\layerhalign{c}%
\else
\if b\reserved@a
\def\layervalign{b}%
\else
\if l\reserved@a
\def\layerhalign{l}%
\else
\if r\reserved@a
\def\layerhalign{r}%
\else
\PackageWarning{scrlayer}{%
Unknown alignment `\reserved@a' ignored}%
\fi
\fi
\fi
\fi
\fi
}%
\parbox[t][\z@][t]{\z@}{%
\vskip\layeryoffset
\if b\layervalign\vskip-\layerheight\fi
\if c\layervalign\vskip-.5\layerheight\fi
\makebox[\z@][\IfRTL{r}{l}]{%
\hskip\layerxoffset
\IfRTL{\hskip\layerwidth}{}%
\makebox[\z@][\layerhalign]{%
\parbox[\layervalign][\layerheight][\layervalign]{\layerwidth}{%
\vskip\z@\strut{%
\ifscrlayer@forceignoreuppercase
\expandafter\let\csname MakeUppercase \endcsname\@firstofone
\let\MakeUppercase\@firstofone
\let\uppercase\@firstofone
\fi
#6%
}\strut\vskip\z@
}%
}%
}%
}%
\endgroup
}
\newcommand{\layerrawmode}[1]{#1}
\newcommand{\layertextmode}[1]{#1}
\newcommand{\layerpicturemode}[1]{%
\begin{picture}(0,0)
(0,\LenToUnit{%
\if t\layervalign \dimexpr\layerheight-\ht\strutbox\relax
\else
\if b\layervalign \dp\strutbox
\else .5\dimexpr\layerheight-\ht\strutbox+\dp\strutbox\relax
\fi
\fi})
\long\def\putLL##1{\put(0,0){##1}}%
\long\def\putUL##1{\put(0,\LenToUnit{\layerheight}){##1}}%
\long\def\putLR##1{\put(\LenToUnit{\layerwidth},0){##1}}%
\long\def\putUR##1{\put(\LenToUnit{\layerwidth},%
\LenToUnit{\layerheight}){##1}}%
\long\def\putC##1{\put(\LenToUnit{.5\layerwidth},%
\LenToUnit{.5\layerheight}){##1}}%
#1%
\end{picture}%
}
\newcommand*{\DeclareNewPageStyleByLayers}[2][]{%
\@ifundefined{ps@#2}{}{%
\PackageError{scrlayer}{%
Page style `#2' already defined%
}{%
You may use \string\DeclareNewPageStyleByLayers\space to declare a new
page style only\MessageBreak
if that page style hasn't been declared or defined before.\MessageBreak
You may use either \string\ProvidePageStyleByLayers\space to declare the
page style only\MessageBreak
if it hasn't been declared or defined before, or
\string\RedeclarePageStyleByLayers\MessageBreak
to overwrite the former
declaration or definition of the page style%
\@ifundefined{@ps@#2@layers}{}{,\MessageBreak
or \string\AddLayersToPageStyle\space to add further layers to the
already declared\MessageBreak
page style, or \string\RemoveLayersFromPageStyle\space to remove
layers from the\MessageBreak
already declared page style}.\MessageBreak
Nevertheless, if you'll continue, the page style will be
overwritten\MessageBreak
by the new declaration.%
}%
}%
\DeclarePageStyleByLayers[{#1}]{#2}%
}
\newcommand*{\ProvidePageStyleByLayers}[3][]{%
\@ifundefined{ps@#2}{%
\DeclarePageStyleByLayers[{#1}]{#2}{#3}%
}{%
\PackageInfo{scrlayer}{%
\string\ProvidePageStyleByLayers{#2}{#3} ignored,\MessageBreak
because page style `#2'\MessageBreak
already exists%
}%
}%
}
\newcommand*{\RedeclarePageStyleByLayers}[2][]{%
\@ifundefined{ps@#2}{%
\PackageError{scrlayer}{%
Page style `#2' not yet defined%
}{%
You may use \string\RedeclarePageStyleByLayers\space to declare a page
style only\MessageBreak
if that page style has already been declared or defined.\MessageBreak
You may use either \string\DeclareNewPageStyleByLayers,
\string\DeclarePageStyleByLayers,\MessageBreak
or \string\ProvidePageStyleByLayers\space to declare that not yet
defined page style.\MessageBreak
Nevertheless, if you'll continue, the page style will be declared.%
}%
}{}%
\DeclarePageStyleByLayers[{#1}]{#2}%
}
\newcommand*{\AddLayersToPageStyle}[2]{%
\edef\reserved@b{\GetRealPageStyle{#1}}%
\IfLayerPageStyleExists{\reserved@b}{%
\@for \reserved@a:=#2\do {%
\scr@trim@spaces\reserved@a
\Ifstr\reserved@a\@empty{}{%
\expandafter\@cons\csname @ps@\reserved@b @layers\endcsname
{{\reserved@a}}%
}%
}%
}{%
\scrlayer@lpm@error{#1}{adding layers}%
}%
}
\newcommand*{\AddLayersAtEndOfPageStyle}{%
\AddLayersToPageStyle
}
\newcommand*{\AddLayersAtBeginOfPageStyle}[2]{%
\begingroup
\let\@cons\@snoc
\AddLayersToPageStyle{#1}{#2}%
\endgroup
}
\newcommand*{\@snoc}[2]{%
\begingroup\let\@elt\relax\xdef#1{\@elt #2#1}\endgroup
}
\newcommand*{\RemoveLayersFromPageStyle}[2]{%
\edef\reserved@b{\GetRealPageStyle{#1}}%
\IfLayerPageStyleExists{#1}{%
\@for \reserved@a:=#2\do {%
\scr@trim@spaces\reserved@a
\Ifstr\reserved@a\@empty{}{%
\expandafter\remove@layer@from@page@style\expandafter{\reserved@a}%
{\reserved@b}%
}%
}%
}{%
\scrlayer@lpm@error{#1}{removing layers}%
}%
}
\newcommand*{\remove@layer@from@page@style}[2]{%
\begingroup
\expandafter\let\expandafter\reserved@a\csname @ps@#2@layers\endcsname
\expandafter\global\expandafter\let\csname @ps@#2@layers\endcsname\@empty
\def\@elt##1{%
\Ifstr{#1}{##1}{}{%
\expandafter\@cons\csname @ps@#2@layers\endcsname{{##1}}%
}%
}\reserved@a
\endgroup
}
\newcommand*{\scrlayer@lpm@error}[2]{%
\PackageError{scrlayer}{`#1' is not a layer page style}{%
\scr@ifundefinedorrelax{ps@#1}{%
Page style `#1' is not defined,
}{%
Page style `#1' is not a layer page style,
}%
but #2\MessageBreak
may be used only for layer page styles declared using\MessageBreak
\string\DeclarePageStyleByLayers,
\string\DeclareNewPageStyleByLayers,\MessageBreak
of \string\ProvidePageStyleByLayers.\MessageBreak
If you'll continue, your operation will be ignored.%
}%
}
\newcommand*{\AddLayersToPageStyleAfterLayer}[3]{%
\edef\reserved@b{\GetRealPageStyle{#1}}%
\IfLayerPageStyleExists{\reserved@b}{%
\begingroup
\expandafter\let\expandafter\reserved@a
\csname @ps@\reserved@b @layers\endcsname
\@namedef{@ps@\reserved@b @layers}{}%
\def\@elt##1{%
\Ifstr{##1}\@empty{}{%
\expandafter\@cons\csname @ps@\reserved@b @layers\endcsname{{##1}}%
\Ifstr{##1}{#3}{%
\@for \reserved@a:=#2\do {%
\scr@trim@spaces\reserved@a
\Ifstr\reserved@a\@empty{}{%
\expandafter\@cons\csname @ps@\reserved@b @layers\endcsname
{{\reserved@a}}%
}%
}%
}{}%
}%
}%
\reserved@a
\endgroup
}{%
\scrlayer@lpm@error{#1}{adding layers}%
}%
}
\newcommand*{\AddLayersToPageStyleBeforeLayer}[3]{%
\edef\reserved@b{\GetRealPageStyle{#1}}%
\IfLayerPageStyleExists{\reserved@b}{%
\begingroup
\expandafter\let\expandafter\reserved@a
\csname @ps@\reserved@b @layers\endcsname
\@namedef{@ps@\reserved@b @layers}{}%
\def\@elt##1{%
\Ifstr{##1}\@empty{}{%
\Ifstr{##1}{#3}{%
\@for \reserved@a:=#2\do {%
\scr@trim@spaces\reserved@a
\Ifstr\reserved@a\@empty{}{%
\expandafter\@cons\csname @ps@\reserved@b @layers\endcsname
{{\reserved@a}}%
}%
}%
}{}%
\expandafter\@cons\csname @ps@#1@layers\endcsname{{##1}}%
}%
}%
\reserved@a
\endgroup
}{%
\scrlayer@lpm@error{#1}{adding layers}%
}%
}
\newcommand*{\UnifyLayersAtPageStyle}[1]{%
\edef\reserved@b{\GetRealPageStyle{#1}}%
\IfLayerPageStyleExists{\reserved@b}{%
\expandafter\let\expandafter\reserved@a
\csname @ps@\reserved@b @layers\endcsname
\@namedef{@ps@\reserved@b @layers}{}%
\begingroup
\def\@elt##1{%
\Ifstr{##1}\@empty{}{%
\remove@layer@from@page@style{##1}{\reserved@b}%
\expandafter\@cons\csname @ps@\reserved@b @layers\endcsname{{##1}}%
}%
}%
\reserved@a
\endgroup
}{%
\scrlayer@lpm@error{#1}{unifying}%
}%
}
\newcommand*{\ModifyLayerPageStyleOptions}[2]{%
\edef\reserved@a{\GetRealPageStyle{#1}}%
\IfLayerPageStyleExists{#1}{%
\expandafter\scrlayer@modify@layer@ps@options\expandafter{%
\reserved@a
}{#2}%
}{%
\scrlayer@lpm@error{#1}{modifying}%
}%
}
\newcommand*{\scrlayer@modify@layer@ps@options}[2]{%
\begingroup
\def\scrlayer@current@pagestyle{#1}%
\@namedef{@ps@#1@initialhook}{}%
\@namedef{@ps@#1@hook}{}%
\@namedef{@ps@#1@backgroundhook}{}%
\@namedef{@ps@#1@foregroundhook}{}%
\@namedef{@ps@#1@oddpagehook}{}%
\@namedef{@ps@#1@evenpagehook}{}%
\@namedef{@ps@#1@onesidehook}{}%
\@namedef{@ps@#1@twosidehook}{}%
\@namedef{@ps@#1@floatpagehook}{}%
\@namedef{@ps@#1@nonfloatpagehook}{}%
\let\scr@opt@marker@initialhook\@empty
\let\scr@opt@marker@hook\@empty
\let\scr@opt@marker@backgroundhook\@empty
\let\scr@opt@marker@foregroundhook\@empty
\let\scr@opt@marker@oddpagehook\@empty
\let\scr@opt@marker@evenpagehook\@empty
\let\scr@opt@marker@onesidehook\@empty
\let\scr@opt@marker@twosidehook\@empty
\let\scr@opt@marker@floatpagehook\@empty
\let\scr@opt@marker@nonfloatpagehook\@empty
\FamilyExecuteOptions[.definelayerpagestyle]{KOMAarg}{#2}%
\def\reserved@a{\endgroup}%
\def\@sls@##1{%
\expandafter\ifx \csname scr@opt@marker@##1hook\endcsname\@empty\else
\expandafter\let\expandafter\reserved@b\csname @ps@#1@##1hook\endcsname
\l@addto@macro\reserved@a{\@namedef{@ps@#1@##1hook}}%
\expandafter\l@addto@macro\expandafter\reserved@a\expandafter{%
\expandafter{%
\reserved@b
}%
}%
\fi
}%
\@sls@{initial}%
\@sls@{}%
\@sls@{background}%
\@sls@{foreground}%
\@sls@{oddpage}%
\@sls@{evenpage}%
\@sls@{oneside}%
\@sls@{twoside}%
\@sls@{floatpage}%
\@sls@{nonfloatpage}%
\reserved@a
}
\newcommand*{\AddToLayerPageStyleOptions}[2]{%
\IfLayerPageStyleExists{#1}{%
\def\scrlayer@current@pagestyle{#1}%
\FamilyExecuteOptions[.definelayerpagestyle]{KOMAarg}{#2}%
}{%
\scrlayer@lpm@error{#1}{modifying}%
}%
}
\RequirePackage{scrlfile}
\BeforePackage{tagpdf}{%
\let\scrlayer@beginartifact\relax
\let\scrlayer@endartifact\relax
}
\AfterPackage*{tagpdf}{%
\providecommand*{\scrlayer@beginartifact}[1]{%
\Ifstr{#1}{}{%
\tagmcbegin{artifact}%
}{%
\tagmcbegin{artifact=#1}%
}%
}%
\providecommand*{\scrlayer@endartifact}[1]{%
\tagmcend
}%
}
\providecommand*{\scrlayer@beginartifact}[1]{}
\providecommand*{\scrlayer@endartifact}[1]{}
\newcommand*{\DeclarePageStyleAlias}[2]{%
\edef\reserved@a{\GetRealPageStyle{#2}}%
\scr@ifundefinedorrelax{ps@\reserved@a}{%
\PackageError{scrlayer}{unknown real page style `#2'}{%
You've tried to declare an alias for page style `#2',\MessageBreak
but the real page style of `#2' is undefined.\MessageBreak
You can define aliases, only if the real page style has been
defined.\MessageBreak
If you'll continue, the declaration will be ignored.%
}%
\DestroyRealLayerPageStyle{#1}%
\DestroyLayerAlias{#1}%
}{%
\@namedef{@ps@#1@alias}{#2}%
\@namedef{ps@#1}{\pagestyle{\@nameuse{@ps@#1@alias}}}%
}%
}
\newcommand*{\DeclareNewPageStyleAlias}[1]{%
\@ifundefined{ps@#1}{}{%
\PackageError{scrlayer}{%
Page style `#1' already defined%
}{%
You may use \string\DeclareNewPageStyleAlias\space to declare a new
page style only\MessageBreak
if that page style hasn't been declared or defined before.\MessageBreak
You may use either \string\ProvidePageStyleAlias\space to declare the
page style only\MessageBreak
if it hasn't been declared or defined before, or
\string\RedeclarePageStyleAlias\MessageBreak
to overwrite the former declaration or definition of the page
style\MessageBreak
Nevertheless, if you'll continue, the page style will be
overwritten\MessageBreak
by the new alias.%
}%
}%
\DeclarePageStyleAlias{#1}%
}
\newcommand*{\ProvidePageStyleAlias}[2]{%
\@ifundefined{ps@#1}{%
\DeclarePageStyleAlias{#1}{#2}%
}{%
\PackageInfo{scrlayer}{%
\string\ProvidePageStyleAlias{#1}{#2} ignored,\MessageBreak
because page style `#1' already\MessageBreak
exists%
}%
}%
}
\newcommand*{\RedeclarePageStyleAlias}[1]{%
\@ifundefined{ps@#1}{%
\PackageError{scrlayer}{%
Page style `#1' not yet defined%
}{%
You may use \string\RedeclarePageStyleAlias\space to declare a page
style only\MessageBreak
if that page style has already been declared or defined.\MessageBreak
You may use either \string\DeclareNewPageStyleAlias,
\string\DeclarePageStyleAlias,\MessageBreak
or \string\ProvidePageStyleAlias\space to declare that not yet
defined page style.\MessageBreak
Nevertheless, if you'll continue, the page style will be declared.%
}%
}{}%
\DeclarePageStyleAlias{#1}%
}
\newcommand*{\DestroyPageStyleAlias}[1]{%
\scr@ifundefinedorrelax{@ps@#1@alias}{}{%
\expandafter\let\csname @ps@#1@alias\endcsname\relax
\expandafter\let\csname ps@#1\endcsname\relax
}%
}
\newcommand*{\GetRealPageStyle}[1]{%
\scr@ifundefinedorrelax{@ps@#1@alias}{#1}{%
\expandafter\GetRealPageStyle\expandafter{%
\expandafter\csname @ps@#1@alias\expandafter\endcsname\expandafter}%
}%
}
\newcommand*{\IfLayerPageStyleExists}[1]{%
\scr@ifundefinedorrelax{ps@#1}{%
\expandafter\@secondoftwo
}{%
\scr@ifundefinedorrelax{@ps@#1@layers}{%
\scr@ifundefinedorrelax{@ps@#1@alias}{%
\expandafter\@secondoftwo
}{%
\expandafter\IfLayerPageStyleExists\expandafter{%
\expandafter\csname @ps@#1@alias\expandafter\endcsname\expandafter}%
}%
}{%
\expandafter\@firstoftwo
}%
}%
}
\newcommand*{\IfRealLayerPageStyleExists}[1]{%
\scr@ifundefinedorrelax{ps@#1}{%
\expandafter\@secondoftwo
}{%
\scr@ifundefinedorrelax{@ps@#1@layers}{%
\expandafter\@secondoftwo
}{%
\expandafter\@firstoftwo
}%
}%
}
\newcommand*{\IfLayerAtPageStyle}[2]{%
\IfLayerPageStyleExists{#1}{%
\begingroup
\edef\reserved@a{\GetRealPageStyle{#1}}%
\@tempswafalse
\Ifstr{#2}{}{%
\expandafter\ifx\csname @ps@\reserved@a @layers\endcsname\@empty
\@tempswatrue
\fi
}{%
\expandafter\ForEachLayerOfPageStyle\expandafter{%
\reserved@a}{\Ifstr{##1}{#2}{\aftergroup\@tempswatrue}{}}%
}%
\if@tempswa \aftergroup\@firstoftwo \else \aftergroup\@secondoftwo \fi
\expandafter\endgroup
}{%
\scrlayer@lpm@error{#1}{testing for layers}%
\expandafter\@gobbletwo
}%
}
\newcommand*{\IfSomeLayersAtPageStyle}[2]{%
\IfLayerPageStyleExists{#1}{%
\begingroup
\@tempswafalse
\@for \reserved@a:=#2\do {%
\scr@trim@spaces\reserved@a
\edef\reserved@a{\noexpand\IfLayerAtPageStyle{#1}{\reserved@a}}%
\reserved@a{\@tempswatrue}{}%
}%
\if@tempswa \aftergroup\@firstoftwo \else \aftergroup\@secondoftwo \fi
\expandafter\endgroup
}{%
\scrlayer@lpm@error{#1}{testing for layers}%
\expandafter\@gobbletwo
}%
}
\newcommand*{\IfLayersAtPageStyle}[2]{%
\IfLayerPageStyleExists{#1}{%
\begingroup
\@tempswatrue
\Ifstr{#2}{}{%
\edef\reserved@a{\GetRealPageStyle{#1}}%
\expandafter\ifx\csname @scr@\reserved@a @layers\endcsname\@empty \else
\@tempswafalse
\fi
}{%
\@for \reserved@a:=#2\do {%
\scr@trim@spaces\reserved@a
\edef\reserved@a{\noexpand\IfLayerAtPageStyle{#1}{\reserved@a}}%
\reserved@a{}{\@tempswafalse}%
}%
}%
\if@tempswa \aftergroup\@firstoftwo \else \aftergroup\@secondoftwo \fi
\expandafter\endgroup
}{%
\scrlayer@lpm@error{#1}{testing for layers}%
\expandafter\@gobbletwo
}%
}
\newcommand*{\DestroyRealLayerPageStyle}[1]{%
\IfRealLayerPageStyleExists{#1}{%
\expandafter\let\csname @ps@#1@initialhook\endcsname\relax
\expandafter\let\csname @ps@#1@hook\endcsname\relax
\expandafter\let\csname @ps@#1@backgroundhook\endcsname\relax
\expandafter\let\csname @ps@#1@foregroundhook\endcsname\relax
\expandafter\let\csname @ps@#1@oddpagehook\endcsname\relax
\expandafter\let\csname @ps@#1@evenpagehook\endcsname\relax
\expandafter\let\csname @ps@#1@onesidehook\endcsname\relax
\expandafter\let\csname @ps@#1@twosidehook\endcsname\relax
\expandafter\let\csname @ps@#1@floatpagehook\endcsname\relax
\expandafter\let\csname @ps@#1@nonfloatpagehook\endcsname\relax
\expandafter\let\csname @ps@#1@layers\endcsname\relax
\expandafter\let\csname ps@#1\endcsname\relax
\Ifstr{\currentpagestyle}{#1}{%
\def\currentpagestyle{scrlayer@empty}%
\let\@oddhead\@empty\let\@evenhead\@empty
\let\@oddfoot\@empty\let\@evenfoot\@empty
}{}%
\if@specialpage
\Ifstr{\@specialstyle}{#1}{%
\global\let\@specialstyle\relax
\global\@specialpagefalse
}{}%
\fi
}{%
\PackageInfo{scrlayer}{%
\string\DestroyRealLayerPageStyle{#1} ignored,\MessageBreak
because the layer page style isn't\MessageBreak
defined (any longer)%
}%
}%
}
\newcommand*{\currentpagestyle}{}
\PackageInfo{scrlayer}{patching LaTeX kernel macro \string\pagestyle}
\def\reserved@a{%
\iftoplevelpagestyle\edef\toplevelpagestyle{##1}\toplevelpagestylefalse\fi
\scrlayer@exec@before@pagestyle@hook{##1}%
}
\expandafter\expandafter\expandafter\renewcommand
\expandafter\expandafter\expandafter*%
\expandafter\expandafter\expandafter\pagestyle
\expandafter\expandafter\expandafter[%
\expandafter\expandafter\expandafter1%
\expandafter\expandafter\expandafter]%
\expandafter\expandafter\expandafter{%
\expandafter\reserved@a
\pagestyle{#1}%
\edef\currentpagestyle{\GetRealPageStyle{#1}}%
\scrlayer@exec@after@pagestyle@hook{#1}%
\toplevelpagestyletrue
}
\newif\iftoplevelpagestyle\toplevelpagestyletrue
\AtBeginDocument{%
\begingroup
\let\scrlayer@exec@before@pagestyle@hook\@gobble
\let\scrlayer@exec@after@pagestyle@hook\@gobble
\def\ps@test{}%
\pagestyle{test}%
\Ifstr{\currentpagestyle}{test}{}{%
\PackageError{scrlayer}{package incompatibility detected}{%
Another package redefines \string\pagestyle\space incompatible with
scrlayer.\MessageBreak
This disables setting of \string\currentpagestyle\space and may
be serious.\MessageBreak
Maybe you could prevent this loading package scrlayer
later.\MessageBreak
If not you should either not use scrlayer or not the other
package,\MessageBreak
that redefines \string\pagestyle.%
}%
}%
\endgroup
}
\newcommand*{\BeforeSelectAnyPageStyle}[1]{%
\expandafter\renewcommand\expandafter*%
\expandafter\scrlayer@exec@before@pagestyle@hook
\expandafter[\expandafter1\expandafter]\expandafter{%
\scrlayer@exec@before@pagestyle@hook{##1}#1}%
}
\newcommand*{\scrlayer@exec@before@pagestyle@hook}[1]{}
\newcommand*{\AfterSelectAnyPageStyle}[1]{%
\expandafter\renewcommand\expandafter*%
\expandafter\scrlayer@exec@after@pagestyle@hook
\expandafter[\expandafter1\expandafter]\expandafter{%
\scrlayer@exec@after@pagestyle@hook{##1}#1}%
}
\newcommand*{\scrlayer@exec@after@pagestyle@hook}[1]{}
\newcommand*{\scrlayerAddToInterface}[2][\@currname.\@currext]{%
\scrlayer@report@deprecated{#1}{\scrlayerAddToInterface}%
\begingroup
\edef\reserve@a{%
\noexpand\scrlayerAddCsToInterface[#1]{\expandafter\@gobble\string #2}%
}%
\expandafter\endgroup\reserve@a
}
\newcommand{\scrlayerAddCsToInterface}[3][\@currname.\@currext]{%
\scrlayer@report@deprecated{#1}{\scrlayerAddCsToInterface}%
\@ifundefined{scrlayer@#1@commandlist}{%
\PackageError{scrlayer}{unkown interface `#1'}{%
I've been told to add a command sequence to an interface, that hasn't
been\MessageBreak
defined yet. Please initialise every interface using
\string\InitInterface\space before\MessageBreak
trying to add command sequences to it.\MessageBreak
If you'll continue, the command will be ignored.%
}%
}{%
\@ifundefined{#2}{%
\scrlayer@AddCsToInterface[#1]{#2}#3%
}{%
\@ifundefined{scrlayer@command@#2}{%
\ifscrlayer@forceoverwrite
\PackageWarning{scrlayer}{%
Overloading `\@backslashchar#2'!\MessageBreak
scrlayer detected, that the given command\MessageBreak
has been defined already, when\MessageBreak
`#1' tried to define it again.\MessageBreak
Nevertheless, while scrlayer is in force overwrite\MessageBreak
mode currently, the original definition will be\MessageBreak
removed%
}%
\expandafter\let\csname #2\endcsname\relax
\scrlayer@AddCsToInterface[#1]{#2}#3%
\else
\PackageError{scrlayer}{cannot define `\@backslashchar#2'}{%
scrlayer interface `#1' has tried to
define command\MessageBreak
`\@backslashchar#2', but this has already been defined\MessageBreak
and is not part of another interface. So it cannot be
defined.\MessageBreak
Before continuing you should solve this conflict.\MessageBreak
Nevertheless, you may use option `forceoverwrite' to get only a
warning instead\MessageBreak
of an error. But this wouldn't solve the problem at
all!\MessageBreak
This error is almost fatal, so you should abort the LaTeX
run.%
}%
\fi
}{%
\ifscrlayer@autoremoveinterfaces
\PackageInfo{scrlayer}{%
already define interface command\MessageBreak
`\@backslashchar#2' detected.\MessageBreak
Command has been defined by interface\MessageBreak
`\@nameuse{scrlayer@command@#2}'.\MessageBreak
To continue installation of interface\MessageBreak
`#1', interface\MessageBreak
`\@nameuse{scrlayer@command@#2}' will\MessageBreak
be removed%
}%
\@nameuse{scrlayer@\@nameuse{scrlayer@command@#2}@onremove}%
\begingroup
\def\@elt##1{%
\aftergroup\let\aftergroup##1\aftergroup\relax
}%
\@nameuse{scrlayer@\@nameuse{scrlayer@command@#2}@commandlist}%
\endgroup
\expandafter\let\csname
scrlayer@\@nameuse{scrlayer@command@#2}@commandlist\endcsname\relax
\expandafter\let\csname
scrlayer@\@nameuse{scrlayer@command@#2}@onremove\endcsname\relax
\expandafter\let\csname #2\endcsname\relax
\scrlayer@AddCsToInterface[#1]{#2}#3%
\else
\PackageError{scrlayer}{cannot define `\@backslashchar#2'}{%
Interface command `\@backslashchar#2' has already
been\MessageBreak
defined by interface
`\@nameuse{scrlayer@command@#2}'.\MessageBreak
So it cannot be defined again.\MessageBreak
You may try scrlayer option `autoremoveinterfaces' to
automatically remove\MessageBreak
older interfaces in such conflict situations.\MessageBreak
For now, it's recommended so solve the problem before you'll
continue.%
}%
\fi
}%
}%
}%
}%
\newcommand*\scrlayer@AddCsToInterface[2][\@currname.\@currext]{%
\scrlayer@report@deprecated{#1}{\scrlayer@AddCsToInterface}%
\expandafter\expandafter\expandafter\def\expandafter
\csname scrlayer@#1@commandlist\expandafter\expandafter\expandafter\endcsname
\expandafter\expandafter\expandafter{%
\csname scrlayer@#1@commandlist\expandafter\endcsname
\expandafter\@elt\csname #2\endcsname
}%
\@namedef{scrlayer@command@#2}{#1}%
}
\newcommand*{\scrlayerInitInterface}[1][\@currname.\@currext]{%
\scrlayer@report@deprecated{#1}{\scrlayerInitInterface}%
\@ifundefined{scrlayer@#1@commandlist}{%
\@namedef{scrlayer@#1@commandlist}{}%
}{%
\begingroup
\def\@elt##1{\space\space\string##1\MessageBreak}%
\PackageError{scrlayer}{interface `#1' already initialised}{%
You've tried to initialise scrlayer interface `#1',\MessageBreak
but an interface of this name has been initialised
already.\MessageBreak
Here's a list of all macros of the already initialised
interface:\MessageBreak
\@nameuse{scrlayer@#1@commandlist}.%
If you'll continue, this re-initialisation will be ignored.%
}%
\endgroup
}%
}
\newcommand*{\scrlayerOnAutoRemoveInterface}[2][\@currname.\@currext]{%
\scrlayer@report@deprecated{#1}{\scrlayerOnAutoRemoveInterface}%
\@ifundefined{scrlayer@#1@onremove}{\@namedef{scrlayer@#1@onremove}{}}{}%
\expandafter\l@addto@macro\csname scrlayer@#1@onremove\endcsname{#2}%
}
%%% From File: $Id: scrlayer.dtx 3533 2020-09-11 13:32:10Z kohm $
%%% (run: final)
\DeclareNewPageStyleByLayers{@everystyle@}{}
\RedeclarePageStyleByLayers{empty}{}
%%% From File: $Id: scrlogo.dtx 3527 2020-09-11 09:44:32Z kohm $
\@ifundefined{KOMAScript}{%
\DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em%
M\kern.05em A\kern.1em-\kern.1em Script}}}{}
\endinput
%%
%% End of file `scrlayer.sty'.
|