Debian Codegraph @

texmf-dist/source/latex/koma-script/scrlayer-scrpage.dtx

raw
1 % \iffalse^^A meta-comment
2 % ======================================================================
3 % scrlayer-scrpage.dtx
4 % Copyright (c) Markus Kohm, 2012-2025
5 %
6 % This file is part of the LaTeX2e KOMA-Script bundle.
7 %
8 % This work may be distributed and/or modified under the conditions of
9 % the LaTeX Project Public License, version 1.3c of the license.
10 % The latest version of this license is in
11 % http://www.latex-project.org/lppl.txt
12 % and version 1.3c or later is part of all distributions of LaTeX
13 % version 2005/12/01 and of this work.
14 %
15 % This work has the LPPL maintenance status "author-maintained".
16 %
17 % The Current Maintainer and author of this work is Markus Kohm.
18 %
19 % This work consists of all files listed in MANIFEST.md.
20 % ======================================================================
21 %%% From File: $Id: scrlayer-scrpage.dtx 4160 2025-06-04 11:53:33Z kohm $
22 %<identify>%%% (run: identify)
23 %<init>%%% (run: init)
24 %<options>%%% (run: options)
25 %<body>%%% (run: body)
26 %<*dtx>
27 \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
28 \begingroup
29 \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
30 \filedate$Date: 2025-06-04 13:53:33 +0200 (Mi, 04. Jun 2025) $
31 \def\filerevision$#1: #2 ${\gdef\filerevision{r#2}}
32 \filerevision$Revision: 4160 $
33 \edef\reserved@a{%
34 \noexpand\endgroup
35 \noexpand\ProvidesFile{scrlayer-scrpage.dtx}%
36 [\filedate\space\filerevision\space
37 KOMA-Script package source
38 }%
39 \reserved@a
40 %</dtx>
41 %<*identify>
42 %<interface>\NeedsTeXFormat{LaTeX2e}[2022/06/01]
43 %<interface>\ProvidesPackage{scrlayer-scrpage}[%
44 %!KOMAScriptVersion
45 %<interface> package
46 %</identify>
47 %<*dtx|identify>
48 (end user interface for scrlayer)]
49 %</dtx|identify>
50 %<*dtx>
51 \ifx\documentclass\undefined
52 \input scrdocstrip.tex
53 \@@input scrkernel-version.dtx
54 \@@input scrstrip.inc
55 \KOMAdefVariable{COPYRIGHTFROM}{2012}
56 \generate{\usepreamble\defaultpreamble
57 \file{scrlayer-scrpage.sty}{%
58 \from{scrlayer-scrpage.dtx}{interface,scrpage,identify}%
59 \from{scrlayer.dtx}{interface,scrpage,init}%
60 \from{scrlayer-scrpage.dtx}{interface,scrpage,init}%
61 \from{scrlayer.dtx}{interface,scrpage,options}%
62 \from{scrlayer-scrpage.dtx}{interface,scrpage,options}%
63 \from{scrlayer.dtx}{interface,scrpage,body}%
64 \from{scrlayer-scrpage.dtx}{interface,scrpage,body}%
65 \from{scrlogo.dtx}{logo}%
66 }%
67 }
68 \@@input scrstrop.inc
69 \else
70 \let\endbatchfile\relax
71 \fi
72 \endbatchfile
73 \documentclass[USenglish]{koma-script-source-doc}
74 \usepackage{babel}
75 \setcounter{StandardModuleDepth}{2}
76 % We need (foo,bar)
77 \DeclareRobustCommand*{\pparg}[2]{\texttt(\meta{#1}\texttt,\meta{#2}\texttt)}
78 % and {foo:bar}
79 \DeclareRobustCommand*{\mmarg}[2]{%
80 \texttt{\char`\{}\meta{#1}\texttt:\meta{#2}\texttt{\char`\}}}
81 \begin{document}
82 \DocInput{scrlayer-scrpage.dtx}
83 \end{document}
84 %</dtx>
85 % \fi^^A meta-comment
86 %
87 % \changes{v0.0}{2012/01/01}{start of interface}
88 % \changes{v3.32}{2020/09/11}{do not use deprecated interface commands}
89 % \changes{v3.36}{2022/02/09}{switch over from \cls*{scrdoc} to
90 % \cls*{koma-script-source-doc}}
91 % \changes{v3.36}{2022/02/09}{require package \pkg*{scrlogo} instead of
92 % defining \cs{KOMAScript}}
93 % \changes{v3.36}{2022/02/09}{whole implementation documentation in English}
94 % \changes{v3.40}{2023/04/17}{guide names changed}
95 %
96 % \GetFileInfo{scrlayer-scrpage.dtx}
97 % \title{The \texttt{scrlayer} Interface of
98 % \href{https://komascript.de}{\KOMAScript} Package \pkg*{scrlayer-scrpage}}
99 % \author{\href{mailto:[email protected]}{Markus Kohm}}
100 % \date{Revision \fileversion{} of \filedate}
101 % \maketitle
102 % \begin{abstract}
103 % This package defines several extensions above \pkg*{scrlayer} for easy
104 % handling of pairs of \emph{headings} and \emph{plain} page styles. So this
105 % widely is a replacement of the not any longer supported, former
106 % \KOMAScript{} package \pkg{scrpage2}.
107 % \end{abstract}
108 % \tableofcontents
109 %
110 % \section{User Manual}
111 %
112 % You can find the user manuals of \pkg*{scrlayer-scrpage} in the
113 % \KOMAScript{} manual, either the German \file{scrguide-de.pdf} or the
114 % English \file{scrguide-en.pdf}.
115 %
116 % \MaybeStop{\PrintIndex}
117 %
118 %
119 % \section{Implementation of \pkg*{scrlayer-scrpage}}
120 % \label{sec:scrlayer-scrpage}
121 %
122 % This section if for developers only.
123 %
124 % \begin{macrocode}
125 %<*interface>
126 % \end{macrocode}
127 %
128 %
129 % \subsection{Initialising some values before the options}
130 %
131 % \begin{macrocode}
132 %<*init>
133 % \end{macrocode}
134 %
135 % Initialisation before all options (even the options from
136 % \file{scrlayer.dtx}).
137 %
138 % Currently nothing to do.
139 %
140 % \begin{macrocode}
141 %</init>
142 % \end{macrocode}
143 %
144 %
145 % \subsection{Options}
146 %
147 % \begin{macrocode}
148 %<*options>
149 % \end{macrocode}
150 %
151 % Package \pkg{scrpage2} didn't support \KOMAScript{} options but only
152 % regular \LaTeX{} package options. This interface will also support those
153 % options, but uses \KOMAScript{} options for the implementation. This
154 % results in additional features of the interface.
155 %
156 % Note, that some options are already defined before this by the common option
157 % parts of \file{scrlayer.dtx}. All others will follow step by step in the
158 % main part.
159 %
160 % Options \opt{headinclude}, \opt{headexclude}, \opt{footinclude} and
161 % \opt{footexclude} of package \pkg{scrpage2} are deprecated since
162 % package version 2.3, 2008-12-08. They won't be supported by the
163 % \pkg*{scrlayer-scrpage} interface.
164 %
165 % Additional initialisation may be done here, but currently this isn't
166 % needed.
167 %
168 % \begin{macrocode}
169 %</options>
170 % \end{macrocode}
171 %
172 %
173 % \subsection{Width of header and footer}
174 %
175 % \pkg{scrpage2} provided commands \cs{setheadwidth} and \cs{setfootwidth} to
176 % set the width of the page head or footer different from the width of the
177 % text area of the page. Optionally those commands allow to setup an
178 % horizontal offset for the head or footer. This interface provides the same
179 % feature but prefers to set up the widths and offsets with \KOMAScript{}
180 % options. Those options will become the primary interface.
181 %
182 % \begin{option}{headwidth}
183 % \changes{v0.9.1757}{2014/04/09}{new: two offsets available}
184 % \changes{v3.17}{2015/02/25}{new: store the values}
185 % \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage
186 % commands removed}
187 % \begin{option}{footwidth}
188 % \changes{v0.9.1757}{2014/04/09}{new: two offsets available}
189 % \changes{v3.15}{2014/12/28}{fix: missing colon in call of
190 % \cs{sls@split@at@iicolons}}
191 % \changes{v3.17}{2015/02/25}{new: store the values}
192 % \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage
193 % commands removed}
194 % \begin{description}
195 % \item[\texttt{=\meta{special dimensional expression}:\meta{special
196 % dimensional expression}}:] see \cs{sls@settowidthof} for information about
197 % the syntax of \meta{special dimensional expression}. The width of the page
198 % head or footer will be set to the result of the first on, the offset to
199 % the result of the second one. If the first one\,---\,the width\,---\,is
200 % omitted, the current width will be used. If the second one\,---\,the
201 % offset\,---\,is omitted and the width is the width of the text area plus
202 % the margin note column, the offset will be set to zero. If the second one
203 % is omitted and the width is not the width of the text area plus the margin
204 % note column, a special kind of centering will be used.
205 % \end{description}
206 % These options may be used to set up the widths of head and foot.
207 % \begin{macrocode}
208 %<*options>
209 \KOMA@key{headwidth}{%
210 \begingroup
211 \sls@split@at@iicolons#1:::\@nil
212 \ifx\reserved@a\@empty \let\reserved@a\sls@headwidth\fi
213 \edef\reserved@a{%
214 \noexpand\endgroup
215 \noexpand\sls@set@hf@width{head}{\reserved@b}{\reserved@c}{\reserved@a}%
216 \noexpand\FamilyKeyStateProcessed
217 \noexpand\KOMA@kav@replacevalue{scrlayer-scrpage.sty}{headwidth}{%
218 \reserved@a:\reserved@b:\reserved@c
219 }%
220 }%
221 \reserved@a
222 }
223 \KOMA@key{footwidth}{%
224 \begingroup
225 \sls@split@at@iicolons#1:::\@nil
226 \ifx\reserved@a\@empty \let\reserved@a\sls@footwidth\fi
227 \edef\reserved@a{%
228 \noexpand\endgroup
229 \noexpand\sls@set@hf@width{foot}{\reserved@b}{\reserved@c}{\reserved@a}%
230 \noexpand\FamilyKeyStateProcessed
231 \noexpand\KOMA@kav@replacevalue{scrlayer-scrpage.sty}{footwidth}{%
232 \reserved@a:\reserved@b:\reserved@c
233 }%
234 }%
235 \reserved@a
236 }
237 % \end{macrocode}
238 % \begin{macro}{\sls@split@at@iicolons}
239 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
240 % \begin{description}
241 % \item[\texttt{\meta{balanced}:\meta{balanced}:\meta{balanced}\cs{@nil}}:]
242 % first \meta{balanced} will be stored into \cs{reserved@a}, second into
243 % \cs{reserved@b}, third will be eaten and warn about if it is neither empty
244 % and nor a colon.
245 % \end{description}
246 % This little helper is used, e.g., by options \opt{headwidth} and
247 % \opt{footwidth}.
248 % \begin{macrocode}
249 \newcommand\sls@split@at@iicolons{}
250 \def\sls@split@at@iicolons#1:#2:#3:#4\@nil{%
251 \Ifstr{#4}{}{}{%
252 \Ifstr{#4}{:}{}{%
253 \Ifstr{#4}{::}{}{%
254 \PackageWarning{scrlayer}{extra `:' found!\MessageBreak
255 You've used more than two colons at the argument\MessageBreak
256 of a two value option.\MessageBreak
257 The extra value(s) will be ignored%
258 }%
259 }%
260 }%
261 }%
262 \def\reserved@a{#1}%
263 \def\reserved@b{#2}%
264 \def\reserved@c{#3}%
265 }%
266 % \end{macrocode}
267 % \end{macro}^^A \sls@split@at@iicolons
268 % \begin{macro}{\sls@set@hf@width}
269 % \changes{v0.9.1757}{2014/04/09}{new: two offsets available}
270 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
271 % \begin{description}
272 % \item[\marg{head or foot}:] to complete the macro names for page head or
273 % footer, either \texttt{head} or \texttt{foot}.
274 % \item[\marg{special dimensional expression}:] the offset odd page
275 % \item[\marg{special dimensional expression}:] the offset even page
276 % \item[\marg{special dimensional expression}:] the width
277 % \end{description}
278 % This helper will generally set up width an offset of either head or footer.
279 % \begin{macrocode}
280 \newcommand*{\sls@set@hf@width}[4]{%
281 \sls@settowidthof{\@tempdima}{#4}%
282 \ifdim\@tempdima>\paperwidth
283 \PackageWarning
284 {scrlayer-scrpage}%
285 {You've set width of #1 to a value\MessageBreak
286 greater than width of page!\MessageBreak%
287 I'll reduce width of #1 to width of page}%
288 \setlength{\@tempdima}{\paperwidth}%
289 \else
290 \ifdim\@tempdima<\z@
291 \PackageWarning
292 {scrlayer-scrpage}%
293 {You've set width of #1 to negative value!\MessageBreak%
294 I'll set it to 0pt}%
295 \setlength{\@tempdima}{\z@}%
296 \fi
297 \fi
298 \expandafter\edef\csname sls@#1width\endcsname{\the\@tempdima}%
299 \setlength{\@tempdima}{\textwidth}%
300 \addtolength{\@tempdima}{-\csname sls@#1width\endcsname}%
301 \Ifstr{#2}{}{%
302 \ifdim \csname sls@#1width\endcsname
303 = \dimexpr \textwidth+\marginparwidth+\marginparsep\relax
304 % \end{macrocode}
305 % \changes{3.39}{2023/02/02}{offset depends on \cs{reversemarginpar}}
306 % \begin{macrocode}
307 \if@reversemargin
308 \setlength{\@tempdimb}{-\dimexpr \marginparwidth+\marginparsep\relax}%
309 \else
310 \setlength{\@tempdimb}{\z@}%
311 \fi
312 \else
313 \if@twoside
314 \setlength{\@tempdimb}{.3333333333\@tempdima}%
315 \else
316 \setlength{\@tempdimb}{.5\@tempdima}%
317 \fi
318 \fi
319 }{%
320 \sls@settowidthof{\@tempdimb}{#2}%
321 }%
322 \Ifstr{#3}{}{%
323 \addtolength{\@tempdima}{-\@tempdimb}%
324 }{%
325 \sls@settowidthof{\@tempdima}{#3}%
326 \setlength{\@tempdima}{-\@tempdima}%
327 }%
328 \ifdim\@tempdimb<\z@
329 \setlength{\@tempdimb}{-\@tempdimb}%
330 \expandafter\edef\csname sls@odd#1shift\endcsname{-\the\@tempdimb}%
331 \else
332 \expandafter\edef\csname sls@odd#1shift\endcsname{\the\@tempdimb}%
333 \fi
334 \ifdim\@tempdima<\z@
335 \setlength{\@tempdima}{-\@tempdima}%
336 \expandafter\edef\csname sls@even#1shift\endcsname{-\the\@tempdima}%
337 \else
338 \expandafter\edef\csname sls@even#1shift\endcsname{\the\@tempdima}%
339 \fi
340 }%
341 % \end{macrocode}
342 % \end{macro}^^A \sls@set@hf@width
343 % \begin{macro}{\sls@headwidth,\sls@oddheadshift,\sls@evenheadshift,
344 % \sls@footwidth,\sls@oddfootshift,\sls@evenfootshift}
345 % \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage
346 % commands removed}
347 % To store width and offset of page head an footer, we use macros. Those are
348 % also used by the options and therefore need to be initialised before option
349 % usage.
350 % \begin{macrocode}
351 \scr@ifundefinedorrelax{@headwidth}{%
352 \newcommand*{\sls@headwidth}{\textwidth}%
353 \KOMA@kav@add{scrlayer-scrpage.sty}{headwidth}{\textwidth:0pt:0pt}%
354 }{%
355 \newcommand*{\sls@headwidth}{\@headwidth}%
356 \KOMA@kav@xadd{scrlayer-scrpage.sty}{headwidth}{\@headwidth:0pt:0pt}%
357 }%
358 \newcommand*{\sls@oddheadshift}{0pt}
359 \newcommand*{\sls@evenheadshift}{0pt}
360 \scr@ifundefinedorrelax{@footwidth}{%
361 \newcommand*{\sls@footwidth}{\textwidth}%
362 \KOMA@kav@add{scrlayer-scrpage.sty}{footwidth}{\textwidth:0pt:0pt}
363 }{%
364 \newcommand*{\sls@footwidth}{\@footwidth}%
365 \KOMA@kav@xadd{scrlayer-scrpage.sty}{footwidth}{\@footwidth:0pt:0pt}
366 }%
367 \newcommand*{\sls@oddfootshift}{0pt}
368 \newcommand*{\sls@evenfootshift}{0pt}
369 % \end{macrocode}
370 % \end{macro}^^A \sls@headwidth … \sls@evenfootshift
371 %
372 % \begin{macro}{\sls@settowidthof,\sls@deftowidthof}
373 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
374 % the special dimensional expressions may be either one of the strings
375 % \texttt{paper}, \texttt{text}, \texttt{marginpar},
376 % \texttt{textwithmarginpar}, \texttt{head}, \texttt{foot},
377 % \texttt{headtopline}, \texttt{headsepline}, \texttt{footsepline},
378 % \texttt{footbotline}, or \texttt{page} or a valid dimensional
379 % expression. But it cannot be both a dimensional expression using symbolic
380 % values!
381 % \begin{macrocode}
382 \newcommand*{\sls@settowidthof}[2]{%
383 \Ifstr{#2}{paper}{%
384 \setlength{#1}{\paperwidth}%
385 }{%
386 \Ifstr{#2}{text}{%
387 \setlength{#1}{\textwidth}%
388 }{%
389 \Ifstr{#2}{marginpar}{%
390 \setlength{#1}{\dimexpr \marginparwidth+\marginparsep\relax}%
391 }{%
392 \Ifstr{#2}{textwithmarginpar}{%
393 \setlength{#1}{\dimexpr\textwidth
394 +\marginparwidth
395 +\marginparsep\relax}%
396 }{%
397 \Ifstr{#2}{head}{%
398 \setlength{#1}{\sls@headwidth}%
399 }{%
400 \Ifstr{#2}{foot}{%
401 \setlength{#1}{\sls@footwidth}%
402 }{%
403 \Ifstr{#2}{headtopline}{%
404 \setlength{#1}{\sls@headabove@linelength}%
405 }{%
406 \Ifstr{#2}{headsepline}{%
407 \setlength{#1}{\sls@headbelow@linelength}%
408 }{%
409 \Ifstr{#2}{footsepline}{%
410 \setlength{#1}{\sls@footabove@linelength}%
411 }{%
412 \Ifstr{#2}{footbotline}{%
413 \setlength{#1}{\sls@footbelow@linelength}%
414 }{%
415 \Ifstr{#2}{page}{%
416 \setlength{#1}{\paperwidth}%
417 \begingroup
418 \expandafter\expandafter\expandafter\endgroup
419 \expandafter\ifx\csname ta@bcor\endcsname\relax\else
420 \addtolength{#1}{-\ta@bcor}%
421 \fi
422 }{%
423 \setlength{#1}{\dimexpr #2\relax}%
424 }%
425 }%
426 }%
427 }%
428 }%
429 }%
430 }%
431 }%
432 }%
433 }%
434 }%
435 }%
436 \newcommand*{\sls@deftowidthof}[2]{%
437 \Ifstr{#2}{autohead}{%
438 \expandafter\def\csname #1\endcsname{\sls@headwidth}%
439 }{%
440 \Ifstr{#2}{autofoot}{%
441 \expandafter\def\csname #1\endcsname{\sls@footwidth}%
442 }{%
443 \sls@settowidthof{\@tempdima}{#2}%
444 \expandafter\edef\csname #1\endcsname{\the\@tempdima}%
445 }%
446 }%
447 }%
448 %</options>
449 % \end{macrocode}
450 % \end{macro}^^A \sls@deftowidthof,\sls@settowidthof
451 % \end{option}^^A footwidth
452 % \end{option}^^A footheight
453 %
454 % \begin{command}{\setheadwidth,\setfootwidth}
455 % \changes{v3.36}{2022/02/09}{warning about deprecated command}
456 % For compatibility with \pkg{scrpage2}, map the commands to the options:
457 % \begin{macrocode}
458 %<*body>
459 \newcommand*{\setheadwidth}[2][]{%
460 \PackageWarning{scrlayer-scrpage}{%
461 Command `\string\setheadwidth' is deprecated.\MessageBreak
462 I'm using \detokenize{\KOMAoptions{headwidth=#2:#1}} instead,\MessageBreak
463 and so should you do}%
464 \KOMAoptions{headwidth=#2:#1}%
465 }%
466 \newcommand*{\setfootwidth}[2][]{%
467 \PackageWarning{scrlayer-scrpage}{%
468 Command `\string\setfootwidth' is deprecated.\MessageBreak
469 I'm using \detokenize{\KOMAoptions{footwidth=#2:#1}} instead,\MessageBreak
470 and so should you do}%
471 \KOMAoptions{footwidth=#2:#1}%
472 }%
473 %</body>
474 % \end{macrocode}
475 % \end{command}^^A \setheadwidth,\setfootwidth
476 %
477 %
478 % \subsection{Lines in page head and footer}
479 %
480 % The interface implements the options \opt{headtopline}, \opt{headsepline},
481 % \opt{footsepline}, \opt{footbotline}, \opt{plainheadtopline},
482 % \opt{plainheadsepline}, \opt{plainfootsepline}, \opt{plainfootbotline},
483 % \opt{ilines}, \opt{clines}, and \opt{olines}, the commands
484 % \cs{setheadtopline}, \cs{setheadsepline}, \cs{setfootsepline}, and
485 % \cs{setfootbotline}, and the corresponding \KOMAScript{} font elements of
486 % package \pkg{scrpage2}. Some of the options are extended to understand
487 % values.
488 %
489 % \begin{option}{headtopline,headsepline,footsepline,footbotline}
490 % \changes{v3.17}{2015/02/25}{new: store the values}
491 % \begin{description}
492 % \item[{\texttt{=\meta{dimensional expression}:\meta{dimensional
493 % expression}}:}]
494 % \end{description}\noindent
495 % Define thickness and length of the a default separation line between:
496 % \begin{description}
497 % \item[\opt{headtopline}:] the top margin of the page and the page head.
498 % \item[\opt{headsepline}:] the page head and the text area.
499 % \item[\opt{footsepline}:] the text area and the page footer.
500 % \item[\opt{footbotline}:] the page footer and the bottom margin.
501 % \end{description}
502 % Both \meta{dimensional expression} values may be omitted. In that case
503 % thickness would be 0.4\,pt, and length would be the width of the page head
504 % or footer. If the second argument, the length, has been omitted the
505 % \texttt{:} may also be omitted.
506 % \begin{macrocode}
507 %<*options>
508 \KOMA@key{headtopline}[:]{%
509 \sls@set@values[headtopline]{head}{above}{#1}%
510 }
511 \KOMA@key{headsepline}[:]{%
512 \sls@set@values[headsepline]{head}{below}{#1}%
513 }
514 \KOMA@key{footsepline}[:]{%
515 \sls@set@values[footsepline]{foot}{above}{#1}%
516 }
517 \KOMA@key{footbotline}[:]{%
518 \sls@set@values[footbotline]{foot}{below}{#1}%
519 }
520 % \end{macrocode}
521 % \begin{macro}{\sls@set@values}
522 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
523 % \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage
524 % commands removed}
525 % \begin{description}
526 % \item[\oarg{option name}:] either empty or the name of the option that sets
527 % the line,
528 % \item[\marg{head or foot}:] either \texttt{head} or \texttt{foot},
529 % \item[\marg{above or below}:] either \texttt{above} or \texttt{below},
530 % \item[\mmarg{dimension expression}{dimension expression}:] length an
531 % thickness of a line (both are optional).
532 % \end{description}
533 % Helper macros for the options to set two macros by two values of one
534 % option. The two values are separated by a colon.
535 % \begin{macrocode}
536 \newcommand*{\sls@set@values}[4][]{%
537 \begingroup
538 \Ifstr{#1}{}{%
539 \FamilyKeyStateUnknown
540 }{%
541 \KOMA@set@ifkey{#1}{@tempswa}{#4}%
542 }%
543 \ifx\FamilyKeyState\FamilyKeyStateProcessed
544 \if@tempswa
545 \edef\reserved@b{%
546 \noexpand\endgroup
547 \noexpand\@namedef{sls@#2#3@linethickness}{.4pt}%
548 \noexpand\@namedef{sls@#2#3@linelength}{%
549 \expandafter\noexpand\csname sls@#2width\endcsname
550 }%
551 }%
552 \else
553 \def\reserved@b{%
554 \endgroup
555 \@namedef{sls@#2#3@linethickness}{0pt}%
556 \@namedef{sls@#2#3@linelength}{0pt}%
557 }%
558 \fi
559 \else
560 \let\reserved@a\@empty
561 \let\reserved@b\@empty
562 \sls@split@at@colon#4::\@nil
563 \ifx\reserved@a\@empty
564 \def\reserved@a{\endgroup\@namedef{sls@#2#3@linethickness}{.4pt}}%
565 \else
566 \setlength{\@tempdima}{\dimexpr\reserved@a\relax}%
567 \edef\reserved@a{%
568 \noexpand\endgroup
569 \noexpand\@namedef{sls@#2#3@linethickness}{\the\@tempdima}%
570 }%
571 \fi
572 \ifx\reserved@b\@empty
573 \def\reserved@b{%
574 \reserved@a
575 \@namedef{sls@#2#3@linelength}{\@nameuse{sls@#2width}}%
576 }%
577 \else
578 \edef\reserved@b{%
579 \noexpand\reserved@a
580 \noexpand\sls@deftowidthof{sls@#2#3@linelength}{\reserved@b}%
581 }%
582 \fi
583 \fi
584 \reserved@b
585 \FamilyKeyStateProcessed
586 \Ifstr{#1}{}{}{%
587 \KOMA@kav@xreplacevalue{scrlayer-scrpage.sty}{#1}{%
588 \csname sls@#2#3@linethickness\endcsname
589 :\csname sls@#2#3@linelength\endcsname
590 }%
591 }%
592 }%
593 % \end{macrocode}
594 % \end{macro}^^A \sls@set@values
595 % \begin{macro}{\sls@split@at@colon}
596 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
597 % \begin{description}
598 % \item[\texttt{\meta{balanced}:\meta{balanced}:\meta{balanced}\cs{@nil}}:]
599 % first \meta{balanced} will be stored into \cs{reserved@a}, second into
600 % \cs{reserved@b}, third will be eaten and warn about if it is neither empty
601 % and nor a colon.
602 % \end{description}
603 % This little helper is used, e.g., by options \opt{headwidth} and
604 % \opt{footwidth}.
605 % \begin{macrocode}
606 \newcommand*{\sls@split@at@colon}{}
607 \def\sls@split@at@colon#1:#2:#3\@nil{%
608 \Ifstr{#3}{}{}{%
609 \Ifstr{#3}{:}{}{%
610 \PackageWarning{scrlayer}{extra `:' found!\MessageBreak
611 You've used more than one colon at the argument\MessageBreak
612 of a two value option.\MessageBreak
613 The extra value(s) will be ignored%
614 }%
615 }%
616 }%
617 \def\reserved@a{#1}%
618 \def\reserved@b{#2}%
619 }%
620 % \end{macrocode}
621 % \end{macro}^^A \sls@split@at@colon
622 % \begin{macro}{\sls@headabove@linelength,\sls@headabove@linethickness,
623 % \sls@headbelow@linelength,\sls@headbelow@linethickness,
624 % \sls@footabove@linelength,\sls@footabove@linethickness,
625 % \sls@footbelow@linelength,\sls@footbelow@linethickness}
626 % \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage
627 % commands removed}
628 % To store length and thickness of the lines at the page head an footer, we
629 % use macros. Those are also used by the options and therefore need to be
630 % initialised before option usage.
631 % \begin{macrocode}
632 \newcommand*{\sls@headabove@linelength}{\sls@headwidth}%
633 \newcommand*{\sls@headabove@linethickness}{0pt}%
634 \KOMA@kav@xadd{scrlayer-scrpage.sty}{headtopline}{%
635 \expandafter\noexpand\sls@headabove@linethickness:%
636 \expandafter\noexpand\sls@headabove@linelength
637 }
638 \newcommand*{\sls@headbelow@linelength}{\sls@headwidth}%
639 \newcommand*{\sls@headbelow@linethickness}{0pt}%
640 \KOMA@kav@xadd{scrlayer-scrpage.sty}{headsepline}{%
641 \expandafter\noexpand\sls@headbelow@linethickness:%
642 \expandafter\noexpand\sls@headbelow@linelength
643 }
644 \newcommand*{\sls@footabove@linelength}{\sls@footwidth}%
645 \newcommand*{\sls@footabove@linethickness}{0pt}%
646 \KOMA@kav@xadd{scrlayer-scrpage.sty}{footsepline}{%
647 \expandafter\noexpand\sls@footabove@linethickness:%
648 \expandafter\noexpand\sls@footabove@linelength
649 }
650 \newcommand*{\sls@footbelow@linelength}{\sls@footwidth}%
651 \newcommand*{\sls@footbelow@linethickness}{0pt}%
652 \KOMA@kav@xadd{scrlayer-scrpage.sty}{footbotline}{%
653 \expandafter\noexpand\sls@footbelow@linethickness:%
654 \expandafter\noexpand\sls@footbelow@linelength
655 }
656 %</options>
657 % \end{macrocode}
658 % \end{macro}^^A \sls@headabove@linelength … \sls@footbelow@linethickness
659 % \end{option}^^A headtopline … footbotline
660 %
661 % \begin{option}{plainheadtopline,plainheadsepline,
662 % plainfootsepline,plainfootbotline}
663 % \begin{macro}{\ifsls@plain@head@above@line,\sls@plain@head@above@linetrue,
664 % \sls@plain@head@above@linefalse,
665 % \ifsls@plain@head@below@line,\sls@plain@head@below@linetrue,
666 % \sls@plain@head@below@linefalse,
667 % \ifsls@plain@foot@above@line,\sls@plain@foot@above@linetrue,
668 % \sls@plain@foot@above@linefalse,
669 % \ifsls@plain@foot@below@line,\sls@plain@foot@below@linetrue,
670 % \sls@plain@foot@below@linefalse}
671 % \begin{description}
672 % \item[\texttt{=\meta{switch value}}:]
673 % \end{description}\noindent
674 % While these only switches the rule on or off, we need only some switches.
675 % \begin{macrocode}
676 %<*options>
677 \KOMA@ifkey{plainheadtopline}{sls@plain@head@above@line}%
678 \KOMA@ifkey{plainheadsepline}{sls@plain@head@below@line}%
679 \KOMA@ifkey{plainfootsepline}{sls@plain@foot@above@line}%
680 \KOMA@ifkey{plainfootbotline}{sls@plain@foot@below@line}%
681 %</options>
682 % \end{macrocode}
683 % \end{macro}^^A \ifsls@plain@foot@below@line … \sls@plain@foot@below@linefalse
684 % \end{option}^^A plainheadtopline … plainfootbotline
685 %
686 % \begin{option}{ilines,clines,olines}
687 % \changes{v3.17}{2015/02/25}{storing values}
688 % \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage
689 % commands removed}
690 % \begin{macro}{\sls@hfline@adjust}
691 % Maybe it would be more useful to be able to adjust each line on its own or
692 % at most to define an offset. But \pkg{scrpage2} supports only these
693 % options. At least we can set the options inside a layer or page style. This
694 % may help.
695 % \begin{macrocode}
696 %<*options>
697 \newcommand*{\sls@hfline@adjust}{0}%
698 \KOMA@kav@add{scrlayer-scrpage.sty}{ilines}{}
699 \KOMA@key{ilines}[]{%
700 \ifx\relax#1\relax
701 \renewcommand*{\sls@hfline@adjust}{0}%
702 \FamilyKeyStateProcessed
703 \KOMA@kav@removekey{scrlayer-scrpage.sty}{ilines}%
704 \KOMA@kav@removekey{scrlayer-scrpage.sty}{clines}%
705 \KOMA@kav@removekey{scrlayer-scrpage.sty}{olines}%
706 \KOMA@kav@add{scrlayer-scrpage.sty}{ilines}{}%
707 \else
708 \def\FamilyKeyStateProcessed{unexpected value}%
709 \fi
710 }
711 \KOMA@key{clines}[]{%
712 \ifx\relax#1\relax
713 \renewcommand*{\sls@hfline@adjust}{1}%
714 \FamilyKeyStateProcessed
715 \KOMA@kav@removekey{scrlayer-scrpage.sty}{ilines}%
716 \KOMA@kav@removekey{scrlayer-scrpage.sty}{clines}%
717 \KOMA@kav@removekey{scrlayer-scrpage.sty}{olines}%
718 \KOMA@kav@add{scrlayer-scrpage.sty}{clines}{}%
719 \else
720 \def\FamilyKeyStateProcessed{unexpected value}%
721 \fi
722 }
723 \KOMA@key{olines}[]{%
724 \ifx\relax#1\relax
725 \renewcommand*{\sls@hfline@adjust}{2}%
726 \FamilyKeyStateProcessed
727 \KOMA@kav@removekey{scrlayer-scrpage.sty}{ilines}%
728 \KOMA@kav@removekey{scrlayer-scrpage.sty}{clines}%
729 \KOMA@kav@removekey{scrlayer-scrpage.sty}{olines}%
730 \KOMA@kav@add{scrlayer-scrpage.sty}{olines}{}%
731 \else
732 \def\FamilyKeyStateProcessed{unexpected value}%
733 \fi
734 }
735 \KOMA@kav@add{scrlayer-scrpage.sty}{ilines}{}
736 %</options>
737 % \end{macrocode}
738 % \end{macro}^^A \sls@hfline@adjust
739 % \end{option}^^A ilines … olines
740 %
741 % \begin{command}{\setheadtopline,\setheadsepline,
742 % \setfootsepline,\setfootbotline}
743 % \begin{description}
744 % \item[\oarg{extended dimensional expression}:] the length of the line; if
745 % omitted the length will use the width of the page head or footer while
746 % printing the line.
747 % \item[\marg{dimensional expression}:] the thickness of the line.
748 % \item[\oarg{code}:] the font selection code for the line. You may use it for
749 % any kind of operation, that doesn't change the position, width, height, or
750 % depth, e.g., to change the colour of the line.
751 % \end{description}
752 % \begin{macrocode}
753 %<*body>
754 \newcommand*{\setheadtopline}{\sls@setline{head}{above}}%
755 \newcommand*{\setheadsepline}{\sls@setline{head}{below}}%
756 \newcommand*{\setfootsepline}{\sls@setline{foot}{above}}%
757 \newcommand*{\setfootbotline}{\sls@setline{foot}{below}}%
758 % \end{macrocode}
759 % \begin{macro}{\sls@setline}
760 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
761 % \cs{kernel@ifnextchar}}
762 % \begin{macro}{\sls@@setline}
763 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
764 % \begin{macro}{\sls@@@setline}
765 % \changes{v3.17}[2015/02/27]{internal use of the corresponding options}
766 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
767 % \cs{kernel@ifnextchar}}
768 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
769 % \changes{v3.39}{2022/11/11}{initial dot in member argument of
770 % \cs{KOMAExecuteOptions} removed}
771 % \begin{macro}{\sls@@@@setline}
772 % \changes{v3.18}{2015/06/17}{explicit reuse of the current length}
773 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
774 % Helper to set up the line attributes processing the parameters of the
775 % commands above.
776 % \begin{macrocode}
777 \newcommand*\sls@setline[2]{%
778 \kernel@ifnextchar[%]
779 {\sls@@setline{#1}{#2}}{\sls@@@setline{#1#2}}%
780 }%
781 \newcommand*{\sls@@setline}{}
782 \def\sls@@setline#1#2[#3]{%
783 \Ifstr{#3}{auto}{%
784 \sls@deftowidthof{sls@#1#2@linelength}{#3#1}%
785 }{%
786 \sls@deftowidthof{sls@#1#2@linelength}{#3}%
787 }%
788 \sls@@@setline{#1#2}%
789 }%
790 \newcommand*{\sls@@@setline}[2]{%
791 \edef\@tempa{#2}\edef\@tempb{current}%
792 \Ifstr{#2}{}{}{%
793 \Ifstr{#2}{current}{}{%
794 \setlength{\@tempdima}{#2}%
795 \Ifstr{#1}{headabove}{%
796 \KOMAExecuteOptions[scrlayer-scrpage.sty]%
797 {headtopline=\@tempdima:\csname sls@#1@linelength\endcsname}%
798 }{\Ifstr{#1}{headbelow}{%
799 \KOMAExecuteOptions[scrlayer-scrpage.sty]%
800 {headsepline=\@tempdima:\csname sls@#1@linelength\endcsname}%
801 }{%
802 \Ifstr{#1}{footabove}{%
803 \KOMAExecuteOptions[scrlayer-scrpage.sty]%
804 {footsepline=\@tempdima:\csname sls@#1@linelength\endcsname}%
805 }{%
806 \KOMAExecuteOptions[scrlayer-scrpage.sty]%
807 {footbotline=\@tempdima:\csname sls@#1@linelength\endcsname}%
808 }%
809 }%
810 }%
811 }%
812 }%
813 \PackageWarning{scrlayer-scrpage}{%
814 Command deprecated!\MessageBreak
815 Usage of `\string\setheadtopline',
816 `\string\setheadsepline',\MessageBreak
817 `\string\setfootsepline', and `\string\setfootbotline'\MessageBreak
818 became deprecated with scrlayer-scrpage.\MessageBreak
819 You should use KOMA-Script options\MessageBreak
820 `headsepline', `headtopline', `footsepline',\MessageBreak
821 or `footbotline' with values\MessageBreak
822 `<line thickness>:<line length>' to setup\MessageBreak
823 the line length and thickness, and\MessageBreak
824 `\string\setkomafont' or `\string\addtokomafont' to\MessageBreak
825 setup the colour%
826 }%
827 \kernel@ifnextchar[%]
828 {%
829 \sls@@@@setline{#1}%
830 }{%
831 }%
832 }%
833 \newcommand*{\sls@@@@setline}{}
834 \def\sls@@@@setline#1[#2]{%
835 \Ifstr{#1}{headabove}{\setkomafont{headtopline}{#2}}{%
836 \Ifstr{#1}{headbelow}{\setkomafont{headsepline}{#2}}{%
837 \Ifstr{#1}{footabove}{\setkomafont{footsepline}{#2}}{%
838 \setkomafont{footbotline}{#2}%
839 }%
840 }%
841 }%
842 }%
843 % \end{macrocode}
844 % \end{macro}^^A \sls@setline
845 % \end{macro}^^A \sls@@setline
846 % \end{macro}^^A \sls@@@setline
847 % \end{macro}^^A \sls@@@@setline
848 % \begin{fontelement}{headtopline,headsepline,footsepline,footbotline}
849 % These are the font elements used in \cs{sls@hf@rule} to set the rules
850 % with, i.e., another colour. Note, that those may already be defined and
851 % become only part of the interface if they are not.
852 % \begin{macrocode}
853 \@ifundefined{scr@fnt@headtopline}{%
854 \newkomafont{headtopline}{}%
855 }{}
856 \@ifundefined{scr@fnt@headsepline}{%
857 \newkomafont{headsepline}{}%
858 }{}
859 \@ifundefined{scr@fnt@footsepline}{%
860 \newkomafont{footsepline}{}%
861 }{}
862 \@ifundefined{scr@fnt@footbotline}{%
863 \newkomafont{footbotline}{}%
864 }{}
865 %</body>
866 % \end{macrocode}
867 % \end{fontelement}^^A headtopline … footbotline
868 % \end{command}^^A \setheadtopline … \setfootbotline
869 %
870 % \begin{length}{\headheight,\footheight}
871 % \changes{v3.24}{2017/05/22}{warning depends on option \opt{singlespacing}}
872 % Some classes set \len{headheight} to a very, very small value. We'll
873 % warn about that.
874 % \changes{v3.24}{2017/05/23}{also warn for low \cs{footheight}}
875 % If the \len{headheight} is OK, we also test for \len{footheight}.
876 % \begin{macrocode}
877 %<*body>
878 \AtBeginDocument{%
879 \ifdim \headheight
880 <\if@ps@singlespacing\f@baselineskip\else\baselineskip\fi\relax
881 \PackageWarningNoLine{scrlayer-scrpage}{Very small head height
882 detected!\MessageBreak
883 Using scrlayer-scrpage the head height\MessageBreak
884 should be at least \string\baselineskip, which is\MessageBreak
885 \if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi\space
886 currently.\MessageBreak
887 But head height is currently
888 \the\headheight\space only.\MessageBreak
889 You may use\MessageBreak
890 \IfPackageLoadedTF{geometry}{%
891 geometry option
892 `head=\if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi'%
893 }{%
894 \IfPackageLoadedTF{typearea}{%
895 typearea option `headheight=%
896 \if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi'%
897 }{%
898 \string\setlength{\string\headheight}%
899 {\if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi}%
900 }%
901 }\MessageBreak
902 \if@ps@singlespacing\else\ifdim \headheight<\f@baselineskip\else
903 or load package `scrlayer-scrpage' with\MessageBreak
904 option `singlespacing=true'\MessageBreak
905 \fi\fi
906 to avoid this warning%
907 }%
908 \else
909 \ifdim \footheight
910 <\if@ps@singlespacing\f@baselineskip\else\baselineskip\fi\relax
911 \PackageWarningNoLine{scrlayer-scrpage}{Very small foot height
912 detected!\MessageBreak
913 Using scrlayer-scrpage the foot height\MessageBreak
914 should be at least \string\baselineskip, which is\MessageBreak
915 \if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi\space
916 currently.\MessageBreak
917 But foot height is currently
918 \the\footheight\space only.\MessageBreak
919 You may use\MessageBreak
920 \IfPackageLoadedTF{typearea}{%
921 typearea option `footheight=%
922 \if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi'%
923 }{%
924 \string\setlength{\string\footheight}%
925 {\if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi}%
926 }%
927 \MessageBreak
928 \if@ps@singlespacing\else\ifdim \footheight<\f@baselineskip\else
929 or load package `scrlayer-scrpage' with\MessageBreak
930 option `singlespacing=true'\MessageBreak
931 \fi\fi
932 to avoid this warning%
933 }%
934 \fi
935 \fi
936 }
937 %</body>
938 % \end{macrocode}
939 % \end{length}^^A \headheight,\footheight
940 %
941 %
942 % \subsection{Usual \LaTeX{} kernel commands}
943 %
944 % \pkg*{scrlayer-scrpage} uses some very usual \LaTeX{} kernel commands, that
945 % should really behave like the original \LaTeX{} kernel commands do. But some
946 % packages redefine them without restoring them in the output routine before
947 % the page head and foot is build. Such a redefinition could break
948 % \pkg*{scrlayer-scrpage} or even provoke errors. Here we try to make sure,
949 % that \pkg*{scrlayer-scrpage} uses the correct definitions. Note: This should
950 % not be needed, if other packages would be more careful.
951 %
952 % \begin{command}{\LaTeXcentering,\LaTeXraggedright,\LaTeXraggedleft}
953 % \changes{v3.27}{2019/04/05}{added}
954 % \pkg*{scrlayer-scrpage} needs \cs{centering} to center, \cs{raggedright}
955 % to left align and \cs{raggedleft} to right align the three elements of
956 % three-part header and footer. \pkg{ragged2e} optionally redefines them. This
957 % is not perfect but does not break \pkg*{scrlayer-scrpage} completely. But
958 % \pkg{tabu}\footnote{Note, package \pkg{tabu} is not officially maintained by
959 % anyone for several years. Unofficially some members of The \LaTeX{} Team
960 % fix some problems related to new \LaTeX{} kernel changes. But the package
961 % is without support for all other problems, even if they are known for
962 % years. But you have to decide yourself, whether it is a good idea to use
963 % such packages.} also redefines them an that breaks \pkg*{scrlayer-scrpage}
964 % in a way, that even error messages can occur. So from version~3.27
965 % \pkg*{scrlayer-scrpage} does not longer use \cs{centering}, \cs{raggedright}
966 % or \cs{raggedleft} but \cs{LaTeXcentering}, \cs{LaTeXraggedright} and
967 % \cs{LaTeXraggedleft}. With \pkg{ragged2e} and its option
968 % \opt{newcommands}/\opt{NewCommands} this would be already defined and
969 % contain the original definition. On all other circumstances the commands
970 % have to be defined. But these commands should not be defined as part of the
971 % interface or removing the interface could break other packages like
972 % \pkg{ragged2e}.
973 % \begin{macrocode}
974 %<*body>
975 \@ifundefined{LaTeXcentering}{\let\LaTeXcentering\centering}{}
976 \@ifundefined{LaTeXraggedleft}{\let\LaTeXraggedleft\raggedleft}{}
977 \@ifundefined{LaTeXraggedright}{\let\LaTeXraggedright\raggedright}{}
978 %</body>
979 % \end{macrocode}
980 % \end{command}^^A \LaTeXcentering … \LaTeXraggedright
981 %
982 %
983 % \subsection{Style of running heads}
984 %
985 % This implements not only options \opt{komastyle} and \opt{standardstyle} of
986 % \pkg{scrpage2}, but also activates the default style at the end of the
987 % package and takes care for the correct behave of option \opt{markcase}.
988 %
989 % \begin{option}{pagestyleset}
990 % \begin{description}
991 % \item[\texttt{=\meta{string}}:] a valid name of a predefined
992 % style-set. Currently only \optvalue{KOMA-Script} and \optvalue{standard}
993 % are supported. Maybe more will follow.
994 % \end{description}
995 % Note, that the following automatic style activation must be before the
996 % first option usage:
997 % \begin{macrocode}
998 %<*init>
999 \AtEndOfPackage{%
1000 \sls@auto@pagestyleset%
1001 }
1002 % \end{macrocode}
1003 % \begin{macro}{\sls@auto@pagestyleset}
1004 % \changes{v0.9}{2014/01/22}{added}
1005 % \begin{macrocode}
1006 \newcommand*{\sls@auto@pagestyleset}{%
1007 \scr@ifundefinedorrelax{KOMAClassName}{%
1008 %<trace> \PackageInfoNoLine{scrlayer-scrpage}{%
1009 %<trace> auto-selection of `pagestyleset=standard'}%
1010 \FamilyExecuteOptions[.scrlayer-scrpage.sty]{KOMA}{pagestyleset=standard}%
1011 }{%
1012 %<trace> \PackageInfoNoLine{scrlayer-scrpage}{%
1013 %<trace> auto-selection of `pagestyleset=KOMA-Script'}%
1014 \FamilyExecuteOptions[.scrlayer-scrpage.sty]{KOMA}%
1015 {pagestyleset=KOMA-Script}%
1016 }%
1017 }
1018 %</init>
1019 % \end{macrocode}
1020 % \end{macro}^^A \sls@auto@pagestyleset
1021 % \changes{v3.17}{2015/02/25}{storing the values}
1022 % \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage
1023 % commands removed}
1024 % \begin{macrocode}
1025 %<*options>
1026 \KOMA@key{pagestyleset}{%
1027 \scr@ifundefinedorrelax{sls@ps@style@#1}{%
1028 \FamilyKeyStateUnknownValue
1029 }{%
1030 \let\sls@auto@pagestyleset\relax
1031 \@nameuse{sls@ps@style@#1}%
1032 \FamilyKeyStateProcessed
1033 \KOMA@kav@replacevalue{scrlayer-scrpage.sty}{pagestyleset}{#1}%
1034 }%
1035 }
1036 % \end{macrocode}
1037 % \begin{macro}{\sls@ps@style@standard,\sls@ps@style@KOMA-Script}
1038 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
1039 % These are the predefined page style sets.
1040 % \begin{macrocode}
1041 \newcommand*{\sls@ps@style@standard}{%
1042 \let\MakeMarkcase\MakeUppercase
1043 \scrlayer@AtEndOfPackage{%
1044 \pagestyle{scrheadings}%
1045 \clearpairofpagestyles
1046 \ihead{\headmark}%
1047 \ohead{\pagemark}%
1048 \cfoot[\if@twoside\else\pagemark\fi]{}%
1049 }%
1050 }%
1051 \expandafter\newcommand\expandafter*\csname sls@ps@style@KOMA-Script\endcsname{%
1052 \let\MakeMarkcase\@firstofone
1053 \scrlayer@AtEndOfPackage{%
1054 \pagestyle{scrheadings}%
1055 \clearpairofpagestyles
1056 \ohead{\if@twoside\headmark\fi}%
1057 \chead{\if@twoside\else\headmark\fi}%
1058 \ofoot[\if@twoside\pagemark\fi]{\if@twoside\pagemark\fi}%
1059 \cfoot[\if@twoside\else\pagemark\fi]{\if@twoside\else\pagemark\fi}%
1060 \scr@ifundefinedorrelax{KOMAClassName}{}{%
1061 \Ifstr{\KOMAClassName}{scrlttr2}{%
1062 % \end{macrocode}
1063 % We are using \cls*{scrlttr2}, so we have to initialise the page style
1064 % different:
1065 % \changes{v3.18}{2015/06/24}{missing \cs{lofoot} and \cs{rofoot} added}
1066 % \begin{macrocode}
1067 \clearpairofpagestyles
1068 \lehead[\ifnum\@pageat=\z@\pagemark\fi]
1069 {\ifnum\@pageat=\z@\pagemark\else\leftmark\fi}%
1070 \lohead[\ifnum\@pageat=\z@\pagemark\fi]
1071 {\ifnum\@pageat=\z@\pagemark\else\leftmark\fi}%
1072 \chead[\ifnum\@pageat=\@ne\pagemark\fi]
1073 {\ifcase\@pageat \rightmark\or \pagemark\or \rightmark\fi}%
1074 \rehead[\ifnum\@pageat=\tw@\pagemark\fi]
1075 {\ifcase\@pageat \leftmark\or \rightmark\or \pagemark
1076 \else \rightmark\fi}%
1077 \rohead[\ifnum\@pageat=\tw@\pagemark\fi]
1078 {\ifcase\@pageat \leftmark\or \rightmark\or \pagemark
1079 \else \rightmark\fi}%
1080 \lefoot[\ifnum\@pageat=\thr@@\pagemark\fi]
1081 {\ifnum\@pageat=\thr@@\pagemark\fi}%
1082 \lofoot[\ifnum\@pageat=\thr@@\pagemark\fi]
1083 {\ifnum\@pageat=\thr@@\pagemark\fi}%
1084 \cfoot[\ifnum\@pageat=4 \pagemark\fi]
1085 {\ifnum\@pageat=4 \pagemark\fi}%
1086 \refoot[\ifnum\@pageat=5 \pagemark\fi]
1087 {\ifnum\@pageat=5 \pagemark\fi}%
1088 \rofoot[\ifnum\@pageat=5 \pagemark\fi]
1089 {\ifnum\@pageat=5 \pagemark\fi}%
1090 }{}%
1091 }%
1092 }%
1093 }%
1094 %</options>
1095 % \end{macrocode}
1096 % \end{macro}^^A \sls@ps@style@standard,\sls@ps@style@KOMA-Script
1097 % \end{option}^^A pagestyleset
1098 %
1099 % \begin{option}{komastyle,standardstyle}
1100 % \changes{v3.39}{2022/11/16}{only with \KOMAScript~3}
1101 % These options are deprecated, but defined for compatibility with
1102 % \pkg{scrpage2}:
1103 % \begin{macrocode}
1104 %<*options>
1105 \@ifundefined{KOMA@DeclareDeprecatedOption}{}{%
1106 \KOMA@DeclareDeprecatedOption[scrlayer-scrpage]{komastyle}{%
1107 pagestyleset=KOMA-Script}%
1108 \KOMA@DeclareDeprecatedOption[scrlayer-scrpage]{standardstyle}{%
1109 pagestyleset=standard}%
1110 }
1111 %</options>
1112 % \end{macrocode}
1113 % \end{option}^^A komastyle,standardstyle
1114 %
1115 %
1116 % \subsection{Extended mark mechanisms}
1117 %
1118 % Package options \opt{markuppercase}, \opt{markusedcase}, and
1119 % \opt{nouppercase} of package \pkg{scrpage2} are mapped to \KOMAScript{}
1120 % option \opt{markcase}.
1121 %
1122 % \begin{option}{markuppercase,markusedcase,nouppercase}
1123 % \changes{v3.39}{2022/11/16}{only with \KOMAScript~3}
1124 % For compatibility with \pkg{scrpage2}.
1125 % \begin{macrocode}
1126 %<*options>
1127 \@ifundefined{KOMA@DeclareDeprecatedOption}{}{%
1128 \KOMA@DeclareDeprecatedOption[scrlayer-scrpage]{markuppercase}{markcase=upper}
1129 \KOMA@DeclareDeprecatedOption[scrlayer-scrpage]{markusedcase}{markcase=used}
1130 \KOMA@DeclareDeprecatedOption[scrlayer-scrpage]{nouppercase}{%
1131 markcase=ignoreuppercase%
1132 }
1133 }
1134 %</options>
1135 % \end{macrocode}
1136 % \end{option}^^A markuppercase … nouppercase
1137 %
1138 %
1139 % \subsection{Expert page style definition interface}
1140 %
1141 % This is the low level interface of \pkg{scrpage2} with \cs{defpagestyle},
1142 % \cs{newpagestyle}, \cs{renewpagestyle}, and \cs{providepagestyle}. We will
1143 % also define is. In difference to \pkg{scrpage2} layers are used. Following
1144 % layers will be defined for each page style:
1145 % \begin{description}
1146 % \item[\texttt{\meta{page style name}.head.above.line}] line above the head
1147 % \item[\texttt{\meta{page style name}.head.odd}] odd page head (only twoside)
1148 % \item[\texttt{\meta{page style name}.head.even}] even page head (only
1149 % twoside)
1150 % \item[\texttt{\meta{page style name}.head.oneside}] single-side head (only
1151 % oneside)
1152 % \item[\texttt{\meta{page style name}.head.below}] line below the head
1153 % \item[\texttt{\meta{page style name}.foot.above.line}] line above the footer
1154 % \item[\texttt{\meta{page style name}.foot.odd}] odd page footer (only
1155 % twoside)
1156 % \item[\texttt{\meta{page style name}.foot.even}] even side footer (only
1157 % twoside)
1158 % \item[\texttt{\meta{page style name}.foot.oneside}] single-side footer (only
1159 % oneside)
1160 % \item[\texttt{\meta{page style name}.foot.below.line}] line below the footer
1161 % (only oneside)
1162 % \end{description}
1163 % Note: \pkg{scrpage2} also provided star versions of the page style
1164 % definition commands, doing the same like the starless versions. This has
1165 % been done for compatibility reasons with deprecated
1166 % \pkg[https://www.ctan.org/pkg/koma-script-obsolete]{scrpage} and has been
1167 % described as to be removed some times. The layer interface doesn't support
1168 % this any longer.
1169 %
1170 %
1171 % \begin{command}{\defpagestyle}
1172 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
1173 % \begin{description}
1174 % \item[\marg{string}:] the name of the page style to be defined (must be
1175 % fully expandable and expand to a string only).
1176 % \item[\marg{head/foot definition}:] will be used to define the head (see
1177 % \cs{sls@defhead}).
1178 % \item[\marg{head/foot definition}:] will be used to define the foot (see
1179 % \cs{sls@deffoot}).
1180 % \end{description}
1181 % \begin{macrocode}
1182 %<*body>
1183 \newcommand*{\defpagestyle}[3]{%
1184 \sls@defhead{#1}#2\@empty\@empty\@empty
1185 \sls@deffoot{#1}#3\@empty\@empty\@empty
1186 \DeclarePageStyleByLayers{#1}{%
1187 #1.head.odd,#1.head.even,#1.head.oneside,%
1188 #1.head.above.line,#1.head.below.line,%
1189 #1.foot.odd,#1.foot.even,#1.foot.oneside,%
1190 #1.foot.above.line,#1.foot.below.line%
1191 }%
1192 }%
1193 % \end{macrocode}
1194 % \begin{macro}{\sls@defhead,\sls@@defhead}
1195 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
1196 % \cs{kernel@ifnextchar}}
1197 % \begin{macro}{\sls@@@defhead}
1198 % \changes{v0.9}{2014/08/18}{fixed names of layers \texttt{\dots head.odd} and
1199 % \texttt{\dots head.even}}
1200 % \begin{description}
1201 % \item[\pparg{dimensional expression}{dimensional expression}:] length and
1202 % thickness of a line (ruler) above the page head. May be omitted and if so
1203 % the values from option \opt{headtopline} will be used.
1204 % \item[\marg{code}:] will be executed on even pages; used to define the
1205 % contents of layer \texttt{\meta{page style name}.head.even}.
1206 % \item[\marg{code}:] will be executed on odd pages within two-side layout;
1207 % used to define the contents of layer \texttt{\meta{page style
1208 % name}.head.odd}.
1209 % \item[\marg{code}:] will be executed on single-side pages; used to define
1210 % the contents of layer \texttt{\meta{page style name}.head.oneside}.
1211 % \item[\pparg{dimensional expression}{dimensional expression}:] length and
1212 % thickness of a line (ruler) below the page head. May be omitted and if so
1213 % the values from option \opt{headsepline} will be used.
1214 % \end{description}
1215 % Helper to define the head layers.
1216 % \begin{macrocode}
1217 \newcommand*\sls@defhead[1]{%
1218 \kernel@ifnextchar(%)
1219 {\sls@@defhead{#1}}%
1220 {\sls@@defhead{#1}(\sls@headabove@linelength,\sls@headabove@linethickness)}%
1221 }%
1222 \newcommand*{\sls@@defhead}{}
1223 \def\sls@@defhead#1(#2,#3)#4#5#6{%
1224 \kernel@ifnextchar(%)
1225 {\sls@@@defhead{#1}({#2},{#3}){#4}{#5}{#6}}%
1226 {\sls@@@defhead{#1}%
1227 ({#2},{#3})%
1228 {#4}{#5}{#6}%
1229 (\sls@headbelow@linelength,\sls@headbelow@linethickness)}%
1230 }%
1231 \newcommand*{\sls@@@defhead}{}
1232 \def\sls@@@defhead#1(#2,#3)#4#5#6(#7,#8){%
1233 % \end{macrocode}
1234 % The lines:
1235 % \begin{macrocode}
1236 \DeclareLayer[%
1237 background,%
1238 hoffset=\sls@leftmargin{head},%
1239 voffset=\sls@topmargin+\dp\strutbox,%
1240 width=\sls@headwidth,%
1241 height=0pt,%
1242 align=bl,%
1243 contents={%
1244 {\normalfont\usekomafont{pageheadfoot}{\usekomafont{pagehead}{%
1245 \sls@hf@rule{headtop}{#2}{#3}}}}%
1246 }%
1247 ]{#1.head.above.line}%
1248 \DeclareLayer[%
1249 background,%
1250 hoffset=\sls@leftmargin{head},%
1251 voffset=\sls@topmargin+\headheight-\ht\strutbox+#8,%
1252 width=\sls@headwidth,%
1253 height=0pt,%
1254 align=tl,%
1255 contents={%
1256 {\normalfont\usekomafont{pageheadfoot}{\usekomafont{pagehead}{%
1257 \sls@hf@rule{headsep}{#7}{#8}}}}%
1258 }%
1259 ]{#1.head.below.line}%
1260 % \end{macrocode}
1261 % The odd side, even side and one side:
1262 % \changes{v3.13b}{2014/10/16}{workaround: additional group added to avoid
1263 % pdf\TeX{} color stack warnings}
1264 % \begin{macrocode}
1265 \DeclareLayer[%
1266 background,evenpage,twoside,%
1267 head,%
1268 hoffset=\sls@leftmargin{head},%
1269 width=\sls@headwidth,%
1270 contents={%
1271 \sls@secure@box\headheight{%
1272 \normalfont{\usekomafont{pageheadfoot}{\usekomafont{pagehead}{#4}}}}}%
1273 ]{#1.head.even}%
1274 \DeclareLayer[%
1275 background,oddpage,twoside,%
1276 head,%
1277 hoffset=\sls@leftmargin{head},%
1278 width=\sls@headwidth,%
1279 contents={%
1280 \sls@secure@box\headheight{%
1281 \normalfont{\usekomafont{pageheadfoot}{\usekomafont{pagehead}{#5}}}}}%
1282 ]{#1.head.odd}%
1283 \DeclareLayer[%
1284 background,oddpage,oneside,%
1285 head,%
1286 hoffset=\sls@leftmargin{head},%
1287 width=\sls@headwidth,%
1288 contents={%
1289 \sls@secure@box\headheight{%
1290 \normalfont{\usekomafont{pageheadfoot}{\usekomafont{pagehead}{#6}}}}}%
1291 ]{#1.head.oneside}%
1292 }%
1293 % \end{macrocode}
1294 % \begin{macro}{\sls@deffoot,\sls@@deffoot}
1295 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
1296 % \cs{kernel@ifnextchar}}
1297 % \begin{macro}{\sls@@@deffoot}
1298 % \changes{v0.9}{2014/08/18}{fixed names of layers \texttt{\dots foot.odd} and
1299 % \texttt{\dots foot.even}}
1300 % \begin{description}
1301 % \item[\pparg{dimensional expression}{dimensional expression}:] length and
1302 % thickness of a line (ruler) above the page footer. May be omitted and if
1303 % so the values from option \opt{footsepline} will be used.
1304 % \item[\marg{code}:] will be executed on even pages; used to define the
1305 % contents of layer \texttt{\meta{page style name}.foot.even}.
1306 % \item[\marg{code}:] will be executed on odd pages within two-side layout;
1307 % used to define the contents of layer \texttt{\meta{page style
1308 % name}.foot.odd}.
1309 % \item[\marg{code}:] will be executed on single-side pages; used to define
1310 % the contents of layer \texttt{\meta{page style name}.foot.oneside}.
1311 % \item[\pparg{dimensional expression}{dimensional expression}:] length and
1312 % thickness of a line (ruler) below the page footer. May be omitted and if
1313 % so the values from option \opt{footbotline} will be used.
1314 % \end{description}
1315 % Helper to define the foot layers.
1316 % \begin{macrocode}
1317 \newcommand*\sls@deffoot[1]{%
1318 \kernel@ifnextchar(%)
1319 {\sls@@deffoot{#1}}%
1320 {\sls@@deffoot{#1}(\sls@footabove@linelength,\sls@footabove@linethickness)}%
1321 }%
1322 \newcommand*{\sls@@deffoot}{}
1323 \def\sls@@deffoot#1(#2,#3)#4#5#6{%
1324 \kernel@ifnextchar(%)
1325 {\sls@@@deffoot{#1}({#2},{#3}){#4}{#5}{#6}}%
1326 {\sls@@@deffoot{#1}%
1327 ({#2},{#3})%
1328 {#4}{#5}{#6}%
1329 (\sls@footbelow@linelength,\sls@footbelow@linethickness)}%
1330 }%
1331 \newcommand*{\sls@@@deffoot}{}
1332 \def\sls@@@deffoot#1(#2,#3)#4#5#6(#7,#8){%
1333 % \end{macrocode}
1334 % The lines:
1335 % \begin{macrocode}
1336 \DeclareLayer[%
1337 foreground,%
1338 hoffset=\sls@leftmargin{foot},%
1339 voffset=\sls@topmargin
1340 +\headheight+\headsep
1341 +\textheight
1342 +\footskip-\footheight
1343 +2\dp\strutbox,%
1344 width=\sls@footwidth,%
1345 height=0pt,%
1346 align=bl,%
1347 contents={%
1348 {\normalfont\usekomafont{pageheadfoot}{\usekomafont{pagefoot}{%
1349 \sls@hf@rule{footsep}{#2}{#3}}}}%
1350 }%
1351 ]{#1.foot.above.line}%
1352 \DeclareLayer[%
1353 foreground,%
1354 hoffset=\sls@leftmargin{foot},%
1355 voffset=\sls@topmargin
1356 +\headheight+\headsep
1357 +\textheight
1358 +\footskip
1359 +2\dp\strutbox
1360 +#8,%
1361 width=\sls@footwidth,%
1362 height=0pt,%
1363 align=bl,%
1364 contents={%
1365 {\normalfont\usekomafont{pageheadfoot}{\usekomafont{pagefoot}{%
1366 \sls@hf@rule{footbot}{#7}{#8}}}}%
1367 }%
1368 ]{#1.foot.below.line}%
1369 % \end{macrocode}
1370 % The odd side, even side and one side:
1371 % \begin{macrocode}
1372 \DeclareLayer[%
1373 foreground,evenpage,twoside,%
1374 foot,%
1375 hoffset=\sls@leftmargin{foot},%
1376 width=\sls@footwidth,%
1377 contents={%
1378 \sls@secure@box\footheight{%
1379 \normalfont\usekomafont{pageheadfoot}{\usekomafont{pagefoot}{#4}}}}%
1380 ]{#1.foot.even}%
1381 \DeclareLayer[%
1382 foreground,oddpage,twoside,%
1383 foot,%
1384 hoffset=\sls@leftmargin{foot},%
1385 width=\sls@footwidth,%
1386 contents={%
1387 \sls@secure@box\footheight{%
1388 \normalfont\usekomafont{pageheadfoot}{\usekomafont{pagefoot}{#5}}}}%
1389 ]{#1.foot.odd}%
1390 \DeclareLayer[%
1391 foreground,oddpage,oneside,%
1392 foot,%
1393 hoffset=\sls@leftmargin{foot},%
1394 width=\sls@footwidth,%
1395 contents={%
1396 \sls@secure@box\footheight{%
1397 \normalfont\usekomafont{pageheadfoot}{\usekomafont{pagefoot}{#6}}}}%
1398 ]{#1.foot.oneside}%
1399 }%
1400 % \end{macrocode}
1401 % \begin{macro}{\sls@secure@box}
1402 % \changes{v3.34}{2021/05/16}{\LaTeX{} team requested for additional \cs{par}}
1403 % \begin{description}
1404 % \item[\marg{length}:] a \LaTeX{} length, that gives the maximum
1405 % height + depth of the \meta{content}. It has to be either
1406 % \cs{headheight} or \cs{footheight}.
1407 % \item[\marg{content}:] what should be output (inside the box).
1408 % \end{description}
1409 % Note, that several length may be changed, to fit.
1410 % \begin{macrocode}
1411 \newcommand*{\sls@secure@box}[2]{%
1412 \begingroup
1413 \setbox\z@\vbox{%
1414 \ifsls@leavevmode\leavevmode\expandafter\ignorespaces\fi
1415 #2\par
1416 }%
1417 \ifdim #1<\dimexpr \ht\z@+\dp\z@\relax
1418 \PackageWarning{scrlayer-scrpage}{%
1419 \string#1 to low.\MessageBreak
1420 At least \the\dimexpr \ht\z@+\dp\z@\relax\space needed,\MessageBreak
1421 but only \the#1 found.\MessageBreak
1422 \ifsls@autoenlarge
1423 I'll enlarge \string#1, for further\MessageBreak
1424 processing, but you should do this yourself,\MessageBreak
1425 \else
1426 You should enlarge \string#1,\MessageBreak
1427 \fi
1428 e.g.,
1429 \scr@ifundefinedorrelax{geometry}{%
1430 \scr@ifundefinedorrelax{typearea}{%
1431 using\MessageBreak
1432 \space\space\string\setlength{\string#1}{%
1433 \the\dimexpr \ht\z@+\dp\z@\relax}\MessageBreak
1434 in your preamble%
1435 }{%
1436 setting typearea's option\MessageBreak
1437 `\expandafter\@gobble\string#1=\the\dimexpr \ht\z@+\dp\z@\relax'%
1438 }%
1439 }{%
1440 \ifx #1\headheight
1441 setting geometry's option\MessageBreak
1442 `head=\the\dimexpr \ht\z@+\dp\z@\relax'%
1443 \else
1444 using\MessageBreak
1445 \space\space\string\setlength{\string#1}{%
1446 \the\dimexpr \ht\z@+\dp\z@\relax}\MessageBreak
1447 in your preamble%
1448 \fi
1449 }%
1450 \ifsls@autoenlarge
1451 .\MessageBreak
1452 I'll also
1453 \ifx #1\headheight decrease \string\topmargin
1454 \else increase \string\footskip\fi
1455 \fi
1456 }%
1457 \ifsls@autoenlarge
1458 \@tempdima\dimexpr \ht\z@+\dp\z@\relax
1459 \ifx #1\headheight
1460 \global\advance\topmargin by \dimexpr #1-(\ht\z@+\dp\z@)\relax
1461 \dp\z@\dimexpr \dp\z@+\ht\z@+\dp\z@-\headheight\relax
1462 \else
1463 \global\advance\footskip by \dimexpr \ht\z@+\dp\z@-#1\relax
1464 \fi
1465 \global#1\@tempdima
1466 \fi
1467 \fi
1468 \usebox\z@
1469 \endgroup
1470 }%
1471 %</body>
1472 % \end{macrocode}
1473 % \begin{option}{hmode}
1474 % Switch automatically to the horizontal mode before setting a page head or
1475 % page footer element.
1476 % \begin{macrocode}
1477 %<*options>
1478 \KOMA@ifkey{hmode}{sls@leavevmode}
1479 %</options>
1480 % \end{macrocode}
1481 % \end{option}^^A hmode
1482 % \begin{option}{autoenlargeheadfoot}
1483 % \changes{v3.25}{2018/01/14}{added}
1484 % Automaticly enlarge vertical size of head or foot if the contents is to
1485 % large. This is the default.
1486 % \begin{macrocode}
1487 %<*options>
1488 \KOMA@ifkey{autoenlargeheadfoot}{sls@autoenlarge}
1489 \KOMAExecuteOptions{autoenlargeheadfoot=true}
1490 %</options>
1491 % \end{macrocode}
1492 % \end{option}^^A autoenlargeheadfoot
1493 % \end{macro}^^A \sls@secure@box
1494 % \end{macro}^^A \sls@@@deffoot
1495 % \end{macro}^^A \sls@deffoot,\sls@@deffoot
1496 % \end{macro}^^A \sls@@@defhead
1497 % \end{macro}^^A \sls@defhead,\sls@@defhead
1498 % \begin{command}{\headfont}
1499 % The low level page head font command. It is deprecated to redefine or use
1500 % this and it may already be defined.
1501 % \begin{macro}{\scr@fnt@pagehead}
1502 % \changes{v3.25}{2018/02/05}{don't use \cs{newkomafont} to avoid warning}
1503 % \begin{macro}{\scr@fnt@wrn@pagehead}
1504 % \changes{v0.9}{2014/01/13}{warning always deactivated}
1505 % \begin{macro}{\scr@fnt@pageheadfoot}
1506 % \begin{macrocode}
1507 %<*body>
1508 \@ifundefined{scr@fnt@pagehead}{%
1509 \scr@ifundefinedorrelax{scr@fnt@instead@pagehead}{}{%
1510 \PackageInfo{scrlayer-scrpage}{%
1511 Makeing stand-alone element `pagehead' from\MessageBreak
1512 alias to `pageheadfoot'%
1513 }%
1514 \let\scr@fnt@instead@pagehead\relax
1515 }%
1516 \@ifundefined{@pageheadfont}{%
1517 \newcommand*{\@pageheadfont}{}%
1518 }{}%
1519 \newcommand*{\scr@fnt@pagehead}{\@pageheadfont}%
1520 }{}
1521 \@ifundefined{scr@fnt@pageheadfoot}{%
1522 \newcommand*{\scr@fnt@pageheadfoot}{\headfont}%
1523 \@ifundefined{headfont}{%
1524 \newcommand*{\headfont}{\normalcolor\slshape}%
1525 }{}
1526 }{}
1527 \scr@ifundefinedorrelax{scr@fnt@wrn@pagehead}{}{%
1528 %<trace> \PackageInfo{scrlayer-scrpage}{%
1529 %<trace> deactivating warning for font element\MessageBreak
1530 %<trace> `pagehead'}%
1531 \let\scr@fnt@wrn@pagehead\relax
1532 }
1533 % \end{macrocode}
1534 % \end{macro}^^A \scr@fnt@pageheadfoot
1535 % \end{macro}^^A \scr@fnt@wrn@pagehead
1536 % \end{macro}^^A \scr@fnt@pagehead
1537 % \end{command}^^A \headfont
1538 %
1539 % \begin{command}{\footfont}
1540 % The low level page footer font command. It is deprecated to redefine or use
1541 % this and it may already be defined.
1542 % \begin{macro}{\scr@fnt@pagefoot}
1543 % \begin{macro}{\scr@fnt@wrn@pagefoot}
1544 % \changes{v0.9}{2014/01/13}{warning always deactivated}
1545 % \begin{macrocode}
1546 \@ifundefined{scr@fnt@pagefoot}{%
1547 \def\scr@fnt@pagefoot{\footfont}%
1548 \@ifundefined{footfont}{%
1549 \newcommand*{\footfont}{}%
1550 }{}%
1551 }{}
1552 \scr@ifundefinedorrelax{scr@fnt@wrn@pagefoot}{}{%
1553 %<trace> \PackageInfo{scrlayer-scrpage}{%
1554 %<trace> deactivating warning for font element\MessageBreak
1555 %<trace> `pagefoot'}%
1556 \let\scr@fnt@wrn@pagefoot\relax
1557 }
1558 % \end{macrocode}
1559 % \end{macro}^^A \scr@fnt@wrn@pagefoot
1560 % \end{macro}^^A \scr@fnt@pagefoot
1561 % \end{command}^^A \footfont
1562 %
1563 % \begin{macro}{\sls@hf@rule}
1564 % \changes{v3.34}{2021/05/16}{\LaTeX{} team requested for additional \cs{par}}
1565 % \begin{description}
1566 % \item[\marg{rule name}:] one of \texttt{headtop}, \texttt{headsep},
1567 % \texttt{footsep}, or \texttt{footbot}
1568 % \item[\marg{dimensional expression}:] the line length (width)
1569 % \item[\marg{dimensional expression}:] the line thickness (height)
1570 % \end{description}
1571 % Helper to draw the line.
1572 % \begin{macrocode}
1573 \newcommand*\sls@hf@rule[3]{%
1574 \begingroup
1575 \normalfont\usekomafont{#1line}{%
1576 \vbox to \z@{%
1577 \kern -\dimexpr #3\relax
1578 \ifnum \sls@hfline@adjust>\z@ \@tempswatrue \else \@tempswafalse\fi
1579 \if@twoside\ifodd\value{page}\else
1580 \ifnum \sls@hfline@adjust<\tw@ \@tempswatrue\else \@tempswafalse\fi
1581 \fi\fi
1582 \if@tempswa
1583 \hskip \z@\@plus 1fill\@minus \paperwidth
1584 \fi
1585 \vrule \@width\dimexpr #2\relax \@height\dimexpr #3\relax \@depth\z@
1586 \ifnum \sls@hfline@adjust<\tw@ \@tempswatrue\else \@tempswafalse\fi
1587 \if@twoside\ifodd\value{page}\else
1588 \ifnum \sls@hfline@adjust>\z@ \@tempswatrue \else \@tempswafalse\fi
1589 \fi\fi
1590 \if@tempswa
1591 \hskip \z@\@plus 1fill\@minus \paperwidth\null
1592 \fi
1593 \par
1594 }%
1595 }%
1596 \endgroup
1597 }%
1598 % \end{macrocode}
1599 % \end{macro}^^A \sls@hf@rule
1600 % \begin{macro}{\sls@topmargin,\sls@leftmargin}
1601 % Two simple helper macros:
1602 % \begin{macrocode}
1603 \newcommand*{\sls@topmargin}{\dimexpr\topmargin+1in\relax}%
1604 \newcommand*{\sls@leftmargin}[1]{%
1605 \dimexpr
1606 \if@twoside
1607 \ifodd\value{page}
1608 \oddsidemargin+\csname sls@odd#1shift\endcsname
1609 \else
1610 \evensidemargin+\csname sls@even#1shift\endcsname
1611 \fi
1612 \else
1613 \oddsidemargin+\csname sls@odd#1shift\endcsname
1614 \fi
1615 +1in\relax
1616 }%
1617 %</body>
1618 % \end{macrocode}
1619 % \end{macro}^^A \sls@topmargin … \sls@leftmargin
1620 % \end{command}^^A \defpagestyle
1621 %
1622 % \begin{command}{\newpagestyle}
1623 % \changes{v3.32}{2020/09/11}{test for \pkg{titlesec}}
1624 % For the parameters see \cs{defpagestyle}. Define the pagestyle only, if not
1625 % already defined. Unfortunately \pkg{titlesec} also defines this command. So
1626 % new definition will fail. \textsf{titlesec} uses \cs{providecommand} so if
1627 % the order would be changed, everything would be OK.
1628 % \begin{macrocode}
1629 %<*body>
1630 \IfPackageLoadedT{titlesec}{%
1631 \@ifundefined{newpagestyle}{}{%
1632 \IfPackageLoadedF{titleps}{%
1633 \PackageWarningNoLine{scrlayer-scrpage}{%
1634 it seems that package `titlesec' is used\MessageBreak
1635 and has already defined `\string\newpagestyle'.\MessageBreak
1636 To avoid this warning message, you should\MessageBreak
1637 load package `titlesec' not before package\MessageBreak
1638 `scrlayer-scrpage'. If you need `titlesec'\MessageBreak
1639 you could load it after `scrlayer-scrpage',\MessageBreak
1640 but you still would not be able to use\MessageBreak
1641 the `titlesec' implemenation of\MessageBreak
1642 `\string\newpagestyle'%
1643 }%
1644 \let\newpagestyle\relax
1645 }%
1646 }%
1647 }
1648 \newcommand*\newpagestyle[3]{%
1649 \@ifundefined{ps@#1}{\defpagestyle{#1}{#2}{#3}}{%
1650 \PackageError{scrlayer-scrpage}{Page style `#1' already defined}{%
1651 Only not yet defined page style may be defined using
1652 \string\newpagestyle.\MessageBreak
1653 You may use either \string\renewpagestyle, \string\providepagestyle,
1654 or \string\defpagestyle\MessageBreak
1655 with already defined page styles.\MessageBreak
1656 If you'll continue, your command will be ignored.%
1657 }%
1658 }%
1659 }%
1660 %</body>
1661 % \end{macrocode}
1662 % \end{command}^^A \newpagestyle
1663 %
1664 % \begin{command}{\renewpagestyle}
1665 % \changes{v3.32}{2020/09/11}{test for \textsf{titlesec}}
1666 % For the parameters see \cs{defpagestyle}. Define the pagestyle only, if not
1667 % already defined. Unfortunately \textsf{titlesec} also defines this
1668 % command. So new definition will fail. \textsf{titlesec} uses
1669 % \cs{providecommand} so if the order would be changed, everything would be OK.
1670 % \begin{macrocode}
1671 %<*body>
1672 \IfPackageLoadedT{titlesec}{%
1673 \@ifundefined{renewpagestyle}{}{%
1674 \IfPackageLoadedF{titleps}{%
1675 \PackageWarningNoLine{scrlayer-scrpage}{%
1676 It seems that package `titlesec' is used\MessageBreak
1677 and has already defined `\string\renewpagestyle'.\MessageBreak
1678 To avoid this warning message, you should\MessageBreak
1679 load package `titlesec' not before package\MessageBreak
1680 `scrlayer-scrpage'. If you need `titlesec'\MessageBreak
1681 you could load it after `scrlayer-scrpage',\MessageBreak
1682 but you still would not be able to use\MessageBreak
1683 the `titlesec' implemenation of\MessageBreak
1684 `\string\renewpagestyle'%
1685 }%
1686 \let\renewpagestyle\relax
1687 }%
1688 }%
1689 }
1690 \newcommand*\renewpagestyle[3]{%
1691 \@ifundefined{ps@#1}{%
1692 \PackageError{scrlayer-scrpage}{Undefined page style `#1'}{%
1693 Only already defined page style may be re-defined using
1694 \string\renewpagestyle.\MessageBreak
1695 You may use either \string\newpagestyle, \string\providepagestyle,
1696 or \string\defpagestyle\MessageBreak
1697 with not yet defined page styles.\MessageBreak
1698 If you'll continue, your command will be ignored.%
1699 }%
1700 }{%
1701 \defpagestyle{#1}{#2}{#3}%
1702 }%
1703 }%
1704 %</body>
1705 % \end{macrocode}
1706 % \end{command}^^A \renewpagestyle
1707 %
1708 % \begin{command}{\providepagestyle}
1709 % For the parameters see \cs{defpagestyle}. Define only, if not already defined:
1710 % \begin{macrocode}
1711 %<*body>
1712 \newcommand*\providepagestyle[3]{%
1713 \@ifundefined{ps@#1}{%
1714 \defpagestyle{#1}{#2}{#3}%
1715 }{%
1716 %<*trace>
1717 \PackageInfo{scrlayer-scrpage}{%
1718 page style `#1' already defined.\MessageBreak
1719 New definition ignored%
1720 }%
1721 %</trace>
1722 }%
1723 }
1724 %</body>
1725 % \end{macrocode}
1726 % \end{command}^^A \providepagestyle
1727 %
1728 %
1729 % \subsection{User page style definition interface}
1730 %
1731 % This is the mid-level interface of \pkg{scrpage2} with \cs{deftripstyle}. As
1732 % in \pkg{scrpage2} we simply use the expert page style definition interface
1733 % to define the new user interface commands. But here the useless starred
1734 % versions will not longer be supported. So users of them have to remove the
1735 % star (nothing else).
1736 %
1737 % \begin{command}{\deftriplepagestyle,\newtriplepagestyle,
1738 % \renewtriplepagestyle,\providetriplepagestyle}
1739 % \begin{description}
1740 % \item[\marg{string}:] the name of the page style to be defined (must be
1741 % fully expandable and expand to a string only).
1742 % \item[\oarg{dimensional expression}:] thickness of a horizontal line above
1743 % the page head and below the page foot (default: 0\,pt).
1744 % \item[\oarg{dimensional expression}:] thickness of a horizontal line below
1745 % the page head and above the page foot (default: 0\,pt).
1746 % \item[\marg{code}:] will be expanded left aligned at head of odd pages (with
1747 % one-side layout all pages are odd) and right aligned at head of even
1748 % pages.
1749 % \item[\marg{code}:] will be expanded centered at head of odd and even pages.
1750 % \item[\marg{code}:] will be expanded right aligned at head of odd pages
1751 % (with one-side layout all pages are odd) and left aligned at head of even
1752 % pages.
1753 % \item[\marg{code}:] will be expanded left aligned at footer of odd pages
1754 % (with one-side layout all pages are odd) and right aligned at footer of
1755 % even pages.
1756 % \item[\marg{code}:] will be expanded centered at footer of odd and even
1757 % pages.
1758 % \item[\marg{code}:] will be expanded right aligned at footer of odd pages
1759 % (with one-side layout all pages are odd) and left aligned at footer of
1760 % even pages.
1761 % \end{description}
1762 % \begin{macrocode}
1763 %<*body>
1764 \newcommand*{\deftriplepagestyle}[1]{%
1765 \let\@tempa\defpagestyle
1766 \scrlayer@triplestyle{#1}%
1767 }%
1768 \newcommand*{\newtriplepagestyle}[1]{%
1769 \let\@tempa\newpagestyle
1770 \scrlayer@triplestyle{#1}%
1771 }%
1772 \newcommand*{\renewtriplepagestyle}[1]{%
1773 \let\@tempa\renewpagestyle
1774 \scrlayer@triplestyle{#1}%
1775 }%
1776 \newcommand*{\providetriplepagestyle}[1]{%
1777 \let\@tempa\providepagestyle
1778 \scrlayer@triplestyle{#1}%
1779 }%
1780 % \end{macrocode}
1781 % \begin{macro}{\scrlayer@triplestyle,\scrlayer@@triplestyle}
1782 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
1783 % \cs{kernel@ifnextchar}}
1784 % \begin{macro}{\scrlayer@@@triplestyle}
1785 % Helpers, that do the real work. Parameters are same, but \cs{reserved@a} has
1786 % to be one of \cs{defpagestyle}, \cs{newpagestyle},
1787 % \cs{renewpagestyle}, or \cs{providepagestyle}.
1788 % \begin{macrocode}
1789 \newcommand*{\scrlayer@triplestyle}[1]{%
1790 \kernel@ifnextchar[%]
1791 {\scrlayer@@triplestyle{#1}}%
1792 {\scrlayer@@triplestyle{#1}[\z@]}%
1793 }
1794 \newcommand*{\scrlayer@@triplestyle}{}
1795 \def\scrlayer@@triplestyle#1[#2]{%
1796 \kernel@ifnextchar[%]
1797 {\scrlayer@@@triplestyle{#1}[#2]}%
1798 {\scrlayer@@@triplestyle{#1}[\z@][#2]}%
1799 }%
1800 \newcommand*{\scrlayer@@@triplestyle}{}
1801 \def\scrlayer@@@triplestyle#1[#2][#3]#4#5#6#7#8#9{%
1802 \@tempa{#1}{%
1803 (\sls@headwidth,#2)%
1804 {%
1805 \makebox[\z@][l]{#6}\hfill
1806 \makebox[\z@][c]{#5}\hfill
1807 \makebox[\z@][r]{#4}%
1808 }{%
1809 \makebox[\z@][l]{#4}\hfill
1810 \makebox[\z@][c]{#5}\hfill
1811 \makebox[\z@][r]{#6}%
1812 }{%
1813 \makebox[\z@][l]{#4}\hfill
1814 \makebox[\z@][c]{#5}\hfill
1815 \makebox[\z@][r]{#6}%
1816 }%
1817 (\sls@headwidth,#3)%
1818 }{%
1819 (\sls@footwidth,#3)%
1820 {%
1821 \makebox[\z@][l]{#9}\hfill
1822 \makebox[\z@][c]{#8}\hfill
1823 \makebox[\z@][r]{#7}%
1824 }{%
1825 \makebox[\z@][l]{#7}\hfill
1826 \makebox[\z@][c]{#8}\hfill
1827 \makebox[\z@][r]{#9}%
1828 }{%
1829 \makebox[\z@][l]{#7}\hfill
1830 \makebox[\z@][c]{#8}\hfill
1831 \makebox[\z@][r]{#9}%
1832 }%
1833 (\sls@footwidth,#2)%
1834 }%
1835 }%
1836 % \end{macrocode}
1837 % \end{macro}^^A \scrlayer@@@triplestyle
1838 % \end{macro}^^A \scrlayer@triplestyle,\scrlayer@@triplestyle
1839 % \begin{command}{deftripstyle}
1840 % Command \cs{deftripstyle} has been defined for compatibility with
1841 % \pkg{scrpage2} only. It is deprecated now.
1842 % The starred version \cs{deftripstyle*} is deprecated for several
1843 % years and hasn't been described at the manual, it will not longer be
1844 % defined.
1845 % \begin{macrocode}
1846 \newcommand*{\deftripstyle}{%
1847 \PackageWarning{scrlayer-scrpage}{%
1848 Command \string\deftripstyle\space is deprecate.\MessageBreak
1849 You should replace it by \string\deftriplepagestyle,\MessageBreak
1850 e.g.,%
1851 }%
1852 \let\deftripstyle\deftriplepagestyle
1853 \deftripstyle
1854 }%
1855 %</body>
1856 % \end{macrocode}
1857 % \end{command}^^A \deftripstyle
1858 % \end{command}^^A \deftriplepagestyle … \providetriplepagestyle
1859 %
1860 %
1861 % \subsection{Pre-defined page styles interface}
1862 %
1863 % This is the high-level interface of \pkg{scrpage2} with the page style
1864 % \pstyle{scrheadings}, \pstyle{scrplain}, and \pstyle{useheadings}. Those
1865 % will work as expected but will also be extended to support definition of
1866 % additional styles using the same interface.
1867 %
1868 % \begin{command}{\defpairofpagestyles}
1869 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
1870 % \begin{description}
1871 % \item[\oarg{string}:] name of a parent page style, that will be used to
1872 % initialise the new page style (must be fully expandable and expand to the
1873 % name of a page style).
1874 % \item[\marg{string}:] name the page style to be defined (must be fully
1875 % expandable and expand to the name of a page style).
1876 % \item[\marg{code}:] several commands of \cs{ihead}, \cs{chead}, \cs{ohead},
1877 % \cs{lehead}, \cs{lohead}, \cs{cohead}, \cs{rehead}, \cs{cehead},
1878 % \cs{rohead}, \cs{ifoot}, \cs{cfoot}, \cs{ofoot}, \cs{lefoot}, \cs{cefoot},
1879 % \cs{lofoot}, \cs{refoot}, \cs{cofoot}, \cs{rofoot}, \cs{clearscrheadfoot},
1880 % \cs{clearscrheadings}, \cs{clearscrplain}.
1881 % \end{description}
1882 % Two page styles will be defined using \cs{defpagestyle}, page style named
1883 % with the second argument and page style with the same name but an additional
1884 % prefix ``\pstyle{plain.}''. This will be activated automatically to be the
1885 % plain page style when the first page style will be used. If first argument
1886 % is used this pair of page styles will be used to initialise the head and
1887 % footer of the new. All the other commands are used to define the initial
1888 % fields. Note, if one of those page styles is active, all further commands
1889 % (see 3rd argument) depend on the active page style. If no one is active,
1890 % they depend on page style \pstyle{scrheadings}.
1891 % \begin{macrocode}
1892 %<*body>
1893 \newcommand*{\defpairofpagestyles}[3][]{%
1894 \def\reserved@a##1##2##3##4##5##6##7\@nil{##1##2##3##4##5##6}%
1895 \edef\reserved@a{\expandafter\reserved@a #2xxxxxx\@nil}%
1896 \Ifstr\reserved@a{plain.}{%
1897 \PackageError{scrlayer-scrpage}{plain page style `#2' not allowed}{%
1898 You may not define a plain page style using
1899 \string\defpairofpagestyles, \string\newpairofpagestyles,
1900 \string\renewpairofpagestyles, or\MessageBreak
1901 \string\providepairofpagestyles. I'd suggest to simply define the
1902 corresponding\MessageBreak
1903 non-plain page style to also define the plain one.\MessageBreak
1904 If you'll continue, your command will be ignored.}%
1905 }{%
1906 \sls@init@pair@page@style*{#2}%
1907 \sls@init@pair@page@style*{plain.#2}%
1908 \ifx\relax #1\relax\else
1909 \scr@ifundefinedorrelax{sls@ps@#1@even@left@head}{%
1910 \PackageError{scrlayer-scrpage}{`#1' not a pair page style}{%
1911 Only pair page styles may be used to initialise new pairs of page
1912 styles. So\MessageBreak
1913 optional argument of \string\defpairofpagestyles,
1914 \string\newpairofpagestyles,\MessageBreak
1915 \string\renewpairofpagestyles, or \string\providepairofpagestyle has
1916 to be a pair\MessageBreak
1917 page style or should be unused.\MessageBreak
1918 If you'll continue, the initialisation will be ignored.}%
1919 }{%
1920 \sls@init@pair@page@style{#2}{#1}%
1921 \scr@ifundefinedorrelax{sls@ps@plain.#1@even@left@head}{%
1922 \sls@init@pair@page@style{plain.#2}{#1}%
1923 }{%
1924 \sls@init@pair@page@style{plain.#2}{plain.#1}%
1925 }%
1926 }%
1927 \fi
1928 \sls@def@pair@page@style@member{#2}%
1929 \AddToLayerPageStyleOptions{#2}{%
1930 onselect={%
1931 % \end{macrocode}
1932 % \changes{v3.15}{2015/01/08}{usage of \cs{DeclarePageStyleAlias} instead of
1933 % \cs{let}}
1934 % \begin{macrocode}
1935 \DeclarePageStyleAlias{plain}{plain.#2}%
1936 \DeclarePageStyleAlias{headings}{#2}%
1937 \def\sls@currentheadings{#2}%
1938 \def\sls@currentplain{plain.#2}%
1939 #3%
1940 }%
1941 }%
1942 \sls@def@pair@page@style@member{plain.#2}%
1943 \AddToLayerPageStyleOptions{plain.#2}{%
1944 onselect={%
1945 % \end{macrocode}
1946 % \changes{v3.15}{2015/01/08}{usage of \cs{DeclarePageStyleAlias} instead of
1947 % \cs{let}}
1948 % \begin{macrocode}
1949 \DeclarePageStyleAlias{plain}{plain.#2}%
1950 \DeclarePageStyleAlias{headings}{#2}%
1951 \def\sls@currentheadings{#2}%
1952 \def\sls@currentplain{plain.#2}%
1953 #3%
1954 },%
1955 oninit={%
1956 \expandafter
1957 \ifx\csname ifsls@plain@head@above@line\expandafter\endcsname
1958 \csname iftrue\endcsname\else
1959 \let\sls@headabove@linelength\z@
1960 \let\sls@headabove@linethickness\z@
1961 \fi
1962 \expandafter
1963 \ifx\csname ifsls@plain@head@below@line\expandafter\endcsname
1964 \csname iftrue\endcsname\else
1965 \let\sls@headbelow@linelength\z@
1966 \let\sls@headbelow@linethickness\z@
1967 \fi
1968 \expandafter
1969 \ifx\csname ifsls@plain@foot@above@line\expandafter\endcsname
1970 \csname iftrue\endcsname\else
1971 \let\sls@footabove@linelength\z@
1972 \let\sls@footabove@linethickness\z@
1973 \fi
1974 \expandafter
1975 \ifx\csname ifsls@plain@foot@below@line\expandafter\endcsname
1976 \csname iftrue\endcsname\else
1977 \let\sls@footbelow@linelength\z@
1978 \let\sls@footbelow@linethickness\z@
1979 \fi
1980 }%
1981 }%
1982 }%
1983 }%
1984 % \end{macrocode}
1985 % \begin{macro}{\sls@currentheadings,\sls@currentplain}
1986 % These little helpers will be set up at selection of each pair page style and
1987 % stores the last activated page style pair of the scope.
1988 % \begin{macrocode}
1989 \newcommand*\sls@currentheadings{scrheadings}%
1990 \newcommand*\sls@currentplain{plain.scrheadings}%
1991 % \end{macrocode}
1992 % \end{macro}^^A \sls@currentheadings,\sls@currentplain
1993 % \begin{macro}{\sls@init@pair@page@style}
1994 % \changes{v3.20}{2016/04/12}{\cs{ifstar} replaced by \cs{kernel@ifstar}}
1995 % \begin{macro}{\sls@init@@pair@page@style}
1996 % \begin{description}
1997 % \item[\marg{string}:] the name of the page style, that should be initialised
1998 % to be one member of a page style pair.
1999 % \item[\marg{string}:] the name of a member of a page style pair, that should
2000 % be used to initialise one the member of a page style pair from first
2001 % argument.
2002 % \end{description}
2003 % These are two little helpers for \cs{defpairofpagestyles}. The first command
2004 % has two starred versions. With one star the commands for the page style will
2005 % be initialised to \cs{@empty}, with two stars they will become
2006 % \LaTeX-undefined (\cs{relax}).
2007 %
2008 % Note also, that the second argument may either be the plain or the non-plain
2009 % member of the page style pair.
2010 % \begin{macrocode}
2011 \newcommand*{\sls@init@pair@page@style}{%
2012 \kernel@ifstar {%
2013 \kernel@ifstar {%
2014 \sls@let@pair@page@style\relax
2015 }{%
2016 \sls@let@pair@page@style\@empty
2017 }
2018 }{%
2019 \sls@init@@pair@page@style
2020 }%
2021 }%
2022 \newcommand*{\sls@init@@pair@page@style}[2]{%
2023 \expandafter\let\csname sls@ps@#1@even@left@head\expandafter\endcsname
2024 \csname sls@ps@#2@even@left@head\endcsname
2025 \expandafter\let\csname sls@ps@#1@even@middle@head\expandafter\endcsname
2026 \csname sls@ps@#2@even@middle@head\endcsname
2027 \expandafter\let\csname sls@ps@#1@even@right@head\expandafter\endcsname
2028 \csname sls@ps@#2@even@right@head\endcsname
2029 \expandafter\let\csname sls@ps@#1@odd@left@head\expandafter\endcsname
2030 \csname sls@ps@#2@odd@left@head\endcsname
2031 \expandafter\let\csname sls@ps@#1@odd@middle@head\expandafter\endcsname
2032 \csname sls@ps@#2@odd@middle@head\endcsname
2033 \expandafter\let\csname sls@ps@#1@odd@right@head\expandafter\endcsname
2034 \csname sls@ps@#2@odd@right@head\endcsname
2035 \expandafter\let\csname sls@ps@#1@even@left@foot\expandafter\endcsname
2036 \csname sls@ps@#2@even@left@foot\endcsname
2037 \expandafter\let\csname sls@ps@#1@even@middle@foot\expandafter\endcsname
2038 \csname sls@ps@#2@even@middle@foot\endcsname
2039 \expandafter\let\csname sls@ps@#1@even@right@foot\expandafter\endcsname
2040 \csname sls@ps@#2@even@right@foot\endcsname
2041 \expandafter\let\csname sls@ps@#1@odd@left@foot\expandafter\endcsname
2042 \csname sls@ps@#2@odd@left@foot\endcsname
2043 \expandafter\let\csname sls@ps@#1@odd@middle@foot\expandafter\endcsname
2044 \csname sls@ps@#2@odd@middle@foot\endcsname
2045 \expandafter\let\csname sls@ps@#1@odd@right@foot\expandafter\endcsname
2046 \csname sls@ps@#2@odd@right@foot\endcsname
2047 }%
2048 % \end{macrocode}
2049 % \end{macro}^^A \sls@init@@pair@page@style
2050 % \begin{macro}{\sls@let@pair@page@style}
2051 % \begin{description}
2052 % \item[\marg{command}:] a single command used to initialise the commands of
2053 % the page style commands.
2054 % \item[\marg{string}:] the name of a member of a page style pair, that should
2055 % be used to initialise one the member of a page style pair from first
2056 % argument.
2057 % \end{description}
2058 % A little helper for \cs{sls@init@pair@page@style}.
2059 % \begin{macrocode}
2060 \newcommand*{\sls@let@pair@page@style}[2]{%
2061 \expandafter\let\csname sls@ps@#2@even@left@head\endcsname #1%
2062 \expandafter\let\csname sls@ps@#2@even@middle@head\endcsname #1%
2063 \expandafter\let\csname sls@ps@#2@even@right@head\endcsname #1%
2064 \expandafter\let\csname sls@ps@#2@odd@left@head\endcsname #1%
2065 \expandafter\let\csname sls@ps@#2@odd@middle@head\endcsname #1%
2066 \expandafter\let\csname sls@ps@#2@odd@right@head\endcsname #1%
2067 \expandafter\let\csname sls@ps@#2@even@left@foot\endcsname #1%
2068 \expandafter\let\csname sls@ps@#2@even@middle@foot\endcsname #1%
2069 \expandafter\let\csname sls@ps@#2@even@right@foot\endcsname #1%
2070 \expandafter\let\csname sls@ps@#2@odd@left@foot\endcsname #1%
2071 \expandafter\let\csname sls@ps@#2@odd@middle@foot\endcsname #1%
2072 \expandafter\let\csname sls@ps@#2@odd@right@foot\endcsname #1%
2073 }%
2074 % \end{macrocode}
2075 % \end{macro}^^A \sls@let@pair@page@style
2076 % \end{macro}^^A \sls@init@pair@page@style
2077 % \begin{macro}{\sls@def@pair@page@style@member}
2078 % \changes{v3.24}{2017/05/04}{improved \textsf{bidi} compatibility}
2079 % \changes{v3.27}{2019/04/05}{\cs{centering} replaced by
2080 % \cs{LaTeXcentering}}
2081 % \changes{v3.27}{2019/04/05}{\cs{raggedright} replaced by
2082 % \cs{LaTeXraggedright}}
2083 % \changes{v3.27}{2019/04/05}{\cs{raggedleft} replaced by
2084 % \cs{LaTeXraggedleft}}
2085 % \begin{description}
2086 % \item[\marg{string}:] name of the page style to be defined.
2087 % \end{description}
2088 % A little helper for \cs{defpairofpagestyles}.
2089 % \begin{macrocode}
2090 \newcommand*{\sls@def@pair@page@style@member}[1]{%
2091 \defpagestyle{#1}{%
2092 {%
2093 \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@headwidth}{\LaTeXraggedright
2094 \strut\@nameuse{sls@ps@#1@even@left@head}\strut}}%
2095 \parbox{\sls@headwidth}{\LaTeXcentering
2096 \strut\@nameuse{sls@ps@#1@even@middle@head}\strut}%
2097 \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@headwidth}{\LaTeXraggedleft
2098 \strut\@nameuse{sls@ps@#1@even@right@head}\strut}}%
2099 }{%
2100 \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@headwidth}{\LaTeXraggedright
2101 \strut\@nameuse{sls@ps@#1@odd@left@head}\strut}}%
2102 \parbox{\sls@headwidth}{\LaTeXcentering
2103 \strut\@nameuse{sls@ps@#1@odd@middle@head}\strut}%
2104 \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@headwidth}{\LaTeXraggedleft
2105 \strut\@nameuse{sls@ps@#1@odd@right@head}\strut}}%
2106 }{%
2107 \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@headwidth}{\LaTeXraggedright
2108 \strut\@nameuse{sls@ps@#1@odd@left@head}\strut}}%
2109 \parbox{\sls@headwidth}{\LaTeXcentering
2110 \strut\@nameuse{sls@ps@#1@odd@middle@head}\strut}%
2111 \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@headwidth}{\LaTeXraggedleft
2112 \strut\@nameuse{sls@ps@#1@odd@right@head}\strut}}%
2113 }%
2114 }{%
2115 {%
2116 \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@footwidth}{\LaTeXraggedright
2117 \strut\@nameuse{sls@ps@#1@even@left@foot}\strut}}%
2118 \parbox{\sls@footwidth}{\LaTeXcentering
2119 \strut\@nameuse{sls@ps@#1@even@middle@foot}\strut}%
2120 \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@footwidth}{\LaTeXraggedleft
2121 \strut\@nameuse{sls@ps@#1@even@right@foot}\strut}}%
2122 }{%
2123 \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@footwidth}{\LaTeXraggedright
2124 \strut\@nameuse{sls@ps@#1@odd@left@foot}\strut}}%
2125 \parbox{\sls@footwidth}{\LaTeXcentering
2126 \strut\@nameuse{sls@ps@#1@odd@middle@foot}\strut}%
2127 \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@footwidth}{\LaTeXraggedleft
2128 \strut\@nameuse{sls@ps@#1@odd@right@foot}\strut}}%
2129 }{%
2130 \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@footwidth}{\LaTeXraggedright
2131 \strut\@nameuse{sls@ps@#1@odd@left@foot}\strut}}%
2132 \parbox{\sls@footwidth}{\LaTeXcentering
2133 \strut\@nameuse{sls@ps@#1@odd@middle@foot}\strut}%
2134 \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@footwidth}{\LaTeXraggedleft
2135 \strut\@nameuse{sls@ps@#1@odd@right@foot}\strut}}%
2136 }%
2137 }%
2138 }%
2139 %</body>
2140 % \end{macrocode}
2141 % \end{macro}^^A \sls@def@pair@page@style@member
2142 % \end{command}^^A \defpairofpagestyles
2143 %
2144 % \begin{command}{\newpairofpagestyles,\renewpairofpagestyles,
2145 % \providepairofpagestyles}
2146 % See \cs{defpairofpagestyles} for the arguments.
2147 % \begin{macrocode}
2148 %<*body>
2149 \newcommand*{\newpairofpagestyles}[3][]{%
2150 \scr@ifundefinedorrelax{ps@#2}{%
2151 \@ifundefined{ps@plain.#2}{\defpairofpagestyles[#1]{#2}{#3}}{%
2152 \PackageError{scrlayer-scrpage}{%
2153 Plain page style of `#2' already defined}{%
2154 You may only define a new pair of page styles, if neither the style
2155 itself\MessageBreak
2156 nor it's plain page style has already been defined.\MessageBreak
2157 You may use only \string\defpairofpagestyles\space or
2158 \string\providepairofpagestyles\space with partly\MessageBreak
2159 already defined page styles.\MessageBreak
2160 If you'll continue, your command will be ignored.%
2161 }%
2162 }%
2163 }{%
2164 \PackageError{scrlayer-scrpage}{%
2165 Page style `#2' already defined}{%
2166 You may only define a new pair of page styles, if neither the style
2167 itself\MessageBreak
2168 nor it's plain page style has already been defined.\MessageBreak
2169 You may use either \string\renewpairsofpagestyles,
2170 \string\defpairofpagestyles, or\MessageBreak
2171 \string\providepairofpagestyles\space with already defined page
2172 styles.\MessageBreak
2173 If you'll continue, your command will be ignored.%
2174 }%
2175 }%
2176 }%
2177 \newcommand*{\renewpairofpagestyles}[3][]{%
2178 \scr@ifundefinedorrelax{ps@#2}{%
2179 \PackageError{scrlayer-scrpage}{%
2180 Undefined page style `#2'}{%
2181 You may only redefine existing pairs of page styles. You may use
2182 either\MessageBreak
2183 \string\newpairsofpagestyles, \string\defpairofpagestyles, or
2184 \string\providepairofpagestyles\MessageBreak
2185 with not yet defined page styles.\MessageBreak
2186 If you'll continue, your command will be ignored.%
2187 }%
2188 }{%
2189 \@ifundefined{ps@plain.#2}{%
2190 \PackageError{scrlayer-scrpage}{%
2191 Undefined plain page style of `#2'}{%
2192 You may only redefine existing pairs of page styles. You may use
2193 either\MessageBreak
2194 \string\defpairofpagestyles\space or
2195 \string\providepairofpagestyles\space with partly already
2196 defined\MessageBreak
2197 page styles.\MessageBreak
2198 If you'll continue, your command will be ignored.%
2199 }%
2200 }{\defpairofpagestyles[#1]{#2}{#3}}%
2201 }%
2202 }%
2203 \newcommand*{\providepairofpagestyles}[3][]{%
2204 \scr@ifundefinedorrelax{ps@#2}{%
2205 \@ifundefined{ps@plain.#2}{\defpairofpagestyles[#1]{#2}{#3}}{%
2206 %<*trace>
2207 \PackageInfo{scrlayer-scrpage}{%
2208 Plain page style of `#2' already\MessageBreak
2209 defined. Definition ignored}%
2210 %</trace>
2211 }%
2212 }{%
2213 %<*trace>
2214 \PackageInfo{scrlayer-scrpage}{%
2215 Page style of `#2' already defined.\MessageBreak
2216 Definition ignored}%
2217 %</trace>
2218 }%
2219 }%
2220 %</body>
2221 % \end{macrocode}
2222 % \end{command}^^A \newpairofpagestyles … \providepairofpagestyles
2223 %
2224 %
2225 % \begin{pgstyle}{scrheading,plain.scrheadings}
2226 % We have one predefined pair: \texttt{scrheadings} with plain page style
2227 % \texttt{plain.scrheadings}.
2228 % \begin{macrocode}
2229 %<*body>
2230 \newpairofpagestyles{scrheadings}{}%
2231 % \end{macrocode}
2232 % \begin{pgstyle}{scrplain}
2233 % But with package \pkg{scrpage2}
2234 % the plain page style was \texttt{scrplain}. So we make a kind of alias:
2235 % \begin{macrocode}
2236 \DeclarePageStyleAlias{scrplain}{plain.scrheadings}
2237 %</body>
2238 % \end{macrocode}
2239 % \end{pgstyle}^^A scrplain
2240 % \end{pgstyle}^^A scrheadings,plain.scrheadings
2241 %
2242 %
2243 % \begin{command}{\ihead,\ohead,\chead,
2244 % \lehead,\lohead,\rehead,\rohead,\cehead,\cohead,
2245 % \ifoot,\ofoot,\cfoot,
2246 % \lefoot,\lofoot,\refoot,\rofoot,\cefoot,\cofoot}
2247 % \changes{v3.14}{2014/09/19}{new star version double the argument}
2248 % \changes{v3.20}{2016/04/12}{\cs{ifstar} replaced by \cs{kernel@ifstar}}
2249 % We also need macros to define the contents of the three part head and
2250 % foot. Each macro defines one of the part of head or foot of the
2251 % \emph{headings} page style member and optional of the \emph{plain} page
2252 % style member.
2253 % \begin{macrocode}
2254 %<*body>
2255 \newcommand*{\ihead}{\kernel@ifstar {\@dblarg\@@@ihead}{\@ihead}}%
2256 % \end{macrocode}
2257 % \begin{macro}{\@ihead}
2258 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
2259 % \cs{kernel@ifnextchar}}
2260 % \begin{macro}{\@@ihead,\@@@ihead}
2261 % \changes{v3.27}{2019/04/05}{long}
2262 % Two helpers for the previous one to double the command and it's arguments.
2263 % \begin{macrocode}
2264 \newcommand*{\@ihead}{\kernel@ifnextchar[{\@@@ihead}{\@@ihead}}%
2265 \newcommand{\@@ihead}[1]{\rehead{#1}\lohead{#1}}%
2266 \newcommand{\@@@ihead}[2][]{\rehead[{#1}]{#2}\lohead[{#1}]{#2}}%
2267 % \end{macrocode}
2268 % \end{macro}^^A \@@ihead,\@@@ihead
2269 % \end{macro}^^A \@ihead
2270 % \begin{macrocode}
2271 \newcommand*{\ohead}{\kernel@ifstar {\@dblarg\@@@ohead}{\@ohead}}%
2272 % \end{macrocode}
2273 % \begin{macro}{\@ohead}
2274 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
2275 % \cs{kernel@ifnextchar}}
2276 % \begin{macro}{\@@ohead,\@@@ohead}
2277 % \changes{v3.27}{2019/04/05}{long}
2278 % Two helpers for the previous one to double the command and it's arguments.
2279 % \begin{macrocode}
2280 \newcommand*{\@ohead}{\kernel@ifnextchar[{\@@@ohead}{\@@ohead}}%
2281 \newcommand{\@@ohead}[1]{\lehead{#1}\rohead{#1}}%
2282 \newcommand{\@@@ohead}[2][]{\lehead[{#1}]{#2}\rohead[{#1}]{#2}}%
2283 % \end{macrocode}
2284 % \end{macro}^^A \@@ohead,\@@@ohead
2285 % \end{macro}^^A \@ohead
2286 % \begin{macrocode}
2287 \newcommand*{\chead}{\kernel@ifstar {\@dblarg\@@@chead}{\@chead}}%
2288 % \end{macrocode}
2289 % \begin{macro}{\@chead}
2290 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
2291 % \cs{kernel@ifnextchar}}
2292 % \begin{macro}{\@@chead,\@@@chead}
2293 % \changes{v3.27}{2019/04/05}{long}
2294 % Two helpers for the previous one to double the command and it's arguments.
2295 % \begin{macrocode}
2296 \newcommand*{\@chead}{\kernel@ifnextchar[{\@@@chead}{\@@chead}}%
2297 \newcommand{\@@chead}[1]{\cehead{#1}\cohead{#1}}%
2298 \newcommand{\@@@chead}[2][]{\cehead[{#1}]{#2}\cohead[{#1}]{#2}}%
2299 % \end{macrocode}
2300 % \end{macro}^^A \@@chead,\@@@chead
2301 % \end{macro}^^A \@chead
2302 % \begin{macrocode}
2303 \newcommand*{\lehead}{\sls@renewelement{even}{left}{head}}%
2304 \newcommand*{\lohead}{\sls@renewelement{odd}{left}{head}}%
2305 \newcommand*{\rehead}{\sls@renewelement{even}{right}{head}}%
2306 \newcommand*{\rohead}{\sls@renewelement{odd}{right}{head}}%
2307 \newcommand*{\cehead}{\sls@renewelement{even}{middle}{head}}%
2308 \newcommand*{\cohead}{\sls@renewelement{odd}{middle}{head}}%
2309 % \end{macrocode}
2310 % \begin{macrocode}
2311 \newcommand*{\ifoot}{\kernel@ifstar {\@dblarg\@@@ifoot}{\@ifoot}}%
2312 % \end{macrocode}
2313 % \begin{macro}{\@ifoot}
2314 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
2315 % \cs{kernel@ifnextchar}}
2316 % \begin{macro}{\@@ifoot,\@@@ifoot}
2317 % \changes{v3.27}{2019/04/05}{long}
2318 % Two helpers for the previous one to double the command and it's arguments.
2319 % \begin{macrocode}
2320 \newcommand*{\@ifoot}{\kernel@ifnextchar[{\@@@ifoot}{\@@ifoot}}%
2321 \newcommand{\@@ifoot}[1]{\refoot{#1}\lofoot{#1}}%
2322 \newcommand{\@@@ifoot}[2][]{\refoot[{#1}]{#2}\lofoot[{#1}]{#2}}%
2323 % \end{macrocode}
2324 % \end{macro}^^A \@@ifoot,\@@@ifoot
2325 % \end{macro}^^A \@ifoot
2326 % \begin{macrocode}
2327 \newcommand*{\ofoot}{\kernel@ifstar {\@dblarg\@@@ofoot}{\@ofoot}}%
2328 % \end{macrocode}
2329 % \begin{macro}{\@ofoot}
2330 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
2331 % \cs{kernel@ifnextchar}}
2332 % \begin{macro}{\@@ofoot,\@@@ofoot}
2333 % \changes{v3.27}{2019/04/05}{long}
2334 % Two helpers for the previous one to double the command and it's arguments.
2335 % \begin{macrocode}
2336 \newcommand*{\@ofoot}{\kernel@ifnextchar[{\@@@ofoot}{\@@ofoot}}%
2337 \newcommand{\@@ofoot}[1]{\lefoot{#1}\rofoot{#1}}%
2338 \newcommand{\@@@ofoot}[2][]{\lefoot[{#1}]{#2}\rofoot[{#1}]{#2}}%
2339 % \end{macrocode}
2340 % \end{macro}^^A \@@ofoot,\@@@ofoot
2341 % \end{macro}^^A \@ofoot
2342 % \begin{macrocode}
2343 \newcommand*{\cfoot}{\kernel@ifstar {\@dblarg\@@@cfoot}{\@cfoot}}%
2344 % \end{macrocode}
2345 % \begin{macro}{\@cfoot}
2346 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
2347 % \cs{kernel@ifnextchar}}
2348 % \begin{macro}{\@@cfoot,\@@@cfoot}
2349 % \changes{v3.27}{2019/04/05}{long}
2350 % Two helpers for the previous one to double the command and it's arguments.
2351 % \begin{macrocode}
2352 \newcommand*{\@cfoot}{\kernel@ifnextchar[{\@@@cfoot}{\@@cfoot}}%
2353 \newcommand{\@@cfoot}[1]{\cefoot{#1}\cofoot{#1}}%
2354 \newcommand{\@@@cfoot}[2][]{\cefoot[{#1}]{#2}\cofoot[{#1}]{#2}}%
2355 % \end{macrocode}
2356 % \end{macro}^^A \@@cfoot,\@@@cfoot
2357 % \end{macro}^^A \@cfoot
2358 % \begin{macrocode}
2359 \newcommand*{\lefoot}{\sls@renewelement{even}{left}{foot}}%
2360 \newcommand*{\lofoot}{\sls@renewelement{odd}{left}{foot}}%
2361 \newcommand*{\refoot}{\sls@renewelement{even}{right}{foot}}%
2362 \newcommand*{\rofoot}{\sls@renewelement{odd}{right}{foot}}%
2363 \newcommand*{\cefoot}{\sls@renewelement{even}{middle}{foot}}%
2364 \newcommand*{\cofoot}{\sls@renewelement{odd}{middle}{foot}}%
2365 % \end{macrocode}
2366 % \begin{macro}{\sls@renewelement}
2367 % \begin{macro}{\sls@@renewelement}
2368 % \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
2369 % \cs{kernel@ifnextchar}}
2370 % \changes{v3.20}{2016/04/12}{\cs{ifstar} replaced by \cs{kernel@ifstar}}
2371 % \begin{macro}{\sls@@@renewelement,\sls@@@@renewelement,
2372 % \sls@@renewplainelement}
2373 % \changes{v3.27}{2019/04/05}{long}
2374 % Little helper for several of the above commands.
2375 % \begin{macrocode}
2376 \newcommand*{\sls@renewelement}[3]{%
2377 \kernel@ifstar{\@dblarg{\sls@@@@renewelement{#1}{#2}{#3}}}%
2378 {\sls@@renewelement{#1}{#2}{#3}}%
2379 }%
2380 \newcommand*{\sls@@renewelement}[3]{%
2381 \kernel@ifnextchar[%]
2382 {\sls@@@@renewelement{#1}{#2}{#3}}%
2383 {\sls@@@renewelement{#1}{#2}{#3}}%
2384 }%
2385 \newcommand{\sls@@@renewelement}[4]{%
2386 \scr@ifundefinedorrelax{sls@ps@\sls@currentheadings @#1@#2@#3}{%
2387 \@namedef{sls@ps@scrheadings@#1@#2@#3}{#4}%
2388 }{%
2389 \@namedef{sls@ps@\sls@currentheadings @#1@#2@#3}{#4}%
2390 }%
2391 }%
2392 \newcommand*{\sls@@@@renewelement}{}
2393 \long\def\sls@@@@renewelement#1#2#3[#4]#5{%
2394 \sls@@renewplainelement{#1}{#2}{#3}{#4}%
2395 \sls@@@renewelement{#1}{#2}{#3}{#5}%
2396 }%
2397 \newcommand{\sls@@renewplainelement}[4]{%
2398 \scr@ifundefinedorrelax{sls@ps@\sls@currentplain @#1@#2@#3}{%
2399 \@namedef{sls@[email protected]@#1@#2@#3}{#4}%
2400 }{%
2401 \@namedef{sls@ps@\sls@currentplain @#1@#2@#3}{#4}%
2402 }%
2403 }%
2404 %</body>
2405 % \end{macrocode}
2406 % \end{macro}^^A \sls@@@renewelement … \sls@@renewplainelement
2407 % \end{macro}^^A \sls@@renewelement
2408 % \end{macro}^^A \sls@renewelement
2409 % \end{command}^^A \ihead … \cofoot
2410 %
2411 %
2412 % \begin{command}{\clearmainofpairofpagestyles}
2413 % \begin{command}{\clearscrheadings}
2414 % \changes{v3.32}{2020/09/11}{deprecation warning added}
2415 % Maybe you want to clear the currently defined head and foot. First
2416 % let's clear only scrheadings pagestyle but not scrplain pagestyle.
2417 % We do this simply using the already known command:
2418 % \begin{macrocode}
2419 %<*body>
2420 \newcommand*{\clearmainofpairofpagestyles}{%
2421 \ihead{}\chead{}\ohead{}\ifoot{}\cfoot{}\ofoot{}%
2422 }%
2423 \newcommand*{\clearscrheadings}{%
2424 \PackageWarning{scrlayer-scrpage}{%
2425 replacing deprecated \string\clearscrheading\space by\MessageBreak
2426 \string\clearmainofpairofpagestyles
2427 }%
2428 \clearmainofpairofpagestyles
2429 }
2430 %</body>
2431 % \end{macrocode}
2432 % \end{command}^^A \clearscrheadings
2433 % \end{command}^^A \clearmainofpairofpagestyles
2434 % \begin{command}{\clearplainofpairofpagestyles}
2435 % \begin{command}{\clearscrplain}
2436 % \changes{v3.32}{2020/09/11}{deprecation warning added}
2437 % Now, we use the not recommended feature to set up a plain style:
2438 % \begin{macrocode}
2439 %<*body>
2440 \newcommand*{\clearplainofpairofpagestyles}{%
2441 \sls@@renewplainelement{odd}{left}{head}{}%
2442 \sls@@renewplainelement{odd}{right}{head}{}%
2443 \sls@@renewplainelement{odd}{middle}{head}{}%
2444 \sls@@renewplainelement{even}{left}{head}{}%
2445 \sls@@renewplainelement{even}{right}{head}{}%
2446 \sls@@renewplainelement{even}{middle}{head}{}%
2447 \sls@@renewplainelement{odd}{left}{foot}{}%
2448 \sls@@renewplainelement{odd}{right}{foot}{}%
2449 \sls@@renewplainelement{odd}{middle}{foot}{}%
2450 \sls@@renewplainelement{even}{left}{foot}{}%
2451 \sls@@renewplainelement{even}{right}{foot}{}%
2452 \sls@@renewplainelement{even}{middle}{foot}{}%
2453 }%
2454 \newcommand*{\clearscrplain}{%
2455 \PackageWarning{scrlayer-scrpage}{%
2456 replacing deprecated \string\clearscrplain\space by\MessageBreak
2457 \string\clearplainofpairofpagestyles
2458 }%
2459 \clearplainofpairofpagestyles
2460 }
2461 %</body>
2462 % \end{macrocode}
2463 % \end{command}^^A \clearscrplain
2464 % \end{command}^^A \clearplainofpairofpagestyles
2465 % \begin{command}{\clearpairofpagestyles}
2466 % \begin{command}{\clearscrheadfoot}
2467 % \changes{v3.32}{2020/09/11}{deprecation warning added}
2468 % Last but not least we clean up both, the main and the plain:
2469 % \begin{macrocode}
2470 %<*body>
2471 \newcommand*{\clearpairofpagestyles}{%
2472 \ihead[]{}\chead[]{}\ohead[]{}\ifoot[]{}\cfoot[]{}\ofoot[]{}%
2473 }%
2474 \newcommand*{\clearscrheadfoot}{%
2475 \PackageWarning{scrlayer-scrpage}{%
2476 replacing deprecated \string\clearscrheadfoot\space by\MessageBreak
2477 \string\clearpairofpagestyles
2478 }%
2479 \clearpairofpagestyles
2480 }
2481 %</body>
2482 % \end{macrocode}
2483 % \end{command}^^A \clearscrheadfoot
2484 % \end{command}^^A \clearpairofpagestyles
2485 %
2486 %
2487 % \begin{pgstyle}{useheadings,plain.useheadings}
2488 % Not longer supported:
2489 % \begin{macrocode}
2490 %<*body>
2491 \newcommand*\ps@useheadings{%
2492 \PackageWarning{scrlayer-scrpage}{incompatible page style!\MessageBreak
2493 Page styles like `headings' and `plain'\MessageBreak
2494 are incompatible with the page styles\MessageBreak
2495 of scrlayer-scrpage. You shouldn't mix\MessageBreak
2496 them up. Therefore page style\MessageBreak
2497 `useheadings' is not longer provided.\MessageBreak
2498 Usage is deprecated and will be replaced\MessageBreak
2499 by `scrheadings'%
2500 }%
2501 \let\ps@useheadings\ps@scrheadings
2502 \ps@useheadings
2503 }%
2504 \expandafter\newcommand\expandafter*\csname [email protected]\endcsname{%
2505 \@nameuse{[email protected]}%
2506 }%
2507 %</body>
2508 % \end{macrocode}
2509 % \end{pgstyle}^^A useheadings,plain.useheadings
2510 %
2511 % \begin{macrocode}
2512 %</interface>
2513 % \end{macrocode}
2514 %
2515 % \Finale
2516 % \PrintChanges
2517 %
2518 \endinput
2519 % Local Variables:
2520 % mode: doctex
2521 % ispell-local-dictionary: "en_US"
2522 % eval: (flyspell-mode 1)
2523 % TeX-master: t
2524 % TeX-engine: luatex-dev
2525 % eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx"))
2526 % End: