summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/ltclass.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/base/ltclass.dtx')
-rw-r--r--macros/latex-dev/base/ltclass.dtx78
1 files changed, 50 insertions, 28 deletions
diff --git a/macros/latex-dev/base/ltclass.dtx b/macros/latex-dev/base/ltclass.dtx
index 06e0f437af..0ff3f71162 100644
--- a/macros/latex-dev/base/ltclass.dtx
+++ b/macros/latex-dev/base/ltclass.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2021
+% Copyright (C) 1993-2022
% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltclass.dtx}
- [2021/08/25 v1.4f LaTeX Kernel (Class & Package Interface)]
+ [2021/12/09 v1.5a LaTeX Kernel (Class & Package Interface)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltclass.dtx}
@@ -338,7 +338,7 @@
% or the old name \cs{@ifpackagelater}.
% \DescribeMacro\IfFormatAtLeastTF
-% To test the format date use
+% To test the format date use
% \begin{quote}
% |\IfFormatAtLeastTF{|\meta{date}|}{|^^A
% \meta{true}|}{|\meta{false}|}|
@@ -434,7 +434,7 @@
% standard (and other non-standard) distributions can put informative
% strings in this argument.
%
-% \StopEventually{}
+% \MaybeStop{}
%
% \section{Implementation}
%
@@ -1833,7 +1833,7 @@
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
-%
+%
% \begin{macrocode}
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease> {\RequirePackageWithOptions}{Unused options issue}%
@@ -2175,27 +2175,21 @@
% \begin{macrocode}
\@ifl@aded\@currext\@currname
% \end{macrocode}
-% If the package is already loaded, check that there were no option
-% clashes:
-% \changes{v1.1b}{1998/05/07}
-% {Modify help message for latex/2805}
-% \begin{macrocode}
- {\@if@ptions\@currext{\@currname}{#2}{}%
- {\@latex@error
- {Option clash for \@cls@pkg\space \@currname}%
- {The package \@currname\space has already been loaded
- with options:\MessageBreak
- \space\space[\@ptionlist{\@currname.\@currext}]\MessageBreak
- There has now been an attempt to load it
- with options\MessageBreak
- \space\space[#2]\MessageBreak
- Adding the global options:\MessageBreak
- \space\space
- \@ptionlist{\@currname.\@currext},#2\MessageBreak
- to your \noexpand\documentclass declaration may fix this.%
- \MessageBreak
- Try typing \space <return> \space to proceed.}}%
- \@firstofone}%
+% In the current preferred approach, a key family name will exist for
+% processing using \pkg{ltkeys}. In that case, we replace the previous
+% package options with with the new ones, then call the key handler.
+% Otherwise, we use the more classical clash handler.
+% \begin{macrocode}
+ {%
+ \@ifundefined{opt@fam@\@currname.\@currext}
+ {\@onefilewithoptions@clashchk{#2}}
+ {%
+ \@namedef{opt@\@currname.\@currext}{#2}%
+ \expandafter\expandafter\expandafter\ProcessKeyPackageOptions
+ \expandafter\expandafter\expandafter
+ [\csname opt@fam@\@currname.\@currext\endcsname]%
+ }%
+ }%
{\makeatletter
% \end{macrocode}
% The next line seems to be necessary for 2.09 compatibility (the
@@ -2298,6 +2292,34 @@
\@reset@ptions}
% \end{macrocode}
%
+% \begin{macro}{\@onefilewithoptions@clashchk}
+% If the package is already loaded, check that there were no option
+% clashes.
+% \changes{v1.1b}{1998/05/07}
+% {Modify help message for latex/2805}
+% \changes{v1.5a}{2021/11/30}
+% {Separated out from \cs{@onefilewithoptions}}
+% \begin{macrocode}
+\def\@onefilewithoptions@clashchk#1{%
+ \@if@ptions\@currext{\@currname}{#1}{}%
+ {\@latex@error
+ {Option clash for \@cls@pkg\space \@currname}%
+ {The package \@currname\space has already been loaded
+ with options:\MessageBreak
+ \space\space[\@ptionlist{\@currname.\@currext}]\MessageBreak
+ There has now been an attempt to load it
+ with options\MessageBreak
+ \space\space[#1]\MessageBreak
+ Adding the global options:\MessageBreak
+ \space\space
+ \@ptionlist{\@currname.\@currext},#1\MessageBreak
+ to your \noexpand\documentclass declaration may fix this.%
+ \MessageBreak
+ Try typing \space <return> \space to proceed.}}%
+ \@firstofone}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
\let\@currpkg@reqd\@empty
% \end{macrocode}
@@ -2622,7 +2644,7 @@
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
-%
+%
% \begin{macrocode}
\@onlypreamble\AtBeginDocument
% \end{macrocode}
@@ -2826,7 +2848,7 @@
% \end{macrocode}
%
% \changes{v1.3m}{2020-08-08}{define \cs{q@curr@file} directly as the
-% quotes have already been removed (gh/220)}
+% quotes have already been removed (gh/220)}
% \begin{macrocode}
\gdef\filec@ntents#1{%
\set@curr@file{\filec@ntents@checkdir#1}%