diff --git a/required/latex-lab/changes.txt b/required/latex-lab/changes.txt index aebc41c91..3118ce810 100644 --- a/required/latex-lab/changes.txt +++ b/required/latex-lab/changes.txt @@ -1,3 +1,6 @@ +2024-01-29 Ulrike Fischer + * latex-lab-math.dtx: disable mathgrabbing in begindocument hook. + 2024-01-18 Ulrike Fischer * 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 802ba5434..5fd0dec0c 100644 --- a/required/latex-lab/latex-lab-math.dtx +++ b/required/latex-lab/latex-lab-math.dtx @@ -1828,6 +1828,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@before@begindocument + { + \bool_set_true:N\l__math_collected_bool + } +\tl_gput_right:Nn\@kernel@after@begindocument + { + \bool_set_false:N\l__math_collected_bool + } +% \end{macrocode} % % \subsection{Modifying \pkg{amsmath}} %