% \CheckSum{2321}
% \iffalse^^A meta-comment
% ======================================================================
% scrlayer-scrpage.dtx
% Copyright (c) Markus Kohm, 2012-2013
%
% 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.
%
% Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien.
% ----------------------------------------------------------------------
% scrlayer-scrpage.dtx
% Copyright (c) Markus Kohm, 2012-2013
%
% 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 1548 2013-12-14 17:36:23Z mjk $ (identify)
%%%% From File: $Id: scrlayer-scrpage.dtx 1548 2013-12-14 17:36:23Z mjk $ (init)
%%%% From File: $Id: scrlayer-scrpage.dtx 1548 2013-12-14 17:36:23Z mjk $ (options)
%%%% From File: $Id: scrlayer-scrpage.dtx 1548 2013-12-14 17:36:23Z mjk $ (body)
%<*dtx>
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\begingroup
\def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#4/#3/#2}}
\filedate$Date: 2013-12-14 18:36:23 +0100 (Sa, 14 Dez 2013) $
\def\filerevision$#1: #2 ${\gdef\filerevision{v0.9.#2}}
\filerevision$Revision: 1548 $
\endgroup
\ProvidesFile{scrlayer-scrpage.dtx}[\filedate\space\filerevision\space
%
%<*identify>
%\NeedsTeXFormat{LaTeX2e}[1995/12/01]
%\ProvidesPackage{scrlayer-scrpage}[%
% Some time following will be replaced by !KOMASCRIPTVERSION:
%!SCRLAYERVERSION
% 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}
\KOMAdefVariable{SCRLAYERVERSION}{\space\space\filedate\space\filerevision}%
\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
%
%<*driver>
\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}
%
%<*dtx>
% \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
%
% \chapter{End User Interface \Package{scrlayer-scrpage}}
% \label{sec:scrlayer-scrpage}
%
% This interface is the implementation of the described features of
% \KOMAScript{} package \Package{scrpage2}. It is extended by some additional
% options and commands. Some features, that has been described for
% \Package{scrpage2} have been removed or declared to be deprecated.
%
% While this is mainly the implementation documentation, you may find only some
% additional information about differences to \Package{scrpage2}. See the
% \KOMAScript{} manual (\File{scrguien.pdf}) for more information.
%
% \section{Head and Foot Width and Offset}
% \label{sec:scrlayer.headfoot.width}
%
% From \Package{scrpage2} you already know commands \Macro{setheadwidth} and
% \Macro{setfootwidth}. Package \Package{scrlayer-scrpage} provides them too and
% they are still supported.
%
% \DescribeOption{headwidth}
% \DescribeOption{footwidth}
% Options
% \KOption{headwidth}\PName{width}\texttt{:}\PName{offset}
% and
% \KOption{footwidth}\PName{width}\texttt{:}\PName{offset}
% could be used to setup the width and the horizontal offset of the page head
% respectively the page foot. By default the \PName{width} is
% \Length{textwidth}, the width of the text area. The default of \PName{offset}
% is a little bit more complex. Normally the default of \PName{offset} in
% single-side mode is half of the difference of the text area width minus
% \PName{width}. In two-side mode it's only a third of that difference. But if
% \PName{width} is the width of the text area plus the marginal note column, the
% default of \PName{offset} is zero.
%
% An \PName{offset} of zero means, that the head respectively foot is aligned to
% the inner edge of the text area. In single-side mode this is the left edge of
% the text area. In double-side mode, this is the left edge of the text area of
% odd pages or the right edge of the text area of even pages. An positive
% \PName{offset} will move the head respectively the foot towards the outer
% margin respectively the right margin in single-side mode.
%
% You may omit the \PName{width} or the \PName{offset}. In this case also the
% defaults of the values will be used. If you omit both, you may also omit the
% colon. If you omit one value and the colon, the existent value is the
% \PName{width}.
%
% Instead of using lengths for \PName{width} or \PName{offset}, you may use also
% some symbolic values. These are
% \begin{description}
% \item[\PValue{foot}:] the current width of the page foot,
% \item[\PValue{footbotline}:] the current length of the horizontal line below
% the page foot,
% \item[\PValue{footsepline}:] the current length of the horizontal line above
% the page foot,
% \item[\PValue{head}:] the current width of the page head,
% \item[\PValue{headsepline}:] the current length of the horizontal line below
% the page head,
% \item[\PValue{headtopline}:] the current length of the horizontal line above
% the page head,
% \item[\PValue{marginpar}:] the width of the marginal note column plus the
% distance of that column to the text area,
% \item[\PValue{page}:] the paper width without binding correction, that has
% been set using package \Package{typearea},
% \item[\PValue{paper}:] the whole paper width inclusive a binding correction
% if used,
% \item[\PValue{text}:] the width of the text area,
% \item[\PValue{textwidthmarginpar}:] the width of the text area plus the
% marginal note column (and the distance between them).
% \end{description}
% If none of the symbolic values has been used, you may alternatively use a
% dimensional expression. Those may contain basic arithmetic operations and
% round brackets. For more information about dimensional expressions see the
% \eTeX{} manual.
%
%
% \section{Horizontal Separation Lines above and below Page Head and Foot}
% \label{sec:scrlayer-headfoot.lines}
%
% From \Package{scrpage2} you already know options \Option{headtopline},
% \Option{headsepline}, \Option{footsepline}, \Option{footbotline},
% \Option{plainheadtopline}, \Option{plainheadsepline},
% \Option{plainfootsepline}, and \Option{plainfootbotline}. These were
% implemented as \LaTeX{} package options and could be used to switch on the
% lines only. With \Package{scrlayer-scrpage} this has been changed.
%
% \DescribeOption{headtopline}
% \DescribeOption{headsepline}
% \DescribeOption{footsepline}
% \DescribeOption{footbotline}
% The option
% \KOption{headtopline}\PName{thickness}\texttt{:}\PName{length}
% May be used to activate a horizontal line above the page head and to configure
% it's \PName{thickness} and \PName{length}. You may omit both, the
% \PName{thickness} and \PName{length}. In this case you may also omit the
% colon. This would result in the default \PName{thickness} 0.4\,pt and the
% default \PName{length}, that is the current width of the page head. If you use
% only one value without colon, this will be interpreted as \PName{thickness}
% and \PName{width} will become also the default. For \PName{length} you may
% also use a symbolic value. Alternatively you may use a dimensional expression
% again. See option \Option{headwidth} for more information about valid symbolic
% values and dimensional expressions.
%
% Options \Option{headsepline}, \Option{footsepline}, and \Option{footbotline}
% are similar to \Option{headtopline}, but for a horizontal line below the page
% head, above the page foot, and below the page foot. The default \PName{length}
% of \Option{footsepline} and \Option{footbotline} is the width of the page foot
% instead of the page head.
%
% Instead of \PName{thickness}\texttt{:}\PName{length} you may alternatively use
% one of the values for \emph{simple switches}. Switching on a line, will also
% set \PName{thickness} and \PName{length} to their defaults. Switching off a
% line, will set both values to zero. This makes the lines invisible.
%
% All of them are also font elements, that may be configured using
% \Macro{setkomafont} or \Macro{addtokomafont}, but you should not change the
% font size. The elements are provided to make it easier to change the colour of
% the lines. See package \Package{color} or \Package{xcolor} for more
% information about colour with \LaTeX.
%
% \DescribeOption{plainheadtopline}
% \DescribeOption{plainheadsepline}
% \DescribeOption{plainfootsepline}
% \DescribeOption{plainfootbotline}
% The option
% \KOption{plainheadtopline}\PName{simple switch}
% may be used to switch on or off the horizontal line above the page head of
% \emph{plain} pages, defined using on of the commands from
% \autoref{sec:scrlayer.definepairs}. Page style \Pagestyle{scrplain} is one of
% those. You cannot give them another length or thickness than the lines of the
% \emph{headings} or \emph{main} page style. You may only switch them on or off
% and they will use the settings of the \emph{main} page style. By default they
% are switched off, because that's the usual style of chapter start pages.
%
% Options \Option{plainheadsepline}, \Option{plainfootsepline}, and
% \Option{plainfootbotline} are similar for the corresponding other horizontal
% lines below or above the page head or foot.
%
% \DescribeOption{ilines}
% \DescribeOption{clines}
% \DescribeOption{olines}
% You already know these options from \Package{scrpage2}. But now they are not
% only package options, but \KOMAScript{} options, that may be used anywhere at
% the document preamble or document body. Nevertheless, they don't expect any
% value. Maybe these options will become deprecated in a future release of
% \Package{scrlayer-scrpage} and will become a single option with (at least)
% three values.
%
%
% \section{Predefined Page Styles}
% \label{sec:scrlayer.predefined}
%
% Package \Package{scrlayer-scrpage} still defines page styles
% \Pagestyle{scrheadings} and \Pagestyle{scrplain}, but \Pagestyle{scrplain}
% is only an alias for \Pagestyle{plain.scrheadings} now.
%
% \DescribeOption{pagestyleset}
% \KOMAScript{} option
% \KOption{pagestyleset}\PName{name}
% may be used to configure the page styles \Pagestyle{scrheadings} and
% \Pagestyle{scrplain}. For \PName{name} currently one of \PValue{standard} or
% \PValue{KOMA-Script} is allowed. The first one selects settings for the
% elements of the page head and foot, that are compatible with the standard
% classes. The second one selects defaults compatible with the \KOMAScript{}
% classes.
%
%
% \section{Defining Pairs Like \Pagestyle{scrheadings} and
% \Pagestyle{plain.scrheadings}}
% \label{sec:scrlayer.definepairs}
%
% You already know the page style pair \Pagestyle{scrheadings} and
% \Pagestyle{scrplain} from package \Package{scrpage2}. As told above with
% \Package{scrlayer-scrpage} page style \Package{scrplain} is an alias of
% \Pagestyle{plain.scrheadings}. So page styles \Pagestyle{scrheadings} and
% \Pagestyle{plain.scrheadings} build the real pair of a \emph{headings} page
% style and a \emph{plain} page style.
%
% You should\,---\,at this point\,---\,also note, that the commands
% \Macro{ihead}, \Macro{chead}, \Macro{ohead}, \Macro{lehead}, \Macro{cehead},
% \Macro{rehead}, \Macro{lohead}, \Macro{lohead}, \Macro{rohead},
% \Macro{ifoot}, \Macro{cfoot}, \Macro{ofoot}, \Macro{lefoot}, \Macro{cefoot},
% \Macro{refoot}, \Macro{lofoot}, \Macro{lofoot}, \Macro{rofoot},
% \Macro{clearscrheadfoot}, \Macro{clearscrplain}, and \Macro{clearscrheadings}
% does not only configure \Pagestyle{scrplain} and \Pagestyle{scrheadings}, but
% the current pair of page styles. If the current page style is not a member of
% a pair of page styles, that last pair, that has been used, is the current
% one. Only if this is unknown too, the pair \Pagestyle{scrheadings} and
% \Pagestyle{plain.scrheadings}\footnote{\Pagestyle{plain.scrheadings} is the
% real name of the \emph{plain} page style to \Pagestyle{scrheadings}.} is
% current.
%
% \DescribeMacro{\defpairofpagestyles}
% \DescribeMacro{\newpairofpagestyles}
% \DescribeMacro{\renewpairofpagestyles}
% \DescribeMacro{\providepairofpagestyles}
% The command
% \Macro{defpairofpagestyles}%
% \OParameter{parent page style name}\Parameter{name}\Parameter{definition}
% may be used to define a pair of page styles like \PName{scrheadings} and
% \PName{plain.scrheadings}. \PName{name} is the name of the \emph{headings}
% page style of the pair. We also say \emph{main} page style alternatively to
% \emph{headings} page style. The \emph{plain} page style will become the name
% \PValue{plain.}\PName{name}.
%
% The \PName{definition} will be executed, whenever either the main or the plain
% page style will be selected. You may use here, e.g., commands like
% \Macro{ihead} or \Macro{clearpairofpagestyles} to configure the pair of page
% styles. But note, if you redefine things like \Macro{chaptermark} inside of
% \PName{definition}, this would also influence other page styles. So it's
% recommended to use only commands, that do not influence other page styles or
% other features of \Package{scrlayer} or other packages or classes!
%
% The difference between \Macro{newpairofpagestyles} and
% \Macro{defpairofpagestyles} is, that the first one would raise an error, if
% there has been a page style \PName{name} or \PValue{plain.}\PName{name}
% already before. In opposite to this \Macro{renewpairofpagestyles} would raise
% the error, if those page style hasn't been already before. Last but not least
% \Macro{providepairofpagestyles} won't raise an error, but it defines
% \PName{name} and \PValue{plain.}\PName{name} only, if they were not defined
% already before.
%
% \DescribeMacro{\clearmainofpairofpagestyles}
% \DescribeMacro{\clearplainofpairofpagestyles}
% \DescribeMacro{\clearpairofpagestyles}
% With \Package{scrlayer-scrpage} pairs of page styles are more general that
% with the single pair of \Package{scrpage2}. So command names like
% \Macro{clearscrheadings}, \Macro{clearscrplain} and even
% \Macro{clearscrheadfoot} are somehow to specific. Therefore
% \Macro{clearmainofpairofpagestyles} is the new name of
% \Macro{clearscrheadings} to set all fields of the main page style of the
% current pair of page styles to an empty value;
% \Macro{clearplainofpairofpagestyles} is the new name of \Macro{clearscrplain}
% to set all fields of the plain page style of the current pair of page styles
% to an empty value; \Macro{clearpariofpagestyles} is the new name of
% \Macro{clearscrheadfoot} to set all fields of the plain and the main page
% style if the current pair of page styles to an empty value. The old names are
% obsolete, but still valid for compatibility reason. But they have the new
% meanings, if \Pagestyle{scrheadings} and \Pagestyle{plain.scrheadings} are not
% the only existing pair of page styles.
%
%
% \section{Defining Page Styles With Expert Interface}
% \label{sec:scrlayer.expert}
%
% You already know \Macro{defpagestyle}, \Macro{newpagestyle},
% \Macro{renewpagestyle}, and \Macro{providepagestyle} from package
% \Package{scrpage2}. Package \Package{scrlayer-scrpage} provides those
% too. Nevertheless there are some differences, e.g., \Package{scrpage2} didn't
% support a configurable height for the page foot, but supposed
% \Length{baselineskip} for the total height of the foot. Package
% \Package{scrlayer-scrpage} uses length \Length{footheight} provided by
% \Package{scrlayer} for the total height of the foot.
%
% \DescribeOption{hmode}
% The option
% \KOption{hmode}\PName{simple switch}%
% may be used to make \Package{scrlayer-scrpage} more compatible with
% \Package{scrpage2}. By default \Package{scrlayer-scrpage} sets the elements of
% the page head and page foot in vertical mode. But \Package{scrpage2} did the
% same job in horizontal mode. If the option has been switched on,
% \Package{scrlayer-scrpage} will also leave the vertical mode before setting a
% page head or foot element.
%
%
% \section{Removed or Deprecated Package Options}
% \label{sec:scrlayer.deprecated.options}
%
% Package \Package{scrpage2} never supported \KOMAScript{} options. Instead it
% only supports standard \LaTeX{} package options. Options \Option{headinclude},
% \Option{headexclude}, \Option{footinclude}, and \Option{footexclude} became
% deprecated since 2008-12-08. Package \Package{scrlayer-scrpage} doesn't
% provide them any longer. Options \Option{mpinclude} and \Option{mpexclude} has
% never been official in \Package{scrpage2}. So it was an easy decision to not
% provide them by \Package{scrlayer-scrpage}.
%
% Options \Option{komastyle} and \Option{standardstyle} have been replaced by
% \Option{pagestyleset}. Nevertheless, they are still implemented as simple
% package options, but declared to be deprecated. You should not use them any
% longer, because they might be removed in a future release.
%
% Options \Option{markuppercase}, \Option{markusedcase}, and
% \Option{nouppercase} have been replaced by \Option{markcase}. Nevertheless,
% they are still implemented as simple package options, but declared to be
% deprecated. You should not use them any longer, because they might be removed
% in a future release.
%
%
% \section{Deprecated Commands}
% \label{sec:scrlayer.deprecated.commands}
%
% The commands \Macro{setheadtopline}, \Macro{setheadsepline},
% \Macro{setfootsepline}, and \Macro{setfootbotline} of \Package{scrpage2} has
% been intended to configure the lines above and below the page head and
% foot. They \emph{never} has been intended to switch the lines on an
% off. Switching on the lines should have been done using the package options
% \Option{headtopline}, \Option{headsepline}, \Option{footsepline}, and
% \Option{footbotline}, and their plain equivalents \Option{plainheadtopline},
% \Option{plainheadsepline}, \Option{plainfootsepline}, and
% \Option{plainfootbotline}. Nevertheless, a lot of users have used the commands
% also to switch on the lines. This commands became deprecated with
% \Package{scrlayer-scrpage}, but nevertheless are still
% implemented. Nevertheless, with \Package{scrlayer-scrpage} users should
% absolutely use the \KOMAScript{} options and the font elements not only for
% switching on the lines, but also for configuration of the lines.
%
% Commands \Macro{headfont} and \Macro{footfont} are deprecated, because
% \Package{scrlayer-scrpage} provides the font element interface of the
% \KOMAScript{} classes. You should use \Macro{setkomafont} and
% \Macro{addtokomafont} to configure fonts and colours of page head and foot.
%
% Package \Package{scrpage2} provided an additional user page style definition
% interface using command \Macro{deftripstyle}. This became obsolete with
% \Package{scrlayer-scrpage}, because the other interfaces are easier to
% understand and more powerful. Nevertheless additional commands
% \Macro{deftriplepagestyle}, \Macro{newtriplepagestyle},
% \Macro{renewtriplepagestyle}, and \Macro{providetriplepagestyle} has been
% implemented to have a more consistent user interface.
%
%\iffalse
%
%\fi
%
% \StopEventually{}
%
% \chapter{Implementation of \Package{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}
% \begin{option}{footwidth}
% \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@colon#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@a}%
}%
\reserved@a
\FamilyKeyStateProcessed
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@headwidth}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@headwidth@default}
\KOMA@key{footwidth}{%
\begingroup
\sls@split@at@colon#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@a}%
}%
\reserved@a
\FamilyKeyStateProcessed
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@footwidth}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@footwidth@default}
% \end{macrocode}
% \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 es 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@set@hf@width}
% \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
% \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}[3]{%
\sls@settowidthof{\@tempdima}{#3}%
\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}%
}
\addtolength{\@tempdima}{-\@tempdimb}%
\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}%
}{%
\newcommand*{\sls@headwidth}{\@headwidth}%
}%
}
\scrlayerAddToInterface\sls@oddheadshift{\newcommand*{\sls@oddheadshift}{\z@}}
\scrlayerAddToInterface\sls@evenheadshift{\newcommand*{\sls@evenheadshift}{\z@}}
\scrlayerAddToInterface\sls@footwidth{%
\scr@ifundefinedorrelax{@footwidth}{%
\newcommand*{\sls@footwidth}{\textwidth}%
}{%
\newcommand*{\sls@footwidth}{\@footwidth}%
}%
}
\scrlayerAddToInterface\sls@oddfootshift{\newcommand*{\sls@oddfootshift}{\z@}}
\scrlayerAddToInterface\sls@evenfootshift{\newcommand*{\sls@evenfootshift}{\z@}}
% \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}
% \begin{option}{headsepline}
% \begin{option}{footsepline}
% \begin{option}{footbotline}
% \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{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{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{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{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[\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}[3]{%
\begingroup
\let\reserved@a\@empty
\let\reserved@b\@empty
\ifstr{#3}{true}{\def\reserved@a{.4pt}\def\reserved@b{sls@#1width}}{%
\ifstr{#3}{yes}{\def\reserved@a{.4pt}\def\reserved@b{sls@#1width}}{%
\ifstr{#3}{on}{\def\reserved@a{.4pt}\def\reserved@b{sls@#1width}}{%
\ifstr{#3}{false}{\def\reserved@a{\z@}\def\reserved@b{z@}}{%
\ifstr{#3}{no}{\def\reserved@a{\z@}\def\reserved@b{z@}}{%
\ifstr{#3}{off}{\def\reserved@a{\z@}\def\reserved@b{z@}}{%
}%
}%
}%
}%
}%
}%
\ifx\reserved@a\@empty
\sls@split@at@colon#3::\@nil
\ifx\reserved@a\@empty
\def\reserved@a{\endgroup\@namedef{sls@#1#2@linethickness}{.4pt}}%
\else
\setlength{\@tempdima}{\dimexpr\reserved@a\relax}%
\edef\reserved@a{%
\noexpand\endgroup
\noexpand\@namedef{sls@#1#2@linethickness}{\the\@tempdima}%
}%
\fi
\ifx\reserved@b\@empty
\def\reserved@b{%
\reserved@a
\@namedef{sls@#1#2@linelength}{\@nameuse{sls@#1width}}%
}%
\else
\edef\reserved@b{%
\noexpand\reserved@a
\noexpand\sls@deftowidthof{sls@#1#2@linelength}{\reserved@b}%
}%
\fi
\else
\edef\reserved@b{%
\noexpand\endgroup
\noexpand\@namedef{sls@#1#2@linethickness}{\reserved@a}%
\noexpand\@namedef{sls@#1#2@linelength}{%
\expandafter\noexpand\csname \reserved@b\endcsname
}%
}%
\fi
\reserved@b
}%
}
% \end{macrocode}
% \end{macro}^^A \sls@set@values
% \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}{\z@}%
}
\scrlayerAddToInterface\sls@headbelow@linelength{%
\newcommand*{\sls@headbelow@linelength}{\sls@headwidth}%
}
\scrlayerAddToInterface\sls@headbelow@linethickness{%
\newcommand*{\sls@headbelow@linethickness}{\z@}%
}
\scrlayerAddToInterface\sls@footabove@linelength{%
\newcommand*{\sls@footabove@linelength}{\sls@footwidth}%
}
\scrlayerAddToInterface\sls@footabove@linethickness{%
\newcommand*{\sls@footabove@linethickness}{\z@}%
}
\scrlayerAddToInterface\sls@footbelow@linelength{%
\newcommand*{\sls@footbelow@linelength}{\sls@footwidth}%
}
\scrlayerAddToInterface\sls@footbelow@linethickness{%
\newcommand*{\sls@footbelow@linethickness}{\z@}%
}
%
% \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}
% \begin{option}{clines}
% \begin{option}{olines}
% \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@key{ilines}[]{%
\ifx\relax#1\relax
\renewcommand*{\sls@hfline@adjust}{0}%
\FamilyKeyStateProcessed
\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
\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
\else
\def\FamilyKeyStateProcessed{unexpected value}%
\fi
}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@olines}
\scrlayer@AddCsToInterface{KV@KOMA.scrlayer-scrpage.sty@olines@default}
%
% \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}
% \begin{macro}{\sls@@setline}
% \begin{macro}{\sls@@@setline}
% \begin{macro}{\sls@@@@setline}
% Helper to set up the line attributes processing the parameters of the
% commands above.
% \begin{macrocode}
\scrlayerAddToInterface\sls@setline{%
\newcommand*\sls@setline[2]{%
\@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}%
\expandafter\edef\csname sls@#1@linethickness\endcsname%
{\the\@tempdima}%
}%
}%
\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%
}%
\@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}%
}{}
%