diff options
author | Norbert Preining <norbert@preining.info> | 2023-11-02 03:04:13 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-11-02 03:04:13 +0000 |
commit | 2da66dea964ffa47d24f26081f2942a6e1ef1121 (patch) | |
tree | 74283568549892324b317485ab0a26dc23917afb /macros/latex/required/firstaid/latex2e-first-aid-for-external-files.dtx | |
parent | a9d0083bcc66de9ea863ed14cf8cde44e88e4355 (diff) |
CTAN sync 202311020304
Diffstat (limited to 'macros/latex/required/firstaid/latex2e-first-aid-for-external-files.dtx')
-rw-r--r-- | macros/latex/required/firstaid/latex2e-first-aid-for-external-files.dtx | 155 |
1 files changed, 38 insertions, 117 deletions
diff --git a/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.dtx b/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.dtx index 90958ed777..ed6c898d65 100644 --- a/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.dtx +++ b/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.dtx @@ -111,8 +111,8 @@ % \end{macrocode} % % \begin{macrocode} -\def\LaTeXFirstAidDate{2023/05/20} -\def\LaTeXFirstAidVersion{v1.0z} +\def\LaTeXFirstAidDate{2023/09/20} +\def\LaTeXFirstAidVersion{v1.1b} % \end{macrocode} % % \begin{macrocode} @@ -285,62 +285,10 @@ %</filehook-ltx> % \end{macrocode} % -% -% -% -% \subsection{The \pkg{bidi} package first aid} -% -% The \pkg{bidi} package adds a lot of hooks in various places and -% those added to \cs{document} and \cs{enddocument} are now no -% longer necessary as the kernel already provides the right hooks -% there. -% -% However, we aren't trying to change that but instead only make -% sure that the existing patches still work by adding some first -% aid after \pkg{biditools} has been loaded. -% -% If the package gets updated one can easily take that out simply -% through -%\begin{verbatim} -% \RemoveFromHook{file/biditools.sty/after}[firstaid] -%\end{verbatim} -% This makes it easy to test new bidi code while the first aid code -% is still in the kernel. -% % \begin{macrocode} %<*kernel> % \end{macrocode} % -% Bidi is now ar a new version: patches are no longer needed. -% \begin{macrocode} -%\AddToHook{file/biditools.sty/after}[firstaid]{% -% \FirstAidNeededT{biditools}{sty}% -% {2020/05/13 v2 Programming tools for bidi package}% -% {% -% \end{macrocode} -% \pkg{bidi} adds some code to the beginning of \cs{document} which -% contains \cs{endgroup} and \cs{begingroup} which is no longer -% correct. -% -% Patching \cs{document} using \cs{bidi@patchcmd} doesn't work so -% we take the extra groups out by hand: -% \begin{macrocode} -% \def\firstaid@bidi@document@patch -% \endgroup#1\begingroup#2\firstaid@bidi@document@patch -% {\unexpanded{#1#2}}% -% \edef\document{\expandafter\firstaid@bidi@document@patch\document -% \firstaid@bidi@document@patch}% -% \end{macrocode} -% There are also some patches into \cs{enddocument}, some continue -% to go in but one fails, so we add that now into the right place. -% \begin{macrocode} -% \AddToHook{enddocument/info}% -% {\let\bidi@AfterEndDocumentCheckLabelsRerun\@firstofone -% \bidi@afterenddocumentchecklabelsrerunhook}% -% }% -%} -% \end{macrocode} -% % \subsection{The \pkg{dinbrief} class first aid} % % Again a case of a no longer correct \cs{endgroup} in document. @@ -482,46 +430,6 @@ %</kernel> % \end{macrocode} % -% \subsection{The \pkg{everysel} package first aid} -% -% -% The \cs{selectfont} command got a hook (with the 2021/05 release) which -% was originally provided by the \pkg{everysel} -% package. Now that it is in the kernel this package is no longer -% needed (or only in a simplified manner). -% -% If it is requested we replace it with a simplified package -% (until) it gets updated at which point this line can be removed. -% \changes{v2.2k}{2020/12/04}{Emulate everysel package} -% \begin{macrocode} -%<*kernel> -% this has been updated -%\declare@file@substitution{everysel.sty}{everysel-ltx.sty} -%</kernel> -% \end{macrocode} -% -% -% -% \begin{macrocode} -%<*everysel-ltx> -\ProvidesPackage{everysel-ltx} - [2020/12/04 v1.0a - Emulation of the original everysel^^Jpackage with kernel methods] -% \end{macrocode} -% -% \begin{macrocode} -\newcommand*{\EverySelectfont}[1] - {\AddToHook{selectfont}{#1}} -\newcommand*{\AtNextSelectfont}[1] - {\AddToHookNext{selectfont}{#1}} -% \end{macrocode} -% -% -% \begin{macrocode} -%</everysel-ltx> -% \end{macrocode} -% -% % % \begin{macrocode} %<*kernel> @@ -652,32 +560,45 @@ } % \end{macrocode} % -% -% \subsection{First aid for \pkg{memoir}} -% -% The introduction of \cs{stockheight} and \cs{stockwidth} into the -% kernel requires some first aid. This has to go in \emph{before} -% loading the class, so we cannot check the version string here. % \begin{macrocode} -\AddToHook{file/memoir.cls/before}[firstaid]{% - \expandafter\def\expandafter\@tempa\string\dimen{}% - \edef\kernel@stockheight{\expandafter\@tempa\meaning\stockheight}% - \edef\kernel@stockwidth{\expandafter\@tempa\meaning\stockwidth}% - \let\stockheight\@undefined - \let\stockwidth\@undefined -} -\AddToHook{file/memoir.cls/after}[firstaid]{% - \dimen\kernel@stockheight=\stockheight - \dimen\kernel@stockwidth=\stockwidth - \dimendef\stockheight=\kernel@stockheight - \dimendef\stockwidth=\kernel@stockwidth -} +%</kernel> +% \end{macrocode} +% \subsection{The \pkg{underscore} first aid} +% +% The \pkg{underscore} package makes the underscore active. This means that the +% underscore can not be used in label and references unless the package option \texttt{strings} is used +% (which patches a selection of problematic commands like \cs{label} and \cs{ref}) +% or \pkg{babel} is used which redefines\footnote{unless the recommended option \texttt{safe=none} is used} +% a selection of problematic commands like \cs{@testdef} or \cs{@newl@bel}. +% +% With the new property commands the work-around do not work. We therefore make the +% underscore protected and use \cs{ifincsname} to allow its use in csnames. +% +% \begin{macrocode} +%<*underscore-ltx> +\ProvidesPackage{underscore-ltx}[2023/09/20 LaTeX firstaid to make underscore protected ] +\begingroup + \catcode`\_=\active + \protected\gdef _{% + \ifincsname % + \string_% + \else + \ifx\protect\@typeset@protect + \ifmmode \sb \else \BreakableUnderscore \fi + \else + \ifx\protect\@unexpandable@protect \noexpand_% + \else \protect_% + \fi\fi + \fi + } + \global\let\ActiveUnderscore=_ +\endgroup +%</underscore-ltx> % \end{macrocode} -% -% -% -% % \begin{macrocode} +%<*kernel> +\AddToHook{file/underscore.sty/after}[firstaid]{% + \FirstAidNeededT{underscore}{sty}{2006/09/13}{\RequirePackage{underscore-ltx}}} %</kernel> % \end{macrocode} % |