A new font selection scheme for TEX macro packages (Compatibility with NFSS1)^{∗}

Frank Mittelbach  Rainer Schöpf

March 27, 1996

This file contains the implementation of commands giving compatibility with the original ‘NFSS1’ release of the Font Selection Scheme.

Warning: The macro documentation is still basically the documentation from the first NFSS release and therefore in some cases probably not completely accurate.

1 Compatibility code for NFSS release 1

There have been a couple of commands which became obsolete with NFSS2. In the past they have been still part of the kernel code to make it possible to process old packages using those commands but since they take up valuable space we decided to remove them and instead auto-load their definitions if they are actually encountered in some file.

Thus the following code doesn’t really belong to this file but I put it here for the moment until finally a documented version of ltfss.dtx is available.

[ auto-loading not activated ]

\new@fontshape \subst@fontshape \extra@def \default@mextra \define@mathalphabet \define@mathgroup These macros are the interfaces in NFSS1 which shouldn’t be used any longer.

We all define them to call the macro \scan@fontshape which is an internal macro that loads the real definitions and then to execute themselves again. Once this auto-loading has happened they have the definition shown below and thus execute their real code directly.

1 ⟨∗autoload⟩

 2 \def\new@fontshape{\scan@fontshape\new@fontshape}
 3 \def\subst@fontshape{\scan@fontshape\subst@fontshape}
 4 \def\extra@def{\scan@fontshape\extra@def}
 5 \def\default@mextra{\scan@fontshape\default@mextra}
 6 \def\define@mathalphabet{\scan@fontshape\define@mathalphabet}
 7 \def\define@mathgroup{\scan@fontshape\define@mathgroup}

∗This file has version number v3.0c dated 1995/08/26

\scan@fontshape Here is the kernel definition for \scan@fontshape which loads the actual definitions from the file nfsscmp.def.

 8 \def\scan@fontshape{\input{nfsscmp.def}}

The following definitions are now placed into the auto-load file.

Since we don’t know when this file will be read in we need to provide ourselves with standard \catcode settings. This is done by placing all definitions in a group and calling \nfss@catcodes. But this macro will also disable spaces which isn’t very appropriate for the following code because it contains a lot of helper messages. Therefore we change this back.

 9 \begingroup
10 \nfss@catcodes
11 \catcode`\ =10\relax

12 ⟨/autoload⟩ 13 ⟨∗compat⟩

\new@fontshape The interface is now \DeclareFontShape.
14 \gdef\new@fontshape#1#2#3#4{%
15  \warn@rel@i\new@fontshape\DeclareFontShape
16  \expandafter\scan@fontshape\@gobble#4<\@nil><<%
17  \DeclareFontShape U{#1}{#2}{#3}\reserved@f}
18 \@onlypreamble\new@fontshape

\warn@rel@i The warning message used above.

19 \gdef\warn@rel@i#1#2{%
20 \@font@warning{***  NFSS release 1 command
21  \noexpand#1found\MessageBreak
22 ***  Update by using release 2 command
23  \string#2.\MessageBreak
24 ***  Recovery is probably possible}%

25 }

26 \@onlypreamble\warn@rel@i

\scan@fontshape This will scan the old font shape definition syntax.

27 \gdef\scan@fontshape{%
28 \let\reserved@f\@empty
29 \let\reserved@e\@empty %        holds last info
30 \scan@@fontshape

31 }

32 \@onlypreamble\scan@fontshape
\scan@@fontshape
33 \gdef\scan@@fontshape#1>#2#3<{%
34 \ifx\@nil#1%
35  \edef\reserved@f{\reserved@f\reserved@e}%
36 \else
37  \def\reserved@b{#1}%       nick names
38  \def\reserved@c{#3}%

39  \in@{ at}{#3}%
40  \ifin@
41  \in@{pt}{#3}%  not a proof but a good chance
42  \ifin@

We grap also everything after pt and discard it if people have forgotten to place a percent sign there.

43  \def\reserved@a##1 at##2pt##3\@nil{%
44  \def\reserved@b{##2}%
45  \def\reserved@c{##1}%
46  }%
47  \reserved@a#3\@nil
48  \fi
49  \fi
50  \ifnum 0<0#2
51  \edef\reserved@d{subf*\reserved@c}%
52  \ifcase #2\or
53  \or
54  \else
55  \errmessage{*** What's this? NFSS release 0? ***}%
56  \fi
57  \else
58  \edef\reserved@d{#2\reserved@c}%
59  \fi
60  \ifx\reserved@d\reserved@e
61  \edef\reserved@f{\reserved@f<\reserved@b>}%
62  \else
63  \edef\reserved@f{\reserved@f\reserved@e<\reserved@b>}%add old info
64  \let\reserved@e\reserved@d
65  \fi
66  \expandafter\scan@@fontshape
67 \fi

68 }

69 \@onlypreamble\scan@@fontshape

\subst@fontshape This is now also handled by the extend syntax of \DeclareFontShape.

70 \gdef\subst@fontshape#1#2#3#4#5#6{%
71  \warn@rel@i\subst@fontshape\DeclareFontShape
72  \DeclareFontShape{U}{#1}{#2}{#3}{<->sub*#4/#5/#6}{}}
73 \@onlypreamble\subst@fontshape
\extra@def This was replaced by \DeclareFontFamily.
74 \gdef\extra@def#1#2#3{%
75  \warn@rel@i\extra@def\DeclareFontFamily
76  \DeclareFontFamily{U}{#1}{}%

77 }

78 \@onlypreamble\extra@def
\default@mextra The new name is \DeclareFontEncodingDefaults but in this case we don’t feel

comfortable with this either.

79 \gdef\default@mextra{%
80 \warn@rel@i\default@mextra\DeclareFontEncodingDefaults

We pick up the argument to \default@mextra implicitly as the second argument

of \DeclareFontEncodingDefaults.
81 \DeclareFontEncodingDefaults\relax

82 }

83 \@onlypreamble\default@mextra
\preload@sizes The new interface is \DeclarePreloadSizes.
84 \gdef\preload@sizes{%
85  \warn@rel@i\preload@sizes\DeclarePreloadSizes
86  \DeclarePreloadSizes U%

87 }

88 \@onlypreamble\preload@sizes

\err@rel@i This macro is used in cases where emulation with NFSS2 features is not really possible.

89 \gdef\err@rel@i#1#2{%
90 \@latex@error{***  NFSS release 1 command \noexpand#1found%
91  ^^J***  Recovery not possible. Use \string#2}%
92  {The new release of NFSS doesn't support the
93  \noexpand#1command^^Jany longer.
94  Please upgrade your file to the syntax of NFSS
95  release 2^^Jusing the \noexpand#2command.}%

Let’s die.

96 \batchmode\input.\relax

97 }

98 \@onlypreamble\err@rel@i
\newmathalphabet \newmathalphabet@@ \newmathalphabet@@@  \newmathalphabet is the old form.
99 \gdef\newmathalphabet{%
100 \if@no@font@opt
101  \@latex@error{*** NFSS release 1 command
102  \noexpand\newmathalphabet found%
103  ^^J \space*** Automatic recovery not possible.%
104  ^^J \space*** TYPE H for Help%

105 }%

106  {Please look at the file usrguide.tex for hints on
107  how to resolve this problem.}%
108 \else
109  \warn@rel@i\newmathalphabet\DeclareMathAlphabet
110 \fi
111 \@ifstar\newmathalphabet@@@
112  \newmathalphabet@@}
113 \gdef\newmathalphabet@@#1{\DeclareMathAlphabet#1{U}{}{}{}}
114 \gdef\newmathalphabet@@@#1#2#3#4{%
115  \DeclareMathAlphabet{#1}{U}{#2}{#3}{#4}}
116 \@onlypreamble\newmathalphabet

117 \@onlypreamble\newmathalphabet@@
118 \@onlypreamble\newmathalphabet@@@
\if@no@font@opt
\@no@font@optfalse
119 \global\let\if@no@font@opt\iftrue
120 \gdef\@no@font@optfalse{\let\if@no@font@opt\iffalse}

\define@mathalphabet This is a case where dying is best.

121 \gdef\define@mathalphabet{%
122  \err@rel@i\define@mathalphabet\DeclareMathAlphabet

123 }

124 \@onlypreamble\define@mathalphabet

\define@mathgroup And here is another one

125 \gdef\define@mathgroup{%
126  \err@rel@i\define@mathgroup\DeclareSymbolFont

127 }

128 \@onlypreamble\define@mathgroup

129 ⟨/compat⟩

\addtoversion  \addtoversion is the old form.
130 \def\addtoversion#1#2{%
131 \warn@rel@i\addtoversion\SetMathAlphabet
132 \SetMathAlphabet#2{#1}{U}}
133 \@onlypreamble\addtoversion

That finishes the definitions for the old interfaces — but first we better finish the group.

134 ⟨∗autoload⟩

135 \endgroup

136 ⟨/autoload⟩