1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
30 %%% From File: ltfssdcl.dtx
31 %% Copyright (C) 1989-1998 Frank Mittelbach and Rainer Sch\"opf,
32 %% all rights reserved.
38 \ProvidesFile{ltfssdcl.dtx}
39 [2016/02/18 v3.0r LaTeX Kernel (NFSS Declarative Interface)]
41 \documentclass{ltxdoc}
43 \DocInput{ltfssdcl.dtx}
49 %<+checkmem>\def\CHECKMEM{\tracingstats=2
50 %<+checkmem> \newlinechar=`\^^J
51 %<+checkmem> \message{^^JMemory usage: \filename}\shipout\hbox{}}
57 % \GetFileInfo{ltfssdcl.dtx}
58 % \title{A new font selection scheme for \TeX{} macro packages\\
59 % (Declarative Interface)\thanks
60 % {This file has version number
61 % \fileversion\ dated \filedate}}
63 % \author{Frank Mittelbach \and Rainer Sch\"opf}
65 % \MaintainedByLaTeXTeam{latex}
68 % This file contains the main implementation of the font selection
69 % scheme commands. See other parts of the \LaTeX\ distribution, or
70 % \emph{The \LaTeX\ Companion} for higher level documentation of these
75 % The macro documentation is still basically the documentation from the
76 % first NFSS release and therefore in some cases probably not
77 % completely accurate.
82 % \section{Interface Commands}
84 % \changes{v3.0i}{1998/08/17}
85 % {(RmS) Corrected minor glitches in changes entries.}
86 % \changes{v3.0b}{1995/06/15}
87 % {(DPC) minor documentation changes}
88 % \changes{v3.0a}{1995/05/24}
89 % {(DPC) Make file from previous file, latint.dtx 1995/05/21 v2.1t}
90 % \changes{v3.0p}{2015/02/21}
91 % {Removed autoload code}
94 % \changes{v2.1o}{1994/11/22}
96 % \changes{v2.1m}{1994/11/17}
97 % {\cs{@tempa} to \cs{reserved@a}}
98 % \changes{v2.1j}{1994/05/29}{Use new error commands}
99 % \changes{v2.1h}{1994/05/13}{Removed file identification typeout}
100 % \changes{v2.1g}{1994/05/12}{Allow \cs{relax}'ed cmds to be declared}
101 % \changes{v2.1g}{1994/05/12}{Allow \cs{relax} as undefined command}
102 % \changes{v2.1e}{1994/04/28}{Removed all \cs{uppercase} in hex num
104 % \changes{v2.1d}{1994/04/18}{Removed surplus \cs{no@alphabet@error}
109 % \changes{v2.1f}{1994/05/03}{Renamed \cs{@@DeclareMathDelimiter} to
110 % \cs{@DeclareMathDelimiter}}
111 % \changes{v2.1c}{1994/03/13}{add 2ekernel module to omit repeated code}
114 % \begin{macro}{\in@}
115 % \changes{v3.0m}{2009/10/20}{More robust thanks to Heiko.}
116 % \changes{v3.0n}{2011/05/08}{Simplified thanks to Bruno.}
117 % \begin{macro}{\ifin@}
118 % |\@in| is a utility macro with two arguments. It determines
119 % whether its first argument occurs in its second and sets the
120 % switch |\ifin@| accordingly. The first argument may not
121 % contain braces nor |#| (more precisely, tokens of category
129 \toks@\expandafter{\in@@#2{}{}#1}%
130 \edef\in@@{\the\toks@}%
131 \expandafter\endgroup
143 % Before the |\begin{document}| command several
144 % \meta{math versions} and \meta{math alphabet identifiers} may
146 % In principle, there should be exactly one family/series/shape
147 % combination be declared for each version/alphabet pair.
148 % But we want to allow for defaults as well for automagical
151 % While building the tables for math alphabet identifiers and math
152 % versions we keep several lists:
154 % \item the list of all math versions, |\version@list|,
155 % each entry prefixed by the control sequence |\version@elt|,
156 % i.e.\ this list has the following form
158 % |\version@elt|\meta{version$_1$}^^A
159 % |\version@elt|\meta{version$_2$}\ldots\\\hspace*{\fill}^^A
160 % |\version@elt|\meta{version$_n$}
162 % \item the list of all math alphabet identifiers. Here every
163 % entry has the form:\\[2pt]
164 % \hspace*{\MacroIndent}
165 % |\group@elt|\meta{math group number}\\
166 % \hspace*{\MacroIndent}
167 % |{{|\meta{default family}^^A
168 % |}{|\meta{default series}^^A
169 % |}{|\meta{default shape}|}}|.
170 % \item Each defined math alphabet identifier holds a list containing
171 % Information about the {\em versions\/} for which it is
172 % defined. This list has a more complicated structure: it
175 % |\set@alpha|\meta{the alphabet identifier itself}\\
176 % \hspace*{\MacroIndent}
177 % |\reserved@c|\meta{math version}\meta{font info}\\
178 % \hspace*{\MacroIndent}\ldots\\
181 % where \meta{font info} is either |\reserved@e|
182 % (if the combination is not defined yet) or
184 % |{{|\meta{family}|}{|\meta{series}^^A
185 % |}{|\meta{shape}|}}|
189 % \begin{macro}{\version@list}
190 % We initialize the version list to be empty.
192 \let\version@list=\@empty
193 \@onlypreamble\version@list
198 % \begin{macro}{\version@elt}
200 \let\version@elt\relax
201 \@onlypreamble\version@elt
206 % \begin{macro}{\new@mathversion}
207 % The macro |\new@mathversion| is called with the version control
208 % sequence as its argument.
210 %\def\new@mathversion#1{%
212 % The first thing this macro does is to check if the version
213 % identifier is already present in |\version@list|.
214 % We enclose |\version@list| in braces since it might be empty
215 % (if no {\em version\/} is defined yet). But this means that
216 % we need a suitable number of |\expandafter| primitives.
218 % \expandafter\in@\expandafter#1\expandafter{\version@list}%
221 % If so it prints an error message.
222 % The |\next| macro is used to get rid of the four characters
223 % |\mv@| that would otherwise appear at the begin of the
224 % version name in the error message.
226 % \@latex@error{Math version
227 % `\expandafter\@gobblefour\string#1'
228 % already defined}\@eha
230 % Otherwise we have a new version, and we can proceed with
231 % entering it into the tables.
232 % We add it to |\version@list|. This is very easy:
233 % we define |\version@elt| (which is the delimiter in
234 % |\version@list|) to protect itself and the following token
235 % from being expanded and simply redefine |\version@list|.
238 % \global\expandafter\newcount\csname c@\expandafter
239 % \@gobble\string#1\endcsname
240 % \global\csname c@\expandafter
241 % \@gobble\string#1\endcsname\@ne
242 % \def\version@elt{\noexpand\version@elt\noexpand}%
243 % \edef\version@list{\version@list\version@elt#1}%
245 % Then we prepare to enter the new version into all math
246 % alphabet identifier lists. Remember that these lists
247 % use |\reserved@c| as delimiter, and that there appears the
248 % control sequence |\reserved@e| that must not be expanded.
249 % Therefore we take suitable precautions.
251 % \def\reserved@c{\noexpand\reserved@c\noexpand}%
252 % \let\reserved@e\relax
254 % We will now go through the |\alpha@list| to process every
255 % \meta{math alphabet identifier} in turn.
256 % Since this list has |\group@elt| as a delimiter we define
257 % this control sequence. It has three arguments as every
258 % entry consists of three items (as explained above).
260 % \def\group@elt##1##2##3{%
262 % The first of these arguments is the \meta{math alphabet
263 % identifier}. We redefine it by appending the information
264 % about the new version at the end of the list contained in
265 % it. However, there is one subtlety: the definitions for
266 % |\reserved@c| and |\reserved@e| made above prevent the
267 % main part of the list from being expanded. But we still have
268 % to take care of the header and the trailer. To do this we
269 % remove the trailer by means of the macro |\remove@nil|
270 % which also protect the header from being expanded. Its
271 % definition is given below. Now we can prepare to add the
274 % \edef##1{\expandafter\remove@nil##1%
280 % Finally we call |\alpha@list| which will now execute
281 % the macro |\group@elt| once for every defined \meta{math
282 % alphabet identifier}. And that's all for now.
290 % \begin{macro}{\alpha@list}
291 % As we explained above every entry in |\alpha@list| has
293 % |\alpha@elt|\\\meta{alphabet identifier}\meta{internal
294 % group number}\meta{default font assignments}\ldots\\[2pt]
295 % We initialize it to |\@empty|.
297 \let\alpha@list\@empty
298 \@onlypreamble\alpha@list
303 % \begin{macro}{\alpha@elt}
306 \@onlypreamble\alpha@elt
312 % \begin{macro}{\newgroup}
313 % Start the group (fam) allocation at 0. (Doesn't belong here.)
319 % \begin{macro}{\stepcounter}
320 % \changes{v3.0f}{1997/11/13}
321 % {(DPC) Remove as never used. (Re)defined in ltcounts}
324 % \begin{macro}{\select@group}
325 % We surround |\select@group| with braces so that functions using it
326 % can be used directly after |_| or |^|.
327 % \changes{v2.1p}{1994/12/10}{Surround with braces (add fourth arg)}
328 % However, if we use oldstyle syntax where the math alphabet
329 % doesn't have arguments (ie if |\math@bgroup| is not |\bgroup|) we
330 % need to get rid of the extra group.
331 % \changes{v2.1q}{1995/04/02}{fix problem for pr/1275}
332 % \changes{v3.0g}{1997/11/20}
333 % {(DPC) inline use of \cs{stepcounter} (faster, and saves a csname
334 % per math version as no reset list)}
335 % \changes{v3.0q}{2015/03/18}{Introduce \cs{e@mathgroup@top}}
338 %<latexrelease>\IncludeInRelease{2015/01/01}
339 %<latexrelease> {\select@group}{\select@group}%
340 %<*2ekernel|latexrelease>
341 \def\select@group#1#2#3#4{%
342 \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi
345 \ifnum\csname c@mv@\math@version\endcsname<\e@mathgroup@top
348 \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3%
349 \globaldefs\@ne \math@fonts
351 \init@restore@version
352 \xdef#1{\noexpand\use@mathgroup\noexpand#2%
353 {\number\csname c@mv@\math@version\endcsname}}%
354 \global\advance\csname c@mv@\math@version\endcsname\@ne
357 \@latex@error{Too many math alphabets used in
358 version \math@version}%
361 \else \expandafter\non@alpherr\fi
365 %</2ekernel|latexrelease>
366 %<latexrelease>\EndIncludeInRelease
367 %<latexrelease>\IncludeInRelease{0000/00/00}
368 %<latexrelease> {\select@group}{\select@group}%
369 %<latexrelease>\def\select@group#1#2#3#4{%
370 %<latexrelease> \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi
372 %<latexrelease> \ifmmode
373 %<latexrelease> \ifnum\csname c@mv@\math@version\endcsname<\sixt@@n
374 %<latexrelease> \begingroup
375 %<latexrelease> \escapechar\m@ne
376 %<latexrelease> \getanddefine@fonts
377 %<latexrelease> {\csname c@mv@\math@version\endcsname}#3%
378 %<latexrelease> \globaldefs\@ne \math@fonts
379 %<latexrelease> \endgroup
380 %<latexrelease> \init@restore@version
381 %<latexrelease> \xdef#1{\noexpand\use@mathgroup\noexpand#2%
382 %<latexrelease> {\number\csname c@mv@\math@version\endcsname}}%
383 %<latexrelease> \global\advance\csname c@mv@\math@version\endcsname\@ne
384 %<latexrelease> \else
385 %<latexrelease> \let#1\relax
386 %<latexrelease> \@latex@error{Too many math alphabets used in
387 %<latexrelease> version \math@version}%
388 %<latexrelease> \@eha
390 %<latexrelease> \else \expandafter\non@alpherr\fi
391 %<latexrelease> #1{#4}%
394 %<latexrelease>\EndIncludeInRelease
399 \@onlypreamble\restore@mathversion
403 % \begin{macro}{\init@restore@version}
404 % \changes{v3.0e}{1996/07/26}{Removed \cs{ifrestore@version} switch
405 % and replaced by \cs{init@restore@version}}
407 \def\init@restore@version{%
408 \global\let\init@restore@version\relax
409 \xdef\restore@mathversion
410 {\expandafter\noexpand\csname mv@\math@version\endcsname
411 \global\csname c@mv@\math@version\endcsname
412 \number\csname c@mv@\math@version\endcsname\relax}%
413 \aftergroup\dorestore@version
415 \@onlypreamble\init@restore@version
419 % \begin{macro}{\non@alpherr}
420 % \changes{v3.0c}{1995/10/10}
421 % {(DPC) autoload error message}
422 % \changes{v3.0j}{2005/07/27}
423 % {(MH) Change because command is now properly robust}
425 \gdef\non@alpherr#1{\@latex@error{%
427 % The command here will have a space at the end of its name, so we make
428 % sure not to insert an extra one.
430 \string#1allowed only in math mode}\@ehd}
434 % \begin{macro}{\dorestore@version}
436 \def\dorestore@version
438 \aftergroup\dorestore@version
440 \gdef\init@restore@version{%
441 \global\let\init@restore@version\relax
442 \xdef\restore@mathversion
443 {\expandafter\noexpand\csname mv@\math@version\endcsname
444 \global\csname c@mv@\math@version\endcsname
445 \number\csname c@mv@\math@version\endcsname\relax}%
446 \aftergroup\dorestore@version
449 \let\getanddefine@fonts\@gobbletwo
453 \@onlypreamble\dorestore@version
457 % \begin{macro}{\document@select@group}
458 % We surround |\select@group| with braces so that functions using it
459 % can be used directly after |_| or |^|.
460 % \changes{v2.1p}{1994/12/10}{Surround with braces (add fourth arg)}
461 % \changes{v2.1q}{1995/04/02}{fix problem for pr/1275}
462 % \changes{v3.0g}{1997/11/20}
463 % {(DPC) inline use of \cs{stepcounter} (faster, and saves a csname
464 % per math version as no reset list)}
465 % \changes{v3.0q}{2015/03/18}{Introduce \cs{e@mathgroup@top}}
468 %<latexrelease>\IncludeInRelease{2015/01/01}
469 %<latexrelease> {\document@select@group}{\document@select@group}%
470 %<*2ekernel|latexrelease>
471 \def\document@select@group#1#2#3#4{%
472 \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi
475 \ifnum\csname c@mv@\math@version\endcsname<\e@mathgroup@top
478 \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3%
479 \globaldefs\@ne \math@fonts
481 \expandafter\extract@alph@from@version
482 \csname mv@\math@version\expandafter\endcsname
483 \expandafter{\number\csname
484 c@mv@\math@version\endcsname}%
486 \global\advance\csname c@mv@\math@version\endcsname\@ne
489 \@latex@error{Too many math alphabets used
490 in version \math@version}%
493 \else \expandafter\non@alpherr\fi
497 %</2ekernel|latexrelease>
498 %<latexrelease>\EndIncludeInRelease
499 %<latexrelease>\IncludeInRelease{0000/00/00}
500 %<latexrelease> {\document@select@group}{\document@select@group}%
501 %<latexrelease>\def\document@select@group#1#2#3#4{%
502 %<latexrelease> \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi
504 %<latexrelease> \ifmmode
505 %<latexrelease> \ifnum\csname c@mv@\math@version\endcsname<\sixt@@n
506 %<latexrelease> \begingroup
507 %<latexrelease> \escapechar\m@ne
508 %<latexrelease> \getanddefine@fonts
509 %<latexrelease> {\csname c@mv@\math@version\endcsname}#3%
510 %<latexrelease> \globaldefs\@ne \math@fonts
511 %<latexrelease> \endgroup
512 %<latexrelease> \expandafter\extract@alph@from@version
513 %<latexrelease> \csname mv@\math@version\expandafter\endcsname
514 %<latexrelease> \expandafter{\number\csname
515 %<latexrelease> c@mv@\math@version\endcsname}%
517 %<latexrelease> \global\advance\csname c@mv@\math@version\endcsname\@ne
518 %<latexrelease> \else
519 %<latexrelease> \let#1\relax
520 %<latexrelease> \@latex@error{Too many math alphabets used
521 %<latexrelease> in version \math@version}%
522 %<latexrelease> \@eha
524 %<latexrelease> \else \expandafter\non@alpherr\fi
525 %<latexrelease> #1{#4}%
528 %<latexrelease>\EndIncludeInRelease
533 % \begin{macro}{\process@table}
536 \def\cdp@elt##1##2##3##4{%
537 \@font@info{Checking defaults for
540 \ifx\csname##1/##2/##3/##4\endcsname\relax
542 % Grouping is important for two reasons, first |\cdp@elt| will get
543 % redefined if |\Declare...| functions are executed within the
544 % external |.fd| file and secondly |\try@load@fontshape| changes a
545 % lot of catcodes without surrounding itself with a group.
548 \def\f@encoding{##1}\def\f@family{##2}%
553 \ifx\csname##1/##2/##3/##4\endcsname\relax
554 \@latex@error{This NFSS system isn't set up properly}%
555 {For encoding scheme ##1 the defaults
556 ##2/##3/##4 do not form a valid font shape}%
558 \@font@info{... okay}%
562 % Now we make sure that |\error@fontshape| is okay.
567 \expandafter\ifx\csname \curr@fontshape\endcsname\relax
572 \expandafter\ifx\csname \curr@fontshape\endcsname\relax
573 \@latex@error{This NFSS system isn't set up properly}%
574 {The system maintainer forgot to specify a suitable
576 font shape using the \noexpand\DeclareErrorFont
581 % Set |\select@group| to its meaning used within the document body.
583 \let\select@group\document@select@group
585 % Install the default font attributes they are currently pointing
586 % to error font shape.
587 % Don't use |\reset@font| since that would trigger |\selectfont|.
589 \fontencoding{\encodingdefault}%
590 \fontfamily{\familydefault}%
591 \fontseries{\seriesdefault}%
592 \fontshape{\shapedefault}%
594 % kill all macros not longer needed.
595 % we need to add many more!!!!!!
599 \@onlypreamble\process@table
604 %\@onlypreamble\set@mathradical
607 % \begin{macro}{\DeclareMathVersion}
609 \def\DeclareMathVersion#1{%
610 \expandafter\new@mathversion\csname mv@#1\endcsname}
611 \@onlypreamble\DeclareMathVersion
615 % \begin{macro}{\new@mathversion}
616 % \changes{v3.0o}{2011/09/03}
617 % {(Will) Remove \cs{global} before \cs{newcount} (unnecessary and caused etex bug).}
619 \def\new@mathversion#1{%
620 \expandafter\in@\expandafter#1\expandafter{\version@list}%
622 \@font@info{Redeclaring math version
623 `\expandafter\@gobblefour\string#1'}%
625 \expandafter\newcount\csname c@\expandafter
626 \@gobble\string#1\endcsname
627 \def\version@elt{\noexpand\version@elt\noexpand}%
628 \edef\version@list{\version@list\version@elt#1}%
631 % |\toks@| is used to gather all tokens for the math version.
632 % |\count@| will be used to count the math groups we add to this
638 % Now we loop over |\group@list| to add all math groups defined so
639 % far to the version and at the same time to count them.
641 \def\group@elt##1##2{%
643 \addto@hook\toks@{\getanddefine@fonts##1##2}%
647 % We set the counter for this math version to the number of math
648 % groups found in |\group@list|.
650 \global\csname c@\expandafter\@gobble\string#1\endcsname\count@
652 % Now we loop over |\alpha@list| to add all math alphabets known so
653 % far. We have to distinguish the case that an alphabet by default
654 % should produce an error in new versions.
656 \def\alpha@elt##1##2##3{%
657 \ifx##2\no@alphabet@error
658 \toks@\expandafter{\the\toks@\install@mathalphabet##1%
659 {\no@alphabet@error##1}}%
661 \toks@\expandafter{\the\toks@\install@mathalphabet##1%
662 {\select@group##1##2##3}}%
667 % Finally we define the math version to expand to the contents of
669 % \changes{v2.0e}{1993/08/18}{Exchanged names of encodings in warning
670 % message of \cs{SetSymbolFont}.}
674 \@onlypreamble\new@mathversion
678 % \begin{macro}{\DeclareSymbolFont}
680 \def\DeclareSymbolFont#1#2#3#4#5{%
682 \edef\reserved@b{#2}%
683 \def\cdp@elt##1##2##3##4{\def\reserved@c{##1}%
684 \ifx\reserved@b\reserved@c \@tempswatrue\fi}%
687 \@ifundefined{sym#1}{%
690 % \changes{v3.0q}{2015/03/18}{Restrict Symbol fonts to 0-15}
693 \expandafter\new@mathgroup\csname sym#1\endcsname
694 \expandafter\new@symbolfont\csname sym#1\endcsname
697 \@latex@error{Too many symbol fonts declared}\@eha
704 \@font@info{Redeclaring symbol font `#1'}%
706 % \changes{v3.0f}{1997/11/13}
707 % {(DPC) Really update \cs{group@list} dont
708 % leave new version in \cs{toks@}. latex/2661}
709 % Update the group list.
711 \def\group@elt##1##2{%
712 \noexpand\group@elt\noexpand##1%
713 \expandafter\ifx\csname sym#1\endcsname##1%
714 \expandafter\noexpand\csname#2/#3/#4/#5\endcsname
718 \xdef\group@list{\group@list}%
720 % Update the version list.
722 \def\version@elt##1{%
724 \SetSymbolFont@\expandafter##1\csname#2/#3/#4/#5\expandafter
725 \endcsname \csname sym#1\endcsname
730 \@latex@error{Encoding scheme `#2' unknown}\@eha
733 \@onlypreamble\DeclareSymbolFont
737 % \begin{macro}{\group@list}
739 \let\group@list\@empty
740 \@onlypreamble\group@list
744 % \begin{macro}{\group@elt}
747 \@onlypreamble\group@elt
751 % \begin{macro}{\new@symbolfont}
753 \def\new@symbolfont#1#2#3#4#5{%
754 \toks@\expandafter{\group@list}%
755 \edef\group@list{\the\toks@\noexpand\group@elt\noexpand#1%
756 \expandafter\noexpand\csname#2/#3/#4/#5\endcsname}%
757 \def\version@elt##1{\toks@\expandafter{##1}%
758 \edef##1{\the\toks@\noexpand\getanddefine@fonts
759 #1\expandafter\noexpand\csname#2/#3/#4/#5\endcsname}%
760 \global\advance\csname c@\expandafter
761 \@gobble\string##1\endcsname\@ne
765 \@onlypreamble\new@symbolfont
769 % \begin{macro}{\SetSymbolFont}
771 \def\SetSymbolFont#1#2#3#4#5#6{%
773 \edef\reserved@b{#3}%
774 \def\cdp@elt##1##2##3##4{\def\reserved@c{##1}%
775 \ifx\reserved@b\reserved@c \@tempswatrue\fi}%
778 \expandafter\SetSymbolFont@
779 \csname mv@#2\expandafter\endcsname\csname#3/#4/#5/#6\expandafter
780 \endcsname \csname sym#1\endcsname
782 \@latex@error{Encoding scheme `#3' unknown}\@eha
785 \@onlypreamble\SetSymbolFont
789 % \begin{macro}{\SetSymbolFont@}
790 % \changes{v3.0l}{2007/08/31}{Font warning changed to info
791 % for encoding change (pr/3975)}
793 \def\SetSymbolFont@#1#2#3{%
794 \expandafter\in@\expandafter#1\expandafter{\version@list}%
796 \expandafter\in@\expandafter#3\expandafter{\group@list}%
799 \expandafter\get@cdp\string#2\@nil\reserved@a
801 \def\install@mathalphabet##1##2{%
802 \addto@hook\toks@{\install@mathalphabet##1{##2}}%
804 \def\getanddefine@fonts##1##2{%
806 \addto@hook\toks@{\getanddefine@fonts#3#2}%
807 \expandafter\get@cdp\string##2\@nil\reserved@b
808 \ifx\reserved@a\reserved@b\else
809 \@font@info{Encoding `\reserved@b' has changed
810 to `\reserved@a' for symbol font\MessageBreak
811 `\expandafter\@gobblefour\string#3' in the
812 math version `\expandafter
813 \@gobblefour\string#1'}%
816 Overwriting symbol font
817 `\expandafter\@gobblefour\string#3' in
818 version `\expandafter
819 \@gobblefour\string#1'\MessageBreak
820 \@spaces \expandafter\@gobble\string##2 -->
821 \expandafter\@gobble\string#2}%
823 \addto@hook\toks@{\getanddefine@fonts##1##2}%
829 \@latex@error{Symbol font `\expandafter\@gobblefour\string#3'
833 \@latex@error{Math version `\expandafter\@gobblefour\string#1'
835 defined}{You probably misspelled the name of the math
836 version.^^JOr you have to specify an additional package.}%
839 \@onlypreamble\SetSymbolFont@
843 % \begin{macro}{\get@cdp}
845 \def\get@cdp#1#2/#3\@nil#4{\def#4{#2}}
846 \@onlypreamble\get@cdp
850 % \begin{macro}{\DeclareMathAlphabet}
851 % \changes{v3.0j}{2005/07/27}
852 % {(MH) Make document commands robust}
854 \def\DeclareMathAlphabet#1#2#3#4#5{%
856 \edef\reserved@b{#2}%
857 \def\cdp@elt##1##2##3##4{\def\reserved@c{##1}%
858 \ifx\reserved@b\reserved@c \@tempswatrue\fi}%
862 \csname\expandafter\@gobble\string#1\endcsname
864 \new@mathalphabet#1{#2}{#3}{#4}{#5}%
867 % Check if it is already a math alphabet.
869 \edef\reserved@a{\noexpand\in@{\string\select@group}%
870 {\expandafter\meaning\csname \expandafter
871 \@gobble\string#1\space\endcsname}}%
874 \@font@info{Redeclaring math alphabet \string#1}%
875 \def\version@elt##1{%
876 \expandafter\SetMathAlphabet@\expandafter
877 ##1\csname#2/#3/#4/#5\expandafter\endcsname
879 % \changes{???}{1994/04/18}{Pass correct arg (2 not 3)}
881 \csname M@#2\expandafter\endcsname
882 \csname \expandafter\@gobble\string#1\space\endcsname#1}%
886 % Check if it is a math alphabet defined via
887 % |\DeclareSymbolFontAlphabet|.
889 \edef\reserved@a{\noexpand\in@{\string\use@mathgroup}%
890 {\expandafter\meaning\csname \expandafter
891 \@gobble\string#1\space\endcsname}}%
895 % In that case overwriting is simple since there is nothing
896 % inserted in the math version macros.
898 \@font@info{Redeclaring math alphabet \string#1}%
899 \new@mathalphabet#1{#2}{#3}{#4}{#5}%
904 \@latex@error{Command `\string#1' already defined}\@eha
909 \@latex@error{Encoding scheme `#2' unknown}\@eha
912 \@onlypreamble\DeclareMathAlphabet
916 % \begin{macro}{\new@mathalphabet}
917 % \changes{v3.0j}{2005/07/27}
918 % {(MH) Make document commands robust}
920 \def\new@mathalphabet#1#2#3#4#5{%
921 \toks@\expandafter{\alpha@list}%
922 \edef#1{\expandafter\noexpand\csname \expandafter
923 \@gobble\string#1\space\endcsname
925 \noexpand\no@alphabet@error
926 \noexpand\no@alphabet@error
928 \expandafter\noexpand\csname M@#2\endcsname
929 \expandafter\noexpand\csname#2/#3/#4/#5\endcsname
932 \toks2\expandafter{#1}%
933 \edef\alpha@list{\the\toks@\noexpand\alpha@elt\the\toks2}%
934 \def\version@elt##1{\toks@\expandafter{##1}%
935 \edef##1{\the\toks@\install@mathalphabet
936 \expandafter\noexpand
937 \csname \expandafter\@gobble
938 \string#1\space\endcsname
940 \noexpand\no@alphabet@error
943 \noexpand\select@group\the\toks2
947 \expandafter\edef\csname \expandafter\@gobble
948 \string#1\space\endcsname{\if/#5/%
949 \noexpand\no@alphabet@error
952 \noexpand\select@group\the\toks2
954 \edef#1{\noexpand\protect
955 \expandafter\noexpand\csname \expandafter
956 \@gobble\string#1\space\endcsname}%
958 \@onlypreamble\new@mathalphabet
962 % \begin{macro}{\SetMathAlphabet}
963 % \changes{v3.0j}{2005/07/27}
964 % {(MH) Make document commands robust}
966 \def\SetMathAlphabet#1#2#3#4#5#6{%
968 \edef\reserved@b{#3}%
969 \def\cdp@elt##1##2##3##4{\def\reserved@c{##1}%
970 \ifx\reserved@b\reserved@c \@tempswatrue\fi}%
973 \expandafter\SetMathAlphabet@
974 \csname mv@#2\expandafter\endcsname\csname#3/#4/#5/#6\expandafter
975 \endcsname \csname M@#3\expandafter\endcsname
976 \csname \expandafter\@gobble\string#1\space\endcsname#1%
978 \@latex@error{Encoding scheme `#3' unknown}\@eha
981 \@onlypreamble\SetMathAlphabet
985 % \begin{macro}{\SetMathAlphabet@}
987 \def\SetMathAlphabet@#1#2#3#4#5{%
988 \expandafter\in@\expandafter#1\expandafter{\version@list}%
990 \expandafter\in@\expandafter#4\expandafter{\alpha@list}%
994 \def\getanddefine@fonts##1##2{%
995 \addto@hook\toks@{\getanddefine@fonts##1##2}%
997 \def\reserved@c##1##2##3##4{% % for message below
998 \expandafter\@gobble\string##4}%
999 \def\install@mathalphabet##1##2{%
1002 {\install@mathalphabet#4{\select@group#4#3#2}}%
1003 \@font@info{Overwriting math alphabet
1004 `\string#5' in version `\expandafter
1005 \@gobblefour\string#1'\MessageBreak
1006 \@spaces \reserved@c##2 -->
1007 \expandafter\@gobble\string#2}%
1009 \addto@hook\toks@{\install@mathalphabet##1{##2}}%
1013 \xdef#1{\the\toks@}%
1017 % If the math alphabet was defined via |\DeclareSymbolFontAlphabet|
1018 % we have remove its external definition and add it as a normal
1019 % math alphabet to every version before trying to change it in one
1021 % \changes{v2.1b}{1994/03/11}{Changed parameter template in temporary
1022 % macro to catch check add below.}
1025 \noexpand\in@{\string\use@mathgroup}{\meaning#4}}%
1028 \def\reserved@b##1\use@mathgroup##2##3{%
1029 \def\reserved@b{##3}\def\reserved@c{##2}}%
1030 \expandafter\reserved@b#4%
1032 \def\install@mathalphabet##1##2{%
1033 \addto@hook\toks@{\install@mathalphabet##1{##2}}%
1035 \def\getanddefine@fonts##1##2{%
1036 \addto@hook\toks@{\getanddefine@fonts##1##2}%
1037 \ifnum##1=\reserved@b
1039 \addto@hook\expandafter\toks@
1040 \expandafter{\expandafter\install@mathalphabet
1041 \expandafter#4\expandafter
1042 {\expandafter\select@group\expandafter
1046 \def\version@elt##1{%
1049 \xdef##1{\the\toks@}%
1054 % Put it into the |\alpha@list| with default `error'
1056 \expandafter\gdef\expandafter\alpha@list\expandafter
1058 \alpha@elt #4\no@alphabet@error \no@alphabet@error}%
1059 \gdef#4{\no@alphabet@error #5}% fake things :-)
1061 % Then call the internal setting routine again:
1063 \SetMathAlphabet@{#1}{#2}{#3}#4#5%
1065 \@latex@error{Command `\string#5' not defined as a
1067 {Use \noexpand\DeclareMathAlphabet to define it.}%
1071 \@latex@error{Math version `\expandafter\@gobblefour\string#1'
1073 defined}{You probably misspelled the name of the math
1074 version.^^JOr you have to specify an additional package.}%
1077 \@onlypreamble\SetMathAlphabet@
1081 % \begin{macro}{\DeclareMathAlphabet}
1082 % could do with more checks like allowing single number in |#4|
1083 % lowercase in |#4| etc
1084 % \changes{v3.0r}{2016/02/18}
1085 % {Check for mathaccent not \cs{mathaccemt}}
1087 \def\DeclareMathAccent#1#2#3#4{%
1088 \expandafter\in@\csname sym#3\expandafter\endcsname
1089 \expandafter{\group@list}%
1094 \divide\count\z@\sixt@@n
1096 \multiply\count@\sixt@@n
1097 \advance\count\tw@-\count@
1098 \if\relax\noexpand#1% is command?
1099 \edef\reserved@a{\noexpand\in@
1100 {\expandafter\@gobble\string\mathaccent}{\meaning#1}}%
1103 \expandafter\set@mathaccent
1104 \csname sym#3\endcsname#1#2%
1105 {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
1106 \@font@info{Redeclaring math accent \string#1}%
1109 \csname\expandafter\@gobble\string#1\endcsname
1111 \expandafter\set@mathaccent
1112 \csname sym#3\endcsname#1#2%
1113 {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
1115 \@latex@error{Command `\string#1' already defined}\@eha
1119 \@latex@error{Not a command name: `\noexpand#1'}\@eha
1123 \@latex@error{Symbol font `#3' is not defined}\@eha
1126 \@onlypreamble\DeclareMathAccent
1130 % \begin{macro}{\set@mathaccent}
1132 \def\set@mathaccent#1#2#3#4{%
1133 \xdef#2{\mathaccent"\mathchar@type#3\hexnumber@#1#4\relax}}
1134 \@onlypreamble\set@mathaccent
1138 % \begin{macro}{\DeclareMathSymbol}
1139 % \changes{v3.0r}{2016/02/18}
1140 % {Check for mathchar not \cs{mathchar}}
1142 \def\DeclareMathSymbol#1#2#3#4{%
1143 \expandafter\in@\csname sym#3\expandafter\endcsname
1144 \expandafter{\group@list}%
1149 \divide\count\z@\sixt@@n
1151 \multiply\count@\sixt@@n
1152 \advance\count\tw@-\count@
1153 \if\relax\noexpand#1% is command?
1155 {\noexpand\in@{\expandafter\@gobble\string\mathchar}{\meaning#1}}%
1158 \expandafter\set@mathsymbol
1159 \csname sym#3\endcsname#1#2%
1160 {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
1161 \@font@info{Redeclaring math symbol \string#1}%
1164 \csname\expandafter\@gobble\string#1\endcsname
1166 \expandafter\set@mathsymbol
1167 \csname sym#3\endcsname#1#2%
1168 {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
1170 \@latex@error{Command `\string#1' already defined}\@eha
1174 \expandafter\set@mathchar
1175 \csname sym#3\endcsname#1#2
1176 {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
1180 \@latex@error{Symbol font `#3' is not defined}\@eha
1183 \@onlypreamble\DeclareMathSymbol
1187 % \begin{macro}{\set@mathchar}
1189 \def\set@mathchar#1#2#3#4{%
1190 \global\mathcode`#2="\mathchar@type#3\hexnumber@#1#4\relax}
1191 \@onlypreamble\set@mathchar
1195 % \begin{macro}{\set@mathsymbol}
1197 \def\set@mathsymbol#1#2#3#4{%
1198 \global\mathchardef#2"\mathchar@type#3\hexnumber@#1#4\relax}
1199 \@onlypreamble\set@mathsymbol
1204 %\def\mathsymbol#1#2#3{%
1205 % \@tempcnta=#3\relax
1206 % \@tempcntb\@tempcnta
1207 % \divide\@tempcnta\sixt@@n
1209 % \multiply\count@\sixt@@n
1210 % \advance\@tempcntb-\count@
1211 % \mathchar"\mathchar@type#1\hexnumber@#2%
1212 % \hexnumber@\@tempcnta\hexnumber@\@tempcntb\relax}
1214 %\def\DeclareMathAlphabetCharacter#1#2#3{%
1215 % \DeclareMathSymbol{#1}7{#2}{#3}}
1218 % \begin{macro}{\DeclareMathDelimiter}
1219 % \changes{v2.1m}{1994/11/18}
1220 % {(DPC) \cs{expandafter} instead of \cs{next}}
1222 \def\DeclareMathDelimiter#1{%
1223 \if\relax\noexpand#1%
1224 \expandafter\@DeclareMathDelimiter
1226 \expandafter\@xxDeclareMathDelimiter
1229 \@onlypreamble\DeclareMathDelimiter
1233 % \begin{macro}{\@xxDeclareMathDelimiter}
1234 % \changes{v3.0h}{1998/04/15}{Macro added (pr/2662)}
1235 % This macro checks if the second arg is a ``math type'' such
1236 % as |\mathopen|. The undocumented original code didn't use math
1237 % types when the delimiter was a single letter.
1238 % For this reason the coding is a bit strange as it tries to
1239 % support the undocumented syntax for compatibility reasons.
1241 \def\@xxDeclareMathDelimiter#1#2#3#4{%
1243 % 7 is the default value returned in the case that |\mathchar@type|
1244 % is passed something unexpected, like a math symbol font name.
1245 % We locally move |\mathalpha| out of the way so if you use that
1246 % the right branch is taken. This will still fail if an explicit
1247 % number |7| is used!
1250 \let\mathalpha\mathord
1251 \ifnum7=\mathchar@type{#2}%
1254 % If this branch is taken we have old syntax (5 arguments).
1256 \expandafter\@firstofone
1259 % If this branch is taken |\mathchar@type| is different from 7 so
1260 % we assume new syntax. In this case we also use the arguments to
1261 % set up the letter as a math symbol for the case where it is not
1262 % used as a delimiter.
1265 \DeclareMathSymbol#1{#2}{#3}{#4}%
1267 % Then we arrange that |\@xDeclareMathDelimiter| only gets |#1|,
1268 % |#3|, |#4| \ldots\ as it does not expect a math type as argument.
1270 \expandafter\@firstoftwo
1272 {\@xDeclareMathDelimiter#1}{#2}{#3}{#4}}
1273 \@onlypreamble\@xxDeclareMathDelimiter
1277 % \begin{macro}{\@DeclareMathDelimiter}
1278 % \changes{v3.0r}{2016/02/18}
1279 % {Check for delimiter not \cs{delimiter}}
1281 \def\@DeclareMathDelimiter#1#2#3#4#5#6{%
1282 \expandafter\in@\csname sym#3\expandafter\endcsname
1283 \expandafter{\group@list}%
1285 \expandafter\in@\csname sym#5\expandafter\endcsname
1286 \expandafter{\group@list}%
1291 \divide\count\z@\sixt@@n
1293 \multiply\count@\sixt@@n
1294 \advance\count\tw@-\count@
1295 \edef\reserved@c{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
1299 \divide\count\z@\sixt@@n
1301 \multiply\count@\sixt@@n
1302 \advance\count\tw@-\count@
1303 \edef\reserved@d{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
1305 \edef\reserved@a{\noexpand\in@
1306 {\expandafter\@gobble\string\delimiter}{\meaning#1}}%
1309 \expandafter\set@mathdelimiter
1310 \csname sym#3\expandafter\endcsname
1311 \csname sym#5\endcsname#1#2%
1312 \reserved@c\reserved@d
1313 \@font@info{Redeclaring math delimiter \string#1}%
1316 \csname\expandafter\@gobble\string#1\endcsname
1318 \expandafter\set@mathdelimiter
1319 \csname sym#3\expandafter\endcsname
1320 \csname sym#5\endcsname#1#2%
1321 \reserved@c\reserved@d
1323 \@latex@error{Command `\string#1' already defined}\@eha
1328 \@latex@error{Symbol font `#5' is not defined}\@eha
1331 \@latex@error{Symbol font `#3' is not defined}\@eha
1334 \@onlypreamble\@DeclareMathDelimiter
1338 % \begin{macro}{\@xDeclareMathDelimiter}
1340 \def\@xDeclareMathDelimiter#1#2#3#4#5{%
1341 \expandafter\in@\csname sym#2\expandafter\endcsname
1342 \expandafter{\group@list}%
1344 \expandafter\in@\csname sym#4\expandafter\endcsname
1345 \expandafter{\group@list}%
1350 \divide\count\z@\sixt@@n
1352 \multiply\count@\sixt@@n
1353 \advance\count\tw@-\count@
1354 \edef\reserved@c{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
1358 \divide\count\z@\sixt@@n
1360 \multiply\count@\sixt@@n
1361 \advance\count\tw@-\count@
1362 \edef\reserved@d{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
1363 \expandafter\set@@mathdelimiter
1364 \csname sym#2\expandafter\endcsname\csname sym#4\endcsname#1%
1365 \reserved@c\reserved@d
1368 \@latex@error{Symbol font `#4' is not defined}\@eha
1371 \@latex@error{Symbol font `#2' is not defined}\@eha
1374 \@onlypreamble\@xDeclareMathDelimiter
1378 % \begin{macro}{\set@mathdelimiter}
1379 % We have to end the definition of a math delimiter like |\lfloor|
1380 % with a space and not with |\relax| as we did before, because
1381 % otherwise constructs involving |\abovewithdelims| will prematurely
1384 % \changes{v2.1q}{1995/04/02}{fix pr/1329}
1386 \def\set@mathdelimiter#1#2#3#4#5#6{%
1387 \xdef#3{\delimiter"\mathchar@type#4\hexnumber@#1#5%
1389 \@onlypreamble\set@mathdelimiter
1393 % \begin{macro}{\set@@mathdelimiter}
1395 \def\set@@mathdelimiter#1#2#3#4#5{%
1396 \global\delcode`#3="\hexnumber@#1#4\hexnumber@#2#5\relax}
1397 \@onlypreamble\set@@mathdelimiter
1401 % \begin{macro}{\DeclareMathRadical}
1403 \def\DeclareMathRadical#1#2#3#4#5{%
1405 % Below is a crude fix to make this macro work if |#1| is undefined
1406 % or |\relax|. Should be improved!
1407 % \changes{v2.1t}{1995/05/21}{Allow for undefined cs names}
1408 % \changes{v3.0r}{2016/02/18}
1409 % {Check for radical not \cs{radical}}
1412 \csname\expandafter\@gobble\string#1\endcsname
1416 \edef\reserved@a{\noexpand\in@
1417 {\expandafter\@gobble\string\radical}{\meaning#1}}%
1420 \expandafter\in@\csname sym#2\expandafter\endcsname
1421 \expandafter{\group@list}%
1423 \expandafter\in@\csname sym#4\expandafter\endcsname
1424 \expandafter{\group@list}%
1429 \divide\count\z@\sixt@@n
1431 \multiply\count@\sixt@@n
1432 \advance\count\tw@-\count@
1434 \hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
1437 \divide\count\z@\sixt@@n
1439 \multiply\count@\sixt@@n
1440 \advance\count\tw@-\count@
1442 \hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
1444 % Coded inline instead of using |\set@mathradical|
1446 % \expandafter\set@mathradical
1447 % \csname sym#2\expandafter\endcsname
1448 % \csname sym#4\endcsname#1%
1449 % \reserved@c\reserved@d
1450 \xdef#1{\radical"\expandafter\hexnumber@
1451 \csname sym#2\endcsname\reserved@c
1452 \expandafter\hexnumber@
1453 \csname sym#4\endcsname\reserved@d
1457 \@latex@error{Symbol font `#4' is not defined}\@eha
1460 \@latex@error{Symbol font `#2' is not defined}\@eha
1463 \@latex@error{Command `\string#1' already defined}\@eha
1466 \@onlypreamble\DeclareMathRadical
1470 % Definition below was wrong it contained |\delimiter| !
1473 %\def\set@mathradical#1#2#3#4#5{%
1474 % \xdef#3{\radical"\hexnumber@#1#4\hexnumber@#2#5\relax}}
1477 % \begin{macro}{\mathalpha}
1478 % just a dummy currently
1480 \let\mathalpha\relax
1484 % \begin{macro}{\mathchar@type}
1486 \def\mathchar@type#1{%
1487 \ifodd 2#11 #1\else % is this non-negative number?
1488 \ifx#1\mathord 0\else
1489 \ifx#1\mathop 1\else
1490 \ifx#1\mathbin 2\else
1491 \ifx#1\mathrel 3\else
1492 \ifx#1\mathopen 4\else
1493 \ifx#1\mathclose 5\else
1494 \ifx#1\mathpunct 6\else
1495 7% % anything else is variable ord
1504 \@onlypreamble\mathchar@type
1508 % \begin{macro}{\DeclareSymbolFontAlphabet}
1509 % \changes{v3.0j}{2005/07/27}
1510 % {(MH) Make document commands robust}
1512 \def\DeclareSymbolFontAlphabet#1#2{%
1513 \expandafter\DeclareSymbolFontAlphabet@
1514 \csname \expandafter\@gobble\string#1\space\endcsname{#2}#1}
1515 \@onlypreamble\DeclareSymbolFontAlphabet
1519 % \begin{macro}{\DeclareSymbolFontAlphabet@}
1521 \def\DeclareSymbolFontAlphabet@#1#2#3{%
1523 % We use the switch |\if@tempswa| to decide if we can declare this
1524 % symbol font alphabet.
1528 % First check if |#2| is known to be a symbol font
1530 \expandafter\in@\csname sym#2\expandafter\endcsname
1531 \expandafter{\group@list}%
1534 % Check if |#1| is defined as a math alphabet defined via
1535 % |\DeclareMathAlphabet|:
1537 \expandafter\in@\expandafter#1\expandafter{\alpha@list}%
1540 % If so remove it from the |\alpha@list| and from all math version
1543 \@font@info{Redeclaring math alphabet \string#3}%
1545 \def\alpha@elt##1##2##3{%
1546 \ifx##1#1\else\addto@hook\toks@{\alpha@elt##1##2##3}\fi}%
1548 \xdef\alpha@list{\the\toks@}%
1550 % Now we loop over all versions and remove the math alphabet:
1552 \def\version@elt##1{%
1555 \def\getanddefine@fonts####1####2{%
1556 \addto@hook\toks@{\getanddefine@fonts####1####2}}%
1557 \def\install@mathalphabet####1####2{%
1559 \addto@hook\toks@{\install@mathalphabet
1562 \xdef##1{\the\toks@}%
1568 % If |#3| is not defined as a math alphabet check if it is defined
1572 \csname\expandafter\@gobble\string#1\space\endcsname
1575 % If it is undefined, fine otherwise check if it is a math alphabet
1576 % defined via |\DeclareSymbolFontAlphabet|:
1580 \noexpand\in@{\string\use@mathgroup}{\meaning#1}}%
1583 \@font@info{Redeclaring math alphabet \string#3}%
1586 % Since the command |#3| is defined to be something which is not a
1587 % math alphabet we have to skip redefining it.
1590 \@latex@error{Command `\string#3' already defined}\@eha
1596 % Since the symbol font is not known we better skip defining this
1600 \@latex@error{Unknown symbol font `#2'}\@eha
1604 % When we reach this point we are allowed to define |#1| to be a
1605 % symbol font math alphabet. This means that we have to set it to
1607 % |\use@mathgroup| \meta{math-settings} |\sym|\meta{name}
1609 % The \meta{math-settings} are the one for the encoding that is
1610 % used in the font shape where |\sym|\meta{name} is pointing to.
1611 % This means that we have to get it from the information stored in
1612 % |\group@list|. Thus we loop through that list after defining
1613 % |\group@elt| in a suitable way.
1614 % \changes{v2.1b}{1994/03/11}{Added check against use of alphabet
1615 % switch outside of math mode.}
1617 \def\group@elt##1##2{%
1618 \expandafter\ifx\csname sym#2\endcsname##1%
1619 \expandafter\reserved@a\string##2\@nil
1621 \def\reserved@a##1##2/##3\@nil{%
1622 \def\reserved@a{##2}}%
1624 \toks@{\relax\ifmmode \else \non@alpherr#1\fi}%
1626 \noexpand\use@mathgroup
1627 \expandafter\noexpand\csname M@\reserved@a\endcsname
1628 \csname sym#2\endcsname}%
1632 \@onlypreamble\DeclareSymbolFontAlphabet@