[latex3-commits] [git/LaTeX3-latex3-latex2e] localalpha: documentation and code cleanup (28224d9d)

Frank Mittelbach frank.mittelbach at latex-project.org
Mon Sep 27 12:37:10 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : localalpha
Link       : https://github.com/latex3/latex2e/commit/28224d9db9bc270e099f2bc86ef90cc003cba127

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

commit 28224d9db9bc270e099f2bc86ef90cc003cba127
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Sep 27 12:37:10 2021 +0200

    documentation and code cleanup


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

28224d9db9bc270e099f2bc86ef90cc003cba127
 base/changes.txt                                |   8 ++
 base/ltfssdcl.dtx                               | 171 +++++++++++++++++++-----
 base/testfiles/github-0479-often.luatex.tlg     |   2 +-
 base/testfiles/github-0479-often.tlg            |   2 +-
 base/testfiles/github-0479-often.xetex.tlg      |   2 +-
 base/testfiles/tlb-nfss-alphabets-02.luatex.tlg |  86 ++++++++++++
 base/testfiles/tlb-nfss-alphabets-02.lvt        |  52 +++++++
 base/testfiles/tlb-nfss-alphabets-02.tlg        |  90 +++++++++++++
 base/testfiles/tlb-nfss-alphabets-02.xetex.tlg  |  86 ++++++++++++
 base/testfiles/tlb-rollback-005.luatex.tlg      |   2 +-
 base/testfiles/tlb-rollback-005.tlg             |   2 +-
 base/testfiles/tlb-rollback-005.xetex.tlg       |   2 +-
 12 files changed, 464 insertions(+), 41 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 50f916b2..465a17fc 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,14 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2021-09-27  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltfssdcl.dtx (section{Interface Commands}):
+	Provide counter "localmathalphabets" to keep that many alphabets
+	from being permanently allocated after use. This allows
+	some flexibility if many math alphabets are needed but not needed
+	all in the same formula. (gh/676)
+
 2021-09-18  David Carlisle  <David.Carlisle at latex-project.org>
 
 	* ltpara.dtx: use a \hskip rather than \kern as the guard to
diff --git a/base/ltfssdcl.dtx b/base/ltfssdcl.dtx
index d2925bc2..9bfb7967 100644
--- a/base/ltfssdcl.dtx
+++ b/base/ltfssdcl.dtx
@@ -454,30 +454,80 @@
 %    \end{macrocode}
 % \end{macro}
 %
+%
+%
+%
+%  \begin{macro}{\c at localalphabets}
+% \changes{v3.0x}{2021/09/26}{Counter added for (gh/676)}
+%    To avoid hitting the ``no more math fams available'' limit of 16, we
+%    keep a defined number of math alphabets flexible/local. If we have to
+%    allocate any of those we roll back the allocation after the
+%    formula has ended, so the next formula can use other alphabets in
+%    the slot(s). This makes the processing a bit slower if you are
+%    working at the limit, but that is better than dying with out of memory.
+%    \begin{macrocode}
+%</2ekernel>
+%<latexrelease>\IncludeInRelease{2021/11/15}
+%<latexrelease>  {\document at select@group}{\document at select@group}%
+%<*2ekernel|latexrelease>
+%    \end{macrocode}
+%    We don't really undo the declaration on rollback (as that would
+%    be hard to maintain), so rolling
+%    forward needs to check if the declaration was already made.
+%    \begin{macrocode}
+\ifx\c at localmathalphabets\@undefined
+%    \end{macrocode}
+%    There is no need to have this counter as part of the include
+%    checkpoints, given that it makes little sense to alter its
+%    settings mid document. All we want is the ability to change it
+%    using the \cs{setcounter} interface.
+%
+%    By default we keep two math fams flexible.
+%    \begin{macrocode}
+  \newcount\c at localmathalphabets
+  \setcounter{localmathalphabets}{2}
+\fi
+%    \end{macrocode}
+%  \end{macro}
+%
+%
+%
+%
+%
 % \begin{macro}{\document at select@group}
-%    We surround |\select at group| with braces so that functions using it
-%    can be used directly after |_| or |^|.
-% \changes{v2.1p}{1994/12/10}{Surround with braces (add fourth arg)}
-% \changes{v2.1q}{1995/04/02}{fix problem for pr/1275}
+%    The \cs{document at select@group} command is the version of
+%    \cs{select at group} (inside math versions) that is used in the
+%    document body to set up math alphabets (if used).
+%
 % \changes{v3.0g}{1997/11/20}
 %      {(DPC) inline use of \cs{stepcounter} (faster, and saves a csname
 %       per math version as no reset list)}
 % \changes{v3.0q}{2015/03/18}{Introduce \cs{e at mathgroup@top}}
 %    \begin{macrocode}
-%</2ekernel>
-%<latexrelease>\IncludeInRelease{2020/10/01}
-%<latexrelease>  {\document at select@group}{\document at select@group}%
-%<*2ekernel|latexrelease>
 \def\document at select@group#1#2#3#4{%
  \ifx\math at bgroup\bgroup\else\relax\expandafter\@firstofone\fi
  {%
  \ifmmode
+%    \end{macrocode}
+%    We first check if there is still room for allocating another
+%    mathgroup. If there is, we check if it can be globally allocated
+%    or if we have reached the limit which is given by
+%    \cs{e at mathgroup@top} with \cs{c at localmathalphabets} subtracted.
+% 
+% \changes{v3.0x}{2021/09/26}{Test if we should freeze the version (gh/676)}
+%    \begin{macrocode}
    \ifnum\csname c at mv@\math at version\endcsname<\e at mathgroup@top
      \ifnum \numexpr\e at mathgroup@top-\c at localmathalphabets
               >\csname c at mv@\math at version\endcsname
      \else
+%    \end{macrocode}
+%    If we are past this point we freeze the current state of the math
+%    version so that we can return to it after the formula has
+%    ended. Of course, that should be done only once, so we check if
+%    \cs{mv@\meta{version}@frozen} already exists.
+%    \begin{macrocode}
        \ifcsname mv@\math at version @frozen\endcsname \else
-         \freez at math@version\math at version
+         \freeze at math@version\math at version
        \fi
      \fi
      \begingroup
@@ -498,11 +548,16 @@
         \@eha
   \fi
 %    \end{macrocode}
-% extra \cs{expandafter} to remove the \cs{expandafter} added below
-% \changes{v3.0w}{2021/02/115}{fix for (gh/501)}
+%    Extra \cs{expandafter} to remove the \cs{expandafter} added below
+% \changes{v3.0w}{2021/02/15}{fix for (gh/501)}
 %    \begin{macrocode}
  \else \expandafter\expandafter\expandafter\non at alpherr\fi
 %    \end{macrocode}
+%    We surround |\select at group| with braces so that functions using it
+%    can be used directly after |_| or |^|.
+% \changes{v2.1p}{1994/12/10}{Surround with braces (add fourth arg)}
+% \changes{v2.1q}{1995/04/02}{fix problem for pr/1275}
+%
 %    If the legacy interface is used, e.g., \verb=$\sf -1$= the math
 %    alphabet \verb=#1= does not take an argument so we better do not
 %    surround \verb=#4= with braces, because then we get
@@ -514,60 +569,106 @@
  \expandafter#1\ifx\math at bgroup\bgroup{#4}\else#4\fi
  }%
 }
+%    \end{macrocode}
+%
+%
 
-\ifx\c at localmathalphabets\@undefined
-  \newcounter{localmathalphabets} \setcounter{localmathalphabets}{2}  % keep 2 alphabets variable by default
-\fi
-
+%  \begin{macro}{\freeze at math@version}
+% \changes{v3.0x}{2021/09/26}{Macro added for (gh/676)}
+%    This command stores the current state of the math version and set
+%    things up to return to it after each formula from now on. We use
+%    L3 programming layer code to set it up.
+%    \begin{macrocode}
 \ExplSyntaxOn
-
-% doesn't really need declaration but if then in \DeclareMathVersion
-\tl_new:N \g__mv_frozen_normal_tl
-\tl_new:N \g__mv_frozen_bold_tl
-
-\cs_new:Npn\freez at math@version #1 {
+\cs_new:Npn\freeze at math@version #1 {
+%    \end{macrocode}
+%    Save the current \cs{mv@\meta{version}} code and the number of
+%    allocated mathgroups inside.
+%    \begin{macrocode}
+  \@font at info{Freeze~ math~ alphabet~ allocation~ in~ version~ #1}
   \cs_gset_eq:cc { mv@#1 at frozen }{ mv@#1 }
   \tl_gset:cx { g__mv_frozen_ #1 _tl }{ \int_use:c { c at mv@#1 } }
-  \@font at info{Freeze~ math~ alphabet~ allocation~ in~ version~ #1}
+%    \end{macrocode}
+%    To do the reset the first time, we have wait until we are out of
+%    math mode, so we use some recursive \cs{aftergroup} for this
+%    before we execute \cs{mv@\meta{version}@reset}.
+%    \begin{macrocode}
   \aftergroup \__mv_init_freeze:N \exp_after:wN
     \aftergroup \cs:w mv@#1 at reset \cs_end:
-  %
+%    \end{macrocode}
+%    The \cs{check at mathfonts} is called at the very beginning of each
+%    math formula, so it is a good way to hook in the resetting.
+%    Again that has to happen after the formula has ended, but we know
+%    because of the place where \cs{check at mathfonts} is used
+%    that a single \cs{aftergoup} is sufficient.
+%    \begin{macrocode}
   \tl_gput_right:No \check at mathfonts 
        {
          \exp_after:wN \aftergroup \cs:w mv@#1 at reset \cs_end:
        }
-  %
+%    \end{macrocode}
+%    Here is the definition of \cs{mv@\meta{version}@reset}. If there
+%    has been no new math alphabet allocation, doing a reset would
+%    just cause a lot of unnecessary processing, so we do a quick
+%    check upfront for this.
+%    \begin{macrocode}
   \cs_gset:cpn{mv@#1 at reset}
      {
          \int_compare:nNnTF { \int_use:c{c at mv@#1} } > 
                             { \tl_use:c{g__mv_frozen_ #1 _tl} }
              {
                \@font at info{Undo~ math~ alphabet~ allocation~ in~ version~ #1}
-               %
-               % need to also reset the global counter otherwise we count up fast to 16
-               %
+%    \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__mv_frozen_ #1 _tl} }
+%    \end{macrocode}
+%    But we also should undo changes to the 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:
              }
              {
+%    \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}
              }
     }
 }
-
-% argument is implicit
-
-\cs_new:Npn \__mv_init_freeze:N {%
-  \mode_if_math:T { \aftergroup \__mv_init_freeze:N \aftergroup }
+%    \end{macrocode}
+%  \end{macro}
+%
+%
+%  \begin{macro}{\__mv_init_freeze:N}
+% \changes{v3.0x}{2021/09/26}{Macro added for (gh/676)}
+%    To do the initial freeze in a safe place, we check if we are in
+%    math mode and if so try again after the group has ended by pushing
+%    the command and its  single token argument with two
+%    \cs{aftergroup}s after the current group. If we are no longer in
+%    math mode we bypass the
+%    conditional and so the next token is our argument
+%    which is then finally executed.
+%    \begin{macrocode}
+\cs_new:Npn \__mv_init_freeze:N #1 {%
+  \mode_if_math:T { \aftergroup \__mv_init_freeze:N \aftergroup } #1
 }
-
-
+%    \end{macrocode}
+%  \end{macro}
+%
+%
+%    \begin{macrocode}
 \ExplSyntaxOff 
-
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 %</2ekernel|latexrelease>
 %<latexrelease>\EndIncludeInRelease
 %<latexrelease>\IncludeInRelease{2020/10/01}
diff --git a/base/testfiles/github-0479-often.luatex.tlg b/base/testfiles/github-0479-often.luatex.tlg
index 89bd98b9..76b4cea5 100644
--- a/base/testfiles/github-0479-often.luatex.tlg
+++ b/base/testfiles/github-0479-often.luatex.tlg
@@ -277,10 +277,10 @@ Applying: [....-..-..] alias size function on input line ....
 Already applied: [....-..-..] alias size function on input line ....
 Applying: [....-..-..] \select at group  on input line ....
 Already applied: [....-..-..] \select at group  on input line ....
+Skipping: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
-Already applied: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] Make math accents robust on input line ....
 Already applied: [....-..-..] Make math accents robust on input line ....
 Applying: [....-..-..] makemath accents robust on input line ....
diff --git a/base/testfiles/github-0479-often.tlg b/base/testfiles/github-0479-often.tlg
index 6bb73e80..8540d1fd 100644
--- a/base/testfiles/github-0479-often.tlg
+++ b/base/testfiles/github-0479-often.tlg
@@ -267,10 +267,10 @@ Applying: [....-..-..] alias size function on input line ....
 Already applied: [....-..-..] alias size function on input line ....
 Applying: [....-..-..] \select at group  on input line ....
 Already applied: [....-..-..] \select at group  on input line ....
+Skipping: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
-Already applied: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] Make math accents robust on input line ....
 Already applied: [....-..-..] Make math accents robust on input line ....
 Applying: [....-..-..] makemath accents robust on input line ....
diff --git a/base/testfiles/github-0479-often.xetex.tlg b/base/testfiles/github-0479-often.xetex.tlg
index 0a2ae5ad..6b8e509f 100644
--- a/base/testfiles/github-0479-often.xetex.tlg
+++ b/base/testfiles/github-0479-often.xetex.tlg
@@ -267,10 +267,10 @@ Applying: [....-..-..] alias size function on input line ....
 Already applied: [....-..-..] alias size function on input line ....
 Applying: [....-..-..] \select at group  on input line ....
 Already applied: [....-..-..] \select at group  on input line ....
+Skipping: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
-Already applied: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] Make math accents robust on input line ....
 Already applied: [....-..-..] Make math accents robust on input line ....
 Applying: [....-..-..] makemath accents robust on input line ....
diff --git a/base/testfiles/tlb-nfss-alphabets-02.luatex.tlg b/base/testfiles/tlb-nfss-alphabets-02.luatex.tlg
new file mode 100644
index 00000000..d8b5d359
--- /dev/null
+++ b/base/testfiles/tlb-nfss-alphabets-02.luatex.tlg
@@ -0,0 +1,86 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+\symfooi=\mathgroup4
+\symfooii=\mathgroup5
+\symfooiii=\mathgroup6
+\symfooiv=\mathgroup7
+\symfoov=\mathgroup8
+\symfoovi=\mathgroup9
+\symfoovii=\mathgroup10
+\symfooviii=\mathgroup11
+\symfooix=\mathgroup12
+\symfoox=\mathgroup13
+(tlb-nfss-alphabets-02.aux)
+LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+> \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 \symfooi \OT1/cmr/m/n \getanddefine at fonts \symfooii \OT1/cmr/m/n \getanddefine at fonts \symfooiii \OT1/cmr/m/n \getanddefine at fonts \symfooiv \OT1/cmr/m/n \getanddefine at fonts \symfoov \OT1/cmr/m/n \getanddefine at fonts \symfoovi \OT1/cmr/m/n \getanddefine at fonts \symfoovii \OT1/cmr/m/n \getanddefine at fonts \symfooviii \OT1/cmr/m/n \getanddefine at fonts \symfooix \OT1/cmr/m/n \getanddefine at fonts \symfoox \OT1/cmr/m/n \install at mathalphabet \baz  {\select at group \baz  \M at OT1 \OT1/cmss/m/n }.
+l. ...\makeatletter \show\mv at normal
+                                  \showthe\c at mv@normal  \makeatother
+> 14.
+l. ......letter \show\mv at normal  \showthe\c at mv@normal
+                                                    \makeatother
+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 ....
+### math mode entered at line 28
+\mathord
+.\fam14 Z
+### restricted horizontal mode entered at line 28
+spacefactor 1000
+### vertical mode entered at line 0
+### current page:
+\write-{}
+prevdepth 0.0
+! OK.
+l. ...\showlists
+> \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 \symfooi \OT1/cmr/m/n \getanddefine at fonts \symfooii \OT1/cmr/m/n \getanddefine at fonts \symfooiii \OT1/cmr/m/n \getanddefine at fonts \symfooiv \OT1/cmr/m/n \getanddefine at fonts \symfoov \OT1/cmr/m/n \getanddefine at fonts \symfoovi \OT1/cmr/m/n \getanddefine at fonts \symfoovii \OT1/cmr/m/n \getanddefine at fonts \symfooviii \OT1/cmr/m/n \getanddefine at fonts \symfooix \OT1/cmr/m/n \getanddefine at fonts \symfoox \OT1/cmr/m/n \getanddefine at fonts {14}\OT1/cmss/m/n \install at mathalphabet \baz  {\relax \ifmmode \else \non at alpherr \baz  \fi \use at mathgroup \M at OT1 {14}}.
+l. ...\makeatletter \show\mv at normal
+                                  \showthe\c at mv@normal  \makeatother
+> 15.
+l. ......letter \show\mv at normal  \showthe\c at mv@normal
+                                                    \makeatother
+### math mode entered at line 35
+\mathord
+.\fam15 B
+### restricted horizontal mode entered at line 35
+spacefactor 1000
+### vertical mode entered at line 0
+### current page:
+\write-{}
+prevdepth 0.0
+! OK.
+l. ...\showlists
+> \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 \getanddefine at fonts {15}\OT1/cmr/bx/n \install at mathalphabet \mathbf  {\relax \ifmmode \else \non at alpherr \mathbf  \fi \use at mathgroup \M at OT1 {15}}\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 \symfooi \OT1/cmr/m/n \getanddefine at fonts \symfooii \OT1/cmr/m/n \getanddefine at fonts \symfooiii \OT1/cmr/m/n \getanddefine at fonts \symfooiv \OT1/cmr/m/n \getanddefine at fonts \symfoov \OT1/cmr/m/n \getanddefine at fonts \symfoovi \OT1/cmr/m/n \getanddefine at fonts \symfoovii \OT1/cmr/m/n \getanddefine at fonts \symfooviii \OT1/cmr/m/n \getanddefine at fonts \symfooix \OT1/cmr/m/n \getanddefine at fonts \symfoox \OT1/cmr/m/n \getanddefine at fonts {14}\OT1/cmss/m/n \install at mathalphabet \baz  {\relax \ifmmode \else \non at alpherr \baz  \fi \use at mathgroup \M at OT1 {14}}.
+l. ...\makeatletter \show\mv at normal
+                                  \showthe\c at mv@normal  \makeatother
+> 16.
+l. ......letter \show\mv at normal  \showthe\c at mv@normal
+                                                    \makeatother
+### math mode entered at line 42
+\mathord
+.\fam1 X
+### restricted horizontal mode entered at line 42
+spacefactor 1000
+### vertical mode entered at line 0
+### current page:
+\write-{}
+prevdepth 0.0
+! OK.
+l. ...\showlists
+==> In unicode engines this will always give a diff as all math alphabets can be allocated!
diff --git a/base/testfiles/tlb-nfss-alphabets-02.lvt b/base/testfiles/tlb-nfss-alphabets-02.lvt
new file mode 100644
index 00000000..a8ecaf24
--- /dev/null
+++ b/base/testfiles/tlb-nfss-alphabets-02.lvt
@@ -0,0 +1,52 @@
+\documentclass{article}
+
+\input{test2e}
+
+\START
+
+\setcounter{localmathalphabets}{5}
+
+\DeclareSymbolFont{fooi}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{fooii}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{fooiii}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{fooiv}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{foov}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{foovi}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{foovii}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{fooviii}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{fooix}{OT1}{cmr}{m}{n}
+\DeclareSymbolFont{foox}{OT1}{cmr}{m}{n}  % only one slot open   
+
+
+
+\DeclareMathAlphabet\baz{OT1}{cmss}{m}{n}
+
+\begin{document}
+
+\makeatletter \show\mv at normal  \showthe\c at mv@normal  \makeatother
+
+\setbox0\hbox{$
+\baz{Z}
+\showlists
+$}
+
+\makeatletter \show\mv at normal  \showthe\c at mv@normal  \makeatother
+
+\setbox0\hbox{$
+\mathbf{B}
+\showlists
+$}
+
+\makeatletter \show\mv at normal  \showthe\c at mv@normal  \makeatother
+
+\setbox0\hbox{$
+X
+\showlists
+$}
+
+
+
+\typeout{==> In unicode engines this will always give a diff as all math alphabets can be allocated!}
+
+
+\END
diff --git a/base/testfiles/tlb-nfss-alphabets-02.tlg b/base/testfiles/tlb-nfss-alphabets-02.tlg
new file mode 100644
index 00000000..697ade1a
--- /dev/null
+++ b/base/testfiles/tlb-nfss-alphabets-02.tlg
@@ -0,0 +1,90 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+\symfooi=\mathgroup4
+\symfooii=\mathgroup5
+\symfooiii=\mathgroup6
+\symfooiv=\mathgroup7
+\symfoov=\mathgroup8
+\symfoovi=\mathgroup9
+\symfoovii=\mathgroup10
+\symfooviii=\mathgroup11
+\symfooix=\mathgroup12
+\symfoox=\mathgroup13
+(tlb-nfss-alphabets-02.aux)
+LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+> \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 \symfooi \OT1/cmr/m/n \getanddefine at fonts \symfooii \OT1/cmr/m/n \getanddefine at fonts \symfooiii \OT1/cmr/m/n \getanddefine at fonts \symfooiv \OT1/cmr/m/n \getanddefine at fonts \symfoov \OT1/cmr/m/n \getanddefine at fonts \symfoovi \OT1/cmr/m/n \getanddefine at fonts \symfoovii \OT1/cmr/m/n \getanddefine at fonts \symfooviii \OT1/cmr/m/n \getanddefine at fonts \symfooix \OT1/cmr/m/n \getanddefine at fonts \symfoox \OT1/cmr/m/n \install at mathalphabet \baz  {\select at group \baz  \M at OT1 \OT1/cmss/m/n }.
+l. ...\makeatletter \show\mv at normal
+                                    \showthe\c at mv@normal  \makeatother
+> 14.
+l. ......tter \show\mv at normal  \showthe\c at mv@normal
+                                                    \makeatother
+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 on input line ....
+### math mode entered at line 28
+\mathord
+.\fam14 Z
+### restricted horizontal mode entered at line 28
+spacefactor 1000
+### vertical mode entered at line 0
+### current page:
+\write-{}
+prevdepth 0.0
+! OK.
+l. ...\showlists
+LaTeX Font Info:    Undo math alphabet allocation in version normal on input line ....
+> \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 \symfooi \OT1/cmr/m/n \getanddefine at fonts \symfooii \OT1/cmr/m/n \getanddefine at fonts \symfooiii \OT1/cmr/m/n \getanddefine at fonts \symfooiv \OT1/cmr/m/n \getanddefine at fonts \symfoov \OT1/cmr/m/n \getanddefine at fonts \symfoovi \OT1/cmr/m/n \getanddefine at fonts \symfoovii \OT1/cmr/m/n \getanddefine at fonts \symfooviii \OT1/cmr/m/n \getanddefine at fonts \symfooix \OT1/cmr/m/n \getanddefine at fonts \symfoox \OT1/cmr/m/n \install at mathalphabet \baz  {\select at group \baz  \M at OT1 \OT1/cmss/m/n }.
+l. ...\makeatletter \show\mv at normal
+                                    \showthe\c at mv@normal  \makeatother
+> 14.
+l. ......tter \show\mv at normal  \showthe\c at mv@normal
+                                                    \makeatother
+### math mode entered at line 35
+\mathord
+.\fam14 B
+### restricted horizontal mode entered at line 35
+spacefactor 1000
+### vertical mode entered at line 0
+### current page:
+\write-{}
+prevdepth 0.0
+! OK.
+l. ...\showlists
+LaTeX Font Info:    Undo math alphabet allocation in version normal on input line ....
+> \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 \symfooi \OT1/cmr/m/n \getanddefine at fonts \symfooii \OT1/cmr/m/n \getanddefine at fonts \symfooiii \OT1/cmr/m/n \getanddefine at fonts \symfooiv \OT1/cmr/m/n \getanddefine at fonts \symfoov \OT1/cmr/m/n \getanddefine at fonts \symfoovi \OT1/cmr/m/n \getanddefine at fonts \symfoovii \OT1/cmr/m/n \getanddefine at fonts \symfooviii \OT1/cmr/m/n \getanddefine at fonts \symfooix \OT1/cmr/m/n \getanddefine at fonts \symfoox \OT1/cmr/m/n \install at mathalphabet \baz  {\select at group \baz  \M at OT1 \OT1/cmss/m/n }.
+l. ...\makeatletter \show\mv at normal
+                                    \showthe\c at mv@normal  \makeatother
+> 14.
+l. ......tter \show\mv at normal  \showthe\c at mv@normal
+                                                    \makeatother
+### math mode entered at line 42
+\mathord
+.\fam1 X
+### restricted horizontal mode entered at line 42
+spacefactor 1000
+### vertical mode entered at line 0
+### current page:
+\write-{}
+prevdepth 0.0
+! OK.
+l. ...\showlists
+LaTeX Font Info:    No math alphabet change to frozen version normal on input line ....
+==> In unicode engines this will always give a diff as all math alphabets can be allocated!
diff --git a/base/testfiles/tlb-nfss-alphabets-02.xetex.tlg b/base/testfiles/tlb-nfss-alphabets-02.xetex.tlg
new file mode 100644
index 00000000..41a69c12
--- /dev/null
+++ b/base/testfiles/tlb-nfss-alphabets-02.xetex.tlg
@@ -0,0 +1,86 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+\symfooi=\mathgroup4
+\symfooii=\mathgroup5
+\symfooiii=\mathgroup6
+\symfooiv=\mathgroup7
+\symfoov=\mathgroup8
+\symfoovi=\mathgroup9
+\symfoovii=\mathgroup10
+\symfooviii=\mathgroup11
+\symfooix=\mathgroup12
+\symfoox=\mathgroup13
+(tlb-nfss-alphabets-02.aux)
+LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line ....
+LaTeX Font Info:    ... okay on input line ....
+> \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 \symfooi \OT1/cmr/m/n \getanddefine at fonts \symfooii \OT1/cmr/m/n \getanddefine at fonts \symfooiii \OT1/cmr/m/n \getanddefine at fonts \symfooiv \OT1/cmr/m/n \getanddefine at fonts \symfoov \OT1/cmr/m/n \getanddefine at fonts \symfoovi \OT1/cmr/m/n \getanddefine at fonts \symfoovii \OT1/cmr/m/n \getanddefine at fonts \symfooviii \OT1/cmr/m/n \getanddefine at fonts \symfooix \OT1/cmr/m/n \getanddefine at fonts \symfoox \OT1/cmr/m/n \install at mathalphabet \baz  {\select at group \baz  \M at OT1 \OT1/cmss/m/n }.
+l. ...\makeatletter \show\mv at normal
+                                    \showthe\c at mv@normal  \makeatother
+> 14.
+l. ......tter \show\mv at normal  \showthe\c at mv@normal
+                                                    \makeatother
+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 ....
+### math mode entered at line 28
+\mathord
+.\fam14 Z
+### restricted horizontal mode entered at line 28
+spacefactor 1000
+### vertical mode entered at line 0
+### current page:
+\write-{}
+prevdepth 0.0
+! OK.
+l. ...\showlists
+> \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 \symfooi \OT1/cmr/m/n \getanddefine at fonts \symfooii \OT1/cmr/m/n \getanddefine at fonts \symfooiii \OT1/cmr/m/n \getanddefine at fonts \symfooiv \OT1/cmr/m/n \getanddefine at fonts \symfoov \OT1/cmr/m/n \getanddefine at fonts \symfoovi \OT1/cmr/m/n \getanddefine at fonts \symfoovii \OT1/cmr/m/n \getanddefine at fonts \symfooviii \OT1/cmr/m/n \getanddefine at fonts \symfooix \OT1/cmr/m/n \getanddefine at fonts \symfoox \OT1/cmr/m/n \getanddefine at fonts {14}\OT1/cmss/m/n \install at mathalphabet \baz  {\relax \ifmmode \else \non at alpherr \baz  \fi \use at mathgroup \M at OT1 {14}}.
+l. ...\makeatletter \show\mv at normal
+                                    \showthe\c at mv@normal  \makeatother
+> 15.
+l. ......tter \show\mv at normal  \showthe\c at mv@normal
+                                                    \makeatother
+### math mode entered at line 35
+\mathord
+.\fam15 B
+### restricted horizontal mode entered at line 35
+spacefactor 1000
+### vertical mode entered at line 0
+### current page:
+\write-{}
+prevdepth 0.0
+! OK.
+l. ...\showlists
+> \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 \getanddefine at fonts {15}\OT1/cmr/bx/n \install at mathalphabet \mathbf  {\relax \ifmmode \else \non at alpherr \mathbf  \fi \use at mathgroup \M at OT1 {15}}\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 \symfooi \OT1/cmr/m/n \getanddefine at fonts \symfooii \OT1/cmr/m/n \getanddefine at fonts \symfooiii \OT1/cmr/m/n \getanddefine at fonts \symfooiv \OT1/cmr/m/n \getanddefine at fonts \symfoov \OT1/cmr/m/n \getanddefine at fonts \symfoovi \OT1/cmr/m/n \getanddefine at fonts \symfoovii \OT1/cmr/m/n \getanddefine at fonts \symfooviii \OT1/cmr/m/n \getanddefine at fonts \symfooix \OT1/cmr/m/n \getanddefine at fonts \symfoox \OT1/cmr/m/n \getanddefine at fonts {14}\OT1/cmss/m/n \install at mathalphabet \baz  {\relax \ifmmode \else \non at alpherr \baz  \fi \use at mathgroup \M at OT1 {14}}.
+l. ...\makeatletter \show\mv at normal
+                                    \showthe\c at mv@normal  \makeatother
+> 16.
+l. ......tter \show\mv at normal  \showthe\c at mv@normal
+                                                    \makeatother
+### math mode entered at line 42
+\mathord
+.\fam1 X
+### restricted horizontal mode entered at line 42
+spacefactor 1000
+### vertical mode entered at line 0
+### current page:
+\write-{}
+prevdepth 0.0
+! OK.
+l. ...\showlists
+==> In unicode engines this will always give a diff as all math alphabets can be allocated!
diff --git a/base/testfiles/tlb-rollback-005.luatex.tlg b/base/testfiles/tlb-rollback-005.luatex.tlg
index 425e59d8..bf4ec8f5 100644
--- a/base/testfiles/tlb-rollback-005.luatex.tlg
+++ b/base/testfiles/tlb-rollback-005.luatex.tlg
@@ -281,10 +281,10 @@ Applying: [....-..-..] alias size function on input line ....
 Already applied: [....-..-..] alias size function on input line ....
 Applying: [....-..-..] \select at group  on input line ....
 Already applied: [....-..-..] \select at group  on input line ....
+Skipping: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
-Already applied: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] Make math accents robust on input line ....
 Already applied: [....-..-..] Make math accents robust on input line ....
 Applying: [....-..-..] makemath accents robust on input line ....
diff --git a/base/testfiles/tlb-rollback-005.tlg b/base/testfiles/tlb-rollback-005.tlg
index 1b6b5fc3..3ba30dae 100644
--- a/base/testfiles/tlb-rollback-005.tlg
+++ b/base/testfiles/tlb-rollback-005.tlg
@@ -271,10 +271,10 @@ Applying: [....-..-..] alias size function on input line ....
 Already applied: [....-..-..] alias size function on input line ....
 Applying: [....-..-..] \select at group  on input line ....
 Already applied: [....-..-..] \select at group  on input line ....
+Skipping: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
-Already applied: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] Make math accents robust on input line ....
 Already applied: [....-..-..] Make math accents robust on input line ....
 Applying: [....-..-..] makemath accents robust on input line ....
diff --git a/base/testfiles/tlb-rollback-005.xetex.tlg b/base/testfiles/tlb-rollback-005.xetex.tlg
index 826994b7..b50db6d2 100644
--- a/base/testfiles/tlb-rollback-005.xetex.tlg
+++ b/base/testfiles/tlb-rollback-005.xetex.tlg
@@ -271,10 +271,10 @@ Applying: [....-..-..] alias size function on input line ....
 Already applied: [....-..-..] alias size function on input line ....
 Applying: [....-..-..] \select at group  on input line ....
 Already applied: [....-..-..] \select at group  on input line ....
+Skipping: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
 Already applied: [....-..-..] \document at select@group  on input line ....
-Already applied: [....-..-..] \document at select@group  on input line ....
 Applying: [....-..-..] Make math accents robust on input line ....
 Already applied: [....-..-..] Make math accents robust on input line ....
 Applying: [....-..-..] makemath accents robust on input line ....





More information about the latex3-commits mailing list.