1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
30 %%% From File: ltfntcmd.dtx
34 \ProvidesFile{ltfntcmd.dtx}
35 [2015/03/11 v3.4b LaTeX Kernel (Font commands)]
37 \documentclass{ltxdoc}
38 \GetFileInfo{ltfntcmd.dtx}
41 \author{Frank Mittelbach, Chris Rowley}
43 \MaintainedByLaTeXTeam{latex}
52 % Copyright (C) 1994-1995 Frank Mittelbach and Chris Rowley
53 % all rights reserved.
56 % \changes{v2.0b}{1993/05/05}{Removed all LaTeX related cmds}
57 % \changes{v3.0a}{1993/12/11}{Complete reworking of all text commands,
58 % using just one creator function}
59 % \changes{v3.0a}{1993/12/11}{newfontswitch command corrected and
61 % \changes{v3.0a}{1993/12/11}{newcommands replaced by defs}
62 % \changes{v3.0a}{1993/12/11}{italic correction now put in front of
63 % penalty before glue}
64 % \changes{v3.0b}{1993/12/19}{\cs{@pdef} command added}
65 % \changes{v3.0b}{1993/12/19}{Other tidying}
66 % \changes{v3.0b}{1993/12/19}{Made \cs{@newfontswitch} produce an
67 % error if command already exists, and added \cs{@renewfontswitch},
69 % \changes{v3.0b}{1993/12/19}{Untidying added, so this is now a
71 % \changes{v3.0b}{1993/12/19}{Some more tidying done}
72 % \changes{v3.1b}{1994/01/31}{\cs{@normalsize} no longer defined}
73 % \changes{v3.2a}{1994/03/15}{Adapted to mass formatting}
74 % \changes{v3.2a}{1994/03/15}{Removed defs of short-forms and all
75 % sizes except \cs{normalize}}
76 % \changes{v3.2a}{1994/03/15}{Removed \cs{@renewfontswitch}}
77 % \changes{v3.2a}{1994/03/15}{Changed \cs{/} to \cs{@@italiccorr}}
78 % \changes{v3.2b}{1994/04/14}{Macros renamed to non-private forms, JB}
79 % \changes{v3.3a}{1994/04/20}{New implementation of \cs{nocorr}}
80 % \changes{v3.3a}{1994/04/20}{Documentation up-dated}
81 % \changes{v3.3b}{1994/04/30}{Documentation up-dated and tidied}
82 % \changes{v3.3b}{1994/04/30}{Title changed}
83 % \changes{v3.3b}{1994/04/30}{Prefix frag@ changed to frag in
85 % \changes{v3.3b}{1994/04/30}{Warning changed to info message in
87 % \changes{v3.3c}{1994/05/05}{Corrected \cs{@fontswitch}}
88 % \changes{v3.3d}{1994/05/08}{Removed \cs{@undefinedfonterror}}
89 % \changes{v3.3f}{1994/05/09}{Replaced all \cs{next} by
90 % \cs{@let@token} and undo change 3.3e,
92 % \changes{v3.3g}{1994/05/13}{Replaced \cs{@protecteddef} by
93 % \cs{DeclareRobustCommand}}
94 % \changes{v3.3h}{1994/05/20}{Use new error commands}
95 % \changes{v3.3i}{1994/05/24}{Tidying and typos fixed}
96 % \changes{v3.3j}{1994/05/25}{Insertion of \cs{aftergroup}s to
97 % implement \cs{nocorr} moved to the end of the group}
98 % \changes{v3.3k}{1994/06/09}{Tidying and typos fixed in documentation}
99 % \changes{v3.3l}{1994/06/18}{Added check for empty text}
100 % \changes{v3.3m}{1994/06/22}{Removed space from \cs{nfss@text}}
101 % \changes{v3.3m}{1994/06/22}{Renamed \cs{check@nocorr}}
102 % \changes{v3.3p}{1994/11/17}
103 % {\cs{@tempa} to \cs{reserved@a}}
104 % \changes{v3.3v}{1997/06/16}{Fix typo in documentation.}
105 % \changes{v3.3x}{1998/08/17}{(RmS) Minor documentation fixes.}
110 % \def \dst {{\normalfont\scshape docstrip}}
111 % \def \NFSS {\textsf{NFSS}}
115 % The commands defined in this file \texttt{ltfntcmd} are
116 % part of the kernel code for \LaTeXe/NFSS2.
118 % It is also meant to serve as documentation for package writers since
119 % it demonstrates how to define high-level font changing commands
120 % using a small number of creator functions.
123 % \section{Introduction}
125 % Font changes such as |\bfseries|, |\sffamily|, etc.\ are
126 % declarations; this means that their scope is delimited by the
127 % grouping structure, either by the next |\end| of some environment or
128 % by explicitly using a group, e.g., writing something like
129 % |{\bfseries...}| in the source. If you make the mistake of writing
130 % |\bfseries{...}| (thinking of |\bfseries| as a command with one
131 % argument) then the result is rather striking.
133 % Font declarations are an artifact of the \TeX{} system and for
134 % several reasons it is better to avoid them on the user level
135 % whenever possible. In \LaTeX3 they will probably all be
136 % replaced by environments and by font commands taking one argument.
138 % This file defines a creator function for such declarative font
139 % switches. This function creates commands which can be used in
140 % both math and text.
142 % This file also defines a number of high-level commands (all
143 % starting with |\text..|) that have one argument and typeset this
144 % argument in the requested way. Thus these commands are for
145 % typesetting short pieces of text in a specific family, series or
146 % shape. These are all produced as examples of the use of a creator
147 % function which is itself also defined in this file.
149 % Table~\ref{tab:fontcmds} shows all these high-level commands in
150 % action. A further advantage of using these commands is that they
151 % automatically take care of any necessary italic correction on either
152 % side of their argument.
155 % \begin{tabular}{lll}
156 % \textit{Command} & \textit{Corresponds to }& \textit{Action} \\[4pt]
157 % |\textrm{..}| & |\rmfamily| &
158 % Typeset argument in roman family \\
159 % |\textsf{..}| & |\sffamily| &
160 % Typeset argument in \textsf{sans serif} family \\
161 % |\texttt{..}| & |\ttfamily| &
162 % Typeset argument in \texttt{typewriter} family
164 % |\textmd{..}| & |\mdseries| &
165 % Typeset argument in medium series \\
166 % |\textbf{..}| & |\bfseries| &
167 % Typeset argument in \textbf{bold} series \\[2pt]
168 % |\textup{..}| & |\upshape| &
169 % Typeset argument in normal shape \\
170 % |\textit{..}| & |\itshape| &
171 % Typeset argument in \textit{italic} shape \\
172 % |\textsl{..}| & |\slshape| &
173 % Typeset argument in \textsl{slanted} shape \\
174 % |\textsc{..}| & |\scshape| &
175 % Typeset argument in \textsc{small caps} shape
177 % |\emph{..}| & |\em| &
178 % Typeset argument \emph{emphasized}
181 % \caption{Font-change commands with arguments}
182 % \label{tab:fontcmds}
184 % The font change commands provided here
185 % all start with |\text..| to emphasize that they
186 % are for use in normal text and to be easily memorable. They
187 % automatically take care of any necessary italic correction on either
188 % side of the argument.
192 % Thus, when using such commands, one does not have to worry about
193 % forgetting the italic correction when changing fonts. Only in very
194 % few situations is this additional space wrong but, for example, most
195 % typographers recommend omitting the italic correction if a small
196 % punctuation character, like a comma, directly follows the font
197 % change. Since the amount of correction required is partly a matter
198 % of taste, you can define in what situations the italic correction
199 % should be suppressed. This is done by putting the characters that
200 % should cancel a preceding italic correction in the list
201 % |\nocorrlist|.\footnote{Any package that changes the
202 % \texttt{\string\catcode} of a character inside
203 % \texttt{\string\nocorrlist} must then explicitly reset the list.
204 % Otherwise the changed character will no longer be recognized
205 % by the suppression algorithm.}
206 % The default definition for this list is produced by the following.
208 % \newcommand \nocorrlist {,.}
210 % It is best to declare the most often used characters first, because
211 % this will make the processing slightly faster. For example,
213 % \emph{When using the \NFSS{} high-level commands,
214 % the \emph{proper} use of italic corrections is
215 % automatically taken care of}. Only
216 % \emph{sometimes} one has to help \LaTeX{} by
217 % adding a \verb=\nocorr= command.
221 % \emph{When using the \NFSS{} high-level commands,
222 % the \emph{proper} use of italic corrections is
223 % automatically taken care of}. Only
224 % \emph{sometimes} one has to help \LaTeX{} by
225 % adding a \verb=\nocorr= command.
228 % In contrast, the use of the declaration forms is often more
229 % appropriate when you define your own commands or environments.
231 % \newenvironment{bfitemize}{\begin{itemize}\normalfont\bfseries}
234 % \item This environment produces boldface items.
235 % \item It is defined in terms of \LaTeX's
236 % \texttt{itemize} environment and NFSS
242 % \newenvironment{bfitemize}
243 % {\begin{itemize}\normalfont\bfseries}
246 % \item This environment produces boldface items.
247 % \item It is defined in terms of \LaTeX's
248 % \texttt{itemize} environment and NFSS
253 % In addition to global customization of when to insert the italic
254 % correction, it is of course sometimes necessary to explicitly insert
257 % It is also possible to suppress the italic correction
258 % in individual instances. For this, the command |\nocorr| is provided.
260 % The |\nocorr| must appear as the first or last token inside the
261 % braces of the argument of the |\text...| commands, at that end of
262 % the text where you wish to suppress the italic correction.
265 % It is worth pointing out here that inserting a |\/| in places where
266 % it can have no function (\ie anywhere except immediately after a
267 % slanted letter) is not an error---it will just be silently ignored.
268 % Unfortunately this is not true if the redefinition of |\/| in {\tt
269 % amstex.sty} is used as this version can cause space to be removed
270 % immediately before the |\/|.
275 % \section{The implementation}
277 % \changes{v3.3z}{2003/01/01}{Code checked and documentation extended
280 % \begin{macro}{\DeclareTextFontCommand}
281 % \changes{v3.0a}{1993/12/11}{Macro changed}
282 % \changes{v3.0a}{1993/12/11}{Macro changed}
283 % This is the creator function for |\text..| commands.
284 % It gives a warning if |\foo| or |\fragfoo| is already defined.
285 % \changes{v3.0b}{1993/12/19}{Corrected and tidied}
287 % In math mode it simply puts the font declaration and text into a
288 % box (possibly an automagically sized one).
290 % Otherwise it first scans the text to see where |\nocorr| occurs
291 % within it. This sets the |\check@ic| commands to do what is
292 % necessary concerning the italic correction at both ends.
294 % The algorithm for deciding whether to put in an italic correction
295 % is not very subtle: one is added whenever the newly current font
296 % is not itself positively sloped, unless the next token is a
297 % character in the `nocorr' list. At the end of the text this
298 % is done after closing the group so as to check the `outer font'.
300 % will often result in adding an italic correction token after a
301 % character in an unsloped font; we believe (in early 2003) that
302 % this is perhaps inefficient but not dangerous.
304 % It also now checks for empty contents of the text command and optimises
305 % this case. Some care is also taken to check that doing dangerous
306 % things in vertical mode is avoided.
308 % The italic correction token is added to the horizontal list
309 % before (in the list) an immediately preceding non-zero glob of
310 % glue (skip) and any non-zero penalty preceding that since, in
311 % the typical case, this puts it immediately
312 % after the last character in the preceding word.
315 % \changes{v3.3j}{1994/05/25}{Insertion of \cs{aftergroup}s moved}
316 % \changes{v3.3j}{1994/05/25}{\cs{expandafter} inserted}
317 % \changes{v3.3m}{1994/06/22}{Removed space from \cs{nfss@text}}
318 % \changes{v3.3u}{1996/10/08}{Removed \cs{check@icr} when in vmode
319 % since it causes various errors (see pr/2157)}
320 % \changes{v3.3w}{1997/10/17}{Reinstalled \cs{check@icr} as check is
321 % now done in \cs{check@nocorr@} (see PR/2646).}
322 % \changes{v3.3y}{2000/01/30}{Use \cs{hmode@bgroup} now (pr/3160)}
324 % Note that it is necessary to put in the |\aftergroup\maybe@ic| at
325 % the end of the group so that it comes after any other aftergroup
326 % tokens and immediately before the following tokens.
327 % It is also necessary to remove the |\fi| from the token list before
328 % the group ends; this is done by adding an |\expandafter| just
329 % before the closing brace.
333 \def \DeclareTextFontCommand #1#2{%
334 \DeclareRobustCommand#1[1]{%
340 #2\check@icl ##1\check@icr
349 % \begin{macro}{\textrm}
350 % \begin{macro}{\textsf}
351 % \begin{macro}{\texttt}
352 % \begin{macro}{\textnormal}
353 % Now we define the |\text|\meta{family} commands in terms of the
354 % above; |\texttt| does not look very nice!
356 \DeclareTextFontCommand{\textrm}{\rmfamily}
357 \DeclareTextFontCommand{\textsf}{\sffamily}
358 \DeclareTextFontCommand{\texttt}{\ttfamily}
359 \DeclareTextFontCommand{\textnormal}{\normalfont}
366 % \begin{macro}{\textbf}
367 % \begin{macro}{\textmd}
368 % For the series attribute:
370 \DeclareTextFontCommand{\textbf}{\bfseries}
371 \DeclareTextFontCommand{\textmd}{\mdseries}
376 % \begin{macro}{\textit}
377 % \begin{macro}{\textsl}
378 % \begin{macro}{\textsc}
379 % \begin{macro}{\textup}
380 % \changes{v3.0a}{1993/12/11}{Macros changed}
381 % And for the shapes:
383 \DeclareTextFontCommand{\textit}{\itshape}
384 \DeclareTextFontCommand{\textsl}{\slshape}
385 \DeclareTextFontCommand{\textsc}{\scshape}
386 \DeclareTextFontCommand{\textup}{\upshape}
393 % \begin{macro}{\emph}
394 % \changes{v3.0a}{1993/12/11}{Macro changed}
395 % Finally we have the |\em| font change declaration of \LaTeX. The
396 % corresponding definition with argument is
398 \DeclareTextFontCommand{\emph}{\em}
402 % \begin{macro}{\nocorr}
403 % This is just a label, so it does nothing; it should also be
410 % \begin{macro}{\check@icl}
411 % \begin{macro}{\check@icr}
412 % \changes{v3.3j}{1994/05/25}{Macros added}
413 % \changes{v3.3t}{1996/05/09}{Default definitions added}
414 % We define these defaults in case some error causes them to be
415 % expanded at the wrong time.
417 \let \check@icl \@empty
418 \let \check@icr \@empty
423 % \begin{macro}{\text@command}
424 % \begin{macro}{\check@nocorr@}
425 % \changes{v3.3a}{1994/04/20}{Macros added}
426 % \changes{v3.3m}{1994/06/22}{Renamed \cs{check@nocorr} to
427 % \cs{text@command} to improve \cs{long} error message}
428 % \changes{v3.3j}{1994/05/25}{Insertion of \cs{aftergroup}s moved
429 % and defaults set up for efficiency}
430 % This checks for a |\nocorr| as the first token in its argument
431 % and also for one in any other position not protected within
432 % braces (the latter is treated as if it were at the end of the
435 % Is this the correct action in the `empty' case? It is efficient but
436 % typographically it is, strictly, incorrect!
437 % \changes{v3.3l}{1994/06/18}{Added check for empty text}
439 \def \text@command #1{%
440 \def \reserved@a {#1}%
441 \ifx \reserved@a \@empty
442 \let \check@icl \@empty
443 \let \check@icr \@empty
446 % |\space| is a reserved word in \LaTeX{} or actually already in
447 % plain \TeX. If somebody really redefines it so many things will
448 % break that I don't see any reason to make this routine here
449 % slower than necessary.
450 % \changes{v3.3q}{1994/12/10}{Use \cs{space} command for comparison}
452 % \def \reserved@b { }%
453 % \ifx \reserved@a \reserved@b
454 \ifx \reserved@a \space
455 \let \check@icl \@empty
456 \let \check@icr \@empty
458 \check@nocorr@ #1\nocorr\@nil
462 \def \check@nocorr@ #1#2\nocorr#3\@nil {%
464 % The two checks are initialised here to their values in
466 % \changes{v3.3w}{1997/10/17}{Check for vertical mode moved here, from
467 % \cs{DeclareTextFontCommand} (see PR/2646).}
469 \let \check@icl \maybe@ic
470 \def \check@icr {\ifvmode \else \aftergroup \maybe@ic \fi}%
471 \def \reserved@a {\nocorr}%
472 \def \reserved@b {#1}%
473 \def \reserved@c {#3}%
474 \ifx \reserved@a \reserved@b
475 \ifx \reserved@c \@empty
477 % In this case there is a |\nocorr| at the start but not at the
478 % end, so |\check@icl| should be empty.
480 \let \check@icl \@empty
483 % Otherwise there is a |\nocorr| both at the start and
484 % elsewhere, so no italic corrections should be added.
486 \let \check@icl \@empty
487 \let \check@icr \@empty
490 \ifx \reserved@c \@empty
492 % In this case there is no |\nocorr| anywhere, so we need to check
493 % for an italic correction at both the beginning and the end. This
494 % has been set up as the default so no code is needed here.
498 % In this case there is no |\nocorr| at the start but there is one
499 % elsewhere, so no |\aftergroup| is needed.
501 \let \check@icr \@empty
509 % \begin{macro}{\ifmaybe@ic}
510 % \changes{v3.4a}{2009/12/14}{Macro added}
511 % Switch used soley within |\maybe@ic| not interfering with other
518 % \begin{macro}{\maybe@ic}
519 % \changes{v3.0a}{1993/12/11}{Macro name changed}
520 % \begin{macro}{\maybe@ic@}
521 % \changes{v3.0a}{1993/12/11}{Macro and name changed}
522 % \changes{v3.4a}{2009/12/14}{Use switch \cs{ifmaybe@ic} instead of
524 % \task{CAR}{Make this more efficient by checking for non-characters
525 % first and using \cs{if} test?}
526 % These macros implement the italic correction.
528 \def \maybe@ic {\futurelet\@let@token\maybe@ic@}
531 % We first check to see if the current font is positively sloped.
532 % (But do not forget the message Rainer sent about an upright font
533 % with non-zero slope! Or is this an urban myth?) It has been
534 % suggested that this should test against a small positive value,
537 \ifdim \fontdimen\@ne\font>\z@
541 % It would be possible, but probably not worthwhile, to continue the
542 % forward scan beyond any closing braces.
544 % \changes{v3.3a}{1994/04/20}{\cs{nocorr} etc removed from list of
545 % tokens to check, leaving only punctuation characters}
547 \expandafter\@tfor\expandafter\reserved@a\expandafter:\expandafter=%
550 % We have to hide the |\@let@token| in the macro |\t@st@ic| rather
551 % than testing it directly in the loop since it might be |\let|
552 % to a |\fi| or |\else|, which would result in chaos.
553 % \changes{v2.1a}{1993/11/24}{Use \cs{t@st@ic}}
557 % Frank thinks that the next bit it is inefficient if done after
558 % the second change. Chris thinks that most all of this is
559 % inefficient for the commonest cases: but that is the price of a
560 % cleverer algorithm. It is certainly needed to deal with the use
564 \ifmaybe@ic \sw@slant \fi
571 % \begin{macro}{\t@st@ic}
572 % \changes{v2.1a}{1993/11/24}{Macro added}
573 % \changes{v3.3s}{1995/07/05}{Renamed from \cs{test@next}}
574 % The next token in the input stream is stored in |\@let@token| via a
575 % |\let|, the current token from |\nocorrlist| is stored via |\def|
576 % in |\reserved@a|. To compare them we have to fiddle around a bit.
578 % If the only things to check were characters then this could be
579 % done via an |\if| thus their catcodes would not matter; but this
580 % will not work whilst |\futurelet| is used above.
581 % \changes{v3.4a}{2009/12/14}{Use switch \cs{ifmaybe@ic} instead of
585 \expandafter\let\expandafter\reserved@b\expandafter=\reserved@a\relax
586 \ifx\reserved@b\@let@token
588 % If they are the same we record the fact and jump out of the loop.
589 % \changes{v3.3s}{1995/07/03}{Use clean interface for jump}
598 % \begin{macro}{\sw@slant}
599 % \changes{v3.0a}{1993/12/11}{Macro changed}
600 % \begin{macro}{\fix@penalty}
601 % \changes{v3.0a}{1993/12/11}{Macro added}
602 % The definition of the mysterious |\sw@slant| command is as follows.
606 % It is surely correct to put in an italic correction when there
607 % is no skip. If the last thing on the list is actually a zero
608 % skip (including things whose dimension part is zero, such as
609 % |\hfill|), or anything other than a character, then the
610 % italic correction will have no effect.
612 % In order to work correctly with unbreakable spaces from |~|
613 % (and other common forms of line-breaking control) we also move
614 % back across a penalty before the glue.
626 % The above code means: ``If there is a non-zero space just before
627 % the current position (|\ifdim...|) save the amount of that space
628 % (|\skip@\lastskip|), remove it (|\unskip|), then do a similar
629 % thing if there is a penalty just before the skip,
630 % and finally put the space back in.''
632 % Since zero glue cannot be distinguished in this context from no
633 % glue, we dare not put in an |\hskip| in this case as this may
634 % produce an unwanted breakpoint. This is not satisfactory.
636 % The penalty before the glue is handled similarly, with the same
637 % caveats concerning the zero case. Is this the first recorded
638 % use of |\unpenalty| in standard \LaTeX{} code?
641 \ifnum \lastpenalty=\z@
654 % \begin{macro}{\nocorrlist}
655 % This holds the list of characters that should prevent italic
656 % correction. They should be ordered by decreasing frequency of
657 % use. If any such character is made active later on one needs
658 % to redefine the list so that the active character becomes part
660 % \changes{v3.1a}{1994/01/27}{Only ., used as default for cm fonts}
662 \def \nocorrlist {,.}
667 % \begin{macro}{\nfss@text}
668 % This command will by default behave like a \LaTeX{} |\mbox| but
669 % may be redefined by packages such as |amstext.sty| to be a bit
672 \ifx \nfss@text\@undefined
673 \def \nfss@text {\leavevmode\hbox}
679 % \begin{macro}{\DeclareOldFontCommand}
680 % \changes{v3.2b}{1994/04/14}{Renamed from \cs{@newfontswitch}}
681 % This is the function used to create declarative font-changing
682 % commands that can also be used to change alphabets in math-mode.
684 % Usage: |\DeclareOldFontCommand \fn{|\meta{font-change decls}|}|
685 % \meta{math-alphabet}
687 % Here |\fn| is the font-declaration command being defined,
688 % \meta{font-change decls} is the declaration it will expand to in
689 % text-mode, and \meta{math-alphabet} is the (single) math alphabet
690 % specifier which is to be used in math-mode.
692 % It does not care whether the command being defined already
693 % exists but it does give a warning if it redefines anything.
695 % Here are some typical examples of its use in conjunction with
696 % more basic NFSS2 font commands.
698 % \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
699 % \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
700 % \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
703 % \changes{v3.0b}{1993/12/19}{Corrected and tidied}
705 \def \DeclareOldFontCommand #1#2#3{%
706 \DeclareRobustCommand #1{\@fontswitch {#2}{#3}}%
711 % \begin{macro}{\@fontswitch}
712 % \begin{macro}{\@@math@egroup}
713 % \begin{macro}{\@@math@egroup}
714 % These two commands actually do the necessary tests and
715 % declarative \mbox{font-} or alphabet-changing.
717 % \changes{v3.3c}{1994/05/05}{Corrected \cs{@fontswitch} and added
719 % \changes{v3.3q}{1994/12/10}{Don't read arguments}
720 % \changes{v3.3r}{1995/04/02}{Read them again to be able to add \cs{relax}.}
722 \def \@fontswitch #1#2{%
724 \let \math@bgroup \relax
725 \def \math@egroup {\let \math@bgroup \@@math@bgroup
726 \let \math@egroup \@@math@egroup}%
728 % We need to have a |\relax| in the following line in case the |#2|
729 % is something like |\mathsf| grabbing the next token as an
730 % argument. For this reason the code also uses explicit arguments
731 % again (see pr/1275).
738 \let \@@math@bgroup \math@bgroup
739 \let \@@math@egroup \math@egroup
745 % \changes{v2.1b}{1993/12/08}{Macros \cs{rm}, \cs{bf} and \cs{sf}
746 % moved to classes.dtx}
748 % These commands are available only in the preamble.
750 \@onlypreamble \DeclareTextFontCommand
751 \@onlypreamble \DeclareOldFontCommand
754 % \section{Initialization}
755 % \changes{v3.0b}{1993/12/19}{Added by ASAJ.}
756 % \changes{v3.0b}{1993/12/19}{Wording changes by CAR.}
758 % \begin{macro}{\normalsize}
759 % \changes{v3.3d}{1994/05/08}{Removed \cs{@undefinedfonterror}}
760 % \changes{v3.3o}{1994/11/12}{Added \cs{MessageBreak}}
761 % This is defined to produce an error.
764 \@latex@error {The font size command \protect\normalsize\space
765 is not defined:\MessageBreak
766 there is probably something wrong with