summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/koma-script/source/scrkernel-basics.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-04-22 03:02:46 +0000
committerNorbert Preining <norbert@preining.info>2020-04-22 03:02:46 +0000
commite0e2537ccbac6924b371be81092c1177e817162c (patch)
tree1ee747d3a078004710d37b5f3ddaa9d975bdded7 /macros/latex/contrib/koma-script/source/scrkernel-basics.dtx
parent8731cc5ad70723b9a155917df509d857579c355d (diff)
CTAN sync 202004220302
Diffstat (limited to 'macros/latex/contrib/koma-script/source/scrkernel-basics.dtx')
-rw-r--r--macros/latex/contrib/koma-script/source/scrkernel-basics.dtx93
1 files changed, 69 insertions, 24 deletions
diff --git a/macros/latex/contrib/koma-script/source/scrkernel-basics.dtx b/macros/latex/contrib/koma-script/source/scrkernel-basics.dtx
index f9c193af4f..e46fa55950 100644
--- a/macros/latex/contrib/koma-script/source/scrkernel-basics.dtx
+++ b/macros/latex/contrib/koma-script/source/scrkernel-basics.dtx
@@ -1,8 +1,8 @@
-% \CheckSum{4335}
+% \CheckSum{4366}
% \iffalse meta-comment
% ======================================================================
% scrkernel-basics.dtx
-% Copyright (c) Markus Kohm, 2002-2019
+% Copyright (c) Markus Kohm, 2002-2020
%
% This file is part of the LaTeX2e KOMA-Script bundle.
%
@@ -20,7 +20,7 @@
% This work consists of all files listed in manifest.txt.
% ----------------------------------------------------------------------
% scrkernel-basics.dtx
-% Copyright (c) Markus Kohm, 2002-2019
+% 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.
@@ -55,7 +55,7 @@
% Right brace \} Tilde \~}
%
% \iffalse
-%%% From File: $Id: scrkernel-basics.dtx 3448 2020-01-17 14:56:41Z kohm $
+%%% From File: $Id: scrkernel-basics.dtx 3465 2020-03-07 10:23:56Z kohm $
%<prepare>%%% (run: prepare)
%<option>%%% (run: option)
%<body>%%% (run: body)
@@ -65,7 +65,7 @@
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\begingroup
\def\filedate$#1: #2-#3-#4 #5${\def\filedate{#2/#3/#4}}
- \filedate$Date: 2020-01-17 15:56:41 +0100 (Fri, 17 Jan 2020) $
+ \filedate$Date: 2020-03-07 11:23:56 +0100 (Sat, 07 Mar 2020) $
\def\filerevision$#1: #2 ${\def\filerevision{r#2}}
\filerevision$Revision: 1638 $
\xdef\fileinfo{\filedate\space\filerevision\space}
@@ -244,6 +244,38 @@
% \end{macrocode}
% \end{macro}%^^A \kernel@ifstar
%
+% \selectlanguage{english}
+%
+% \subsection{Improved \LaTeX{} kernel commands}
+% The \LaTeX{} kernel already provides some useful commands, but some can be
+% improved.
+%
+% \begin{macro}{\rloop}
+% \changes{v3.30}{2020/03/07}{new}
+% The \cs{loop} \dots \cs{repeat} of the \LaTeX{} kernel cannot be used inside
+% a \cs{loop} \dots \cs{repeat} without extra code for preserving
+% \cs{iterate}. So here is a re-entrant version that is also long. This
+% version can be used even inside a \cs{loop} \dots \cs{repeat}. However you
+% should not use \cs{loop} \dots \cs{repeat} inside \cs{rloop} \dots
+% \cs{repeat}.
+% \begin{macrocode}
+%<*base>
+\newcommand{\rloop}[1]{}
+\long\def\rloop#1\repeat{%
+ \ifdefined\iterate
+ \edef\iterate{\unexpanded{#1\relax\expandafter\iterate\fi\def\iterate}%
+ {\unexpanded\expandafter{\iterate}}}%
+ \else
+ \def\iterate{#1\relax\expandafter\iterate\fi\let\iterate\relax}%
+ \fi
+ \iterate
+}
+%</base>
+% \end{macrocode}
+% \end{macro}
+% \selectlanguage{ngerman}
+%
+%
% \subsection{Test von Anweisungen}
%
% \begin{macro}{\scr@ifundefinedorrelax}
@@ -2761,10 +2793,12 @@
% \changes{v3.28}{2019/11/18}{entfernt}%^^A
% \begin{macro}{\scr@ifpdftex}
% \changes{v2.95}{2002/08/19}{neu (intern)}%^^A
+% \changes{v3.30}{2020/03/06}{veralteten Befehl \cs{ifnotundefined} durch
+% \cs{Ifnotundefined} ersetzt}%^^A
% If-then-else-Konstrukt, um zu testen, ob pdf\TeX{} verwendet wird.
% \begin{macrocode}
%<*base>
-\newcommand{\scr@ifpdftex}{\ifnotundefined{pdftexversion}}
+\newcommand{\scr@ifpdftex}{\Ifnotundefined{pdftexversion}}
%</base>
% \end{macrocode}
% \end{macro}
@@ -2772,10 +2806,12 @@
%
% \begin{macro}{\scr@ifluatex}
% \changes{v3.21}{2016/05/27}{neu (intern)}%^^A
+% \changes{v3.30}{2020/03/06}{veralteten Befehl \cs{ifnotundefined} durch
+% \cs{Ifnotundefined} ersetzt}%^^A
% If-the-else-Konstrukt, um zu testen, ob lua\TeX{} verwendet wird.
% \begin{macrocode}
%<*base>
-\newcommand{\scr@ifluatex}{\ifnotundefined{luatexversion}}
+\newcommand{\scr@ifluatex}{\Ifnotundefined{luatexversion}}
%</base>
% \end{macrocode}
% \end{macro}
@@ -2800,10 +2836,12 @@
% \begin{macro}{\scr@ifVTeX}
% \changes{v2.95}{2002/08/19}{neu}%^^A
% \changes{v2.97c}{2007/06/20}{umdefiniert von \cs{scr@ifvtex}}
+% \changes{v3.30}{2020/03/06}{veralteten Befehl \cs{ifnotundefined} durch
+% \cs{Ifnotundefined} ersetzt}%^^A
% If-then-else-Konstrukt, um zu testen, ob V\TeX{} verwendet wird.
% \begin{macrocode}
%<*base>
-\newcommand{\scr@ifVTeX}{\ifnotundefined{VTeXversion}}
+\newcommand{\scr@ifVTeX}{\Ifnotundefined{VTeXversion}}
%</base>
% \end{macrocode}
% \end{macro}
@@ -2880,19 +2918,21 @@
% \begin{macro}{\scr@ifpsoutput}
% \changes{v2.95}{2002/08/21}{neu (intern)}%^^A
% \changes{v2.95}{2004/07/20}{Expandierbarkeit verbessert}%^^A
+% \changes{v3.30}{2020/03/06}{veralteten Befehl \cs{ifnotundefined} durch
+% \cs{Ifnotundefined} ersetzt}%^^A
% If-then-else-Konstrukt, um abhängig davon, ob früher oder später
% \texttt{ps} ausgegeben wird oder nicht, Befehle auszuführen.
% \begin{macrocode}
%<*base>
\newcommand*{\scr@ifpsoutput}{%
- \ifnotundefined{if@dvips}{%
+ \Ifnotundefined{if@dvips}{%
\if@dvips
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
}{%
- \ifnotundefined{OpMode}{%
+ \Ifnotundefined{OpMode}{%
\ifnum\OpMode=2
\expandafter\@firstoftwo
\else
@@ -4105,8 +4145,9 @@
% \begin{macro}{\FamilyUnknownKeyValue}
% \changes{v3.10}{2011/09/12}{no error while processing global options}%^^A
% \changes{v3.11a}{2012/05/28}{prevent remove from list of unused global
-% options globally}%^^A
+% options globally}%^^A
% \changes{v3.14}{2014/10/17}{\cs{long}}%^^A
+% \changes{v3.30}{2020/02/25}{spurious space in warning message removed}%^^A
% Dieses Makro berichtet über Fehler wegen unbekannter Wertübergabe an einen
% Schlüssel. Das erste Argument ist die Familie, das zweite der Schlüssel,
% das dritte der Wert und das vierte die Liste der möglichen Werte.
@@ -4120,7 +4161,7 @@
Setting this command to a non empty\MessageBreak
value for option `#2' of\MessageBreak
family `#1' is deprecated,\MessageBreak
- but has been found
+ but has been found%
}%
\fi
}
@@ -5108,6 +5149,8 @@
% \begin{macro}{\ForDoHook}
% \changes{v3.27}{2019/02/05}{New}%^^A
% \changes{v3.28}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
+% \changes{v3.30}{2020/03/07}{\cs{loop}\dots\cs{repeat} inside group}%^^A
+% \changes{v3.30}{2020/03/07}{using \cs{rloop} instead of \cs{loop}}%^^A
% Arguments:
% \begin{description}
% \item[\meta{specificator}:]
@@ -5129,18 +5172,20 @@
but do-hook specificators must not be empty.%
}%
}{%
- \let\scr@hookname\relax
- \edef\scr@hookargument{#1}%
- \loop
- \scr@hooksplit@specificator\scr@hookname\scr@hookargument
- \scr@hookargument
- \begingroup\edef\reserved@a{%
- \unexpanded{\endgroup #2}{\scr@hookname}{\scr@hookargument}%
- }\reserved@a
- \ifx\scr@hookargument\@empty\else
- \repeat
- \let\scr@hookname\relax
- \let\scr@hookargument\relax
+ \begingroup
+ \def\scr@hookrun{\endgroup}%
+ \let\scr@hookname\relax
+ \edef\scr@hookargument{#1}%
+ \rloop
+ \scr@hooksplit@specificator\scr@hookname\scr@hookargument
+ \scr@hookargument
+ \edef\scr@hookrun{%
+ \unexpanded\expandafter{\scr@hookrun}%
+ \unexpanded{#2}{\scr@hookname}{\scr@hookargument}%
+ }%
+ \ifx\scr@hookargument\@empty\else
+ \repeat
+ \scr@hookrun
}%
}
% \end{macrocode}