[latex3-commits] [latex3/latex2e] gh1101: reset top-level alphabets only for the current math version (7540b2b6b)

github at latex-project.org github at latex-project.org
Wed Nov 27 14:37:04 CET 2024


Repository : https://github.com/latex3/latex2e
On branch  : gh1101
Link       : https://github.com/latex3/latex2e/commit/7540b2b6bf4e1d0c34a30b73304ecec0ae893fbf

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

commit 7540b2b6bf4e1d0c34a30b73304ecec0ae893fbf
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Nov 27 14:37:04 2024 +0100

    reset top-level alphabets only for the current math version


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

7540b2b6bf4e1d0c34a30b73304ecec0ae893fbf
 base/changes.txt               |  6 ++++++
 base/ltfssdcl.dtx              | 35 +++++++++++++++++++++++------------
 base/testfiles/github-1028.tlg |  9 ++++++---
 base/testfiles/github-1101.tlg |  2 +-
 4 files changed, 36 insertions(+), 16 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index eaae54432..0c071bedc 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,12 @@ to completeness or accuracy and it contains some references to files that are
 not part of the distribution.
 ================================================================================
 
+2024-11-27  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltfssdcl.dtx (section{Interface Commands}):
+	Reset top-level alphabet definitions
+        only for the current math version (gh/1101 and gh/1028)
+
 2024-11-17  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltmarks.dtx (section{Public interfaces for packages such as \pkg{multicol}}):
diff --git a/base/ltfssdcl.dtx b/base/ltfssdcl.dtx
index 25fee865a..3e157b9ff 100644
--- a/base/ltfssdcl.dtx
+++ b/base/ltfssdcl.dtx
@@ -32,11 +32,11 @@
 %% all rights reserved.
 %
 %<*driver>
-% \fi
+ \fi
 %
 %
 \ProvidesFile{ltfssdcl.dtx}
-            [2024/11/19 v3.1c LaTeX Kernel (NFSS Declarative Interface)]
+            [2024/11/27 v3.1d LaTeX Kernel (NFSS Declarative Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \begin{document}
@@ -719,34 +719,45 @@
          \int_compare:nNnTF { \int_use:c{c at mv@#1} } > 
                             { \tl_use:c{g__nfss_frozen_mv_ #1 _tl} }
              {
-               \@font at info{Undo~ math~ alphabet~ allocation~ in~ version~ #1}
+               \@font at info{ Undo~ math~ alphabet~ allocation~ in~ version~ #1 }
 %    \end{macrocode}
 %    If the undo is necessary, we restore the \cs{mv@\meta{version}} code.
 %    \begin{macrocode}
                \cs_gset_eq:cc { mv@#1 }{ mv@#1 at frozen }
                \int_gset:cn { c at mv@#1 }{ \tl_use:c {g__nfss_frozen_mv_ #1 _tl} }
 %    \end{macrocode}
-%    But we also should undo changes to the math alphabet
+%    But we also should undo changes to the top-level math alphabet
 %    definitions. We therefore run this code with a modified
 %    definition for \cs{getanddefine at fonts} because there is no need
 %    to do anything to the symbol fonts that are permanently allocated.
-%    \begin{macrocode}
-               \group_begin:
-                 \cs_set_eq:NN \getanddefine at fonts \use_none:nn
-                 \use:c {mv@#1}
-               \group_end:
+%    However, we do this only if the resetting was for the current
+%    math version, because otherwise we would give the top-level
+%    definitions the values for the last math version being resetted
+%    (e.g., bold if there are just two).
+% \changes{v3.1d}{2024/11/27}{Reset top-level alphabet definitions
+%    only for the current math version (gh/1101 and gh/1028)}
+%    \begin{macrocode}
+               \tl_if_eq:NnT \math at version {#1}
+               {
+                 \@font at info{ Also~reset~ the~ top-level~ math~
+                              alphabet~ definitions }
+                 \group_begin:
+                   \cs_set_eq:NN \getanddefine at fonts \use_none:nn
+                   \use:c {mv@ \math at version }
+                 \group_end:
+               }
              }
              {
 %    \end{macrocode}
 %    If there was no change, we report that in the log (but this
 %    branch could go completely).
 %    \begin{macrocode}
-               \@font at info{No~ math~ alphabet~ change~ to~ frozen~ version~ #1}
+               \@font at info{ No~ math~ alphabet~ change~ to~ frozen~ version~ #1 }
              }
        }
        {
-         \@font at info{Nested~ math:~ keeping math~ alphabet~
-                     allocation~ in~ version~ #1}
+         \@font at info{ Nested~ math:~ keeping~ math~ alphabet~
+                      allocation~ in~ version~ #1}
        }
 %    \end{macrocode}
 %    If this is executed after a math display, we may have to arrange
diff --git a/base/testfiles/github-1028.tlg b/base/testfiles/github-1028.tlg
index 5f3029f56..5f1aa1e63 100644
--- a/base/testfiles/github-1028.tlg
+++ b/base/testfiles/github-1028.tlg
@@ -7,13 +7,16 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 LaTeX Font Info:    Freeze math alphabet allocation in version normal.
 (Font)              Allocated math groups: 15 (local: 2) on input line ....
 LaTeX Font Info:    Undo math alphabet allocation in version normal on input line ....
+LaTeX Font Info:    Also reset the top-level math alphabet definitions to version normal on input line ....
 LaTeX Font Info:    Freeze math alphabet allocation in version bold.
 (Font)              Allocated math groups: 15 (local: 2) on input line ....
+LaTeX Font Info:    Nested math: keeping math alphabet allocation in version normal on input line ....
+LaTeX Font Info:    Nested math: keeping math alphabet allocation in version bold on input line ....
 LaTeX Font Info:    Undo math alphabet allocation in version normal on input line ....
+LaTeX Font Info:    Also reset the top-level math alphabet definitions to version normal on input line ....
 LaTeX Font Info:    Undo math alphabet allocation in version bold on input line ....
-LaTeX Font Info:    No math alphabet change to frozen version normal on input line ....
-LaTeX Font Info:    No math alphabet change to frozen version bold on input line ....
-LaTeX Font Info:    No math alphabet change to frozen version normal on input line ....
+LaTeX Font Info:    Undo math alphabet allocation in version normal on input line ....
+LaTeX Font Info:    Also reset the top-level math alphabet definitions to version normal on input line ....
 LaTeX Font Info:    No math alphabet change to frozen version bold on input line ....
 Completed box being shipped out [1]
 \vbox(633.0+0.0)x407.0
diff --git a/base/testfiles/github-1101.tlg b/base/testfiles/github-1101.tlg
index 192732e5e..8ff869fc9 100644
--- a/base/testfiles/github-1101.tlg
+++ b/base/testfiles/github-1101.tlg
@@ -16,7 +16,7 @@ LaTeX Font Info:    Freeze math alphabet allocation in version normal.
 \x #1->\showthe \textfont 14 
 l. ...   $M\x1
              $\x2
-LaTeX Font Info:    Nested math: keepingmath alphabet allocation in version normal on input line ....
+LaTeX Font Info:    Nested math: keeping math alphabet allocation in version normal on input line ....
 > \OT1/cmr/m/it/10 .
 \x #1->\showthe \textfont 14 
 l. ...   $M\x1$\x2





More information about the latex3-commits mailing list.