[latex3-commits] [latex3/latex2e] gh1101: draft for #1101 (69b3f3bed)
github at latex-project.org
github at latex-project.org
Wed Nov 27 01:19:26 CET 2024
Repository : https://github.com/latex3/latex2e
On branch : gh1101
Link : https://github.com/latex3/latex2e/commit/69b3f3bed0d5ec43ddbdf88d6b6f350b05099703
>---------------------------------------------------------------
commit 69b3f3bed0d5ec43ddbdf88d6b6f350b05099703
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Wed Nov 27 01:19:26 2024 +0100
draft for #1101
>---------------------------------------------------------------
69b3f3bed0d5ec43ddbdf88d6b6f350b05099703
base/ltfssbas.dtx | 9 +++++++++
base/ltfssdcl.dtx | 7 +++++++
base/testfiles/github-1101.lvt | 43 ++++++++++++++++++++++++++++++++++++++++++
base/testfiles/github-1101.tlg | 37 ++++++++++++++++++++++++++++++++++++
4 files changed, 96 insertions(+)
diff --git a/base/ltfssbas.dtx b/base/ltfssbas.dtx
index 4e376d376..fe351e510 100644
--- a/base/ltfssbas.dtx
+++ b/base/ltfssbas.dtx
@@ -1298,11 +1298,19 @@
%<*2ekernel|latexrelease>
\frozen at everydisplay = {%
\aftergroup\@ignoretrue \aftergroup\ignorespaces
+ \advance\@math at nesting\@ne
\check at mathfonts
\the\everydisplay}
% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{\@math at nesting}
+%
+% \begin{macrocode}
+\newcount\@math at nesting
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\frozen at everymath}
% \changes{v2.1a}{1994/01/17}{New math font setup}
@@ -1312,6 +1320,7 @@
% \begin{macrocode}
\frozen at everymath = {%
\aftergroup\@ignorefalse
+ \advance\@math at nesting\@ne
\check at mathfonts
\the\everymath}
% \end{macrocode}
diff --git a/base/ltfssdcl.dtx b/base/ltfssdcl.dtx
index c88fe6e1b..25fee865a 100644
--- a/base/ltfssdcl.dtx
+++ b/base/ltfssdcl.dtx
@@ -714,6 +714,8 @@
% \begin{macrocode}
\cs_gset:cpn{mv@#1 at reset}
{
+ \int_compare:nNnTF \@math at nesting = 0
+ {
\int_compare:nNnTF { \int_use:c{c at mv@#1} } >
{ \tl_use:c{g__nfss_frozen_mv_ #1 _tl} }
{
@@ -741,6 +743,11 @@
% \begin{macrocode}
\@font at info{No~ math~ alphabet~ change~ to~ frozen~ 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
% for ignoring spaces, because they are now hidden if
diff --git a/base/testfiles/github-1101.lvt b/base/testfiles/github-1101.lvt
new file mode 100644
index 000000000..353ada4cb
--- /dev/null
+++ b/base/testfiles/github-1101.lvt
@@ -0,0 +1,43 @@
+\documentclass{article}
+
+\input{test2e}
+
+\DeclareSymbolFont{abc1}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{abc2}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{abc3}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{abc4}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{abc5}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{abc6}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{abc7}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{abc8}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{abc9}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{abca}{OT1}{cmr}{m}{n}
+\DeclareMathAlphabet\mathscr{OT1}{cmr}{m}{it}
+\DeclareMathAlphabet\mathfrak{T1}{lmss}{m}{n}
+
+\def\x#1{\showthe\textfont14 }
+
+\begin{document}
+
+\START
+
+\makeatletter
+
+\show\mv at normal
+
+% incorrect
+\x0
+$\mathscr{F}_x
+ \hbox{
+ $M\x1$\x2
+ }
+ \mathfrak{p}\x3$
+\x4
+
+% correct
+$\mathscr{F}_x M \mathfrak{p}$
+\x5
+
+\newpage
+\OMIT
+\end{document}
diff --git a/base/testfiles/github-1101.tlg b/base/testfiles/github-1101.tlg
new file mode 100644
index 000000000..192732e5e
--- /dev/null
+++ b/base/testfiles/github-1101.tlg
@@ -0,0 +1,37 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+> \mv at normal=macro:
+->\getanddefine at fonts \symoperators \OT1/cmr/m/n \getanddefine at fonts \symletters \OML/cmm/m/it \getanddefine at fonts \symsymbols \OMS/cmsy/m/n \getanddefine at fonts \symlargesymbols \OMX/cmex/m/n \install at mathalphabet \mathbf {\select at group \mathbf \M at OT1 \OT1/cmr/bx/n }\install at mathalphabet \mathsf {\select at group \mathsf \M at OT1 \OT1/cmss/m/n }\install at mathalphabet \mathit {\select at group \mathit \M at OT1 \OT1/cmr/m/it }\install at mathalphabet \mathtt {\select at group \mathtt \M at OT1 \OT1/cmtt/m/n }\getanddefine at fonts \symabc1 \OT1/cmr/m/n \getanddefine at fonts \symabc2 \OT1/cmr/m/n \getanddefine at fonts \symabc3 \OT1/cmr/m/n \getanddefine at fonts \symabc4 \OT1/cmr/m/n \getanddefine at fonts \symabc5 \OT1/cmr/m/n \getanddefine at fonts \symabc6 \OT1/cmr/m/n \getanddefine at fonts \symabc7 \OT1/cmr/m/n \getanddefine at fonts \symabc8 \OT1/cmr/m/n \getanddefine at fonts \symabc9 \OT1/cmr/m/n \getanddefine at fonts \symabca \OT1/cmr/m/n \install at mathalphabet \mathscr {\select at group \mathscr \M at OT1 \OT1/cmr/m/it }\install at mathalphabet \mathfrak {\select at group \mathfrak \M at T1 \T1/lmss/m/n }.
+l. ...\show\mv at normal
+> \nullfont .
+\x #1->\showthe \textfont 14
+l. ...\x0
+LaTeX Font Info: External font `cmex10' loaded for size
+(Font) <7> on input line ....
+LaTeX Font Info: External font `cmex10' loaded for size
+(Font) <5> on input line ....
+LaTeX Font Info: Freeze math alphabet allocation in version normal.
+(Font) Allocated math groups: 14 (local: 2) on input line ....
+> \OT1/cmr/m/it/10 .
+\x #1->\showthe \textfont 14
+l. ... $M\x1
+ $\x2
+LaTeX Font Info: Nested math: keepingmath alphabet allocation in version normal on input line ....
+> \OT1/cmr/m/it/10 .
+\x #1->\showthe \textfont 14
+l. ... $M\x1$\x2
+LaTeX Font Info: Trying to load font information for T1+lmss on input line ....
+> \OT1/cmr/m/it/10 .
+\x #1->\showthe \textfont 14
+l. ... \mathfrak{p}\x3
+ $
+LaTeX Font Info: Undo math alphabet allocation in version normal on input line ....
+> \OT1/cmr/m/it/10 .
+\x #1->\showthe \textfont 14
+l. ...\x4
+LaTeX Font Info: Undo math alphabet allocation in version normal on input line ....
+> \OT1/cmr/m/it/10 .
+\x #1->\showthe \textfont 14
+l. ...\x5
+[1
+]
More information about the latex3-commits
mailing list.