updated
[latex2e.git] / base / ltfsscmp.dtx
blob89fce00b26efee2334f6440a6199b8e4162222ee
1 % \iffalse meta-comment
3 % Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
4 % The LaTeX3 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 %    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.
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: ltfsscmp.dtx
31 %% Copyright (C) 1989-1995 Frank Mittelbach and Rainer Sch\"opf,
32 %% all rights reserved.
34 %<*driver>
35 % \fi
36
38 \ProvidesFile{ltfsscmp.dtx}
39              [1995/08/26 v3.0c LaTeX Kernel (NFSS1 Compatibility)]
40 % \iffalse
41 \documentclass{ltxdoc}
42 \begin{document}
43 \DocInput{ltfsscmp.dtx}
44 \end{document}
45 %</driver>
46 % \fi
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
55 % \CheckSum{235}
58 % \GetFileInfo{ltfsscmp.dtx}
59 % \title{A new font selection scheme for \TeX{} macro packages\\
60 %        (Compatibility with NFSS1)\thanks
61 %       {This file has version number
62 %       \fileversion\ dated \filedate}}
64 % \author{Frank Mittelbach \and Rainer Sch\"opf}
66 % \maketitle
68 % This file contains the  implementation of commands giving
69 % compatibility with the original `NFSS1' release of the Font Selection
70 % Scheme.
72 % \begin{quote}
73 %   \textbf{Warning:} 
74 %  The macro documentation is still basically the documentation from the
75 %  first NFSS release and therefore in some cases probably not
76 %  completely accurate.
77 % \end{quote}
79 % \StopEventually{}
82 % \changes{v3.0b}{1995/06/15}
83 %         {(DPC) minor documentation edits}
84 % \changes{v3.0a}{1995/05/24}
85 %         {(DPC) Make file from previous file, fam.dtx 1995/05/20 v2.2d}
89 % \section{Compatibility code for NFSS release 1}
91 % There have been a couple of commands which became obsolete with NFSS2.
92 % In the past they have been still part of the kernel code to make it
93 % possible to process old packages using those commands but since they
94 % take up valuable space we decided to remove them and instead
95 % auto-load their definitions if they are actually encountered in some
96 % file.
98 % Thus the following code doesn't really belong to this file but I put
99 % it here for the moment until finally a documented version of
100 % \texttt{ltfss.dtx} is available.
102 % [ auto-loading not activated ]
104 % \begin{macro}{\new@fontshape}
105 % \begin{macro}{\subst@fontshape}
106 % \begin{macro}{\extra@def}
107 % \begin{macro}{\default@mextra}
108 % \begin{macro}{\define@mathalphabet}
109 % \begin{macro}{\define@mathgroup}
110 %    These macros are the interfaces in NFSS1 which shouldn't be used
111 %    any longer. We all define them to call the macro
112 %    |\scan@fontshape| which is an internal macro that loads the real
113 %    definitions and then to execute themselves again. Once this
114 %    auto-loading has happened they have the definition shown below and
115 %    thus execute their real code directly.
116 %    \begin{macrocode}
117 %<*autoload>
118 \def\new@fontshape{\scan@fontshape\new@fontshape}
119 \def\subst@fontshape{\scan@fontshape\subst@fontshape}
120 \def\extra@def{\scan@fontshape\extra@def}
121 \def\default@mextra{\scan@fontshape\default@mextra}
122 \def\define@mathalphabet{\scan@fontshape\define@mathalphabet}
123 \def\define@mathgroup{\scan@fontshape\define@mathgroup}
124 %    \end{macrocode}
125 % \end{macro}
126 % \end{macro}
127 % \end{macro}
128 % \end{macro}
129 % \end{macro}
130 % \end{macro}
133 % \begin{macro}{\scan@fontshape}
134 %    Here is the kernel definition for |\scan@fontshape| which loads
135 %    the actual definitions from the file \texttt{nfsscmp.def}.
136 %    \begin{macrocode}
137 \def\scan@fontshape{\input{nfsscmp.def}}
138 %    \end{macrocode}
139 % \end{macro}
142 %    The following definitions are now placed into the auto-load file.
143 %    \begin{macrocode}
144 %    \end{macrocode}
146 %    Since we don't know when this file will be read in we need to
147 %    provide ourselves with standard |\catcode| settings. This is done
148 %    by placing all definitions in a group and calling
149 %    |\nfss@catcodes|. But this macro will also disable spaces which
150 %    isn't very appropriate for the following code because it contains
151 %    a lot of helper messages. Therefore we change this back.
152 %    \begin{macrocode}
153 \begingroup
154 \nfss@catcodes
155 \catcode`\ =10\relax
156 %</autoload>
157 %<*compat>
158 %    \end{macrocode}
160 % \begin{macro}{\new@fontshape}
161 %    The interface is now |\DeclareFontShape|.
162 %    \begin{macrocode}
163 \gdef\new@fontshape#1#2#3#4{%
164      \warn@rel@i\new@fontshape\DeclareFontShape
165      \expandafter\scan@fontshape\@gobble#4<\@nil><<%
166      \DeclareFontShape U{#1}{#2}{#3}\reserved@f}
167 \@onlypreamble\new@fontshape
168 %    \end{macrocode}
169 % \end{macro}
172 %  \begin{macro}{\warn@rel@i}
173 %    The warning message used above.
174 %    \begin{macrocode}
175 \gdef\warn@rel@i#1#2{%
176  \@font@warning{***  NFSS release 1 command 
177                \noexpand#1found\MessageBreak 
178    ***  Update by using release 2 command 
179         \string#2.\MessageBreak 
180    ***  Recovery is probably possible}% 
182 \@onlypreamble\warn@rel@i
183 %    \end{macrocode}
184 %  \end{macro}
188 %  \begin{macro}{\scan@fontshape}
189 %    This will scan the old font shape definition syntax.
190 %    \begin{macrocode}
191 \gdef\scan@fontshape{%
192   \let\reserved@f\@empty
193   \let\reserved@e\@empty %        holds last info
194   \scan@@fontshape
196 \@onlypreamble\scan@fontshape
197 %    \end{macrocode}
198 %  \end{macro}
201 %  \begin{macro}{\scan@@fontshape}
202 %    \begin{macrocode}
203 \gdef\scan@@fontshape#1>#2#3<{%
204   \ifx\@nil#1%
205     \edef\reserved@f{\reserved@f\reserved@e}%
206   \else
207     \def\reserved@b{#1}%       nick names
208     \def\reserved@c{#3}%
209     \in@{ at}{#3}%
210     \ifin@
211       \in@{pt}{#3}%  not a proof but a good chance
212       \ifin@
213 %    \end{macrocode}
214 %    We grap also everything after pt and discard it if people have
215 %    forgotten to place a percent sign there.
216 % \changes{v2.1d}{1994/02/10}{scan away stuff after pt}
217 %    \begin{macrocode}
218         \def\reserved@a##1 at##2pt##3\@nil{%
219            \def\reserved@b{##2}%
220            \def\reserved@c{##1}%
221            }%
222         \reserved@a#3\@nil
223       \fi
224     \fi
225     \ifnum 0<0#2 
226       \edef\reserved@d{subf*\reserved@c}%
227       \ifcase #2\or
228       \or
229       \else
230         \errmessage{*** What's this? NFSS release 0? ***}%
231       \fi   
232     \else
233       \edef\reserved@d{#2\reserved@c}%
234     \fi
235     \ifx\reserved@d\reserved@e
236       \edef\reserved@f{\reserved@f<\reserved@b>}%
237     \else
238       \edef\reserved@f{\reserved@f\reserved@e<\reserved@b>}%add old info
239       \let\reserved@e\reserved@d
240     \fi
241     \expandafter\scan@@fontshape
242   \fi
244 \@onlypreamble\scan@@fontshape
245 %    \end{macrocode}
246 %  \end{macro}
250 % \begin{macro}{\subst@fontshape}
251 %    This is now also handled by the extend syntax of
252 %    |\DeclareFontShape|.
253 %    \begin{macrocode}
254 \gdef\subst@fontshape#1#2#3#4#5#6{%
255      \warn@rel@i\subst@fontshape\DeclareFontShape
256      \DeclareFontShape{U}{#1}{#2}{#3}{<->sub*#4/#5/#6}{}}
257 \@onlypreamble\subst@fontshape
258 %    \end{macrocode}
259 % \end{macro}
263 %  \begin{macro}{\extra@def}
264 %    This was replaced by |\DeclareFontFamily|.
265 %    \begin{macrocode}
266 \gdef\extra@def#1#2#3{%
267      \warn@rel@i\extra@def\DeclareFontFamily
268      \DeclareFontFamily{U}{#1}{}%
270 \@onlypreamble\extra@def
271 %    \end{macrocode}
272 %  \end{macro}
277 %  \begin{macro}{\default@mextra}
278 %    The new name is |\DeclareFontEncodingDefaults| but in this case
279 %    we don't feel comfortable with this either.
280 %    \begin{macrocode}
281 \gdef\default@mextra{%
282   \warn@rel@i\default@mextra\DeclareFontEncodingDefaults
283 %    \end{macrocode}
284 %    We pick up the argument to |\default@mextra| implicitly as
285 %    the second argument of |\DeclareFontEncodingDefaults|.
286 %    \begin{macrocode}
287   \DeclareFontEncodingDefaults\relax
289 \@onlypreamble\default@mextra
290 %    \end{macrocode}
291 %  \end{macro}
295 %  \begin{macro}{\preload@sizes}
296 %    The new interface is |\DeclarePreloadSizes|.
297 %    \begin{macrocode}
298 \gdef\preload@sizes{%
299      \warn@rel@i\preload@sizes\DeclarePreloadSizes
300      \DeclarePreloadSizes U%
302 \@onlypreamble\preload@sizes
303 %    \end{macrocode}
304 %  \end{macro}
307 %  \begin{macro}{\err@rel@i}
308 %    This macro is used in cases where emulation with NFSS2 features
309 %    is not really possible.
310 %    \begin{macrocode}
311 \gdef\err@rel@i#1#2{%
312   \@latex@error{***  NFSS release 1 command \noexpand#1found%
313           ^^J***  Recovery not possible. Use \string#2}% 
314        {The new release of NFSS doesn't support the
315         \noexpand#1command^^Jany longer.
316         Please upgrade your file to the syntax of NFSS
317         release 2^^Jusing the \noexpand#2command.}%
318 %    \end{macrocode}
319 %    Let's die.
320 %    \begin{macrocode}
321   \batchmode\input.\relax
323 \@onlypreamble\err@rel@i
324 %    \end{macrocode}
325 %  \end{macro}
329 % \begin{macro}{\newmathalphabet}
330 % \begin{macro}{\newmathalphabet@@}
331 % \begin{macro}{\newmathalphabet@@@}
332 %    |\newmathalphabet| is the old form.
333 %    \begin{macrocode}
334 \gdef\newmathalphabet{%
335   \if@no@font@opt
336     \@latex@error{*** NFSS release 1 command 
337                     \noexpand\newmathalphabet found%
338      ^^J \space*** Automatic recovery not possible.%
339      ^^J \space*** TYPE H for Help%
340               }% 
341        {Please look at the file usrguide.tex for hints on
342         how to resolve this problem.}%
343   \else
344      \warn@rel@i\newmathalphabet\DeclareMathAlphabet
345   \fi
346   \@ifstar\newmathalphabet@@@
347           \newmathalphabet@@}
348 \gdef\newmathalphabet@@#1{\DeclareMathAlphabet#1{U}{}{}{}}
349 \gdef\newmathalphabet@@@#1#2#3#4{%
350        \DeclareMathAlphabet{#1}{U}{#2}{#3}{#4}}
351 \@onlypreamble\newmathalphabet
352 \@onlypreamble\newmathalphabet@@
353 \@onlypreamble\newmathalphabet@@@
354 %    \end{macrocode}
355 % \end{macro}
356 % \end{macro}
357 % \end{macro}
359 %  \begin{macro}{\if@no@font@opt}
360 %  \begin{macro}{\@no@font@optfalse}
361 %    \begin{macrocode}
362 \global\let\if@no@font@opt\iftrue
363 \gdef\@no@font@optfalse{\let\if@no@font@opt\iffalse}
364 %    \end{macrocode}
365 % \end{macro}
366 % \end{macro}
368 %  \begin{macro}{\define@mathalphabet}
369 %    This is a case where dying is best.
370 %    \begin{macrocode}
371 \gdef\define@mathalphabet{%
372       \err@rel@i\define@mathalphabet\DeclareMathAlphabet
374 \@onlypreamble\define@mathalphabet
375 %    \end{macrocode}
376 %  \end{macro}
381 %  \begin{macro}{\define@mathgroup}
382 %    And here is another one
383 %    \begin{macrocode}
384 \gdef\define@mathgroup{%
385       \err@rel@i\define@mathgroup\DeclareSymbolFont
387 \@onlypreamble\define@mathgroup
388 %</compat>
389 %    \end{macrocode}
390 %  \end{macro}
393 % \begin{macro}{\addtoversion}
394 %    |\addtoversion| is the old form.
395 %    \begin{macrocode}
396 \def\addtoversion#1#2{%
397   \warn@rel@i\addtoversion\SetMathAlphabet
398   \SetMathAlphabet#2{#1}{U}}
399 \@onlypreamble\addtoversion
400 %    \end{macrocode}
401 % \end{macro}
405 % That finishes the definitions for the old interfaces --- but first
406 % we better finish the group.
407 %    \begin{macrocode}
408 %<*autoload>
409 \endgroup
410 %</autoload>
411 %    \end{macrocode}
413 % \Finale