texlive[59847] Master/texmf-dist: lualatex-math (5jul21)

commits+karl at tug.org commits+karl at tug.org
Mon Jul 5 22:55:21 CEST 2021


Revision: 59847
          http://tug.org/svn/texlive?view=revision&revision=59847
Author:   karl
Date:     2021-07-05 22:55:21 +0200 (Mon, 05 Jul 2021)
Log Message:
-----------
lualatex-math (5jul21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/lualatex/lualatex-math/lualatex-math.pdf
    trunk/Master/texmf-dist/source/lualatex/lualatex-math/lualatex-math.dtx
    trunk/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty

Modified: trunk/Master/texmf-dist/doc/lualatex/lualatex-math/lualatex-math.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/lualatex/lualatex-math/lualatex-math.dtx
===================================================================
--- trunk/Master/texmf-dist/source/lualatex/lualatex-math/lualatex-math.dtx	2021-07-05 20:55:05 UTC (rev 59846)
+++ trunk/Master/texmf-dist/source/lualatex/lualatex-math/lualatex-math.dtx	2021-07-05 20:55:21 UTC (rev 59847)
@@ -1,6 +1,7 @@
 % \iffalse meta-comment
 %
 % Copyright 2011–2020 by Philipp Stephani, Joseph Wright, and Will Robertson
+% Copyright 2021 Google LLC
 %
 % This file may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either
@@ -31,7 +32,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{300}
+% \CheckSum{314}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -150,7 +151,7 @@
 %<@@=lltxmath>
 \NeedsTeXFormat{LaTeX2e}[2020/02/02]
 \RequirePackage{expl3}[2018/06/18]
-\ProvidesExplPackage{lualatex-math}{2020/09/25}{1.9}%
+\ProvidesExplPackage{lualatex-math}{2021/07/05}{1.11}%
   {Patches for mathematics typesetting with LuaLaTeX}
 \RequirePackage { etoolbox } [ 2007/10/08 ]
 \cs_if_exist:NF \newluabytecode
@@ -634,6 +635,11 @@
 % internal version use a hack involving a null radical.  \Hologo{LuaTeX} has
 % primitives for setting material in cramped mode, so we make use of them.
 %
+% In newer versions of \pkg{mathtools}, this issue is fixed, in which case we
+% skip the patch.
+% \changes{v1.10}{2021/03/28}{Skip patch if \pkg{mathtools} is recent enough}
+% \changes{v1.11}{2021/07/05}{Adapt to March 2021 changes to \pkg{mathtools}}
+%
 % \begin{macro}{\MT_cramped_internal:Nn}
 %   The macro \cmd{\MT_cramped_internal:Nn}\meta{style}\marg{expression}
 %   typesets the \meta{expression} in the cramped style corresponding to the
@@ -644,36 +650,39 @@
 %   single command.
 %    \begin{macrocode}
 \@@_after_package_or_now:nn { mathtools } {
-  \@@_patch:NNnnn \MT_cramped_internal:Nn
-    \cs_set_nopar:Npn { #1 #2 } {
-    \sbox \z@ {
-      $
-      \m at th
-      #1
-      \nulldelimiterspace = \z@
-      \radical \z@ { #2 }
-      $
-    }
-    \ifx #1 \displaystyle
-      \dimen@ = \fontdimen 8 \textfont 3
-      \advance \dimen@ .25 \fontdimen 5 \textfont 2
-    \else
-      \dimen@ = 1.25 \fontdimen 8
-      \ifx #1 \textstyle
-        \textfont
+  \@ifpackagelater { mathtools } { 2021/03/28 } { } {
+    \@@_patch:NNnnn \MT_cramped_internal:Nn
+      \cs_set_nopar:Npn { #1 #2 } {
+      \setbox \z@ \hbox {
+        $
+        \m at th
+        #1
+        \kern -\nulldelimiterspace
+        \radical \z@ { #2 }
+        $
+      }
+      \ifx #1 \displaystyle
+        \dimen@ = \fontdimen 8 \textfont 3
+        \advance \dimen@ .25 \fontdimen 5 \textfont 2
       \else
-        \ifx #1 \scriptstyle
-          \scriptfont
+        \dimen@ = 1.25 \fontdimen 8
+        \ifx #1 \textstyle
+          \textfont
         \else
-          \scriptscriptfont
+          \ifx #1 \scriptstyle
+            \scriptfont
+          \else
+            \scriptscriptfont
+          \fi
         \fi
+        3
       \fi
-      3
-    \fi
-    \advance \dimen@ -\ht\z@
-    \ht\z@ = -\dimen@
-    \box\z@
-  } {
+      \advance \dimen@ -\ht\z@
+      \ht\z@ = -\dimen@
+      \ifvmode \leavevmode \fi
+      { }
+      \box\z@
+    } {
 %    \end{macrocode}
 % \changes{v1.4}{2014/08/18}{Added \cs{ensuremath} to work around
 % \href{https://github.com/phst/lualatex-math/issues/11}{issue~11}}
@@ -683,9 +692,10 @@
 % math mode, we use |\ensuremath| here.
 %   \changes{v1.9}{2020/09/25}{Stop using \cs{…:D} control sequences}
 %    \begin{macrocode}
-    {
-      \ensuremath {
-        \use:c { cramped \cs_to_str:N #1 } #2
+      {
+        \ensuremath {
+          \use:c { cramped \cs_to_str:N #1 } #2
+        }
       }
     }
   }
@@ -701,6 +711,8 @@
 % the comma character.  This breaks for Unicode fonts.  The incompatibility was
 % noticed by
 % \Breitfeld.\footnote{\url{https://groups.google.com/forum/\#!topic/de.comp.text.tex/Cputk-AJS5I/discussion}}
+% \changes{v1.10}{2021/03/28}{Use new \Hologo{LaTeX2e} hook management if
+% available}
 %
 % \begin{macro}{\mathcomma}
 %   \pkg{icomma} defines the mathemathical character shorthand \cmd{\icomma} at
@@ -708,10 +720,19 @@
 %   \cmd{\@begindocumenthook}.
 %    \begin{macrocode}
 \@@_after_package_or_now:nn { icomma } {
-  \tl_replace_once:Nnn \@begindocumenthook {
-    \mathchardef \mathcomma \mathcode `\,
+  \@ifl at t@r \fmtversion { 2020/10/01 } {
+    \hook_gput_code:nnn { begindocument } { lualatex-math } {
+      \@@_set_mathchar:NN \mathcomma \,
+      \mathcode `\, = "8000 ~
+    }
+    \hook_gset_rule:nnnn
+      { begindocument } { lualatex-math } { voids } { icomma }
   } {
-    \@@_set_mathchar:NN \mathcomma \,
+    \tl_replace_once:Nnn \@begindocumenthook {
+      \mathchardef \mathcomma \mathcode `\,
+    } {
+      \@@_set_mathchar:NN \mathcomma \,
+    }
   }
 }
 %</package>

Modified: trunk/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty	2021-07-05 20:55:05 UTC (rev 59846)
+++ trunk/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty	2021-07-05 20:55:21 UTC (rev 59847)
@@ -22,7 +22,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[2020/02/02]
 \RequirePackage{expl3}[2018/06/18]
-\ProvidesExplPackage{lualatex-math}{2020/09/25}{1.9}%
+\ProvidesExplPackage{lualatex-math}{2021/07/05}{1.11}%
   {Patches for mathematics typesetting with LuaLaTeX}
 \RequirePackage { etoolbox } [ 2007/10/08 ]
 \cs_if_exist:NF \newluabytecode
@@ -230,48 +230,61 @@
   }
 }
 \__lltxmath_after_package_or_now:nn { mathtools } {
-  \__lltxmath_patch:NNnnn \MT_cramped_internal:Nn
-    \cs_set_nopar:Npn { #1 #2 } {
-    \sbox \z@ {
-      $
-      \m at th
-      #1
-      \nulldelimiterspace = \z@
-      \radical \z@ { #2 }
-      $
-    }
-    \ifx #1 \displaystyle
-      \dimen@ = \fontdimen 8 \textfont 3
-      \advance \dimen@ .25 \fontdimen 5 \textfont 2
-    \else
-      \dimen@ = 1.25 \fontdimen 8
-      \ifx #1 \textstyle
-        \textfont
+  \@ifpackagelater { mathtools } { 2021/03/28 } { } {
+    \__lltxmath_patch:NNnnn \MT_cramped_internal:Nn
+      \cs_set_nopar:Npn { #1 #2 } {
+      \setbox \z@ \hbox {
+        $
+        \m at th
+        #1
+        \kern -\nulldelimiterspace
+        \radical \z@ { #2 }
+        $
+      }
+      \ifx #1 \displaystyle
+        \dimen@ = \fontdimen 8 \textfont 3
+        \advance \dimen@ .25 \fontdimen 5 \textfont 2
       \else
-        \ifx #1 \scriptstyle
-          \scriptfont
+        \dimen@ = 1.25 \fontdimen 8
+        \ifx #1 \textstyle
+          \textfont
         \else
-          \scriptscriptfont
+          \ifx #1 \scriptstyle
+            \scriptfont
+          \else
+            \scriptscriptfont
+          \fi
         \fi
+        3
       \fi
-      3
-    \fi
-    \advance \dimen@ -\ht\z@
-    \ht\z@ = -\dimen@
-    \box\z@
-  } {
-    {
-      \ensuremath {
-        \use:c { cramped \cs_to_str:N #1 } #2
+      \advance \dimen@ -\ht\z@
+      \ht\z@ = -\dimen@
+      \ifvmode \leavevmode \fi
+      { }
+      \box\z@
+    } {
+      {
+        \ensuremath {
+          \use:c { cramped \cs_to_str:N #1 } #2
+        }
       }
     }
   }
 }
 \__lltxmath_after_package_or_now:nn { icomma } {
-  \tl_replace_once:Nnn \@begindocumenthook {
-    \mathchardef \mathcomma \mathcode `\,
+  \@ifl at t@r \fmtversion { 2020/10/01 } {
+    \hook_gput_code:nnn { begindocument } { lualatex-math } {
+      \__lltxmath_set_mathchar:NN \mathcomma \,
+      \mathcode `\, = "8000 ~
+    }
+    \hook_gset_rule:nnnn
+      { begindocument } { lualatex-math } { voids } { icomma }
   } {
-    \__lltxmath_set_mathchar:NN \mathcomma \,
+    \tl_replace_once:Nnn \@begindocumenthook {
+      \mathchardef \mathcomma \mathcode `\,
+    } {
+      \__lltxmath_set_mathchar:NN \mathcomma \,
+    }
   }
 }
 \endinput



More information about the tex-live-commits mailing list.