[latex3-commits] [git/LaTeX3-latex3-latex2e] everymath: Suppress some \mathchoice noise (15d4065f)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Jan 6 15:44:24 CET 2023


Repository : https://github.com/latex3/latex2e
On branch  : everymath
Link       : https://github.com/latex3/latex2e/commit/15d4065f775454a5499f0f070c2679628fa59ddf

>---------------------------------------------------------------

commit 15d4065f775454a5499f0f070c2679628fa59ddf
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Jan 6 14:44:24 2023 +0000

    Suppress some \mathchoice noise
    
    Still likely needs more refinement.


>---------------------------------------------------------------

15d4065f775454a5499f0f070c2679628fa59ddf
 required/latex-lab/latex-lab-mathcapture.dtx       |  16 ++
 .../testfiles-mathcapture/mathcapture-009.tlg      |  12 -
 .../testfiles-mathcapture/mathcapture-012.tlg      | 264 ---------------------
 3 files changed, 16 insertions(+), 276 deletions(-)

diff --git a/required/latex-lab/latex-lab-mathcapture.dtx b/required/latex-lab/latex-lab-mathcapture.dtx
index 001a07c5..86ae5879 100644
--- a/required/latex-lab/latex-lab-mathcapture.dtx
+++ b/required/latex-lab/latex-lab-mathcapture.dtx
@@ -206,6 +206,22 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\mathchoice}
+%   Avoid issues with multiple collection.
+%    \begin{macrocode}
+\cs_gset_protected:Npn \mathchoice #1#2#3#4
+  {
+    \bool_if:NTF \l_@@_collected_bool
+      { \tex_mathchoice:D {#1} {#2} {#3} {#4} }
+      {
+        \bool_set_true:N \l_@@_collected_bool
+        \tex_mathchoice:D {#1} {#2} {#3} {#4}
+        \bool_set_false:N \l_@@_collected_bool
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \subsection{Marking math environments}
 %
 % A general mechanism for math mode environments that do no grab their
diff --git a/required/latex-lab/testfiles-mathcapture/mathcapture-009.tlg b/required/latex-lab/testfiles-mathcapture/mathcapture-009.tlg
index 90a03d2e..0571473a 100644
--- a/required/latex-lab/testfiles-mathcapture/mathcapture-009.tlg
+++ b/required/latex-lab/testfiles-mathcapture/mathcapture-009.tlg
@@ -5,18 +5,6 @@ Math env equation*
 \begin {array}{ccc} S^{\mathcal {W}_\Lambda }\otimes T & \stackrel {j}{\longrightarrow } & T \\ \Big \downarrow & & \Big \downarrow \vcenter {\rlap {$\scriptstyle {\mathrm {End}}\,P$}} \\ (S\otimes T)/I & = & (Z\otimes T)/J \end {array}
 -----------------------------------
 Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
 \bool_set_false:N \l__math_collected_bool \scriptstyle {\mathrm {End}}\,P
 ???????????????????????? strange extra
 [1
diff --git a/required/latex-lab/testfiles-mathcapture/mathcapture-012.tlg b/required/latex-lab/testfiles-mathcapture/mathcapture-012.tlg
index 30c825d9..f8adff26 100644
--- a/required/latex-lab/testfiles-mathcapture/mathcapture-012.tlg
+++ b/required/latex-lab/testfiles-mathcapture/mathcapture-012.tlg
@@ -3,30 +3,6 @@ Don't change this file in any respect.
 -----------------------------------
 Math env equation*
 0 \xleftarrow [\zeta ]{} F \times \Delta (n - 1) \xrightarrow {\partial _0 \alpha (b)} E^{\partial _0 b}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
 ???????????????????????? again spurious extra captures
 -----------------------------------
 Math env align*
@@ -39,256 +15,16 @@ Math env gather
 A \xLeftarrow {\ x} B \xRightarrow [y\ ]{} C \xLeftrightarrow [y]{\ x\ } D \\ A \xhookleftarrow {x} B \xhookrightarrow [bbb]{a} C \\ \xleftharpoondown {} \xleftharpoonup {} \xleftrightharpoons {xxx} \xrightleftharpoons [yy]{} \xrightharpoondown {} \xrightharpoonup {} \\ \xmapsto {x>0} A \xleftrightarrow [\text {letters}]{} Z
 -----------------------------------
 Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
 \bool_set_false:N \l__math_collected_bool \m at th \thickmuskip 0mu\medmuskip \thickmuskip \thinmuskip \thickmuskip \relax \displaystyle \leftharpoonup \mkern -7mu\cleaders \hbox {$\displaystyle \mkern -2mu\relbar \mkern -2mu$}\hfill \mkern -7mu\relbar 
 -----------------------------------
 Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \displaystyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \textstyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {}
------------------------------------
-Math env $
 \bool_set_false:N \l__math_collected_bool \m at th \thickmuskip 0mu\medmuskip \thickmuskip \thinmuskip \thickmuskip \relax \displaystyle \relbar \mkern -7mu\cleaders \hbox {$\displaystyle \mkern -2mu\relbar \mkern -2mu$}\hfill \mkern -7mu\rightharpoondown 
 -----------------------------------
 Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {xxx}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {xxx}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {xxx}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {xxx}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \displaystyle {xxx}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \textstyle {xxx}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {xxx}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {xxx}
------------------------------------
-Math env $
 \bool_set_false:N \l__math_collected_bool \m at th \thickmuskip 0mu\medmuskip \thickmuskip \thinmuskip \thickmuskip \relax \displaystyle \relbar \mkern -7mu\cleaders \hbox {$\displaystyle \mkern -2mu\relbar \mkern -2mu$}\hfill \mkern -7mu\rightharpoonup 
 -----------------------------------
 Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {yy}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {yy}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {yy}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {yy}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \displaystyle {yy}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \textstyle {yy}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {yy}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {yy}
------------------------------------
-Math env $
 \bool_set_false:N \l__math_collected_bool \m at th \thickmuskip 0mu\medmuskip \thickmuskip \thinmuskip \thickmuskip \relax \displaystyle \leftharpoondown \mkern -7mu\cleaders \hbox {$\displaystyle \mkern -2mu\relbar \mkern -2mu$}\hfill \mkern -7mu\relbar 
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \displaystyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \textstyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {}
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \displaystyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \textstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptstyle {\std at minus }
------------------------------------
-Math env $
-\bool_set_false:N \l__math_collected_bool \bool_set_false:N \l__math_collected_bool \m at th \scriptscriptstyle {\std at minus }
 ???????????????????????? again spurious extra captures
 -----------------------------------
 Math env gather*





More information about the latex3-commits mailing list.