summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/koma-script/source/scrkernel-sections.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/koma-script/source/scrkernel-sections.dtx')
-rw-r--r--macros/latex/contrib/koma-script/source/scrkernel-sections.dtx5743
1 files changed, 2816 insertions, 2927 deletions
diff --git a/macros/latex/contrib/koma-script/source/scrkernel-sections.dtx b/macros/latex/contrib/koma-script/source/scrkernel-sections.dtx
index 35ffefe9de..71ceb54ce7 100644
--- a/macros/latex/contrib/koma-script/source/scrkernel-sections.dtx
+++ b/macros/latex/contrib/koma-script/source/scrkernel-sections.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
% ======================================================================
% scrkernel-sections.dtx
-% Copyright (c) Markus Kohm, 2002-2021
+% Copyright (c) Markus Kohm, 2002-2022
%
% This file is part of the LaTeX2e KOMA-Script bundle.
%
@@ -17,44 +17,8 @@
% The Current Maintainer and author of this work is Markus Kohm.
%
% This work consists of all files listed in manifest.txt.
-% ----------------------------------------------------------------------
-% scrkernel-sections.dtx
-% Copyright (c) Markus Kohm, 2002-2021
-%
-% Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
-% Version 1.3c, verteilt und/oder veraendert werden.
-% 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 oder spaeter 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
-%
-% \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
-%%% From File: $Id: scrkernel-sections.dtx 3621 2021-10-15 10:20:41Z kohm $
+%%% From File: $Id: scrkernel-sections.dtx 3770 2022-03-22 16:27:02Z kohm $
% The runs of run-time file generation:
%<preidentify>%%% (run: preidentify)
% - everything that is needed before selfidentification of resulting files
@@ -73,13 +37,12 @@
%<exit>%%% (run: exit)
% - everything, that should be done immediately before leaving the file
%<*dtx>
-% \fi
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\begingroup
\def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
- \filedate$Date: 2021-10-15 12:20:41 +0200 (Fri, 15 Oct 2021) $
+ \filedate$Date: 2022-03-22 17:27:02 +0100 (Di, 22. Mär 2022) $
\def\filerevision$#1: #2 ${\gdef\filerevision{r#2}}
- \filerevision$Revision: 3621 $
+ \filerevision$Revision: 3770 $
\edef\reserved@a{%
\noexpand\endgroup
\noexpand\ProvidesFile{scrkernel-sections.dtx}%
@@ -87,87 +50,89 @@
KOMA-Script source (disposition)]
}%
\reserved@a
-% \iffalse
-\documentclass[parskip=half-]{scrdoc}
-\usepackage[english,ngerman]{babel}
-\CodelineIndex
-\RecordChanges
-\GetFileInfo{scrkernel-sections.dtx}
-\title{\KOMAScript{} \partname\ \texttt{\filename}%
- \footnote{Dies ist Version \fileversion\ von Datei
- \texttt{\filename}.}}
-\date{\filedate}
-\author{Markus Kohm}
-
+\documentclass[USenglish]{koma-script-source-doc}
+\usepackage{babel}
+\setcounter{StandardModuleDepth}{3}
\begin{document}
- \maketitle
- \tableofcontents
- \DocInput{\filename}
+\DocInput{scrkernel-sections.dtx}
\end{document}
%</dtx>
% \fi
%
-% \selectlanguage{ngerman}
+% \changes{v2.3h}{1996/01/20}{configurable font sized for headings}
+% \changes{v2.95}{2002/06/26}{first version after splitting \file{scrclass.dtx}}
+% \changes{v3.15}{2014/12/09}{reordered code in \file{scrkernel-sections.dtx}}
+% \changes{v3.36}{2022/03/08}{switch over from \cls*{scrdoc} to
+% \cls*{koma-script-source-doc}}
+% \changes{v3.36}{2022/03/21}{the whole implementation documentation in English}
%
-% \changes{v2.3h}{1996/01/20}{Größenbefehle in den Überschriften
-% variabilisiert}%^^A
-% \changes{v2.95}{2002/06/26}{erste Version aus der Aufteilung von
-% \texttt{scrclass.dtx}}%^^A
-% \changes{v3.15}{2014/12/09}{Code in Datei \texttt{scrkernel-section} komplett
-% umsortiert}%^^A
+% \GetFileInfo{scrkernel-sections.dtx}
+% \title{The Code for Parts, Chapters, Sections etc.\@ of
+% \href{https://komascript.de}{\KOMAScript} Classes}
+% \author{\href{mailto:komascript@gmx.info}{Markus Kohm}}
+% \date{Revision \fileversion{} of \filedate}
+% \maketitle
+% \begin{abstract}
+% \file{scrkernel-sections.dtx} implements all the options, macros and user
+% commands used for the sectioning of documents.
+% \end{abstract}
+% \tableofcontents
%
-% \section{Gliederung}
+% \section{User Manual}
%
-% Zur Gliederung gehören neben den üblichen Gliederungsbefehlen
-% \cs{chapter} \dots \cs{subparagraph} auch alle Optionen und Befehle,
-% die diese Gliederung beeinflussen. Eingeschränkt gehören auch die
-% Befehle dazu, die Inhaltsverzeichniseinträge zu den
-% Gliederungsbefehlen erzeugen oder unmittelbar formatieren. Diese
-% Entscheidung wurde getroffen, weil die Zusammengehörigkeit eher hier
-% gesehen wird, als bei den Verzeichnissen selbst.
+% You can find the user documentation the commands implemented here in the
+% \KOMAScript{} manual, either the German \file{scrguide} or the English
+% \file{scrguien}.
%
-% \StopEventually{\PrintIndex\PrintChanges}
+% \MaybeStop{\PrintIndex}
%
-% \changes{v2.8e}{2001/07/10}{\cs{@maybeasf} entfernt}
+% \section{Implementation of Parts, Chapters, Section etc.}
%
-% Die Briefklasse hat keine derartige Gliederung. Beim Briefpaket wird die
-% Gliederung über die verwendete Klasse bestimmt.
-% \iffalse
-%<*!letter>
-% \fi
+% The letter class does not provide sectioning.
+% \begin{macrocode}
+%<*class&!letter>
+% \end{macrocode}
%
-% \subsection{Vakatseiten}
+% \begin{macro}{@maybeasf}
+% \changes{v2.8e}{2001/07/10}{removed}
+% \end{macro}
%
-% Bei \textsf{scrbook} und \textsf{scrreprt} gibt es im doppelseitigen Modus
-% ggf. Vakatseiten.
+% \subsection{Interleaf pages}
+%
+% With \cls*{scrbook} and \cls*{scrreprt} chapters can optionally (or by
+% default) start automatically on a odd page. So if the last page before
+% already was an odd page, we have to insert a so called interleaf page. The
+% main handling of interleaf pages is already defined in
+% \file{scrkernel-pagestyles.dtx} (but there is a ToDo note to move is to a
+% new file). Here we only support the optional selection of the start page of
+% a chapter.
%
% \begin{option}{open}
-% \changes{v2.98c}{2008/03/06}{Neue Option}%^^A
-% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit
-% \cs{FamilyKeyState}}%^^A
-% \changes{v3.17}{2015/03/09}{interne Speicherung des Wert}%^^A
-% Bei \textsf{scrreprt} und \textsf{scrbook} kann per Option eingestellt
-% werden, ob beispielsweise Kapitel nur auf linken oder rechten Seiten
-% beginnen dürfen oder auf jeder Seite.
-% \begin{macro}{\if@openright}
-% \begin{macro}{\@openrighttrue}
-% \begin{macro}{\@openrightfalse}
-% Der Zustand wird dann in einem Schalter und durch umdefinieren von
-% \cs{cleardoublestandardpage} gespeichert. Die Voreinstellungen sind je nach
-% Klasse unterschiedlich.
-% \begin{macrocode}
-%<*class>
+% \changes{v2.98c}{2008/03/06}{added}
+% \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyState}}
+% \changes{v3.17}{2015/03/09}{using internal value storage}
+% \changes{v3.18}{2015/05/22}{initialization using \opt{headings}}
+% \begin{macro}{\@openrighttrue,\@openrightfalse,\if@openright}
+% The option supports three values:
+% \begin{center}
+% \begin{tabular}{llll}
+% \opt{open} & \cs{if@openright} & \cs{cleardoublestandardpage} &
+% meaning\\\hline
+% \opt{=any} & \cs{iffalse} & \cs{cleardoubleoddstandardpage} &
+% chapters on any page\\
+% \opt{=right} & \cs{iftrue} & \cs{cleardoubleoddstandardpage} &
+% chapters on odd pages\\
+% \opt{=left} & \cs{iftrue} & \cs{cleardoubleevenstandardpage} &
+% chapters on even pages\\
+% \end{tabular}
+% \end{center}
+% \begin{macrocode}
%<*book|report>
%<*prepare>
\newif\if@openright
%<report>\@openrightfalse
%<book>\@openrighttrue
%</prepare>
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \begin{macrocode}
%<*option>
\KOMA@key{open}{%
\KOMA@set@ncmdkey{open}{@tempa}{%
@@ -196,58 +161,57 @@
\fi
}
%</option>
-% \end{macrocode}
-% \changes{v3.18}{2015/05/22}{indirekte Initialisierung}
-% Die Initialisierung erfolgt indirekt über Option \texttt{headings}.
-% \begin{macrocode}
%<*execoption>
%<book>\KOMAExecuteOptions{headings=openright}
%<report>\KOMAExecuteOptions{headings=openany}
%</execoption>
% \end{macrocode}
-% \end{option}
+% \end{macro}^^A \if@openright
+% \end{option}^^A open
%
-% \begin{option}{openright}
-% \changes{v2.98c}{2008/03/05}{obsolet}%^^A
-% \changes{v3.01a}{2008/11/21}{standard statt obsolet}%^^A
-% \begin{option}{openany}
-% \changes{v2.98c}{2008/03/05}{obsolet}%^^A
-% \changes{v3.01a}{2008/11/21}{standard statt obsolet}%^^A
-% Zusätzlich gibt es einige Standardoptionen, die natürlich auch mit
-% \KOMAScript{} funktionieren sollen.
+% \begin{option}{openright,openany}
+% \changes{v2.98c}{2008/03/05}{obsolete}
+% \changes{v3.01a}{2008/11/21}{standard instead of obsolete}
+% Two deprecated options of \KOMAScript{} 2.
% \begin{macrocode}
%<*option>
\KOMA@DeclareStandardOption{openright}{open=right}
\KOMA@DeclareStandardOption{openany}{open=any}
%</option>
%</book|report>
-%</class>
% \end{macrocode}
-% \end{option}
-% \end{option}
+% \end{option}^^A openright,openany
%
%
-% \subsection{Behandlung von Gliederungsnummern}
+% \subsection{Numbers and the auto dot feature}
%
-% Die Möglichkeit der Nummerierung ist allen Ebenen bis auf \cs{minisec}
-% gemeinsam.
+% Not only parts, chapter, section etc.\@ are numbered. But several other
+% numbers are related to these numbers. The feature we define here is also
+% known as the auto dot feature.
%
% \begin{option}{numbers}
-% \changes{v2.98c}{2008/03/07}{Neue Option}%^^A
-% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit
-% \cs{FamilyKeyState}}%^^A
-% \changes{v3.17}{2015/03/09}{interne Speicherung des Wert}%^^A
-% Dies ist die zentrale Option zur Konfiguration der Nummerierung. Dabei geht
-% es primär um die Gliederungsnummern, es sind jedoch auch davon abgeleitete
-% Nummern betroffen.
+% \changes{v2.98c}{2008/03/07}{added}
+% \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyState}}
+% \changes{v3.17}{2015/03/09}{using internal value storage}
% \begin{macro}{\scr@dotchangeatdocument}
-% \changes{v2.98c}{2008/03/07}{Neu (intern)}%^^A
-% Da die Umschaltung zwischen automatischem Endpunkt, immer Endpunkt und kein
-% Endpunkt unbedingt \emph{vor} \cs{begin{document}} erfolgen muss, wird eine
-% Fehlermeldung ausgegeben, falls das jemand zu einem späteren Zeitpunkt
-% probiert. Umschaltmöglichkeiten sind auf die Klassen beschränkt.
+% \changes{v2.98c}{2008/03/07}{added}
+% The \opt{numbers} option provides several settings for the dot at the end of
+% such numbers. But because the setting is always document global, this option
+% cannot be changed inside the document, but in the document preamble only. If
+% you try to change it inside the document, the error of
+% \cs{scr@dotchangedatdocument} will be raised. Currently following values to
+% the option are supported:
+% \begin{center}
+% \begin{tabular}{ll}
+% \opt{numbers} & meaning\\\hline
+% \opt{=auto} & automatically detect, if the dot has to be added\\
+% \opt{=enddot} & always use a dot at the end\\
+% \opt{=noenddot}& don't use a dot at the end\\
+% \end{tabular}
+% \end{center}
+% The criterion for automatically adding a dot is: Does any sectioning number
+% contain something else but an Arabic number for a number portion?
% \begin{macrocode}
-%<*class>
%<*prepare>
\newcommand*{\scr@dotchangeatdocument}[1]{%
\ClassError{\KOMAClassName}{%
@@ -259,15 +223,6 @@
}%
}
%</prepare>
-% \end{macrocode}
-% \end{macro}
-% Normalerweise wird automatisch entschieden, ob Nummern mit einem
-% Punkt enden müssen oder nicht. Um dies abzuschalten, muss nur der
-% gewünschte Zustand eingeschaltet und die Umschaltmöglichkeit
-% entfernt werden. Die Umschaltung kann jedoch nicht direkt erfolgen, sondern
-% erfolgt zeitverzögert in \cs{begin{document}}. Hier wird nur das Makro
-% umgeschaltet, das dort verwendet wird.
-% \begin{macrocode}
%<*option>
\KOMA@key{numbers}{%
\KOMA@set@ncmdkey{numbers}{@tempa}{%
@@ -297,62 +252,180 @@
%</option>
%<execoption>\KOMAExecuteOptions{numbers=autoendperiod}
% \end{macrocode}
-% \end{option}
-%
-% \begin{option}{pointednumbers}
-% \changes{v2.3h}{1995/01/19}{neue Option}%^^A
-% \changes{v2.4g}{1996/11/04}{die Option heißt nun wirklich so,
-% bei \texttt{pointednumber} wird explizit ein Fehler gemeldet}
-% \changes{v2.4g}{1996/11/04}{\cs{@altsecnumformatfalse} wird
-% direkt auf \cs{@altsecnumformattrue} gesetzt}
-% \changes{v2.98c}{2008/03/07}{obsolet}%^^A
-% \changes{v3.01a}{2008/11/20}{deprecated}%^^A
-% \begin{option}{pointlessnumbers}
-% \changes{v2.3h}{1995/01/19}{neue Option}%^^A
-% \changes{v2.4g}{1996/11/04}{die Option heißt nun wirklich so,
-% bei \texttt{pointlessnumber} wird explizit ein Fehler gemeldet}
-% \changes{v2.4g}{1996/11/04}{\cs{@altsecnumformattrue} wird direkt
-% auf \cs{@altsecnumformatfalse} gesetzt}
-% \changes{v2.98c}{2008/03/07}{obsolet}%^^A
-% \changes{v3.01a}{2008/11/20}{deprecated}%^^A
-% Diese Optionens sind nun wirklich veraltet und sollten nicht mehr verwendet
-% werden!
+% \end{macro}^^A \scr@dotchangeatdocument
+% \end{option}^^A numbers
+%
+% \begin{option}{pointednumbers,pointlessnumbers}
+% \changes{v2.3h}{1995/01/19}{added}
+% \changes{v2.4g}{1996/11/04}{option name fixed}
+% \changes{v2.4g}{1996/11/04}{immediate setting \cs{@altsecnumformatfalse}
+% to \cs{@altsecnumformattrue}}
+% \changes{v2.98c}{2008/03/07}{obsolete}
+% \changes{v3.01a}{2008/11/20}{deprecated}
+% Two deprecated options.
% \begin{macrocode}
%<*option>
\KOMA@DeclareDeprecatedOption{pointednumbers}{numbers=enddot}
\KOMA@DeclareDeprecatedOption{pointlessnumbers}{numbers=noenddot}
%</option>
% \end{macrocode}
-% Übrigens weiß ich, wie blödsinnig die Namen der Optionen sind. Aber
-% das ist nun nicht mehr zu ändern.
-% \end{option}
-% \end{option}
+% \end{option}^^A pointednumbers,pointlessnumbers
+%
+% \begin{command}{\autodot}
+% \changes{v2.7}{2001/01/03}{added}
+% \begin{macro}{\@altsecnumformattrue,\@altsecnumformatfalse,\if@altsecnumformat}
+% \changes{v2.3c}{1995/08/06}{added}
+% \begin{macro}{\@autodottrue,\@autodotfalse,\if@autodot}
+% \changes{v2.8e}{2001/07/10}{added}
+% \changes{v2.9k}{2003/01/12}{write to \cs{@mainaux}}
+% \changes{v2.95}{2004/01/15}{write to \cs{@mainaux} just before closing the
+% file}
+% \changes{v2.96a}{2006/12/07}{using \cs{immediate}}
+% \changes{v3.00}{2008/10/07}{global}
+% \changes{v3.20}{2016/03/25}{using \cs{csname}\dots\cs{endcsname}}
+% Depending on \cs{if@altsecnumformat} \cs{autodot} shows a dot or nothing.
+% \begin{description}
+% \item[ToDo:] Add an optional look forward feature to also not add a dot, if
+% the next character is a punctuation character, e.g. a dot, semicolon,
+% comma etc.
+% \end{description}
+% \cs{if@autodot} is the current result of the inspection of all sectioning
+% numbers. If it is \cs{iftrue}, switching on the dot will be written to the
+% main \file{aux}-file.
+% \begin{macrocode}
+%<*prepare>
+\newif\if@altsecnumformat\@altsecnumformatfalse
+\newif\if@autodot
+\renewcommand*{\@autodottrue}{\global\let\if@autodot\iftrue}
+\renewcommand*{\@autodotfalse}{\global\let\if@autodot\iffalse}
+\@autodotfalse
+%</prepare>
+%<*body>
+\BeforeClosingMainAux{%
+ \if@autodot\if@filesw\immediate\write\@mainaux{%
+ \string\global\string\csname\space @altsecnumformattrue\string\endcsname}%
+ \fi\fi}
+%</body>
+% \end{macrocode}
+% \end{macro}^^A \if@autodot
+% \end{macro}^^A \if@altsecnumformat
+%
+% \begin{macro}{\scr@altsecnumhook,\scr@altsecnumhooktrue,\scr@altsecnumhookfalse}
+% \changes{v2.98c}{2008/03/07}{added}
+% Used by option \opt{numbers} for (de-)activation of the dot in the document
+% preamble and to overwrite the setting found in the \file{aux}-file.
+% \begin{description}
+% \item[Note:] The hook is executed after reading the main \file{aux}-file. So
+% the overwriting of the setting does work. It is needed as long a boolean
+% switch is used, because otherwise option \opt{numbers=auto} would not be
+% able to reset option \opt{numbers=enddot} ot \opt{numbers=noenddot}. With
+% this code we simply can use an empty \cs{scr@altsecnumhook} for
+% \opt{numbers=auto} and two compellent definitions for the other cases.
+% \end{description}
+% \begin{macrocode}
+%<*prepare>
+\newcommand*{\scr@altsecnumhook}{}
+\AtBeginDocument{\scr@altsecnumhook}
+\newcommand*{\scr@altsecnumhooktrue}{%
+ \@altsecnumformattrue\global\let\@altsecnumformatfalse\@altsecnumformattrue
+}
+\newcommand*{\scr@altsecnumhookfalse}{%
+ \@altsecnumformatfalse\global\let\@altsecnumformattrue\@altsecnumformatfalse
+}
+%</prepare>
+% \end{macrocode}
+% \end{macro}^^A \scr@altsecnumhook,\scr@altsecnumhooktrue,\scr@altsecnumhookfalse
+%
+% \begin{macro}{\@maybeautodot,\@@maybeautodot}
+% \changes{v2.8e}{2001/07/10}{added}
+% \changes{v3.00}{2008/10/07}{not any longer needed \cs{aftergroup} removed}
+% We scan a \cs{the\meta{counter}} command to decide, if the automatic dot has
+% to be added (later). It sets \cs{@autodottrue}, if there is any kind of
+% alphabetic or Roman numbering command inside the one time expansion of the
+% \cs{the\meta{counter}} given as argument.
+% \begin{description}
+% \item[Note:] This is a heuristic only. It would, e.g., fail, if you are
+% using another macro, that expands to the output of the counter, e.g.,
+%\begin{verbatim}
+% \def\myalph{\alph}\def\thesection{\myalph{section}}
+%\end{verbatim}
+% However, it seems that the heuristic is so good, that in more than twenty
+% years nobody has complained about.
+% \end{description}
+% \begin{macrocode}
+%<*body>
+\newcommand{\@maybeautodot}[1]{\if@autodot\else\begingroup%
+ \expandafter\@@maybeautodot #1\@stop\endgroup\fi
+}
+\newcommand*{\@@maybeautodot}[1]{%
+ \ifx #1\@stop\let\@@maybeautodot\relax
+ \else
+ \ifx #1\Alph \@autodottrue\fi
+ \ifx #1\alph \@autodottrue\fi
+ \ifx #1\Roman \@autodottrue\fi
+ \ifx #1\roman \@autodottrue\fi
+ \ifx #1\@Alph \@autodottrue\fi
+ \ifx #1\@alph \@autodottrue\fi
+ \ifx #1\@Roman \@autodottrue\fi
+ \ifx #1\@roman \@autodottrue\fi
+ \ifx #1\romannumeral \@autodottrue\fi
+ \fi
+ \@@maybeautodot
+}
+%</body>
+% \end{macrocode}
+% \end{macro}^^A \@maybeautodot,\@@maybeautodot
%
-% \begin{Counter}{secnumdepth}
-% Dieser Zähler gibt an, bis zu welcher Ebene die Gliederungsüberschriften
-% nummeriert werden.
+% \begin{macrocode}
+%<*body>
+\newcommand*\autodot{\if@altsecnumformat.\fi}
+%</body>
+% \end{macrocode}
+% \end{command}^^A \autodot
+%
+%
+% \subsection{Definition and handling of sectioning commands}
+%
+% Some of the \LaTeX{} kernel features are used here too. But almost none of
+% these features is enough to implement all the functionality of \KOMAScript{}
+% classes. So we redefine several of the \LaTeX{} kernel macros to extend them
+% and define several new features.
+% \begin{description}
+% \item[ToDo:] Don't redefine \LaTeX{} kernel macros, but define new macros
+% for the interface. Maybe this should also be swapped to a new package used
+% by the classes.
+% \end{description}
+%
+% \begin{counter}{secnumdepth}
+% The counter rules down to which section level the headings should be
+% numbered.
+% \begin{description}
+% \item[ToDo:] Move this behind the declaration of the section levels to be
+% able to use symbolic value \cs{subsectionnumdepth}. It is not related to
+% the auto dot feature.
+% \end{description}
% \begin{macrocode}
%<*body>
%<book|report>\setcounter{secnumdepth}{2}
%<article>\setcounter{secnumdepth}{3}
%</body>
% \end{macrocode}
-% \end{Counter}
+% \end{counter}
%
%
-% \begin{macro}{\ifnumbered}
-% \changes{v3.12}{2013/12/16}{new command}%^^A
-% \changes{v3.28}{2019/11/19}{renamed to \cs{Ifnumbered}}%^^A
-% \begin{macro}{\Ifnumbered}
-% \changes{v3.28}{2019/11/19}{renamed from \cs{ifnumbered}}%^^A
-% \begin{macro}{\ifunnumbered}
-% \changes{v3.12}{2013/12/16}{new command}%^^A
-% \changes{v3.28}{2019/11/19}{renamed to \cs{Ifunnumbered}}%^^A
-% \begin{macro}{\Ifunnumbered}
-% \changes{v3.28}{2019/11/19}{renamed from \cs{ifunnumbered}}%^^A
-% Test, ob eine Gliederungsebene (\texttt{\#1}) nummeriert wird. Falls das der
-% Fall ist, wird das zweite Argument verwendet, sonst das dritte. Bei
-% \cs{ifunnumbered} ist die Logik genau vertauscht.
+% \begin{command}{\ifnumbered,\Ifnumbered}
+% \changes{v3.12}{2013/12/16}{added}
+% \changes{v3.28}{2019/11/19}{\cs{ifnumbered} renamed to \cs{Ifnumbered}}
+% \begin{command}{\ifunnumbered,\Ifunnumbered}
+% \changes{v3.12}{2013/12/16}{added}
+% \changes{v3.28}{2019/11/19}{\cs{ifunnumbered} renamed to \cs{Ifunnumbered}}
+% Commands
+% \begin{quote}\raggedright
+% \cs{Ifnumbered}\marg{section level name}\marg{numbered}\marg{not numbered}\\
+% \cs{Ifunnumbered}\marg{section level name}\marg{not numbered}\marg{numbered}\\
+% \end{quote}
+% If \meta{section level name} has to be numbered, execute code \meta{numbered}
+% otherwise execute code \meta{not numbered}.
% \begin{macrocode}
%<*body>
\providecommand*{\ifnumbered}{%
@@ -392,240 +465,90 @@
\Ifnumbered{#1}{\@secondoftwo}{\@firstoftwo}%
}
%</body>
-%</class>
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
+% \end{command}^^A \Ifunnumbered
+% \end{command}^^A \ifnumbered
%
-% \subsection{\KOMAScript-eigene Befehle zur Definition von
-% Gliederungsbefehlen}
%
-% Die Funktionalität des \LaTeX-Kerns genügt \KOMAScript{} bei der Definition
-% von Gliederungsebenen nicht.
-%
-% \begin{macro}{\scr@activate@xsection}
-% \changes{v3.10}{2011/08/30}{neu (intern)}%^^A
-% Hiermit wird die Erweiterung für das optionale Argument der
-% Gliederungsbefehle eingeschaltet.
-% \begin{macro}{\scr@osectarg}%^^A
-% Für die nicht per \cs{@startsection} implementierten Befehle geht das
-% einfach durch Umschaltung von \cs{scr@osectarg}. Bei 0 ist die Aktivierung
-% nicht aktiv. Bei 1 landet das optionale Argument hingegen im Kopf, bei 2
-% im Inhaltsverzeichnis und bei 3 in beiden. Die Voreinstellung ist deshalb
-% ebenfalls 0.
-%
-% Da Option \texttt{headings} darauf zurückgreift, müssen die beiden Makros
-% bereits vorab definiert werden.
+% \begin{macro}{\scr@activate@xsection,\scr@osectarg}
+% \changes{v3.10}{2011/08/30}{added}
+% Option \opt{headings=optiontotocandhead}, \opt{headings=optiontotoc} and
+% \opt{headings=optiontohead} used
+% \begin{quote}
+% \cs{scr@activate@xsection}\marg{value}
+% \end{quote}
+% with the values 3, 2 and 1 to activate the extended optional argument. This
+% sets \cs{scr@osectarg} to the corresponding value. The initial value 0
+% deactivates the extended optional argument.
+% \begin{description}
+% \item[ToDo:] Do we really need \cs{scr@activate@xsection}, that is used
+% inside option \opt{headings} only?
+% \end{description}
% \begin{macrocode}
-%<*class>
%<*prepare>
\newcommand*{\scr@osectarg}{0}
\newcommand*{\scr@activate@xsection}[1]{%
\renewcommand*{\scr@osectarg}{#1}%
}
%</prepare>
-%</class>
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-% \begin{macro}{\if@altsecnumformat}
-% \changes{v2.3c}{1995/08/06}{neuer Schalter}%^^A
-% \begin{macro}{\@altsecnumformattrue}
-% \begin{macro}{\@altsecnumformatfalse}
-% Dieses Schalter wird für die Umschaltung auf Duden-Regel~6 bei der
-% Numerierung benötigt.
-% \begin{macro}{\if@autodot}
-% \changes{v2.8e}{2001/07/10}{neuer Schalter}%^^A
-% \begin{macro}{\@autodottrue}
-% \changes{v3.00}{2008/10/07}{arbeitet nun gobal}%^^A
-% \begin{macro}{\@autodotfalse}
-% \changes{v3.00}{2008/10/07}{arbeitet nun gobal}%^^A
-% Nach Duden 20.~Auflage, Regel~5 wird in der Gliederung kein Punkt gesetzt,
-% wenn diese rein mit arabischen Zahlen erfolgt. Nach Regel~6 folgt jedoch ein
-% Punkt, wenn die Gliederung auch römische Zahlen oder Großbuchstaben
-% enthält. Aus Konsistenzgründen muss der Punkt in diesem Fall immer gesetzt
-% werden. \KOMAScript{} bietet dafür einen Automatismus.
-%
-% Damit die Umschaltung auch wieder zurück auf Regel~5 automatisch erfolgen
-% kann, wird ein zweiter Schalter benötigt.
-% \begin{macrocode}
-%<*class>
-%<*prepare>
-\newif\if@altsecnumformat\@altsecnumformatfalse
-\newif\if@autodot
-\renewcommand*{\@autodottrue}{\global\let\if@autodot\iftrue}
-\renewcommand*{\@autodotfalse}{\global\let\if@autodot\iffalse}
-\@autodotfalse
-%</prepare>
-% \end{macrocode}
-% Dabei soll die Umstellung des Punktes beim zweiten TeX-Lauf bereits am
-% Anfang aktiv sein. Deshalb wird die Information am Ende in die aux-Datei
-% geschrieben.
-% \changes{v2.9k}{2003/01/12}{es wird direkt in \cs{@mainaux} geschrieben}%^^A
-% \changes{v2.95}{2004/01/15}{es wird erst unmittelbar vor dem Schließen
-% der Haupt-aux-Datei in diese geschrieben}%^^A
-% \changes{v2.96a}{2006/12/07}{es wird \cs{immediate} geschrieben}%^^A
-% \changes{v3.20}{2016/03/25}{es wird \cs{csname}\dots\cs{endcsname}
-% verwendet}%^^A
-% \begin{macrocode}
-%<*body>
-\BeforeClosingMainAux{%
- \if@autodot\if@filesw\immediate\write\@mainaux{%
- \string\global\string\csname\space @altsecnumformattrue\string\endcsname}%
- \fi\fi}
-%</body>
-% \end{macrocode}
-% \end{macro}%^^A \@autodotfalse
-% \end{macro}%^^A \@autodottrue
-% \end{macro}%^^A \if@autodot
-% \end{macro}%^^A \@altsecnumformatfalse
-% \end{macro}%^^A \@altsecnumformattrue
-% \end{macro}%^^A \if@altsecnumformat
-%
-% \begin{macro}{\scr@altsecnumhook}
-% \changes{v2.98c}{2008/03/07}{Neu (intern)}%^^A
-% \begin{macro}{\scr@altsecnumhooktrue}
-% \changes{v2.98c}{2008/03/07}{Neu (intern)}%^^A
-% \begin{macro}{\scr@altsecnumhookfalse}
-% \changes{v2.98c}{2008/03/07}{Neu (intern)}%^^A
-% Es werden drei Hilfsmakros benötigt. Das erste davon wird bei
-% \cs{begin{document}} ausgeführt (nachdem die \texttt{aux}-Datei gelesen
-% wurde!) und schaltet den gewünschten Zustand ein. Dazu wird es per Option
-% ggf. auf die eine oder andere Bedeutung umgeschaltet. Im Auto-Fall ist es
-% übrigens \cs{@empty}.
-% \begin{macrocode}
-%<*prepare>
-\newcommand*{\scr@altsecnumhook}{}
-\AtBeginDocument{\scr@altsecnumhook}
-\newcommand*{\scr@altsecnumhooktrue}{%
- \@altsecnumformattrue\global\let\@altsecnumformatfalse\@altsecnumformattrue
-}
-\newcommand*{\scr@altsecnumhookfalse}{%
- \@altsecnumformatfalse\global\let\@altsecnumformattrue\@altsecnumformatfalse
-}
-%</prepare>
-% \end{macrocode}
-% \end{macro}%^^A \scr@altsecnumhooktrue
-% \end{macro}%^^A \scr@altsecnumhookfalse
-% \end{macro}%^^A \scr@altsecnumhook
-%
-% \begin{macro}{\@maybeautodot}
-% \changes{v2.8e}{2001/07/10}{neu (intern)}%^^A
-% Ob der automatische Punkt aktiviert werden muss, wird aufgrund der
-% Darstellung eines Zählers entschieden. Diese wird dem Makro als Argument
-% übergeben (\cs{thepart}, \cs{thechapter} etc.). Durch Verwendung einer
-% Gruppe, werden alle Definitionen lokal gehalten.
-% \begin{macrocode}
-%<*body>
-\newcommand{\@maybeautodot}[1]{\if@autodot\else\begingroup%
- \expandafter\@@maybeautodot #1\@stop\endgroup\fi
-}
-% \end{macrocode}
-% \begin{macro}{\@@maybeautodot}
-% \changes{v2.8e}{2001/07/10}{neu (intern)}%^^A
-% \changes{v3.00}{2008/10/07}{neuerdings überflüssige \cs{aftergroup}%^^A
-% entfernt}%^^A
-% Die expandierte Darstellung wird dann auf Darstellungsbefehle für
-% Zähler gescannt.
-% \begin{macrocode}
-\newcommand*{\@@maybeautodot}[1]{%
- \ifx #1\@stop\let\@@maybeautodot\relax
- \else
- \ifx #1\Alph \@autodottrue\fi
- \ifx #1\alph \@autodottrue\fi
- \ifx #1\Roman \@autodottrue\fi
- \ifx #1\roman \@autodottrue\fi
- \ifx #1\@Alph \@autodottrue\fi
- \ifx #1\@alph \@autodottrue\fi
- \ifx #1\@Roman \@autodottrue\fi
- \ifx #1\@roman \@autodottrue\fi
- \ifx #1\romannumeral \@autodottrue\fi
- \fi
- \@@maybeautodot
-}
-%</body>
% \end{macrocode}
-% \end{macro}%^^A \@@maybeautodot
-% \end{macro}%^^A \@maybeautodot
-%
-% \begin{macro}{\autodot}
-% \changes{v2.7}{2001/01/03}{neu}%^^A
-% Dieses Makro setzt dann den Punkt nach Bedarf.
-% \begin{macrocode}
-%<*body>
-\newcommand*\autodot{\if@altsecnumformat.\fi}
-%</body>
-% \end{macrocode}
-% \end{macro}
+% \end{macro}^^A \scr@activate@xsection,\scr@osectarg
%
%
% \begin{macro}{\@startsection}
-% \changes{v3.13a}{2014/09/11}{Vollständige Neudefinition zur Optimierung
-% der Erweiterung für das optionale Argument}%^^A
+% \changes{v3.13a}{2014/09/11}{re-definition for extended optional argument}
% \begin{macro}{\scr@startsection}
-% \changes{v3.13a}{2014/09/11}{Neue interne Anweisung}%^^A
-% \changes{v3.18}{2015/05/22}{verwende \cs{numexpr} für Argument 2}
-% \changes{v3.18}{2015/05/22}{verwende \cs{glueexpr} für Argument 3--5}
-% \changes{v3.20}{2016/04/12}{\cs{@ifstar} durch \cs{kernel@ifstar}
-% ersetzt}%^^A
-% \changes{v3.26}{2018/09/18}{\texttt{afterindent}-Einstellung wird
-% beachtet}%^^A
+% \changes{v3.13a}{2014/09/11}{added}
+% \changes{v3.18}{2015/05/22}{using \cs{numexpr} for argument 2}
+% \changes{v3.18}{2015/05/22}{using \cs{glueexpr} for arguments 3--5}
+% \changes{v3.20}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
+% \changes{v3.26}{2018/09/18}{supporting \opt{afterindent}}
% \begin{macro}{\scr@saved@startsection}
-% \changes{v3.13a}{2014/09/11}{Neue interne Anweisung}%^^A
-% \changes{v3.20}{2016/04/12}{Tests funktionieren jetzt auch mit
-% \textsf{amsgen}}%^^A
-% \KOMAScript{} benötigt ein eigenes \cs{@startsection}, weil die
-% Funktionalität des \cs{@startsection} aus dem \LaTeX-Kern nicht
-% genügt. Bevor allerdings die eigene Definition in Angriff genommen wird,
-% muss kontrolliert werden, ob die aufgefundene Definition noch den
-% Erwartungen entspricht. Alles andere wäre ein deutlicher Hinweis, dass
-% eventuell in \KOMAScript{} ebenfalls eine Anpassung vorzunehmen wäre.
-% Da es offenbar Leute gibt, die bei der Umdefinierung von \cs{section}
-% etc. mit Hilfe von \cs{@startsection} Leerzeichen zwischen die Argumente
-% packen und gleichzeitig \textsf{amsgen} verwenden, sorgen wir hier dafür,
-% dass dann trotzdem noch die Warnungen funktionieren und nebenbei der Code
-% mit etwas Glück sogar ebenfalls. Dazu ist es notwendig, dass die Version von
-% \cs{@startsection} gespeichert wird, die \cs{kernel@ifstar} verwendet.
-% \begin{macro}{\startsection@sectionname}
-% \changes{v3.26}{2018/05/14}{Neue Anweisung für Paketautoren}%^^A
-% \begin{macro}{\startsection@secnumdepth}
-% \changes{v3.26}{2018/05/14}{Neue Anweisung für Paketautoren}%^^A
-% \begin{macro}{\startsection@indent}
-% \changes{v3.26}{2018/05/14}{Neue Anweisung für Paketautoren}%^^A
-% \begin{macro}{\startsection@beforeskip}
-% \changes{v3.26}{2018/05/14}{Neue Anweisung für Paketautoren}%^^A
-% \begin{macro}{\startsection@afterskip}
-% \changes{v3.26}{2018/05/14}{Neue Anweisung für Paketautoren}%^^A
-% \begin{macro}{\if@startsection@runin}
-% \changes{v3.26}{2018/05/14}{Neue Anweisung für Paketautoren}%^^A
-% \begin{macro}{\startsection@afterindent}
-% \changes{v3.26}{2018/09/18}{Neue Anweisung für Paketautoren}%^^A
-% Ab dem Zeitpunkt des Aufrufs des Do-Hooks
-% \texttt{heading/postinit} sind die Makros
-% \cs{startsection@sectionname}, \cs{startsection@secnumdepth},
-% \cs{startsection@indent}, \cs{startsection@beforeskip},
-% \cs{if@startsection@indentafter}, \cs{startsection@afterskip},
-% \cs{if@startsection@runin} und \cs{startsection@afterindent} gültig. Die
-% \cs{\dots indent}- und \cs{\dots skip}-Makros sind dabei skips (oder
-% \cs{glueexpr}) und somit wie Längen verwendbar. Bei den beiden \cs{\dots
-% skip}-Makros handelt es sich bereits um effektive Abstände, es wurden also
-% etwaige Fallunterscheidungen bezüglich des Vorzeichens des Arguments für
-% \cs{scr@startsection} bereits aufgelöst. Das \cs{if\dots}-Makro ist entweder
-% \cs{iftrue} oder \cs{iffalse}. Ein \cs{if@startsection@afterindent}
-% existiert nicht, weil \cs{if@afterindent} zu dem Zeitpunkt bereits gültig
-% ist. Außerhalb von \cs{scr@startsection} ist die Verwendung dieser Macros
-% unzulässig, bzw. das Ergebnis unspezifiziert. Ebenso sind diese Macros als
-% \emph{read-only} zu betrachten!
-%^^A TODO: Der ganze Test hier ist eigentlich Unfug. Beim Laden
-%^^A der Klasse sollte die Kern-Anweisung noch unverändert sein, da Pakete
-%^^A normalerweise erst danach zum Zuge kommen und sie umdefinieren
-%^^A können. Also müsste eigentlich \cs{AtBeginDocument} getestet werden. Ich
-%^^A werde mir das gelegentlich noch einmal vornehmen müssen.
+% \changes{v3.13a}{2014/09/11}{added}
+% \changes{v3.20}{2016/04/12}{supporting \pkg{amsgen}}
+% \begin{macro}{\startsection@sectionname,\startsection@secnumdepth,
+% \startsection@indent,\startsection@beforeskip,
+% \startsection@afterskip,\startsection@afterindent,
+% \@startsection@runintrue,\@startsection@runinfalse,
+% \if@startsection@runin}
+% \changes{v3.26}{2018/05/14}{added}
+% The \cs{@startsection} of the \LaTeX{} kernel does not provide all the
+% features we need for \KOMAScript. And the generic hooks of \LaTeX{} do not
+% allow to change it wide enough. So we either have to use \pkg{xparse} to
+% patch it very much or we have to define our own version. In this case
+% patching is too fragile, so we define \cs{scr@startsection} and store the
+% original definition in \cs{scr@saved@startsection}.
+% \begin{description}
+% \item[Note:] Package \pkg{amsgen} redefines \cs{@ifstar}. The new version
+% does not ignore white spaces. So testing the original definition using
+% \cs{@ifstar} may fail. It is better to use \cs{kernel@ifstar}.
+% \item[ToDo:] All the testing here doesn't make much sense, because we are
+% inside a class and packages like \pkg{amsgen} should not yet have been
+% loaded. So the test only needs to test, if the \LaTeX{} kernel has been
+% changed.
+% \item[Note:] In our own \cs{scr@startsection} the macros
+% \cs{startsection@sectionname}, \cs{startsection@secnumdepth},
+% \cs{startsection@indent}, \cs{startsection@beforeskip},
+% \cs{startsection@afterskip}, \cs{if@afterindent},
+% \cs{if@startsection@runin}, and \cs{startsection@afterindent} are valid
+% from executing the do hook \dhook{heading/postinit}. So they can be used
+% inside all the hooks.
+% \item[Note:] \cs{startsection@indent}, \cs{startsection@beforeskip},
+% \cs{startsection@afterskip} and \cs{startsection@afterindent} are either
+% skips or \cs{glueexpr}, that can be used like skips.
+% \item[Note:] \cs{startsection@beforeskip} and \cs{startsection@afterskip}
+% are effective values already. Not special treatment for negative or
+% positive values must be done.
+% \item[Note:] \cs{if@startsection@runin}
+% are either \cs{iftrue} or \cs{iffalse}.
+% \item[Note:] \cs{if@startsection@indentafter} does not exist and is not
+% needed, because \cs{if@afterindent} is already valid and also either
+% \cs{iftrue} or \cs{iffalse}.
+% \item[Note:] Using one of the \cs{startsection@\dots}
+% resp. \cs{if@startsection@\dots} macros outside \cs{scr@startsection} is
+% not allowed and the result is unspecified. Inside \cs{scr@startsection}
+% they have to be interpreted as constants, so changing them is not allowed!
+% \end{description}
% \begin{macrocode}
%<*body>
\newcommand*{\scr@saved@startsection}[6]{%
@@ -768,23 +691,24 @@
\fi
% \end{macrocode}
% \begin{macro}{\scr@sect@runin}
-% \changes{v3.26}{2018/09/18}{neu (intern)}
-% Diese Hilfsanweisung nimmt die Fallunterscheidung vor, ob eine Spitzmarke
-% oder eine freistehende Überschrift oder abhängig vom Vorzeichen des
-% Abstandes danach eine Spitzmarke oder eine freistehende Überschrift gesetzt
-% werden soll. Die Voreinstellung ist sicherheitshalber letzteres. Diese
-% Voreinstellung wird auch bei jedem Aufruf von \cs{@xsect} erneut
-% erzwungen. Auch in \cs{scr@startsection} wird die Anweisung angepasst.
+% \changes{v3.26}{2018/09/18}{added}
+% Depending on sectioning feature \opt{runin} the macro expands to the first
+% argument, if a in-text heading aka run-in heading has to used, the second
+% argument, if a free-standing heading has to be used, or the third argument,
+% of run-in or free-standing depends on the sign of \opt{afterskip}. The
+% initial definition is depending on the sign of \opt{afterskip}. This initial
+% definition is also done inside \cs{@xsect}. \cs{scr@startsection} also
+% redefines \cs{scr@sect@runin}. So it should always be the currently valid
+% definition, even if \cs{scr@startsection} is used with a section command,
+% that does not provide all the variable of \KOMAScript.
% \begin{macrocode}
\newcommand*{\scr@sect@runin}[3]{#3}
% \end{macrocode}
-% \end{macro}%^^A \scr@sect@runin
+% \end{macro}^^A \scr@sect@runin
% \begin{macro}{\scr@startsection@ulm@error}
-% \changes{v3.26}{2018/05/14}{Neue interne Anweisung}
-% Ich bin mir bewusst, dass die Fehlerausgabe, die hier definiert wird,
-% vermutlich nie aufgerufen wird, da ein Paketautor hierzu eines der Makros
-% bereits vor dem ersten \cs{scr@startsection}-Befehl verwenden
-% müsste. Trotzdem verwende ich es quasi zwecks Initialisierung.
+% \changes{v3.26}{2018/05/14}{added}
+% This is the initial error message for using one of the internal macros
+% before \cs{scr@startsection}. This should never happen.
% \begin{macrocode}
\newcommand*{\scr@startsection@ulm@error}[1]{%
\ClassError{\KOMAClassName}{%
@@ -812,23 +736,15 @@
\newcommand*\startsection@afterindent{%
\scr@startsection@ulm@error\startsection@afterindent}
% \end{macrocode}
-% \end{macro}%^^A \scr@startsection@ulm@error
-% \end{macro}%^^A \scr@startsection@afterindent
-% \end{macro}%^^A \if@startsection@runin
-% \end{macro}%^^A \startsection@afterskip
-% \end{macro}%^^A \startsection@beforeskip
-% \end{macro}%^^A \startsection@indent
-% \end{macro}%^^A \startsection@secnumdepth
-% \end{macro}%^^A \startsection@sectionname
+% \end{macro}^^A \scr@startsection@ulm@error
+% \end{macro}^^A \startsection@sectionname … \scr@startsection@runin
% \begin{macro}{\At@startsection}
-% \changes{v3.14}{2014/09/11}{Neue Anweisung für Paketautoren}%^^A
-% \changes{v3.27}{2019/02/04}{Umgestellt auf \cs{AddtoDoHook}}%^^A
-% \changes{v3.27}{2019/02/04}{deprecated}%^^A
-% Mit Hilfe dieser Anweisung kann Code in die Ausführung von \KOMAScript's
-% eigenem \cs{scr@startsection} an der Stelle eingefügt werden, an der
-% \cs{if@afterindent} und \cs{@tempskipa} bereits korrekt eingestellt sind,
-% aber noch bevor \emph{pentaly} und Abstand gesetzt wurden bzw. \cs{everypar}
-% gelöscht wurde.
+% \changes{v3.14}{2014/09/11}{added}
+% \changes{v3.27}{2019/02/04}{using \cs{AddtoDoHook}}
+% \changes{v3.27}{2019/02/04}{deprecated}
+% This is deprecated now. You should use the corresponding
+% \dhook{heading/postinit} do hook. However the do hooks are command specific,
+% but the argument of \cs{At@startsection} is style specific.
% \begin{macrocode}
\newcommand*{\At@startsection}[1]{%
\ClassInfo{\KOMAClassName}{%
@@ -841,24 +757,25 @@
}
% \end{macrocode}
% \begin{macro}{\scr@doonlyifstyleofargis}
-% \changes{v3.27}{2019/02/04}{neu (intern)}
-% Hilfsmakro für \cs{At@startsection}, \cs{Before@sect} und \cs{Before@@sect}.
+% \changes{v3.27}{2019/02/04}{added}
+% Execute the first argument only, of the style of the third argument is the
+% second argument.
% \begin{macrocode}
\newcommand*{\scr@doonlyifstyleofargis}[3]{%
\IfSectionCommandStyleIs{#3}{#2}{#1}{}%
}
% \end{macrocode}
-% \end{macro}%^^A \scr@doonlyifstyleofargis
-% \end{macro}%^^A \At@startsection
+% \end{macro}^^A \scr@doonlyifstyleofargis
+% \end{macro}^^A \At@startsection
% \begin{macro}{\Before@ssect}
-% \changes{v3.14}{2014/09/11}{Neue Anweisung für Paketautoren}
-% \changes{v3.27}{2019/02/04}{Umgestellt auf \cs{AddtoDoHook}}
+% \changes{v3.14}{2014/09/11}{added}
+% \changes{v3.27}{2019/02/04}{using \cs{AddtoDoHook}}
% \changes{v3.27}{2019/02/04}{deprecated}
% \changes{v3.35}{2021/10/15}{\cs{ClassWarning} instead of \cs{ClassInfo}}
% \changes{v3.35}{2021/10/15}{Usage of \cs{scr@doonlyifstyleofargis} fixed}
-% Mit Hilfe dieser Anweisung kann Code in die Ausführung von \KOMAScript's
-% eigenem \cs{scr@startsection} unmittelbar vor dem Aufruf von \cs{@ssect}
-% eingefügt werden.
+% This is deprecated now. You should use the corresponding
+% \dhook{heading/branch/star} do hook. However the do hooks are command
+% specific, but the argument of \cs{Before@ssect} is style specific.
% \begin{macrocode}
\newcommand*{\Before@ssect}[1]{%
\ClassWarning{\KOMAClassName}{%
@@ -870,16 +787,16 @@
\AddtoDoHook{heading/branch/star}{\scr@doonlyifstyleofargis{#1}{section}}%
}
% \end{macrocode}
-% \end{macro}%^^A \Before@ssect
+% \end{macro}^^A \Before@ssect
% \begin{macro}{\Before@sect}
-% \changes{v3.14}{2014/09/11}{Neue Anweisung für Paketautoren}%^^A
-% \changes{v3.27}{2019/02/04}{Umgestellt auf \cs{AddtoDoHook}}%^^A
-% \changes{v3.27}{2019/02/04}{deprecated}%^^A
-% Mit Hilfe dieser Anweisung kann Code in die Ausführung von \KOMAScript's
-% eigenem \cs{scr@startsection} unmittelbar vor dem Aufruf von \cs{@sect}
-% eingefügt werden.
+% \changes{v3.14}{2014/09/11}{added}
+% \changes{v3.27}{2019/02/04}{using \cs{AddtoDoHook}}
+% \changes{v3.27}{2019/02/04}{deprecated}
% \changes{v3.35}{2021/10/15}{\cs{ClassWarning} instead of \cs{ClassInfo}}
% \changes{v3.35}{2021/10/15}{Usage of \cs{scr@doonlyifstyleofargis} fixed}
+% This is deprecated now. You should use the corresponding
+% \dhook{heading/branch/nostar} do hook. However the do hooks are command
+% specific, but the argument of \cs{Before@sect} is style specific.
% \begin{macrocode}
\newcommand*{\Before@sect}[1]{%
\ClassWarning{\KOMAClassName}{%
@@ -891,11 +808,13 @@
\AddtoDoHook{heading/branch/nostar}{\scr@doonlyifstyleofargis{#1}{section}}%
}
% \end{macrocode}
-% \end{macro}%^^A \Before@sect
-% \begin{macro}{\scr@section@dblarg}
-% \changes{v3.13a}{2014/09/11}{Neue interne Anweisung}%^^A
-% \begin{macro}{\scr@section@xdblarg}
-% \changes{v3.13a}{2014/09/11}{Neue interne Anweisung}%^^A
+% \end{macro}^^A \Before@sect
+% \begin{macro}{\scr@section@dblarg,\scr@section@xdblarg}
+% \changes{v3.13a}{2014/09/11}{added}
+% Similar to the \LaTeX{} kernel macros \cs{@dblarg} and \cs{@xdblarg} but
+% preserve the definition of \cs{scr@osectarg}. So changes of
+% \cs{scr@osectarg} inside the definition of the command of the first
+% argument, are locally to the execution of that command.
% \begin{macrocode}
\newcommand{\scr@section@dblarg}[1]{%
\kernel@ifnextchar[%]
@@ -910,10 +829,16 @@
\reserved@a
}
% \end{macrocode}
-% \end{macro}%^^A \scr@section@xdblarg
-% \end{macro}%^^A \scr@section@dblarg
-% \end{macro}%^^A \scr@saved@startsection
-% \end{macro}%^^A \scr@startsection
+% \end{macro}^^A \scr@section@dblarg,\scr@section@xdblarg
+% \end{macro}^^A \scr@saved@startsection
+% \end{macro}^^A \scr@startsection
+% \begin{description}
+% \item[ToDo:] Currently we still redefine \cs{@startsection} to use either
+% \cs{scr@saced@startsection} or \cs{scr@startsection}. But it would be
+% better to not redefine a \LaTeX{} kernel macro. However, if not doing so,
+% packages, that use \cs{@startsection} would not support \KOMAScript{}
+% features without detecting \KOMAScript{} and using \cs{scr@startsection}.
+% \end{description}
% \begin{macrocode}
\renewcommand*{\@startsection}{%
\ifnum \scr@osectarg=\z@
@@ -924,15 +849,15 @@
}
%</body>
% \end{macrocode}
-% \end{macro}%^^A \@startsection
+% \end{macro}^^A \@startsection
%
-% \begin{macro}{\UseNumberUsageError}
-% \changes{v3.27}{2019/02/02}{Neu}
-% \begin{macro}{\IfUseNumber}
-% \changes{v3.27}{2019/02/02}{Explizite Fehlermeldung bei Verwendung außerhalb
-% von Überschriften}%^^A
-% Diese Anweisung ist nur innerhalb von Überschriften definiert. Wird sie
-% außerhalb verwendet, so gibt sie einen entsprechenden Fehler aus.
+% \begin{command}{\UseNumberUsageError}
+% \changes{v3.27}{2019/02/02}{added}
+% \begin{command}{\IfUseNumber}
+% \changes{v3.27}{2019/02/02}{error if used outside sectioning command}
+% Command \cs{IfUseNumner} is defined only inside sectioning commands. Using
+% it outside is not specified. To report an error in this case, it should be
+% set to \cs{UseNumberUsageError} outside a sectioning command.
% \begin{macrocode}
%<*body>
\newcommand*{\UseNumberUsageError}[2]{%
@@ -949,16 +874,15 @@
\let\IfUseNumber\UseNumberUsageError
%</body>
% \end{macrocode}
-% \end{macro}
-% \end{macro}
+% \end{command}^^A \IfUseNumnr
+% \end{command}^^A \UseNumberUsageError
+%
%
-% \begin{macro}{\SecDef}
-% \changes{v3.13a}{2014/09/11}{neue Anweisung}%^^A
-% \changes{v3.20}{2016/04/12}{\cs{@ifstar} durch \cs{kernel@ifstar}
-% ersetzt}%^^A
-% \begin{macro}{\secdef}
-% \changes{v3.13a}{2014/09/11}{Vollständige Neudefinition zur Optimierung
-% der Erweiterung für das optionale Argument}%^^A
+% \begin{command}{\SecDef}
+% \changes{v3.13a}{2014/09/11}{added}
+% \changes{v3.20}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
+% \begin{command}{\secdef}
+% \changes{v3.13a}{2014/09/11}{re-definition because of extended optional argument}
% \begin{macrocode}
%<*body>
\newcommand*{\SecDef}[2]{\kernel@ifstar{#2}{\scr@section@dblarg{#1}}}
@@ -966,33 +890,37 @@
\let\secdef\SecDef
%</body>
% \end{macrocode}
-% \end{macro}%^^A \secdef
-% \end{macro}%^^A \SecDef
+% \end{command}^^A \secdef
+% \end{command}^^A \SecDef
% \begin{macro}{\scr@sect}
-% \changes{v3.10}{2011/08/30}{entfällt}%^^A
-% \end{macro}%^^A \scr@sect
+% \changes{v3.10}{2011/08/30}{removed}
+% \end{macro}^^A \scr@sect
% \begin{macro}{\@sect}
-% \changes{v3.10}{2011/08/30}{Vollständige Neudefinition zur Realisierung
-% der Erweiterung für das optionale Argument}%^^A
-% \changes{v3.10}{2011/08/30}{Verwendung von
+% \changes{v3.10}{2011/08/30}{re-definition because of extended optional argument}
+% \changes{v3.10}{2011/08/30}{using
% \cs{csname}\texttt{add\#1tocentry}\cs{endcsname}
-% bzw. \cs{addtocentrydefault}}%^^A
-% \changes{v3.18}{2015/05/20}{definiert \cs{IfUsePrefixLine} intern}%^^A
-% \changes{v3.18}{2015/05/22}{Verwendung von \cs{numexpr} für Argument 2}%^^A
-% \changes{v3.18}{2015/05/22}{Verwendung von \cs{gluexpr} für Argument
-% 3--5}%^^A
-% \changes{v3.19}{2015/07/17}{Verwendung von \cs{sectionlinesformat} und
-% \cs{sectioncatchphraseformat}}%^^A
-% \changes{v3.27}{2019/07/08}{neue Option \texttt{nonumber}}%^^A
-% \changes{v3.30}{2020/02/25}{unerwünschtes Leerzeichen am Ende der Warnung
-% entfernt}%^^A
+% resp. \cs{addtocentrydefault}}
+% \changes{v3.18}{2015/05/20}{defines \cs{IfUsePrefixLine} locally}
+% \changes{v3.18}{2015/05/22}{using \cs{numexpr} for argument 2}
+% \changes{v3.18}{2015/05/22}{using \cs{gluexpr} for arguments 3--5}
+% \changes{v3.19}{2015/07/17}{using \cs{sectionlinesformat} and
+% \cs{sectioncatchphraseformat}}
+% \changes{v3.27}{2019/07/08}{new optional \opt{nonumber}}
+% \changes{v3.30}{2020/02/25}{orphan spaces removed}
% \begin{macro}{\scr@latex@sect}
-% \changes{v3.27}{2019/07/24}{Neu (intern für \textsf{scrhack})}%^^A
-% Damit auch alle mit \cs{@startsection} definierten Gliederungsebenen
-% bei der Entscheidung berücksichtigt werden, muss ein internes Makro
-% des \LaTeX-Kerns erweitert werden. Für die Ebenen \cs{part} und
-% \cs{chapter} wird der Test direkt in der Definition der Befehle
-% erledigt.
+% \changes{v3.27}{2019/07/24}{added to be used by \pkg*{scrhack}}
+% Because we want to support the extended optional argument for all commands
+% defined using \cs{@startsection} we also have to redefine \cs{@sect}. Once
+% again several security tests are done, before redefining an internal
+% \LaTeX{} kernel macro.
+% \begin{description}
+% \item[ToDo:] It would be better not to redefine an internal \LaTeX{} kernel
+% macro, but use a own definition in our own \cs{scr@startsection}. But in
+% this case packages, that use \cs{@sect} would not automatically support
+% several \KOMAScript{} features.
+% \item[Note:] \cs{chapter} and \cs{part} do not use \cs{@sect} but
+% \cs{SecDef}.
+% \end{description}
% \begin{macrocode}
%<*body>
\def\scr@latex@sect#1#2#3#4#5#6[#7]#8{%
@@ -1037,7 +965,7 @@
of \string\@sect}%
\fi
% \end{macrocode}
-% \end{macro}%^^A \scr@latex@sect
+% \end{macro}^^A \scr@latex@sect
% \begin{macrocode}
%<trace>\ClassInfo{\KOMAClassName}{redefining LaTeX kernel macro \string\@sect}
\def\@sect#1#2#3#4#5#6[#7]#8{%
@@ -1061,12 +989,12 @@
\fi
\fi
% \end{macrocode}
-% \changes{v3.23}{2017/02/04}{support for \textsf{minitoc}}%^^A
+% \changes{v3.23}{2017/02/04}{support for \pkg{minitoc}}
% \changes{v3.23}{2017/03/24}{usage of \cs{ext@figure} and \cs{ext@table}
-% instead of \texttt{lof} and \texttt{lot}}%^^A
+% instead of \texttt{lof} and \texttt{lot}}
% Add the \texttt{xsect} entries to \texttt{lof} and \texttt{lot}. Note, that
-% the original \cs{starsection} tests of \textsf{minitoc} has a bug and so
-% does not work. And the original code of \textsf{minitoc} has hard coded
+% the original \cs{starsection} tests of \pkg{minitoc} has a bug and so
+% does not work. And the original code of \pkg{minitoc} has hard coded
% \texttt{lot} and \texttt{lof} instead of \cs{ext@figure} and
% \cs{ext@table}. This is a fixed one:
% \begin{macrocode}
@@ -1089,8 +1017,7 @@
\fi
\let\@svsec\@empty
% \end{macrocode}
-% \selectlanguage{english}%
-% \changes{v3.31}{2020/06/02}{execute counter reset list}%^^A
+% \changes{v3.31}{2020/06/02}{execute counter reset list}
% Even for not numbered sections, the reset list für the section counter has
% to be executed.
% \begin{macrocode}
@@ -1101,10 +1028,9 @@
\endgroup
\fi
% \end{macrocode}
-% \changes{v3.31}{2020/06/02}{\cs{hy@insteadofrefstepcounter} added}%^^A
-% At this point we have to make sure, that the \textsf{hyperref} code for not
+% \changes{v3.31}{2020/06/02}{\cs{hy@insteadofrefstepcounter} added}
+% At this point we have to make sure, that the \pkg{hyperref} code for not
% increasing a counter is executed.
-% \selectlanguage{ngerman}%
% \begin{macrocode}
\hy@insteadofrefstepcounter{#1}%
\else
@@ -1113,11 +1039,8 @@
\protected@edef\@svsec{\@seccntformat{#1}\relax}%
\fi
% \end{macrocode}
-% \changes{v3.26}{2018/09/18}{\cs{scr@sect@runin} beachten}%^^A
-% Falls \cs{scr@sect@runin} nicht definiert ist, wird es jetzt höchste Zeit
-% dafür. Und natürlich nutzen wir es dann für die Entscheidung Spitzmarke oder
-% nicht.
-% \changes{v3.27}{2019/02/02}{\cs{IfUseNumber} lokal definiert}%^^A
+% \changes{v3.26}{2018/09/18}{support for \cs{scr@sect@runin}}
+% \changes{v3.27}{2019/02/02}{\cs{IfUseNumber} defined locally}
% \begin{macrocode}
\ifdim
\scr@sect@runin{\z@}{\p@}{\glueexpr #5\relax}>\z@
@@ -1128,11 +1051,8 @@
\let\IfUseNumber\@firstoftwo
\fi
% \end{macrocode}
-% \changes{v3.21}{2016/06/12}{fehlendes \cs{nobreak} ergänzt}%^^A
-% Das Farbänderungen im Schriftargument erlaubt sein sollen und diese aktuelle
-% \cs{penalty}-Werte wieder aufheben, verbiete ich hier einen Umbruch nach
-% der Fontänderung.
-% \changes{v3.27}{2019/02/02}{\cs{scr@do@at} hinzugefügt}%^^A
+% \changes{v3.21}{2016/06/12}{missing \cs{nobreak} added}
+% \changes{v3.27}{2019/02/02}{\cs{scr@do@at} added}
% \begin{macrocode}
\ExecuteDoHook{heading/begingroup/#1}%
#6{\nobreak\interlinepenalty \@M
@@ -1161,10 +1081,10 @@
\csname add#1tocentry\endcsname{}{\@currenttocentry}%
\else
% \end{macrocode}
-% \selectlanguage{english}%
-% \changes{v3.31}{2020/06/06}{use \cs{\dots tocformat}}%
-%^^ATODO: move \cs{autodot} to the definition of \cs{\dots tocformat}
-% \selectlanguage{ngerman}%
+% \changes{v3.31}{2020/06/06}{using \cs{\dots tocformat}}%
+% \begin{description}
+% \item[ToDo:] Move \cs{autodot} to the definition of \cs{\dots tocformat}.
+% \end{description}
% \begin{macrocode}
\@ifundefined{#1tocformat}{%
\expandafter\gdef\csname #1tocformat\endcsname
@@ -1176,11 +1096,8 @@
\fi
\else
% \end{macrocode}
-% \changes{v3.21}{2016/06/12}{fehlendes \cs{nobreak} ergänzt}%^^A
-% \changes{v3.27}{2019/02/02}{\cs{ExecuteDoHook} eingefügt}%^^A
-% Da Farbänderungen im Schriftargument erlaubt sein sollen und diese aktuelle
-% \cs{penalty}-Werte wieder aufheben, verbiete ich hier einen Umbruch nach
-% der Fontänderung.
+% \changes{v3.21}{2016/06/12}{missing \cs{nobreak} added}
+% \changes{v3.27}{2019/02/02}{\cs{ExecuteDoHook} added}
% \begin{macrocode}
\def\@svsechd{%
\ifx\@svsec\@empty
@@ -1213,10 +1130,10 @@
\csname add#1tocentry\endcsname{}{\@currenttocentry}%
\else
% \end{macrocode}
-% \selectlanguage{english}%
-% \changes{v3.31}{2020/06/06}{use \cs{\dots tocformat}}%
-%^^ATODO: move \cs{autodot} to the definition of \cs{\dots tocformat}
-% \selectlanguage{ngerman}%
+% \changes{v3.31}{2020/06/06}{using \cs{\dots tocformat}}%
+% \begin{description}
+% \item[ToDo:] Move \cs{autodot} to the definition of \cs{\dots tocformat}.
+% \end{description}
% \begin{macrocode}
\@ifundefined{#1tocformat}{%
\expandafter\gdef\csname #1tocformat\endcsname
@@ -1233,26 +1150,26 @@
\@xsect{\glueexpr #5\relax}%
}
% \end{macrocode}
-% \begin{macro}{\scr@ds@tocentry}
-% \changes{v3.10}{2011/08/30}{neu (intern)}%^^A
-% \begin{macro}{\@currenttocentry}
-% \changes{v3.22}{2016/07/12}{\cs{scr@ds@tocentry} (semi-intern)
-% umbenannt}%^^A
-% \begin{macro}{\scr@ds@head}
-% \changes{v3.10}{2011/08/30}{neu (intern)}%^^A
-% \begin{macro}{\@currentheadentry}
-% \changes{v3.22}{2016/07/12}{\cs{scr@ds@head} (semi-intern)
-% umbenannt}%^^A
+% \begin{macro}{\scr@ds@tocentry,\@currenttocentry}
+% \changes{v3.10}{2011/08/30}{added}
+% \changes{v3.22}{2016/07/12}{\cs{scr@ds@tocentry} renamed to \cs{@currenttocentry}}
+% \begin{macro}{\scr@ds@head,\@currentheadentry}
+% \changes{v3.10}{2011/08/30}{added}
+% \changes{v3.22}{2016/07/12}{\cs{scr@ds@head} renamed to \cs{@currentheadentry}}
% \begin{macro}{\@currentlabelname}
-% \changes{v3.22}{2016/07/12}{neu (semi-intern)}
-% \begin{macro}{\if@scr@tempswa}
-% \changes{v3.10}{2011/08/30}{neu (intern)}%^^A
-% \begin{macro}{\if@currentusenumber}
-% \changes{v3.27}{2019/07/08}{neu (semi-intern)}%^^A
+% \changes{v3.22}{2016/07/12}{added}
+% \begin{macro}{\@scr@tempswatrue,\@scr@tempswafalse,\if@scr@tempswa}
+% \changes{v3.10}{2011/08/30}{added}
+% \begin{macro}{\@currentusenumbertrue,\@currentusenumberfalse,\if@currentusenumber}
+% \changes{v3.27}{2019/07/08}{added}
% \begin{macro}{\scr@istest}
-% \changes{v3.10}{2011/08/30}{neu (intern)}%^^A
-% Für die Realisierung werden noch ein paar Key-Value-Definitionen und ein
-% paar Hilfsmakros benötigt:
+% \changes{v3.10}{2011/08/30}{added}
+% We are using several \pkg*{scrbase} options to handle the extended
+% optional argument features.
+% \begin{description}
+% \item[ToDo:] Is there a general initialization hook to make additional such
+% options at package author level possible?
+% \end{description}
% \begin{macrocode}
\DefineFamily{KOMAarg}
\DefineFamilyMember[.section]{KOMAarg}
@@ -1287,72 +1204,68 @@
}
\newif\if@scr@tempswa
% \end{macrocode}
-% \end{macro}%^^A \scr@istest
-% \end{macro}%^^A \if@currentusenumber
-% \end{macro}%^^A \if@scr@tempswa
-% \end{macro}%^^A \@currentlabelname
-% \end{macro}%^^A \@currentheadentry
-% \end{macro}%^^A \scr@ds@head
-% \end{macro}%^^A \@currenttocentry
-% \end{macro}%^^A \scr@ds@tocentry
-% \begin{macro}{\sectionlinesformat}
-% \changes{v3.19}{2015/07/17}{neue Anweisung}%^^A
-% Diese Anweisung definiert das Format der eigentlichen Überschriften im Stil
-% \texttt{section}, wenn mit Überschriftenzeilen gearbeitet
-% wird. Fonteinstellungen sind zu diesem Zeitpunkt bereits erfolgt. Die
-% Argumente sind:
+% \end{macro}^^A \scr@istest
+% \end{macro}^^A \if@currentusenumber
+% \end{macro}^^A \if@scr@tempswa
+% \end{macro}^^A \@currentlabelname
+% \end{macro}^^A \scr@ds@head,\@currentheadentry
+% \end{macro}^^A \scr@ds@tocentry,\@currenttocentry
+%
+% \begin{command}{\sectionlinesformat,\sectioncatchphraseformat}
+% \changes{v3.19}{2015/07/17}{added}
+% Headings with style \texttt{section} can either be free-standing or
+% in-line. Free-standing headings are printed using:
+% \begin{quote}
+% \cs{sectionlinesformat}\marg{level name}\marg{indent}\marg{number}\marg{text}
+% \end{quote}
+% The in-line headings are printed using:
+% \begin{quote}
+% \cs{sectioncatchphraseformat}\marg{level name}\marg{indent}\marg{number}\marg{text}
+% \end{quote}
+% The \meta{level name} can also be interpreted as the section command
+% name. The \meta{indent} is the horizontal indent of the first line of the
+% heading. The \meta{number} is either empty for not numbered headings or the
+% formatted number to be used. \meta{text} is the formatted text to be
+% used. Formatted text means, the fonts are already set and \cs{@@par} for the
+% end of paragraph already has been added to the \meta{text} of
+% \cs{sectionlinesformat}. But if the user uses more paragraphs than this
+% final one, the user is responsible to prevent page breaks!
% \begin{description}
-% \item[\meta{Ebene} --] der Name der Gliederungebene
-% \item[\meta{Einzug} --] ein eventuell zu verwendender horizontaler
-% Einzug.
-% \item[\meta{Gliederungsnummer} --] die bereits fertig formatierte
-% Gliederungsnummer oder leer, falls keine Gliederungsnummer auszugeben ist.
-% \item[\meta{Text} --] der Text der Überschrift.
+% \item[Note:] Argument \meta{indent} is a kind of design mistake. It would
+% have been better to get the indent by the attributes of the \meta{level
+% name}. However having an argument makes it easier for users to redefine
+% the command.
% \end{description}
-% Der Anwender ist selbst verantwortlich, dass innerhalb der Überschrift kein
-% Seitenumbruch erfolgen kann. Nach der Überschrift wird jedoch zwangsweise
-% ein \cs{@@par} ausgeführt, so dass sichergestellt ist, dass mit einem
-% internen Absatz abgeschlossen wird.
% \begin{macrocode}
\newcommand{\sectionlinesformat}[4]{%
\@hangfrom{\hskip #2#3}{#4}%
}
-% \end{macrocode}
-% \end{macro}%^^A \sectionlinesformat
-% \begin{macro}{\sectioncatchphraseformat}
-% \changes{v3.19}{2015/07/17}{neue Anweisung}%^^A
-% Diese Anweisung definiert das Format der eigentlichen Überschriften im
-% Stil \texttt{section}, wenn mit Spitzmarken gearbeitet
-% wird. Fonteinstellungen sind zu diesem Zeitpunkt bereits erfolgt. Die
-% Argumente sind:
-% \begin{description}
-% \item[\meta{Ebene} --] der Name der Gliederungebene
-% \item[\meta{Einzug} --] ein eventuell zu verwendender horizontaler
-% Einzug.
-% \item[\meta{Gliederungsnummer} --] die bereits fertig formatierte
-% Gliederungsnummer oder leer, falls keine Gliederungsnummer auszugeben
-% ist.
-% \item[\meta{Text} --] der Text der Überschrift.
-% \end{description}
-% Der Anwender ist selbst verantwortlich, dass innerhalb der Überschrift kein
-% Seitenumbruch erfolgen kann.
-% \begin{macrocode}
\newcommand{\sectioncatchphraseformat}[4]{%
\hskip #2#3#4%
}
% \end{macrocode}
-% \end{macro}%^^A \sectioncatchphraseformat
-% \end{macro}%^^A \@sect
+% \end{command}^^A \sectionlinesformat,\sectioncatchphraseformat
+% \end{macro}^^A \@sect
%
% \begin{macro}{\@ssect}
-% \changes{v3.19}{2015/07/17}{Vollständige Neudefinition zur Realisierung
-% der Erweiterung für die Formatieurng der Überschrift}%^^A
+% \changes{v3.19}{2015/07/17}{re-definition because of several new features}
% \begin{macro}{\scr@latex@ssect}
-% \changes{v3.27}{2019/07/24}{Neu (intern für \textsf{scrhack})}%^^A
-% \changes{v3.30}{2020/02/25}{unerwünschtes Leerzeichen am Ende der Warnung
-% entfernt}%^^A
-% Das wird für Überschriften ohne Nummer verwendet. Im Prinzip machen wir hier
-% dasselbe wie zuvor.
+% \changes{v3.27}{2019/07/24}{added to be used by \pkg*{scrhack})}
+% \changes{v3.30}{2020/02/25}{orphan space removed}
+% The star variant of section commands do not use \cs{@sect} but
+% \cs{@ssect}. Here we have the problem, that the command name argument is
+% missing. The whole definition is very similar to \cs{@sect} but without a
+% number, ToC entry or running head.
+% \begin{description}
+% \item[Note:] we do not have to support an extended optional argument,
+% because there isn't an optional argument.
+% \item[ToDo:] It would be better not to redefine an internal \LaTeX{} kernel
+% macro, but use a own definition in our own \cs{scr@startsection}. But in
+% this case packages, that use \cs{@ssect} would not automatically support
+% several \KOMAScript{} features.
+% \item[Note:] \cs{chapter} and \cs{part} do not use \cs{@ssect} but
+% \cs{SecDef}.
+% \end{description}
% \begin{macrocode}
\def\scr@latex@ssect#1#2#3#4#5{%
\@tempskipa #3\relax
@@ -1377,7 +1290,7 @@
of \string\@ssect}%
\fi
% \end{macrocode}
-% \end{macro}%^^A \scr@latex@ssect
+% \end{macro}^^A \scr@latex@ssect
% \begin{macrocode}
%<trace>\ClassInfo{\KOMAClassName}{redefining LaTeX kernel macro
%<trace> \string\@ssect}
@@ -1393,11 +1306,9 @@
\def\scr@s@ct@@nn@m@{\string\scr@s@ct@@nn@m@}%
}{%
% \end{macrocode}
-% \selectlanguage{english}%
-% \changes{v3.31}{2020/06/02}{execute counter reset list}%^^A
+% \changes{v3.31}{2020/06/02}{execute counter reset list}
% Even for not numbered sections, the reset list für the corresponding section
% counter has to be executed.
-% \selectlanguage{ngerman}%
% \begin{macrocode}
\expandafter\ifnum\scr@v@is@lt{3.31}\relax\else
\begingroup
@@ -1407,22 +1318,16 @@
\fi
}%
% \end{macrocode}
-% \changes{v3.26}{2018/09/18}{\cs{scr@sect@runin} beachten}%^^A
-% Falls \cs{scr@sect@runin} nicht definiert ist, wird es jetzt höchste Zeit
-% dafür. Und natürlich nutzen wir es dann für die Entscheidung Spitzmarke oder
-% nicht.
-% \changes{v3.27}{2019/02/02}{\cs{IfUseNumber} lokal definiert}%^^A
+% \changes{v3.26}{2018/09/18}{support for \cs{scr@sect@runin}}
+% \changes{v3.27}{2019/02/02}{defining \cs{IfUseNumber} locally}
% \begin{macrocode}
\ifdim
\scr@sect@runin{\z@}{\p@}{\glueexpr #3\relax}>\z@
\begingroup
\let\IfUseNumber\@secondoftwo
% \end{macrocode}
-% \changes{v3.21}{2016/06/12}{fehlendes \cs{nobreak} ergänzt}%^^A
-% \changes{v3.27}{2019/02/02}{\cs{ExecuteDoHook} eingefügt}%^^A
-% Das Farbänderungen im Schriftargument erlaubt sein sollen und diese aktuelle
-% \cs{penalty}-Werte wieder aufheben, verbiete ich hier einen Umbruch nach
-% der Fontänderung.
+% \changes{v3.21}{2016/06/12}{missing \cs{nobreak} added}
+% \changes{v3.27}{2019/02/02}{\cs{ExecuteDoHook} added}
% \begin{macrocode}
\edef\reserved@a{%
\noexpand\ExecuteDoHook{heading/begingroup/\scr@s@ct@@nn@m@}%
@@ -1440,10 +1345,7 @@
\noexpand\ExecuteDoHook{heading/begingroup/\scr@s@ct@@nn@m@}%
\unexpanded{#4}{%
% \end{macrocode}
-% \changes{v3.21}{2016/06/12}{fehlendes \cs{nobreak} ergänzt}%^^A
-% Das Farbänderungen im Schriftargument erlaubt sein sollen und diese aktuelle
-% \cs{penalty}-Werte wieder aufheben, verbiete ich hier einen Umbruch nach
-% der Fontänderung.
+% \changes{v3.21}{2016/06/12}{missing \cs{nobreak} added}
% \begin{macrocode}
\noexpand\nobreak
\noexpand\sectioncatchphraseformat{\scr@s@ct@@nn@m@}%
@@ -1457,16 +1359,18 @@
}
%</body>
% \end{macrocode}
-% \end{macro}%^^A \@ssect
+% \end{macro}^^A \@ssect
% \begin{macro}{\@xsect}
-% \changes{v3.26}{2018/09/18}{wird umdefiniert}%^^A
-% \changes{v3.30}{2020/02/25}{unerwünschtes Leerzeichen am Ende der Warnung
-% entfernt}%^^A
+% \changes{v3.26}{2018/09/18}{re-definition}
+% \changes{v3.30}{2020/02/25}{orphan space removed}
% \begin{macro}{\scr@latex@xsect}
-% \changes{v3.27}{2019/07/24}{Neu (intern für \textsf{scrhack})}%^^A
-% Wir brauchen zum Einen in \cs{@xsect} einen Fallunterscheidung nach
-% \cs{scr@sect@runin} und zum Anderen muss diese Fallunterscheidung am Ende
-% wieder zurückgesetzt werden.
+% \changes{v3.27}{2019/07/24}{added to be used by \pkg*{scrhack}}
+% We need a differentiation with \cs{scr@sect@runin} to be initialized in
+% \cs{@xsect} and also need to reset this internal macro at the end.
+% \begin{description}
+% \item[ToDo:] It would be better not to redefine the internal \LaTeX{} kernel
+% macro, but to define and use our own one.
+% \end{description}
% \begin{macrocode}
%<*body>
\def\scr@latex@xsect#1{%
@@ -1504,7 +1408,7 @@
of \string\@xsect}%
\fi
% \end{macrocode}
-% \end{macro}%^^A \scr@latex@xsect
+% \end{macro}^^A \scr@latex@xsect
% \begin{macrocode}
%<trace>\ClassInfo{\KOMAClassName}{redefining LaTeX kernel macro
%<trace> \string\@xsect}
@@ -1543,20 +1447,18 @@
}
%</body>
% \end{macrocode}
-% \end{macro}%^^A \@xsect
-%
-% \begin{macro}{\IfUsePrefixLine}
-% \changes{v3.18}{2015/06/09}{außerhalb von Gliederungsbefehlsstilen
-% definiert}%^^A
-% Eigentlich ist diese Anweisung nur innerhalb von Gliederungsbefehlen
-% sinnvoll und wurde bis \KOMAScript{} 3.17c auch nur dort definiert. Dann gab
-% es aber Leute, die \cs{chapterformat} missbraucht haben und gleich meldete
-% sich jemand, die nicht verstehen konnte, warum die Anweisung dann einen
-% Fehler produzieren muss. Wenn man den Code nicht verstanden hat, dann ist
-% das nämlich so. Deshalb gebe ich jetzt eine Warnung aus, dass die Verwendung
-% nicht unbedingt zu dem Resultat führt, das erwartet wird.
+% \end{macro}^^A \@xsect
+%
+% \begin{command}{\IfUsePrefixLine}
+% \changes{v3.18}{2015/06/09}{added}
% \begin{macro}{\scr@IfUsePrefixLineWarning}
-% \changes{v3.18}{2015/06/09}{neu (intern)}
+% \changes{v3.18}{2015/06/09}{added}
+% This command makes sense inside the section commands only. But users often
+% tried to use it outside instead of \cs{ifnumbered}. This mostly has resulted
+% in a undefined command sequence error users did not understand. So now, we
+% use an internal definition to be uses outside the section commands, that
+% results in a warning with more information about the mistake and that does
+% neither use the first nor the second argument (instead of using both of them).
% \begin{macrocode}
%<*body>
\newcommand*{\scr@IfUsePrefixLineWarning}[2]{%
@@ -1578,52 +1480,68 @@
\let\IfUsePrefixLine\scr@IfUsePrefixLineWarning
%</body>
% \end{macrocode}
-% \end{macro}%^^A \scr@IfUsePrefixLineWarning
-% \end{macro}%^^A \IfUsePrefixLine
+% \end{macro}^^A \scr@IfUsePrefixLineWarning
+% \end{command}^^A \IfUsePrefixLine
%
%
-% \begin{macro}{\raggedsection}
-% \changes{v2.3h}{1996/01/20}{Überschriften werden \cs{raggedsection}%^^A
-% gesetzt}%^^A
-% \changes{v2.3h}{1996/01/20}{\cs{raggedsection} ist als \cs{raggedright}
-% voreingestellt}%^^A
-% Dieses Makro gibt an, wie die Überschriften formatiert
-% werden. Voreingestellt ist linksbündig. Da dies nicht nur die Formatierung
-% von \cs{section} (und darunter), sondern auch die Voreinstellung für die
-% höheren Ebenen ist, wird die Definition hier vorgezogen.
+% \begin{command}{\raggedsection}
+% \changes{v2.3h}{1996/01/20}{added}
+% Should be either \cs{raggedleft}, \cs{raggedright}, \cs{centering} or
+% empty. Empty means no change, which is usually justified. Users could also
+% use other alignment/justification commands like the commands of package
+% \pkg{ragged2e}. The initial value is \cs{raggedright}.
+% \begin{description}
+% \item[Note:] We are here in the class. So usually \cs{raggedright} is the
+% \cs{raggedright} of the \LaTeX{} kernel. This also means: no hyphenation.
+% \item[Note:] We define is already here, because it is not only used for
+% style \texttt{section} but also as initial default of the \emph{higher
+% level} styles.
+% \end{description}
% \begin{macrocode}
%<*body>
\newcommand*{\raggedsection}{}
\let\raggedsection\raggedright
%</body>
% \end{macrocode}
-% \end{macro}%^^A \raggedsection
+% \end{command}^^A \raggedsection
%
%
-% \begin{macro}{\DeclareSectionCommand}
-% \changes{v3.15}{2014/11/21}{neue Anweisung}%^^A
-% \changes{v3.17}{2015/03/23}{Komplettumbau, um stilabhängige Optionen zu
-% ermöglichen}%^^A
-% \changes{v3.18}{2015/05/22}{\cs{scr@dsc@def@style@\dots @command}
-% definiert alle Stil abhängigen Anweisungen}%^^A
-% \changes{v3.20}{2015/10/03}{\cs{DeclareTOCStyleEntry}
-% definiert die Verzeichnisstil abhängigen Anweisungen}%^^A
-% Definition neuer oder Umdefinition existierender Gliederungsbefehle. Ebenso
-% wird ein Verzeichniseintrag erzeugt, falls ein solcher noch nicht
-% existiert. Die Deklaration geschieht über diverse Optionen:
-%^^A (Achtung: Unbedingt daran denken, die Optionen in
-%^^A \cs{ProvideSectionCommands} ebenfalls zu definieren!!!)
+% All the options of \cs{DeclareSectionCommand} are options of family
+% \texttt{KOMAarg} member \texttt{.dsc}.
% \begin{macrocode}
%<*body>
\DefineFamily{KOMAarg}
\DefineFamilyMember[.dsc]{KOMAarg}
% \end{macrocode}
-% \begin{macro}{\DeclareSectionCommandStyleOption}
-% \changes{v3.17}{2015/03/23}{neue Anweisung}%^^A
-% Definiert eine neue Option für einen Stil eines Gliederungsbefehls. Das
-% erste Argument ist der Stil, das zweite der Name der Option, das dritte ist
-% die Definition. Sollte innerhalb der Definition eine Familie benötigt
-% werden, so ist \texttt{KOMAarg} zu verwenden.
+% \begin{command}{\DeclareSectionCommandStyleOption}
+% \changes{v3.17}{2015/03/23}{added}
+% \begin{command}{\AddToSectionCommandOptionsDoList,\RelaxSectionCommandOptions}
+% \changes{v3.20}{2015/11/18}{added}
+% \begin{macro}{\@AddToSectionCommandOptionsDoList,\scr@dsc@doopts}
+% \changes{v3.20}{2015/11/18}{added}
+% The basic command to define a section command style option is:
+% \begin{quote}
+% \cs{DeclareSectionCommandStyleOption}\marg{style}\marg{option}\marg{definition}
+% \end{quote}
+% Is similar to a corresponding \cs{DefineFamilyKey}. But the option
+% definition is not done immediately but added to
+% \cs{scr@dsc@style@\meta{style}@options} which is executed later inside
+% \cs{DeclareSectionCommand} after detection of the \opt{style} option. The
+% option is also added to the \emph{section command options do list} of
+% \cs{scr@dsc@doopts} using
+% \begin{quote}
+% \cs{AddToSectionCommandOptionsDoList}\marg{option}
+% \end{quote}
+% This is used, e.g., to relax all options inside \cs{DeclareSectionCommand}
+% using \cs{RelaxSectionCommandOptions} to not have options defined, that are
+% used by one style, while declaring a command of another style, that does not
+% support the option.
+% \begin{description}
+% \item[Note:] We also could have used another option member for every style
+% to avoid such problems. With \LaTeX3 also usage of
+% \pkg[https://www.ctan.org/pkg/l3kernel]{l3keys}, which provides a kind of
+% hierarchical options, would have been possible.
+% \end{description}
% \begin{macrocode}
\newcommand*{\DeclareSectionCommandStyleOption}[3]{%
\AddToSectionCommandOptionsDoList{#2}%
@@ -1631,20 +1549,6 @@
\DefineFamilyKey[.dsc]{KOMAarg}{#2}{#3}%
}%
}
-% \end{macrocode}
-% \begin{macro}{\DeclareSectionCommandDummyOption}
-% \changes{v3.17}{2015/03/23}{neue Anweisung (intern)}%^^A
-% \changes{v3.20}{2015/11/18}{wird nicht mehr benötigt}%^^A
-% \end{macro}%^^A \DeclareSectionCommandDummyOption
-% \begin{macro}{\AddToSectionCommandOptionsDoList}
-% \changes{v3.20}{2015/11/18}{neu}
-% \begin{macro}{\@AddToSectionCommandOptionsDoList}
-% \changes{v3.20}{2015/11/18}{neu (intern)}
-% \begin{macro}{\scr@dsc@doopts}
-% \changes{v3.20}{2015/11/18}{neu (intern)}
-% Registriert eine neue Gliederungsbefehlsoption, indem sie der internen Liste
-% der Gliederungsbefehlsoptionen hinzugefügt wird.
-% \begin{macrocode}
\newcommand*{\AddToSectionCommandOptionsDoList}[1]{%
\kernel@ifnextchar [%]
{\@AddToSectionCommandOptionListWithDefault{#1}}%
@@ -1655,14 +1559,6 @@
\l@addto@macro\scr@dsc@doopts{\do[{#2}]{#1}}
}%
\newcommand*{\scr@dsc@doopts}{}
-% \end{macrocode}
-% \end{macro}%^^A \scr@dsc@dooptions
-% \end{macro}%^^A \@AddToSectionCommandOptionsListWithDefault
-% \end{macro}%^^A \AddToSectionCommandOptionsDoList
-% \begin{macro}{\RelaxSectionCommandOptions}
-% \changes{v3.20}{2015/11/18}{neu}
-% Diese Option macht alle Gliederungsbefehlsoptionen ungültig.
-% \begin{macrocode}
\newcommand*{\RelaxSectionCommandOptions}{%
\begingroup
\def\do@endgroup{\endgroup}%
@@ -1678,14 +1574,45 @@
\do@endgroup
}
% \end{macrocode}
-% \end{macro}%^^A \RelaxSectionCommandOptions
-% \end{macro}%^^A \DeclareSectionCommandStyleOption
-% \begin{macro}{\DeclareSectionCommandStyleLengthOption}
-% \changes{v3.17}{2015/03/23}{neue Anweisung}%^^A
-% \changes{v3.20}{2016/04/25}{Argument wird ggf. expandiert}%^^A
-% Definiert eine für die aktuelle Ebene \cs{scr@dsc@current} eine neue
-% Längenoption und speichert das Ergebnis in einem Makro, das sich aus
-% Argument 3 gefolgt von der aktuellen Ebene gefolgt von Argument 4 ergibt.
+% \end{macro}^^A \@AddToSectionCommandOptionsListWithDefault,\scr@dsc@dooptions
+% \end{command}^^A \AddToSectionCommandOptionsDoList,\RelaxSectionCommandOptions
+% \end{command}^^A \DeclareSectionCommandStyleOption
+% We provide several kinds of options:
+% \begin{command}{\DeclareSectionCommandDummyOption}
+% \changes{v3.17}{2015/03/23}{added}
+% \changes{v3.20}{2015/11/18}{removed}
+% \end{command}^^A \DeclareSectionCommandDummyOption
+% \begin{command}{\DeclareSectionCommandStyleLengthOption,
+% \DeclareSectionCommandStyleNumberOption,
+% \DeclareSectionCommandStyleFontOption}
+% \changes{v3.17}{2015/03/23}{added}
+% \changes{v3.20}{2016/04/25}{argument expansion}
+% All these commands have the four arguments:
+% \begin{quote}
+% \marg{style}\marg{option}\marg{prefix}\marg{postfix}
+% \end{quote}
+% Most of the commands all correspond to \pkg*{scrbase} option declaration
+% commands:
+% \begin{center}
+% \begin{tabular}{lll}
+% \cs{DeclareSectionCommand} & \pkg*{scrbase} & meaning \\\hline
+% \cs{DeclareSectionCommandStyleLengthOption}
+% & \cs{FamilyLengthMacroKey} & length option\\
+% \cs{DeclareSectionCommandStyleNumberOption}
+% & \cs{FamilyCounterMacroKey} & numerical option\\
+% \cs{DeclareSectionCommandStyleFontOption}
+% & & font element option\\
+% \end{tabular}
+% \end{center}
+% The \meta{macro} of the corresponding \pkg*{scrbase} command is build by
+% \meta{prefix}\cs{scr@dsc@current}\meta{postfix}. For
+% \cs{DeclareSectionCommandStyleOption} the build name is the font
+% element instead. However, before using (setting) the option,
+% \cs{scr@dsc@current} has to be defined to be \meta{level name}
+% (aka \emph{section command name}). Depending on \cs{ifscr@dsc@expandtopt}
+% (see option \opt{expandtopt}) lengths given as argument to the option of
+% \cs{DeclareSectionCommandStyleLengthOption} is expanded to a \texttt{pt}
+% value instead of used as it is.
% \begin{macrocode}
\newcommand*{\DeclareSectionCommandStyleLengthOption}[4]{%
\DeclareSectionCommandStyleOption{#1}{#2}{%
@@ -1702,15 +1629,6 @@
\fi
}%
}
-% \end{macrocode}
-% \end{macro}%^^A \DeclareSectionCommandStyleLengthOption
-% \begin{macro}{\DeclareSectionCommandStyleNumberOption}
-% \changes{v3.17}{2015/03/23}{neue Anweisung}%^^A
-% \changes{v3.20}{2016/04/25}{Argument wird expandiert}%^^A
-% Definiert eine für die aktuelle Ebene \cs{scr@dsc@current} eine neue
-% Zahlenoption und speichert das Ergebnis in einem Makro, das sich aus
-% Argument 3 gefolgt von der aktuellen Ebene gefolgt von Argument 4 ergibt.
-% \begin{macrocode}
\newcommand*{\DeclareSectionCommandStyleNumberOption}[4]{%
\DeclareSectionCommandStyleOption{#1}{#2}{%
\protected@edef\reserved@a{%
@@ -1721,14 +1639,6 @@
\fi
}%
}
-% \end{macrocode}
-% \end{macro}%^^A \DeclareSectionCommandStyleNumberOption
-% \begin{macro}{\DeclareSectionCommandStyleFontOption}
-% \changes{v3.17}{2015/03/23}{neue Anweisung}%^^A
-% Definiert für die aktuelle Ebene \cs{scr@dsc@current} eine neue
-% Schrift und speichert das Ergebnis in einem Element, das sich aus
-% Argument 3 gefolgt von der aktuellen Ebene gefolgt von Argument 4 ergibt.
-% \begin{macrocode}
\newcommand*{\DeclareSectionCommandStyleFontOption}[4]{%
\DeclareSectionCommandStyleOption{#1}{#2}{%
\IfExistskomafont{#3\scr@dsc@current#4}{%
@@ -1740,16 +1650,22 @@
}%
}
% \end{macrocode}
-% \end{macro}%^^A \DeclareSectionCommandStyleFontOption
-% \begin{macro}{\DeclareSectionCommandStyleFuzzyOption}
-% \changes{v3.26}{2018/09/18}{neue Anweisung}%^^A
-% \changes{v3.28}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
-% Definiert für die aktuelle Ebene \cs{scr@dsc@current} eine neue
-% Fuzzy-Auswahl. Eine Fuzzy-Auswahl akzeptiert neben den Werten für
-% boolsche-Schalter noch einen weiteren Wert. Es wird davon eine Anweisung
-% mit drei Argumenten definiert. Abhängig vom Wert wird das erste
-% (\texttt{true}), zweite (\texttt{false}) oder dritte (\emph{sonst}) Argument
-% ausgeführt. Der erlaubte weitere Wert wird als 5. Argument angegeben.
+% \end{command}^^A \DeclareSectionCommandStyleLengthOption …
+% \begin{command}{\DeclareSectionCommandStyleFuzzyOption}
+% \changes{v3.26}{2018/09/18}{added}
+% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
+% We also have a kind of fuzzy option. A fuzzy option defined by
+% \begin{quote}
+% \cs{DeclareSectionCommandStyleFuzzyOption}\meta{style}\meta{option}%
+% \meta{prefix}\meta{postfix}\meta{also}
+% \end{quote}
+% is an option, that provides three values: \texttt{true} (and the aliases
+% \texttt{on} and \texttt{yes}), \texttt{false} (and the aliases \texttt{off}
+% and \texttt{no}), and a third one \meta{also}. It defines a macro with the
+% name \meta{prefix}\cs{scr@dsc@current}\meta{postfix} and three arguments. If
+% the option is true, the macro expands to the first argument. If the option
+% is false, the macro expands to the second argument. If the option is
+% \meta{also} the macro expands to the third argument.
% \begin{macrocode}
\newcommand*{\DeclareSectionCommandStyleFuzzyOption}[5]{%
\DeclareSectionCommandStyleOption{#1}{#2}{%
@@ -1772,81 +1688,94 @@
}%
}
% \end{macrocode}
-% \end{macro}%^^A \DeclareSectionCommandStyleFuzzyOptions
+% \end{command}^^A \DeclareSectionCommandStyleFuzzyOptions
%
+% These types of options are used to define all the options of a style, e.g.,
% \begin{macro}{\scr@dsc@style@section@options}
-% \changes{v3.17}{2015/03/23}{neue Anweisung (intern)}%^^A
-% Dann für die Optionen des Stils \texttt{section}:
+% \changes{v3.17}{2015/03/23}{added}
+% the option declarations of style \texttt{section}:
% \begin{macrocode}
\newcommand*{\scr@dsc@style@section@options}{}
% \end{macrocode}
-% \begin{description}\item[\texttt{indent}]
-% Linker Einzug der Überschrift
+% \begin{description}
+% \item[\opt{indent=\meta{length}}:]
+% the left indent of the heading.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleLengthOption{section}
{indent}{scr@}{@sectionindent}
% \end{macrocode}
% \begin{description}
-% \item[\texttt{afterindent}]
-% \changes{v3.26}{2018/09/18}{neue Option \texttt{afterindent}}%^^A
-% Fuzzy-Logik. Ein boolcher Wert gibt an, ob die erste Zeile nach der
-% Überschrift eingezogen werden soll. Als dritter Wert ist \texttt{bysign}
-% möglich. Dann hängt die Entscheidung für den Einzug vom Vorzeichen von
-% \texttt{beforeskip} ab. Ein negativer Wert bedeutet dann, dass der
-% Absatzeinzug nach der Überschrift unterdrückt werden soll.
+% \item[\opt{afterindent=\meta{fuzzy}}:]
+% \changes{v3.26}{2018/09/18}{option \opt{afterindent}}
+% fuzzy logic. A boolean value states whether to indent the first line
+% after the heading. With additional \opt{afterindent=bysign} the decision
+% depends on the sign of \opt{beforeskip}. Negative values of
+% \opt{beforeskip} result in no paragraph indent.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleFuzzyOption{section}
{afterindent}{scr@}{@afterindent}
{bysign}
% \end{macrocode}
-% \begin{description}\item[\texttt{beforeskip}]
-% Gibt den vertikalen Abstand vor der Übeschrift an. Im Fall von
-% \texttt{afterindent=bysign} wird der Absolutwert verwendet.
+% \begin{description}
+% \item[\opt{beforeskip=\meta{length}}:]
+% The vertical distance before the heading. If \opt{afterindent=bysign}, the
+% absolute value of \meta{length} is used. Otherwise the \meta{length} can
+% also be negative to move up the heading.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleLengthOption{section}
{beforeskip}{scr@}{@beforeskip}
% \end{macrocode}
-% \begin{description}\item[\texttt{runin}]
-% \changes{v3.26}{2018/09/18}{neue Option \texttt{runin}}%^^A
-% Fuzzy-Logik. Ein boolscher Wert gibt an, dass die Überschrift als
-% Spitzmarke (\texttt{true}) oder als eigene Zeile (\texttt{false}) gesetzt
-% werden soll. Als dritter Wert ist \texttt{bysign} möglich. Dann hängt
-% Spitzmarke oder nicht vom Vorzeichen von \texttt{afterskip} ab. Spitzmarke
-% gibt es dann bei einem negativen Wert von \texttt{afterskip}.
+% \begin{description}
+% \item[\opt{runin=\meta{fuzzy}}:]
+% \changes{v3.26}{2018/09/18}{option \opt{runin}}
+% fuzzy logic. A boolean value states whether the heading is run-in (or
+% free-standing). With additional \opt{runin=bysign} the decision depends on
+% the sign of \opt{afterskip}. Negative values of \opt{afterskip} result in
+% a run-in heading.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleFuzzyOption{section}
{runin}{scr@}{@runin}
{bysign}
% \end{macrocode}
-% \begin{description}\item[\texttt{afterskip}] Im Fall einer Spitzmarke (siehe
-% \texttt{runin}) der horizontale Abstand nach der Überschrift. Im Fall einer
-% freistehenden Überschrift der vertikale Abstand nach der Überschrift. Falls
-% die Spitzmarke über das Vorzeichen aktiviert wird, wird immer der Betrag des
-% Wertes verwendet!
+% \begin{description}
+% \item[\opt{afterskip=\meta{length}}:]
+% In case of a run-in heading (see option \opt{runin}) the horizontal
+% distance after the heading. In case of a free-standing heading the
+% vertical distance after the heading. If the run-in heading is activated by
+% a negative \meta{length}, the absolute value is used. Otherwise the
+% \meta{length} can also be negative, which usually does not make much
+% sense.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleLengthOption{section}
{afterskip}{scr@}{@afterskip}
% \end{macrocode}
-% \begin{description}\item[\texttt{font}] Schrifteinstellungen für das
-% Element.\end{description}
+% \begin{description}
+% \item[\opt{font=\meta{font settings}}:]
+% The font setting for the font element of the heading.
+% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleFontOption{section}{font}{}{}
% \end{macrocode}
-% \end{macro}%^^A \scr@dsc@style@section@options
+% \end{macro}^^A \scr@dsc@style@section@options
% \begin{macro}{\scr@dsc@def@style@section@command}
-% \changes{v3.18}{2015/05/21}{neue Anweisung (intern)}%^^A
-% \changes{v3.20}{2016/01/19}{korrekte Spitzmarkenprüfung für
-% \cs{parfillskip}-Änderung}%^^A
-% Diese Anweisung left fest, wie ein Gliederungsbefehl für den Stil
-% \texttt{section} zu definieren ist. Das einzige Argument ist dabei der
-% \meta{Name} der Gliederungsebene, beispielsweise \texttt{section},
-% \texttt{subsection} etc. Hier ist es recht einfach, da lediglich
-% \cs{\meta{Name}} per \cs{scr@startsection} definiert werden muss.
+% \changes{v3.18}{2015/05/21}{added}
+% \changes{v3.20}{2016/01/19}{inline section test fixed}
+% Macro
+% \begin{quote}
+% \cs{scr@dsc@def@style@section@command}\marg{command name}
+% \end{quote}
+% defines a section command \cs{\meta{command name}} of style
+% \texttt{section}.
+% \begin{description}
+% \item[Note:] Here we already use our own \cs{scr@startsection} instead of
+% \cs{@startsection}. So maybe not redefining \cs{@startsection} or
+% redefining \cs{@startsection} only optionally wouldn't be a big step.
+% \end{description}
% \begin{macrocode}
\newcommand*{\scr@dsc@def@style@section@command}[1]{%
\@namedef{#1}{%
@@ -1867,18 +1796,20 @@
}%
}
% \end{macrocode}
-% \end{macro}%^^A \scr@dsc@def@style@section@command
+% \end{macro}^^A \scr@dsc@def@style@section@command
%
% \begin{macro}{\scr@dsc@style@chapter@options}
-% \changes{v3.17}{2015/03/23}{neue Anweisung (intern)}%^^A
-% Dann für die Optionen des Stils \texttt{chapter}:
+% \changes{v3.17}{2015/03/23}{added}
+% Now, the option declaration of style \texttt{chapter} (similar, but not the
+% same):
% \begin{macrocode}
%<*book|report>
\newcommand*{\scr@dsc@style@chapter@options}{}
% \end{macrocode}
% \begin{description}
-% \item[\texttt{pagestyle}] Seitenstil für die Anfangsseite der
-% Gliederungsebene.
+% \item[\opt{pagestyle=\meta{name}}:]
+% The page style, that should be used for the starting page of the chapter
+% like outline level.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleOption{chapter}{pagestyle}{%
@@ -1887,65 +1818,72 @@
}%
% \end{macrocode}
% \begin{description}
-% \item[\texttt{afterindent}]
-% \changes{v3.26}{2018/09/18}{neue Option \texttt{afterindent}}%^^A
-% Fuzzy-Logik. Ein boolcher Wert gibt an, ob die erste Zeile nach der
-% Überschrift eingezogen werden soll. Als dritter Wert ist \texttt{bysign}
-% möglich. Dann hängt die Entscheidung für den Einzug vom Vorzeichen von
-% \texttt{beforeskip} ab. Ein negativer Wert bedeutet dann, dass der
-% Absatzeinzug nach der Überschrift unterdrückt werden soll.
+% \item[\opt{afterindent=\meta{fuzzy}}:]
+% \changes{v3.26}{2018/09/18}{option \opt{afterindent}}
+% fuzzy logic. A boolean value states whether to indent the first line
+% after the heading. With additional \opt{afterindent=bysign} the decision
+% depends on the sign of \opt{beforeskip}. Negative values of
+% \opt{beforeskip} result in no paragraph indent.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleFuzzyOption{chapter}
{afterindent}{scr@}{@afterindent}
{bysign}
% \end{macrocode}
-% \begin{description}\item[\texttt{beforeskip}]
-% Gibt den vertikalen Abstand vor der Übeschrift an. Im Fall von
-% \texttt{afterindent=bysign} wird der Absolutwert verwendet.
+% \begin{description}
+% \item[\opt{beforeskip=\meta{length}}:]
+% The vertical distance before the heading. If \opt{afterindent=bysign}, the
+% absolute value of \meta{length} is used. Otherwise the \meta{length} can
+% also be negative to move up the heading.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleLengthOption{chapter}
{beforeskip}{scr@}{@beforeskip}
% \end{macrocode}
% \begin{description}
-% \item[\texttt{innerskip}] Der Absolutwert gibt den vertikalen Abstand
-% innerhalb der Überschrift zwischen Präfix-Zeile und Text an.
+% \item[\opt{innerskip=\meta{length}}:]
+% The vertical distance between the prefix line and the text (if a prefix
+% line is used).
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleLengthOption{chapter}
{innerskip}{scr@}{@innerskip}
% \end{macrocode}
% \begin{description}
-% \item[\texttt{afterskip}] Der Absolutwert gibt den vertikalen Abstand nach
-% der Überschrift an.
+% \item[\opt{afterskip=\meta{length}}:]
+% The vertical distance after the heading.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleLengthOption{chapter}
{afterskip}{scr@}{@afterskip}
% \end{macrocode}
% \begin{description}
-% \item[\texttt{font}] Schrifteinstellungen für das Element.
+% \item[\opt{font=\meta{font settings}}:]
+% The font setting for the font element of the heading.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleFontOption{chapter}{font}{}{}
% \end{macrocode}
% \begin{description}
-% \item[\texttt{prefixfont}] Schrifteinstellungen für die Präfixzeile des
-% Elements.
+% \item[\opt{prefixfont=\meta{font settings}}:]
+% The font setting for the font element of the prefix line of the heading.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleFontOption{chapter}{prefixfont}{}{prefix}
% \end{macrocode}
-% \end{macro}%^^A \scr@dsc@style@chapter@options
+% \end{macro}^^A \scr@dsc@style@chapter@options
% \begin{macro}{\scr@dsc@def@style@chapter@command}
-% \changes{v3.18}{2015/05/22}{neue Anweisung (intern)}
-% Diese Anweisung left fest, wie ein Gliederungsbefehl für den Stil
-% \texttt{chapter} zu definieren ist. Das einzige Argument ist dabei der
-% \meta{Name} der Gliederungsebene, normalerweise \texttt{chapter}.
-% Das ist etwas komplizierter als bei \cs{scr@dsc@def@style@section@command},
-% da hier eine ganze Reihe von miteinander verschachtelten Anweisungen zu
-% definieren sind.
+% \changes{v3.18}{2015/05/22}{added}
+% Macro
+% \begin{quote}
+% \cs{scr@dsc@def@style@chapter@command}\marg{command name}
+% \end{quote}
+% defines a section command \cs{\meta{command name}} of style
+% \texttt{chapter}. We need some more macros to be initialized than with
+% \cs{scr@dsc@def@style@section@command}.
+% \begin{description}
+% \item[ToDo:] Make a more generic (and general) interface for this.
+% \end{description}
% \begin{macrocode}
\newcommand*{\scr@dsc@def@style@chapter@command}[1]{%
\@namedef{#1}{\scr@startchapter{#1}}%
@@ -1960,27 +1898,31 @@
%</book|report>
% \end{macrocode}
% \begin{macro}{\scr@dsc@style@chapter@subcommands}
-% \selectlanguage{english}%^^A
-% \changes{v3.30}{2020/04/08}{new (internal)}
+% \changes{v3.30}{2020/04/08}{added}
% Internal name list of additional commands to be defined for style
-% \texttt{part} commands.
+% \texttt{chapter} commands. This is used, to decide, if a new section command
+% declaration is really new or already redefines some commands. This should
+% help to avoid, e.g., defining a new chapter command \cs{schapter}, if
+% \cs{chapter} is already defines, because \cs{schapter} would redefine the
+% \cs{@schapter} of \cs{chapter}.
% \begin{macrocode}
\newcommand*{\scr@dsc@style@chapter@subcommands}[1]{%
@#1,@s#1,@make#1head,@makes#1head,@@make#1head,@@makes#1head,set#1preamble%
}
% \end{macrocode}
-% \end{macro}%^^A \scr@dsc@style@chapter@subcommands
-% \end{macro}%^^A \scr@dsc@def@style@chapter@command
+% \end{macro}^^A \scr@dsc@style@chapter@subcommands
+% \end{macro}^^A \scr@dsc@def@style@chapter@command
%
% \begin{macro}{\scr@dsc@style@part@options}
-% \changes{v3.17}{2015/03/23}{neue Anweisung (intern)}%^^A
-% Dann für die Optionen des Stils \texttt{part}:
+% \changes{v3.17}{2015/03/23}{added}
+% Now the options for style \texttt{part} (very similar to \texttt{chapter}):
% \begin{macrocode}
\newcommand*{\scr@dsc@style@part@options}{}
% \end{macrocode}
% \begin{description}
-% \item[\texttt{pagestyle}] Seitenstil für die Anfangsseite der
-% Gliederungsebene.
+% \item[\opt{pagestyle=\meta{name}}:]
+% The page style, that should be used for the starting page of the chapter
+% like outline level.
% \end{description}
% \begin{macrocode}
%<*report|book>
@@ -1991,30 +1933,32 @@
%</report|book>
% \end{macrocode}
% \begin{description}
-% \item[\texttt{afterindent}]
-% \changes{v3.26}{2018/09/18}{neue Option \texttt{afterindent}}%^^A
-% Fuzzy-Logik. Ein boolcher Wert gibt an, ob die erste Zeile nach der
-% Überschrift eingezogen werden soll. Als dritter Wert ist \texttt{bysign}
-% möglich. Dann hängt die Entscheidung für den Einzug vom Vorzeichen von
-% \texttt{beforeskip} ab. Ein negativer Wert bedeutet dann, dass der
-% Absatzeinzug nach der Überschrift unterdrückt werden soll.
+% \item[\opt{afterindent=\meta{fuzzy}}:]
+% \changes{v3.26}{2018/09/18}{option \opt{afterindent}}
+% fuzzy logic. A boolean value states whether to indent the first line
+% after the heading. With additional \opt{afterindent=bysign} the decision
+% depends on the sign of \opt{beforeskip}. Negative values of
+% \opt{beforeskip} result in no paragraph indent.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleFuzzyOption{part}
{afterindent}{scr@}{@afterindent}
{bysign}
% \end{macrocode}
-% \begin{description}\item[\texttt{beforeskip}]
-% Gibt den vertikalen Abstand vor der Übeschrift an. Im Fall von
-% \texttt{afterindent=bysign} wird der Absolutwert verwendet.
+% \begin{description}
+% \item[\opt{beforeskip=\meta{length}}:]
+% The vertical distance before the heading. If \opt{afterindent=bysign}, the
+% absolute value of \meta{length} is used. Otherwise the \meta{length} can
+% also be negative to move up the heading.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleLengthOption{part}
{beforeskip}{scr@}{@beforeskip}
% \end{macrocode}
% \begin{description}
-% \item[\texttt{innerskip}] Der Absolutwert gibt den vertikalen Abstand
-% innerhalb der Überschrift zwischen Präfix-Zeile und Text an.
+% \item[\opt{innerskip=\meta{length}}:]
+% The vertical distance between the prefix line and the text (if a prefix
+% line is used).
% \end{description}
% \begin{macrocode}
%<*book|report>
@@ -2023,32 +1967,41 @@
%</book|report>
% \end{macrocode}
% \begin{description}
-% \item[\texttt{afterskip}] Der Absolutwert gibt den vertikalen Abstand nach
-% der Überschrift an.
+% \item[\opt{afterskip=\meta{length}}:]
+% The vertical distance after the heading.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleLengthOption{part}
{afterskip}{scr@}{@afterskip}
% \end{macrocode}
% \begin{description}
-% \item[\texttt{font}] Schrifteinstellungen für das Element.
+% \item[\opt{font=\meta{font settings}}:]
+% The font setting for the font element of the heading.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleFontOption{part}{font}{}{}
% \end{macrocode}
% \begin{description}
-% \item[\texttt{font}] Schrifteinstellungen für die Präfixzeile des Elements.
+% \item[\opt{prefixfont=\meta{font settings}}:]
+% The font setting for the font element of the prefix line of the heading.
% \end{description}
% \begin{macrocode}
\DeclareSectionCommandStyleFontOption{part}{prefixfont}{}{prefix}
% \end{macrocode}
-% \end{macro}%^^A \scr@dsc@style@part@options
-% \begin{macro}{\scr@dsc@def@style@part@ommand}
-% \changes{v3.18}{2015/05/23}{neue Anweisung (intern)}
-% Diese Anweisung legt fest, wie ein Gliederungsbefehl für den Stil
-% \texttt{part} zu definieren ist. Das einzige Argument ist dabei der
-% \meta{Name} der Gliederungsebene, normalerweise \texttt{part}.
-% Das ist ganz ähnlich wie bei \cs{scr@dsc@def@style@chapter@command}.
+% \end{macro}^^A \scr@dsc@style@part@options
+% \begin{macro}{\scr@dsc@def@style@part@command}
+% \changes{v3.18}{2015/05/23}{added}
+% Macro
+% \begin{quote}
+% \cs{scr@dsc@def@style@part@command}\marg{command name}
+% \end{quote}
+% defines a section command \cs{\meta{command name}} of style
+% \texttt{part}. This looks like a mixture of
+% \cs{scr@dsc@def@style@section@command} and
+% \cs{scr@dsc@def@style@chapter@command}.
+% \begin{description}
+% \item[ToDo:] Make a more generic (and general) interface for this.
+% \end{description}
% \begin{macrocode}
\newcommand*{\scr@dsc@def@style@part@command}[1]{%
\@namedef{#1}{\scr@startpart{#1}}%
@@ -2059,8 +2012,7 @@
}
% \end{macrocode}
% \begin{macro}{\scr@dsc@style@part@subcommands}
-% \selectlanguage{english}%^^A
-% \changes{v3.30}{2020/04/08}{new (internal)}
+% \changes{v3.30}{2020/04/08}{added}
% Internal name list of additional commands to be defined for style
% \texttt{part} commands.
% \begin{macrocode}
@@ -2068,19 +2020,18 @@
@#1,@s#1,@end#1,set#1preamble%
}
% \end{macrocode}
-% \end{macro}%^^A \scr@dsc@style@part@subcommands
-% \end{macro}%^^A \scr@dsc@def@style@part@command
+% \end{macro}^^A \scr@dsc@style@part@subcommands
+% \end{macro}^^A \scr@dsc@def@style@part@command
%
% \begin{macro}{\scr@dsc@style@section@neededoptionstest}
-% \changes{v3.17}{2015/03/24}{Neu (intern)}%^^A
-% \changes{v3.24}{2017/04/25}{Voreinstellungen für \texttt{indent} und
-% \texttt{font}}%^^A
-% \changes{v3.26}{2018/09/18}{\texttt{runin} und \texttt{afterindent}
-% beachten}%^^A
-% Dieses Anweisung überprüft, ob alle notwendigen Eigenschaften für die
-% Definition der spezifischen Gliederungsebene im section-Stil bekannt
-% sind. Sollte das nicht der Fall sein, meldet sie einen Fehler und sorgt sie
-% mit \cs{aftergroup}\cs{@gobbletwo} dafür, dass die Definition unterbleibt.
+% \changes{v3.17}{2015/03/24}{added}
+% \changes{v3.24}{2017/04/25}{initial values of \opt{indent} and
+% \opt{font}}
+% \changes{v3.26}{2018/09/18}{supporting \opt{runin} and \opt{afterindent}}
+% This macro checks, that all attributes needed for the definition of a
+% section command (with style \texttt{section}) are properly setup. If not, an
+% error is reported and the definition is prevented (using
+% \cs{aftergroup}\cs{@gobbletwo} inside \cs{scr@declaresectioncommanderror}).
% \begin{macrocode}
\newcommand*{\scr@dsc@style@section@neededoptionstest}{%
\scr@ifundefinedorrelax{scr@\scr@dsc@current @sectionindent}{%
@@ -2121,17 +2072,17 @@
}{}%
}
% \end{macrocode}
-% \end{macro}%^^A \scr@dsc@style@section@neededoptionstest
+% \end{macro}^^A \scr@dsc@style@section@neededoptionstest
%
% \begin{macro}{\scr@dsc@style@chapter@neededoptionstest}
-% \changes{v3.17}{2015/03/24}{Neu (intern)}%^^A
-% \changes{v3.24}{2017/04/25}{Voreinstellungen für alle außer auf Ebene
-% \texttt{chapter}}%^^A
-% \changes{v3.28}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
-% Dieses Anweisung überprüft, ob alle notwendigen Eigenschaften für die
-% Definition der spezifischen Gliederungsebene im chapter-Stil bekannt
-% sind. Sollte das nicht der Fall sein, meldet sie einen Fehler und sorgt sie
-% mit \cs{aftergroup}\cs{@gobbletwo} dafür, dass die Definition unterbleibt.
+% \changes{v3.17}{2015/03/24}{added}
+% \changes{v3.24}{2017/04/25}{initial values for all but level
+% \texttt{chapter}}
+% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
+% This macro checks, that all attributes needed for the definition of a
+% chapter command (with style \texttt{chapter}) are properly setup. If not, an
+% error is reported and the definition is prevented (using
+% \cs{aftergroup}\cs{@gobbletwo} inside \cs{scr@declaresectioncommanderror}).
% \begin{macrocode}
%<*book|report>
\newcommand*{\scr@dsc@style@chapter@neededoptionstest}{%
@@ -2212,17 +2163,16 @@
}
%</book|report>
% \end{macrocode}
-% \end{macro}%^^A \scr@dsc@style@chapter@neededoptionstest
+% \end{macro}^^A \scr@dsc@style@chapter@neededoptionstest
%
% \begin{macro}{\scr@dsc@style@part@neededoptionstest}
-% \changes{v3.17}{2015/03/24}{Neu (intern)}
-% \changes{v3.24}{2017/04/25}{Voreinstellungen für alle außer auf Ebene
-% \texttt{part}}%^^A
-% \changes{v3.28}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
-% Dieses Anweisung überprüft, ob alle notwendigen Eigenschaften für die
-% Definition der spezifischen Gliederungsebene im part-Stil bekannt
-% sind. Sollte das nicht der Fall sein, meldet sie einen Fehler und sorgt sie
-% mit \cs{aftergroup}\cs{@gobbletwo} dafür, dass die Definition unterbleibt.
+% \changes{v3.17}{2015/03/24}{added}
+% \changes{v3.24}{2017/04/25}{initial values for all but level \texttt{part}}
+% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
+% This macro checks, that all attributes needed for the definition of a
+% part command (with style \texttt{part}) are properly setup. If not, an
+% error is reported and the definition is prevented (using
+% \cs{aftergroup}\cs{@gobbletwo} inside \cs{scr@declaresectioncommanderror}).
% \begin{macrocode}
\newcommand*{\scr@dsc@style@part@neededoptionstest}{%
%<*book|report>
@@ -2306,27 +2256,51 @@
}{}%
}
% \end{macrocode}
-% \end{macro}%^^A \scr@dsc@style@part@neededoptionstest
+% \end{macro}^^A \scr@dsc@style@part@neededoptionstest
%
-% \begin{macro}{\ifscr@dsc@parametersonly}
-% \changes{v3.17}{2015/03/24}{neu}%^^A
-% \changes{v3.20}{2015/11/18}{es gibt keine Dummy-Optionen mehr}%^^A
-% Dieser Schalter wird verwendet, um die Einstellungen entsprechend dem
-% aktuell gültigen Stil zu ändern, die zugehörige Anweisung selbst aber nicht
-% neu zu definieren. Er wird von einem leeren \texttt{style}-Wert lokal
-% gesetzt.
+% \begin{macro}{\scr@dsc@parametersonlytrue,\scr@dsc@parametersonlyfalse,
+% \ifscr@dsc@parametersonly}
+% \changes{v3.17}{2015/03/24}{added}
+% \changes{v3.20}{2015/11/18}{dummy options removed}
+% In the first option pass of \cs{DeclareSectionCommand} this is set to true,
+% if the \opt{style} option is used without value, to change the settings of a
+% command without running \cs{scr@dsc@def@style@\meta{style}@command} and
+% therefore without defining the command itself.
+% \begin{description}
+% \item[ToDo:] Is this a not documented feature? What's the sense?
+% \end{description}
% \begin{macrocode}
\newif\ifscr@dsc@parametersonly
% \end{macrocode}
-% \end{macro}%^^A \ifscr@dsc@parametersonly
+% \end{macro}^^A \ifscr@dsc@parametersonly
%
+% \begin{command}{\DeclareSectionCommand}
+% \changes{v3.15}{2014/11/21}{added}
+% \changes{v3.17}{2015/03/23}{re-implemented because of style depending
+% options}
+% \changes{v3.18}{2015/05/22}{\cs{scr@dsc@def@style@\dots @command}
+% defines style depending macros}
+% \changes{v3.20}{2015/10/03}{using \cs{DeclareTOCStyleEntry}}
+% The main command to define new section commands or redefine existing section
+% commands. Incidentally it also defines the corresponding ToC entry command.
+% \begin{quote}
+% \cs{DeclareSectionCommand}\oarg{options}\marg{command name}
+% \end{quote}
+% is used to define \cs{\meta{command name}}. The \meta{options} are used to
+% specify the behave of the command. It is declared as optional
+% argument. However for new commands not all the options are really optional.
+% \begin{description}
+% \item[Note:] Don't forget to declare all options, that are defined for
+% \cs{DeclareSectionCommand} also for \cs{ProvideSectionCommands}!
+% \end{description}
% \begin{macrocode}
\newcommand*{\DeclareSectionCommand}[2][]{%
\edef\scr@dsc@current{#2}%
% \end{macrocode}
-% Im ersten Durchlauf werden nur die Stil-Optionen ausgewertet:
+% The first pass to get the:
% \begin{description}
-% \item[\texttt{style}] Stil der Gliederungsebene
+% \item[\opt{style=\meta{name}}:]
+% style of the section command.
% \end{description}
% \begin{macrocode}
\scr@dsc@parametersonlyfalse
@@ -2345,16 +2319,16 @@
}%
% \end{macrocode}
% \begin{description}
-% \item[\texttt{tocstyle}]
-% \changes{v3.20}{2015/11/12}{Option \texttt{tocstyle} frühzeitig
-% auswerten}%^^A
-% \changes{v3.27}{2019/10/02}{Präfix für die Speicherung des
-% Verzeichnisstils geändert}%^^A
-% Verzeichnis-Eintrags-Stil, damit auch für diesen anschließend die Optionen
-% definiert bzw. aktiviert werden können. Zu beachten ist hier, dass ab
-% \textsf{tocbasic} 3.27 der Stil korrekter Weise in \cs{scr@tso@\meta{level
-% name}@style} statt in \cs{scr@dte@\meta{level name}@style} gespeichert
-% wird. Zur Sicherheit werden hier beide Makros behandelt.
+% \item[\opt{tocstyle=\meta{name}}:] \changes{v3.20}{2015/11/12}{early
+% evaluation of option \opt{tocstyle}} \changes{v3.27}{2019/10/02}{prefix
+% for storing directory style changed} style of the ToC entry. From
+% \pkg*{tocbasic} 3.27 the style name macro has been changed from
+% \cs{scr@dte@\meta{level name}@style} to \cs{scr@tso@\meta{level
+% name}@style}.
+% \begin{description}
+% \item[ToDo:] Don't support deprecated \cs{scr@dte@\meta{level name}@style}
+% any longer.
+% \end{description}
% \end{description}
% \begin{macrocode}
\DefineFamilyKey[.dsc]{KOMAarg}{tocstyle}{%
@@ -2382,12 +2356,11 @@
}%
% \end{macrocode}
% \begin{description}
-% \item[\texttt{@else@}]
-% \changes{v3.20}{2015/11/18}{Option \texttt{tocstyle} frühzeitig
-% auswerten}%^^A
-% Damit keine anderen Optionen ausgewertet werden müssen aber auch nicht als
-% unbekannte Optionen einen Fehler erzeugen, wird diese Spezialoption
-% definiert, die einfach nur \cs{FamilyKeyStateProcessed} setzt.
+% \item[\texttt{@else@=\meta{value}}:]
+% \changes{v3.20}{2015/11/18}{early evaluation of option \opt{tocstyle}}
+% All other options are ignored using the \opt{@else@} option, which simply
+% accepts every option. So the first pass does not report any unknown
+% options.
% \end{description}
% \begin{macrocode}
\DefineFamilyKey[.dsc]{KOMAarg}{@else@}{%
@@ -2404,10 +2377,8 @@
}%
\FamilyExecuteOptions[.dsc]{KOMAarg}{#1}%
% \end{macrocode}
-% \changes{v3.20}{2015/11/18}{Rüchnahme der Optionen nach dem ersten
-% Durchgang}%^^A
-% Nach dem ersten Druchgang müssen alle Optionen wieder zurückgenommen
-% werden.
+% \changes{v3.20}{2015/11/18}{Resetting options after first pass}
+% After the first pass we have to reset these options.
% \begin{macrocode}
\RelaxFamilyKey[.dsc]{KOMAarg}{@else@}%
\RelaxFamilyKey[.dsc]{KOMAarg}{tocstyle}%
@@ -2420,14 +2391,13 @@
\endgroup
\@firstofone{%
% \end{macrocode}
-% \changes{v3.20}{2015/11/12}{keine Dummy-Optionen für den echten Lauf}%^^A
-% Nachdem nun der Stil für den Gliederungsbefehl bekannt ist, können wir
-% dessen Optionen aktivieren:
+% \changes{v3.20}{2015/11/12}{dummy options for main pass removed}
+% Now, we know the style and can activate all the options of the style.
% \begin{macrocode}
%<trace> \typeout{TRACE: style=\@nameuse{scr@\scr@dsc@current @style}}%
\@nameuse{scr@dsc@style@\@nameuse{scr@\scr@dsc@current @style}@options}%
% \end{macrocode}
-% Außerdem muss der Verzeichniseintrags-Stils initialisiert werden:
+% And initialize the ToC style.
% \begin{macrocode}
%<trace> \typeout{TRACE: tocstyle=%
%<trace> \@nameuse{scr@tso@\scr@dsc@current @style}}%
@@ -2438,14 +2408,16 @@
}{}%
% \end{macrocode}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
-% \cs{kernel@ifnextchar}}%^^A
-% \changes{v3.21}{2016/06/12}{erlaube auch \texttt{tocentry} an Stelle von
-% \texttt{toc} als Präfix}%^^A
-% An dieser Stelle müssen die Optionen des Verzeichniseintrags auf Optionen
-% der Gliederungsebene abgebildet werden. Dazu erhalten sie in der
-% Gliederungebene den Präfix \texttt{toc}. Das bedeutet gleichzeitig, dass es
-% keine Verzeichniseintragsoption Namens \texttt{style} geben kann und dass
-% Gliederungsoptionen nicht mit \texttt{toc} beginnen dürfen.
+% \cs{kernel@ifnextchar}}
+% \changes{v3.21}{2016/06/12}{support for prefix \opt{tocentry} instead of
+% \opt{toc}}
+% We also have to define options for all the ToC style options by adding the
+% prefix \opt{toc} to the names of these options. This also means a ToC style
+% option \opt{style} must not exist (because we already have an option
+% \opt{tocstyle}). This is the main reason, \cs{DeclareTOCStyleEntry} has not
+% such an option but a corresponding argument. Additionally ToC style options
+% should never start with \opt{toc} (because of the ugly resulting
+% \opt{toctoc\dots}).
% \begin{macrocode}
\let\scr@dsc@tocstyle@options\@empty
\let\scr@dsc@extra@relax@opts\@empty
@@ -2502,26 +2474,30 @@
\do@endgroup
}%
% \end{macrocode}
-% Die Optionen für die Stile von Verzeichniseintrag und Gliederungsebene
-% werden nicht erneut benötigt, müssten aber natürlich erneut verarbeitet
-% werden.
+% Make option \opt{style} and \opt{tocstyle} (fast) dummies, because they
+% already have been handled completely.
% \begin{macrocode}
\DefineFamilyKey[.dsc]{KOMAarg}{style}{\FamilyKeyStateProcessed}%
\DefineFamilyKey[.dsc]{KOMAarg}{tocstyle}{\FamilyKeyStateProcessed}%
% \end{macrocode}
-% Dazu kommen einige Optionen, die es schlicht immer gibt:
-% \begin{description}\item[\texttt{expandtopt}] Schalter, um die Längen zur
-% Definitionszeit statt zur Anwendungszeit komplett zu expandieren. Das
-% bedingt dann aber auch, dass die Längen nicht mehr abhängig von der
-% aktuellen Schriftgröße sind.\end{description}
+% Some options exist for all section command styles and therefore are defined
+% here and not a part of the style options:
+% \begin{description}
+% \item[\opt{expandtopt=\meta{boolean}}:]
+% If \texttt{true} all lengths are expanded at setting time to unit pt
+% instead of used unchanged. With this, the lengths are not depending on the
+% font size of usage time but on the current font size.
+% \end{description}
% \begin{macrocode}
\FamilyBoolKey[.dsc]{KOMAarg}{expandtopt}{scr@dsc@expandtopt}%
\scr@dsc@expandtoptfalse
% \end{macrocode}
-% \begin{description}\item[\texttt{increaselevel}] Automatische Erhöhung des
-% Wertes von Option \texttt{level} mit Säumniswert 1. Diese Option wird nur
-% definiert, wenn \cs{DeclareSectionCommands} verwendet wurde, was an
-% \cs{scr@local@levelincrease} erkannt wird.\end{description}
+% \begin{description}
+% \item[\opt{increaselevel=\meta{number}}:]
+% Automatically increase \opt{level} by \meta{number} (with default 1). This
+% is needed for \cs{DeclareSectionCommands} and therefore only defined if
+% \cs{scr@local@levelincrease} is defined.
+% \end{description}
% \begin{macrocode}
\scr@ifundefinedorrelax{scr@local@levelincrease}{%
\RelaxFamilyKey[.dsc]{KOMAarg}{increaselevel}%
@@ -2530,8 +2506,10 @@
{\scr@local@levelincrease}%
}%
% \end{macrocode}
-% \begin{description}\item[\texttt{level}] nummerische
-% Gliederungsebene\end{description}
+% \begin{description}
+% \item[\opt{level=\meta{number}}:]
+% The numerical outline level of the command.
+% \end{description}
% \begin{macrocode}
\scr@ifundefinedorrelax{scr@local@leveloffset}{%
\edef\reserved@a{%
@@ -2554,28 +2532,31 @@
}\reserved@a
}%
% \end{macrocode}
-% \changes{v3.19}{2015/09/09}{neue Eigenschaft \texttt{counterwithout}}
-% \begin{description}\item[\texttt{counterwithout}] Der Zähler dieser Ebene
-% soll nicht länger abhängen vom angegebenen Zähler.
+% \begin{description}
+% \item[\opt{counterwithout=\meta{name}}:]
+% \changes{v3.19}{2015/09/09}{option \opt{counterwithout}}
+% The counter of this command should not depend on the counter
+% \cnt{name} any longer.
% \end{description}
% \begin{macrocode}
\FamilyStringKey[.dsc]{KOMAarg}{counterwithout}{\scr@local@counterwithout}%
\let\scr@local@counterwithout\relax
% \end{macrocode}
-% \begin{description}\item[\texttt{counterwithin}] Der Zähler dieser Ebene
-% soll abhängen vom angegebenen Zähler.
+% \begin{description}
+% \item[\opt{counterwithin=\meta{name}}:]
+% The counter of this command depends on the counter \cnt{name}.
% \end{description}
% \begin{macrocode}
\FamilyStringKey[.dsc]{KOMAarg}{counterwithin}{\scr@local@counterwithin}%
\let\scr@local@counterwithin\relax
% \end{macrocode}
% \begin{description}
-% \item[\texttt{toclevel}] Ebene im Inhaltsverzeichnis (Voreinstellung ist
-% derselbe Wert wie für level); diese Option gibt es nur, wenn der
-% Verzeichnisstil sie unterstützt (was jeder Verzeichnisstil
-% sollte); wenn allerdings ein Offset dafür definiert ist, dann wird die
-% Option nicht einfach an den Stil weitergereicht, muss also noch einmal
-% umdefiniert werden.
+% \item[\opt{toclevel=\meta{number}}:]
+% The numerical ToC entry level. Default is \opt{level}. This option exists
+% only, if the ToC style supports it. But because with
+% \cs{DeclareSectionCommands} we need an offset for this (similar to the
+% increase of \opt{level}). So we have to redefine it in case of existing
+% \cs{scr@local@tocleveloffset}.
% \end{description}
% \begin{macrocode}
\scr@ifundefinedorrelax{scr@local@tocleveloffset}{}{%
@@ -2595,8 +2576,8 @@
}%
}%
% \end{macrocode}
-% \changes{v3.20}{2015/11/12}{Optionen werden nur temporär definiert}%^^A
-% Optionen ausführen und anschließend wieder freigeben.
+% \changes{v3.20}{2015/11/12}{only temporary definition of options}
+% The main pass of options execution. Afterwards reset all the options.
% \begin{macrocode}
\FamilyExecuteOptions[.dsc]{KOMAarg}{#1}%
\scr@dsc@extra@relax@opts
@@ -2611,11 +2592,10 @@
\RelaxFamilyKey[.dsc]{KOMAarg}{level}%
\RelaxFamilyKey[.dsc]{KOMAarg}{counterwithin}%
% \end{macrocode}
-% Testen, ob alle benötigten Optionen für die (Um-)Definierung des
-% Gliederungsbefehls gesetzt sind,
-% \changes{v3.27}{2019/02/07}{\texttt{level} darf nicht -\cs{maxdimen}
-% sein}%^^A
-% wobei \texttt{level} nicht -\cs{maxdimen} ist:
+% Now, we can test, if all needed options has been defined.
+% \changes{v3.27}{2019/02/07}{\opt{level} must no be -\cs{maxdimen}}
+% Also test, that \opt{level} is not -\len{maxdimen}, because this value is
+% used internally to switch of numbering locally.
% \begin{macrocode}
\begingroup
\def\local@endgroup{\endgroup}%
@@ -2643,14 +2623,13 @@
}%
\local@endgroup
% \end{macrocode}
-% Wenn alle Informationen für die (Um-)Definierung des Gliederungsbefehls
-% zusammen sind \dots
+% If the configuration is compete, we are ready for the (re-)definition of the
+% command.
% \begin{macrocode}
\@firstofone{%
% \end{macrocode}
-% Zunächst sicherstellen, dass der Zähler existiert und ggf. dessen
-% Ausgabe anpassen:
-% \changes{v3.20}{2015/10/15}{fehlendes \cs{expandafter} ergänzt}%^^A
+% \changes{v3.20}{2015/10/15}{missing \cs{expandafter} added}
+% First of all we need a counter:
% \begin{macrocode}
\@ifundefined{c@#2}{\newcounter{#2}}{}%
\ifx\scr@local@counterwithout\relax
@@ -2674,7 +2653,7 @@
\@namedef{#2format}{\csname the#2\endcsname\autodot\enskip}%
}{}%
% \end{macrocode}
-% Dann den eigentlichen Gliederungsbefehl definieren:
+% Then the command itself (but only, if the \opt{style} was not empty):
% \begin{macrocode}
\ifscr@dsc@parametersonly
\ClassInfo{\KOMAClassName}{%
@@ -2697,11 +2676,10 @@
}%
\fi
% \end{macrocode}
-% Zu jedem Gliederungsbefehl gehört auch ein Befehl für den Kolumnentitel, der
-% bei \KOMAScript{} außerdem eine Formatierung des Zählers benötigt. Falls
-% \textsf{scrlayer} geladen ist, wird das über dessen Befehl
-% |\DeclareSectionNumberDepth| erledigt, sonst direkt:
-% \changes{v3.15a}{2015/01/21}{fix: \cs{endskip} statt \cs{enskip}}%^^A
+% We also need commands for the running head and a corresponding number
+% formatting. With \pkg*{scrlayer} this can and should be done using
+% \cs{DeclareSectionNumberDepth}. Otherwise we do it step by step.
+% \changes{v3.15a}{2015/01/21}{\cs{endskip} instead of \cs{enskip}}
% \begin{macrocode}
\@ifundefined{DeclareSectionNumberDepth}{%
\@ifundefined{#2markformat}{%
@@ -2714,8 +2692,7 @@
\DeclareSectionNumberDepth{#2}{\csname #2numdepth\endcsname}%
}%
% \end{macrocode}
-% Und es gehören Befehle dazu, um einen Eintrag ins Inhaltsverzeichnis zu
-% schreiben und den Eintrag auch darzustellen:
+% We also need macros to generate and print the ToC entry.
% \begin{macrocode}
\expandafter\providecommand\expandafter*%
\csname add#2tocentry\endcsname[2]{%
@@ -2735,12 +2712,11 @@
\DeclareTOCStyleEntry[\scr@dsc@tocstyle@options]{default}{#2}%
}{}%
% \end{macrocode}
-% \changes{v3.20}{2015/0/07}{\textsf{hyperref} bei den Ebenen der
-% Verzeichniseinträge berücksichtigen}%^^A
-% \changes{v3.26}{2018/06/27}{Einstellungen von \textsl{hyperref}
-% überschreiben}%^^A
-% \changes{v3.26}{2018/06/27}{Notfallbehandlung für Lücken in den
-% Bookmark-Ebenen}%^^A
+% \changes{v3.20}{2015/0/07}{support for ToC levels with \pkg{hyperref}}
+% \changes{v3.26}{2018/06/27}{overwrite ToC levels of \pkg{hyperref}}
+% \changes{v3.26}{2018/06/27}{fallback handling of gaps in the bookmark
+% levels}
+% And we need extra code for \pkg{hyperref} and the bookmarks.
% \begin{macrocode}
\if@atdocument
\let\reserved@a\@firstofone
@@ -2817,12 +2793,12 @@
}
% \end{macrocode}
% \begin{macro}{\scr@declaresectioncommanderror}
-% \changes{v3.15}{2014/11/21}{neue (interne) Anweisung}%^^A
-% Gibt einen Fehler aus, falls \cs{DeclareSectionCommand} zu wenige Optionen
-% übergeben wurde. Das erste Argument ist der Name des zu deklarierenden
-% Befehls, das zweite ist eine textuelle Beschreibung der fehlenden Option und
-% das dritte ist der Name der fehlenden Option. Als Seiteneffekt sorgt der
-% Befehl dafür, dass die Deklaration nicht stattfindet.
+% \changes{v3.15}{2014/11/21}{added}
+% It there were not enough options to \cs{DeclareSectionCommand} to define the
+% command, we report an error and also execute
+% \cs{aftergroup}\cs{@gobbletwo}. So the |\@firstofone{…}| code after
+% |\endgroup| resp. |\local@endgroup| inside \cs{DeclareSectionCommand} that
+% defines the new section command etc. will never be used in such a case.
% \begin{macrocode}
\newcommand*{\scr@declaresectioncommanderror}[3]{%
\ClassError{\KOMAClassName}{%
@@ -2835,17 +2811,10 @@
\aftergroup\@gobbletwo
}
% \end{macrocode}
-% \end{macro}%^^A \scr@declaresectioncommanderror
+% \end{macro}^^A \scr@declaresectioncommanderror
% \begin{macro}{\scr@declaresectioncommandwarning}
-% \changes{v3.24}{2017/04/25}{neue (interne) Anweisung}%^^A
-% In einigen Fällen genügt es hingegen eine Warnung oder Info für fehlende
-% Optionen auszugeben und einen Defaultwert zu verwenden. Das erste Argument
-% ist auch hier der Name des zu deklarierenden Befehls, das zweite eine
-% textuelle Beschreibung der fehlenden Option und das dritte der Name der
-% fehlenden Option. Das vierte ist der Defaultwert, der ersatzweise verwendet
-% wird. Der Befehl hat wie \cs{scr@declaresectioncommanderror} einen
-% Seiteneffekt. In diesem Fall wird \cs{local@endgroup} um das fünfte Argument
-% erweitert.
+% \changes{v3.24}{2017/04/25}{added}
+% Sometimes a warning and extension of \cs{local@endgroup} is enough.
% \begin{macrocode}
\newcommand*{\scr@declaresectioncommandwarning}[5]{%
\ClassInfo{\KOMAClassName}{%
@@ -2857,18 +2826,19 @@
\l@addto@macro\local@endgroup{#5}%
}
% \end{macrocode}
-% \end{macro}%^^A \scr@declaresectioncommandwarning
-% \end{macro}%^^A \DeclareSectionCommand
+% \end{macro}^^A \scr@declaresectioncommandwarning
+% \end{command}^^A \DeclareSectionCommand
+%
%
-% \begin{macro}{\DeclareNewSectionCommand}
-% \changes{v3.15}{2014/11/21}{neue Anweisung}%^^A
-% \changes{v3.25}{2018/03/10}{zusätzliche Tests und Fehlermeldungen bei
+% \begin{command}{\DeclareNewSectionCommand}
+% \changes{v3.15}{2014/11/21}{added}
+% \changes{v3.25}{2018/03/10}{additional tests and errors about
% \cs{the\dots}, \cs{\dots mark}, \cs{\dots format},
-% \cs{\dots markformat}}%^^A
-% \changes{v3.30}{2020/04/08}{unerwünschte Leerzeichen eliminiert}%^^A
-% Basierend auf |\DeclareSectionCommand| wird eine Gliederungsanweisung
-% definiert, die zuvor noch nicht existierte. Wichtig zu bemerken ist, dass
-% die ganzen Hilfsanweisungen bereits existieren dürfen.
+% \cs{\dots markformat}}
+% \changes{v3.30}{2020/04/08}{orphan spaces removed}
+% This is similar to \cs{DeclareSectionCommand} but reports an error, if the
+% command or a main helper already exist. So it can be used for new commands
+% only.
% \begin{macrocode}
\newcommand*{\DeclareNewSectionCommand}[2][]{%
\@ifundefined{#2}{%
@@ -2882,9 +2852,8 @@
}%
\if@tempswa
% \end{macrocode}
-% \changes{v3.30}{2020/04/08}{erweiterte Neuheitsprüfung}%^^A
-% Es wird der Stil benötigt, um zu ermitteln, ob die Unterbefehle für diesen
-% Stil möglicherweise bereits definiert sind.
+% \changes{v3.30}{2020/04/08}{extended test for really new}
+% After the general user commands, we just have to detect the style \dots
% \begin{macrocode}
\expandafter\let\expandafter\scr@dsc@current
\csname scr@tso@##2@style\endcsname
@@ -2898,7 +2867,8 @@
\RelaxFamilyKey[.dsc]{KOMAarg}{style}%
\@tempswatrue
% \end{macrocode}
-% Wenn der Stil definiert ist und Unterbefehle kennt, diese ebenfalls testen.
+% \dots{} to gut through the \cs{scr@dsc@style@\meta{style}@subcommands} and
+% test, if one of them exists.
% \begin{macrocode}
\@ifundefined{scr@dsc@current}{}{%
\scr@ifundefinedorrelax{scr@dsc@style@\scr@dsc@current @subcommands}{%
@@ -2919,6 +2889,10 @@
\let\scr@dsc@current\relax
\fi
\if@tempswa
+% \end{macrocode}
+% If not, we can use \cs{DeclareSectionCommand}. Otherwise just report an
+% error.
+% \begin{macrocode}
\DeclareSectionCommand[{#1}]{#2}%
\else
\ClassError{\KOMAClassName}{%
@@ -2952,13 +2926,14 @@
}%
}
% \end{macrocode}
-% \end{macro}%^^A \DeclareNewSectionCommand
+% \end{command}^^A \DeclareNewSectionCommand
%
-% \begin{macro}{\RedeclareSectionCommand}
-% \changes{v3.15}{2014/11/21}{neue Anweisung}%^^A
-% Basierend auf |\DeclareSectionCommand| wird eine Gliederungsanweisung
-% umdefiniert, die zuvor bereits existierte. Wichtig zu bemerken ist, dass
-% die ganzen Hilfsanweisungen nicht zu exisieren brauchen.
+% \begin{command}{\RedeclareSectionCommand}
+% \changes{v3.15}{2014/11/21}{added}
+% This is much easier than \cs{DeclareNewSectionCommand} because it tests only
+% for the main command and uses \cs{DeclareSectionCommand} if the main command
+% already exists. So all the additional commands and main helpers do not need
+% to exist.
% \begin{macrocode}
\newcommand*{\RedeclareSectionCommand}[2][]{%
\@ifundefined{#2}{%
@@ -2978,10 +2953,18 @@
}%
}
% \end{macrocode}
-% \end{macro}%^^A \RedeclareSectionCommand
+% \end{command}^^A \RedeclareSectionCommand
%
-% \begin{macro}{\ProvideSectionCommand}
-% \changes{v3.15}{2014/11/21}{neue Anweisung}%^^A
+% \begin{command}{\ProvideSectionCommand}
+% \changes{v3.15}{2014/11/21}{added}
+% This is much easier than \cs{DeclareNewSectionCommand} because currently it
+% tests only for the command itself but nor for the helpers.
+% \begin{description}
+% \item[ToDo:] This is dangerous, because
+% e.g. |\ProvideSectionCommand{schapter}| would break \cs{chapter} (because
+% of \cs{@schapter}). So maybe it should do the same tests as
+% \cs{DeclareNewSectionCommand} and at least warn.
+% \end{description}
% Basierend auf |\DeclareSectionCommand| wird eine Gliederungsanweisung
% definiert, wenn sie zuvor noch nicht existierte. Wichtig zu bemerken ist,
% dass die ganzen Hilfsanweisungen bereits existieren dürfen.
@@ -2996,16 +2979,22 @@
}%
}
% \end{macrocode}
-% \end{macro}%^^A \ProvideSectionCommand
-%
-% \begin{macro}{\DeclareSectionCommands}
-% \changes{v3.15}{2014/12/03}{neue Anweisung}%^^A
-% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} eingefügt}%^^A
-% Basierend auf \cs{DeclareSectionCommand} können gleich mehrere
-% Gliederungsanweisungen definiert werden. Dabei sorgt Option
-% \texttt{increaselevel} dafür, dass die Werte von \texttt{level} und
-% \texttt{toclevel} automatisch von Befehl zu Befehl um den angegebenen Wert
-% (Default ist 1) erhöht werden.
+% \end{command}^^A \ProvideSectionCommand
+%
+% \begin{command}{\DeclareSectionCommands}
+% \changes{v3.15}{2014/12/03}{added}
+% \changes{v3.26}{2018/08/29}{using \cs{scr@trim@spaces}}
+% Based on \cs{DeclareSectionCommand} this one can be used to define several
+% commands at once. The commands are given as a comma-separated list of
+% commands. There is one additional option \opt{increaselevel=\meta{number}}
+% to add \meta{number} to the \opt{level} at each call of
+% \cs{DeclareSectionCommand} but the first one. The definition of this option
+% is done inside \cs{DeclareSectionCommand} if \cs{scr@local@levelincrease} is
+% defined. Because of the first run, we initialize it with 0. The same has to
+% be done for \cs{scr@local@leveloffset} and \cs{scr@local@tocleveloffset}.
+% At the end we also have to un-define these local commands. Otherwise later
+% usage of \cs{DeclareSectionCommand} would be detected as part of
+% \cs{DeclareSectionCommands}.
% \begin{macrocode}
\newcommand*{\DeclareSectionCommands}[2][]{%
\edef\reserved@a{#2}%
@@ -3024,16 +3013,19 @@
\let\scr@local@tocleveloffset\relax
}
% \end{macrocode}
-% \end{macro}%^^A \DeclareSectionCommands
+% \end{command}^^A \DeclareSectionCommands
%
-% \begin{macro}{\DeclareNewSectionCommands}
-% \changes{v3.15}{2014/12/03}{neue Anweisung}%^^A
-% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} eingefügt}%^^A
-% Im Unterschied zu \cs{DeclareNewSectionCommand} führt diese Anweisung die
-% Änderung auch dann aus, wenn die Anweisung bereits deklariert war. Eine
-% Fehlermeldung wird aber natürlich trotzdem ausgegeben. Dieser Unterschied
-% ist jedoch notwendig, weil sonst Option \texttt{increaselevel} für
-% nachfolgende Befehle nicht mehr korrekt arbeiten würde.
+% \begin{command}{\DeclareNewSectionCommands}
+% \changes{v3.15}{2014/12/03}{added}
+% \changes{v3.26}{2018/08/29}{using \cs{scr@trim@spaces}}
+% Because of \opt{increaselevel} we cannot simply use
+% \cs{DeclareNewSectionCommand} inside, but have to use
+% \cs{DeclareSectionCommand} even for already defined commands (but
+% nevertheless report an error).
+% \begin{description}
+% \item[ToDo:] Is this really the correct error action? Does it really matter,
+% if \opt{increaselevel} would be wrong after already reporting an error?
+% \end{description}
% \begin{macrocode}
\newcommand*{\DeclareNewSectionCommands}[2][]{%
\edef\reserved@a{#2}%
@@ -3067,16 +3059,19 @@
\let\scr@local@tocleveloffset\relax
}
% \end{macrocode}
-% \end{macro}%^^A \DeclareNewSectionCommands
+% \end{command}^^A \DeclareNewSectionCommands
%
-% \begin{macro}{\RedeclareSectionCommands}
-% \changes{v3.15}{2014/12/03}{neue Anweisung}%^^A
-% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} eingefügt}%^^A
-% Im Unterschied zu \cs{RedeclareNewSectionCommands} führt diese Anweisung die
-% Änderung auch dann aus, wenn die Anweisung noch nicht deklariert war. Eine
-% Fehlermeldung wird aber natürlich trotzdem ausgegeben. Dieser Unterschied
-% ist jedoch notwendig, weil sonst Option \texttt{increaselevel} für
-% nachfolgende Befehle nicht mehr korrekt arbeiten würde.
+% \begin{command}{\RedeclareSectionCommands}
+% \changes{v3.15}{2014/12/03}{added}
+% \changes{v3.26}{2018/08/29}{using \cs{scr@trim@spaces}}
+% Because of \opt{increaselevel} we cannot simply use
+% \cs{RedeclareSectionCommand} inside, but have to use
+% \cs{DeclareSectionCommand} even for not yet defined commands (but
+% nevertheless report an error).
+% \begin{description}
+% \item[ToDo:] Is this really the correct error action? Does it really matter,
+% if \opt{increaselevel} would be wrong after already reporting an error?
+% \end{description}
% \begin{macrocode}
\newcommand*{\RedeclareSectionCommands}[2][]{%
\edef\reserved@a{#2}%
@@ -3108,16 +3103,16 @@
\let\scr@local@tocleveloffset\relax
}
% \end{macrocode}
-% \end{macro}%^^A \RedeclareSectionCommands
+% \end{command}^^A \RedeclareSectionCommands
%
-% \begin{macro}{\ProvideSectionCommands}
-% \changes{v3.15}{2014/12/03}{neue Anweisung}%^^A
-% \changes{v3.17}{2015/03/23}{Umbau, um stilabhängige Optionen zu
-% ermöglichen}%^^A
-% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} eingefügt}%^^A
-% Hier wird es nun wirklich schwierig, weil wir irgendwie dafür sorgen müssen,
-% dass Option \texttt{increaselevel} funktioniert, auch wenn gar nichts
-% definiert werden darf. Das macht die Geschichte ein wenig auswändig.
+% \begin{command}{\ProvideSectionCommands}
+% \changes{v3.15}{2014/12/03}{added}
+% \changes{v3.17}{2015/03/23}{re-implemented because of style depending
+% options}
+% \changes{v3.26}{2018/08/29}{using \cs{scr@trim@spaces}}
+% This is the real problematic case, because \opt{increaselevel} should be
+% used even for commands, that must not be defined. However, maybe a solution
+% like this should be used for the two previous commands too.
% \begin{macrocode}
\newcommand*{\ProvideSectionCommands}[2][]{%
\edef\reserved@a{#2}%
@@ -3133,10 +3128,8 @@
\reserved@a
}{%
% \end{macrocode}
-% Wenn die Anweisung bereits definiert ist, dann müssen wir trotzdem die
-% Optionen auswerten, wobei allerdings nur die Option \texttt{level} und
-% \texttt{increaselevel} eine Wirkung haben dürfen. Der Rest wird per
-% \texttt{@else}-Optionen erledigt.
+% If the command already exists, process options \opt{level}, \opt{toclevel}
+% and \opt{increaselevel} and ignore all others using an \opt{@else@} option.
% \begin{macrocode}
\DefineFamilyKey[.dsc]{KOMAarg}{@else@}{\FamilyKeyStateProcessed}%
\FamilyCounterMacroKey[.dsc]{KOMAarg}{increaselevel}[1]%
@@ -3166,11 +3159,10 @@
}
%</body>
% \end{macrocode}
-% \end{macro}%^^A \ProvideSectionCommands
+% \end{command}^^A \ProvideSectionCommands
%
-% \begin{macro}{\IfSectionCommandStyleIs}
-% \selectlanguage{english}%^^A
-% \changes{v3.27}{2019/02/04}{new}%^^A
+% \begin{command}{\IfSectionCommandStyleIs}
+% \changes{v3.27}{2019/02/04}{added}
% Test whether ot not the section command of argument 1 has the style of
% argument 2. If so: use argument 3, of not: use argument 4.
% \begin{macrocode}
@@ -3201,19 +3193,18 @@
}
%</body>
% \end{macrocode}
-% \end{macro}
+% \end{command}
%
% \begin{option}{bookmarkpackage}
-% \selectlanguage{english}%^^A
-% \changes{v3.26}{2018/06/27}{new option}%^^A
-% Package \textsf{hyperref} has problems with bookmark level gaps. So if
+% \changes{v3.26}{2018/06/27}{added}
+% Package \pkg{hyperref} has problems with bookmark level gaps. So if
% either the users omits a heading level or defines a heading with a level
% that distinguish more than one from the previous or following level, there
% would be a problem. One recommended solution for this would be to use
-% package \textsf{bookmark}. So if we load this package, we can use the same
+% package \pkg{bookmark}. So if we load this package, we can use the same
% value for bookmark levels and TOC levels even within
-% \textsf{scrartcl}. Nevertheless we allow the user to decide not to use
-% \textsf{bookmark}, but then it is not my fault, if something strange
+% \cls*{scrartcl}. Nevertheless we allow the user to decide not to use
+% \pkg{bookmark}, but then it is not my fault, if something strange
% happens.
% \begin{macrocode}
%<*option>
@@ -3225,13 +3216,13 @@
\@ifpackageloaded{bookmark}{}{%
\if@scr@autoloadbookmarkpackage
% \end{macrocode}
-% \changes{v3.27}{2019/06/26}{try to translate \textsf{hyperref} driver to
-% \textsf{bookmark} driver option}%^^A
-% The name of the \textsf{hyperref} driver is in \cs{Hy@driver}. But
-% \textsf{bookmark} does not provide the same drivers, so we try to translate
-% the curreny known \textsf{hyperref} drivers to \textsf{bookmark}
-% drivers. Also we do not load \textsf{bookmark} with a driver option but
-% define \textsf{bookmark}'s \cs{BookmarkDriverDefault}.
+% \changes{v3.27}{2019/06/26}{try to translate \pkg{hyperref} driver to
+% \pkg{bookmark} driver option}
+% The name of the \pkg{hyperref} driver is in \cs{Hy@driver}. But
+% \pkg{bookmark} does not provide the same drivers, so we try to translate
+% the curreny known \pkg{hyperref} drivers to \pkg{bookmark}
+% drivers. Also we do not load \pkg{bookmark} with a driver option but
+% define \pkg{bookmark}'s \cs{BookmarkDriverDefault}.
% \begin{macrocode}
\scr@ifundefinedorrelax{Hy@driver}{%
\ClassWarning{\KOMAClassName}{%
@@ -3241,11 +3232,11 @@
}%
}{%
% \end{macrocode}
-% \changes{v3.28}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
+% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
% Note: \texttt{hpdftex}, \texttt{hluatex}, \texttt{hxetex} and \texttt{hvtex}
% do not need to be translated, because they are autodetected by
-% \textsf{bookmark} as well. \texttt{hypertex}, \texttt{hdviwindo},
-% \texttt{htex4ht} and \texttt{latex2html} are not known by \textsf{bookmark},
+% \pkg{bookmark} as well. \texttt{hypertex}, \texttt{hdviwindo},
+% \texttt{htex4ht} and \texttt{latex2html} are not known by \pkg{bookmark},
% so we stay with the default (usually \texttt{dvips}).
% \begin{macrocode}
\Ifstr{\Hy@driver}{hdvips}{%
@@ -3283,9 +3274,9 @@
}%
% \end{macrocode}
% \changes{v3.33}{2021/02/17}{workaround for catcode changes of
-% \textsf{babel-spanish}}
-% For \textsf{babel-spanish} we need to deactivate quoting before loading
-% \textsf{bookmark}.
+% \pkg{babel-spanish}}
+% For \pkg{babel-spanish} we need to deactivate quoting before loading
+% \pkg{bookmark}.
% \begin{macrocode}
\@ifundefined{es@quoting}{%
\RequirePackage{bookmark}%
@@ -3305,8 +3296,8 @@
\fi
}%
% \end{macrocode}
-% \changes{v3.26b}{2019/01/17}{workaround for \cs{@beginmainauxhook} added}%^^A
-% Sometimes \textsf{auxhook} is not able to recognize that it cannot use a
+% \changes{v3.26b}{2019/01/17}{workaround for \cs{@beginmainauxhook} added}
+% Sometimes \pkg{auxhook} is not able to recognize that it cannot use a
% patch of \cs{document} to execute \cs{@beginmainauxhook} if it is loaded via
% \cs{AtBeginDocument}. In this case we do it here.
% \begin{macrocode}
@@ -3335,28 +3326,27 @@
}%
}
%</option>
-%</class>
% \end{macrocode}
-% \selectlanguage{ngerman}%^^A
-% \end{option}%^^A bookmarkpackage
+% \end{option}^^A bookmarkpackage
%
%
-% \subsection{Definitionen für Präambeln}
+% \subsection{Preambles of parts or chapters}
%
-% Bei den \KOMAScript-Klassen \textsf{scrbook} und \textsf{scrreprt}
-% können \cs{part} und \cs{chapter} mit Präambeln versehen werden. Es
-% wird gleichzeitig eine Präambel über und unter der jeweiligen
-% Überschrift unterstützt.
+% The \KOMAScript{} classes \cls*{scrbook} and \cls*{scrreprt} provide
+% preambles above and below the headings of parts and chapters. The preamble
+% above is printed into the usual distance above the headings. It does not
+% increase this distance to avoid \emph{jumping headings}. However here we
+% have only the generic code for preambles. The user commands are defined by
+% \cs{scr@dsc@style@chapter@command} and \cs{scr@dsc@style@part@command}.
%
% \begin{macro}{\use@preamble}
-% \changes{v2.8p}{2001/09/25}{neu (intern)}%^^A
-% Dieses Makro dient allgemein zum Setzen einer Präambel (für
-% Gliederungsüberschriften), wenn eine solche definiert ist. Als
-% Argument wird der Name der Präambel übergeben, an den automatisch
-% \texttt{@preamble} angehängt wird. Zum Schluss wird die gespeicherte
-% Präambel gelöscht.
-% \begin{macrocode}
-%<*class>
+% \changes{v2.8p}{2001/09/25}{added}
+% Used as a general macro to print the stored preamble code and clean the
+% storage. Preambles are only printed, if the storage is defined. But an empty
+% defined storage would be printed. The argument is the name of the storage,
+% e.g., \texttt{chapter@o}, \texttt{chapter@u}, \texttt{part@o},
+% \texttt{part@u}.
+% \begin{macrocode}
%<*book|report>
%<*body>
\newcommand*{\use@preamble}[1]{%
@@ -3368,58 +3358,56 @@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\set@preamble}
-% \changes{v2.8p}{2001/09/25}{neu (intern)}%^^A
+% \changes{v2.8p}{2001/09/25}{added}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
-% \cs{kernel@ifnextchar}}%^^A
-% Das Makro \cs{set@preamble} dient allgemein der Defintion einer
-% Präambel (für Gliederungsüberschriften). Als Argument wird der
-% Name der Gliederungsebene übergeben. Danach folgt ein optionales
-% Argument, das die Position der Präambel angibt. Darauf folgt ein
-% weiteres optionales Argument, das die Breite der Präambel
-% angibt. Ist nur ein optionales Argument angegeben, so ist es die
-% Position. Es folgt ein obligatorisches Argument mit dem Inhalt der
-% Präambel. Die Definition der Präambel erfolgt global.
+% \cs{kernel@ifnextchar}}
+% Macro
+% \begin{quote}
+% \cs{set@preamble}\marg{level name}\oarg{position}\oarg{width}\marg{text}
+% \end{quote}
+% defines a preamble code stored into \cs{\meta{preamble name}@preamble}. The
+% \meta{preamble name} is build depending on the \meta{level name} and the
+% \meta{position}. The \meta{position} is a combination of vertical and
+% horizontal position and used to generate not only the \meta{preamble name}
+% but also options for the \cs{parbox} used to encapsulate the \meta{text}
+% into a preamble code. The \meta{width} is also used for the \cs{parbox}.
+% \begin{description}
+% \item[Note:] The definition of a preamble is global and the definition of a
+% new preamble of the same \meta{preamble name} overwrite an existing one.
+% \end{description}
% \begin{macro}{\set@@preamble}
-% \changes{v2.8p}{2001/09/25}{neu (intern)}%^^A
+% \changes{v2.8p}{2001/09/25}{added}
% \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
-% \cs{kernel@ifnextchar}}%^^A
+% \cs{kernel@ifnextchar}}
% \begin{macro}{\set@@@preamble}
-% \changes{v2.8p}{2001/09/25}{neu (intern)}%^^A
+% \changes{v2.8p}{2001/09/25}{added}
% \begin{macro}{\set@@@@preamble}
-% \changes{v2.8p}{2001/09/25}{neu (intern)}%^^A
-% \changes{v2.8q}{2001/11/27}{fehlende Klammern ergänzt}%^^A
-% \changes{v3.12}{2012/10/16}{b mit derselben Funktion wie u erlaubt}%^^A
-% \changes{v3.12a}{2014/02/14}{b korrigiert}%^^A
-% Da mehrere optionale Argumente nach einem obligatorischen Argument
-% auszuwerten sind, werden diverse Hilfsmakros benötigt.
+% \changes{v2.8p}{2001/09/25}{added}
+% \changes{v2.8q}{2001/11/27}{missing brace added}
+% \changes{v3.12}{2012/10/16}{allow \texttt{o} as alias for \texttt{b}}
+% \changes{v3.12a}{2014/02/14}{\texttt{b} fixed}
+% We need a lot of helpers because of not using \pkg*{xparse} but having
+% several optional arguments. At least one optional argument? If not use an
+% empty default for the first one and \len{hsize} for the second one.
% \begin{macrocode}
\newcommand*{\set@preamble}[1]{%
-% \end{macrocode}
-% Zunächst wird das erste optionale Argument gesucht.
-% \begin{macrocode}
\kernel@ifnextchar [%]
{\set@@preamble{#1}}{\set@@@preamble{#1}[][\hsize]}%
}
-\newcommand*{\set@@preamble}{}
-\def\set@@preamble#1[#2]{%
% \end{macrocode}
-% Wenn ein optionales Argument existiert, kann es auch ein zweites
-% geben. Wenn nicht, wird mit der Voreinstellung gearbeitet.
+% Or even two optional argument? If not use default \len{hsize}.
% \begin{macrocode}
+\newcommand*{\set@@preamble}{}
+\def\set@@preamble#1[#2]{%
\kernel@ifnextchar [%]
{\set@@@preamble{#1}[{#2}]}{\set@@@preamble{#1}[{#2}][\hsize]}%
}
-\newcommand{\set@@@preamble}{}
-\long\def\set@@@preamble#1[#2][#3]#4{%
% \end{macrocode}
-% Dies ist das Hauptmakro, das die eigentliche Arbeit macht. Es muss
-% \cs{long} definiert werden, da die Präambel auch aus mehreren
-% Absätzen bestehen kann.
-%
-% Zunächst wird das Positionsargument ausgewertet. Dies geschieht mit
-% lokalen Hilfsmakros und einer Schleife. Zur Funktion der Schleife
-% siehe im dokumentierten \LaTeX-Kern.
+% From here we know all optional arguments and have to process the composite
+% \meta{position}.
% \begin{macrocode}
+\newcommand{\set@@@preamble}{}
+\long\def\set@@@preamble#1[#2][#3]#4{%
\begingroup
\def\prmbl@pos{#2}\let\prmbl@hpos\relax\let\prmbl@vpos\relax
\expandafter \@tfor \expandafter \@tempa
@@ -3448,37 +3436,28 @@
\fi
}%
% \end{macrocode}
-% Wurde keine horizontale oder vertikale Ausrichtung definiert, so
-% wird nun der Standardwert dafür eingesetzt.
+% If the horizontal or vertical position is still unclear use defaults.
% \begin{macrocode}
\@ifundefined{prmbl@hpos}{\def\prmbl@hpos{0}}{}%
\@ifundefined{prmbl@vpos}{\def\prmbl@vpos{0}}{}%
% \end{macrocode}
-% Nun sind die Positionen ermittelt und es werden abhängig davon
-% entsprechende Päambelmakros definiert.
+% From the vertical position we can build the \meta{preamble name} and the
+% vertical position of the \cs{parbox} the horizontal is used for the
+% horizontal skip before and after the \cs{parbox}.
% \begin{macrocode}
\ifcase\prmbl@hpos
-% \end{macrocode}
-% Zunächst links unten und oben:
-% \begin{macrocode}
\ifcase\prmbl@vpos
\set@@@@preamble{#1@u}{t}{#3}{}{\hfil}{#4}%
\else
\set@@@@preamble{#1@o}{b}{#3}{}{\hfil}{#4}%
\fi
\or
-% \end{macrocode}
-% Dann zentriert unten und oben:
-% \begin{macrocode}
\ifcase\prmbl@vpos
\set@@@@preamble{#1@u}{t}{#3}{\hfil}{\hfil}{#4}%
\else
\set@@@@preamble{#1@o}{b}{#3}{\hfil}{\hfil}{#4}%
\fi
\else
-% \end{macrocode}
-% Zum Schluss rechts und oben:
-% \begin{macrocode}
\ifcase\prmbl@vpos
\set@@@@preamble{#1@u}{t}{#3}{\hfil}{}{#4}%
\else
@@ -3488,12 +3467,8 @@
\endgroup
}
% \end{macrocode}
-% Es folgt das Makro, mit dem die Definition tatsächlich
-% stattfindet. Das erste Argument ist der Name der Präambel, das
-% zweite die Positionsoption für die verwendete \cs{parbox}, das
-% dritte ist die Breite der \cs{parbox}, dann zwei Argumente mit der
-% horizontalen Ausrichtung vor und nach der \cs{parbox} und das
-% sechste Agument ist schließlich der Inhalt der \cs{parbox}.
+% Last but not least add the horizontal aligned \cs{parbox} to the preamble
+% storage.
% \begin{macrocode}
\newcommand{\set@@@@preamble}[6]{%
\expandafter\gdef\csname #1@preamble\endcsname{%
@@ -3501,14 +3476,10 @@
}%
}
% \end{macrocode}
-%
% \begin{macro}{\set@preamble@hpos}
-% \changes{v2.8q}{2001/09/25}{neu (intern)}%^^A
-% Eines der Hilfsmakros dient dazu, die horizontale Position der
-% Präambel einzustellen, falls dies nicht bereits erfolgt ist. Ist es
-% bereits nicht über"-einstimmend erfolgt, wird ein Fehler
-% ausgegeben. Dieses Makro ist extrem intern und funktioniert nur im
-% Kontext vor \cs{set@preamble}.
+% \changes{v2.8q}{2001/09/25}{added}
+% Either store the horizontal preamble position if not yet defined or if
+% already defined but illegal report it as an error.
% \begin{macrocode}
\newcommand*{\set@preamble@hpos}[2]{%
\@ifundefined{prbml@hpos}{%
@@ -3529,11 +3500,11 @@
}%
}
% \end{macrocode}
-% \end{macro}%^^A \set@preamble@hpos
+% \end{macro}^^A \set@preamble@hpos
% \begin{macro}{\set@preamble@vpos}
-% \changes{v2.8q}{2001/09/25}{neu (intern)}%^^A
-% Das Hilfsmakro für die vertikale Position funktioniert in gleicher
-% Weise.
+% \changes{v2.8q}{2001/09/25}{added}
+% Either store the vertical position if not yet defined or if already defined
+% but illegal report it as an error.
% \begin{macrocode}
\newcommand*{\set@preamble@vpos}[2]{%
\@ifundefined{prbml@vpos}{%
@@ -3555,143 +3526,108 @@
}
%</body>
%</book|report>
-%</class>
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
+% \end{macro}^^A \set@preamble@vpos
+% \end{macro}^^A \set@@@@preamble
+% \end{macro}^^A \set@@@preamble
+% \end{macro}^^A \set@@preamble
+% \end{macro}^^A \set@preamble
+%
%
+% \subsection{Deprecated code for the ToC}
%
-% \subsubsection{\KOMAScript-eigene Befehle für Verzeichniseinträge}
-% Wie schon bei den Gliederungsbefehlen genügt \KOMAScript{} nicht, was der
-% \LaTeX-Kern für Verzeichniseinträge zu bieten hat.
+% Before using \pkg*{tocbasic} we needed additional code for our extended
+% version of \cs{@dottedtocline}. However this has been removed in
+% \KOMAScript~v3.36.
+%
+% \begin{description}
+% \item[ToDo:] This should be moved to \file{scrkernel-listsof.dtx} or should
+% be removed.
+% \end{description}
%
% \begin{macro}{\bprot@dottedtocline}
-% \changes{v2.96a}{2006/11/30}{neu (intern)}%^^A
-% \changes{v3.27}{2019/02/25}{veraltet}%^^A
-% Dieses Makro wird benötigt, um die Ebenen unterhalb von \cs{chapter}
-% bzw. \cs{section} im Inhaltsverzeichnis ebenfalls vor unerwünschten
-% Umbrüchen zwischen Eintrag und Unterebene zu schützen.
-% \begin{macrocode}
-%<*class>
-%<*body>
-\newcommand*{\bprot@dottedtocline}[5]{%
- \expandafter\ifnum\scr@v@is@gt{2.96}\relax
- \ClassWarning{\KOMAClassName}{%
- usage of `\string\bprot@dottedtocline' is deprecated.\MessageBreak
- Maybe an old auxiliary file has been used.\MessageBreak
- Note, this command will be removed from\MessageBreak
- KOMA-Script soon. So if this warning message\MessageBreak
- persists after one more LaTeX run, you should\MessageBreak
- redeclare the corresponding ToC entries using\MessageBreak
- \string\DeclareTOCStyleEntry[\MessageBreak
- \space\space level=\detokenize{#1},\MessageBreak
- \space\space indent=\detokenize{#2},\MessageBreak
- \space\space numwidth=\detokenize{#3}]{default}{...},\MessageBreak
- where `...' is the name of the ToC level.\MessageBreak
- Note, in future usage of `\string\bprot@dottedtocline'\MessageBreak
- could result in an error%
- }%
- \ifnum #1>\c@tocdepth \else
- \ifnum \lastpenalty<\numexpr 20010-#1\relax
- \addpenalty{\@lowpenalty}%
- \fi
- \@dottedtocline{#1}{#2}{#3}{#4}{#5}%
- \penalty \numexpr 20009-#1\relax
- \fi
- \else
- \@dottedtocline{#1}{#2}{#3}{#4}{#5}%
- \fi
-}
-%</body>
-%</class>
-% \end{macrocode}
+% \changes{v2.96a}{2006/11/30}{added}
+% \changes{v3.27}{2019/02/25}{deprecated}
+% \changes{v3.36}{2022/03/15}{removed}
% \end{macro}
%
%
-% \subsection{Grobeinteilung von Büchern}
+% \subsection{Rough structuring of books}
%
-% Bei Büchern gibt es teilweise eine Einteilung in Vorderteil, Hauptteil und
-% Endteil, die nicht wirklich eine Gliederung darstellt, sondern auf
-% Gliederung, Seitennummerierung etc. Einfluss nimmt.
+% Some books have a kind of rough structuring into front matter, main matter
+% and back matter. This has consequences for the page numbering and the
+% numbering of headings and other elements.
%
-% \begin{macro}{\if@mainmatter}
-% \begin{macro}{\@mainmattertrue}
-% \begin{macro}{\@mainmatterfalse}
-% \changes{v2.3a}{1995/07/08}{\cs{if@mainmatter} Anforderung verschoben}%^^A
-% Über diesen Schalter wird bei Buchklassen festgelegt, ob wir uns im
-% Hauptteil des Dokuments befinden oder nicht. Die eigentliche
-% Umschaltung geschieht mit Hilfe der Befehle \cs{frontmatter},
-% \cs{mainmatter}, \cs{backmatter}. Ohne Umschaltung befinden wir uns
-% bereits im Hauptteil.
+% \begin{macro}{\@mainmattertrue,\@mainmatterfalse,\if@mainmatter}
+% For the numbering of headings and other elements we only need to know
+% whether we are in the main matter or not, because chapters outside the main
+% matter do not provide a number. A boolean switch is best for this. By
+% default we already start with the main matter.
% \begin{macrocode}
-%<*class>
%<*book>
%<*body>
\newif\if@mainmatter\@mainmattertrue
% \end{macrocode}
-% \end{macro}%^^A \@mainmatterfalse
-% \end{macro}%^^A \@mainmattertrue
-% \end{macro}%^^A \if@mainmatter
+% \end{macro}^^A \@mainmattertrue,\if@mainmatter
%
-% \begin{macro}{\frontmatter}
-% \changes{v2.4e}{1996/07/02}{Option \texttt{openany} beachten}%^^A
-% \changes{v2.5h}{1999/12/29}{Option \texttt{twoside} beachten}%^^A
-% \changes{v3.00}{2008/09/27}{\cs{cleardoubleoddpage} statt
-% \cs{cleardoublepage}}%^^A
-% Der Vorspann enthält bei Büchern oftmals Inhaltsverzeichnis, Vorwort
-% und dergleichen und wird mit kleinen römischen Seitenzahlen
-% versehen.
+% \begin{command}{\frontmatter}
+% \changes{v2.4e}{1996/07/02}{support for \opt{open\quotechar=any}}
+% \changes{v2.5h}{1999/12/29}{support for \opt{twoside}}
+% \changes{v3.00}{2008/09/27}{\cs{cleardoublepage} replaced by
+% \cs{cleardoubleoddpage}}
+% Switching to the front matter always needs a new odd page, because we change
+% the page numbering to lowercase Roman numbers.
% \begin{macrocode}
\newcommand*\frontmatter{%
\if@twoside\cleardoubleoddpage\else\clearpage\fi
\@mainmatterfalse\pagenumbering{roman}%
}
% \end{macrocode}
-% \end{macro}%^^A \frontmatter
-% \begin{macro}{\mainmatter}
-% \changes{v2.4e}{1996/07/02}{Option \texttt{openany} beachten}%^^A
-% \changes{v2.5h}{1999/12/29}{Option \texttt{twoside} beachten}%^^A
-% \changes{v3.00}{2008/09/27}{\cs{cleardoubleoddpage} statt
-% \cs{cleardoublepage}}%^^A
-% Der Hauptteil ist das Fleisch der Bücher.
+% \end{command}^^A \frontmatter
+% \begin{command}{\mainmatter}
+% \changes{v2.4e}{1996/07/02}{support for \opt{open\quotechar=any}}
+% \changes{v2.5h}{1999/12/29}{support for \opt{twoside}}
+% \changes{v3.00}{2008/09/27}{\cs{cleardoublepage} replaced by
+% \cs{cleardoubleoddpage}}
+% Switching back to main matter always needs a new odd page, because we change
+% the page numbering to Arabic numbers.
% \begin{macrocode}
\newcommand*\mainmatter{%
\if@twoside\cleardoubleoddpage\else\clearpage\fi
\@mainmattertrue\pagenumbering{arabic}%
}
% \end{macrocode}
-% \end{macro}%^^A \mainmatter
-% \begin{macro}{\backmatter}
-% \changes{v3.00}{2008/09/27}{\cs{cleardoubleoddpage} statt
-% \cs{cleardoublepage}}%^^A
-% Auch wenn nicht ganz einzusehen ist, warum das anders sein soll,
-% wird hier nicht nach der Option \texttt{twoside}, sondern nach
-% \texttt{openright} unterschieden.
+% \end{command}^^A \mainmatter
+% \begin{command}{\backmatter}
+% \changes{v3.00}{2008/09/27}{\cs{cleardoublepage} replaced by
+% \cs{cleardoubleoddpage}}
+% Only with \opt{open=right} we start a new odd page when starting the back
+% matter.
+% \begin{description}
+% \item[ToDo:] This does not make any sense, because the page numbering is not
+% changed. And it seems to be even wrong for \opt{open=left}! So why does
+% \cls*{book} use this and why shall we do so too?
+% \end{description}
% \begin{macrocode}
\newcommand*\backmatter{%
\if@openright\cleardoubleoddpage\else\clearpage\fi\@mainmatterfalse
}
%</body>
%</book>
-%</class>
% \end{macrocode}
-% \end{macro}
+% \end{command}
%
%
-% \selectlanguage{english}
% \subsection{Appendix}
%
-% The classes (except \textsf{scrlttr2}) does provide an appendix switch,
+% The classes (except \cls*{scrlttr2}) does provide an appendix switch,
% similar but not identical to the standard classes.
%
-% \begin{macro}{\appendix}
+% \begin{command}{\appendix}
% Activation of the appendix switch over to numbering of chapters
% resp. sections with uppercase letters.
-% \changes{v2.2d}{1995/05/28}{\textsf{scrartcl} doesn't have a chapter
-% counter}
+% \changes{v2.2d}{1995/05/28}{\cls*{scrartcl} doesn't have a chapter
+% counter}
% \changes{v2.3c}{1995/08/06}{alternative section numbering in appendix}
% \changes{v2.8}{2001/06/15}{new \cs{appendixmore}}
% \changes{v2.8e}{2001/07/10}{\cs{@altsecnumformattrue} removed}
@@ -3701,12 +3637,11 @@
% \changes{v3.20}{2016/12/05}{improved warning}
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
% \changes{v3.34}{2021/04/30}{\LaTeX{} hook added}
-% \begin{macro}{\appendixmore}
-% \changes{v2.8}{2001/06/15}{new}
+% \begin{command}{\appendixmore}
+% \changes{v2.8}{2001/06/15}{added}
% \cs{appendixmore} is deprecated with \LaTeX{} 2020/10/01 (or newer) but
% still executed as a kind of hook.
% \begin{macrocode}
-%<*class>
%<*body>
\newcommand*\appendix{%
\Ifstr{\@currenvir}{appendix}{%
@@ -3748,91 +3683,89 @@
%<*prepare>
\IfLTXAtLeastTF{2020/10/01}{\NewHook{\KOMAClassName/appendix}}{}
%</prepare>
-%</class>
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
+% \end{command}
+% \end{command}
%
-% \selectlanguage{ngerman}
-% \subsection{Teile}
%
-% \changes{v2.8e}{2001/07/10}{\cs{@thepart} entfernt}
+% \subsection{Parts}
%
-% Teile sind bei den unterschiedlichen Klassen unterschiedlich definiert.
+% \begin{macro}{\@thepart}
+% \changes{v2.8e}{2001/07/10}{removed}
+% \end{macro}
%
-% \begin{macro}{\size@part}
-% \changes{v2.8o}{2001/09/14}{neu (intern)}%^^A
-% \changes{v2.96a}{2006/12/02}{letztes Element darf ein Argument erwarten,
-% wenn es keine Auswirkung auf den Zeilen abstand hat}%^^A
-% \begin{macro}{\size@partnumber}
-% \changes{v2.8o}{2001/09/14}{neu (intern)}%^^A
-% \changes{v2.96a}{2006/12/02}{letztes Element darf ein Argument erwarten,
-% wenn es keine Auswirkung auf den Zeilen abstand hat}%^^A
-% Hier werden diese Befehle nur vordefiniert. Ihre tatsächliche Einstellung
-% erfolgt über die (Vor-)Auswahl von Option \texttt{headings}.
+% The definition of parts depends on the class.
+%
+% \begin{fontelement}{partnumber,part}
+% \changes{v2.8o}{2001/09/14}{pre-added as macro}
+% \changes{v2.8p}{2001/09/23}{added}
+% \changes{v2.96a}{2006/12/02}{undocumented support for last macro expects an
+% argument}
+% \begin{fontelement}{partprefix}
+% \changes{v3.18}{2015/06/10}{alias added}
+% Definition of the font elements used by \cs{part}. The settings are done by
+% option \texttt{headings} later. Everything is prepared before this option is
+% used the first time. The elements are defined manually because of
+% compatibility with \KOMAScript~v2.8o before font elements has been
+% implemented in \KOMAScript~v2.8p.
% \begin{macrocode}
-%<*class>
%<*prepare>
\newcommand*{\size@part}{}
+\newcommand*{\scr@fnt@part}{\size@part}
\newcommand*{\size@partnumber}{}
+\newcommand*{\scr@fnt@partnumber}{\size@partnumber}
+\aliaskomafont{partprefix}{partnumber}
%</prepare>
% \end{macrocode}
-% \end{macro}%^^A \size@partnumber
-% \end{macro}%^^A \size@part
-%
-%
-% \begin{macro}{\partheadstartvskip}
-% \changes{v2.95a}{2006/07/10}{neue Konfiguratonsmöglichkeit}%^^A
-% \changes{v3.15}{2014/11/24}{\textsf{scrartcl} definiert und verwendet
-% \cs{scr@part@beforeskip}}%^^A
-% \begin{macro}{\partheadmidvskip}
-% \changes{v2.95a}{2006/07/10}{neue Konfiguratonsmöglichkeit}%^^A
-% \begin{macro}{\partheadendvskip}
-% \changes{v2.95a}{2006/07/10}{neue Konfiguratonsmöglichkeit}%^^A
-% \changes{v3.15}{2014/11/24}{\textsf{scrartcl} definiert und verwendet
-% \cs{scr@part@afterskip}}%^^A
-% \begin{macro}{\parheademptypage}
-% \changes{v3.02}{2009/01/01}{neue Konfigurationsmöglichkeit}%^^A
-% Diese vier Makros werden verwendet, um den Abstand über in und unter der
-% Überschrift eines Teils und die leere Rückseite zu definieren. Prinzipiell
-% kann damit auch der Umbruch zwischen Nummer und Text entfernt werden.
-% Da die Größe nicht über Option \texttt{headings} beeinflusst werden kann,
-% müssen diese Hilfsmakros nicht bereits vor den Optionen definiert werden.
-%
-% Zur Erhöhung der Kompatibilität mit \cs{DeclareSectionCommand} werden
-% zunächst einige Hilfsanweisung definiert und verwendet.
-% \begin{macro}{\scr@part@sectionbeforeskip}
-% \changes{v3.15}{2014/11/24}{neue (interne) Anweisung}%^^A
-% \changes{v3.17}{2015/03/25}{umbenannt in \cs{scr@part@beforeskip}}%^^A
-% \begin{macro}{\scr@part@sectionafterskip}
-% \changes{v3.15}{2014/11/24}{neue (interne) Anweisung}%^^A
-% \changes{v3.17}{2015/03/25}{umbenannt in \cs{scr@part@afterskip}}%^^A
+% \end{fontelement}^^A partprefix
+% \end{fontelement}^^A partnumber,part
+%
+%
+% \begin{command}{\partheadstartvskip,\partheadendvskip}
+% \changes{v2.95a}{2006/07/10}{added}
+% \changes{v3.15}{2014/11/24}{\cls*{scrartcl} defines and uses
+% \cs{scr@part@beforeskip} resp. \cs{scr@part@afterskip}}
+% \begin{command}{\partheadmidvskip}
+% \changes{v2.95a}{2006/07/10}{added}
+% \begin{command}{\parheademptypage}
+% \changes{v3.02}{2009/01/01}{added}
+% These commands are the distance before and after a part heading, between the
+% prefix line and the text line of the heading and also the empty retro page
+% of a part.
+%
+% \begin{macro}{\scr@part@sectionbeforeskip,\scr@part@beforeskip}
+% \changes{v3.15}{2014/11/24}{added}
+% \changes{v3.17}{2015/03/25}{\cs{scr@part@sectionbeforeskip} renamed to
+% \cs{scr@part@beforeskip}}
+% \begin{macro}{\scr@part@sectionafterskip,\scr@part@sectionbeforeskip}
+% \changes{v3.15}{2014/11/24}{added}
+% \changes{v3.17}{2015/03/25}{\cs{scr@part@sectionafterskip} renamed to
+% \cs{scr@part@afterskip}}
% \begin{macro}{\scr@part@sectionindent}
-% \changes{v3.15}{2014/11/24}{neue (interne) Anweisung (unbenutzt)}%^^A
-% \changes{v3.17}{2015/03/24}{entfernt}%^^A
-% \end{macro}%^^A \scr@part@sectionindent
-% \end{macro}%^^A \scr@part@sectionafterskip
-% \end{macro}%^^A \scr@part@sectionbeforeskip
-% \begin{macro}{\scr@part@beforeskip}
-% \changes{v3.17}{2015/03/25}{neu (intern) aus Umdefinierung von
-% \cs{scr@part@ectionbeforeskip}}%^^A
+% \changes{v3.15}{2014/11/24}{added}
+% \changes{v3.17}{2015/03/24}{removed}
+% \end{macro}^^A \scr@part@sectionindent
% \begin{macro}{\scr@part@innerskip}
-% \changes{v3.17}{2015/03/24}{neu (intern)}%^^A
-% \begin{macro}{\scr@part@afterskip}
-% \changes{v3.17}{2015/03/25}{neu (intern) aus Umdefinierung von
-% \cs{scr@part@ectionbeforeskip}}%^^A
+% \changes{v3.17}{2015/03/24}{added}
% \begin{macro}{\scr@part@style}
-% \changes{v3.15}{2014/11/24}{neue (interne) Anweisung}%^^A
-% Es wird der leere Stil verwendet, mit dem Neudefinitionen von \cs{part}
-% über \cs{DeclareSectionCommand} verhindert werden.
+% \changes{v3.15}{2014/11/24}{added}
+% All the skips and the page style are used by \cs{DeclareSectionCommand}
+% resp. the style \texttt{part}. We define it as early as possible. Even the
+% style of \cs{part} is already defined here.
+% \begin{description}
+% \item[ToDo:] Do we need them in the \texttt{prepare} run or can we move then
+% even to the \texttt{body} run?
+% \item[ToDo:] Do we really need to define \cs{scr@part@style}?
+% \end{description}
% \begin{macrocode}
%<*prepare>
\newcommand*{\scr@part@beforeskip}{%
%<article> 4ex
% \end{macrocode}
-% Hinweis: Das |+\baselineskip| wird benötigt, um Kompatibilitätsprobleme mit
-% der Umdefinierung von |\chapterheadstartvskip| zu vermeiden.
+% \begin{description}
+% \item[Note:] The |+\baselineskip| is needed, to stay as compatible as
+% possible with prior definitions of \cs{chapterheadstartvskip}.
+% \end{description}
% \begin{macrocode}
%<report|book> \z@ \@plus 1fil + \baselineskip
}
@@ -3843,10 +3776,10 @@
}
\newcommand*{\scr@part@style}{part}
% \end{macrocode}
-% \end{macro}%^^A \scr@part@style
-% \end{macro}%^^A \scr@part@afterskip
-% \end{macro}%^^A \scr@part@innerskip
-% \end{macro}%^^A \scr@part@beforeskip
+% \end{macro}^^A \scr@part@style
+% \end{macro}^^A \scr@part@afterskip
+% \end{macro}^^A \scr@part@innerskip
+% \end{macro}^^A \scr@part@beforeskip
% \begin{macrocode}
\newcommand*{\partheadstartvskip}{%
%<article> \addvspace{\@tempskipa}%
@@ -3871,30 +3804,27 @@
%</report|book>
%</prepare>
% \end{macrocode}
-% \end{macro}%^^A \partheademptypage
-% \end{macro}%^^A \partheadendvskip
-% \end{macro}%^^A \partheadmidvskip
-% \end{macro}%^^A \partheadstartvskip
+% \end{command}^^A \partheademptypage
+% \end{command}^^A \partheadmidvskip
+% \end{command}^^A \partheadstartvskip,\partheadendvskip
%
%
% \begin{macro}{\scr@startpart}
-% \changes{v3.18}{2015/05/23}{neue Anweisung (intern)}%^^A
-% Diese Anweisung ist von der ursprünglichen Definition von \cs{part}
-% abgeleitet und erbt deren ChangeLog-Einträge.
-% \changes{v2.8d}{2001/07/05}{\cs{partpagestyle} statt \texttt{plain}}%^^A
-% \changes{v2.8p}{2001/09/27}{Präambel über der Überschrift hinzugefügt}%^^A
-% \changes{v3.13a}{2014/09/11}{Verwendung von \cs{SecDef}}%^^A
-% \changes{v3.19}{2015/08/25}{Seitenstil nur ändern wenn definiert und nicht
-% leer}%^^A
-% \changes{v3.26}{2018/10/14}{Option \texttt{afterindent} wird beachtet}%^^A
-% \changes{v3.28}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
-% Die Anweisung definiert den Gliederungsüberschriften-Stil
-% \texttt{part}. Dazu bekommt sie als einziges explizites Argument den
-% \meta{Namen} der Gliederungsüberschrift. Weitere Argumente wie ein
-% optionaler Stern oder ein optionales Argument für Inhaltsverzeichnis und
-% Kolumnentitel sowie ein obligatorisches Argument für den Text der
-% Überschrift sind implizit, das heißt, sie werden erst im weiteren Verlauf
-% von Unter-Macros eingelesen und verarbeitet.
+% \changes{v2.8d}{2001/07/05}{using \cs{partpagestyle}}
+% \changes{v2.8p}{2001/09/27}{preamble above heading}
+% \changes{v3.13a}{2014/09/11}{using \cs{SecDef}}
+% \changes{v3.18}{2015/05/23}{added}
+% \changes{v3.19}{2015/08/25}{ignoring empty \cs{partpagestyle}}
+% \changes{v3.26}{2018/10/14}{supporting option \opt{afterindent}}
+% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
+% The macro
+% \begin{quote}
+% \cs{scr@startpart}\marg{part command name}
+% \end{quote}
+% is now part of the style \texttt{part}. However, the main parts
+% of the code are from the original definition of \cs{part}. It has only one
+% argument: The name of the part command, i.e., \texttt{part}. All arguments
+% to the part command will be processed later.
% \begin{macrocode}
%<*body>
\newcommand*{\scr@startpart}[1]{%
@@ -3936,30 +3866,34 @@
% \end{macrocode}
%
% \begin{macro}{\scr@@startpart}
-% \changes{v3.18}{2015/05/23}{neue Anweisung (intern)}%^^A
-% Diese Anweisung ist von der ursprünglichen Definition von \cs{@part}
-% abgeleitet und erbt deren ChangeLog-Einträge.
-% \changes{v2.8q}{2001/11/13}{\cs{@parskipfalse}\cs{@parskip@indent}}%^^A
-% \changes{v2.95}{2002/08/13}{\cs{centering} und \cs{@parskipfalse}%
-% \cs{@parskip@indent} vertauscht}%^^A
-% \changes{v2.95}{2004/11/05}{\cs{@parskipfalse} und \cs{@parskip@indent}
-% ersetzt}%^^A
-% \changes{v3.27}{2019/07/08}{neue Option \texttt{nonumber}}%^^A
-% Die Anweisung macht die eigentliche Arbeit für den Fall einer
-% Gliederungsanweisung ohne Stern. Das erste obligatorische Argument ist der
-% \meta{Name} der Gliederungsanweisung. Das zweite eigentlich optionale
-% Argument, das hier jedoch zwingend ist, ist der \meta{Spezial-Text} für
-% Kolumnentitel und Inhaltsverzeichnis. Das dritte obligatorische Argument
-% ist der \meta{Text} für die Überschrift.
+% \changes{v2.8q}{2001/11/13}{\cs{@parskipfalse}\cs{@parskip@indent}}
+% \changes{v2.95}{2002/08/13}{\cs{centering} and \cs{@parskipfalse}%
+% \cs{@parskip@indent} switched}
+% \changes{v2.95}{2004/11/05}{\cs{@parskipfalse} and \cs{@parskip@indent}
+% replaced}
+% \changes{v3.18}{2015/05/23}{added}
+% \changes{v3.27}{2019/07/08}{support for option \opt{nonumber}}
+% The macro
+% \begin{quote}
+% \cs{scr@@startpart}\marg{part command name}\oarg{extended optional
+% argument}\marg{part heading}
+% \end{quote}
+% is now part of the style \texttt{part}. However, the main parts
+% of the code are from the original definition of \cs{@part}. Therefore it has
+% the mandatory and optional arguments of a non-star variant of, i.e.,
+% \cs{part} but an additional first argument.
+% \begin{description}
+% \item[Note:] \meta{extended optional argument} is named as optional, however
+% here it is already mandatory, because it is a delimited argument.
+% \end{description}
% \begin{macrocode}
\newcommand{\scr@@startpart}{}
\long\def\scr@@startpart#1[#2]#3{%
\ExecuteDoHook{heading/branch/nostar/#1}%
% \end{macrocode}
-% \changes{v3.10}{2011/08/30}{Integration der Erweiterung für das optionale
-% Argument der Gliederungsbefehle}%^^A
-% Für das erweitere optionale Argument muss hier eine key-value-Auswertung
-% erfolgen, falls das erweitere optionale Argument aktiviert ist:
+% \changes{v3.10}{2011/08/30}{extended optional argument}
+% First of all, depending in \opt{headings=optionto\dots} we have different
+% defaults for the options.
% \begin{macrocode}
\ifnum \scr@osectarg=\z@
\@scr@tempswafalse
@@ -3981,28 +3915,29 @@
\fi
\fi
% \end{macrocode}
-% Als nächstes muss für nummerierte Überschriften dieser Ebene sowohl der
-% Zähler erhöht also auch ein nummerierter Eintrag ins Inhaltsverzeichnis
-% erstellt werden.
-% \changes{v2.8e}{2001/07/10}{\cs{@maybeautodot} wird aufgerufen}%^^A
-% \changes{v3.08}{2010/11/01}{Verwendung von \cs{addparttocentry}}%^^A
-% \changes{v3.18}{2015/05/20}{Verwendung von \cs{add\meta{Name}tocentry} in
-% \cs{typeout}}%^^A
-% \changes{v3.28}{2019/11/19}{\cs{ifnumbered} umbenannt in
-% \cs{Ifnumbered}}%^^A
-% \changes{v3.31}{2020/06/02}{\cs{@maybeautodot}\cs{thepart} entfernt}%^^A
+% \changes{v2.8e}{2001/07/10}{using \cs{@maybeautodot}}
+% \changes{v3.28}{2019/11/19}{\cs{ifnumbered} renamed to
+% \cs{Ifnumbered}}
+% \changes{v3.31}{2020/06/02}{\cs{@maybeautodot}\cs{thepart} removed}
+% For numbered headings we have to increase the counter and write a process
+% information to the \file{log} and the terminal.
% \begin{macrocode}
\Ifnumbered{#1}{%
\refstepcounter{#1}%
\expandafter\@maybeautodot\csname the#1\endcsname
\typeout{#1 \csname the#1\endcsname.}%
- \ifx\@currenttocentry\@empty\else
% \end{macrocode}
-% \selectlanguage{english}%
-% \changes{v3.31}{2020/06/06}{use \cs{\dots tocformat}}%
-%^^ATODO: move \cs{autodot} to the definition of \cs{\dots tocformat}
-% \selectlanguage{ngerman}%
+% \changes{v3.08}{2010/11/01}{using \cs{addparttocentry}}
+% \changes{v3.18}{2015/05/20}{using \cs{add\meta{Name}tocentry} for
+% \cs{typeout}}
+% \changes{v3.31}{2020/06/06}{using \cs{\dots tocformat}}
+% And if the ToC entry is not empty add a numbered entry to the table of
+% contents.
+% \begin{description}
+% \item[ToDo:] Move \cs{autodot} to the definition of \cs{\dots tocformat}.
+% \end{description}
% \begin{macrocode}
+ \ifx\@currenttocentry\@empty\else
\@ifundefined{#1tocformat}{%
\expandafter\gdef\csname #1tocformat\endcsname
{\csname the#1\endcsname}%
@@ -4016,11 +3951,10 @@
\fi
}{%
% \end{macrocode}
-% \changes{v3.18}{2015/05/23}{Resetliste auch bei nicht nummerierten
-% Überschriften abarbeiten}%^^A
-% Für alle nicht nummerieten Überschriften dieser Ebene trotzdem die
-% Resetliste des Zählers ausführen und ggf. einen Verzeichniseintrag
-% erstellen.
+% \changes{v3.18}{2015/05/23}{execute counter reset list for not numbered
+% headings}
+% For not numbered headings we still have to process the reset list of the
+% counter and write a process information to the \file{log} and the terminal.
% \begin{macrocode}
\expandafter\ifnum\scr@v@is@lt{3.18}\relax\else
\begingroup
@@ -4029,13 +3963,18 @@
\endgroup
\fi
\typeout{#1 without number}%
- \ifx\@currenttocentry\@empty\else
% \end{macrocode}
-% An dieser Stelle muss ggf. der \textsf{hyperref}-Hook für nicht nummerierte
-% Inhaltsverzeichniseinträge ausgeführt werden.
-% \changes{v3.08}{2010/11/01}{Verwendung von \cs{addparttocentry}}%^^A
-% \changes{v3.18}{2015/05/23}{\cs{addparttocentry} verallgemeinert}%^^A
+% \changes{v3.08}{2010/11/01}{using \cs{addparttocentry}}
+% \changes{v3.18}{2015/05/23}{generalized \cs{addparttocentry}}
+% And before writing a not numbered entry to the table of contents we have to
+% execute also the \pkg{hyperref} hook \cs{hy@insteadofrefstepcounter}.
+% \begin{description}
+% \item[Note:] \pkg*{scrhack} uses the existence of this command to detect a
+% \KOMAScript{} class. Shouldn't this be changed using, e.g.,
+% \cs{KOMAClassName}?
+% \end{description}
% \begin{macrocode}
+ \ifx\@currenttocentry\@empty\else
\hy@insteadofrefstepcounter{#1}%
\scr@ifundefinedorrelax{add#1tocentry}{%
\addtocentrydefault{#1}%
@@ -4045,29 +3984,28 @@
\fi
}%
% \end{macrocode}
-% Es folgt das eigentliche Setzen der Überschrift. Übrigens ist der ganze Code
-% oben bei \cs{scr@@startchapter} praktisch identisch. Lediglich das
-% Abarbeiten der Resetliste gibt es dort bereits seit Version~3.15. In
-% \cs{scr@@startchapter} wird an dieser Stelle dann \cs{@make\dots head}
-% ausgeführt. Das könnte man eigentlich irgendwann hier genauso machen.
-% \changes{v2.2c}{1995/05/25}{Part-Ausgabe auf CJK umgestellt}%^^A
-% \changes{v2.4b}{1996/03/29}{\cs{size@partnumer} durch
-% \cs{size@partnumber} ersetzt}%^^A
-% \changes{v2.8p}{2001/09/22}{\cs{sectfont} wird nun vor \cs{size@part} und
-% \cs{size@partnumber} aufgerufen}%^^A
-% \changes{v2.8q}{2002/02/28}{\cs{nobreak} nach \cs{sectfont} behebt einen
-% Bug im color Paket}%^^A
-% \changes{v3.18}{2015/05/23}{\cs{size@\dots} durch \cs{usekomafont}
-% ersetzt}%^^A
-% \changes{v3.21}{2016/06/12}{fehlendes \cs{nobreak} ergänzt}%^^A
-% \changes{v3.25}{2017/09/07}{\cs{IfUseNumber} definiert}%^^A
-% \changes{v3.25}{2017/09/07}{\cs{sectfont} durch \cs{usekomafont}
-% ersetzt}%^^A
-% \changes{v3.25}{2017/09/07}{Umstellung auf
-% \cs{partlineswithprefixformat}}%^^A
-% \changes{v3.25}{2018/02/12}{Verwendung des korrekten Font-Elements}%^^A
-% \changes{v3.28}{2019/11/19}{\cs{ifnumbered} umbenannt in
-% \cs{Ifnumbered}}%^^A
+% \changes{v2.2c}{1995/05/25}{support for CJK}
+% \changes{v2.4b}{1996/03/29}{\cs{size@partnumer} replaced by
+% \cs{size@partnumber}}
+% \changes{v2.8p}{2001/09/22}{\cs{sectfont} used before \cs{size@part} or
+% \cs{size@partnumber}}
+% \changes{v2.8q}{2002/02/28}{\cs{nobreak} after \cs{sectfont}}
+% \changes{v3.18}{2015/05/23}{\cs{size@\dots} replaced by \cs{usekomafont}}
+% \changes{v3.21}{2016/06/12}{missing \cs{nobreak} added}
+% \changes{v3.25}{2017/09/07}{defining \cs{IfUseNumber} locally}
+% \changes{v3.25}{2017/09/07}{\cs{sectfont} replaced by \cs{usekomafont}}
+% \changes{v3.25}{2017/09/07}{using \cs{partlineswithprefixformat}}
+% \changes{v3.25}{2018/02/12}{using correct fontelement}
+% \changes{v3.28}{2019/11/19}{\cs{ifnumbered} renamed to
+% \cs{Ifnumbered}}
+% Now the main printing code.
+% \begin{description}
+% \item[ToDo:] This code is almost the same as \cs{scr@@startchapter}. Only
+% the procession of the reset list was there already with
+% \KOMAScript~v3.15. And in \cs{scr@@startchapter} we are using
+% \cs{@make\meta{name}head} here. So maybe we should do the same here and
+% really use the same definition instead of having it twice.
+% \end{description}
% \begin{macrocode}
\begingroup
\def\IfUseNumber{\Ifnumbered{#1}}%
@@ -4089,9 +4027,9 @@
}
}%
% \end{macrocode}
-% \changes{v3.10}{2011/08/30}{Wenn \cs{partmark} \cs{@gobble} ist, wird
-% stattdessen \cs{@mkboth}{}{} aufgerufen.}%^^A
-% Und noch den Kolumnentitel setzen.
+% \changes{v3.10}{2011/08/30}{using\cs{@mkboth{}{}} if \cs{partmark} is
+% \cs{@gobble}}
+% The running head.
% \begin{macrocode}
\expandafter\ifx\csname #1mark\endcsname\@gobble
\@mkboth{}{}%
@@ -4102,7 +4040,7 @@
\ExecuteDoHook{heading/endgroup/#1}%
\endgroup
% \end{macrocode}
-% Ganz zum Schluss muss noch einmal ein Abstand eingefügt werden.
+% The final distance.
% \begin{macrocode}
%<*article>
\nobreak
@@ -4112,57 +4050,56 @@
%</article>
%<book|report> \@nameuse{@end#1}%
% \end{macrocode}
-% \changes{v3.26}{2018/10/14}{Verwendung von \@cs{@afterheading} für
-% \textsf{scrbook} und \textsf{scrreprt}}%^^A
-% Ab \KOMAScript{} 3.26 wird hier \cs{@afterheading} für alle Klassen
-% aufgerufen. Damit kann der Einzug nach der Überschrift eingestellt werden.
+% \changes{v3.26}{2018/10/14}{using \@cs{@afterheading} with
+% \cls*{scrbook} or \cls*{scrreprt}}
+% And \cs{@afterheading} for all classes.
% \begin{macrocode}
\@afterheading
}
% \end{macrocode}
-% \end{macro}%^^A \scr@@startpart
+% \end{macro}^^A \scr@@startpart
%
% \begin{macro}{\scr@@startspart}
-% \changes{v3.18}{2015/05/23}{neue Anweisung (intern)}%^^A
-% Diese Anweisung ist von der ursprünglichen Definition von \cs{@spart}
-% abgeleitet und erbt deren ChangeLog-Einträge.
-% \changes{v2.4n}{1997/05/28}{in der Sternvariante \cs{chaptermark}%^^A
-% bzw. \cs{sectionmark} eingefügt, um die Kolumnentitel zu
-% löschen}%^^A
-% \changes{v2.6a}{2000/01/20}{zum Löschen der Kolumnentitel wird
-% nun \cs{@mkboth} verwendet}%^^A
-% \changes{v2.8q}{2001/11/13}{\cs{@parskipfalse}\cs{@parskip@indent}}%^^A
-% \changes{v2.95}{2002/08/13}{\cs{centering} und
-% \cs{@parskipfalse}\cs{@parskip@indent} vertauscht}%^^A
-% \changes{v2.95}{2004/11/05}{\cs{@parskipfalse} und \cs{@parskip@indent}
-% ersetzt}%^^A
-% Die Anweisung macht die eigentliche Arbeit für den Fall einer
-% Gliederungsanweisung mit Stern. Das erste obligatorische Argument ist der
-% \meta{Name} der Gliederungsanweisung. Das zweite obligatorische Argument
-% ist der \meta{Text} für die Überschrift.
+% \changes{v2.4n}{1997/05/28}{added \cs{chaptermark} resp.
+% \cs{sectionmark} to star variant}
+% \changes{v2.6a}{2000/01/20}{using \cs{@mkboth} to delete the running head}
+% \changes{v2.8q}{2001/11/13}{\cs{@parskipfalse}\cs{@parskip@indent}}
+% \changes{v2.95}{2002/08/13}{\cs{centering} and
+% \cs{@parskipfalse}\cs{@parskip@indent} swapped}
+% \changes{v2.95}{2004/11/05}{\cs{@parskipfalse} and\cs{@parskip@indent}
+% replaced}
+% \changes{v3.18}{2015/05/23}{added}
+% The macro
+% \begin{quote}
+% \cs{scr@@startspart}\marg{part command name}\marg{part heading}
+% \end{quote}
+% is now part of the style \texttt{part}. However, the main parts
+% of the code are from the original definition of \cs{@spart}. Therefore it has
+% the mandatory argument of a star variant of, i.e., \cs{part} but an
+% additional first argument.
% \begin{macrocode}
\newcommand{\scr@@startspart}[2]{%
\ExecuteDoHook{heading/branch/star/#1}%
% \end{macrocode}
-% Für Leute, die unbedingt nach der Sternversion noch ein \cs{addcontentsline}
-% anfügen wollen, muss hier ebenfalls der \textsf{hyperref}-Hook ausgeführt
-% werden. Allerdings passiert das hier entsprechend dem Vorgehen von
-% \textsf{hyperref} selbst in einer Gruppe, in der zusätzlich \cs{@mkboth} zu
-% \cs{@gobbletwo} gemacht wird, auch wenn ich absolut nicht versehe, was das
-% soll.
+% Some users don't learn to use \cs{addpart} for not numbered parts with entry
+% to the table of contents but insist in using \cs{addcontentsline}. Despite
+% this should not be used, because at least \cs{addparttocentry} should be
+% used, we tolerate this by using our \pkg{hyperref} hook.
+% \begin{description}
+% \item[ToDo:] I don't understand why \pkg{hyperref} uses a group here and
+% locally sets \cs{@mkboth} to \cs{@gobbletwo}. However, I've copied this.
+% \end{description}
% \begin{macrocode}
\begingroup
\let\@mkboth\@gobbletwo
\hy@insteadofrefstepcounter{#1}%
\endgroup
% \end{macrocode}
-% Erst dann erfolgt die tatsächliche Ausgabe der Überschrift.
-% \changes{v3.21}{2016/06/12}{fehlendes \cs{nobreak} ergänzt}%^^A
-% \changes{v3.25}{2017/09/07}{\cs{IfUseNumber} definiert}%^^A
-% \changes{v3.25}{2017/09/07}{\cs{sectfont} durch \cs{usekomafont}
-% ersetzt}%^^A
-% \changes{v3.25}{2017/09/07}{Umstellung auf
-% \cs{partlineswithprefixformat}}%^^A
+% \changes{v3.21}{2016/06/12}{missing \cs{nobreak} added}
+% \changes{v3.25}{2017/09/07}{difining \cs{IfUseNumber} locally}
+% \changes{v3.25}{2017/09/07}{\cs{sectfont} replaced by \cs{usekomafont}}
+% \changes{v3.25}{2017/09/07}{using \cs{partlineswithprefixformat}}
+% Now the printing similar to \cs{scr@@startpart}.
% \begin{macrocode}
\begingroup
\let\IfUseNumber\@secondoftwo
@@ -4188,50 +4125,40 @@
%<book|report> \@nameuse{@end#1}%
}
% \end{macrocode}
-% \end{macro}%^^A \scr@@startspart
+% \end{macro}^^A \scr@@startspart
%
-% \begin{macro}{\partlineswithprefixformat}
-% \changes{v3.25}{2017/09/07}{neu}
-% Diese Anweisung definiert das Format der eigentlichen Überschriften im Stil
-% \texttt{part}. Fonteinstellungen sind zu diesem Zeitpunkt bereits erfolgt
-% order Teil der Argumente. Die Argumente sind:
-% \begin{description}
-% \item[\meta{Befehlsname} --] der Name der Gliederungsebene, normalerweise
-% \texttt{chapter}.
-% \item[\meta{Gliederungsnummer} --] die bereits fertig formatierte
-% Gliederungsnummer einschließlich des nachfolgenden vertikalen Abstands
-% oder leer, falls keine Gliederungsnummer auszugeben ist.
-% \item[\meta{Text} --] der Text der Überschrift.
-% \end{description}
-% Der Anwender ist selbst verantwortlich, dass innerhalb der Überschrift kein
-% Seitenumbruch erfolgen kann. Nach der Überschrift wird jedoch zwangsweise
-% ein \cs{@@par} ausgeführt, so dass sichergestellt ist, dass mit einem
-% internen Absatz abgeschlossen wird.
+% \begin{command}{\partlineswithprefixformat}
+% \changes{v3.25}{2017/09/07}{added}
+% Command
+% \begin{quote}
+% \cs{partlineswithprefixformat}\marg{command name}\marg{number}\marg{text}
+% \end{quote}
+% is used to print a part heading with a prefix line. \meta{number} is the
+% completely formatted prefix line inclusive the vertical distance below. The
+% \meta{text} is the text of the heading also formatted and with final
+% \cs{@@par}. But if the user uses more paragraphs than this final one, the
+% user is responsible to prevent page breaks!
% \begin{macrocode}
\newcommand{\partlineswithprefixformat}[3]{%
#2#3%
}
% \end{macrocode}
-% \end{macro}%^^A \partlineswithprefixformat
+% \end{command}^^A \partlineswithprefixformat
%
% \begin{macro}{\scr@@endpart}
-% \changes{v3.18}{2015/05/23}{neue Anweisung (intern)}%^^A
-% Diese Anweisung ist von der ursprünglichen Definition von \cs{@spart}
-% abgeleitet und erbt deren ChangeLog-Einträge.
-% \changes{v2.3g}{1996/01/14}{\cs{@endpart} wird für
-% \textsf{scrartcl} nicht mehr definiert}%^^A
-% \changes{v2.4e}{1996/07/02}{Option \texttt{openany} beachten}%^^A
-% \changes{v2.6c}{2000/06/10}{\cs{@endpart} fügt nur noch in
-% beidseitigen Dokumenten bei Verwendung von \texttt{openright} eine
-% Leerseite ein}%^^A
-% \changes{v2.8p}{2001/09/27}{\cs{vbox} eingefügt}%^^A
-% \changes{v2.8p}{2001/09/27}{\cs{use@preamble} ersetzt
-% \cs{@part@preamble}}%^^A
-% \changes{v3.02}{2009/01/01}{Verwendung des neuen
-% \cs{partheademptypage}}%^^A
-% Die Anweisung wird bei \textsf{scrbook} und \textsf{screprt} verwendet, um
-% die Überschrift abzuschließen. \textsf{scrartcl} hat keine solche Anweisung.
-% Da einzige Argument ist der \meta{Name} der Gliederungsanweisung.
+% \changes{v2.3g}{1996/01/14}{\cs{@endpart} not defined for \cls*{scrartcl}}
+% \changes{v2.4e}{1996/07/02}{supporting option \opt{openany}}
+% \changes{v2.6c}{2000/06/10}{\cs{@endpart} respects \opt{open\quotechar=right}}
+% \changes{v2.8p}{2001/09/27}{\cs{vbox} added}
+% \changes{v2.8p}{2001/09/27}{\cs{@part@preamble} replaced by \cs{use@preamble}}
+% \changes{v3.02}{2009/01/01}{using \cs{partheademptypage}}
+% \changes{v3.18}{2015/05/23}{added}
+% Before \KOMAScript~v3.18 this code was part of \cs{part}. \cls*{scrbook} and
+% \cls*{scrreprt} use this macro to finalize the heading, e.g., print a
+% preamble, to the final distance or new page and add an empty retro
+% page. \cls*{scrartcl} does not have such a command, because with
+% \cls*{scrartcl} parts are simple headings not pages. As usual the argument
+% is the name of the part command, e.g., \texttt{part}.
% \begin{macrocode}
%<*book|report>
\newcommand*{\scr@@endpart}[1]{%
@@ -4246,30 +4173,34 @@
}
%</book|report>
% \end{macrocode}
-% \end{macro}%^^A \scr@@endpart
-% \end{macro}%^^A \scr@startpart
+% \end{macro}^^A \scr@@endpart
+% \end{macro}^^A \scr@startpart
%
%
% \begin{macro}{\hy@insteadofrefstepcounter}
-% \changes{v3.18}{2015/05/22}{neu (intern und \textsf{hyperref})}
+% \changes{v3.18}{2015/05/22}{added to be used by \pkg{hyperref}}
% \begin{macro}{\scr@chapter@before@hyperref@patch}
-% \changes{v3.27}{2019/07/24}{neu (intern für \textsf{scrhack})}
+% \changes{v3.27}{2019/07/24}{added to be used by \pkg*{scrhack}}
% \begin{macro}{\scr@chapter@after@hyperref@patch}
-% \changes{v3.27}{2019/07/24}{neu (intern für \textsf{scrhack})}
-% \changes{v3.32}{2020/09/11}{\cs{AfterPackage!} durch
-% \cs{AfterAtEndOfPackage} ersetzt}
-% Normalerweise führt \textsf{hyperref} via \cs{refstepcounter}
-% Initialisierungen für ein nachfolgendes \cs{addcontentsline} durch. Wenn
-% allerdings eine nicht nummerierte Überschrift ins Inhaltsverzeichnis
-% eingetragen wird, dann fehlt das vorherige \cs{refstepcounter}. Statt
-% \cs{@chapter}, \cs{@schapter}, \cs{@part}, \cs{@spart} etc. direkt zu
-% patchen, erscheint es mir sinnvoller einen Hook dafür zu definieren, der
-% dann von \textsf{hyperref} entsprechend definiert werden kann. Solange
-% \textsf{hyperref} das nicht macht, versuche ich mich selbst daran und kann
-% nur hoffen, dass es funktioniert. Dabei verwende ich im Gegensatz zu
-% \textsf{hyperref} für \cs{Hy@MakeCurrentHrefAuto} kein \cs{Hy@chapapp}, weil
-% ja \cs{autoref} für nicht nummerierte Überschriften ohnehin sinnlos
-% ist. Stattdessen verwende ich den Gliederungsbefehl.
+% \changes{v3.27}{2019/07/24}{added to be used by \pkg*{scrhack}}
+% \changes{v3.32}{2020/09/11}{\cs{AfterPackage!} replaced by
+% \cs{AfterAtEndOfPackage}}
+% Usually \pkg{hyperref} uses \cs{refstepcounter} to process extra codes for
+% anchors and bookmarks. However, if a not numbered heading is used,
+% \pkg{hyperref} cannot use \cs{refstepcounter} but still has to add
+% code. Usually \pkg{hyperref} patchs several commands like \cs{@chapter},
+% \cs{@schapter}, \cs{@part}, \cs{@spart} etc. to do so. But I think, it would
+% be better to provide a hook for this, \pkg*{hyperref} can change. So we've
+% designed \cs{hy@insteadofrefstepcounter}. Unfortunately \pkg{hyperref}
+% currently does not care for this, but still does its patches. So we need to
+% prevent \pkg{hyperref} from doing so and additionally define
+% \cs{hy@insteadofrefstepcounter} ourselves. But because \cs{autoref} is
+% nonsense for not numbered headings, I do not use \cs{Hy@chapapp} for
+% \cs{Hy@MakeCurrentHrefAuto}.
+% \begin{description}
+% \item[ToDo:] Explain the Oberdiek support team, what we are doing here and
+% what they should do.
+% \end{description}
% \begin{macrocode}
\newcommand*{\hy@insteadofrefstepcounter}[1]{}
\let\hy@insteadofrefstepcounter\@gobble
@@ -4294,92 +4225,81 @@
}
\AfterAtEndOfPackage{hyperref}{\scr@chapter@after@hyperref@patch}
% \end{macrocode}
-% \end{macro}%^^A \scr@after@hyperref@patch
-% \end{macro}%^^A \scr@before@hyperref@patch
-% \end{macro}%^^A \hy@insteadofrefstepcounter
-%
-% \begin{macro}{\addparttocentry}
-% \changes{v3.08}{2010/11/01}{Neu}%^^A
-% Seit Version~3.08 wird der Eintrag nicht direkt innerhalb von \cs{part}
-% per \cs{addcontentsline} erzeugt, sondern indirekt über diese Anweisung. Das
-% erste Argument ist dabei die (formatierte) Nummer bzw. bei nicht
-% nummerierten Teilen leer. Das zweite Argument ist der Überschriftstext für
-% das Verzeichnis. Durch diesen indirekten Weg, kann die Anweisung einfach
-% umdefiniert werden. Verwendet wird hier die Standardanweisung für
-% Inhaltsverzeichniseinträge, die in \texttt{scrkliof.dtx} definiert ist:
+% \end{macro}^^A \scr@after@hyperref@patch
+% \end{macro}^^A \scr@before@hyperref@patch
+% \end{macro}^^A \hy@insteadofrefstepcounter
+%
+% \begin{command}{\addparttocentry}
+% \changes{v3.08}{2010/11/01}{added}
+% We do not use \cs{addcontentsline} directly for the entries to the table of
+% contents. Using
+% \begin{quote}
+% \cs{addparttocentry}\marg{number}\marg{text}
+% \end{quote}
+% allows easy manipulation of such entries and additional actions. If the
+% \meta{number} is completely empty no number should be used. Internally the
+% generic \cs{addtocentrydefault} it used, which uses \cs{nonumberline}
+% instead of \cs{numberline} in this case. See \file{scrkernel-listsof.dtx}
+% for more information.
% \begin{macrocode}
\newcommand*{\addparttocentry}[2]{%
\addtocentrydefault{part}{#1}{#2}%
}
% \end{macrocode}
-% \end{macro}%^^A \addparttocentry
-%
-%
-% \begin{macro}{\part}
-% \changes{v3.18}{2015/05/23}{siehe \cs{scr@dsc@def@style@part@command} und
-% \cs{scr@startpart}}%^^A
-% \begin{macro}{\@part}
-% \changes{v3.18}{2015/05/23}{siehe \cs{scr@dsc@def@style@part@command} und
-% \cs{scr@@startpart}}%^^A
-% \begin{macro}{\@spart}
-% \changes{v3.18}{2015/05/23}{siehe \cs{scr@dsc@def@style@part@command} und
-% \cs{scr@@startspart}}%^^A
-% \begin{macro}{\@endpart}
-% \changes{v3.18}{2015/05/23}{siehe \cs{scr@dsc@def@style@part@command} und
-% \cs{scr@@endpart}}%^^A
-% \begin{macro}{\setpartpreamble}
-% \changes{v2.8f}{2001/07/12}{neu}%^^A
-% \changes{v2.8p}{2001/09/27}{Verwendung von \cs{use@preamble}}%^^A
-% \changes{v3.18}{2015/05/23}{siehe \cs{scr@dsc@def@style@part@command} und
-% \cs{scr@@endpart}}%^^A
-% \begin{macro}{\part@u@preamble}
-% \changes{v2.8p}{2001/09/27}{neu (intern)}%^^A
-% \changes{v2.8p}{2001/09/27}{Ersatz für \cs{part@preamble}}%^^A
-% \changes{v3.12a}{2014/02/14}{flaschen (\cs{part@preamble@u}) Namen
-% korrigiert}%^^A
-% \changes{v3.18}{2015/05/23}{siehe \cs{scr@dsc@def@style@part@command} und
-% \cs{scr@@endpart}}%^^A
+% \end{command}^^A \addparttocentry
+%
+%
+% \begin{command}{\part}
+% \changes{v3.18}{2015/05/23}{indirect definition}
+% \begin{macro}{\@part,\@spart,\@endpart}
+% \changes{v3.18}{2015/05/23}{indirect definition}
+% \begin{command}{\setpartpreamble}
+% \changes{v2.8f}{2001/07/12}{added}
+% \changes{v2.8p}{2001/09/27}{using \cs{use@preamble}}
+% \changes{v3.18}{2015/05/23}{indirect definition}
+% \begin{macro}{\part@preamble,\part@u@preamble}
+% \changes{v2.8p}{2001/09/27}{added}
+% \changes{v2.8p}{2001/09/27}{\cs{part@preamble} renamed to \cs{part@u@preamble}}
+% \changes{v3.12a}{2014/02/14}{name fixed}
+% \changes{v3.18}{2015/05/23}{indirect definition}
% \begin{macro}{\part@o@preamble}
-% \changes{v2.8p}{2001/09/27}{neu (intern)}%^^A
-% \changes{v3.12a}{2014/02/14}{flaschen Namen (\cs{part@preamble@o})
-% korrigiert}%^^A
-% \changes{v3.18}{2015/05/23}{siehe \cs{scr@dsc@def@style@part@command} und
-% \cs{scr@@endpart}}%^^A
-% Diese Anweisungen werden indirekt über \cs{DeclareSectionCommand} und
-% \cs{scr@dsc@def@style@part@command} bzw. \cs{setpartpreamble} definiert.
-% \end{macro}%^^A \setpartpreamble
-% \end{macro}%^^A \part@u@preamble
-% \end{macro}%^^A \part@o@preamble
-% \end{macro}%^^A \@endpart
-% \end{macro}%^^A \@spart
-% \end{macro}%^^A \@part
-% \end{macro}%^^A \part
-%
-% \begin{macro}{\addpart}
-% \changes{v2.8c}{2001/06/29}{neu}%^^A
-% \changes{v2.8d}{2001/07/05}{\cs{partpagestyle} statt \texttt{plain}}%^^A
-% \changes{v2.95a}{2006/07/10}{support of preamble added}%^^A
-% \changes{v3.11b}{2012/07/29}{missing negativ \cs{vskip} added}%^^A
-% \changes{v3.13a}{2014/09/11}{Verwendung von \cs{SecDef}}%^^A
-% \changes{v3.15a}{2015/01/22}{Anpassung an geänderte Abstandsbehandlung bei
-% \cs{part} und \cs{@spart}}%^^A
-% \changes{v3.18}{2015/05/25}{Komplett neu definiert}%^^A
+% \changes{v2.8p}{2001/09/27}{added}
+% \changes{v3.12a}{2014/02/14}{name fixed}
+% \changes{v3.18}{2015/05/23}{indirect definition}
+% All these commands and macros are not defined explicitly but by using
+% \cs{DeclareSectionCommand} later. See also
+% \cs{scr@dsc@def@style@part@command} and \cs{setpartpreamble}.
+% \end{macro}^^A \part@o@preamble
+% \end{macro}^^A \part@u@preamble
+% \end{command}^^A \setpartpreamble
+% \end{macro}^^A \@part,\@spart,\@endpart
+% \end{command}^^A \part
+%
+% \begin{command}{\addpart}
+% \changes{v2.8c}{2001/06/29}{added}
+% \changes{v2.8d}{2001/07/05}{using \cs{partpagestyle}}
+% \changes{v2.95a}{2006/07/10}{support of preamble added}
+% \changes{v3.11b}{2012/07/29}{missing negativ \cs{vskip} added}
+% \changes{v3.13a}{2014/09/11}{using \cs{SecDef}}
+% \changes{v3.15a}{2015/01/22}{distance adaption}
+% \changes{v3.18}{2015/05/25}{redefinition}
% \begin{macro}{\@addpart}
-% \changes{v2.8c}{2001/06/29}{neu (intern)}%^^A
-% \changes{v2.8l}{2001/08/17}{erst eintragen, dann ausgeben}%^^A
-% \changes{v2.95}{2004/07/20}{kann Kolumnentitel erzeugen}%^^A
-% \changes{v3.00}{2008/07/01}{Notlösung für \textsf{hyperref} eingefügt}%^^A
-% \changes{v3.08}{2010/11/02}{Verwendung von \cs{addparttocentry}}%^^A
-% \changes{v3.10}{2011/08/30}{Integration der Erweiterung für das optionale
-% Argument der Gliederungsbefehle}%^^A
-% \changes{v3.10}{2011/08/30}{Wenn \cs{partmark} \cs{@gobble} ist, wird
-% \cs{@mkboth}{}{} aufgerufen.}%^^A
-% \changes{v3.17}{2015/04/20}{Es wird \cs{addpartmark} verwendet und auch
-% nie \cs{@mkboth}{}{} aufgerufen.}%^^A
-% \changes{v3.18}{2015/05/25}{Komplett neu definiert}%^^A
+% \changes{v2.8c}{2001/06/29}{added}
+% \changes{v2.8l}{2001/08/17}{first ToC then output}
+% \changes{v2.95}{2004/07/20}{support for running head}
+% \changes{v3.00}{2008/07/01}{\pkg{hyperref} workaround}
+% \changes{v3.08}{2010/11/02}{using \cs{addparttocentry}}
+% \changes{v3.10}{2011/08/30}{extended optional argument}
+% \changes{v3.10}{2011/08/30}{using \cs{@mkboth{}{}} if \cs{partmark} is
+% \cs{@gobble}}
+% \changes{v3.17}{2015/04/20}{using \cs{addpartmark} but never \cs{@mkboth}}
+% \changes{v3.18}{2015/05/25}{redefinition}
% \begin{macro}{\@saddpart}
-% \changes{v2.8c}{2001/06/29}{neu (intern)}%^^A
-% \changes{v3.18}{2015/05/25}{Komplett neu definiert}%^^A
+% \changes{v2.8c}{2001/06/29}{added}
+% \changes{v3.18}{2015/05/25}{redefinition}
+% The improved not numbered version of \cs{part}. Note: This could also be
+% done using the extended optional argument of \cs{part} and option
+% \opt{nonumber=true}. So this command becomes more and more deprecated.
% \begin{macrocode}
\newcommand\addpart{%
\SecDef\@addpart\@saddpart
@@ -4400,83 +4320,77 @@
\addpartmark{}%
}
% \end{macrocode}
-% \end{macro}%^^A \@saddpart
-% \end{macro}%^^A \@addpart
-% \end{macro}%^^A \addpart
+% \end{macro}^^A \@saddpart
+% \end{macro}^^A \@addpart
+% \end{command}^^A \addpart
%
%
% \begin{macro}{\l@part}
-% \changes{v2.97c}{2007/06/21}{\cs{sectfont}\cs{large} durch Verwendung von
-% Element \texttt{partentry} ersetzt}%^^A
-% \changes{v2.97c}{2007/06/21}{Element \texttt{partentrypagenumber} wird
-% verwendet}%^^A
-% \changes{v3.15}{2014/12/23}{Verwendung von \cs{parttocdepth} und
-% \cs{scr@part@numwidth}}%^^A
-% \changes{v3.20}{2015/10/06}{Überführung in Verzeichnisstil}%^^A
-% Der Eintrag für \cs{part}. Es werden einige Hilfsmakros passend zu
-% \cs{DeclareSectionCommand} definiert. Dadurch können diverse Einstellungen
-% darüber geändert werden. Es kann jedoch derzeit kein neuer Stil zugewiesen
-% werden.
+% \changes{v2.97c}{2007/06/21}{\cs{sectfont}\cs{large} replaced by font
+% element \fnt{partentry}}
+% \changes{v2.97c}{2007/06/21}{using font element \fnt{partentrypagenumber}}
+% \changes{v3.15}{2014/12/23}{using \cs{parttocdepth} and
+% \cs{scr@part@numwidth}}
+% \changes{v3.20}{2015/10/06}{replaced by usage of ToC style}
% \begin{macro}{\scr@part@tocindent}
-% \changes{v3.15}{2014/12/02}{neue (interne) Anweisung}%^^A
-% \changes{v3.18}{2015/06/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \changes{v3.20}{2015/11/06}{wird nun auch verwendet}%^^A
-% Der Einzug des Eintrags noch vor der Nummer.
-% \end{macro}%^^A \scr@part@tocindent
+% \changes{v3.15}{2014/12/02}{added}
+% \changes{v3.18}{2015/06/09}{indirect by \cs{DeclareSectionCommand}}
+% \end{macro}^^A \scr@part@tocindent
% \begin{macro}{\scr@part@tocnumwidth}
-% \changes{v3.15}{2014/12/02}{neue (interne) Anweisung}%^^A
-% \changes{v3.18}{2015/06/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% Die definierte Breite der Nummer für den Eintrag ins Inhaltsverzeichnis.
+% \changes{v3.15}{2014/12/02}{added}
+% \changes{v3.18}{2015/06/09}{indirect by\cs{DeclareSectionCommand}}
+% These macros are not longer defined explicitly but by
+% \cs{DeclareTOCEntryStyle} and indirectly by \cs{DeclareSectionCommand}.
% \end{macro}
-% \end{macro}%^^A \l@part
-%
-%
-% \begin{Counter}{part}
-% \begin{macro}{\thepart}
-% \begin{macro}{\partformat}
-% \changes{v2.3c}{1995/08/06}{Duden Regel 6}%^^A
-% \changes{v2.5f}{1999/02/14}{überflüssiges Leerzeichen am Ende
-% entfernt}%^^A
-% \changes{v2.7h}{2001/04/22}{verlorenen Backslash in \cs{autodot}%^^A
-% wieder eingefügt}%^^A
-% Jede Gliederungsebene benötigt einen Zähler für die Gliederungsnummer und
-% eine Darstellung des Zählers (\cs{the\dots}). Desweiteren wird eine
-% Formatierung des Zählers in den Gliederungsüberschriften
-% (\texttt{\bslash\dots format}) benötigt.
+% \end{macro}^^A \l@part
+%
+%
+% \begin{counter}{part}
+% \begin{command}{\thepart}
+% \begin{command}{\partformat}
+% \changes{v2.3c}{1995/08/06}{auto dot feature}
+% \changes{v2.5f}{1999/02/14}{orphan spaces removed}
+% \changes{v2.7h}{2001/04/22}{missing backslash of \cs{autodot} fixed}
+% Because we don't use the default Arabic numbering, we still define the
+% counter for \cs{part}, it's printing and the formatting explicitly.
% \begin{macrocode}
\newcounter{part}
\renewcommand*{\thepart}{\@Roman\c@part}
\newcommand*{\partformat}{\partname~\thepart\autodot}
% \end{macrocode}
-% \end{macro}%^^A \partformat
-% \end{macro}%^^A \thepart
-% \end{Counter}{part}
+% \end{command}^^A \partformat
+% \end{command}^^A \thepart
+% \end{counter}{part}
%
%
-% \begin{macro}{\partname}
-% Namen der Gliederungsebenen \cs{part}.
+% \begin{command}{\partname}
+% \changes{v3.36}{2022/03/15}{explicit definition for English languages}
+% The name of a part used for the prefix line and maybe for the ToC entry.
% \begin{macrocode}
\newcommand*\partname{Part}
+\providecaptionname{american,australian,british,canadian,english,newzealand,%
+ UKenglish,ukenglish,USenglish,usenglish}\partname{Part}
% \end{macrocode}
-% \end{macro}%^^A \partname
+% \end{command}^^A \partname
%
%
-% \begin{macro}{\partmark}
-% \changes{v2.9r}{2004/07/20}{neu (für \textsf{scrpage2})}%^^A
-% \changes{v3.18}{2015/05/24}{Voreinstellung von \cs{@gobble} zu
-% \cs{@mkboth{}{}} geändert}
+% \begin{command}{\partmark}
+% \changes{v2.9r}{2004/07/20}{added}
+% \changes{v3.18}{2015/05/24}{default changed from \cs{@gobble} to
+% \cs{@mkboth{}{}}}
+% Initially \cs{part} should simply empty the left and right mark if an
+% automatic running head is used. This is independent from the page style.
% \begin{macrocode}
\newcommand*{\partmark}[1]{\@mkboth{}{}}
% \end{macrocode}
-% \end{macro}%^^A \partmark
+% \end{command}^^A \partmark
%
-% \begin{macro}{\addpartmark}
-% \changes{v3.17}{2015/04/20}{neue Anweisung}%^^A
-% \changes{v3.18}{2015/05/24}{abhängig von \cs{partnumdepth}}%^^A
-% Analog zu \cs{addchapmark} für \cs{addpart}. Auch dabei gilt, dass
-% \cs{if@mainmatter} hier auch von \textsf{scrreprt} definiert wird. Das ist
-% Absicht und vereinfacht dem einen oder anderen Paket oder Benutzer
-% vielleicht die Arbeit.
+% \begin{command}{\addpartmark}
+% \changes{v3.17}{2015/04/20}{added}
+% \changes{v3.18}{2015/05/24}{depends on \cs{partnumdepth}}
+% To be used to add the marks with \cs{addpart}. Locally we define
+% \cs{if@mainmatter}, because it makes life easier for users or package
+% authors, who (re-)define \cs{partmark}.
% \begin{macrocode}
\newcommand*\addpartmark[1]{%
\begingroup
@@ -4487,101 +4401,79 @@
\endgroup
}
% \end{macrocode}
-% \end{macro}%^^A \addpartmark
+% \end{command}^^A \addpartmark
%
%
-% \begin{macro}{\raggedpart}
-% \changes{v2.95a}{2006/07/10}{neue Konfigurationsmöglichkeit}%^^A
-% Die Ausrichtung der Überschrift von \cs{part} kann davon abweichend über
-% \cs{raggedpart} konfiguriert werden. Die Voreinstellung ist von der
-% Klasse abhängig.
+% \begin{command}{\raggedpart}
+% \changes{v2.95a}{2006/07/10}{added}
+% Style \texttt{part} does not use \cs{raggedsection} but
+% \cs{raggedpart}. However for \cls*{scrartcl} the default is the same. But
+% \cls*{scrbook} and \cls*{scrreprt} use \cs{centering} as default.
+% \begin{description}
+% \item[Note:] Because of using \cs{let} inside a class, \cs{raggedright}
+% should be without hyphenation when we define \cs{raggedpart}.
+% \end{description}
% \begin{macrocode}
\newcommand*{\raggedpart}{}
%<article>\let\raggedpart\raggedsection
%<report|book>\let\raggedpart\centering
% \end{macrocode}
-% \end{macro}
-%
-% \begin{KOMAfont}{part}
-% \changes{v2.8p}{2001/09/23}{neues Element \texttt{part}}%^^A
-% \begin{macro}{\scr@fnt@part}
-% \changes{v2.8p}{2001/09/23}{neues Element \texttt{part}}%^^A
-% \begin{KOMAfont}{partnumber}
-% \changes{v2.8p}{2001/09/23}{neues Element \texttt{partnumber}}%^^A
-% \begin{macro}{\scr@fnt@partnumber}
-% \changes{v2.8p}{2001/09/23}{neues Element \texttt{partnumber}}%^^A
-% \begin{KOMAfont}{partprefix}
-% \changes{v3.18}{2015/06/10}{neues Alias-Element \texttt{partprefix}}%^^A
-% \begin{macrocode}
-\newcommand*{\scr@fnt@part}{\size@part}
-\newcommand*{\scr@fnt@partnumber}{\size@partnumber}
-\aliaskomafont{partprefix}{partnumber}
-% \end{macrocode}
-% \end{KOMAfont}
-% \end{macro}
-% \end{KOMAfont}
-% \end{macro}
-% \end{KOMAfont}
+% \end{command}
%
-% \begin{KOMAfont}{partentry}
-% \changes{v2.97c}{2007/06/21}{neues Font-Element}%^^A
-% \changes{v3.06}{2010/06/09}{Verwendung von \texttt{sectioning} durch
-% \texttt{disposition} ersetzt}%^^A
-% Schrift für den \cs{part}-Eintrag im Inhaltsverzeichnis.
+% \begin{fontelement}{partentry}
+% \changes{v2.97c}{2007/06/21}{added}
+% \changes{v3.06}{2010/06/09}{\fnt{sectioning} replaced by \fnt{disposition}}
+% \cs{part} entries to the table of contents are \cs{large}.
% \begin{macrocode}
\newkomafont{partentry}{\usekomafont{disposition}\large}
% \end{macrocode}
-% \end{KOMAfont}
+% \end{fontelement}
%
-% \begin{KOMAfont}{partentrypagenumber}
-% \changes{v2.97c}{2007/06/21}{neues Font-Element}%^^A
-% Schrift für die Seitenzahl des \cs{part}-Eintrags im Inhaltsverzeichnis
-% abweichend von \texttt{partentry}.
+% \begin{fontelement}{partentrypagenumber}
+% \changes{v2.97c}{2007/06/21}{added}
+% The page number of the ToC entry should be unchanged.
% \begin{macrocode}
\newkomafont{partentrypagenumber}{}
%</body>
-%</class>
% \end{macrocode}
-% \end{KOMAfont}
+% \end{fontelement}
%
%
-% \subsection{Kapitel}
+% \subsection{Chapters}
%
-% Bei den Klassen \texttt{scrbook} und \texttt{scrreprt} gibt es im
-% Unterschied zu \texttt{scrartcl} auch noch die Kapitelebene. Für die
-% Definition des Kapitelstils mittels \cs{DeclareSectionCommand} werden neben
-% den Optionen und \cs{scr@dsc@def@style@chapter@command} noch diverse
-% Anweisungen benötigt. Diese sind allesamt von der ursprünglichen Definition
-% für Kapitel abgeleitet. Eine Besonderheit ist dabei, dass \textsf{hyperref}
-% dem neuen Code durch (inkompatible) Umdefinierung von \cs{@schapter} und
-% \cs{@chapter} in die Quere kommt. Das gilt es also zusätzlich zu verhindern
-% und dennoch \cs{hyperref} zu berücksichtigen. Dies gelingt am einfachsten
-% durch einen neuen Hook, den \cs{hyperref} zukünftig gerne selbst passend
-% umdefinieren kann. Wer sonst noch an \cs{@chapter} und \cs{@schaper}
-% herumdoktert und dabei \KOMAScript{} aus dem Tritt bringt, ist selbst
-% schuld.
+% Classes \cls*{scrbook} and \cls*{scrreprt} provide chapters. These are
+% realized by \cs{DeclareSectionCommand} and the \texttt{chapter} style. The
+% style is represented by \cs{scr@dsc@def@style@chapter@command} and several
+% helpers.
+% \begin{description}
+% \item[Note:] Package \pkg{hyperref} is not really compatible with
+% \KOMAScript{} classes, because it redefines \cs{@schapter} and
+% \cs{@chapter} incompatible. However, currently \KOMAScript{} has a build
+% in workaround for this. But this workaround itself depends on internal
+% code of \pkg{hyperref}. It would be better, if \pkg{hyperref} would
+% provide an interface for class authors and would redefine internal macros
+% of classes only as fallback if classes do not use this
+% interface. \KOMAScript{} also provides an alternative. \pkg*{hyperref}
+% could redefine a single command \cs{hy@insteadofrefstepcounter}.
+% \item[Note:] Any package, that changes internal macros like \cs{@chapter},
+% \cs{@schapter}, \cs{@makechapterhead}, \cs{@makeschapterhead} is
+% incompatible with \KOMAScript{} classes. Neither \KOMAScript{} nor the
+% \KOMAScript{} author is responsible for this. Package authors are welcome
+% to ask for interfaces they need, e.g., a good idea would be to define a
+% own headings style.
+% \end{description}
%
% \begin{option}{chapterprefix}
-% \changes{v2.8}{2001/06/15}{neue Option}%^^A
-% \changes{v2.95c}{2006/08/21}{als \textsf{keyval}-Option}%^^A
-% \changes{v3.18}{2015/05/22}{die Option bezieht sich allgemein auf den
-% Gliederungsstil}%^^A
-% \begin{option}{nochapterprefix}
-% \changes{v2.8}{2001/06/15}{neue Option}%^^A
-% \changes{v2.95c}{2006/08/21}{obsolete Option}%^^A
-% \changes{v3.01a}{2008/11/20}{deprecated}%^^A
-% Normalerweise verwenden \textsf{scrbook} und \textsf{scrreprt} nicht
-% die enorm großen Überschriften von \textsf{book} und
-% \textsf{report}, die mit einem Absatz "`Kapitel \emph{Nummer}"'
-% beginnen. Mit der Option \texttt{chapterprefix} kann dies jetzt
-% wieder aktiviert werden. Die Option, zur Deaktivierung heißt
-% entsprechend \textsf{nochapterprefix}.
-% Um für Spezialanwendungen auch innerhalb des Dokuments eine
-% Umschaltung zu ermöglichen bzw. für die Optionen
-% \texttt{appendixprefix} und \texttt{noappendixprefix} erfolgt die
-% Umschaltung durch einen Schalter.
-% \begin{macrocode}
-%<*class>
+% \changes{v2.8}{2001/06/15}{added}
+% \changes{v2.95c}{2006/08/21}{changed to \pkg{keyval} option}
+% \changes{v3.18}{2015/05/22}{option correlates with style not level}
+% \begin{macro}{\@chapterprefixtrue,\@chapterprefixfalse,\if@chapterprefix}
+% Initially \KOMAScript{} does not use the enormous chapter headings with
+% prefix line ``Chapter \meta{number}'' but a more subtle one. However, either
+% \opt{chapterprefix} or \opt{headings=twolinechapter} can be used to
+% reactivate the prefix line. The current setting is available via the boolean
+% switch \cs{if@chapterprefix}.
+% \begin{macrocode}
%<*book|report>
%<prepare>\newif\if@chapterprefix
%<*option>
@@ -4600,23 +4492,32 @@
}%
\fi
}
-\KOMA@DeclareDeprecatedOption{nochapterprefix}{chapterprefix=false}
\KOMA@kav@add{.\KOMAClassFileName}{headings}{onelinechapter}%
+% \end{macrocode}
+% \begin{option}{nochapterprefix}
+% \changes{v2.8}{2001/06/15}{added}
+% \changes{v2.95c}{2006/08/21}{obsolete}
+% \changes{v3.01a}{2008/11/20}{deprecated}
+% Deprecated option for compatibility with \KOMAScript~2.9u only.
+% \begin{macrocode}
+\KOMA@DeclareDeprecatedOption{nochapterprefix}{chapterprefix=false}
%</option>
% \end{macrocode}
-% \end{option}
-% \end{option}
+% \end{option}^^A nochapterprefix
+% \end{macro}^^A \if@chapterprefix
+% \end{option}^^A chapterprefix
+%
%
-% \selectlanguage{english}
% \begin{option}{appendixprefix}
-% \changes{v2.8}{2001/06/15}{new option}
-% \changes{v2.95c}{2006/08/21}{re-implementation as \textsf{keyval} option}
+% \changes{v2.8}{2001/06/15}{added}
+% \changes{v2.95c}{2006/08/21}{re-implementation as \pkg{keyval} option}
% \changes{v3.12}{2013/03/05}{usage of \cs{FamilyKeyState}}
% \changes{v3.17}{2015/03/09}{internal value storage}
% \changes{v3.34}{2021/04/30}{usage of \LaTeX{} hook, if available}
-% \changes{v3.34}{2021/04/30}{new value \texttt{default} with \LaTeX{} hooks}
+% \changes{v3.34}{2021/04/30}{new value \opt{\quotechar=default} with \LaTeX{}
+% hooks}
% If the appendix chapters should be with or without prefix line independent
-% from the chapters of the main part, option \Option{appendixprefix} can be
+% from the chapters of the main part, option \opt{appendixprefix} can be
% used. This does not set up a new boolean but just activates or deactivates
% the boolean for chapters inside \cs{appendix}. From \KOMAScript{} v3.34 and
% \LaTeX{} 2020/10/01 this is done using a new \LaTeX{} hook. Otherwise still
@@ -4680,91 +4581,82 @@
}%
}
% \end{macrocode}
-% \end{option}%^^A appendixprefix
-%
% \begin{option}{noappendixprefix}
-% \changes{v2.8}{2001/06/15}{new option}
-% \changes{v2.95c}{2006/08/21}{obsolete option}
+% \changes{v2.8}{2001/06/15}{added}
+% \changes{v2.95c}{2006/08/21}{obsolete}
% \changes{v3.01a}{2008/11/20}{deprecated}
% \begin{macrocode}
\KOMA@DeclareDeprecatedOption{noappendixprefix}{appendixprefix=false}
%</option>
% \end{macrocode}
-% \end{option}%^^A noappendixprefix
+% \end{option}^^A noappendixprefix
+% \end{option}^^A appendixprefix
%
%
-% \selectlanguage{ngerman}
-% \begin{macro}{\size@chapter}
-% \changes{v2.8o}{2001/09/14}{neu (intern)}%^^A
-% \changes{v2.96a}{2006/12/02}{letztes Element darf ein Argument erwarten,
-% wenn es keine Auswirkung auf den Zeilen abstand hat}%^^A
-% \begin{macro}{\size@chapterprefix}
-% \changes{v2.96a}{2006/12/02}{neu (intern)}%^^A
-% Hier werden diese Befehle nur vordefiniert. Ihre tatsächliche Einstellung
-% erfolgt über die (Vor-)Auswahl von Option \texttt{headings}.
+% \begin{fontelement}{chapter}
+% \changes{v2.8o}{2001/09/14}{added}
+% \changes{v2.96a}{2006/12/02}{undocumented support for last macro expects an
+% argument}
+% \begin{fontelement}{chapterprefix}
+% \changes{v2.8o}{2001/09/14}{added by macro}
+% \changes{v2.96a}{2006/12/02}{added}
+% Definition of the font elements used by \cs{chapter}. The settings are done
+% by option \opt{headings} later. Everything is prepared before this option
+% is used the first time. The manual definition is used, because of
+% compatibility with \KOMAScript{} 2.9u. However, using the old macros is
+% deprecated and not supported any longer.
% \begin{macrocode}
%<*prepare>
\newcommand*{\size@chapter}{}
+\newcommand*{\scr@fnt@chapter}{\size@chapter}
\newcommand*{\size@chapterprefix}{\size@chapter}
+\newcommand*{\scr@fnt@chapterprefix}{\size@chapterprefix}
%</prepare>
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-% \begin{macro}{\chapterheadstartvskip}
-% \changes{v3.15}{2014/11/24}{\cs{scr@chapter@beforeskip} wird
-% definiert und verwendet}%^^A
-% \begin{macro}{\chapterheadendvskip}
-% \changes{v3.11c}{2013/02/13}{\cs{chapterheadstartvskip} und
-% \cs{chapterheadendvskip} haben in \textsf{scrartcl} nichts verloren}%^^A
-% \changes{v3.15}{2014/11/24}{\cs{scr@chapter@afterskip} wird
-% definiert und verwendet}%^^A
-% \changes{v3.15}{2014/12/10}{\cs{vspace} durch \cs{vskip} ersetzt, damit
-% \cs{lastskip} korrekt gesetzt ist}
-% \begin{macro}{\chapterheadmidvskip}
-% \changes{v3.15}{2014/11/20}{neue Anweisung}%^^A
-% \changes{v3.17}{2015/03/25}{\cs{scr@chapter@innerskip} wird
-% definiert und verwendet}%^^A
-% Mit diesen Anweisungen wird üblicherweise der Abstand zwischen
-% oberem Rand des Textbereichs und der Überschrift bzw. der Abstand
-% zwischen der Überschrift und dem Text des Kapitels gesetzt. Man kann
-% die Anweisungen aber zusätzlich auch für andere Zwecke
-% missbrauchen. Das ist der Grund warum diese Makros keine Längen,
-% sondern komplette Anweisungen enthalten. In der Voreinstellung
-% enthalten sie jedoch gar nichts. Die tatsächlichen Werte werden
-% durch die Optionen festgelegt. Dabei wird \cs{chapterheadmidvskip} nur
-% verwendet, wenn Option \texttt{chapterprefix} aktiv ist.
-%
-% Zur Erhöhung der Kompatibilität mit \cs{DeclareSectionCommand} werden
-% zunächst einige Hilfsanweisung definiert und verwendet.
-% \begin{macro}{\scr@chapter@beforeskip}
-% \changes{v3.15}{2014/11/24}{neue (interne) Anweisung}%^^A
-% \changes{v3.17}{2015/03/25}{umbenannt in
-% \cs{scr@chapter@beforeskip}}%^^A
-% \begin{macro}{\scr@chapter@afterskip}
-% \changes{v3.15}{2014/11/24}{neue (interne) Anweisung}%^^A
-% \changes{v3.17}{2015/03/25}{umbenannt in
-% \cs{scr@chapter@afterskip}}%^^A
-% \begin{macro}{\scr@chapter@sectionindent}
-% \changes{v3.15}{2014/11/24}{neue (interne) Anweisung (unbenutzt)}%^^A
-% \changes{v3.17}{2015/04/24}{entfernt}%^^A
-% \end{macro}%^^A \scr@chapter@sectionindent
-% \end{macro}%^^A \scr@chapter@afterskip
-% \end{macro}%^^A \scr@chapter@beforeskip
-% \begin{macro}{\scr@chapter@beforeskip}
-% \changes{v3.17}{2015/03/25}{Neu (intern) aus Umdefinierung von
-% \cs{scr@chapter@sectionbeforeskip}}%^^A
+% \end{fontelement}^^A chapterprefix
+% \end{fontelement}^^A chapter
+%
+%
+% \begin{command}{\chapterheadstartvskip}
+% \changes{v3.15}{2014/11/24}{defining and using \cs{scr@chapter@beforeskip}}
+% \begin{command}{\chapterheadmidvskip}
+% \changes{v3.15}{2014/11/20}{added}
+% \changes{v3.17}{2015/03/25}{defining and using \cs{scr@chapter@innerskip}}
+% \begin{command}{\chapterheadendvskip}
+% \changes{v3.11c}{2013/02/13}{\cs{chapterheadstartvskip} and
+% \cs{chapterheadendvskip} removed from \cls*{scrartcl}}
+% \changes{v3.15}{2014/11/24}{defining and using \cs{scr@chapter@afterskip}}
+% \changes{v3.15}{2014/12/10}{\cs{vspace} replaced by \cs{vskip} because of
+% \cs{lastskip}}
+% These commands are the distance before a chapter heading, between the
+% prefix line and the text line of the heading and after the chapter heading.
+% \cs{chapterheadmidvskip} is only used with option \opt{chapterprefix}
+% resp. \opt{headings=twolinechapter}.
+%
+% \begin{macro}{\scr@chapter@sectionbeforeskip,\scr@chapter@beforeskip}
+% \changes{v3.15}{2014/11/24}{added}
+% \changes{v3.17}{2015/03/25}{\cs{scr@chapter@sectionbeforeskip} renamed to
+% \cs{scr@chapter@beforeskip}}
% \begin{macro}{\scr@chapter@innerskip}
-% \changes{v3.17}{2015/03/25}{Neu (intern)}%^^A
-% \begin{macro}{\scr@chapter@afterskip}
-% \changes{v3.17}{2015/03/25}{Neu (intern) aus Umdefinierung von
-% \cs{scr@chapter@sectionafterskip}}%^^A
+% \changes{v3.17}{2015/03/25}{added}
+% \begin{macro}{\scr@chapter@sectionafterskip,\scr@chapter@afterskip}
+% \changes{v3.15}{2014/11/24}{added}
+% \changes{v3.17}{2015/03/25}{\cs{scr@chapter@sectionafterskip} renamed to
+% \cs{scr@chapter@afterskip}}
+% \begin{macro}{\scr@chapter@sectionindent}
+% \changes{v3.15}{2014/11/24}{added}
+% \changes{v3.17}{2015/04/24}{removed}
+% \end{macro}^^A \scr@chapter@sectionindent
% \begin{macro}{\scr@chapter@style}
-% \changes{v3.15}{2014/11/24}{neue (interne) Anweisung}%^^A
-% Dabei wird der leere Stil verwendet, mit dem Neudefinitionen von \cs{part}
-% über \cs{DeclareSectionCommand} verhindert werden. Gleichzeitig können
-% jedoch Einstellungen einiger Werte darüber erfolgen.
+% \changes{v3.15}{2014/11/24}{added}
+% All the skips and the page style are used by \cs{DeclareSectionCommand}
+% resp. the style \texttt{chapter}. We define it as early as possible. Even the
+% style of \cs{chapter} is already defined here.
+% \begin{description}
+% \item[ToDo:] Do we need them in the \texttt{prepare} run or can we move then
+% even to the \texttt{body} run?
+% \item[ToDo:] Do we really need to define \cs{scr@chapter@style}?
+% \end{description}
% \begin{macrocode}
%<*prepare>
\newcommand*{\scr@chapter@beforeskip}{\z@}
@@ -4775,33 +4667,32 @@
\let\scr@chapter@innerskip\z@
\newcommand*{\scr@chapter@style}{chapter}
% \end{macrocode}
-% \end{macro}%^^A \scr@chapter@style
-% \end{macro}%^^A \scr@chapter@innerskip
-% \end{macro}%^^A \scr@chapter@beforeskip
-% \end{macro}%^^A \scr@chapter@afterskip
+% \end{macro}^^A \scr@chapter@style
+% \end{macro}^^A \scr@chapter@afterskip
+% \end{macro}^^A \scr@chapter@innerskip
+% \end{macro}^^A \scr@chapter@beforeskip
% \begin{macrocode}
\newcommand*{\chapterheadstartvskip}{\vspace{\@tempskipa}}
\newcommand*{\chapterheadendvskip}{\vskip\@tempskipa}
\newcommand*{\chapterheadmidvskip}{\par\nobreak\vskip\@tempskipa}
%</prepare>
% \end{macrocode}
-% \end{macro}%^^A \chapterheadmidvskip
-% \end{macro}%^^A \chapterheadendvskip
-% \end{macro}%^^A \chapterheadstartvskip
+% \end{command}^^A \chapterheadendvskip
+% \end{command}^^A \chapterheadmidvskip
+% \end{command}^^A \chapterheadstartvskip
%
%
% \begin{macro}{\scr@startchapter}
-% \changes{v3.18}{2015/05/22}{neue Anweisung (für Paketautoren)}
-% \changes{v3.19}{2015/08/25}{Seitenstil nur ändern wenn definiert und nicht
-% leer}%^^A
-% Diese Anweisung legt fest, wie der konkrete Aufruf für Überschriften des
-% Stils \texttt{chapter} lautet. Einziges Argument ist dabei der Name der
-% Gliederungsebene, beispielsweise \texttt{chapter}. Alle anderen benötigten
-% Werte ergeben sich aus den Einstellungen für die Gliederungsebene. Beim
-% tatsächlichen Aufruf wird dann daran wie üblich noch optional noch entweder
-% ein Stern oder ein Argument für Kolumnentitel und Inhaltsverzeichniseintrag
-% und der Text der Überschrift angehängt. Diese Anweisung wurde von der
-% ursprünglichen Definition von \cs{chapter} abgeleitet.
+% \changes{v3.18}{2015/05/22}{added}
+% \changes{v3.19}{2015/08/25}{ignore empty page styles}
+% The macro
+% \begin{quote}
+% \cs{scr@startchapter}\marg{chapter command name}
+% \end{quote}
+% is now part of the style \texttt{chapter}. However, the main parts
+% of the code are from the original definition of \cs{chapter}. It has only one
+% argument: The name of the chapter command, i.e., \texttt{chapter}. All
+% arguments to the part command will be processed later.
% \begin{macrocode}
%<*body>
\newcommand*{\scr@startchapter}[1]{%
@@ -4830,20 +4721,29 @@
% \end{macrocode}
%
% \begin{macro}{\scr@@startchapter}
-% \changes{v3.18}{2015/05/22}{neue Anweisung (intern)}
-% Diese Anweisung nimmt die Rolle des ursprüngliche \cs{@chapter} ein und
-% erbst damit auch die ganzen noch relevanten ChangeLog-Einträge dieser
-% Anweisung.
+% \changes{v3.18}{2015/05/22}{added}
+% The macro
+% \begin{quote}
+% \cs{scr@@startchapter}\marg{chapter command name}\oarg{extended optional
+% argument}\marg{chapter heading}
+% \end{quote}
+% is now part of the style \texttt{chapter}. However, the main parts
+% of the code are from the original definition of \cs{@chapter}. Therefore it
+% has the mandatory and optional arguments of a non-star variant of, i.e.,
+% \cs{chapter} but an additional first argument.
+% \begin{description}
+% \item[Note:] \meta{extended optional argument} is named as optional, however
+% here it is already mandatory, because it is a delimited argument.
+% \end{description}
% \begin{macrocode}
\newcommand*{\scr@@startchapter}{}
\def\scr@@startchapter#1[#2]#3{%
\ExecuteDoHook{heading/branch/nostar/#1}%
% \end{macrocode}
-% \changes{v3.10}{2011/08/30}{Integration der Erweiterung für das optionale
-% Argument der Gliederungsbefehle}%^^A
-% \changes{v3.27}{2019/07/08}{neue Option \texttt{nonumber}}%^^A
-% Für das erweitere optionale Argument muss hier eine key-value-Auswertung
-% erfolgen, falls das erweitere optionale Argument aktiviert ist:
+% \changes{v3.10}{2011/08/30}{extended optional argument}
+% \changes{v3.27}{2019/07/08}{option \opt{nonumber} added}
+% First of all, depending in \opt{headings=optionto\dots} we have different
+% defaults for the options.
% \begin{macrocode}
\ifnum \scr@osectarg=\z@
\@scr@tempswafalse
@@ -4865,16 +4765,15 @@
\fi
\fi
% \end{macrocode}
-% Als nächstes muss für nummerierte Überschriften dieser Ebene sowohl der
-% Zähler erhöht also auch ein nummerierter Eintrag ins Inhaltsverzeichnis
-% erstellt werden.
-% \changes{v2.8e}{2001/07/10}{\cs{@maybeautodot} wird aufgerufen}%^^A
-% \changes{v3.08}{2010/11/01}{Verwendung von \cs{addchaptertocentry}}%^^A
-% \changes{v3.18}{2015/05/20}{Verwendung von \cs{add\meta{Name}tocentry}}%^^A
-% \changes{v3.18}{2015/05/22}{Verwendung von \meta{Name} statt \cs{@chapapp}
-% in \cs{typeout}}%^^A
-% \changes{v3.28}{2019/11/19}{\cs{ifnumbered} umbenannt in
-% \cs{Ifnumbered}}%^^A
+% \changes{v2.8e}{2001/07/10}{using \cs{@maybeautodot}}
+% \changes{v3.08}{2010/11/01}{using \cs{addchaptertocentry}}
+% \changes{v3.18}{2015/05/20}{using \cs{add\meta{name}tocentry}}
+% \changes{v3.18}{2015/05/22}{using \meta{name} instead of \cs{@chapapp}
+% in \cs{typeout}}
+% \changes{v3.28}{2019/11/19}{\cs{ifnumbered} renamed to
+% \cs{Ifnumbered}}
+% For numbered headings we have to increase the counter and write a process
+% information to the \file{log} and the terminal.
% \begin{macrocode}
\Ifnumbered{#1}{%
%<book> \if@mainmatter
@@ -4887,10 +4786,10 @@
\typeout{#1 \csname the#1\endcsname.}%
\ifx\@currenttocentry\@empty\else
% \end{macrocode}
-% \selectlanguage{english}%
-% \changes{v3.31}{2020/06/06}{use \cs{\dots tocformat}}%
-%^^ATODO: move \cs{autodot} to the definition of \cs{\dots tocformat}
-% \selectlanguage{ngerman}%
+% \changes{v3.31}{2020/06/06}{using \cs{\dots tocformat}}%
+% \begin{description}
+% \item[ToDo]: Move \cs{autodot} to the definition of \cs{\dots tocformat}.
+% \end{description}
% \begin{macrocode}
\@ifundefined{#1tocformat}{%
\expandafter\gdef\csname #1tocformat\endcsname
@@ -4903,12 +4802,11 @@
}{\csname\@ifundefined{#1tocformat}{the#1}{#1tocformat}\endcsname}%
{\@currenttocentry}%
\fi
+ \else
% \end{macrocode}
-% Für alle nicht nummerieten Überschriften dieser Ebene trotzdem die
-% Resetliste des Zählers ausführen und ggf. einen Verzeichniseintrag
-% erstellen.
+% For not numbered headings we still have to process the reset list of the
+% counter and write a process information to the \file{log} and the terminal.
% \begin{macrocode}
- \else
\expandafter\ifnum\scr@v@is@lt{3.15}\relax\else
\begingroup
\let\@elt\@stpelt
@@ -4918,8 +4816,13 @@
\typeout{#1 without number}%
\ifx\@currenttocentry\@empty\else
% \end{macrocode}
-% An dieser Stelle muss ggf. der \textsf{hyperref}-Hook für nicht nummerierte
-% Inhaltsverzeichniseinträge ausgeführt werden.
+% And before writing a not numbered entry to the table of contents we have to
+% execute also the \pkg{hyperref} hook \cs{hy@insteadofrefstepcounter}.
+% \begin{description}
+% \item[Note:] \pkg*{scrhack} uses the existence of this command to detect a
+% \KOMAScript{} class. Shouldn't this be changed using, e.g.,
+% \cs{KOMAClassName}?
+% \end{description}
% \begin{macrocode}
\hy@insteadofrefstepcounter{#1}%
\scr@ifundefinedorrelax{add#1tocentry}{%
@@ -4930,18 +4833,21 @@
\fi
\fi
% \end{macrocode}
-% Jetzt kommt der Kolumnentitel an die Reihe.
+% Set the mark for the running head. Here we have to do a one step expansion
+% of \cs{@currentheadentry}, because otherwise it would change with every
+% \cs{section}, \cs{subsection} \dots
% \begin{macrocode}
\csname #1mark\expandafter\endcsname\expandafter{\@currentheadentry}%
% \end{macrocode}
-% Und die Abstände in die andere Verzeichnisse.
-% \changes{v2.8g}{2001/07/18}{per \cs{float@addtolists} wird nun
-% auch ein vertikaler Abstand in Listen des \texttt{float}-Pakets
-% eingebaut}%^^A
-% \changes{v3.00}{2008/07/01}{jetzt auch Kapiteleinträge in andere
-% float-Verzeichnisse mit hyperref}%^^A
-% \changes{v3.28}{2019/11/19}{\cs{iftocfeature} replaced by
-% \cs{Iftocfeature}}%^^A
+% \changes{v2.8g}{2001/07/18}{support for \cs{float@addtolists}}
+% \changes{v3.28}{2019/11/19}{\cs{iftocfeature} replaced by \cs{Iftocfeature}}
+% Depending on feature \texttt{chapteratlist} we have to add a vertical space
+% to other directories. And for compatibility we also support the deprecated
+% \cs{float@addtolists} but not without warning.
+% \begin{description}
+% \item[ToDo:] Why do we add the gap here but also use \cs{addctontentsline}
+% in \cs{addchaptertocentry}? Is this a bug? Should this be standardized?
+% \end{description}
% \begin{macrocode}
\ifdim \@chapterlistsgap>\z@
\doforeachtocfile{%
@@ -4955,12 +4861,20 @@
}%
\fi
% \end{macrocode}
-% Jetzt kommt die eigentliche Überschrift. An dieser Stelle wird ab
-% Version~3.18 nicht mehr stur \cs{@makecshapterhead} verwendet, sondern eine
-% Anweisung, die vom Namen der Gliederungsüberschrift abhängig ist.
-% \changes{v3.18}{2015/05/22}{\cs{@makechapterhead} durch
-% \cs{@make\meta{Name}head} ersetzt}%^^A
+% \changes{v3.18}{2015/05/22}{\cs{@makechapterhead} replaced by
+% \cs{@make\meta{Name}head}}
+% \changes{v3.36}{2022/03/16}{warning about deprecated \cs{@makechapterhead}}
+% Setting the heading itself is more or less a call of \cs{@make\meta{command
+% name}head}.
+% \begin{description}
+% \item[ToDo:] Using \cs{scr@makechapterhead}\marg{command name} would be the
+% better solution. However in this case, every redefinition of
+% \cs{@makechapterhead} would be ignored. So currently we support such
+% deprecated redefinition of internal macro \cs{@makechapterhead} for
+% \cs{chapter}. But this will be changed in future.
+% \end{description}
% \begin{macrocode}
+ \scr@t@st@nd@w@rn@m@k@ch@pt@rh@@d{#1}%
\if@twocolumn
\if@at@twocolumn
\@nameuse{@make#1head}{#3}%
@@ -4971,36 +4885,84 @@
\@nameuse{@make#1head}{#3}%
\fi
% \end{macrocode}
-% Und das Ganze endet schließlich mit:
-% \changes{v3.18}{2015/05/21}{\cs{@afterheading} in jedem Fall}%^^A
+% \changes{v3.18}{2015/05/21}{always using \cs{@afterheading}}
+% And finally the end of every outline command.
% \begin{macrocode}
\@afterheading
}
% \end{macrocode}
-% \end{macro}%^^A \scr@@startchapter
+% \begin{macro}{\scr@t@st@nd@w@rn@m@k@ch@pt@rh@@d}
+% \changes{v3.36}{2022/03/16}{added}
+% The test and warning used inside \cs{scr@@startchapter}.
+% \begin{macrocode}
+\expandafter\ifnum\scr@v@is@ge{3.36}%
+ \newcommand*{\scr@t@st@nd@w@rn@m@k@ch@pt@rh@@d}[1]{%
+ \Ifstr{#1}{chapter}{%
+ \begingroup
+ \def\reserved@a{\scr@makechapterhead{chapter}}%
+ \ifx\@makechapterhead\reserved@a\else
+ \ClassWarningNoLine{\KOMAClassName}{%
+ Redefinition of \string\@makechapterhead\space detected.\MessageBreak
+ Note: KOMA-Script does use styles for commands like\MessageBreak
+ \string\chapter. Currently it internally still provides and\MessageBreak
+ uses \string\@makechapterhead, but a completely different\MessageBreak
+ definition compared to the standard classes.\MessageBreak
+ So redefining or using internal \string\@makechapterhead\MessageBreak
+ by users or package authors may already break\MessageBreak
+ KOMA-Script and will not work with a coming version,\MessageBreak
+ that will remove this deprecated code}%
+ \let\scr@t@st@nd@w@rn@m@k@ch@pt@rh@@d\@gobbble
+ \fi
+ \endgroup
+ }{}%
+ }
+\else
+ \let\scr@t@st@nd@w@rn@m@k@ch@pt@rh@@d\@gobble
+\fi
+% \end{macrocode}
+% \end{macro}^^A \scr@t@st@nd@w@rn@m@k@ch@pt@rh@@d
+% \end{macro}^^A \scr@@startchapter
%
% \begin{macro}{\scr@@startschapter}
-% \changes{v3.18}{2015/05/22}{neue Anweisung (intern)}
-% Diese Anweisung nimmt die Rolle des ursprüngliche \cs{@schapter} ein sie ist
-% sehr viel einfacher gestrickt als \cs{scr@@startchapter}.
+% \changes{v3.18}{2015/05/22}{added}
+% The macro
+% \begin{quote}
+% \cs{scr@@startschapter}\marg{chapter command name}\marg{chapter heading}
+% \end{quote}
+% is now part of the style \texttt{chapter}. However, the main parts
+% of the code are from the original definition of \cs{@schapter}. Therefore it
+% has the mandatory argument of a star variant of, i.e., \cs{chapter} but an
+% additional first argument.
% \begin{macrocode}
\newcommand*{\scr@@startschapter}[2]{%
\ExecuteDoHook{heading/branch/star/#1}%
% \end{macrocode}
-% Für Leute, die unbedingt nach der Sternversion noch ein \cs{addcontentsline}
-% anfügen wollen, muss hier ebenfalls der \textsf{hyperref}-Hook ausgeführt
-% werden. Allerdings passiert das hier entsprechend dem Vorgehen von
-% \textsf{hyperref} selbst in einer Gruppe, in der zusätzlich \cs{@mkboth} zu
-% \cs{@gobbletwo} gemacht wird, auch wenn ich absolut nicht versehe, was das
-% soll.
+% Some users don't learn to use \cs{addchapter} for not numbered parts with
+% entry to the table of contents but insist in using
+% \cs{addcontentsline}. Despite this should not be used, because at least
+% \cs{addchaptertocentry} should be used, we tolerate this by using our
+% \pkg{hyperref} hook.
+% \begin{description}
+% \item[ToDo:] I don't understand why \pkg{hyperref} uses a group here and
+% locally sets \cs{@mkboth} to \cs{@gobbletwo}. However, I've copied this.
+% \end{description}
% \begin{macrocode}
\begingroup
\let\@mkboth\@gobbletwo
\hy@insteadofrefstepcounter{#1}%
\endgroup
% \end{macrocode}
-% Dann wird die eigentliche Überschrift ausgegeben.
+% Setting the heading itself is more or less a call of \cs{@makes\meta{command
+% name}head}.
+% \begin{description}
+% \item[ToDo:] Using \cs{scr@makeschapterhead}\marg{command name} would be the
+% better solution. However in this case, every redefinition of
+% \cs{@makeschapterhead} would be ignored. So currently we support such
+% deprecated redefinition of internal macro \cs{@makeschapterhead} for
+% \cs{chapter}. But this will be changed in future.
+% \end{description}
% \begin{macrocode}
+ \scr@t@st@nd@w@rn@m@ks@ch@pt@rh@@d{#1}%
\if@twocolumn
\if@at@twocolumn
\@nameuse{@makes#1head}{#2}%
@@ -5011,40 +4973,61 @@
\@nameuse{@makes#1head}{#2}%
\fi
% \end{macrocode}
-% Und das Ganze endet schließlich mit:
-% \changes{v3.18}{2015/05/21}{\cs{@afterheading} in jedem Fall}%^^A
+% \changes{v3.18}{2015/05/21}{always using \cs{@afterheading}}
+% And finally the end of every outline command.
% \begin{macrocode}
\@afterheading
}
% \end{macrocode}
-% \end{macro}%^^A \scr@@startschapter
+% \begin{macro}{\scr@t@st@nd@w@rn@m@ks@ch@pt@rh@@d}
+% \changes{v3.36}{2022/03/16}{added}
+% The test and warning used inside \cs{scr@@startschapter}.
+% \begin{macrocode}
+\expandafter\ifnum\scr@v@is@ge{3.36}%
+ \newcommand*{\scr@t@st@nd@w@rn@m@ks@ch@pt@rh@@d}[1]{%
+ \Ifstr{#1}{chapter}{%
+ \begingroup
+ \def\reserved@a{\scr@makeschapterhead{chapter}}%
+ \ifx\@makeschapterhead\reserved@a\else
+ \ClassWarningNoLine{\KOMAClassName}{%
+ Redefinition of \string\@makeschapterhead\space detected.\MessageBreak
+ Note: KOMA-Script does use styles for commands like\MessageBreak
+ \string\chapter. Currently it internally still provides and\MessageBreak
+ uses \string\@makeschapterhead, but a completely different\MessageBreak
+ definition compared to the standard classes.\MessageBreak
+ So redefining or using internal \string\@makeschapterhead\MessageBreak
+ by users or package authors may already break\MessageBreak
+ KOMA-Script and will not work with a coming version,\MessageBreak
+ that will remove this deprecated code}%
+ \let\scr@t@st@nd@w@rn@m@ks@ch@pt@rh@@d\@gobble
+ \fi
+ \endgroup
+ }{}%
+ }
+\else
+ \let\scr@t@st@nd@w@rn@m@ks@ch@pt@rh@@d\@gobble
+\fi
+% \end{macrocode}
+% \end{macro}^^A \scr@t@st@nd@w@rn@m@ks@ch@pt@rh@@d
+% \end{macro}^^A \scr@@startschapter
%
-%% \begin{macro}{\if@at@twocolumn}
-% \changes{v2.7b}{2001/01/05}{neu (intern)}%^^A
+%% \begin{macro}{\@at@twocolumntrue,\@at@twocolumnfalse,\if@at@twocolumn}
+% \changes{v2.7b}{2001/01/05}{added}
% \begin{macro}{\scr@topnewpage}
-% \changes{v2.7b}{2001/01/05}{neu (intern)}%^^A
-% \changes{v2.8q}{2001/11/27}{fehlende Klammern ergänzt}%^^A
+% \changes{v2.7b}{2001/01/05}{added}
+% \changes{v2.8q}{2001/11/27}{braces fixed}
% \begin{macro}{\@topnewpage}
-% \changes{v2.7b}{2001/01/05}{neu (\LaTeX{} intern)}%^^A
-% \changes{v2.7g}{2001/04/17}{vergessenes \cs{long} ergänzt}%^^A
-% \changes{v3.01}{2008/11/13}{Verwendung von
-% \cs{scr@float@addtolists@warning} (aus \texttt{scrkliof.dtx})}%^^A
-% Interessant ist dabei die Erweiterung, daß jedes Kapitel mit einer
-% Präambel versehen werden kann. Diese wird im zweispaltigen Satz wie
-% die Überschrift selbst einspaltig gesetzt. Intern wird dies für
-% die Preambel des Index und der Bibliography verwendet. Dabei
-% entsteht aber wiederum das Problem, dass der Indexkopf innerhalb von
-% \cs{twocolumn} ausgegeben wird andererseits aber innerhalb von
-% \cs{chapter} das Makro \cs{@topnewpage} verwendet wird. Damit würde
-% dann also \cs{@topnewpage} innerhalb von \cs{@topnewpage}
-% aufgerufen. Das ist jedoch nicht erlaubt. Als muss der Aufruf von
-% \cs{@topnewpage} in \cs{@chapter} und \cs{@schapter} verhindert
-% werden, wenn wir uns bereits in \cs{@topnewpage} befinden. Eine
-% Möglichkeit dafür wäre, einen Schalter in den Index-Kopf
-% einzubauen. Ich wähle hingegen die Methode, \cs{@topnewpage}
-% entsprechend umzudefinieren. Damit kann dann auch der Anwender
-% \cs{@chapter} innerhalb des optionalen Arguments von \cs{twocolumn}
-% verwenden. Ein Schalter wird allerdings trotzdem gebraucht.
+% \changes{v2.7b}{2001/01/05}{added}
+% \changes{v2.7g}{2001/04/17}{missing \cs{long} added}
+% In the code above we use \cs{if@at@twocolumn} to detect, if we already
+% inside the optional argument of \cs{twocolumn}. A clean definition of this
+% feature would redefine \LaTeX{} command \cs{twocolumn}. Here we use the ugly
+% hack to redefine the internal macro \cs{@topnewpage} of the \LaTeX{} kernel
+% instead. This macro is used to print the optional argument. So we can add
+% switching on and of the boolean switch before and after it. With this,
+% packages can simply use chapter commands also inside the optional argument
+% of \cs{twocolumn} instead of need to use an internal command like
+% \cs{@makechapterhead}.
% \begin{macrocode}
\newif\if@at@twocolumn
\newcommand*\scr@topnewpage{}
@@ -5053,67 +5036,46 @@
\@at@twocolumntrue\scr@topnewpage[{#1}]\@at@twocolumnfalse
}
% \end{macrocode}
-% \end{macro}%^^A \@topnewpage
-% \end{macro}%^^A \scr@topnewpage
-% \end{macro}%^^A \if@at@twocolumn
+% \end{macro}^^A \@topnewpage
+% \end{macro}^^A \scr@topnewpage
+% \end{macro}^^A \if@at@twocolumn
%
% \begin{macro}{\scr@makechapterhead}
-% \changes{v3.18}{2015/05/22}{neue Anweisung (intern)}
-% Diese Anweisung nimmt die Rolle des ursprüngliche \cs{@makechapterhead}
-% ein. Mit dem neuen Mechanismus könnte man auf diesen zusätzlichen Schritt
-% verzichten. Aus Gründen der Kompatibilität wurde er aber übernommen. Daher
-% übernimmt sie auch die ChangeLog-Einträge der alten Anweisung.
-% \changes{v2.7b}{2001/01/05}{Kapitel können grundsätzlich mit einer
-% Präambel versehen werden}%^^A
-% \changes{v2.8p}{2001/09/25}{es gibt verschiedene Arten von Präambeln}%^^A
-% \changes{v3.15}{2014/12/10}{\cs{nobreak} am Ende entfernt}%^^A
+% \changes{v2.7b}{2001/01/05}{support for chapter preamble}
+% \changes{v2.8p}{2001/09/25}{support for different kinds of preambles}
+% \changes{v3.15}{2014/12/10}{\cs{nobreak} removed}
+% \changes{v3.18}{2015/05/22}{added}
+% \begin{macro}{\scr@@makechapterhead}
+% \changes{v3.18}{2015/05/22}{added}
+% \changes{v2.8q}{2002/04/18}{\cs{raggedsection} also for the prefix}
+% \changes{v2.9p}{2003/06/28}{setting \cs{parfillskip} to \cs{fill}}
+% \changes{v2.96a}{2006/12/02}{distance after the prefix line only if prefix line}
+% \changes{v2.97b}{2007/03/09}{\cs{endgraf} fixed}
+% \changes{v3.15}{2014/11/20}{re-implementation}
+% \changes{v3.15}{2014/12/09}{\cs{raggedchapter} replaced by \cs{raggedsection}}
+% \changes{v3.17}{2015/04/03}{using \cs{usefontofkomafont} for initial font
+% changed}
+% Macros
+% \begin{quote}\raggedright
+% \cs{scr@makechapterhead}\marg{chapter command name}\marg{heading}\\
+% \cs{scr@@makechapterhead}\marg{chapter command name}\marg{heading}
+% \end{quote}
+% are used inside the definition of style \texttt{chapter} and replace
+% \cs{@makechapterhead} resp. \cs{@@makechapterhead} there. So they have one
+% more argument than \cs{@makechapterhead} of the standard classes.
% \begin{macrocode}
\newcommand*{\scr@makechapterhead}[2]{%
\use@chapter@o@preamble{#1}%
\@nameuse{@@make#1head}{#2}%
\use@preamble{#1@u}%
}
-% \end{macrocode}
-% \end{macro}%^^A \scr@makechapterhead
-%
-% \begin{macro}{\scr@makeschapterhead}
-% \changes{v3.18}{2015/05/22}{neue Anweisung (intern)}
-% Diese Anweisung nimmt die Rolle des ursprüngliche \cs{@makeschapterhead}
-% ein. Mit dem neuen Mechanismus könnte man auf diesen zusätzlichen Schritt
-% verzichten. Aus Gründen der Kompatibilität wurde er aber übernommen. Daher
-% übernimmt sie auch die ChangeLog-Einträge der alten Anweisung.
-% \begin{macrocode}
-\newcommand*{\scr@makeschapterhead}[2]{%
- \use@chapter@o@preamble{#1}%
- \@nameuse{@@makes#1head}{#2}%
- \use@preamble{#1@u}%
-}
-% \end{macrocode}
-% \end{macro}%^^A \scr@makeschapterhead
-%
-% \begin{macro}{\scr@@makechapterhead}
-% \changes{v3.18}{2015/05/22}{neue Anweisung (intern)}
-% Diese Anweisung nimmt die Rolle des ursprüngliche \cs{@@makechapterhead}
-% ein. Daher übernimmt sie auch die ChangeLog-Einträge der alten Anweisung.
-% \changes{v2.8q}{2002/04/18}{\cs{raggedsection} wird bei Option
-% \texttt{chapterprefix} auch auf den Präfix angewendet}%^^A
-% \changes{v2.9p}{2003/06/28}{\cs{parfillskip} auf \cs{fill} gesetzt}%^^A
-% \changes{v2.96a}{2006/12/02}{Abstand nach der Präfixzeile nur, wenn eines
-% Präfixzeile ausgegeben wurde}%^^A
-% \changes{v2.97b}{2007/03/09}{\cs{endgraf} korrigiert}%^^A
-% \changes{v3.15}{2014/11/20}{Generalumbau}%^^A
-% \changes{v3.15}{2014/12/09}{\cs{raggedchapter} ersetzt
-% \cs{raggedsection}}%^^A
-% \changes{v3.17}{2015/04/03}{Verwendung von \cs{usefontofkomafont} für die
-% initiale Fontumstellung}%^^A
-% \begin{macrocode}
\newcommand*{\scr@@makechapterhead}[2]{%
% \end{macrocode}
-% Der Absolutwert des Abstandes davor wird eingefügt.
-% \changes{v3.22}{2016/12/21}{\cs{@afterindentrue} wird bei positivem
-% \texttt{beforeskip} gesetzt}%^^A
-% \changes{v3.26}{2018/09/18}{Beachtung von Einstellung
-% \texttt{afterindent}}%^^A
+% \changes{v3.22}{2016/12/21}{\cs{@afterindentrue} if \opt{beforeskip} is
+% positive}
+% \changes{v3.26}{2018/09/18}{using \opt{afterindent}}
+% Depending on \opt{afterindent} we set \cs{if@afterindent} and set the
+% initial vertical skip using \cs{@tempskipa} and \cs{chapterheadstartvskip}.
% \begin{macrocode}
\@tempskipa=\glueexpr \csname scr@#1@beforeskip\endcsname\relax\relax
\csname scr@#1@afterindent\endcsname
@@ -5124,31 +5086,25 @@
}%
\chapterheadstartvskip
% \end{macrocode}
-% Dann die eigentliche Überschrift innerhalb einer Gruppe.
-% \changes{v3.20}{2015/12/23}{\cs{parfillskip} auf \texttt{\cs{z@} plus
-% 1fil} gesetzt}%^^A
-% \changes{v3.27}{2019/02/02}{Setzen von \cs{parindent} und \cs{parfillskip}
-% verschoben}%^^A
+% \changes{v3.19}{2015/08/02}{using \cs{chapterlinesformat} and
+% \cs{chapterlineswithprefixformat}}
+% \changes{v3.19}{2015/08/02}{using font element \fnt{disposition} instead of
+% \cs{sectfont}}
+% \changes{v3.19a}{2015/10/03}{missing local definition of \cs{IfUseNumber}
+% added}
+% \changes{v3.20}{2015/12/23}{setting \cs{parfillskip} to \texttt{\cs{z@} plus
+% 1fil}}
+% \changes{v3.27}{2019/02/02}{setting of \cs{parindent} and \cs{parfillskip}
+% moved}
+% \changes{v3.27}{2019/02/02}{\cs{ExecuteDoHook} added}
+% \changes{v3.28}{2019/11/19}{\cs{ifnumbered} renamed to
+% \cs{Ifnumbered}}
+% For the heading itself a group is used. Using group braces instead of
+% \cs{begingroup} makes it possible to do a very ugly hack inside a
+% redefinition of \cs{chapterheadstartvskip}. Nevertheless, such hacks are not
+% recommended.
% \begin{macrocode}
{%
-% \end{macrocode}
-% \changes{v3.19}{2015/08/02}{Verwendung von \cs{chapterlinesformat} und
-% \cs{chapterlineswithprefixformat}}%^^A
-% \changes{v3.19}{2015/08/02}{Verwendung von Element \texttt{disposition} an
-% Stelle von Befehl \cs{sectfont}}%^^A
-% \changes{v3.19a}{2015/10/03}{Bug durch vergessene Definition von
-% \cs{IfUseNumber} behoben}%^^A
-% \changes{v3.27}{2019/02/02}{\cs{ExecuteDoHook} eingefügt}%^^A
-% \changes{v3.28}{2019/11/19}{\cs{ifnumbered} umbenannt in
-% \cs{Ifnumbered}}%^^A
-% Ab Version~3.19 wurde der Code weitgehend umgebaut, um die Befehle
-% \cs{chapterlinesformat} für die hängende Version und
-% \cs{chapterlinesandprefixformat} für die Version mit Präfixzeile zu
-% verwenden. Dadurch entfällt dann auch die Verwendung von
-% \cs{usefontofkomafont}. Ich bin mir bewusst, dass dadurch diverse Hacks
-% bezüglich der Kapitelüberschriften nicht mehr funktionieren. Dafür kann man
-% diese Hacks nun durch saubere Lösungen ersetzen.
-% \begin{macrocode}
\def\IfUseNumber{\Ifnumbered{#1}}%
%<book> \if@mainmatter\else\let\IfUseNumber\@secondoftwo\fi
\ExecuteDoHook{heading/begingroup/#1}%
@@ -5194,38 +5150,53 @@
}%
\nobreak\par\nobreak
% \end{macrocode}
-% Zum Schluss der Absolutwert des Abstandes dahinter.
-% \changes{v3.26}{2018/09/20}{Betragsbildung entfernt}%^^A
+% \changes{v3.26}{2018/09/20}{no absolute value}
+% Last but not least the final skip.
+% \begin{description}
+% \item[Note:] \cs{@afterheading} will be added by \cs{scr@@startchapter}.
+% \end{description}
% \begin{macrocode}
\@tempskipa=\glueexpr \csname scr@#1@afterskip\endcsname\relax\relax
\chapterheadendvskip
}
% \end{macrocode}
-% \end{macro}%^^A \scr@@makechapterhead
+% \end{macro}^^A \scr@makechapterhead
+% \end{macro}^^A \scr@@makechapterhead
%
+% \begin{macro}{\scr@makeschapterhead}
+% \changes{v3.18}{2015/05/22}{added}
% \begin{macro}{\scr@@makeschapterhead}
-% \changes{v3.18}{2015/05/22}{neue Anweisung (intern)}
-% Diese Anweisung nimmt die Rolle des ursprüngliche \cs{@@makechapterhead}
-% ein. Sie ist um einiges einfacher als \cs{scr@@makechapterhead} orientiert
-% sich aber prinzipiell daran.
-% \changes{v2.9p}{2003/06/28}{\cs{parfillskip} auf \cs{fill} gesetzt}%^^A
-% \changes{v2.9q}{2004/03/24}{Klammerung an \cs{@@makechapterhead}%^^A
-% angepasst}%^^A
-% \changes{v3.15}{2014/12/09}{\cs{raggedchapter} ersetzt
-% \cs{raggedsection}}%^^A
-% \changes{v3.19}{2015/08/02}{an die Änderungen bei \cs{scr@@makechapterhead}
-% angepasst}%^^A
-% \changes{v3.20}{2015/12/23}{\cs{parfillskip} auf \texttt{\cs{z@} plus
-% 1fil} gesetzt}%^^A
-% \changes{v3.22}{2016/12/21}{\cs{@afterindentrue} wird bei positivem
-% \texttt{beforeskip} gesetzt}%^^A
-% \changes{v3.25}{2017/09/07}{\cs{IfUseNumber} korrigiert}%^^A
-% \changes{v3.26}{2018/09/18}{Beachtung von Einstellung
-% \texttt{afterindent}}%^^A
-% \changes{v3.26}{2018/09/20}{Betragsbildung für \texttt{afterskip}
-% entfernt}%^^A
+% \changes{v2.9p}{2003/06/28}{to \cs{parfillskip} to \cs{fill}}
+% \changes{v2.9q}{2004/03/24}{same braces like \cs{@@makechapterhead}}
+% \changes{v3.15}{2014/12/09}{\cs{raggedchapter} replaced by
+% \cs{raggedsection}}
+% \changes{v3.18}{2015/05/22}{added}
+% \changes{v3.19}{2015/08/02}{same changes like \cs{scr@@makechapterhead}}
+% \changes{v3.20}{2015/12/23}{setting \cs{parfillskip} to \texttt{\cs{z@} plus
+% 1fil}}
+% \changes{v3.25}{2017/09/07}{\cs{IfUseNumber} fixed}
+% \changes{v3.26}{2018/09/20}{no absolute of \opt{afterskip}}
+% Macros
+% \begin{quote}\raggedright
+% \cs{scr@makeschapterhead}\marg{chapter command name}\marg{heading}\\
+% \cs{scr@@makeschapterhead}\marg{chapter command name}\marg{heading}
+% \end{quote}
+% are used inside the definition of style \texttt{chapter} and replace
+% \cs{@makeschapterhead} resp. \cs{@@makeschapterhead} there. So they have one
+% more argument than \cs{@makeschapterhead} of the standard classes.
% \begin{macrocode}
+\newcommand*{\scr@makeschapterhead}[2]{%
+ \use@chapter@o@preamble{#1}%
+ \@nameuse{@@makes#1head}{#2}%
+ \use@preamble{#1@u}%
+}
\newcommand*{\scr@@makeschapterhead}[2]{%
+% \end{macrocode}
+% \changes{v3.22}{2016/12/21}{\cs{@afterindentrue} if positive
+% \opt{beforeskip}}
+% \changes{v3.26}{2018/09/18}{supporting \opt{afterindent}}
+% This is a simplified version of \cs{scr@@makechapterhead}.
+% \begin{macrocode}
\@tempskipa=\glueexpr \csname scr@#1@beforeskip\endcsname\relax\relax
\csname scr@#1@afterindent\endcsname
{\@afterindenttrue}{\@afterindentfalse}{%
@@ -5264,29 +5235,22 @@
\chapterheadendvskip
}
% \end{macrocode}
-% \end{macro}%^^A \scr@@makeschapterhead
-%
-% \begin{macro}{\chapterlinesformat}
-% \changes{v3.19}{2015/08/02}{neue Anweisung}
-% \begin{macro}{\chapterlineswithprefixformat}
-% \changes{v3.19}{2015/08/02}{neue Anweisung}
-% Diese Anweisung definiert das Format der eigentlichen Überschriften im Stil
-% \texttt{chapter}, wenn mit Überschriftenzeilen gearbeitet
-% wird. Fonteinstellungen sind zu diesem Zeitpunkt bereits erfolgt. Die
-% Argumente sind:
-% \begin{description}
-% \item[\meta{Befehlsname} --] der Name der Gliederungsebene, normalerweise
-% \texttt{chapter}.
-% \item[\meta{Gliederungsnummer} --] die bereits fertig formatierte
-% Gliederungsnummer (bei \cs{chapterlineswithprefixformat} einschließlich
-% des nachfolgenden vertikalen Abstands) oder leer, falls keine
-% Gliederungsnummer auszugeben ist.
-% \item[\meta{Text} --] der Text der Überschrift.
-% \end{description}
-% Der Anwender ist selbst verantwortlich, dass innerhalb der Überschrift kein
-% Seitenumbruch erfolgen kann. Nach der Überschrift wird jedoch zwangsweise
-% ein \cs{@@par} ausgeführt, so dass sichergestellt ist, dass mit einem
-% internen Absatz abgeschlossen wird.
+% \end{macro}^^A \scr@@makeschapterhead
+% \end{macro}^^A \scr@makeschapterhead
+%
+% \begin{command}{\chapterlinesformat,\chapterlineswithprefixformat}
+% \changes{v3.19}{2015/08/02}{added}
+% Commands
+% \begin{quote}\raggedright
+% \cs{chapterlinesformat}\marg{command name}\marg{number}\marg{text}\\
+% \cs{chapterlineswithprefixformat}\marg{command name}\marg{number}\marg{text}
+% \end{quote}
+% are used to print a chapter heading either a free standing one or a free
+% stranding one with prefix line. \meta{number} is the completely formatted
+% prefix line inclusive the vertical distance below. The \meta{text} is the
+% text of the heading also formatted and with final \cs{@@par}. But if the
+% user used more paragraphs than this is final one, the user is responsible to
+% prevent page breaks!
% \begin{macrocode}
\newcommand{\chapterlinesformat}[3]{%
\@hangfrom{#2}{#3}%
@@ -5295,20 +5259,16 @@
#2#3%
}
% \end{macrocode}
-% \end{macro}%^^A \chapterlineswithprefixformat
-% \end{macro}%^^A \chapterlinesformat
+% \end{command}^^A \chapterlinesformat,\chapterlineswithprefixformat
%
% \begin{macro}{\use@chapter@o@preamble}
-% \changes{v3.15}{2014/12/08}{Anpassung an geänderte Abstandsbehandlung}%^^A
-% \changes{v3.15a}{2015/02/02}{Korrektur, zur Verhinderung falscher
-% \texttt{overfull \cs{vbox}} Meldungen}%^^A
-% \changes{v3.18}{2015/05/20}{Verwendung befehlsabhängiger Abstände und
-% Warnungen}%^^A
-% \changes{v3.18}{2015/05/22}{Bekommt ein Argument und setzt die Prämabel
-% der Anweisung nicht des Stils}%^^A
-% Das Makro wird benötigt, weil das Setzen der oberen Präambel etwas
-% mehr Aufwand bedeutet. Die Anweisung spart Platz, da sie zweimal
-% verwendet wird.
+% \changes{v3.15}{2014/12/08}{distances adapted}
+% \changes{v3.15a}{2015/02/02}{avoiding \texttt{overfull \cs{vbox}}}
+% \changes{v3.18}{2015/05/20}{using command depending distances and warnings}
+% \changes{v3.18}{2015/05/22}{has an argument and prints the preamble of the
+% command instead of the style}
+% Used by \cs{scr@makechapterhead} and \cs{scr@makeschapterhead} to set the
+% preamble above chapter headings.
% \begin{macrocode}
\newcommand*{\use@chapter@o@preamble}[1]{%
{%
@@ -5362,22 +5322,32 @@
}%
}
% \end{macrocode}
-% \end{macro}%^^A \use@chapter@o@preamble
-% \end{macro}%^^A \scr@startchapter
+% \end{macro}^^A \use@chapter@o@preamble
+% \end{macro}^^A \scr@startchapter
%
-% \begin{macro}{\addchaptertocentry}
-% \changes{v3.08}{2010/11/01}{Neu}%^^A
-% \changes{v3.12}{2013/09/24}{Behandlung von \cs{if@chaptertolists} hier}%^^A
-% \changes{v3.12}{2013/09/24}{Verwendung von \cs{addxcontentsline}}%^^A
+% \begin{command}{\addchaptertocentry}
+% \changes{v3.08}{2010/11/01}{added}
+% \changes{v3.12}{2013/09/24}{support for \cs{if@chaptertolists}}
+% \changes{v3.12}{2013/09/24}{using\cs{addxcontentsline}}
% \changes{v3.28}{2019/11/19}{\cs{iftocfeature} replaced by
-% \cs{Iftocfeature}}%^^A
-% Seit Version~3.08 wird der Eintrag nicht direkt innerhalb von \cs{chapter}
-% per \cs{addcontentsline} erzeugt, sondern indirekt über diese Anweisung. Das
-% erste Argument ist dabei die (formatierte) Nummer bzw. bei nicht
-% nummerierten Kapiteln leer. Das zweite Argument ist der Überschriftstext für
-% das Verzeichnis. Durch diesen indirekten Weg, kann die Anweisung einfach
-% umdefiniert werden. Verwendet wird hier die Standardanweisung für
-% Inhaltsverzeichniseinträge, die in \texttt{scrkliof.dtx} definiert ist:
+% \cs{Iftocfeature}}
+% We do not use \cs{addcontentsline} directly for the entries to the table of
+% contents. Using
+% \begin{quote}
+% \cs{addchaptertocentry}\marg{number}\marg{text}
+% \end{quote}
+% allows easy manipulation of such entries and additional actions. If the
+% \meta{number} is completely empty no number should be used. Internally the
+% generic \cs{addtocentrydefault} it used, which uses \cs{nonumberline}
+% instead of \cs{numberline} in this case. See \file{scrkernel-listsof.dtx}
+% for more information.
+% \begin{description}
+% \item[ToDo:] Here we also do the entries to other directories. But we have
+% also code for this in \cs{scr@@startchapter} at least for the vertical
+% space. Shouldn't we combine both places to one place? And shouldn't this
+% be done here only, because of handling of user calls of
+% \cs{addchaptertocentry}?
+% \end{description}
% \begin{macrocode}
\newcommand*{\addchaptertocentry}[2]{%
\addtocentrydefault{chapter}{#1}{#2}%
@@ -5391,130 +5361,67 @@
\fi
}
% \end{macrocode}
-% \end{macro}%^^A \addchaptertocentry
-%
-% \begin{macro}{\@chapter}
-% \changes{v3.18}{2015/05/22}{siehe \cs{scr@dsc@def@style@chapter@command}
-% und \cs{scr@@startchapter}}%^^A
-% \begin{macro}{\@makechapterhead}
-% \changes{v3.18}{2015/05/22}{siehe \cs{scr@dsc@def@style@chapter@command}
-% und \cs{scr@makechapterhead}}%^^A
-% \begin{macro}{\@@makechapterhead}
-% \changes{v3.18}{2015/05/22}{siehe \cs{scr@dsc@def@style@chapter@command}
-% und \cs{scr@@makechapterhead}}%^^A
-% \begin{macro}{\@schapter}
-% \changes{v3.18}{2015/05/22}{siehe \cs{scr@dsc@def@style@chapter@command}
-% und \cs{scr@@startschapter}}%^^A
-% \begin{macro}{\@makeschapterhead}
-% \changes{v3.18}{2015/05/22}{siehe \cs{scr@dsc@def@style@chapter@command}
-% und \cs{scr@makeschapterhead}}%^^A
-% \begin{macro}{\@@makeschapterhead}
-% \changes{v3.18}{2015/05/22}{siehe \cs{scr@dsc@def@style@chapter@command}
-% und \cs{scr@@makeschapterhead}}%^^A
-% \begin{macro}{\setchapterpreamble}
-% \changes{v2.7b}{2001/01/05}{neu}%^^A
-% \changes{v3.18}{2015/05/22}{siehe \cs{scr@dsc@def@style@chapter@command}}%^^A
-% \begin{macro}{\chapter@u@preamble}
-% \changes{v2.8p}{2001/09/25}{neu (intern)}%^^A
-% \changes{v3.18}{2015/05/22}{siehe \cs{scr@dsc@def@style@chapter@command}}%^^A
-% \begin{macro}{\chapter@o@preamble}
-% \changes{v2.8p}{2001/09/25}{neu (intern)}%^^A
-% \changes{v3.18}{2015/05/22}{siehe \cs{scr@dsc@def@style@chapter@command}}%^^A
-% All diese Anweisungen wurden in früheren Versionen von \KOMAScript{}
-% explizit definiert. Nun werden sie nur noch indirekt über
-% \cs{scr@dsc@def@style@chapter@command} definiert und verwenden dabei andere
-% interne Anweisungen als früher. Deshalb funktionieren ggf. das Patchen mit
-% \textsf{etoolbox}, \textsf{xpatch} und ähnlichen Paketen nicht mehr. Das ist
-% der Preis für die neuen Möglichkeiten.
-% \end{macro}%^^A \chapter@o@preamble
-% \end{macro}%^^A \chapter@u@preamble
-% \end{macro}%^^A \setchapterpreamble
-% \end{macro}%^^A \@@makeschapterhead
-% \end{macro}%^^A \@makeschapterhead
-% \end{macro}%^^A \@schapter
-% \end{macro}%^^A \@@makechapterhead
-% \end{macro}%^^A \@makechapterhead
-% \end{macro}%^^A \@chapter
-%
-% \begin{macro}{\addchap}
-% \changes{v2.0e}{1994/08/10}{\cs{sectdef} durch \cs{secdef} ersetzt}%^^A
-% \changes{v2.0e}{1994/08/10}{\cs{addcontensline} durch
-% \cs{addcontentsline} ersetzt}%^^A
-% \changes{v2.0e}{1994/08/10}{\cs{@makechapterhead} durch
-% \cs{@makeschapterhead} ersetzt}%^^A
-% \changes{v2.0e}{1994/08/10}{\cs{afterheadings} durch
-% \cs{@afterheading} ersetzt}%^^A
-% \changes{v2.1a}{1994/10/29}{Argument von \cs{chaptermark}%^^A
-% entfernt bei \textsf{scrbook}}%^^A
-% \changes{v2.0e}{1994/10/12}{mehrfach \cs{markboth} durch
-% \cs{sectionmark} ersetzt}%^^A
-% \changes{v2.2b}{1995/03/20}{\cs{chaptermark} durch \cs{@mkboth}
-% ersetzt}%^^A
-% \changes{v2.8d}{2001/07/05}{\cs{chapterpagestyle} statt
-% \texttt{plain}}%^^A
-% \changes{v3.00}{2008/07/01}{jetzt auch Kapiteleinträge in andere
-% float-Verzeichnisse mit hyperref}%^^A
-% \changes{v3.01}{2008/11/13}{Verwendung von
-% \cs{scr@float@addtolists@warning} (aus \texttt{scrkliof.dtx})}%^^A
-% \changes{v3.08}{2010/11/01}{Verwendung von \cs{addchaptertocentry}}%^^A
-% \changes{v3.10}{2011/08/30}{Integration der Erweiterung für das optionale
-% Argument der Gliederungsbefehle}%^^A
-% \changes{v3.13a}{2014/09/11}{Verwendung von \cs{SecDef}}%^^A
-% \changes{v3.18}{2015/05/22}{Komplett neu definiert}%^^A
-% \KOMAScript{} bietet in \textsf{scrbook} und \textsf{scrreprt} den
-% zusätzlichen Gliederungsbefehl \cs{addchap}. Es handelt sich dabei
-% um einen mit \cs{chapter*} vergleichbaren Befehl, bei dem jedoch der
-% Kolumnentitel korrigiert wird und ein Eintrag ins Inhaltsverzeichnis
-% erfolgt (nicht in der Stern-Variante).
-%
-% Die Definition von \cs{addcap} sah bis zu Version 2.7 so aus:
-% \begin{verbatim}
-% \newcommand\addchap{\if@openright\cleardoublepage\else\clearpage\fi
-% \thispagestyle{plain}%
-% \global\@topnum\z@
-% \@afterindentfalse
-% \secdef\@addchap\@saddchap}
-% \def\@addchap[#1]#2{\typeout{#2}
-% \addcontentsline{toc}{chapter}{#1}
-% \if@twoside\@mkboth{#1}{}\else\@mkboth{}{#1}\fi
-% \addtocontents{lof}{\protect\addvspace{10\p@}}%
-% \addtocontents{lot}{\protect\addvspace{10\p@}}%
-% \if@twocolumn
-% \@topnewpage[\@makeschapterhead{#2}]%
-% \else
-% \@makeschapterhead{#2}%
-% \@afterheading
-% \fi}
-% \def\@saddchap#1{\@mkboth{}{}
-% \if@twocolumn
-% \@topnewpage[\@makeschapterhead{#1}]%
-% \else
-% \@makeschapterhead{#1}%
-% \@afterheading
-% \fi}
-% \end{verbatim}\vspace{-\baselineskip}
-% Dies führte jedoch zu Problemen im Zusammenhang mit
-% \textsf{hyperref}, da hierbei keine korrekten Links erzeugt
-% werden. Mit dem \texttt{hypertex}-Treiber von \textsf{hyperref}
-% bis Version 6.71a werden auch in der neuen Implementierung keine
-% korrekten Links erzeugt. Dies ist jedoch ein Bug in jenem
-% Treiber. Mit neuen Versionen tritt das Problem nicht mehr auf.
-% Deshalb wurde der Code wie folgt vereinfacht. Von wesentlicher
-% Bedeutung ist dabei der Aufruf von \cs{chapter*}, da in
-% \texttt{hpdftex.def} das interne Makro \cs{@schapter} so umdefiniert
-% wird, dass ein korrekter Link erzeugt wird.
+% \end{command}^^A \addchaptertocentry
+%
+% \begin{macro}{\@chapter,\@makechapterhead,\@@makechapterhead,
+% \@schapter,\@makeschapterhead,\@@makeschapterhead}
+% \changes{v3.18}{2015/05/22}{indirect by \cs{DeclareSectionCommand}}
+% \begin{command}{\setchapterpreamble}
+% \changes{v2.7b}{2001/01/05}{added}
+% \changes{v3.18}{2015/05/22}{indirect by \cs{DeclareSectionCommand}}
+% \begin{macro}{\chapter@u@preamble,\chapter@o@preamble}
+% \changes{v2.8p}{2001/09/25}{added}
+% \changes{v3.18}{2015/05/22}{indirect by \cs{DeclareSectionCommand}}
+% All these commands and macros are not defined explicitly but by using
+% \cs{DeclareSectionCommand} later. See also
+% \cs{scr@dsc@def@style@chapter@command} and \cs{setchapterpreamble}.
+% \end{macro}^^A \chapter@u@preamble,\chapter@o@preamble
+% \end{command}^^A \setchapterpreamble
+% \end{macro}^^A \@chapter … \@@makeschapterhead
+%
+% \begin{command}{\addchap}
+% \changes{v2.0e}{1994/08/10}{\cs{sectdef} replaced by h \cs{secdef}}
+% \changes{v2.0e}{1994/08/10}{\cs{addcontensline} replaced by
+% \cs{addcontentsline}}
+% \changes{v2.0e}{1994/08/10}{\cs{@makechapterhead} replaced by
+% \cs{@makeschapterhead}}
+% \changes{v2.0e}{1994/08/10}{\cs{afterheadings} replaced by
+% \cs{@afterheading}}
+% \changes{v2.1a}{1994/10/29}{argument of \cs{chaptermark} removed from
+% \cls*{scrbook}}
+% \changes{v2.0e}{1994/10/12}{several \cs{markboth} replaced by
+% \cs{sectionmark}}
+% \changes{v2.2b}{1995/03/20}{several \cs{chaptermark} replaced by
+% \cs{@mkboth}}
+% \changes{v2.8d}{2001/07/05}{using \cs{chapterpagestyle}}
+% \changes{v3.08}{2010/11/01}{using \cs{addchaptertocentry}}
+% \changes{v3.10}{2011/08/30}{extended optional argument}
+% \changes{v3.13a}{2014/09/11}{using \cs{SecDef}}
+% \changes{v3.18}{2015/05/22}{redefinition}
% \begin{macro}{\@addchap}
-% \changes{v3.12}{2013/02/26}{Verwendung von \cs{addchapmark}}%^^A
-% \changes{v3.17}{2015/04/20}{\cs{scr@ds@head} in \cs{addchapmark}
-% expandieren}%^^A
-% \changes{v3.18}{2015/05/22}{Komplett neu definiert}%^^A
+% \changes{v3.12}{2013/02/26}{using \cs{addchapmark}}
+% \changes{v3.17}{2015/04/20}{expanding \cs{scr@ds@head} in \cs{addchapmark}}
+% \changes{v3.18}{2015/05/22}{redefinition}
% \begin{macro}{\@saddchap}
-% \changes{v3.12}{2013/02/26}{Verwendung von \cs{addchapmark}}%^^A
-% \changes{v3.18}{2015/05/22}{Komplett neu definiert}%^^A
-% Seit \KOMAScript~3.18 wurden die Definitionen noch einmal deutlich
-% vereinfacht. Deshalb wird nun auch nur noch für \cs{addchap*} die neue
-% Anweisung \cs{addchapmark} benötigt. Bei \cs{addchap} geht es hingegen
-% einfach über \cs{chaptermark} innerhalb von \cs{chapter}.
+% \changes{v3.12}{2013/02/26}{using \cs{addchapmark}}
+% \changes{v3.18}{2015/05/22}{redefinition}
+% Since \KOMAScript{} 3.18 using
+% \begin{quote}
+% \cs{addchap}\oarg{head or ToC entry}\marg{heading}
+% \end{quote}
+% is very similar to
+% |\chapter[nonumber=true,…]{…}| but also works if the extended optional
+% argument is not activated. And
+% \begin{quote}
+% \cs{addchap*}\marg{heading}
+% \end{quote}
+% is just a \cs{chapter*}\marg{heading} with additional |\addchapmark{}| to
+% empty the running head.
+% \begin{description}
+% \item[Note:] Because of simply manipulating \cnt{secnumdepth} this should
+% also work with packages like \pkg{hyperref} as long as they support
+% chapters without numbering.
+% \end{description}
% \begin{macrocode}
\newcommand\addchap{%
\SecDef\@addchap\@saddchap
@@ -5535,20 +5442,19 @@
\addchapmark{}%
}%
% \end{macrocode}
-% In \texttt{hyperref} bis Version 6.71a ist ein dicker Bug. In
-% verschiedenen \texttt{def}-Dateien wird dort das \emph{interne}
-% \KOMAScript-Makro \cs{@addchap} umdefiniert, ohne sicherzustellen,
-% dass das Makro auch noch so aussieht, wie man das erwartet hat. Die
-% sauberste Lösung wäre sicher gewesen dort \cs{@addchap} nur zu
-% ergänzen, so wie man das auch bei \cs{@schapter} gemacht hatte. Ab
-% Version 6.71b ist dieser Bug behoben. Damit ich nicht eines Fehlers
-% verdächtigt werde, wird ggf. eine entsprechende Meldung ausgegeben.
-% \changes{v2.7e}{2001/04/16}{fehlende, schließende Klammer
-% ergänzt}%^^A
-% \changes{v2.7f}{2001/04/17}{fehlendes Klammerpaar ergänzt}%^^A
-% \changes{v2.8q}{2001/11/17}{\cs{AfterPackage} zur Überprüfung der
-% \textsf{hyperref}-Version verwendet}%^^A
-% \changes{v3.27a}{2019/11/11}{Meldung korrigiert}%^^A
+% \changes{v2.7e}{2001/04/16}{braces fixed}
+% \changes{v2.7f}{2001/04/17}{braces fixed}
+% \changes{v2.8q}{2001/11/17}{using \cs{AfterPackage} to test for
+% \pkg{hyperref} version}
+% \changes{v3.27a}{2019/11/11}{warning fixed}
+% \begin{description}
+% \item[ToDo:] Unfortunately \pkg{hyperref} until version 6.71a has a big fat
+% bug. It redefines the internal \KOMAScript{} macro \cs{@addchap} without
+% testing the definition. From version 6.71b this is done only, if a very
+% old \KOMAScript{} is used. However, I would prefer removing all such code
+% from \pkg{hyperref}. Currently we warn, if such an old \pkg{hyperref} is
+% used. But this will be removed in future.
+% \end{description}
% \begin{macrocode}
%<*book>
\AfterPackage{hyperref}{%
@@ -5564,103 +5470,107 @@
%</book>
%</body>
% \end{macrocode}
-% \end{macro}%^^A \@saddchap
-% \end{macro}%^^A \@addchap
-% \end{macro}%^^A \addchap
+% \end{macro}^^A \@saddchap
+% \end{macro}^^A \@addchap
+% \end{command}^^A \addchap
%
%
% \begin{macro}{\l@chapter}
-% \changes{v2.9k}{2003/01/02}{Anpassung an Option \texttt{tocleft}}%^^A
-% \changes{v2.96b}{2006/11/30}{Umbruch zwischen \cs{chapter}-Eintrag im
-% Inhaltsverzeichnis und übergeordneten Einträgen verhindern}%^^A
-% \changes{v2.96b}{2006/11/30}{Umbruch zwischen \cs{chapter}-Eintrag im
-% Inhaltsverzeichnis und untergeordneten Einträgen verhindern}%^^A
-% \changes{v2.97c}{2007/06/21}{\cs{sectfont} durch Verwendung von
-% Element \texttt{chapterentry} ersetzt}%^^A
-% \changes{v2.97c}{2007/06/21}{Element \texttt{chapterentrypagenumber} wird
-% verwendet}%^^A
-% \changes{v2.97c}{2007/06/21}{weitgehend umgeschrieben, um linksbündige
-% Einträge zu ermöglichen}%^^A
-% \changes{v3.15}{2014/12/22}{Verwendung von \cs{chaptertocdepth} und
-% \cs{scr@chapter@tocnumwidth}}%^^A
-% \changes{v3.15}{2014/12/10}{Verwendung von \cs{addvspace} statt \cs{vskip}
-% für den Abstand am Anfang}%^^A
-% \changes{v3.20}{2015/10/06}{überführt in Verzeichnisstil}%^^A
-% Für die Definition des Kapiteleintrags ins Inhaltsverzeichnis werden einige
-% Parameter von \cs{DeclareSectionCommand} definiert und teilweise
-% verwendet. Damit kann man dann zumindest einige Änderungen mit
-% \cs{DeclareSectionCommand} vornehmen, allerdings noch keine komplette
-% Neugestaltung des Eintrags erreichen.
+% \changes{v2.9k}{2003/01/02}{supporting option \opt{tocleft}}
+% \changes{v2.96b}{2006/11/30}{prevent page break between chapter entry and
+% parent}
+% \changes{v2.96b}{2006/11/30}{prevent page break between chapter entry and
+% child}
+% \changes{v2.97c}{2007/06/21}{\cs{sectfont} replaced by font element
+% \fnt{chapterentry}}
+% \changes{v2.97c}{2007/06/21}{using font element
+% \fnt{chapterentrypagenumber}}
+% \changes{v2.97c}{2007/06/21}{re-implemented to support left aligned entries}
+% \changes{v3.15}{2014/12/22}{using \cs{chaptertocdepth} and
+% \cs{scr@chapter@tocnumwidth}}
+% \changes{v3.15}{2014/12/10}{initial skip with \cs{addvspace} instead of
+% \cs{vskip}}
+% \changes{v3.20}{2015/10/06}{re-implemented using ToC styles}
% \begin{macro}{\scr@chapter@tocindent}
-% \changes{v3.15}{2014/12/02}{neue (interne) Anweisung}%^^A
-% \changes{v3.18}{2015/05/20}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \changes{v3.20}{2015/11/06}{wird nun auch verwendet}%^^A
-% Der Einzug des Eintrags noch vor der Nummer.
-% \end{macro}%^^A \scr@chapter@tocindent
+% \changes{v3.15}{2014/12/02}{added}
+% \changes{v3.18}{2015/05/20}{indirect definition by \cs{DeclareSectionCommand}}
+% \changes{v3.20}{2015/11/06}{really used}
+% \end{macro}^^A \scr@chapter@tocindent
% \begin{macro}{\scr@chapter@tocnumwidth}
-% \changes{v3.15}{2014/12/02}{neue (interne) Anweisung}%^^A
-% \changes{v3.18}{2015/05/20}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% Die Breite der Nummer des Eintrags wird tatsächlich verwendet.
+% \changes{v3.15}{2014/12/02}{added}
+% \changes{v3.18}{2015/05/20}{indirect definition by \cs{DeclareSectionCommand}}
% \end{macro}
% \begin{option}{chapterentrydots}
-% \changes{v3.15}{2014/12/10}{Neu}%^^A
-% Seit Version~3.15 kann man mit dieser Option Pünktchen zwischen Text und
-% Seitenzahl in den Kapiteleinträgen einschalten.
+% \changes{v3.15}{2014/12/10}{added}
+% Option
+% \begin{quote}
+% \opt{chapterentrydots=\meta{boolean}}
+% \end{quote}
+% is the main difference of ToC entry style \texttt{chapter} to ToC entry
+% style \texttt{tocline}. It activates the dots between the entry text and the
+% page number.
+% \begin{description}
+% \item[ToDo:] This should be moved to \file{scrkernel-tocstyle.dtx}.
+% \end{description}
% \begin{macrocode}
%<*option>
\KOMA@ifkey{chapterentrydots}{@chapterentrywithdots}
%</option>
% \end{macrocode}
-% \end{option}%^^A chapterentrydots
-% \begin{macro}{\raggedchapterentry}
-% \changes{v2.97c}{2007/06/21}{neue Anweisung}%^^A
-% \changes{v3.20}{2016/02/23}{wird nicht mehr verwendet}%^^A
-% \changes{v3.21}{2016/06/06}{siehe \texttt{scrkernel-tocstyle.dtx},
-% Stil \texttt{tocline}, Eigenschaft \texttt{raggedentrytext}}%^^A
-% Ausrichtung des Textes der Kapiteleinträge im Inhaltsverzeichnis.
+% \end{option}^^A chapterentrydots
+% \begin{command}{\raggedchapterentry}
+% \changes{v2.97c}{2007/06/21}{added}
+% \changes{v3.20}{2016/02/23}{removed}
+% \changes{v3.21}{2016/06/06}{see \file{scrkernel-tocstyle.dtx},
+% style \texttt{tocline}, option \opt{raggedentrytext}}
+% The initial setting of option \opt{raggedtext} of chapter ToC entry style
+% \texttt{tocline} resp. \texttt{chapter}.
+% \begin{description}
+% \item[ToDo:] Do we really need this definition? Every definition but
+% \cs{raggedright} results in justified text. So not defining it would be
+% almost the same. It just would not reserve the macro. But this could be
+% done in \file{scrkernel-tocstyle.dtx}.
+% \end{description}
% \begin{macrocode}
%<*body>
\newcommand*{\raggedchapterentry}{}
% \end{macrocode}
-% \end{macro}%^^A \raggedchapterentry
-% \end{macro}%^^A \l@chapter
+% \end{command}^^A \raggedchapterentry
+% \end{macro}^^A \l@chapter
%
% \begin{macro}{\l@chapteratlist}
-% \changes{v2.96a}{2006/12/03}{neues Macro}%^^A
-% Dieses Makro wird ggf. für die Kapiteleinträge in den Listen der
-% Gleitumgebungen verwendet. Zunächst einmal wird hier dasselbe verwendet, wie
-% für die Kapiteleinträge ins Inhaltsverzeichnis.
+% \changes{v2.96a}{2006/12/03}{added}
+% This is used for chapter entries to other directories by the table of
+% contents. By default it uses \cs{l@chapter}. But users can redefine it
+% using, i.e., \cs{DeclareTOCStyleEntry}. However in this case they have to
+% setup all the attributes/options on their own.
% \begin{macrocode}
\newcommand*{\l@chapteratlist}{\l@chapter}
% \end{macrocode}
-% \end{macro}%^^A \l@chapteratlist
-%
-% \begin{Counter}{chapter}
-% \begin{macro}{\thechapter}
-% \begin{macro}{\chapterformat}
-% \changes{v2.3c}{1995/08/06}{Duden Regel 6}%^^A
-% \changes{v2.7}{2000/01/03}{einfaches Leerzeichen durch \cs{enskip}%^^A
-% ersetzt}%^^A
-% \changes{v2.8}{2001/06/15}{\cs{chapappifprefix} eingefügt}%^^A
-% \changes{v2.8o}{2001/09/19}{\cs{chapappifchapterprefix} statt
-% \cs{chapappifprefix}} ^^A
-% \changes{v2.96a}{2006/12/02}{\cs{mbox} eingefügt, um \cs{caps} zu
-% ermöglichen}%^^A
-% \changes{v3.17}{2015/03/08}{\cs{enskip} not in prefix line mode}%^^A
-% \begin{macro}{\chaptermarkformat}
-% \changes{v2.3a}{1995/07/08}{Leerraum nach der Kapitelnummer erhöht}%^^A
-% \changes{v2.3c}{1995/08/06}{Duden Regel 6}%^^A
-% \changes{v2.8}{2001/06/15}{\cs{chapappifprefix} eingefügt}%^^A
-% \changes{v2.8o}{2001/09/19}{\cs{chapappifchapterprefix} statt
-% \cs{chapappifprefix}}%^^A
-% \changes{v3.03a}{2009/04/03}{Tilde durch \cs{nobreakspace} ersetzt, um die
-% Kompatibilität mit Spanisch zu verbessern}%^^A
-% Jede Gliederungsebene benötigt einen Zähler für die
-% Gliederungsnummer und eine Darstellung des Zählers
-% (\cs{the\dots}). Desweiteren wird eine Formatierung des Zählers in
-% den Gliederungsüberschriften (\texttt{\bslash\dots format}) und eine
-% Formatierung des Zählers in der Kopfzeile
-% (\texttt{\bslash\dots markformat}) benötigt.
+% \end{macro}^^A \l@chapteratlist
+%
+% \begin{counter}{chapter}
+% \begin{command}{\thechapter}
+% \begin{command}{\chapterformat}
+% \changes{v2.3c}{1995/08/06}{auto dot feature}
+% \changes{v2.7}{2000/01/03}{white space replaced by \cs{enskip}}
+% \changes{v2.8}{2001/06/15}{\cs{chapappifprefix} added}
+% \changes{v2.8o}{2001/09/19}{\cs{chapappifprefix} replaced by
+% \cs{chapappifchapterprefix}}
+% \changes{v2.96a}{2006/12/02}{\cs{mbox} added}
+% \changes{v3.17}{2015/03/08}{\cs{enskip} not in prefix line mode}
+% \begin{command}{\chaptermarkformat}
+% \changes{v2.3a}{1995/07/08}{space after chapter number increased}
+% \changes{v2.3c}{1995/08/06}{auto dot feature}
+% \changes{v2.8}{2001/06/15}{\cs{chapappifprefix} added}
+% \changes{v2.8o}{2001/09/19}{\cs{chapappifprefix} replaced by
+% \cs{chapappifchapterprefix}}
+% \changes{v3.03a}{2009/04/03}{tilde replaced by \cs{nobreakspace} for better
+% \pkg{babel-spanish} support}
+% The counter would also be defined by \cs{DeclareSectionCommand}. But because
+% of handling \cs{frontmatter} and \cs{backmatter} and prefix lines we cannot
+% use the default definition of the formatting. So we define it already before
+% calling \cs{DeclareSectionCommand} for \cs{chapter}.
% \begin{macrocode}
\newcounter{chapter}
\renewcommand*{\thechapter}{\@arabic\c@chapter}
@@ -5671,61 +5581,74 @@
\newcommand*\chaptermarkformat{\chapappifchapterprefix{\ }%
\thechapter\autodot\enskip}
% \end{macrocode}
-% \end{macro}%^^A \chaptermarkformat
-% \end{macro}%^^A \chapterformat
-% \end{macro}%^^A \thechapter
-% \end{Counter}%^^A chapter
+% \end{command}^^A \chaptermarkformat
+% \end{command}^^A \chapterformat
+% \end{command}^^A \thechapter
+% \end{counter}^^A chapter
%
%
-% \begin{macro}{\chaptername}
-% Name der Gliederungsebenen \cs{chapter}.
+% \begin{command}{\chaptername}
+% \changes{v3.36}{2022/03/15}{explicit definition for English languages}
+% The name of a chapter, e.g., used for the prefix line and maybe for the ToC
+% entry.
% \begin{macrocode}
\newcommand*\chaptername{Chapter}
+\providecaptionname{american,australian,british,canadian,english,newzealand,%
+ UKenglish,ukenglish,USenglish,usenglish}\chaptername{Chapter}
% \end{macrocode}
-% \end{macro}%^^A \chaptername
+% \end{command}^^A \chaptername
%
%
-% \begin{macro}{\appendixname}
-% Der Name des Anhangs.
+% \begin{command}{\appendixname}
+% \changes{v3.36}{2022/03/15}{explicit definition for English languages}
+% The same for appendix chapters.
% \begin{macrocode}
\newcommand*\appendixname{Appendix}
+\providecaptionname{american,australian,british,canadian,english,newzealand,%
+ UKenglish,ukenglish,USenglish,usenglish}\appendixname{Appendix}
% \end{macrocode}
-% \end{macro}%^^A \appendixname
-%
-%
-% \begin{macro}{\chapappifprefix}
-% \changes{v2.8}{2001/06/15}{neu}%^^A
-% \changes{v2.8o}{2001/09/19}{obsolet}%^^A
-% \begin{macro}{\chapappifchapterprefix}
-% \changes{v2.8o}{2001/09/19}{neu}%^^A
-% \changes{v2.8o}{2001/09/19}{Argument ist nicht optional}%^^A
-% \changes{v3.18}{2015/06/09}{verwendet \cs{IfChapterUsePrefixLine}}%^^A
-% \begin{macro}{\IfChapterUsesPrefixLine}
-% \changes{v3.18}{2015/06/09}{neu (intern)}
-% \begin{macro}{\chapapp}
-% \changes{v2.8}{2001/06/15}{neu}%^^A
-% Das in \cs{chapterformat} verwendete Makro
-% \cs{chapappifchapterprefix} setzt abhängig von \cs{if@chapterprefix}
-% noch das Makro \cs{chapapp} gefolgt vom obliatorischen Argument.
-% \cs{chapapp} macht \cs{@chapapp} auf Anwenderebene verfügbar. Der
-% Vorteil des neuen \cs{chapappifchapterprefix} gegenüber dem alten
-% \cs{chapappifprefix} ist, dass nun beim Umdefinieren von
-% \cs{chapterformat} und \cs{chaptermarkformat} wieder
-% \cs{renewcommand} verwendet werden kann und beim Umschalten in den
-% Anhang die Kopfzeile korrekt ist, weil das Makro nun nicht mehr
-% geschützt ist, sondern direkt expandiert.
-% \begin{macrocode}
-\newcommand*{\chapappifprefix}[1][]{%
- \ClassWarning{\KOMAClassName}{%
- Please don't use obsolete command
- \string\chapappifprefix.\MessageBreak
- The new command \string\chapappifchapterprefix\space has
- an\MessageBreak
- obligatory instead of an optional argument. Use that\MessageBreak
- new command%
- }%
- \chapappifchapterprefix{#1}%
-}
+% \end{command}^^A \appendixname
+%
+%
+% \begin{command}{\chapappifprefix}
+% \changes{v2.8}{2001/06/15}{added}
+% \changes{v2.8o}{2001/09/19}{deprecated}
+% \changes{v3.36}{2022/03/18}{removed}
+% \begin{description}
+% \item[Note:] Command \cs{chapappifprefix} has been removed in \KOMAScript{}
+% v3.36, because it is deprecated from \KOMAScript{} v2.8o and there never has
+% been a compatibility switch for versions before \KOMAScript{} v2.9.
+% \end{description}
+% \end{command}^^A \chapappifprefix
+%
+%
+% \begin{command}{\chapappifchapterprefix}
+% \changes{v2.8o}{2001/09/19}{added}
+% \changes{v3.18}{2015/06/09}{using \cs{IfChapterUsePrefixLine}}
+% \begin{command}{\IfChapterUsesPrefixLine}
+% \changes{v3.18}{2015/06/09}{added}
+% \begin{command}{\chapapp}
+% \changes{v2.8}{2001/06/15}{added}
+% \begin{macro}{\@chapapp}
+% The \LaTeX{} standard classes provide an internal macro \cs{@chapapp} that
+% is either \cs{chaptername} or \cs{appendixname} depending on whether we are
+% inside or outside the appendix. For compatibility with lots of packages
+% \KOMAScript{} does provide this too. But for the user level this is
+% cumbersome. So \KOMAScript{} does also provide a \emph{read only specified}
+% user command \cs{chapapp}. \KOMAScript{} itself uses \cs{chapapp} inside
+% \begin{quote}
+% \cs{chapappifchapterprefix}\marg{then string}
+% \end{quote}
+% that outputs \cs{then string} prefixed by \cs{chapapp} only, if
+% \opt{chapterprefix} (resp. \opt{headings=twolinechapter}) has been activated
+% and therefore a chapter prefix line has to be used. A more general version
+% \cs{chapterifchapterprefix} is
+% \begin{quote}
+% \cs{IfChapterUsesPrefixLine}\marg{then code}\marg{else code}
+% \end{quote}
+% that executes \cs{then code} if a chapter prefix line has to be used and
+% \cs{else code} otherwise (both without extra prefix).
+% \begin{macrocode}
\newcommand*{\chapappifchapterprefix}[1]{%
\IfChapterUsesPrefixLine{\chapapp#1}{}%
}
@@ -5733,38 +5656,37 @@
\if@chapterprefix\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
}
\newcommand*{\chapapp}{\@chapapp}
-% \end{macrocode}
-% \begin{macro}{\@chapapp}
-% Dieses Makro enthält den Kapitelname (\cs{chaptername}), der sich im
-% Anhang üblicherweise ändert (\cs{appendixname}).
-% \begin{macrocode}
\newcommand*\@chapapp{\chaptername}
% \end{macrocode}
-% \end{macro}%^^A \@chapapp
-% \end{macro}%^^A \chapapp
-% \end{macro}%^^A \IfChapterUsePrefixLine
-% \end{macro}%^^A \chapappifchapterprefix
-% \end{macro}%^^A \chapappifprefix
+% \end{macro}^^A \@chapapp
+% \end{command}^^A \chapapp
+% \end{command}^^A \IfChapterUsePrefixLine
+% \end{command}^^A \chapappifchapterprefix
%
%
-% \begin{macro}{\chaptermark}
-% Da \cs{chapter} nicht mit Hilfe von \cs{@startsection} definiert
-% wird, wird auch \cs{chaptermark} nicht automatisch definiert. Es
-% wird aber in den Seitenstilen benötigt bzw. umdefiniert. Also hier
-% vorsorglich eine Dummy-Definition:
+% \begin{command}{\chaptermark}
+% Before selecting a page style with automatic running head, \cs{chapter}
+% should simply not change the left or right mark.
+% \begin{description}
+% \item[ToDo:] Do we really need this or would the later
+% \cs{DeclareSectionCommand} be enough to do the initial definition?
+% \end{description}
% \begin{macrocode}
\newcommand*\chaptermark[1]{}
% \end{macrocode}
-% \end{macro}
+% \end{command}
%
-% \begin{macro}{\addchapmark}
-% \changes{v3.12}{2013/03/26}{neue Anweisung}%^^A
-% Für \cs{addchapmark} gilt dies hingegen nicht. Das wird nicht von den Stilen
-% definiert, sondern direkt mit der gewünschten Definition
-% initialisiert. Bitte nicht davon verwirren lassen, dass \cs{if@mainmatter}
-% hier auch von \textsf{scrreprt} definiert wird. Das ist Absicht und
-% vereinfacht dem einen oder anderen Paket oder Benutzer vielleicht die
-% Arbeit.
+% \begin{command}{\addchapmark}
+% \changes{v3.12}{2013/03/26}{added}
+% \cs{addchap} and marks for running heads are a little bit more
+% complicated. Currently we are using a local redefinition of
+% \cs{if@mainmatter} and setting of \cnt{secnumdept} to switch of numbering
+% and then using \cs{chaptermark}. So the \cs{chaptermark} definition should
+% always respect at least one of these settings.
+% \begin{description}
+% \item[Note:] The ToDo note at \cs{chaptermark} is not relevant for this
+% definition.
+% \end{description}
% \begin{macrocode}
\newcommand*\addchapmark[1]{%
\begingroup
@@ -5775,185 +5697,183 @@
\endgroup
}
% \end{macrocode}
-% \end{macro}%^^A \addchapmark
+% \end{command}^^A \addchapmark
%
%
-% \begin{macro}{\raggedchapter}
-% \changes{v3.15}{2014/12/09}{neu}%^^A
-% Da das doch recht häufig gewünscht wird, kann man die Ausrichtung der
-% Kapitelüberschrift auch getrennt von der Ausrichtung der übrigen
-% Überschriften einstellen.
+% \begin{command}{\raggedchapter}
+% \changes{v3.15}{2014/12/09}{added}
+% Style \texttt{chapter} does not use \cs{raggedsection} but
+% \cs{raggedchapter}. However, the initial value is \cs{raggedsection}, so a
+% change of \cs{raggedsection} would also change the initial behave of
+% \cs{raggedchapter}. Nevertheless the alignment of chapters in independent
+% from the alignment of sections, if wanted.
% \begin{macrocode}
\newcommand*{\raggedchapter}{\raggedsection}
% \end{macrocode}
-% \end{macro}
-%
+% \end{command}
%
-% \begin{KOMAfont}{chapter}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{chapter}}%^^A
-% \begin{macro}{\scr@fnt@chapter}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{chapter}}%^^A
-% \begin{KOMAfont}{chapterprefix}
-% \changes{v2.96a}{2006/12/02}{neues Element \texttt{chapterprefix}}%^^A
-% \begin{macro}{\scr@fnt@chapterprefix}
-% \changes{v2.96a}{2006/12/02}{neues Element \texttt{chapterprefix}}%^^A
-% \begin{macrocode}
-\newcommand*{\scr@fnt@chapter}{\size@chapter}
-\newcommand*{\scr@fnt@chapterprefix}{\size@chapterprefix}
-% \end{macrocode}
-% \end{macro}%^^A \scr@fnt@chapterprefix
-% \end{KOMAfont} chapterprefix
-% \end{macro}%^^A \scr@fnt@chapter
-% \end{KOMAfont}%^^A chapter
%
-% \begin{KOMAfont}{chapterentry}
-% \changes{v2.97c}{2007/06/21}{neues Font-Element}%^^A
-% \changes{v3.06}{2010/06/09}{Verwendung von \texttt{sectioning} durch
-% \texttt{disposition} ersetzt}%^^A
-% Schrift für den \cs{chapter}-Eintrag im Inhaltsverzeichnis.
+% \begin{fontelement}{chapterentry}
+% \changes{v2.97c}{2007/06/21}{added}
+% \changes{v3.06}{2010/06/09}{font element \fnt{sectioning} replaced by
+% \fnt{disposition}}
+% \cs{chapter} entries to the table of contents initially using
+% \fnt{disposition}, the basic font of all outlines.
% \begin{macrocode}
\newkomafont{chapterentry}{\usekomafont{disposition}}
% \end{macrocode}
-% \end{KOMAfont}
+% \end{fontelement}
%
-% \begin{KOMAfont}{chapterentrypagenumber}
-% \changes{v2.97c}{2007/06/21}{neues Font-Element}%^^A
-% Schrift für die Seitenzahl des \cs{chapter}-Eintrags im Inhaltsverzeichnis
-% abweichend von \texttt{chapterentry}.
+% \begin{fontelement}{chapterentrypagenumber}
+% \changes{v2.97c}{2007/06/21}{added}
+% The page number of \cs{chapter} entries to the table of contents is
+% initially the same as the entry at whole.
% \begin{macrocode}
\newkomafont{chapterentrypagenumber}{}
% \end{macrocode}
-% \end{KOMAfont}
+% \end{fontelement}
%
-% \begin{KOMAfont}{chapterentrydots}
-% \changes{v3.15}{2014/12/10}{neues Font-Element}%^^A
-% \changes{v3.27}{2019/10/28}{überflüssiges \cs{normalfont} entfernt}%^^A
-% Schrift für die optionalen Pünktchen des \cs{chapter}-Eintrags im
-% Inhaltsverzeichnis abweichend von \texttt{chapterentry} und
-% \cs{normalfont}\cs{normalsize}.
+% \begin{fontelement}{chapterentrydots}
+% \changes{v3.15}{2014/12/10}{added}
+% \changes{v3.27}{2019/10/28}{\cs{normalfont} removed}
+% If the optional dots for \cs{chapter} entries to the table of contents are
+% used, we can change the font of the dots also. It is used for the
+% \texttt{linefill} of \pkg*{tocbasic} ToC entry style \texttt{chapter}, that
+% uses ToC entry style \texttt{tocline} where the line filler is always
+% prefixed by \cs{normalfont}\cs{normalsize}. So the setting is relative to
+% this. The color is relative to the color of \fnt{chapterentry}.
% \begin{macrocode}
\newkomafont{chapterentrydots}{}
%</body>
%</book|report>
-%</class>
% \end{macrocode}
-% \end{KOMAfont}
+% \end{fontelement}
%
%
-% \subsection{Abschnitte und Untergliederungen}
+% \subsection{Section, subsections and more}
%
-% Alle Ebenen ab \cs{section} ähneln sich so sehr, dass sie gemeinsam
-% behandelt werden. Lediglich bei \textsf{scrartl} gibt es für \cs{section}
-% selbst noch ein paar Besonderheiten.
+% The outline levels of sections, subsections, subsubsection, paragraphs and
+% subparagraphs are all very similar. There are only some special treatments
+% of sections with \cls*{scrartcl}, because there \cs{section} is a high-level
+% command.
%
-% \begin{macro}{\size@section}
-% \changes{v2.8o}{2001/09/14}{neu (intern)}%^^A
-% \begin{macro}{\size@subsection}
-% \changes{v2.8o}{2001/09/14}{neu (intern)}%^^A
-% \begin{macro}{\size@subsubsection}
-% \changes{v2.8o}{2001/09/14}{neu (intern)}%^^A
-% \begin{macro}{\size@paragraph}
-% \changes{v2.8o}{2001/09/14}{neu (intern)}%^^A
-% \begin{macro}{\size@subparagraph}
-% \changes{v2.8o}{2001/09/14}{neu (intern)}%^^A
-% Hier werden diese Befehle nur vordefiniert. Ihre tatsächliche Einstellung
-% erfolgt über die (Vor-)Auswahl von Option \texttt{headings}.
+% \begin{fontelement}{section,subsection,subsubsection,
+% paragraph,subparagraph}
+% \changes{v2.8o}{2001/09/14}{added}
+% Definition of the font elements used by \cs{section}, \cs{subsection},
+% \cs{subsubsection}, \cs{paragraph} and \cs{subparagraph}. The settings are
+% done by option \texttt{headings} later. Everything is prepared before this
+% option is used the first time. The definition of the font element is done
+% manually to stay compatible with old \KOMAScript{} versions using another
+% internal macro than the default of \cs{newkomafont}.
% \begin{macrocode}
-%<*class>
%<*prepare>
\newcommand*{\size@section}{}
+\newcommand*{\scr@fnt@section}{\size@section}
\newcommand*{\size@subsection}{}
+\newcommand*{\scr@fnt@subsection}{\size@subsection}
\newcommand*{\size@subsubsection}{}
+\newcommand*{\scr@fnt@subsubsection}{\size@subsubsection}
\newcommand*{\size@paragraph}{}
+\newcommand*{\scr@fnt@paragraph}{\size@paragraph}
\newcommand*{\size@subparagraph}{}
+\newcommand*{\scr@fnt@subparagraph}{\size@subparagraph}
%</prepare>
% \end{macrocode}
-% \end{macro}%^^A \size@subparagraph
-% \end{macro}%^^A \size@paragraph
-% \end{macro}%^^A \size@subsubsection
-% \end{macro}%^^A \size@subsection
-% \end{macro}%^^A \size@section
+% \end{fontelement}^^A section … subparagraph
%
%
% \begin{macro}{\l@section}
-% \changes{v2.9k}{2003/01/02}{Anpassung an Option \texttt{tocleft}}%^^A
-% \changes{v2.96b}{2006/11/30}{Umbruch zwischen \cs{section}-Eintrag im
-% Inhaltsverzeichnis und übergeordneten Einträgen verhindern}%^^A
-% \changes{v2.96b}{2006/11/30}{Umbruch zwischen \cs{section}-Eintrag im
-% Inhaltsverzeichnis und untergeordneten Einträgen verhindern}%^^A
-% \changes{v2.97c}{2007/06/21}{\cs{sectfont} durch Verwendung von
-% Element \texttt{sectionentry} ersetzt}%^^A
-% \changes{v2.97c}{2007/06/21}{Element \texttt{sectionentrypagenumber} wird
-% verwendet}%^^A
-% \changes{v2.97c}{2007/06/21}{weitgehend umgeschrieben, um linksbündige
-% Einträge zu ermöglichen}%^^A
-% \changes{v3.15}{2014/11/24}{\cs{sectiontocdepth},
-% \cs{scr@section@tocindent} und \cs{scr@section@tocnumwidth} werden
-% verwendet}%^^A
-% \changes{v3.20}{2015/10/06}{Überführung in Verzeichnisstil}%^^A
-% Bei der Artikel-Klasse folgt die Formatierung für
-% \cs{section}-Einträge, an Stelle der Einträge für \cs{chapter}
-% der Buch- oder der Bericht-Klasse. Bei diesen handelt es sich hier
-% stattdessen um eine normale Ebene.
+% \changes{v2.9k}{2003/01/02}{supporting option \opt{tocleft}}
+% \changes{v2.96b}{2006/11/30}{preventing page break between section entry and
+% parent}
+% \changes{v2.96b}{2006/11/30}{preventing page break between section entry and
+% child}
+% \changes{v2.97c}{2007/06/21}{\cs{sectfont} replaced by font element
+% \fnt{sectionentry}}
+% \changes{v2.97c}{2007/06/21}{using font element
+% \fnt{sectionentrypagenumber}}
+% \changes{v2.97c}{2007/06/21}{re-implemented to support left aligned entries}
+% \changes{v3.15}{2014/11/24}{using \cs{sectiontocdepth},
+% \cs{scr@section@tocindent} and \cs{scr@section@tocnumwidth}}
+% \changes{v3.20}{2015/10/06}{re-implemented using ToC styles}
% \begin{option}{sectionentrydots}
-% \changes{v3.15}{2014/12/10}{Neu}%^^A
-% Seit Version~3.15 kann man mit dieser Option Pünktchen zwischen Text und
-% Seitenzahl in den Kapiteleinträgen einschalten.
+% \changes{v3.15}{2014/12/10}{added}
+% With \cls*{scrartcl} option
+% \begin{quote}
+% \opt{sectionentrydots=\meta{boolean}}
+% \end{quote}
+% is the main difference of ToC entry style \texttt{section} to ToC entry
+% style \texttt{tocline}. It activates the dots between the entry text and the
+% page number.
+% \begin{description}
+% \item[ToDo:] This should be moved to \file{scrkernel-tocstyle.dtx}.
+% \end{description}
% \begin{macrocode}
%<*article>
%<*option>
\KOMA@ifkey{sectionentrydots}{@sectionentrywithdots}
%</option>
% \end{macrocode}
-% \end{option}%^^A sectionentrydots
-% \begin{macro}{\raggedsectionentry}
-% \changes{v2.97c}{2007/06/21}{neue Anweisung}%^^A
-% \changes{v3.20}{2016/02/23}{nicht mehr verwendet}%^^A
-% Ausrichtung des Textes der Abschnittseinträge im Inhaltsverzeichnis.
+% \end{option}^^A sectionentrydots
+% \begin{command}{\raggedsectionentry}
+% \changes{v2.97c}{2007/06/21}{added}
+% \changes{v3.20}{2016/02/23}{removed}
+% The initial setting of option \opt{raggedtext} of section ToC entry style
+% \texttt{tocline} resp. \texttt{section}.
+% \begin{description}
+% \item[ToDo:] Do we really need this definition? Every definition but
+% \cs{raggedright} results in justified text. So not defining it would be
+% almost the same. It just would not reserve the macro. But this could be
+% done in \file{scrkernel-tocstyle.dtx}.
+% \end{description}
% \begin{macrocode}
%<*body>
\newcommand*{\raggedsectionentry}{}
%</body>
%</article>
% \end{macrocode}
-% \end{macro}%^^A \raggedsectionentry
-% \end{macro}%^^A \l@section
-%
-%
-% \begin{macro}{\addsec}
-% \changes{v2.0e}{1994/10/12}{mehrfach \cs{markboth} durch
-% \cs{sectionmark} ersetzt}%^^A
-% \changes{v2.2b}{1995/03/20}{\cs{sectionmark} durch \cs{@mkboth}
-% ersetzt}%^^A
-% \changes{v2.3h}{1995/01/21}{jetzt auch bei \textsf{scrbook} und
-% \textsf{scrreprt}}%^^A
-% \changes{v2.4g}{1996/11/04}{\cs{section*} vorgezogen, damit
-% dadurch provozierte Seitenumbrüche im Inhaltsverzeichnis
-% berücksichtigt werden}%^^A
-% \changes{v2.5d}{1998/01/03}{\cs{@mkboth} bedingt durch
-% \cs{markright} ersetzt}%^^A
-% \changes{v2.7a}{2001/01/04}{\cs{addsec} für eine bessere
-% Unterstützung von \textsf{hyperref} geändert}%^^A
-% \changes{v3.13a}{2014/09/11}{Verwendung von \cs{SecDef}}%^^A
+% \end{command}^^A \raggedsectionentry
+% \end{macro}^^A \l@section
+%
+%
+% \begin{command}{\addsec}
+% \changes{v2.0e}{1994/10/12}{several \cs{markboth} replaced by
+% \cs{sectionmark}}
+% \changes{v2.2b}{1995/03/20}{\cs{sectionmark} replaced by \cs{@mkboth}}
+% \changes{v2.3h}{1995/01/21}{also available with \cls*{scrbook} and
+% \cls*{scrreprt}}
+% \changes{v2.4g}{1996/11/04}{\cs{section*} moved because of page breaks in
+% the table of contents}
+% \changes{v2.5d}{1998/01/03}{\cs{@mkboth} replaced by conditional
+% \cs{markright}}
+% \changes{v2.7a}{2001/01/04}{supporting \pkg{hyperref}}
+% \changes{v3.13a}{2014/09/11}{using \cs{SecDef}}
% \begin{macro}{\@addsec}
-% \changes{v3.10}{2011/08/30}{Verwendung von \cs{addsectiontocentry}}%^^A
-% \changes{v3.10}{2011/08/30}{Integration der Erweiterung für das optionale
-% Argument der Gliederungsbefehle}%^^A
-% \changes{v3.12}{2013/02/26}{Verwendung von \cs{addsecmark}}%^^A
-% \changes{v3.18}{2015/05/22}{komplett neu definiert}%^^A
+% \changes{v3.10}{2011/08/30}{using \cs{addsectiontocentry}}
+% \changes{v3.10}{2011/08/30}{extended optional argument}
+% \changes{v3.12}{2013/02/26}{using \cs{addsecmark}}
+% \changes{v3.18}{2015/05/22}{redefinition}
% \begin{macro}{\@saddsec}
-% \changes{v3.12}{2013/02/26}{Verwendung von \cs{addsecmark}}%^^A
-% \changes{v3.17}{2015/04/20}{\cs{scr@ds@head} in \cs{addsecmark}
-% expandieren}%^^A
-% \KOMAScript{} bietet in allen drei Hauptklassen den zusätzlichen
-% Gliederungsbefehl \cs{addsec}. Es handelt sich dabei um einen mit
-% \cs{section*} vergleichbaren Befehl, bei dem jedoch der
-% Kolumnentitel korrigiert wird und ein Eintrag ins Inhaltsverzeichnis
-% erfolgt (nicht in der Stern-Variante).
-%
-% Mit Version~3.18 wurde \cs{addsec} deutlich vereinfacht. Seither verwendet
-% nur noch \cs{@saddsec} die Anweiung \cs{addsecmark}, während \cs{@addsec}
-% direkt über das \cs{sectionmark} von \cs{section} arbeitet.
+% \changes{v3.12}{2013/02/26}{using \cs{addsecmark}}
+% \changes{v3.17}{2015/04/20}{expanding \cs{scr@ds@head} in \cs{addsecmark}}
+% Since \KOMAScript{} 3.18 using
+% \begin{quote}
+% \cs{addsec}\oarg{head or ToC entry}\marg{heading}
+% \end{quote}
+% is very similar to
+% |\section[nonumber=true,…]{…}| but also works if the extended optional
+% argument is not activated. And
+% \begin{quote}
+% \cs{addsec*}\marg{heading}
+% \end{quote}
+% is just a \cs{section*}\marg{heading} with additional |\addsecmark{}| to
+% empty the running head.
+% \begin{description}
+% \item[Note:] Because of simply manipulating \cnt{secnumdepth} this should
+% also work with packages like \pkg{hyperref} as long as they support
+% sections without numbering.
+% \end{description}
% \begin{macrocode}
%<*body>
\newcommand\addsec{\SecDef\@addsec\@saddsec}
@@ -5972,30 +5892,28 @@
\section*{#1}\addsecmark{}%
}
% \end{macrocode}
-% \end{macro}%^^A \@saddsec
-% \end{macro}%^^A \@addsec
-% \end{macro}%^^A \addsec
-%
-%
-% \begin{macro}{\minisec}
-% \changes{v2.8q}{2002/02/28}{\cs{nobreak} nach \cs{sectfont}
-% behebt einen Bug im color Paket}%^^A
-% \changes{v2.9o}{2003/01/31}{\cs{nobreak} nach dem Gruppenende
-% behebt einen Bug im color Paket}%^^A
-% \changes{v2.96a}{2006/11/30}{Standardwert für \cs{parfillskip} (abhängig
-% von Option \texttt{version})}%^^A
-% \changes{v2.96a}{2006/12/03}{alle nicht benötigten \cs{nobreak}%^^A
-% entfernt}%^^A
-% \changes{v3.13a}{2014/08/07}{Absicherung der Abstände bei
-% aufeinanderfolgenden Überschriften entsprechend \cs{@startsection}}%^^A
-% \changes{v3.26}{2018/05/14}{fehlendes \cs{interlinepenalty}\cs{@M}
-% ergänzt}%^^A
-% \begin{KOMAfont}{minisec}
-% \changes{v2.96a}{2006/12/03}{\texttt{minisec} ist ein eigenes
-% Fontelement}%^^A
-% \changes{v3.21}{2016/06/12}{fehlendes \cs{nobreak} ergänzt}%^^A
-% In \KOMAScript{} gibt es diese zusätzliche Gliederungsebene, die
-% immer ohne Nummer und ohne Eintrag ins Inhaltsverzeichnis erfolgt.
+% \end{macro}^^A \@saddsec
+% \end{macro}^^A \@addsec
+% \end{command}^^A \addsec
+%
+%
+% \begin{command}{\minisec}
+% \changes{v2.8q}{2002/02/28}{\cs{nobreak} after \cs{sectfont} added}
+% \changes{v2.9o}{2003/01/31}{\cs{nobreak} after group end}
+% \changes{v2.96a}{2006/11/30}{initial value of \cs{parfillskip} depending on
+% \opt{version}}
+% \changes{v2.96a}{2006/12/03}{not needed \cs{nobreak} removed}
+% \changes{v3.13a}{2014/08/07}{handling of distances of immediate following
+% headings like \cs{@startsection}}
+% \changes{v3.26}{2018/05/14}{missing \cs{interlinepenalty}\cs{@M} added}
+% \begin{fontelement}{minisec}
+% \changes{v2.8o}{2001/09/14}{using font element \fnt{minisec}}
+% \changes{v3.21}{2016/06/12}{missing \cs{nobreak} added}
+% \cs{minisec} is a very special additional outline of \KOMAScript. It is
+% always free standing but without numbering. Something like
+% \cs{sectionlinesformat} is not supported currently. Also entries to the
+% table of contents or marks for an automatic running head are not
+% supported. However a dedicated font element is provided.
% \begin{macrocode}
\newkomafont{minisec}{}
\newcommand\minisec[1]{%
@@ -6020,81 +5938,81 @@
\@afterheading
}
% \end{macrocode}
-% \end{KOMAfont}
-% \end{macro}
-%
-%
-% \begin{macro}{\addsectiontocentry}
-% \changes{v3.10}{2011/08/30}{Neu}%^^A
-% Entsprechend \cs{addparttocentry} und \cs{addchaptertocentry}.
+% \end{fontelement}^^A minisec
+% \end{command}^^A \minisec
+%
+%
+% \begin{command}{\addsectiontocentry,\addsubsectiontocentry,
+% \addsubsubsectiontocentry,
+% \addparagraphtocentry,\addsubparagraphtocentry}
+% \changes{v3.10}{2011/08/30}{added}
+% We do not use \cs{addcontentsline} directly for the entries to the table of
+% contents. Using
+% \begin{quote}\raggedright
+% \cs{addsectiontocentry}\marg{number}\marg{text}\\
+% \cs{addsubsectiontocentry}\marg{number}\marg{text}\\
+% \cs{addsubsubsectiontocentry}\marg{number}\marg{text}\\
+% \cs{addparagraphtocentry}\marg{number}\marg{text}\\
+% \cs{addsubparagraphtocentry}\marg{number}\marg{text}\\
+% \end{quote}
+% allows easy manipulation of such entries and additional actions. If the
+% \meta{number} is completely empty no number should be used. Internally the
+% generic \cs{addtocentrydefault} it used, which uses \cs{nonumberline}
+% instead of \cs{numberline} in this case. See \file{scrkernel-listsof.dtx}
+% for more information.
+% \begin{description}
+% \item[ToDo:] Should this be moved to \file{scrkernel-listsof.dtx} or even to
+% \file{scrkernel-tocstyle.dtx}?
+% \item[ToDo:] Are these really needed or would the implicit definition by the
+% later \cs{DeclareSectionCommand} be enough as it is already used for
+% \cs{addsubsubsectiontocentry}?
+% \end{description}
% \begin{macrocode}
\newcommand*{\addsectiontocentry}[2]{%
\addtocentrydefault{section}{#1}{#2}%
}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\addsubsectiontocentry}
-% \changes{v3.10}{2011/08/30}{Neu}%^^A
-% Entsprechend \cs{addparttocentry} usw.
-% \begin{macrocode}
\newcommand*{\addsubsectiontocentry}[2]{%
\addtocentrydefault{subsection}{#1}{#2}%
}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\addparagraphtocentry}
-% \changes{v3.10}{2011/08/30}{Neu}%^^A
-% Entsprechend \cs{addparttocentry} usw.
-% \begin{macrocode}
\newcommand*{\addparagraphtocentry}[2]{%
\addtocentrydefault{paragraph}{#1}{#2}%
}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\addsubparagraphtocentry}
-% \changes{v3.10}{2011/08/30}{Neu}%^^A
-% Entsprechend \cs{addparttocentry} usw.
-% \begin{macrocode}
\newcommand*{\addsubparagraphtocentry}[2]{%
\addtocentrydefault{subparagraph}{#1}{#2}%
}
% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{Counter}{section}
-% \begin{macro}{\thesection}
-% \changes{v2.97e}{2007/11/23}{Kapitelnummer nur im Hauptteil}%^^A
-% \changes{v3.03b}{2009/06/09}{\cs{relax} im Kompatibilitätstest durch ein
-% Leerzeichen ersetzt, obwohl das die Wartbarkeit verschlechtert, aber
-% \textsf{hyperref} hat mit dem \cs{relax} ein nicht dokumentieres
-% Problem}%^^A
-% \changes{v3.27}{2019/06/26}{Umstellung auf \cs{scr@v@is@gt}}%^^A
-% \begin{macro}{\sectionmarkformat}
-% \changes{v2.3a}{1995/07/08}{Leerraum nach der Kapitelnummer
-% erhöht}%^^A
-% \changes{v2.3c}{1995/08/06}{Duden Regel 6}%^^A
-% \begin{Counter}{subsection}
-% \begin{macro}{\thesubsection}
-% \begin{macro}{\subsectionmarkformat}
-% \changes{v2.3a}{1995/07/08}{Leerraum nach der Kapitelnummer
-% erhöht}%^^A
-% \changes{v2.3c}{1995/08/06}{Duden Regel 6}%^^A
-% \begin{Counter}{subsubsection}
-% \begin{macro}{\thesubsubsection}
-% \begin{Counter}{paragraph}
-% \begin{macro}{\theparagraph}
-% \begin{Counter}{subparagraph}
-% \begin{macro}{\thesubparagraph}
-% Jede Gliederungsebene benötigt einen Zähler für die
-% Gliederungsnummer und eine Darstellung des Zählers
-% (\cs{the\dots}). Desweiteren wird eine Formatierung des Zählers in
-% den Gliederungsüberschriften (\texttt{\bslash\dots format}) und eine
-% Formatierung des Zählers in der Kopfzeile
-% (\texttt{\bslash\dots markformat}) benötigt.
+% \end{command}
+%
+%
+% \begin{counter}{section}
+% \begin{command}{\thesection}
+% \changes{v2.97e}{2007/11/23}{chapter number prefix only in main matter}
+% \changes{v3.03b}{2009/06/09}{\cs{relax} replaced by white space for better
+% support of \pkg{hyperref}}
+% \changes{v3.27}{2019/06/26}{using \cs{scr@v@is@gt}}
+% \begin{command}{\sectionmarkformat}
+% \changes{v2.3a}{1995/07/08}{space after number increased}
+% \changes{v2.3c}{1995/08/06}{auto dot feature}
+% \begin{counter}{subsection}
+% \begin{command}{\thesubsection}
+% \begin{command}{\subsectionmarkformat}
+% \changes{v2.3a}{1995/07/08}{space after number increased}
+% \changes{v2.3c}{1995/08/06}{auto dot feature}
+% \begin{counter}{subsubsection}
+% \begin{command}{\thesubsubsection}
+% \begin{counter}{paragraph}
+% \begin{command}{\theparagraph}
+% \begin{counter}{subparagraph}
+% \begin{command}{\thesubparagraph}
+% The counter would also be defined by \cs{DeclareSectionCommand}. But because
+% of handling \cs{frontmatter} and \cs{backmatter} and prefix lines we cannot
+% use the default definition of the formatting of \cnt{section}. So we define
+% it already before calling \cs{DeclareSectionCommand} for \cs{section}.
+% \begin{description}
+% \item[ToDo:] Do we really need the explicit definition of \cnt{subsection},
+% \cnt{subsubsection}, \cnt{paragraph}, and \cnt{subparagraph} of would the
+% implicit definition by \cs{DeclareSectionCommand} be enough for these.
+% \end{description}
% \begin{macrocode}
%<*book|report>
\newcounter{section}[chapter]
@@ -6131,36 +6049,34 @@
}
% \end{macrocode}
% \begin{macro}{\@seccntformat}
-% \changes{v2.3c}{1995/08/06}{CJK erweitert}%^^A
-% \changes{v2.9p}{2004/01/07}{\cs{protect} eingefügt}%^^A
-% \changes{v2.97}{2007/01/24}{Workaround für das blöde \cs{protect}}%^^A
-% \changes{v3.17}{2015/02/23}{verwendet \cs{\dots format}, wenn es
-% existiert}%^^A
-% \changes{v3.17}{2015/03/31}{verwendet \cs{protect} für \cs{\dots
-% format}}%^^A
-% \begin{macro}{\othersectionlevelsformat}
-% \changes{v2.7}{2000/01/03}{neu}%^^A
-% \changes{v2.7}{2000/01/03}{\cs{quad} durch \cs{enskip} ersetzt}%^^A
-% \changes{v2.7i}{2001/05/17}{\cs{let} durch \cs{def} ersetzt}%^^A
-% \changes{v2.97}{2007/01/24}{statt einem Argument jetzt drei}%^^A
-% Bei den Ebenen ab \cs{section} erfolgt die Formatierung der
-% Gliederungnummer in der Überschrift mit einer gemeinsamen
-% Anweisung. Die interne Anweisung \cs{@seccntformat} wird dabei von
-% \LaTeX-Kern verwendet und muss umdefiniert werden, um eine
-% entsprechende Anweisung auf Anwenderebene verfügbar zu haben.
-% Ab Version 2.9p wurde in \cs{@seccntformat} ein \cs{protect} vor
-% \cs{othersectionlevelsformat} eingefügt. Damit wurde es für den Benutzer
-% deutlich einfacher, die Anweisung \cs{othersectionlevelsformat}
-% umzudefinieren. Dafür war dadurch aber \cs{the\dots} nicht mehr
-% expandiert. Das wiederum gab Probleme, wenn \cs{@seccntformat} für den
-% \cs{mark}-Mechanismus genutzt wurde. Deshalb hat
-% \cs{othersectionlevelsformat} ab Version 2.97 drei Argumente statt nur
-% eines. Das zweite Argument sollte vom Anwender ignoriert werden, es
-% existiert nur, um die Kompatibitlität Umdefinitionen zu erhalten, bei denen
-% \cs{othersectionlevelsformat} nur ein Argument besitzt. Das dritte Argument
-% ist die \cs{the\dots}-Anweisung. Das zweite Argument funktioniert so, das es
-% das dritte Argument frisst, falls \cs{othersectionlevelsformat} nur ein
-% Argument liest.
+% \changes{v2.3c}{1995/08/06}{CJK support extended}
+% \changes{v2.9p}{2004/01/07}{\cs{protect} added}
+% \changes{v2.97}{2007/01/24}{workaround for the ugly \cs{protect}}
+% \changes{v3.17}{2015/02/23}{using \cs{\dots format} if exists}
+% \changes{v3.17}{2015/03/31}{using \cs{protect} for \cs{\dots format}}
+% \begin{command}{\othersectionlevelsformat}
+% \changes{v2.7}{2000/01/03}{added}
+% \changes{v2.7}{2000/01/03}{\cs{quad} replaced by \cs{enskip}}
+% \changes{v2.7i}{2001/05/17}{\cs{let} replaced by \cs{def}}
+% \changes{v2.97}{2007/01/24}{three arguments instead of only one}
+% With \KOMAScript~2 \cs{othersectionlevelsformat} has had only one argument,
+% the \cs{…format} command of the level. But with there has been expansion
+% issues. So we have had to change the definition to
+% \begin{quote}
+% \cs{othersectionlevelsformat}\marg{level name}\marg{ignore
+% command}\marg{the command}
+% \end{quote}
+% Users who use or redefine \cs{othersectionlevelsformat} should always ignore
+% the \meta{ignore command}. It is used to internally handle deprecated
+% definitions of \cs{othersectionlevelsformat} with only one
+% argument. \meta{level name} is the name of the level command, e.g.,
+% |subsubsection|. \meta{the command} is the \cs{the…} command corresponding
+% with \marg{level name}. See the definition of \cs{@seccntformat} for more
+% information about the internal usage of \cs{othersectionlevelsformat}.
+% \begin{description}
+% \item[ToDo:] Can we somehow change this for \KOMAScript~4 to no longer
+% support the second argument (unless a low compatibility level is used)?
+% \end{description}
% \begin{macrocode}
\newcommand*{\othersectionlevelsformat}[3]{#3\autodot\enskip}
\renewcommand*{\@seccntformat}[1]{%
@@ -6175,26 +6091,28 @@
\fi
}
% \end{macrocode}
-% \end{macro}%^^A \othersectonlevelsformat
-% \end{macro}%^^A \@seccntformat
-% \end{macro}%^^A \thesubparagraph
-% \end{Counter}%^^A subparagraph
-% \end{macro}%^^A \theparagraph
-% \end{Counter}%^^A paragraph
-% \end{macro}%^^A \thesubsubsection
-% \end{Counter}%^^A subsubsection
-% \end{macro}%^^A \subsectionformat
-% \end{macro}%^^A \thesubsection
-% \end{Counter}%^^A subsection
-% \end{macro}%^^A \sectionformat
-% \end{macro}%^^A \thesection
-% \end{Counter}%^^A section
-%
-%
-% \begin{macro}{\addsecmark}
-% \changes{v3.12}{2013/03/26}{neue Anweisung}%^^A
-% \cs{addsecmark} wird nicht von den Seitenstilen definiert, sondern direkt
-% mit der gewünschten Definition initialisiert.
+% \end{command}^^A \othersectonlevelsformat
+% \end{macro}^^A \@seccntformat
+% \end{command}^^A \thesubparagraph
+% \end{counter}^^A subparagraph
+% \end{command}^^A \theparagraph
+% \end{counter}^^A paragraph
+% \end{command}^^A \thesubsubsection
+% \end{counter}^^A subsubsection
+% \end{command}^^A \subsectionformat
+% \end{command}^^A \thesubsection
+% \end{counter}^^A subsection
+% \end{command}^^A \sectionformat
+% \end{command}^^A \thesection
+% \end{counter}^^A section
+%
+%
+% \begin{command}{\addsecmark}
+% \changes{v3.12}{2013/03/26}{added}
+% \cs{addsec} and marks for running heads are a little bit
+% complicated. Currently we are using a local setting of \cnt{secnumdept} to
+% switch of numbering and then using \cs{sectionmark}. So the \cs{sectionmark}
+% definition should always respect \cnt{secnumdepth}.
% \begin{macrocode}
\newcommand*\addsecmark[1]{%
\begingroup
@@ -6203,193 +6121,122 @@
\endgroup
}
% \end{macrocode}
-% \end{macro}%^^A \addsecmark
-%
-% \begin{KOMAfont}{section}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{section}}%^^A
-% \begin{macro}{\scr@fnt@section}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{section}}%^^A
-% \begin{KOMAfont}{subsection}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{subsection}}%^^A
-% \begin{macro}{\scr@fnt@subsection}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{subsection}}%^^A
-% \begin{KOMAfont}{subsubsection}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{subsubsection}}%^^A
-% \begin{macro}{\scr@fnt@subsubsection}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{subsubsection}}%^^A
-% \begin{KOMAfont}{paragraph}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{paragraph}}%^^A
-% \begin{macro}{\scr@fnt@paragraph}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{paragraph}}%^^A
-% \begin{KOMAfont}{subparagraph}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{subparagraph}}%^^A
-% \begin{macro}{\scr@fnt@subparagraph}
-% \changes{v2.8o}{2001/09/14}{neues Element \texttt{subparagraph}}%^^A
-% \begin{KOMAfont}{minisec}
-% \changes{v2.8o}{2001/09/14}{neuer Ersatz für das Element
-% \texttt{minisec}}%^^A
-% \changes{v2.96a}{2007/01/08}{Alias für das Element \texttt{minisec}%^^A
-% entfernt, da es nun ein eigenes Element ist}%^^A
-% Definition der Elemente der Gliederung, deren Schrift geändert
-% werden kann.
-% \begin{macrocode}
-\newcommand*{\scr@fnt@section}{\size@section}
-\newcommand*{\scr@fnt@subsection}{\size@subsection}
-\newcommand*{\scr@fnt@subsubsection}{\size@subsubsection}
-\newcommand*{\scr@fnt@paragraph}{\size@paragraph}
-\newcommand*{\scr@fnt@subparagraph}{\size@subparagraph}
-% \end{macrocode}
-% \end{KOMAfont}%^^A minisec
-% \end{macro}
-% \end{KOMAfont}
-% \end{macro}
-% \end{KOMAfont}
-% \end{macro}
-% \end{KOMAfont}
-% \end{macro}
-% \end{KOMAfont}
-% \end{macro}
-% \end{KOMAfont}
+% \end{command}^^A \addsecmark
+%
%
-% \begin{KOMAfont}{sectionentry}
-% \changes{v2.97c}{2007/06/21}{neues Font-Element}%^^A
-% \changes{v3.06}{2010/06/09}{Verwendung von \texttt{sectioning} durch
-% \texttt{disposition} ersetzt}%^^A
-% Schrift für den \cs{section}-Eintrag im Inhaltsverzeichnis.
+% \begin{fontelement}{sectionentry}
+% \changes{v2.97c}{2007/06/21}{added}
+% \changes{v3.06}{2010/06/09}{font element \fnt{sectioning} replaced by
+% \fnt{disposition}}
+% With \cls*{scrartcl} \cs{section} entries to the table of contents initially
+% using \fnt{disposition}, the basic font of all outlines.
% \begin{macrocode}
%<*article>
\newkomafont{sectionentry}{\usekomafont{disposition}}
% \end{macrocode}
-% \end{KOMAfont}
+% \end{fontelement}
%
-% \begin{KOMAfont}{sectionentrypagenumber}
-% \changes{v2.97c}{2007/06/21}{neues Font-Element}%^^A
-% Schrift für die Seitenzahl des \cs{section}-Eintrags im Inhaltsverzeichnis
-% abweichend von \texttt{sectionentry}.
+% \begin{fontelement}{sectionentrypagenumber}
+% \changes{v2.97c}{2007/06/21}{added}
+% The page number of \cs{section} entries to the table of contents is
+% initially the same as the entry at whole with \cls*{scrartcl}.
% \begin{macrocode}
\newkomafont{sectionentrypagenumber}{}
% \end{macrocode}
-% \end{KOMAfont}
+% \end{fontelement}
%
-% \begin{KOMAfont}{sectionentrydots}
-% \changes{v3.15}{2014/12/10}{neues Font-Element}%^^A
-% \changes{v3.27}{2019/10/28}{überflüssiges \cs{normalfont} entfernt}%^^A
-% Schrift für die optionalen Pünktchen des \cs{section}-Eintrags im
-% Inhaltsverzeichnis abweichend von \texttt{sectionentry} und
-% \cs{normalfont}\cs{normalsize}.
+% \begin{fontelement}{sectionentrydots}
+% \changes{v3.15}{2014/12/10}{added}
+% \changes{v3.27}{2019/10/28}{\cs{normalfont} removed}
+% If the optional dots for \cs{section} entries to the table of contents are
+% used, we can change the font of the dots also. It is used for the
+% \texttt{linefill} of \pkg*{tocbasic} ToC entry style \texttt{section}, that
+% uses ToC entry style \texttt{tocline} where the line filler is always
+% prefixed by \cs{normalfont}\cs{normalsize}. So the setting is relative to
+% this. The color is relative to the color of \fnt{sectionentry}.
% \begin{macrocode}
\newkomafont{sectionentrydots}{}
%</article>
% \end{macrocode}
-% \end{KOMAfont}
-%
-%
-% \begin{macro}{\partnumdepth}
-% \changes{v3.12}{2013/12/16}{new read only command}%^^A
-% \changes{v3.18}{2015/05/24}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\chapternumdepth}
-% \changes{v3.12}{2013/12/16}{new read only command}%^^A
-% \changes{v3.18}{2015/05/20}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\sectionnumdepth}
-% \changes{v3.12}{2013/12/16}{new read only command}%^^A
-% \changes{v3.15}{2014/12/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\subsectionnumdepth}
-% \changes{v3.12}{2013/12/16}{new read only command}%^^A
-% \changes{v3.15}{2014/12/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\subsubsectionnumdepth}
-% \changes{v3.12}{2013/12/16}{new read only command}%^^A
-% \changes{v3.15}{2014/12/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\paragraphnumdepth}
-% \changes{v3.12}{2013/12/16}{new read only command}%^^A
-% \changes{v3.15}{2014/12/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\subparagraphnumdepth}
-% \changes{v3.12}{2013/12/16}{new read only command}%^^A
-% \changes{v3.15}{2014/12/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% Diese dürfen nur gelesen, sollten aber nie umdefiniert werden und geben die
-% Nummerierungsebene der Gliederungsanweisungen an (nicht zu verwechseln mit
-% der Verzeichnisebene der Gliederungsanweisungen).
-% \begin{macro}{\parttocdepth}
-% \changes{v3.15}{2014/12/22}{neue Anweisung}%^^A
-% \changes{v3.18}{2015/05/25}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\chaptertocdepth}
-% \changes{v3.15}{2014/12/22}{neue Anweisung}%^^A
-% \changes{v3.18}{2015/05/20}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\sectiontocdepth}
-% \changes{v3.15}{2014/12/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\subsectiontocdepth}
-% \changes{v3.15}{2014/12/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\subsubsectiontocdepth}
-% \changes{v3.15}{2014/12/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\paragraphtocdepth}
-% \changes{v3.15}{2014/12/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\subparagraphtocdepth}
-% \changes{v3.15}{2014/12/09}{indirekt über \cs{DeclareSectionCommand}}%^^A
-% Diese dürfen nur gelesen, sollten aber nie umdefiniert werden und geben die
-% Verzeichnisebene der Gliederungsanweisungen an.
-% \begin{macro}{\part}
-% \changes{v3.18}{2015/05/25}{Verwendung von \cs{DeclareSectionCommand}}%^^A
-% \changes{v3.26}{2018/06/27}{Definition nach \cs{section} verschoben (wegen
-% bookmark level fix)}%^^A
-% \begin{macro}{\chapter}
-% \changes{v2.8d}{2001/07/05}{\cs{chapterpagestyle} statt
-% \texttt{plain}}%^^A
-% \changes{v3.18}{2015/05/20}{Verwendung von \cs{DeclareSectionCommand}}%^^A
-% Als Besonderheit werden für \cs{chapter} nur diejenigen Werte gesetzt, die
-% nicht über Optionen eingestellt werden können und daher vorab deklariert
-% werden müssen. Bei den Anweisungen der unteren Ebenen werden hingegen alle
-% Einstellungen über \cs{DeclareSectionCommand} vorgenommen.
-% \begin{macro}{\section}
-% \changes{v2.8p}{2001/09/22}{\cs{sectfont} wird nun vor
-% \cs{size@section} aufgerufen}%^^A
-% \changes{v2.8q}{2002/02/28}{\cs{nobreak} nach \cs{sectfont}
-% behebt einen Bug im color Paket}%^^A
-% \changes{v2.96a}{2006/11/30}{Standardwert für \cs{parfillskip} (abhängig
-% von Option \texttt{version})}%^^A
-% \changes{v2.96a}{2006/12/03}{alle nicht benötigten \cs{nobreak} entfernt}%^^A
-% \changes{v3.13a}{2014/09/11}{Verwendung von \cs{scr@startsection}}%^^A
-% \changes{v3.15}{2014/11/24}{Verwendung von \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\subsection}
-% \changes{v2.8p}{2001/09/22}{\cs{sectfont} wird nun vor
-% \cs{size@subsection} aufgerufen}%^^A
-% \changes{v2.8q}{2002/02/28}{\cs{nobreak} nach \cs{sectfont}
-% behebt einen Bug im color Paket}%^^A
-% \changes{v2.96a}{2006/11/30}{Standardwert für \cs{parfillskip} (abhängig
-% von Option \texttt{version})}%^^A
-% \changes{v2.96a}{2006/12/03}{alle nicht benötigten \cs{nobreak} entfernt}%^^A
-% \changes{v3.13a}{2014/09/11}{Verwendung von \cs{scr@startsection}}%^^A
-% \changes{v3.15}{2014/11/24}{Verwendung von \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\subsubsection}
-% \changes{v2.3d}{1995/08/19}{wird bei \texttt{scrartcl} nun
-% ebenfalls numeriert und ins Inhaltsverzeichnis geschrieben}%^^A
-% \changes{v2.8p}{2001/09/22}{\cs{sectfont} wird nun vor
-% \cs{size@subsubsection} aufgerufen}%^^A
-% \changes{v2.8q}{2002/02/28}{\cs{nobreak} nach \cs{sectfont}
-% behebt einen Bug im color Paket}%^^A
-% \changes{v2.96a}{2006/11/30}{Standardwert für \cs{parfillskip} (abhängig
-% von Option \texttt{version})}%^^A
-% \changes{v2.96a}{2006/12/03}{alle nicht benötigten \cs{nobreak} entfernt}%^^A
-% \changes{v3.13a}{2014/09/11}{Verwendung von \cs{scr@startsection}}%^^A
-% \changes{v3.15}{2014/11/24}{Verwendung von \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\paragraph}
-% \changes{v2.8p}{2001/09/22}{\cs{sectfont} wird nun vor
-% \cs{size@paragraph} aufgerufen}%^^A
-% \changes{v2.8q}{2002/02/28}{\cs{nobreak} nach \cs{sectfont}
-% behebt einen Bug im color Paket}%^^A
-% \changes{v2.96a}{2006/12/03}{alle nicht benötigten \cs{nobreak} entfernt}%^^A
-% \changes{v3.15}{2014/11/24}{Verwendung von \cs{DeclareSectionCommand}}%^^A
-% \begin{macro}{\subparagraph}
-% \changes{v2.8p}{2001/09/22}{\cs{sectfont} wird nun vor
-% \cs{size@subparagraph} aufgerufen}%^^A
-% \changes{v2.8q}{2002/02/28}{\cs{nobreak} nach \cs{sectfont}
-% behebt einen Bug im color Paket}%^^A
-% \changes{v2.96a}{2006/12/03}{alle nicht benötigten \cs{nobreak} entfernt}%^^A
-% \changes{v3.13a}{2014/09/11}{Verwendung von \cs{scr@startsection}}%^^A
-% \changes{v3.15}{2014/11/24}{Verwendung von \cs{DeclareSectionCommand}}%^^A
-% \changes{v3.15}{2014/11/24}{\cs{parindent} durch \cs{scr@parindent}
-% ersetzt}%^^A
-% Die Standardgliederungsbefehle \cs{section} bis \cs{subparagraph}
-% sind seit \KOMAScript{} v3.15 über die von \KOMAScript{} bereitgestellte
-% Schnittstelle \cs{DeclareSectionCommand} definiert.
+% \end{fontelement}
+%
+%
+% \begin{command}{\partnumdepth,\chapternumdepth,
+% \sectionnumdepth,\subsectionnumdepth,\subsubsectionnumdepth,
+% \paragraphnumdepth,\subparagraphnumdepth,
+% \parttocdepth,\chaptertocdepth
+% \sectiontocdepth,\subsectiontocdepth,\subsubsectiontocdepth,
+% \paragraphtocdepth,\subparagraphtocdepth}
+% \changes{v3.12}{2013/12/16}{added}
+% \changes{v3.15}{2014/12/09}{indirect definition by
+% \cs{DeclareSectionCommand}}
+% The section numbering levels, to be compared with counter
+% \cnt{secnumdepth}, and the table of contents entry levels, to be compared
+% with counter \cs{tocdepth}, of all outline commands defined by the
+% \KOMAScript{} classes.
+% \begin{description}
+% \item[Note:] These are specified to be \emph{read only}. They are defined by
+% \cs{DeclareSectionCommand}.
+% \end{description}
+% \end{command}^^A \partnumdepth … \subparagraphtocdepth
+%
+% \begin{command}{\part}
+% \changes{v3.18}{2015/05/25}{indirect definition by \cs{DeclareSectionCommand}}
+% \changes{v3.26}{2018/06/27}{definition moved behind \cs{section} because of
+% bookmark level workaround}
+% \begin{command}{\chapter}
+% \changes{v2.8d}{2001/07/05}{using \cs{chapterpagestyle}}
+% \changes{v3.18}{2015/05/20}{indirect definition by \cs{DeclareSectionCommand}}
+% \begin{command}{\section}
+% \changes{v2.8p}{2001/09/22}{\cs{sectfont} before \cs{size@section}}
+% \changes{v2.8q}{2002/02/28}{\cs{nobreak} after \cs{sectfont} added}
+% \changes{v2.96a}{2006/11/30}{initial value of \cs{parfillskip} depending on
+% option \opt{version}}
+% \changes{v2.96a}{2006/12/03}{not needed \cs{nobreak} removed}
+% \changes{v3.13a}{2014/09/11}{using \cs{scr@startsection}}
+% \changes{v3.15}{2014/11/24}{indirect definition by \cs{DeclareSectionCommand}}
+% \begin{command}{\subsection}
+% \changes{v2.8p}{2001/09/22}{\cs{sectfont} before \cs{size@subsection}}
+% \changes{v2.8q}{2002/02/28}{\cs{nobreak} after \cs{sectfont} added}
+% \changes{v2.96a}{2006/11/30}{initial value of \cs{parfillskip} depending on
+% option \opt{version}}
+% \changes{v2.96a}{2006/12/03}{not needed \cs{nobreak} removed}
+% \changes{v3.13a}{2014/09/11}{using \cs{scr@startsection}}
+% \changes{v3.15}{2014/11/24}{indirect definition by \cs{DeclareSectionCommand}}
+% \begin{command}{\subsubsection}
+% \changes{v2.3d}{1995/08/19}{with \cls*{scrartcl} also numbered and added to
+% ToC}
+% \changes{v2.8p}{2001/09/22}{\cs{sectfont} added before
+% \cs{size@subsubsection}}
+% \changes{v2.8q}{2002/02/28}{\cs{nobreak} added after \cs{sectfont}}
+% \changes{v2.96a}{2006/11/30}{initial value of \cs{parfillskip} depending on
+% option \opt{version}}
+% \changes{v2.96a}{2006/12/03}{not needed \cs{nobreak} removed}
+% \changes{v3.13a}{2014/09/11}{using \cs{scr@startsection}}
+% \changes{v3.15}{2014/11/24}{indirect definition by \cs{DeclareSectionCommand}}
+% \begin{command}{\paragraph}
+% \changes{v2.8p}{2001/09/22}{\cs{sectfont} added before
+% \cs{size@paragraph}}
+% \changes{v2.8q}{2002/02/28}{\cs{nobreak} added after \cs{sectfont}}
+% \changes{v2.96a}{2006/12/03}{not needed \cs{nobreak} removed}
+% \changes{v3.15}{2014/11/24}{indirect definition by \cs{DeclareSectionCommand}}
+% \begin{command}{\subparagraph}
+% \changes{v2.8p}{2001/09/22}{\cs{sectfont} added before
+% \cs{size@subparagraph}}
+% \changes{v2.8q}{2002/02/28}{\cs{nobreak} added after \cs{sectfont}}
+% \changes{v2.96a}{2006/12/03}{not needed \cs{nobreak} removed}
+% \changes{v3.13a}{2014/09/11}{using \cs{scr@startsection}}
+% \changes{v3.15}{2014/11/24}{indirect definition by \cs{DeclareSectionCommand}}
+% \changes{v3.15}{2014/11/24}{\cs{parindent} replaced by \cs{scr@parindent}}
+% Commands \cs{part}, \cs{chapter}, \cs{section}, \cs{subsection},
+% \cs{subsubection}, \cs{paragraph} and \cs{subparagraph} are defined using
+% \cs{DeclareSectionCommand}. The definition of \cs{part} must be \emph{after}
+% \cs{section} because of the bookmark level workaround (see definition of
+% \cs{DelcareSectionCommand}. The declaration of \cs{chapter} uses only those
+% settings that do not depend on options, because settings by class options
+% must no be overwritten here. So all settings that do depend on class options
+% have to be initialized before the options (see the \texttt{prepare} code of
+% such options above). For the lower levels this is only the case for the font.
% \begin{macrocode}
%<*book|report>
\DeclareSectionCommand[%
@@ -6483,118 +6330,188 @@
\def\scr@subparagraph@sectionindent{\scr@parindent}%
\fi
%</body>
-%</class>
-% \end{macrocode}
-% \end{macro}%^^A \subparagraph
-% \end{macro}%^^A \paragraph
-% \end{macro}%^^A \subsubsection
-% \end{macro}%^^A \subsection
-% \end{macro}%^^A \section
-% \end{macro}%^^A \chapter
-% \end{macro}%^^A \part
-% \end{macro}%^^A \subparargraphtocdepth
-% \end{macro}%^^A \paragraphtocdepth
-% \end{macro}%^^A \subsubsectiontocdepth
-% \end{macro}%^^A \subsectiontocdepth
-% \end{macro}%^^A \sectiontocdepth
-% \end{macro}%^^A \chaptertocdepth
-% \end{macro}%^^A \parttocdepth
-% \end{macro}%^^A \subparargraphnumdepth
-% \end{macro}%^^A \paragraphnumdepth
-% \end{macro}%^^A \subsubsectionnumdepth
-% \end{macro}%^^A \subsectionnumdepth
-% \end{macro}%^^A \sectionnumdepth
-% \end{macro}%^^A \chapternumdepth
-% \end{macro}%^^A \partnumdepth
-%
-%
-% \subsection{Font und Größeneinstellungen}
-%
-% Die Einstellungen für die einzelnen Ebenen werden bei den Definitonen der
-% Ebenen vorgenommen. Hier gibt es nur Einstellungen, die nicht einer
-% einzelnen Ebene zugeordnet sind.
-%
-% \begin{KOMAfont}{disposition}
-% \changes{v2.95b}{2006/07/30}{neues Element \texttt{disposition}}%^^A
-% \begin{KOMAfont}{sectioning}
-% \begin{macro}{\scr@fnt@disposition}
-% \changes{v2.95b}{2006/07/30}{neues Element \texttt{disposition}}%^^A
+% \end{macrocode}
+% \end{command}^^A \subparagraph
+% \end{command}^^A \paragraph
+% \end{command}^^A \subsubsection
+% \end{command}^^A \subsection
+% \end{command}^^A \section
+% \end{command}^^A \chapter
+% \end{command}^^A \part
+%
+%
+% \subsection{Fonts}
+%
+% The font settings of dedicated elements of the the corresponding section
+% levels already have been done. But there are also some elements that do not
+% correspond with a single section level.
+%
+% \begin{fontelement}{disposition}
+% \changes{v2.95b}{2006/07/30}{added}
+% \begin{fontelement}{sectioning}
+% \changes{v2.95b}{2006/07/30}{added}
% \begin{macro}{\sectfont}
-% \changes{v2.8c}{2001/06/29}{\cs{normalcolor} eingefügt}%^^A
-% \changes{v3.12}{2013/11/11}{wird wegen Option
-% \texttt{headings!=standardclasses} früher definiert}%^^A
-% \changes{v3.20}{2016/01/29}{\cs{sffamily} durch \cs{@gr@gsffamily}
-% ersetzt}%^^A
-% Dies Schriftart nicht nur für die Gliederungsbefehle. Dieses Makro
-% ist als intern zu betrachten. Der Anwender sollte stattdessen das
-% entsprtechende Fontelement verwenden.
-% \begin{macrocode}
-%<*prepare>
+% \changes{v2.8c}{2001/06/29}{\cs{normalcolor} added}
+% \changes{v3.12}{2013/11/11}{earlier definition to support option
+% \opt{headings\quotechar=standardclasses}}
+% \changes{v3.20}{2016/01/29}{\cs{sffamily} replaced by \cs{@gr@gsffamily}}
+% This element is not only used by all section levels before the dedicated
+% element of the single level is used. It is also used by other elements like
+% the \fnt{chaptertocentry}. The command \cs{sectfont} instead of the
+% \cs{newkomafont} default is used for compatibility only. So it is specified
+% as internal. Using it as user command is deprecated!
+% \begin{macrocode}
+%</class&!letter>
+%<*(class&!letter)|(package&extend)>
+%<*prepare>
\newcommand*{\sectfont}{\normalcolor\@gr@gsffamily\bfseries}
%</prepare>
+%</(class&!letter)|(package&extend)>
+%<*class&!letter>
%<*body>
\newcommand*{\scr@fnt@disposition}{\sectfont}
\aliaskomafont{sectioning}{disposition}
%</body>
% \end{macrocode}
-% \end{macro}%^^A \sectfont
-% \end{macro}%^^A \scr@fnt@disposition
-% \end{KOMAfont}%^^A sectioning
-% \end{KOMAfont}%^^A disposition
+% \end{macro}^^A \sectfont
+% \end{fontelement}^^A sectioning
+% \end{fontelement}^^A disposition
%
%
% \begin{option}{headings}
-% \changes{v2.3h}{1996/01/20}{Größe von \cs{chapter} um eine Stufe
-% verringert}%^^A
-% \changes{v2.3h}{1996/01/20}{Verwendung von \cs{chapterheadstartvskip} und
-% \cs{chapterheadendvskip} an Stelle von festen vertikalen Abständen am
-% Anfang und am Ende eines Kapitels}%^^A
-% \changes{v2.7c}{2000/01/19}{vertikale Abstände nach der Kapitelüberschrift
-% geringfügig verändert und mit Leim versehen, um mit \cs{flushbottom} zu
-% besseren Ergebnissen zu gelangen}%^^A
-% \changes{v2.98c}{2008/03/10}{Neue Option}%^^A
-% \changes{v3.10}{2011/08/30}{Integration der Erweiterung für das optionale
-% Argument der Gliederungsbefehle}%^^A
-% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit
-% \cs{FamilyKeyState}}%^^A
-% \changes{v3.12}{2013/08/26}{\cs{KOMA@options} durch \cs{KOMAoptions}
-% ersetzt}%^^A
-% \changes{v3.12}{2013/11/11}{neuer Wert \texttt{standardclasses}}%^^A
-% \changes{v3.15}{2014/11/24}{\cs{scr@chapter@beforeskip} und
-% \cs{scr@chapter@afterskip} werden verwendet}%^^A
-% \changes{v3.17}{2015/03/09}{interne Speicherung des Wert}%^^A
-% \changes{v3.18}{2015/05/20}{Werte für \cs{scr@chapter@beforeskip}
-% negiert}%^^A
-% Dies ist eine neue zentrale Option für Überschriften. Dabei ergibt sich
-% nun auch das Problem, dass die Gesamtmenge der Überschriften mal
-% \emph{headings} (Überschriften), mal \emph{sectioning}
-% (Abschnittseinteilung) und mal \emph{disposition} (Gliederung) genannt
-% wird. Es wäre gut gewesen, sich bei Zeiten Gedanken darüber zu machen, wie
-% man das am besten einheitlich nennt.
-% \begin{macrocode}
-%<*class>
+% \changes{v2.3h}{1996/01/20}{Size of \cs{chapter} decreased by one grade
+% step}
+% \changes{v2.3h}{1996/01/20}{using \cs{chapterheadstartvskip} and
+% \cs{chapterheadendvskip}}
+% \changes{v2.7c}{2000/01/19}{vertical distance after chapters slightly
+% changed and glue added}
+% \changes{v2.98c}{2008/03/10}{added}
+% \changes{v3.10}{2011/08/30}{extended optional argument}
+% \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyState}}
+% \changes{v3.12}{2013/08/26}{\cs{KOMA@options} replaced by \cs{KOMAoptions}}
+% \changes{v3.12}{2013/11/11}{value \opt{\quotechar=standardclasses} added}
+% \changes{v3.15}{2014/11/24}{using \cs{scr@chapter@beforeskip} and
+% \cs{scr@chapter@afterskip}}
+% \changes{v3.17}{2015/03/09}{using internal value storage}
+% \changes{v3.18}{2015/05/20}{values of \cs{scr@chapter@beforeskip} negative}
+% Option \opt{headings} is the main switch for the headings of all outlines.
+% It provides the following values:
+% \begin{macrocode}
%<*option>
\KOMA@key{headings}{%
\KOMA@set@ncmdkey{headings}{@tempa}{%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=big}:] use big sized headings. This also changes the distances
+% of chapter and redefined \cs{chapterheadstartvskip} and
+% \cs{chapterheadendvskip} (\cls*{scrbook} and \cls*{scrreprt} only).
+% \end{description}
+% \begin{macrocode}
{big}{0},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=normal}:] use medium sized headings. This also changes the
+% distances of chapter and redefined \cs{chapterheadstartvskip} and
+% \cs{chapterheadendvskip} (\cls*{scrbook} and \cls*{scrreprt} only).
+% \end{description}
+% \begin{macrocode}
{normal}{1},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=small}:] use small sized headings. This also changes the
+% distances of chapter and redefined \cs{chapterheadstartvskip} and
+% \cs{chapterheadendvskip} (\cls*{scrbook} and \cls*{scrreprt} only).
+% \end{description}
+% \begin{macrocode}
{small}{2},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=openany}:] same as \opt{open=any} for \cls*{scrbook} and
+% \cls*{scrreprt}.
+% \end{description}
+% \begin{macrocode}
%<*book|report>
{openany}{3},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=openright}:] same as \opt{open=right} for \cls*{scrbook} and
+% \cls*{scrreprt}.
+% \end{description}
+% \begin{macrocode}
{openright}{4},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=openleft}:] same as \opt{open=left} for \cls*{scrbook} and
+% \cls*{scrreprt}.
+% \end{description}
+% \begin{macrocode}
{openleft}{5},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=twolinechapter}:] use chapter headings with two lines. The first
+% line is a kind of prefix line with the number and a prefix text only. The
+% second one is the heading text.
+% \end{description}
+% \begin{macrocode}
{twolinechapter}{6},{chapterprefix}{6},{chapterwithprefix}{6},%
{chapterwithprefixline}{6},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=onelinechapter}:] use chapter headings without the prefix line.
+% \end{description}
+% \begin{macrocode}
{onelinechapter}{7},{nochapterprefix}{7},{chapterwithoutprefix}{7},%
{chapterwithoutprefixline}{7},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=twolineappendix}:] use chapter headings with two lines in the
+% appendix. This overwrites \opt{headings=onelinechapter} for the chapters
+% of the appendix.
+% \end{description}
+% \begin{macrocode}
{twolineappendix}{8},{appendixprefix}{8},{appendixwithprefix}{8},%
{appendixwithprefixline}{8},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=onelineappendix}:] use chapter headings without prefix line in
+% the appendix. This overwrites \opt{headings=twolinechapter} for the
+% chapters of the appendix.
+% \end{description}
+% \begin{macrocode}
{onelineappendix}{9},{noappendixprefix}{9},{appendixwithoutprefix}{9},%
{appendixwithoutprefixline}{9},%
%</book|report>
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=optiontotocandhead}:] activates the extended option handling of
+% all outline commands and uses an unspecified optional argument as default
+% of for the running head and the ToC entry.
+% \end{description}
+% \begin{macrocode}
{optiontotocandhead}{10},{optiontoheadandtoc}{10},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=optiontotoc}:] activates the extended option handling of all
+% outline commands and uses an unspecified optional argument as default for
+% the ToC entry only.
+% \end{description}
+% \begin{macrocode}
{optiontotoc}{11},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=optiontohead}:] activated the extended option handling of all
+% outline commands and uses an unspecified optional argument as default fot
+% the running head.
+% \end{description}
+% \begin{macrocode}
{optiontohead}{12},%
+% \end{macrocode}
+% \begin{description}
+% \item[\opt{=standardclasses}:] reconfigure headings (at least the fonts) to
+% look more like the headings of the standard classes than the defaults of
+% \KOMAScript.
+% \end{description}
+% \begin{macrocode}
{standardclasses}{13}%
}{#1}%
\ifx\FamilyKeyState\FamilyKeyStateProcessed
@@ -6605,17 +6522,15 @@
\KOMA@kav@remove{.\KOMAClassFileName}{headings}{standardclasses}%
\KOMA@kav@add{.\KOMAClassFileName}{headings}{big}%
% \end{macrocode}
-% Als erstes kümmern wir uns um die drei Größenabstufungen für die
-% Überschriften, die \KOMAScript{} bietet, und zwar in der Reihenfolge
-% \texttt{big}, \texttt{normal}, \texttt{small}. Es sei darauf hingewiesen,
-% dass die Verwendung dieser Option alle Änderungen an
-% \cs{chapterheadstartvskip} oder \cs{chapterheadendvskip} oder den
-% Font-Elementen für die einzelnen Überschriften aufhebt macht!
-%
-% Hinweis: Es wurde |+\baselineskip+\parskip| hinzugefügt, um
-% Kompatibilitätsprobleme zu vermeiden. Die entsprechenden Werte werden in der
-% Präambel aber wieder abgezogen, um Überschriften wirklich mit
-% |beforeskip=0pt| an den oberen Rand zu bekommen.
+% First of all we handle the three size values.
+% \begin{description}
+% \item[Note:] These are redefining \cs{chapterheadstartvkip} and
+% \cs{chapterheadendvskip}.
+% \item[Note:] The |+\baselineskip+\parskip| is needed to stay compatible with
+% old version of \KOMAScript{} not providing \cs{DeclareSectionCommand}. They
+% are regarded inside setting of the preamble to print heading with
+% |beforeskip=0pt| at the very beginning of the text area.
+% \end{description}
% \begin{macrocode}
%<*book|report>
\renewcommand*{\scr@chapter@beforeskip}{-3.3\baselineskip-\parskip}%
@@ -6630,15 +6545,15 @@
}%
\renewcommand*{\chapterheadmidvskip}{\par\nobreak\vskip\@tempskipa}%
%</book|report>
- \renewcommand*{\size@part}{\Huge}%
- \renewcommand*{\size@partnumber}{\huge}%
-%<book|report> \renewcommand*{\size@chapter}{\huge}%
-%<book|report> \renewcommand*{\size@chapterprefix}{\size@chapter}%
- \renewcommand*{\size@section}{\Large}%
- \renewcommand*{\size@subsection}{\large}%
- \renewcommand*{\size@subsubsection}{\normalsize}%
- \renewcommand*{\size@paragraph}{\normalsize}%
- \renewcommand*{\size@subparagraph}{\normalsize}%
+ \setkomafont{part}{\Huge}%
+ \setkomafont{partnumber}{\huge}%
+%<book|report> \setkomafont{chapter}{\huge}%
+%<book|report> \setkomafont{chapterprefix}{\size@chapter}%
+ \setkomafont{section}{\Large}%
+ \setkomafont{subsection}{\large}%
+ \setkomafont{subsubsection}{\normalsize}%
+ \setkomafont{paragraph}{\normalsize}%
+ \setkomafont{subparagraph}{\normalsize}%
\or % normal
\KOMA@kav@remove{.\KOMAClassFileName}{headings}{big}%
\KOMA@kav@remove{.\KOMAClassFileName}{headings}{normal}%
@@ -6658,21 +6573,21 @@
}%
\renewcommand*{\chapterheadmidvskip}{\par\nobreak\vskip\@tempskipa}%
%</book|report>
- \renewcommand*{\size@part}{\huge}%
- \renewcommand*{\size@partnumber}{\huge}%
+ \setkomafont{part}{\huge}%
+ \setkomafont{partnumber}{\huge}%
%<*book|report>
- \renewcommand*{\size@chapter}{\LARGE}%
- \renewcommand*{\size@chapterprefix}{\size@chapter}%
- \renewcommand*{\size@section}{\Large}%
- \renewcommand*{\size@subsection}{\large}%
+ \setkomafont{chapter}{\LARGE}%
+ \setkomafont{chapterprefix}{\size@chapter}%
+ \setkomafont{section}{\Large}%
+ \setkomafont{subsection}{\large}%
%</book|report>
%<*article>
- \renewcommand*{\size@section}{\large}%
- \renewcommand*{\size@subsection}{\normalsize}%
+ \setkomafont{section}{\large}%
+ \setkomafont{subsection}{\normalsize}%
%</article>
- \renewcommand*{\size@subsubsection}{\normalsize}%
- \renewcommand*{\size@paragraph}{\normalsize}%
- \renewcommand*{\size@subparagraph}{\normalsize}%
+ \setkomafont{subsubsection}{\normalsize}%
+ \setkomafont{paragraph}{\normalsize}%
+ \setkomafont{subparagraph}{\normalsize}%
\or % small
\KOMA@kav@remove{.\KOMAClassFileName}{headings}{big}%
\KOMA@kav@remove{.\KOMAClassFileName}{headings}{normal}%
@@ -6692,24 +6607,23 @@
}%
\renewcommand*{\chapterheadmidvskip}{\par\nobreak\vskip\@tempskipa}%
%</book|report>
- \renewcommand*{\size@part}{\LARGE}%
- \renewcommand*{\size@partnumber}{\LARGE}%
+ \setkomafont{part}{\LARGE}%
+ \setkomafont{partnumber}{\LARGE}%
%<*book|report>
- \renewcommand*{\size@chapter}{\Large}%
- \renewcommand*{\size@chapterprefix}{\size@chapter}%
- \renewcommand*{\size@section}{\large}%
+ \setkomafont{chapter}{\Large}%
+ \setkomafont{chapterprefix}{\size@chapter}%
+ \setkomafont{section}{\large}%
%</book|report>
%<*article>
- \renewcommand*{\size@section}{\normalsize}%
+ \setkomafont{section}{\normalsize}%
%</article>
- \renewcommand*{\size@subsection}{\normalsize}%
- \renewcommand*{\size@subsubsection}{\normalsize}%
- \renewcommand*{\size@paragraph}{\normalsize}%
- \renewcommand*{\size@subparagraph}{\normalsize}%
+ \setkomafont{subsection}{\normalsize}%
+ \setkomafont{subsubsection}{\normalsize}%
+ \setkomafont{paragraph}{\normalsize}%
+ \setkomafont{subparagraph}{\normalsize}%
% \end{macrocode}
-% Für \textsf{scrbook} und \textsf{scrreprt} gibt es dann noch die
-% Möglichkeit, auch hierüber die Optionen \texttt{open=any},
-% \texttt{open=right} und \texttt{open=left} zu setzen.
+% \cls*{scrbook} and \cls*{scrreprt} also provide settings that are delegated
+% to option \opt{open}.
% \begin{macrocode}
\or % openany
%<*book|report>
@@ -6724,9 +6638,8 @@
\KOMAoptions{open=left}%
%</book|report>
% \end{macrocode}
-% Für \textsf{scrbook} und \textsf{scrreprt} gibt es dann noch die
-% Möglichkeit, auch hierüber die Optionen \texttt{chapterprefix} und
-% \texttt{appendixprefix} zu setzen.
+% \cls*{scrbook} and \cls*{scrreprt} also provide settings that are delegated
+% to option \opt{chapterprefix} and \opt{appendixprefix}.
% \begin{macrocode}
\or % twolinechapter
%<*book|report>
@@ -6740,13 +6653,12 @@
%<*book|report>
\KOMAoptions{appendixprefix=true}%
%</book|report>
- \or % onelineappend
+ \or % onelineappendix
%<*book|report>
\KOMAoptions{appendixprefix=false}%
%</book|report>
% \end{macrocode}
-% Ab Version~3.10 wird über diese Option auch noch die Erweiterung für das
-% optionale Argument der Gliederungsüberschriften aktiviert und gesteuert.
+% We have also options to handle the extended optional argument.
% \begin{macrocode}
\or % optiontotocandhead
\KOMA@kav@remove{.\KOMAClassFileName}{headings}{optiontotocandhead}%
@@ -6767,8 +6679,8 @@
\KOMA@kav@add{.\KOMAClassFileName}{headings}{optiontohead}%
\scr@activate@xsection{1}%
% \end{macrocode}
-% Ab Version~3.12 gibt es noch die Möglichkeit, die Überschriftengrößen der
-% Standardklassen zu emulieren.
+% Last but not least the option to activate the standard class emulation of
+% headings.
% \begin{macrocode}
\or % standardclasses
\KOMA@kav@remove{.\KOMAClassFileName}{headings}{big}%
@@ -6783,20 +6695,20 @@
\renewcommand*{\chapterheadstartvskip}{\vspace{\@tempskipa}}%
\renewcommand*{\chapterheadendvskip}{\vskip\@tempskipa}%
\renewcommand*{\chapterheadmidvskip}{\par\nobreak\vskip\@tempskipa}%
- \renewcommand*{\size@part}{\Huge}%
- \renewcommand*{\size@partnumber}{\huge}%
- \renewcommand*{\size@chapter}{\Huge}%
- \renewcommand*{\size@chapterprefix}{\huge}%
+ \setkomafont{part}{\Huge}%
+ \setkomafont{partnumber}{\huge}%
+ \setkomafont{chapter}{\Huge}%
+ \setkomafont{chapterprefix}{\huge}%
%</book|report>
%<*article>
- \renewcommand*{\size@part}{\huge}%
- \renewcommand*{\size@partnumber}{\Large}%
+ \setkomafont{part}{\huge}%
+ \setkomafont{partnumber}{\Large}%
%</article>
- \renewcommand*{\size@section}{\Large}%
- \renewcommand*{\size@subsection}{\large}%
- \renewcommand*{\size@subsubsection}{\normalsize}%
- \renewcommand*{\size@paragraph}{\normalsize}%
- \renewcommand*{\size@subparagraph}{\normalsize}%
+ \setkomafont{section}{\Large}%
+ \setkomafont{subsection}{\large}%
+ \setkomafont{subsubsection}{\normalsize}%
+ \setkomafont{paragraph}{\normalsize}%
+ \setkomafont{subparagraph}{\normalsize}%
\renewcommand*{\sectfont}{\bfseries}%
%<book|report> \KOMAoptions{open=right,chapterprefix=true}%
\fi
@@ -6805,61 +6717,38 @@
\KOMA@kav@add{.\KOMAClassFileName}{headings}{big}
%<book|report>\KOMA@kav@add{.\KOMAClassFileName}{headings}{onelinechapter}
% \end{macrocode}
-% \end{option}%^^A headings
-%
-% \begin{option}{bigheadings}
-% \changes{v2.3h}{1996/01/20}{neue Option}%^^A
-% \changes{v2.4g}{1996/11/04}{die Option heißt nun wirklich so; bei
-% Verwendung des alten, falschen Namens wird ein Fehler
-% ausgegeben}%^^A
-% \changes{v2.98c}{2008/03/10}{obsolet}%^^A
-% \changes{v3.01a}{2008/11/20}{deprecated}%^^A
-% \begin{macro}{\@bigheadings}
-% \changes{v2.98c}{2008/03/10}{entfernt}%^^A
-% \begin{option}{normalheadings}
-% \changes{v2.3h}{1996/01/20}{neue Option}%^^A
-% \changes{v2.4g}{1996/11/04}{die Option heißt nun wirklich so; bei
-% Verwendung des alten, falschen Namens wird ein Fehler
-% ausgegeben}%^^A
-% \changes{v2.98c}{2008/03/10}{obsolet}%^^A
-% \changes{v3.01a}{2008/11/20}{deprecated}%^^A
-% \begin{macro}{\@normalheadings}
-% \changes{v2.98c}{2008/03/10}{entfernt}%^^A
-% \begin{option}{smallheadings}
-% \changes{v2.3h}{1996/01/20}{neue Option}%^^A
-% \changes{v2.4g}{1996/11/04}{die Option heißt nun wirklich so; bei
-% Verwendung des alten, falschen Namens wird ein Fehler
-% ausgegeben}%^^A
-% \changes{v2.98c}{2008/03/10}{obsolet}%^^A
-% \changes{v3.01a}{2008/11/20}{deprecated}%^^A
-% \begin{macro}{\@smallheadings}
-% \changes{v2.98c}{2008/03/10}{entfernt}%^^A
+% \end{option}^^A headings
+%
+% \begin{option}{bigheadings,normalheadings,smallheadings}
+% \changes{v2.3h}{1996/01/20}{added}
+% \changes{v2.4g}{1996/11/04}{option name fixed}
+% \changes{v2.98c}{2008/03/10}{obsolete}
+% \changes{v3.01a}{2008/11/20}{deprecated}
+% \begin{macro}{\@bigheadings,\@normalheadings,\@smallheadings}
+% \changes{v2.98c}{2008/03/10}{removed}
+% \end{macro}^^A \@bigheadings … \@smallheadings
+% We also have some deprecated options.
% \begin{macrocode}
\KOMA@DeclareDeprecatedOption{bigheadings}{headings=big}
\KOMA@DeclareDeprecatedOption{normalheadings}{headings=normal}
\KOMA@DeclareDeprecatedOption{smallheadings}{headings=small}
%</option>
-%</class>
% \end{macrocode}
-% \end{macro}%^^A \@smallheadings
-% \end{option}%^^A smallheadings
-% \end{macro}%^^A \@normalheadings
-% \end{option}%^^A normalheadings
-% \end{macro}%^^A \@bigheadings
-% \end{option}%^^A bigheadings
-%
-%
-% \iffalse
-%</!letter>
-% \fi
+% \end{option}^^A smallheading,normalheadings,bigheadings
%
+% \begin{macrocode}
+%</class&!letter>
+% \end{macrocode}
+%
% \Finale
-%
+% \PrintChanges
+%
\endinput
-%
-% end of file `scrkernel-sections.dtx'
-%%% Local Variables:
-%%% mode: doctex
-%%% coding: utf-8
-%%% TeX-master: t
-%%% End:
+% Local Variables:
+% mode: doctex
+% ispell-local-dictionary: "en_US"
+% eval: (flyspell-mode 1)
+% TeX-master: t
+% TeX-engine: luatex-dev
+% eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx"))
+% End: