summaryrefslogtreecommitdiff
path: root/macros/latex-dev/required/firstaid
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/required/firstaid')
-rw-r--r--macros/latex-dev/required/firstaid/changes.txt11
-rw-r--r--macros/latex-dev/required/firstaid/firstaid.ins3
-rw-r--r--macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.dtx42
-rw-r--r--macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.pdfbin252465 -> 263670 bytes
4 files changed, 51 insertions, 5 deletions
diff --git a/macros/latex-dev/required/firstaid/changes.txt b/macros/latex-dev/required/firstaid/changes.txt
index 17d8f9acdf..8db6a5d0fd 100644
--- a/macros/latex-dev/required/firstaid/changes.txt
+++ b/macros/latex-dev/required/firstaid/changes.txt
@@ -1,8 +1,13 @@
+2023-09-20 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+
+ * latex2e-first-aid-for-external-files.dtx: add firstaid for underscore to
+ make the active char protected and safe for use in csnames.
+
2023-07-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
- * latex2e-first-aid-for-external-files.dtx: remove no longer needed code for
+ * latex2e-first-aid-for-external-files.dtx: remove no longer needed code for
everysel
- * latex2e-first-aid-for-external-files.dtx: remove no longer needed code for bidi
- * latex2e-first-aid-for-external-files.dtx:
+ * latex2e-first-aid-for-external-files.dtx: remove no longer needed code for bidi
+ * latex2e-first-aid-for-external-files.dtx:
remove no longer needed code for memoir/stockheight
2023-05-20 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
diff --git a/macros/latex-dev/required/firstaid/firstaid.ins b/macros/latex-dev/required/firstaid/firstaid.ins
index b3f30c30da..22067390cd 100644
--- a/macros/latex-dev/required/firstaid/firstaid.ins
+++ b/macros/latex-dev/required/firstaid/firstaid.ins
@@ -72,4 +72,7 @@ without such generated files.
\generate{\file{filehook-ltx.sty}
{\from{latex2e-first-aid-for-external-files.dtx}{filehook-ltx}}}
+\generate{\file{underscore-ltx.sty}
+ {\from{latex2e-first-aid-for-external-files.dtx}{underscore-ltx}}}
+
\endbatchfile
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 d1eeaf5ce2..ed6c898d65 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
@@ -111,8 +111,8 @@
% \end{macrocode}
%
% \begin{macrocode}
-\def\LaTeXFirstAidDate{2023/07/18}
-\def\LaTeXFirstAidVersion{v1.1a}
+\def\LaTeXFirstAidDate{2023/09/20}
+\def\LaTeXFirstAidVersion{v1.1b}
% \end{macrocode}
%
% \begin{macrocode}
@@ -563,6 +563,44 @@
% \begin{macrocode}
%</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}
%
% \Finale
%
diff --git a/macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.pdf b/macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.pdf
index c024fad142..9716fc7592 100644
--- a/macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.pdf
+++ b/macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.pdf
Binary files differ