[latex3-commits] [latex3/latex2e] latex-lab/UF-06: \pmb + poorman \bm WIP, only luatex (d25f811b)
github at latex-project.org
github at latex-project.org
Fri Feb 23 20:02:26 CET 2024
Repository : https://github.com/latex3/latex2e
On branch : latex-lab/UF-06
Link : https://github.com/latex3/latex2e/commit/d25f811b11cac4b8fcd28ebf157b8b37ca06e0b3
>---------------------------------------------------------------
commit d25f811b11cac4b8fcd28ebf157b8b37ca06e0b3
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Fri Feb 23 20:02:26 2024 +0100
\pmb + poorman \bm WIP, only luatex
>---------------------------------------------------------------
d25f811b11cac4b8fcd28ebf157b8b37ca06e0b3
required/latex-lab/changes.txt | 4 ++++
required/latex-lab/latex-lab-amsmath.dtx | 32 +++++++++++++++++++++++++++++++
required/latex-lab/latex-lab-mathpkg.dtx | 33 ++++++++++++++++++++++++--------
3 files changed, 61 insertions(+), 8 deletions(-)
diff --git a/required/latex-lab/changes.txt b/required/latex-lab/changes.txt
index e68da021..d41cc34c 100644
--- a/required/latex-lab/changes.txt
+++ b/required/latex-lab/changes.txt
@@ -1,3 +1,7 @@
+2024-02-23 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
+ * latex-lab-amsmath.dtx, latex-lab-mathpkg.dtx: handle \pbm and poormans \bm
+ (luatex only)
+
2024-02-23 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
* update tagpdf and pdfmanagement
diff --git a/required/latex-lab/latex-lab-amsmath.dtx b/required/latex-lab/latex-lab-amsmath.dtx
index c87f5189..57e27067 100644
--- a/required/latex-lab/latex-lab-amsmath.dtx
+++ b/required/latex-lab/latex-lab-amsmath.dtx
@@ -199,6 +199,38 @@
}
% \end{macrocode}
%
+% \subsection{\cs{pmb}}
+% \cs{pmb} prints is argument three times. For tagging we must mark
+% two of occurences as artifact.
+% For luatex the attributes in the box must be reset, for this
+% we switch to expl3-boxes.
+% \begin{macrocode}
+\AddToHook{package/amsbsy/after}
+ {
+ \def\pmb@@@@#1#2#3{\leavevmode\hbox_set:Nn\l_@@_tmpa_box{xxx#3}
+ \dimen at -\box_wd:N\l_@@_tmpa_box
+ \kern-.5\ex@\box_use:N\l_@@_tmpa_box
+ \tag_mc_end:\tag_mc_begin:n{artifact}
+ \tag_mc_reset_box:N\l_@@_tmpa_box
+ \kern\dimen@\kern.25\ex@\raise.4\ex@\box_use:N\l_@@_tmpa_box
+ \kern\dimen@\kern.25\ex@\box_use_drop:N\l_@@_tmpa_box
+ \tag_mc_end:\tag_mc_begin:n{}
+ }
+ \def\pmb@#1#2{\hbox_set:Nn\l_@@_tmpa_box{$\m at th#1{#2}$}
+ \setboxz at h{$\m at th#1\mkern.5mu$}\pmbraise@\wdz@
+ \binrel@{#2}
+ \dimen at -\box_wd:N\l_@@_tmpa_box
+ \binrel@@@@{
+ \mkern-.8mu\box_use:N\l_@@_tmpa_box
+ \tag_mc_end:\tag_mc_begin:n{artifact}
+ \tag_mc_reset_box:N\l_@@_tmpa_box
+ \kern\dimen@\mkern.4mu\raise\pmbraise@\box_use:N\l_@@_tmpa_box
+ \kern\dimen@\mkern.4mu\box_use_drop:N\l_@@_tmpa_box
+ \tag_mc_end:\tag_mc_begin:n{}
+ }
+ }
+ }
+% \end{macrocode}
% \begin{macrocode}
\ExplSyntaxOff
% \end{macrocode}
diff --git a/required/latex-lab/latex-lab-mathpkg.dtx b/required/latex-lab/latex-lab-mathpkg.dtx
index a8e8e810..31e7d31e 100644
--- a/required/latex-lab/latex-lab-mathpkg.dtx
+++ b/required/latex-lab/latex-lab-mathpkg.dtx
@@ -68,15 +68,8 @@
\ProvidesFile{latex-lab-mathpkg.ltx}
[2023-01-05 v0.1a mathpkg adaptions]
% \end{macrocode}
-% \subsection{Tagpdf support}
-% To make the code independent from tagging being loaded and active
-% we load the \pkg{tagpdf-base} package:
-%
-% \begin{macrocode}
-\RequirePackage{tagpdf-base}
-% \end{macrocode}
-%
%
+% \subsection{breqn}
% \begin{macrocode}
\AddToHook{package/breqn/after}{
\RegisterMathEnvironment{dmath}
@@ -86,6 +79,7 @@
}
% \end{macrocode}
%
+% \subsection{cases}
% Force loading of \pkg{amsmath} before \pkg{cases}.
% \begin{macrocode}
\AddToHook {package/cases/before}{\RequirePackage{amsmath}}
@@ -94,6 +88,29 @@
}
% \end{macrocode}
%
+% \subsection{bm}
+% Similar to the amsbsy code in latex-lab-amsmath for \cs{pmb} we need to mark up
+% copies as artifact:
+%
+% \begin{macrocode}
+\ExplSyntaxOn
+\AddToHook{package/bm/after}
+ {
+ \def\bm at pmb@@@@#1#2#3{{%
+ \hbox_set:Nn\l_@@_tmpa_box{$\m at th#1#3$}%
+ \dimen@#2\wd\tw@
+ \rlap{\box_use:N\l_@@_tmpa_box}%
+ \tag_mc_end:\tag_mc_begin:n{artifact}
+ \tag_mc_reset_box:N\l_@@_tmpa_box
+ \kern\dimen@
+ \raise1.5\dimen@\rlap{\box_use:N\l_@@_tmpa_box}%
+ \kern\dimen@
+ \box_use_drop:N\l_@@_tmpa_box
+ \tag_mc_end:\tag_mc_begin:n{}%
+ }}
+ }
+\ExplSyntaxOff
+% \end{macrocode}
% \begin{macrocode}
%</kernel>
% \end{macrocode}
More information about the latex3-commits
mailing list.