% \CheckSum{2591}
% \iffalse^^A meta-comment
% ======================================================================
% scrlayer-scrpage.dtx
% Copyright (c) Markus Kohm, 2012-2018
%
% This file is part of the LaTeX2e KOMA-Script bundle.
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, version 1.3c of the license.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 and of this work.
%
% This work has the LPPL maintenance status "author-maintained".
%
% The Current Maintainer and author of this work is Markus Kohm.
%
% This work consists of all files listed in manifest.txt.
% ----------------------------------------------------------------------
% scrlayer-scrpage.dtx
% Copyright (c) Markus Kohm, 2012-2018
%
% Diese Datei ist Teil der LaTeX2e KOMA-Script-Sammlung.
%
% Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
% Version 1.3c.
% Die neuste Version dieser Lizenz ist
% http://www.latex-project.org/lppl.txt
% und Version 1.3c ist Teil aller Verteilungen von LaTeX
% Version 2005/12/01 und dieses Werks.
%
% Dieses Werk hat den LPPL-Verwaltungs-Status "author-maintained"
% (allein durch den Autor verwaltet).
%
% Der Aktuelle Verwalter und Autor dieses Werkes ist Markus Kohm.
%
% Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien.
% ======================================================================
% \fi^^A meta-comment
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
% \iffalse^^A meta-comment
%%% From File: $Id: scrlayer-scrpage.dtx 3017 2018-09-05 06:27:27Z kohm $
%%%% (run: identify)
%%%% (run: init)
%%%% (run: options)
%%%% (run: body)
%<*dtx>
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\begingroup
\def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
\filedate$Date: 2018-09-05 08:27:27 +0200 (Wed, 05 Sep 2018) $
\def\filerevision$#1: #2 ${\gdef\filerevision{r#2}}
\filerevision$Revision: 3017 $
\edef\reserved@a{%
\noexpand\endgroup
\noexpand\ProvidesFile{scrlayer-scrpage.dtx}%
[\filedate\space\filerevision\space
KOMA-Script package source
}%
\reserved@a
%
%<*identify>
%\NeedsTeXFormat{LaTeX2e}[1995/12/01]
%\ProvidesPackage{scrlayer-scrpage}[%
%!KOMAScriptVersion
% package
%
%<*dtx|identify>
(end user interface for scrlayer)]
%
%<*dtx>
\ifx\documentclass\undefined
\input scrdocstrip.tex
\@@input scrkernel-version.dtx
\@@input scrstrip.inc
\KOMAdefVariable{COPYRIGHTFROM}{2012}
\generate{\usepreamble\defaultpreamble
\file{scrlayer-scrpage.sty}{%
\from{scrlayer-scrpage.dtx}{interface,trace,scrpage,identify}%
\from{scrlayer.dtx}{interface,trace,scrpage,init}%
\from{scrlayer-scrpage.dtx}{interface,trace,scrpage,init}%
\from{scrlayer.dtx}{interface,trace,scrpage,options}%
\from{scrlayer-scrpage.dtx}{interface,trace,scrpage,options}%
\from{scrlayer.dtx}{interface,trace,scrpage,body}%
\from{scrlayer-scrpage.dtx}{interface,trace,scrpage,body}%
\from{scrlogo.dtx}{logo}%
}%
}
\@@input scrstrop.inc
\else
\let\endbatchfile\relax
\fi
\endbatchfile
\documentclass{scrdoc}
\addtolength{\textwidth}{-1em}
\addtolength{\marginparwidth}{2em}
\addtolength{\oddsidemargin}{2em}
\usepackage[ngerman,english]{babel}
\usepackage{url,babelbib}\bibliographystyle{babalpha-fl}
\usepackage{listings}
\usepackage{scrhack}
\usepackage{etoolbox}
\pretocmd\DescribeMacro{\ifhmode\else\bigskip\noindent\fi}{}{}
\pretocmd\DescribeEnv{\ifhmode\else\bigskip\noindent\fi}{}{}
\pretocmd\DescribeOption{\ifhmode\else\bigskip\noindent\fi}{}{}
\CodelineIndex
\RecordChanges
\GetFileInfo{scrlayer-scrpage.dtx}
\title{The \texttt{scrlayer} interface \texttt{scrlayer-scrpage}%
\footnote{This is version \fileversion\ of file \texttt{\filename}.}}
\date{\filedate}
\author{Markus Kohm}
\newenvironment{Explain}{\par}{\par}
\newcommand*{\length}{}
\let\length\Length
\let\endlength\endLength
\let\Macro\cs
\let\Length\Macro
\let\Package\textsf
\let\Class\Package
\let\File\texttt
\let\Option\texttt
\newcommand*{\KOption}[1]{\Option{#1}\texttt{=}}
\newcommand*{\OptionValue}[2]{\Option{#1}\texttt{=}\PValue{#2}}
\let\Counter\texttt
\let\Environment\texttt
\let\ShowOutput\quote
\let\endShowOutput\endquote
\let\Pagestyle\texttt
\newcommand*{\Parameter}[1]{\texttt{\marg{#1}}\linebreak[1]}
\newcommand*{\OParameter}[1]{\texttt{\oarg{#1}}\linebreak[1]}
\newcommand*{\MParameter}[2]{\texttt{(\meta{#1},\meta{#2})}\linebreak[1]}
\providecommand\PParameter[1]{\mbox{\texttt{\{#1\}}}\linebreak[1]}
\let\PName\meta
\let\PValue\texttt
\providecommand*{\autoref}[1]{\expandafter\AUTOREF#1:}
\providecommand*{\AUTOREF}{}
\makeatletter
\def\AUTOREF#1:#2:{%
\edef\@tempa{#1}%
\edef\@tempb{tab}\ifx\@tempa\@tempb table~\fi
\edef\@tempb{sec}\ifx\@tempa\@tempb section~\fi
\ref{#1:#2}%
}
\providecommand*{\IndexCmd}[2][]{}
\providecommand*{\textnote}[2][]{}
\providecommand*\eTeX{\leavevmode\hbox{$\varepsilon$}-\TeX}
\providecommand*\NTS{%
\leavevmode\hbox{$\cal N\kern-0.35em\lower0.5ex\hbox{$\cal T$}%
\kern-0.2emS$}}
\lstnewenvironment{lstcode}{\lstset{language=[LaTeX]TeX}}{}
\makeatother
\sloppy% YOU SHOULD NOT DO THIS!!!
\begin{document}
\maketitle
\tableofcontents
\DocInput{\filename}
\PrintChanges
\PrintIndex
\end{document}
% \fi^^A meta-comment
%
% \selectlanguage{english}
%
% \changes{v0.0}{2012/01/01}{start of interface}
% \let\restorechapter\chapter
% \let\chapter\section
% \let\section\subsection
% \let\subsection\subsubsection
%
%\iffalse
%
%\fi
%
% \StopEventually{}
%
% \chapter{Implementation of \Package{scrlayer-scrpage}}
% \label{sec:scrlayer-scrpage}
%
% This section if for developers only.
%
% \iffalse
%<*interface>
%<*identify>
% \fi
%
%\iffalse
%
%\fi
%
%
% \section{Initialising some Values before the Options}
%
% \iffalse^^A meta-comment
%<*init>
% \fi^^A meta-comment
%
% Initialisation before all options (even the options from
% \File{scrlayer.dtx}).
%
% Currently nothing.
%
% \iffalse^^A meta-comment
%
% \fi^^A meta-comment
%
% \section{Options}
%
% \iffalse^^A meta-comment
%<*options>
% \fi
%
% Package \Package{scrpage2} doesn't support \KOMAScript{} options but only
% regular \LaTeX{} package options. The interface will also support those
% options, but uses \KOMAScript{} options for the implementation. This
% results in additional features of the interface.
%
% Note, that some options are already defined before this by the common option
% parts of \File{scrlayer.dtx}. All others will follow step by step in the
% main part.
%
% Options \Option{headinclude}, \Option{headexclude}, \Option{footinclude} and
% \Option{footexclude} of package \Package{scrpage2} are deprecated since
% package version 2.3, 2008-12-08. They won't be supported by the
% \Package{scrlayer-scrpage} interface.
%
% Additional initialisation may be done here, but currently this isn't
% needed.
%
% \iffalse^^A meta-comment
%
% \fi^^A meta-comment
%
%
% \section{Width of Header and Footer}
%
% \Package{scrpage2} provides to set the width of the page head or footer
% different from the width of the text area of the page using
% \Macro{setheadwidth} and \Macro{setfootwidth}. Optionally those commands
% allow to setup an horizontal offset for the head or footer. This interface
% provides the same feature but also allows to set up the widths and offsets
% with \KOMAScript{} options. Those options will become the primary interface.
%
% \begin{option}{headwidth}
% \changes{v0.9.1757}{2014/04/09}{new: two offsets available}^^A
% \changes{v3.17}{2015/02/25}{new: store the values}^^A
% \begin{option}{footwidth}
% \changes{v0.9.1757}{2014/04/09}{new: two offsets available}^^A
% \changes{v3.15}{2014/12/28}{fix: missing colon in call of
% \cs{sls@split@at@iicolons}}^^A
% \changes{v3.17}{2015/02/25}{new: store the values}^^A
% \begin{description}
% \item[\texttt{=\meta{special dimensional expression}:\meta{special
% dimensional expression}}:] see \Macro{sls@settowidthof} for information
% about the syntax of \meta{special dimensional expression}. The width of
% the page head or footer will be set to the result of the first on, the
% offset to the result of the second one. If the first one\,---\,the
% width\,---\,is omitted, the current width will be used. If the second
% one\,---\,the offset\,---\,is omitted and the width is the width of the
% text area plus the margin note column, the offset will be set to
% zero. If the second one is omitted and the width is not the width of the
% text area plus the margin note column, a special kind of centering will
% be used.
% \end{description}
% These options may be used to set up the widths of head and foot.
% \begin{macrocode}
%<*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
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@headwidth}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@headwidth@default}
\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
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@footwidth}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@footwidth@default}
% \end{macrocode}
% \begin{macro}{\sls@split@at@iicolons}
% \begin{description}
% \item[\texttt{\meta{balanced}:^^A
% \meta{balanced}:^^A
% \meta{balanced}\Macro{@nil}}:] first \meta{balanced} will be stored into
% \Macro{reserved@a}, second into \Macro{reserved@b}, third will be eaten
% and warn about if it is neither empty and nor a colon.
% \end{description}
% This little helper is used, e.g., by options \Option{headwidth} and
% \Option{footwidth}.
% \begin{macrocode}
\scrlayerAddToInterface\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}%
}%
}
% \end{macrocode}
% \end{macro}^^A \sls@split@at@iicolons
% \begin{macro}{\sls@set@hf@width}
% \changes{v0.9.1757}{2014/04/09}{new: two offsets available}
% \begin{description}
% \item[\Parameter{head} or \Parameter{foot}:] to complete the macro names
% for page head or footer.
% \item[\Parameter{special dimensional expression}:] the offset odd page
% \item[\Parameter{special dimensional expression}:] the offset even page
% \item[\Parameter{special dimensional expression}:] the width
% \end{description}
% This helper will generally set up width an offset of either head or footer.
% \begin{macrocode}
\scrlayerAddToInterface\sls@set@hf@width{%
\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
}%
}
% \end{macrocode}
% \end{macro}^^A \sls@set@hf@width
% \begin{macro}{\sls@headwidth}
% \begin{macro}{\sls@oddheadshift}
% \begin{macro}{\sls@evenheadshift}
% \begin{macro}{\sls@footwidth}
% \begin{macro}{\sls@oddfootshift}
% \begin{macro}{\sls@evenfootshift}
% To store width and offset of page head an footer, we use macros. Those are
% also used by the options and therefore need to be initialised before option
% usage.
% \begin{macrocode}
\scrlayerAddToInterface\sls@headwidth{%
\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}%
}%
}
\scrlayerAddToInterface\sls@oddheadshift{\newcommand*{\sls@oddheadshift}{0pt}}
\scrlayerAddToInterface\sls@evenheadshift{\newcommand*{\sls@evenheadshift}{0pt}}
\scrlayerAddToInterface\sls@footwidth{%
\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}
}%
}
\scrlayerAddToInterface\sls@oddfootshift{\newcommand*{\sls@oddfootshift}{0pt}}
\scrlayerAddToInterface\sls@evenfootshift{\newcommand*{\sls@evenfootshift}{0pt}}
% \end{macrocode}
% \end{macro}^^A \sls@headwidth
% \end{macro}^^A \sls@oddheadshift
% \end{macro}^^A \sls@evenheadshift
% \end{macro}^^A \sls@footwidth
% \end{macro}^^A \sls@oddfootshift
% \end{macro}^^A \sls@evenfootshift
%
% \begin{macro}{\sls@settowidthof}
% \begin{macro}{\sls@deftowidthof}
% the special dimensional expressions may be either one of the strings
% \texttt{paper}, \texttt{text}, \texttt{marginpar},
% \texttt{textwithmarginpar}, \texttt{head}, \texttt{foot},
% \texttt{headtopline}, \texttt{headsepline}, \texttt{footsepline},
% \texttt{footbotline}, or \texttt{page} or a valid dimensional
% expression. But it cannot be both a dimensional expression using symbolic
% values!
% \begin{macrocode}
\scrlayerAddToInterface\sls@settotwidthof{%
\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}%
}%
}%
}%
}%
}%
}%
}%
}%
}%
}%
}%
}%
}
\scrlayerAddToInterface\sls@deftowidthof{%
\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}%
}%
}%
}%
}
%
% \end{macrocode}
% \end{macro}^^A \sls@deftowidthof
% \end{macro}^^A \sls@settowidthof
% \end{option}^^A footwidth
% \end{option}^^A footheight
%
% \begin{macro}{\setheadwidth}
% \begin{macro}{\setfootwidth}
% For compatibility with \Package{scrpage2}, map the commands to the options:
% \begin{macrocode}
%<*body>
\scrlayerAddToInterface\setheadwidth{%
\newcommand*{\setheadwidth}[2][]{%
\KOMAoptions{headwidth=#2:#1}%
}%
}
\scrlayerAddToInterface\setfootwidth{%
\newcommand*{\setfootwidth}[2][]{%
\KOMAoptions{footwidth=#2:#1}%
}%
}
%
% \end{macrocode}
% \end{macro}^^A \setheadwidth
% \end{macro}^^A \setfootwidth
%
%
% \section{Lines in Page Head and Footer}
%
% The interface implements the options \Option{headtopline},
% \Option{headsepline}, \Option{footsepline}, \Option{footbotline},
% \Option{plainheadtopline}, \Option{plainheadsepline},
% \Option{plainfootsepline}, \Option{plainfootbotline}, \Option{ilines},
% \Option{clines}, and \Option{olines}, the commands \Macro{setheadtopline},
% \Macro{setheadsepline}, \Macro{setfootsepline}, and \Macro{setfootbotline},
% and the corresponding \KOMAScript{} font elements of package
% \Package{scrpage2}. Some of the options are extended to understand
% values.
%
% \begin{option}{headtopline}
% \changes{v3.17}{2015/02/25}{new: store the values}^^A
% \begin{option}{headsepline}
% \changes{v3.17}{2015/02/25}{new: store the values}^^A
% \begin{option}{footsepline}
% \changes{v3.17}{2015/02/25}{new: store the values}^^A
% \begin{option}{footbotline}
% \changes{v3.17}{2015/02/25}{new: store the values}^^A
% \begin{description}
% \item[{\texttt{=\meta{dimensional expression}:\meta{dimensional
% expression}}:}]
% \end{description}\noindent
% Define thickness and length of the a default separation line between:
% \begin{description}
% \item[\Option{headtopline}:] the top margin of the page and the page head.
% \item[\Option{headsepline}:] the page head and the text area.
% \item[\Option{footsepline}:] the text area and the page footer.
% \item[\Option{footbotline}:] the page footer and the bottom margin.
% \end{description}
% Both values may be omitted. In that case thickness would be 0.4\,pt, and
% length would be the width of the page head or footer. If the second
% argument, the length, has been omitted the \texttt{:} may also be omitted.
% \begin{macrocode}
%<*options>
\KOMA@key{headtopline}[:]{%
\sls@set@values[headtopline]{head}{above}{#1}%
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@headtopline}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@headtopline@default}
\KOMA@key{headsepline}[:]{%
\sls@set@values[headsepline]{head}{below}{#1}%
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@headsepline}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@headsepline@default}
\KOMA@key{footsepline}[:]{%
\sls@set@values[footsepline]{foot}{above}{#1}%
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@footsepline}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@footsepline@default}
\KOMA@key{footbotline}[:]{%
\sls@set@values[footbotline]{foot}{below}{#1}%
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@footbotline}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@footbotline@default}
% \end{macrocode}
% \begin{macro}{\sls@set@values}
% \begin{description}
% \item[\OParameter{option name}:] either empty or the name of the option
% that sets the line,
% \item[\Parameter{head or foot}:] either \texttt{head} or \texttt{foot},
% \item[\Parameter{above or below}:] either \texttt{above} or
% \texttt{below},
% \item[\Parameter{dimension expression}\texttt{:}\Parameter{dimension
% expression}] length an thickness of a line (both are optional).
% \end{description}
% Helper macros for the options to set two macros by two values of one
% option. The two values are separated by a colon.
% \begin{macrocode}
\scrlayerAddToInterface\sls@set@values{%
\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
}%
}%
}%
}
% \end{macrocode}
% \end{macro}^^A \sls@set@values
% \begin{macro}{\sls@split@at@colon}
% \begin{description}
% \item[\texttt{\meta{balanced}:^^A
% \meta{balanced}:^^A
% \meta{balanced}\Macro{@nil}}:] first \meta{balanced} will be stored into
% \Macro{reserved@a}, second into \Macro{reserved@b}, third will be eaten
% and warn about if it is neither empty and nor a colon.
% \end{description}
% This little helper is used, e.g., by options \Option{headwidth} and
% \Option{footwidth}.
% \begin{macrocode}
\scrlayerAddToInterface\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}%
}%
}
% \end{macrocode}
% \end{macro}^^A \sls@split@at@colon
% \begin{macro}{\sls@headabove@linelength}
% \begin{macro}{\sls@headabove@linethickness}
% \begin{macro}{\sls@headbelow@linelength}
% \begin{macro}{\sls@headbelow@linethickness}
% \begin{macro}{\sls@footabove@linelength}
% \begin{macro}{\sls@footabove@linethickness}
% \begin{macro}{\sls@footbelow@linelength}
% \begin{macro}{\sls@footbelow@linethickness}
% To store length and thickness of the lines at the page head an footer, we
% use macros. Those are also used by the options and therefore need to be
% initialised before option usage.
% \begin{macrocode}
\scrlayerAddToInterface\sls@headabove@linelength{%
\newcommand*{\sls@headabove@linelength}{\sls@headwidth}%
}
\scrlayerAddToInterface\sls@headabove{%
\newcommand*{\sls@headabove@linethickness}{0pt}%
}
\KOMA@kav@xadd{.scrlayer-scrpage.sty}{headtopline}{%
\expandafter\noexpand\sls@headabove@linethickness:%
\expandafter\noexpand\sls@headabove@linelength}
\scrlayerAddToInterface\sls@headbelow@linelength{%
\newcommand*{\sls@headbelow@linelength}{\sls@headwidth}%
}
\scrlayerAddToInterface\sls@headbelow@linethickness{%
\newcommand*{\sls@headbelow@linethickness}{0pt}%
}
\KOMA@kav@xadd{.scrlayer-scrpage.sty}{headsepline}{%
\expandafter\noexpand\sls@headbelow@linethickness:%
\expandafter\noexpand\sls@headbelow@linelength}
\scrlayerAddToInterface\sls@footabove@linelength{%
\newcommand*{\sls@footabove@linelength}{\sls@footwidth}%
}
\scrlayerAddToInterface\sls@footabove@linethickness{%
\newcommand*{\sls@footabove@linethickness}{0pt}%
}
\KOMA@kav@xadd{.scrlayer-scrpage.sty}{footsepline}{%
\expandafter\noexpand\sls@footabove@linethickness:%
\expandafter\noexpand\sls@footabove@linelength}
\scrlayerAddToInterface\sls@footbelow@linelength{%
\newcommand*{\sls@footbelow@linelength}{\sls@footwidth}%
}
\scrlayerAddToInterface\sls@footbelow@linethickness{%
\newcommand*{\sls@footbelow@linethickness}{0pt}%
}
\KOMA@kav@xadd{.scrlayer-scrpage.sty}{footbotline}{%
\expandafter\noexpand\sls@footbelow@linethickness:%
\expandafter\noexpand\sls@footbelow@linelength}
%
% \end{macrocode}
% \end{macro}^^A \sls@footbelow@linethickness
% \end{macro}^^A \sls@footbelow@linelength
% \end{macro}^^A \sls@footabove@linethickness
% \end{macro}^^A \sls@footabove@linelength
% \end{macro}^^A \sls@headbelow@linethickness
% \end{macro}^^A \sls@headbelow@linelength
% \end{macro}^^A \sls@headabove@linethickness
% \end{macro}^^A \sls@headabove@linelength
% \end{option}^^A footbotline
% \end{option}^^A footsepline
% \end{option}^^A headsepline
% \end{option}^^A headtopline
%
% \begin{option}{plainheadtopline}
% \begin{macro}{\ifsls@plain@head@above@line}
% \begin{option}{plainheadsepline}
% \begin{macro}{\ifsls@plain@head@below@line}
% \begin{option}{plainfootsepline}
% \begin{macro}{\ifsls@plain@foot@above@line}
% \begin{option}{plainfootbotline}
% \begin{macro}{\ifsls@plain@foot@below@line}
% \begin{description}
% \item[\texttt{=\meta{switch value}}:]
% \end{description}\noindent
% While these only switches the rule on or off, we need only some switches.
% \begin{macrocode}
%<*options>
\scrlayerAddCsToInterface{ifsls@plain@head@above@line}{%
\KOMA@ifkey{plainheadtopline}{sls@plain@head@above@line}%
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@plainheadtopline}%
\scrlayer@AddCsToInterface{%
KV@KOMA.scrlayer-scrpage.sty@plainheadtopline@default}%
\scrlayer@AddCsToInterface{sls@plain@head@above@linetrue}
\scrlayer@AddCsToInterface{sls@plain@head@above@linefalse}
}
\scrlayerAddCsToInterface{ifsls@plain@head@sbelow@line}{%
\KOMA@ifkey{plainheadsepline}{sls@plain@head@below@line}%
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@plainheadsepline}%
\scrlayer@AddCsToInterface{%
KV@KOMA.scrlayer-scrpage.sty@plainheadsepline@default}%
\scrlayer@AddCsToInterface{sls@plain@head@below@linetrue}%
\scrlayer@AddCsToInterface{sls@plain@head@below@linefalse}%
}
\scrlayerAddCsToInterface{ifsls@plain@foot@above@line}{%
\KOMA@ifkey{plainfootsepline}{sls@plain@foot@above@line}%
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@plainfootsepline}%
\scrlayer@AddCsToInterface{%
KV@KOMA.scrlayer-scrpage.sty@plainfootsepline@default}%
\scrlayer@AddCsToInterface{sls@plain@foot@above@linetrue}%
\scrlayer@AddCsToInterface{sls@plain@foot@above@linefalse}%
}
\scrlayerAddCsToInterface{ifsls@plain@foot@below@line}{%
\KOMA@ifkey{plainfootbotline}{sls@plain@foot@below@line}%
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@plainfootbotline}%
\scrlayer@AddCsToInterface{%
KV@KOMA.scrlayer-scrpage.sty@plainfootbotline@default}%
\scrlayer@AddCsToInterface{sls@plain@foot@below@linetrue}%
\scrlayer@AddCsToInterface{sls@plain@foot@below@linefalse}%
}
%
% \end{macrocode}
% \end{macro}^^A \ifsls@plain@foot@below@line
% \end{option}^^A plainfootbotline
% \end{macro}^^A \ifsls@plain@foot@above@line
% \end{option}^^A plainfootsepline
% \end{macro}^^A \ifsls@plain@head@below@line
% \end{option}^^A plainheadsepline
% \end{macro}^^A \ifsls@plain@head@above@line
% \end{option}^^A plainheadtopline
%
% \begin{option}{ilines}
% \changes{v3.17}{2015/02/25}{new: store the values}^^A
% \begin{option}{clines}
% \changes{v3.17}{2015/02/25}{new: store the values}^^A
% \begin{option}{olines}
% \changes{v3.17}{2015/02/25}{new: store the values}^^A
% \begin{macro}{\sls@hfline@adjust}
% Maybe it would be more useful to be able to adjust each line on its own or
% at most to define an offset. But \Package{scrpage2} supports only these
% options. At least we can set the options inside a layer or page style. This
% may help.
% \begin{macrocode}
%<*options>
\scrlayerAddToInterface\sls@hfline@adjust{%
\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
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@ilines}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@ilines@default}
\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
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@clines}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@clines@default}
\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
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@olines}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@olines@default}
\KOMA@kav@add{.scrlayer-scrpage.sty}{ilines}{}
%
% \end{macrocode}
% \end{macro}^^A \sls@hfline@adjust
% \end{option}^^A olines
% \end{option}^^A clines
% \end{option}^^A ilines
%
% \begin{macro}{\setheadtopline}
% \begin{macro}{\setheadsepline}
% \begin{macro}{\setfootsepline}
% \begin{macro}{\setfootbotline}
% \begin{description}
% \item[\OParameter{extended dimensional expression}:] the length of the
% line; if omitted the length will use the width of the page head or
% footer while printing the line.
% \item[\Parameter{dimensional expression}:] the thickness of the line.
% \item[\OParameter{code}:] the font selection code for the line. You may
% use it for any kind of operation, that doesn't change the position,
% width, height, or depth, e.g., to change the colour of the line.
% \end{description}
% \begin{macrocode}
%<*body>
\scrlayerAddToInterface\setheadtopline{%
\newcommand*{\setheadtopline}{\sls@setline{head}{above}}%
}
\scrlayerAddToInterface\setheadsepline{%
\newcommand*{\setheadsepline}{\sls@setline{head}{below}}%
}
\scrlayerAddToInterface\setfootsepline{%
\newcommand*{\setfootsepline}{\sls@setline{foot}{above}}%
}
\scrlayerAddToInterface\setfootbotline{%
\newcommand*{\setfootbotline}{\sls@setline{foot}{below}}%
}
% \end{macrocode}
% \begin{macro}{\sls@setline}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
% \cs{kernel@ifnextchar}}^^A
% \begin{macro}{\sls@@setline}
% \begin{macro}{\sls@@@setline}
% \changes{v3.17}[2015/02/27]{internal use of the corresponding options}^^A
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
% \cs{kernel@ifnextchar}}^^A
% \begin{macro}{\sls@@@@setline}
% \changes{v3.18}{2015/06/17}{explicit reuse of the current length}^^A
% Helper to set up the line attributes processing the parameters of the
% commands above.
% \begin{macrocode}
\scrlayerAddToInterface\sls@setline{%
\newcommand*\sls@setline[2]{%
\kernel@ifnextchar[%]
{\sls@@setline{#1}{#2}}{\sls@@@setline{#1#2}}%
}%
}
\scrlayerAddToInterface\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}%
}%
}
\scrlayerAddToInterface\sls@@@setline{%
\def\sls@@@setline#1#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
`:' 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}%
}{%
}%
}%
}
\scrlayerAddToInterface\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}%
}%
}%
}%
}%
}
% \end{macrocode}
% \end{macro}^^A \sls@setline
% \end{macro}^^A \sls@@setline
% \end{macro}^^A \sls@@@setline
% \end{macro}^^A \sls@@@@setline
% \begin{KOMAfont}{headtopline}
% \begin{KOMAfont}{headsepline}
% \begin{KOMAfont}{footsepline}
% \begin{KOMAfont}{footbotline}
% These are the font elements used in \Macro{sls@hf@rule} to set the rules
% with, i.e., another colour. Note, that those may already be defined and
% become only part of the interface if they are not.
% \begin{macrocode}
\@ifundefined{scr@fnt@headtopline}{%
\@ifundefined{@headtoplinefont}{%
\scrlayer@AddCsToInterface{@headtoplinefont}%
}{}%
\newkomafont{headtopline}{}%
\scrlayer@AddCsToInterface{scr@fnt@headtopline}%
}{}
\@ifundefined{scr@fnt@headsepline}{%
\@ifundefined{@headseplinefont}{%
\scrlayer@AddCsToInterface{@headseplinefont}%
}{}%
\newkomafont{headsepline}{}%
\scrlayer@AddCsToInterface{scr@fnt@headsepline}%
}{}
\@ifundefined{scr@fnt@footsepline}{%
\@ifundefined{@footseplinefont}{%
\scrlayer@AddCsToInterface{@footseplinefont}%
}{}%
\newkomafont{footsepline}{}%
\scrlayer@AddCsToInterface{scr@fnt@footsepline}%
}{}
\@ifundefined{scr@fnt@footbotline}{%
\@ifundefined{@footbotlinefont}{%
\scrlayer@AddCsToInterface{@footbotlinefont}%
}{}%
\newkomafont{footbotline}{}%
\scrlayer@AddCsToInterface{scr@fnt@footbotline}%
}{}
%