Current File : //usr/share/texlive/texmf-dist/tex/latex/koma-script/scrlayer-scrpage.sty
%%
%% This is file `scrlayer-scrpage.sty',
%% generated with the docstrip utility, extended by scrdocstrip.
%%
%% The original source files were:
%%
%% scrlayer-scrpage.dtx  (with options: `interface,trace,scrpage,identify')
%% scrlayer.dtx  (with options: `interface,trace,scrpage,init')
%% scrlayer-scrpage.dtx  (with options: `interface,trace,scrpage,init')
%% scrlayer.dtx  (with options: `interface,trace,scrpage,options')
%% scrlayer-scrpage.dtx  (with options: `interface,trace,scrpage,options')
%% scrlayer.dtx  (with options: `interface,trace,scrpage,body')
%% scrlayer-scrpage.dtx  (with options: `interface,trace,scrpage,body')
%% scrlogo.dtx  (with options: `logo')
%% 
%% Copyright (c) 2012-2019 Markus Kohm [komascript at gmx info]
%% 
%% This file was generated from file(s) of the KOMA-Script bundle.
%% ---------------------------------------------------------------
%% 
%% It may be distributed under the conditions of the
%% LaTeX Project Public License in the version distributed together
%% with KOMA-Script, see file `lppl.txt' or `lppl-de.txt'.
%% 
%% This file may only be distributed together with a copy of the
%% KOMA-Script bundle.  You may however distribute the
%% KOMA-Script bundle without all such generated files.  See also
%% `lppl.txt' or `lppl-de.txt' for additional information.
%% 
%% The list of files belonging to KOMA-Script distribution is given in
%% the file `manifest.txt'.  See also `lppl.txt' or `lppl-de.txt' for
%% additional information.
%% 
%% If this file is a beta version, you may not be allowed to distribute
%% it.  Look at the comments below to see if this is the case.
%% 
%% English and German manuals are part of KOMA-Script bundle.
%% ----------------------------------------------------------
%% 
%% See `README'.
%% 
%% The KOMA-Script bundle (but maybe not this file) was based upon the
%% LaTeX 2.09 Script family created by Frank Neukam 1993 and the LaTeX2e
%% standard classes created by The LaTeX3 Project 1994-1996.  You can
%% find a complete unmodified copy of LaTeX2e at
%% <http://mirror.ctan.org/tex-archive/macros/latex/base/>.
%% 
%%% From File: $Id: scrlayer-scrpage.dtx 3531 2020-09-11 12:28:41Z kohm $
%%%            (run: identify)
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{scrlayer-scrpage}[%
  2021/03/17 v3.33 KOMA-Script
  package
  (end user interface for scrlayer)]
%%% From File: $Id: scrlayer.dtx 3560 2021-02-15 13:20:12Z kohm $
%%%            (run: init)
\RequirePackage{scrlayer}
\scr@ifundefinedorrelax{scrlayer@AtEndOfPackage}{%
  \AtEndOfPackage{\let\scrlayer@AtEndOfPackage\@firstofone}%
}{%
  \ifx\scrlayer@AtEndOfPackage\@firstofone
    \AtEndOfPackage{\let\scrlayer@AtEndOfPackage\@firstofone}%
  \fi
}
\let\scrlayer@AtEndOfPackage\AtEndOfPackage
%%% From File: $Id: scrlayer-scrpage.dtx 3531 2020-09-11 12:28:41Z kohm $
%%%            (run: init)
\AtEndOfPackage{%
  \sls@auto@pagestyleset%
}
\newcommand*{\sls@auto@pagestyleset}{%
  \scr@ifundefinedorrelax{KOMAClassName}{%
    \PackageInfoNoLine{scrlayer-scrpage}{%
      auto-selection of `pagestyleset=standard'}%
    \FamilyExecuteOptions[.scrlayer-scrpage.sty]{KOMA}{pagestyleset=standard}%
  }{%
    \PackageInfoNoLine{scrlayer-scrpage}{%
      auto-selection of `pagestyleset=KOMA-Script'}%
    \FamilyExecuteOptions[.scrlayer-scrpage.sty]{KOMA}%
    {pagestyleset=KOMA-Script}%
  }%
}
%%% From File: $Id: scrlayer.dtx 3560 2021-02-15 13:20:12Z kohm $
%%%            (run: options)
\KOMA@key{markcase}{%
\scrlayer@AtEndOfPackage{%
  \begingroup
    \KOMA@set@ncmdkey{markcase}{reserved@a}{%
      {upper}{0},{lower}{1},{used}{2},%
      {ignoreuppercase}{3},{nouppercase}{3},%
      {ignoreupper}{3},{noupper}{3}%
    }{#1}%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \aftergroup\FamilyKeyStateProcessed
      \ifnum \reserved@a>\m@ne
        \aftergroup\let\aftergroup\MakeMarkcase
        \ifcase \reserved@a
          \aftergroup\MakeUppercase
          \aftergroup\scrlayer@forceignoreuppercasefalse
        \or
          \aftergroup\MakeLowercase
          \aftergroup\scrlayer@forceignoreuppercasefalse
        \or
          \aftergroup\@firstofone
          \aftergroup\scrlayer@forceignoreuppercasefalse
        \else
          \aftergroup\scrlayer@ignoreuppercase
          \aftergroup\scrlayer@forceignoreuppercasetrue
        \fi
      \fi
    \else
      \aftergroup\FamilyKeyStateUnknownValue
    \fi
  \endgroup
  \ifx\FamilyKeyState\FamilyKeyStateProcessed
    \KOMA@kav@removekey{.scrlayer.sty}{markcase}%
    \KOMA@kav@xadd{.scrlayer.sty}{markcase}{#1}%
  \fi
}%
}
\KOMA@key{autooneside}[true]{%
  \KOMA@set@ifkey{autooneside}{scrlayer@autooneside}{#1}%
  \KOMA@kav@replacebool{.scrlayer.sty}{autooneside}{scrlayer@autooneside}%
}
\KOMA@key{automark}[]{%
  \scrlayer@testunexpectedarg{automark}{#1}%
  \scrlayer@AtEndOfPackage{%
    \if@chapter
      \scr@ifundefinedorrelax{section}{%
        \automark{chapter}%
      }{%
        \automark[section]{chapter}%
      }%
    \else
      \scr@ifundefinedorrelax{section}{%
        \automark{}%
      }{%
        \scr@ifundefinedorrelax{subsection}{%
          \automark{section}%
        }{%
          \automark[subsection]{section}%
        }
      }%
    \fi
  }%
  \FamilyKeyStateProcessed
  \KOMA@kav@removekey{.scrlayer.sty}{automark}%
  \KOMA@kav@removekey{.scrlayer.sty}{manualmark}%
  \KOMA@kav@add{.scrlayer.sty}{automark}{}%
}
\KOMA@key{manualmark}[]{%
  \scrlayer@testunexpectedarg{manualmark}{#1}%
  \scrlayer@AtEndOfPackage{\manualmark}%
  \FamilyKeyStateProcessed
  \KOMA@kav@removekey{.scrlayer.sty}{automark}%
  \KOMA@kav@removekey{.scrlayer.sty}{manualmark}%
  \KOMA@kav@add{.scrlayer.sty}{manualmark}{}%
}
\KOMA@key{onpsselect}{%
  \l@addto@macro{\@ps@initialhook}{#1}%
  \FamilyKeyStateProcessed
  \KOMA@kav@add{.scrlayer.sty}{onpsselect}{#1}%
}
\KOMA@key{onpsinit}{%
  \l@addto@macro{\@ps@hook}{#1}%
  \FamilyKeyStateProcessed
  \KOMA@kav@add{.scrlayer.sty}{onpsinit}{#1}%
}
\KOMA@key{onpsoneside}{%
  \l@addto@macro{\@ps@onesidehook}{#1}%
  \FamilyKeyStateProcessed
  \KOMA@kav@add{.scrlayer.sty}{onpsoneside}{#1}%
}
\KOMA@key{onpstwoside}{%
  \l@addto@macro{\@ps@twosidehook}{#1}%
  \FamilyKeyStateProcessed
  \KOMA@kav@add{.scrlayer.sty}{onpstwoside}{#1}%
}
\KOMA@key{onpsoddpage}{%
  \l@addto@macro{\@ps@oddpagehook}{#1}%
  \FamilyKeyStateProcessed
  \KOMA@kav@add{.scrlayer.sty}{onpsoddpage}{#1}%
}
\KOMA@key{onpsevenpage}{%
  \l@addto@macro{\@ps@evenpagehook}{#1}%
  \FamilyKeyStateProcessed
  \KOMA@kav@add{.scrlayer.sty}{onpsevenpage}{#1}%
}
\KOMA@key{onpsfloatpage}{%
  \l@addto@macro{\@ps@floatpagehook}{#1}%
  \FamilyKeyStateProcessed
  \KOMA@kav@add{.scrlayer.sty}{onpsfloatpage}{#1}%
}
\KOMA@key{onpsnonfloatpage}{%
  \l@addto@macro{\@ps@nonfloatpagehook}{#1}%
  \FamilyKeyStateProcessed
  \KOMA@kav@add{.scrlayer.sty}{onpsnonfloatpage}{#1}%
}
\KOMA@key{onpsbackground}{%
  \l@addto@macro{\@ps@backgroundhook}{#1}%
  \FamilyKeyStateProcessed
  \KOMA@kav@add{.scrlayer.sty}{onpsbackground}{#1}%
}
\KOMA@key{onpsforeground}{%
  \l@addto@macro{\@ps@foregroundhook}{#1}%
  \FamilyKeyStateProcessed
  \KOMA@kav@add{.scrlayer.sty}{onpsforeground}{#1}%
}
\KOMA@ifkey{singlespacing}{@ps@singlespacing}
\KOMA@key{deactivatepagestylelayers}[true]{%
  \KOMA@set@ifkey{deactivatepagestylelayers}{scrlayer@deactivate@layers}{#1}%
  \KOMA@kav@replacebool{.scrlayer.sty}{deactivatepagestylelayers}
                       {scrlayer@deactivate@layers}%
}
\KOMA@key{draft}[true]{%
  \KOMA@set@ifkey{draft}{scrlayer@draft}{#1}%
  \KOMA@kav@replacebool{.scrlayer.sty}{draft}{scrlayer@draft}%
}
\KOMA@key{forceoverwrite}[true]{%
  \KOMA@set@ifkey{forceoverwrite}{scrlayer@forceoverwrite}{#1}%
  \KOMA@kav@replacebool{.scrlayer.sty}{forceoverwrite}{scrlayer@forceoverwrite}%
}
\KOMA@key{autoremoveinterfaces}[true]{%
  \scrlayer@report@deprecated{#1}{autoremoveinterface}%
  \KOMA@set@ifkey{autoremoveinterfaces}{scrlayer@autoremoveinterfaces}{#1}%
  \KOMA@kav@replacebool{.scrlayer.sty}{autoremoveinterfaces}
                       {scrlayer@autoremoveinterfaces}%
}
%%% From File: $Id: scrlayer-scrpage.dtx 3531 2020-09-11 12:28:41Z kohm $
%%%            (run: options)
\KOMA@key{headwidth}{%
  \begingroup
    \sls@split@at@iicolons#1:::\@nil
    \ifx\reserved@a\@empty \let\reserved@a\sls@headwidth\fi
    \edef\reserved@a{%
      \noexpand\endgroup
      \noexpand\sls@set@hf@width{head}{\reserved@b}{\reserved@c}{\reserved@a}%
      \noexpand\FamilyKeyStateProcessed
      \noexpand\KOMA@kav@replacevalue{.scrlayer-scrpage.sty}{headwidth}{%
        \reserved@a:\reserved@b:\reserved@c
      }%
    }%
  \reserved@a
}
\KOMA@key{footwidth}{%
  \begingroup
    \sls@split@at@iicolons#1:::\@nil
    \ifx\reserved@a\@empty \let\reserved@a\sls@footwidth\fi
    \edef\reserved@a{%
      \noexpand\endgroup
      \noexpand\sls@set@hf@width{foot}{\reserved@b}{\reserved@c}{\reserved@a}%
      \noexpand\FamilyKeyStateProcessed
      \noexpand\KOMA@kav@replacevalue{.scrlayer-scrpage.sty}{footwidth}{%
        \reserved@a:\reserved@b:\reserved@c
      }%
    }%
  \reserved@a
}
\newcommand\sls@split@at@iicolons{}
\def\sls@split@at@iicolons#1:#2:#3:#4\@nil{%
  \Ifstr{#4}{}{}{%
    \Ifstr{#4}{:}{}{%
      \Ifstr{#4}{::}{}{%
        \PackageWarning{scrlayer}{extra `:' found!\MessageBreak
          You've used more than two colons at the argument\MessageBreak
          of a two value option.\MessageBreak
          The extra value(s) will be ignored%
        }%
      }%
    }%
  }%
  \def\reserved@a{#1}%
  \def\reserved@b{#2}%
  \def\reserved@c{#3}%
}%
\newcommand*{\sls@set@hf@width}[4]{%
  \sls@settowidthof{\@tempdima}{#4}%
  \ifdim\@tempdima>\paperwidth
    \PackageWarning
      {scrlayer-scrpage}%
      {You've set width of #1 to a value\MessageBreak
        greater than width of page!\MessageBreak%
        I'll reduce width of #1 to width of page}%
    \setlength{\@tempdima}{\paperwidth}%
  \else
    \ifdim\@tempdima<\z@
       \PackageWarning
         {scrlayer-scrpage}%
         {You've set width of #1 to negative value!\MessageBreak%
           I'll set it to 0pt}%
       \setlength{\@tempdima}{\z@}%
     \fi
  \fi
  \expandafter\edef\csname sls@#1width\endcsname{\the\@tempdima}%
  \setlength{\@tempdima}{\textwidth}%
  \addtolength{\@tempdima}{-\csname sls@#1width\endcsname}%
  \Ifstr{#2}{}{%
    \ifdim \csname sls@#1width\endcsname
         = \dimexpr \textwidth+\marginparwidth+\marginparsep\relax
      \setlength{\@tempdimb}{\z@}
    \else
      \if@twoside
        \setlength{\@tempdimb}{.3333333333\@tempdima}%
      \else
        \setlength{\@tempdimb}{.5\@tempdima}%
      \fi
    \fi
  }{%
    \sls@settowidthof{\@tempdimb}{#2}%
  }%
  \Ifstr{#3}{}{%
    \addtolength{\@tempdima}{-\@tempdimb}%
  }{%
    \sls@settowidthof{\@tempdima}{#3}%
    \setlength{\@tempdima}{-\@tempdima}%
  }%
  \ifdim\@tempdimb<\z@
    \setlength{\@tempdimb}{-\@tempdimb}%
    \expandafter\edef\csname sls@odd#1shift\endcsname{-\the\@tempdimb}%
  \else
    \expandafter\edef\csname sls@odd#1shift\endcsname{\the\@tempdimb}%
  \fi
  \ifdim\@tempdima<\z@
    \setlength{\@tempdima}{-\@tempdima}%
    \expandafter\edef\csname sls@even#1shift\endcsname{-\the\@tempdima}%
  \else
    \expandafter\edef\csname sls@even#1shift\endcsname{\the\@tempdima}%
  \fi
}%
\scr@ifundefinedorrelax{@headwidth}{%
  \newcommand*{\sls@headwidth}{\textwidth}%
  \KOMA@kav@add{.scrlayer-scrpage.sty}{headwidth}{\textwidth:0pt:0pt}%
}{%
  \newcommand*{\sls@headwidth}{\@headwidth}%
  \KOMA@kav@xadd{.scrlayer-scrpage.sty}{headwidth}{\@headwidth:0pt:0pt}%
}%
\newcommand*{\sls@oddheadshift}{0pt}
\newcommand*{\sls@evenheadshift}{0pt}
\scr@ifundefinedorrelax{@footwidth}{%
  \newcommand*{\sls@footwidth}{\textwidth}%
  \KOMA@kav@add{.scrlayer-scrpage.sty}{footwidth}{\textwidth:0pt:0pt}
}{%
  \newcommand*{\sls@footwidth}{\@footwidth}%
  \KOMA@kav@xadd{.scrlayer-scrpage.sty}{footwidth}{\@footwidth:0pt:0pt}
}%
\newcommand*{\sls@oddfootshift}{0pt}
\newcommand*{\sls@evenfootshift}{0pt}
\newcommand*{\sls@settowidthof}[2]{%
  \Ifstr{#2}{paper}{%
    \setlength{#1}{\paperwidth}%
  }{%
    \Ifstr{#2}{text}{%
      \setlength{#1}{\textwidth}%
    }{%
      \Ifstr{#2}{marginpar}{%
        \setlength{#1}{\dimexpr \marginparwidth+\marginparsep\relax}%
      }{%
        \Ifstr{#2}{textwithmarginpar}{%
          \setlength{#1}{\dimexpr\textwidth
                                +\marginparwidth
                                +\marginparsep\relax}%
        }{%
          \Ifstr{#2}{head}{%
            \setlength{#1}{\sls@headwidth}%
          }{%
            \Ifstr{#2}{foot}{%
              \setlength{#1}{\sls@footwidth}%
            }{%
              \Ifstr{#2}{headtopline}{%
                \setlength{#1}{\sls@headabove@linelength}%
              }{%
                \Ifstr{#2}{headsepline}{%
                  \setlength{#1}{\sls@headbelow@linelength}%
                }{%
                  \Ifstr{#2}{footsepline}{%
                    \setlength{#1}{\sls@footabove@linelength}%
                  }{%
                    \Ifstr{#2}{footbotline}{%
                      \setlength{#1}{\sls@footbelow@linelength}%
                    }{%
                      \Ifstr{#2}{page}{%
                        \setlength{#1}{\paperwidth}%
                        \begingroup
                        \expandafter\expandafter\expandafter\endgroup
                        \expandafter\ifx\csname ta@bcor\endcsname\relax\else
                          \addtolength{#1}{-\ta@bcor}%
                        \fi
                      }{%
                        \setlength{#1}{\dimexpr #2\relax}%
                      }%
                    }%
                  }%
                }%
              }%
            }%
          }%
        }%
      }%
    }%
  }%
}%
\newcommand*{\sls@deftowidthof}[2]{%
  \Ifstr{#2}{autohead}{%
    \expandafter\def\csname #1\endcsname{\sls@headwidth}%
  }{%
    \Ifstr{#2}{autofoot}{%
      \expandafter\def\csname #1\endcsname{\sls@footwidth}%
    }{%
      \sls@settowidthof{\@tempdima}{#2}%
      \expandafter\edef\csname #1\endcsname{\the\@tempdima}%
    }%
  }%
}%
\KOMA@key{headtopline}[:]{%
  \sls@set@values[headtopline]{head}{above}{#1}%
}
\KOMA@key{headsepline}[:]{%
  \sls@set@values[headsepline]{head}{below}{#1}%
}
\KOMA@key{footsepline}[:]{%
  \sls@set@values[footsepline]{foot}{above}{#1}%
}
\KOMA@key{footbotline}[:]{%
  \sls@set@values[footbotline]{foot}{below}{#1}%
}
\newcommand*{\sls@set@values}[4][]{%
  \begingroup
    \Ifstr{#1}{}{%
      \FamilyKeyStateUnknown
    }{%
      \KOMA@set@ifkey{#1}{@tempswa}{#4}%
    }%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \if@tempswa
        \edef\reserved@b{%
          \noexpand\endgroup
          \noexpand\@namedef{sls@#2#3@linethickness}{.4pt}%
          \noexpand\@namedef{sls@#2#3@linelength}{%
            \expandafter\noexpand\csname sls@#2width\endcsname
          }%
        }%
      \else
        \def\reserved@b{%
          \endgroup
          \@namedef{sls@#2#3@linethickness}{0pt}%
          \@namedef{sls@#2#3@linelength}{0pt}%
        }%
      \fi
    \else
      \let\reserved@a\@empty
      \let\reserved@b\@empty
      \sls@split@at@colon#4::\@nil
      \ifx\reserved@a\@empty
        \def\reserved@a{\endgroup\@namedef{sls@#2#3@linethickness}{.4pt}}%
      \else
        \setlength{\@tempdima}{\dimexpr\reserved@a\relax}%
        \edef\reserved@a{%
          \noexpand\endgroup
          \noexpand\@namedef{sls@#2#3@linethickness}{\the\@tempdima}%
        }%
      \fi
      \ifx\reserved@b\@empty
        \def\reserved@b{%
          \reserved@a
          \@namedef{sls@#2#3@linelength}{\@nameuse{sls@#2width}}%
        }%
      \else
        \edef\reserved@b{%
          \noexpand\reserved@a
          \noexpand\sls@deftowidthof{sls@#2#3@linelength}{\reserved@b}%
        }%
      \fi
    \fi
  \reserved@b
  \FamilyKeyStateProcessed
  \Ifstr{#1}{}{}{%
    \KOMA@kav@xreplacevalue{.scrlayer-scrpage.sty}{#1}{%
      \csname sls@#2#3@linethickness\endcsname
      :\csname sls@#2#3@linelength\endcsname
    }%
  }%
}%
\newcommand*{\sls@split@at@colon}{}
\def\sls@split@at@colon#1:#2:#3\@nil{%
  \Ifstr{#3}{}{}{%
    \Ifstr{#3}{:}{}{%
      \PackageWarning{scrlayer}{extra `:' found!\MessageBreak
        You've used more than one colon at the argument\MessageBreak
        of a two value option.\MessageBreak
        The extra value(s) will be ignored%
      }%
    }%
  }%
  \def\reserved@a{#1}%
  \def\reserved@b{#2}%
}%
\newcommand*{\sls@headabove@linelength}{\sls@headwidth}%
\newcommand*{\sls@headabove@linethickness}{0pt}%
\KOMA@kav@xadd{.scrlayer-scrpage.sty}{headtopline}{%
  \expandafter\noexpand\sls@headabove@linethickness:%
  \expandafter\noexpand\sls@headabove@linelength
}
\newcommand*{\sls@headbelow@linelength}{\sls@headwidth}%
\newcommand*{\sls@headbelow@linethickness}{0pt}%
\KOMA@kav@xadd{.scrlayer-scrpage.sty}{headsepline}{%
  \expandafter\noexpand\sls@headbelow@linethickness:%
  \expandafter\noexpand\sls@headbelow@linelength
}
\newcommand*{\sls@footabove@linelength}{\sls@footwidth}%
\newcommand*{\sls@footabove@linethickness}{0pt}%
\KOMA@kav@xadd{.scrlayer-scrpage.sty}{footsepline}{%
  \expandafter\noexpand\sls@footabove@linethickness:%
  \expandafter\noexpand\sls@footabove@linelength
}
\newcommand*{\sls@footbelow@linelength}{\sls@footwidth}%
\newcommand*{\sls@footbelow@linethickness}{0pt}%
\KOMA@kav@xadd{.scrlayer-scrpage.sty}{footbotline}{%
  \expandafter\noexpand\sls@footbelow@linethickness:%
  \expandafter\noexpand\sls@footbelow@linelength
}
\KOMA@ifkey{plainheadtopline}{sls@plain@head@above@line}%
\KOMA@ifkey{plainheadsepline}{sls@plain@head@below@line}%
\KOMA@ifkey{plainfootsepline}{sls@plain@foot@above@line}%
\KOMA@ifkey{plainfootbotline}{sls@plain@foot@below@line}%
\newcommand*{\sls@hfline@adjust}{0}%
\KOMA@kav@add{.scrlayer-scrpage.sty}{ilines}{}
\KOMA@key{ilines}[]{%
  \ifx\relax#1\relax
    \renewcommand*{\sls@hfline@adjust}{0}%
    \FamilyKeyStateProcessed
    \KOMA@kav@removekey{.scrlayer-scrpage.sty}{ilines}%
    \KOMA@kav@removekey{.scrlayer-scrpage.sty}{clines}%
    \KOMA@kav@removekey{.scrlayer-scrpage.sty}{olines}%
    \KOMA@kav@add{.scrlayer-scrpage.sty}{ilines}{}%
  \else
    \def\FamilyKeyStateProcessed{unexpected value}%
  \fi
}
\KOMA@key{clines}[]{%
  \ifx\relax#1\relax
    \renewcommand*{\sls@hfline@adjust}{1}%
    \FamilyKeyStateProcessed
    \KOMA@kav@removekey{.scrlayer-scrpage.sty}{ilines}%
    \KOMA@kav@removekey{.scrlayer-scrpage.sty}{clines}%
    \KOMA@kav@removekey{.scrlayer-scrpage.sty}{olines}%
    \KOMA@kav@add{.scrlayer-scrpage.sty}{clines}{}%
  \else
    \def\FamilyKeyStateProcessed{unexpected value}%
  \fi
}
\KOMA@key{olines}[]{%
  \ifx\relax#1\relax
    \renewcommand*{\sls@hfline@adjust}{2}%
    \FamilyKeyStateProcessed
    \KOMA@kav@removekey{.scrlayer-scrpage.sty}{ilines}%
    \KOMA@kav@removekey{.scrlayer-scrpage.sty}{clines}%
    \KOMA@kav@removekey{.scrlayer-scrpage.sty}{olines}%
    \KOMA@kav@add{.scrlayer-scrpage.sty}{olines}{}%
  \else
    \def\FamilyKeyStateProcessed{unexpected value}%
  \fi
}
\KOMA@kav@add{.scrlayer-scrpage.sty}{ilines}{}
\KOMA@key{pagestyleset}{%
  \scr@ifundefinedorrelax{sls@ps@style@#1}{%
    \FamilyKeyStateUnknownValue
  }{%
    \let\sls@auto@pagestyleset\relax
    \@nameuse{sls@ps@style@#1}%
    \FamilyKeyStateProcessed
    \KOMA@kav@replacevalue{.scrlayer-scrpage.sty}{pagestyleset}{#1}%
  }%
}
\newcommand*{\sls@ps@style@standard}{%
  \let\MakeMarkcase\MakeUppercase
  \scrlayer@AtEndOfPackage{%
    \pagestyle{scrheadings}%
    \clearpairofpagestyles
    \ihead{\headmark}%
    \ohead{\pagemark}%
    \cfoot[\if@twoside\else\pagemark\fi]{}%
  }%
}%
\expandafter\newcommand\expandafter*\csname sls@ps@style@KOMA-Script\endcsname{%
  \let\MakeMarkcase\@firstofone
  \scrlayer@AtEndOfPackage{%
    \pagestyle{scrheadings}%
    \clearpairofpagestyles
    \ohead{\if@twoside\headmark\fi}%
    \chead{\if@twoside\else\headmark\fi}%
    \ofoot[\if@twoside\pagemark\fi]{\if@twoside\pagemark\fi}%
    \cfoot[\if@twoside\else\pagemark\fi]{\if@twoside\else\pagemark\fi}%
    \scr@ifundefinedorrelax{KOMAClassName}{}{%
      \Ifstr{\KOMAClassName}{scrlttr2}{%
        \clearpairofpagestyles
        \lehead[\ifnum\@pageat=\z@\pagemark\fi]
               {\ifnum\@pageat=\z@\pagemark\else\leftmark\fi}%
        \lohead[\ifnum\@pageat=\z@\pagemark\fi]
               {\ifnum\@pageat=\z@\pagemark\else\leftmark\fi}%
        \chead[\ifnum\@pageat=\@ne\pagemark\fi]
              {\ifcase\@pageat \rightmark\or \pagemark\or \rightmark\fi}%
        \rehead[\ifnum\@pageat=\tw@\pagemark\fi]
               {\ifcase\@pageat \leftmark\or \rightmark\or \pagemark
                 \else \rightmark\fi}%
        \rohead[\ifnum\@pageat=\tw@\pagemark\fi]
               {\ifcase\@pageat \leftmark\or \rightmark\or \pagemark
                 \else \rightmark\fi}%
        \lefoot[\ifnum\@pageat=\thr@@\pagemark\fi]
               {\ifnum\@pageat=\thr@@\pagemark\fi}%
        \lofoot[\ifnum\@pageat=\thr@@\pagemark\fi]
               {\ifnum\@pageat=\thr@@\pagemark\fi}%
        \cfoot[\ifnum\@pageat=4 \pagemark\fi]
              {\ifnum\@pageat=4 \pagemark\fi}%
        \refoot[\ifnum\@pageat=5 \pagemark\fi]
               {\ifnum\@pageat=5 \pagemark\fi}%
        \rofoot[\ifnum\@pageat=5 \pagemark\fi]
               {\ifnum\@pageat=5 \pagemark\fi}%
      }{}%
    }%
  }%
}%
\KOMA@DeclareDeprecatedOption[scrlayer-scrpage]{komastyle}{%
  pagestyleset=KOMA-Script}
\KOMA@DeclareDeprecatedOption[scrlayer-scrpage]{standardstyle}{%
  pagestyleset=standard}
\KOMA@DeclareDeprecatedOption[scrlayer-scrpage]{markuppercase}{markcase=upper}
\KOMA@DeclareDeprecatedOption[scrlayer-scrpage]{markusedcase}{markcase=used}
\KOMA@DeclareDeprecatedOption[scrlayer-scrpage]{nouppercase}{%
  markcase=ignoreuppercase%
}
\KOMA@ifkey{hmode}{sls@leavevmode}
\KOMA@ifkey{autoenlargeheadfoot}{sls@autoenlarge}
\KOMAExecuteOptions{autoenlargeheadfoot=true}
%%% From File: $Id: scrlayer.dtx 3560 2021-02-15 13:20:12Z kohm $
%%%            (run: body)
\KOMAProcessOptions\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @markcase\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @autooneside\endcsname\relax
\expandafter\let\csname KV@KOMA.\@currname.\@currext @automark\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @automark@default\endcsname\relax
\expandafter\let\csname KV@KOMA.\@currname.\@currext @manualmark\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @manualmark@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsselect\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsselect@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsinit\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsinit@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsoneside\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsoneside@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpstwoside\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpstwoside@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsoddpage\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsoddpage@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsevenpage\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsevenpage@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsfloatpage\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsfloatpage@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsnonfloatpage\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsnonfloatpage@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsbackground\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsbackground@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsforeground\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @onpsforeground@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @deactivatepagestylelayers\endcsname
  \relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @deactivatepagestylelayers@default\endcsname
  \relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @draft\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @draft@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @forceoverwrite\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @forceoverwrite@default\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @autoremoveinterfaces\endcsname\relax
\expandafter\let
  \csname KV@KOMA.\@currname.\@currext @autoremoveinterfaces@default\endcsname
  \relax
%%% From File: $Id: scrlayer-scrpage.dtx 3531 2020-09-11 12:28:41Z kohm $
%%%            (run: body)
\newcommand*{\setheadwidth}[2][]{%
  \KOMAoptions{headwidth=#2:#1}%
}%
\newcommand*{\setfootwidth}[2][]{%
  \KOMAoptions{footwidth=#2:#1}%
}%
\newcommand*{\setheadtopline}{\sls@setline{head}{above}}%
\newcommand*{\setheadsepline}{\sls@setline{head}{below}}%
\newcommand*{\setfootsepline}{\sls@setline{foot}{above}}%
\newcommand*{\setfootbotline}{\sls@setline{foot}{below}}%
\newcommand*\sls@setline[2]{%
  \kernel@ifnextchar[%]
  {\sls@@setline{#1}{#2}}{\sls@@@setline{#1#2}}%
}%
\newcommand*{\sls@@setline}{}
\def\sls@@setline#1#2[#3]{%
  \Ifstr{#3}{auto}{%
    \sls@deftowidthof{sls@#1#2@linelength}{#3#1}%
  }{%
    \sls@deftowidthof{sls@#1#2@linelength}{#3}%
  }%
  \sls@@@setline{#1#2}%
}%
\newcommand*{\sls@@@setline}[2]{%
  \edef\@tempa{#2}\edef\@tempb{current}%
  \Ifstr{#2}{}{}{%
    \Ifstr{#2}{current}{}{%
      \setlength{\@tempdima}{#2}%
      \Ifstr{#1}{headabove}{%
        \KOMAExecuteOptions[.scrlayer-scrpage.sty]%
          {headtopline=\@tempdima:\csname sls@#1@linelength\endcsname}%
      }{\Ifstr{#1}{headbelow}{%
          \KOMAExecuteOptions[.scrlayer-scrpage.sty]%
            {headsepline=\@tempdima:\csname sls@#1@linelength\endcsname}%
        }{%
          \Ifstr{#1}{footabove}{%
            \KOMAExecuteOptions[.scrlayer-scrpage.sty]%
              {footsepline=\@tempdima:\csname sls@#1@linelength\endcsname}%
          }{%
            \KOMAExecuteOptions[.scrlayer-scrpage.sty]%
              {footbotline=\@tempdima:\csname sls@#1@linelength\endcsname}%
          }%
        }%
      }%
    }%
  }%
  \PackageWarning{scrlayer-scrpage}{%
    Command deprecated!\MessageBreak
    Usage of `\string\setheadtopline',
    `\string\setheadsepline',\MessageBreak
    `\string\setfootsepline', and `\string\setfootbotline'\MessageBreak
    became deprecated with scrlayer-scrpage.\MessageBreak
    You should use KOMA-Script options\MessageBreak
    `headsepline', `headtopline', `footsepline',\MessageBreak
    or `footbotline' with values\MessageBreak
    `<line thickness>:<line length>' to setup\MessageBreak
    the line length and thickness, and\MessageBreak
    `\string\setkomafont' or `\string\addtokomafont' to\MessageBreak
    setup the colour%
  }%
  \kernel@ifnextchar[%]
  {%
    \sls@@@@setline{#1}%
  }{%
  }%
}%
\newcommand*{\sls@@@@setline}{}
\def\sls@@@@setline#1[#2]{%
  \Ifstr{#1}{headabove}{\setkomafont{headtopline}{#2}}{%
    \Ifstr{#1}{headbelow}{\setkomafont{headsepline}{#2}}{%
      \Ifstr{#1}{footabove}{\setkomafont{footsepline}{#2}}{%
        \setkomafont{footbotline}{#2}%
      }%
    }%
  }%
}%
\@ifundefined{scr@fnt@headtopline}{%
  \newkomafont{headtopline}{}%
}{}
\@ifundefined{scr@fnt@headsepline}{%
  \newkomafont{headsepline}{}%
}{}
\@ifundefined{scr@fnt@footsepline}{%
  \newkomafont{footsepline}{}%
}{}
\@ifundefined{scr@fnt@footbotline}{%
  \newkomafont{footbotline}{}%
}{}
\AtBeginDocument{%
  \ifdim \headheight
         <\if@ps@singlespacing\f@baselineskip\else\baselineskip\fi\relax
    \PackageWarningNoLine{scrlayer-scrpage}{Very small head height
      detected!\MessageBreak
      Using scrlayer-scrpage the head height\MessageBreak
      should be at least \string\baselineskip, which is\MessageBreak
      \if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi\space
      currently.\MessageBreak
      But head height is currently
      \the\headheight\space only.\MessageBreak
      You may use\MessageBreak
      \@ifpackageloaded{geometry}{%
        geometry option
        `head=\if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi'%
      }{%
        \@ifpackageloaded{typearea}{%
          typearea option `headheight=%
          \if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi'%
        }{%
          \string\setlength{\string\headheight}%
          {\if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi}%
        }%
      }\MessageBreak
      \if@ps@singlespacing\else\ifdim \headheight<\f@baselineskip\else
        or load package `scrlayer-scrpage' with\MessageBreak
        option `singlespacing=true'\MessageBreak
      \fi\fi
      to avoid this warning%
    }%
  \else
    \ifdim \footheight
           <\if@ps@singlespacing\f@baselineskip\else\baselineskip\fi\relax
      \PackageWarningNoLine{scrlayer-scrpage}{Very small foot height
        detected!\MessageBreak
        Using scrlayer-scrpage the foot height\MessageBreak
        should be at least \string\baselineskip, which is\MessageBreak
        \if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi\space
        currently.\MessageBreak
        But foot height is currently
        \the\footheight\space only.\MessageBreak
        You may use\MessageBreak
        \@ifpackageloaded{typearea}{%
          typearea option `footheight=%
          \if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi'%
        }{%
          \string\setlength{\string\footheight}%
          {\if@ps@singlespacing\f@baselineskip\else\the\baselineskip\fi}%
        }%
        \MessageBreak
        \if@ps@singlespacing\else\ifdim \footheight<\f@baselineskip\else
          or load package `scrlayer-scrpage' with\MessageBreak
          option `singlespacing=true'\MessageBreak
        \fi\fi
        to avoid this warning%
      }%
    \fi
  \fi
}
\@ifundefined{LaTeXcentering}{\let\LaTeXcentering\centering}{}
\@ifundefined{LaTeXraggedleft}{\let\LaTeXraggedleft\raggedleft}{}
\@ifundefined{LaTeXraggedright}{\let\LaTeXraggedright\raggedright}{}
\newcommand*{\defpagestyle}[3]{%
  \sls@defhead{#1}#2\@empty\@empty\@empty
  \sls@deffoot{#1}#3\@empty\@empty\@empty
  \DeclarePageStyleByLayers{#1}{%
    #1.head.odd,#1.head.even,#1.head.oneside,%
    #1.head.above.line,#1.head.below.line,%
    #1.foot.odd,#1.foot.even,#1.foot.oneside,%
    #1.foot.above.line,#1.foot.below.line%
  }%
}%
\newcommand*\sls@defhead[1]{%
  \kernel@ifnextchar(%)
  {\sls@@defhead{#1}}%
  {\sls@@defhead{#1}(\sls@headabove@linelength,\sls@headabove@linethickness)}%
}%
\newcommand*{\sls@@defhead}{}
\def\sls@@defhead#1(#2,#3)#4#5#6{%
  \kernel@ifnextchar(%)
  {\sls@@@defhead{#1}({#2},{#3}){#4}{#5}{#6}}%
  {\sls@@@defhead{#1}%
                 ({#2},{#3})%
                 {#4}{#5}{#6}%
                 (\sls@headbelow@linelength,\sls@headbelow@linethickness)}%
}%
\newcommand*{\sls@@@defhead}{}
\def\sls@@@defhead#1(#2,#3)#4#5#6(#7,#8){%
  \DeclareLayer[%
    background,%
    hoffset=\sls@leftmargin{head},%
    voffset=\sls@topmargin+\dp\strutbox,%
    width=\sls@headwidth,%
    height=0pt,%
    align=bl,%
    contents={%
      {\normalfont\usekomafont{pageheadfoot}{\usekomafont{pagehead}{%
            \sls@hf@rule{headtop}{#2}{#3}}}}%
    }%
  ]{#1.head.above.line}%
  \DeclareLayer[%
    background,%
    hoffset=\sls@leftmargin{head},%
    voffset=\sls@topmargin+\headheight-\ht\strutbox+#8,%
    width=\sls@headwidth,%
    height=0pt,%
    align=tl,%
    contents={%
      {\normalfont\usekomafont{pageheadfoot}{\usekomafont{pagehead}{%
            \sls@hf@rule{headsep}{#7}{#8}}}}%
    }%
  ]{#1.head.below.line}%
  \DeclareLayer[%
    background,evenpage,twoside,%
    head,%
    hoffset=\sls@leftmargin{head},%
    width=\sls@headwidth,%
    contents={%
      \sls@secure@box\headheight{%
        \normalfont{\usekomafont{pageheadfoot}{\usekomafont{pagehead}{#4}}}}}%
  ]{#1.head.even}%
  \DeclareLayer[%
    background,oddpage,twoside,%
    head,%
    hoffset=\sls@leftmargin{head},%
    width=\sls@headwidth,%
    contents={%
      \sls@secure@box\headheight{%
        \normalfont{\usekomafont{pageheadfoot}{\usekomafont{pagehead}{#5}}}}}%
  ]{#1.head.odd}%
  \DeclareLayer[%
    background,oddpage,oneside,%
    head,%
    hoffset=\sls@leftmargin{head},%
    width=\sls@headwidth,%
    contents={%
      \sls@secure@box\headheight{%
        \normalfont{\usekomafont{pageheadfoot}{\usekomafont{pagehead}{#6}}}}}%
  ]{#1.head.oneside}%
}%
\newcommand*\sls@deffoot[1]{%
  \kernel@ifnextchar(%)
  {\sls@@deffoot{#1}}%
  {\sls@@deffoot{#1}(\sls@footabove@linelength,\sls@footabove@linethickness)}%
}%
\newcommand*{\sls@@deffoot}{}
\def\sls@@deffoot#1(#2,#3)#4#5#6{%
  \kernel@ifnextchar(%)
  {\sls@@@deffoot{#1}({#2},{#3}){#4}{#5}{#6}}%
  {\sls@@@deffoot{#1}%
                 ({#2},{#3})%
                 {#4}{#5}{#6}%
                 (\sls@footbelow@linelength,\sls@footbelow@linethickness)}%
}%
\newcommand*{\sls@@@deffoot}{}
\def\sls@@@deffoot#1(#2,#3)#4#5#6(#7,#8){%
  \DeclareLayer[%
    foreground,%
    hoffset=\sls@leftmargin{foot},%
    voffset=\sls@topmargin
            +\headheight+\headsep
            +\textheight
            +\footskip-\footheight
            +2\dp\strutbox,%
    width=\sls@footwidth,%
    height=0pt,%
    align=bl,%
    contents={%
      {\normalfont\usekomafont{pageheadfoot}{\usekomafont{pagefoot}{%
            \sls@hf@rule{footsep}{#2}{#3}}}}%
    }%
  ]{#1.foot.above.line}%
  \DeclareLayer[%
    foreground,%
    hoffset=\sls@leftmargin{foot},%
    voffset=\sls@topmargin
            +\headheight+\headsep
            +\textheight
            +\footskip
            +2\dp\strutbox
            +#8,%
    width=\sls@footwidth,%
    height=0pt,%
    align=bl,%
    contents={%
      {\normalfont\usekomafont{pageheadfoot}{\usekomafont{pagefoot}{%
            \sls@hf@rule{footbot}{#7}{#8}}}}%
    }%
  ]{#1.foot.below.line}%
  \DeclareLayer[%
    foreground,evenpage,twoside,%
    foot,%
    hoffset=\sls@leftmargin{foot},%
    width=\sls@footwidth,%
    contents={%
      \sls@secure@box\footheight{%
        \normalfont\usekomafont{pageheadfoot}{\usekomafont{pagefoot}{#4}}}}%
  ]{#1.foot.even}%
  \DeclareLayer[%
    foreground,oddpage,twoside,%
    foot,%
    hoffset=\sls@leftmargin{foot},%
    width=\sls@footwidth,%
    contents={%
      \sls@secure@box\footheight{%
        \normalfont\usekomafont{pageheadfoot}{\usekomafont{pagefoot}{#5}}}}%
  ]{#1.foot.odd}%
  \DeclareLayer[%
    foreground,oddpage,oneside,%
    foot,%
    hoffset=\sls@leftmargin{foot},%
    width=\sls@footwidth,%
    contents={%
      \sls@secure@box\footheight{%
        \normalfont\usekomafont{pageheadfoot}{\usekomafont{pagefoot}{#6}}}}%
  ]{#1.foot.oneside}%
}%
\newcommand*{\sls@secure@box}[2]{%
  \begingroup
    \setbox\z@\vbox{%
      \ifsls@leavevmode\leavevmode\expandafter\ignorespaces\fi
      #2%
    }%
    \ifdim #1<\dimexpr \ht\z@+\dp\z@\relax
      \PackageWarning{scrlayer-scrpage}{%
        \string#1 to low.\MessageBreak
        At least \the\dimexpr \ht\z@+\dp\z@\relax\space needed,\MessageBreak
        but only \the#1 found.\MessageBreak
        \ifsls@autoenlarge
          I'll enlarge \string#1, for further\MessageBreak
          processing, but you should do this yourself,\MessageBreak
        \else
          You should enlarge \string#1,\MessageBreak
        \fi
        e.g.,
        \scr@ifundefinedorrelax{geometry}{%
          \scr@ifundefinedorrelax{typearea}{%
            using\MessageBreak
            \space\space\string\setlength{\string#1}{%
              \the\dimexpr \ht\z@+\dp\z@\relax}\MessageBreak
            in your preamble%
          }{%
            setting typearea's option\MessageBreak
            `\expandafter\@gobble\string#1=\the\dimexpr \ht\z@+\dp\z@\relax'%
          }%
        }{%
          \ifx #1\headheight
            setting geometry's option\MessageBreak
            `head=\the\dimexpr \ht\z@+\dp\z@\relax'%
          \else
            using\MessageBreak
            \space\space\string\setlength{\string#1}{%
              \the\dimexpr \ht\z@+\dp\z@\relax}\MessageBreak
            in your preamble%
          \fi
        }%
        \ifsls@autoenlarge
          .\MessageBreak
          I'll also
          \ifx #1\headheight decrease \string\topmargin
          \else increase \string\footskip\fi
        \fi
      }%
      \ifsls@autoenlarge
        \@tempdima\dimexpr \ht\z@+\dp\z@\relax
        \ifx #1\headheight
          \global\advance\topmargin by \dimexpr #1-(\ht\z@+\dp\z@)\relax
          \dp\z@\dimexpr \dp\z@+\ht\z@+\dp\z@-\headheight\relax
        \else
          \global\advance\footskip by \dimexpr \ht\z@+\dp\z@-#1\relax
        \fi
        \global#1\@tempdima
      \fi
    \fi
    \usebox\z@
  \endgroup
}%
\@ifundefined{scr@fnt@pagehead}{%
  \scr@ifundefinedorrelax{scr@fnt@instead@pagehead}{}{%
    \PackageInfo{scrlayer-scrpage}{%
      Makeing stand-alone element `pagehead' from\MessageBreak
      alias to `pageheadfoot'%
    }%
    \let\scr@fnt@instead@pagehead\relax
  }%
  \@ifundefined{@pageheadfont}{%
    \newcommand*{\@pageheadfont}{}%
  }{}%
  \newcommand*{\scr@fnt@pagehead}{\@pageheadfont}%
}{}
\@ifundefined{scr@fnt@pageheadfoot}{%
  \newcommand*{\scr@fnt@pageheadfoot}{\headfont}%
  \@ifundefined{headfont}{%
    \newcommand*{\headfont}{\normalcolor\slshape}%
  }{}
}{}
\scr@ifundefinedorrelax{scr@fnt@wrn@pagehead}{}{%
  \PackageInfo{scrlayer-scrpage}{%
    deactivating warning for font element\MessageBreak
    `pagehead'}%
  \let\scr@fnt@wrn@pagehead\relax
}
\@ifundefined{scr@fnt@pagefoot}{%
  \def\scr@fnt@pagefoot{\footfont}%
  \@ifundefined{footfont}{%
    \newcommand*{\footfont}{}%
  }{}%
}{}
\scr@ifundefinedorrelax{scr@fnt@wrn@pagefoot}{}{%
  \PackageInfo{scrlayer-scrpage}{%
    deactivating warning for font element\MessageBreak
    `pagefoot'}%
  \let\scr@fnt@wrn@pagefoot\relax
}
\newcommand*\sls@hf@rule[3]{%
  \begingroup
    \normalfont\usekomafont{#1line}{%
      \vbox to \z@{%
        \kern -\dimexpr #3\relax
        \ifnum \sls@hfline@adjust>\z@ \@tempswatrue \else \@tempswafalse\fi
        \if@twoside\ifodd\value{page}\else
          \ifnum \sls@hfline@adjust<\tw@ \@tempswatrue\else \@tempswafalse\fi
        \fi\fi
        \if@tempswa
          \hskip \z@\@plus 1fill\@minus \paperwidth
        \fi
        \vrule \@width\dimexpr #2\relax \@height\dimexpr #3\relax \@depth\z@
        \ifnum \sls@hfline@adjust<\tw@ \@tempswatrue\else \@tempswafalse\fi
        \if@twoside\ifodd\value{page}\else
          \ifnum \sls@hfline@adjust>\z@ \@tempswatrue \else \@tempswafalse\fi
        \fi\fi
        \if@tempswa
          \hskip \z@\@plus 1fill\@minus \paperwidth\null
        \fi
      }%
    }%
  \endgroup
}%
\newcommand*{\sls@topmargin}{\dimexpr\topmargin+1in\relax}%
\newcommand*{\sls@leftmargin}[1]{%
  \dimexpr
  \if@twoside
    \ifodd\value{page}
      \oddsidemargin+\csname sls@odd#1shift\endcsname
    \else
      \evensidemargin+\csname sls@even#1shift\endcsname
    \fi
  \else
    \oddsidemargin+\csname sls@odd#1shift\endcsname
  \fi
  +1in\relax
}%
\@ifpackageloaded{titlesec}{%
  \@ifundefined{newpagestyle}{}{%
    \@ifpackageloaded{titleps}{}{%
      \PackageWarningNoLine{scrlayer-scrpage}{%
        it seems that package `titlesec' is used\MessageBreak
        and has already defined `\string\newpagestyle'.\MessageBreak
        To avoid this warning message, you should\MessageBreak
        load package `titlesec' not before package\MessageBreak
        `scrlayer-scrpage'. If you need `titlesec'\MessageBreak
        you could load it after `scrlayer-scrpage',\MessageBreak
        but you still would not be able to use\MessageBreak
        the `titlesec' implemenation of\MessageBreak
        `\string\newpagestyle'%
      }%
      \let\newpagestyle\relax
    }%
  }%
}{}
\newcommand*\newpagestyle[3]{%
  \@ifundefined{ps@#1}{\defpagestyle{#1}{#2}{#3}}{%
    \PackageError{scrlayer-scrpage}{Page style `#1' already defined}{%
      Only not yet defined page style may be defined using
      \string\newpagestyle.\MessageBreak
      You may use either \string\renewpagestyle, \string\providepagestyle,
      or \string\defpagestyle\MessageBreak
      with already defined page styles.\MessageBreak
      If you'll continue, your command will be ignored.%
    }%
  }%
}%
\@ifpackageloaded{titlesec}{%
  \@ifundefined{renewpagestyle}{}{%
    \@ifpackageloaded{titleps}{}{%
      \PackageWarningNoLine{scrlayer-scrpage}{%
        It seems that package `titlesec' is used\MessageBreak
        and has already defined `\string\renewpagestyle'.\MessageBreak
        To avoid this warning message, you should\MessageBreak
        load package `titlesec' not before package\MessageBreak
        `scrlayer-scrpage'. If you need `titlesec'\MessageBreak
        you could load it after `scrlayer-scrpage',\MessageBreak
        but you still would not be able to use\MessageBreak
        the `titlesec' implemenation of\MessageBreak
        `\string\renewpagestyle'%
      }%
      \let\renewpagestyle\relax
    }%
  }%
}{}
\newcommand*\renewpagestyle[3]{%
  \@ifundefined{ps@#1}{%
    \PackageError{scrlayer-scrpage}{Undefined page style `#1'}{%
      Only already defined page style may be re-defined using
      \string\renewpagestyle.\MessageBreak
      You may use either \string\newpagestyle, \string\providepagestyle,
      or \string\defpagestyle\MessageBreak
      with not yet defined page styles.\MessageBreak
      If you'll continue, your command will be ignored.%
    }%
  }{%
    \defpagestyle{#1}{#2}{#3}%
  }%
}%
\newcommand*\providepagestyle[3]{%
  \@ifundefined{ps@#1}{%
    \defpagestyle{#1}{#2}{#3}%
  }{%
    \PackageInfo{scrlayer-scrpage}{%
      page style `#1' already defined.\MessageBreak
      New definition ignored%
    }%
  }%
}
\newcommand*{\deftriplepagestyle}[1]{%
  \let\@tempa\defpagestyle
  \scrlayer@triplestyle{#1}%
}%
\newcommand*{\newtriplepagestyle}[1]{%
  \let\@tempa\newpagestyle
  \scrlayer@triplestyle{#1}%
}%
\newcommand*{\renewtriplepagestyle}[1]{%
  \let\@tempa\renewpagestyle
  \scrlayer@triplestyle{#1}%
}%
\newcommand*{\providetriplepagestyle}[1]{%
  \let\@tempa\providepagestyle
  \scrlayer@triplestyle{#1}%
}%
\newcommand*{\scrlayer@triplestyle}[1]{%
  \kernel@ifnextchar[%]
  {\scrlayer@@triplestyle{#1}}%
  {\scrlayer@@triplestyle{#1}[\z@]}%
}
\newcommand*{\scrlayer@@triplestyle}{}
\def\scrlayer@@triplestyle#1[#2]{%
 \kernel@ifnextchar[%]
  {\scrlayer@@@triplestyle{#1}[#2]}%
  {\scrlayer@@@triplestyle{#1}[\z@][#2]}%
}%
\newcommand*{\scrlayer@@@triplestyle}{}
\def\scrlayer@@@triplestyle#1[#2][#3]#4#5#6#7#8#9{%
  \@tempa{#1}{%
    (\sls@headwidth,#2)%
    {%
      \makebox[\z@][l]{#6}\hfill
      \makebox[\z@][c]{#5}\hfill
      \makebox[\z@][r]{#4}%
    }{%
      \makebox[\z@][l]{#4}\hfill
      \makebox[\z@][c]{#5}\hfill
      \makebox[\z@][r]{#6}%
    }{%
      \makebox[\z@][l]{#4}\hfill
      \makebox[\z@][c]{#5}\hfill
      \makebox[\z@][r]{#6}%
    }%
    (\sls@headwidth,#3)%
  }{%
    (\sls@footwidth,#3)%
    {%
      \makebox[\z@][l]{#9}\hfill
      \makebox[\z@][c]{#8}\hfill
      \makebox[\z@][r]{#7}%
    }{%
      \makebox[\z@][l]{#7}\hfill
      \makebox[\z@][c]{#8}\hfill
      \makebox[\z@][r]{#9}%
    }{%
      \makebox[\z@][l]{#7}\hfill
      \makebox[\z@][c]{#8}\hfill
      \makebox[\z@][r]{#9}%
    }%
    (\sls@footwidth,#2)%
  }%
}%
\newcommand*{\deftripstyle}{%
  \PackageWarning{scrlayer-scrpage}{%
    Command \string\deftripstyle\space is deprecate.\MessageBreak
    You should replace it by \string\deftriplepagestyle,\MessageBreak
    e.g.,%
  }%
  \let\deftripstyle\deftriplepagestyle
  \deftripstyle
}%
\newcommand*{\defpairofpagestyles}[3][]{%
  \def\reserved@a##1##2##3##4##5##6##7\@nil{##1##2##3##4##5##6}%
  \edef\reserved@a{\expandafter\reserved@a #2xxxxxx\@nil}%
  \Ifstr\reserved@a{plain.}{%
    \PackageError{scrlayer-scrpage}{plain page style `#2' not allowed}{%
      You may not define a plain page style using
      \string\defpairofpagestyles, \string\newpairofpagestyles,
      \string\renewpairofpagestyles, or\MessageBreak
      \string\providepairofpagestyles.  I'd suggest to simply define the
      corresponding\MessageBreak
      non-plain page style to also define the plain one.\MessageBreak
      If you'll continue, your command will be ignored.}%
  }{%
    \sls@init@pair@page@style*{#2}%
    \sls@init@pair@page@style*{plain.#2}%
    \ifx\relax #1\relax\else
      \scr@ifundefinedorrelax{sls@ps@#1@even@left@head}{%
        \PackageError{scrlayer-scrpage}{`#1' not a pair page style}{%
          Only pair page styles may be used to initialise new pairs of page
          styles. So\MessageBreak
          optional argument of \string\defpairofpagestyles,
          \string\newpairofpagestyles,\MessageBreak
          \string\renewpairofpagestyles, or \string\providepairofpagestyle has
          to be a pair\MessageBreak
          page style or should be unused.\MessageBreak
          If you'll continue, the initialisation will be ignored.}%
      }{%
        \sls@init@pair@page@style{#2}{#1}%
        \scr@ifundefinedorrelax{sls@ps@plain.#1@even@left@head}{%
          \sls@init@pair@page@style{plain.#2}{#1}%
        }{%
          \sls@init@pair@page@style{plain.#2}{plain.#1}%
        }%
      }%
    \fi
    \sls@def@pair@page@style@member{#2}%
    \AddToLayerPageStyleOptions{#2}{%
      onselect={%
        \DeclarePageStyleAlias{plain}{plain.#2}%
        \DeclarePageStyleAlias{headings}{#2}%
        \def\sls@currentheadings{#2}%
        \def\sls@currentplain{plain.#2}%
        #3%
      }%
    }%
    \sls@def@pair@page@style@member{plain.#2}%
    \AddToLayerPageStyleOptions{plain.#2}{%
      onselect={%
        \DeclarePageStyleAlias{plain}{plain.#2}%
        \DeclarePageStyleAlias{headings}{#2}%
        \def\sls@currentheadings{#2}%
        \def\sls@currentplain{plain.#2}%
        #3%
      },%
      oninit={%
        \expandafter
        \ifx\csname ifsls@plain@head@above@line\expandafter\endcsname
          \csname iftrue\endcsname\else
          \let\sls@headabove@linelength\z@
          \let\sls@headabove@linethickness\z@
        \fi
        \expandafter
        \ifx\csname ifsls@plain@head@below@line\expandafter\endcsname
            \csname iftrue\endcsname\else
          \let\sls@headbelow@linelength\z@
          \let\sls@headbelow@linethickness\z@
        \fi
        \expandafter
        \ifx\csname ifsls@plain@foot@above@line\expandafter\endcsname
            \csname iftrue\endcsname\else
          \let\sls@footabove@linelength\z@
          \let\sls@footabove@linethickness\z@
        \fi
        \expandafter
        \ifx\csname ifsls@plain@foot@below@line\expandafter\endcsname
            \csname iftrue\endcsname\else
          \let\sls@footbelow@linelength\z@
          \let\sls@footbelow@linethickness\z@
        \fi
      }%
    }%
  }%
}%
\newcommand*\sls@currentheadings{scrheadings}%
\newcommand*\sls@currentplain{plain.scrheadings}%
\newcommand*{\sls@init@pair@page@style}{%
  \kernel@ifstar {%
    \kernel@ifstar {%
      \sls@let@pair@page@style\relax
    }{%
      \sls@let@pair@page@style\@empty
    }
  }{%
    \sls@init@@pair@page@style
  }%
}%
\newcommand*{\sls@init@@pair@page@style}[2]{%
  \expandafter\let\csname sls@ps@#1@even@left@head\expandafter\endcsname
  \csname sls@ps@#2@even@left@head\endcsname
  \expandafter\let\csname sls@ps@#1@even@middle@head\expandafter\endcsname
  \csname sls@ps@#2@even@middle@head\endcsname
  \expandafter\let\csname sls@ps@#1@even@right@head\expandafter\endcsname
  \csname sls@ps@#2@even@right@head\endcsname
  \expandafter\let\csname sls@ps@#1@odd@left@head\expandafter\endcsname
  \csname sls@ps@#2@odd@left@head\endcsname
  \expandafter\let\csname sls@ps@#1@odd@middle@head\expandafter\endcsname
  \csname sls@ps@#2@odd@middle@head\endcsname
  \expandafter\let\csname sls@ps@#1@odd@right@head\expandafter\endcsname
  \csname sls@ps@#2@odd@right@head\endcsname
  \expandafter\let\csname sls@ps@#1@even@left@foot\expandafter\endcsname
  \csname sls@ps@#2@even@left@foot\endcsname
  \expandafter\let\csname sls@ps@#1@even@middle@foot\expandafter\endcsname
  \csname sls@ps@#2@even@middle@foot\endcsname
  \expandafter\let\csname sls@ps@#1@even@right@foot\expandafter\endcsname
  \csname sls@ps@#2@even@right@foot\endcsname
  \expandafter\let\csname sls@ps@#1@odd@left@foot\expandafter\endcsname
  \csname sls@ps@#2@odd@left@foot\endcsname
  \expandafter\let\csname sls@ps@#1@odd@middle@foot\expandafter\endcsname
  \csname sls@ps@#2@odd@middle@foot\endcsname
  \expandafter\let\csname sls@ps@#1@odd@right@foot\expandafter\endcsname
  \csname sls@ps@#2@odd@right@foot\endcsname
}%
\newcommand*{\sls@let@pair@page@style}[2]{%
  \expandafter\let\csname sls@ps@#2@even@left@head\endcsname #1%
  \expandafter\let\csname sls@ps@#2@even@middle@head\endcsname #1%
  \expandafter\let\csname sls@ps@#2@even@right@head\endcsname #1%
  \expandafter\let\csname sls@ps@#2@odd@left@head\endcsname #1%
  \expandafter\let\csname sls@ps@#2@odd@middle@head\endcsname #1%
  \expandafter\let\csname sls@ps@#2@odd@right@head\endcsname #1%
  \expandafter\let\csname sls@ps@#2@even@left@foot\endcsname #1%
  \expandafter\let\csname sls@ps@#2@even@middle@foot\endcsname #1%
  \expandafter\let\csname sls@ps@#2@even@right@foot\endcsname #1%
  \expandafter\let\csname sls@ps@#2@odd@left@foot\endcsname #1%
  \expandafter\let\csname sls@ps@#2@odd@middle@foot\endcsname #1%
  \expandafter\let\csname sls@ps@#2@odd@right@foot\endcsname #1%
}%
\newcommand*{\sls@def@pair@page@style@member}[1]{%
  \defpagestyle{#1}{%
    {%
      \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@headwidth}{\LaTeXraggedright
          \strut\@nameuse{sls@ps@#1@even@left@head}\strut}}%
      \parbox{\sls@headwidth}{\LaTeXcentering
        \strut\@nameuse{sls@ps@#1@even@middle@head}\strut}%
      \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@headwidth}{\LaTeXraggedleft
          \strut\@nameuse{sls@ps@#1@even@right@head}\strut}}%
    }{%
      \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@headwidth}{\LaTeXraggedright
          \strut\@nameuse{sls@ps@#1@odd@left@head}\strut}}%
      \parbox{\sls@headwidth}{\LaTeXcentering
        \strut\@nameuse{sls@ps@#1@odd@middle@head}\strut}%
      \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@headwidth}{\LaTeXraggedleft
          \strut\@nameuse{sls@ps@#1@odd@right@head}\strut}}%
    }{%
      \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@headwidth}{\LaTeXraggedright
          \strut\@nameuse{sls@ps@#1@odd@left@head}\strut}}%
      \parbox{\sls@headwidth}{\LaTeXcentering
        \strut\@nameuse{sls@ps@#1@odd@middle@head}\strut}%
      \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@headwidth}{\LaTeXraggedleft
          \strut\@nameuse{sls@ps@#1@odd@right@head}\strut}}%
    }%
  }{%
    {%
      \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@footwidth}{\LaTeXraggedright
          \strut\@nameuse{sls@ps@#1@even@left@foot}\strut}}%
      \parbox{\sls@footwidth}{\LaTeXcentering
        \strut\@nameuse{sls@ps@#1@even@middle@foot}\strut}%
      \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@footwidth}{\LaTeXraggedleft
          \strut\@nameuse{sls@ps@#1@even@right@foot}\strut}}%
    }{%
      \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@footwidth}{\LaTeXraggedright
          \strut\@nameuse{sls@ps@#1@odd@left@foot}\strut}}%
      \parbox{\sls@footwidth}{\LaTeXcentering
        \strut\@nameuse{sls@ps@#1@odd@middle@foot}\strut}%
      \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@footwidth}{\LaTeXraggedleft
          \strut\@nameuse{sls@ps@#1@odd@right@foot}\strut}}%
    }{%
      \makebox[0pt][\IfRTL{r}{l}]{\parbox{\sls@footwidth}{\LaTeXraggedright
          \strut\@nameuse{sls@ps@#1@odd@left@foot}\strut}}%
      \parbox{\sls@footwidth}{\LaTeXcentering
        \strut\@nameuse{sls@ps@#1@odd@middle@foot}\strut}%
      \makebox[0pt][\IfRTL{l}{r}]{\parbox{\sls@footwidth}{\LaTeXraggedleft
          \strut\@nameuse{sls@ps@#1@odd@right@foot}\strut}}%
    }%
  }%
}%
\newcommand*{\newpairofpagestyles}[3][]{%
  \scr@ifundefinedorrelax{ps@#2}{%
    \@ifundefined{ps@plain.#2}{\defpairofpagestyles[#1]{#2}{#3}}{%
      \PackageError{scrlayer-scrpage}{%
        Plain page style of `#2' already defined}{%
        You may only define a new pair of page styles, if neither the style
        itself\MessageBreak
        nor it's plain page style has already been defined.\MessageBreak
        You may use only \string\defpairofpagestyles\space or
        \string\providepairofpagestyles\space with partly\MessageBreak
        already defined page styles.\MessageBreak
        If you'll continue, your command will be ignored.%
      }%
    }%
  }{%
    \PackageError{scrlayer-scrpage}{%
      Page style `#2' already defined}{%
      You may only define a new pair of page styles, if neither the style
      itself\MessageBreak
      nor it's plain page style has already been defined.\MessageBreak
      You may use either \string\renewpairsofpagestyles,
      \string\defpairofpagestyles, or\MessageBreak
      \string\providepairofpagestyles\space with already defined page
      styles.\MessageBreak
      If you'll continue, your command will be ignored.%
    }%
  }%
}%
\newcommand*{\renewpairofpagestyles}[3][]{%
  \scr@ifundefinedorrelax{ps@#2}{%
    \PackageError{scrlayer-scrpage}{%
      Undefined page style `#2'}{%
      You may only redefine existing pairs of page styles. You may use
      either\MessageBreak
      \string\newpairsofpagestyles, \string\defpairofpagestyles, or
      \string\providepairofpagestyles\MessageBreak
      with not yet defined page styles.\MessageBreak
      If you'll continue, your command will be ignored.%
    }%
  }{%
    \@ifundefined{ps@plain.#2}{%
      \PackageError{scrlayer-scrpage}{%
        Undefined plain page style of `#2'}{%
        You may only redefine existing pairs of page styles. You may use
        either\MessageBreak
        \string\defpairofpagestyles\space or
        \string\providepairofpagestyles\space with partly already
        defined\MessageBreak
        page styles.\MessageBreak
        If you'll continue, your command will be ignored.%
      }%
    }{\defpairofpagestyles[#1]{#2}{#3}}%
  }%
}%
\newcommand*{\providepairofpagestyles}[3][]{%
  \scr@ifundefinedorrelax{ps@#2}{%
    \@ifundefined{ps@plain.#2}{\defpairofpagestyles[#1]{#2}{#3}}{%
      \PackageInfo{scrlayer-scrpage}{%
        Plain page style of `#2' already\MessageBreak
        defined. Definition ignored}%
    }%
  }{%
    \PackageInfo{scrlayer-scrpage}{%
      Page style of `#2' already defined.\MessageBreak
      Definition ignored}%
  }%
}%
\newpairofpagestyles{scrheadings}{}%
\DeclarePageStyleAlias{scrplain}{plain.scrheadings}
\newcommand*{\ihead}{\kernel@ifstar {\@dblarg\@@@ihead}{\@ihead}}%
\newcommand*{\@ihead}{\kernel@ifnextchar[{\@@@ihead}{\@@ihead}}%
\newcommand{\@@ihead}[1]{\rehead{#1}\lohead{#1}}%
\newcommand{\@@@ihead}[2][]{\rehead[{#1}]{#2}\lohead[{#1}]{#2}}%
\newcommand*{\ohead}{\kernel@ifstar {\@dblarg\@@@ohead}{\@ohead}}%
\newcommand*{\@ohead}{\kernel@ifnextchar[{\@@@ohead}{\@@ohead}}%
\newcommand{\@@ohead}[1]{\lehead{#1}\rohead{#1}}%
\newcommand{\@@@ohead}[2][]{\lehead[{#1}]{#2}\rohead[{#1}]{#2}}%
\newcommand*{\chead}{\kernel@ifstar {\@dblarg\@@@chead}{\@chead}}%
\newcommand*{\@chead}{\kernel@ifnextchar[{\@@@chead}{\@@chead}}%
\newcommand{\@@chead}[1]{\cehead{#1}\cohead{#1}}%
\newcommand{\@@@chead}[2][]{\cehead[{#1}]{#2}\cohead[{#1}]{#2}}%
\newcommand*{\lehead}{\sls@renewelement{even}{left}{head}}%
\newcommand*{\lohead}{\sls@renewelement{odd}{left}{head}}%
\newcommand*{\rehead}{\sls@renewelement{even}{right}{head}}%
\newcommand*{\rohead}{\sls@renewelement{odd}{right}{head}}%
\newcommand*{\cehead}{\sls@renewelement{even}{middle}{head}}%
\newcommand*{\cohead}{\sls@renewelement{odd}{middle}{head}}%
\newcommand*{\ifoot}{\kernel@ifstar {\@dblarg\@@@ifoot}{\@ifoot}}%
\newcommand*{\@ifoot}{\kernel@ifnextchar[{\@@@ifoot}{\@@ifoot}}%
\newcommand{\@@ifoot}[1]{\refoot{#1}\lofoot{#1}}%
\newcommand{\@@@ifoot}[2][]{\refoot[{#1}]{#2}\lofoot[{#1}]{#2}}%
\newcommand*{\ofoot}{\kernel@ifstar {\@dblarg\@@@ofoot}{\@ofoot}}%
\newcommand*{\@ofoot}{\kernel@ifnextchar[{\@@@ofoot}{\@@ofoot}}%
\newcommand{\@@ofoot}[1]{\lefoot{#1}\rofoot{#1}}%
\newcommand{\@@@ofoot}[2][]{\lefoot[{#1}]{#2}\rofoot[{#1}]{#2}}%
\newcommand*{\cfoot}{\kernel@ifstar {\@dblarg\@@@cfoot}{\@cfoot}}%
\newcommand*{\@cfoot}{\kernel@ifnextchar[{\@@@cfoot}{\@@cfoot}}%
\newcommand{\@@cfoot}[1]{\cefoot{#1}\cofoot{#1}}%
\newcommand{\@@@cfoot}[2][]{\cefoot[{#1}]{#2}\cofoot[{#1}]{#2}}%
\newcommand*{\lefoot}{\sls@renewelement{even}{left}{foot}}%
\newcommand*{\lofoot}{\sls@renewelement{odd}{left}{foot}}%
\newcommand*{\refoot}{\sls@renewelement{even}{right}{foot}}%
\newcommand*{\rofoot}{\sls@renewelement{odd}{right}{foot}}%
\newcommand*{\cefoot}{\sls@renewelement{even}{middle}{foot}}%
\newcommand*{\cofoot}{\sls@renewelement{odd}{middle}{foot}}%
\newcommand*{\sls@renewelement}[3]{%
  \kernel@ifstar{\@dblarg{\sls@@@@renewelement{#1}{#2}{#3}}}%
                {\sls@@renewelement{#1}{#2}{#3}}%
}%
\newcommand*{\sls@@renewelement}[3]{%
  \kernel@ifnextchar[%]
  {\sls@@@@renewelement{#1}{#2}{#3}}%
  {\sls@@@renewelement{#1}{#2}{#3}}%
}%
\newcommand{\sls@@@renewelement}[4]{%
  \scr@ifundefinedorrelax{sls@ps@\sls@currentheadings @#1@#2@#3}{%
    \@namedef{sls@ps@scrheadings@#1@#2@#3}{#4}%
  }{%
    \@namedef{sls@ps@\sls@currentheadings @#1@#2@#3}{#4}%
  }%
}%
\newcommand*{\sls@@@@renewelement}{}
\long\def\sls@@@@renewelement#1#2#3[#4]#5{%
  \sls@@renewplainelement{#1}{#2}{#3}{#4}%
  \sls@@@renewelement{#1}{#2}{#3}{#5}%
}%
\newcommand{\sls@@renewplainelement}[4]{%
  \scr@ifundefinedorrelax{sls@ps@\sls@currentplain @#1@#2@#3}{%
    \@namedef{sls@ps@plain.scrheadings@#1@#2@#3}{#4}%
  }{%
    \@namedef{sls@ps@\sls@currentplain @#1@#2@#3}{#4}%
  }%
}%
\newcommand*{\clearmainofpairofpagestyles}{%
  \ihead{}\chead{}\ohead{}\ifoot{}\cfoot{}\ofoot{}%
}%
\newcommand*{\clearscrheadings}{%
  \PackageWarning{scrlayer-scrpage}{%
    replacing deprecated \string\clearscrheading\space by\MessageBreak
    \string\clearmainofpairofpagestyles
  }%
  \clearmainofpairofpagestyles
}
\newcommand*{\clearplainofpairofpagestyles}{%
  \sls@@renewplainelement{odd}{left}{head}{}%
  \sls@@renewplainelement{odd}{right}{head}{}%
  \sls@@renewplainelement{odd}{middle}{head}{}%
  \sls@@renewplainelement{even}{left}{head}{}%
  \sls@@renewplainelement{even}{right}{head}{}%
  \sls@@renewplainelement{even}{middle}{head}{}%
  \sls@@renewplainelement{odd}{left}{foot}{}%
  \sls@@renewplainelement{odd}{right}{foot}{}%
  \sls@@renewplainelement{odd}{middle}{foot}{}%
  \sls@@renewplainelement{even}{left}{foot}{}%
  \sls@@renewplainelement{even}{right}{foot}{}%
  \sls@@renewplainelement{even}{middle}{foot}{}%
}%
\newcommand*{\clearscrplain}{%
  \PackageWarning{scrlayer-scrpage}{%
    replacing deprecated \string\clearscrplain\space by\MessageBreak
    \string\clearplainofpairofpagestyles
  }%
  \clearplainofpairofpagestyles
}
\newcommand*{\clearpairofpagestyles}{%
  \ihead[]{}\chead[]{}\ohead[]{}\ifoot[]{}\cfoot[]{}\ofoot[]{}%
}%
\newcommand*{\clearscrheadfoot}{%
  \PackageWarning{scrlayer-scrpage}{%
    replacing deprecated \string\clearscrheadfoot\space by\MessageBreak
    \string\clearpairofpagestyles
  }%
  \clearpairofpagestyles
}
\newcommand*\ps@useheadings{%
  \PackageWarning{scrlayer-scrpage}{incompatible page style!\MessageBreak
    Page styles like `headings' and `plain'\MessageBreak
    are incompatible with the page styles\MessageBreak
    of scrlayer-scrpage. You shouldn't mix\MessageBreak
    them up. Therefore page style\MessageBreak
    `useheadings' is not longer provided.\MessageBreak
    Usage is deprecated and will be replaced\MessageBreak
    by `scrheadings'%
  }%
  \let\ps@useheadings\ps@scrheadings
  \ps@useheadings
}%
\expandafter\newcommand\expandafter*\csname ps@plain.useheadings\endcsname{%
  \@nameuse{ps@plain.scrheadings}%
}%
%%% From File: $Id: scrlogo.dtx 3527 2020-09-11 09:44:32Z kohm $
\@ifundefined{KOMAScript}{%
  \DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em%
      M\kern.05em A\kern.1em-\kern.1em Script}}}{}
\endinput
%%
%% End of file `scrlayer-scrpage.sty'.