diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/koma-script/scrkernel-basics.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/koma-script/scrkernel-basics.dtx | 99 |
1 files changed, 77 insertions, 22 deletions
diff --git a/Master/texmf-dist/source/latex/koma-script/scrkernel-basics.dtx b/Master/texmf-dist/source/latex/koma-script/scrkernel-basics.dtx index fa5cb5e9a68..9c8358b4661 100644 --- a/Master/texmf-dist/source/latex/koma-script/scrkernel-basics.dtx +++ b/Master/texmf-dist/source/latex/koma-script/scrkernel-basics.dtx @@ -36,7 +36,7 @@ % Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien. % ====================================================================== % -%%% From File: $Id: scrkernel-basics.dtx 3578 2021-03-12 16:50:00Z kohm $ +%%% From File: $Id: scrkernel-basics.dtx 3606 2021-06-08 08:28:35Z kohm $ %<prepare>%%% (run: prepare) %<option>%%% (run: option) %<body>%%% (run: body) @@ -46,7 +46,7 @@ \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi \begingroup \def\filedate$#1: #2-#3-#4 #5${\def\filedate{#2/#3/#4}} - \filedate$Date: 2021-03-12 17:50:00 +0100 (Fri, 12 Mar 2021) $ + \filedate$Date: 2021-06-08 10:28:35 +0200 (Tue, 08 Jun 2021) $ \def\filerevision$#1: #2 ${\def\filerevision{r#2}} \filerevision$Revision: 1638 $ \xdef\fileinfo{\filedate\space\filerevision\space} @@ -880,10 +880,13 @@ % \selectlanguage{english}% % \changes{v3.33}{2021/03/02}{new version using raw options lists of \LaTeX{} % 2021/05/01} +% Note, we use 2021/05/01 instead of the official \LaTeX{} release date, +% because there were relevant earlier \LaTeX{} developer releases with that +% date. % \begin{macrocode} %<*base> -\IncludeInRelease{2021/05/01}{\FamilyProcessOptions}{% - Usage of raw option list} +\IncludeInRelease{2021/05/01}{\FamilyProcessOptions}% + {Usage of raw or classic option list} \newcommand*{\FamilyProcessOptions}[2][.\@currname.\@currext]{% % \end{macrocode} % Before processing of the options we have to execute an initialise several @@ -943,28 +946,40 @@ }% % \end{macrocode} % If this is not a class, we first have to process all raw class options. -% \changes{v3.33}{2021/03/12}{switched to fast test like \LaTeX{} 2021/05/01} +% \changes{v3.33}{2021/03/12}{switched to fast test like \LaTeX{} 2021/06/01} +% \changes{v3.34}{2021/05/30}{use \cs{@raw@classoptionslist} only, if defined} +% Note, if \Package{scrbase} or a depending package is loaded before the class, +% \cs{@raw@classoptionslist} should not be processed. % \begin{macrocode} \ifx\@currext\@clsextension\else - \@for\CurrentOption:=\@raw@classoptionslist\do{% - \scr@trim@spaces\CurrentOption - \ifx\CurrentOption\@empty\else - \@ifundefined{ds@\CurrentOption}{% - \scr@ifprocess@curroption{#1}{#2}{% - \@expandtwoargs\@removeelement{% - \expandafter\@remove@eq@value\CurrentOption=\@nil}% - \@unusedoptionlist\@unusedoptionlist - }{}% - }{% - \@use@ption - \expandafter\let\csname ds@\CurrentOption\endcsname\@empty - }% - \fi + \@ifundefined{@raw@classoptionslist}{}{% + \@for\CurrentOption:=\@raw@classoptionslist\do{% + \scr@trim@spaces\CurrentOption + \ifx\CurrentOption\@empty\else + \@ifundefined{ds@\CurrentOption}{% + \scr@ifprocess@curroption{#1}{#2}{% + \@expandtwoargs\@removeelement{% + \expandafter\@remove@eq@value\CurrentOption=\@nil}% + \@unusedoptionlist\@unusedoptionlist + }{}% + }{% + \@use@ption + \expandafter\let\csname ds@\CurrentOption\endcsname\@empty + }% + \fi + }% }% \fi % \end{macrocode} -% Afterwards we have to process the current options. +% \changes{v3.34}{2021/06/05}{extra test because of \LaTeX{} raw option issue} +% Afterwards we have to process the current options. Unfortunately there is an +% issue with the raw option list of the \LaTeX{} kernel, that could result in +% \cs{CurrentOption} in the option list instead of the one step expansion of +% \cs{CurrentOption} (see +% \url{https://sourceforge.net/p/koma-script/tickets/10/}). This would result +% in an infinite loop using the usual loop: % \begin{macrocode} +%<*dontusethis> \@for\CurrentOption:=\@curroptions\do{% \scr@trim@spaces\CurrentOption \@ifundefined{ds@\CurrentOption}{% @@ -972,6 +987,46 @@ \scr@ifprocess@curroption{#1}{#2}{}\default@ds }\@use@ption }% +%</dontusethis> +% \end{macrocode} +% So for a little more rosbustnes we do an extra test. +% \begin{macrocode} + \@for\reserved@a:=\@curroptions\do{% + \scr@trim@spaces\reserved@a + \def\reserved@b{\CurrentOption}% + \ifx\reserved@a\reserved@b + \PackageError{scrbase}{% + \string\CurrentOption\space loop detected\MessageBreak + Perhaps someone uses:\MessageBreak\space\space + \ifx\@currext\@clsextension + \string\PassOptionsToClass + \else + \string\PassOptionsToPackage + \fi + {\string\CurrentOption}{…}.\MessageBreak + With LaTeX 2020/10/01 or 2021/06/01 this results in + \string\CurrentOption\MessageBreak + in the raw option list and therefore is not allowed.\MessageBreak + Please ask the class or package author to use:\MessageBreak\space\space + \string\expandafter + \ifx\@currext\@clsextension + \string\PassOptionsToClass + \else + \string\PassOptionsToPackage + \fi + \MessageBreak\space\space\space + \string\expandafter{\string\CurrentOption}{…}\MessageBreak + instead or update LaTeX (if possible)% + }% + \let\CurrentOption\@empty + \else + \let\CurrentOption\reserved@a + \fi + \@ifundefined{ds@\CurrentOption}{% + \@use@ption + \scr@ifprocess@curroption{#1}{#2}{}\default@ds + }\@use@ption + }% % \end{macrocode} % Clear all the definitions for declared options and the current option. Then % reset the marker macro, initiate emptying the unprocessed options list of @@ -991,8 +1046,8 @@ % And here the old version for old \LaTeX{} kernel version: % \selectlanguage{ngerman}% % \begin{macrocode} -\IncludeInRelease{0000/00/00}{\FamilyProcessOptions}{% - compatibility for LaTeX before 2021/05/01} +\IncludeInRelease{0000/00/00}{\FamilyProcessOptions}% + {Usage of raw or classic option list} \newcommand*{\FamilyProcessOptions}[2][.\@currname.\@currext]{% \ifx\AtEndOfFamilyOptions\scr@AtEndOfFamilyOptions \PackageError{scrbase}{nested \string\FamilyProcessOptions\space |