| 1 |
% \iffalse^^A meta-comment |
| 2 |
% ====================================================================== |
| 3 |
% scrlayer.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.dtx 4145 2025-05-13 16:54:14Z kohm $ |
| 22 |
%<identify>%%% (run: identify) |
| 23 |
%<init>%%% (run: init) |
| 24 |
%<options>%%% (run: options) |
| 25 |
%<body>%%% (run: body) |
| 26 |
%<final>%%% (run: final) |
| 27 |
%<*dtx> |
| 28 |
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi |
| 29 |
\begingroup |
| 30 |
\def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}} |
| 31 |
\filedate$Date: 2025-05-13 18:54:14 +0200 (Di, 13. Mai 2025) $ |
| 32 |
\def\filerevision$#1: #2 ${\gdef\filerevision{r#2}} |
| 33 |
\filerevision$Revision: 4145 $ |
| 34 |
\edef\reserved@a{% |
| 35 |
\noexpand\endgroup |
| 36 |
\noexpand\ProvidesFile{scrlayer.dtx}% |
| 37 |
[\filedate\space\filerevision\space |
| 38 |
KOMA-Script package source |
| 39 |
}% |
| 40 |
\reserved@a |
| 41 |
%</dtx> |
| 42 |
%<*identify|doc> |
| 43 |
%<package>\NeedsTeXFormat{LaTeX2e}[2022/06/01] |
| 44 |
%<package>\ProvidesPackage{scrlayer}[% |
| 45 |
%<doc>\ProvidesFile{scrlayer.tex}[% |
| 46 |
%!KOMAScriptVersion |
| 47 |
%<package> package |
| 48 |
%</identify|doc> |
| 49 |
%<*dtx|identify|doc> |
| 50 |
(defining layers and page styles)] |
| 51 |
%</dtx|identify|doc> |
| 52 |
%<*dtx> |
| 53 |
\ifx\documentclass\undefined |
| 54 |
\input scrdocstrip.tex |
| 55 |
\@@input scrkernel-version.dtx |
| 56 |
\@@input scrstrip.inc |
| 57 |
\KOMAdefVariable{COPYRIGHTFROM}{2012} |
| 58 |
\generate{\usepreamble\defaultpreamble |
| 59 |
\file{scrlayer.sty}{% |
| 60 |
\from{scrlayer.dtx}{package,scrlayer,identify}% |
| 61 |
\from{scrlayer.dtx}{package,scrlayer,init}% |
| 62 |
\from{scrlayer.dtx}{package,scrlayer,options}% |
| 63 |
\from{scrlayer.dtx}{package,scrlayer,body}% |
| 64 |
\from{scrlayer.dtx}{package,scrlayer,final}% |
| 65 |
\from{scrlogo.dtx}{logo}% |
| 66 |
}% |
| 67 |
} |
| 68 |
|
| 69 |
\batchinput{scrlayer-scrpage.dtx} |
| 70 |
\batchinput{scrlayer-notecolumn.dtx} |
| 71 |
\@@input scrstrop.inc |
| 72 |
\else |
| 73 |
\let\endbatchfile\relax |
| 74 |
\fi |
| 75 |
\endbatchfile |
| 76 |
\documentclass[USenglish]{koma-script-source-doc} |
| 77 |
\usepackage{babel} |
| 78 |
\setcounter{StandardModuleDepth}{2} |
| 79 |
\begin{document} |
| 80 |
\DocInput{scrlayer.dtx} |
| 81 |
\end{document} |
| 82 |
%</dtx> |
| 83 |
% \fi^^A meta-comment |
| 84 |
% |
| 85 |
% \changes{v0.0}{2012/01/01}{Start of new package} |
| 86 |
% \changes{v0.9}{2014/07/25}{User documentation removed} |
| 87 |
% \changes{v3.36}{2022/02/08}{switch over from \cls*{scrdoc} to |
| 88 |
% \cls*{koma-script-source-doc}} |
| 89 |
% \changes{v3.36}{2022/02/08}{require package \pkg*{scrlogo} instead of |
| 90 |
% defining \cs{KOMAScript}} |
| 91 |
% \changes{v3.36}{2022/02/08}{whole implementation documentation in English} |
| 92 |
% \changes{v3.40}{2023/04/17}{guide names changed} |
| 93 |
% |
| 94 |
% \GetFileInfo{scrlayer.dtx} |
| 95 |
% \title{Layers and Page Styles with \href{https://komascript.de}{\KOMAScript} |
| 96 |
% Package \pkg*{scrlayer}} |
| 97 |
% \author{\href{mailto:[email protected]}{Markus Kohm}} |
| 98 |
% \date{Revision \fileversion{} of \filedate} |
| 99 |
% \maketitle |
| 100 |
% \begin{abstract} |
| 101 |
% Usually page styles only define the page header and page footer. But with |
| 102 |
% \pkg*{scrlayer} page styles consist of multiple layers, that can be placed |
| 103 |
% everywhere in the page background or foreground. |
| 104 |
% \end{abstract} |
| 105 |
% \tableofcontents |
| 106 |
% |
| 107 |
% \section{User Manual} |
| 108 |
% |
| 109 |
% You can find the user manuals of \pkg*{scrlayer} in the \KOMAScript{} |
| 110 |
% manual, either the German \file{scrguide-de.pdf} or the English |
| 111 |
% \file{scrguide-en.pdf}. |
| 112 |
% |
| 113 |
% \MaybeStop{\PrintIndex} |
| 114 |
% |
| 115 |
% \section{Implementation of \pkg*{scrlayer}} |
| 116 |
% |
| 117 |
% \begin{macrocode} |
| 118 |
%<*package|interface|class> |
| 119 |
% \end{macrocode} |
| 120 |
% |
| 121 |
% \subsection{Initialising some values before the options} |
| 122 |
% |
| 123 |
% \begin{macrocode} |
| 124 |
%<*init> |
| 125 |
% \end{macrocode} |
| 126 |
% |
| 127 |
% Initialisation before all options. |
| 128 |
% |
| 129 |
% \begin{macro}{\scrlayer@@inherited@options@cslist, |
| 130 |
% \scrlayer@@add@inherited@option} |
| 131 |
% \changes{v3.33}{2021/02/15}{added} |
| 132 |
% \begin{macro}{\scrlayer@do@inherited@options, |
| 133 |
% \scrlayer@inherit@option} |
| 134 |
% \changes{v3.33}{2021/02/15}{added (interface command)} |
| 135 |
% The options of \textsf{scrlayer} should be passed to \textsf{scrlayer} while |
| 136 |
% loading an interface package. We use the comma-separated-list |
| 137 |
% \cs{scrlayer@@inherited@options@cslist} to store all of them, so the |
| 138 |
% interface packages are able to process them via |
| 139 |
% \cs{scrlayer@do@inherited@options} which has an optional command, the |
| 140 |
% \texttt{KOMA} member defined by the interface package. The default of the |
| 141 |
% optional argument is (as usual) |
| 142 |
% ``\texttt{.}\cs{@currname}\texttt{.}\cs{currext}''. This option is passed to |
| 143 |
% the command, that is used a second argument, which is the first mandatory |
| 144 |
% argument. |
| 145 |
% Last but not least \cs{scrlayer@inherit@option} is the usual inheritance |
| 146 |
% function. It adds a new \texttt{KOMA} option and also removes it at the end |
| 147 |
% of the package. It should be used \emph{before} \cs{KOMAProcessOptions}. It |
| 148 |
% has three arguments: the \texttt{KOMA} member and the option name. |
| 149 |
% |
| 150 |
% With this the usual execution order of an interface package would be: |
| 151 |
% \begin{verbatim} |
| 152 |
% \RequirePackage{scrlayer}[2021/02/15] |
| 153 |
% \scrlayer@do@inherited@options{\scrlayer@inherit@option} |
| 154 |
% \end{verbatim} |
| 155 |
% \begin{macrocode} |
| 156 |
%<*package> |
| 157 |
\newcommand*{\scrlayer@@inherited@options@cslist}{} |
| 158 |
\newcommand*{\scrlayer@@add@inherited@option}[1]{% |
| 159 |
\ifx\scrlayer@@inherited@options@cslist\@empty |
| 160 |
\g@addto@macro\scrlayer@@inherited@options@cslist{#1}% |
| 161 |
\else |
| 162 |
\g@addto@macro\scrlayer@@inherited@options@cslist{,#1}% |
| 163 |
\fi |
| 164 |
} |
| 165 |
\newcommand*{\scrlayer@do@inherited@options}[2][.\@currname.\@currext]{% |
| 166 |
\@for \reserved@a:=\scrlayer@@inherited@options@cslist \do {% |
| 167 |
\edef\reserved@a{\unexpanded{#2}{#1}{\reserved@a}}% |
| 168 |
\reserved@a |
| 169 |
}% |
| 170 |
} |
| 171 |
\newcommand*{\scrlayer@inherit@option}[2]{% |
| 172 |
\DefineFamilyMember[#1]{KOMA}% |
| 173 |
\expandafter\let\csname KV@KOMA#1@#2\expandafter\endcsname |
| 174 |
\csname [email protected]@#2\endcsname |
| 175 |
\expandafter\let\csname KV@KOMA#1@#2@default\expandafter\endcsname |
| 176 |
\csname [email protected]@#2@default\expandafter\endcsname |
| 177 |
\AtEndOfPackage{% |
| 178 |
\RelaxFamilyKey[{#1}]{KOMA}{#2}% |
| 179 |
}% |
| 180 |
} |
| 181 |
\@onlypreamble\scr@do@inherited@options |
| 182 |
\@onlypreamble\scr@inherit@option |
| 183 |
%</package> |
| 184 |
% \end{macrocode} |
| 185 |
% \end{macro} |
| 186 |
% \end{macro} |
| 187 |
% |
| 188 |
% While there are \KOMAScript{} options, we need \pkg*{scrkbase} to declare |
| 189 |
% them, but the interfaces also needs \pkg*{scrlayer} which already |
| 190 |
% includes \pkg*{scrkbase}. |
| 191 |
% \begin{macrocode} |
| 192 |
%<package>\RequirePackage{scrkbase}[2013/03/05] |
| 193 |
%<interface>\RequirePackage{scrlayer} |
| 194 |
% \end{macrocode} |
| 195 |
% |
| 196 |
% |
| 197 |
% \begin{macro}{\scrlayer@AtEndOfPackage} |
| 198 |
% Initial \cs{AtEndOfPackage}, but after end of package |
| 199 |
% \cs{@firstofone}. |
| 200 |
% \begin{macrocode} |
| 201 |
\scr@ifundefinedorrelax{scrlayer@AtEndOfPackage}{% |
| 202 |
\AtEndOfPackage{\let\scrlayer@AtEndOfPackage\@firstofone}% |
| 203 |
}{% |
| 204 |
\ifx\scrlayer@AtEndOfPackage\@firstofone |
| 205 |
\AtEndOfPackage{\let\scrlayer@AtEndOfPackage\@firstofone}% |
| 206 |
\fi |
| 207 |
} |
| 208 |
\let\scrlayer@AtEndOfPackage\AtEndOfPackage |
| 209 |
% \end{macrocode} |
| 210 |
% \end{macro}^^A \sls@AtEndOfPackage |
| 211 |
% |
| 212 |
% \begin{macro}{\scrlayer@testunexpectedarg} |
| 213 |
% We'll have several \KOMAScript{} options, that didn't expect an |
| 214 |
% value. So we use this general helper to test the value and report an error |
| 215 |
% if it is not empty (or \cs{relax}). |
| 216 |
% \begin{macrocode} |
| 217 |
%<*package> |
| 218 |
\newcommand*{\scrlayer@testunexpectedarg}[2]{% |
| 219 |
\ifx\relax#2\relax\else |
| 220 |
\PackageError{scrlayer}{unexpected value to `#1'}{% |
| 221 |
Option `#1' doesn't expect any value.\MessageBreak |
| 222 |
If you'll continue, the value `#2' will be ignored.% |
| 223 |
}% |
| 224 |
\fi |
| 225 |
} |
| 226 |
%</package> |
| 227 |
% \end{macrocode} |
| 228 |
% \end{macro}^^A \scrlayer@testunexpectedarg |
| 229 |
% |
| 230 |
% \begin{macro}{\if@chapter,\@chaptertrue,\@chapterfalse} |
| 231 |
% We need this later. But it is something general. So we initialise it as |
| 232 |
% early as possible. |
| 233 |
% \begin{macrocode} |
| 234 |
%<*package> |
| 235 |
\scr@ifundefinedorrelax{if@chapter}{% |
| 236 |
\newif\if@chapter |
| 237 |
\scr@ifundefinedorrelax{chapter}{\@chapterfalse}{\@chaptertrue}% |
| 238 |
}{} |
| 239 |
% \end{macrocode} |
| 240 |
% \end{macro}^^A \if@chapter |
| 241 |
% |
| 242 |
% \begin{macro}{\if@mainmatter} |
| 243 |
% Some classes define \cs{frontmatter} or \cs{mainmatter}, but do not |
| 244 |
% define \cs{if@mainmatter}. But we nee some information about the matter, |
| 245 |
% so in that case, we add it. |
| 246 |
% \begin{macrocode} |
| 247 |
\scr@ifundefinedorrelax{if@mainmatter}{% |
| 248 |
\scr@ifundefinedorrelax{mainmatter}{% |
| 249 |
\newif\if@mainmatter\@mainmattertrue |
| 250 |
}{% |
| 251 |
\PackageWarningNoLine{scrlayer}{% |
| 252 |
\string\mainmatter\space defined without |
| 253 |
\string\if@mainmatter!\MessageBreak |
| 254 |
Note, that several packages need |
| 255 |
\string\if@mainmatter\space\MessageBreak |
| 256 |
to detect whether or no the main matter has been\MessageBreak |
| 257 |
entered. So does scrlayer. Because of this\MessageBreak |
| 258 |
it will extend \string\mainmatter, now% |
| 259 |
}% |
| 260 |
\newif\if@mainmatter\@mainmattertrue |
| 261 |
\expandafter\def\expandafter\mainmatter\expandafter{% |
| 262 |
\expandafter\@mainmattertrue\mainmatter}% |
| 263 |
\scr@ifundefinedorrelax{frontmatter}{}{% |
| 264 |
\expandafter\def\expandafter\frontmatter\expandafter{% |
| 265 |
\expandafter\@mainmatterfalse\frontmatter} |
| 266 |
}% |
| 267 |
\scr@ifundefinedorrelax{backmatter}{}{% |
| 268 |
\expandafter\def\expandafter\backmatter{% |
| 269 |
\expandafter\@mainmatterfalse\backmattter}% |
| 270 |
}% |
| 271 |
}% |
| 272 |
}{} |
| 273 |
%</package> |
| 274 |
% \end{macrocode} |
| 275 |
% \end{macro}^^A \if@mainmatter |
| 276 |
% |
| 277 |
% \begin{macrocode} |
| 278 |
%</init> |
| 279 |
% \end{macrocode} |
| 280 |
% |
| 281 |
% |
| 282 |
% \subsection{Process Options} |
| 283 |
% |
| 284 |
% \begin{macrocode} |
| 285 |
%<*body> |
| 286 |
% \end{macrocode} |
| 287 |
% |
| 288 |
% The very first thing at the body is processing the options: |
| 289 |
% \begin{macrocode} |
| 290 |
%<*package|interface> |
| 291 |
\KOMAProcessOptions\relax |
| 292 |
%</package|interface> |
| 293 |
% \end{macrocode} |
| 294 |
% |
| 295 |
% \subsection{Body Initialisation} |
| 296 |
% |
| 297 |
% Currently not needed. |
| 298 |
% |
| 299 |
% \begin{macrocode} |
| 300 |
%</body> |
| 301 |
% \end{macrocode} |
| 302 |
% |
| 303 |
% |
| 304 |
% \subsection{Extended Running Heads} |
| 305 |
% |
| 306 |
% Package \pkg{scrpage2} changes and extends the running head mechanisms |
| 307 |
% of \LaTeX{} and the classes. Most of this are basic features an therefore |
| 308 |
% done already by \pkg*{scrlayer}. But not the deprecated options. |
| 309 |
% |
| 310 |
% \begin{option}{markcase} |
| 311 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 312 |
% commands removed} |
| 313 |
% \changes{v3.41}{2023/06/16}{new value \texttt{title} to support |
| 314 |
% \cs{MakeTitlecase}} |
| 315 |
% \begin{description} |
| 316 |
% \item[\texttt{=\meta{setting}}] one of: \texttt{upper}, \texttt{lower}, |
| 317 |
% \texttt{title}, \texttt{used}, or \texttt{ignoreuppercase}. |
| 318 |
% \end{description}\noindent |
| 319 |
% The two options \opt{markuppercase} and \opt{markusedcase} become |
| 320 |
% deprecated and are replace be the single option \opt{markcase}. Note, |
| 321 |
% that interface \pkg*{scrlayer-scrpage} has to delay this option to |
| 322 |
% overload case setting of option \opt{pagestyleset}. |
| 323 |
% \begin{macrocode} |
| 324 |
%<*options> |
| 325 |
\KOMA@key{markcase}{% |
| 326 |
%<interface&scrpage>\scrlayer@AtEndOfPackage{% |
| 327 |
\begingroup |
| 328 |
\KOMA@set@ncmdkey{markcase}{reserved@a}{% |
| 329 |
{upper}{0},{lower}{1},{title}{2},{used}{3},% |
| 330 |
{ignoreuppercase}{4},{nouppercase}{4},% |
| 331 |
{ignoreupper}{4},{noupper}{4}% |
| 332 |
}{#1}% |
| 333 |
\ifx\FamilyKeyState\FamilyKeyStateProcessed |
| 334 |
\aftergroup\FamilyKeyStateProcessed |
| 335 |
\ifnum \reserved@a>\m@ne |
| 336 |
\aftergroup\let\aftergroup\MakeMarkcase |
| 337 |
\ifcase \reserved@a |
| 338 |
\aftergroup\MakeUppercase |
| 339 |
\aftergroup\scrlayer@forceignoreuppercasefalse |
| 340 |
\or |
| 341 |
\aftergroup\MakeLowercase |
| 342 |
\aftergroup\scrlayer@forceignoreuppercasefalse |
| 343 |
\or |
| 344 |
\scr@ifundefinedorrelax{MakeTitlecase}{% |
| 345 |
\PackageWarning{scrlayer}{`markcase=title' ignored because |
| 346 |
\string\MakeTitlecase\space not available}% |
| 347 |
\aftergroup\MakeMarkcase |
| 348 |
}{% |
| 349 |
\aftergroup\MakeTitlecase |
| 350 |
}% |
| 351 |
\aftergroup\scrlayer@forceignoreuppercasefalse |
| 352 |
\or |
| 353 |
\aftergroup\@firstofone |
| 354 |
\aftergroup\scrlayer@forceignoreuppercasefalse |
| 355 |
\else |
| 356 |
\aftergroup\scrlayer@ignoreuppercase |
| 357 |
\aftergroup\scrlayer@forceignoreuppercasetrue |
| 358 |
\fi |
| 359 |
\fi |
| 360 |
\else |
| 361 |
\aftergroup\FamilyKeyStateUnknownValue |
| 362 |
\fi |
| 363 |
\endgroup |
| 364 |
\ifx\FamilyKeyState\FamilyKeyStateProcessed |
| 365 |
\KOMA@kav@removekey{scrlayer.sty}{markcase}% |
| 366 |
\KOMA@kav@xadd{scrlayer.sty}{markcase}{#1}% |
| 367 |
\fi |
| 368 |
%<interface&scrpage>}% |
| 369 |
} |
| 370 |
%<package>\scrlayer@@add@inherited@option{markcase} |
| 371 |
%</options> |
| 372 |
%<*interface&body> |
| 373 |
\expandafter\let |
| 374 |
\csname KV@KOMA.\@currname.\@currext @markcase\endcsname\relax |
| 375 |
%</interface&body> |
| 376 |
% \end{macrocode} |
| 377 |
% \begin{command}{\MakeMarkcase} |
| 378 |
% We use this instead of, e.g., \cs{MakeUppercase} for every layer! So the |
| 379 |
% name seams to be wrong, but it is common, so we use it here. |
| 380 |
% \begin{macrocode} |
| 381 |
%<*package&options> |
| 382 |
\@ifundefined{MakeMarkcase}{\let\MakeMarkcase\@firstofone}{} |
| 383 |
\ifx\MakeMarkcase\@firstofone |
| 384 |
\KOMA@kav@replacevalue{scrlayer.sty}{markcase}{used}% |
| 385 |
\else\ifx\MakeMarkcase\MakeUppercase |
| 386 |
\KOMA@kav@replacevalue{scrlayer.sty}{markcase}{upper}% |
| 387 |
\else\ifx\MakeMarkcase\MakeLowercase |
| 388 |
\KOMA@kav@replacevalue{scrlayer.sty}{markcase}{lower}% |
| 389 |
\else\ifx\MakeMarkcase\MakeTitlecase |
| 390 |
\KOMA@kav@replacevalue{scrlayer.sty}{markcase}{title}% |
| 391 |
\else\ifx\MakeMarkcase\scr@ignoreuppercase |
| 392 |
\KOMA@kav@replacevalue{scrlayer.sty}{markcase}{ignoreuppercase}% |
| 393 |
\fi\fi\fi\fi\fi |
| 394 |
% \end{macrocode} |
| 395 |
% \begin{macro}{\scrlayer@ignoreuppercase} |
| 396 |
% We span a group and set \cs{uppercase} and \cs{MakeUppercase} to |
| 397 |
% \cs{@firstofone}. |
| 398 |
% \begin{macrocode} |
| 399 |
\DeclareRobustCommand*{\scrlayer@ignoreuppercase}[1]{% |
| 400 |
\begingroup |
| 401 |
\let\uppercase\@firstofone |
| 402 |
\let\MakeUppercase\@firstofone |
| 403 |
\expandafter\let\csname MakeUppercase \endcsname\@firstofone |
| 404 |
#1% |
| 405 |
\endgroup |
| 406 |
} |
| 407 |
% \end{macrocode} |
| 408 |
% This is almost enough, but standard classes still would show upper-case |
| 409 |
% letters at table of contents, list of figures, list of tables, index and |
| 410 |
% bibliography. So we need an additional workaround. |
| 411 |
% \begin{macro}{\ifscrlayer@forceignoreuppercase} |
| 412 |
% \begin{macrocode} |
| 413 |
\newif\ifscrlayer@forceignoreuppercase |
| 414 |
%</package&options> |
| 415 |
% \end{macrocode} |
| 416 |
% \end{macro}^^A \ifscrlayer@forceignoreuppercase |
| 417 |
% \end{macro}^^A \scrlayer@ignoreuppercase |
| 418 |
% \end{command}^^A \MakeMarkcase |
| 419 |
% \end{option}^^A markcase |
| 420 |
% |
| 421 |
% \begin{command}{\rightfirstmark,\rightbotmark,\righttopmark, |
| 422 |
% \leftfirstmark,\leftbotmark,\lefttopmark} |
| 423 |
% \changes{v3.16}{2015/01/14}{added} |
| 424 |
% \changes{3.44}{2025/05/13}{\LaTeX{} 2025-06-01 uses only the new mark |
| 425 |
% mechanism} |
| 426 |
% \cs{rightfirstmark} is simply the same like the \cs{rightmark} of the |
| 427 |
% \LaTeX{} kernel. \cs{rightbotmark} uses \cs{botmark} instead of |
| 428 |
% \cs{firstmark} and \cs{righttopmark} uses \cs{topmark}. |
| 429 |
% \cs{leftbotmark} is simply the same like the \cs{leftmark} of the |
| 430 |
% \LaTeX{} kernel. \cs{leftfirstmark} uses \cs{firstmark} instead of |
| 431 |
% \cs{botmark} and \cs{lefttopmark} uses \cs{topmark}. |
| 432 |
% \begin{macrocode} |
| 433 |
%<*package&body> |
| 434 |
\ExplSyntaxOn |
| 435 |
\IfLTXAtLeastTF{2025-06-01}{ |
| 436 |
\cs_new:Npn \rightfirstmark {\mark_use_first:nn{page}{2e-right}} |
| 437 |
\cs_new:Npn \rightbotmark {\mark_use_last:nn{page}{2e-right}} |
| 438 |
\cs_new:Npn \righttopmark {\mark_use_top:nn{page}{2e-right}} |
| 439 |
\cs_new:Npn \leftfirstmark {\mark_use_first:nn{page}{2e-left}} |
| 440 |
\cs_new:Npn \leftbotmark {\mark_use_last:nn{page}{2e-left}} |
| 441 |
\cs_new:Npn \lefttopmark {\mark_use_top:nn{page}{2e-left}} |
| 442 |
}{ |
| 443 |
\newcommand*{\rightfirstmark}{\expandafter\@rightmark\firstmark\@empty\@empty} |
| 444 |
\newcommand*{\rightbotmark}{\expandafter\@rightmark\botmark\@empty\@empty} |
| 445 |
\newcommand*{\righttopmark}{\expandafter\@rightmark\topmark\@empty\@empty} |
| 446 |
\newcommand*{\leftfirstmark}{\expandafter\@leftmark\firstmark\@empty\@empty} |
| 447 |
\newcommand*{\leftbotmark}{\expandafter\@leftmark\botmark\@empty\@empty} |
| 448 |
\newcommand*{\lefttopmark}{\expandafter\@leftmark\topmark\@empty\@empty} |
| 449 |
} |
| 450 |
\ExplSyntaxOff |
| 451 |
%</package&body> |
| 452 |
% \end{macrocode} |
| 453 |
% \end{command}^^A \rightfirstmark … |
| 454 |
% |
| 455 |
% \begin{command}{\headmark} |
| 456 |
% Inside a page style, this macro is either \cs{rightmark} or |
| 457 |
% \cs{leftmark}. Outside its \LaTeX-undefined and therefore it's not an |
| 458 |
% interface command, but has to be undefined: |
| 459 |
% \begin{macrocode} |
| 460 |
%<*package&body> |
| 461 |
\@ifundefined{headmark}{}{% |
| 462 |
\PackageWarningNoLine{scrlayer}{% |
| 463 |
\string\headmark\space detected!\MessageBreak |
| 464 |
\string\headmark\space will either be set to |
| 465 |
\string\rightmark\MessageBreak |
| 466 |
or \string\leftmark inside of page styles.\MessageBreak |
| 467 |
This means, that \string\headmark\space will be overwritten\MessageBreak |
| 468 |
at every page layer usage!\MessageBreak |
| 469 |
Nevertheless it will stay unchanged outside\MessageBreak |
| 470 |
of page layers.\MessageBreak |
| 471 |
I hope, this won't break your document% |
| 472 |
}% |
| 473 |
} |
| 474 |
%</package&body> |
| 475 |
% \end{macrocode} |
| 476 |
% \end{command}^^A \headmark |
| 477 |
% |
| 478 |
% \begin{command}{\pagemark} |
| 479 |
% The page number together with its font setting. It's robust and will never |
| 480 |
% be part of the interface. |
| 481 |
% \begin{macrocode} |
| 482 |
%<*package&body> |
| 483 |
\@ifundefined{pagemark}{% |
| 484 |
\DeclareRobustCommand\pagemark{{\pnumfont{\thepage}}}% |
| 485 |
}{}% |
| 486 |
% \end{macrocode} |
| 487 |
% \begin{command}{\pnumfont} |
| 488 |
% \begin{macro}{\scr@fnt@pagenumber} |
| 489 |
% The low-level page number font command. It is deprecated to redefine or use |
| 490 |
% this and it may already be defined. These commands will not become part of |
| 491 |
% the interface! |
| 492 |
% \begin{macrocode} |
| 493 |
\@ifundefined{pnumfont}{% |
| 494 |
\newcommand{\pnumfont}{\normalfont}% |
| 495 |
}{} |
| 496 |
\@ifundefined{scr@fnt@pagenumber}{% |
| 497 |
\newcommand{\scr@fnt@pagenumber}{\pnumfont}% |
| 498 |
}{} |
| 499 |
%</package&body> |
| 500 |
% \end{macrocode} |
| 501 |
% \end{macro}^^A \scr@fnt@pagenumber |
| 502 |
% \end{command}^^A \pnumfont |
| 503 |
% \end{command}^^A \pagemark |
| 504 |
% |
| 505 |
% \begin{command}{\partmarkformat,\chaptermarkformat,\sectionmarkformat, |
| 506 |
% \GenericMarkFormat} |
| 507 |
% All the \cs{\dots markformat} macros of \KOMAScript{} are also |
| 508 |
% supported by \pkg*{scrlayer} and it uses them actively. The generic |
| 509 |
% definition has been moved from \cs{@seccntmarkformat} to |
| 510 |
% \cs{GenericMarkFormat}. This is one more difference to |
| 511 |
% \pkg{scrpage2}. The defaults are compatible to the standard |
| 512 |
% classes. These commands will not become part of the interface and other |
| 513 |
% interfaces should redefine them only, if they are not already defined. |
| 514 |
% \begin{macrocode} |
| 515 |
%<*package&body> |
| 516 |
\providecommand*{\partmarkformat}{\partname\ \thepart. \ }% |
| 517 |
\if@chapter |
| 518 |
\providecommand*{\@chapapp}{\chaptername}% |
| 519 |
\providecommand*{\chaptermarkformat}{\@chapapp\ \thechapter. \ }% |
| 520 |
\providecommand*{\sectionmarkformat}{\thesection. \ }% |
| 521 |
\else |
| 522 |
\providecommand*{\sectionmarkformat}{\GenericMarkFormat{section}}% |
| 523 |
\fi |
| 524 |
\scr@ifundefinedorrelax{@seccntmarkformat}{% |
| 525 |
\providecommand*{\GenericMarkFormat}{\@seccntformat}% |
| 526 |
}{% |
| 527 |
\providecommand*{\GenericMarkFormat}[1]{\@seccntmarkformat{#1}}% |
| 528 |
} |
| 529 |
%</package&body> |
| 530 |
% \end{macrocode} |
| 531 |
% Note, that the other \cs{\dots markformat} will be defined by |
| 532 |
% \cs{scrlayer@level@init}. |
| 533 |
% \end{command}^^A \partmarkformat … |
| 534 |
% |
| 535 |
% \begin{macro}{\@mkleft,\@mkright} |
| 536 |
% \changes{v3.25}{2017/10/13}{added to the \KOMAScript{} classes} |
| 537 |
% \begin{macro}{\@mkdouble} |
| 538 |
% \changes{v3.25}{2017/10/13}{added to the \KOMAScript{} classes} |
| 539 |
% \changes{v3.27a}{2019/10/17}{long definition} |
| 540 |
% These are new in \pkg*{scrlayer}. They may be updated, whenever |
| 541 |
% \cs{@mkboth} will be updated. Otherwise they get a working default |
| 542 |
% definition. These commands will not become part of the interface and other |
| 543 |
% interfaces should redefine them only, if they are not already defined. |
| 544 |
% \begin{macrocode} |
| 545 |
%<*(package|class)&body> |
| 546 |
\providecommand*{\@mkleft}{% |
| 547 |
\IfActiveMkBoth{\markleft}{\@gobble}% |
| 548 |
}% |
| 549 |
\providecommand*{\@mkright}{% |
| 550 |
\IfActiveMkBoth{\markright}{\@gobble}% |
| 551 |
}% |
| 552 |
\providecommand{\@mkdouble}[1]{% |
| 553 |
\@mkboth{#1}{#1}% |
| 554 |
} |
| 555 |
%</(package|class)&body> |
| 556 |
% \end{macrocode} |
| 557 |
% \end{macro}^^A \@mkdouble |
| 558 |
% \end{macro}^^A \@mkright,\@mkleft |
| 559 |
% |
| 560 |
% \begin{command}{\markleft} |
| 561 |
% \changes{v3.27a}{2019/10/17}{robust and long definition} |
| 562 |
% \changes{v3.37}{2022/06/19}{respect extended mark mechanism of \LaTeX{} |
| 563 |
% 2022/06/01} |
| 564 |
% \changes{v3.44}{2025/05/25}{\LaTeX{} 2025-06-01 does not uses the new |
| 565 |
% mark mechanism also for legacy marks} |
| 566 |
% \changes{v3.44}{2025/05/13}{code for \LaTeX{} before 2022-06-01 removed} |
| 567 |
% \begin{macro}{\@markleft} |
| 568 |
% \LaTeX{} itself provides \cs{markboth} and \cs{markright} but not |
| 569 |
% \cs{markleft}. So we add it. |
| 570 |
% \begin{macrocode} |
| 571 |
%<*package&body> |
| 572 |
\ExplSyntaxOn |
| 573 |
\IfLTXAtLeastTF{2025-06-01}{ |
| 574 |
\ProvideDocumentCommand{\markleft}{m}{\mark_insert:nn{2e-left}{#1}} |
| 575 |
}{ |
| 576 |
\@ifundefined{markleft}{ |
| 577 |
\DeclareRobustCommand{\markleft}[1]{ |
| 578 |
\begingroup |
| 579 |
\let\label\relax \let\index\relax \let\glossary\relax |
| 580 |
\expandafter\@markleft\@themark {#1} |
| 581 |
\@temptokena \expandafter{\@themark} |
| 582 |
\mark_insert:nn{2e-left}{#1} |
| 583 |
\mark{\the\@temptokena} |
| 584 |
\endgroup |
| 585 |
\if@nobreak\ifvmode\nobreak\fi\fi |
| 586 |
}% |
| 587 |
\providecommand{\@markleft}[3]{ |
| 588 |
\@temptokena {#2} |
| 589 |
\unrestored@protected@xdef\@themark{{#3}{\the\@temptokena}} |
| 590 |
} |
| 591 |
}{} |
| 592 |
} |
| 593 |
\ExplSyntaxOff |
| 594 |
%</package&body> |
| 595 |
% \end{macrocode} |
| 596 |
% \end{macro}^^A \@markleft |
| 597 |
% \end{command}^^A \markleft |
| 598 |
% |
| 599 |
% \begin{command}{\markdouble} |
| 600 |
% \changes{v3.28}{2019/10/17}{added} |
| 601 |
% This is easier, because it uses \cs{markboth}. So we do not need to declare |
| 602 |
% it robust and we can use \cs{providecommand}. |
| 603 |
% \begin{macrocode} |
| 604 |
%<*package&body> |
| 605 |
\providecommand{\markdouble}[1]{\markboth{#1}{#1}} |
| 606 |
%</package&body> |
| 607 |
% \end{macrocode} |
| 608 |
% \end{command}^^A \markdouble |
| 609 |
% |
| 610 |
% \begin{option}{autooneside} |
| 611 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 612 |
% commands removed} |
| 613 |
% \begin{macro}{\ifscrlayer@autooneside} |
| 614 |
% Decide whether or not use the optional argument of \cs{automark} in |
| 615 |
% single-side layout. |
| 616 |
% \begin{macrocode} |
| 617 |
%<*options> |
| 618 |
%<*package> |
| 619 |
\KOMA@ifkey{autooneside}{scrlayer@autooneside}\scrlayer@autoonesidetrue |
| 620 |
\scrlayer@@add@inherited@option{autooneside} |
| 621 |
\KOMA@kav@replacebool{scrlayer.sty}{autooneside}{scrlayer@autooneside} |
| 622 |
%</package> |
| 623 |
%<*interface> |
| 624 |
\KOMA@key{autooneside}[true]{% |
| 625 |
\KOMA@set@ifkey{autooneside}{scrlayer@autooneside}{#1}% |
| 626 |
\KOMA@kav@replacebool{scrlayer.sty}{autooneside}{scrlayer@autooneside}% |
| 627 |
} |
| 628 |
%</interface> |
| 629 |
%</options> |
| 630 |
%<*interface&body> |
| 631 |
\expandafter\let |
| 632 |
\csname KV@KOMA.\@currname.\@currext @autooneside\endcsname\relax |
| 633 |
%</interface&body> |
| 634 |
% \end{macrocode} |
| 635 |
% \end{macro}^^A \ifscrlayer@autooneside |
| 636 |
% \end{option}^^A autooneside |
| 637 |
% |
| 638 |
% |
| 639 |
% \begin{option}{automark} |
| 640 |
% \begin{option}{manualmark} |
| 641 |
% Maybe we will extend these options later. Currently they do almost the |
| 642 |
% same they do at \pkg{scrpage2}. The difference is, that single-side or |
| 643 |
% two-side doesn't matter here (but it does inside of the definitions of the |
| 644 |
% marks itself). |
| 645 |
% |
| 646 |
% \begin{description} |
| 647 |
% \item[ToDo:] Maybe \opt{manualmark} should become deprecated and |
| 648 |
% \opt{automark} should have simple values or a new option, that also |
| 649 |
% handles \opt{autooneside}? |
| 650 |
% \end{description} |
| 651 |
% \changes{v3.22}{2016/12/07}{prepared for classes without \cs{section} or |
| 652 |
% \cs{subsection}} |
| 653 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 654 |
% commands removed} |
| 655 |
% \begin{macrocode} |
| 656 |
%<*options> |
| 657 |
\KOMA@key{automark}[]{% |
| 658 |
\scrlayer@testunexpectedarg{automark}{#1}% |
| 659 |
\scrlayer@AtEndOfPackage{% |
| 660 |
\if@chapter |
| 661 |
\scr@ifundefinedorrelax{section}{% |
| 662 |
\automark{chapter}% |
| 663 |
}{% |
| 664 |
\automark[section]{chapter}% |
| 665 |
}% |
| 666 |
\else |
| 667 |
\scr@ifundefinedorrelax{section}{% |
| 668 |
\automark{}% |
| 669 |
}{% |
| 670 |
\scr@ifundefinedorrelax{subsection}{% |
| 671 |
\automark{section}% |
| 672 |
}{% |
| 673 |
\automark[subsection]{section}% |
| 674 |
} |
| 675 |
}% |
| 676 |
\fi |
| 677 |
}% |
| 678 |
\FamilyKeyStateProcessed |
| 679 |
\KOMA@kav@removekey{scrlayer.sty}{automark}% |
| 680 |
\KOMA@kav@removekey{scrlayer.sty}{manualmark}% |
| 681 |
\KOMA@kav@add{scrlayer.sty}{automark}{}% |
| 682 |
} |
| 683 |
%<package>\scrlayer@@add@inherited@option{automark} |
| 684 |
%</options> |
| 685 |
%<*interface&body> |
| 686 |
\expandafter\let\csname KV@KOMA.\@currname.\@currext @automark\endcsname\relax |
| 687 |
\expandafter\let |
| 688 |
\csname KV@KOMA.\@currname.\@currext @automark@default\endcsname\relax |
| 689 |
%</interface&body> |
| 690 |
%<*options> |
| 691 |
\KOMA@key{manualmark}[]{% |
| 692 |
\scrlayer@testunexpectedarg{manualmark}{#1}% |
| 693 |
\scrlayer@AtEndOfPackage{\manualmark}% |
| 694 |
\FamilyKeyStateProcessed |
| 695 |
\KOMA@kav@removekey{scrlayer.sty}{automark}% |
| 696 |
\KOMA@kav@removekey{scrlayer.sty}{manualmark}% |
| 697 |
\KOMA@kav@add{scrlayer.sty}{manualmark}{}% |
| 698 |
} |
| 699 |
%<package>\scrlayer@@add@inherited@option{manualmark} |
| 700 |
%</options> |
| 701 |
%<*interface&body> |
| 702 |
\expandafter\let\csname KV@KOMA.\@currname.\@currext @manualmark\endcsname\relax |
| 703 |
\expandafter\let |
| 704 |
\csname KV@KOMA.\@currname.\@currext @manualmark@default\endcsname\relax |
| 705 |
%</interface&body> |
| 706 |
% \end{macrocode} |
| 707 |
% \end{option}^^A manualmark |
| 708 |
% \end{option}^^A automark |
| 709 |
% |
| 710 |
% \begin{command}{\manualmark} |
| 711 |
% Switch to manual marks. This resets \cs{@mkleft}, \cs{@mkright}, |
| 712 |
% \cs{@mkdouble}, \cs{@mkboth} and the \cs{\dots mark} of all known |
| 713 |
% levels. |
| 714 |
% \begin{macrocode} |
| 715 |
%<*package&body> |
| 716 |
\newcommand*{\manualmark}{% |
| 717 |
\begingroup |
| 718 |
\def\@elt##1{% |
| 719 |
\aftergroup\let\expandafter\aftergroup\csname ##1mark\endcsname |
| 720 |
\aftergroup\@gobble |
| 721 |
}% |
| 722 |
\scrlayer@level@list |
| 723 |
\endgroup |
| 724 |
\let\@mkleft\@gobble |
| 725 |
\let\@mkright\@gobble |
| 726 |
\let\@mkdouble\@gobble |
| 727 |
\let\@mkboth\@gobbletwo |
| 728 |
} |
| 729 |
%</package&body> |
| 730 |
% \end{macrocode} |
| 731 |
% \end{command} |
| 732 |
% |
| 733 |
% \begin{command}{\automark} |
| 734 |
% \changes{v3.20}{2016/04/12}{\cs{@ifstar} durch \cs{kernel@ifstar} |
| 735 |
% ersetzt} |
| 736 |
% \begin{macro}{\@automark} |
| 737 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 738 |
% This is the brain knot of the game! I'll try to explain, what I'm doing: |
| 739 |
% First of all the new starred version of \cs{automark} doesn't reset the |
| 740 |
% mark commands. So it works cumulatively. This may be useful e.g. to have |
| 741 |
% chapter marks as long as no section marks have been made etc. |
| 742 |
% \begin{macrocode} |
| 743 |
%<*package&body> |
| 744 |
\newcommand*{\automark}{% |
| 745 |
\kernel@ifstar{\@automark}{\manualmark\@automark}% |
| 746 |
} |
| 747 |
\newcommand*{\@automark}[2][]{% |
| 748 |
\Ifstr{#2}{}{% |
| 749 |
\Ifstr{#1}{}{% |
| 750 |
% \end{macrocode} |
| 751 |
% \cs{automark[]{}} or \cs{automark{}} has been used. This will activate |
| 752 |
% the low level mark commands, but doesn't change the high level commands. It |
| 753 |
% may be useful or may not, the user should know what he does: |
| 754 |
% \begin{macrocode} |
| 755 |
\automark@basics |
| 756 |
}{% |
| 757 |
% \end{macrocode} |
| 758 |
% \cs{automark[\dots]{}} has been used. This will activate the higher level |
| 759 |
% mark commands and also set up the right mark |
| 760 |
% \begin{macrocode} |
| 761 |
\automark@basics |
| 762 |
\automark@righthigh{#1}% |
| 763 |
}% |
| 764 |
}{% |
| 765 |
\Ifstr{#1}{}{% |
| 766 |
% \end{macrocode} |
| 767 |
% \cs{automark[]{\dots}} or \cs{automark{\dots}} has been used. This |
| 768 |
% will activate the low level mark commands and also set up either the left or |
| 769 |
% both marks. |
| 770 |
% \begin{macrocode} |
| 771 |
\automark@basics |
| 772 |
\automark@leftlow{#2}% |
| 773 |
}{% |
| 774 |
% \end{macrocode} |
| 775 |
% \cs{automark[\dots]{\dots}} has been used. This will activate the low |
| 776 |
% level mark commands and also both high level marks. |
| 777 |
% \begin{macrocode} |
| 778 |
\automark@basics |
| 779 |
\automark@both{#1}{#2}% |
| 780 |
}% |
| 781 |
}% |
| 782 |
} |
| 783 |
% \end{macrocode} |
| 784 |
% \begin{macro}{\automark@basics} |
| 785 |
% Activate all low level \cs{@mk\dots} commands: |
| 786 |
% \begin{macrocode} |
| 787 |
\newcommand*{\automark@basics}{% |
| 788 |
\let\@mkleft\markleft |
| 789 |
\let\@mkright\markright |
| 790 |
\let\@mkboth\markboth |
| 791 |
\def\@mkdouble##1{\@mkboth{##1}{##1}}% |
| 792 |
} |
| 793 |
% \end{macrocode} |
| 794 |
% \end{macro}^^A \automark@basics |
| 795 |
% \begin{macro}{\automark@righthigh} |
| 796 |
% \changes{v3.41}{2023/06/16}{split usage of \cs{MakeMarkcase} to support |
| 797 |
% \cs{MakeTitlecase}} |
| 798 |
% Set up the right mark of a higher level, but in single-side layout only if |
| 799 |
% \opt{autooneside} hasn't been used. Note, that with this definition no |
| 800 |
% special handling for \KOMAScript's \cs{addchap} and \cs{addsec} is |
| 801 |
% needed. |
| 802 |
% \begin{macrocode} |
| 803 |
\newcommand*{\automark@righthigh}[1]{% |
| 804 |
\ifscrlayer@level@prepared{#1}{% |
| 805 |
\expandafter\def\csname #1mark\endcsname##1{% |
| 806 |
\begingroup |
| 807 |
\@tempswafalse |
| 808 |
\if@twoside\@tempswatrue |
| 809 |
\else\ifscrlayer@autooneside\else\@tempswatrue\fi\fi |
| 810 |
\expandafter\endgroup |
| 811 |
\if@tempswa |
| 812 |
\@mkright{% |
| 813 |
\ifnum \c@secnumdepth<\numexpr \csname #1numdepth\endcsname +0\relax |
| 814 |
\else |
| 815 |
\if@mainmatter \MakeMarkcase{\csname #1markformat\endcsname}\fi |
| 816 |
\fi |
| 817 |
\MakeMarkcase{##1}% |
| 818 |
}% |
| 819 |
\fi |
| 820 |
}% |
| 821 |
}{}% |
| 822 |
} |
| 823 |
% \end{macrocode} |
| 824 |
% \end{macro}^^A \automark@righthigh |
| 825 |
% \begin{macro}{\automark@leftlow} |
| 826 |
% Set up the left mark of a low level, but in single-side layout the right |
| 827 |
% mark has to be used. |
| 828 |
% \begin{macrocode} |
| 829 |
\newcommand*{\automark@leftlow}[1]{% |
| 830 |
\ifscrlayer@level@prepared{#1}{% |
| 831 |
\expandafter\def\csname #1mark\endcsname ##1{% |
| 832 |
\if@twoside |
| 833 |
% \end{macrocode} |
| 834 |
% In two-side mode the left high mark has also to clear the right low |
| 835 |
% mark. This would be unwanted, if the left mark is a low mark and the right |
| 836 |
% mark is a high mark. But we cannot detect this if no right mark level has |
| 837 |
% been given. So we simply use: |
| 838 |
% \begin{macrocode} |
| 839 |
\expandafter\@mkboth |
| 840 |
\else |
| 841 |
% \end{macrocode} |
| 842 |
% In single-side mode there's no left high mark without a right low mark. So |
| 843 |
% instead of only a left high mark, we set up both marks. |
| 844 |
% \changes{v3.27}{2019/07/25}{replaced \cs{@empty} by \texttt{\{\}} to avoid |
| 845 |
% \textsf{babel} issue} |
| 846 |
% \changes{v3.41}{2023/06/16}{split usage of \cs{MakeMarkcase} to support |
| 847 |
% \cs{MakeTitlecase}} |
| 848 |
% \begin{macrocode} |
| 849 |
\expandafter\@mkdouble |
| 850 |
\fi |
| 851 |
{% |
| 852 |
\ifnum \c@secnumdepth<\numexpr \csname #1numdepth\endcsname +0\relax |
| 853 |
\else |
| 854 |
\if@mainmatter \MakeMarkcase{\csname #1markformat\endcsname}\fi |
| 855 |
\fi |
| 856 |
\MakeMarkcase{##1}% |
| 857 |
}{}% |
| 858 |
}% |
| 859 |
}{}% |
| 860 |
} |
| 861 |
% \end{macrocode} |
| 862 |
% \end{macro}^^A \automark@leftlow |
| 863 |
% \begin{macro}{\automark@both} |
| 864 |
% Set up both marks, but in single-side layout depending on |
| 865 |
% \opt{autooneside}. |
| 866 |
% \begin{macrocode} |
| 867 |
\newcommand*{\automark@both}[2]{% |
| 868 |
\ifscrlayer@level@prepared{#1}{% |
| 869 |
\ifscrlayer@level@prepared{#2}{% |
| 870 |
\ifnum \numexpr \csname #1numdepth\endcsname +0\relax |
| 871 |
> \numexpr \csname #2numdepth\endcsname +0\relax |
| 872 |
% \end{macrocode} |
| 873 |
% Level of left mark is greater than level of right mark. e.g., section > |
| 874 |
% chapter. This is unusual. Nevertheless we'll handle it. |
| 875 |
% \begin{macrocode} |
| 876 |
\automark@leftlow{#2}% |
| 877 |
\automark@righthigh{#1}% |
| 878 |
\else \ifnum \numexpr \csname #1numdepth\endcsname +0\relax |
| 879 |
= \numexpr \csname #2numdepth\endcsname +0\relax |
| 880 |
% \end{macrocode} |
| 881 |
% Level of left mark is equal to level of right mark. This is |
| 882 |
% nice and very easy to handle. |
| 883 |
% \changes{v3.41}{2023/06/16}{split usage of \cs{MakeMarkcase} to support |
| 884 |
% \cs{MakeTitlecase}} |
| 885 |
% \begin{macrocode} |
| 886 |
\expandafter\def\csname #2mark\endcsname##1{% |
| 887 |
\@mkdouble{% |
| 888 |
\ifnum \c@secnumdepth<\numexpr |
| 889 |
\csname #2numdepth\endcsname +0\relax |
| 890 |
\else |
| 891 |
\if@mainmatter \MakeMarkcase{\csname #2markformat\endcsname}\fi |
| 892 |
\fi |
| 893 |
\MakeMarkcase{##1}% |
| 894 |
}% |
| 895 |
}% |
| 896 |
\else |
| 897 |
% \end{macrocode} |
| 898 |
% Level of left mark is less than level of right mark. This is |
| 899 |
% unusual, nevertheless it should work: |
| 900 |
% \changes{v3.42}{2024/09/02}{argument reversal corrected |
| 901 |
% (\href{https://sourceforge.net/p/koma-script/tickets/74/}{issue 74})} |
| 902 |
% \begin{macrocode} |
| 903 |
\expandafter\def\csname #1mark\endcsname##1{% |
| 904 |
\@mkboth{}{% |
| 905 |
\ifnum \c@secnumdepth |
| 906 |
< \numexpr \csname #1numdepth\endcsname +0\relax |
| 907 |
\else |
| 908 |
\if@mainmatter \MakeMarkcase{\csname #1markformat\endcsname}\fi |
| 909 |
\fi |
| 910 |
\MakeMarkcase{##1}% |
| 911 |
}% |
| 912 |
}% |
| 913 |
\expandafter\def\csname #2mark\endcsname##1{% |
| 914 |
\begingroup |
| 915 |
\@tempswafalse |
| 916 |
\if@twoside\@tempswatrue |
| 917 |
\else\ifscrlayer@autooneside\else\@tempswatrue\fi\fi |
| 918 |
\expandafter\endgroup |
| 919 |
\if@tempswa |
| 920 |
\@mkleft{% |
| 921 |
\ifnum \c@secnumdepth |
| 922 |
< \numexpr\csname #2numdepth\endcsname +0\relax |
| 923 |
\else |
| 924 |
\if@mainmatter \MakeMarkcase{\csname #2markformat\endcsname}\fi |
| 925 |
\fi |
| 926 |
\MakeMarkcase{##1}% |
| 927 |
}% |
| 928 |
\fi |
| 929 |
}% |
| 930 |
\fi |
| 931 |
\fi |
| 932 |
}{}% |
| 933 |
}{}% |
| 934 |
} |
| 935 |
% \end{macrocode} |
| 936 |
% \begin{macro}{\ifscrlayer@level@prepared} |
| 937 |
% Test, whether or not this level has been prepared. |
| 938 |
% \changes{v3.42}{2024/02/01}{removed overlooked debug message} |
| 939 |
% \begin{macrocode} |
| 940 |
\newcommand*{\ifscrlayer@level@prepared}[1]{% |
| 941 |
\scr@ifundefinedorrelax{#1numdepth}{% |
| 942 |
\PackageError{scrlayer}{numbering depth of `#1' unknown}{% |
| 943 |
Someone told me to use a section mark for level `#1',\MessageBreak |
| 944 |
but the numbering depth hasn't been declared before. You may solve this |
| 945 |
using\MessageBreak |
| 946 |
\string\DeclareSectionNumberDepth{#1}{NUMBER}.% |
| 947 |
}% |
| 948 |
\@secondoftwo |
| 949 |
}{% |
| 950 |
\@firstoftwo |
| 951 |
}% |
| 952 |
} |
| 953 |
%</package&body> |
| 954 |
% \end{macrocode} |
| 955 |
% \end{macro}^^A \ifscrlayer@level@prepared |
| 956 |
% \end{macro}^^A \automark@both |
| 957 |
% \end{macro}^^A \@automark |
| 958 |
% \end{command}^^A \automark |
| 959 |
% |
| 960 |
% \begin{command}{\DeclareSectionNumberDepth} |
| 961 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 962 |
% \begin{description} |
| 963 |
% \item[\marg{string}:] the name of the section level, e.g., |
| 964 |
% part, chapter, section etc. (must be fully |
| 965 |
% expandable and expand to a string). |
| 966 |
% \item[\marg{numeric expression}:] the section number depth of the |
| 967 |
% level, e.g., -1 for part, 0 for chapter etc. |
| 968 |
% \end{description} |
| 969 |
% Note that levels part, chapter, section, subsection, sub\dots subsection, |
| 970 |
% paragraph, subparagraph, sub\dots subparagraph, minisec, subminisec, |
| 971 |
% sub\dots subminisec will be recognised either at load time or at |
| 972 |
% \cs{begin}\texttt\{\env{document}\texttt\} automatically if they have the |
| 973 |
% usual levels. |
| 974 |
% \begin{macrocode} |
| 975 |
%<*package&body> |
| 976 |
\newcommand*{\DeclareSectionNumberDepth}[2]{% |
| 977 |
\expandafter\edef\csname #1numdepth\endcsname{\the\numexpr #2\relax}% |
| 978 |
\@ifundefined{#1mark}{% |
| 979 |
\expandafter\let\csname #1mark\endcsname\@gobble |
| 980 |
}{}% |
| 981 |
\@ifundefined{#1markformat}{% |
| 982 |
\@namedef{#1markformat}{\GenericMarkFormat{#1}}% |
| 983 |
}{}% |
| 984 |
\begingroup |
| 985 |
\@tempswatrue |
| 986 |
\def\@elt##1{\Ifstr{#1}{##1}{\@tempswafalse}{}}% |
| 987 |
\scrlayer@level@list |
| 988 |
\if@tempswa |
| 989 |
\aftergroup\@firstofone |
| 990 |
\else |
| 991 |
\aftergroup\@gobble |
| 992 |
\fi |
| 993 |
\endgroup |
| 994 |
{% |
| 995 |
\l@addto@macro\scrlayer@level@list{\@elt{#1}}% |
| 996 |
}% |
| 997 |
} |
| 998 |
% \end{macrocode} |
| 999 |
% \begin{macro}{\scrlayer@level@list,\scrlayer@level@init} |
| 1000 |
% Stores all the existing levels. |
| 1001 |
% \begin{macrocode} |
| 1002 |
\newcommand*{\scrlayer@level@list}{} |
| 1003 |
% \end{macrocode} |
| 1004 |
% Usually all levels are known on loading this package, but if a package |
| 1005 |
% defines additional levels later we'll do an additional test at |
| 1006 |
% \cs{begin}\texttt\{\env{document}\texttt\}. But we do not redo the part and |
| 1007 |
% the chapter test. |
| 1008 |
% \changes{v3.38}{2022/07/19}{improved level initialization} |
| 1009 |
% \begin{macrocode} |
| 1010 |
\newcommand*{\scrlayer@level@init}{% |
| 1011 |
\@tempcnta=\if@chapter \m@ne\else \z@\fi |
| 1012 |
\def\reserved@b##1{% |
| 1013 |
\@tempswatrue |
| 1014 |
\def\reserved@a{##1}% |
| 1015 |
\@whilesw \if@tempswa \fi {% |
| 1016 |
\scr@ifundefinedorrelax{\reserved@a}{% |
| 1017 |
\@tempswafalse |
| 1018 |
}{% |
| 1019 |
\@ifundefined{\reserved@a numdepth}{% |
| 1020 |
\expandafter\DeclareSectionNumberDepth |
| 1021 |
\expandafter{\reserved@a}{\@tempcnta}% |
| 1022 |
}{% |
| 1023 |
\expandafter\DeclareSectionNumberDepth |
| 1024 |
\expandafter{\reserved@a}{\csname \reserved@a numdepth\endcsname}% |
| 1025 |
}% |
| 1026 |
\advance \@tempcnta by \@ne |
| 1027 |
\edef\reserved@a{sub\reserved@a}% |
| 1028 |
}% |
| 1029 |
}% |
| 1030 |
}% |
| 1031 |
\reserved@b{part}% |
| 1032 |
\reserved@b{chapter}% |
| 1033 |
\reserved@b{section}% |
| 1034 |
\reserved@b{paragraph}% |
| 1035 |
\reserved@b{minisec}% |
| 1036 |
} |
| 1037 |
\scrlayer@level@init |
| 1038 |
\renewcommand*{\scrlayer@level@init}{% |
| 1039 |
\@tempcnta=1 |
| 1040 |
\def\reserved@b##1{% |
| 1041 |
\@tempswatrue |
| 1042 |
\def\reserved@a{##1}% |
| 1043 |
\@whilesw \if@tempswa \fi {% |
| 1044 |
\scr@ifundefinedorrelax{\reserved@a}{% |
| 1045 |
\@tempswafalse |
| 1046 |
}{% |
| 1047 |
\@ifundefined{\reserved@a numdepth}{% |
| 1048 |
\expandafter\DeclareSectionNumberDepth |
| 1049 |
\expandafter{\reserved@a}{\@tempcnta}% |
| 1050 |
}{% |
| 1051 |
\expandafter\DeclareSectionNumberDepth |
| 1052 |
\expandafter{\reserved@a}{\csname \reserved@a numdepth\endcsname}% |
| 1053 |
}% |
| 1054 |
\advance \@tempcnta by \@ne |
| 1055 |
\edef\reserved@a{sub\reserved@a}% |
| 1056 |
}% |
| 1057 |
}% |
| 1058 |
}% |
| 1059 |
\reserved@b{section}% |
| 1060 |
\reserved@b{paragraph}% |
| 1061 |
\reserved@b{minisec}% |
| 1062 |
} |
| 1063 |
\AtBeginDocument{% |
| 1064 |
\scrlayer@level@init |
| 1065 |
} |
| 1066 |
%</package&body> |
| 1067 |
% \end{macrocode} |
| 1068 |
% \end{macro}^^A \scrlayer@level@init,\scrlayer@level@list |
| 1069 |
% \end{command}^^A DeclareSectionNumberDepth |
| 1070 |
% |
| 1071 |
% |
| 1072 |
% \subsection{Providing Layers} |
| 1073 |
% |
| 1074 |
% A layer is a virtual sheet of paper stacked behind or above the real sheet |
| 1075 |
% of paper. All the virtual and real sheets of one page may been seen |
| 1076 |
% simultanous, but material o one sheet may overlap material on sheets below. |
| 1077 |
% Layers provided by \pkg*{scrlayer} will not be stacked below or above |
| 1078 |
% real sheets unless they are used by a page style. |
| 1079 |
% |
| 1080 |
% While we use \meta{key}\texttt{=}\meta{value} arguments for several of the |
| 1081 |
% layer commands we define a new family with a new member: |
| 1082 |
% \begin{macrocode} |
| 1083 |
%<*package&body> |
| 1084 |
\DefineFamily{KOMAarg} |
| 1085 |
\DefineFamilyMember[.definelayer]{KOMAarg} |
| 1086 |
%</package&body> |
| 1087 |
% \end{macrocode} |
| 1088 |
% |
| 1089 |
% \begin{command}{\DeclareLayer} |
| 1090 |
% \begin{description} |
| 1091 |
% \item[\oarg{option list}:] a comma separated list of |
| 1092 |
% \texttt{\meta{key}=\meta{value}} pairs. |
| 1093 |
% \item[\marg{string}:] the name of the layer (must be fully expandable |
| 1094 |
% and expand to a string only). |
| 1095 |
% \end{description} |
| 1096 |
% Layers are the basic elements of page styles. A layer has a name and several |
| 1097 |
% attributes. The attributes may be set as comma separated list at the first, |
| 1098 |
% optional argument of \cs{DeclareLayer}. The name must be set by the second, |
| 1099 |
% mandatory argument. |
| 1100 |
% \begin{macro}{\def@scr@l@pos} |
| 1101 |
% And a second helper macro to easily define $x, y, w, h$ of a layer. |
| 1102 |
% \begin{macrocode} |
| 1103 |
%<*package&body> |
| 1104 |
\newcommand*{\def@scr@l@pos}[4]{% |
| 1105 |
\@namedef{scr@l@\scr@current@layer @x}{#1}% |
| 1106 |
\@namedef{scr@l@\scr@current@layer @y}{#2}% |
| 1107 |
\@namedef{scr@l@\scr@current@layer @w}{#3}% |
| 1108 |
\@namedef{scr@l@\scr@current@layer @h}{#4}% |
| 1109 |
} |
| 1110 |
% \end{macrocode} |
| 1111 |
% \end{macro}^^A \def@scr@l@pos |
| 1112 |
% |
| 1113 |
% There are basic, primitive attributes and compounding attributes. The basic |
| 1114 |
% attributes are: |
| 1115 |
% \begin{description} |
| 1116 |
% \item[\texttt{mode=\meta{command sequence}}:] the mode that should be used |
| 1117 |
% to output the \texttt{contents}. A command \cs{layer\meta{command |
| 1118 |
% sequence}mode} with one argument need to be defined. |
| 1119 |
% \changes{v3.19}{2015/07/30}{new layer attribute \texttt{mode}} |
| 1120 |
% \begin{macrocode} |
| 1121 |
\DefineFamilyKey[.definelayer]{KOMAarg}{mode}{% |
| 1122 |
\scr@ifundefinedorrelax{layer#1mode}{\FamilyKeyStateUnknownValue}{% |
| 1123 |
\@namedef{scr@l@\scr@current@layer @mode}{#1}% |
| 1124 |
\FamilyKeyStateProcessed |
| 1125 |
}% |
| 1126 |
} |
| 1127 |
% \end{macrocode} |
| 1128 |
% \item[\texttt{hoffset=\meta{dimension expression}}:] offset from the left |
| 1129 |
% edge of the paper. |
| 1130 |
% \begin{macrocode} |
| 1131 |
\DefineFamilyKey[.definelayer]{KOMAarg}{hoffset}{% |
| 1132 |
\@namedef{scr@l@\scr@current@layer @x}{\dimexpr #1\relax}% |
| 1133 |
\FamilyKeyStateProcessed |
| 1134 |
} |
| 1135 |
% \end{macrocode} |
| 1136 |
% \item[\texttt{voffset=\meta{dimension expression}}:] offset from the top |
| 1137 |
% edge of the paper. |
| 1138 |
% \begin{macrocode} |
| 1139 |
\DefineFamilyKey[.definelayer]{KOMAarg}{voffset}{% |
| 1140 |
\@namedef{scr@l@\scr@current@layer @y}{\dimexpr #1\relax}% |
| 1141 |
\FamilyKeyStateProcessed |
| 1142 |
} |
| 1143 |
% \end{macrocode} |
| 1144 |
% \item[\texttt{width=\meta{dimension expression}}:] width of the layer. |
| 1145 |
% \begin{macrocode} |
| 1146 |
\DefineFamilyKey[.definelayer]{KOMAarg}{width}{% |
| 1147 |
\@namedef{scr@l@\scr@current@layer @w}{\dimexpr #1\relax}% |
| 1148 |
\FamilyKeyStateProcessed |
| 1149 |
} |
| 1150 |
% \end{macrocode} |
| 1151 |
% \item[\texttt{height=\meta{dimension expression}}:] height of the layer. |
| 1152 |
% \begin{macrocode} |
| 1153 |
\DefineFamilyKey[.definelayer]{KOMAarg}{height}{% |
| 1154 |
\@namedef{scr@l@\scr@current@layer @h}{\dimexpr #1\relax}% |
| 1155 |
\FamilyKeyStateProcessed |
| 1156 |
} |
| 1157 |
% \end{macrocode} |
| 1158 |
% \item[\texttt{align=\meta{specification}}:] horizontal and vertical |
| 1159 |
% alignment of the layer. The \meta{specification} will interpreted |
| 1160 |
% character by character with the following valid characters: |
| 1161 |
% \begin{itemize} |
| 1162 |
% \item[l] -- align the layer with its left edge to the given horizontal |
| 1163 |
% offset. This means, that the layer's width will span right from the |
| 1164 |
% given horizontal offset. |
| 1165 |
% \item[r] -- align the layer with its right edge to the given horizontal |
| 1166 |
% offset. This means, that the layer's width will span left from the given |
| 1167 |
% horizontal offset. |
| 1168 |
% \item[c] -- align the layer centered to the given horizontal and vertical |
| 1169 |
% offset. This means, that the given offsets are at the middle of the |
| 1170 |
% layer width and total height. |
| 1171 |
% \item[t] -- align the layer with its top edge to the given vertical |
| 1172 |
% offset. This means that the layer's contents will span below the given |
| 1173 |
% vertical offset. |
| 1174 |
% \item[b] -- align the layer with its bottom edge to the given vertical |
| 1175 |
% offset. This means, that the layer's contents will span above the given |
| 1176 |
% vertical offset. |
| 1177 |
% \end{itemize} |
| 1178 |
% \begin{macrocode} |
| 1179 |
\DefineFamilyKey[.definelayer]{KOMAarg}{align}{% |
| 1180 |
\@namedef{scr@l@\scr@current@layer @align}{#1}% |
| 1181 |
\FamilyKeyStateProcessed |
| 1182 |
} |
| 1183 |
% \end{macrocode} |
| 1184 |
% \item[\texttt{contents=\meta{output}}:] whatever should be printed by the |
| 1185 |
% layer. |
| 1186 |
% \changes{v3.14}{2014/10/20}{\texttt{contents} is \cs{long}} |
| 1187 |
% \begin{macrocode} |
| 1188 |
\DefineFamilyKey[.definelayer]{KOMAarg}{contents}{% |
| 1189 |
\long\@namedef{scr@l@\scr@current@layer @contents}{#1}% |
| 1190 |
\FamilyKeyStateProcessed |
| 1191 |
} |
| 1192 |
% \end{macrocode} |
| 1193 |
% \item[\texttt{background}:] restrict the layer to the page |
| 1194 |
% background. This means, that the main contents of the page may overprint |
| 1195 |
% the contents of the layer. Note, that this attribute has no value! |
| 1196 |
% \begin{macrocode} |
| 1197 |
\DefineFamilyKey[.definelayer]{KOMAarg}{background}[\relax]{% |
| 1198 |
\FamilyKeyStateProcessed |
| 1199 |
\scrlayer@testunexpectedarg{background}{#1}% |
| 1200 |
\csname @scr@l@\scr@current@layer @backgroundtrue\endcsname |
| 1201 |
\csname @scr@l@\scr@current@layer @foregroundfalse\endcsname |
| 1202 |
} |
| 1203 |
% \end{macrocode} |
| 1204 |
% \item[\texttt{foreground}:] restrict the layer to the page |
| 1205 |
% foreground. This means, that the layer's contents may overprint the main |
| 1206 |
% contents of the page. Note, that this attribute has no value! |
| 1207 |
% \begin{macrocode} |
| 1208 |
\DefineFamilyKey[.definelayer]{KOMAarg}{foreground}[\relax]{% |
| 1209 |
\FamilyKeyStateProcessed |
| 1210 |
\scrlayer@testunexpectedarg{foreground}{#1}% |
| 1211 |
\csname @scr@l@\scr@current@layer @backgroundfalse\endcsname |
| 1212 |
\csname @scr@l@\scr@current@layer @foregroundtrue\endcsname |
| 1213 |
} |
| 1214 |
% \end{macrocode} |
| 1215 |
% \item[\texttt{backandforeground}:] not really useful, but the counterpart of |
| 1216 |
% the restrictions above. |
| 1217 |
% \changes{v3.18}{2015/05/14}{new layer feature \texttt{backandforeground}} |
| 1218 |
% \begin{macrocode} |
| 1219 |
\DefineFamilyKey[.definelayer]{KOMAarg}{backandforeground}[\relax]{% |
| 1220 |
\FamilyKeyStateProcessed |
| 1221 |
\scrlayer@testunexpectedarg{backandforeground}{#1}% |
| 1222 |
\csname @scr@l@\scr@current@layer @backgroundtrue\endcsname |
| 1223 |
\csname @scr@l@\scr@current@layer @foregroundtrue\endcsname |
| 1224 |
} |
| 1225 |
% \end{macrocode} |
| 1226 |
% \item[\texttt{oddpage}:] restrict the layer to odd pages only. At |
| 1227 |
% two-sided layout only pages with odd page numbers are odd pages. At |
| 1228 |
% single-sided layout all pages are odd pages. Note, that this attribute has |
| 1229 |
% no value! |
| 1230 |
% \begin{macrocode} |
| 1231 |
\DefineFamilyKey[.definelayer]{KOMAarg}{oddpage}[\relax]{% |
| 1232 |
\FamilyKeyStateProcessed |
| 1233 |
\scrlayer@testunexpectedarg{oddpage}{#1}% |
| 1234 |
\csname @scr@l@\scr@current@layer @oddtrue\endcsname |
| 1235 |
\csname @scr@l@\scr@current@layer @evenfalse\endcsname |
| 1236 |
} |
| 1237 |
% \end{macrocode} |
| 1238 |
% \item[\texttt{evenpage}:] restrict the layer to even pages only. At |
| 1239 |
% two-sided layout only pages with even page numbers are even pages. At |
| 1240 |
% single-sided layout there aren't even pages. Note, that this attribute has |
| 1241 |
% no value! |
| 1242 |
% \begin{macrocode} |
| 1243 |
\DefineFamilyKey[.definelayer]{KOMAarg}{evenpage}[\relax]{% |
| 1244 |
\FamilyKeyStateProcessed |
| 1245 |
\scrlayer@testunexpectedarg{evenpage}{#1}% |
| 1246 |
\csname @scr@l@\scr@current@layer @oddfalse\endcsname |
| 1247 |
\csname @scr@l@\scr@current@layer @eventrue\endcsname |
| 1248 |
} |
| 1249 |
% \end{macrocode} |
| 1250 |
% \item[\texttt{oddorevenpage}:] do not restrict the layer to odd or even |
| 1251 |
% pages. |
| 1252 |
% \changes{v3.18}{2015/05/14}{new layer feature \texttt{oddorevenpage}} |
| 1253 |
% \begin{macrocode} |
| 1254 |
\DefineFamilyKey[.definelayer]{KOMAarg}{oddorevenpage}[\relax]{% |
| 1255 |
\FamilyKeyStateProcessed |
| 1256 |
\scrlayer@testunexpectedarg{oddorevenpage}{#1}% |
| 1257 |
\csname @scr@l@\scr@current@layer @oddtrue\endcsname |
| 1258 |
\csname @scr@l@\scr@current@layer @eventrue\endcsname |
| 1259 |
} |
| 1260 |
% \end{macrocode} |
| 1261 |
% \item[\texttt{evenoroddpage}:] same as \texttt{oddorevenpage} |
| 1262 |
% \begin{macrocode} |
| 1263 |
\DefineFamilyKey[.definelayer]{KOMAarg}{evenoroddpage}[\relax]{% |
| 1264 |
\PackageWarning{scrlayer}{Option `evenoroddpage' unknown.\MessageBreak |
| 1265 |
Using `oddorevenpage' instead}% |
| 1266 |
\ExecuteFamilyOptions[.definelayer]{KOMAarg}{oddorevenpage=#1} |
| 1267 |
} |
| 1268 |
% \end{macrocode} |
| 1269 |
% \item[\texttt{oddandevenpages}:] same as \texttt{oddorevenpage} |
| 1270 |
% \begin{macrocode} |
| 1271 |
\DefineFamilyKey[.definelayer]{KOMAarg}{oddandevenpages}[\relax]{% |
| 1272 |
\PackageWarning{scrlayer}{Option `oddandevenpages' unknown.\MessageBreak |
| 1273 |
Using `oddorevenpage' instead}% |
| 1274 |
\ExecuteFamilyOptions[.definelayer]{KOMAarg}{oddorevenpage=#1} |
| 1275 |
} |
| 1276 |
% \end{macrocode} |
| 1277 |
% \item[\texttt{evenandoddpages}:] same as \texttt{oddorevenpage} |
| 1278 |
% \begin{macrocode} |
| 1279 |
\DefineFamilyKey[.definelayer]{KOMAarg}{evenandoddpages}[\relax]{% |
| 1280 |
\PackageWarning{scrlayer}{Option `evenandoddpages' unknown.\MessageBreak |
| 1281 |
Using `oddorevenpage' instead}% |
| 1282 |
\ExecuteFamilyOptions[.definelayer]{KOMAarg}{oddorevenpage=#1} |
| 1283 |
} |
| 1284 |
% \end{macrocode} |
| 1285 |
% \item[\opt{floatpage}:] restrict the layer to float pages. |
| 1286 |
% \begin{macrocode} |
| 1287 |
\DefineFamilyKey[.definelayer]{KOMAarg}{floatpage}[\relax]{% |
| 1288 |
\FamilyKeyStateProcessed |
| 1289 |
\scrlayer@testunexpectedarg{floatpage}{#1}% |
| 1290 |
\csname @scr@l@\scr@current@layer @nonfloatpagefalse\endcsname |
| 1291 |
\csname @scr@l@\scr@current@layer @floatpagetrue\endcsname |
| 1292 |
} |
| 1293 |
% \end{macrocode} |
| 1294 |
% \item[\opt{nonfloatpage}:] restrict the layer to pages, which aren't |
| 1295 |
% float pages. |
| 1296 |
% \begin{macrocode} |
| 1297 |
\DefineFamilyKey[.definelayer]{KOMAarg}{nonfloatpage}[\relax]{% |
| 1298 |
\FamilyKeyStateProcessed |
| 1299 |
\scrlayer@testunexpectedarg{nonfloatpage}{#1}% |
| 1300 |
\csname @scr@l@\scr@current@layer @nonfloatpagetrue\endcsname |
| 1301 |
\csname @scr@l@\scr@current@layer @floatpagefalse\endcsname |
| 1302 |
} |
| 1303 |
% \end{macrocode} |
| 1304 |
% \item[\opt{floatornonfloatpage}:] don't restrict the layer to float or |
| 1305 |
% non-float pages. |
| 1306 |
% \changes{v3.18}{2015/05/14}{new layer feature \texttt{floatornonfloatpage}} |
| 1307 |
% \begin{macrocode} |
| 1308 |
\DefineFamilyKey[.definelayer]{KOMAarg}{floatornonfloatpage}[\relax]{% |
| 1309 |
\FamilyKeyStateProcessed |
| 1310 |
\scrlayer@testunexpectedarg{floatornonfloatpage}{#1}% |
| 1311 |
\csname @scr@l@\scr@current@layer @nonfloatpagetrue\endcsname |
| 1312 |
\csname @scr@l@\scr@current@layer @floatpagetrue\endcsname |
| 1313 |
} |
| 1314 |
% \end{macrocode} |
| 1315 |
% \item[\opt{nonfloatorfloatpage}:] same as \opt{floatornonfloatpage} |
| 1316 |
% \begin{macrocode} |
| 1317 |
\DefineFamilyKey[.definelayer]{KOMAarg}{nonfloatorfloatpage}[\relax]{% |
| 1318 |
\PackageWarning{scrlayer}{Option `nonfloatorfloatpage' unknown.\MessageBreak |
| 1319 |
Using `floatornonfloatpage' instead}% |
| 1320 |
\FamilyExecuteOptions[.definelayer]{KOMAarg}{floatornonfloatpage=#1}% |
| 1321 |
} |
| 1322 |
% \end{macrocode} |
| 1323 |
% \item[\opt{floatandnonfloatpages}:] same as \opt{floatornonfloatpage} |
| 1324 |
% \begin{macrocode} |
| 1325 |
\DefineFamilyKey[.definelayer]{KOMAarg}{floatandnonfloatpages}[\relax]{% |
| 1326 |
\PackageWarning{scrlayer}{Option `floatandnonfloatpages' unknown.\MessageBreak |
| 1327 |
Using `floatornonfloatpage' instead}% |
| 1328 |
\FamilyExecuteOptions[.definelayer]{KOMAarg}{floatornonfloatpage=#1}% |
| 1329 |
} |
| 1330 |
% \end{macrocode} |
| 1331 |
% \item[\opt{nonfloatandfloatpages}:] same as \opt{floatornonfloatpage} |
| 1332 |
% \begin{macrocode} |
| 1333 |
\DefineFamilyKey[.definelayer]{KOMAarg}{nonfloatandfloatpages}[\relax]{% |
| 1334 |
\PackageWarning{scrlayer}{Option `nonfloatandfloatpages' unknown.\MessageBreak |
| 1335 |
Using `floatornonfloatpage' instead}% |
| 1336 |
\FamilyExecuteOptions[.definelayer]{KOMAarg}{floatornonfloatpage=#1}% |
| 1337 |
} |
| 1338 |
% \end{macrocode} |
| 1339 |
% \item[\opt{everypage}:] remove all odd-, even-, float-, and |
| 1340 |
% nonfloat-restrictions. |
| 1341 |
% \changes{v3.18}{2015/05/14}{new layer feature \texttt{everypage}} |
| 1342 |
% \changes{v3.22}{2016/09/24}{foreground and background condition |
| 1343 |
% removed} |
| 1344 |
% \begin{macrocode} |
| 1345 |
\DefineFamilyKey[.definelayer]{KOMAarg}{everypage}[\relax]{% |
| 1346 |
\FamilyKeyStateProcessed |
| 1347 |
\scrlayer@testunexpectedarg{everypage}{#1}% |
| 1348 |
\csname @scr@l@\scr@current@layer @oddtrue\endcsname |
| 1349 |
\csname @scr@l@\scr@current@layer @eventrue\endcsname |
| 1350 |
\csname @scr@l@\scr@current@layer @nonfloatpagetrue\endcsname |
| 1351 |
\csname @scr@l@\scr@current@layer @floatpagetrue\endcsname |
| 1352 |
} |
| 1353 |
% \end{macrocode} |
| 1354 |
% \item[\opt{oneside}:] restrict the layer to pages on single-sided |
| 1355 |
% layouts. |
| 1356 |
% \begin{macrocode} |
| 1357 |
\DefineFamilyKey[.definelayer]{KOMAarg}{oneside}[\relax]{% |
| 1358 |
\FamilyKeyStateProcessed |
| 1359 |
\scrlayer@testunexpectedarg{oneside}{#1}% |
| 1360 |
\csname @scr@l@\scr@current@layer @twosidefalse\endcsname |
| 1361 |
\csname @scr@l@\scr@current@layer @onesidetrue\endcsname |
| 1362 |
} |
| 1363 |
% \end{macrocode} |
| 1364 |
% \item[\opt{twoside}:] restrict the layer to pages on two-sided |
| 1365 |
% layouts. |
| 1366 |
% \begin{macrocode} |
| 1367 |
\DefineFamilyKey[.definelayer]{KOMAarg}{twoside}[\relax]{% |
| 1368 |
\FamilyKeyStateProcessed |
| 1369 |
\scrlayer@testunexpectedarg{twoside}{#1}% |
| 1370 |
\csname @scr@l@\scr@current@layer @twosidetrue\endcsname |
| 1371 |
\csname @scr@l@\scr@current@layer @onesidefalse\endcsname |
| 1372 |
} |
| 1373 |
% \end{macrocode} |
| 1374 |
% \item[\opt{everyside}:] remove all one- or two-side restrictions. |
| 1375 |
% \changes{v3.18}{2015/05/14}{new layer feature \texttt{everyside}} |
| 1376 |
% \begin{macrocode} |
| 1377 |
\DefineFamilyKey[.definelayer]{KOMAarg}{everyside}[\relax]{% |
| 1378 |
\FamilyKeyStateProcessed |
| 1379 |
\scrlayer@testunexpectedarg{everyside}{#1}% |
| 1380 |
\csname @scr@l@\scr@current@layer @twosidetrue\endcsname |
| 1381 |
\csname @scr@l@\scr@current@layer @onesidetrue\endcsname |
| 1382 |
} |
| 1383 |
% \end{macrocode} |
| 1384 |
% \item[\opt{unrestricted}:] remove all restrictions |
| 1385 |
% \changes{v3.18}{2015/05/14}{new layer feature \texttt{unrestricted}} |
| 1386 |
% \changes{v3.22}{2016/09/24}{missing background and foreground |
| 1387 |
% condition} |
| 1388 |
% \changes{v3.22}{2016/09/24}{nonfloatpage condition fixed} |
| 1389 |
% \begin{macrocode} |
| 1390 |
\DefineFamilyKey[.definelayer]{KOMAarg}{unrestricted}[\relax]{% |
| 1391 |
\FamilyKeyStateProcessed |
| 1392 |
\scrlayer@testunexpectedarg{unrestricted}{#1}% |
| 1393 |
\csname @scr@l@\scr@current@layer @oddtrue\endcsname |
| 1394 |
\csname @scr@l@\scr@current@layer @eventrue\endcsname |
| 1395 |
\csname @scr@l@\scr@current@layer @backgroundtrue\endcsname |
| 1396 |
\csname @scr@l@\scr@current@layer @foregroundtrue\endcsname |
| 1397 |
\csname @scr@l@\scr@current@layer @nonfloatpagetrue\endcsname |
| 1398 |
\csname @scr@l@\scr@current@layer @floatpagetrue\endcsname |
| 1399 |
\csname @scr@l@\scr@current@layer @twosidetrue\endcsname |
| 1400 |
\csname @scr@l@\scr@current@layer @onesidetrue\endcsname |
| 1401 |
} |
| 1402 |
% \end{macrocode} |
| 1403 |
% \changes{v3.26}{2018/07/14}{new attribute \texttt{beforecontents}} |
| 1404 |
% \item[\opt{beforecontents}:] code to be executed immediately before |
| 1405 |
% setting the contents. See also modification attribute |
| 1406 |
% \texttt{addbeforecontents}. |
| 1407 |
% \begin{macrocode} |
| 1408 |
\FamilyCSKey[.definelayer]{KOMAarg}{beforecontents} |
| 1409 |
{scr@l@\scr@current@layer @precontents@hook} |
| 1410 |
% \end{macrocode} |
| 1411 |
% \changes{v3.26}{2018/07/14}{new attribute \texttt{aftercontents}} |
| 1412 |
% \item[\opt{aftercontents}:] code to be executed immediately before |
| 1413 |
% setting the contents. See also modification attribute |
| 1414 |
% \texttt{addaftercontents}. |
| 1415 |
% \begin{macrocode} |
| 1416 |
\FamilyCSKey[.definelayer]{KOMAarg}{aftercontents} |
| 1417 |
{scr@l@\scr@current@layer @postcontents@hook} |
| 1418 |
% \end{macrocode} |
| 1419 |
% \changes{v3.26}{2018/07/14}{new attribute \texttt{artifact}} |
| 1420 |
% \item[\opt{artifact}:] reserved for tagging packages. The artifact can |
| 1421 |
% either be a boolean or a general value. Boolean false will unset the |
| 1422 |
% attribute. Boolean true is the same like empty. All other values will be |
| 1423 |
% stored. |
| 1424 |
% \begin{macrocode} |
| 1425 |
\DefineFamilyKey[.definelayer]{KOMAarg}{artifact}[true]{% |
| 1426 |
\FamilySetBool{KOMAarg}{artifact}{@tempswa}{#1}% |
| 1427 |
\ifx\FamilyKeyState\FamilyKeyStateProcessed |
| 1428 |
\if@tempswa |
| 1429 |
\expandafter\let\csname scr@l@\scr@current@layer @artifact\endcsname |
| 1430 |
\@empty |
| 1431 |
\else |
| 1432 |
\expandafter\let\csname scr@l@\scr@current@layer @artifact\endcsname |
| 1433 |
\relax |
| 1434 |
\fi |
| 1435 |
\else |
| 1436 |
\FamilyKeyStateProcessed |
| 1437 |
\@namedef{scr@l@\scr@current@layer @artifact}{#1}% |
| 1438 |
\fi |
| 1439 |
} |
| 1440 |
% \end{macrocode} |
| 1441 |
% \end{description} |
| 1442 |
% |
| 1443 |
% Attribute modifications are attributes, that modify existing basic |
| 1444 |
% attributes: |
| 1445 |
% \begin{description} |
| 1446 |
% \changes{v3.16}{2015/01/26}{new layer attribute \texttt{addhoffset}} |
| 1447 |
% \item[\texttt{addhoffset=\meta{dimension expression}}:] add to offset from |
| 1448 |
% the left edge of the paper. |
| 1449 |
% \begin{macrocode} |
| 1450 |
\DefineFamilyKey[.definelayer]{KOMAarg}{addhoffset}{% |
| 1451 |
\expandafter\edef\csname scr@l@\scr@current@layer @x\endcsname{% |
| 1452 |
\noexpand\dimexpr \unexpanded\expandafter\expandafter\expandafter{% |
| 1453 |
\csname scr@l@\scr@current@layer @x\endcsname + (#1)\relax}}% |
| 1454 |
\FamilyKeyStateProcessed |
| 1455 |
} |
| 1456 |
% \end{macrocode} |
| 1457 |
% \changes{v3.16}{2015/01/26}{new layer attribute \texttt{addvoffset}} |
| 1458 |
% \item[\texttt{addvoffset=\meta{dimension expression}}:] add to offset from |
| 1459 |
% the top edge of the paper. |
| 1460 |
% \begin{macrocode} |
| 1461 |
\DefineFamilyKey[.definelayer]{KOMAarg}{addvoffset}{% |
| 1462 |
\expandafter\edef\csname scr@l@\scr@current@layer @y\endcsname{% |
| 1463 |
\noexpand\dimexpr \unexpanded\expandafter\expandafter\expandafter{% |
| 1464 |
\csname scr@l@\scr@current@layer @y\endcsname + (#1)\relax}}% |
| 1465 |
\FamilyKeyStateProcessed |
| 1466 |
} |
| 1467 |
% \end{macrocode} |
| 1468 |
% \changes{v3.16}{2015/01/26}{new layer attribute \texttt{addwidth}} |
| 1469 |
% \item[\texttt{addwidth=\meta{dimension expression}}:] add to width of the |
| 1470 |
% layer. |
| 1471 |
% \begin{macrocode} |
| 1472 |
\DefineFamilyKey[.definelayer]{KOMAarg}{addwidth}{% |
| 1473 |
\expandafter\edef\csname scr@l@\scr@current@layer @w\endcsname{% |
| 1474 |
\noexpand\dimexpr \unexpanded\expandafter\expandafter\expandafter{% |
| 1475 |
\csname scr@l@\scr@current@layer @w\endcsname + (#1)\relax}}% |
| 1476 |
\FamilyKeyStateProcessed |
| 1477 |
} |
| 1478 |
% \end{macrocode} |
| 1479 |
% \changes{v3.16}{2015/01/26}{new layer attribute \texttt{addheight}} |
| 1480 |
% \item[\texttt{addheight=\meta{dimension expression}}:] add to height of the |
| 1481 |
% layer. |
| 1482 |
% \begin{macrocode} |
| 1483 |
\DefineFamilyKey[.definelayer]{KOMAarg}{addheight}{% |
| 1484 |
\expandafter\edef\csname scr@l@\scr@current@layer @h\endcsname{% |
| 1485 |
\noexpand\dimexpr \unexpanded\expandafter\expandafter\expandafter{% |
| 1486 |
\csname scr@l@\scr@current@layer @h\endcsname + (#1)\relax}}% |
| 1487 |
\FamilyKeyStateProcessed |
| 1488 |
} |
| 1489 |
% \end{macrocode} |
| 1490 |
% \changes{v3.16}{2015/01/26}{new layer attribute \texttt{addcontents}} |
| 1491 |
% \item[\texttt{addcontents=\meta{output}}:] append to whatever should be |
| 1492 |
% printed by the layer. |
| 1493 |
% \changes{v3.14}{2014/10/20}{\texttt{contents} is \cs{long}} |
| 1494 |
% \begin{macrocode} |
| 1495 |
\DefineFamilyKey[.definelayer]{KOMAarg}{addcontents}{% |
| 1496 |
\expandafter\edef\csname scr@l@\scr@current@layer @contents\endcsname{% |
| 1497 |
\unexpanded\expandafter\expandafter\expandafter{% |
| 1498 |
\csname scr@l@\scr@current@layer @contents\endcsname #1}}% |
| 1499 |
\FamilyKeyStateProcessed |
| 1500 |
} |
| 1501 |
% \end{macrocode} |
| 1502 |
% \changes{v3.16}{2015/01/26}{new layer attribute \texttt{pretocontents}} |
| 1503 |
% \item[\texttt{pretocontents=\meta{output}}:] prefix whatever should be |
| 1504 |
% printed by the layer. |
| 1505 |
% \changes{v3.14}{2014/10/20}{\texttt{contents} is \cs{long}} |
| 1506 |
% \begin{macrocode} |
| 1507 |
\DefineFamilyKey[.definelayer]{KOMAarg}{pretocontents}{% |
| 1508 |
\expandafter\edef\csname scr@l@\scr@current@layer @contents\endcsname{% |
| 1509 |
\unexpanded{#1}\unexpanded\expandafter\expandafter\expandafter{% |
| 1510 |
\csname scr@l@\scr@current@layer @contents\endcsname}}% |
| 1511 |
\FamilyKeyStateProcessed |
| 1512 |
} |
| 1513 |
% \end{macrocode} |
| 1514 |
% \changes{v3.26}{2018/07/14}{new attribute \texttt{addbeforecontents}} |
| 1515 |
% \item[\opt{addbeforecontents}:] code to be executed immediately before |
| 1516 |
% setting the contents. The new code will be added before the old code. |
| 1517 |
% \begin{macrocode} |
| 1518 |
\DefineFamilyKey[.definelayer]{KOMAarg}{addbeforecontents}{% |
| 1519 |
\scr@ifundefinedorrelax{scr@l@\scr@current@layer @precontents@hook}{% |
| 1520 |
\expandafter\def |
| 1521 |
\csname scr@l@\scr@current@layer @precontents@hook\endcsname{#1}% |
| 1522 |
}{% |
| 1523 |
\expandafter\edef |
| 1524 |
\csname scr@l@\scr@current@layer @precontents@hook\endcsname{% |
| 1525 |
\unexpanded\expandafter\expandafter\expandafter{% |
| 1526 |
\csname scr@l@\scr@current@layer @precontents@hook\endcsname}% |
| 1527 |
\unexpanded{#1} |
| 1528 |
}% |
| 1529 |
}% |
| 1530 |
\FamilyKeyStateProcessed |
| 1531 |
} |
| 1532 |
% \end{macrocode} |
| 1533 |
% \changes{v3.26}{2018/07/14}{new attribute \texttt{addaftercontents}} |
| 1534 |
% \item[\opt{addaftercontents}:] code to be executed immediately before |
| 1535 |
% setting the contents. The new code will be added after the old code. |
| 1536 |
% \begin{macrocode} |
| 1537 |
\DefineFamilyKey[.definelayer]{KOMAarg}{addaftercontents}{% |
| 1538 |
\scr@ifundefinedorrelax{scr@l@\scr@current@layer @postcontents@hook}{% |
| 1539 |
\expandafter\def |
| 1540 |
\csname scr@l@\scr@current@layer @postcontents@hook\endcsname{#1}% |
| 1541 |
}{% |
| 1542 |
\expandafter\edef |
| 1543 |
\csname scr@l@\scr@current@layer @postcontents@hook\endcsname{% |
| 1544 |
\unexpanded{#1}% |
| 1545 |
\unexpanded\expandafter\expandafter\expandafter{% |
| 1546 |
\csname scr@l@\scr@current@layer @postcontents@hook\endcsname}% |
| 1547 |
}% |
| 1548 |
}% |
| 1549 |
\FamilyKeyStateProcessed |
| 1550 |
} |
| 1551 |
% \end{macrocode} |
| 1552 |
% \end{description} |
| 1553 |
% |
| 1554 |
% Compounding attributes are attributes, that set up several basic attributes |
| 1555 |
% with a single compounding attribute: |
| 1556 |
% \begin{description} |
| 1557 |
% \item[\texttt{page}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1558 |
% \texttt{width}, and \texttt{height} to values spanning the whole |
| 1559 |
% page aligned by the default alignment \texttt{tl}. Note, that this |
| 1560 |
% attribute has no value! |
| 1561 |
% \begin{macrocode} |
| 1562 |
\DefineFamilyKey[.definelayer]{KOMAarg}{page}[\relax]{% |
| 1563 |
\FamilyKeyStateProcessed |
| 1564 |
\scrlayer@testunexpectedarg{page}{#1}% |
| 1565 |
\def@scr@l@pos{\z@}{\z@}{\paperwidth}{\paperheight}% |
| 1566 |
\@namedef{scr@l@\scr@current@layer @align}{tl}% |
| 1567 |
} |
| 1568 |
% \end{macrocode} |
| 1569 |
% \item[\texttt{topmargin}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1570 |
% \texttt{width}, and \texttt{height} to values vertically spanning the top |
| 1571 |
% margin of the page and horizontally spanning the whole page aligned by the |
| 1572 |
% default alignment \texttt{tl}. Note, that this attribute has no value! |
| 1573 |
% \begin{macrocode} |
| 1574 |
\DefineFamilyKey[.definelayer]{KOMAarg}{topmargin}[\relax]{% |
| 1575 |
\FamilyKeyStateProcessed |
| 1576 |
\scrlayer@testunexpectedarg{topmargin}{#1}% |
| 1577 |
\def@scr@l@pos{\z@}{\z@}{\paperwidth}{\dimexpr \topmargin+1in\relax}% |
| 1578 |
\@namedef{scr@l@\scr@current@layer @align}{tl}% |
| 1579 |
} |
| 1580 |
% \end{macrocode} |
| 1581 |
% \item[\texttt{head}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1582 |
% \texttt{width}, and \texttt{height} to values vertically spanning the page |
| 1583 |
% head and horizontally spanning the text area aligned by usual head |
| 1584 |
% alignment \texttt{bl}. Note, that this attribute has no value! |
| 1585 |
% \begin{macrocode} |
| 1586 |
\DefineFamilyKey[.definelayer]{KOMAarg}{head}[\relax]{% |
| 1587 |
\FamilyKeyStateProcessed |
| 1588 |
\scrlayer@testunexpectedarg{head}{#1}% |
| 1589 |
\def@scr@l@pos{% |
| 1590 |
\dimexpr |
| 1591 |
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi |
| 1592 |
\else\oddsidemargin\fi |
| 1593 |
+1in |
| 1594 |
\relax |
| 1595 |
}{% |
| 1596 |
\dimexpr \topmargin+1in+\headheight\relax |
| 1597 |
}{\textwidth}{\headheight}% |
| 1598 |
\@namedef{scr@l@\scr@current@layer @align}{bl}% |
| 1599 |
} |
| 1600 |
% \end{macrocode} |
| 1601 |
% \item[\texttt{headsep}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1602 |
% \texttt{width}, and \texttt{height} to values vertically spanning the area |
| 1603 |
% between page head and text area and horizontally spanning the text area |
| 1604 |
% aligned by the default alignment \texttt{t}. Note, that this attribute |
| 1605 |
% has no value! |
| 1606 |
% \begin{macrocode} |
| 1607 |
\DefineFamilyKey[.definelayer]{KOMAarg}{headsep}[\relax]{% |
| 1608 |
\FamilyKeyStateProcessed |
| 1609 |
\scrlayer@testunexpectedarg{head}{#1}% |
| 1610 |
\def@scr@l@pos{% |
| 1611 |
\dimexpr |
| 1612 |
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi |
| 1613 |
\else\oddsidemargin\fi |
| 1614 |
+1in |
| 1615 |
\relax |
| 1616 |
}{% |
| 1617 |
\dimexpr \topmargin+1in+\headheight\relax |
| 1618 |
}{\textwidth}{\headsep}% |
| 1619 |
\@namedef{scr@l@\scr@current@layer @align}{tl}% |
| 1620 |
} |
| 1621 |
% \end{macrocode} |
| 1622 |
% \item[\texttt{textarea}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1623 |
% \texttt{width}, and \texttt{height} to values spanning the text area of |
| 1624 |
% the page aligned by the default alignment \texttt{t}. Note, that this |
| 1625 |
% attribute has no value! |
| 1626 |
% \begin{macrocode} |
| 1627 |
\DefineFamilyKey[.definelayer]{KOMAarg}{textarea}[\relax]{% |
| 1628 |
\FamilyKeyStateProcessed |
| 1629 |
\scrlayer@testunexpectedarg{textarea}{#1}% |
| 1630 |
\def@scr@l@pos{% |
| 1631 |
\dimexpr |
| 1632 |
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi |
| 1633 |
\else\oddsidemargin\fi |
| 1634 |
+1in |
| 1635 |
\relax |
| 1636 |
}{% |
| 1637 |
\dimexpr \topmargin+1in+\headheight+\headsep\relax |
| 1638 |
}{\textwidth}{\textheight}% |
| 1639 |
\@namedef{scr@l@\scr@current@layer @align}{tl}% |
| 1640 |
} |
| 1641 |
% \end{macrocode} |
| 1642 |
% \item[\texttt{foot}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1643 |
% \texttt{width}, and \texttt{height} to values vertically spanning the page |
| 1644 |
% footer and horizontally spanning the text area aligned by the usual footer |
| 1645 |
% alignment \texttt{t}. Note, that this attribute has no value! |
| 1646 |
% \begin{macrocode} |
| 1647 |
\DefineFamilyKey[.definelayer]{KOMAarg}{foot}[\relax]{% |
| 1648 |
\FamilyKeyStateProcessed |
| 1649 |
\scrlayer@testunexpectedarg{foot}{#1}% |
| 1650 |
\def@scr@l@pos{% |
| 1651 |
\dimexpr |
| 1652 |
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi |
| 1653 |
\else\oddsidemargin\fi |
| 1654 |
+1in |
| 1655 |
\relax |
| 1656 |
}{% |
| 1657 |
\dimexpr \topmargin+1in+\headheight+\headsep+\textheight |
| 1658 |
+\footskip+\dp\strutbox-\footheight\relax |
| 1659 |
}{\textwidth}{\footheight}% |
| 1660 |
\@namedef{scr@l@\scr@current@layer @align}{tl}% |
| 1661 |
} |
| 1662 |
% \end{macrocode} |
| 1663 |
% \item[\texttt{footskip}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1664 |
% \texttt{width}, and \texttt{height} to values vertically spanning the |
| 1665 |
% distance from the text area to the page |
| 1666 |
% footer and horizontally spanning the text area aligned by the usual footer |
| 1667 |
% alignment \texttt{t}. Note, that this attribute has no value! |
| 1668 |
% \begin{macrocode} |
| 1669 |
\DefineFamilyKey[.definelayer]{KOMAarg}{footskip}[\relax]{% |
| 1670 |
\FamilyKeyStateProcessed |
| 1671 |
\scrlayer@testunexpectedarg{foot}{#1}% |
| 1672 |
\def@scr@l@pos{% |
| 1673 |
\dimexpr |
| 1674 |
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi |
| 1675 |
\else\oddsidemargin\fi |
| 1676 |
+1in |
| 1677 |
\relax |
| 1678 |
}{% |
| 1679 |
\dimexpr \topmargin+1in+\headheight+\headsep+\textheight\relax |
| 1680 |
}{\textwidth}{\dimexpr\footskip+\dp\strutbox-\footheight\relax}% |
| 1681 |
\@namedef{scr@l@\scr@current@layer @align}{tl}% |
| 1682 |
} |
| 1683 |
% \end{macrocode} |
| 1684 |
% \item[\texttt{bottommargin}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1685 |
% \texttt{width}, and \texttt{height} to values vertically spanning the |
| 1686 |
% page's bottom margin below the footer and horizontally spanning the page |
| 1687 |
% by the default alignment \texttt{t}. Note, that this attribute has no |
| 1688 |
% value! |
| 1689 |
% \begin{macrocode} |
| 1690 |
\DefineFamilyKey[.definelayer]{KOMAarg}{bottommargin}[\relax]{% |
| 1691 |
\FamilyKeyStateProcessed |
| 1692 |
\scrlayer@testunexpectedarg{bottommargin}{#1}% |
| 1693 |
\def@scr@l@pos{\z@}{% |
| 1694 |
\dimexpr \topmargin+1in+\headheight+\headsep |
| 1695 |
+\textheight |
| 1696 |
+\footskip+\dp\strutbox\relax |
| 1697 |
}{\paperwidth}{\dimexpr\paperheight-\layeryoffset\relax}% |
| 1698 |
\@namedef{scr@l@\scr@current@layer @align}{tl}% |
| 1699 |
} |
| 1700 |
% \end{macrocode} |
| 1701 |
% \item[\texttt{leftmargin}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1702 |
% \texttt{width}, and \texttt{height} to values vertically spanning the page |
| 1703 |
% and horizontally spanning the left margin of the page by the default |
| 1704 |
% alignment \texttt{t}. Note, that this attribute has no value! |
| 1705 |
% \begin{macrocode} |
| 1706 |
\DefineFamilyKey[.definelayer]{KOMAarg}{leftmargin}[\relax]{% |
| 1707 |
\FamilyKeyStateProcessed |
| 1708 |
\scrlayer@testunexpectedarg{leftmargin}{#1}% |
| 1709 |
\def@scr@l@pos{\z@}{\z@}{% |
| 1710 |
\dimexpr |
| 1711 |
\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi |
| 1712 |
\else\oddsidemargin\fi |
| 1713 |
+1in |
| 1714 |
\relax |
| 1715 |
}{\paperheight}% |
| 1716 |
\@namedef{scr@l@\scr@current@layer @align}{tl}% |
| 1717 |
} |
| 1718 |
% \end{macrocode} |
| 1719 |
% \item[\texttt{rightmargin}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1720 |
% \texttt{width}, and \texttt{height} to values vertically spanning the page |
| 1721 |
% and horizontally spanning the right margin of the page by the default |
| 1722 |
% alignment \texttt{t}. Note, that this attribute has no value! |
| 1723 |
% \begin{macrocode} |
| 1724 |
\DefineFamilyKey[.definelayer]{KOMAarg}{rightmargin}[\relax]{% |
| 1725 |
\FamilyKeyStateProcessed |
| 1726 |
\scrlayer@testunexpectedarg{rightmargin}{#1}% |
| 1727 |
\def@scr@l@pos{\paperwidth}{\z@}{% |
| 1728 |
\dimexpr \paperwidth-1in-\textwidth |
| 1729 |
-\if@twoside\ifodd\value{page}\oddsidemargin\else\evensidemargin\fi |
| 1730 |
\else\oddsidemargin\fi\relax |
| 1731 |
}{\paperheight}% |
| 1732 |
\@namedef{scr@l@\scr@current@layer @align}{tr}% |
| 1733 |
} |
| 1734 |
% \end{macrocode} |
| 1735 |
% \item[\texttt{innermargin}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1736 |
% \texttt{width}, and \texttt{height} to values vertically spanning the page |
| 1737 |
% and horizontally spanning the right margin of even pages and the left |
| 1738 |
% margin of odd pages by the default alignment \texttt{t}. See attributes |
| 1739 |
% \texttt{oddpage} and \texttt{evenpage} for more information about odd and |
| 1740 |
% even pages. Note, that this attribute has no value! |
| 1741 |
% \begin{macrocode} |
| 1742 |
\DefineFamilyKey[.definelayer]{KOMAarg}{innermargin}[\relax]{% |
| 1743 |
\FamilyKeyStateProcessed |
| 1744 |
\scrlayer@testunexpectedarg{innermargin}{#1}% |
| 1745 |
\def@scr@l@pos{% |
| 1746 |
\if@twoside |
| 1747 |
\ifodd\value{page} \z@ |
| 1748 |
\else \dimexpr \evensidemargin+1in+\textwidth\relax |
| 1749 |
\fi |
| 1750 |
\else \z@\fi |
| 1751 |
}{\z@}{% |
| 1752 |
\dimexpr |
| 1753 |
\if@twoside\ifodd\value{page} \oddsidemargin+1in |
| 1754 |
\else \paperwidth-\layerxoffset\fi |
| 1755 |
\else \oddsidemargin+1in\fi |
| 1756 |
\relax |
| 1757 |
}{\paperheight}% |
| 1758 |
\@namedef{scr@l@\scr@current@layer @align}{tl}% |
| 1759 |
} |
| 1760 |
% \end{macrocode} |
| 1761 |
% \item[\texttt{outermargin}:] set up \texttt{hoffset}, \texttt{voffset}, |
| 1762 |
% \texttt{width}, and \texttt{height} to values vertically spanning the page |
| 1763 |
% and horizontally spanning the left margin of even pages and the right |
| 1764 |
% margin of odd pages by the default alignment \texttt{t}. See attributes |
| 1765 |
% \texttt{oddpage} and \texttt{evenpage} for more information about odd and |
| 1766 |
% even pages. Note, that this attribute has no value! |
| 1767 |
% \begin{macrocode} |
| 1768 |
\DefineFamilyKey[.definelayer]{KOMAarg}{outermargin}[\relax]{% |
| 1769 |
\FamilyKeyStateProcessed |
| 1770 |
\scrlayer@testunexpectedarg{outermargin}{#1}% |
| 1771 |
\def@scr@l@pos{% |
| 1772 |
\dimexpr |
| 1773 |
\if@twoside\ifodd\value{page} \oddsidemargin+1in+\textwidth |
| 1774 |
\else \z@\fi |
| 1775 |
\else \oddsidemargin+1in+\textwidth\fi |
| 1776 |
\relax |
| 1777 |
}{\z@}{% |
| 1778 |
\dimexpr |
| 1779 |
\if@twoside\ifodd\value{page}\paperwidth-\layerxoffset |
| 1780 |
\else \evensidemargin+1in\fi |
| 1781 |
\else \paperwidth-\layerxoffset\fi |
| 1782 |
\relax |
| 1783 |
}{\paperheight}% |
| 1784 |
\@namedef{scr@l@\scr@current@layer @align}{tl}% |
| 1785 |
} |
| 1786 |
% \end{macrocode} |
| 1787 |
% \item[\texttt{area=\{\meta{hoffset}\}\{\meta{voffset}\} |
| 1788 |
% \{\meta{width}\}\{\meta{height}\}}:] set up |
| 1789 |
% \texttt{hoffset}, \texttt{voffset}, \texttt{width}, and \texttt{height} to |
| 1790 |
% the given values. |
| 1791 |
% \begin{macrocode} |
| 1792 |
\DefineFamilyKey[.definelayer]{KOMAarg}{area}{% |
| 1793 |
\def@scr@l@pos#1 |
| 1794 |
\FamilyKeyStateProcessed |
| 1795 |
} |
| 1796 |
% \end{macrocode} |
| 1797 |
% \changes{v3.26}{2018/07/14}{clone code for \texttt{precontents@hook}, |
| 1798 |
% \texttt{postcontents@hook} and \texttt{artifact} added}^^A |
| 1799 |
% \item[\texttt{clone=\meta{layer}}:] set up the new layer by the settings |
| 1800 |
% of the given \meta{layer}. |
| 1801 |
% \begin{macrocode} |
| 1802 |
\DefineFamilyKey[.definelayer]{KOMAarg}{clone}{% |
| 1803 |
\scr@ifundefinedorrelax{scr@l@#1@x}{% |
| 1804 |
\FamilyKeyStateUnknownValue |
| 1805 |
\PackageError{scrlayer}{layer `#1' undefined}{% |
| 1806 |
You can clone only already defined layers.\MessageBreak |
| 1807 |
If you'll continue, `clone=#1' will be ignored.% |
| 1808 |
}% |
| 1809 |
}{% |
| 1810 |
\FamilyKeyStateProcessed |
| 1811 |
\scrlayer@clone@attribute{\scr@current@layer}{#1}{mode}% |
| 1812 |
\scrlayer@clone@attribute{\scr@current@layer}{#1}{x}% |
| 1813 |
\scrlayer@clone@attribute{\scr@current@layer}{#1}{y}% |
| 1814 |
\scrlayer@clone@attribute{\scr@current@layer}{#1}{w}% |
| 1815 |
\scrlayer@clone@attribute{\scr@current@layer}{#1}{h}% |
| 1816 |
\scrlayer@clone@attribute{\scr@current@layer}{#1}{align}% |
| 1817 |
\scrlayer@clone@attribute{\scr@current@layer}{#1}{contents}% |
| 1818 |
\scrlayer@clone@switch{\scr@current@layer}{#1}{background}% |
| 1819 |
\scrlayer@clone@switch{\scr@current@layer}{#1}{foreground}% |
| 1820 |
\scrlayer@clone@switch{\scr@current@layer}{#1}{odd}% |
| 1821 |
\scrlayer@clone@switch{\scr@current@layer}{#1}{even}% |
| 1822 |
\scrlayer@clone@switch{\scr@current@layer}{#1}{oneside}% |
| 1823 |
\scrlayer@clone@switch{\scr@current@layer}{#1}{twoside}% |
| 1824 |
\scrlayer@clone@switch{\scr@current@layer}{#1}{floatpage}% |
| 1825 |
\scrlayer@clone@switch{\scr@current@layer}{#1}{nonfloatpage}% |
| 1826 |
\scrlayer@clone@attribute{\scr@current@layer}{#1}{precontents@hook}% |
| 1827 |
\scrlayer@clone@attribute{\scr@current@layer}{#1}{postcontents@hook}% |
| 1828 |
\scrlayer@clone@attribute{\scr@current@layer}{#1}{artifact}% |
| 1829 |
}% |
| 1830 |
} |
| 1831 |
% \end{macrocode} |
| 1832 |
% \begin{macro}{\scrlayer@clone@attribute} |
| 1833 |
% \begin{macro}{\scrlayer@clone@switch} |
| 1834 |
% Two helpers used at option \texttt{clone} to clone either a macro-based |
| 1835 |
% attribute or a if-based attribute. |
| 1836 |
% \begin{macrocode} |
| 1837 |
\newcommand*{\scrlayer@clone@attribute}[3]{% |
| 1838 |
\expandafter\let\csname scr@l@#1@#3\expandafter\endcsname |
| 1839 |
\csname scr@l@#2@#3\expandafter\endcsname |
| 1840 |
} |
| 1841 |
\newcommand*{\scrlayer@clone@switch}[3]{% |
| 1842 |
\expandafter\let\csname if@scr@l@#1@#3\expandafter\endcsname |
| 1843 |
\csname if@scr@l@#2@#3\expandafter\endcsname |
| 1844 |
} |
| 1845 |
% \end{macrocode} |
| 1846 |
% \end{macro}^^A \scrlayer@clone@switch |
| 1847 |
% \end{macro}^^A \scrlayer@clone@attribute |
| 1848 |
% \end{description} |
| 1849 |
% |
| 1850 |
% \changes{v0.9}{2014/08/31}{missing reset of \cs{scr@current@layer} added} |
| 1851 |
% \changes{v3.14}{2014/10/20}{\cs{long}} |
| 1852 |
% \begin{macrocode} |
| 1853 |
\newcommand{\DeclareLayer}[2][]{% |
| 1854 |
\def\scr@current@layer{#2}% |
| 1855 |
\@namedef{scr@l@#2@mode}{text}% |
| 1856 |
\@namedef{scr@l@#2@x}{\z@}% |
| 1857 |
\@namedef{scr@l@#2@y}{\z@}% |
| 1858 |
\@namedef{scr@l@#2@w}{\paperwidth}% |
| 1859 |
\@namedef{scr@l@#2@h}{\paperheight}% |
| 1860 |
\@namedef{scr@l@#2@align}{tl}% |
| 1861 |
\@namedef{scr@l@#2@contents}{}% |
| 1862 |
\expandafter\newif\csname if@scr@l@#2@background\endcsname |
| 1863 |
\csname @scr@l@#2@backgroundtrue\endcsname |
| 1864 |
\expandafter\newif\csname if@scr@l@#2@foreground\endcsname |
| 1865 |
\csname @scr@l@#2@foregroundtrue\endcsname |
| 1866 |
\expandafter\newif\csname if@scr@l@#2@odd\endcsname |
| 1867 |
\csname @scr@l@#2@oddtrue\endcsname |
| 1868 |
\expandafter\newif\csname if@scr@l@#2@even\endcsname |
| 1869 |
\csname @scr@l@#2@eventrue\endcsname |
| 1870 |
\expandafter\newif\csname if@scr@l@#2@oneside\endcsname |
| 1871 |
\csname @scr@l@#2@onesidetrue\endcsname |
| 1872 |
\expandafter\newif\csname if@scr@l@#2@twoside\endcsname |
| 1873 |
\csname @scr@l@#2@twosidetrue\endcsname |
| 1874 |
\expandafter\newif\csname if@scr@l@#2@floatpage\endcsname |
| 1875 |
\csname @scr@l@#2@floatpagetrue\endcsname |
| 1876 |
\expandafter\newif\csname if@scr@l@#2@nonfloatpage\endcsname |
| 1877 |
\csname @scr@l@#2@nonfloatpagetrue\endcsname |
| 1878 |
\FamilyExecuteOptions[.definelayer]{KOMAarg}{#1}% |
| 1879 |
\let\scr@current@layer\@empty |
| 1880 |
} |
| 1881 |
% \end{macrocode} |
| 1882 |
% \begin{macro}{\scr@current@layer} |
| 1883 |
% Helper to hold the current layer and only valid in non recursive calls of |
| 1884 |
% \cs{DeclareLayer}. |
| 1885 |
% \begin{macrocode} |
| 1886 |
\newcommand*{\scr@current@layer}{} |
| 1887 |
%</package&body> |
| 1888 |
% \end{macrocode} |
| 1889 |
% \end{macro}^^A \scr@current@layer |
| 1890 |
% \end{command}^^A \DeclareLayer |
| 1891 |
% |
| 1892 |
% \begin{command}{\IfLayerExists} |
| 1893 |
% \begin{description} |
| 1894 |
% \item[\marg{string}:] the name of the layer (must be fully expandable |
| 1895 |
% and expand to a string only). |
| 1896 |
% \item[\marg{then code}:] will be executed, if the layer exists. |
| 1897 |
% \item[\marg{else code}:] will be executed, if the layer doesn't exist. |
| 1898 |
% \end{description} |
| 1899 |
% Note, that we don't known really whether or not a layer exists, but have a |
| 1900 |
% heuristic. |
| 1901 |
% \begin{macrocode} |
| 1902 |
%<*package&body> |
| 1903 |
\newcommand*{\IfLayerExists}[1]{% |
| 1904 |
\scr@ifundefinedorrelax{scr@l@#1@mode}{% |
| 1905 |
\expandafter\@secondoftwo |
| 1906 |
}{% |
| 1907 |
\expandafter\@firstoftwo |
| 1908 |
}% |
| 1909 |
} |
| 1910 |
%</package&body> |
| 1911 |
% \end{macrocode} |
| 1912 |
% \end{command}^^A \IfLayerExists |
| 1913 |
% |
| 1914 |
% \begin{command}{\DeclareNewLayer,\ProvideLayer,\RedeclareLayer} |
| 1915 |
% \changes{v3.14}{2014/10/20}{\cs{long}} |
| 1916 |
% \begin{command}{\ModifyLayer} |
| 1917 |
% \changes{v3.14}{2014/10/20}{\cs{long}} |
| 1918 |
% \changes{v0.9}{2014/08/31}{missing definition and reset of |
| 1919 |
% \cs{scr@current@layer} added} |
| 1920 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 1921 |
% There are also two commands for declaration of layers, that haven't been |
| 1922 |
% declared before, with or without error message for already declared layers, |
| 1923 |
% and two commands for changing already declared layers, first one beginning |
| 1924 |
% again from scratch, second one for only setting up attributes, that should |
| 1925 |
% be changed. |
| 1926 |
% \begin{macrocode} |
| 1927 |
%<*package&body> |
| 1928 |
\newcommand{\DeclareNewLayer}[2][]{% |
| 1929 |
\IfLayerExists{#2}{% |
| 1930 |
\PackageError{scrlayer}{layer `#2' already defined}{% |
| 1931 |
You may declare only layer, that haven't been declared previously |
| 1932 |
using\MessageBreak |
| 1933 |
\string\DeclareNewLayer. See also the alternatives |
| 1934 |
\string\RedeclareLayer,\MessageBreak |
| 1935 |
\string\ModifyLayer\space and \string\ProvideLayer.\MessageBreak |
| 1936 |
If you'll continue, declaration will be ignored.}% |
| 1937 |
}{\DeclareLayer[{#1}]{#2}}% |
| 1938 |
} |
| 1939 |
\newcommand{\ProvideLayer}[2][]{% |
| 1940 |
\IfLayerExists{#2}{% |
| 1941 |
%<*trace> |
| 1942 |
\PackageInfo{scrlayer}{\string\ProvideLayer{#2} ignored,\MessageBreak |
| 1943 |
because of already defined layer}% |
| 1944 |
%</trace> |
| 1945 |
}{\DeclareNewLayer[{#1}]{#2}}% |
| 1946 |
} |
| 1947 |
\newcommand{\RedeclareLayer}[2][]{% |
| 1948 |
\IfLayerExists{#2}{}{% |
| 1949 |
\PackageError{scrlayer}{layer `#2' not yet defined}{% |
| 1950 |
You may declare only already declared layers using |
| 1951 |
\string\RedeclareLayer.\MessageBreak |
| 1952 |
See also the alternatives |
| 1953 |
\string\DeclareLayer and \string\ProvideLayer.\MessageBreak |
| 1954 |
Nevertheless, if you'll continue, declaration will be done.}% |
| 1955 |
}% |
| 1956 |
\DeclareLayer[{#1}]{#2}% |
| 1957 |
} |
| 1958 |
\newcommand{\ModifyLayer}[2][]{% |
| 1959 |
\IfLayerExists{#2}{% |
| 1960 |
\def\scr@current@layer{#2}% |
| 1961 |
\edef\reserved@a{% |
| 1962 |
\unexpanded{% |
| 1963 |
\FamilyExecuteOptions[.definelayer]{KOMAarg}{#1}% |
| 1964 |
\Ifstr{\csname scr@l@#2@mode\endcsname}% |
| 1965 |
}{\csname scr@l@#2@mode\endcsname}% |
| 1966 |
}\reserved@a{}{% |
| 1967 |
\PackageWarning{scrlayer}{% |
| 1968 |
change of layer mode could result in unexpected\MessageBreak |
| 1969 |
output and errors% |
| 1970 |
}% |
| 1971 |
}% |
| 1972 |
\let\scr@current@layer\@empty |
| 1973 |
}{% |
| 1974 |
\PackageError{scrlayer}{layer `#2' not yet defined}{% |
| 1975 |
You may modify only already declared layers using |
| 1976 |
\string\ModifyLayer.\MessageBreak |
| 1977 |
See also the alternatives |
| 1978 |
\string\DeclareLayer and \string\ProvideLayer.\MessageBreak |
| 1979 |
Nevertheless, if you'll continue, declaration will be done.}% |
| 1980 |
\DeclareLayer[{#1}]{#2}% |
| 1981 |
}% |
| 1982 |
} |
| 1983 |
%</package&body> |
| 1984 |
% \end{macrocode} |
| 1985 |
% \end{command}^^A \ModifyLayer |
| 1986 |
% \end{command}^^A \DeclareNewLayer,\ProvideLayer,\RedeclareLayer |
| 1987 |
% |
| 1988 |
% \begin{command}{\ModifyLayers} |
| 1989 |
% \changes{v3.26}{2018/07/14}{added} |
| 1990 |
% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} added} |
| 1991 |
% Like \cs{ModifyLayer} but allows a list of layers instead of only one layer. |
| 1992 |
% For the commands \cs{DeclareLayer}, \cs{ProvideLayer} and |
| 1993 |
% \cs{RedeclareLayer} this does not make any sense, so there are not similar |
| 1994 |
% list commands for these commands. |
| 1995 |
% \begin{macrocode} |
| 1996 |
%<*package&body> |
| 1997 |
\newcommand{\ModifyLayers}[2][]{% |
| 1998 |
\edef\scr@current@layer{#2}% |
| 1999 |
\@for\scr@current@layer:=\scr@current@layer\do{% |
| 2000 |
\scr@trim@spaces\scr@current@layer |
| 2001 |
\ifx\scr@current@layer\@emtpy\else |
| 2002 |
\edef\scr@current@layer{% |
| 2003 |
\unexpanded{\ModifyLayer[{#1}]}{\scr@current@layer}% |
| 2004 |
}% |
| 2005 |
\scr@current@layer |
| 2006 |
\fi |
| 2007 |
}% |
| 2008 |
\let\scr@current@layer\@empty |
| 2009 |
} |
| 2010 |
%</package&body> |
| 2011 |
% \end{macrocode} |
| 2012 |
% \end{command}^^A \ModifyLayers |
| 2013 |
% |
| 2014 |
% \begin{command}{\GetLayerContents} |
| 2015 |
% \changes{v3.16}{2015/01/26}{added} |
| 2016 |
% \begin{description} |
| 2017 |
% \item[\marg{string}:] the name of the layer |
| 2018 |
% \end{description} |
| 2019 |
% Get the contents of the given layer. |
| 2020 |
% \begin{macrocode} |
| 2021 |
%<*package&body> |
| 2022 |
\newcommand*{\GetLayerContents}[1]{% |
| 2023 |
\IfLayerExists{#1}{\@nameuse{scr@l@#1@contents}}{% |
| 2024 |
\PackageError{scrlayer}{unknown layer `#1'}{% |
| 2025 |
You can ask only for the contents of an existing layer.}% |
| 2026 |
}% |
| 2027 |
} |
| 2028 |
%</package&body> |
| 2029 |
% \end{macrocode} |
| 2030 |
% \end{command} |
| 2031 |
% |
| 2032 |
% |
| 2033 |
% \begin{command}{\DestroyLayer} |
| 2034 |
% \changes{v3.26}{2018/07/14}{destroy pre-contents hook, post-contents hook |
| 2035 |
% and artifact} |
| 2036 |
% \begin{description} |
| 2037 |
% \item[\marg{string}:] the name of the layer, that should be |
| 2038 |
% destroyed |
| 2039 |
% \end{description} |
| 2040 |
% Note: Nothing will be done to remove the layer from a page style, but this |
| 2041 |
% shouldn't matter, because layers with, e.g., |
| 2042 |
% \cs{if@scr@l@\dots@nonfloatpage}=\cs{relax} and |
| 2043 |
% \cs{if@scr@l@\dots@floatpage}=\cs{relax} won't be output ever. This |
| 2044 |
% command could be used by interfaces via |
| 2045 |
% \cs{scrlayerOnAutoRemoveInterface} to remove the generated |
| 2046 |
% layers, if the interface commands wouldn't be depreacted. |
| 2047 |
% However, it only destroys existing layers and doesn't care for not |
| 2048 |
% existing. |
| 2049 |
% \begin{macrocode} |
| 2050 |
%<*package&body> |
| 2051 |
\newcommand*{\DestroyLayer}[1]{% |
| 2052 |
\IfLayerExists{#1}{% |
| 2053 |
\expandafter\let\csname scr@l@#1@mode\endcsname\relax |
| 2054 |
\expandafter\let\csname scr@l@#1@x\endcsname\relax |
| 2055 |
\expandafter\let\csname scr@l@#1@y\endcsname\relax |
| 2056 |
\expandafter\let\csname scr@l@#1@w\endcsname\relax |
| 2057 |
\expandafter\let\csname scr@l@#1@h\endcsname\relax |
| 2058 |
\expandafter\let\csname scr@l@#1@align\endcsname\relax |
| 2059 |
\expandafter\let\csname scr@l@#1@contents\endcsname\relax |
| 2060 |
\expandafter\let\csname if@scr@l@#1@background\endcsname\relax |
| 2061 |
\expandafter\let\csname @scr@l@#1@backgroundfalse\endcsname\relax |
| 2062 |
\expandafter\let\csname @scr@l@#1@backgroundtrue\endcsname\relax |
| 2063 |
\expandafter\let\csname if@scr@l@#1@foreground\endcsname\relax |
| 2064 |
\expandafter\let\csname @scr@l@#1@foregroundfalse\endcsname\relax |
| 2065 |
\expandafter\let\csname @scr@l@#1@foregroundtrue\endcsname\relax |
| 2066 |
\expandafter\let\csname if@scr@l@#1@odd\endcsname\relax |
| 2067 |
\expandafter\let\csname @scr@l@#1@oddfalse\endcsname\relax |
| 2068 |
\expandafter\let\csname @scr@l@#1@oddtrue\endcsname\relax |
| 2069 |
\expandafter\let\csname if@scr@l@#1@even\endcsname\relax |
| 2070 |
\expandafter\let\csname @scr@l@#1@evenfalse\endcsname\relax |
| 2071 |
\expandafter\let\csname @scr@l@#1@eventrue\endcsname\relax |
| 2072 |
\expandafter\let\csname if@scr@l@#1@oneside\endcsname\relax |
| 2073 |
\expandafter\let\csname @scr@l@#1@onesidefalse\endcsname\relax |
| 2074 |
\expandafter\let\csname @scr@l@#1@onesidetrue\endcsname\relax |
| 2075 |
\expandafter\let\csname if@scr@l@#1@twoside\endcsname\relax |
| 2076 |
\expandafter\let\csname @scr@l@#1@twosidefalse\endcsname\relax |
| 2077 |
\expandafter\let\csname @scr@l@#1@twosidetrue\endcsname\relax |
| 2078 |
\expandafter\let\csname if@scr@l@#1@floatpage\endcsname\relax |
| 2079 |
\expandafter\let\csname @scr@l@#1@floatpagefalse\endcsname\relax |
| 2080 |
\expandafter\let\csname @scr@l@#1@floatpagetrue\endcsname\relax |
| 2081 |
\expandafter\let\csname if@scr@l@#1@nonfloatpage\endcsname\relax |
| 2082 |
\expandafter\let\csname @scr@l@#1@nonfloatpagefalse\endcsname\relax |
| 2083 |
\expandafter\let\csname @scr@l@#1@nonfloatpagetrue\endcsname\relax |
| 2084 |
\expandafter\let\csname scr@l@#1@precontents@hook\relax |
| 2085 |
\expandafter\let\csname scr@l@#1@postcontents@hook\relax |
| 2086 |
\expandafter\let\csname scr@l@#1@artifact\relax |
| 2087 |
}{% |
| 2088 |
%<*trace> |
| 2089 |
\PackageInfo{scrlayer}{\string\DestroyLayer{#1} ignored,\MessageBreak |
| 2090 |
because that layer doesn't exist\MessageBreak |
| 2091 |
(any longer)% |
| 2092 |
}% |
| 2093 |
%</trace> |
| 2094 |
}% |
| 2095 |
} |
| 2096 |
%</package&body> |
| 2097 |
% \end{macrocode} |
| 2098 |
% \end{command}^^A \DestroyLayer |
| 2099 |
% |
| 2100 |
% |
| 2101 |
% \begin{command}{\layercontentsmeasure} |
| 2102 |
% \changes{v3.19}{2015/07/27}{\cs{@gobble} eliminated} |
| 2103 |
% This may used by used as the only value of the layer option |
| 2104 |
% \texttt{contents} to show measure lines around the layer. The left and the |
| 2105 |
% top measure line will be in centimeter, the right and the bottom measure |
| 2106 |
% line in inch. With option \texttt{draft=true} this also be used |
| 2107 |
% automatically and additionally for every layer of a page style. |
| 2108 |
% \begin{macrocode} |
| 2109 |
%<*package&body> |
| 2110 |
\newcommand*{\layercontentsmeasure}{% |
| 2111 |
\smash{\begin{picture}(0,0) |
| 2112 |
(0,\LenToUnit{% |
| 2113 |
\if t\layervalign -\ht\strutbox |
| 2114 |
\else |
| 2115 |
\if b\layervalign -\dimexpr\layerheight-\dp\strutbox\relax |
| 2116 |
\else -.5\dimexpr\layerheight+\ht\strutbox-\dp\strutbox\relax |
| 2117 |
\fi |
| 2118 |
\fi}) |
| 2119 |
% \end{macrocode} |
| 2120 |
% 1st horizontal cm |
| 2121 |
% \begin{macrocode} |
| 2122 |
\setlength{\unitlength}{1mm}% |
| 2123 |
\put(0,0){\line(1,0){\LenToUnit{\layerwidth}}}% |
| 2124 |
\@tempcnta=\numexpr \dimexpr\layerwidth + .5mm\relax/\dimexpr 1mm\relax\relax |
| 2125 |
\multiput(0,0)(1,0){\@tempcnta}{% |
| 2126 |
\line(0,-1){1}% |
| 2127 |
}% |
| 2128 |
\@tempcnta=\numexpr \dimexpr\layerwidth + 2.5mm\relax/\dimexpr 5mm\relax\relax |
| 2129 |
\multiput(0,0)(5,0){\@tempcnta}{% |
| 2130 |
\line(0,-1){2}% |
| 2131 |
}% |
| 2132 |
\@tempcnta=\numexpr \dimexpr\layerwidth + .5cm\relax/\dimexpr 1cm\relax\relax |
| 2133 |
\multiput(0,0)(10,0){\@tempcnta}{% |
| 2134 |
\put(0,0){\line(0,-1){3}}% |
| 2135 |
\put(0,-3.5){% |
| 2136 |
\makebox(0,0)[ct]{\the\numexpr\@tempcnta-\@multicnt\relax}}% |
| 2137 |
}% |
| 2138 |
% \end{macrocode} |
| 2139 |
% 2nd horizontal in: |
| 2140 |
% \begin{macrocode} |
| 2141 |
\put(0,\LenToUnit{-\layerheight}){\line(1,0){\LenToUnit{\layerwidth}}}% |
| 2142 |
\@tempcnta=\numexpr \dimexpr\layerwidth + .05in\relax/\dimexpr .1in\relax\relax |
| 2143 |
\multiput(0,\LenToUnit{-\layerheight})(2.54,0){\@tempcnta}{% |
| 2144 |
\line(0,1){1}% |
| 2145 |
}% |
| 2146 |
\@tempcnta=\numexpr \dimexpr\layerwidth + .25in\relax/\dimexpr .5in\relax\relax |
| 2147 |
\multiput(0,\LenToUnit{-\layerheight})(12.7,0){\@tempcnta}{% |
| 2148 |
\line(0,1){2}% |
| 2149 |
}% |
| 2150 |
\@tempcnta=\numexpr \dimexpr\layerwidth + .5in\relax/\dimexpr 1in\relax\relax |
| 2151 |
\multiput(0,\LenToUnit{-\layerheight})(25.4,0){\@tempcnta}{% |
| 2152 |
\put(0,0){\line(0,1){3}}% |
| 2153 |
\put(0,3.5){% |
| 2154 |
\makebox(0,0)[cb]{\the\numexpr\@tempcnta-\@multicnt\relax}}% |
| 2155 |
}% |
| 2156 |
% \end{macrocode} |
| 2157 |
% 3rd vertical cm: |
| 2158 |
% \begin{macrocode} |
| 2159 |
\put(0,0){\line(0,-1){\LenToUnit{\layerheight}}}% |
| 2160 |
\@tempcnta\numexpr \dimexpr\layerheight + .5mm\relax/\dimexpr 1mm\relax\relax |
| 2161 |
\multiput(0,0)(0,-1){\@tempcnta}{% |
| 2162 |
\line(1,0){1}% |
| 2163 |
}% |
| 2164 |
\@tempcnta\numexpr \dimexpr\layerheight + 2.5mm\relax/\dimexpr 5mm\relax\relax |
| 2165 |
\multiput(0,0)(0,-5){\@tempcnta}{% |
| 2166 |
\line(1,0){2}% |
| 2167 |
}% |
| 2168 |
\@tempcnta\numexpr \dimexpr\layerheight + .5cm\relax/\dimexpr 1cm\relax\relax |
| 2169 |
\multiput(0,0)(0,-10){\@tempcnta}{% |
| 2170 |
\put(0,0){\line(1,0){3}}% |
| 2171 |
\put(3.5,0){% |
| 2172 |
\makebox(0,0)[cl]{\the\numexpr\@tempcnta-\@multicnt\relax}}% |
| 2173 |
}% |
| 2174 |
% \end{macrocode} |
| 2175 |
% 4th vertical in: |
| 2176 |
% \begin{macrocode} |
| 2177 |
\put(\LenToUnit{\layerwidth},0){\line(0,-1){\LenToUnit{\layerheight}}}% |
| 2178 |
\@tempcnta\numexpr \dimexpr\layerheight + .05in\relax/\dimexpr .1in\relax\relax |
| 2179 |
\multiput(\LenToUnit{\layerwidth},0)(0,-2.54){\@tempcnta}{% |
| 2180 |
\line(-1,0){1}% |
| 2181 |
}% |
| 2182 |
\@tempcnta\numexpr \dimexpr\layerheight + .25in\relax/\dimexpr .5in\relax\relax |
| 2183 |
\multiput(\LenToUnit{\layerwidth},0)(0,-12.7){\@tempcnta}{% |
| 2184 |
\line(-1,0){2}% |
| 2185 |
}% |
| 2186 |
\@tempcnta\numexpr \dimexpr\layerheight + .5in\relax/\dimexpr 1in\relax\relax |
| 2187 |
\multiput(\LenToUnit{\layerwidth},0)(0,-25.4){\@tempcnta}{% |
| 2188 |
\put(0,0){\line(-1,0){3}}% |
| 2189 |
\put(-3.5,0){% |
| 2190 |
\makebox(0,0)[cr]{\the\numexpr\@tempcnta-\@multicnt\relax}}% |
| 2191 |
}% |
| 2192 |
\end{picture}}% |
| 2193 |
} |
| 2194 |
% \end{macrocode} |
| 2195 |
% \begin{command}{\LenToUnit} |
| 2196 |
% \changes{v3.19}{2015/07/27}{added} |
| 2197 |
% Due to an incompatibility of package \textsf{curve2e} I've eliminated |
| 2198 |
% \cs{@gobble} in the definition of \cs{layercontentsmeasure} and replaced it |
| 2199 |
% sometimes by \cs{LenToUnit} with the (not long) definition suggested by |
| 2200 |
% \textsf{curve2e} itself. |
| 2201 |
% \begin{macrocode} |
| 2202 |
\providecommand*{\LenToUnit}[1]{\strip@pt\dimexpr#1*\p@/\unitlength} |
| 2203 |
%</package&body> |
| 2204 |
% \end{macrocode} |
| 2205 |
% \end{command}^^A \LenToUnit |
| 2206 |
% \end{command}^^A \layercontentsmeasure |
| 2207 |
% |
| 2208 |
% |
| 2209 |
% \subsection{Providing Page Styles} |
| 2210 |
% |
| 2211 |
% Page styles in \LaTeX{} consist of the elements: |
| 2212 |
% \begin{itemize} |
| 2213 |
% \item a header for odd pages, |
| 2214 |
% \item a header for even pages, |
| 2215 |
% \item a footer for odd pages, |
| 2216 |
% \item a footer for even pages, |
| 2217 |
% \end{itemize} |
| 2218 |
% and some optional additional commands, that will be expanded, whenever the |
| 2219 |
% page style will be activated. Note, that header and footer for even pages |
| 2220 |
% will be used only at two-sided mode. At one-sided mode the header and footer |
| 2221 |
% for odd pages will be used for all pages. |
| 2222 |
% |
| 2223 |
% With package \pkg*{scrlayer} layers will be linked to package styles and |
| 2224 |
% expanded at the four elements above. Background layers will expand only |
| 2225 |
% at the headers. Foreground layers will expand only at the |
| 2226 |
% footers. Layers, that haven't been restricted to background or foreground, |
| 2227 |
% will expand at both, page headers and page footers. |
| 2228 |
% |
| 2229 |
% Similar to the expansion of background and foreground layers, odd page |
| 2230 |
% layers will only expand in the headers or footers of odd pages and even page |
| 2231 |
% layers will only expand in the headers or footers of even pages. Layers, |
| 2232 |
% that haven't been restricted to odd or even pages, will expand in the |
| 2233 |
% headers or footers of odd pages and also in the headers or footers of even |
| 2234 |
% pages. |
| 2235 |
% |
| 2236 |
% One step more: Single-side layers will only expand in the headers or footers |
| 2237 |
% of pages in single-side layouts and two-side layers only in the headers or |
| 2238 |
% footers of pages in two-side layout. |
| 2239 |
% |
| 2240 |
% One more step: float page layers will only expand in the headers or footers |
| 2241 |
% of pages, that consists of page floats only, while non-float page layers |
| 2242 |
% will only expand in the headers of footers of pages, that doesn't have page |
| 2243 |
% floats. |
| 2244 |
% |
| 2245 |
% \begin{length}{\footheight} |
| 2246 |
% For the header \LaTeX{} already defines a length \len{headheight} to be |
| 2247 |
% the maximum height of the header. But for footer it only defines the |
| 2248 |
% distance of the baseline of the footer from the last baseline of the text |
| 2249 |
% area. \pkg*{scrlayer} changes this and also defines a new length |
| 2250 |
% \len{footheight}. This length will be initialised with magic value |
| 2251 |
% -12345\,sp. But if it is still that magic value at |
| 2252 |
% \cs{begin}\texttt\{\env{document}\texttt\} it will be reset to the value of |
| 2253 |
% \len{baselineskip}. |
| 2254 |
% \begin{macrocode} |
| 2255 |
%<*package&init> |
| 2256 |
\@ifundefined{footheight}{% |
| 2257 |
\newlength{\footheight}% |
| 2258 |
\setlength{\footheight}{-12345sp}% |
| 2259 |
}{% |
| 2260 |
%<*trace> |
| 2261 |
\PackageInfo{scrlayer}{Using already defined \string\footheight\MessageBreak |
| 2262 |
hoping, that this is a length and\MessageBreak |
| 2263 |
not only a macro}% |
| 2264 |
%</trace> |
| 2265 |
} |
| 2266 |
\AtBeginDocument{% |
| 2267 |
\ifdim\footheight=-12345sp |
| 2268 |
%<*trace> |
| 2269 |
\PackageInfo{scrlayer}{Setting magic \string\footheight\space to |
| 2270 |
\string\baselineskip\space while\MessageBreak |
| 2271 |
\string\begin{document}}% |
| 2272 |
%</trace> |
| 2273 |
\setlength{\footheight}{\baselineskip} |
| 2274 |
\fi |
| 2275 |
} |
| 2276 |
%</package&init> |
| 2277 |
% \end{macrocode} |
| 2278 |
% \end{length}^^A \footheight |
| 2279 |
% |
| 2280 |
% |
| 2281 |
% Several of the following commands use \meta{key}=\meta{value} arguments. So |
| 2282 |
% we define a family with a new member: |
| 2283 |
% \begin{macrocode} |
| 2284 |
%<*package&body> |
| 2285 |
\DefineFamily{KOMAarg} |
| 2286 |
\DefineFamilyMember[.definelayerpagestyle]{KOMAarg} |
| 2287 |
%</package&body> |
| 2288 |
% \end{macrocode} |
| 2289 |
% |
| 2290 |
% \begin{command}{\DeclarePageStyleByLayers} |
| 2291 |
% \begin{description} |
| 2292 |
% \item[\oarg{option list}:] comma separated list of named page |
| 2293 |
% style options (see below). |
| 2294 |
% \item[\marg{string}:] the name of the page style to be declared (must |
| 2295 |
% be expandable and result in a string). |
| 2296 |
% \item[\marg{string list}:] comma separated list of layer names (must |
| 2297 |
% be expandable and result in strings); first in the list will be added |
| 2298 |
% first. |
| 2299 |
% \end{description} |
| 2300 |
% Page styles may be declared using this command. It has one optional and |
| 2301 |
% two mandatory arguments. The first mandatory one is the name of the page |
| 2302 |
% style and the second one is a list of layers to be used for this page |
| 2303 |
% style. The page style itself will expand all background layers for odd |
| 2304 |
% pages in \cs{@oddhead}, all background layers for even pages on |
| 2305 |
% \cs{@evenhead}, all foreground layers for odd pages in \cs{@oddfoot}, and |
| 2306 |
% all foreground layers for even pages in \cs{@evenfoot}. This may be |
| 2307 |
% restricted by additional attributes, e.g., \opt{oneside} and |
| 2308 |
% \opt{twoside}. |
| 2309 |
% |
| 2310 |
% The optional argument may be used to define hooks. There are six named |
| 2311 |
% optional arguments to set up six hooks. And there are also \KOMAScript{} |
| 2312 |
% options for these, to define global pre-definitions. Note, that you may |
| 2313 |
% remove the global pre-definitions by emptying the local hooks. The local |
| 2314 |
% argument are named similar, but without ``\texttt{ps}'' after |
| 2315 |
% ``\texttt{on}''. |
| 2316 |
% \begin{option}{onselect} |
| 2317 |
% \changes{v3.28}{2019/11/28}{marker for \cs{ModifyLayerPageStyleOptions}} |
| 2318 |
% \begin{option}{onpsselect} |
| 2319 |
% \begin{macro}{\@ps@initialhook} |
| 2320 |
% \begin{description} |
| 2321 |
% \item[\texttt{=\meta{code}}:] executes \meta{code} whenever the |
| 2322 |
% page style will be selected, e.g. using \cs{pagestyle} or |
| 2323 |
% \cs{thispagestyle} or the low level command defining the page |
| 2324 |
% style itself. |
| 2325 |
% \end{description} |
| 2326 |
% \begin{macrocode} |
| 2327 |
%<*options> |
| 2328 |
\KOMA@key{onpsselect}{% |
| 2329 |
\l@addto@macro{\@ps@initialhook}{#1}% |
| 2330 |
\FamilyKeyStateProcessed |
| 2331 |
\KOMA@kav@add{scrlayer.sty}{onpsselect}{#1}% |
| 2332 |
} |
| 2333 |
%<package>\scrlayer@@add@inherited@option{onpsselect} |
| 2334 |
%<package>\newcommand*{\@ps@initialhook}{} |
| 2335 |
%<package>\KOMA@kav@add{scrlayer.sty}{onpsselect}{} |
| 2336 |
%</options> |
| 2337 |
%<*interface&body> |
| 2338 |
\expandafter\let |
| 2339 |
\csname KV@KOMA.\@currname.\@currext @onpsselect\endcsname\relax |
| 2340 |
\expandafter\let |
| 2341 |
\csname KV@KOMA.\@currname.\@currext @onpsselect@default\endcsname\relax |
| 2342 |
%</interface&body> |
| 2343 |
%<*package&body> |
| 2344 |
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onselect}{% |
| 2345 |
\expandafter\l@addto@macro |
| 2346 |
\csname @ps@\scrlayer@current@pagestyle @initialhook\endcsname |
| 2347 |
{#1}% |
| 2348 |
\let\scr@opt@marker@initialhook\FamilyKeyStateProcssed |
| 2349 |
\FamilyKeyStateProcessed |
| 2350 |
} |
| 2351 |
%</package&body> |
| 2352 |
% \end{macrocode} |
| 2353 |
% \end{macro}^^A \@ps@initialhook |
| 2354 |
% \end{option}^^A onpsselect |
| 2355 |
% \begin{option}{onpsinit} |
| 2356 |
% \begin{macro}{\@ps@hook} |
| 2357 |
% \begin{description} |
| 2358 |
% \item[\texttt{=\meta{code}}:] executes \meta{code} whenever the |
| 2359 |
% output of a layer stack is initialised. Note, that \meta{code} must not |
| 2360 |
% result in any page output. Otherwise the output of the layer stack will be |
| 2361 |
% broken! |
| 2362 |
% \end{description} |
| 2363 |
% \begin{macrocode} |
| 2364 |
%<*options> |
| 2365 |
\KOMA@key{onpsinit}{% |
| 2366 |
\l@addto@macro{\@ps@hook}{#1}% |
| 2367 |
\FamilyKeyStateProcessed |
| 2368 |
\KOMA@kav@add{scrlayer.sty}{onpsinit}{#1}% |
| 2369 |
} |
| 2370 |
%<package>\scrlayer@@add@inherited@option{onpsinit} |
| 2371 |
%<package>\newcommand*{\@ps@hook}{} |
| 2372 |
%<package>\KOMA@kav@add{scrlayer.sty}{onpsinit}{} |
| 2373 |
%</options> |
| 2374 |
%<*interface&body> |
| 2375 |
\expandafter\let |
| 2376 |
\csname KV@KOMA.\@currname.\@currext @onpsinit\endcsname\relax |
| 2377 |
\expandafter\let |
| 2378 |
\csname KV@KOMA.\@currname.\@currext @onpsinit@default\endcsname\relax |
| 2379 |
%</interface&body> |
| 2380 |
%<*package&body> |
| 2381 |
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{oninit}{% |
| 2382 |
\expandafter\l@addto@macro |
| 2383 |
\csname @ps@\scrlayer@current@pagestyle @hook\endcsname |
| 2384 |
{#1}% |
| 2385 |
\let\scr@opt@marker@hook\FamilyKeyStateProcssed |
| 2386 |
\FamilyKeyStateProcessed |
| 2387 |
} |
| 2388 |
%</package&body> |
| 2389 |
% \end{macrocode} |
| 2390 |
% \end{macro}^^A \@ps@hook |
| 2391 |
% \end{option}^^A onpsinit |
| 2392 |
% \end{option}^^A oninit |
| 2393 |
% \begin{option}{ononeside} |
| 2394 |
% \changes{v3.28}{2019/11/28}{marker for \cs{ModifyLayerPageStyleOptions}} |
| 2395 |
% \begin{option}{onpsoneside} |
| 2396 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 2397 |
% commands removed} |
| 2398 |
% \begin{macro}{\@ps@onesidehook} |
| 2399 |
% \begin{description} |
| 2400 |
% \item[\opt{=\meta{code}}:] executes \meta{code} after |
| 2401 |
% \opt{oninit}'s \meta{code} whenever the output of a layer stack of a |
| 2402 |
% page in single-side layout is initialised. Note, that \meta{code} must not |
| 2403 |
% result in any page output. Otherwise the output of the layer stack will be |
| 2404 |
% broken! |
| 2405 |
% \end{description} |
| 2406 |
% \begin{macrocode} |
| 2407 |
%<*options> |
| 2408 |
\KOMA@key{onpsoneside}{% |
| 2409 |
\l@addto@macro{\@ps@onesidehook}{#1}% |
| 2410 |
\FamilyKeyStateProcessed |
| 2411 |
\KOMA@kav@add{scrlayer.sty}{onpsoneside}{#1}% |
| 2412 |
} |
| 2413 |
%<package>\scrlayer@@add@inherited@option{onpsoneside} |
| 2414 |
%<package>\newcommand*{\@ps@onesidehook}{} |
| 2415 |
%<package>\KOMA@kav@add{scrlayer.sty}{onpsoneside}{} |
| 2416 |
%</options> |
| 2417 |
%<*interface&body> |
| 2418 |
\expandafter\let |
| 2419 |
\csname KV@KOMA.\@currname.\@currext @onpsoneside\endcsname\relax |
| 2420 |
\expandafter\let |
| 2421 |
\csname KV@KOMA.\@currname.\@currext @onpsoneside@default\endcsname\relax |
| 2422 |
%</interface&body> |
| 2423 |
%<*package&body> |
| 2424 |
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{ononeside}{% |
| 2425 |
\expandafter\l@addto@macro |
| 2426 |
\csname @ps@\scrlayer@current@pagestyle @onesidehook\endcsname |
| 2427 |
{#1}% |
| 2428 |
\let\scr@opt@marker@onesidehook\FamilyKeyStateProcssed |
| 2429 |
\FamilyKeyStateProcessed |
| 2430 |
} |
| 2431 |
%</package&body> |
| 2432 |
% \end{macrocode} |
| 2433 |
% \end{macro}^^A \@ps@onesidehook |
| 2434 |
% \end{option}^^A onpsoneside |
| 2435 |
% \end{option}^^A ononeside |
| 2436 |
% \begin{option}{ontwoside} |
| 2437 |
% \changes{v3.28}{2019/11/28}{marker for \cs{ModifyLayerPageStyleOptions}} |
| 2438 |
% \begin{option}{onpstwoside} |
| 2439 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 2440 |
% commands removed} |
| 2441 |
% \begin{macro}{\@ps@twosidehook} |
| 2442 |
% \begin{description} |
| 2443 |
% \item[\opt{=\meta{code}}:] executes \meta{code} after |
| 2444 |
% \opt{oninit}'s \meta{code} whenever the output of a layer stack of a |
| 2445 |
% page in two-side layout is initialised. Note, that \meta{code} must not |
| 2446 |
% result in any page output. Otherwise the output of the layer stack will be |
| 2447 |
% broken! |
| 2448 |
% \end{description} |
| 2449 |
% \begin{macrocode} |
| 2450 |
%<*options> |
| 2451 |
\KOMA@key{onpstwoside}{% |
| 2452 |
\l@addto@macro{\@ps@twosidehook}{#1}% |
| 2453 |
\FamilyKeyStateProcessed |
| 2454 |
\KOMA@kav@add{scrlayer.sty}{onpstwoside}{#1}% |
| 2455 |
} |
| 2456 |
%<package>\scrlayer@@add@inherited@option{onpstwoside} |
| 2457 |
%<package>\newcommand*{\@ps@twosidehook}{} |
| 2458 |
%<package>\KOMA@kav@add{scrlayer.sty}{onpstwoside}{} |
| 2459 |
%</options> |
| 2460 |
%<*interface&body> |
| 2461 |
\expandafter\let |
| 2462 |
\csname KV@KOMA.\@currname.\@currext @onpstwoside\endcsname\relax |
| 2463 |
\expandafter\let |
| 2464 |
\csname KV@KOMA.\@currname.\@currext @onpstwoside@default\endcsname\relax |
| 2465 |
%</interface&body> |
| 2466 |
%<*package&body> |
| 2467 |
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{ontwoside}{% |
| 2468 |
\expandafter\l@addto@macro |
| 2469 |
\csname @ps@\scrlayer@current@pagestyle @twosidehook\endcsname |
| 2470 |
{#1}% |
| 2471 |
\let\scr@opt@marker@twosidehook\FamilyKeyStateProcssed |
| 2472 |
\FamilyKeyStateProcessed |
| 2473 |
} |
| 2474 |
%</package&body> |
| 2475 |
% \end{macrocode} |
| 2476 |
% \end{macro}^^A \@ps@twosidehook |
| 2477 |
% \end{option}^^A onpstwoside |
| 2478 |
% \end{option}^^A ontwoside |
| 2479 |
% \begin{option}{onoddpage} |
| 2480 |
% \changes{v3.28}{2019/11/28}{marker for \cs{ModifyLayerPageStyleOptions}} |
| 2481 |
% \begin{option}{onpsoddpage} |
| 2482 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 2483 |
% commands removed} |
| 2484 |
% \begin{macro}{\@ps@oddpagehook} |
| 2485 |
% \begin{description} |
| 2486 |
% \item[\texttt{=\meta{code}}:] executes \meta{code} after |
| 2487 |
% \opt{ononeside}'s or \opt{ontwoside}'s \meta{code} whenever the |
| 2488 |
% output of a layer stack of an odd page is initialised. Note, that |
| 2489 |
% \meta{code} must not result in any page output. Otherwise the output of |
| 2490 |
% the layer stack will be broken! |
| 2491 |
% \end{description} |
| 2492 |
% \begin{macrocode} |
| 2493 |
%<*options> |
| 2494 |
\KOMA@key{onpsoddpage}{% |
| 2495 |
\l@addto@macro{\@ps@oddpagehook}{#1}% |
| 2496 |
\FamilyKeyStateProcessed |
| 2497 |
\KOMA@kav@add{scrlayer.sty}{onpsoddpage}{#1}% |
| 2498 |
} |
| 2499 |
%<package>\scrlayer@@add@inherited@option{onpsoddpage} |
| 2500 |
%<package>\newcommand*{\@ps@oddpagehook}{} |
| 2501 |
%<package>\KOMA@kav@add{scrlayer.sty}{onpsoddpage}{} |
| 2502 |
%</options> |
| 2503 |
%<*interface&body> |
| 2504 |
\expandafter\let |
| 2505 |
\csname KV@KOMA.\@currname.\@currext @onpsoddpage\endcsname\relax |
| 2506 |
\expandafter\let |
| 2507 |
\csname KV@KOMA.\@currname.\@currext @onpsoddpage@default\endcsname\relax |
| 2508 |
%</interface&body> |
| 2509 |
%<*package&body> |
| 2510 |
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onoddpage}{% |
| 2511 |
\expandafter\l@addto@macro |
| 2512 |
\csname @ps@\scrlayer@current@pagestyle @oddpagehook\endcsname |
| 2513 |
{#1}% |
| 2514 |
\let\scr@opt@marker@oddpagehook\FamilyKeyStateProcssed |
| 2515 |
\FamilyKeyStateProcessed |
| 2516 |
} |
| 2517 |
%</package&body> |
| 2518 |
% \end{macrocode} |
| 2519 |
% \end{macro}^^A \@ps@oddpagehook |
| 2520 |
% \end{option}^^A onpsoddpage |
| 2521 |
% \end{option}^^A onoddside |
| 2522 |
% \begin{option}{onevenpage} |
| 2523 |
% \changes{v3.28}{2019/11/28}{marker for \cs{ModifyLayerPageStyleOptions}} |
| 2524 |
% \begin{option}{onpsevenpage} |
| 2525 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 2526 |
% commands removed} |
| 2527 |
% \begin{macro}{\@ps@evenpagehook} |
| 2528 |
% \begin{description} |
| 2529 |
% \item[\texttt{=\meta{code}}:] executes \meta{code} after |
| 2530 |
% \opt{ononeside}'s or \opt{ontwoside}'s \meta{code} whenever the |
| 2531 |
% output of a layer stack of an even page is initialised. Note, that |
| 2532 |
% \meta{code} must not result in any page output. Otherwise the output of |
| 2533 |
% the layer stack will be broken! |
| 2534 |
% \end{description} |
| 2535 |
% \begin{macrocode} |
| 2536 |
%<*options> |
| 2537 |
\KOMA@key{onpsevenpage}{% |
| 2538 |
\l@addto@macro{\@ps@evenpagehook}{#1}% |
| 2539 |
\FamilyKeyStateProcessed |
| 2540 |
\KOMA@kav@add{scrlayer.sty}{onpsevenpage}{#1}% |
| 2541 |
} |
| 2542 |
%<package>\scrlayer@@add@inherited@option{onpsevenpage} |
| 2543 |
%<package>\newcommand*{\@ps@evenpagehook}{} |
| 2544 |
%<package>\KOMA@kav@add{scrlayer.sty}{onpsevenpage}{} |
| 2545 |
%</options> |
| 2546 |
%<*interface&body> |
| 2547 |
\expandafter\let |
| 2548 |
\csname KV@KOMA.\@currname.\@currext @onpsevenpage\endcsname\relax |
| 2549 |
\expandafter\let |
| 2550 |
\csname KV@KOMA.\@currname.\@currext @onpsevenpage@default\endcsname\relax |
| 2551 |
%</interface&body> |
| 2552 |
%<*package&body> |
| 2553 |
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onevenpage}{% |
| 2554 |
\expandafter\l@addto@macro |
| 2555 |
\csname @ps@\scrlayer@current@pagestyle @evenpagehook\endcsname |
| 2556 |
{#1}% |
| 2557 |
\let\scr@opt@marker@evenpagehook\FamilyKeyStateProcssed |
| 2558 |
\FamilyKeyStateProcessed |
| 2559 |
} |
| 2560 |
%</package&body> |
| 2561 |
% \end{macrocode} |
| 2562 |
% \end{macro}^^A \@ps@evenpagehook |
| 2563 |
% \end{option}^^A onpsevenpage |
| 2564 |
% \end{option}^^A onevenside |
| 2565 |
% \begin{option}{onfloatpage} |
| 2566 |
% \changes{v3.28}{2019/11/28}{marker for \cs{ModifyLayerPageStyleOptions}} |
| 2567 |
% \begin{option}{onpsfloatpage} |
| 2568 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 2569 |
% commands removed} |
| 2570 |
% \begin{macro}{\@ps@floatpagehook} |
| 2571 |
% \begin{description} |
| 2572 |
% \item[\opt{=\meta{code}}:] executes \meta{code} after |
| 2573 |
% \opt{onoddpage}'s or \opt{onevenpage}'s \meta{code} whenever a float |
| 2574 |
% column has been made (usually those pages are float pages). |
| 2575 |
% \end{description} |
| 2576 |
% \begin{macrocode} |
| 2577 |
%<*options> |
| 2578 |
\KOMA@key{onpsfloatpage}{% |
| 2579 |
\l@addto@macro{\@ps@floatpagehook}{#1}% |
| 2580 |
\FamilyKeyStateProcessed |
| 2581 |
\KOMA@kav@add{scrlayer.sty}{onpsfloatpage}{#1}% |
| 2582 |
} |
| 2583 |
%<package>\scrlayer@@add@inherited@option{onpsfloatpage} |
| 2584 |
%<package>\newcommand*{\@ps@floatpagehook}{} |
| 2585 |
%<package>\KOMA@kav@add{scrlayer.sty}{onpsfloatpage}{} |
| 2586 |
%</options> |
| 2587 |
%<*interface&body> |
| 2588 |
\expandafter\let |
| 2589 |
\csname KV@KOMA.\@currname.\@currext @onpsfloatpage\endcsname\relax |
| 2590 |
\expandafter\let |
| 2591 |
\csname KV@KOMA.\@currname.\@currext @onpsfloatpage@default\endcsname\relax |
| 2592 |
%</interface&body> |
| 2593 |
%<*package&body> |
| 2594 |
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onfloatpage}{% |
| 2595 |
\expandafter\l@addto@macro |
| 2596 |
\csname @ps@\scrlayer@current@pagestyle @floatpagehook\endcsname |
| 2597 |
{#1}% |
| 2598 |
\let\scr@opt@marker@floatpagehook\FamilyKeyStateProcssed |
| 2599 |
\FamilyKeyStateProcessed |
| 2600 |
} |
| 2601 |
%</package&body> |
| 2602 |
% \end{macrocode} |
| 2603 |
% \end{macro}^^A \@ps@floatpagehook |
| 2604 |
% \end{option}^^A onpsfloatpage |
| 2605 |
% \end{option}^^A onfloatpage |
| 2606 |
% \begin{option}{onnonfloatpage} |
| 2607 |
% \changes{v3.28}{2019/11/28}{marker for \cs{ModifyLayerPageStyleOptions}} |
| 2608 |
% \begin{option}{onpsnonfloatpage} |
| 2609 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 2610 |
% commands removed} |
| 2611 |
% \begin{macro}{\@ps@nonfloatpagehook} |
| 2612 |
% \begin{description} |
| 2613 |
% \item[\opt{=\meta{code}}:] executes \meta{code} after |
| 2614 |
% \opt{onoddpage}'s or \opt{onevenpage}'s \meta{code} whenever no |
| 2615 |
% float column has been made (usually those pages aren't float pages). |
| 2616 |
% \end{description} |
| 2617 |
% \begin{macrocode} |
| 2618 |
%<*options> |
| 2619 |
\KOMA@key{onpsnonfloatpage}{% |
| 2620 |
\l@addto@macro{\@ps@nonfloatpagehook}{#1}% |
| 2621 |
\FamilyKeyStateProcessed |
| 2622 |
\KOMA@kav@add{scrlayer.sty}{onpsnonfloatpage}{#1}% |
| 2623 |
} |
| 2624 |
%<package>\scrlayer@@add@inherited@option{onpsnonfloatpage} |
| 2625 |
%<package>\newcommand*{\@ps@nonfloatpagehook}{} |
| 2626 |
%<package>\KOMA@kav@add{scrlayer.sty}{onpsnonfloatpage}{} |
| 2627 |
%</options> |
| 2628 |
%<*interface&body> |
| 2629 |
\expandafter\let |
| 2630 |
\csname KV@KOMA.\@currname.\@currext @onpsnonfloatpage\endcsname\relax |
| 2631 |
\expandafter\let |
| 2632 |
\csname KV@KOMA.\@currname.\@currext @onpsnonfloatpage@default\endcsname\relax |
| 2633 |
%</interface&body> |
| 2634 |
%<*package&body> |
| 2635 |
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onnonfloatpage}{% |
| 2636 |
\expandafter\l@addto@macro |
| 2637 |
\csname @ps@\scrlayer@current@pagestyle @nonfloatpagehook\endcsname |
| 2638 |
{#1}% |
| 2639 |
\let\scr@opt@marker@nonfloatpagehook\FamilyKeyStateProcssed |
| 2640 |
\FamilyKeyStateProcessed |
| 2641 |
} |
| 2642 |
%</package&body> |
| 2643 |
% \end{macrocode} |
| 2644 |
% \end{macro}^^A \@ps@nonfloatpagehook |
| 2645 |
% \end{option}^^A onpsnonfloatpage |
| 2646 |
% \end{option}^^A onnonfloatpage |
| 2647 |
% \begin{option}{onbackground} |
| 2648 |
% \changes{v3.28}{2019/11/28}{marker for \cs{ModifyLayerPageStyleOptions}} |
| 2649 |
% \begin{option}{onpsbackground} |
| 2650 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 2651 |
% commands removed} |
| 2652 |
% \begin{macro}{\@ps@backgroundhook} |
| 2653 |
% \begin{description} |
| 2654 |
% \item[\texttt{=\meta{code}}:] executes \meta{code} after |
| 2655 |
% \opt{onfloatpage}'s or \opt{onnonfloatpage}'s \meta{code} whenever |
| 2656 |
% the output of a background layer stack is initialised. Note, that |
| 2657 |
% \meta{code} must not result in any page output. Otherwise the output of |
| 2658 |
% the layer stack will be broken! |
| 2659 |
% \end{description} |
| 2660 |
% \begin{macrocode} |
| 2661 |
%<*options> |
| 2662 |
\KOMA@key{onpsbackground}{% |
| 2663 |
\l@addto@macro{\@ps@backgroundhook}{#1}% |
| 2664 |
\FamilyKeyStateProcessed |
| 2665 |
\KOMA@kav@add{scrlayer.sty}{onpsbackground}{#1}% |
| 2666 |
} |
| 2667 |
%<package>\scrlayer@@add@inherited@option{onpsbackground} |
| 2668 |
%<package>\newcommand*{\@ps@backgroundhook}{} |
| 2669 |
%<package>\KOMA@kav@add{scrlayer.sty}{onpsbackground}{} |
| 2670 |
%</options> |
| 2671 |
%<*interface&body> |
| 2672 |
\expandafter\let |
| 2673 |
\csname KV@KOMA.\@currname.\@currext @onpsbackground\endcsname\relax |
| 2674 |
\expandafter\let |
| 2675 |
\csname KV@KOMA.\@currname.\@currext @onpsbackground@default\endcsname\relax |
| 2676 |
%</interface&body> |
| 2677 |
%<*package&body> |
| 2678 |
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onbackground}{% |
| 2679 |
\expandafter\l@addto@macro |
| 2680 |
\csname @ps@\scrlayer@current@pagestyle @backgroundhook\endcsname |
| 2681 |
{#1}% |
| 2682 |
\let\scr@opt@marker@backgroundhook\FamilyKeyStateProcssed |
| 2683 |
\FamilyKeyStateProcessed |
| 2684 |
} |
| 2685 |
%</package&body> |
| 2686 |
% \end{macrocode} |
| 2687 |
% \end{macro}^^A \@ps@backgroundhook |
| 2688 |
% \end{option}^^A onbackground |
| 2689 |
% \end{option}^^A onbackground |
| 2690 |
% \begin{option}{onforeground} |
| 2691 |
% \changes{v3.28}{2019/11/28}{marker for \cs{ModifyLayerPageStyleOptions}} |
| 2692 |
% \begin{option}{onpsforeground} |
| 2693 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 2694 |
% commands removed} |
| 2695 |
% \begin{macro}{\@ps@foregroundhook} |
| 2696 |
% \begin{description} |
| 2697 |
% \item[\texttt{=\meta{code}}:] executes \meta{code} after |
| 2698 |
% \opt{onfloatpage}'s or \opt{onnonfloatpage}'s \meta{code} whenever |
| 2699 |
% the output of a foreground layer stack is initialised. Note, that |
| 2700 |
% \meta{code} must not result in any page output. Otherwise the output of |
| 2701 |
% the layer stack will be broken! |
| 2702 |
% \end{description} |
| 2703 |
% \begin{macrocode} |
| 2704 |
%<*options> |
| 2705 |
\KOMA@key{onpsforeground}{% |
| 2706 |
\l@addto@macro{\@ps@foregroundhook}{#1}% |
| 2707 |
\FamilyKeyStateProcessed |
| 2708 |
\KOMA@kav@add{scrlayer.sty}{onpsforeground}{#1}% |
| 2709 |
} |
| 2710 |
%<package>\scrlayer@@add@inherited@option{onpsforeground} |
| 2711 |
%<package>\newcommand*{\@ps@foregroundhook}{} |
| 2712 |
%<package>\KOMA@kav@add{scrlayer.sty}{onpsforeground}{} |
| 2713 |
%</options> |
| 2714 |
%<*interface&body> |
| 2715 |
\expandafter\let |
| 2716 |
\csname KV@KOMA.\@currname.\@currext @onpsforeground\endcsname\relax |
| 2717 |
\expandafter\let |
| 2718 |
\csname KV@KOMA.\@currname.\@currext @onpsforeground@default\endcsname\relax |
| 2719 |
%</interface&body> |
| 2720 |
%<*package&body> |
| 2721 |
\DefineFamilyKey[.definelayerpagestyle]{KOMAarg}{onforeground}{% |
| 2722 |
\expandafter\l@addto@macro |
| 2723 |
\csname @ps@\scrlayer@current@pagestyle @foregroundhook\endcsname |
| 2724 |
{#1}% |
| 2725 |
\let\scr@opt@marker@foregroundhook\FamilyKeyStateProcssed |
| 2726 |
\FamilyKeyStateProcessed |
| 2727 |
} |
| 2728 |
%</package&body> |
| 2729 |
% \end{macrocode} |
| 2730 |
% \end{macro}^^A \@psforegroundhook |
| 2731 |
% \end{option}^^A onpsforeground |
| 2732 |
% \end{option}^^A onforeground |
| 2733 |
% \begin{option}{singlespacing} |
| 2734 |
% \changes{v3.24}{2017/05/22}{added} |
| 2735 |
% \begin{description} |
| 2736 |
% \item[\texttt{=\meta{simple switch}}:] if activated, all page styles will be |
| 2737 |
% set with line spread 1. This switch is global. If you want it for some |
| 2738 |
% styles only, add \cs{linespread}|{1}|\cs{selectfont} to |
| 2739 |
% option \opt{oninit} of only those styles. |
| 2740 |
%\end{description} |
| 2741 |
% \begin{macrocode} |
| 2742 |
%<*options> |
| 2743 |
\KOMA@ifkey{singlespacing}{@ps@singlespacing} |
| 2744 |
%<package>\scrlayer@@add@inherited@option{singlespacing} |
| 2745 |
%</options> |
| 2746 |
% \end{macrocode} |
| 2747 |
% \end{option} |
| 2748 |
% \begin{macrocode} |
| 2749 |
%<*package&body> |
| 2750 |
\newcommand*{\DeclarePageStyleByLayers}[3][]{% |
| 2751 |
\edef\scrlayer@current@pagestyle{\GetRealPageStyle{#2}}% |
| 2752 |
\expandafter\scrlayer@declare@ps@by@layers\expandafter{% |
| 2753 |
\scrlayer@current@pagestyle |
| 2754 |
}{#1}{#3}% |
| 2755 |
} |
| 2756 |
% \end{macrocode} |
| 2757 |
% \begin{macro}{\scrlayer@declare@ps@by@layers} |
| 2758 |
% \changes{v3.15}{2014/12/28}{fix: \cs{linewidth} replaced by |
| 2759 |
% \cs{textwidth}} |
| 2760 |
% \changes{v3.18}{2015/06/09}{usage of \cs{parbox[b]} instead of |
| 2761 |
% \cs{parbox[t]} because of strange effect with package |
| 2762 |
% \textsf{multicol}} |
| 2763 |
% \changes{v3.24}{2017/05/22}{test for \cs{if@ps@singlespacing} added} |
| 2764 |
% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} added} |
| 2765 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 2766 |
% Needed, because of page style aliases. Same arguments like |
| 2767 |
% \cs{DeclarePageStyleByLayers} but, \#1 is the name of the page style, \#2 is |
| 2768 |
% the list of options and \#3 is still the list of layers. |
| 2769 |
% \begin{macrocode} |
| 2770 |
\newcommand*{\scrlayer@declare@ps@by@layers}[3]{% |
| 2771 |
\@namedef{@ps@#1@initialhook}{\@ps@initialhook}% |
| 2772 |
\@namedef{@ps@#1@hook}{\@ps@hook}% |
| 2773 |
\@namedef{@ps@#1@backgroundhook}{\@ps@backgroundhook}% |
| 2774 |
\@namedef{@ps@#1@foregroundhook}{\@ps@foregroundhook}% |
| 2775 |
\@namedef{@ps@#1@oddpagehook}{\@ps@oddpagehook}% |
| 2776 |
\@namedef{@ps@#1@evenpagehook}{\@ps@evenpagehook}% |
| 2777 |
\@namedef{@ps@#1@onesidehook}{\@ps@onesidehook}% |
| 2778 |
\@namedef{@ps@#1@twosidehook}{\@ps@twosidehook}% |
| 2779 |
\@namedef{@ps@#1@floatpagehook}{\@ps@floatpagehook}% |
| 2780 |
\@namedef{@ps@#1@nonfloatpagehook}{\@ps@nonfloatpagehook}% |
| 2781 |
\FamilyExecuteOptions[.definelayerpagestyle]{KOMAarg}{#2}% |
| 2782 |
\@namedef{ps@#1}{% |
| 2783 |
\renewcommand*{\currentpagestyle}{#1}% |
| 2784 |
\@nameuse{@ps@@everystyle@@initialhook}% |
| 2785 |
\@nameuse{@ps@#1@initialhook}% |
| 2786 |
\renewcommand*{\currentpagestyle}{#1}% |
| 2787 |
\renewcommand*{\@oddhead}{% |
| 2788 |
\begingroup |
| 2789 |
\let\headmark\rightmark |
| 2790 |
\if@ps@singlespacing\linespread{1}\selectfont\fi |
| 2791 |
\@nameuse{@ps@@everystyle@@hook}% |
| 2792 |
\@nameuse{@ps@#1@hook}% |
| 2793 |
\@nameuse{@ps@@everystyle@@\if@twoside two\else one\fi sidehook}% |
| 2794 |
\@nameuse{@ps@#1@\if@twoside two\else one\fi sidehook}% |
| 2795 |
\@nameuse{@ps@@everystyle@@oddpagehook}% |
| 2796 |
\@nameuse{@ps@#1@oddpagehook}% |
| 2797 |
\@nameuse{@ps@@everystyle@@\if@fcolmade\else non\fi floatpagehook}% |
| 2798 |
\@nameuse{@ps@#1@\if@fcolmade\else non\fi floatpagehook}% |
| 2799 |
\@nameuse{@ps@@everystyle@@backgroundhook}% |
| 2800 |
\@nameuse{@ps@#1@backgroundhook}% |
| 2801 |
\parbox[b][\headheight][t]{\textwidth}{% |
| 2802 |
\vskip \dimexpr -\topmargin-1in |
| 2803 |
-\ht\strutbox\relax |
| 2804 |
\hskip \dimexpr -\oddsidemargin-1in\relax |
| 2805 |
\strut\makebox[\z@][l]{% |
| 2806 |
\ForEachLayerOfPageStyle{@everystyle@}{% |
| 2807 |
\scrlayer@do@page@style@element@layer{background}{odd}% |
| 2808 |
{########1}% |
| 2809 |
}% |
| 2810 |
\ForEachLayerOfPageStyle{#1}{% |
| 2811 |
\scrlayer@do@page@style@element@layer{background}{odd}% |
| 2812 |
{########1}% |
| 2813 |
}% |
| 2814 |
}% |
| 2815 |
}% |
| 2816 |
\endgroup |
| 2817 |
}% |
| 2818 |
\renewcommand*{\@evenhead}{% |
| 2819 |
\begingroup |
| 2820 |
\let\headmark\leftmark |
| 2821 |
\if@ps@singlespacing\linespread{1}\selectfont\fi |
| 2822 |
\@nameuse{@ps@@everystyle@@hook}% |
| 2823 |
\@nameuse{@ps@#1@hook}% |
| 2824 |
\@nameuse{@ps@@everystyle@@twosidehook}% |
| 2825 |
\@nameuse{@ps@#1@twosidehook}% |
| 2826 |
\@nameuse{@ps@@everystyle@@evenpagehook}% |
| 2827 |
\@nameuse{@ps@#1@evenpagehook}% |
| 2828 |
\@nameuse{@ps@@everystyle@@\if@fcolmade\else non\fi floatpagehook}% |
| 2829 |
\@nameuse{@ps@#1@\if@fcolmade\else non\fi floatpagehook}% |
| 2830 |
\@nameuse{@ps@@everystyle@@backgroundhook}% |
| 2831 |
\@nameuse{@ps@#1@backgroundhook}% |
| 2832 |
\parbox[b][\headheight][t]{\textwidth}{% |
| 2833 |
\vskip \dimexpr -\topmargin-1in |
| 2834 |
-\ht\strutbox\relax |
| 2835 |
\hskip \dimexpr-\evensidemargin-1in\relax |
| 2836 |
\strut\makebox[\z@][l]{% |
| 2837 |
\ForEachLayerOfPageStyle{@everystyle@}{% |
| 2838 |
\scrlayer@do@page@style@element@layer{background}{even}% |
| 2839 |
{########1}% |
| 2840 |
}% |
| 2841 |
\ForEachLayerOfPageStyle{#1}{% |
| 2842 |
\scrlayer@do@page@style@element@layer{background}{even}% |
| 2843 |
{########1}% |
| 2844 |
}% |
| 2845 |
}% |
| 2846 |
}% |
| 2847 |
\endgroup |
| 2848 |
}% |
| 2849 |
\renewcommand*{\@oddfoot}{% |
| 2850 |
\begingroup |
| 2851 |
\let\headmark\rightmark |
| 2852 |
\if@ps@singlespacing\linespread{1}\selectfont\fi |
| 2853 |
\@nameuse{@ps@@everystyle@@hook}% |
| 2854 |
\@nameuse{@ps@#1@hook}% |
| 2855 |
\@nameuse{@ps@@everystyle@@\if@twoside two\else one\fi sidehook}% |
| 2856 |
\@nameuse{@ps@#1@\if@twoside two\else one\fi sidehook}% |
| 2857 |
\@nameuse{@ps@@everystyle@@oddpagehook}% |
| 2858 |
\@nameuse{@ps@#1@oddpagehook}% |
| 2859 |
\@nameuse{@ps@@everystyle@@\if@fcolmade\else non\fi floatpagehook}% |
| 2860 |
\@nameuse{@ps@#1@\if@fcolmade\else non\fi floatpagehook}% |
| 2861 |
\@nameuse{@ps@@everystyle@@foregroundhook}% |
| 2862 |
\@nameuse{@ps@#1@foregroundhook}% |
| 2863 |
\parbox[t][\headheight][t]{\textwidth}{% |
| 2864 |
\vskip \dimexpr -\topmargin-1in |
| 2865 |
-\headheight |
| 2866 |
-\headsep |
| 2867 |
-\textheight |
| 2868 |
-\footskip |
| 2869 |
-\ht\strutbox\relax |
| 2870 |
\hskip \dimexpr -\oddsidemargin-1in\relax |
| 2871 |
\strut\makebox[\z@][l]{% |
| 2872 |
\ForEachLayerOfPageStyle{@everystyle@}{% |
| 2873 |
\scrlayer@do@page@style@element@layer{foreground}{odd}% |
| 2874 |
{########1}% |
| 2875 |
}% |
| 2876 |
\ForEachLayerOfPageStyle{#1}{% |
| 2877 |
\scrlayer@do@page@style@element@layer{foreground}{odd}% |
| 2878 |
{########1}% |
| 2879 |
}% |
| 2880 |
}% |
| 2881 |
}% |
| 2882 |
\endgroup |
| 2883 |
}% |
| 2884 |
\renewcommand*{\@evenfoot}{% |
| 2885 |
\begingroup |
| 2886 |
\let\headmark\leftmark |
| 2887 |
\if@ps@singlespacing\linespread{1}\selectfont\fi |
| 2888 |
\@nameuse{@ps@@everystyle@@hook}% |
| 2889 |
\@nameuse{@ps@#1@hook}% |
| 2890 |
\@nameuse{@ps@@everystyle@@twosidehook}% |
| 2891 |
\@nameuse{@ps@#1@twosidehook}% |
| 2892 |
\@nameuse{@ps@@everystyle@@evenpagehook}% |
| 2893 |
\@nameuse{@ps@#1@evenpagehook}% |
| 2894 |
\@nameuse{@ps@@everystyle@@\if@fcolmade\else non\fi floatpagehook}% |
| 2895 |
\@nameuse{@ps@#1@\if@fcolmade\else non\fi floatpagehook}% |
| 2896 |
\@nameuse{@ps@@everystyle@@foregroundhook}% |
| 2897 |
\@nameuse{@ps@#1@foregroundhook}% |
| 2898 |
\parbox[t][\headheight][t]{\textwidth}{% |
| 2899 |
\vskip \dimexpr -\topmargin-1in |
| 2900 |
-\headheight |
| 2901 |
-\headsep |
| 2902 |
-\textheight |
| 2903 |
-\footskip |
| 2904 |
-\ht\strutbox\relax |
| 2905 |
\hskip \dimexpr-\evensidemargin-1in\relax |
| 2906 |
\strut\makebox[\z@][l]{% |
| 2907 |
\ForEachLayerOfPageStyle{@everystyle@}{% |
| 2908 |
\scrlayer@do@page@style@element@layer{foreground}{even}% |
| 2909 |
{########1}% |
| 2910 |
}% |
| 2911 |
\ForEachLayerOfPageStyle{#1}{% |
| 2912 |
\scrlayer@do@page@style@element@layer{foreground}{even}% |
| 2913 |
{########1}% |
| 2914 |
}% |
| 2915 |
}% |
| 2916 |
}% |
| 2917 |
\endgroup |
| 2918 |
}% |
| 2919 |
}% |
| 2920 |
\@namedef{@ps@#1@layers}{}% |
| 2921 |
\@for \reserved@a:=#3\do {% |
| 2922 |
\scr@trim@spaces\reserved@a |
| 2923 |
\Ifstr\reserved@a\@empty{}{% |
| 2924 |
\expandafter\@cons\csname @ps@#1@layers\endcsname{{\reserved@a}}% |
| 2925 |
}% |
| 2926 |
}% |
| 2927 |
} |
| 2928 |
%</package&body> |
| 2929 |
% \end{macrocode} |
| 2930 |
% \end{macro}^^A \scrlayer@declare@ps@by@layers |
| 2931 |
% |
| 2932 |
% \begin{command}{\ForEachLayerOfPageStyle} |
| 2933 |
% \changes{v3.18}{2015/05/14}{star version of the command} |
| 2934 |
% \changes{v3.20}{2016/04/12}{\cs{@ifstar} durch \cs{kernel@ifstar} |
| 2935 |
% ersetzt} |
| 2936 |
% \begin{description} |
| 2937 |
% \item[\marg{string}:] a valid page style (must be fully expandable |
| 2938 |
% and expand to the name of a existing page style); note, that currently |
| 2939 |
% no exists test will be done. |
| 2940 |
% \item[\marg{code}:] any macro definition body with usage of at most |
| 2941 |
% one argument (\texttt{\#1}), that will be replaced by the layer's name |
| 2942 |
% \end{description} |
| 2943 |
% Do the given \meta{code} for each layer of the page style |
| 2944 |
% \meta{string}. Note, that the expansion of \meta{code} will be done inside |
| 2945 |
% a group. There's also a star version of the command, that delays execution |
| 2946 |
% of \meta{code} after the end of the group. |
| 2947 |
% \begin{macrocode} |
| 2948 |
%<*package&body> |
| 2949 |
\newcommand*{\ForEachLayerOfPageStyle}{% |
| 2950 |
\kernel@ifstar {\@s@ForEachLayerOfPageStyle}{\@ForEachLayerOfPageStyle}% |
| 2951 |
} |
| 2952 |
\newcommand*{\@ForEachLayerOfPageStyle}[2]{% |
| 2953 |
\begingroup |
| 2954 |
\edef\reserved@a{\GetRealPageStyle{#1}}% |
| 2955 |
\def\@elt##1{\ifscrlayer@deactivate@layers\else #2\fi}% |
| 2956 |
\@nameuse{@ps@\reserved@a @layers}% |
| 2957 |
\endgroup |
| 2958 |
} |
| 2959 |
\newcommand*{\@s@ForEachLayerOfPageStyle}[2]{% |
| 2960 |
\begingroup |
| 2961 |
\edef\reserved@a{\GetRealPageStyle{#1}}% |
| 2962 |
\def\reserved@b{\endgroup}% |
| 2963 |
\def\@elt##1{% |
| 2964 |
\l@addto@macro\reserved@b{% |
| 2965 |
\ifscrlayer@deactivate@layers\else #2\fi |
| 2966 |
}% |
| 2967 |
}% |
| 2968 |
\@nameuse{@ps@\reserved@a @layers}% |
| 2969 |
\reserved@b |
| 2970 |
} |
| 2971 |
%</package&body> |
| 2972 |
% \end{macrocode} |
| 2973 |
% \begin{option}{deactivatepagestylelayers} |
| 2974 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 2975 |
% commands removed} |
| 2976 |
% \begin{macro}{\ifscrlayer@deactivate@layers} |
| 2977 |
% \begin{description} |
| 2978 |
% \item[\marg{simple switch}:] whether or not |
| 2979 |
% \cs{ForEachLayerOfPageStyle} should ignore the layers. |
| 2980 |
% \end{description} |
| 2981 |
% This is a global \KOMAScript{} options. Several other definitions and at |
| 2982 |
% least the usage of the page style will ignore the layers if |
| 2983 |
% \cs{ForEachLayerOfPageStyle} ignores them. So this is something like: |
| 2984 |
% hide the layers. It may also be useful inside the code for the hooks |
| 2985 |
% described above, because hooks may used to deactivate the layers with this |
| 2986 |
% option too. |
| 2987 |
% \begin{macrocode} |
| 2988 |
%<*options> |
| 2989 |
%<*package> |
| 2990 |
\KOMA@ifkey{deactivatepagestylelayers}{scrlayer@deactivate@layers} |
| 2991 |
%<package>\scrlayer@@add@inherited@option{deactivatepagestylelayers} |
| 2992 |
%</package> |
| 2993 |
%<*interface> |
| 2994 |
\KOMA@key{deactivatepagestylelayers}[true]{% |
| 2995 |
\KOMA@set@ifkey{deactivatepagestylelayers}{scrlayer@deactivate@layers}{#1}% |
| 2996 |
\KOMA@kav@replacebool{scrlayer.sty}{deactivatepagestylelayers} |
| 2997 |
{scrlayer@deactivate@layers}% |
| 2998 |
} |
| 2999 |
%</interface> |
| 3000 |
%</options> |
| 3001 |
%<*interface&body> |
| 3002 |
\expandafter\let |
| 3003 |
\csname KV@KOMA.\@currname.\@currext @deactivatepagestylelayers\endcsname |
| 3004 |
\relax |
| 3005 |
\expandafter\let |
| 3006 |
\csname KV@KOMA.\@currname.\@currext @deactivatepagestylelayers@default\endcsname |
| 3007 |
\relax |
| 3008 |
%</interface&body> |
| 3009 |
% \end{macrocode} |
| 3010 |
% \end{macro}^^A \ifscrlayer@deactivate@layers |
| 3011 |
% \end{option}^^A deactivatepagestylelayers |
| 3012 |
% \end{command}^^A \ForEachLayerOfPageStyle |
| 3013 |
% |
| 3014 |
% \begin{macro}{\scrlayer@do@page@style@element@layer} |
| 3015 |
% \changes{v3.26}{2018/07/14}{added hooks and artifact code} |
| 3016 |
% Helper macro to show one layer. First argument is either ``background'' or |
| 3017 |
% ``foreground'', second argument is either ``odd'' or ``even'', and third |
| 3018 |
% argument is the name of the layer. Note, that in draft mode for every layer |
| 3019 |
% will be shown also a \cs{layercontentsmeasure}. |
| 3020 |
% \begin{macrocode} |
| 3021 |
%<*package&body> |
| 3022 |
\newcommand*{\scrlayer@do@page@style@element@layer}[3]{% |
| 3023 |
\begingroup |
| 3024 |
\expandafter\ifx\csname if@scr@l@#3@\if@fcolmade\else non\fi floatpage% |
| 3025 |
\expandafter\endcsname\csname iftrue\endcsname |
| 3026 |
\expandafter\ifx\csname if@scr@l@#3@\if@twoside two\else one\fi side% |
| 3027 |
\expandafter\endcsname\csname iftrue\endcsname |
| 3028 |
\expandafter |
| 3029 |
\ifx\csname if@scr@l@#3@#1\expandafter\endcsname |
| 3030 |
\csname iftrue\endcsname |
| 3031 |
\expandafter |
| 3032 |
\ifx\csname if@scr@l@#3@#2\expandafter\endcsname |
| 3033 |
\csname iftrue\endcsname |
| 3034 |
\ifscrlayer@draft |
| 3035 |
\scr@layerbox(\csname scr@l@#3@x\endcsname,% |
| 3036 |
\csname scr@l@#3@y\endcsname)% |
| 3037 |
(\csname scr@l@#3@w\endcsname,% |
| 3038 |
\csname scr@l@#3@h\endcsname)% |
| 3039 |
[\csname scr@l@#3@align\endcsname]% |
| 3040 |
{% |
| 3041 |
\scrlayer@predraftmeasure@hook |
| 3042 |
\scrlayer@beginartifact{}% |
| 3043 |
\layercontentsmeasure |
| 3044 |
\scrlayer@endartifact{}% |
| 3045 |
\scrlayer@postdraftmeasure@hook |
| 3046 |
}% |
| 3047 |
\fi |
| 3048 |
\scr@layerbox(\csname scr@l@#3@x\endcsname,% |
| 3049 |
\csname scr@l@#3@y\endcsname)% |
| 3050 |
(\csname scr@l@#3@w\endcsname,% |
| 3051 |
\csname scr@l@#3@h\endcsname)% |
| 3052 |
[\csname scr@l@#3@align\endcsname]% |
| 3053 |
{\csname layer\csname scr@l@#3@mode\endcsname |
| 3054 |
mode\expandafter\endcsname{% |
| 3055 |
\csname scr@l@#3@precontents@hook\endcsname |
| 3056 |
\scr@ifundefinedorrelax{scr@l@#3@artifact}{}{% |
| 3057 |
\expandafter\expandafter\expandafter |
| 3058 |
\scrlayer@beginartifact |
| 3059 |
\expandafter\expandafter\expandafter{% |
| 3060 |
\csname scr@l@#3@artifact\endcsname |
| 3061 |
}% |
| 3062 |
\csname scr@l@#3@contents\endcsname |
| 3063 |
\expandafter\expandafter\expandafter |
| 3064 |
\scrlayer@endartifact |
| 3065 |
\expandafter\expandafter\expandafter{% |
| 3066 |
\csname scr@l@#3@artifact\endcsname |
| 3067 |
}% |
| 3068 |
}{% |
| 3069 |
\csname scr@l@#3@contents\endcsname |
| 3070 |
}% |
| 3071 |
\csname scr@l@#3@postcontents@hook\endcsname |
| 3072 |
}% |
| 3073 |
}% |
| 3074 |
\fi |
| 3075 |
\fi |
| 3076 |
\fi |
| 3077 |
\fi |
| 3078 |
\endgroup |
| 3079 |
} |
| 3080 |
% \end{macrocode} |
| 3081 |
% \begin{macro}{\scrlayer@predraftmeasure@hook} |
| 3082 |
% \changes{v3.26}{2018/07/14}{added} |
| 3083 |
% The hooks that will be executed before setting the draft measuring. |
| 3084 |
% \begin{macrocode} |
| 3085 |
\newcommand*{\scrlayer@predraftmeasure@hook}{} |
| 3086 |
% \end{macrocode} |
| 3087 |
% \begin{command}{\BeforeDraftMeasuringLayer} |
| 3088 |
% \changes{v3.26}{2018/07/14}{added} |
| 3089 |
% New code will be added in front of the hook. |
| 3090 |
% \begin{macrocode} |
| 3091 |
\newcommand*{\BeforeDraftMeasuringLayer}[1]{% |
| 3092 |
\edef\scrlayer@predraftmeasure@hook{% |
| 3093 |
\unexpanded{#1}\unexpanded\expandafter{\scrlayer@predraftmeasure@hook}% |
| 3094 |
}% |
| 3095 |
} |
| 3096 |
% \end{macrocode} |
| 3097 |
% \end{command}^^A \BeforeDraftMeasuringLayer |
| 3098 |
% \end{macro}^^A \scrlayer@predraftmeasure@hook |
| 3099 |
% \begin{macro}{\scrlayer@postdraftmeasure@hook} |
| 3100 |
% \changes{v3.26}{2018/07/14}{added} |
| 3101 |
% The hook that will be executed after setting the draft measuring. |
| 3102 |
% \begin{macrocode} |
| 3103 |
\newcommand*{\scrlayer@postdraftmeasure@hook}{} |
| 3104 |
% \end{macrocode} |
| 3105 |
% \begin{command}{\AfterDraftMeasuringLayer} |
| 3106 |
% \changes{v3.26}{2018/07/14}{added} |
| 3107 |
% New code will be added at the end of the hook. |
| 3108 |
% \begin{macrocode} |
| 3109 |
\newcommand*{\AfterDraftMeasuringLayer}[1]{% |
| 3110 |
\expandafter\def\expandafter\scrlayer@postdraftmeasure@hook\expandafter{% |
| 3111 |
\scrlayer@postdraftmeasure@hook #1% |
| 3112 |
}% |
| 3113 |
} |
| 3114 |
% \end{macrocode} |
| 3115 |
% \end{command}^^A \AfterDraftMeasuringLayer |
| 3116 |
% \end{macro}^^A \scrlayer@postdraftmeasure@hook |
| 3117 |
% \begin{macro}{\scr@layerbox} |
| 3118 |
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by |
| 3119 |
% \cs{kernel@ifnextchar}} |
| 3120 |
% \begin{macro}{\scr@@layerbox} |
| 3121 |
% \changes{v3.24}{2017/05/08}{\cs{edef} replaced by \cs{protected@edef}} |
| 3122 |
% \changes{v3.24}{2017/05/08}{\cs{dimexpr} added to \cs{layer\dots}} |
| 3123 |
% \changes{v3.24}{2017/05/08}{\cs{dimexpr} removed from usage of |
| 3124 |
% \cs{layer\dots}} |
| 3125 |
% The layer box is used to output a layer in \cs{@oddhead}, \cs{@evenhead}, |
| 3126 |
% \cs{@oddfoot}, or \cs{@evenfoot}. Is has two pairs of arguments: ($x,y$) |
| 3127 |
% and ($w,h$), where $x$ is the distance from left paper edge, $y$ is the |
| 3128 |
% distance from the topmost edge of paper, $w$ is the width of the box and $h$ |
| 3129 |
% is the height of the box. The fifth argument is an optional vertical and |
| 3130 |
% horizontal alignment of the box. It may be a combination of the alignment |
| 3131 |
% characters described above. The sixth and last argument is the contents of |
| 3132 |
% the layer, to be placed into the last argument of the innermost |
| 3133 |
% \cs{parbox}. |
| 3134 |
% \begin{macrocode} |
| 3135 |
\def\scr@layerbox(#1,#2)(#3,#4){% |
| 3136 |
\kernel@ifnextchar [%] |
| 3137 |
{\scr@@layerbox(#1,#2)(#3,#4)}{\scr@@layerbox(#1,#2)(#3,#4)[]}% |
| 3138 |
} |
| 3139 |
\def\scr@@layerbox(#1,#2)(#3,#4)[#5]#6{% |
| 3140 |
\begingroup |
| 3141 |
\protected@edef\layerxoffset{\noexpand\dimexpr #1\relax}% |
| 3142 |
\protected@edef\layeryoffset{\noexpand\dimexpr #2\relax}% |
| 3143 |
\protected@edef\layerwidth{\noexpand\dimexpr #3\relax}% |
| 3144 |
\protected@edef\layerheight{\noexpand\dimexpr #4\relax}% |
| 3145 |
\def\layervalign{t}% |
| 3146 |
\def\layerhalign{l}% |
| 3147 |
\edef\reserved@b{#5}% |
| 3148 |
\expandafter\@tfor\expandafter\reserved@a\expandafter:\expandafter=% |
| 3149 |
\reserved@b\do{% |
| 3150 |
\if t\reserved@a |
| 3151 |
\def\layervalign{t}% |
| 3152 |
\else |
| 3153 |
\if c\reserved@a |
| 3154 |
\def\layervalign{c}% |
| 3155 |
\def\layerhalign{c}% |
| 3156 |
\else |
| 3157 |
\if b\reserved@a |
| 3158 |
\def\layervalign{b}% |
| 3159 |
\else |
| 3160 |
\if l\reserved@a |
| 3161 |
\def\layerhalign{l}% |
| 3162 |
\else |
| 3163 |
\if r\reserved@a |
| 3164 |
\def\layerhalign{r}% |
| 3165 |
\else |
| 3166 |
\PackageWarning{scrlayer}{% |
| 3167 |
Unknown alignment `\reserved@a' ignored}% |
| 3168 |
\fi |
| 3169 |
\fi |
| 3170 |
\fi |
| 3171 |
\fi |
| 3172 |
\fi |
| 3173 |
}% |
| 3174 |
\parbox[t][\z@][t]{\z@}{% |
| 3175 |
\vskip\layeryoffset |
| 3176 |
\if b\layervalign\vskip-\layerheight\fi |
| 3177 |
\if c\layervalign\vskip-.5\layerheight\fi |
| 3178 |
% \end{macrocode} |
| 3179 |
% \changes{3.23a}{2017/04/22}{\textsf{bidi} code added} |
| 3180 |
% \changes{v3.24}{2017/05/04}{usage of \textsf{scrbase}'s \cs{IfRTL}} |
| 3181 |
% If we are in right-to-left mode of package \textsf{bidi} or |
| 3182 |
% \textsf{xepersian} the horizontal output is in the opposite direction. So we |
| 3183 |
% need the \cs{makebox} to the right instead of the left and to move the |
| 3184 |
% contents additionally by its width. |
| 3185 |
% \begin{macrocode} |
| 3186 |
\makebox[\z@][\IfRTL{r}{l}]{% |
| 3187 |
\hskip\layerxoffset |
| 3188 |
\IfRTL{\hskip\layerwidth}{}% |
| 3189 |
\makebox[\z@][\layerhalign]{% |
| 3190 |
\parbox[\layervalign][\layerheight][\layervalign]{\layerwidth}{% |
| 3191 |
\vskip\z@\strut{% |
| 3192 |
\ifscrlayer@forceignoreuppercase |
| 3193 |
\expandafter\let\csname MakeUppercase \endcsname\@firstofone |
| 3194 |
\let\MakeUppercase\@firstofone |
| 3195 |
\let\uppercase\@firstofone |
| 3196 |
\fi |
| 3197 |
#6% |
| 3198 |
}\strut\vskip\z@ |
| 3199 |
}% |
| 3200 |
}% |
| 3201 |
}% |
| 3202 |
}% |
| 3203 |
\endgroup |
| 3204 |
} |
| 3205 |
%</package&body> |
| 3206 |
% \end{macrocode} |
| 3207 |
% \end{macro}^^A \scr@@layerbox |
| 3208 |
% \end{macro}^^A \scr@layerbox |
| 3209 |
% |
| 3210 |
% \begin{command}{\layerrawmode,\layertextmode} |
| 3211 |
% \changes{v3.19}{2015/07/30}{added} |
| 3212 |
% This is the command to output layers in raw mode. This is very simple: |
| 3213 |
% \begin{macrocode} |
| 3214 |
%<*package&body> |
| 3215 |
\newcommand{\layerrawmode}[1]{#1} |
| 3216 |
\newcommand{\layertextmode}[1]{#1} |
| 3217 |
%</package&body> |
| 3218 |
% \end{macrocode} |
| 3219 |
% \end{command}^^A \layerrawmode,\layertextmode |
| 3220 |
% |
| 3221 |
% \begin{command}{\layerpicturemode} |
| 3222 |
% \changes{v3.19}{2015/07/30}{added} |
| 3223 |
% \changes{v3.24}{2017/05/08}{redundant \cs{dimexpr} removed} |
| 3224 |
% This is a bit more complicated. It is the layer output for \texttt{picture} |
| 3225 |
% layers. In this case we use a picture environment and internally define some |
| 3226 |
% additional commands. |
| 3227 |
% \begin{macrocode} |
| 3228 |
%<*package&body> |
| 3229 |
\newcommand{\layerpicturemode}[1]{% |
| 3230 |
\begin{picture}(0,0) |
| 3231 |
(0,\LenToUnit{% |
| 3232 |
\if t\layervalign \dimexpr\layerheight-\ht\strutbox\relax |
| 3233 |
\else |
| 3234 |
\if b\layervalign \dp\strutbox |
| 3235 |
\else .5\dimexpr\layerheight-\ht\strutbox+\dp\strutbox\relax |
| 3236 |
\fi |
| 3237 |
\fi}) |
| 3238 |
\long\def\putLL##1{\put(0,0){##1}}% |
| 3239 |
\long\def\putUL##1{\put(0,\LenToUnit{\layerheight}){##1}}% |
| 3240 |
\long\def\putLR##1{\put(\LenToUnit{\layerwidth},0){##1}}% |
| 3241 |
\long\def\putUR##1{\put(\LenToUnit{\layerwidth},% |
| 3242 |
\LenToUnit{\layerheight}){##1}}% |
| 3243 |
\long\def\putC##1{\put(\LenToUnit{.5\layerwidth},% |
| 3244 |
\LenToUnit{.5\layerheight}){##1}}% |
| 3245 |
#1% |
| 3246 |
\end{picture}% |
| 3247 |
} |
| 3248 |
%</package&body> |
| 3249 |
% \end{macrocode} |
| 3250 |
% \end{command}^^A \layerpicturemode |
| 3251 |
% |
| 3252 |
% \begin{option}{draft} |
| 3253 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 3254 |
% commands removed} |
| 3255 |
% \begin{macro}{\ifscrlayer@draft,\scrlayer@drafttrue,\scrlayer@draftfalse} |
| 3256 |
% \begin{description} |
| 3257 |
% \item[\marg{simple switch}:] whether or not to use the draft mode, |
| 3258 |
% that, i.e., activates visualisation of the layers. |
| 3259 |
% \end{description} |
| 3260 |
% When option is set, every layer is shown twice: one time with it's own |
| 3261 |
% contents and one time with contents \cs{layercontentsmeasure}. |
| 3262 |
% \begin{macrocode} |
| 3263 |
%<*options> |
| 3264 |
%<*package> |
| 3265 |
\KOMA@ifkey{draft}{scrlayer@draft} |
| 3266 |
%<package>\scrlayer@@add@inherited@option{draft} |
| 3267 |
%</package> |
| 3268 |
%<*interface> |
| 3269 |
\KOMA@key{draft}[true]{% |
| 3270 |
\KOMA@set@ifkey{draft}{scrlayer@draft}{#1}% |
| 3271 |
\KOMA@kav@replacebool{scrlayer.sty}{draft}{scrlayer@draft}% |
| 3272 |
} |
| 3273 |
%</interface> |
| 3274 |
%</options> |
| 3275 |
%<*interface&body> |
| 3276 |
\expandafter\let |
| 3277 |
\csname KV@KOMA.\@currname.\@currext @draft\endcsname\relax |
| 3278 |
\expandafter\let |
| 3279 |
\csname KV@KOMA.\@currname.\@currext @draft@default\endcsname\relax |
| 3280 |
%</interface&body> |
| 3281 |
% \end{macrocode} |
| 3282 |
% \end{macro}^^A \ifscrlayer@draft |
| 3283 |
% \end{option}^^A draft |
| 3284 |
% \end{macro}^^A \scrlayer@do@page@style@element@layer |
| 3285 |
% \end{command}^^A \DeclarePageStyleByLayers |
| 3286 |
% |
| 3287 |
% |
| 3288 |
% \begin{command}{\DeclareNewPageStyleByLayers} |
| 3289 |
% Arguments like \cs{DeclarePageStyleByLayers}; results in error if the page |
| 3290 |
% style has been defined (or declared) already. |
| 3291 |
% \begin{command}{\ProvidePageStyleByLayers} |
| 3292 |
% Arguments like \cs{DeclarePageStyleByLayers}; doesn't define anything it |
| 3293 |
% the page style has been defined (or declared) already. |
| 3294 |
% \begin{command}{\RedeclarePageStyleByLayers} |
| 3295 |
% Arguments like \cs{DeclarePageStyleByLayers}; results in error if the page |
| 3296 |
% style hasn't been defined (or declared) already. |
| 3297 |
% \begin{macrocode} |
| 3298 |
%<*package&body> |
| 3299 |
\newcommand*{\DeclareNewPageStyleByLayers}[2][]{% |
| 3300 |
\@ifundefined{ps@#2}{}{% |
| 3301 |
\PackageError{scrlayer}{% |
| 3302 |
Page style `#2' already defined% |
| 3303 |
}{% |
| 3304 |
You may use \string\DeclareNewPageStyleByLayers\space to declare a new |
| 3305 |
page style only\MessageBreak |
| 3306 |
if that page style hasn't been declared or defined before.\MessageBreak |
| 3307 |
You may use either \string\ProvidePageStyleByLayers\space to declare the |
| 3308 |
page style only\MessageBreak |
| 3309 |
if it hasn't been declared or defined before, or |
| 3310 |
\string\RedeclarePageStyleByLayers\MessageBreak |
| 3311 |
to overwrite the former |
| 3312 |
declaration or definition of the page style% |
| 3313 |
\@ifundefined{@ps@#2@layers}{}{,\MessageBreak |
| 3314 |
or \string\AddLayersToPageStyle\space to add further layers to the |
| 3315 |
already declared\MessageBreak |
| 3316 |
page style, or \string\RemoveLayersFromPageStyle\space to remove |
| 3317 |
layers from the\MessageBreak |
| 3318 |
already declared page style}.\MessageBreak |
| 3319 |
Nevertheless, if you'll continue, the page style will be |
| 3320 |
overwritten\MessageBreak |
| 3321 |
by the new declaration.% |
| 3322 |
}% |
| 3323 |
}% |
| 3324 |
\DeclarePageStyleByLayers[{#1}]{#2}% |
| 3325 |
} |
| 3326 |
\newcommand*{\ProvidePageStyleByLayers}[3][]{% |
| 3327 |
\@ifundefined{ps@#2}{% |
| 3328 |
\DeclarePageStyleByLayers[{#1}]{#2}{#3}% |
| 3329 |
}{% |
| 3330 |
%<*trace> |
| 3331 |
\PackageInfo{scrlayer}{% |
| 3332 |
\string\ProvidePageStyleByLayers{#2}{#3} ignored,\MessageBreak |
| 3333 |
because page style `#2'\MessageBreak |
| 3334 |
already exists% |
| 3335 |
}% |
| 3336 |
%</trace> |
| 3337 |
}% |
| 3338 |
} |
| 3339 |
\newcommand*{\RedeclarePageStyleByLayers}[2][]{% |
| 3340 |
\@ifundefined{ps@#2}{% |
| 3341 |
\PackageError{scrlayer}{% |
| 3342 |
Page style `#2' not yet defined% |
| 3343 |
}{% |
| 3344 |
You may use \string\RedeclarePageStyleByLayers\space to declare a page |
| 3345 |
style only\MessageBreak |
| 3346 |
if that page style has already been declared or defined.\MessageBreak |
| 3347 |
You may use either \string\DeclareNewPageStyleByLayers, |
| 3348 |
\string\DeclarePageStyleByLayers,\MessageBreak |
| 3349 |
or \string\ProvidePageStyleByLayers\space to declare that not yet |
| 3350 |
defined page style.\MessageBreak |
| 3351 |
Nevertheless, if you'll continue, the page style will be declared.% |
| 3352 |
}% |
| 3353 |
}{}% |
| 3354 |
\DeclarePageStyleByLayers[{#1}]{#2}% |
| 3355 |
} |
| 3356 |
%</package&body> |
| 3357 |
% \end{macrocode} |
| 3358 |
% \end{command}^^A \RedeclarePageStyleByLayers |
| 3359 |
% \end{command}^^A \ProvidePageStyleByLayers |
| 3360 |
% \end{command}^^A \DeclareNewPageStyleByLayers |
| 3361 |
% |
| 3362 |
% \begin{pgstyle}{@everystyle@,empty} |
| 3363 |
% We also declare page style \pstyle{@everystyle@} by default. You should |
| 3364 |
% not use this page style as an real page style (even not as the empty |
| 3365 |
% one). The layers of this page style will be used by every other layer page |
| 3366 |
% style. An we re-declare \pstyle{empty} to be a layer page style. |
| 3367 |
% \begin{macrocode} |
| 3368 |
%<*package&final> |
| 3369 |
\DeclareNewPageStyleByLayers{@everystyle@}{} |
| 3370 |
\RedeclarePageStyleByLayers{empty}{} |
| 3371 |
%</package&final> |
| 3372 |
% \end{macrocode} |
| 3373 |
% \end{pgstyle} |
| 3374 |
% |
| 3375 |
% \begin{command}{\AddLayersToPageStyle} |
| 3376 |
% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} added} |
| 3377 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 3378 |
% \begin{command}{\AddLayersAtBeginOfPageStyle,\AddLayersAtEndOfPageStyle} |
| 3379 |
% \begin{command}{\RemoveLayersFromPageStyle} |
| 3380 |
% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} added} |
| 3381 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 3382 |
% \begin{description} |
| 3383 |
% \item[\marg{string}:] the name of the page style to be modified (must |
| 3384 |
% be expandable and result in a string). |
| 3385 |
% \item[\marg{string list}:] comma separated list of layer names (must |
| 3386 |
% be expandable and result in strings); first in the list will be added |
| 3387 |
% first. |
| 3388 |
% \end{description} |
| 3389 |
% Change the layer list of a given page style. The differences between the |
| 3390 |
% commands are: |
| 3391 |
% \begin{description} |
| 3392 |
% \item[\cs{AddLayersToPageStyle}:] first in the \meta{string list} will |
| 3393 |
% be added first at the end. |
| 3394 |
% \item[\cs{AddLayersAtBeginOfPageStyle}:] first in the \meta{string list} |
| 3395 |
% will be added first at the start. Note, that this will result in changing |
| 3396 |
% the order of the layers in \meta{string list}. |
| 3397 |
% \item[\cs{AddLayerAtEndOfPageStyle}:] same like |
| 3398 |
% \cs{AddLayerToPageStyle}. |
| 3399 |
% \item[\cs{RemoveLayersFromPageStyle}:] remove the layers from the page |
| 3400 |
% style's layer list. |
| 3401 |
% \end{description} |
| 3402 |
% \begin{macrocode} |
| 3403 |
%<*package&body> |
| 3404 |
\newcommand*{\AddLayersToPageStyle}[2]{% |
| 3405 |
\edef\reserved@b{\GetRealPageStyle{#1}}% |
| 3406 |
\IfLayerPageStyleExists{\reserved@b}{% |
| 3407 |
\@for \reserved@a:=#2\do {% |
| 3408 |
\scr@trim@spaces\reserved@a |
| 3409 |
\Ifstr\reserved@a\@empty{}{% |
| 3410 |
\expandafter\@cons\csname @ps@\reserved@b @layers\endcsname |
| 3411 |
{{\reserved@a}}% |
| 3412 |
}% |
| 3413 |
}% |
| 3414 |
}{% |
| 3415 |
\scrlayer@lpm@error{#1}{adding layers}% |
| 3416 |
}% |
| 3417 |
} |
| 3418 |
\newcommand*{\AddLayersAtEndOfPageStyle}{% |
| 3419 |
\AddLayersToPageStyle |
| 3420 |
} |
| 3421 |
\newcommand*{\AddLayersAtBeginOfPageStyle}[2]{% |
| 3422 |
\begingroup |
| 3423 |
\let\@cons\@snoc |
| 3424 |
\AddLayersToPageStyle{#1}{#2}% |
| 3425 |
\endgroup |
| 3426 |
} |
| 3427 |
% \end{macrocode} |
| 3428 |
% \begin{macro}{\@snoc} |
| 3429 |
% \cs{@snoc} is a helper macro similar to \cs{@cons} from \LaTeX{} kernel, but |
| 3430 |
% it appends at the front instead of the end. |
| 3431 |
% \begin{macrocode} |
| 3432 |
\newcommand*{\@snoc}[2]{% |
| 3433 |
\begingroup\let\@elt\relax\xdef#1{\@elt #2#1}\endgroup |
| 3434 |
} |
| 3435 |
% \end{macrocode} |
| 3436 |
% \end{macro}^^A \@snoc |
| 3437 |
% \begin{macrocode} |
| 3438 |
\newcommand*{\RemoveLayersFromPageStyle}[2]{% |
| 3439 |
\edef\reserved@b{\GetRealPageStyle{#1}}% |
| 3440 |
\IfLayerPageStyleExists{#1}{% |
| 3441 |
\@for \reserved@a:=#2\do {% |
| 3442 |
\scr@trim@spaces\reserved@a |
| 3443 |
\Ifstr\reserved@a\@empty{}{% |
| 3444 |
\expandafter\remove@layer@from@page@style\expandafter{\reserved@a}% |
| 3445 |
{\reserved@b}% |
| 3446 |
}% |
| 3447 |
}% |
| 3448 |
}{% |
| 3449 |
\scrlayer@lpm@error{#1}{removing layers}% |
| 3450 |
}% |
| 3451 |
} |
| 3452 |
% \end{macrocode} |
| 3453 |
% \begin{macro}{\remove@layer@from@page@style} |
| 3454 |
% \changes{v0.9}{2014/07/25}{cleaning of layer list must be global} |
| 3455 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 3456 |
% Helper macro to remove exactly one layer (arg 1) from a page style (arg 2). |
| 3457 |
% \begin{macrocode} |
| 3458 |
\newcommand*{\remove@layer@from@page@style}[2]{% |
| 3459 |
\begingroup |
| 3460 |
\expandafter\let\expandafter\reserved@a\csname @ps@#2@layers\endcsname |
| 3461 |
\expandafter\global\expandafter\let\csname @ps@#2@layers\endcsname\@empty |
| 3462 |
\def\@elt##1{% |
| 3463 |
\Ifstr{#1}{##1}{}{% |
| 3464 |
\expandafter\@cons\csname @ps@#2@layers\endcsname{{##1}}% |
| 3465 |
}% |
| 3466 |
}\reserved@a |
| 3467 |
\endgroup |
| 3468 |
} |
| 3469 |
% \end{macrocode} |
| 3470 |
% \end{macro}^^A \remoce@layer@from@page@style |
| 3471 |
% \begin{macro}{\scrlayer@lpm@error} |
| 3472 |
% \begin{description} |
| 3473 |
% \item[\marg{string}:] the name of the page style to be modified (must |
| 3474 |
% be expandable and result in a string). |
| 3475 |
% \item[\marg{string}:] the kind of modification, that isn't allowed |
| 3476 |
% (must be expandable and result in a string). |
| 3477 |
% \end{description} |
| 3478 |
% Show an error because of page style it either not a defined or not a layer |
| 3479 |
% page style. |
| 3480 |
% \begin{macrocode} |
| 3481 |
\newcommand*{\scrlayer@lpm@error}[2]{% |
| 3482 |
\PackageError{scrlayer}{`#1' is not a layer page style}{% |
| 3483 |
\scr@ifundefinedorrelax{ps@#1}{% |
| 3484 |
Page style `#1' is not defined, |
| 3485 |
}{% |
| 3486 |
Page style `#1' is not a layer page style, |
| 3487 |
}% |
| 3488 |
but #2\MessageBreak |
| 3489 |
may be used only for layer page styles declared using\MessageBreak |
| 3490 |
\string\DeclarePageStyleByLayers, |
| 3491 |
\string\DeclareNewPageStyleByLayers,\MessageBreak |
| 3492 |
of \string\ProvidePageStyleByLayers.\MessageBreak |
| 3493 |
If you'll continue, your operation will be ignored.% |
| 3494 |
}% |
| 3495 |
} |
| 3496 |
%</package&body> |
| 3497 |
% \end{macrocode} |
| 3498 |
% \end{macro}^^A \scrlayer@lpm@error |
| 3499 |
% \end{command}^^A \RemoveLayersFromPageStyle |
| 3500 |
% \end{command}^^A \AddLayersAtBeginOfPageStyle,\AddLayersAtEndOfPageStyle |
| 3501 |
% \end{command}^^A \AddLayersToPageStyle |
| 3502 |
% |
| 3503 |
% \begin{command}{\AddLayersToPageStyleBeforeLayer, |
| 3504 |
% \AddLayersToPageStyleAfterLayer} |
| 3505 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 3506 |
% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} added} |
| 3507 |
% \begin{description} |
| 3508 |
% \item[\marg{string}:] the name of the page style to be modified (must |
| 3509 |
% be expandable and result in a string). |
| 3510 |
% \item[\marg{string list}:] comma separated list of layer names (must |
| 3511 |
% be expandable and result in strings); first in the list will be added |
| 3512 |
% first. |
| 3513 |
% \item[\marg{string}:] the name of the layer before |
| 3514 |
% (\cs{AddLayersToPageStyleBeforeLayer}) or after |
| 3515 |
% (\cs{AddLayersToPageStyleAfterLayer}) that the layers of the list |
| 3516 |
% should be added. |
| 3517 |
% \end{description} |
| 3518 |
% Note: If the layer from third argument is not part of the page style's layer |
| 3519 |
% list, the new layers won't be added anywhere. |
| 3520 |
% \begin{macrocode} |
| 3521 |
%<*package&body> |
| 3522 |
\newcommand*{\AddLayersToPageStyleAfterLayer}[3]{% |
| 3523 |
\edef\reserved@b{\GetRealPageStyle{#1}}% |
| 3524 |
\IfLayerPageStyleExists{\reserved@b}{% |
| 3525 |
\begingroup |
| 3526 |
\expandafter\let\expandafter\reserved@a |
| 3527 |
\csname @ps@\reserved@b @layers\endcsname |
| 3528 |
\@namedef{@ps@\reserved@b @layers}{}% |
| 3529 |
\def\@elt##1{% |
| 3530 |
\Ifstr{##1}\@empty{}{% |
| 3531 |
\expandafter\@cons\csname @ps@\reserved@b @layers\endcsname{{##1}}% |
| 3532 |
\Ifstr{##1}{#3}{% |
| 3533 |
\@for \reserved@a:=#2\do {% |
| 3534 |
\scr@trim@spaces\reserved@a |
| 3535 |
\Ifstr\reserved@a\@empty{}{% |
| 3536 |
\expandafter\@cons\csname @ps@\reserved@b @layers\endcsname |
| 3537 |
{{\reserved@a}}% |
| 3538 |
}% |
| 3539 |
}% |
| 3540 |
}{}% |
| 3541 |
}% |
| 3542 |
}% |
| 3543 |
\reserved@a |
| 3544 |
\endgroup |
| 3545 |
}{% |
| 3546 |
\scrlayer@lpm@error{#1}{adding layers}% |
| 3547 |
}% |
| 3548 |
} |
| 3549 |
\newcommand*{\AddLayersToPageStyleBeforeLayer}[3]{% |
| 3550 |
\edef\reserved@b{\GetRealPageStyle{#1}}% |
| 3551 |
\IfLayerPageStyleExists{\reserved@b}{% |
| 3552 |
\begingroup |
| 3553 |
\expandafter\let\expandafter\reserved@a |
| 3554 |
\csname @ps@\reserved@b @layers\endcsname |
| 3555 |
\@namedef{@ps@\reserved@b @layers}{}% |
| 3556 |
\def\@elt##1{% |
| 3557 |
\Ifstr{##1}\@empty{}{% |
| 3558 |
\Ifstr{##1}{#3}{% |
| 3559 |
\@for \reserved@a:=#2\do {% |
| 3560 |
\scr@trim@spaces\reserved@a |
| 3561 |
\Ifstr\reserved@a\@empty{}{% |
| 3562 |
\expandafter\@cons\csname @ps@\reserved@b @layers\endcsname |
| 3563 |
{{\reserved@a}}% |
| 3564 |
}% |
| 3565 |
}% |
| 3566 |
}{}% |
| 3567 |
\expandafter\@cons\csname @ps@#1@layers\endcsname{{##1}}% |
| 3568 |
}% |
| 3569 |
}% |
| 3570 |
\reserved@a |
| 3571 |
\endgroup |
| 3572 |
}{% |
| 3573 |
\scrlayer@lpm@error{#1}{adding layers}% |
| 3574 |
}% |
| 3575 |
} |
| 3576 |
%</package&body> |
| 3577 |
% \end{macrocode} |
| 3578 |
% \end{command}^^A \AddLayersToPageStyleBeforeLayer, |
| 3579 |
% ^^A \AddLayersToPageStyleAfterLayer |
| 3580 |
% |
| 3581 |
% |
| 3582 |
% \begin{command}{\UnifyLayersAtPageStyle} |
| 3583 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 3584 |
% \begin{description} |
| 3585 |
% \item[\marg{string}:] the name of the page style to be unified (must |
| 3586 |
% be expandable and result in a string). |
| 3587 |
% \end{description} |
| 3588 |
% Remove doublets of layers from a page style. |
| 3589 |
% \begin{macrocode} |
| 3590 |
%<*package&body> |
| 3591 |
\newcommand*{\UnifyLayersAtPageStyle}[1]{% |
| 3592 |
\edef\reserved@b{\GetRealPageStyle{#1}}% |
| 3593 |
\IfLayerPageStyleExists{\reserved@b}{% |
| 3594 |
\expandafter\let\expandafter\reserved@a |
| 3595 |
\csname @ps@\reserved@b @layers\endcsname |
| 3596 |
\@namedef{@ps@\reserved@b @layers}{}% |
| 3597 |
\begingroup |
| 3598 |
\def\@elt##1{% |
| 3599 |
\Ifstr{##1}\@empty{}{% |
| 3600 |
\remove@layer@from@page@style{##1}{\reserved@b}% |
| 3601 |
\expandafter\@cons\csname @ps@\reserved@b @layers\endcsname{{##1}}% |
| 3602 |
}% |
| 3603 |
}% |
| 3604 |
\reserved@a |
| 3605 |
\endgroup |
| 3606 |
}{% |
| 3607 |
\scrlayer@lpm@error{#1}{unifying}% |
| 3608 |
}% |
| 3609 |
} |
| 3610 |
%</package&body> |
| 3611 |
% \end{macrocode} |
| 3612 |
% \end{command}^^A \UnifyLayersAtPageStyle |
| 3613 |
% |
| 3614 |
% \begin{command}{\ModifyLayerPageStyleOptions,\AddToLayerPageStyleOptions} |
| 3615 |
% \begin{description} |
| 3616 |
% \item[\marg{string}:] the name of the page style to be modified (must |
| 3617 |
% be expandable and result in a string). |
| 3618 |
% \item[\marg{option list}:] comma separated list of named page |
| 3619 |
% style options. You may use any of the options provided for |
| 3620 |
% \cs{DeclarePageStyle}. |
| 3621 |
% \end{description} |
| 3622 |
% \cs{ModifyLayerPageStyleOptions} replaces the options and only the |
| 3623 |
% options from the list by their new |
| 3624 |
% values. \cs{AddToLayerPageStyleOptions} adds the new values to the |
| 3625 |
% already given. |
| 3626 |
% \begin{macrocode} |
| 3627 |
%<*package&body> |
| 3628 |
\newcommand*{\ModifyLayerPageStyleOptions}[2]{% |
| 3629 |
\edef\reserved@a{\GetRealPageStyle{#1}}% |
| 3630 |
\IfLayerPageStyleExists{#1}{% |
| 3631 |
\expandafter\scrlayer@modify@layer@ps@options\expandafter{% |
| 3632 |
\reserved@a |
| 3633 |
}{#2}% |
| 3634 |
}{% |
| 3635 |
\scrlayer@lpm@error{#1}{modifying}% |
| 3636 |
}% |
| 3637 |
} |
| 3638 |
% \end{macrocode} |
| 3639 |
% \begin{macro}{\scrlayer@modify@layer@ps@options} |
| 3640 |
% \changes{v3.28}{2019/11/28}{usage of marker makros} |
| 3641 |
% Helper needed because of alias page styles. Same parameters like |
| 3642 |
% \cs{ModifyLayerPageStyleOptions} |
| 3643 |
% \begin{macrocode} |
| 3644 |
\newcommand*{\scrlayer@modify@layer@ps@options}[2]{% |
| 3645 |
\begingroup |
| 3646 |
\def\scrlayer@current@pagestyle{#1}% |
| 3647 |
\@namedef{@ps@#1@initialhook}{}% |
| 3648 |
\@namedef{@ps@#1@hook}{}% |
| 3649 |
\@namedef{@ps@#1@backgroundhook}{}% |
| 3650 |
\@namedef{@ps@#1@foregroundhook}{}% |
| 3651 |
\@namedef{@ps@#1@oddpagehook}{}% |
| 3652 |
\@namedef{@ps@#1@evenpagehook}{}% |
| 3653 |
\@namedef{@ps@#1@onesidehook}{}% |
| 3654 |
\@namedef{@ps@#1@twosidehook}{}% |
| 3655 |
\@namedef{@ps@#1@floatpagehook}{}% |
| 3656 |
\@namedef{@ps@#1@nonfloatpagehook}{}% |
| 3657 |
\let\scr@opt@marker@initialhook\@empty |
| 3658 |
\let\scr@opt@marker@hook\@empty |
| 3659 |
\let\scr@opt@marker@backgroundhook\@empty |
| 3660 |
\let\scr@opt@marker@foregroundhook\@empty |
| 3661 |
\let\scr@opt@marker@oddpagehook\@empty |
| 3662 |
\let\scr@opt@marker@evenpagehook\@empty |
| 3663 |
\let\scr@opt@marker@onesidehook\@empty |
| 3664 |
\let\scr@opt@marker@twosidehook\@empty |
| 3665 |
\let\scr@opt@marker@floatpagehook\@empty |
| 3666 |
\let\scr@opt@marker@nonfloatpagehook\@empty |
| 3667 |
\FamilyExecuteOptions[.definelayerpagestyle]{KOMAarg}{#2}% |
| 3668 |
\def\reserved@a{\endgroup}% |
| 3669 |
\def\@sls@##1{% |
| 3670 |
\expandafter\ifx \csname scr@opt@marker@##1hook\endcsname\@empty\else |
| 3671 |
\expandafter\let\expandafter\reserved@b\csname @ps@#1@##1hook\endcsname |
| 3672 |
\l@addto@macro\reserved@a{\@namedef{@ps@#1@##1hook}}% |
| 3673 |
\expandafter\l@addto@macro\expandafter\reserved@a\expandafter{% |
| 3674 |
\expandafter{% |
| 3675 |
\reserved@b |
| 3676 |
}% |
| 3677 |
}% |
| 3678 |
\fi |
| 3679 |
}% |
| 3680 |
\@sls@{initial}% |
| 3681 |
\@sls@{}% |
| 3682 |
\@sls@{background}% |
| 3683 |
\@sls@{foreground}% |
| 3684 |
\@sls@{oddpage}% |
| 3685 |
\@sls@{evenpage}% |
| 3686 |
\@sls@{oneside}% |
| 3687 |
\@sls@{twoside}% |
| 3688 |
\@sls@{floatpage}% |
| 3689 |
\@sls@{nonfloatpage}% |
| 3690 |
\reserved@a |
| 3691 |
} |
| 3692 |
% \end{macrocode} |
| 3693 |
% \end{macro}^^A \scrlayer@modify@layer@ps@options |
| 3694 |
% \begin{macrocode} |
| 3695 |
\newcommand*{\AddToLayerPageStyleOptions}[2]{% |
| 3696 |
\IfLayerPageStyleExists{#1}{% |
| 3697 |
\def\scrlayer@current@pagestyle{#1}% |
| 3698 |
\FamilyExecuteOptions[.definelayerpagestyle]{KOMAarg}{#2}% |
| 3699 |
}{% |
| 3700 |
\scrlayer@lpm@error{#1}{modifying}% |
| 3701 |
}% |
| 3702 |
} |
| 3703 |
%</package&body> |
| 3704 |
% \end{macrocode} |
| 3705 |
% \end{command}^^A \ModifyLayerPageStyleOptions,\AddToLayerPageStyleOptions |
| 3706 |
% |
| 3707 |
% |
| 3708 |
% \begin{macro}{\scrlayer@beginartifact,\scrlayer@endartifact} |
| 3709 |
% \changes{v3.26}{2018/07/14}{new (semi internal)} |
| 3710 |
% These macros are reserved for tagging packages. The first one is executed |
| 3711 |
% after the initial contents hook, the last one is executed after the final |
| 3712 |
% contents hook. Both executions are done only, if the \texttt{artifact} |
| 3713 |
% option of the layer has been used an was not boolean false. With boolean |
| 3714 |
% true the argument will be empty. All other values will be passed as |
| 3715 |
% argument. |
| 3716 |
% |
| 3717 |
% In case of package \textsf{tagpdf} the following definition would be |
| 3718 |
% usefull (here automatically done after loading the package, if the package |
| 3719 |
% does not do its own definitions): |
| 3720 |
% \begin{macrocode} |
| 3721 |
%<*package&body> |
| 3722 |
\RequirePackage{scrlfile} |
| 3723 |
\BeforePackage{tagpdf}{% |
| 3724 |
% \end{macrocode} |
| 3725 |
% Deactivation of the two commands before loading \textsf{tagpdf}, so that |
| 3726 |
% after loading the package \cs{providecommand} can be used to do a new |
| 3727 |
% default definition. |
| 3728 |
% \begin{macrocode} |
| 3729 |
\let\scrlayer@beginartifact\relax |
| 3730 |
\let\scrlayer@endartifact\relax |
| 3731 |
} |
| 3732 |
\AfterPackage*{tagpdf}{% |
| 3733 |
\providecommand*{\scrlayer@beginartifact}[1]{% |
| 3734 |
\Ifstr{#1}{}{% |
| 3735 |
\tagmcbegin{artifact}% |
| 3736 |
}{% |
| 3737 |
\tagmcbegin{artifact=#1}% |
| 3738 |
}% |
| 3739 |
}% |
| 3740 |
\providecommand*{\scrlayer@endartifact}[1]{% |
| 3741 |
\tagmcend |
| 3742 |
}% |
| 3743 |
} |
| 3744 |
% \end{macrocode} |
| 3745 |
% But the default definition (if \textsf{tagpdf} has not already been loaded) |
| 3746 |
% are simple dummies: |
| 3747 |
% \begin{macrocode} |
| 3748 |
\providecommand*{\scrlayer@beginartifact}[1]{} |
| 3749 |
\providecommand*{\scrlayer@endartifact}[1]{} |
| 3750 |
%</package&body> |
| 3751 |
% \end{macrocode} |
| 3752 |
% \end{macro}^^A \scrlayer@beginartifact,\scrlayer@endartifact |
| 3753 |
% |
| 3754 |
% \begin{command}{\DeclarePageStyleAlias,\DeclareNewPageStyleAlias, |
| 3755 |
% \ProvidePageStyleAlias,\RedeclarePageStyleAlias} |
| 3756 |
% \begin{description} |
| 3757 |
% \item[\marg{string}:] The name of the page style to be declared |
| 3758 |
% (must be expandable and result in a string). |
| 3759 |
% \item[\marg{string}:] The name of the existing page style |
| 3760 |
% (must be expandable and result in a string). |
| 3761 |
% \end{description} |
| 3762 |
% \begin{macrocode} |
| 3763 |
%<*package&body> |
| 3764 |
\newcommand*{\DeclarePageStyleAlias}[2]{% |
| 3765 |
\edef\reserved@a{\GetRealPageStyle{#2}}% |
| 3766 |
\scr@ifundefinedorrelax{ps@\reserved@a}{% |
| 3767 |
\PackageError{scrlayer}{unknown real page style `#2'}{% |
| 3768 |
You've tried to declare an alias for page style `#2',\MessageBreak |
| 3769 |
but the real page style of `#2' is undefined.\MessageBreak |
| 3770 |
You can define aliases, only if the real page style has been |
| 3771 |
defined.\MessageBreak |
| 3772 |
If you'll continue, the declaration will be ignored.% |
| 3773 |
}% |
| 3774 |
\DestroyRealLayerPageStyle{#1}% |
| 3775 |
\DestroyLayerAlias{#1}% |
| 3776 |
}{% |
| 3777 |
\@namedef{@ps@#1@alias}{#2}% |
| 3778 |
\@namedef{ps@#1}{\pagestyle{\@nameuse{@ps@#1@alias}}}% |
| 3779 |
}% |
| 3780 |
} |
| 3781 |
\newcommand*{\DeclareNewPageStyleAlias}[1]{% |
| 3782 |
\@ifundefined{ps@#1}{}{% |
| 3783 |
\PackageError{scrlayer}{% |
| 3784 |
Page style `#1' already defined% |
| 3785 |
}{% |
| 3786 |
You may use \string\DeclareNewPageStyleAlias\space to declare a new |
| 3787 |
page style only\MessageBreak |
| 3788 |
if that page style hasn't been declared or defined before.\MessageBreak |
| 3789 |
You may use either \string\ProvidePageStyleAlias\space to declare the |
| 3790 |
page style only\MessageBreak |
| 3791 |
if it hasn't been declared or defined before, or |
| 3792 |
\string\RedeclarePageStyleAlias\MessageBreak |
| 3793 |
to overwrite the former declaration or definition of the page |
| 3794 |
style\MessageBreak |
| 3795 |
Nevertheless, if you'll continue, the page style will be |
| 3796 |
overwritten\MessageBreak |
| 3797 |
by the new alias.% |
| 3798 |
}% |
| 3799 |
}% |
| 3800 |
\DeclarePageStyleAlias{#1}% |
| 3801 |
} |
| 3802 |
\newcommand*{\ProvidePageStyleAlias}[2]{% |
| 3803 |
\@ifundefined{ps@#1}{% |
| 3804 |
\DeclarePageStyleAlias{#1}{#2}% |
| 3805 |
}{% |
| 3806 |
%<*trace> |
| 3807 |
\PackageInfo{scrlayer}{% |
| 3808 |
\string\ProvidePageStyleAlias{#1}{#2} ignored,\MessageBreak |
| 3809 |
because page style `#1' already\MessageBreak |
| 3810 |
exists% |
| 3811 |
}% |
| 3812 |
%</trace> |
| 3813 |
}% |
| 3814 |
} |
| 3815 |
\newcommand*{\RedeclarePageStyleAlias}[1]{% |
| 3816 |
\@ifundefined{ps@#1}{% |
| 3817 |
\PackageError{scrlayer}{% |
| 3818 |
Page style `#1' not yet defined% |
| 3819 |
}{% |
| 3820 |
You may use \string\RedeclarePageStyleAlias\space to declare a page |
| 3821 |
style only\MessageBreak |
| 3822 |
if that page style has already been declared or defined.\MessageBreak |
| 3823 |
You may use either \string\DeclareNewPageStyleAlias, |
| 3824 |
\string\DeclarePageStyleAlias,\MessageBreak |
| 3825 |
or \string\ProvidePageStyleAlias\space to declare that not yet |
| 3826 |
defined page style.\MessageBreak |
| 3827 |
Nevertheless, if you'll continue, the page style will be declared.% |
| 3828 |
}% |
| 3829 |
}{}% |
| 3830 |
\DeclarePageStyleAlias{#1}% |
| 3831 |
} |
| 3832 |
% \end{macrocode} |
| 3833 |
% \end{command}^^A \DeclarePageStyleAlias … |
| 3834 |
% |
| 3835 |
% \begin{command}{\DestroyPageStyleAlias} |
| 3836 |
% \begin{description} |
| 3837 |
% \item[\marg{string}:] the name of a page style (must be |
| 3838 |
% expandable and result in a string). |
| 3839 |
% \end{description} |
| 3840 |
% \begin{macrocode} |
| 3841 |
\newcommand*{\DestroyPageStyleAlias}[1]{% |
| 3842 |
\scr@ifundefinedorrelax{@ps@#1@alias}{}{% |
| 3843 |
\expandafter\let\csname @ps@#1@alias\endcsname\relax |
| 3844 |
\expandafter\let\csname ps@#1\endcsname\relax |
| 3845 |
}% |
| 3846 |
} |
| 3847 |
% \end{macrocode} |
| 3848 |
% \end{command} |
| 3849 |
% |
| 3850 |
% \begin{command}{\GetRealPageStyle} |
| 3851 |
% \begin{description} |
| 3852 |
% \item[\marg{string}:] the name of a page style (must be |
| 3853 |
% expandable and result in a string). |
| 3854 |
% \end{description} |
| 3855 |
% Get the real name of the page style. |
| 3856 |
% \begin{macrocode} |
| 3857 |
\newcommand*{\GetRealPageStyle}[1]{% |
| 3858 |
\scr@ifundefinedorrelax{@ps@#1@alias}{#1}{% |
| 3859 |
\expandafter\GetRealPageStyle\expandafter{% |
| 3860 |
\expandafter\csname @ps@#1@alias\expandafter\endcsname\expandafter}% |
| 3861 |
}% |
| 3862 |
} |
| 3863 |
%</package&body> |
| 3864 |
% \end{macrocode} |
| 3865 |
% \end{command} |
| 3866 |
% |
| 3867 |
% \begin{command}{\IfLayerPageStyleExists,\IfRealLayerPageStyleExists} |
| 3868 |
% \begin{description} |
| 3869 |
% \item[\marg{string}:] the name of the page style to be tested (must |
| 3870 |
% be expandable and result in a string). |
| 3871 |
% \item[\marg{code}:] whatever code should be expanded, if the test |
| 3872 |
% result is true. |
| 3873 |
% \item[\marg{code}:] whatever code should be expanded, if the test |
| 3874 |
% result is false. |
| 3875 |
% \end{description} |
| 3876 |
% Test, whether or not the page style is a declared layer page style. |
| 3877 |
% \begin{macrocode} |
| 3878 |
%<*package&body> |
| 3879 |
\newcommand*{\IfLayerPageStyleExists}[1]{% |
| 3880 |
\scr@ifundefinedorrelax{ps@#1}{% |
| 3881 |
\expandafter\@secondoftwo |
| 3882 |
}{% |
| 3883 |
\scr@ifundefinedorrelax{@ps@#1@layers}{% |
| 3884 |
\scr@ifundefinedorrelax{@ps@#1@alias}{% |
| 3885 |
\expandafter\@secondoftwo |
| 3886 |
}{% |
| 3887 |
\expandafter\IfLayerPageStyleExists\expandafter{% |
| 3888 |
\expandafter\csname @ps@#1@alias\expandafter\endcsname\expandafter}% |
| 3889 |
}% |
| 3890 |
}{% |
| 3891 |
\expandafter\@firstoftwo |
| 3892 |
}% |
| 3893 |
}% |
| 3894 |
} |
| 3895 |
\newcommand*{\IfRealLayerPageStyleExists}[1]{% |
| 3896 |
\scr@ifundefinedorrelax{ps@#1}{% |
| 3897 |
\expandafter\@secondoftwo |
| 3898 |
}{% |
| 3899 |
\scr@ifundefinedorrelax{@ps@#1@layers}{% |
| 3900 |
\expandafter\@secondoftwo |
| 3901 |
}{% |
| 3902 |
\expandafter\@firstoftwo |
| 3903 |
}% |
| 3904 |
}% |
| 3905 |
} |
| 3906 |
%</package&body> |
| 3907 |
% \end{macrocode} |
| 3908 |
% \end{command}^^A \IfLayerPageStyleExists,\IfRealLayerPageStyleExists |
| 3909 |
% |
| 3910 |
% \begin{command}{\IfLayerAtPageStyle,\IfSomeLayersAtPageStyle} |
| 3911 |
% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} added} |
| 3912 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 3913 |
% \begin{command}{\IfLayersAtPageStyle} |
| 3914 |
% \begin{description} |
| 3915 |
% \item[\marg{string}:] the name of the page style to be tested (must |
| 3916 |
% be expandable and result in a string). |
| 3917 |
% \item[\marg{string}:] the name(s) of the layer(s) to be tested (must be |
| 3918 |
% expandable and result in a string). |
| 3919 |
% \item[\marg{code}:] whatever code should be expanded, if the test |
| 3920 |
% result is true. |
| 3921 |
% \item[\marg{code}:] whatever code should be expanded, if the test |
| 3922 |
% result is false. |
| 3923 |
% \end{description} |
| 3924 |
% Tests: |
| 3925 |
% \begin{description} |
| 3926 |
% \item[\cs{IfLayerAtPageStyle}:] Test, whether or not the page style has a |
| 3927 |
% layer. The second argument is the name of one layer only! |
| 3928 |
% \item[\cs{IfSomeLayersAtPageStyle}:] Test, whether or not the page style |
| 3929 |
% has at least one layer of a list of layers. The second argument is a comma |
| 3930 |
% separated list of layer names. |
| 3931 |
% \item[\cs{IfLayersAtPageStyle}:] Test, whether or not the page style has |
| 3932 |
% every layer of a list of layers. The second argument is a comma separated |
| 3933 |
% list of layer names. |
| 3934 |
% \end{description} |
| 3935 |
% Note, that testing an page style, that is not a layer page style will result |
| 3936 |
% in an error and neither the third nor the fourth argument will be expanded. |
| 3937 |
% Note, that layers with empty name are only part of a layer page style |
| 3938 |
% without any layers. |
| 3939 |
% |
| 3940 |
% Note also, that with active \opt{deactivatepagestylelayers} layers are |
| 3941 |
% logically not longer part of the page styles. |
| 3942 |
% \begin{macrocode} |
| 3943 |
%<*package&body> |
| 3944 |
\newcommand*{\IfLayerAtPageStyle}[2]{% |
| 3945 |
\IfLayerPageStyleExists{#1}{% |
| 3946 |
\begingroup |
| 3947 |
\edef\reserved@a{\GetRealPageStyle{#1}}% |
| 3948 |
\@tempswafalse |
| 3949 |
\Ifstr{#2}{}{% |
| 3950 |
\expandafter\ifx\csname @ps@\reserved@a @layers\endcsname\@empty |
| 3951 |
\@tempswatrue |
| 3952 |
\fi |
| 3953 |
}{% |
| 3954 |
\expandafter\ForEachLayerOfPageStyle\expandafter{% |
| 3955 |
\reserved@a}{\Ifstr{##1}{#2}{\aftergroup\@tempswatrue}{}}% |
| 3956 |
}% |
| 3957 |
\if@tempswa \aftergroup\@firstoftwo \else \aftergroup\@secondoftwo \fi |
| 3958 |
\expandafter\endgroup |
| 3959 |
}{% |
| 3960 |
\scrlayer@lpm@error{#1}{testing for layers}% |
| 3961 |
\expandafter\@gobbletwo |
| 3962 |
}% |
| 3963 |
} |
| 3964 |
\newcommand*{\IfSomeLayersAtPageStyle}[2]{% |
| 3965 |
\IfLayerPageStyleExists{#1}{% |
| 3966 |
\begingroup |
| 3967 |
\@tempswafalse |
| 3968 |
\@for \reserved@a:=#2\do {% |
| 3969 |
\scr@trim@spaces\reserved@a |
| 3970 |
\edef\reserved@a{\noexpand\IfLayerAtPageStyle{#1}{\reserved@a}}% |
| 3971 |
\reserved@a{\@tempswatrue}{}% |
| 3972 |
}% |
| 3973 |
\if@tempswa \aftergroup\@firstoftwo \else \aftergroup\@secondoftwo \fi |
| 3974 |
\expandafter\endgroup |
| 3975 |
}{% |
| 3976 |
\scrlayer@lpm@error{#1}{testing for layers}% |
| 3977 |
\expandafter\@gobbletwo |
| 3978 |
}% |
| 3979 |
} |
| 3980 |
\newcommand*{\IfLayersAtPageStyle}[2]{% |
| 3981 |
\IfLayerPageStyleExists{#1}{% |
| 3982 |
\begingroup |
| 3983 |
\@tempswatrue |
| 3984 |
\Ifstr{#2}{}{% |
| 3985 |
\edef\reserved@a{\GetRealPageStyle{#1}}% |
| 3986 |
\expandafter\ifx\csname @scr@\reserved@a @layers\endcsname\@empty \else |
| 3987 |
\@tempswafalse |
| 3988 |
\fi |
| 3989 |
}{% |
| 3990 |
\@for \reserved@a:=#2\do {% |
| 3991 |
\scr@trim@spaces\reserved@a |
| 3992 |
\edef\reserved@a{\noexpand\IfLayerAtPageStyle{#1}{\reserved@a}}% |
| 3993 |
\reserved@a{}{\@tempswafalse}% |
| 3994 |
}% |
| 3995 |
}% |
| 3996 |
\if@tempswa \aftergroup\@firstoftwo \else \aftergroup\@secondoftwo \fi |
| 3997 |
\expandafter\endgroup |
| 3998 |
}{% |
| 3999 |
\scrlayer@lpm@error{#1}{testing for layers}% |
| 4000 |
\expandafter\@gobbletwo |
| 4001 |
}% |
| 4002 |
} |
| 4003 |
%</package&body> |
| 4004 |
% \end{macrocode} |
| 4005 |
% \end{command}^^A \IfLayersAtPageStyle |
| 4006 |
% \end{command}^^A \IfLayerAtPageStyle,\IfSomeLayersAtPageStyle |
| 4007 |
% |
| 4008 |
% |
| 4009 |
% \begin{command}{\DestroyRealLayerPageStyle} |
| 4010 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 4011 |
% \begin{description} |
| 4012 |
% \item[\marg{string}:] name of the layer page style to be destroyed. |
| 4013 |
% \end{description} |
| 4014 |
% Destroys the given layer page style but not the layers! If the page style is |
| 4015 |
% the current page style, the empty page style an empty page style will be |
| 4016 |
% activated. If the special page style is valid an the destroyed one, this |
| 4017 |
% will be removed. This command could be used, e.g., at |
| 4018 |
% \cs{scrlayerOnAutoRemoveInterface} after destroying the layers. However, |
| 4019 |
% the interface commands are deprecated. |
| 4020 |
% \begin{macrocode} |
| 4021 |
%<*package&body> |
| 4022 |
\newcommand*{\DestroyRealLayerPageStyle}[1]{% |
| 4023 |
\IfRealLayerPageStyleExists{#1}{% |
| 4024 |
\expandafter\let\csname @ps@#1@initialhook\endcsname\relax |
| 4025 |
\expandafter\let\csname @ps@#1@hook\endcsname\relax |
| 4026 |
\expandafter\let\csname @ps@#1@backgroundhook\endcsname\relax |
| 4027 |
\expandafter\let\csname @ps@#1@foregroundhook\endcsname\relax |
| 4028 |
\expandafter\let\csname @ps@#1@oddpagehook\endcsname\relax |
| 4029 |
\expandafter\let\csname @ps@#1@evenpagehook\endcsname\relax |
| 4030 |
\expandafter\let\csname @ps@#1@onesidehook\endcsname\relax |
| 4031 |
\expandafter\let\csname @ps@#1@twosidehook\endcsname\relax |
| 4032 |
\expandafter\let\csname @ps@#1@floatpagehook\endcsname\relax |
| 4033 |
\expandafter\let\csname @ps@#1@nonfloatpagehook\endcsname\relax |
| 4034 |
\expandafter\let\csname @ps@#1@layers\endcsname\relax |
| 4035 |
\expandafter\let\csname ps@#1\endcsname\relax |
| 4036 |
\Ifstr{\currentpagestyle}{#1}{% |
| 4037 |
\def\currentpagestyle{scrlayer@empty}% |
| 4038 |
\let\@oddhead\@empty\let\@evenhead\@empty |
| 4039 |
\let\@oddfoot\@empty\let\@evenfoot\@empty |
| 4040 |
}{}% |
| 4041 |
\if@specialpage |
| 4042 |
\Ifstr{\@specialstyle}{#1}{% |
| 4043 |
\global\let\@specialstyle\relax |
| 4044 |
\global\@specialpagefalse |
| 4045 |
}{}% |
| 4046 |
\fi |
| 4047 |
}{% |
| 4048 |
%<*trace> |
| 4049 |
\PackageInfo{scrlayer}{% |
| 4050 |
\string\DestroyRealLayerPageStyle{#1} ignored,\MessageBreak |
| 4051 |
because the layer page style isn't\MessageBreak |
| 4052 |
defined (any longer)% |
| 4053 |
}% |
| 4054 |
%</trace> |
| 4055 |
}% |
| 4056 |
} |
| 4057 |
%</package&body> |
| 4058 |
% \end{macrocode} |
| 4059 |
% \end{command}^^A \DestroyRealLayerPageStyle |
| 4060 |
% |
| 4061 |
% |
| 4062 |
% \subsection{Kernel Patches} |
| 4063 |
% |
| 4064 |
% This package as so many others need to patch the \LaTeX{} kernel. This will |
| 4065 |
% be done, because we need information about the current active package style. |
| 4066 |
% |
| 4067 |
% \begin{command}{\pagestyle} |
| 4068 |
% \begin{command}{\currentpagestyle} |
| 4069 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 4070 |
% We save the current page style. Note, that this doesn't work for special |
| 4071 |
% page styles\footnote{Special page styles are set by |
| 4072 |
% \cs{thispagestyle}.} that hasn't been defined using |
| 4073 |
% \pkg*{scrlayer}. As long as \cs{currentpagestyle} is empty, the |
| 4074 |
% current page style is unknown. And we add two hooks into page style |
| 4075 |
% selection: one before an one after the selection. |
| 4076 |
% \begin{macrocode} |
| 4077 |
%<*package&body> |
| 4078 |
\newcommand*{\currentpagestyle}{} |
| 4079 |
\PackageInfo{scrlayer}{patching LaTeX kernel macro \string\pagestyle} |
| 4080 |
\def\reserved@a{% |
| 4081 |
\iftoplevelpagestyle\edef\toplevelpagestyle{##1}\toplevelpagestylefalse\fi |
| 4082 |
\scrlayer@exec@before@pagestyle@hook{##1}% |
| 4083 |
} |
| 4084 |
\expandafter\expandafter\expandafter\renewcommand |
| 4085 |
\expandafter\expandafter\expandafter*% |
| 4086 |
\expandafter\expandafter\expandafter\pagestyle |
| 4087 |
\expandafter\expandafter\expandafter[% |
| 4088 |
\expandafter\expandafter\expandafter1% |
| 4089 |
\expandafter\expandafter\expandafter]% |
| 4090 |
\expandafter\expandafter\expandafter{% |
| 4091 |
\expandafter\reserved@a |
| 4092 |
\pagestyle{#1}% |
| 4093 |
\edef\currentpagestyle{\GetRealPageStyle{#1}}% |
| 4094 |
\scrlayer@exec@after@pagestyle@hook{#1}% |
| 4095 |
\toplevelpagestyletrue |
| 4096 |
} |
| 4097 |
\newif\iftoplevelpagestyle\toplevelpagestyletrue |
| 4098 |
\AtBeginDocument{% |
| 4099 |
\begingroup |
| 4100 |
\let\scrlayer@exec@before@pagestyle@hook\@gobble |
| 4101 |
\let\scrlayer@exec@after@pagestyle@hook\@gobble |
| 4102 |
\def\ps@test{}% |
| 4103 |
\pagestyle{test}% |
| 4104 |
\Ifstr{\currentpagestyle}{test}{}{% |
| 4105 |
\PackageError{scrlayer}{package incompatibility detected}{% |
| 4106 |
Another package redefines \string\pagestyle\space incompatible with |
| 4107 |
scrlayer.\MessageBreak |
| 4108 |
This disables setting of \string\currentpagestyle\space and may |
| 4109 |
be serious.\MessageBreak |
| 4110 |
Maybe you could prevent this loading package scrlayer |
| 4111 |
later.\MessageBreak |
| 4112 |
If not you should either not use scrlayer or not the other |
| 4113 |
package,\MessageBreak |
| 4114 |
that redefines \string\pagestyle.% |
| 4115 |
}% |
| 4116 |
}% |
| 4117 |
\endgroup |
| 4118 |
} |
| 4119 |
%</package&body> |
| 4120 |
% \end{macrocode} |
| 4121 |
% \end{command}^^A \currentpagestyle |
| 4122 |
% |
| 4123 |
% \begin{command}{\BeforeSelectAnyPageStyle,\AfterSelectAnyPageStyle} |
| 4124 |
% \begin{macro}{\scrlayer@exec@before@pagestyle@hook, |
| 4125 |
% \scrlayer@exec@after@pagestyle@hook} |
| 4126 |
% We have two macros to locally add code to be executed whenever a page style |
| 4127 |
% changes using \cs{pagestyle}. The first one executes the code before the |
| 4128 |
% page style will be changed, the second one after the page style has been |
| 4129 |
% changed. Note, that you may use \#1 as a placeholder of the argument of |
| 4130 |
% \cs{pagestyle}. |
| 4131 |
% \begin{macrocode} |
| 4132 |
%<*package&body> |
| 4133 |
\newcommand*{\BeforeSelectAnyPageStyle}[1]{% |
| 4134 |
\expandafter\renewcommand\expandafter*% |
| 4135 |
\expandafter\scrlayer@exec@before@pagestyle@hook |
| 4136 |
\expandafter[\expandafter1\expandafter]\expandafter{% |
| 4137 |
\scrlayer@exec@before@pagestyle@hook{##1}#1}% |
| 4138 |
} |
| 4139 |
\newcommand*{\scrlayer@exec@before@pagestyle@hook}[1]{} |
| 4140 |
\newcommand*{\AfterSelectAnyPageStyle}[1]{% |
| 4141 |
\expandafter\renewcommand\expandafter*% |
| 4142 |
\expandafter\scrlayer@exec@after@pagestyle@hook |
| 4143 |
\expandafter[\expandafter1\expandafter]\expandafter{% |
| 4144 |
\scrlayer@exec@after@pagestyle@hook{##1}#1}% |
| 4145 |
} |
| 4146 |
\newcommand*{\scrlayer@exec@after@pagestyle@hook}[1]{} |
| 4147 |
%</package&body> |
| 4148 |
% \end{macrocode} |
| 4149 |
% \end{macro}^^A \scrlayer@exec@after@pagestyle@hook … |
| 4150 |
% \end{command}^^A \BeforeSelectAnyPageStyle,\AfterSelectAnyPageStyle |
| 4151 |
% \end{command}^^A \pagestyle |
| 4152 |
% |
| 4153 |
% |
| 4154 |
% \subsection{Deprecated declaration of end user interfaces} |
| 4155 |
% |
| 4156 |
% \changes{v3.32}{2020/09/11}{the interface commands are deprecated} |
| 4157 |
% |
| 4158 |
% All commands of this subsection are deprecated. So they are declared as |
| 4159 |
% internal independent from their name. |
| 4160 |
% |
| 4161 |
% \begin{macro}{\scrlayerAddToInterface,\scrlayerAddCsToInterface} |
| 4162 |
% \begin{description} |
| 4163 |
% \item[\texttt{\{\meta{command}\textbar\meta{command sequence}\}}:] the |
| 4164 |
% command (with backslash) or the command sequence of the command (without |
| 4165 |
% backslash) of the command, that should be added to the interface. |
| 4166 |
% \item[\marg{code}:] will be executed, only if the command could be |
| 4167 |
% added to the interface. |
| 4168 |
% \end{description} |
| 4169 |
% Add either a command sequence or a command to the user interface. |
| 4170 |
% \begin{macrocode} |
| 4171 |
%<*package&body> |
| 4172 |
\newcommand*{\scrlayerAddToInterface}[2][\@currname.\@currext]{% |
| 4173 |
\scrlayer@report@deprecated{#1}{\scrlayerAddToInterface}% |
| 4174 |
\begingroup |
| 4175 |
\edef\reserve@a{% |
| 4176 |
\noexpand\scrlayerAddCsToInterface[#1]{\expandafter\@gobble\string #2}% |
| 4177 |
}% |
| 4178 |
\expandafter\endgroup\reserve@a |
| 4179 |
} |
| 4180 |
\newcommand{\scrlayerAddCsToInterface}[3][\@currname.\@currext]{% |
| 4181 |
\scrlayer@report@deprecated{#1}{\scrlayerAddCsToInterface}% |
| 4182 |
\@ifundefined{scrlayer@#1@commandlist}{% |
| 4183 |
\PackageError{scrlayer}{unkown interface `#1'}{% |
| 4184 |
I've been told to add a command sequence to an interface, that hasn't |
| 4185 |
been\MessageBreak |
| 4186 |
defined yet. Please initialise every interface using |
| 4187 |
\string\InitInterface\space before\MessageBreak |
| 4188 |
trying to add command sequences to it.\MessageBreak |
| 4189 |
If you'll continue, the command will be ignored.% |
| 4190 |
}% |
| 4191 |
}{% |
| 4192 |
\@ifundefined{#2}{% |
| 4193 |
\scrlayer@AddCsToInterface[#1]{#2}#3% |
| 4194 |
}{% |
| 4195 |
\@ifundefined{scrlayer@command@#2}{% |
| 4196 |
\ifscrlayer@forceoverwrite |
| 4197 |
\PackageWarning{scrlayer}{% |
| 4198 |
Overloading `\@backslashchar#2'!\MessageBreak |
| 4199 |
scrlayer detected, that the given command\MessageBreak |
| 4200 |
has been defined already, when\MessageBreak |
| 4201 |
`#1' tried to define it again.\MessageBreak |
| 4202 |
Nevertheless, while scrlayer is in force overwrite\MessageBreak |
| 4203 |
mode currently, the original definition will be\MessageBreak |
| 4204 |
removed% |
| 4205 |
}% |
| 4206 |
\expandafter\let\csname #2\endcsname\relax |
| 4207 |
\scrlayer@AddCsToInterface[#1]{#2}#3% |
| 4208 |
\else |
| 4209 |
\PackageError{scrlayer}{cannot define `\@backslashchar#2'}{% |
| 4210 |
scrlayer interface `#1' has tried to |
| 4211 |
define command\MessageBreak |
| 4212 |
`\@backslashchar#2', but this has already been defined\MessageBreak |
| 4213 |
and is not part of another interface. So it cannot be |
| 4214 |
defined.\MessageBreak |
| 4215 |
Before continuing you should solve this conflict.\MessageBreak |
| 4216 |
Nevertheless, you may use option `forceoverwrite' to get only a |
| 4217 |
warning instead\MessageBreak |
| 4218 |
of an error. But this wouldn't solve the problem at |
| 4219 |
all!\MessageBreak |
| 4220 |
This error is almost fatal, so you should abort the LaTeX |
| 4221 |
run.% |
| 4222 |
}% |
| 4223 |
\fi |
| 4224 |
}{% |
| 4225 |
\ifscrlayer@autoremoveinterfaces |
| 4226 |
\PackageInfo{scrlayer}{% |
| 4227 |
already define interface command\MessageBreak |
| 4228 |
`\@backslashchar#2' detected.\MessageBreak |
| 4229 |
Command has been defined by interface\MessageBreak |
| 4230 |
`\@nameuse{scrlayer@command@#2}'.\MessageBreak |
| 4231 |
To continue installation of interface\MessageBreak |
| 4232 |
`#1', interface\MessageBreak |
| 4233 |
`\@nameuse{scrlayer@command@#2}' will\MessageBreak |
| 4234 |
be removed% |
| 4235 |
}% |
| 4236 |
\@nameuse{scrlayer@\@nameuse{scrlayer@command@#2}@onremove}% |
| 4237 |
\begingroup |
| 4238 |
\def\@elt##1{% |
| 4239 |
\aftergroup\let\aftergroup##1\aftergroup\relax |
| 4240 |
}% |
| 4241 |
\@nameuse{scrlayer@\@nameuse{scrlayer@command@#2}@commandlist}% |
| 4242 |
\endgroup |
| 4243 |
\expandafter\let\csname |
| 4244 |
scrlayer@\@nameuse{scrlayer@command@#2}@commandlist\endcsname\relax |
| 4245 |
\expandafter\let\csname |
| 4246 |
scrlayer@\@nameuse{scrlayer@command@#2}@onremove\endcsname\relax |
| 4247 |
\expandafter\let\csname #2\endcsname\relax |
| 4248 |
\scrlayer@AddCsToInterface[#1]{#2}#3% |
| 4249 |
\else |
| 4250 |
\PackageError{scrlayer}{cannot define `\@backslashchar#2'}{% |
| 4251 |
Interface command `\@backslashchar#2' has already |
| 4252 |
been\MessageBreak |
| 4253 |
defined by interface |
| 4254 |
`\@nameuse{scrlayer@command@#2}'.\MessageBreak |
| 4255 |
So it cannot be defined again.\MessageBreak |
| 4256 |
You may try scrlayer option `autoremoveinterfaces' to |
| 4257 |
automatically remove\MessageBreak |
| 4258 |
older interfaces in such conflict situations.\MessageBreak |
| 4259 |
For now, it's recommended so solve the problem before you'll |
| 4260 |
continue.% |
| 4261 |
}% |
| 4262 |
\fi |
| 4263 |
}% |
| 4264 |
}% |
| 4265 |
}% |
| 4266 |
}% |
| 4267 |
% \end{macrocode} |
| 4268 |
% \begin{macro}{\scrlayer@AddCsToInterface} |
| 4269 |
% Little helper, to avoid repeating this \cs{expandafter} orgy. |
| 4270 |
% \begin{description} |
| 4271 |
% \item[\oarg{string}:] the interface name (must be expandable and |
| 4272 |
% expand to a string) |
| 4273 |
% \item[\marg{command sequence}] the command sequence of the command to |
| 4274 |
% be added. |
| 4275 |
% \end{description} |
| 4276 |
% \begin{macrocode} |
| 4277 |
\newcommand*\scrlayer@AddCsToInterface[2][\@currname.\@currext]{% |
| 4278 |
\scrlayer@report@deprecated{#1}{\scrlayer@AddCsToInterface}% |
| 4279 |
\expandafter\expandafter\expandafter\def\expandafter |
| 4280 |
\csname scrlayer@#1@commandlist\expandafter\expandafter\expandafter\endcsname |
| 4281 |
\expandafter\expandafter\expandafter{% |
| 4282 |
\csname scrlayer@#1@commandlist\expandafter\endcsname |
| 4283 |
\expandafter\@elt\csname #2\endcsname |
| 4284 |
}% |
| 4285 |
\@namedef{scrlayer@command@#2}{#1}% |
| 4286 |
} |
| 4287 |
%</package&body> |
| 4288 |
% \end{macrocode} |
| 4289 |
% \begin{option}{forceoverwrite} |
| 4290 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 4291 |
% commands removed} |
| 4292 |
% \begin{macro}{\ifscrlayer@forceoverwrite} |
| 4293 |
% \begin{description} |
| 4294 |
% \item[\marg{simple switch}:] whether or not to overwrite already |
| 4295 |
% defined command. Note: If true, there will still be a warning. |
| 4296 |
% \end{description} |
| 4297 |
% \begin{macrocode} |
| 4298 |
%<*options> |
| 4299 |
%<*package> |
| 4300 |
\KOMA@ifkey{forceoverwrite}{scrlayer@forceoverwrite} |
| 4301 |
%<package>\scrlayer@@add@inherited@option{forceoverwrite} |
| 4302 |
%</package> |
| 4303 |
%<*interface> |
| 4304 |
\KOMA@key{forceoverwrite}[true]{% |
| 4305 |
\KOMA@set@ifkey{forceoverwrite}{scrlayer@forceoverwrite}{#1}% |
| 4306 |
\KOMA@kav@replacebool{scrlayer.sty}{forceoverwrite}{scrlayer@forceoverwrite}% |
| 4307 |
} |
| 4308 |
%</interface> |
| 4309 |
%</options> |
| 4310 |
%<*interface&body> |
| 4311 |
\expandafter\let |
| 4312 |
\csname KV@KOMA.\@currname.\@currext @forceoverwrite\endcsname\relax |
| 4313 |
\expandafter\let |
| 4314 |
\csname KV@KOMA.\@currname.\@currext @forceoverwrite@default\endcsname\relax |
| 4315 |
%</interface&body> |
| 4316 |
% \end{macrocode} |
| 4317 |
% \end{macro}^^A \ifscrlayer@forceoverwrite |
| 4318 |
% \end{option}^^A forceoverwrite |
| 4319 |
% |
| 4320 |
% \begin{option}{autoremoveinterfaces} |
| 4321 |
% \changes{v3.39}{2022/11/11}{initial dot in member argument of option storage |
| 4322 |
% commands removed} |
| 4323 |
% \begin{macro}{\ifscrlayer@autoremoveinterfaces} |
| 4324 |
% \begin{description} |
| 4325 |
% \item[\marg{simple switch}:] whether or not older interfaces may be |
| 4326 |
% automatically removed in conflict cases. |
| 4327 |
% \end{description} |
| 4328 |
% \begin{macrocode} |
| 4329 |
%<*options> |
| 4330 |
%<*package> |
| 4331 |
\KOMA@ifkey{autoremoveinterfaces}{scrlayer@autoremoveinterfaces} |
| 4332 |
%<package>\scrlayer@@add@inherited@option{autoremoveinterfaces} |
| 4333 |
%</package> |
| 4334 |
%<*interface> |
| 4335 |
\KOMA@key{autoremoveinterfaces}[true]{% |
| 4336 |
\scrlayer@report@deprecated{#1}{autoremoveinterface}% |
| 4337 |
\KOMA@set@ifkey{autoremoveinterfaces}{scrlayer@autoremoveinterfaces}{#1}% |
| 4338 |
\KOMA@kav@replacebool{scrlayer.sty}{autoremoveinterfaces} |
| 4339 |
{scrlayer@autoremoveinterfaces}% |
| 4340 |
} |
| 4341 |
%</interface> |
| 4342 |
%</options> |
| 4343 |
%<*interface&body> |
| 4344 |
\expandafter\let |
| 4345 |
\csname KV@KOMA.\@currname.\@currext @autoremoveinterfaces\endcsname\relax |
| 4346 |
\expandafter\let |
| 4347 |
\csname KV@KOMA.\@currname.\@currext @autoremoveinterfaces@default\endcsname |
| 4348 |
\relax |
| 4349 |
%</interface&body> |
| 4350 |
% \end{macrocode} |
| 4351 |
% \end{macro}^^A \ifscrlayer@autoremoveinterfaces |
| 4352 |
% \end{option}^^A autoremoveinterfaces |
| 4353 |
% \end{macro}^^A \scrlayer@AddCsToInterface |
| 4354 |
% \end{macro}^^A \scrlayerAddToInterface,\scrlayerAddCsToInterface |
| 4355 |
% |
| 4356 |
% \begin{macro}{\scrlayerInitInterface} |
| 4357 |
% \begin{description} |
| 4358 |
% \item[\oarg{string}:] the name of the interface. Generally this is |
| 4359 |
% the file name of the package or class, that defines the interface |
| 4360 |
% (default: \texttt{\cs{@currname}.\cs{@currext}}). |
| 4361 |
% \end{description} |
| 4362 |
% This registers a new user interface. |
| 4363 |
% \begin{macrocode} |
| 4364 |
%<*package&body> |
| 4365 |
\newcommand*{\scrlayerInitInterface}[1][\@currname.\@currext]{% |
| 4366 |
\scrlayer@report@deprecated{#1}{\scrlayerInitInterface}% |
| 4367 |
\@ifundefined{scrlayer@#1@commandlist}{% |
| 4368 |
\@namedef{scrlayer@#1@commandlist}{}% |
| 4369 |
}{% |
| 4370 |
\begingroup |
| 4371 |
\def\@elt##1{\space\space\string##1\MessageBreak}% |
| 4372 |
\PackageError{scrlayer}{interface `#1' already initialised}{% |
| 4373 |
You've tried to initialise scrlayer interface `#1',\MessageBreak |
| 4374 |
but an interface of this name has been initialised |
| 4375 |
already.\MessageBreak |
| 4376 |
Here's a list of all macros of the already initialised |
| 4377 |
interface:\MessageBreak |
| 4378 |
\@nameuse{scrlayer@#1@commandlist}.% |
| 4379 |
If you'll continue, this re-initialisation will be ignored.% |
| 4380 |
}% |
| 4381 |
\endgroup |
| 4382 |
}% |
| 4383 |
} |
| 4384 |
%</package&body> |
| 4385 |
% \end{macrocode} |
| 4386 |
% \end{macro}^^A \scrlayerInitInterface |
| 4387 |
% |
| 4388 |
% \begin{macro}{\scrlayerOnAutoRemoveInterface} |
| 4389 |
% \begin{description} |
| 4390 |
% \item[\oarg{string}:] the name of the interface. Generally this is |
| 4391 |
% the file name of the package or class, that defines the interface |
| 4392 |
% (default: \texttt{\cs{@currname}.\cs{@currext}}). |
| 4393 |
% \item[\marg{code}:] will be executed if the interface will be removed |
| 4394 |
% automatically (see option \opt{autoremoveinterfaces}). |
| 4395 |
% \end{description} |
| 4396 |
% \begin{macrocode} |
| 4397 |
%<*package&body> |
| 4398 |
\newcommand*{\scrlayerOnAutoRemoveInterface}[2][\@currname.\@currext]{% |
| 4399 |
\scrlayer@report@deprecated{#1}{\scrlayerOnAutoRemoveInterface}% |
| 4400 |
\@ifundefined{scrlayer@#1@onremove}{\@namedef{scrlayer@#1@onremove}{}}{}% |
| 4401 |
\expandafter\l@addto@macro\csname scrlayer@#1@onremove\endcsname{#2}% |
| 4402 |
} |
| 4403 |
%</package&body> |
| 4404 |
% \end{macrocode} |
| 4405 |
% \end{macro}^^A \scrlayerOnAutoRemoveInterface |
| 4406 |
% |
| 4407 |
% \begin{macro}{\scrlayer@report@deprecated} |
| 4408 |
% \changes{v3.32}{2020/09/11}{added} |
| 4409 |
% Report that the deprecated interface commands are used but should not. But |
| 4410 |
% report this only once per interface. |
| 4411 |
% \begin{macrocode} |
| 4412 |
%<*package&init> |
| 4413 |
\newcommand*{\scrlayer@report@deprecated}[2]{% |
| 4414 |
\@ifundefined{scrlayer@deprecated@reported@for@#1}{% |
| 4415 |
\PackageWarning{scrlayer}{% |
| 4416 |
Deprecated interface detected for `#1'.\MessageBreak |
| 4417 |
There isn't any support for using, e.g.,\MessageBreak |
| 4418 |
`\string #2'% |
| 4419 |
}% |
| 4420 |
\@namedef{scrlayer@deprecated@reported@for@#1}{\string #2}% |
| 4421 |
}{}% |
| 4422 |
} |
| 4423 |
%</package&init> |
| 4424 |
% \end{macrocode} |
| 4425 |
% \end{macro} |
| 4426 |
% |
| 4427 |
% \begin{macrocode} |
| 4428 |
%</package|interface|class> |
| 4429 |
% \end{macrocode} |
| 4430 |
% |
| 4431 |
% \Finale |
| 4432 |
% \PrintChanges |
| 4433 |
% |
| 4434 |
\endinput |
| 4435 |
% Local Variables: |
| 4436 |
% mode: doctex |
| 4437 |
% ispell-local-dictionary: "en_US" |
| 4438 |
% eval: (flyspell-mode 1) |
| 4439 |
% TeX-master: t |
| 4440 |
% TeX-engine: luatex-dev |
| 4441 |
% 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")) |
| 4442 |
% End: |