summaryrefslogtreecommitdiff
path: root/macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.dtx')
-rw-r--r--macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.dtx129
1 files changed, 126 insertions, 3 deletions
diff --git a/macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.dtx b/macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.dtx
index ed6c898d65..152737eaf7 100644
--- a/macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.dtx
+++ b/macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: latex2e-first-aid-for-external-files.dtx (C) Copyright 2020-2023
+%% File: latex2e-first-aid-for-external-files.dtx (C) Copyright 2020-2024
%%
%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
@@ -111,8 +111,8 @@
% \end{macrocode}
%
% \begin{macrocode}
-\def\LaTeXFirstAidDate{2023/09/20}
-\def\LaTeXFirstAidVersion{v1.1b}
+\def\LaTeXFirstAidDate{2024/03/20}
+\def\LaTeXFirstAidVersion{v1.1e}
% \end{macrocode}
%
% \begin{macrocode}
@@ -602,5 +602,128 @@
%</kernel>
% \end{macrocode}
%
+% \begin{macrocode}
+%<*kernel>
+% \end{macrocode}
+%
+% \subsection{The \pkg{acro} package first aid}
+%
+% The package does not declare a \texttt{prop}, which causes an issue with newer
+% routines in \pkg{expl3}.
+% \begin{macrocode}
+\AddToHook{package/acro/after}[firstaid]{%
+ \FirstAidNeededT{acro}{sty}{2022/04/01 v3.8 typeset acronyms
+ and other abbreviations (CN)}
+ {\UseName{prop_new:c}{l__acro_tmpa_prop}%
+% \end{macrocode}
+% With the 2024 June release of \LaTeX{} it will also fail to patch
+% \cs{endlongtable} and therefore errors when loading. However, the
+% patch it tries never worked (because it was setting a local
+% boolean at a point where it was more or less immediately
+% reset). Thus, rather than fixing the patch approach (which
+% requires to surround the patch with \cs{ExplSyntaxOn}
+% \verb*/\catcode`\ =10 / and \cs{ExplSyntaxOff}) we simply disable
+% the patch for now.
+% \begin{macrocode}
+ \acsetup{patch/longtable=false}%
+ }%
+}
+% \end{macrocode}
+%
+% \subsection{The \pkg{chemformula} package first aid}
+%
+% Package \pkg{chemformula} uses \pkg{l3keys2e} for option processing.
+% This used to be made available as \pkg{chemformula} also loads
+% \pkg{xfrac}, which loaded \pkg{l3keys2e}. However, \pkg{xfrac} has now
+% been updated to use the newer kernel method if available, so loading
+% \pkg{chemformula} fails.
+% \begin{macrocode}
+\AddToHook{package/chemformula/before}[firstaid]{%
+ \RequirePackage{l3keys2e}%
+}
+% \end{macrocode}
+%
+% \subsection{The \pkg{chemnum} package first aid}
+%
+% The package does not declare a \texttt{prop}, which causes an issue with newer
+% routines in \pkg{expl3}.
+% \begin{macrocode}
+\AddToHook{package/chemnum/after}[firstaid]{%
+ \FirstAidNeededT{chemnum}{sty}{2021/01/21 v1.3a a comprehensive
+ approach for the numbering of chemical compounds (CN)}
+ {\UseName{prop_new:c}{l__chemnum_tmpa_prop}}%
+}
+% \end{macrocode}
+%
+% \subsection{The \pkg{cleveref} package first aid}
+%
+% The \pkg{cleveref} package expects only two data containers
+% for its internal \cs{newlabel} command. This fails if
+% \pkg{xr-hyper} is used which expands every \cs{newlabel} to
+% five data container and puts the file name into the last one.
+% \begin{macrocode}
+\AddToHook{package/cleveref/after}[firstaid]{%
+ \FirstAidNeededT{cleveref}{sty}{2018/03/27 v0.21.4 Intelligent cross-referencing}
+ {%
+% \end{macrocode}
+% This are the two commands which retrieve the data from the label info.
+% We change them to expect five arguments.
+% \begin{macrocode}
+ \def\cref@getref#1#2{%
+ \expandafter\let\expandafter#2\csname r@#1@cref\endcsname%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter#2%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\@firstoffive#2}}% <-------- five
+ \def\cpageref@getref#1#2{%
+ \expandafter\let\expandafter#2\csname r@#1@cref\endcsname%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter#2%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\@secondoffive#2}}% <----------- five
+% \end{macrocode}
+% We also need to redefine the internal label commands of cleveref.
+% This must be done after \pkg{cleveref} has made its changes
+% in \texttt{begindocument} so we add it to the same hook using
+% the hook label used by \pkg{cleveref}.
+% This way it is guaranteed to overwrite the definitions.
+% \begin{macrocode}
+ \AddToHook{begindocument}[cleveref]{%
+ \def\label@noarg#1{%
+ \cref@old@label{#1}%
+ \@bsphack%
+ \edef\@tempa{{page}{\the\c@page}}%
+ \setcounter{page}{1}%
+ \edef\@tempb{\thepage}%
+ \expandafter\setcounter\@tempa%
+ \cref@constructprefix{page}{\cref@result}%
+ \protected@write\@auxout{}%
+ {\string\newlabel{#1@cref}{{\cref@currentlabel}%
+ {[\@tempb][\arabic{page}][\cref@result]\thepage}{}{}{}}}% <----- five
+ \@esphack}%
+ \def\label@optarg[#1]#2{%
+ \cref@old@label{#2}%
+ \@bsphack%
+ \edef\@tempa{{page}{\the\c@page}}%
+ \setcounter{page}{1}%
+ \edef\@tempb{\thepage}%
+ \expandafter\setcounter\@tempa%
+ \cref@constructprefix{page}{\cref@result}%
+ \protected@edef\cref@currentlabel{%
+ \expandafter\cref@override@label@type%
+ \cref@currentlabel\@nil{#1}}%
+ \protected@write\@auxout{}%
+ {\string\newlabel{#2@cref}{{\cref@currentlabel}%
+ {[\@tempb][\arabic{page}][\cref@result]\thepage}{}{}{}}}% <------- five
+ \@esphack}%
+ }
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</kernel>
+% \end{macrocode}
+%
% \Finale
%