[latex3-commits] [git/LaTeX3-latex3-latex2e] everymath: Detect \m at th for all grabbed math (bbba7723)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Jan 18 21:44:35 CET 2023


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

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

commit bbba772374157851153816c9d12afdc9ed43b2c3
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Jan 18 20:44:35 2023 +0000

    Detect \m at th for all grabbed math
    
    This means that any appearance of \m at th at
    top level will prevent treatment as grabbed math mode.


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

bbba772374157851153816c9d12afdc9ed43b2c3
 required/latex-lab/latex-lab-mathcapture.dtx | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/required/latex-lab/latex-lab-mathcapture.dtx b/required/latex-lab/latex-lab-mathcapture.dtx
index 213cc588..1f23435d 100644
--- a/required/latex-lab/latex-lab-mathcapture.dtx
+++ b/required/latex-lab/latex-lab-mathcapture.dtx
@@ -154,7 +154,10 @@
 \cs_new_protected:Npn \@@_process:nn #1#2
   {
     \legacy_if:nF { measuring@ }
-      { \tl_trim_spaces_apply:nN {#2} \@@_process_auxi:nn {#1} }
+      {
+        \tl_if_in:nnF {#2} { \m at th }
+          { \tl_trim_spaces_apply:nN {#2} \@@_process_auxi:nn {#1} }
+      }
   }
 \cs_generate_variant:Nn \@@_process:nn { V }
 \cs_new_protected:Npn \@@_process_auxi:nn #1#2
@@ -182,8 +185,7 @@
   {
     \tl_if_blank:nF {#1}
       {
-        \tl_if_head_eq_meaning:nNF {#1} \m at th
-          { \@@_process:nn { math } {#1} } % $
+        \@@_process:nn { math } {#1} } % $
         #1 $
       }
   }
@@ -230,7 +232,7 @@
 %
 % \subsection{Marking math environments}
 %
-% A general mechanism for math mode environments that do no grab their
+% A general mechanism for math mode environments that do not grab their
 % content (\emph{cf.}~most \pkg{amsmath} environments).
 %
 % \begin{variable}{\l_@@_env_name_tl}
@@ -458,13 +460,13 @@
 % \begin{macro}{\align@}
 % \begin{macro}{\gather@, \multline@}
 %   Mark up all of the display environments as the content is captured anyway.
-%   We then use the internal for each environment type to insert the processing
-%   code. Each of these is slightly different, so we cannot use a simple loop
-%   here. The test for \cs{split at tag} is required as the \texttt{split}
-%   environment internally uses \texttt{gather} \emph{when not within an
-%   \pkg{amsmath}} environment, for example inside \texttt{equation}. Without
-%   the precaution, we'd get two copies of the grabbed math, the second of
-%   which would start with \cs{split at tag}.
+%   We then use an internal macro in each environment type to insert the
+%   processing code. Each of these is slightly different, so we cannot use a
+%   simple loop here. The test for \cs{split at tag} is required as the
+%   \texttt{split} environment internally uses \texttt{gather} \emph{when not
+%   within an \pkg{amsmath}} environment, for example inside \texttt{equation}.
+%   Without the precaution, we'd get two copies of the grabbed math, the second
+%   of which would start with \cs{split at tag}.
 %    \begin{macrocode}
 \clist_map_inline:nn
   { align , gather , multline }





More information about the latex3-commits mailing list.