[latex3-commits] [git/LaTeX3-latex3-latex2e] everymath: Suppress capture of second pass over split (44e71eb0)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Jan 9 08:47:02 CET 2023


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

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

commit 44e71eb0600556b64ba02d6d2a0dce17a92f7a34
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Jan 9 07:47:02 2023 +0000

    Suppress capture of second pass over split


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

44e71eb0600556b64ba02d6d2a0dce17a92f7a34
 required/latex-lab/latex-lab-mathcapture.dtx                 | 8 +++++++-
 required/latex-lab/testfiles-mathcapture/mathcapture-008.lvt | 3 ---
 required/latex-lab/testfiles-mathcapture/mathcapture-008.tlg | 4 ----
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/required/latex-lab/latex-lab-mathcapture.dtx b/required/latex-lab/latex-lab-mathcapture.dtx
index a99a91ca..ff193a8a 100644
--- a/required/latex-lab/latex-lab-mathcapture.dtx
+++ b/required/latex-lab/latex-lab-mathcapture.dtx
@@ -417,6 +417,11 @@
 %   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: we can't use \cs{\meta{thing}@} as \cs{align@} takes two arguments!
+%   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 }
@@ -434,7 +439,8 @@
         \cs_new_eq:cc { @@_amsmath_ #1 @:n } { #1@ }
         \cs_gset_protected:cpx { #1@ } ##1
           {
-            \exp_not:N \@@_process:Vn \exp_not:N \@currenvir {##1}
+            \exp_not:N \tl_if_head_eq_meaning:nNF {##1} { \exp_not:N \split at tag }
+              { \exp_not:N \@@_process:Vn \exp_not:N \@currenvir {##1} }
             \exp_not:c { @@_amsmath_ #1 @:n } {##1}
           }
       }
diff --git a/required/latex-lab/testfiles-mathcapture/mathcapture-008.lvt b/required/latex-lab/testfiles-mathcapture/mathcapture-008.lvt
index 80c6b93c..fb36ede1 100644
--- a/required/latex-lab/testfiles-mathcapture/mathcapture-008.lvt
+++ b/required/latex-lab/testfiles-mathcapture/mathcapture-008.lvt
@@ -86,9 +86,6 @@ and~\eqref{eq:2}: only~\ref{eq:1C} and~\ref{eq:2C} differ.
       \right\rvert              \Biggr\rvert
 \end{split} \end{equation}
 
-\TYPE{==>  \string\split at tag\space looks a bit odd and may not be helpful for later processing}
-
-
 11-2-39:
 \begin{gather}   \raisetag{-10pt}
   \text{The sign function: \ }
diff --git a/required/latex-lab/testfiles-mathcapture/mathcapture-008.tlg b/required/latex-lab/testfiles-mathcapture/mathcapture-008.tlg
index adeb45ee..0fb08156 100644
--- a/required/latex-lab/testfiles-mathcapture/mathcapture-008.tlg
+++ b/required/latex-lab/testfiles-mathcapture/mathcapture-008.tlg
@@ -16,10 +16,6 @@ A_1 &= N_0 (\lambda ; \Omega ') - \phi ( \lambda ; \Omega ') \\ A_2 &= \phi (\la
 Math env equation
 \begin {split} \lvert I_2 \rvert &= \left \lvert \int _{0}^T \psi (t) \left \{ u(a, t) - \int _{\gamma (t)}^a \frac {d\theta }{k} (\theta , t) \int _{a}^\theta c (\xi ) u_t (\xi , t) \,d\xi \right \} dt \right \rvert \\ &\le C_6 \Biggl \lvert \left \lvert f \int _\Omega \left \lvert \widetilde {S}^{-1,0}_{a,-} W_2(\Omega , \Gamma _l) \right \rvert \ \right \rvert \left \lvert \lvert u \rvert \overset {\circ }{\to } W_2^{\widetilde {A}} (\Omega ; \Gamma _r,T) \right \rvert \Biggr \rvert \end {split}
 -----------------------------------
-Math env equation
-\split at tag \begin {split} \lvert I_2 \rvert &= \left \lvert \int _{0}^T \psi (t) \left \{ u(a, t) - \int _{\gamma (t)}^a \frac {d\theta }{k} (\theta , t) \int _{a}^\theta c (\xi ) u_t (\xi , t) \,d\xi \right \} dt \right \rvert \\ &\le C_6 \Biggl \lvert \left \lvert f \int _\Omega \left \lvert \widetilde {S}^{-1,0}_{a,-} W_2(\Omega , \Gamma _l) \right \rvert \ \right \rvert \left \lvert \lvert u \rvert \overset {\circ }{\to } W_2^{\widetilde {A}} (\Omega ; \Gamma _r,T) \right \rvert \Biggr \rvert \end {split}
-==> \split at tag looks a bit odd and may not be helpful for later processing
------------------------------------
 Math env gather
 \raisetag {-10pt} \text {The sign function: \ } \mathcal {S}(x) = \begin {cases} -1 & x < 0 \\ 0 & x = 0 \\ 1 & x > 0 \end {cases}
 -----------------------------------





More information about the latex3-commits mailing list.