diff options
Diffstat (limited to 'macros/latex-dev/base/ltclass.dtx')
-rw-r--r-- | macros/latex-dev/base/ltclass.dtx | 61 |
1 files changed, 50 insertions, 11 deletions
diff --git a/macros/latex-dev/base/ltclass.dtx b/macros/latex-dev/base/ltclass.dtx index 7b1dbc8127..44fe0f8856 100644 --- a/macros/latex-dev/base/ltclass.dtx +++ b/macros/latex-dev/base/ltclass.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltclass.dtx} - [2020/08/29 v1.3p LaTeX Kernel (Class & Package Interface)] + [2020/09/06 v1.3q LaTeX Kernel (Class & Package Interface)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltclass.dtx} @@ -1021,11 +1021,28 @@ % If the package has been loaded, we check that it was first loaded with % the options. Otherwise we add the option list to that of the package. % \begin{macrocode} +%</2ekernel> +%<latexrelease>\IncludeInRelease{2020/10/01}{\@pass@ptions} +%<latexrelease> {Add file replacement in \@pass@ptions}% +%<*2ekernel|latexrelease> \def\@pass@ptions#1#2#3{% - \expandafter\xdef\csname opt@#3.#1\endcsname{% - \@ifundefined{opt@#3.#1}\@empty - {\csname opt@#3.#1\endcsname,}% + \edef\reserved@a{\@expl@@@filehook@resolve@file@subst@@w #3.#1\@nil}% + \expandafter\xdef\csname opt@\reserved@a\endcsname{% + \@ifundefined{opt@\reserved@a}\@empty + {\csname opt@\reserved@a\endcsname,}% \zap@space#2 \@empty}} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +% +%<latexrelease>\IncludeInRelease{0000/00/00}{\@pass@ptions} +%<latexrelease> {\@pass@ptions}% +%<latexrelease>\def\@pass@ptions#1#2#3{% +%<latexrelease> \expandafter\xdef\csname opt@#3.#1\endcsname{% +%<latexrelease> \@ifundefined{opt@#3.#1}\@empty +%<latexrelease> {\csname opt@#3.#1\endcsname,}% +%<latexrelease> \zap@space#2 \@empty}} +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> \@onlypreamble\@pass@ptions % \end{macrocode} % @@ -1633,8 +1650,6 @@ \@onlypreamble\@fileswith@pti@ns % \end{macrocode} % - - % \begin{macro}{\load@onefilewithoptions} % This macro is used when loading packages or classes. % @@ -1727,6 +1742,29 @@ {\@expl@@@filehook@file@push@@ \set@curr@file{\@currname.\@currext}% \@filehook@set@CurrentFile +% \end{macrocode} +% \changes{v1.3q}{2020/09/06} +% {Save \cs{@currpkg@reqd} so that we don't lose track of +% package substitutions.} +% The \cs{set@curr@file} line above might have replaced the file, so +% \cs{@currname} and \cs{@currext} may no longer hold the actual +% package being loaded, so in that case we need to update these two +% token lists (\cs{@curr@file} holds the file name after replacement, +% so we parse that). +% +% The requested file is saved in \cs{@currpkg@reqd} to be used in +% \cs{InputIfFileExists} later: if the updated \cs{@currname} and +% \cs{@currext} are used we lose track of the substitution, so +% \cs{CurrentFile} and \cs{CurrentFileUsed} will be (incorrectly) +% the same. +% \begin{macrocode} + \edef\@currpkg@reqd{\@currname.\@currext}% + \ifx\CurrentFile\CurrentFileUsed + \else + \filename@parse\@curr@file + \edef\@currname{\string@makeletter\filename@base}% + \edef\@currext{\string@makeletter\filename@ext}% + \fi \load@onefile@withoptions{#2}% % \end{macrocode} % Now just clean up and exit. @@ -1761,11 +1799,10 @@ % % The kernel no longer uses \cs{@unprocessedoptions} % \begin{macrocode} -\let\@unprocessedoptions\@undefined +\let\@unprocessedoptions\@undefined % \end{macrocode} % \end{macro} - - +% % \begin{macro}{\@missing@onefilewithoptions} % Now the action taken when a file is not found. % \begin{macrocode} @@ -1817,7 +1854,9 @@ % Now actually load the file (at this point we are certain it exists, % but use \cs{InputIfFileExists} so that file hooks are executed): % \begin{macrocode} - \InputIfFileExists{\@currname.\@currext}{}{}% + \InputIfFileExists{\@currpkg@reqd}{}% + {\@latex@error + {The \@cls@pkg\space\@currpkg@reqd\space failed to load.}\@ehd}% %----------------------------------------- % \end{macrocode} % In older versions of the code |\@unprocessedoptions| would @@ -1878,7 +1917,7 @@ \fi \fi}% %----------------------------------------- - \reserved@a} + \@ifl@aded\@currext\@currname{}{\reserved@a}} % \end{macrocode} % \end{macro} % |