summaryrefslogtreecommitdiff
path: root/macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx')
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx65
1 files changed, 63 insertions, 2 deletions
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx b/macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx
index ba4addadd2..ce0d46f815 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx
@@ -16,8 +16,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabfirstaiddate{2024-03-18}
-\def\ltlabfirstaidversion{0.85c}
+\def\ltlabfirstaiddate{2024-05-25}
+\def\ltlabfirstaidversion{0.85d}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -65,6 +65,32 @@
\ltlabfirstaiddate\space v\ltlabfirstaiddate\space
Temporary patches to external packages needed for the tagging project]
% \end{macrocode}
+% \begin{macro}{\FirstAidNeededT}
+% This is a very simple help to ensure that we only apply first aid
+% to an unmodified package or class. It only works in the case the
+% file has already been loaded and the csname \cs{ver@\#1.\#2} got
+% defined (holding the current date, version, and short description
+% info). We then compare its content to a frozen string and make
+% the modification \verb=#3= only if both agree. If they differ we
+% assume that the package/class in question got updated by its
+% maintainer.
+% \begin{macrocode}
+\ExplSyntaxOn
+\providecommand\FirstAidNeededT[3]{
+ \exp_args:Ncx\str_if_eq:onF{ver@#1.#2}{#3}
+ { \typeout{==>~ First~ Aid~ for~ #1.#2~ no~ longer~ applied!^^J
+ \@spaces Expected:^^J
+ \@spaces\@spaces #3^^J
+ \@spaces but~ found:^^J
+ \@spaces\@spaces \use:c{ver@#1.#2}^^J
+ \@spaces so~ I'm~ assuming~ it~ got~ fixed.
+ } }
+ \exp_args:Ncx\str_if_eq:onT{ver@#1.#2}{#3}
+}
+\ExplSyntaxOff
+% \end{macrocode}
+% \end{macro}
+
% \subsection{ams classes}
% The amsart and amsbook classes do not use \cs{@author} to store the author list
% but a command \cs{authors}. To be able to nevertheless use the authors in the
@@ -254,6 +280,41 @@
}
% \end{macrocode}
%
+% \subsection{booktabs}
+% In some cases booktabs inserts a
+% \cs{multispan} into the table (through the commands \cs{@cmidruleb}
+% and \cs{@cmidrulea} and this then errors
+% with the tagging code.
+% This affects both tabular and longtable
+% (but longtable more as booktabs handles lines in longtable differently).
+% See also issue \url{https://github.com/latex3/tagging-project/issues/69}
+%
+%
+\ExplSyntaxOn
+\AddToHook{package/booktabs/after}
+ {
+ \def\@cmidrulea{
+ \multispan\@cmidla
+ &\multispan\@cmidlb
+ \unskip\hskip\cmrkern@l
+ {
+ \tag_mc_begin:n{artifact}
+ \CT@arc@\leaders\hrule \@height\@thisrulewidth\hfill\kern\z@}
+ \hskip\cmrkern@r
+ \tag_mc_end: \int_gdecr:N \g__tbl_row_int
+ \cr}
+
+ \def\@cmidruleb{%
+ \multispan\@cmidlb
+ \unskip\hskip \cmrkern@l%
+ {
+ \tag_mc_begin:n{artifact}
+ \CT@arc@\leaders\hrule \@height\@thisrulewidth\hfill\kern\z@}
+ \hskip\cmrkern@r
+ \tag_mc_end: \int_gdecr:N \g__tbl_row_int
+ \cr}
+ }
+\ExplSyntaxOff
%
% \begin{macrocode}
%</package>