summaryrefslogtreecommitdiff
path: root/macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-06-18 03:01:13 +0000
committerNorbert Preining <norbert@preining.info>2021-06-18 03:01:13 +0000
commit3ecc00c27119bc47ba26b518b7d26c00b69599df (patch)
treedb60a75c06403ca74ed76bc3339d80958159ae3e /macros/latex-dev/required/firstaid/latex2e-first-aid-for-external-files.dtx
parent5f3280db1e6f333f79e9930e5609d3f5175d5af7 (diff)
CTAN sync 202106180301
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.dtx73
1 files changed, 70 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 7eb108418c..84ddacb269 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{2021/03/15}
-\def\LaTeXFirstAidVersion{v1.0l}
+\def\LaTeXFirstAidDate{2021/06/08}
+\def\LaTeXFirstAidVersion{v1.0m}
% \end{macrocode}
%
% \begin{macrocode}
@@ -134,7 +134,9 @@
% \begin{macrocode}
\ExplSyntaxOn
\cs_new:Npn\FirstAidNeededT#1#2#3{
- \exp_args:Nc\str_if_eq:onT{ver@#1.#2}{#3}
+ \exp_args:Ncx\str_if_eq:onF{ver@#1.#2}{#3}
+ { \typeout{==>~ First~ Aid~ for~ #1.#2~ no~ longer~ applied!} }
+ \exp_args:Ncx\str_if_eq:onT{ver@#1.#2}{#3}
}
\ExplSyntaxOff
% \end{macrocode}
@@ -546,6 +548,71 @@
%
%
%
+% \subsection{\cs{ulem} first aid}
+%
+% In 2020 we fixed various kernel commands to accept \pkg{calc}
+% syntax. The \pkg{ulem} package redefines some internals and that
+% now conflicts with the new definitions as they involve an extra
+% group. So we alter the definition of \cs{@hspace} if \pkg{ulem}
+% was loaded. This is not perfect, obviously, so it will go out the
+% moment \pkg{ulem} gets adjusted.
+%
+% \begin{macrocode}
+\AddToHook{file/after/ulem.sty}[firstaid]{%
+ \def\@hspace#1{\begingroup\setlength\skip@{#1}%
+ \edef\x{\endgroup\hskip\the\skip@\relax}\x}%
+ }
+% \end{macrocode}
+%
+%
+% \subsection{\cs{varwidth} first aid}
+%
+% The \pkg{varwidth} package does a lot of low-level paragraph
+% manipulation assuming traditional \TeX{} paragraphs. However, with
+% the paragraph hooks we end up with one extra glue 0pt item on the
+% vertical list and if that isn't removed then the package doesn't
+% find its penalties.
+%
+% So this needs to be removed as well by adding an additional
+% \cs{unskip}.
+%
+% \begin{macrocode}
+\AddToHook{file/after/varwidth.sty}[firstaid]{%
+ \FirstAidNeededT{varwidth}{sty}%
+ {2009/03/30 ver 0.92; \space Variable-width minipages}%
+ {%
+\def\@vwid@sift{%
+ \skip@\lastskip\unskip
+ \unskip % <---- the first aid here
+ \dimen@\lastkern\unkern
+ \count@\lastpenalty\unpenalty
+ \setbox\z@\lastbox
+ \ifvoid\z@ \advance\sift@deathcycles\@ne \else \sift@deathcycles\z@ \fi
+ \ifnum\sift@deathcycles>33
+ \let\@vwid@sift\relax
+ \PackageWarning{varwidth}{Failed to reprocess entire contents}%
+ \fi
+ \ifnum\count@=\@vwid@preeqp \@vwid@eqmodefalse\fi
+ \ifnum\count@=\@vwid@posteqp \@vwid@eqmodetrue\fi
+ \ifnum\count@=\@vwid@toppen % finished
+ \let\@vwid@sift\relax
+ \else\ifnum\count@=\@vwid@offsets
+ \@vwid@setoffsets
+ \else
+ \ifnum\count@=\@vwid@postw
+ \else
+ \@vwid@resetb % reset box \z@ or measure it
+ \fi
+ \@vwid@append
+ \fi\fi
+ \@vwid@sift}%
+ }%
+ }
+% \end{macrocode}
+%
+%
+%
+%
% \subsection[Temporary fixes for the kernel (until the next
% patch-level release)]
% {Temporary fixes for the kernel \\