[latex3-commits] [latex3/latex2e] latex-lab/uf-review-05: disable math grabbing in begindocument (3d10344a)

github at latex-project.org github at latex-project.org
Mon Jan 29 00:13:39 CET 2024


Repository : https://github.com/latex3/latex2e
On branch  : latex-lab/uf-review-05
Link       : https://github.com/latex3/latex2e/commit/3d10344a4e9b3c8aab7ca3cd0f001099680cb3b7

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

commit 3d10344a4e9b3c8aab7ca3cd0f001099680cb3b7
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Jan 29 00:13:39 2024 +0100

    disable math grabbing in begindocument


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

3d10344a4e9b3c8aab7ca3cd0f001099680cb3b7
 required/latex-lab/changes.txt        |  3 +++
 required/latex-lab/latex-lab-math.dtx | 14 ++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/required/latex-lab/changes.txt b/required/latex-lab/changes.txt
index aebc41c9..3118ce81 100644
--- a/required/latex-lab/changes.txt
+++ b/required/latex-lab/changes.txt
@@ -1,3 +1,6 @@
+2024-01-29 Ulrike Fischer <Ulrike.Fischer at latex-project.org> 
+	* latex-lab-math.dtx: disable mathgrabbing in begindocument hook.
+
 2024-01-18 Ulrike Fischer <Ulrike.Fischer at latex-project.org> 
 	* latex-lab-firstaid.dtx: add support for \authors from amsart.
 
diff --git a/required/latex-lab/latex-lab-math.dtx b/required/latex-lab/latex-lab-math.dtx
index 802ba543..5fd0dec0 100644
--- a/required/latex-lab/latex-lab-math.dtx
+++ b/required/latex-lab/latex-lab-math.dtx
@@ -1829,6 +1829,20 @@
 %    \end{macrocode}
 % \end{macro}
 % 
+% \subsection{Disable math grabbing in the begindocument hook}
+% For example amsart uses math to measure text there.
+% 
+%    \begin{macrocode}
+\tl_gput_right:Nn\@kernel at before@begindocument
+  {
+    \bool_set_true:N\l__math_collected_bool
+  }
+\tl_gput_right:Nn\@kernel at after@begindocument
+ {
+   \bool_set_false:N\l__math_collected_bool
+ }
+%    \end{macrocode}
+%
 % \subsection{Modifying \pkg{amsmath}}
 %
 % \begin{macro}{\@@_amsmath_align@:nn}





More information about the latex3-commits mailing list.