Skip to content

Commit

Permalink
reset top-level alphabets only for the current math version
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Nov 27, 2024
1 parent 69b3f3b commit 7540b2b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 16 deletions.
6 changes: 6 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>

* 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 <[email protected]>

* ltmarks.dtx (section{Public interfaces for packages such as \pkg{multicol}}):
Expand Down
35 changes: 23 additions & 12 deletions base/ltfssdcl.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
%% all rights reserved.
%
%<*driver>
% \fi
\fi

This comment has been minimized.

Copy link
@muzimuzhi

muzimuzhi Nov 27, 2024

Contributor

Is this uncommenting expected?

This comment has been minimized.

Copy link
@FrankMittelbach

FrankMittelbach Nov 27, 2024

Author Member

that looks like a typo. wonder why it didn't blow up in the doc tasks

%
%
\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}
Expand Down Expand Up @@ -719,34 +719,45 @@
\int_compare:nNnTF { \int_use:c{c@mv@#1} } >
{ \tl_use:c{g__nfss_frozen_mv_ #1 _tl} }
{
\@font@info{Undo~ math~ alphabet~ allocation~ in~ version~ #1}
\@font@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@frozen }
\int_gset:cn { c@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@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@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@version {#1}
{
\@font@info{ Also~reset~ the~ top-level~ math~
alphabet~ definitions }
\group_begin:
\cs_set_eq:NN \getanddefine@fonts \use_none:nn
\use:c {mv@ \math@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@info{No~ math~ alphabet~ change~ to~ frozen~ version~ #1}
\@font@info{ No~ math~ alphabet~ change~ to~ frozen~ version~ #1 }
}
}
{
\@font@info{Nested~ math:~ keeping math~ alphabet~
allocation~ in~ version~ #1}
\@font@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
Expand Down
9 changes: 6 additions & 3 deletions base/testfiles/github-1028.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion base/testfiles/github-1101.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7540b2b

Please sign in to comment.