summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/koma-script/source/scrextend.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/koma-script/source/scrextend.dtx')
-rw-r--r--macros/latex/contrib/koma-script/source/scrextend.dtx243
1 files changed, 123 insertions, 120 deletions
diff --git a/macros/latex/contrib/koma-script/source/scrextend.dtx b/macros/latex/contrib/koma-script/source/scrextend.dtx
index 63718bf10e..0be97835df 100644
--- a/macros/latex/contrib/koma-script/source/scrextend.dtx
+++ b/macros/latex/contrib/koma-script/source/scrextend.dtx
@@ -1,8 +1,7 @@
-% \CheckSum{74}
% \iffalse meta-comment
% ======================================================================
% scrextend.dtx
-% Copyright (c) Markus Kohm, 2002-2020
+% Copyright (c) Markus Kohm, 2002-2022
%
% This file is part of the LaTeX2e KOMA-Script bundle.
%
@@ -18,44 +17,8 @@
% The Current Maintainer and author of this work is Markus Kohm.
%
% This work consists of all files listed in manifest.txt.
-% ----------------------------------------------------------------------
-% scrextend.dtx
-% Copyright (c) Markus Kohm, 2002-2020
-%
-% 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: scrextend.dtx 3453 2020-02-25 07:33:30Z kohm $
+%%% From File: $Id: scrextend.dtx 3773 2022-03-29 06:27:55Z kohm $
%<preidentify>%%% (run: preidentify)
%<prepare>%%% (run: prepare)
%<option>%%% (run: option)
@@ -63,57 +26,66 @@
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\begingroup
\def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
- \filedate$Date: 2020-02-25 08:33:30 +0100 (Tue, 25 Feb 2020) $
+ \filedate$Date: 2022-03-29 08:27:55 +0200 (Tue, 29 Mar 2022) $
\def\filerevision$#1: #2 ${\gdef\filerevision{r#2}}
- \filerevision$Revision: 1962 $
+ \filerevision$Revision: 3773 $
\endgroup
\ProvidesFile{scrextend.dtx}[\filedate\space\filerevision\space
KOMA-Script package source
(extend other classes)]
-\documentclass[parskip=half-]{scrdoc}
-\usepackage[english,ngerman]{babel}
-\CodelineIndex
-\RecordChanges
-\GetFileInfo{scrextend.dtx}
-\title{\KOMAScript{} \partname\ \texttt{\filename}%
- \footnote{Dies ist Version \fileversion\ von Datei
- \texttt{\filename}.}}
-\date{\filedate}
-\author{Markus Kohm}
-
+\documentclass{koma-script-source-doc}
+\usepackage[USenglish]{babel}
+\setcounter{StandardModuleDepth}{2}
\begin{document}
- \maketitle
- \tableofcontents
- \DocInput{\filename}
+ \DocInput{scrextend.dtx}
\end{document}
%</dtx>
% \fi
%
-% \selectlanguage{ngerman}
+% \changes{v3.00}{2008/05/01}{new package}
+% \changes{v3.36}{2022/01/31}{switched from \cls*{scrdoc} to
+% \cls*{koma-script-source-doc}}
+% \changes{v3.36}{2022/01/31}{whole implementation documentation in English}
%
-% \changes{v3.00}{2008/05/01}{neues Paket}
+% \GetFileInfo{scrextend.dtx}
+% \title{Extending Non-\href{https://komascript.de}{\KOMAScript} Classes by
+% some \href{https://komascript.de}{\KOMAScript} Class Features using
+% \href{https://komascript.de}{\KOMAScript} Package \pkg*{scrextend}}
+% \author{\href{mailto:komascript@gmx.info}{Markus Kohm}}
+% \date{Revision \fileversion{} of \filedate}
+% \maketitle
+% \begin{abstract}
+% The purpose of this package is to provide \KOMAScript{} class features to
+% other classes, i.\,e., the standard classes too. On the other hand it does
+% not make sense to nor should you load this package, if you are using a
+% \KOMAScript{} class.
+% \end{abstract}
%
-% \section{Erweiterungen für andere Klassen}
+% \tableofcontents
%
-% Dieses Paket dient dazu, einige Möglichkeiten von \KOMAScript{} auch anderen
-% Klassen zur Verfügung zustellen. Dafür darf dieses Paket nicht mit einer
-% \KOMAScript-Klasse verwendet werden.
+% \section{User Manual}
%
-% \StopEventually{\PrintIndex\PrintChanges}
+% You can find the user manual of \pkg{scrextend} in the \KOMAScript{} manual,
+% either the German \file{scrguide} or the English \file{scrguien}.
%
-% \subsection{Vorbereitung noch vor der Identifizierung des Pakets}
+% \MaybeStop{\PrintIndex}
%
-% Die Vorbereitung ist einfach. Es wird nur getestet, ob bereits eine
-% \KOMAScript-Klasse geladen ist. Falls dem so ist, wird eine Warnung
-% ausgegeben und dafür gesorgt, dass das Paket nicht weiter abgearbeitet wird.
+% \section{Implementation}
%
-% \iffalse
-%<*preidentify>
-% \fi
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Before the identification of the package}
%
-% \changes{v3.30}{2020/02/25}{\cs{PackageWarningNoLine} statt
-% \cs{PackageWarning} mit angehängtem \cs{@gobble}}%^^A
+% Just before the identification of the package, we have to take care, that it
+% is not loaded with a \KOMAScript{} class. If so, we output a warning an
+% terminate.
+%
+% \changes{v3.30}{2020/02/25}{Using \cs{PackageWarningNoLine} instead of
+% \cs{PackageWarning} with final \cs{@gobble}}
% \begin{macrocode}
+%<*preidentify>
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname KOMAClassName\endcsname\relax\else
\PackageWarningNoLine{scrextend}{%
@@ -125,44 +97,76 @@
}%
\expandafter\endinput
\fi
+%</preidentify>
% \end{macrocode}
%
-% \iffalse
-%</preidentify>
-%<*identify>
-% \fi
%
-% \subsection{Identifizierung des Pakets}
+% \subsection{Package identification}
+%
+% We use the major \KOMAScript{} version for this package, because it uses
+% several main parts of the classes of the same version.
%
% \begin{macrocode}
+%<*identify>
\ProvidesPackage{scrextend}[%
%!KOMAScriptVersion
package (extend other classes with features of KOMA-Script classes)%
]
+%</identify>
% \end{macrocode}
%
-% \iffalse
-%</identify>
-%<*prepare>
-% \fi
%
-% \subsection{Vorbereitung vor den Optionen}
-%
-% \begin{macro}{\scr@ext@activate}
-% \begin{macro}{\scr@ext@activateable}
-% \begin{macro}{\scr@ext@addto@activateable}
-% \begin{sloppypar}
-% Einige Dinge werden nur dann definiert, wenn dies gefordert ist. Dazu werden
-% die entsprechenden Definitionen in das zweite Argument von
-% \cs{scr@ext@activateable}\marg{Kürzel} gepackt, wodurch sie als
-% \cs{scr@ext@activate@}\meta{Kürzel} definiert werden, und anschließend
-% \cs{csname}~\texttt{scr@ext@immediate@}\meta{Kürzel}\cs{endcsname}
-% ausgeführt. Um das dann zu aktivieren wird
-% \cs{scr@ext@activate}\marg{Kürzel} aufgerufen (beispielsweise innerhalb
-% einer Option). Mit \cs{scr@ext@addto@activateable} können Aktivierungen
-% entsprechend um weitere Definitionen erweitert werden.
-% \end{sloppypar}
+% \subsection{Preparation of options}
+%
+% The preparation state is used before the option handling. To allow
+% definition of optional features. Such definitions are used in other parts of
+% the \KOMAScript{} classes. For example \file{scrkernel-title.dtx} defines
+% the \optvalue{title} \opt{feature}.
+%
+% Note: The method used here is very fragile, i.\,e., the definition of
+% feature code with arguments needs to be adapted for \pkg{scrextend}. So
+% there is a big fat
+% \begin{description}
+% \item[ToDo:] Reimplementation of the optional features should simplify the
+% definition of such features a lot in other files. Best would be to have a
+% kind of start command and a kind of end command without the need to change
+% anything in between, if the package instead of a class is defined. But
+% this is hard to reach, because of usage of \cs{ClassError}
+% vs. \cs{PackageError}, \cs{ClassWarning} vs. \cs{PackageWarning}. So at
+% least these commands have to be dependent. Nevertheless the need to
+% change, e.g., |#1| into |##1|, |#2| into |##2| etc. for \pkg{scrextend} is
+% annoying. Moreover the whole usage of \cs{scr@extend@activate@\dots} and
+% \cs{sr@extend@immediate@\dots} is very complicated and currently I'm even
+% not sure, that is always works as expected. Maybe a less complicated
+% feature implementation could be found.
+% \end{description}
+%
+% \begin{macro}{\scr@ext@activate,\scr@ext@activateable,
+% \scr@ext@addto@activateable}
+% One special feature of this package is, to provide some \KOMAScript{}
+% features only, if they have been activated explicitly. To do so
+% \begin{quote}
+% \cs{scr@ext@activateable}\marg{feature}\marg{definition}
+% \end{quote}
+% is used. This macro defines \cs{scr@ext@activate@\meta{feature}}. There is
+% also a
+% \begin{quote}
+% \cs{scr@ext@addto@activateable}\marg{feature}\marg{definition}
+% \end{quote}
+% that does append \meta{definition} to the already existing code of
+% \cs{scr@act@activate@\meta{feature}}, if it already exists, or define it
+% new, if is does not exist already.
+% \begin{quote}
+% \cs{scr@ext@activate}\marg{feature}
+% \end{quote}
+% is used to \emph{activate} a \meta{feature}. That means: If there is a
+% \cs{scr@ext@activate@\meta{feature}} it is executed and afterwards
+% \cs{scr@ext@activate@\meta{feature}} is destroyed making it \cs{relax}. But
+% if there is not yet a \cs{scr@ext@activate@\meta{feature}} a
+% \cs{scr@ext@immediate@\meta{feature}} is defined. The definition of this
+% is, to redefine itself to be \cs{scr@ext@activate@\meta{feature}}.
% \begin{macrocode}
+%<*prepare>
\newcommand*{\scr@ext@activate}[1]{%
\scr@ifundefinedorrelax{scr@ext@activate@#1}{%
\@namedef{scr@ext@immediate@#1}{%
@@ -184,28 +188,22 @@
\expandafter\g@addto@macro\csname scr@ext@activate@#1\endcsname
}%
}
+%</prepare>
% \end{macrocode}
% \end{macro}
-% \end{macro}
-% \end{macro}
%
-% \iffalse
-%</prepare>
-%<*option>
-% \fi
%
-% \subsection{Optionen}
+% \subsection{Options}
%
-% Das Paket kennt eine universelle Option, um aktivierbare Möglichkeiten zu
-% aktivieren. Diese Option steht aber nur während dem Laden des Pakets zur
-% Verfügung!
+% Now, after the preparation, the universal option that enables optional
+% features can defined. This option can be used while loading the package
+% only. Later activation of features is currently not supported.
%
% \begin{option}{extendedfeature}
-% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit
-% \cs{FamilyKeyState}}%^^A
-% \changes{v3.17}{2015/03/09}{Speicherung des Werts in der internen
-% Liste}%^^A
+% \changes{v3.12}{2013/03/05}{using state signaling with \cs{FamilyKeyState}}
+% \changes{v3.17}{2015/03/09}{internal value storage}
% \begin{macrocode}
+%<*option>
\KOMA@key{extendedfeature}{%
\scr@ext@activate{#1}%
\AtEndOfPackage{%
@@ -228,19 +226,24 @@
\def\FamilyKeyState{Option `extendedfeature' too late}%
}%
}
+%</option>
% \end{macrocode}
% \end{option}
%
-% \iffalse
-%</option>
-% \fi
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
%
% \Finale
-%
+% \PrintChanges
+%
\endinput
-%
-% end of file `scrextend.dtx'
-%%% Local Variables:
-%%% mode: doctex
-%%% 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:
+