[latex3-commits] [git/LaTeX3-latex3-latex2e] everymath: Suppress capture for \m at th (c21e9ccd)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Jan 5 19:42:03 CET 2023


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

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

commit c21e9ccd05116b8f93b9f6c64a885412e4022c80
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Jan 5 18:41:56 2023 +0000

    Suppress capture for \m at th


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

c21e9ccd05116b8f93b9f6c64a885412e4022c80
 required/latex-lab/latex-lab-mathcapture.dtx            | 17 +++++++++++++++++
 .../latex-lab/testfiles-mathcapture/mathcapture-002.tlg |  4 ----
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/required/latex-lab/latex-lab-mathcapture.dtx b/required/latex-lab/latex-lab-mathcapture.dtx
index d0d9284a..c3d41a6c 100644
--- a/required/latex-lab/latex-lab-mathcapture.dtx
+++ b/required/latex-lab/latex-lab-mathcapture.dtx
@@ -363,6 +363,23 @@
   }
 %    \end{macrocode}
 %
+% \begin{macro}{\@@_m at th:, \m at th}
+%   Handle non-math use of math mode but allow for nesting.
+%    \begin{macrocode}
+\cs_new_eq:NN \@@_m at th: \m at th
+\cs_gset_protected:Npn \m at th
+  {
+    \bool_set_true:N \l_@@_collected_bool
+    \@@_m at th:
+    \exp_args:No \tex_everymath:D
+      {
+        \tex_the:D \tex_everymath:D
+        \bool_set_false:N \l_@@_collected_bool
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 \ExplSyntaxOff
 %    \end{macrocode}
diff --git a/required/latex-lab/testfiles-mathcapture/mathcapture-002.tlg b/required/latex-lab/testfiles-mathcapture/mathcapture-002.tlg
index 7f51f641..8b497900 100644
--- a/required/latex-lab/testfiles-mathcapture/mathcapture-002.tlg
+++ b/required/latex-lab/testfiles-mathcapture/mathcapture-002.tlg
@@ -2,10 +2,6 @@ This is a generated file for the l3build validation system.
 Don't change this file in any respect.
 -----------------------------------
 \alpha \neq \beta \pmod x
------------------------------------
-_{\mbox {\fontsize \sf at size \sf at size \selectfont 22}}
------------------------------------
-^{\mbox {\fontsize \sf at size \sf at size \selectfont 13}}
 Definitely broken because it should not capture math!
 -----------------------------------
 (a+b)^2 = a^2+2ab+b^2





More information about the latex3-commits mailing list.