[latex3-commits] [git/LaTeX3-latex3-latex2e] everymath: Set up amsmath programmatically (5ba248d2)

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


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

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

commit 5ba248d219ad3b72a7a4c86367efc54b65a4794c
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Jan 6 14:17:30 2023 +0000

    Set up amsmath programmatically


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

5ba248d219ad3b72a7a4c86367efc54b65a4794c
 required/latex-lab/latex-lab-mathcapture.dtx | 36 ++++++++--------------------
 1 file changed, 10 insertions(+), 26 deletions(-)

diff --git a/required/latex-lab/latex-lab-mathcapture.dtx b/required/latex-lab/latex-lab-mathcapture.dtx
index f7df95c8..e3b3725a 100644
--- a/required/latex-lab/latex-lab-mathcapture.dtx
+++ b/required/latex-lab/latex-lab-mathcapture.dtx
@@ -385,6 +385,8 @@
 % \subsection{Modifying \pkg{amsmath}}
 %
 % 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!
 %    \begin{macrocode}
 \clist_map_inline:nn
   { align , gather , multline }
@@ -394,38 +396,20 @@
     \AddToHook{ env / #1* / begin }
       { \bool_set_true:N \l_@@_collected_bool }
   }
-%    \end{macrocode}
-%
-%
-% \begin{macro}{\@@_measure@:n, \@@_gmeasure@:n, \@@_mmeasure@:n}
-% \begin{macro}{\measure@, \gmeasure@, \mmeasure@}
-%   The \pkg{amsmath} environments use a few common internal commands that are
-%   useful places to pick up the content.
-%    \begin{macrocode}
 \tl_gput_right:Nn \@kernel at before@begindocument
   {
-    \cs_new_eq:NN \@@_measure@:n \measure@
-    \cs_gset_protected:Npn \measure@ #1
-      {
-        \@@_process:n {#1}
-        \@@_measure@:n {#1}
-      }
-    \cs_new_eq:NN \@@_gmeasure@:n \gmeasure@
-    \cs_gset_protected:Npn \gmeasure@ #1
+    \clist_map_inline:nn
+      { measure , gmeasure , mmeasure }
       {
-        \@@_process:n {#1}
-        \@@_gmeasure@:n {#1}
-      }
-    \cs_new_eq:NN \@@_mmeasure@:n \mmeasure@
-    \cs_gset_protected:Npn \mmeasure@ #1
-      {
-        \@@_process:n {#1}
-        \@@_mmeasure@:n {#1}
+        \cs_new_eq:cc { @@_amsmath_ #1 @:n } { #1@ }
+        \cs_gset_protected:cpx { #1@ } ##1
+          {
+            \exp_not:N \@@_process:n {##1}
+            \exp_not:c { @@_amsmath_ #1 @:n } {##1}
+          }
       }
   }
 %    \end{macrocode}
-% \end{macro}
-% \end{macro}
 %
 %    \begin{macrocode}
 \ExplSyntaxOff





More information about the latex3-commits mailing list.