| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 1993-2025 |
| 4 |
% The LaTeX Project and any individual authors listed elsewhere |
| 5 |
% in this file. |
| 6 |
% |
| 7 |
% This file is part of the LaTeX base system. |
| 8 |
% ------------------------------------------- |
| 9 |
% |
| 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 |
% https://www.latex-project.org/lppl.txt |
| 15 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 16 |
% version 2008 or later. |
| 17 |
% |
| 18 |
% This file has the LPPL maintenance status "maintained". |
| 19 |
% |
| 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 |
| 22 |
% information. |
| 23 |
% |
| 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. |
| 27 |
% |
| 28 |
% \fi |
| 29 |
% \iffalse |
| 30 |
%%% From File: ltfssdcl.dtx |
| 31 |
%% Copyright (C) 1989-1998 Frank Mittelbach and Rainer Sch\"opf, |
| 32 |
%% all rights reserved. |
| 33 |
% |
| 34 |
%<*driver> |
| 35 |
% \fi |
| 36 |
% |
| 37 |
% |
| 38 |
\ProvidesFile{ltfssdcl.dtx} |
| 39 |
[2025/09/19 v3.1e LaTeX Kernel (NFSS Declarative Interface)] |
| 40 |
% \iffalse |
| 41 |
\documentclass{ltxdoc} |
| 42 |
\begin{document} |
| 43 |
\DocInput{ltfssdcl.dtx} |
| 44 |
\end{document} |
| 45 |
%</driver> |
| 46 |
% \fi |
| 47 |
% |
| 48 |
% \iffalse |
| 49 |
%<+checkmem>\def\CHECKMEM{\tracingstats=2 |
| 50 |
%<+checkmem> \newlinechar=`\^^J |
| 51 |
%<+checkmem> \message{^^JMemory usage: \filename}\shipout\hbox{}} |
| 52 |
%<+checkmem>\CHECKMEM |
| 53 |
% \fi |
| 54 |
% |
| 55 |
% |
| 56 |
% |
| 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}} |
| 62 |
% |
| 63 |
% \author{Frank Mittelbach \and Rainer Sch\"opf} |
| 64 |
% |
| 65 |
% \MaintainedByLaTeXTeam{latex} |
| 66 |
% \maketitle |
| 67 |
% |
| 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 |
| 71 |
% commands. |
| 72 |
% |
| 73 |
% \begin{quote} |
| 74 |
% \textbf{Warning:} |
| 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. |
| 78 |
% \end{quote} |
| 79 |
% |
| 80 |
% \MaybeStop{} |
| 81 |
% |
| 82 |
% \section{Interface Commands} |
| 83 |
% |
| 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} |
| 92 |
% |
| 93 |
% |
| 94 |
% \changes{v2.1o}{1994/11/22} |
| 95 |
% {wrap long lines} |
| 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 |
| 103 |
% parsing macros} |
| 104 |
% \changes{v2.1d}{1994/04/18}{Removed surplus \cs{no@alphabet@error} |
| 105 |
% (see fam.dtx)} |
| 106 |
% |
| 107 |
% |
| 108 |
% |
| 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} |
| 112 |
% |
| 113 |
% \begin{macrocode} |
| 114 |
%<*2ekernel> |
| 115 |
\message{NFSS declarative interface,} |
| 116 |
% \end{macrocode} |
| 117 |
% |
| 118 |
% |
| 119 |
% \begin{macro}{\in@} |
| 120 |
% \changes{v3.0m}{2009/10/20}{More robust thanks to Heiko.} |
| 121 |
% \changes{v3.0n}{2011/05/08}{Simplified thanks to Bruno.} |
| 122 |
% \begin{macro}{\ifin@} |
| 123 |
% |\@in| is a utility macro with two arguments. It determines |
| 124 |
% whether its first argument occurs in its second and sets the |
| 125 |
% switch |\ifin@| accordingly. The first argument may not |
| 126 |
% contain braces nor |#| (more precisely, tokens of category |
| 127 |
% code 1,~2, or~6). |
| 128 |
% \begin{macrocode} |
| 129 |
\def\in@#1#2% |
| 130 |
{% |
| 131 |
\begingroup |
| 132 |
\def\in@@##1#1{}% |
| 133 |
\toks@\expandafter{\in@@#2{}{}#1}% |
| 134 |
\edef\in@@{\the\toks@}% |
| 135 |
\expandafter\endgroup |
| 136 |
\ifx\in@@\@empty |
| 137 |
\in@false |
| 138 |
\else |
| 139 |
\in@true |
| 140 |
\fi |
| 141 |
} |
| 142 |
\newif\ifin@ |
| 143 |
% \end{macrocode} |
| 144 |
% \end{macro} |
| 145 |
% \end{macro} |
| 146 |
% |
| 147 |
% Before the |\begin{document}| command several |
| 148 |
% \meta{math versions} and \meta{math alphabet identifiers} may |
| 149 |
% be declared. |
| 150 |
% In principle, there should be exactly one family/series/shape |
| 151 |
% combination be declared for each version/alphabet pair. |
| 152 |
% But we want to allow for defaults as well for automagical |
| 153 |
% filling of holes. |
| 154 |
% |
| 155 |
% While building the tables for math alphabet identifiers and math |
| 156 |
% versions we keep several lists: |
| 157 |
% \begin{itemize} |
| 158 |
% \item the list of all math versions, |\version@list|, |
| 159 |
% each entry prefixed by the control sequence |\version@elt|, |
| 160 |
% i.e.\ this list has the following form |
| 161 |
% \begin{quote} |
| 162 |
% |\version@elt|\meta{version$_1$}^^A |
| 163 |
% |\version@elt|\meta{version$_2$}\ldots\\\hspace*{\fill}^^A |
| 164 |
% |\version@elt|\meta{version$_n$} |
| 165 |
% \end{quote} |
| 166 |
% \item the list of all math alphabet identifiers. Here every |
| 167 |
% entry has the form:\\[2pt] |
| 168 |
% \hspace*{\MacroIndent} |
| 169 |
% |\group@elt|\meta{math group number}\\ |
| 170 |
% \hspace*{\MacroIndent} |
| 171 |
% |{{|\meta{default family}^^A |
| 172 |
% |}{|\meta{default series}^^A |
| 173 |
% |}{|\meta{default shape}|}}|. |
| 174 |
% \item Each defined math alphabet identifier holds a list containing |
| 175 |
% Information about the {\em versions\/} for which it is |
| 176 |
% defined. This list has a more complicated structure: it |
| 177 |
% looks as follows: |
| 178 |
% \begin{quote} |
| 179 |
% |\set@alpha|\meta{the alphabet identifier itself}\\ |
| 180 |
% \hspace*{\MacroIndent} |
| 181 |
% |\reserved@c|\meta{math version}\meta{font info}\\ |
| 182 |
% \hspace*{\MacroIndent}\ldots\\ |
| 183 |
% |\@nil| |
| 184 |
% \end{quote} |
| 185 |
% where \meta{font info} is either |\reserved@e| |
| 186 |
% (if the combination is not defined yet) or |
| 187 |
% \begin{quote} |
| 188 |
% |{{|\meta{family}|}{|\meta{series}^^A |
| 189 |
% |}{|\meta{shape}|}}| |
| 190 |
% \end{quote} |
| 191 |
% \end{itemize} |
| 192 |
% |
| 193 |
% \begin{macro}{\version@list} |
| 194 |
% We initialize the version list to be empty. |
| 195 |
% \begin{macrocode} |
| 196 |
\let\version@list=\@empty |
| 197 |
\@onlypreamble\version@list |
| 198 |
% \end{macrocode} |
| 199 |
% \end{macro} |
| 200 |
% |
| 201 |
% |
| 202 |
% \begin{macro}{\version@elt} |
| 203 |
% \begin{macrocode} |
| 204 |
\let\version@elt\relax |
| 205 |
\@onlypreamble\version@elt |
| 206 |
% \end{macrocode} |
| 207 |
% \end{macro} |
| 208 |
% |
| 209 |
% |
| 210 |
% \begin{macro}{\new@mathversion} |
| 211 |
% The macro |\new@mathversion| is called with the version control |
| 212 |
% sequence as its argument. |
| 213 |
% \begin{macrocode} |
| 214 |
%\def\new@mathversion#1{% |
| 215 |
% \end{macrocode} |
| 216 |
% The first thing this macro does is to check if the version |
| 217 |
% identifier is already present in |\version@list|. |
| 218 |
% We enclose |\version@list| in braces since it might be empty |
| 219 |
% (if no {\em version\/} is defined yet). But this means that |
| 220 |
% we need a suitable number of |\expandafter| primitives. |
| 221 |
% \begin{macrocode} |
| 222 |
% \expandafter\in@\expandafter#1\expandafter{\version@list}% |
| 223 |
% \ifin@ |
| 224 |
% \end{macrocode} |
| 225 |
% If so it prints an error message. |
| 226 |
% The |\next| macro is used to get rid of the four characters |
| 227 |
% |\mv@| that would otherwise appear at the begin of the |
| 228 |
% version name in the error message. |
| 229 |
% \begin{macrocode} |
| 230 |
% \@latex@error{Math version |
| 231 |
% `\expandafter\@gobblefour\string#1' |
| 232 |
% already defined}\@eha |
| 233 |
% \end{macrocode} |
| 234 |
% Otherwise we have a new version, and we can proceed with |
| 235 |
% entering it into the tables. |
| 236 |
% We add it to |\version@list|. This is very easy: |
| 237 |
% we define |\version@elt| (which is the delimiter in |
| 238 |
% |\version@list|) to protect itself and the following token |
| 239 |
% from being expanded and simply redefine |\version@list|. |
| 240 |
% \begin{macrocode} |
| 241 |
% \else |
| 242 |
% \global\expandafter\newcount\csname c@\expandafter |
| 243 |
% \@gobble\string#1\endcsname |
| 244 |
% \global\csname c@\expandafter |
| 245 |
% \@gobble\string#1\endcsname\@ne |
| 246 |
% \def\version@elt{\noexpand\version@elt\noexpand}% |
| 247 |
% \edef\version@list{\version@list\version@elt#1}% |
| 248 |
% \end{macrocode} |
| 249 |
% Then we prepare to enter the new version into all math |
| 250 |
% alphabet identifier lists. Remember that these lists |
| 251 |
% use |\reserved@c| as delimiter, and that there appears the |
| 252 |
% control sequence |\reserved@e| that must not be expanded. |
| 253 |
% Therefore we take suitable precautions. |
| 254 |
% \begin{macrocode} |
| 255 |
% \def\reserved@c{\noexpand\reserved@c\noexpand}% |
| 256 |
% \let\reserved@e\relax |
| 257 |
% \end{macrocode} |
| 258 |
% We will now go through the |\alpha@list| to process every |
| 259 |
% \meta{math alphabet identifier} in turn. |
| 260 |
% Since this list has |\group@elt| as a delimiter we define |
| 261 |
% this control sequence. It has three arguments as every |
| 262 |
% entry consists of three items (as explained above). |
| 263 |
% \begin{macrocode} |
| 264 |
% \def\group@elt##1##2##3{% |
| 265 |
% \end{macrocode} |
| 266 |
% The first of these arguments is the \meta{math alphabet |
| 267 |
% identifier}. We redefine it by appending the information |
| 268 |
% about the new version at the end of the list contained in |
| 269 |
% it. However, there is one subtlety: the definitions for |
| 270 |
% |\reserved@c| and |\reserved@e| made above prevent the |
| 271 |
% main part of the list from being expanded. But we still have |
| 272 |
% to take care of the header and the trailer. To do this we |
| 273 |
% remove the trailer by means of the macro |\remove@nil| |
| 274 |
% which also protect the header from being expanded. Its |
| 275 |
% definition is given below. Now we can prepare to add the |
| 276 |
% new version. |
| 277 |
% \begin{macrocode} |
| 278 |
% \edef##1{\expandafter\remove@nil##1% |
| 279 |
% \reserved@c |
| 280 |
% #1% |
| 281 |
% \reserved@e |
| 282 |
% \noexpand\@nil}}% |
| 283 |
% \end{macrocode} |
| 284 |
% Finally we call |\alpha@list| which will now execute |
| 285 |
% the macro |\group@elt| once for every defined \meta{math |
| 286 |
% alphabet identifier}. And that's all for now. |
| 287 |
% \begin{macrocode} |
| 288 |
% \alpha@list |
| 289 |
% \fi} |
| 290 |
% \end{macrocode} |
| 291 |
% \end{macro} |
| 292 |
% |
| 293 |
% |
| 294 |
% \begin{macro}{\alpha@list} |
| 295 |
% As we explained above every entry in |\alpha@list| has |
| 296 |
% the form\\[2pt] |
| 297 |
% |\alpha@elt|\\\meta{alphabet identifier}\meta{internal |
| 298 |
% group number}\meta{default font assignments}\ldots\\[2pt] |
| 299 |
% We initialize it to |\@empty|. |
| 300 |
% \begin{macrocode} |
| 301 |
\let\alpha@list\@empty |
| 302 |
\@onlypreamble\alpha@list |
| 303 |
% \end{macrocode} |
| 304 |
% \end{macro} |
| 305 |
% |
| 306 |
% |
| 307 |
% \begin{macro}{\alpha@elt} |
| 308 |
% \begin{macrocode} |
| 309 |
\let\alpha@elt\relax |
| 310 |
\@onlypreamble\alpha@elt |
| 311 |
% \end{macrocode} |
| 312 |
% \end{macro} |
| 313 |
% |
| 314 |
% |
| 315 |
% |
| 316 |
% \begin{macro}{\newgroup} |
| 317 |
% Start the group (fam) allocation at 0. (Doesn't belong here.) |
| 318 |
% \begin{macrocode} |
| 319 |
\count18=-1 |
| 320 |
% \end{macrocode} |
| 321 |
% \end{macro} |
| 322 |
% |
| 323 |
% \begin{macro}{\stepcounter} |
| 324 |
% \changes{v3.0f}{1997/11/13} |
| 325 |
% {(DPC) Remove as never used. (Re)defined in ltcounts} |
| 326 |
% \end{macro} |
| 327 |
% |
| 328 |
% \begin{macro}{\select@group} |
| 329 |
% We surround |\select@group| with braces so that functions using it |
| 330 |
% can be used directly after |_| or |^|. |
| 331 |
% \changes{v2.1p}{1994/12/10}{Surround with braces (add fourth arg)} |
| 332 |
% However, if we use oldstyle syntax where the math alphabet |
| 333 |
% doesn't have arguments (ie if |\math@bgroup| is not |\bgroup|) we |
| 334 |
% need to get rid of the extra group. |
| 335 |
% \changes{v2.1q}{1995/04/02}{fix problem for pr/1275} |
| 336 |
% \changes{v3.0g}{1997/11/20} |
| 337 |
% {(DPC) inline use of \cs{stepcounter} (faster, and saves a csname |
| 338 |
% per math version as no reset list)} |
| 339 |
% \changes{v3.0q}{2015/03/18}{Introduce \cs{e@mathgroup@top}} |
| 340 |
% \begin{macrocode} |
| 341 |
%</2ekernel> |
| 342 |
%<latexrelease>\IncludeInRelease{2015/01/01} |
| 343 |
%<latexrelease> {\select@group}{\select@group}% |
| 344 |
%<*2ekernel|latexrelease> |
| 345 |
\def\select@group#1#2#3#4{% |
| 346 |
\ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi |
| 347 |
{% |
| 348 |
\ifmmode |
| 349 |
\ifnum\csname c@mv@\math@version\endcsname<\e@mathgroup@top |
| 350 |
\begingroup |
| 351 |
\escapechar\m@ne |
| 352 |
\getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3% |
| 353 |
\globaldefs\@ne \math@fonts |
| 354 |
\endgroup |
| 355 |
\init@restore@version |
| 356 |
\xdef#1{\noexpand\use@mathgroup\noexpand#2% |
| 357 |
{\number\csname c@mv@\math@version\endcsname}}% |
| 358 |
\global\advance\csname c@mv@\math@version\endcsname\@ne |
| 359 |
\else |
| 360 |
\let#1\relax |
| 361 |
\@latex@error{Too many math alphabets used in |
| 362 |
version \math@version}% |
| 363 |
\@eha |
| 364 |
\fi |
| 365 |
\else \expandafter\non@alpherr\fi |
| 366 |
#1{#4}% |
| 367 |
}% |
| 368 |
} |
| 369 |
%</2ekernel|latexrelease> |
| 370 |
%<latexrelease>\EndIncludeInRelease |
| 371 |
%<latexrelease>\IncludeInRelease{0000/00/00} |
| 372 |
%<latexrelease> {\select@group}{\select@group}% |
| 373 |
%<latexrelease>\def\select@group#1#2#3#4{% |
| 374 |
%<latexrelease> \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi |
| 375 |
%<latexrelease> {% |
| 376 |
%<latexrelease> \ifmmode |
| 377 |
%<latexrelease> \ifnum\csname c@mv@\math@version\endcsname<\sixt@@n |
| 378 |
%<latexrelease> \begingroup |
| 379 |
%<latexrelease> \escapechar\m@ne |
| 380 |
%<latexrelease> \getanddefine@fonts |
| 381 |
%<latexrelease> {\csname c@mv@\math@version\endcsname}#3% |
| 382 |
%<latexrelease> \globaldefs\@ne \math@fonts |
| 383 |
%<latexrelease> \endgroup |
| 384 |
%<latexrelease> \init@restore@version |
| 385 |
%<latexrelease> \xdef#1{\noexpand\use@mathgroup\noexpand#2% |
| 386 |
%<latexrelease> {\number\csname c@mv@\math@version\endcsname}}% |
| 387 |
%<latexrelease> \global\advance\csname c@mv@\math@version\endcsname\@ne |
| 388 |
%<latexrelease> \else |
| 389 |
%<latexrelease> \let#1\relax |
| 390 |
%<latexrelease> \@latex@error{Too many math alphabets used in |
| 391 |
%<latexrelease> version \math@version}% |
| 392 |
%<latexrelease> \@eha |
| 393 |
%<latexrelease> \fi |
| 394 |
%<latexrelease> \else \expandafter\non@alpherr\fi |
| 395 |
%<latexrelease> #1{#4}% |
| 396 |
%<latexrelease> }% |
| 397 |
%<latexrelease>} |
| 398 |
%<latexrelease>\EndIncludeInRelease |
| 399 |
%<*2ekernel> |
| 400 |
% \end{macrocode} |
| 401 |
% |
| 402 |
% \begin{macrocode} |
| 403 |
\@onlypreamble\restore@mathversion |
| 404 |
% \end{macrocode} |
| 405 |
% \end{macro} |
| 406 |
% |
| 407 |
% \begin{macro}{\init@restore@version} |
| 408 |
% \changes{v3.0e}{1996/07/26}{Removed \cs{ifrestore@version} switch |
| 409 |
% and replaced by \cs{init@restore@version}} |
| 410 |
% \begin{macrocode} |
| 411 |
\def\init@restore@version{% |
| 412 |
\global\let\init@restore@version\relax |
| 413 |
\xdef\restore@mathversion |
| 414 |
{\expandafter\noexpand\csname mv@\math@version\endcsname |
| 415 |
\global\csname c@mv@\math@version\endcsname |
| 416 |
\number\csname c@mv@\math@version\endcsname\relax}% |
| 417 |
\aftergroup\dorestore@version |
| 418 |
} |
| 419 |
\@onlypreamble\init@restore@version |
| 420 |
% \end{macrocode} |
| 421 |
% \end{macro} |
| 422 |
% |
| 423 |
% \begin{macro}{\non@alpherr} |
| 424 |
% \changes{v3.0c}{1995/10/10} |
| 425 |
% {(DPC) autoload error message} |
| 426 |
% \changes{v3.0j}{2005/07/27} |
| 427 |
% {(MH) Change because command is now properly robust} |
| 428 |
% \begin{macrocode} |
| 429 |
\gdef\non@alpherr#1{\@latex@error{% |
| 430 |
% \end{macrocode} |
| 431 |
% The command here will have a space at the end of its name, so we make |
| 432 |
% sure not to insert an extra one. |
| 433 |
% \begin{macrocode} |
| 434 |
\string#1allowed only in math mode}\@ehd} |
| 435 |
% \end{macrocode} |
| 436 |
% \end{macro} |
| 437 |
% |
| 438 |
% \begin{macro}{\dorestore@version} |
| 439 |
% \begin{macrocode} |
| 440 |
\def\dorestore@version |
| 441 |
{\ifmmode |
| 442 |
\aftergroup\dorestore@version |
| 443 |
\else |
| 444 |
\gdef\init@restore@version{% |
| 445 |
\global\let\init@restore@version\relax |
| 446 |
\xdef\restore@mathversion |
| 447 |
{\expandafter\noexpand\csname mv@\math@version\endcsname |
| 448 |
\global\csname c@mv@\math@version\endcsname |
| 449 |
\number\csname c@mv@\math@version\endcsname\relax}% |
| 450 |
\aftergroup\dorestore@version |
| 451 |
}% |
| 452 |
\begingroup |
| 453 |
\let\getanddefine@fonts\@gobbletwo |
| 454 |
\restore@mathversion |
| 455 |
\endgroup |
| 456 |
\fi}% |
| 457 |
\@onlypreamble\dorestore@version |
| 458 |
% \end{macrocode} |
| 459 |
% \end{macro} |
| 460 |
% |
| 461 |
% |
| 462 |
% |
| 463 |
% |
| 464 |
% \begin{macro}{\c@localmathalphabets} |
| 465 |
% \changes{v3.0x}{2021/09/26}{Counter added for (gh/676)} |
| 466 |
% To avoid hitting the ``no more math fams available'' limit of 16, we |
| 467 |
% keep a defined number of math alphabets flexible/local. If we have to |
| 468 |
% allocate any of those we roll back the allocation after the |
| 469 |
% formula has ended, so the next formula can use other alphabets in |
| 470 |
% the slot(s). This makes the processing a bit slower if you are |
| 471 |
% working at the limit, but that is better than dying with ``out of memory''. |
| 472 |
% \begin{macrocode} |
| 473 |
%</2ekernel> |
| 474 |
%<latexrelease>\IncludeInRelease{2021/11/15} |
| 475 |
%<latexrelease> {\document@select@group}{\document@select@group}% |
| 476 |
%<*2ekernel|latexrelease> |
| 477 |
% \end{macrocode} |
| 478 |
% We don't really undo the declaration on rollback (as that would |
| 479 |
% be hard to maintain), so rolling |
| 480 |
% forward needs to check if the declaration was already made. |
| 481 |
% \begin{macrocode} |
| 482 |
\ifx\c@localmathalphabets\@undefined |
| 483 |
% \end{macrocode} |
| 484 |
% There is no need to have this counter as part of the include |
| 485 |
% checkpoints, given that it makes little sense to alter its |
| 486 |
% settings mid document. All we want is the ability to change it |
| 487 |
% using the \cs{setcounter} interface. |
| 488 |
% |
| 489 |
% By default we keep two math fams flexible. |
| 490 |
% \begin{macrocode} |
| 491 |
\newcount\c@localmathalphabets |
| 492 |
\setcounter{localmathalphabets}{2} |
| 493 |
\fi |
| 494 |
% \end{macrocode} |
| 495 |
% \end{macro} |
| 496 |
% |
| 497 |
% |
| 498 |
% |
| 499 |
% |
| 500 |
% |
| 501 |
% \begin{macro}{\document@select@group} |
| 502 |
% The \cs{document@select@group} command is the version of |
| 503 |
% \cs{select@group} (inside math versions) that is used in the |
| 504 |
% document body to set up math alphabets (if used). |
| 505 |
% |
| 506 |
% \changes{v3.0g}{1997/11/20} |
| 507 |
% {(DPC) inline use of \cs{stepcounter} (faster, and saves a csname |
| 508 |
% per math version as no reset list)} |
| 509 |
% \changes{v3.0q}{2015/03/18}{Introduce \cs{e@mathgroup@top}} |
| 510 |
% \begin{macrocode} |
| 511 |
\def\document@select@group#1#2#3#4{% |
| 512 |
\ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi |
| 513 |
{% |
| 514 |
\ifmmode |
| 515 |
% \end{macrocode} |
| 516 |
% We first check if there is still room for allocating another |
| 517 |
% mathgroup. If there is, we check if it can be globally allocated |
| 518 |
% or if we have reached the limit which is given by |
| 519 |
% \cs{e@mathgroup@top} with \cs{c@localmathalphabets} subtracted. |
| 520 |
% |
| 521 |
% \changes{v3.0x}{2021/09/26}{Test if we should freeze the version (gh/676)} |
| 522 |
% \begin{macrocode} |
| 523 |
\ifnum\csname c@mv@\math@version\endcsname<\e@mathgroup@top |
| 524 |
\ifnum \numexpr\e@mathgroup@top-\c@localmathalphabets |
| 525 |
>\csname c@mv@\math@version\endcsname |
| 526 |
\else |
| 527 |
% \end{macrocode} |
| 528 |
% If we are past this point we freeze the current state of the math |
| 529 |
% version so that we can return to it after the formula has |
| 530 |
% ended. Of course, that should be done only once, so we check if |
| 531 |
% \cs{mv@\meta{version}@frozen} already exists. |
| 532 |
% \begin{macrocode} |
| 533 |
\ifcsname mv@\math@version @frozen\endcsname \else |
| 534 |
% \end{macrocode} |
| 535 |
% We have to pass the current value of \cs{math@version} not the |
| 536 |
% macro itself, because some of the processing is delayed to a |
| 537 |
% point where the value may have changed again---not doing this |
| 538 |
% caused a puzzling error in one setup. |
| 539 |
% \begin{macrocode} |
| 540 |
\expandafter\freeze@math@version\expandafter{\math@version}% |
| 541 |
\fi |
| 542 |
\fi |
| 543 |
\begingroup |
| 544 |
\escapechar\m@ne |
| 545 |
\getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3% |
| 546 |
\globaldefs\@ne \math@fonts |
| 547 |
\endgroup |
| 548 |
\expandafter\extract@alph@from@version |
| 549 |
\csname mv@\math@version\expandafter\endcsname |
| 550 |
\expandafter{\number\csname |
| 551 |
c@mv@\math@version\endcsname}% |
| 552 |
#1% |
| 553 |
\global\advance\csname c@mv@\math@version\endcsname\@ne |
| 554 |
\else |
| 555 |
\let#1\relax |
| 556 |
\@latex@error{Too many math alphabets used in |
| 557 |
version \math@version}% |
| 558 |
\@eha |
| 559 |
\fi |
| 560 |
% \end{macrocode} |
| 561 |
% Extra \cs{expandafter} to remove the \cs{expandafter} added below |
| 562 |
% \changes{v3.0w}{2021/02/15}{fix for (gh/501)} |
| 563 |
% \begin{macrocode} |
| 564 |
\else \expandafter\expandafter\expandafter\non@alpherr\fi |
| 565 |
% \end{macrocode} |
| 566 |
% We surround |\select@group| with braces so that functions using it |
| 567 |
% can be used directly after |_| or |^|. |
| 568 |
% \changes{v2.1p}{1994/12/10}{Surround with braces (add fourth arg)} |
| 569 |
% \changes{v2.1q}{1995/04/02}{fix problem for pr/1275} |
| 570 |
% |
| 571 |
% If the legacy interface is used, e.g., \verb=$\sf -1$= the math |
| 572 |
% alphabet \verb=#1= does not take an argument so we better do not |
| 573 |
% surround \verb=#4= with braces, because then we get |
| 574 |
% \verb={\relax}= into the formula and introduce an extra Ord |
| 575 |
% atom. The two different cases can be distinguished by looking at |
| 576 |
% the current value of \cs{math@bgroup}. |
| 577 |
% \changes{v3.0u}{2020/03/19}{fix for (gnats/3357)} |
| 578 |
% \begin{macrocode} |
| 579 |
\expandafter#1\ifx\math@bgroup\bgroup{#4}\else#4\fi |
| 580 |
}% |
| 581 |
} |
| 582 |
% \end{macrocode} |
| 583 |
% |
| 584 |
% \begin{macrocode} |
| 585 |
%</2ekernel|latexrelease> |
| 586 |
%<latexrelease>\EndIncludeInRelease |
| 587 |
%<latexrelease>\IncludeInRelease{2020/10/01} |
| 588 |
%<latexrelease> {\document@select@group}{\document@select@group}% |
| 589 |
%<latexrelease> |
| 590 |
%<latexrelease>\def\document@select@group#1#2#3#4{% |
| 591 |
%<latexrelease> \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi |
| 592 |
%<latexrelease> {% |
| 593 |
%<latexrelease> \ifmmode |
| 594 |
%<latexrelease> \ifnum\csname c@mv@\math@version\endcsname<\e@mathgroup@top |
| 595 |
%<latexrelease> \begingroup |
| 596 |
%<latexrelease> \escapechar\m@ne |
| 597 |
%<latexrelease> \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3% |
| 598 |
%<latexrelease> \globaldefs\@ne \math@fonts |
| 599 |
%<latexrelease> \endgroup |
| 600 |
%<latexrelease> \expandafter\extract@alph@from@version |
| 601 |
%<latexrelease> \csname mv@\math@version\expandafter\endcsname |
| 602 |
%<latexrelease> \expandafter{\number\csname |
| 603 |
%<latexrelease> c@mv@\math@version\endcsname}% |
| 604 |
%<latexrelease> #1% |
| 605 |
%<latexrelease> \global\advance\csname c@mv@\math@version\endcsname\@ne |
| 606 |
%<latexrelease> \else |
| 607 |
%<latexrelease> \let#1\relax |
| 608 |
%<latexrelease> \@latex@error{Too many math alphabets used |
| 609 |
%<latexrelease> in version \math@version}% |
| 610 |
%<latexrelease> \@eha |
| 611 |
%<latexrelease> \fi |
| 612 |
%<latexrelease> \else \expandafter\expandafter\expandafter\non@alpherr\fi |
| 613 |
%<latexrelease> \expandafter#1\ifx\math@bgroup\bgroup{#4}\else#4\fi |
| 614 |
%<latexrelease> }% |
| 615 |
%<latexrelease>} |
| 616 |
%<latexrelease>\EndIncludeInRelease |
| 617 |
%<latexrelease>\IncludeInRelease{2015/01/01} |
| 618 |
%<latexrelease> {\document@select@group}{\document@select@group}% |
| 619 |
%<latexrelease> |
| 620 |
%<latexrelease>\def\document@select@group#1#2#3#4{% |
| 621 |
%<latexrelease> \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi |
| 622 |
%<latexrelease> {% |
| 623 |
%<latexrelease> \ifmmode |
| 624 |
%<latexrelease> \ifnum\csname c@mv@\math@version\endcsname<\e@mathgroup@top |
| 625 |
%<latexrelease> \begingroup |
| 626 |
%<latexrelease> \escapechar\m@ne |
| 627 |
%<latexrelease> \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3% |
| 628 |
%<latexrelease> \globaldefs\@ne \math@fonts |
| 629 |
%<latexrelease> \endgroup |
| 630 |
%<latexrelease> \expandafter\extract@alph@from@version |
| 631 |
%<latexrelease> \csname mv@\math@version\expandafter\endcsname |
| 632 |
%<latexrelease> \expandafter{\number\csname |
| 633 |
%<latexrelease> c@mv@\math@version\endcsname}% |
| 634 |
%<latexrelease> #1% |
| 635 |
%<latexrelease> \global\advance\csname c@mv@\math@version\endcsname\@ne |
| 636 |
%<latexrelease> \else |
| 637 |
%<latexrelease> \let#1\relax |
| 638 |
%<latexrelease> \@latex@error{Too many math alphabets used |
| 639 |
%<latexrelease> in version \math@version}% |
| 640 |
%<latexrelease> \@eha |
| 641 |
%<latexrelease> \fi |
| 642 |
%<latexrelease> \else \expandafter\non@alpherr\fi |
| 643 |
%<latexrelease> #1{#4}% |
| 644 |
%<latexrelease> }% |
| 645 |
%<latexrelease>} |
| 646 |
%<latexrelease>\EndIncludeInRelease |
| 647 |
%<latexrelease> |
| 648 |
%<latexrelease>\IncludeInRelease{0000/00/00} |
| 649 |
%<latexrelease> {\document@select@group}{\document@select@group}% |
| 650 |
%<latexrelease> |
| 651 |
%<latexrelease>\def\document@select@group#1#2#3#4{% |
| 652 |
%<latexrelease> \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi |
| 653 |
%<latexrelease> {% |
| 654 |
%<latexrelease> \ifmmode |
| 655 |
%<latexrelease> \ifnum\csname c@mv@\math@version\endcsname<\sixt@@n |
| 656 |
%<latexrelease> \begingroup |
| 657 |
%<latexrelease> \escapechar\m@ne |
| 658 |
%<latexrelease> \getanddefine@fonts |
| 659 |
%<latexrelease> {\csname c@mv@\math@version\endcsname}#3% |
| 660 |
%<latexrelease> \globaldefs\@ne \math@fonts |
| 661 |
%<latexrelease> \endgroup |
| 662 |
%<latexrelease> \expandafter\extract@alph@from@version |
| 663 |
%<latexrelease> \csname mv@\math@version\expandafter\endcsname |
| 664 |
%<latexrelease> \expandafter{\number\csname |
| 665 |
%<latexrelease> c@mv@\math@version\endcsname}% |
| 666 |
%<latexrelease> #1% |
| 667 |
%<latexrelease> \global\advance\csname c@mv@\math@version\endcsname\@ne |
| 668 |
%<latexrelease> \else |
| 669 |
%<latexrelease> \let#1\relax |
| 670 |
%<latexrelease> \@latex@error{Too many math alphabets used |
| 671 |
%<latexrelease> in version \math@version}% |
| 672 |
%<latexrelease> \@eha |
| 673 |
%<latexrelease> \fi |
| 674 |
%<latexrelease> \else \expandafter\non@alpherr\fi |
| 675 |
%<latexrelease> #1{#4}% |
| 676 |
%<latexrelease> }% |
| 677 |
%<latexrelease>} |
| 678 |
%<latexrelease>\EndIncludeInRelease |
| 679 |
%<*2ekernel> |
| 680 |
% \end{macrocode} |
| 681 |
% \end{macro} |
| 682 |
% |
| 683 |
% |
| 684 |
% |
| 685 |
% |
| 686 |
% \begin{macro}{\freeze@math@version} |
| 687 |
% \changes{v3.0x}{2021/09/26}{Macro added for (gh/676)} |
| 688 |
% \changes{v3.1a}{2022/09/17}{New logic for freezing math versions (gh/921)} |
| 689 |
% This command stores the current state of the math version and sets |
| 690 |
% things up to return to it after each formula from now on. We use |
| 691 |
% L3 programming layer code to set it up. |
| 692 |
% \begin{macrocode} |
| 693 |
%</2ekernel> |
| 694 |
%<*2ekernel|latexrelease> |
| 695 |
%<latexrelease>\IncludeInRelease{2022/11/01}% |
| 696 |
%<latexrelease> {\freeze@math@version}{freeze math version}% |
| 697 |
\ExplSyntaxOn |
| 698 |
\cs_new_protected:Npn\freeze@math@version #1 { |
| 699 |
% \end{macrocode} |
| 700 |
% Save the current \cs{mv@\meta{version}} code and the number of |
| 701 |
% allocated mathgroups inside. |
| 702 |
% \begin{macrocode} |
| 703 |
\@font@info{Freeze~ math~ alphabet~ allocation~ in~ version~ |
| 704 |
#1.\MessageBreak |
| 705 |
Allocated~math~groups:~\int_use:c{ c@mv@ #1 }~ |
| 706 |
(local:~ \int_use:N\c@localmathalphabets) } |
| 707 |
\cs_gset_eq:cc { mv@#1@frozen }{ mv@#1 } |
| 708 |
\tl_gset:cx { g__nfss_frozen_mv_ #1 _tl }{ \int_use:c { c@mv@#1 } } |
| 709 |
% \end{macrocode} |
| 710 |
% Here is the definition of \cs{mv@\meta{version}@reset}. If there |
| 711 |
% has been no new math alphabet allocation, doing a reset would |
| 712 |
% just cause a lot of unnecessary processing, so we do a quick |
| 713 |
% check upfront for this. |
| 714 |
% \begin{macrocode} |
| 715 |
\cs_gset:cpn{mv@#1@reset} |
| 716 |
{ |
| 717 |
% \end{macrocode} |
| 718 |
% If we are back at top-level, or more precisely outside of any |
| 719 |
% (nested) math, we may have to reset the math version back to its |
| 720 |
% frozen version, if that exists and has fewer alphabets allocated. |
| 721 |
% \changes{v3.1d}{2024/11/27}{Reset math version if necessary (gh/1101 and gh/1028)} |
| 722 |
% \begin{macrocode} |
| 723 |
\int_compare:nNnTF \@math@level = 0 |
| 724 |
{ |
| 725 |
\int_compare:nNnTF { \int_use:c{c@mv@#1} } > |
| 726 |
{ \tl_use:c{g__nfss_frozen_mv_ #1 _tl} } |
| 727 |
{ |
| 728 |
\@font@info{ Undo~ math~ alphabet~ allocation~ in~ version~ #1 } |
| 729 |
% \end{macrocode} |
| 730 |
% If the undo is necessary, we restore the \cs{mv@\meta{version}} code. |
| 731 |
% \begin{macrocode} |
| 732 |
\cs_gset_eq:cc { mv@#1 }{ mv@#1@frozen } |
| 733 |
\int_gset:cn { c@mv@#1 }{ \tl_use:c {g__nfss_frozen_mv_ #1 _tl} } |
| 734 |
% \end{macrocode} |
| 735 |
% But we also should undo changes to the top-level math alphabet |
| 736 |
% definitions. We therefore run this code with a modified |
| 737 |
% definition for \cs{getanddefine@fonts} because there is no need |
| 738 |
% to do anything to the symbol fonts that are permanently allocated. |
| 739 |
% However, we do this only if the resetting was for the current |
| 740 |
% math version, because otherwise we would give the top-level |
| 741 |
% definitions the values for the last math version being resetted |
| 742 |
% (e.g., bold if there are just two). |
| 743 |
% \changes{v3.1d}{2024/11/27}{Reset top-level alphabet definitions |
| 744 |
% only for the current math version (gh/1101 and gh/1028)} |
| 745 |
% \begin{macrocode} |
| 746 |
\tl_if_eq:NnTF \math@version {#1} |
| 747 |
{ |
| 748 |
\group_begin: |
| 749 |
\cs_set_eq:NN \getanddefine@fonts \use_none:nn |
| 750 |
\use:c {mv@ \math@version } |
| 751 |
\group_end: |
| 752 |
} |
| 753 |
{ |
| 754 |
% \end{macrocode} |
| 755 |
% Once we have hit the boundary and have to revert to the frozen |
| 756 |
% version that happens quite often, but typically only for the |
| 757 |
% normal version. Thus, it is better to report only when we do not |
| 758 |
% revert the top-level definition as this is the exceptional case |
| 759 |
% and happens only if several math versions are used in parallel. |
| 760 |
% \begin{macrocode} |
| 761 |
\@font@info{ ...~ but~ do~ not~ reset~ the~ |
| 762 |
top-level~ math~ alphabet~ definitions } |
| 763 |
} |
| 764 |
} |
| 765 |
{ |
| 766 |
% \end{macrocode} |
| 767 |
% If there was no change, we report that in the log (but this |
| 768 |
% branch could go completely). |
| 769 |
% \begin{macrocode} |
| 770 |
\@font@info{ No~ math~ alphabet~ change~ |
| 771 |
to~ frozen~ version~ #1 } |
| 772 |
} |
| 773 |
} |
| 774 |
{ |
| 775 |
\@font@info{ Nested~ math:~ keeping~ math~ alphabet~ |
| 776 |
allocation~ in~ version~ #1} |
| 777 |
} |
| 778 |
% \end{macrocode} |
| 779 |
% If this is executed after a math display, we may have to arrange |
| 780 |
% for ignoring spaces, because they are now hidden if |
| 781 |
% the tokens from above intervene. This is signaled by the 2e |
| 782 |
% switch \texttt{@ignore} which is set in \cs{frozen@everymath} and |
| 783 |
% \cs{frozen@everydisplay}. |
| 784 |
% |
| 785 |
% This is all 2e code so we use that syntax. |
| 786 |
% \changes{v3.0z}{2022/07/04}{Ignore spaces if necessary (gh/886)} |
| 787 |
% \begin{macrocode} |
| 788 |
\if@ignore \ignorespaces \fi |
| 789 |
} |
| 790 |
} |
| 791 |
\ExplSyntaxOff |
| 792 |
%</2ekernel|latexrelease> |
| 793 |
%<latexrelease>\EndIncludeInRelease |
| 794 |
%<latexrelease>\IncludeInRelease{2021/11/15} |
| 795 |
%<latexrelease> {\freeze@math@version}{freeze math version}% |
| 796 |
%<latexrelease> |
| 797 |
%<latexrelease>\ExplSyntaxOn |
| 798 |
%<latexrelease>\cs_set_protected:Npn\freeze@math@version #1 { |
| 799 |
%<latexrelease> \@font@info{Freeze~ math~ alphabet~ allocation~ in~ version~ |
| 800 |
%<latexrelease> #1.\MessageBreak |
| 801 |
%<latexrelease> Allocated~math~groups:~\int_use:c{ c@mv@ #1 }~ |
| 802 |
%<latexrelease> (local:~ \int_use:N\c@localmathalphabets) } |
| 803 |
%<latexrelease> \cs_gset_eq:cc { mv@#1@frozen }{ mv@#1 } |
| 804 |
%<latexrelease> \tl_gset:cx { g__nfss_frozen_mv_ #1 _tl }{ \int_use:c { c@mv@#1 } } |
| 805 |
%<latexrelease> \group_insert_after:N \__nfss_init_mv_freeze:N |
| 806 |
%<latexrelease> \exp_after:wN \group_insert_after:N \cs:w mv@#1@reset \cs_end: |
| 807 |
%<latexrelease> \tl_gput_right:No \check@mathfonts |
| 808 |
%<latexrelease> { |
| 809 |
%<latexrelease> \exp_after:wN \group_insert_after:N \cs:w mv@#1@reset \cs_end: |
| 810 |
%<latexrelease> } |
| 811 |
%<latexrelease> \cs_gset:cpn{mv@#1@reset} |
| 812 |
%<latexrelease> { |
| 813 |
%<latexrelease> \int_compare:nNnTF { \int_use:c{c@mv@#1} } > |
| 814 |
%<latexrelease> { \tl_use:c{g__nfss_frozen_mv_ #1 _tl} } |
| 815 |
%<latexrelease> { |
| 816 |
%<latexrelease> \@font@info{Undo~ math~ alphabet~ allocation~ in~ version~ #1} |
| 817 |
%<latexrelease> \cs_gset_eq:cc { mv@#1 }{ mv@#1@frozen } |
| 818 |
%<latexrelease> \int_gset:cn { c@mv@#1 }{ \tl_use:c {g__nfss_frozen_mv_ #1 _tl} } |
| 819 |
%<latexrelease> \group_begin: |
| 820 |
%<latexrelease> \cs_set_eq:NN \getanddefine@fonts \use_none:nn |
| 821 |
%<latexrelease> \use:c {mv@#1} |
| 822 |
%<latexrelease> \group_end: |
| 823 |
%<latexrelease> } |
| 824 |
%<latexrelease> { |
| 825 |
%<latexrelease> \@font@info{No~ math~ alphabet~ change~ to~ frozen~ version~ #1} |
| 826 |
%<latexrelease> } |
| 827 |
%<latexrelease> \if@ignore \ignorespaces \fi |
| 828 |
%<latexrelease> } |
| 829 |
%<latexrelease>} |
| 830 |
%<latexrelease>\cs_set_protected:Npn \__nfss_init_mv_freeze:N #1 {% |
| 831 |
%<latexrelease> \mode_if_math:T { \group_insert_after:N \__nfss_init_mv_freeze:N |
| 832 |
%<latexrelease> \group_insert_after:N } #1 |
| 833 |
%<latexrelease>} |
| 834 |
%<latexrelease>\ExplSyntaxOff |
| 835 |
%<latexrelease> |
| 836 |
%<latexrelease>\EndIncludeInRelease |
| 837 |
%<*2ekernel> |
| 838 |
% \end{macrocode} |
| 839 |
% \end{macro} |
| 840 |
% |
| 841 |
% |
| 842 |
% \begin{macro}{\process@table} |
| 843 |
% \begin{macrocode} |
| 844 |
%</2ekernel> |
| 845 |
%<*2ekernel|latexrelease> |
| 846 |
%<latexrelease>\IncludeInRelease{2025/11/01}% |
| 847 |
%<latexrelease> {\process@table}{Support metafamily}% |
| 848 |
\def\process@table{% |
| 849 |
\def\cdp@elt##1##2##3##4{% |
| 850 |
\@font@info{Checking defaults for |
| 851 |
##1/##2/##3/##4}% |
| 852 |
\expandafter |
| 853 |
\ifx\csname##1/##2/##3/##4\endcsname\relax |
| 854 |
% \end{macrocode} |
| 855 |
% Grouping is important for two reasons, first |\cdp@elt| will get |
| 856 |
% redefined if |\Declare...| functions are executed within the |
| 857 |
% external |.fd| file and secondly |\try@load@fontshape| changes a |
| 858 |
% lot of catcodes without surrounding itself with a group. |
| 859 |
% \begin{macrocode} |
| 860 |
\begingroup |
| 861 |
\def\f@encoding{##1}\def\f@family{##2}% |
| 862 |
\try@load@fontshape |
| 863 |
\endgroup |
| 864 |
\fi |
| 865 |
\expandafter |
| 866 |
\ifx\csname##1/##2/##3/##4\endcsname\relax |
| 867 |
\@latex@error{This NFSS system isn't set up properly}% |
| 868 |
{For encoding scheme ##1 the defaults |
| 869 |
##2/##3/##4 do not form a valid font shape}% |
| 870 |
\else |
| 871 |
\@font@info{... okay}% |
| 872 |
\fi}% |
| 873 |
\cdp@list |
| 874 |
% \end{macrocode} |
| 875 |
% Now we make sure that |\error@fontshape| is okay. |
| 876 |
% \begin{macrocode} |
| 877 |
\begingroup |
| 878 |
\escapechar\m@ne |
| 879 |
\error@fontshape |
| 880 |
\expandafter\ifx\csname \curr@fontshape\endcsname\relax |
| 881 |
\begingroup |
| 882 |
\try@load@fontshape |
| 883 |
\endgroup |
| 884 |
\fi |
| 885 |
\expandafter\ifx\csname \curr@fontshape\endcsname\relax |
| 886 |
\@latex@error{This NFSS system isn't set up properly}% |
| 887 |
{The system maintainer forgot to specify a suitable |
| 888 |
substitution |
| 889 |
font shape using the \noexpand\DeclareErrorFont |
| 890 |
command}% |
| 891 |
\fi |
| 892 |
\endgroup |
| 893 |
% \end{macrocode} |
| 894 |
% Set |\select@group| to its meaning used within the document body. |
| 895 |
% \begin{macrocode} |
| 896 |
\let\select@group\document@select@group |
| 897 |
% \end{macrocode} |
| 898 |
% Install the default font attributes as they are currently pointing |
| 899 |
% to error font face. We can speed up the process by just using |
| 900 |
% \cs{edef}, thereby avoiding all kind of extra processing. |
| 901 |
% Don't use |\reset@font| for this since that would trigger |
| 902 |
% |\selectfont|, but run the \texttt{normalfont} hook, since this |
| 903 |
% is really what we are doing here (except for the |
| 904 |
% \cs{selectfont}=. |
| 905 |
% \changes{v3.0v}{2020/04/13}{Small update for speed.} |
| 906 |
% \begin{macrocode} |
| 907 |
\fontencoding\encodingdefault |
| 908 |
\edef\f@family{\familydefault}% |
| 909 |
\edef\f@series{\seriesdefault}% |
| 910 |
\edef\f@shape{\shapedefault}% |
| 911 |
% \end{macrocode} |
| 912 |
% \changes{v3.1e}{2025/09/15}{Run \cs{set@current@meta@family} and the |
| 913 |
% \texttt{normalfont} hook} |
| 914 |
% \begin{macrocode} |
| 915 |
\set@current@meta@family |
| 916 |
\UseHook{normalfont}% |
| 917 |
% \end{macrocode} |
| 918 |
% Drop stuff not longer needed. |
| 919 |
% \begin{macrocode} |
| 920 |
\everyjob{}% |
| 921 |
} |
| 922 |
%</2ekernel|latexrelease> |
| 923 |
%<latexrelease>\EndIncludeInRelease |
| 924 |
% \end{macrocode} |
| 925 |
% |
| 926 |
% \begin{macrocode} |
| 927 |
%<latexrelease>\IncludeInRelease{0000/00/00}% |
| 928 |
%<latexrelease> {\process@table}{Support metafamily}% |
| 929 |
%<latexrelease> |
| 930 |
%<latexrelease>\def\process@table{% |
| 931 |
%<latexrelease> \def\cdp@elt##1##2##3##4{% |
| 932 |
%<latexrelease> \@font@info{Checking defaults for |
| 933 |
%<latexrelease> ##1/##2/##3/##4}% |
| 934 |
%<latexrelease> \expandafter |
| 935 |
%<latexrelease> \ifx\csname##1/##2/##3/##4\endcsname\relax |
| 936 |
%<latexrelease> \begingroup |
| 937 |
%<latexrelease> \def\f@encoding{##1}\def\f@family{##2}% |
| 938 |
%<latexrelease> \try@load@fontshape |
| 939 |
%<latexrelease> \endgroup |
| 940 |
%<latexrelease> \fi |
| 941 |
%<latexrelease> \expandafter |
| 942 |
%<latexrelease> \ifx\csname##1/##2/##3/##4\endcsname\relax |
| 943 |
%<latexrelease> \@latex@error{This NFSS system isn't set up properly}% |
| 944 |
%<latexrelease> {For encoding scheme ##1 the defaults |
| 945 |
%<latexrelease> ##2/##3/##4 do not form a valid font shape}% |
| 946 |
%<latexrelease> \else |
| 947 |
%<latexrelease> \@font@info{... okay}% |
| 948 |
%<latexrelease> \fi}% |
| 949 |
%<latexrelease> \cdp@list |
| 950 |
%<latexrelease> \begingroup |
| 951 |
%<latexrelease> \escapechar\m@ne |
| 952 |
%<latexrelease> \error@fontshape |
| 953 |
%<latexrelease> \expandafter\ifx\csname \curr@fontshape\endcsname\relax |
| 954 |
%<latexrelease> \begingroup |
| 955 |
%<latexrelease> \try@load@fontshape |
| 956 |
%<latexrelease> \endgroup |
| 957 |
%<latexrelease> \fi |
| 958 |
%<latexrelease> \expandafter\ifx\csname \curr@fontshape\endcsname\relax |
| 959 |
%<latexrelease> \@latex@error{This NFSS system isn't set up properly}% |
| 960 |
%<latexrelease> {The system maintainer forgot to specify a suitable |
| 961 |
%<latexrelease> substitution |
| 962 |
%<latexrelease> font shape using the \noexpand\DeclareErrorFont |
| 963 |
%<latexrelease> command}% |
| 964 |
%<latexrelease> \fi |
| 965 |
%<latexrelease> \endgroup |
| 966 |
%<latexrelease> \let\select@group\document@select@group |
| 967 |
%<latexrelease> \fontencoding\encodingdefault |
| 968 |
%<latexrelease> \edef\f@family{\familydefault}% |
| 969 |
%<latexrelease> \edef\f@series{\seriesdefault}% |
| 970 |
%<latexrelease> \edef\f@shape{\shapedefault}% |
| 971 |
%<latexrelease> \everyjob{}% |
| 972 |
%<latexrelease>} |
| 973 |
%<latexrelease>\EndIncludeInRelease |
| 974 |
%<*2ekernel> |
| 975 |
% \end{macrocode} |
| 976 |
% |
| 977 |
% \begin{macrocode} |
| 978 |
\@onlypreamble\process@table |
| 979 |
% \end{macrocode} |
| 980 |
% \end{macro} |
| 981 |
% |
| 982 |
% \begin{macrocode} |
| 983 |
%\@onlypreamble\set@mathradical |
| 984 |
% \end{macrocode} |
| 985 |
% |
| 986 |
% \begin{macro}{\DeclareMathVersion} |
| 987 |
% \begin{macrocode} |
| 988 |
%</2ekernel> |
| 989 |
%<*2ekernel|latexrelease> |
| 990 |
%<latexrelease>\IncludeInRelease{2022/11/01}% |
| 991 |
%<latexrelease> {\DeclareMathVersion}{local alphabets}% |
| 992 |
\def\DeclareMathVersion#1{% |
| 993 |
% \end{macrocode} |
| 994 |
% When declaring a new math version we need to instantiate an L3 |
| 995 |
% variable that is used when we freeze the version, because too many |
| 996 |
% alphabets got allocated. If we don't do this, L3 programming layer |
| 997 |
% complains if it is run in checking mode. |
| 998 |
% \changes{v3.0y}{2021/10/15}{Initialize variable for freezing |
| 999 |
% math version (gh/676)} |
| 1000 |
% \begin{macrocode} |
| 1001 |
\@namedef{g__nfss_frozen_mv_#1_tl}{}% |
| 1002 |
% \end{macrocode} |
| 1003 |
% We also extend \cs{check@mathfonts} to call a version reset (once |
| 1004 |
% frozen) after a formula has finished. |
| 1005 |
% \changes{v3.1a}{2022/09/17}{New logic for freezing math versions (gh/921)} |
| 1006 |
% \begin{macrocode} |
| 1007 |
\expandafter\ifx\csname mv@#1\endcsname \relax |
| 1008 |
\expandafter \g@addto@macro \expandafter \check@mathfonts |
| 1009 |
\expandafter {\expandafter \aftergroup \csname mv@#1@reset\endcsname}% |
| 1010 |
% \end{macrocode} |
| 1011 |
% Initially this macro does nothing. It is, however, important that |
| 1012 |
% it doesn't stop any \cs{ignorespaces}, so we make it expandable |
| 1013 |
% and not \cs{relax}. |
| 1014 |
% \begin{macrocode} |
| 1015 |
\@namedef{mv@#1@reset}{}% |
| 1016 |
\fi |
| 1017 |
% \end{macrocode} |
| 1018 |
% |
| 1019 |
% \begin{macrocode} |
| 1020 |
\expandafter\new@mathversion\csname mv@#1\endcsname} |
| 1021 |
\@onlypreamble\DeclareMathVersion |
| 1022 |
%</2ekernel|latexrelease> |
| 1023 |
%<latexrelease>\EndIncludeInRelease |
| 1024 |
% \end{macrocode} |
| 1025 |
% |
| 1026 |
% \begin{macrocode} |
| 1027 |
%<latexrelease>\IncludeInRelease{2021/11/15}% |
| 1028 |
%<latexrelease> {\DeclareMathVersion}{local alphabets}% |
| 1029 |
%<latexrelease>\def\DeclareMathVersion#1{% |
| 1030 |
%<latexrelease> \@namedef{g__nfss_frozen_mv_#1_tl}{}% |
| 1031 |
%<latexrelease> \expandafter\new@mathversion\csname mv@#1\endcsname} |
| 1032 |
%<latexrelease>\EndIncludeInRelease |
| 1033 |
%<latexrelease>\IncludeInRelease{0000/00/00}% |
| 1034 |
%<latexrelease> {\DeclareMathVersion}{local alphabets}% |
| 1035 |
%<latexrelease>\def\DeclareMathVersion#1{% |
| 1036 |
%<latexrelease> \expandafter\new@mathversion\csname mv@#1\endcsname} |
| 1037 |
%<latexrelease>\EndIncludeInRelease |
| 1038 |
%<*2ekernel> |
| 1039 |
% \end{macrocode} |
| 1040 |
% \end{macro} |
| 1041 |
% |
| 1042 |
% \begin{macro}{\new@mathversion} |
| 1043 |
% \changes{v3.0o}{2011/09/03} |
| 1044 |
% {(Will) Remove \cs{global} before \cs{newcount} (unnecessary and caused etex bug).} |
| 1045 |
% \begin{macrocode} |
| 1046 |
\def\new@mathversion#1{% |
| 1047 |
\expandafter\in@\expandafter#1\expandafter{\version@list}% |
| 1048 |
\ifin@ |
| 1049 |
\@font@info{Redeclaring math version |
| 1050 |
`\expandafter\@gobblefour\string#1'}% |
| 1051 |
\else |
| 1052 |
\expandafter\newcount\csname c@\expandafter |
| 1053 |
\@gobble\string#1\endcsname |
| 1054 |
\def\version@elt{\noexpand\version@elt\noexpand}% |
| 1055 |
\edef\version@list{\version@list\version@elt#1}% |
| 1056 |
\fi |
| 1057 |
% \end{macrocode} |
| 1058 |
% |\toks@| is used to gather all tokens for the math version. |
| 1059 |
% |\count@| will be used to count the math groups we add to this |
| 1060 |
% version. |
| 1061 |
% \begin{macrocode} |
| 1062 |
\toks@{}% |
| 1063 |
\count@\z@ |
| 1064 |
% \end{macrocode} |
| 1065 |
% Now we loop over |\group@list| to add all math groups defined so |
| 1066 |
% far to the version and at the same time to count them. |
| 1067 |
% \begin{macrocode} |
| 1068 |
\def\group@elt##1##2{% |
| 1069 |
\advance\count@\@ne |
| 1070 |
\addto@hook\toks@{\getanddefine@fonts##1##2}% |
| 1071 |
}% |
| 1072 |
\group@list |
| 1073 |
% \end{macrocode} |
| 1074 |
% We set the counter for this math version to the number of math |
| 1075 |
% groups found in |\group@list|. |
| 1076 |
% \begin{macrocode} |
| 1077 |
\global\csname c@\expandafter\@gobble\string#1\endcsname\count@ |
| 1078 |
% \end{macrocode} |
| 1079 |
% Now we loop over |\alpha@list| to add all math alphabets known so |
| 1080 |
% far. We have to distinguish the case that an alphabet by default |
| 1081 |
% should produce an error in new versions. |
| 1082 |
% \begin{macrocode} |
| 1083 |
\def\alpha@elt##1##2##3{% |
| 1084 |
\ifx##2\no@alphabet@error |
| 1085 |
\toks@\expandafter{\the\toks@\install@mathalphabet##1% |
| 1086 |
{\no@alphabet@error##1}}% |
| 1087 |
\else |
| 1088 |
\toks@\expandafter{\the\toks@\install@mathalphabet##1% |
| 1089 |
{\select@group##1##2##3}}% |
| 1090 |
\fi |
| 1091 |
}% |
| 1092 |
\alpha@list |
| 1093 |
% \end{macrocode} |
| 1094 |
% Finally we define the math version to expand to the contents of |
| 1095 |
% |\toks@|. |
| 1096 |
% \changes{v2.0e}{1993/08/18}{Exchanged names of encodings in warning |
| 1097 |
% message of \cs{SetSymbolFont}.} |
| 1098 |
% \begin{macrocode} |
| 1099 |
\xdef#1{\the\toks@}% |
| 1100 |
} |
| 1101 |
\@onlypreamble\new@mathversion |
| 1102 |
% \end{macrocode} |
| 1103 |
% \end{macro} |
| 1104 |
% |
| 1105 |
% \begin{macro}{\DeclareSymbolFont} |
| 1106 |
% First drop any surplus \texttt{m} from the series argument then |
| 1107 |
% do what has been done since 1994. |
| 1108 |
% \changes{v3.1b}{2022/09/20}{Drop any surplus 'm' in series argument (gh/918)} |
| 1109 |
% \begin{macrocode} |
| 1110 |
%</2ekernel> |
| 1111 |
%<*2ekernel|latexrelease> |
| 1112 |
%<latexrelease>\IncludeInRelease{2022/11/01}% |
| 1113 |
%<latexrelease> {\DeclareSymbolFont}{maybe drop m}% |
| 1114 |
\def\DeclareSymbolFont #1#2#3#4#5{% |
| 1115 |
\def\reserved@a{\DeclareSymbolFont@m@dropped{#1}{#2}{#3}}% |
| 1116 |
\edef\reserved@b{#4}% |
| 1117 |
\series@maybe@drop@one@m\reserved@b\reserved@b |
| 1118 |
\expandafter\reserved@a\expandafter{\reserved@b}{#5}% |
| 1119 |
} |
| 1120 |
% \end{macrocode} |
| 1121 |
% |
| 1122 |
% \begin{macrocode} |
| 1123 |
\def\DeclareSymbolFont@m@dropped #1#2#3#4#5{% |
| 1124 |
\@tempswafalse |
| 1125 |
\edef\reserved@b{#2}% |
| 1126 |
\def\cdp@elt##1##2##3##4{\def\reserved@c{##1}% |
| 1127 |
\ifx\reserved@b\reserved@c \@tempswatrue\fi}% |
| 1128 |
\cdp@list |
| 1129 |
\if@tempswa |
| 1130 |
\@ifundefined{sym#1}{% |
| 1131 |
% \end{macrocode} |
| 1132 |
% |
| 1133 |
% \changes{v3.0q}{2015/03/18}{Restrict Symbol fonts to 0-15} |
| 1134 |
% \begin{macrocode} |
| 1135 |
\ifnum\count18<15 % |
| 1136 |
\expandafter\new@mathgroup\csname sym#1\endcsname |
| 1137 |
\expandafter\new@symbolfont\csname sym#1\endcsname |
| 1138 |
{#2}{#3}{#4}{#5}% |
| 1139 |
\else |
| 1140 |
\@latex@error{Too many symbol fonts declared}\@eha |
| 1141 |
\fi |
| 1142 |
}% |
| 1143 |
{% |
| 1144 |
% \end{macrocode} |
| 1145 |
% |
| 1146 |
% \begin{macrocode} |
| 1147 |
\@font@info{Redeclaring symbol font `#1'}% |
| 1148 |
% \end{macrocode} |
| 1149 |
% \changes{v3.0f}{1997/11/13} |
| 1150 |
% {(DPC) Really update \cs{group@list} don't |
| 1151 |
% leave new version in \cs{toks@}. latex/2661} |
| 1152 |
% Update the group list. |
| 1153 |
% \begin{macrocode} |
| 1154 |
\def\group@elt##1##2{% |
| 1155 |
\noexpand\group@elt\noexpand##1% |
| 1156 |
\expandafter\ifx\csname sym#1\endcsname##1% |
| 1157 |
\expandafter\noexpand\csname#2/#3/#4/#5\endcsname |
| 1158 |
\else |
| 1159 |
\noexpand##2% |
| 1160 |
\fi}% |
| 1161 |
\xdef\group@list{\group@list}% |
| 1162 |
% \end{macrocode} |
| 1163 |
% Update the version list. |
| 1164 |
% \begin{macrocode} |
| 1165 |
\def\version@elt##1{% |
| 1166 |
\expandafter |
| 1167 |
\SetSymbolFont@\expandafter##1\csname#2/#3/#4/#5\expandafter |
| 1168 |
\endcsname \csname sym#1\endcsname |
| 1169 |
}% |
| 1170 |
\version@list |
| 1171 |
}% |
| 1172 |
\else |
| 1173 |
\@latex@error{Encoding scheme `#2' unknown}\@eha |
| 1174 |
\fi |
| 1175 |
} |
| 1176 |
\@onlypreamble\DeclareSymbolFont |
| 1177 |
%</2ekernel|latexrelease> |
| 1178 |
%<latexrelease>\EndIncludeInRelease |
| 1179 |
%<latexrelease>\IncludeInRelease{0000/00/00}% |
| 1180 |
%<latexrelease> {\DeclareSymbolFont}{maybe drop m}% |
| 1181 |
%<latexrelease> |
| 1182 |
%<latexrelease>\let\DeclareSymbolFont\DeclareSymbolFont@m@dropped |
| 1183 |
%<latexrelease>\let\DeclareSymbolFont@m@dropped\@undefined |
| 1184 |
%<latexrelease> |
| 1185 |
%<latexrelease>\EndIncludeInRelease |
| 1186 |
%<*2ekernel> |
| 1187 |
% \end{macrocode} |
| 1188 |
% \end{macro} |
| 1189 |
% |
| 1190 |
% \begin{macro}{\group@list} |
| 1191 |
% \begin{macrocode} |
| 1192 |
\let\group@list\@empty |
| 1193 |
\@onlypreamble\group@list |
| 1194 |
% \end{macrocode} |
| 1195 |
% \end{macro} |
| 1196 |
% |
| 1197 |
% \begin{macro}{\group@elt} |
| 1198 |
% \begin{macrocode} |
| 1199 |
\let\group@elt\relax |
| 1200 |
\@onlypreamble\group@elt |
| 1201 |
% \end{macrocode} |
| 1202 |
% \end{macro} |
| 1203 |
% |
| 1204 |
% \begin{macro}{\new@symbolfont} |
| 1205 |
% \begin{macrocode} |
| 1206 |
\def\new@symbolfont#1#2#3#4#5{% |
| 1207 |
\toks@\expandafter{\group@list}% |
| 1208 |
\edef\group@list{\the\toks@\noexpand\group@elt\noexpand#1% |
| 1209 |
\expandafter\noexpand\csname#2/#3/#4/#5\endcsname}% |
| 1210 |
\def\version@elt##1{\toks@\expandafter{##1}% |
| 1211 |
\edef##1{\the\toks@\noexpand\getanddefine@fonts |
| 1212 |
#1\expandafter\noexpand\csname#2/#3/#4/#5\endcsname}% |
| 1213 |
\global\advance\csname c@\expandafter |
| 1214 |
\@gobble\string##1\endcsname\@ne |
| 1215 |
}% |
| 1216 |
\version@list |
| 1217 |
} |
| 1218 |
\@onlypreamble\new@symbolfont |
| 1219 |
% \end{macrocode} |
| 1220 |
% \end{macro} |
| 1221 |
% |
| 1222 |
% \begin{macro}{\SetSymbolFont} |
| 1223 |
% First drop any surplus \texttt{m} from the series argument then |
| 1224 |
% do what has been done since 1994. |
| 1225 |
% \changes{v3.1b}{2022/09/20}{Drop any surplus 'm' in series argument (gh/918)} |
| 1226 |
% \begin{macrocode} |
| 1227 |
%</2ekernel> |
| 1228 |
%<*2ekernel|latexrelease> |
| 1229 |
%<latexrelease>\IncludeInRelease{2022/11/01}% |
| 1230 |
%<latexrelease> {\SetSymbolFont}{maybe drop m}% |
| 1231 |
\def\SetSymbolFont #1#2#3#4#5#6{% |
| 1232 |
\def\reserved@a{\SetSymbolFont@m@dropped{#1}{#2}{#3}{#4}}% |
| 1233 |
\edef\reserved@b{#5}% |
| 1234 |
\series@maybe@drop@one@m\reserved@b\reserved@b |
| 1235 |
\expandafter\reserved@a\expandafter{\reserved@b}{#6}% |
| 1236 |
} |
| 1237 |
% \end{macrocode} |
| 1238 |
% |
| 1239 |
% \begin{macrocode} |
| 1240 |
\def\SetSymbolFont@m@dropped#1#2#3#4#5#6{% |
| 1241 |
\@tempswafalse |
| 1242 |
\edef\reserved@b{#3}% |
| 1243 |
\def\cdp@elt##1##2##3##4{\def\reserved@c{##1}% |
| 1244 |
\ifx\reserved@b\reserved@c \@tempswatrue\fi}% |
| 1245 |
\cdp@list |
| 1246 |
\if@tempswa |
| 1247 |
\expandafter\SetSymbolFont@ |
| 1248 |
\csname mv@#2\expandafter\endcsname\csname#3/#4/#5/#6\expandafter |
| 1249 |
\endcsname \csname sym#1\endcsname |
| 1250 |
\else |
| 1251 |
\@latex@error{Encoding scheme `#3' unknown}\@eha |
| 1252 |
\fi |
| 1253 |
} |
| 1254 |
\@onlypreamble\SetSymbolFont |
| 1255 |
%</2ekernel|latexrelease> |
| 1256 |
%<latexrelease>\EndIncludeInRelease |
| 1257 |
%<latexrelease>\IncludeInRelease{0000/00/00}% |
| 1258 |
%<latexrelease> {\SetSymbolFont}{maybe drop m}% |
| 1259 |
%<latexrelease> |
| 1260 |
%<latexrelease>\let\SetSymbolFont\SetSymbolFont@m@dropped |
| 1261 |
%<latexrelease>\let\SetSymbolFont@m@dropped\@undefined |
| 1262 |
%<latexrelease> |
| 1263 |
%<latexrelease>\EndIncludeInRelease |
| 1264 |
%<*2ekernel> |
| 1265 |
% \end{macrocode} |
| 1266 |
% \end{macro} |
| 1267 |
% |
| 1268 |
% \begin{macro}{\SetSymbolFont@} |
| 1269 |
% \changes{v3.0l}{2007/08/31}{Font warning changed to info |
| 1270 |
% for encoding change (pr/3975)} |
| 1271 |
% \begin{macrocode} |
| 1272 |
\def\SetSymbolFont@#1#2#3{% |
| 1273 |
\expandafter\in@\expandafter#1\expandafter{\version@list}% |
| 1274 |
\ifin@ |
| 1275 |
\expandafter\in@\expandafter#3\expandafter{\group@list}% |
| 1276 |
\ifin@ |
| 1277 |
\begingroup |
| 1278 |
\expandafter\get@cdp\string#2\@nil\reserved@a |
| 1279 |
\toks@{}% |
| 1280 |
\def\install@mathalphabet##1##2{% |
| 1281 |
\addto@hook\toks@{\install@mathalphabet##1{##2}}% |
| 1282 |
}% |
| 1283 |
\def\getanddefine@fonts##1##2{% |
| 1284 |
\ifnum##1=#3% |
| 1285 |
\addto@hook\toks@{\getanddefine@fonts#3#2}% |
| 1286 |
\expandafter\get@cdp\string##2\@nil\reserved@b |
| 1287 |
\ifx\reserved@a\reserved@b\else |
| 1288 |
\@font@info{Encoding `\reserved@b' has changed |
| 1289 |
to `\reserved@a' for symbol font\MessageBreak |
| 1290 |
`\expandafter\@gobblefour\string#3' in the |
| 1291 |
math version `\expandafter |
| 1292 |
\@gobblefour\string#1'}% |
| 1293 |
\fi |
| 1294 |
\@font@info{% |
| 1295 |
Overwriting symbol font |
| 1296 |
`\expandafter\@gobblefour\string#3' in |
| 1297 |
version `\expandafter |
| 1298 |
\@gobblefour\string#1'\MessageBreak |
| 1299 |
\@spaces \expandafter\@gobble\string##2 --> |
| 1300 |
\expandafter\@gobble\string#2}% |
| 1301 |
\else |
| 1302 |
\addto@hook\toks@{\getanddefine@fonts##1##2}% |
| 1303 |
\fi}% |
| 1304 |
#1% |
| 1305 |
\xdef#1{\the\toks@}% |
| 1306 |
\endgroup |
| 1307 |
\else |
| 1308 |
\@latex@error{Symbol font `\expandafter\@gobblefour\string#3' |
| 1309 |
not defined}\@eha |
| 1310 |
\fi |
| 1311 |
\else |
| 1312 |
\@latex@error{Math version `\expandafter\@gobblefour\string#1' |
| 1313 |
is not |
| 1314 |
defined}{You probably misspelled the name of the math |
| 1315 |
version.^^JOr you have to specify an additional package.}% |
| 1316 |
\fi |
| 1317 |
} |
| 1318 |
\@onlypreamble\SetSymbolFont@ |
| 1319 |
% \end{macrocode} |
| 1320 |
% \end{macro} |
| 1321 |
% |
| 1322 |
% \begin{macro}{\get@cdp} |
| 1323 |
% \begin{macrocode} |
| 1324 |
\def\get@cdp#1#2/#3\@nil#4{\def#4{#2}} |
| 1325 |
\@onlypreamble\get@cdp |
| 1326 |
% \end{macrocode} |
| 1327 |
% \end{macro} |
| 1328 |
% |
| 1329 |
% \begin{macro}{\DeclareMathAlphabet} |
| 1330 |
% \changes{v3.0j}{2005/07/27} |
| 1331 |
% {(MH) Make document commands robust} |
| 1332 |
% \begin{macrocode} |
| 1333 |
\def\DeclareMathAlphabet#1#2#3#4#5{% |
| 1334 |
\@tempswafalse |
| 1335 |
\edef\reserved@b{#2}% |
| 1336 |
\def\cdp@elt##1##2##3##4{\def\reserved@c{##1}% |
| 1337 |
\ifx\reserved@b\reserved@c \@tempswatrue\fi}% |
| 1338 |
\cdp@list |
| 1339 |
\if@tempswa |
| 1340 |
\expandafter\ifx |
| 1341 |
\csname\expandafter\@gobble\string#1\endcsname |
| 1342 |
\relax |
| 1343 |
\new@mathalphabet#1{#2}{#3}{#4}{#5}% |
| 1344 |
\else |
| 1345 |
% \end{macrocode} |
| 1346 |
% Check if it is already a math alphabet. |
| 1347 |
% \begin{macrocode} |
| 1348 |
\edef\reserved@a{\noexpand\in@{\string\select@group}% |
| 1349 |
{\expandafter\meaning\csname \expandafter |
| 1350 |
\@gobble\string#1\space\endcsname}}% |
| 1351 |
\reserved@a |
| 1352 |
\ifin@ |
| 1353 |
\@font@info{Redeclaring math alphabet \string#1}% |
| 1354 |
\def\version@elt##1{% |
| 1355 |
\expandafter\SetMathAlphabet@\expandafter |
| 1356 |
##1\csname#2/#3/#4/#5\expandafter\endcsname |
| 1357 |
% \end{macrocode} |
| 1358 |
% \changes{???}{1994/04/18}{Pass correct arg (2 not 3)} |
| 1359 |
% \begin{macrocode} |
| 1360 |
\csname M@#2\expandafter\endcsname |
| 1361 |
\csname \expandafter\@gobble\string#1\space\endcsname#1}% |
| 1362 |
\version@list |
| 1363 |
\else |
| 1364 |
% \end{macrocode} |
| 1365 |
% Check if it is a math alphabet defined via |
| 1366 |
% |\DeclareSymbolFontAlphabet|. |
| 1367 |
% \begin{macrocode} |
| 1368 |
\edef\reserved@a{\noexpand\in@{\string\use@mathgroup}% |
| 1369 |
{\expandafter\meaning\csname \expandafter |
| 1370 |
\@gobble\string#1\space\endcsname}}% |
| 1371 |
\reserved@a |
| 1372 |
\ifin@ |
| 1373 |
% \end{macrocode} |
| 1374 |
% In that case overwriting is simple since there is nothing |
| 1375 |
% inserted in the math version macros. |
| 1376 |
% \begin{macrocode} |
| 1377 |
\@font@info{Redeclaring math alphabet \string#1}% |
| 1378 |
\new@mathalphabet#1{#2}{#3}{#4}{#5}% |
| 1379 |
% \end{macrocode} |
| 1380 |
% Otherwise panic. |
| 1381 |
% \begin{macrocode} |
| 1382 |
\else |
| 1383 |
\@latex@error{Command `\string#1' already defined}\@eha |
| 1384 |
\fi |
| 1385 |
\fi |
| 1386 |
\fi |
| 1387 |
\else |
| 1388 |
\@latex@error{Encoding scheme `#2' unknown}\@eha |
| 1389 |
\fi |
| 1390 |
} |
| 1391 |
\@onlypreamble\DeclareMathAlphabet |
| 1392 |
% \end{macrocode} |
| 1393 |
% \end{macro} |
| 1394 |
% |
| 1395 |
% \begin{macro}{\new@mathalphabet} |
| 1396 |
% \changes{v3.0j}{2005/07/27} |
| 1397 |
% {(MH) Make document commands robust} |
| 1398 |
% \begin{macrocode} |
| 1399 |
\def\new@mathalphabet#1#2#3#4#5{% |
| 1400 |
\toks@\expandafter{\alpha@list}% |
| 1401 |
\edef#1{\expandafter\noexpand\csname \expandafter |
| 1402 |
\@gobble\string#1\space\endcsname |
| 1403 |
\if/#5/% |
| 1404 |
\noexpand\no@alphabet@error |
| 1405 |
\noexpand\no@alphabet@error |
| 1406 |
\else |
| 1407 |
\expandafter\noexpand\csname M@#2\endcsname |
| 1408 |
\expandafter\noexpand\csname#2/#3/#4/#5\endcsname |
| 1409 |
\fi |
| 1410 |
}% |
| 1411 |
\toks2\expandafter{#1}% |
| 1412 |
\edef\alpha@list{\the\toks@\noexpand\alpha@elt\the\toks2}% |
| 1413 |
\def\version@elt##1{\toks@\expandafter{##1}% |
| 1414 |
\edef##1{\the\toks@\install@mathalphabet |
| 1415 |
\expandafter\noexpand |
| 1416 |
\csname \expandafter\@gobble |
| 1417 |
\string#1\space\endcsname |
| 1418 |
{\if/#5/% |
| 1419 |
\noexpand\no@alphabet@error |
| 1420 |
\noexpand#1% |
| 1421 |
\else |
| 1422 |
\noexpand\select@group\the\toks2 |
| 1423 |
\fi}}% |
| 1424 |
}% |
| 1425 |
\version@list |
| 1426 |
\expandafter\edef\csname \expandafter\@gobble |
| 1427 |
\string#1\space\endcsname{\if/#5/% |
| 1428 |
\noexpand\no@alphabet@error |
| 1429 |
\noexpand#1% |
| 1430 |
\else |
| 1431 |
\noexpand\select@group\the\toks2 |
| 1432 |
\fi}% |
| 1433 |
\edef#1{\noexpand\protect |
| 1434 |
\expandafter\noexpand\csname \expandafter |
| 1435 |
\@gobble\string#1\space\endcsname}% |
| 1436 |
} |
| 1437 |
\@onlypreamble\new@mathalphabet |
| 1438 |
% \end{macrocode} |
| 1439 |
% \end{macro} |
| 1440 |
% |
| 1441 |
% \begin{macro}{\SetMathAlphabet} |
| 1442 |
% \changes{v3.0j}{2005/07/27} |
| 1443 |
% {(MH) Make document commands robust} |
| 1444 |
% \begin{macrocode} |
| 1445 |
\def\SetMathAlphabet#1#2#3#4#5#6{% |
| 1446 |
\@tempswafalse |
| 1447 |
\edef\reserved@b{#3}% |
| 1448 |
\def\cdp@elt##1##2##3##4{\def\reserved@c{##1}% |
| 1449 |
\ifx\reserved@b\reserved@c \@tempswatrue\fi}% |
| 1450 |
\cdp@list |
| 1451 |
\if@tempswa |
| 1452 |
\expandafter\SetMathAlphabet@ |
| 1453 |
\csname mv@#2\expandafter\endcsname\csname#3/#4/#5/#6\expandafter |
| 1454 |
\endcsname \csname M@#3\expandafter\endcsname |
| 1455 |
\csname \expandafter\@gobble\string#1\space\endcsname#1% |
| 1456 |
\else |
| 1457 |
\@latex@error{Encoding scheme `#3' unknown}\@eha |
| 1458 |
\fi |
| 1459 |
} |
| 1460 |
\@onlypreamble\SetMathAlphabet |
| 1461 |
% \end{macrocode} |
| 1462 |
% \end{macro} |
| 1463 |
% |
| 1464 |
% \begin{macro}{\SetMathAlphabet@} |
| 1465 |
% \begin{macrocode} |
| 1466 |
\def\SetMathAlphabet@#1#2#3#4#5{% |
| 1467 |
\expandafter\in@\expandafter#1\expandafter{\version@list}% |
| 1468 |
\ifin@ |
| 1469 |
\expandafter\in@\expandafter#4\expandafter{\alpha@list}% |
| 1470 |
\ifin@ |
| 1471 |
\begingroup |
| 1472 |
\toks@{}% |
| 1473 |
\def\getanddefine@fonts##1##2{% |
| 1474 |
\addto@hook\toks@{\getanddefine@fonts##1##2}% |
| 1475 |
}% |
| 1476 |
\def\reserved@c##1##2##3##4{% % for message below |
| 1477 |
\expandafter\@gobble\string##4}% |
| 1478 |
\def\install@mathalphabet##1##2{% |
| 1479 |
\ifx##1#4% |
| 1480 |
\addto@hook\toks@ |
| 1481 |
{\install@mathalphabet#4{\select@group#4#3#2}}% |
| 1482 |
\@font@info{Overwriting math alphabet |
| 1483 |
`\string#5' in version `\expandafter |
| 1484 |
\@gobblefour\string#1'\MessageBreak |
| 1485 |
\@spaces \reserved@c##2 --> |
| 1486 |
\expandafter\@gobble\string#2}% |
| 1487 |
\else |
| 1488 |
\addto@hook\toks@{\install@mathalphabet##1{##2}}% |
| 1489 |
\fi |
| 1490 |
}% |
| 1491 |
#1% |
| 1492 |
\xdef#1{\the\toks@}% |
| 1493 |
\endgroup |
| 1494 |
\else |
| 1495 |
% \end{macrocode} |
| 1496 |
% If the math alphabet was defined via |\DeclareSymbolFontAlphabet| |
| 1497 |
% we have remove its external definition and add it as a normal |
| 1498 |
% math alphabet to every version before trying to change it in one |
| 1499 |
% version. |
| 1500 |
% \changes{v2.1b}{1994/03/11}{Changed parameter template in temporary |
| 1501 |
% macro to catch check add below.} |
| 1502 |
% \begin{macrocode} |
| 1503 |
\edef\reserved@a{% |
| 1504 |
\noexpand\in@{\string\use@mathgroup}{\meaning#4}}% |
| 1505 |
\reserved@a |
| 1506 |
\ifin@ |
| 1507 |
\def\reserved@b##1\use@mathgroup##2##3{% |
| 1508 |
\def\reserved@b{##3}\def\reserved@c{##2}}% |
| 1509 |
\expandafter\reserved@b#4% |
| 1510 |
\begingroup |
| 1511 |
\def\install@mathalphabet##1##2{% |
| 1512 |
\addto@hook\toks@{\install@mathalphabet##1{##2}}% |
| 1513 |
}% |
| 1514 |
\def\getanddefine@fonts##1##2{% |
| 1515 |
\addto@hook\toks@{\getanddefine@fonts##1##2}% |
| 1516 |
\ifnum##1=\reserved@b |
| 1517 |
\expandafter |
| 1518 |
\addto@hook\expandafter\toks@ |
| 1519 |
\expandafter{\expandafter\install@mathalphabet |
| 1520 |
\expandafter#4\expandafter |
| 1521 |
{\expandafter\select@group\expandafter |
| 1522 |
#4\reserved@c##2}}% |
| 1523 |
\fi |
| 1524 |
}% |
| 1525 |
\def\version@elt##1{% |
| 1526 |
\toks@{}% |
| 1527 |
##1% |
| 1528 |
\xdef##1{\the\toks@}% |
| 1529 |
}% |
| 1530 |
\version@list |
| 1531 |
\endgroup |
| 1532 |
% \end{macrocode} |
| 1533 |
% Put it into the |\alpha@list| with default `error' |
| 1534 |
% \begin{macrocode} |
| 1535 |
\expandafter\gdef\expandafter\alpha@list\expandafter |
| 1536 |
{\alpha@list |
| 1537 |
\alpha@elt #4\no@alphabet@error \no@alphabet@error}% |
| 1538 |
\gdef#4{\no@alphabet@error #5}% fake things :-) |
| 1539 |
% \end{macrocode} |
| 1540 |
% Then call the internal setting routine again: |
| 1541 |
% \begin{macrocode} |
| 1542 |
\SetMathAlphabet@{#1}{#2}{#3}#4#5% |
| 1543 |
\else |
| 1544 |
\@latex@error{Command `\string#5' not defined as a |
| 1545 |
math alphabet}% |
| 1546 |
{Use \noexpand\DeclareMathAlphabet to define it.}% |
| 1547 |
\fi |
| 1548 |
\fi |
| 1549 |
\else |
| 1550 |
\@latex@error{Math version `\expandafter\@gobblefour\string#1' |
| 1551 |
is not |
| 1552 |
defined}{You probably misspelled the name of the math |
| 1553 |
version.^^JOr you have to specify an additional package.}% |
| 1554 |
\fi |
| 1555 |
} |
| 1556 |
\@onlypreamble\SetMathAlphabet@ |
| 1557 |
% \end{macrocode} |
| 1558 |
% \end{macro} |
| 1559 |
% |
| 1560 |
% \begin{macro}{\DeclareMathAccent} |
| 1561 |
% Could do with more checks like allowing single number in |#4| |
| 1562 |
% lowercase in |#4| etc |
| 1563 |
% \changes{v3.0r}{2016/02/18} |
| 1564 |
% {Check for mathaccent not \cs{mathaccemt}} |
| 1565 |
% \changes{v3.0s}{2019/08/27}{Make math accents robust} |
| 1566 |
% \begin{macrocode} |
| 1567 |
%</2ekernel> |
| 1568 |
%<*2ekernel|latexrelease> |
| 1569 |
%<latexrelease>\IncludeInRelease{2019/10/01}% |
| 1570 |
%<latexrelease> {DeclareMathAccent}{Make math accents robust}% |
| 1571 |
\def\DeclareMathAccent#1#2#3#4{% |
| 1572 |
\expandafter\in@\csname sym#3\expandafter\endcsname |
| 1573 |
\expandafter{\group@list}% |
| 1574 |
\ifin@ |
| 1575 |
\begingroup |
| 1576 |
\count\z@=#4\relax |
| 1577 |
\count\tw@\count\z@ |
| 1578 |
\divide\count\z@\sixt@@n |
| 1579 |
\count@\count\z@ |
| 1580 |
\multiply\count@\sixt@@n |
| 1581 |
\advance\count\tw@-\count@ |
| 1582 |
\if\relax\noexpand#1% is command? |
| 1583 |
\edef\reserved@a{\noexpand\in@ |
| 1584 |
{\expandafter\@gobble\string\mathaccent} |
| 1585 |
{\expandafter\meaning |
| 1586 |
\csname\expandafter\@gobble\string#1\space\endcsname}}% |
| 1587 |
\reserved@a |
| 1588 |
\ifin@ |
| 1589 |
\expandafter\let |
| 1590 |
\csname\expandafter\@gobble\string#1\space\endcsname |
| 1591 |
\@undefined |
| 1592 |
\expandafter\set@mathaccent |
| 1593 |
\csname sym#3\endcsname#1#2% |
| 1594 |
{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 1595 |
\@font@info{Redeclaring math accent \string#1}% |
| 1596 |
\else |
| 1597 |
\expandafter\ifx |
| 1598 |
\csname\expandafter\@gobble\string#1\endcsname |
| 1599 |
\relax |
| 1600 |
\expandafter\set@mathaccent |
| 1601 |
\csname sym#3\endcsname#1#2% |
| 1602 |
{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 1603 |
\else |
| 1604 |
\@latex@error{Command `\string#1' already defined}\@eha |
| 1605 |
\fi |
| 1606 |
\fi |
| 1607 |
\else |
| 1608 |
\@latex@error{Not a command name: `\noexpand#1'}\@eha |
| 1609 |
\fi |
| 1610 |
\endgroup |
| 1611 |
\else |
| 1612 |
\@latex@error{Symbol font `#3' is not defined}\@eha |
| 1613 |
\fi |
| 1614 |
} |
| 1615 |
%</2ekernel|latexrelease> |
| 1616 |
%<latexrelease>\EndIncludeInRelease |
| 1617 |
%<latexrelease>\IncludeInRelease{0000/00/00}% |
| 1618 |
%<latexrelease> {DeclareMathAccent}{Make math accents robust}% |
| 1619 |
%<latexrelease>\def\DeclareMathAccent#1#2#3#4{% |
| 1620 |
%<latexrelease> \expandafter\in@\csname sym#3\expandafter\endcsname |
| 1621 |
%<latexrelease> \expandafter{\group@list}% |
| 1622 |
%<latexrelease> \ifin@ |
| 1623 |
%<latexrelease> \begingroup |
| 1624 |
%<latexrelease> \count\z@=#4\relax |
| 1625 |
%<latexrelease> \count\tw@\count\z@ |
| 1626 |
%<latexrelease> \divide\count\z@\sixt@@n |
| 1627 |
%<latexrelease> \count@\count\z@ |
| 1628 |
%<latexrelease> \multiply\count@\sixt@@n |
| 1629 |
%<latexrelease> \advance\count\tw@-\count@ |
| 1630 |
%<latexrelease> \if\relax\noexpand#1% is command? |
| 1631 |
%<latexrelease> \edef\reserved@a{\noexpand\in@ |
| 1632 |
%<latexrelease> {\expandafter\@gobble\string\mathaccent}{\meaning#1}}% |
| 1633 |
%<latexrelease> \reserved@a |
| 1634 |
%<latexrelease> \ifin@ |
| 1635 |
%<latexrelease> \expandafter\set@mathaccent |
| 1636 |
%<latexrelease> \csname sym#3\endcsname#1#2% |
| 1637 |
%<latexrelease> {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 1638 |
%<latexrelease> \@font@info{Redeclaring math accent \string#1}% |
| 1639 |
%<latexrelease> \else |
| 1640 |
%<latexrelease> \expandafter\ifx |
| 1641 |
%<latexrelease> \csname\expandafter\@gobble\string#1\endcsname |
| 1642 |
%<latexrelease> \relax |
| 1643 |
%<latexrelease> \expandafter\set@mathaccent |
| 1644 |
%<latexrelease> \csname sym#3\endcsname#1#2% |
| 1645 |
%<latexrelease> {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 1646 |
%<latexrelease> \else |
| 1647 |
%<latexrelease> \@latex@error{Command `\string#1' already defined}\@eha |
| 1648 |
%<latexrelease> \fi |
| 1649 |
%<latexrelease> \fi |
| 1650 |
%<latexrelease> \else |
| 1651 |
%<latexrelease> \@latex@error{Not a command name: `\noexpand#1'}\@eha |
| 1652 |
%<latexrelease> \fi |
| 1653 |
%<latexrelease> \endgroup |
| 1654 |
%<latexrelease> \else |
| 1655 |
%<latexrelease> \@latex@error{Symbol font `#3' is not defined}\@eha |
| 1656 |
%<latexrelease> \fi |
| 1657 |
%<latexrelease>} |
| 1658 |
%<latexrelease>\EndIncludeInRelease |
| 1659 |
%<*2ekernel> |
| 1660 |
% \end{macrocode} |
| 1661 |
% |
| 1662 |
% \begin{macrocode} |
| 1663 |
\@onlypreamble\DeclareMathAccent |
| 1664 |
% \end{macrocode} |
| 1665 |
% \end{macro} |
| 1666 |
% |
| 1667 |
% \begin{macro}{\set@mathaccent} |
| 1668 |
% \begin{macrocode} |
| 1669 |
%</2ekernel> |
| 1670 |
%<*2ekernel|latexrelease> |
| 1671 |
%<latexrelease>\IncludeInRelease{2019/10/01}% |
| 1672 |
%<latexrelease> {\set@mathaccent}{makemath accents robust}% |
| 1673 |
\def\set@mathaccent#1#2#3#4{% |
| 1674 |
\xdef#2{\mathaccent"\mathchar@type#3\hexnumber@#1#4\relax}% |
| 1675 |
\MakeRobust#2% |
| 1676 |
} |
| 1677 |
\@onlypreamble\set@mathaccent |
| 1678 |
%</2ekernel|latexrelease> |
| 1679 |
%<latexrelease>\EndIncludeInRelease |
| 1680 |
%<latexrelease>\IncludeInRelease{0000/00/00}% |
| 1681 |
%<latexrelease> {\set@mathaccent}{makemath accents robust}% |
| 1682 |
%<latexrelease> |
| 1683 |
%<latexrelease>\def\set@mathaccent#1#2#3#4{% |
| 1684 |
%<latexrelease> \xdef#2{\mathaccent"\mathchar@type#3\hexnumber@#1#4\relax}} |
| 1685 |
%<latexrelease> |
| 1686 |
%<latexrelease>\EndIncludeInRelease |
| 1687 |
%<*2ekernel> |
| 1688 |
% \end{macrocode} |
| 1689 |
% \end{macro} |
| 1690 |
% |
| 1691 |
% \begin{macro}{\DeclareMathSymbol} |
| 1692 |
% \changes{v3.0r}{2016/02/18} |
| 1693 |
% {Check for mathchar not \cs{mathchar}} |
| 1694 |
% \changes{v3.0s}{2019/09/09}{Allow definition if the math symbol was |
| 1695 |
% a command already robust} |
| 1696 |
% \begin{macrocode} |
| 1697 |
\def\DeclareMathSymbol#1#2#3#4{% |
| 1698 |
\expandafter\in@\csname sym#3\expandafter\endcsname |
| 1699 |
\expandafter{\group@list}% |
| 1700 |
\ifin@ |
| 1701 |
\begingroup |
| 1702 |
\count\z@=#4\relax |
| 1703 |
\count\tw@\count\z@ |
| 1704 |
\divide\count\z@\sixt@@n |
| 1705 |
\count@\count\z@ |
| 1706 |
\multiply\count@\sixt@@n |
| 1707 |
\advance\count\tw@-\count@ |
| 1708 |
\if\relax\noexpand#1% is command? |
| 1709 |
% \end{macrocode} |
| 1710 |
% Store the command name with a space attached inside |
| 1711 |
% \cs{reserved@@b} in case we look at a robust definition. |
| 1712 |
% \begin{macrocode} |
| 1713 |
\edef\reserved@b{\expandafter\noexpand |
| 1714 |
\csname\expandafter\@gobble\string#1\space\endcsname}% |
| 1715 |
% \end{macrocode} |
| 1716 |
% Test both \verb=#1= and \verb*=#1 = for containing \texttt{mathchar}. |
| 1717 |
% \begin{macrocode} |
| 1718 |
\edef\reserved@a |
| 1719 |
{\noexpand\in@{\expandafter\@gobble\string\mathchar}% |
| 1720 |
{\meaning#1\expandafter\meaning\reserved@b}}% |
| 1721 |
\reserved@a |
| 1722 |
% \end{macrocode} |
| 1723 |
% Drop \verb*=#1 = in case it was defined before. |
| 1724 |
% \begin{macrocode} |
| 1725 |
\global\expandafter\let\reserved@b\@undefined |
| 1726 |
\ifin@ |
| 1727 |
\expandafter\set@mathsymbol |
| 1728 |
\csname sym#3\endcsname#1#2% |
| 1729 |
{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 1730 |
\@font@info{Redeclaring math symbol \string#1}% |
| 1731 |
\else |
| 1732 |
\expandafter\ifx |
| 1733 |
\csname\expandafter\@gobble\string#1\endcsname |
| 1734 |
\relax |
| 1735 |
\expandafter\set@mathsymbol |
| 1736 |
\csname sym#3\endcsname#1#2% |
| 1737 |
{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 1738 |
\else |
| 1739 |
\@latex@error{Command `\string#1' already defined}\@eha |
| 1740 |
\fi |
| 1741 |
\fi |
| 1742 |
\else |
| 1743 |
\expandafter\set@mathchar |
| 1744 |
\csname sym#3\endcsname#1#2 |
| 1745 |
{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 1746 |
\fi |
| 1747 |
\endgroup |
| 1748 |
\else |
| 1749 |
\@latex@error{Symbol font `#3' is not defined}\@eha |
| 1750 |
\fi |
| 1751 |
} |
| 1752 |
\@onlypreamble\DeclareMathSymbol |
| 1753 |
% \end{macrocode} |
| 1754 |
% \end{macro} |
| 1755 |
% |
| 1756 |
% \begin{macro}{\set@mathchar} |
| 1757 |
% \begin{macrocode} |
| 1758 |
\def\set@mathchar#1#2#3#4{% |
| 1759 |
\global\mathcode`#2="\mathchar@type#3\hexnumber@#1#4\relax} |
| 1760 |
\@onlypreamble\set@mathchar |
| 1761 |
% \end{macrocode} |
| 1762 |
% \end{macro} |
| 1763 |
% |
| 1764 |
% \begin{macro}{\set@mathsymbol} |
| 1765 |
% \begin{macrocode} |
| 1766 |
\def\set@mathsymbol#1#2#3#4{% |
| 1767 |
\global\mathchardef#2"\mathchar@type#3\hexnumber@#1#4\relax} |
| 1768 |
\@onlypreamble\set@mathsymbol |
| 1769 |
% \end{macrocode} |
| 1770 |
% \end{macro} |
| 1771 |
% |
| 1772 |
% \begin{macrocode} |
| 1773 |
%\def\mathsymbol#1#2#3{% |
| 1774 |
% \@tempcnta=#3\relax |
| 1775 |
% \@tempcntb\@tempcnta |
| 1776 |
% \divide\@tempcnta\sixt@@n |
| 1777 |
% \count@\@tempcnta |
| 1778 |
% \multiply\count@\sixt@@n |
| 1779 |
% \advance\@tempcntb-\count@ |
| 1780 |
% \mathchar"\mathchar@type#1\hexnumber@#2% |
| 1781 |
% \hexnumber@\@tempcnta\hexnumber@\@tempcntb\relax} |
| 1782 |
% |
| 1783 |
%\def\DeclareMathAlphabetCharacter#1#2#3{% |
| 1784 |
% \DeclareMathSymbol{#1}7{#2}{#3}} |
| 1785 |
% \end{macrocode} |
| 1786 |
% |
| 1787 |
% \begin{macro}{\DeclareMathDelimiter} |
| 1788 |
% \changes{v2.1m}{1994/11/18} |
| 1789 |
% {(DPC) \cs{expandafter} instead of \cs{next}} |
| 1790 |
% \begin{macrocode} |
| 1791 |
\def\DeclareMathDelimiter#1{% |
| 1792 |
\if\relax\noexpand#1% |
| 1793 |
\expandafter\@DeclareMathDelimiter |
| 1794 |
\else |
| 1795 |
\expandafter\@xxDeclareMathDelimiter |
| 1796 |
\fi |
| 1797 |
#1} |
| 1798 |
\@onlypreamble\DeclareMathDelimiter |
| 1799 |
% \end{macrocode} |
| 1800 |
% \end{macro} |
| 1801 |
% |
| 1802 |
% \begin{macro}{\@xxDeclareMathDelimiter} |
| 1803 |
% \changes{v3.0h}{1998/04/15}{Macro added (pr/2662)} |
| 1804 |
% This macro checks if the second arg is a ``math type'' such |
| 1805 |
% as |\mathopen|. The undocumented original code didn't use math |
| 1806 |
% types when the delimiter was a single letter. |
| 1807 |
% For this reason the coding is a bit strange as it tries to |
| 1808 |
% support the undocumented syntax for compatibility reasons. |
| 1809 |
% \begin{macrocode} |
| 1810 |
\def\@xxDeclareMathDelimiter#1#2#3#4{% |
| 1811 |
% \end{macrocode} |
| 1812 |
% 7 is the default value returned in the case that |\mathchar@type| |
| 1813 |
% is passed something unexpected, like a math symbol font name. |
| 1814 |
% We locally move |\mathalpha| out of the way so if you use that |
| 1815 |
% the right branch is taken. This will still fail if an explicit |
| 1816 |
% number |7| is used! |
| 1817 |
% \begin{macrocode} |
| 1818 |
\begingroup |
| 1819 |
\let\mathalpha\mathord |
| 1820 |
\ifnum7=\mathchar@type{#2}% |
| 1821 |
\endgroup |
| 1822 |
% \end{macrocode} |
| 1823 |
% If this branch is taken we have old syntax (5 arguments). |
| 1824 |
% \begin{macrocode} |
| 1825 |
\expandafter\@firstofone |
| 1826 |
\else |
| 1827 |
% \end{macrocode} |
| 1828 |
% If this branch is taken |\mathchar@type| is different from 7 so |
| 1829 |
% we assume new syntax. In this case we also use the arguments to |
| 1830 |
% set up the letter as a math symbol for the case where it is not |
| 1831 |
% used as a delimiter. |
| 1832 |
% \begin{macrocode} |
| 1833 |
\endgroup |
| 1834 |
\DeclareMathSymbol#1{#2}{#3}{#4}% |
| 1835 |
% \end{macrocode} |
| 1836 |
% Then we arrange that |\@xDeclareMathDelimiter| only gets |#1|, |
| 1837 |
% |#3|, |#4| \ldots\ as it does not expect a math type as argument. |
| 1838 |
% \begin{macrocode} |
| 1839 |
\expandafter\@firstoftwo |
| 1840 |
\fi |
| 1841 |
{\@xDeclareMathDelimiter#1}{#2}{#3}{#4}} |
| 1842 |
\@onlypreamble\@xxDeclareMathDelimiter |
| 1843 |
% \end{macrocode} |
| 1844 |
% \end{macro} |
| 1845 |
% |
| 1846 |
% \begin{macro}{\@DeclareMathDelimiter} |
| 1847 |
% \changes{v3.0r}{2016/02/18} |
| 1848 |
% {Check for delimiter not \cs{delimiter}} |
| 1849 |
% \begin{macrocode} |
| 1850 |
\def\@DeclareMathDelimiter#1#2#3#4#5#6{% |
| 1851 |
\expandafter\in@\csname sym#3\expandafter\endcsname |
| 1852 |
\expandafter{\group@list}% |
| 1853 |
\ifin@ |
| 1854 |
\expandafter\in@\csname sym#5\expandafter\endcsname |
| 1855 |
\expandafter{\group@list}% |
| 1856 |
\ifin@ |
| 1857 |
\begingroup |
| 1858 |
\count\z@=#4\relax |
| 1859 |
\count\tw@\count\z@ |
| 1860 |
\divide\count\z@\sixt@@n |
| 1861 |
\count@\count\z@ |
| 1862 |
\multiply\count@\sixt@@n |
| 1863 |
\advance\count\tw@-\count@ |
| 1864 |
\edef\reserved@c{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 1865 |
% |
| 1866 |
\count\z@=#6\relax |
| 1867 |
\count\tw@\count\z@ |
| 1868 |
\divide\count\z@\sixt@@n |
| 1869 |
\count@\count\z@ |
| 1870 |
\multiply\count@\sixt@@n |
| 1871 |
\advance\count\tw@-\count@ |
| 1872 |
\edef\reserved@d{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 1873 |
% |
| 1874 |
\edef\reserved@a{\noexpand\in@ |
| 1875 |
{\expandafter\@gobble\string\delimiter}{\meaning#1}}% |
| 1876 |
\reserved@a |
| 1877 |
\ifin@ |
| 1878 |
\expandafter\set@mathdelimiter |
| 1879 |
\csname sym#3\expandafter\endcsname |
| 1880 |
\csname sym#5\endcsname#1#2% |
| 1881 |
\reserved@c\reserved@d |
| 1882 |
\@font@info{Redeclaring math delimiter \string#1}% |
| 1883 |
\else |
| 1884 |
\expandafter\ifx |
| 1885 |
\csname\expandafter\@gobble\string#1\endcsname |
| 1886 |
\relax |
| 1887 |
\expandafter\set@mathdelimiter |
| 1888 |
\csname sym#3\expandafter\endcsname |
| 1889 |
\csname sym#5\endcsname#1#2% |
| 1890 |
\reserved@c\reserved@d |
| 1891 |
\else |
| 1892 |
\@latex@error{Command `\string#1' already defined}\@eha |
| 1893 |
\fi |
| 1894 |
\fi |
| 1895 |
\endgroup |
| 1896 |
\else |
| 1897 |
\@latex@error{Symbol font `#5' is not defined}\@eha |
| 1898 |
\fi |
| 1899 |
\else |
| 1900 |
\@latex@error{Symbol font `#3' is not defined}\@eha |
| 1901 |
\fi |
| 1902 |
} |
| 1903 |
% \end{macrocode} |
| 1904 |
% |
| 1905 |
% \begin{macrocode} |
| 1906 |
\@onlypreamble\@DeclareMathDelimiter |
| 1907 |
% \end{macrocode} |
| 1908 |
% \end{macro} |
| 1909 |
% |
| 1910 |
% \begin{macro}{\@xDeclareMathDelimiter} |
| 1911 |
% \begin{macrocode} |
| 1912 |
\def\@xDeclareMathDelimiter#1#2#3#4#5{% |
| 1913 |
\expandafter\in@\csname sym#2\expandafter\endcsname |
| 1914 |
\expandafter{\group@list}% |
| 1915 |
\ifin@ |
| 1916 |
\expandafter\in@\csname sym#4\expandafter\endcsname |
| 1917 |
\expandafter{\group@list}% |
| 1918 |
\ifin@ |
| 1919 |
\begingroup |
| 1920 |
\count\z@=#3\relax |
| 1921 |
\count\tw@\count\z@ |
| 1922 |
\divide\count\z@\sixt@@n |
| 1923 |
\count@\count\z@ |
| 1924 |
\multiply\count@\sixt@@n |
| 1925 |
\advance\count\tw@-\count@ |
| 1926 |
\edef\reserved@c{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 1927 |
% |
| 1928 |
\count\z@=#5\relax |
| 1929 |
\count\tw@\count\z@ |
| 1930 |
\divide\count\z@\sixt@@n |
| 1931 |
\count@\count\z@ |
| 1932 |
\multiply\count@\sixt@@n |
| 1933 |
\advance\count\tw@-\count@ |
| 1934 |
\edef\reserved@d{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 1935 |
\expandafter\set@@mathdelimiter |
| 1936 |
\csname sym#2\expandafter\endcsname\csname sym#4\endcsname#1% |
| 1937 |
\reserved@c\reserved@d |
| 1938 |
\endgroup |
| 1939 |
\else |
| 1940 |
\@latex@error{Symbol font `#4' is not defined}\@eha |
| 1941 |
\fi |
| 1942 |
\else |
| 1943 |
\@latex@error{Symbol font `#2' is not defined}\@eha |
| 1944 |
\fi |
| 1945 |
} |
| 1946 |
\@onlypreamble\@xDeclareMathDelimiter |
| 1947 |
% \end{macrocode} |
| 1948 |
% \end{macro} |
| 1949 |
% |
| 1950 |
% \begin{macro}{\set@mathdelimiter} |
| 1951 |
% We have to end the definition of a math delimiter like |\lfloor| |
| 1952 |
% with a space and not with |\relax| as we did before, because |
| 1953 |
% otherwise constructs involving |\abovewithdelims| will prematurely |
| 1954 |
% end (pr/1329) |
| 1955 |
% |
| 1956 |
% \changes{v2.1q}{1995/04/02}{fix pr/1329} |
| 1957 |
% \begin{macrocode} |
| 1958 |
%</2ekernel> |
| 1959 |
%<*2ekernel|latexrelease> |
| 1960 |
%<latexrelease>\IncludeInRelease{2019/10/01}% |
| 1961 |
%<latexrelease> {\set@mathdelimiter}{make delimiters robust}% |
| 1962 |
\def\set@mathdelimiter#1#2#3#4#5#6{% |
| 1963 |
% \end{macrocode} |
| 1964 |
% We use \cs{protected} not \cs{MakeRobust} so that |
| 1965 |
% \verb=\bigl\lfoor= etc.\ works inside the argument of \cs{protected@edef}. |
| 1966 |
% \changes{v3.0s}{2019/08/27}{Make math delimiters robust} |
| 1967 |
% \changes{v3.0t}{2020/01/20}{fix for gh/251} |
| 1968 |
% \begin{macrocode} |
| 1969 |
\protected |
| 1970 |
\xdef#3{\delimiter"\mathchar@type#4\hexnumber@#1#5% |
| 1971 |
\hexnumber@#2#6 }% |
| 1972 |
% \MakeRobust#3% |
| 1973 |
} |
| 1974 |
\@onlypreamble\set@mathdelimiter |
| 1975 |
%</2ekernel|latexrelease> |
| 1976 |
%<latexrelease>\EndIncludeInRelease |
| 1977 |
%<latexrelease>\IncludeInRelease{0000/00/00}% |
| 1978 |
%<latexrelease> {\set@mathdelimiter}{make delimiters robust}% |
| 1979 |
%<latexrelease> |
| 1980 |
%<latexrelease>\def\set@mathdelimiter#1#2#3#4#5#6{% |
| 1981 |
%<latexrelease> \xdef#3{\delimiter"\mathchar@type#4\hexnumber@#1#5% |
| 1982 |
%<latexrelease> \hexnumber@#2#6 }} |
| 1983 |
%<latexrelease> |
| 1984 |
%<latexrelease>\EndIncludeInRelease |
| 1985 |
%<*2ekernel> |
| 1986 |
% \end{macrocode} |
| 1987 |
% \end{macro} |
| 1988 |
% |
| 1989 |
% \begin{macro}{\set@@mathdelimiter} |
| 1990 |
% \begin{macrocode} |
| 1991 |
\def\set@@mathdelimiter#1#2#3#4#5{% |
| 1992 |
\global\delcode`#3="\hexnumber@#1#4\hexnumber@#2#5\relax} |
| 1993 |
\@onlypreamble\set@@mathdelimiter |
| 1994 |
% \end{macrocode} |
| 1995 |
% \end{macro} |
| 1996 |
% |
| 1997 |
% \begin{macro}{\DeclareMathRadical} |
| 1998 |
% \begin{macrocode} |
| 1999 |
\def\DeclareMathRadical#1#2#3#4#5{% |
| 2000 |
% \end{macrocode} |
| 2001 |
% Below is a crude fix to make this macro work if |#1| is undefined |
| 2002 |
% or |\relax|. Should be improved! |
| 2003 |
% \changes{v2.1t}{1995/05/21}{Allow for undefined cs names} |
| 2004 |
% \changes{v3.0r}{2016/02/18} |
| 2005 |
% {Check for radical not \cs{radical}} |
| 2006 |
% \begin{macrocode} |
| 2007 |
\expandafter\ifx |
| 2008 |
\csname\expandafter\@gobble\string#1\endcsname |
| 2009 |
\relax |
| 2010 |
\let#1\radical |
| 2011 |
\fi |
| 2012 |
\edef\reserved@a{\noexpand\in@ |
| 2013 |
{\expandafter\@gobble\string\radical}{\meaning#1}}% |
| 2014 |
\reserved@a |
| 2015 |
\ifin@ |
| 2016 |
\expandafter\in@\csname sym#2\expandafter\endcsname |
| 2017 |
\expandafter{\group@list}% |
| 2018 |
\ifin@ |
| 2019 |
\expandafter\in@\csname sym#4\expandafter\endcsname |
| 2020 |
\expandafter{\group@list}% |
| 2021 |
\ifin@ |
| 2022 |
\begingroup |
| 2023 |
\count\z@=#3\relax |
| 2024 |
\count\tw@\count\z@ |
| 2025 |
\divide\count\z@\sixt@@n |
| 2026 |
\count@\count\z@ |
| 2027 |
\multiply\count@\sixt@@n |
| 2028 |
\advance\count\tw@-\count@ |
| 2029 |
\edef\reserved@c{% |
| 2030 |
\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 2031 |
\count\z@=#5\relax |
| 2032 |
\count\tw@\count\z@ |
| 2033 |
\divide\count\z@\sixt@@n |
| 2034 |
\count@\count\z@ |
| 2035 |
\multiply\count@\sixt@@n |
| 2036 |
\advance\count\tw@-\count@ |
| 2037 |
\edef\reserved@d{% |
| 2038 |
\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% |
| 2039 |
% \end{macrocode} |
| 2040 |
% Coded inline instead of using |\set@mathradical| |
| 2041 |
% \begin{macrocode} |
| 2042 |
% \expandafter\set@mathradical |
| 2043 |
% \csname sym#2\expandafter\endcsname |
| 2044 |
% \csname sym#4\endcsname#1% |
| 2045 |
% \reserved@c\reserved@d |
| 2046 |
\xdef#1{\radical"\expandafter\hexnumber@ |
| 2047 |
\csname sym#2\endcsname\reserved@c |
| 2048 |
\expandafter\hexnumber@ |
| 2049 |
\csname sym#4\endcsname\reserved@d |
| 2050 |
\relax}% |
| 2051 |
\endgroup |
| 2052 |
\else |
| 2053 |
\@latex@error{Symbol font `#4' is not defined}\@eha |
| 2054 |
\fi |
| 2055 |
\else |
| 2056 |
\@latex@error{Symbol font `#2' is not defined}\@eha |
| 2057 |
\fi |
| 2058 |
\else |
| 2059 |
\@latex@error{Command `\string#1' already defined}\@eha |
| 2060 |
\fi |
| 2061 |
} |
| 2062 |
\@onlypreamble\DeclareMathRadical |
| 2063 |
% \end{macrocode} |
| 2064 |
% \end{macro} |
| 2065 |
% |
| 2066 |
% Definition below was wrong it contained |\delimiter| ! |
| 2067 |
% |
| 2068 |
%\begin{verbatim} |
| 2069 |
%\def\set@mathradical#1#2#3#4#5{% |
| 2070 |
% \xdef#3{\radical"\hexnumber@#1#4\hexnumber@#2#5\relax}} |
| 2071 |
%\end{verbatim} |
| 2072 |
% |
| 2073 |
% \begin{macro}{\mathalpha} |
| 2074 |
% just a dummy currently |
| 2075 |
% \begin{macrocode} |
| 2076 |
\let\mathalpha\relax |
| 2077 |
% \end{macrocode} |
| 2078 |
% \end{macro} |
| 2079 |
% |
| 2080 |
% \begin{macro}{\mathchar@type} |
| 2081 |
% \begin{macrocode} |
| 2082 |
\def\mathchar@type#1{% |
| 2083 |
\ifodd 2#11 #1\else % is this non-negative number? |
| 2084 |
\ifx#1\mathord 0\else |
| 2085 |
\ifx#1\mathop 1\else |
| 2086 |
\ifx#1\mathbin 2\else |
| 2087 |
\ifx#1\mathrel 3\else |
| 2088 |
\ifx#1\mathopen 4\else |
| 2089 |
\ifx#1\mathclose 5\else |
| 2090 |
\ifx#1\mathpunct 6\else |
| 2091 |
7% % anything else is variable ord |
| 2092 |
\fi |
| 2093 |
\fi |
| 2094 |
\fi |
| 2095 |
\fi |
| 2096 |
\fi |
| 2097 |
\fi |
| 2098 |
\fi |
| 2099 |
\fi} |
| 2100 |
\@onlypreamble\mathchar@type |
| 2101 |
% \end{macrocode} |
| 2102 |
% \end{macro} |
| 2103 |
% |
| 2104 |
% \begin{macro}{\DeclareSymbolFontAlphabet} |
| 2105 |
% \changes{v3.0j}{2005/07/27} |
| 2106 |
% {(MH) Make document commands robust} |
| 2107 |
% \begin{macrocode} |
| 2108 |
\def\DeclareSymbolFontAlphabet#1#2{% |
| 2109 |
\expandafter\DeclareSymbolFontAlphabet@ |
| 2110 |
\csname \expandafter\@gobble\string#1\space\endcsname{#2}#1} |
| 2111 |
\@onlypreamble\DeclareSymbolFontAlphabet |
| 2112 |
% \end{macrocode} |
| 2113 |
% \end{macro} |
| 2114 |
% |
| 2115 |
% \begin{macro}{\DeclareSymbolFontAlphabet@} |
| 2116 |
% \begin{macrocode} |
| 2117 |
\def\DeclareSymbolFontAlphabet@#1#2#3{% |
| 2118 |
% \end{macrocode} |
| 2119 |
% We use the switch |\if@tempswa| to decide if we can declare this |
| 2120 |
% symbol font alphabet. |
| 2121 |
% \begin{macrocode} |
| 2122 |
\@tempswatrue |
| 2123 |
% \end{macrocode} |
| 2124 |
% First check if |#2| is known to be a symbol font |
| 2125 |
% \begin{macrocode} |
| 2126 |
\expandafter\in@\csname sym#2\expandafter\endcsname |
| 2127 |
\expandafter{\group@list}% |
| 2128 |
\ifin@ |
| 2129 |
% \end{macrocode} |
| 2130 |
% Check if |#1| is defined as a math alphabet defined via |
| 2131 |
% |\DeclareMathAlphabet|: |
| 2132 |
% \begin{macrocode} |
| 2133 |
\expandafter\in@\expandafter#1\expandafter{\alpha@list}% |
| 2134 |
\ifin@ |
| 2135 |
% \end{macrocode} |
| 2136 |
% If so remove it from the |\alpha@list| and from all math version |
| 2137 |
% macros. |
| 2138 |
% \begin{macrocode} |
| 2139 |
\@font@info{Redeclaring math alphabet \string#3}% |
| 2140 |
\toks@{}% |
| 2141 |
\def\alpha@elt##1##2##3{% |
| 2142 |
\ifx##1#1\else\addto@hook\toks@{\alpha@elt##1##2##3}\fi}% |
| 2143 |
\alpha@list |
| 2144 |
\xdef\alpha@list{\the\toks@}% |
| 2145 |
% \end{macrocode} |
| 2146 |
% Now we loop over all versions and remove the math alphabet: |
| 2147 |
% \begin{macrocode} |
| 2148 |
\def\version@elt##1{% |
| 2149 |
\begingroup |
| 2150 |
\toks@{}% |
| 2151 |
\def\getanddefine@fonts####1####2{% |
| 2152 |
\addto@hook\toks@{\getanddefine@fonts####1####2}}% |
| 2153 |
\def\install@mathalphabet####1####2{% |
| 2154 |
\ifx####1#1\else |
| 2155 |
\addto@hook\toks@{\install@mathalphabet |
| 2156 |
####1{####2}}\fi}% |
| 2157 |
##1% |
| 2158 |
\xdef##1{\the\toks@}% |
| 2159 |
\endgroup |
| 2160 |
}% |
| 2161 |
\version@list |
| 2162 |
\else |
| 2163 |
% \end{macrocode} |
| 2164 |
% If |#3| is not defined as a math alphabet check if it is defined |
| 2165 |
% at all: |
| 2166 |
% \begin{macrocode} |
| 2167 |
\expandafter\ifx |
| 2168 |
\csname\expandafter\@gobble\string#1\space\endcsname |
| 2169 |
\relax |
| 2170 |
% \end{macrocode} |
| 2171 |
% If it is undefined, fine otherwise check if it is a math alphabet |
| 2172 |
% defined via \\ |\DeclareSymbolFontAlphabet|: |
| 2173 |
% \begin{macrocode} |
| 2174 |
\else |
| 2175 |
\edef\reserved@a{% |
| 2176 |
\noexpand\in@{\string\use@mathgroup}{\meaning#1}}% |
| 2177 |
\reserved@a |
| 2178 |
\ifin@ |
| 2179 |
\@font@info{Redeclaring math alphabet \string#3}% |
| 2180 |
\else |
| 2181 |
% \end{macrocode} |
| 2182 |
% Since the command |#3| is defined to be something which is not a |
| 2183 |
% math alphabet we have to skip redefining it. |
| 2184 |
% \begin{macrocode} |
| 2185 |
\@tempswafalse |
| 2186 |
\@latex@error{Command `\string#3' already defined}\@eha |
| 2187 |
\fi |
| 2188 |
\fi |
| 2189 |
\fi |
| 2190 |
\else |
| 2191 |
% \end{macrocode} |
| 2192 |
% Since the symbol font is not known we better skip defining this |
| 2193 |
% alphabet. |
| 2194 |
% \begin{macrocode} |
| 2195 |
\@tempswafalse |
| 2196 |
\@latex@error{Unknown symbol font `#2'}\@eha |
| 2197 |
\fi |
| 2198 |
\if@tempswa |
| 2199 |
% \end{macrocode} |
| 2200 |
% When we reach this point we are allowed to define |#1| to be a |
| 2201 |
% symbol font math alphabet. This means that we have to set it to |
| 2202 |
% \begin{quote} |
| 2203 |
% |\use@mathgroup| \meta{math-settings} |\sym|\meta{name} |
| 2204 |
% \end{quote} |
| 2205 |
% The \meta{math-settings} are the one for the encoding that is |
| 2206 |
% used in the font shape where |\sym|\meta{name} is pointing to. |
| 2207 |
% This means that we have to get it from the information stored in |
| 2208 |
% |\group@list|. Thus we loop through that list after defining |
| 2209 |
% |\group@elt| in a suitable way. |
| 2210 |
% \changes{v2.1b}{1994/03/11}{Added check against use of alphabet |
| 2211 |
% switch outside of math mode.} |
| 2212 |
% \begin{macrocode} |
| 2213 |
\def\group@elt##1##2{% |
| 2214 |
\expandafter\ifx\csname sym#2\endcsname##1% |
| 2215 |
\expandafter\reserved@a\string##2\@nil |
| 2216 |
\fi}% |
| 2217 |
\def\reserved@a##1##2/##3\@nil{% |
| 2218 |
\def\reserved@a{##2}}% |
| 2219 |
\group@list |
| 2220 |
\toks@{\relax\ifmmode \else \non@alpherr#1\fi}% |
| 2221 |
\edef#1{\the\toks@ |
| 2222 |
\noexpand\use@mathgroup |
| 2223 |
\expandafter\noexpand\csname M@\reserved@a\endcsname |
| 2224 |
\csname sym#2\endcsname}% |
| 2225 |
\def#3{\protect#1}% |
| 2226 |
\fi |
| 2227 |
} |
| 2228 |
\@onlypreamble\DeclareSymbolFontAlphabet@ |
| 2229 |
%</2ekernel> |
| 2230 |
% \end{macrocode} |
| 2231 |
% \end{macro} |
| 2232 |
% |
| 2233 |
% \Finale |
| 2234 |
% |