guess we don't want the build dir
[latex2e.git] / trunk / base / ltoutenc.dtx
blob74700eb853a152a7f5869164deca5decdb4c9852
1 % \iffalse meta-comment
3 % Copyright 1993-2017
4 % The LaTeX3 Project and any individual authors listed elsewhere
5 % in this file.
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
22 % information.
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.
28 % \fi
29 % \iffalse
30 %%% From File: ltoutenc.dtx
31 %\NeedsTeXFormat{LaTeX2e}[2000/06/01]
32 %<OT1>\ProvidesFile{ot1enc.def}
33 %<T1>\ProvidesFile{t1enc.def}
34 %<OMS>\ProvidesFile{omsenc.def}
35 %<OML>\ProvidesFile{omlenc.def}
36 %<OT4>\ProvidesFile{ot4enc.def}
37 %<TS1>\ProvidesFile{ts1enc.def}[2001/06/05 v3.0e (jk/car/fm)
38 %<TU>\ProvidesFile{tuenc.def}
39 %<package>\ProvidesPackage{fontenc}
40 %<TS1sty>\ProvidesPackage{textcomp}
41 %<OT1|T1|OMS|OML|OT4|TU|package|TS1sty> [2017/04/05 v2.0i
42 %<OT1|T1|OMS|OML|OT4|TS1|TU>         Standard LaTeX file]
43 %<package|TS1sty>                 Standard LaTeX package]
45 %<*driver>
46 % \fi
47 \ProvidesFile{ltoutenc.dtx}
48              [2017/04/05 v2.0i LaTeX Kernel (font encodings)]
49 % \iffalse
50 \documentclass{ltxdoc}
51 \GetFileInfo{ltoutenc.dtx}
52 \title{\filename}
53 \date{\filedate}
54 \author{%
55   Johannes Braams\and
56   David Carlisle\and
57   Alan Jeffrey\and
58   Frank Mittelbach\and
59   Chris Rowley\and
60   Rainer Sch\"opf}
61 \usepackage{textcomp}
62 \begin{document}
63  \MaintainedByLaTeXTeam{latex}
64  \maketitle
65  \DocInput{\filename}
66 \end{document}
67 %</driver>
68 % \fi
72 % \changes{v1.99e}{2004/02/13}{Documentation fixes: typos}
73 % \changes{v1.9k}{1998/01/12}{Added \cs{ProvidesPackage}
74 %    for textcomp.sty}
75 % \changes{v1.9i}{1997/12/19}{Documentation corrections.}
76 % \changes{v1.9h}{1997/12/17}{Documentation changes and additions.}
77 % \changes{v1.9h}{1997/12/17}{Added textcomp.sty.}
78 % \changes{v1.9f}{1997/08/29}{Added OT4 encoding,
79 %    provided by Marcin Woli\'nski.}
80 % \changes{v1.7r}{1995/11/28}{doc fixes}
81 % \changes{v1.7h}{1995/04/21}{Added \cs{null} \cs{k}  latex/1274}
82 % \changes{v1.7f}{1994/12/14}{Added braces to \cs{copyright} so it
83 %    works unbraced in subscripts.}
84 % \changes{v1.7f}{1994/12/14}{Added check for math mode in
85 %    \cs{@changed@cmd}.}
86 % \changes{v1.7f}{1994/12/14}{Commented out \cs{textasciicircum},
87 %    \cs{textasciitilde}, \cs{textbackslash}, \cs{textbar},
88 %    \cs{textgreater}, \cs{texthyphenchar}, \cs{texthyphen} and
89 %    \cs{textless} to save memory.}
90 % \changes{v1.7e}{1994/12/10}{Added documentation for the OML encoding.}
91 % \changes{v1.7e}{1994/12/10}{Replaced width with \cs{@width} and
92 %    ditto height in vrules.}
93 % \changes{v1.7d}{1994/12/08}{Added \cs{null} and \cs{sh@ft} to \cs{b}
94 %    and \cs{d}.}
95 % \changes{v1.7c}{1994/12/05}{Added braces to \cs{textcircled}.}
96 % \changes{v1.7b}{1994/12/02}{Fixed a bug with \cs{a}.}
97 % \changes{v1.7a}{1994/11/30}{Added new code for encoding-specific
98 %    commands.  These now expand in the mouth, which means that
99 %    ligaturing and kerning can happen.}
100 % \changes{v1.6i}{1994/11/22}{Fixed empty accents.  Again.}
101 % \changes{v1.6i}{1994/11/22}{Corrected \cs{dots} so that there's no
102 %    kerning in monowidth fonts.}
103 % \changes{v1.6i}{1994/11/22}{Corrected typo with
104 %    \cs{mathunderscore}.}
105 % \changes{v1.6h}{1994/11/17}{(DPC) \cs{@tempa} to \cs{reserved@a}}
106 % \changes{v1.6d}{1994/11/02}{Wrapped lines longer than 70 characters.}
107 % \changes{v1.6d}{1994/10/30}{Added math commands.}
108 % \changes{v1.6d}{1994/10/30}{Added OML encoding.}
109 % \changes{v1.6d}{1994/10/30}{Added \cs{textcircled}.}
110 % \changes{v1.6d}{1994/10/30}{Added \cs{DeclareTextCompositeCommand}.}
111 % \changes{v1.6c}{1994/10/29}{Renamed \cs{P}, \cs{S}, \cs{dag} and
112 %    \cs{ddag} to \cs{textparagraph}, \cs{textsection},
113 %    \cs{textdagger} and \cs{textdaggerdbl}.}
114 % \changes{v1.6b}{1994/10/27}{Removed the enc.def files}
115 % \changes{v1.6a}{1994/10/25}{Added \cs{ProvideTextCommand},
116 %    \cs{UseTextSymbol},
117 %    \cs{UseTextAccent},
118 %    \cs{DeclareTextSymbolDefault},
119 %    \cs{DeclareTextAccentDefault},
120 %    \cs{DeclareTextCommandDefault}, and
121 %    \cs{ProvideTextCommandDefault}.}
122 % \changes{v1.5m}{1994/10/18}{Added new definitions of \cs{patterns}
123 %    and \cs{hyphenation}.}
124 % \changes{v1.5l}{1994/10/07}{Moved the ogonek accent.}
125 % \changes{v1.5k}{1994/05/18}{Removed braces from \cs{pounds} and
126 %    \cs{dollar}.}
127 % \changes{v1.5k}{1994/05/18}{Replaced \cs{defaultencoding} with
128 %    \cs{encodingdefault}.}
129 % \changes{v1.5k}{1994/05/18}{Made dotted-i produce `i'.}
130 % \changes{v1.5j}{1994/05/17}{Added braces to \cs{pounds} so it works
131 %    as a subscript.}
132 % \changes{v1.5i}{1994/05/16}{Fixed a bug with \cs{d}.}
133 % \changes{v1.5h}{1994/05/16}{Added \cs{NG}, \cs{ng}, \cs{TH},
134 %    \cs{th}, \cs{DH}, \cs{dh}, \cs{DJ} and \cs{dj}.}
135 % \changes{v1.5h}{1994/05/16}{Added \cs{r} (ring accent) and \cs{k}
136 %    (ogonek) accents.}
137 % \changes{v1.5h}{1994/05/16}{Removed \cs{P} from the OT1 definitions
138 %    file.}
139 % \changes{v1.5h}{1994/05/16}{Fixed a bug with \cs{pounds}.}
140 % \changes{v1.5g}{1994/05/16}{Made fontenc.sty use the new mixed-case
141 %    encoding files.}
142 % \changes{v1.5f}{1994/05/16}{Revert code so that the encoding
143 %                    given is used in \cs{DeclareTextCommand} (FMi)}
144 % \changes{v1.5f}{1994/05/16}{enc files now have uc encoding name
145 %                             parts (FMi)}
146 % \changes{v1.5e}{1994/05/14}{Replaced \cs{ENC@cmd} by \cs{ENC-cmd}.}
147 % \changes{v1.5d}{1994/05/14}{Rewrote \cs{DeclareTextCommand} to define
148 %    its argument to use the current encoding by default, rather than
149 %    the encoding provided to \cs{DeclareTextCommand}.}
150 % \changes{v1.5d}{1994/05/14}{Tidied up the documentation.}
151 % \changes{v1.5c}{1994/05/14}{Added the fontenc package.}
152 % \changes{v1.5c}{1994/05/14}{Fixed a bug which caused an infinite loop
153 %    if \cs{f@encoding} was incorrectly set.}
154 % \changes{v1.5c}{1994/05/14}{Moved fontsmpl to its own dtx file.}
155 % \changes{v1.5b}{1994/05/13}{Added \cmd\{, \cmd\} and \cmd\$.}
156 % \changes{v1.5b}{1994/05/13}
157 %    {Replaces \cs{space} by `~' in \cs{csname}.}
158 % \changes{v1.5b}{1994/05/13}{Renamed \cs{DeclareProtectedCommand} to
159 %    \cs{DeclareRobustCommand}.}
160 % \changes{v1.5a}{1994/05/11}{Renamed the commands again.  Made the
161 %    encoding part of the command syntax.  Added the
162 %    \cs{DeclareTextCommand} interface.  Used
163 %    \cs{DeclareProtectedCommand}.}
164 % \changes{v1.4a}{1994/05/01}{Renamed the commands, removed the
165 %    \cs{EncodingSpecific} command.  Turned all slots into decimal.
166 %    Added \cs{a}.}
167 % \changes{v1.4a}{1994/05/01}{Removed Rokicki's encoding.}
168 % \changes{v1.3d}{1993/12/18}{Some T1 stuff had drifted into the OT1
169 %    file.}
170 % \changes{v1.3c}{1993/12/18}{A new syntax, separating
171 %    accent-definitions from encoding-specific definitions, and
172 %    allowing encoding-specific \cs{chardef}, \cs{let}, etc.}
173 % \changes{v1.3c}{1993/12/18}{Rewrote for the new syntax of
174 %    \cs{EncodingSpecific}.}
175 % \changes{v1.3b}{1993/12/18}{Corrected typos.}
176 % \changes{v1.3b}{1993/12/18}{Replaced the missing last argument to
177 %    \cs{DeclareFontEncoding}.}
178 % \changes{v1.3a}{1993/12/18}{Replaced OT3 by XXX}
179 % \changes{v1.3}{1993/12/17}{Added \cs{EncodingSpecificAccent},
180 %   \cs{EncodingSpecificAccentedLetter} and
181 %   \cs{EncodingSpecificCommand}.}
182 % \changes{v1.3}{1993/12/17}{Made Rokicki's encoding a proper encoding
183 %    scheme rather than a variant of OT1.}
184 % \changes{v1.2b}{1993/12/13}{Corrected file name in driver code.}
185 % \changes{v1.2a}{1993/12/11}{Corrected for t1enc, math.}
186 % \changes{v1.2}{1993/12/10}{Added source code for t1enc.sty.}
187 % \changes{v1.1}{1993/12/07}{Made all character numbers decimal.}
188 % \changes{v1.1}{1993/12/07}{Removed a lot of equal signs and the
189 %   like.}
190 % \changes{v1.99m}{2015/02/21}
191 %         {Removed autoload code}
194 % \section{Font encodings}
196 %    This section of the kernel contains commands for declaring
197 %    encoding-specific
198 %    commands, such as accents.  It also contains the code for some of
199 %    the encoding files, including |omlenc.def|,
200 %    |omsenc.def|, |t1enc.def| and |ot1enc.def| files, which define
201 %    the |OLM|,
202 %    |OMS|, |T1| and |OT1| encodings, and the |fontenc| package
203 %    for selecting encodings.
205 %    The |fontenc| package has options for encodings, of which the
206 %    last option is the default encoding.  For example, to use the
207 %    |OT2|, |OT3| and |T1| encodings, with |T1| as the default, you
208 %    say:
209 %\begin{verbatim}
210 %    \usepackage[OT2,OT3,T1]{fontenc}
211 %\end{verbatim}
212 %    The standard kernel set-up loads font encoding files and selects
213 %    an encoding as follows.
214 %\begin{verbatim}
215 %    \input {omlenc.def}
216 %    \input  {t1enc.def}
217 %    \input {ot1enc.def}
218 %    \input {omsenc.def}
219 %    \fontencoding{OT1}
220 %\end{verbatim}
221 %    Note that the files in the standard |inputenc| package depend on
222 %    this behaviour of the kernel.
224 %    The syntax for declaring encoding-specific commands is:
225 %    \begin{quote}
226 %      |\DeclareTextCommand{|^^A
227 %         \meta{command}|}{|^^A
228 %         \meta{encoding}|}|\\\hspace*{\fill}|[|^^A
229 %         \meta{number}|][|^^A
230 %         \meta{default}|]{|^^A
231 %         \meta{commands}|}|
232 %    \end{quote}
233 %    This command is like |\newcommand|, except that it defines a
234 %    command which is specific to one encoding.  The resulting command
235 %    is always robust, even if its definition is fragile.  For example,
236 %    the definition of |\l| in the |OT1| encoding is:
237 %\begin{verbatim}
238 %    \DeclareTextCommand{\l}{OT1}{{\@xxxii l}}
239 %\end{verbatim}
240 %    |\DeclareTextCommand| takes the same optional arguments as
241 %    |\newcommand|.
242 %    \begin{quote}
243 %      |\ProvideTextCommand{|^^A
244 %         \meta{command}|}{|^^A
245 %         \meta{encoding}|}|\\\hspace*{\fill}|[|^^A
246 %         \meta{number}|][|^^A
247 %         \meta{default}|]{|^^A
248 %         \meta{commands}|}|
249 %    \end{quote}
250 %    This acts like |\DeclareTextCommand|, but does nothing if the
251 %    command is already defined.
252 %    \begin{quote}
253 %      |\DeclareTextSymbol{|^^A
254 %         \meta{command}|}{|^^A
255 %         \meta{encoding}|}{|^^A
256 %         \meta{slot}|}|
257 %    \end{quote}
258 %    This command defines a text symbol, with a particular slot in that
259 %    encoding.  The commands:
260 % \changes{v1.9h}{1997/12/17}{Example corrected, braces removed.}
261 %\begin{verbatim}
262 %    \DeclareTextSymbol{\ss}{OT1}{25}
263 %    \DeclareTextCommand{\ss}{OT1}{\char25 }
264 %\end{verbatim}
265 %    have the same effect, but the |\DeclareTextSymbol| is faster.
266 %    \begin{quote}
267 %      |\DeclareTextAccent{|^^A
268 %         \meta{command}|}{|^^A
269 %         \meta{encoding}|}{|^^A
270 %         \meta{slot}|}|
271 %    \end{quote}
272 % \changes{v1.8e}{1996/11/23}{Corrected description}
273 % \changes{v1.9k}{1997/12/31}{Further correction}
274 %    This command declares a text accent.  The commands:
275 %\begin{verbatim}
276 %    \DeclareTextAccent{\"}{OT1}{127}
277 %    \DeclareTextCommand{\"}{OT1}{\add@accent {127}}
278 %\end{verbatim}
279 %    have the same effect.
280 % \changes{v1.8c}{1996/10/27}
281 %      {Corrected syntax descriptions}
282 %    \begin{quote}
283 %      |\DeclareTextComposite{|^^A
284 %          \meta{command}|}|\\\hspace*{\fill}|{|^^A
285 %         \meta{encoding}|}{|^^A
286 %         \meta{argument}|}{|^^A
287 %             \meta{slot}|}|
288 %    \end{quote}
289 %    This command declares a composite letter, for example in the |T1|
290 %    encoding |\'{a}| is slot 225, which is declared by:
291 %\begin{verbatim}
292 %    \DeclareTextComposite{\'}{T1}{a}{225}
293 %\end{verbatim}
294 % \changes{v1.8e}{1996/11/23}
295 %      {Corrected description}
296 %    The \emph{command} will normally have been declared with
297 %    |\DeclareTextAccent|, or as a one-argument |\DeclareTextCommand|.
299 %    |\DeclareTextComposite| is the most common example of using
300 %    the more general declaration
301 %    |\DeclareTextCompositeCommand|, which can define a composite
302 %    to be an arbitrary piece of text.
303 %    \begin{quote}
304 %      |\DeclareTextCompositeCommand{|^^A
305 %          \meta{command}|}|\\\hspace*{\fill}|{|^^A
306 %         \meta{encoding}|}{|^^A
307 %         \meta{argument}|}{|^^A
308 %             \meta{text}|}|
309 %    \end{quote}
310 %    For example, in the OT1 encoding \r A has a hand-crafted
311 %    definition this is declared as follows
312 %\begin{verbatim}
313 %    \DeclareTextCompositeCommand{\r}{OT1}{A}
314 %     {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex%
315 %      \rlap{\raise.67\dimen@\hbox{\char23}}A}
316 %\end{verbatim}
317 % \changes{v1.8e}{1996/11/23}
318 %      {Corrected description}
319 %    The \emph{command} will normally have been declared with
320 %    |\DeclareTextAccent|, or as a one-argument |\DeclareTextCommand|.
322 %    The commands defined using the above declarations can be used in
323 %    two ways.
324 %    Normally they are used by just calling the command in the
325 %    appropriate encoding, for example |\ss|.  However, sometimes you
326 %    may wish to use a command in an encoding where it is not defined.
327 %    If the command has no arguments, then you can use it in another
328 %    encoding by calling |\UseTextSymbol|:
329 %    \begin{quote}
330 %      |\UseTextSymbol{|^^A
331 %         \meta{encoding}|}{|^^A
332 %         \meta{command}|}|
333 %    \end{quote}
335 % \task{?}{Document the problems of these commands, see pr/3160}
336 % \changes{v1.9e}{1997/08/05}{Corrected order of arguments in
337 %          \cs{UseTextSymbol} example.}
338 %    For example, |\UseTextSymbol{OT1}{\ss}| has the same effect as:
339 %\begin{verbatim}
340 %    {\fontencoding{OT1}\selectfont\ss}
341 %\end{verbatim}
342 %    If the command has one argument then you can use it in another
343 %    encoding by calling
344 %    |\UseTextAccent|:
345 %    \begin{quote}
346 %      |\UseTextAccent{|^^A
347 %         \meta{encoding}|}{|^^A
348 %         \meta{command}|}{|^^A
349 %         \meta{text}|}|
350 %    \end{quote}
351 %    For example, if the current encoding is |OT2| then
352 %    |\UseTextAccent{OT1}{\'}{a}| has the same effect as:
353 %\begin{verbatim}
354 %    {\fontencoding{OT1}\selectfont\'{\fontencoding{OT2}\selectfont a}}
355 %\end{verbatim}
356 % \changes{v1.8e}{1996/11/23}
357 %      {Extended description}
358 %    You can also declare a default definition for a text command, which
359 %    will be used if the current encoding has no appropriate definition.
360 %    Such use will also set the definition for this command in the
361 %    current encoding to equal this default definition; this makes
362 %    subsequent uses of the command much faster.
363 %    \begin{quote}
364 %      |\DeclareTextCommandDefault{|^^A
365 %         \meta{command}|}{|^^A
366 %         \meta{definition}|}|
367 %    \end{quote}
368 %    For example, the default definition of the command
369 %    |\textonequarter| (which produces the fraction $\frac14$) could be
370 %    built using math mode:
371 %\begin{verbatim}
372 %    \DeclareTextCommandDefault{\textonequarter}{\ensuremath {\frac14}}
373 %\end{verbatim}
374 %    There is a matching |\Provide| command which will not override an
375 %    existing default definition:
376 %    \begin{quote}
377 %      |\ProvideTextCommandDefault{|^^A
378 %         \meta{command}|}{|^^A
379 %         \meta{definition}|}|
380 %    \end{quote}
381 %    The most common use for these commands is to use symbols from
382 %    other encodings, so there are some optimizations provided:
383 %    \begin{quote}
384 %      |\DeclareTextSymbolDefault{|^^A
385 %         \meta{command}|}|^^A
386 %         \meta{encoding}|}|\\
387 %      |\DeclareTextAccentDefault{|^^A
388 %         \meta{command}|}|^^A
389 %         \meta{encoding}|}|
390 %    \end{quote}
391 %    are short for:
392 %    \begin{quote}
393 %      |\DeclareTextCommandDefault{|^^A
394 %         \meta{command}|}|\\\hspace*{\fill}^^A
395 %         |{\UseTextSymbol{|^^A
396 %         \meta{encoding}|}{|\meta{command}|}}| \\
397 %      |\DeclareTextCommandDefault[1]{|^^A
398 %         \meta{command}|}|\\\hspace*{\fill}^^A
399 %         |{\UseTextAccent{|^^A
400 %         \meta{encoding}|}{|\meta{command}|}{#1}}|
401 %    \end{quote}
402 %    For example, to make |OT1| the default encoding for |\ss| and
403 %    |\'| you say:
404 %\begin{verbatim}
405 %    \DeclareTextSymbolDefault{\ss}{OT1}
406 %    \DeclareTextAccentDefault{\'}{OT1}
407 %\end{verbatim}
408 %    Note that you can use these commands on any zero- or one-argument
409 %    commands declared with |\DeclareText*| or |\ProvideText*|, not
410 %    just those defined using |\DeclareTextSymbol| or
411 %    |\DeclareTextAccent|.
413 % \subsection{Removing encoding-specific commands}
414 %    \label{sec:removeencspec}
416 % \changes{v1.9o}{1998/03/20}{Documentation added for pr/2783}
418 % In some cases encoding definitions are given to provide some limited
419 % support since nothing better is available, for example, the definition
420 % for |\textdollar| in \texttt{OT1} is a hack since \$ and \pounds{}
421 % actually share the same slot in this encoding. Thus if such a glyph
422 % becomes available in a different encoding (e.g., \texttt{TS1}) one
423 % would like to get rid of the flacky one and make the default
424 % definition point to the new encoding. In such a case defining
425 %\begin{verbatim}
426 %   \DeclareTextSymbol{\textdollar}{TS1}{36}
427 %   \DeclareTextSymbolDefault{\textdollar}{TS1}
428 %\end{verbatim}
429 % is not enough since if typesetting in \texttt{OT1} \LaTeX{} will
430 % still find the encoding specific-definition for \texttt{OT1} and
431 % therefore ignore the new default.
432 % Therefore to ensure that in this case the \texttt{TS1} version is
433 % used  we have to remove the \texttt{OT1} declaration:
434 %\begin{verbatim}
435 %   \UndeclareTextCommand{\textdollar}{OT1}
436 %\end{verbatim}
438 % Since the \$ sign is a proper glyph in the \texttt{T1} encoding there
439 % is no point removing its definition and forcing \LaTeX{} to pick up
440 % the \texttt{TS1} version if typesetting in this encoding.
441 % However, assume you want to use the variant dollar sign,
442 % i.e., \textdollaroldstyle{}
443 % for your dollars. In that case you have to get rid of the \texttt{T1}
444 % declaration as well, e.g., the following would do that for you:
445 %\begin{verbatim}
446 %   \UndeclareTextCommand{\textdollar}{OT1}
447 %   \UndeclareTextCommand{\textdollar} {T1}
448 %   \DeclareTextCommandDefault{\textdollar}
449 %                             {\UseTextSymbol{TS1}\textdollaroldstyle}
450 %\end{verbatim}
452 % \subsection{The order of declarations}\label{sec:orderofdecls}
454 % \changes{v1.9o}{1998/03/20}{Documentation added about order of decls}
456 % If an encoding-specific command is defined for more than one encoding,
457 % then it will execute fastest in the encoding in which it was defined
458 % last since its top-level definition will be set up to execute in that
459 % encoding without any overhead.
461 % For this reason the file \texttt{fonttext.ltx} currently first loads
462 % the definitions for the \texttt{T1} encoding and then those for the
463 % \texttt{OT1} encoding so that typesetting in \texttt{OT1} is optimized
464 % since that is (still) the default. However, when \texttt{T1} is
465 % explicitly requested (via |\usepackage[T1]{fontenc}|) the
466 % top-level definitions are automatically changed to favour
467 % \texttt{T1} since its declarations are reloaded in the process.
469 % For the same reason default declarations should never come last since
470 % they are implemented as a special encoding themselves (with the
471 % name |?|).
472 % Specifying them last would simply mean to make those encoding-specific
473 % commands equally inefficient in all encodings. Therefore the
474 % \texttt{textcomp} package, for example, first sets up all defaults
475 % to point to \texttt{TS1} and then declares the commands in the
476 % \texttt{TS1} encoding.
479 % \StopEventually{}
481 % \subsection{Docstrip modules}
483 %    This |.dtx| file is be used to generate several related files
484 %    containing font encoding definitions. The mutually exclusive
485 %    docstrip options are listed here.
486 %    \begin{center}
487 %    \begin{tabular}{lp{10cm}}
488 %      |T1|       & generates |t1enc.def| for the Cork encoding. \\
489 %      |TS1|      & generates |ts1enc.def| for the Text Companion
490 %                   encoding. \\
491 %      |TS1sty|   & generates |textcomp.sty|, package that sets up use
492 %                   of the Text Companion encoding. \\
493 %      |OT1|      & generates |ot1enc.def| for Knuth's CM encoding. \\
494 %      |OMS|      & generates |omsenc.def| for Knuth's
495 %                   math symbol encoding. \\
496 %      |OML|      & generates |omlenc.def| for Knuth's
497 %                   math letters encoding. \\
498 %      |OT4|      & generates |ot4enc.def| for the Polish extension to
499 %                   the OT1 encoding, created by B.~Jackowski and
500 %                   M.~Ry\'cko for use with the Polish version of
501 %                   Computer Modern and Computer Concrete.\\
502 %      |TU|       & generates |tuenc.def| for Unicode font
503 %                   encoding. \\
504 %      |package|  & generates |fontenc.sty| for
505 %                   selecting encodings. \\
506 %      |2ekernel| & for the kernel commands.\\
507 %    \end{tabular}
508 %    \end{center}
509 % \changes{1.0d}{1993/07/17}{changed \cs{catcoding} @}
510 % \changes{1.0f}{1993/08/13}{Protected against active @ sign.}
511 % \changes{1.0g}{1993/08/16}{Needs space after \cs{string}}
512 % \changes{1.1}{1993/12/07}{Protected all special characters with
513 %                          \cs{string}.}
514 % \changes{1.3}{1993/12/17}{Removed the catcode hackery, since the file
515 %    is only read as a package in the preamble, and removed all the
516 %    messages on the screen, which just confuse users.  Replaced them
517 %    by the appropriate \cs{ProvidesPackage} commands. Added XXXenc.}
518 % \changes{1.3b}{1993/12/18}
519 %   {Fixed typos with \cs{ProvidesPackage} lines.
520 %    Added the \cs{NeedsTeXFormat} line.  Added the last argument to
521 %    \cs{DeclareEncoding}. Moved the use of the encodings to after their
522 %    declaration. }
523 % \changes{1.4a}{1994/04/29}{Removed Rokicki's OT1 variant encoding.
524 %    Moved the driver to the top.}
525 % \changes{1.5a}{1994/05/11}{Made T1 and OT1 generate packages rather
526 %    than def files.  Renamed the `package' module to `teststy'.}
527 % \changes{1.5d}{1994/05/14}{Moved the driver to the top.}
529 % \subsection{Definitions for the kernel}
531 % \subsubsection{Declaration commands}
533 % \changes{1.3}{1993/12/17}{Added this section}
534 % \changes{1.3c}{1993/12/18}{Split \cs{EncodingSpecificAccent} up into
535 %    \cs{EncodingSpecific} and \cs{DeclareAccent}.}
536 % \changes{1.4a}{1994/04/29}{Removed \cs{EncodingSpecific}.  Renamed
537 %    all the commands.  Added \cs{DeclareTextGlyph} and
538 %    \cs{UndeclareTextCommand}.}
539 % \changes{v1.5a}{1994/05/11}{Reimplemented \cs{DeclareTextCommand}
540 %    using \cs{@changed@cmd} and \cs{DeclareProtectedCommand}.}
541 % \changes{v1.5c}{1994/05/14}{Fixed a bug which caused an infinite loop
542 %    if \cs{f@encoding} was incorrectly set.}
543 % \changes{v1.5d}{1994/05/14}{Rewrote \cs{DeclareTextCommand} to define
544 %    its argument to use the current encoding by default, rather than
545 %    the encoding provided to \cs{DeclareTextCommand}.}
546 % \changes{v1.6a}{1994/10/25}{Added the \cs{Provide} commands,
547 %    and the default definitions.}
549 % This section contains definitions for commands such as accents which
550 % depend on the current encoding.  These commands will usually be kept
551 % in |.def| files, for example |ot1enc.def| contains the definitions
552 % for the |OT1| encoding.
553 %    \begin{macrocode}
554 %<*2ekernel>
555 \message{font encodings,}
556 %    \end{macrocode}
558 % \changes{v1.5d}{1994/10/27}{Rewrote \cs{DeclareTextSymbol} to define
559 %    its argument to use the current encoding by default, to fit with
560 %    \cs{DeclareTextCommand}.}
562 % \changes{v1.7a}{1994/11/30}{Redefined \cs{@changed@cmd} to expand in
563 %    the mouth.}
564 % \changes{v1.7a}{1994/11/30}{Removed \cs{@changed@x@mouth} since
565 %    \cs{@changed@x} now expands in the mouth.}
567 % \changes{v1.7r}{1995/11/28}{Renamed \cs{@changed@x@err} to
568 %    \cs{TextSymbolUnavailable}.}
569 % \changes{v1.7r}{1995/11/28}{Added math mode checks to text commands.}
570 % Far too many macros in one block here!
571 % \begin{macro}{\DeclareTextCommand}
572 % \begin{macro}{\ProvideTextCommand}
573 % \begin{macro}{\DeclareTextSymbol}
574 % \begin{macro}{\@dec@text@cmd}
575 % \begin{macro}{\chardef@text@cmd}
576 % \begin{macro}{\@changed@cmd}
577 % \begin{macro}{\@changed@x}
578 % \begin{macro}{\TextSymbolUnavailable}
579 % \begin{macro}{\@inmathwarn}
580 %    If you say:
581 %\begin{verbatim}
582 %    \DeclareTextCommand{\foo}{T1}...
583 %\end{verbatim}
584 %    then |\foo| is defined to be |\T1-cmd \foo \T1\foo|,
585 %    where |\T1\foo| is \emph{one} control sequence, not two!
586 %    We then call |\newcommand| to define |\T1\foo|.
587 %    \begin{macrocode}
588 \def\DeclareTextCommand{%
589    \@dec@text@cmd\newcommand}
590 %    \end{macrocode}
592 %    \begin{macrocode}
593 \def\ProvideTextCommand{%
594    \@dec@text@cmd\providecommand}
595 %    \end{macrocode}
597 %    \begin{macrocode}
598 \def\@dec@text@cmd#1#2#3{%
599    \expandafter\def\expandafter#2%
600       \expandafter{%
601          \csname#3-cmd\expandafter\endcsname
602          \expandafter#2%
603          \csname#3\string#2\endcsname
604       }%
605    \let\@ifdefinable\@rc@ifdefinable
606    \expandafter#1\csname#3\string#2\endcsname}
607 %    \end{macrocode}
608 % \changes{v1.99d}{2004/02/06}{New command added to fix
609 %     severe bug: pr/3563}
610 %    This command was introduced to fix a major bug
611 %    in |\@dec@text@cmd| without changing that command itself.
612 %    This was thought to be necessary because it is defined
613 %    in more than one package. (Perhaps the more serious bug is to put
614 %    complex low-level commands like this in packages?)
616 %    The problem it solves is that whereas both |\newcommand| and
617 %    |\providecommand| (used just above) both handle the
618 %    resetting of |\@ifdefinable| (following its disabling in
619 %    |\@dec@text@cmd|), the primitive |\chardef| neither needs the
620 %    disabling, nor does the resetting.
622 %    \begin{macrocode}
623 \def\chardef@text@cmd{%
624    \let\@ifdefinable\@@ifdefinable
625    \chardef
626   }
627 \def\DeclareTextSymbol#1#2#3{%
628    \@dec@text@cmd\chardef@text@cmd#1{#2}#3\relax
629   }
630 %    \end{macrocode}
632 %    The declarations are only available before |\begin{document}|.
633 % \changes{v1.7h}{1995/05/21}{Added several \cs{@onlypreamble}}
634 % \changes{v1.7k}{1995/06/05}{Removed \cs{protected@cmd} and replaced
635 %    with explicit \cs{noexpand}.}
636 %    \begin{macrocode}
637 \@onlypreamble\DeclareTextCommand
638 \@onlypreamble\DeclareTextSymbol
639 %    \end{macrocode}
640 %    The sneaky bit in all this is what |\T1-cmd \foo \T1\foo| does.
641 %    There are five possibilities, depending on the current values of
642 %    |\protect|, |\cf@encoding| and |\ifmmode|:
643 %    \begin{itemize}
644 %    \item If |\protect| is |\@typeset@protect| and |\cf@encoding| is
645 %       |T1|, then we execute |\T1\foo|.  This should be the normal
646 %       behaviour, and is optimized for speed.
647 %    \item If |\protect| is |\@typeset@protect|, |\cf@encoding| is
648 %       (say) |OT1|, and |\OT1\foo| is defined, then we execute
649 %       |\OT1\foo|.
650 %    \item If |\protect| is |\@typeset@protect|, |\cf@encoding| is
651 %       (say) |OT1|, we're in text mode,
652 %       and |\OT1\foo| is undefined, then we define
653 %       |\OT1\foo| to be the default value of |\foo|, and execute
654 %       |\OT1\foo|.
655 %    \item If |\protect| is |\@typeset@protect|, |\cf@encoding| is
656 %       (say) |OT1|, we're in math mode,
657 %       and |\OT1\foo| is undefined, then we execute the default value
658 %       of |\foo|.  (This is necessary so that things like
659 %       |$X_\copyright$| work properly.)
660 %    \item If |\protect| is not |\@typeset@protect| then we execute
661 %       |\noexpand\foo|.  For example, if we are writing to a file,
662 %       then this results in |\foo| being written.  If we are in a
663 %       |\mark|, then |\foo| will be put in the mark---since |\foo| is
664 %       robust, it will then survive all the things which may happen
665 %       to it whilst it's a |\mark|.
666 %    \end{itemize}
667 %    So after all that, we will either execute the appropriate
668 %    definition of |\foo| for the current encoding, or we will execute
669 %    |\noexpand\foo|.
671 %    The default value of |\foo| is |\?\foo| if it is defined, and an
672 %    error message otherwise.
674 %    When the encoding is changed from |T1| to |OT1|, |\T1-cmd| is
675 %    defined to be |\@changed@cmd| and |\OT1-cmd| is defined to be
676 %    |\@current@cmd|.  This means that the test for what the current
677 %    encoding is can be performed quickly.
678 %    \begin{macrocode}
679 \def\@current@cmd#1{%
680    \ifx\protect\@typeset@protect
681       \@inmathwarn#1%
682    \else
683       \noexpand#1\expandafter\@gobble
684    \fi}
685 %    \end{macrocode}
687 %    \begin{macrocode}
688 \def\@changed@cmd#1#2{%
689    \ifx\protect\@typeset@protect
690       \@inmathwarn#1%
691       \expandafter\ifx\csname\cf@encoding\string#1\endcsname\relax
692          \expandafter\ifx\csname ?\string#1\endcsname\relax
693             \expandafter\def\csname ?\string#1\endcsname{%
694                \TextSymbolUnavailable#1%
695             }%
696          \fi
697          \global\expandafter\let
698                \csname\cf@encoding \string#1\expandafter\endcsname
699                \csname ?\string#1\endcsname
700       \fi
701       \csname\cf@encoding\string#1%
702          \expandafter\endcsname
703    \else
704       \noexpand#1%
705    \fi}
706 %    \end{macrocode}
707 % \changes{v1.7m}{1995/10/09}{Autoload error}
708 % \changes{v1.7v}{1995/12/05}{Changed \cs{TextSymbolUnavailable} text}
709 %    \begin{macrocode}
710 \gdef\TextSymbolUnavailable#1{%
711    \@latex@error{%
712       Command \protect#1 unavailable in encoding \cf@encoding%
713    }\@eha}
714 %    \end{macrocode}
715 %    The command |\@inmathwarn| produces a warning message if we are
716 %    currently in math mode.  Note that since this command is used
717 %    inside text commands, it can't call |\relax| before the
718 %    |\ifmmode|.  This means that it is possible for the warning to
719 %    fail to be issued at the beginning of a row of an halign whose
720 %    template enters math mode.  This is probably a bad feature, but
721 %    there's not much that can be done about it, since adding a |\relax|
722 %    would break ligatures and kerning between text symbols.
724 %    A more efficient solution would be to make |\@inmathwarn| and
725 %    |\@inmatherr| equal to |\@empty| and |\relax| by default, and
726 %    to have
727 %    |\everymath| reset them to their usual definitions.  This is left
728 %    for future investigation (for example it may break some third
729 %    party code).
730 %    \begin{macrocode}
731 \def\@inmathwarn#1{%
732    \ifmmode
733       \@latex@warning{Command \protect#1 invalid in math mode}%
734    \fi}
735 %    \end{macrocode}
736 % \end{macro}
737 % \end{macro}
738 % \end{macro}
739 % \end{macro}
740 % \end{macro}
741 % \end{macro}
742 % \end{macro}
743 % \end{macro}
744 % \end{macro}
746 % \changes{v1.7k}{1995/06/05}{Allowed \cs{ProvideTextCommandDefault}
747 %    after the preamble.}
749 % \begin{macro}{\DeclareTextCommandDefault}
750 % \begin{macro}{\ProvideTextCommandDefault}
751 %    These define commands with encoding |?|.
753 %    Note that |\DeclareTextCommandDefault| can only be used in the
754 %    preamble, but that the |\Provide| version is allowed in inputenc
755 %    |.def| files, so is allowed anywhere.
756 %    \begin{macrocode}
757 \def\DeclareTextCommandDefault#1{%
758    \DeclareTextCommand#1?}
759 %    \end{macrocode}
761 %    \begin{macrocode}
762 \def\ProvideTextCommandDefault#1{%
763    \ProvideTextCommand#1?}
764 %    \end{macrocode}
766 %    \begin{macrocode}
767 \@onlypreamble\DeclareTextCommandDefault
768 %\@onlypreamble\ProvideTextCommandDefault
769 %    \end{macrocode}
770 %    They require |\?-cmd| to be initialized as |\@changed@cmd|.
771 %    \begin{macrocode}
772 \expandafter\let\csname?-cmd\endcsname\@changed@cmd
773 %    \end{macrocode}
774 % \end{macro}
775 % \end{macro}
777 % \begin{macro}{\DeclareTextAccent}
778 % \changes{v1.5a}{1994/05/11}
779 %      {Reimplemented using \cs{DeclareTextCommand}.}
780 % \changes{v1.7z}{1996/05/23}
781 %      {Reimplemented using \cs{add@accent} to save space latex/2133}
782 %    This is just a disguise for defining a \TeX~|\accent| command.
783 %    \begin{macrocode}
784 \def\DeclareTextAccent#1#2#3{%
785    \DeclareTextCommand#1{#2}{\add@accent{#3}}}
786 %    \end{macrocode}
788 %    \begin{macrocode}
789 \@onlypreamble\DeclareTextAccent
790 %    \end{macrocode}
791 % \end{macro}
793 % \changes{v1.7a}{1994/11/30}{Rewrote \cs{@text@composite} so it
794 %    allows an empty argument, or an argument containing lots of
795 %    commands.}
797 %  \begin{macro}{\add@accent}
798 % \changes{v1.7z}{1996/05/23}{macro added. latex/2133}
799 % \changes{v1.91}{2000/08/30}{Rearranged but no change to final code,
800 %    CAR (pr/3160)}
801 % To save space this code is shared between all text accents that are
802 % set using the |\accent| primitive.
803 % The argument is pre-set in a box so that any
804 % font loading that is needed is already done within the box.
805 % This is needed because font-loading involves grouping and that would
806 % prevent the accent mechanism from working so that the accent would
807 % not be positioned over the argument.
808 % Declarations that change the font should be allowed (only low-level
809 % ones are at present) inside the argument of an accent command,
810 % but not size changes, as they involve |\setbox| operations which
811 % also inhibit the mechanism of the |\accent| primitive.
813 % Note that the whole process is within a group.
814 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
815 %    (pr/3160)}
816 %    For a detailed discussion of this reimplementation and its
817 %    deficiencies, see pr/3160.
818 % \task{?}{Improve this and document its problems, see pr/3160}
819 % \changes{v1.9z}{2000/01/30}{Macro reimplemented (pr/3160)}
820 %    \begin{macrocode}
821 \def\add@accent#1#2{\hmode@bgroup
822 %    \end{macrocode}
823 %    Turn off the group in |\UseTextSymbol| in case this is used
824 %    inside the argument of |\add@accent|.
825 %    \begin{macrocode}
826    \let\hmode@start@before@group\@firstofone
827    \setbox\@tempboxa\hbox{#2%
828 %    \end{macrocode}
829 %    When presetting the argument in a box we record its |\spacefactor|
830 %    for later use after the accent got typeset. This way something like
831 %    |\`A| gets the spacefactor of |A| (i.e., 999) rather than the
832 %    default value of 1000.
833 % \changes{v1.9q}{1998/06/12}
834 %    {Explicitly set \cs{spacefactor} after \cs{accent} (pr/2877)}
835 %    \begin{macrocode}
836       \global\mathchardef\accent@spacefactor\spacefactor}%
837    \accent#1 #2\egroup\spacefactor\accent@spacefactor}
838 %    \end{macrocode}
839 %    Default definition for |\accent@spacefactor| prevents a horrible
840 %    death of the above macro inside an unprotected |\edef|.
841 % \changes{v1.9w}{1999/10/28}{Give \cs{accent@spacefactor} a default
842 %    definition (pr/3084)}
843 %    \begin{macrocode}
844 \let\accent@spacefactor\relax
845 %    \end{macrocode}
846 %  \end{macro}
848 % \begin{macro}{\hmode@bgroup}
849 % \changes{v1.9y}{2000/01/30}{Macro added}
850 %    \begin{macrocode}
851 \def\hmode@bgroup{\leavevmode\bgroup}
852 %    \end{macrocode}
853 %  \end{macro}
856 % \begin{macro}{\DeclareTextCompositeCommand}
857 % \changes{v1.7z}{1996/05/23}
858 %      {Modified to cope with new \cs{add@accent} command: required
859 %      removal of check for one argument-command}
860 % \changes{v2.0h}{2017/02/24}{%
861 %     add check whether the accent command is defined for this encoding}
862 % \changes{v2.0i}{2017/04/05}{%
863 %     Declare accent command if not already declared when declaring a composite.}
864 % \begin{macro}{\DeclareTextComposite}
865 % \changes{v1.7l}{1995/06/09}{Rewrote \cs{DeclareTextComposite} to
866 %    define the composite as a no-argument command rather than a
867 %    two-argument command.}
868 % \begin{macro}{\@text@composite}
869 % \begin{macro}{\@text@composite@x}
870 % \begin{macro}{\@strip@args}
871 % \changes{v1.8c}{1996/10/27}
872 %      {Removed macro}
873 %    Another amusing game to play with |\expandafter|, |\csname|, and
874 %    |\string|.  When you say
875 %    |\DeclareTextCompositeCommand{\foo}{T1}{a}{bar}|, we look to see
876 %    if the expansion of |\T1\foo| begins with |\@text@composite|, and
877 %    if it doesn't, we redefine |\T1\foo| to be:
878 %\begin{verbatim}
879 %    #1 -> \@text@composite \T1\foo #1\@empty \@text@composite {...}
880 %\end{verbatim}
881 %    where |...| is the
882 %    previous definition of |\T1\foo|.  Finally, we define |\\T1\foo-a|
883 %    to expand to |bar|.
884 %    \begin{macrocode}
885 %</2ekernel>
886 %<latexrelease>\IncludeInRelease{2017/04/15}{\DeclareTextCompositeCommand}
887 %<latexrelease>                             {test for undeclared accent}%
888 %<*2ekernel|latexrelease>
889 \def\DeclareTextCompositeCommand#1#2#3#4{%
890   \expandafter\let\expandafter\reserved@a\csname#2\string#1\endcsname
891   \ifx\reserved@a\relax
892    \DeclareTextCommand#1{#2}{%
893      \@latex@error{\string#1 undeclared in encoding #2}\@eha}%
894    \@latex@info{Composite with undeclared \string#1 in encoding #2}%
895    \expandafter\let\expandafter\reserved@a\csname#2\string#1\endcsname
896   \fi
897   \expandafter\expandafter\expandafter\ifx
898   \expandafter\@car\reserved@a\relax\relax\@nil \@text@composite \else
899       \edef\reserved@b##1{%
900          \def\expandafter\noexpand
901             \csname#2\string#1\endcsname####1{%
902             \noexpand\@text@composite
903                \expandafter\noexpand\csname#2\string#1\endcsname
904                ####1\noexpand\@empty\noexpand\@text@composite
905                {##1}}}%
906       \expandafter\reserved@b\expandafter{\reserved@a{##1}}%
907    \fi
908    \expandafter\def\csname\expandafter\string\csname
909       #2\endcsname\string#1-\string#3\@empty\endcsname{#4}%
910   }
911 %</2ekernel|latexrelease>
912 %<latexrelease>\EndIncludeInRelease
913 %<latexrelease>\IncludeInRelease{0000/00/00}{\DeclareTextCompositeCommand}
914 %<latexrelease>                            {test for undeclared accent}%
915 %<latexrelease>\def\DeclareTextCompositeCommand#1#2#3#4{%
916 %<latexrelease>  \expandafter\let\expandafter\reserved@a
917 %<latexrelease>                      \csname#2\string#1\endcsname
918 %<latexrelease>  \expandafter\expandafter\expandafter\ifx
919 %<latexrelease>  \expandafter\@car\reserved@a\relax\relax\@nil
920 %<latexrelease>                               \@text@composite \else
921 %<latexrelease>      \edef\reserved@b##1{%
922 %<latexrelease>         \def\expandafter\noexpand
923 %<latexrelease>           \csname#2\string#1\endcsname####1{%
924 %<latexrelease>           \noexpand\@text@composite
925 %<latexrelease>             \expandafter\noexpand\csname#2\string#1\endcsname
926 %<latexrelease>             ####1\noexpand\@empty\noexpand\@text@composite
927 %<latexrelease>             {##1}}}%
928 %<latexrelease>      \expandafter\reserved@b\expandafter{\reserved@a{##1}}%
929 %<latexrelease>   \fi
930 %<latexrelease>   \expandafter\def\csname\expandafter\string\csname
931 %<latexrelease>      #2\endcsname\string#1-\string#3\@empty\endcsname{#4}}
932 %<latexrelease>\EndIncludeInRelease
933 %<*2ekernel>
934 %    \end{macrocode}
936 %    \begin{macrocode}
937 \@onlypreamble\DeclareTextCompositeCommand
938 %    \end{macrocode}
939 %    This all works because:
940 %\begin{verbatim}
941 %    \@text@composite \T1\foo A\@empty \@text@composite {...}
942 %\end{verbatim}
943 %    expands to
944 %    |\\T1\foo-A| if |\\T1\foo-A| has been defined, and |{...}|
945 %    otherwise.
947 %    Note that |\@text@composite| grabs the first token of the
948 %    argument and puts just that in the
949 %    csname.  This is so that |\'{\textit{e}}| will work---it checks
950 %    whether |\\T1\'-\textit| is defined (which presumably it isn't)
951 %    and so expands to |{\accent 1 \textit{e}}|.
953 %    This trick won't always work, for example |\'{{\itshape e}}| will
954 %    expand to (with spaces added for clarity):
955 %\begin{verbatim}
956 %    \csname \string \T1\' - \string {\itshape e} \@empty \endcsname
957 %\end{verbatim}
958 %    which will die pretty horribly.  Unfortunately there's not much
959 %    can be done about this if we're going to use |\csname| lookups as a
960 %    fast way of accessing composites.
962 %    This has an unfortunate `misfeature' though, which is that in
963 %    the T1 encoding, |\'{aa}| produces \'a.  This is not the expected
964 %    behaviour, and should perhaps be fixed if the fix doesn't affect
965 %    performance too badly.
967 %    Finally, it's worth noting that the |\@empty| is used in
968 %    |\@text@composite| so that accents will work even when the
969 %    argument is empty.  If you say |\'{}| then this looks up
970 %    |\\T1\'-\@empty|, which ought to be |\relax|, and so all is well.
971 %    If we didn't include the |\@empty|, then |\'{}| would expand to:
972 %\begin{verbatim}
973 %    \csname \string \T1\' - \string \endcsname
974 %\end{verbatim}
975 %    so the |\endcsname| would be |\string|'ed and the whole of the
976 %    rest of the document would be put inside the |\csname|.  This
977 %    would not be good.
978 %    \begin{macrocode}
979 \def\@text@composite#1#2#3\@text@composite{%
980    \expandafter\@text@composite@x
981       \csname\string#1-\string#2\endcsname}
982 %    \end{macrocode}
984 % \changes{v1.7z}{1996/05/23}
985 %      {\cs{expandafter} added to match other changes for latex/2133}
986 % \changes{v1.9r}{1999/01/06}{New impl for latex/2930}
987 % \changes{v1.9s}{1999/01/13}{Simplified solution for latex/2930}
988 %    Originally the |\@text@composite@x| macro had two arguments and if
989 %    |#1| was not |\relax| it was executed, otherwise |#2| was executed.
990 %    All this happened within the |\ifx| code so that neither |#1|
991 %    nor |#2| could have picked up any additional arguments form
992 %    the input stream.
993 %    This has now being changed using the typical |\@firstoftwo| /
994 %    |\@secondoftwo| coding. This way the
995 %    final expansion will happen without any |\else| or |\fi|
996 %    intervening in the case that we need to get a further token
997 %    from the input stream.
998 %    \begin{macrocode}
999 \def\@text@composite@x#1{%
1000    \ifx#1\relax
1001       \expandafter\@secondoftwo
1002    \else
1003       \expandafter\@firstoftwo
1004    \fi
1005    #1}
1006 %    \end{macrocode}
1007 %    The command |\DeclareTextComposite| uses
1008 %    |\DeclareTextCompositeCommand| to declare a command which
1009 %    expands out to a single glyph.
1010 % \changes{v1.8a}{1996/07/19}
1011 %      {Use char 0 not @ as carrier for \cs{lowercase} /2197}
1012 %    \begin{macrocode}
1013 \catcode\z@=11\relax
1014 %    \end{macrocode}
1016 %    \begin{macrocode}
1017 \def\DeclareTextComposite#1#2#3#4{%
1018    \def\reserved@a{\DeclareTextCompositeCommand#1{#2}{#3}}%
1019    \bgroup
1020       \lccode\z@#4%
1021       \lowercase{%
1022    \egroup
1023       \reserved@a ^^@}}
1024 %    \end{macrocode}
1026 %    \begin{macrocode}
1027 \catcode\z@=15\relax
1028 %    \end{macrocode}
1030 %    \begin{macrocode}
1031 \@onlypreamble\DeclareTextComposite
1032 %    \end{macrocode}
1033 % \end{macro}
1034 % \end{macro}
1035 % \end{macro}
1036 % \end{macro}
1037 % \end{macro}
1039 % \begin{macro}{\UseTextAccent}
1040 % \begin{macro}{\UseTextSymbol}
1041 % \changes{v1.7p}{1995/11/17}{Support \cs{@wrong@font@char} latex/1676}
1042 % \changes{v1.7q}{1995/11/18}{Modify message slightly}
1043 % \begin{macro}{\@use@text@encoding}
1044 % \changes{v1.91}{2000/08/30}{Rearranged but no change to final code,
1045 %    CAR (pr/3160)}
1046 %    These fragile commands access glyphs from different encodings.
1047 %    They use grotty low-level calls to the font selection scheme for
1048 %    speed, and in order to make sure that |\UseTextSymbol| doesn't
1049 %    do anything which you're not allowed to do between an |\accent|
1050 %    and its glyph.
1052 %    For a detailed discussion of this reimplementation and its
1053 %    deficiencies, see pr/3160.
1054 % \task{?}{Improve this and document its problems, see pr/3160}
1055 % \changes{v1.9z}{2000/01/30}{Macro reimplemented (pr/3160)}
1056 %    \begin{macrocode}
1057 \def\UseTextAccent#1#2#3{%
1058   \hmode@start@before@group
1059    {%
1060 %    \end{macrocode}
1061 %    Turn off the group in |\UseTextSymbol| in case this is used
1062 %    inside the arguments of |\UseTextAccent|.
1063 %    \begin{macrocode}
1064     \let\hmode@start@before@group\@firstofone
1065     \let\@curr@enc\cf@encoding
1066     \@use@text@encoding{#1}%
1067     #2{\@use@text@encoding\@curr@enc#3}%
1068    }}
1069 %    \end{macrocode}
1071 % \changes{v1.9z}{2000/01/30}{Macro reimplemented (pr/3160)}
1072 %    \begin{macrocode}
1073 \def\UseTextSymbol#1#2{%
1074        \hmode@start@before@group
1075        {%
1076           \def\@wrong@font@char{\MessageBreak
1077              for \noexpand\symbol`\string#2'}%
1078           \@use@text@encoding{#1}%
1079           #2%
1080        }%
1081     }
1082 %    \end{macrocode}
1084 %    \begin{macrocode}
1085 \def\@use@text@encoding#1{%
1086    \edef\f@encoding{#1}%
1087    \xdef\font@name{%
1088       \csname\curr@fontshape/\f@size\endcsname}%
1089    \pickup@font
1090    \font@name
1091    \@@enc@update}
1092 %    \end{macrocode}
1093 % \end{macro}
1094 % \end{macro}
1095 % \end{macro}
1097 % \begin{macro}{\hmode@start@before@group}
1098 %    The |\hmode@start@before@group| starts hmode and should be
1099 %    immediately followed by an explicit |{...}|. Its purpose is to
1100 %    ensure that hmode is started before this group  is opened. Inside
1101 %    |\add@accent| and |\UseTextAccent| it is redefined to remove this
1102 %    group so that it doesn't conflict with the |\accent| primitive.
1104 %    For a detailed discussion see pr/3160.
1105 % \changes{v1.9z}{2000/01/30}{Macro added (pr/3160)}
1106 %    \begin{macrocode}
1107 \let\hmode@start@before@group\leavevmode
1108 %    \end{macrocode}
1109 % \end{macro}
1111 % \begin{macro}{\DeclareTextSymbolDefault}
1112 % \begin{macro}{\DeclareTextAccentDefault}
1113 %    Some syntactic sugar.  Again, these should probably be optimized
1114 %    for speed.
1115 %    \begin{macrocode}
1116 \def\DeclareTextSymbolDefault#1#2{%
1117    \DeclareTextCommandDefault#1{\UseTextSymbol{#2}#1}}
1118 %    \end{macrocode}
1120 %    \begin{macrocode}
1121 \def\DeclareTextAccentDefault#1#2{%
1122    \DeclareTextCommandDefault#1{\UseTextAccent{#2}#1}}
1123 %    \end{macrocode}
1125 %    \begin{macrocode}
1126 \@onlypreamble\DeclareTextSymbolDefault
1127 \@onlypreamble\DeclareTextAccentDefault
1128 %    \end{macrocode}
1129 % \end{macro}
1130 % \end{macro}
1133 % \begin{macro}{\UndeclareTextCommand}
1134 %    This command safely removes an encoding specific declaration
1135 %    for a given encoding. It is helpful if one intends to use the
1136 %    default definition always and therefore wants to get rid of
1137 %    a declaration for some specific encoding.
1138 % \changes{v1.9o}{1998/03/20}{Macro added for pr/2783}
1139 %    \begin{macrocode}
1140 \def\UndeclareTextCommand#1#2{%
1141 %    \end{macrocode}
1142 %    If there is no declaration for the current encoding do nothing.
1143 %    (This makes a hash table entry but without e\TeX{} we can't do
1144 %    anything about that).
1145 %    \begin{macrocode}
1146   \expandafter\ifx\csname#2\string#1\endcsname\relax
1147   \else
1148 %    \end{macrocode}
1149 %    Else: throw away that declaration.
1150 %    \begin{macrocode}
1151      \global\expandafter\let\csname#2\string#1\endcsname
1152             \@undefined
1153 %    \end{macrocode}
1154 %    But this is unfortunately not enough, we have to take a look
1155 %    at the top-level definition of the encoding specific command
1156 %    which for a command |\foo| would look similar to
1157 %    |\T1-cmd \foo \T1\foo| (three tokens).
1159 %    Of course, instead of |T1| one could see a different encoding name;
1160 %    which one depends the encoding for which |\foo| was declared
1161 %    last.
1163 %    Now assume we have just removed the declaration for |\foo| in |T1|
1164 %    and the top-level of |\foo| expands to the above. Then we better
1165 %    change that pretty fast otherwise we do get an ``undefined csname
1166 %    error'' when we try to typeset |\foo| within |T1| instead of
1167 %    getting the default definition for |\foo|.
1168 %    And what is the best way to change that top-level definition? Well,
1169 %    the only ``encoding'' we know for sure will still be around is
1170 %    the default encoding denoted by |?|.
1172 %    Thus in case the last token of the top-level expansion
1173 %    is now undefined we change the declaration to look like
1174 %    |\?-cmd \foo \?\foo| which is done by the following
1175 %    (readable?) code:
1176 %    \begin{macrocode}
1177      \expandafter\expandafter\expandafter
1178      \ifx\expandafter\@thirdofthree#1\@undefined
1179        \expandafter\gdef\expandafter#1\expandafter
1180           {\csname ?-cmd\expandafter\endcsname\expandafter
1181            #1\csname?\string#1\endcsname}%
1182      \fi
1183  \fi
1185 %    \end{macrocode}
1187 %    \begin{macrocode}
1188 \@onlypreamble\UndeclareTextCommand
1189 %    \end{macrocode}
1190 % \end{macro}
1193 % \subsubsection{Hyphenation}
1195 % \changes{v1.5l}{1994/10/18}{Added new definitions of \cs{patterns}
1196 %    and \cs{hyphenation}.}
1197 % \changes{v1.6g}{1994/11/05}{Added setting of \cs{@typeset@protect}
1198 %    to \cs{patterns} and \cs{hyphenation}.}
1199 % \changes{v1.6g}{1994/11/30}{Removed new definitions of \cs{patterns}
1200 %    and \cs{hyphenation}, since encoding-specific commands now expand
1201 %    in the mouth.}
1203 % \begin{macro}{\patterns}
1204 % \begin{macro}{\@@patterns}
1205 % \begin{macro}{\hyphenation}
1206 % \begin{macro}{\@@hyphenation}
1207 %    We redefine |\patterns| and |\hyphenation| to allow the use of
1208 %    commands declared with |\DeclareText*| to be used inside them.
1209 %    \begin{macrocode}
1210 %\let\@@patterns\patterns
1211 %\let\@@hyphenation\hyphenation
1212 %\def\patterns{%
1213 %   \bgroup
1214 %      \let\protect\@empty
1215 %      \let\@typeset@protect\@empty
1216 %      \let\@changed@x\@changed@x@mouth
1217 %   \afterassignment\egroup
1218 %   \@@patterns
1220 %\def\hyphenation{%
1221 %   \bgroup
1222 %      \let\protect\@empty
1223 %      \let\@typeset@protect\@empty
1224 %      \let\@changed@x\@changed@x@mouth
1225 %   \afterassignment\egroup
1226 %   \@@hyphenation
1228 %    \end{macrocode}
1229 % \end{macro}
1230 % \end{macro}
1231 % \end{macro}
1232 % \end{macro}
1234 % \subsubsection{Miscellania}
1236 % \changes{1.4a}{1994/05/01}{Added the \cs{a} command.}
1237 % \changes{1.7a}{1994/11/30}{Redefined \cs{a} for the new scheme.}
1238 % \changes{1.7b}{1994/12/02}{Redefined \cs{a} properly.}
1239 % \changes{1.7g}{1995/03/03}{Corrected an error in documentation
1240 %               referring to the tabular rather than the tabbing
1241 %               environment.}
1242 % \changes{v1.7n}{1995/11/02}{Changed internal name \cs{a} to
1243 % \cs{@tabacckludge} to protect against redefinition by malicious
1244 % users.}
1246 % \begin{macro}{\a}
1247 %    The |\a| command is used to access the accent commands even when
1248 %    they have been redefined (for example by the |tabbing|
1249 %    environment). Its internal name is |\@tabacckludge|.
1251 %    The |\string| within the |\csname| guards against something
1252 %    like |'| being active at the point of use.
1253 % \changes{v1.9r}{1998/09/19}{Added \cs{string} (pr/2878)}
1254 %    \begin{macrocode}
1255 \def\@tabacckludge#1{\expandafter\@changed@cmd
1256                                  \csname\string#1\endcsname\relax}
1257 \let\a=\@tabacckludge
1258 %    \end{macrocode}
1259 % \end{macro}
1261 % \changes{v1.6a}{1994/10/25}{Added the files OT1enc.def, T1enc.def and
1262 %    OMSenc.def.}
1263 % \changes{v1.6b}{1994/10/27}{Removed the files OT1enc.def, T1enc.def
1264 %    and OMSenc.def.}
1266 % \subsubsection{Default encodings}
1268 % We define the default encodings for most commands to be either OT1,
1269 % OML or OMS.  These defaults are in the kernel and therefore
1270 % fonts with these encodings must be available unless these
1271 % defaults are redefined elsewhere.  Recall that the standard kernel
1272 % loads the encoding files for these encodings, and also that for
1273 % the T1 encoding.
1275 % The naming conventions in the kernel are not what we would use if we
1276 % were starting from scratch\dots\
1277 % Those defined by DEK (like |\ae| and |\ss|) or by the \TeX{} Users
1278 % Group Technical Working Group on multi-lingual typesetting (like
1279 % |\th| and |\ng|) have short names.  Those which were added to the
1280 % kernel in 1993 and early 1994 are named after their Adobe glyph
1281 % names (like |\guillemotleft| and |\quotedblbase|).  Unfortunately,
1282 % this naming scheme won't work for all glyphs, since some names (like
1283 % |\space|) are already used, and some (like |\endash|) are very
1284 % likely to be defined by users.  So we're now using the naming scheme
1285 % of |\text| followed by the Adobe name, (like |\textendash| and
1286 % |\textsterling|).  Except that some glyphs don't have Adobe names,
1287 % so we're using the names used by fontinst for those (like
1288 % |\textcompwordmark|).  Sigh.
1290 % \changes{v1.6a}{1994/10/25}{Added the defaults.}
1291 % \changes{v1.6b}{1994/10/27}{Added more defaults for OT1.}
1292 % \changes{v1.6c}{1994/10/29}{Added commands like \cs{dots} for use in
1293 %    text and math.}
1295 % Some accents from OT1:
1296 %    \begin{macrocode}
1297 \DeclareTextAccentDefault{\"}{OT1}
1298 \DeclareTextAccentDefault{\'}{OT1}
1299 \DeclareTextAccentDefault{\.}{OT1}
1300 \DeclareTextAccentDefault{\=}{OT1}
1301 \DeclareTextAccentDefault{\H}{OT1}
1302 \DeclareTextAccentDefault{\^}{OT1}
1303 \DeclareTextAccentDefault{\`}{OT1}
1304 \DeclareTextAccentDefault{\b}{OT1}
1305 \DeclareTextAccentDefault{\c}{OT1}
1306 \DeclareTextAccentDefault{\d}{OT1}
1307 \DeclareTextAccentDefault{\r}{OT1}
1308 \DeclareTextAccentDefault{\u}{OT1}
1309 \DeclareTextAccentDefault{\v}{OT1}
1310 \DeclareTextAccentDefault{\~}{OT1}
1311 %    \end{macrocode}
1312 % Some symbols from OT1:
1313 % \changes{v1.8c}{1996/10/27}
1314 %      {Removed \cs{aa} and \cs{AA}}
1315 %    \begin{macrocode}
1316 %\DeclareTextSymbolDefault{\AA}{OT1}
1317 \DeclareTextSymbolDefault{\AE}{OT1}
1318 \DeclareTextSymbolDefault{\L}{OT1}
1319 \DeclareTextSymbolDefault{\OE}{OT1}
1320 \DeclareTextSymbolDefault{\O}{OT1}
1321 %\DeclareTextSymbolDefault{\aa}{OT1}
1322 \DeclareTextSymbolDefault{\ae}{OT1}
1323 \DeclareTextSymbolDefault{\i}{OT1}
1324 \DeclareTextSymbolDefault{\j}{OT1}
1325 %    \end{macrocode}
1326 % \changes{v1.99h}{2005/11/08}
1327 %      {Added \cs{ij} and \cs{IJ} from babel. (pr/3771)}
1328 %    \begin{macrocode}
1329 \DeclareTextSymbolDefault{\ij}{OT1}
1330 \DeclareTextSymbolDefault{\IJ}{OT1}
1331 %    \end{macrocode}
1332 %    \begin{macrocode}
1333 \DeclareTextSymbolDefault{\l}{OT1}
1334 \DeclareTextSymbolDefault{\oe}{OT1}
1335 \DeclareTextSymbolDefault{\o}{OT1}
1336 \DeclareTextSymbolDefault{\ss}{OT1}
1337 \DeclareTextSymbolDefault{\textdollar}{OT1}
1338 \DeclareTextSymbolDefault{\textemdash}{OT1}
1339 \DeclareTextSymbolDefault{\textendash}{OT1}
1340 \DeclareTextSymbolDefault{\textexclamdown}{OT1}
1341 %\DeclareTextSymbolDefault{\texthyphenchar}{OT1}
1342 %\DeclareTextSymbolDefault{\texthyphen}{OT1}
1343 \DeclareTextSymbolDefault{\textquestiondown}{OT1}
1344 \DeclareTextSymbolDefault{\textquotedblleft}{OT1}
1345 \DeclareTextSymbolDefault{\textquotedblright}{OT1}
1346 \DeclareTextSymbolDefault{\textquoteleft}{OT1}
1347 \DeclareTextSymbolDefault{\textquoteright}{OT1}
1348 \DeclareTextSymbolDefault{\textsterling}{OT1}
1349 %    \end{macrocode}
1350 % Some symbols from OMS:
1351 % \changes{v1.7t}{1995/11/29}{Added \cs{textbackslash} and
1352 %    \cs{textbar}.}
1353 % \changes{v1.8c}{1996/10/27}
1354 %      {Added \cs{textasteriskcentered}}
1355 % \changes{v1.95}{2002/06/16}{Added default for \cs{textbardbl} (pr/3400)}
1356 %    \begin{macrocode}
1357 \DeclareTextSymbolDefault{\textasteriskcentered}{OMS}
1358 \DeclareTextSymbolDefault{\textbackslash}{OMS}
1359 \DeclareTextSymbolDefault{\textbar}{OMS}
1360 \DeclareTextSymbolDefault{\textbardbl}{OMS}
1361 \DeclareTextSymbolDefault{\textbraceleft}{OMS}
1362 \DeclareTextSymbolDefault{\textbraceright}{OMS}
1363 \DeclareTextSymbolDefault{\textbullet}{OMS}
1364 \DeclareTextSymbolDefault{\textdaggerdbl}{OMS}
1365 \DeclareTextSymbolDefault{\textdagger}{OMS}
1366 \DeclareTextSymbolDefault{\textparagraph}{OMS}
1367 \DeclareTextSymbolDefault{\textperiodcentered}{OMS}
1368 \DeclareTextSymbolDefault{\textsection}{OMS}
1369 \DeclareTextAccentDefault{\textcircled}{OMS}
1370 %    \end{macrocode}
1372 % \changes{v1.6d}{1994/10/30}{Added OML encoding.}
1373 % \changes{v1.6d}{1994/10/30}{Made \cs{textless} and \cs{textgreater}
1374 %    come from OML.}
1375 % \changes{v1.6d}{1994/10/30}{Added \cs{t}.}
1376 % \changes{v1.7k}{1995/06/05}{Commented out \cs{textless} and
1377 %    \cs{textgreater}.}
1379 % Some symbols from OML:
1380 % \changes{v1.7t}{1995/11/29}{Added \cs{textless} and
1381 %    \cs{textgreater}.}
1382 %    \begin{macrocode}
1383 \DeclareTextSymbolDefault{\textless}{OML}
1384 \DeclareTextSymbolDefault{\textgreater}{OML}
1385 \DeclareTextAccentDefault{\t}{OML}
1386 %    \end{macrocode}
1388 % \changes{v1.6d}{1994/10/30}{Added \cs{textcircled}.}
1389 % \changes{v1.6d}{1994/10/30}{Rewrote \cs{copyright} to use
1390 %    \cs{textcircled}.}
1391 % \changes{v1.6d}{1994/10/30}{Removed \cs{textregistered}.}
1392 % \changes{v1.7k}{1995/06/05}{Save some tokens in
1393 %    \cs{textvisiblespace} and \cs{textunderscore}.}
1394 % \changes{v1.7t}{1995/11/29}{Added \cs{textasciicircum},
1395 %    \cs{textasciitilde}, \cs{textregistered} and \cs{texttrademark}.}
1396 % \changes{v1.7u}{1995/12/01}{Made \cs{SS} a Default, rather than
1397 %    having the default point to the OT1 definition.}
1398 % \changes{v1.7w}{1995/12/11}{Modified \cs{copyright}}
1399 % \changes{v1.9a}{1997/04/30}{Introduced \cs{textcopyright} and modified
1400 %                             \cs{copyright}}
1402 % Some defaults we can fake.
1404 % The interface for defining |\copyright| changed, it used to
1405 % use |\expandafter| to add braces at the appropriate points.
1406 % \begin{macrocode}
1407 \DeclareTextCommandDefault{\textcopyright}{\textcircled{c}}
1408 % \expandafter\def\expandafter
1409 %                 \copyright\expandafter{\expandafter{\copyright}}
1410 %    \end{macrocode}
1412 % \changes{v1.9a}{1997/04/30}{Modified \cs{textunderscore}, removing
1413 %                                    \cs{mathunderscore}}
1414 % \changes{v1.9b}{1997/04/30}{Added \cs{leavevmode} to
1415 %                                   \cs{textunderscore}}
1416 % \changes{v1.9d}{1997/05/07}{Added \cs{leavevmode} to
1417 %                                   \cs{textcompwordmark}}
1418 %    \begin{macrocode}
1419 \DeclareTextCommandDefault{\textasciicircum}{\^{}}
1420 \DeclareTextCommandDefault{\textasciitilde}{\~{}}
1421 \DeclareTextCommandDefault{\textcompwordmark}{\leavevmode\kern\z@}
1422 \DeclareTextCommandDefault{\textunderscore}{%
1423   \leavevmode \kern.06em\vbox{\hrule\@width.3em}}
1424 %    \end{macrocode}
1426 %    \begin{macrocode}
1427 \DeclareTextCommandDefault{\textvisiblespace}{%
1428    \mbox{\kern.06em\vrule \@height.3ex}%
1429    \vbox{\hrule \@width.3em}%
1430    \hbox{\vrule \@height.3ex}}
1431 %    \end{macrocode}
1433 %    Using |\fontdimen3| in the next definition is some sort of a
1434 %    kludge (since it is the interword stretch) but it makes the
1435 %    ellipsis come out right in mono-spaced fonts too (since there it
1436 %    is zero).
1437 %    \begin{macrocode}
1438 \DeclareTextCommandDefault{\textellipsis}{%
1439    .\kern\fontdimen3\font
1440    .\kern\fontdimen3\font
1441    .\kern\fontdimen3\font}
1442 %    \end{macrocode}
1444 % \changes{v1.9a}{1997/04/30}{Changed \cs{textsc} to \cs{scshape}}
1445 % \changes{v1.95}{2002/06/18}{Changed def for \cs{textregistered} to
1446 %    avoid small caps (pr/3420)}
1447 %    \begin{macrocode}
1448 %\DeclareTextCommandDefault{\textregistered}{\textcircled{\scshape r}}
1449 \DeclareTextCommandDefault{\textregistered}{\textcircled{%
1450      \check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}}
1451 \DeclareTextCommandDefault{\texttrademark}{\textsuperscript{TM}}
1452 \DeclareTextCommandDefault{\SS}{SS}
1453 %    \end{macrocode}
1455 % \changes{v1.9n}{1998/03/05}{Added masc/fem ords as in pr/2579}
1456 %    \begin{macrocode}
1457 \DeclareTextCommandDefault{\textordfeminine}{\textsuperscript{a}}
1458 \DeclareTextCommandDefault{\textordmasculine}{\textsuperscript{o}}
1459 %    \end{macrocode}
1461 % \subsubsection{Math material}
1463 %    Some commands can be used in both text and math mode:
1464 %    \begin{macrocode}
1465 \DeclareRobustCommand{\$}{\ifmmode\mathdollar\else\textdollar\fi}
1466 \DeclareRobustCommand{\{}{\ifmmode\lbrace\else\textbraceleft\fi}
1467 \DeclareRobustCommand{\}}{\ifmmode\rbrace\else\textbraceright\fi}
1468 \DeclareRobustCommand{\P}{\ifmmode\mathparagraph\else\textparagraph\fi}
1469 \DeclareRobustCommand{\S}{\ifmmode\mathsection\else\textsection\fi}
1470 \DeclareRobustCommand{\dag}{\ifmmode{\dagger}\else\textdagger\fi}
1471 \DeclareRobustCommand{\ddag}{\ifmmode{\ddagger}\else\textdaggerdbl\fi}
1472 %    \end{macrocode}
1474 % For historical reasons |\copyright|
1475 % needs |{}| around the definition in maths.
1477 % \changes{v1.6f}{1994/11/04}{Added \cmd\_.}
1479 % \changes{v1.9a}{1997/04/30}{Modified \cs{underscore}, removing
1480 %                                    \cs{mathunderscore}}
1481 % \changes{v1.9a}{1997/04/30}{Introduced \cs{textcopyright} and modify
1482 %                             \cs{copyright}}
1483 %    \begin{macrocode}
1484 \DeclareRobustCommand{\_}{%
1485    \ifmmode\nfss@text{\textunderscore}\else\textunderscore\fi}
1486 \DeclareRobustCommand{\copyright}{%
1487    \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
1488 \DeclareRobustCommand{\pounds}{%
1489    \ifmmode\mathsterling\else\textsterling\fi}
1490 %    \end{macrocode}
1492 %    \begin{macrocode}
1493 \DeclareRobustCommand{\dots}{%
1494    \ifmmode\mathellipsis\else\textellipsis\fi}
1495 %    \end{macrocode}
1497 %    \begin{macrocode}
1498 \let\ldots\dots
1499 %    \end{macrocode}
1500 % \changes{v1.99m}{2015/02/16}{Added \cs{textcommabelow} latex/4414}
1501 % Default definition of the commabelow accent.
1502 %    \begin{macrocode}
1503 %</2ekernel>
1504 %<latexrelease>\IncludeInRelease{2015/10/01}{\textcommabelow}{comma accent}%
1505 %<*2ekernel|latexrelease>
1506 \DeclareTextCommandDefault\textcommabelow[1]
1507   {\hmode@bgroup\ooalign{\null#1\crcr\hidewidth\raise-.31ex
1508    \hbox{\check@mathfonts\fontsize\ssf@size\z@
1509    \math@fontsfalse\selectfont,}\hidewidth}\egroup}
1510 %<latexrelease>\EndIncludeInRelease
1511 %</2ekernel|latexrelease>
1512 %<latexrelease>\IncludeInRelease{0000/00/00}{\textcommabelow}{comma accent}%
1513 %<latexrelease>\let\textcommabelow\@undefined
1514 %<latexrelease>\expandafter
1515 %<latexrelease>  \let\csname\string\T1\string\c-G\endcsname\@undefined
1516 %<latexrelease>\expandafter
1517 %<latexrelease>  \let\csname\string\T1\string\c-K\endcsname\@undefined
1518 %<latexrelease>\expandafter
1519 %<latexrelease>  \let\csname\string\T1\string\c-k\endcsname\@undefined
1520 %<latexrelease>\expandafter
1521 %<latexrelease>  \let\csname\string\T1\string\c-L\endcsname\@undefined
1522 %<latexrelease>\expandafter
1523 %<latexrelease>  \let\csname\string\T1\string\c-l\endcsname\@undefined
1524 %<latexrelease>\expandafter
1525 %<latexrelease>  \let\csname\string\T1\string\c-N\endcsname\@undefined
1526 %<latexrelease>\expandafter
1527 %<latexrelease>  \let\csname\string\T1\string\c-n\endcsname\@undefined
1528 %<latexrelease>\expandafter
1529 %<latexrelease>  \let\csname\string\T1\string\c-R\endcsname\@undefined
1530 %<latexrelease>\expandafter
1531 %<latexrelease>  \let\csname\string\T1\string\c-r\endcsname\@undefined
1532 %<latexrelease>\EndIncludeInRelease
1533 %    \end{macrocode}
1535 % \changes{v1.99n}{2015/02/16}{Added \cs{textcommaabove}}
1536 % Default definition of the commaabove accent(E.G.).
1537 %    \begin{macrocode}
1538 %<latexrelease>\IncludeInRelease{2016/02/01}{\textcommaabove}{comma above}%
1539 %<*2ekernel|latexrelease>
1540 \DeclareTextCommandDefault\textcommaabove[1]{%
1541   \hmode@bgroup
1542   \ooalign{%
1543     \hidewidth
1544     \raise.7ex\hbox{%
1545       \check@mathfonts\fontsize\ssf@size\z@\math@fontsfalse\selectfont`%
1546     }%
1547    \hidewidth\crcr
1548    \null#1\crcr
1549   }%
1550   \egroup
1552 %<latexrelease>\EndIncludeInRelease
1553 %</2ekernel|latexrelease>
1554 %<latexrelease>\IncludeInRelease{0000/00/00}{\textcommaabove}{comma above}%
1555 %<latexrelease>\let\textcommaabove\@undefined
1556 %<latexrelease>\expandafter
1557 %<latexrelease>  \let\csname\string\OT1\string\c-g\endcsname\@undefined
1558 %<latexrelease>\expandafter
1559 %<latexrelease>  \let\csname\string\T1\string\c-g\endcsname\@undefined
1560 %<latexrelease>\EndIncludeInRelease
1561 %    \end{macrocode}
1563 % \changes{v1.6d}{1994/10/30}{Moved math commands here from ltmath.}
1564 % \changes{v1.6f}{1994/11/04}{Added \cs{mathunderscore}.}
1565 % \changes{v1.7k}{1995/06/05}{Moved math commands to fontdef.dtx.}
1568 % \changes{1.4a}{1994/05/01}{Added the \cs{SaveAtCatcode} and
1569 %    \cs{RestoreAtCatcode} commands.}
1571 % \changes{1.5a}{1994/05/12}{Removed the \cs{SaveAtCatcode} and
1572 %    \cs{RestoreAtCatcode} commands.}
1575 % \subsection{Definitions for the OT1 encoding}
1577 % \changes{1.3}{1993/12/17}{Removed all the hackery for use in
1578 %    \cs{DeclareFontEncoding}, and redid everything using
1579 %    \cs{DeclareTextFoo}.}
1580 % \changes{1.3b}{1993/12/18}{Replaced the missing last argument to
1581 %    \cs{DeclareFontEncoding}.}
1582 % \changes{1.3c}{1993/12/18}{Rewrote for the new syntax of
1583 %    \cs{EncodingSpecific}.}
1584 % \changes{1.4a}{1994/05/01}{Rewrote for the new syntax.}
1585 % \changes{1.5a}{1994/05/12}{Rewrote for the new syntax.}
1586 % \changes{1.5h}{1994/05/16}{\cs{pounds} was still using u rather than
1587 %    ui shape.}
1588 % \changes{1.6b}{1994/10/27}{Added:
1589 %   \cs{textemdash}
1590 %   \cs{textendash}
1591 %   \cs{textexclamdown}
1592 %   \cs{texthyphenchar}
1593 %   \cs{texthyphen}
1594 %   \cs{textquestiondown}
1595 %   \cs{textquotedblleft}
1596 %   \cs{textquotedblright}
1597 %   \cs{textquoteleft}
1598 %   \cs{textquoteright}
1599 % }
1601 % The definitions for the `\TeX{} text' (OT1) encoding.
1603 %    Declare the encoding.
1604 %    \begin{macrocode}
1605 %<*OT1>
1606 \DeclareFontEncoding{OT1}{}{}
1607 %    \end{macrocode}
1608 %    Declare the accents.
1609 %    \begin{macrocode}
1610 \DeclareTextAccent{\"}{OT1}{127}
1611 \DeclareTextAccent{\'}{OT1}{19}
1612 \DeclareTextAccent{\.}{OT1}{95}
1613 \DeclareTextAccent{\=}{OT1}{22}
1614 \DeclareTextAccent{\^}{OT1}{94}
1615 \DeclareTextAccent{\`}{OT1}{18}
1616 \DeclareTextAccent{\~}{OT1}{126}
1617 \DeclareTextAccent{\H}{OT1}{125}
1618 \DeclareTextAccent{\u}{OT1}{21}
1619 \DeclareTextAccent{\v}{OT1}{20}
1620 \DeclareTextAccent{\r}{OT1}{23}
1621 %    \end{macrocode}
1622 %    Some accents have to be built by hand:
1623 %    Note that |\ooalign| and |\o@lign| must be inside a group.
1624 % \changes{v1.7j}{1995/05/21}{Updated some plain macros}
1625 % \changes{v1.7o}{1995/11/07}{Added \cs{leavevmode} at start of
1626 % \cs{c}, otherwise the output routine might be invoked within the
1627 % macro.}
1628 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
1629 %    (pr/3160)}
1630 % \changes{v1.99g}{2005/09/27}{Replace \cs{sh@ft} by \cs{ltx@sh@ft}}
1631 %  In these definitions we no longer use the helper function |\sh@ft|
1632 %  from plain.tex since that now has two incompatible definitions.
1633 %    \begin{macrocode}
1634 \DeclareTextCommand{\b}{OT1}[1]
1635    {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-3ex}%
1636      \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}\egroup}
1637 \DeclareTextCommand{\c}{OT1}[1]
1638    {\leavevmode\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent24 #1%
1639     \else{\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}}\fi}
1640 \DeclareTextCommand{\d}{OT1}[1]
1641    {\hmode@bgroup
1642     \o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-1ex}.\hidewidth}\egroup}
1643 %    \end{macrocode}
1645 %    Declare the text symbols.
1646 %    \begin{macrocode}
1647 \DeclareTextSymbol{\AE}{OT1}{29}
1648 \DeclareTextSymbol{\OE}{OT1}{30}
1649 \DeclareTextSymbol{\O}{OT1}{31}
1650 \DeclareTextSymbol{\ae}{OT1}{26}
1651 \DeclareTextSymbol{\i}{OT1}{16}
1652 \DeclareTextSymbol{\j}{OT1}{17}
1653 \DeclareTextSymbol{\oe}{OT1}{27}
1654 \DeclareTextSymbol{\o}{OT1}{28}
1655 \DeclareTextSymbol{\ss}{OT1}{25}
1656 \DeclareTextSymbol{\textemdash}{OT1}{124}
1657 \DeclareTextSymbol{\textendash}{OT1}{123}
1658 %    \end{macrocode}
1659 %    Using the ligatures helps with OT1 fonts that have
1660 %    |\textexclamdown| and |\textquestiondown| in unusual positions.
1661 % \changes{v1.95}{2002/06/17}{Definition of \cs{textexclamdown} changed (pr/3368)}
1662 % \changes{v1.95}{2002/06/17}{Definition of \cs{textquestiondown} changed (pr/3368)}
1663 %    \begin{macrocode}
1664 %\DeclareTextSymbol{\textexclamdown}{OT1}{60}
1665 %\DeclareTextSymbol{\textquestiondown}{OT1}{62}
1666 \DeclareTextCommand{\textexclamdown}{OT1}{!`}
1667 \DeclareTextCommand{\textquestiondown}{OT1}{?`}
1668 %\DeclareTextSymbol{\texthyphenchar}{OT1}{`\-}
1669 %\DeclareTextSymbol{\texthyphen}{OT1}{`\-}
1670 \DeclareTextSymbol{\textquotedblleft}{OT1}{92}
1671 \DeclareTextSymbol{\textquotedblright}{OT1}{`\"}
1672 \DeclareTextSymbol{\textquoteleft}{OT1}{`\`}
1673 \DeclareTextSymbol{\textquoteright}{OT1}{`\'}
1674 %    \end{macrocode}
1675 %    Some symbols which are faked from others:
1676 % \changes{v1.7o}{1995/11/07}{Changed \cs{char}32 to \cs{@xxxii} (two
1677 % tokens less).}
1678 % \changes{v1.7o}{1995/11/07}{Replaced octal number 27 by decimal
1679 % number 23 to protect against the quote character being active.}
1680 % \changes{v1.7o}{1995/11/07}{Replaced some 0's by \cs{z@} (faster).}
1681 % \changes{v1.8c}{1996/10/27}
1682 %      {Removed \cs{aa} and \cs{AA}}
1683 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
1684 %    (pr/3160)}
1685 %    \begin{macrocode}
1686 % \DeclareTextCommand{\aa}{OT1}
1687 %    {{\accent23a}}
1688 \DeclareTextCommand{\L}{OT1}
1689    {\leavevmode\setbox\z@\hbox{L}\hb@xt@\wd\z@{\hss\@xxxii L}}
1690 \DeclareTextCommand{\l}{OT1}
1691    {\hmode@bgroup\@xxxii l\egroup}
1692 % \DeclareTextCommand{\AA}{OT1}
1693 %    {\leavevmode\setbox\z@\hbox{h}\dimen@\ht\z@\advance\dimen@-1ex%
1694 %     \rlap{\raise.67\dimen@\hbox{\char23}}A}
1695 %    \end{macrocode}
1696 %    In the OT1 encoding \r A has a hand-crafted definition, so we
1697 %    have here the first recorded explicit use of
1698 %    |\DeclareTextCompositeCommand|.
1699 % \changes{v1.8c}{1996/10/27}
1700 %      {Added \cs{r} A}
1701 % \changes{v1.96}{2002/10/28}{%
1702 %   coding change, to follow bug fix by DEK in plain.tex (pr/3469)}
1703 % \changes{v2.0f}{2017/02/19}{%
1704 %     add \cs{@empty} to guard against 3rd argument being empty}
1705 %    \begin{macrocode}
1706 \DeclareTextCompositeCommand{\r}{OT1}{A}
1707    {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex%
1708     \rlap{\raise.67\dimen@\hbox{\char23}}A}
1709 %    \end{macrocode}
1710 % \changes{v1.99h}{2005/11/08}
1711 %      {Added \cs{ij} and \cs{IJ} from babel. (pr/3771)}
1712 %    The dutch language uses the letter `ij'. It is available in
1713 %    \texttt{T1} encoded fonts, but not in the \texttt{OT1} encoded
1714 %    fonts. Therefor we fake it for the \texttt{OT1} encoding.
1715 %    \begin{macrocode}
1716 \DeclareTextCommand{\ij}{OT1}{%
1717   \nobreak\hskip\z@skip i\kern-0.02em j\nobreak\hskip\z@skip}
1718 \DeclareTextCommand{\IJ}{OT1}{%
1719   \nobreak\hskip\z@skip I\kern-0.02em J\nobreak\hskip\z@skip}
1720 %    \end{macrocode}
1721 %    In the OT1 encoding, \pounds~and \$ share a slot.
1722 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
1723 %    (pr/3160)}
1724 %    \begin{macrocode}
1725 \DeclareTextCommand{\textdollar}{OT1}{\hmode@bgroup
1726    \ifdim \fontdimen\@ne\font >\z@
1727       \slshape
1728    \else
1729       \upshape
1730    \fi
1731    \char`\$\egroup}
1732 %    \end{macrocode}
1734 %    \begin{macrocode}
1735 \DeclareTextCommand{\textsterling}{OT1}{\hmode@bgroup
1736    \ifdim \fontdimen\@ne\font >\z@
1737       \itshape
1738    \else
1739       \fontshape{ui}\selectfont
1740    \fi
1741    \char`\$\egroup}
1742 %    \end{macrocode}
1744 %    Here we are adding some more composite commands to the |OT1|
1745 %    encoding.  This makes the use of certain accents with |i|
1746 %    compatible with their use with the |T1| encoding; this
1747 %    enables them to become true \LaTeX{} internal representations.
1748 %    However, it will make these accents work a little less fast since
1749 %    a check will always be made for the existence of a composite.
1751 % \changes{v1.93}{2001/05/28}{Added composites for compatibility with
1752 %                             T1, pr/3295}
1753 % \changes{v1.94}{2001/06/05}{Text composite Commands need kludges for
1754 %                               `,' -- see tlb1903.lvt}
1755 %    \begin{macrocode}
1756 \DeclareTextComposite{\.}{OT1}{i}{`\i}
1757 \DeclareTextComposite{\.}{OT1}{\i}{`\i}
1758 \DeclareTextCompositeCommand{\`}{OT1}{i}{\@tabacckludge`\i}
1759 \DeclareTextCompositeCommand{\'}{OT1}{i}{\@tabacckludge'\i}
1760 \DeclareTextCompositeCommand{\^}{OT1}{i}{\^\i}
1761 \DeclareTextCompositeCommand{\"}{OT1}{i}{\"\i}
1762 %    \end{macrocode}
1764 % T1 encoding is given more extensive set of overloads for \verb|\c|
1765 % But here we just adjust \verb|\c{g}|.
1766 % \changes{v1.99n}{2015/02/16}{Added composites for \cs{c}}
1767 % \changes{v1.99m}{2016/06/19}{OT1 definition (was duplicate T1 definition)}
1768 %    \begin{macrocode}
1769 \ifx\textcommaabove\@undefined\else
1770 \DeclareTextCompositeCommand{\c}{OT1}{g}{\textcommaabove{g}}
1772 %    \end{macrocode}
1774 %    \begin{macrocode}
1775 %</OT1>
1776 %    \end{macrocode}
1778 % \subsection{Definitions for the T1 encoding}
1780 % \changes{1.3}{1993/12/17}{Removed all the hackery for use in
1781 %    \cs{DeclareFontEncoding}, and redid everything using
1782 %    \cs{DeclareTextFoo}.}
1783 % \changes{1.3b}{1993/12/18}{Replaced the missing last argument to
1784 %    \cs{DeclareFontEncoding}.}
1785 % \changes{1.3c}{1993/12/18}{Rewrote for the new syntax of
1786 %    \cs{EncodingSpecific}.}
1787 % \changes{1.4a}{1994/05/01}{Rewrote for the new syntax.}
1788 % \changes{1.5a}{1994/05/12}{Rewrote for the new syntax.}
1789 % \changes{1.6a}{1994/10/25}{Added \cs{textdollar},
1790 %    \cs{textlbrace}, \cs{textrbrace}, \cs{textsterling},
1791 %    \cs{textunderline}.}
1792 % \changes{1.6a}{1994/10/25}{Removed
1793 %    \cs{textlbrace}, \cs{textrbrace}, \cs{textunderline} to give them
1794 %    their proper names.}
1795 % \changes{1.6b}{1994/10/27}{Added
1796 %   \cs{textasciicircum}
1797 %   \cs{textasciitilde}
1798 %   \cs{textbackslash}
1799 %   \cs{textbar}
1800 %   \cs{textbraceleft}
1801 %   \cs{textbraceright}
1802 %   \cs{textcompwordmark}
1803 %   \cs{textemdash}
1804 %   \cs{textendash}
1805 %   \cs{textexclamdown}
1806 %   \cs{textgreater}
1807 %   \cs{texthyphenchar}
1808 %   \cs{texthyphen}
1809 %   \cs{textless}
1810 %   \cs{textquestiondown}
1811 %   \cs{textquotedblleft}
1812 %   \cs{textquotedblright}
1813 %   \cs{textquotedbl}
1814 %   \cs{textquoteleft}
1815 %   \cs{textquoteright}
1816 %   \cs{textunderscore}
1817 %   \cs{textvisiblespace}
1818 % }
1819 % \changes{v1.9h}{1997/12/17}
1820 %    {Added \cs{textperthousand} and \cs{textpertenthousand}}
1822 % The definitions for the `Extended \TeX{} text' (T1) encoding.
1824 %    Declare the encoding.
1825 %    \begin{macrocode}
1826 %<*T1>
1827 \DeclareFontEncoding{T1}{}{}
1828 %    \end{macrocode}
1829 %    Declare the accents.
1830 %    \begin{macrocode}
1831 \DeclareTextAccent{\`}{T1}{0}
1832 \DeclareTextAccent{\'}{T1}{1}
1833 \DeclareTextAccent{\^}{T1}{2}
1834 \DeclareTextAccent{\~}{T1}{3}
1835 \DeclareTextAccent{\"}{T1}{4}
1836 \DeclareTextAccent{\H}{T1}{5}
1837 \DeclareTextAccent{\r}{T1}{6}
1838 \DeclareTextAccent{\v}{T1}{7}
1839 \DeclareTextAccent{\u}{T1}{8}
1840 \DeclareTextAccent{\=}{T1}{9}
1841 \DeclareTextAccent{\.}{T1}{10}
1842 %    \end{macrocode}
1843 %    Some accents have to be built by hand.
1844 %    Note that |\ooalign| and |\o@lign| must be inside a group.
1845 % \changes{v1.9h}{1997/12/17}{As in OT1, Added \cs{leavevmode} at
1846 % start of \cs{c}, otherwise the output routine might be invoked
1847 % within the macro.}
1848 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
1849 %    (pr/3160)}
1850 % \changes{v1.95}{2002/06/17}{Corrected \cs{c} for T1 (pr/3442)}
1851 % \changes{v1.99b}{2004/01/03}{Use \cs{ooalign} for \cs{k} (pr/3532)}
1852 % \changes{v1.99b}{2004/01/03}{Added \cs{textogonekcentered} (pr/3532)}
1853 % \changes{v1.99c}{2004/01/04}{More adjustments for ogonek (pr/3532)}
1854 % \changes{v1.99g}{2005/09/27}{Replace \cs{sh@ft} by \cs{ltx@sh@ft}}
1855 %  In these definitions we no longer use the helper function |\sh@ft|
1856 %  from plain.tex since that now has two incompatible definitions.
1857 %    \begin{macrocode}
1858 \DeclareTextCommand{\b}{T1}[1]
1859    {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-3ex}%
1860      \vbox to.2ex{\hbox{\char9}\vss}\hidewidth}\egroup}
1861 \DeclareTextCommand{\c}{T1}[1]
1862    {\leavevmode\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent11 #1%
1863      \else{\ooalign{\unhbox\z@\crcr
1864         \hidewidth\char11\hidewidth}}\fi}
1865 \DeclareTextCommand{\d}{T1}[1]
1866    {\hmode@bgroup
1867     \o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-1ex}.\hidewidth}\egroup}
1868 \DeclareTextCommand{\k}{T1}[1]
1869    {\hmode@bgroup\ooalign{\null#1\crcr\hidewidth\char12}\egroup}
1870 \DeclareTextCommand{\textogonekcentered}{T1}[1]
1871    {\hmode@bgroup\ooalign{%
1872                 \null#1\crcr\hidewidth\char12\hidewidth}\egroup}
1873 %    \end{macrocode}
1875 %    Some symbols are constructed.
1877 % \changes{v1.9h}{1997/12/17}
1878 %    {Added \cs{textperthousand} and \cs{textpertenthousand}}
1879 %    Slot 24 contains a small circle intended for construction of
1880 %    these two glyphs.
1882 %    \begin{macrocode}
1883 \DeclareTextCommand{\textperthousand}{T1}
1884    {\%\char 24 }          % space or `relax as delimiter?
1885 \DeclareTextCommand{\textpertenthousand}{T1}
1886    {\%\char 24\char 24 }  % space or `relax as delimiter?
1887 %    \end{macrocode}
1889 %    Declare the text symbols.
1890 % \changes{v1.7t}{1995/11/29}{Added \cs{textasciicircum},
1891 %    \cs{textasciitilde}, \cs{textbackslash}, \cs{textbar},
1892 %    \cs{textgreater} and \cs{textless}.}
1893 % \changes{v1.8c}{1996/10/27}
1894 %      {Removed \cs{aa} and \cs{AA}}
1895 % \changes{v1.99h}{2005/11/08}
1896 %      {Added \cs{ij} and \cs{IJ} from babel. (pr/3771)}
1898 %    \begin{macrocode}
1899 %\DeclareTextSymbol{\AA}{T1}{197}
1900 \DeclareTextSymbol{\AE}{T1}{198}
1901 \DeclareTextSymbol{\DH}{T1}{208}
1902 \DeclareTextSymbol{\DJ}{T1}{208}
1903 \DeclareTextSymbol{\L}{T1}{138}
1904 \DeclareTextSymbol{\NG}{T1}{141}
1905 \DeclareTextSymbol{\OE}{T1}{215}
1906 \DeclareTextSymbol{\O}{T1}{216}
1907 \DeclareTextSymbol{\SS}{T1}{223}
1908 \DeclareTextSymbol{\TH}{T1}{222}
1909 %\DeclareTextSymbol{\aa}{T1}{229}
1910 \DeclareTextSymbol{\ae}{T1}{230}
1911 \DeclareTextSymbol{\dh}{T1}{240}
1912 \DeclareTextSymbol{\dj}{T1}{158}
1913 \DeclareTextSymbol{\guillemotleft}{T1}{19}
1914 \DeclareTextSymbol{\guillemotright}{T1}{20}
1915 \DeclareTextSymbol{\guilsinglleft}{T1}{14}
1916 \DeclareTextSymbol{\guilsinglright}{T1}{15}
1917 \DeclareTextSymbol{\i}{T1}{25}
1918 \DeclareTextSymbol{\j}{T1}{26}
1919 \DeclareTextSymbol{\ij}{T1}{188}
1920 \DeclareTextSymbol{\IJ}{T1}{156}
1921 \DeclareTextSymbol{\l}{T1}{170}
1922 \DeclareTextSymbol{\ng}{T1}{173}
1923 \DeclareTextSymbol{\oe}{T1}{247}
1924 \DeclareTextSymbol{\o}{T1}{248}
1925 \DeclareTextSymbol{\quotedblbase}{T1}{18}
1926 \DeclareTextSymbol{\quotesinglbase}{T1}{13}
1927 \DeclareTextSymbol{\ss}{T1}{255}
1928 \DeclareTextSymbol{\textasciicircum}{T1}{`\^}
1929 \DeclareTextSymbol{\textasciitilde}{T1}{`\~}
1930 \DeclareTextSymbol{\textbackslash}{T1}{`\\}
1931 \DeclareTextSymbol{\textbar}{T1}{`\|}
1932 \DeclareTextSymbol{\textbraceleft}{T1}{`\{}
1933 \DeclareTextSymbol{\textbraceright}{T1}{`\}}
1934 \DeclareTextSymbol{\textcompwordmark}{T1}{23}
1935 \DeclareTextSymbol{\textdollar}{T1}{`\$}
1936 \DeclareTextSymbol{\textemdash}{T1}{22}
1937 \DeclareTextSymbol{\textendash}{T1}{21}
1938 \DeclareTextSymbol{\textexclamdown}{T1}{189}
1939 \DeclareTextSymbol{\textgreater}{T1}{`\>}
1940 %\DeclareTextSymbol{\texthyphenchar}{T1}{127}
1941 %\DeclareTextSymbol{\texthyphen}{T1}{`\-}
1942 \DeclareTextSymbol{\textless}{T1}{`\<}
1943 \DeclareTextSymbol{\textquestiondown}{T1}{190}
1944 \DeclareTextSymbol{\textquotedblleft}{T1}{16}
1945 \DeclareTextSymbol{\textquotedblright}{T1}{17}
1946 \DeclareTextSymbol{\textquotedbl}{T1}{`\"}
1947 \DeclareTextSymbol{\textquoteleft}{T1}{`\`}
1948 \DeclareTextSymbol{\textquoteright}{T1}{`\'}
1949 \DeclareTextSymbol{\textsection}{T1}{159}
1950 \DeclareTextSymbol{\textsterling}{T1}{191}
1951 \DeclareTextSymbol{\textunderscore}{T1}{95}
1952 \DeclareTextSymbol{\textvisiblespace}{T1}{32}
1953 \DeclareTextSymbol{\th}{T1}{254}
1954 %    \end{macrocode}
1955 %    Declare the composites.
1956 % \changes{v1.93}{2001/05/28}{Changed the effect of
1957 %                             \cs{.}\cs{i}, pr/3295}
1958 %    \begin{macrocode}
1959 \DeclareTextComposite{\.}{T1}{i}{`\i}
1960 \DeclareTextComposite{\.}{T1}{\i}{`\i}
1961 %    \end{macrocode}
1962 % \changes{v1.9c}{1997/05/04}{Added `hex index tabs'}
1963 %    "80 = 128
1964 %    \begin{macrocode}
1965 \DeclareTextComposite{\u}{T1}{A}{128}
1966 \DeclareTextComposite{\k}{T1}{A}{129}
1967 \DeclareTextComposite{\'}{T1}{C}{130}
1968 \DeclareTextComposite{\v}{T1}{C}{131}
1969 \DeclareTextComposite{\v}{T1}{D}{132}
1970 \DeclareTextComposite{\v}{T1}{E}{133}
1971 \DeclareTextComposite{\k}{T1}{E}{134}
1972 \DeclareTextComposite{\u}{T1}{G}{135}
1973 %    \end{macrocode}
1974 %    "88 = 136
1975 %    \begin{macrocode}
1976 \DeclareTextComposite{\'}{T1}{L}{136}
1977 \DeclareTextComposite{\v}{T1}{L}{137}
1978 \DeclareTextComposite{\'}{T1}{N}{139}
1979 \DeclareTextComposite{\v}{T1}{N}{140}
1980 \DeclareTextComposite{\H}{T1}{O}{142}
1981 \DeclareTextComposite{\'}{T1}{R}{143}
1982 %    \end{macrocode}
1983 %    "90 = 144
1984 %    \begin{macrocode}
1985 \DeclareTextComposite{\v}{T1}{R}{144}
1986 \DeclareTextComposite{\'}{T1}{S}{145}
1987 \DeclareTextComposite{\v}{T1}{S}{146}
1988 \DeclareTextComposite{\c}{T1}{S}{147}
1989 \DeclareTextComposite{\v}{T1}{T}{148}
1990 \DeclareTextComposite{\c}{T1}{T}{149}
1991 \DeclareTextComposite{\H}{T1}{U}{150}
1992 \DeclareTextComposite{\r}{T1}{U}{151}
1993 %    \end{macrocode}
1994 %    "98 = 152
1995 %    \begin{macrocode}
1996 \DeclareTextComposite{\"}{T1}{Y}{152}
1997 \DeclareTextComposite{\'}{T1}{Z}{153}
1998 \DeclareTextComposite{\v}{T1}{Z}{154}
1999 \DeclareTextComposite{\.}{T1}{Z}{155}
2000 \DeclareTextComposite{\.}{T1}{I}{157}
2001 %    \end{macrocode}
2002 %    "A0 = 160
2003 %    \begin{macrocode}
2004 \DeclareTextComposite{\u}{T1}{a}{160}
2005 \DeclareTextComposite{\k}{T1}{a}{161}
2006 \DeclareTextComposite{\'}{T1}{c}{162}
2007 \DeclareTextComposite{\v}{T1}{c}{163}
2008 \DeclareTextComposite{\v}{T1}{d}{164}
2009 \DeclareTextComposite{\v}{T1}{e}{165}
2010 \DeclareTextComposite{\k}{T1}{e}{166}
2011 \DeclareTextComposite{\u}{T1}{g}{167}
2012 %    \end{macrocode}
2013 %    "A8 = 168
2014 %    \begin{macrocode}
2015 \DeclareTextComposite{\'}{T1}{l}{168}
2016 \DeclareTextComposite{\v}{T1}{l}{169}
2017 \DeclareTextComposite{\'}{T1}{n}{171}
2018 \DeclareTextComposite{\v}{T1}{n}{172}
2019 \DeclareTextComposite{\H}{T1}{o}{174}
2020 \DeclareTextComposite{\'}{T1}{r}{175}
2021 %    \end{macrocode}
2022 %    "B0 = 176
2023 %    \begin{macrocode}
2024 \DeclareTextComposite{\v}{T1}{r}{176}
2025 \DeclareTextComposite{\'}{T1}{s}{177}
2026 \DeclareTextComposite{\v}{T1}{s}{178}
2027 \DeclareTextComposite{\c}{T1}{s}{179}
2028 \DeclareTextComposite{\v}{T1}{t}{180}
2029 \DeclareTextComposite{\c}{T1}{t}{181}
2030 \DeclareTextComposite{\H}{T1}{u}{182}
2031 \DeclareTextComposite{\r}{T1}{u}{183}
2032 %    \end{macrocode}
2033 %    "B8 = 184
2034 %    \begin{macrocode}
2035 \DeclareTextComposite{\"}{T1}{y}{184}
2036 \DeclareTextComposite{\'}{T1}{z}{185}
2037 \DeclareTextComposite{\v}{T1}{z}{186}
2038 \DeclareTextComposite{\.}{T1}{z}{187}
2039 %    \end{macrocode}
2040 %    "C0 = 192
2041 %    \begin{macrocode}
2042 \DeclareTextComposite{\`}{T1}{A}{192}
2043 \DeclareTextComposite{\'}{T1}{A}{193}
2044 \DeclareTextComposite{\^}{T1}{A}{194}
2045 \DeclareTextComposite{\~}{T1}{A}{195}
2046 \DeclareTextComposite{\"}{T1}{A}{196}
2047 \DeclareTextComposite{\r}{T1}{A}{197}
2048 \DeclareTextComposite{\c}{T1}{C}{199}
2049 %    \end{macrocode}
2050 %    "C8 = 200
2051 %    \begin{macrocode}
2052 \DeclareTextComposite{\`}{T1}{E}{200}
2053 \DeclareTextComposite{\'}{T1}{E}{201}
2054 \DeclareTextComposite{\^}{T1}{E}{202}
2055 \DeclareTextComposite{\"}{T1}{E}{203}
2056 \DeclareTextComposite{\`}{T1}{I}{204}
2057 \DeclareTextComposite{\'}{T1}{I}{205}
2058 \DeclareTextComposite{\^}{T1}{I}{206}
2059 \DeclareTextComposite{\"}{T1}{I}{207}
2060 %    \end{macrocode}
2061 %    "D0 = 208
2062 %    \begin{macrocode}
2063 \DeclareTextComposite{\~}{T1}{N}{209}
2064 \DeclareTextComposite{\`}{T1}{O}{210}
2065 \DeclareTextComposite{\'}{T1}{O}{211}
2066 \DeclareTextComposite{\^}{T1}{O}{212}
2067 \DeclareTextComposite{\~}{T1}{O}{213}
2068 \DeclareTextComposite{\"}{T1}{O}{214}
2069 %    \end{macrocode}
2070 %    "D8 = 216
2071 %    \begin{macrocode}
2072 \DeclareTextComposite{\`}{T1}{U}{217}
2073 \DeclareTextComposite{\'}{T1}{U}{218}
2074 \DeclareTextComposite{\^}{T1}{U}{219}
2075 \DeclareTextComposite{\"}{T1}{U}{220}
2076 \DeclareTextComposite{\'}{T1}{Y}{221}
2077 %    \end{macrocode}
2078 %    "E0 = 224
2079 %    \begin{macrocode}
2080 \DeclareTextComposite{\`}{T1}{a}{224}
2081 \DeclareTextComposite{\'}{T1}{a}{225}
2082 \DeclareTextComposite{\^}{T1}{a}{226}
2083 \DeclareTextComposite{\~}{T1}{a}{227}
2084 \DeclareTextComposite{\"}{T1}{a}{228}
2085 \DeclareTextComposite{\r}{T1}{a}{229}
2086 \DeclareTextComposite{\c}{T1}{c}{231}
2087 %    \end{macrocode}
2088 %    "E8 = 232
2089 %    \begin{macrocode}
2090 \DeclareTextComposite{\`}{T1}{e}{232}
2091 \DeclareTextComposite{\'}{T1}{e}{233}
2092 \DeclareTextComposite{\^}{T1}{e}{234}
2093 \DeclareTextComposite{\"}{T1}{e}{235}
2094 \DeclareTextComposite{\`}{T1}{i}{236}
2095 \DeclareTextComposite{\`}{T1}{\i}{236}
2096 \DeclareTextComposite{\'}{T1}{i}{237}
2097 \DeclareTextComposite{\'}{T1}{\i}{237}
2098 \DeclareTextComposite{\^}{T1}{i}{238}
2099 \DeclareTextComposite{\^}{T1}{\i}{238}
2100 \DeclareTextComposite{\"}{T1}{i}{239}
2101 \DeclareTextComposite{\"}{T1}{\i}{239}
2102 %    \end{macrocode}
2103 %    "F0 = 240
2104 %    \begin{macrocode}
2105 \DeclareTextComposite{\~}{T1}{n}{241}
2106 \DeclareTextComposite{\`}{T1}{o}{242}
2107 \DeclareTextComposite{\'}{T1}{o}{243}
2108 \DeclareTextComposite{\^}{T1}{o}{244}
2109 \DeclareTextComposite{\~}{T1}{o}{245}
2110 \DeclareTextComposite{\"}{T1}{o}{246}
2111 %    \end{macrocode}
2112 %    "F8 = 248
2113 %    \begin{macrocode}
2114 \DeclareTextComposite{\`}{T1}{u}{249}
2115 \DeclareTextComposite{\'}{T1}{u}{250}
2116 \DeclareTextComposite{\^}{T1}{u}{251}
2117 \DeclareTextComposite{\"}{T1}{u}{252}
2118 \DeclareTextComposite{\'}{T1}{y}{253}
2119 %    \end{macrocode}
2120 % \changes{v1.99b}{2004/01/03}{Added composites for \cs{k} (pr/3532)}
2121 %    \begin{macrocode}
2122 \DeclareTextCompositeCommand{\k}{T1}{o}{\textogonekcentered{o}}
2123 \DeclareTextCompositeCommand{\k}{T1}{O}{\textogonekcentered{O}}
2124 %    \end{macrocode}
2125 % \changes{v1.99n}{2015/02/16}{Added composites for \c{c}}
2126 %    \begin{macrocode}
2127 \ifx\textcommaabove\@undefined\else
2128 \DeclareTextCompositeCommand{\c}{T1}{g}{\textcommaabove{g}}
2130 \ifx\textcommabelow\@undefined\else
2131 \DeclareTextCompositeCommand{\c}{T1}{G}{\textcommabelow{G}}
2132 \DeclareTextCompositeCommand{\c}{T1}{K}{\textcommabelow{K}}
2133 \DeclareTextCompositeCommand{\c}{T1}{k}{\textcommabelow{k}}
2134 \DeclareTextCompositeCommand{\c}{T1}{L}{\textcommabelow{L}}
2135 \DeclareTextCompositeCommand{\c}{T1}{l}{\textcommabelow{l}}
2136 \DeclareTextCompositeCommand{\c}{T1}{N}{\textcommabelow{N}}
2137 \DeclareTextCompositeCommand{\c}{T1}{n}{\textcommabelow{n}}
2138 \DeclareTextCompositeCommand{\c}{T1}{R}{\textcommabelow{R}}
2139 \DeclareTextCompositeCommand{\c}{T1}{r}{\textcommabelow{r}}
2141 %    \end{macrocode}
2143 %    \begin{macrocode}
2144 %</T1>
2145 %    \end{macrocode}
2147 % \changes{1.4a}{1994/05/01}{Removed the uc/lc table settings, since
2148 %    the T1 uc/lc table is now the default.}
2150 % \subsection{Definitions for the OMS encoding}
2152 % \changes{v1.6a}{1994/10/25}{Added the OMS encoding.}
2153 % \changes{v1.6b}{1994/10/27}{Renamed \cs{textlbrace} to
2154 %    \cs{textbraceleft} and \cs{textrbrace} to \cs{textbraceright}.}
2155 % \changes{v1.6b}{1994/10/27}{Added \cs{textbackslash}.}
2156 % \changes{v1.6d}{1994/10/30}{Added \cs{textcircled}.}
2158 % The definitions for the `\TeX{} math symbol' (OMS) encoding.  Even
2159 % though this is meant to be a math font, it includes some of the
2160 % standard \LaTeX{} text symbols.
2162 %    Declare the encoding.
2163 %    \begin{macrocode}
2164 %<*OMS>
2165 \DeclareFontEncoding{OMS}{}{}
2166 %    \end{macrocode}
2167 %    Declare the symbols.
2168 % \changes{v1.7t}{1995/11/29}{Added \cs{textbackslash} and
2169 %    \cs{textbar}.}
2170 % \changes{v1.8c}{1996/10/27}
2171 %      {Added \cs{textasteriskcentered}}
2172 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
2173 %    (pr/3160)}
2174 % \changes{v1.95}{2002/06/16}{Added \cs{textbardbl} (pr/3400)}
2175 % \changes{v1.99}{2004/02/02}{Added \cs{textbigcircle}}
2176 %    Note that slot 13 has in places been named |\Orb|: please root
2177 %    out and destroy this impolity wherever you find it!
2178 %    \begin{macrocode}
2179 \DeclareTextSymbol{\textasteriskcentered}{OMS}{3}   % "03
2180 \DeclareTextSymbol{\textbackslash}{OMS}{110}        % "6E
2181 \DeclareTextSymbol{\textbar}{OMS}{106}              % "6A
2182 \DeclareTextSymbol{\textbardbl}{OMS}{107}           % "6B
2183 \DeclareTextSymbol{\textbraceleft}{OMS}{102}        % "66
2184 \DeclareTextSymbol{\textbraceright}{OMS}{103}       % "67
2185 \DeclareTextSymbol{\textbullet}{OMS}{15}            % "0F
2186 \DeclareTextSymbol{\textdaggerdbl}{OMS}{122}        % "7A
2187 \DeclareTextSymbol{\textdagger}{OMS}{121}           % "79
2188 \DeclareTextSymbol{\textparagraph}{OMS}{123}        % "7B
2189 \DeclareTextSymbol{\textperiodcentered}{OMS}{1}     % "01
2190 \DeclareTextSymbol{\textsection}{OMS}{120}          % "78
2191 \DeclareTextSymbol{\textbigcircle}{OMS}{13}         % "0D
2192 \DeclareTextCommand{\textcircled}{OMS}[1]{\hmode@bgroup
2193    \ooalign{%
2194       \hfil \raise .07ex\hbox {\upshape#1}\hfil \crcr
2195       \char 13 % "0D
2196    }%
2197  \egroup}
2198 %</OMS>
2199 %    \end{macrocode}
2201 % \subsection{Definitions for the OML encoding}
2203 % \changes{v1.6d}{1994/10/30}{Added the OML encoding.}
2205 % The definitions for the `\TeX{} math italic' (OML) encoding.  Even
2206 % though this is meant to be a math font, it includes some of the
2207 % standard \LaTeX{} text symbols.
2209 %    Declare the encoding.
2210 %    \begin{macrocode}
2211 %<*OML>
2212 \DeclareFontEncoding{OML}{}{}
2213 %    \end{macrocode}
2214 %    Declare the symbols.
2215 % \changes{v1.7t}{1995/11/29}{Added \cs{textless} and
2216 %    \cs{textgreater}.}
2217 % \changes{v1.9h}{1997/12/17}{Changed to decimal codes.}
2218 % \changes{v1.9m}{1998/01/16}{fixed decimal codes. latex/2734}
2219 %    \begin{macrocode}
2220 \DeclareTextSymbol{\textless}{OML}{`\<}
2221 \DeclareTextSymbol{\textgreater}{OML}{`\>}
2222 \DeclareTextAccent{\t}{OML}{127}  % "7F
2223 %</OML>
2224 %    \end{macrocode}
2226 % \subsection{Definitions for the OT4 encoding}
2228 % These definitions are for the Polish extension to the
2229 % `\TeX\ text' (OT1) encoding.
2230 % This encoding was created by B.~Jackowski and M.~Ry\'cko
2231 % for use with the Polish version of Computer Modern and Computer
2232 % Concrete.  In positions 0--127 it is identical to OT1 but it
2233 % contains some additional characters in the upper half.  The \LaTeX{}
2234 % support was developed by Mariusz Olko.
2236 % The PL fonts that use it are available as follows:\\
2237 % Metafont sources
2238 % \texttt{ftp://ftp.gust.org.pl/TeX/language/polish/pl-mf.zip};
2240 % Font files
2241 % \texttt{ftp://ftp.gust.org.pl/TeX/language/polish/pl-tfm.zip}.
2243 %    Declare the encoding.
2244 %    \begin{macrocode}
2245 %<*OT4>
2246 \DeclareFontEncoding{OT4}{}{}
2247 \DeclareFontSubstitution{OT4}{cmr}{m}{n}
2248 %    \end{macrocode}
2249 %    Declare the accents.
2250 %    \begin{macrocode}
2251 \DeclareTextAccent{\"}{OT4}{127}
2252 \DeclareTextAccent{\'}{OT4}{19}
2253 \DeclareTextAccent{\.}{OT4}{95}
2254 \DeclareTextAccent{\=}{OT4}{22}
2255 \DeclareTextAccent{\^}{OT4}{94}
2256 \DeclareTextAccent{\`}{OT4}{18}
2257 \DeclareTextAccent{\~}{OT4}{126}
2258 \DeclareTextAccent{\H}{OT4}{125}
2259 \DeclareTextAccent{\u}{OT4}{21}
2260 \DeclareTextAccent{\v}{OT4}{20}
2261 \DeclareTextAccent{\r}{OT4}{23}
2262 %    \end{macrocode}
2263 %    The ogonek accent is available only under a e A \& E.  But we
2264 %    have to provide some definition for \cs{k}. Some other accents
2265 %    have to be built by hand as in OT1:
2266 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
2267 %    (pr/3160)}
2268 %    \begin{macrocode}
2269 \DeclareTextCommand{\k}{OT4}[1]{%
2270     \TextSymbolUnavailable{\k{#1}}#1}
2271 %    \end{macrocode}
2272 %  In these definitions we no longer use the helper function |\sh@ft|
2273 %  from plain.tex since that now has two incompatible definitions.
2274 % \changes{v1.99g}{2005/09/27}{Replace \cs{sh@ft} by \cs{ltx@sh@ft}}
2275 %    \begin{macrocode}
2276 \DeclareTextCommand{\b}{OT4}[1]
2277    {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-3ex}%
2278      \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}\egroup}
2279 \DeclareTextCommand{\c}{OT4}[1]
2280    {\leavevmode\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent24 #1%
2281     \else{\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}}\fi}
2282 \DeclareTextCommand{\d}{OT4}[1]
2283    {\hmode@bgroup
2284     \o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-1ex}.\hidewidth}\egroup}
2285 %    \end{macrocode}
2286 %    Declare the text symbols.
2287 %    \begin{macrocode}
2288 \DeclareTextSymbol{\AE}{OT4}{29}
2289 \DeclareTextSymbol{\OE}{OT4}{30}
2290 \DeclareTextSymbol{\O}{OT4}{31}
2291 \DeclareTextSymbol{\L}{OT4}{138}
2292 \DeclareTextSymbol{\ae}{OT4}{26}
2293 \DeclareTextSymbol{\guillemotleft}{OT4}{174}
2294 \DeclareTextSymbol{\guillemotright}{OT4}{175}
2295 \DeclareTextSymbol{\i}{OT4}{16}
2296 \DeclareTextSymbol{\j}{OT4}{17}
2297 \DeclareTextSymbol{\l}{OT4}{170}
2298 \DeclareTextSymbol{\o}{OT4}{28}
2299 \DeclareTextSymbol{\oe}{OT4}{27}
2300 \DeclareTextSymbol{\quotedblbase}{OT4}{255}
2301 \DeclareTextSymbol{\ss}{OT4}{25}
2302 \DeclareTextSymbol{\textemdash}{OT4}{124}
2303 \DeclareTextSymbol{\textendash}{OT4}{123}
2304 \DeclareTextSymbol{\textexclamdown}{OT4}{60}
2305 %\DeclareTextSymbol{\texthyphenchar}{OT4}{`\-}
2306 %\DeclareTextSymbol{\texthyphen}{OT4}{`\-}
2307 \DeclareTextSymbol{\textquestiondown}{OT4}{62}
2308 \DeclareTextSymbol{\textquotedblleft}{OT4}{92}
2309 \DeclareTextSymbol{\textquotedblright}{OT4}{`\"}
2310 \DeclareTextSymbol{\textquoteleft}{OT4}{`\`}
2311 \DeclareTextSymbol{\textquoteright}{OT4}{`\'}
2312 %    \end{macrocode}
2313 %    Definition for \r A as in OT1:
2314 % \changes{v1.96}{2002/10/28}{%
2315 %   coding change, to follow bug fix by DEK in plain.tex (pr/3469)}
2316 %    \begin{macrocode}
2317 \DeclareTextCompositeCommand{\r}{OT4}{A}
2318    {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex%
2319     \rlap{\raise.67\dimen@\hbox{\char23}}A}
2320 %    \end{macrocode}
2321 %    In the OT4 encoding, \pounds~and \$ share a slot.
2322 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
2323 %    (pr/3160)}
2324 %    \begin{macrocode}
2325 \DeclareTextCommand{\textdollar}{OT4}{\hmode@bgroup
2326    \ifdim \fontdimen\@ne\font >\z@
2327       \slshape
2328    \else
2329       \upshape
2330    \fi
2331    \char`\$\egroup}
2332 \DeclareTextCommand{\textsterling}{OT4}{\hmode@bgroup
2333    \ifdim \fontdimen\@ne\font >\z@
2334       \itshape
2335    \else
2336       \fontshape{ui}\selectfont
2337    \fi
2338    \char`\$\egroup}
2339 %    \end{macrocode}
2340 %    Declare the composites.
2341 %    \begin{macrocode}
2342 \DeclareTextComposite{\k}{OT4}{A}{129}
2343 \DeclareTextComposite{\'}{OT4}{C}{130}
2344 \DeclareTextComposite{\k}{OT4}{E}{134}
2345 \DeclareTextComposite{\'}{OT4}{N}{139}
2346 \DeclareTextComposite{\'}{OT4}{S}{145}
2347 \DeclareTextComposite{\'}{OT4}{Z}{153}
2348 \DeclareTextComposite{\.}{OT4}{Z}{155}
2349 \DeclareTextComposite{\k}{OT4}{a}{161}
2350 \DeclareTextComposite{\'}{OT4}{c}{162}
2351 \DeclareTextComposite{\k}{OT4}{e}{166}
2352 \DeclareTextComposite{\'}{OT4}{n}{171}
2353 \DeclareTextComposite{\'}{OT4}{s}{177}
2354 \DeclareTextComposite{\'}{OT4}{z}{185}
2355 \DeclareTextComposite{\.}{OT4}{z}{187}
2356 \DeclareTextComposite{\'}{OT4}{O}{211}
2357 \DeclareTextComposite{\'}{OT4}{o}{243}
2358 %</OT4>
2359 %    \end{macrocode}
2362 % \subsection{Definitions for the TS1 encoding}
2364 % \changes{v1.9c}{1997/05/04}{Added TS1 encoding v2.2.beta}
2365 % \changes{v1.9g}{1997/11/23}
2366 %    {Use \cs{textperthousand}, \cs{textpertenthousand} and
2367 %          \cs{textfractionsolidus} not
2368 %         \cs{textpermill}, \cs{textpertenmill} and \cs{textfraction}.
2369 %         /2673 }
2370 % \changes{v1.9h}{1997/12/17}
2371 %     {Removed default settings, see next section.}
2373 %    \begin{macrocode}
2374 %<*TS1>
2375 \DeclareFontEncoding{TS1}{}{}
2376 \DeclareFontSubstitution{TS1}{cmr}{m}{n}
2377 %    \end{macrocode}
2378 %    Some accents have to be built by hand.
2379 %    Note that |\ooalign| and |\o@lign| must be inside a group.
2380 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
2381 %    (pr/3160)}
2382 %    \begin{macrocode}
2383 \DeclareTextCommand{\capitalcedilla}{TS1}[1]
2384    {\hmode@bgroup
2385     \ooalign{\null#1\crcr\hidewidth\char11\hidewidth}\egroup}
2386 \DeclareTextCommand{\capitalogonek}{TS1}[1]
2387    {\hmode@bgroup
2388     \ooalign{\null#1\crcr\hidewidth\char12\hidewidth}\egroup}
2389 %    \end{macrocode}
2391 % Accents for capital letters.
2393 % These commands can be used by the end user either directly or through
2394 % definitions of the type
2395 % \begin{verbatim}
2396 % \DeclareTextCompositeCommand{\'}{T1}{X}{\capitalacute X}
2397 % \end{verbatim}
2398 % None of the latter definitions are provided by default, since they
2399 % are probably rarely used.
2401 %    "00 = 0
2402 %    \begin{macrocode}
2403 \DeclareTextAccent{\capitalgrave}{TS1}{0}
2404 \DeclareTextAccent{\capitalacute}{TS1}{1}
2405 \DeclareTextAccent{\capitalcircumflex}{TS1}{2}
2406 \DeclareTextAccent{\capitaltilde}{TS1}{3}
2407 \DeclareTextAccent{\capitaldieresis}{TS1}{4}
2408 \DeclareTextAccent{\capitalhungarumlaut}{TS1}{5}
2409 \DeclareTextAccent{\capitalring}{TS1}{6}
2410 \DeclareTextAccent{\capitalcaron}{TS1}{7}
2411 %    \end{macrocode}
2412 %    "08 = 8
2413 %    \begin{macrocode}
2414 \DeclareTextAccent{\capitalbreve}{TS1}{8}
2415 \DeclareTextAccent{\capitalmacron}{TS1}{9}
2416 \DeclareTextAccent{\capitaldotaccent}{TS1}{10}
2417 %    \end{macrocode}
2418 % Tie accents.
2420 % The tie accent was borrowed from the |cmmi| font. The tc fonts
2421 % now provide four tie accents, the first two are done in the
2422 % classical way with assymetric glyphs hanging out of their boxes;
2423 % the new ties are centered in their boxes like all other accents.
2424 % They need a name: please tell us if you know what to call them.
2426 %    " =
2427 %    \begin{macrocode}
2428 \DeclareTextAccent{\t}{TS1}{26}
2429 \DeclareTextAccent{\capitaltie}{TS1}{27}
2430 \DeclareTextAccent{\newtie}{TS1}{28}
2431 \DeclareTextAccent{\capitalnewtie}{TS1}{29}
2432 %    \end{macrocode}
2434 % Compund word marks.
2436 % The text companion fonts contain two compound word marks of
2437 % different heights, one has |cap_height|, the other |asc_height|.
2439 %    \begin{macrocode}
2440 \DeclareTextSymbol{\textcapitalcompwordmark}{TS1}{23}
2441 \DeclareTextSymbol{\textascendercompwordmark}{TS1}{31}
2442 %    \end{macrocode}
2444 % The text companion symbols.
2446 %    \begin{macrocode}
2447 \DeclareTextSymbol{\textquotestraightbase}{TS1}{13}
2448 %    \end{macrocode}
2449 %    "10 = 16
2450 %    \begin{macrocode}
2451 \DeclareTextSymbol{\textquotestraightdblbase}{TS1}{18}
2452 \DeclareTextSymbol{\texttwelveudash}{TS1}{21}
2453 \DeclareTextSymbol{\textthreequartersemdash}{TS1}{22}
2454 %    \end{macrocode}
2455 %    "18 = 24
2456 %    \begin{macrocode}
2457 \DeclareTextSymbol{\textleftarrow}{TS1}{24}
2458 \DeclareTextSymbol{\textrightarrow}{TS1}{25}
2459 %    \end{macrocode}
2460 %    "20 = 32
2461 %    \begin{macrocode}
2462 \DeclareTextSymbol{\textblank}{TS1}{32}
2463 \DeclareTextSymbol{\textdollar}{TS1}{36}
2464 \DeclareTextSymbol{\textquotesingle}{TS1}{39}
2465 %    \end{macrocode}
2466 %    "28 = 40
2467 %    \begin{macrocode}
2468 \DeclareTextSymbol{\textasteriskcentered}{TS1}{42}
2469 %    \end{macrocode}
2470 % Note that '054 is a comma and '056 is a full stop: these make
2471 % numbers using oldstyle digits easier to input.
2472 %    \begin{macrocode}
2473 \DeclareTextSymbol{\textdblhyphen}{TS1}{45}
2474 \DeclareTextSymbol{\textfractionsolidus}{TS1}{47}
2475 %    \end{macrocode}
2477 % Oldstyle digits.
2479 %    "30 = 48
2480 %    \begin{macrocode}
2481 \DeclareTextSymbol{\textzerooldstyle}{TS1}{48}
2482 \DeclareTextSymbol{\textoneoldstyle}{TS1}{49}
2483 \DeclareTextSymbol{\texttwooldstyle}{TS1}{50}
2484 \DeclareTextSymbol{\textthreeoldstyle}{TS1}{51}
2485 \DeclareTextSymbol{\textfouroldstyle}{TS1}{52}
2486 \DeclareTextSymbol{\textfiveoldstyle}{TS1}{53}
2487 \DeclareTextSymbol{\textsixoldstyle}{TS1}{54}
2488 \DeclareTextSymbol{\textsevenoldstyle}{TS1}{55}
2489 %    \end{macrocode}
2490 %    "38 = 56
2491 %    \begin{macrocode}
2492 \DeclareTextSymbol{\texteightoldstyle}{TS1}{56}
2493 \DeclareTextSymbol{\textnineoldstyle}{TS1}{57}
2494 %    \end{macrocode}
2496 % More text companion symbols.
2498 %    \begin{macrocode}
2499 \DeclareTextSymbol{\textlangle}{TS1}{60}
2500 \DeclareTextSymbol{\textminus}{TS1}{61}
2501 \DeclareTextSymbol{\textrangle}{TS1}{62}
2502 %    \end{macrocode}
2503 %    "48 = 72
2504 %    \begin{macrocode}
2505 \DeclareTextSymbol{\textmho}{TS1}{77}
2506 %    \end{macrocode}
2508 % \changes{v1.9r}{1999/01/06}{Minor documentation fix.}
2509 % The big circle is here to define the command \cs{textcircled}.
2510 % Formerly it was taken from the |cmsy| font.
2511 % \changes{v1.9h}{1997/12/17}{Changed to decimal codes in \cs{ooalign}.}
2512 % \changes{v1.9k}{1998/01/12}{Adding missing braces and \cs{ushape}.}
2513 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
2514 %    (pr/3160)}
2515 %    \begin{macrocode}
2516 \DeclareTextSymbol{\textbigcircle}{TS1}{79}
2517 \DeclareTextCommand{\textcircled}{TS1}[1]{\hmode@bgroup
2518    \ooalign{%
2519       \hfil \raise .07ex\hbox {\upshape#1}\hfil \crcr
2520       \char 79   % '117 = "4F
2521    }%
2522  \egroup}
2523 %    \end{macrocode}
2525 % More text companion symbols.
2527 %    "50 = 80
2528 %    \begin{macrocode}
2529 \DeclareTextSymbol{\textohm}{TS1}{87}
2530 %    \end{macrocode}
2531 %    "58 = 88
2532 %    \begin{macrocode}
2533 \DeclareTextSymbol{\textlbrackdbl}{TS1}{91}
2534 \DeclareTextSymbol{\textrbrackdbl}{TS1}{93}
2535 \DeclareTextSymbol{\textuparrow}{TS1}{94}
2536 \DeclareTextSymbol{\textdownarrow}{TS1}{95}
2537 %    \end{macrocode}
2538 %    "60 = 96
2539 %    \begin{macrocode}
2540 \DeclareTextSymbol{\textasciigrave}{TS1}{96}
2541 \DeclareTextSymbol{\textborn}{TS1}{98}
2542 \DeclareTextSymbol{\textdivorced}{TS1}{99}
2543 \DeclareTextSymbol{\textdied}{TS1}{100}
2544 %    \end{macrocode}
2545 %    "68 = 104
2546 %    \begin{macrocode}
2547 \DeclareTextSymbol{\textleaf}{TS1}{108}
2548 \DeclareTextSymbol{\textmarried}{TS1}{109}
2549 \DeclareTextSymbol{\textmusicalnote}{TS1}{110}
2550 %    \end{macrocode}
2551 %    "78 = 120
2552 %    \begin{macrocode}
2553 \DeclareTextSymbol{\texttildelow}{TS1}{126}
2554 %    \end{macrocode}
2556 % This glyph, |\textdblhyphenchar| is hanging, like the hyphenchar of
2557 % the ec fonts.
2559 %    \begin{macrocode}
2560 \DeclareTextSymbol{\textdblhyphenchar}{TS1}{127}
2561 %    \end{macrocode}
2562 %    "80 = 128
2563 %    \begin{macrocode}
2564 \DeclareTextSymbol{\textasciibreve}{TS1}{128}
2565 \DeclareTextSymbol{\textasciicaron}{TS1}{129}
2566 %    \end{macrocode}
2568 % This next glyph is \emph{not} the same as |\textquotedbl|.
2570 % \changes{v1.9p}{1998/06/12}{Corrected 130 and 131, see pr/2834}
2571 %    \begin{macrocode}
2572 \DeclareTextSymbol{\textacutedbl}{TS1}{130}
2573 \DeclareTextSymbol{\textgravedbl}{TS1}{131}
2574 \DeclareTextSymbol{\textdagger}{TS1}{132}
2575 \DeclareTextSymbol{\textdaggerdbl}{TS1}{133}
2576 \DeclareTextSymbol{\textbardbl}{TS1}{134}
2577 \DeclareTextSymbol{\textperthousand}{TS1}{135}
2578 %    \end{macrocode}
2579 %    "88 = 136
2580 %    \begin{macrocode}
2581 \DeclareTextSymbol{\textbullet}{TS1}{136}
2582 \DeclareTextSymbol{\textcelsius}{TS1}{137}
2583 \DeclareTextSymbol{\textdollaroldstyle}{TS1}{138}
2584 \DeclareTextSymbol{\textcentoldstyle}{TS1}{139}
2585 \DeclareTextSymbol{\textflorin}{TS1}{140}
2586 \DeclareTextSymbol{\textcolonmonetary}{TS1}{141}
2587 \DeclareTextSymbol{\textwon}{TS1}{142}
2588 \DeclareTextSymbol{\textnaira}{TS1}{143}
2589 %    \end{macrocode}
2590 %    "90 = 144
2591 %    \begin{macrocode}
2592 \DeclareTextSymbol{\textguarani}{TS1}{144}
2593 \DeclareTextSymbol{\textpeso}{TS1}{145}
2594 \DeclareTextSymbol{\textlira}{TS1}{146}
2595 \DeclareTextSymbol{\textrecipe}{TS1}{147}
2596 \DeclareTextSymbol{\textinterrobang}{TS1}{148}
2597 \DeclareTextSymbol{\textinterrobangdown}{TS1}{149}
2598 \DeclareTextSymbol{\textdong}{TS1}{150}
2599 \DeclareTextSymbol{\texttrademark}{TS1}{151}
2600 %    \end{macrocode}
2601 %    "98 = 152
2602 %    \begin{macrocode}
2603 \DeclareTextSymbol{\textpertenthousand}{TS1}{152}
2604 \DeclareTextSymbol{\textpilcrow}{TS1}{153}
2605 \DeclareTextSymbol{\textbaht}{TS1}{154}
2606 \DeclareTextSymbol{\textnumero}{TS1}{155}
2607 %    \end{macrocode}
2608 % This next name may change.
2609 % For the following sign we know only a german name, which is
2610 % abz\"uglich. The meaning is something like ``commercial minus''.
2611 % An ASCII ersatz is ./. (dot slash dot).
2612 % The temporary English name is |\textdiscount|.
2613 %    \begin{macrocode}
2614 \DeclareTextSymbol{\textdiscount}{TS1}{156}
2615 \DeclareTextSymbol{\textestimated}{TS1}{157}
2616 \DeclareTextSymbol{\textopenbullet}{TS1}{158}
2617 \DeclareTextSymbol{\textservicemark}{TS1}{159}
2618 %    \end{macrocode}
2619 %    "A0 = 160
2620 %    \begin{macrocode}
2621 \DeclareTextSymbol{\textlquill}{TS1}{160}
2622 \DeclareTextSymbol{\textrquill}{TS1}{161}
2623 \DeclareTextSymbol{\textcent}{TS1}{162}
2624 \DeclareTextSymbol{\textsterling}{TS1}{163}
2625 \DeclareTextSymbol{\textcurrency}{TS1}{164}
2626 \DeclareTextSymbol{\textyen}{TS1}{165}
2627 \DeclareTextSymbol{\textbrokenbar}{TS1}{166}
2628 \DeclareTextSymbol{\textsection}{TS1}{167}
2629 %    \end{macrocode}
2630 %    "A8 = 168
2631 %    \begin{macrocode}
2632 \DeclareTextSymbol{\textasciidieresis}{TS1}{168}
2633 \DeclareTextSymbol{\textcopyright}{TS1}{169}
2634 \DeclareTextSymbol{\textordfeminine}{TS1}{170}
2635 \DeclareTextSymbol{\textcopyleft}{TS1}{171}
2636 \DeclareTextSymbol{\textlnot}{TS1}{172}
2637 %    \end{macrocode}
2639 % The meaning of the circled-P is ``sound recording copyright''.
2641 % \changes{v1.9p}{1998/06/12}{Renamed \cs{textmacron} pr/2840}
2642 %    \begin{macrocode}
2643 \DeclareTextSymbol{\textcircledP}{TS1}{173}
2644 \DeclareTextSymbol{\textregistered}{TS1}{174}
2645 \DeclareTextSymbol{\textasciimacron}{TS1}{175}
2646 %    \end{macrocode}
2647 %    "B0 = 176
2648 %    \begin{macrocode}
2649 \DeclareTextSymbol{\textdegree}{TS1}{176}
2650 \DeclareTextSymbol{\textpm}{TS1}{177}
2651 \DeclareTextSymbol{\texttwosuperior}{TS1}{178}
2652 \DeclareTextSymbol{\textthreesuperior}{TS1}{179}
2653 \DeclareTextSymbol{\textasciiacute}{TS1}{180}
2654 \DeclareTextSymbol{\textmu}{TS1}{181} % micro sign
2655 \DeclareTextSymbol{\textparagraph}{TS1}{182}
2656 \DeclareTextSymbol{\textperiodcentered}{TS1}{183}
2657 %    \end{macrocode}
2658 %    "B8 = 184
2659 %    \begin{macrocode}
2660 \DeclareTextSymbol{\textreferencemark}{TS1}{184}
2661 \DeclareTextSymbol{\textonesuperior}{TS1}{185}
2662 \DeclareTextSymbol{\textordmasculine}{TS1}{186}
2663 \DeclareTextSymbol{\textsurd}{TS1}{187}
2664 \DeclareTextSymbol{\textonequarter}{TS1}{188}
2665 \DeclareTextSymbol{\textonehalf}{TS1}{189}
2666 \DeclareTextSymbol{\textthreequarters}{TS1}{190}
2667 \DeclareTextSymbol{\texteuro}{TS1}{191}
2668 %    \end{macrocode}
2669 %    "E0 = 208
2670 %    \begin{macrocode}
2671 \DeclareTextSymbol{\texttimes}{TS1}{214}
2672 %    \end{macrocode}
2673 %    "F0 = 240
2674 %    \begin{macrocode}
2675 \DeclareTextSymbol{\textdiv}{TS1}{246}
2676 %</TS1>
2677 %    \end{macrocode}
2679 % \subsection{Definitions for the TU encoding}
2681 % \changes{v2.0a}{2016/12/04}{Added TU encoding}
2682 % \changes{v2.0b}{2017/01/23}{Added TU specific commands in ASCII range pr/4500}
2683 % \changes{v2.0c}{2017/01/24}{TeX ligature syntax for xetex and luatex reversed}
2684 % \changes{v2.0c}{2017/01/24}{Make \cs{textasteriskcentered} U+2217 not U+204E}
2685 % \changes{v2.0c}{2017/01/24}{Declare TU composites for i and j}
2686 % \changes{v2.0d}{2017/01/24}{Declare macron composites for YyGg}
2687 % \changes{v2.0e}{2017/02/12}{Declare fallback code for \cs{textasteriskcentered}}
2688 % \changes{v2.0f}{2017/02/19}{%
2689 %     declare composites with empty base for hat and tilde,
2690 %     use same slots for \cs{textasciicircum} ans \cs{textasciitilde}}
2691 % \changes{v2.0f}{2017/02/19}{%
2692 %     declare straight quotes using new \cs{remove@tlig} command}
2693 % \changes{v2.0g}{2017/02/22}{Fix typo introduced at 2.0f}
2694 % \changes{v2.0h}{2017/02/24}{introduce \cs{DeclareUnicodeAccent}}%
2695 % The TU encoding was originally introduced in the contributed
2696 % package \texttt{fontspec} as a Unicode encoding for XeTeX and
2697 % LuaTeX.
2699 % Normally for these engines, the input consists of Unicode characters
2700 % encoded in UTF-8. There is therefore little need to use the
2701 % traditional (ASCII) encoding-specific commands
2703 % However, sometimes (e.g. for backwards compatibility) it can be
2704 % useful to access these Unicode characters via such ASCII-based
2705 % markup. The commands provided here
2706 % Cover the characters in the T1 and TS1 encodings, but specified in
2707 % Unicode position. Almost all the command names have been
2708 % mechanically extracted form the \texttt{inputenc} UTF-8 support,
2709 % which is essentially doing a reverse mapping from UTF-8 data to
2710 % \LaTeX\ LICR commands.
2712 % A few additional names for character which were supported in the
2713 % original \texttt{fontspec} version of this file have also been
2714 % added, even though they are not currently in the default
2715 % \texttt{inputenc} UTF-8 declarations.
2717 %    \begin{macrocode}
2718 %<*TU>
2719 %    \end{macrocode}
2720 % In the base interface the Unicode encoding is always known as TU
2721 % But we parameterise the encoding name to allow for modelling
2722 % differences in Unicode support by different fonts.
2723 %    \begin{macrocode}
2724 \providecommand\UnicodeEncodingName{TU}
2725 %    \end{macrocode}
2726 % As the Unicode encoding, TU, is only currently available with XeTeX
2727 % or LuaTeX, we detect these engines first, and make adjustments for the
2728 % differing font loading syntax. For other engines, we issue a warning
2729 % then abort this file, switching back to T1 encoding.
2730 %    \begin{macrocode}
2731 \begingroup\expandafter\expandafter\expandafter\endgroup
2732 \expandafter\ifx\csname XeTeXrevision\endcsname\relax
2733 %    \end{macrocode}
2735 %    \begin{macrocode}
2736   \begingroup\expandafter\expandafter\expandafter\endgroup
2737   \expandafter\ifx\csname directlua\endcsname\relax
2738 %    \end{macrocode}
2740 % Not LuaTeX or XeTeX, abort with a warning.
2741 %    \begin{macrocode}
2742     \PackageWarningNoLine{fontenc}
2743       {\UnicodeEncodingName\space
2744        encoding is only available with XeTeX and LuaTeX.\MessageBreak
2745        Defaulting to T1 encoding}
2746       \def\encodingdefault{T1}
2747     \expandafter\expandafter\expandafter\endinput
2748 %    \end{macrocode}
2750 %    \begin{macrocode}
2751   \else
2752 %    \end{macrocode}
2754 % LuaTeX.
2755 %    \begin{macrocode}
2756     \def\UnicodeFontTeXLigatures{+tlig;}
2757 %    \end{macrocode}
2759 %    \begin{macrocode}
2760     \def\reserved@a#1{%
2761       \def\@remove@tlig##1{\@remove@tlig@##1\@nil#1\@nil\relax}
2762       \def\@remove@tlig@##1#1{\@remove@tlig@@##1}}
2763     \edef\reserved@b{\detokenize{+tlig;}}
2764     \expandafter\reserved@a\expandafter{\reserved@b}
2765     \def\@remove@tlig@@#1\@nil#2\relax{#1}
2766 %    \end{macrocode}
2768 %    \begin{macrocode}
2769     \def\remove@tlig#1{%
2770       \begingroup
2771       \font\remove@tlig
2772       \expandafter\@remove@tlig\expandafter{\fontname\font}%
2773       \remove@tlig
2774       \char#1\relax
2775       \endgroup
2776     }
2777 %    \end{macrocode}
2779 %    \begin{macrocode}
2780   \fi
2781 \else
2782 %    \end{macrocode}
2784 % XeTeX
2785 %    \begin{macrocode}
2786   \def\UnicodeFontTeXLigatures{mapping=tex-text;}
2787 %    \end{macrocode}
2789 %    \begin{macrocode}
2790   \def\remove@tlig#1{\XeTeXglyph\numexpr\XeTeXcharglyph#1\relax}
2791 %    \end{macrocode}
2793 %    \begin{macrocode}
2795 %    \end{macrocode}
2797 %    \begin{macrocode}
2798 \def\UnicodeFontFile#1#2{"[#1]:#2"}
2799 \def\UnicodeFontName#1#2{"#1:#2"}
2800 %    \end{macrocode}
2802 % Declare the encoding
2803 %    \begin{macrocode}
2804 \DeclareFontEncoding\UnicodeEncodingName{}{}
2805 %    \end{macrocode}
2807 % Declare accent command to use a postpended combining character
2808 % rather than the TeX |\accent| primitive
2809 %    \begin{macrocode}
2810 \def\add@unicode@accent#1#2{%
2811   \if\relax\detokenize{#2}\relax^^a0\else#2\fi
2812   \char#1\relax}
2813 %    \end{macrocode}
2815 %    \begin{macrocode}
2816 \def\DeclareUnicodeAccent#1#2#3{%
2817   \DeclareTextCommand{#1}{#2}{\add@unicode@accent{#3}}%
2819 %    \end{macrocode}
2821 % Wrapper around |\DeclareTextCompositeCommand| that uses the declared
2822 % composite if it exists in the current font or falls back to the default
2823 % definition for the TU accent if not.
2824 %    \begin{macrocode}
2826 \catcode\z@=11\relax
2827 \gdef\DeclareUnicodeComposite#1#2#3{%
2828    \def\reserved@a##1##2{%
2829      \DeclareTextCompositeCommand#1\UnicodeEncodingName{#2}{%
2830    \iffontchar\font#3 ##2%
2831       \else ##1\fi}}%
2832     \expandafter\expandafter\expandafter\extract@default@composite
2833     \csname\UnicodeEncodingName\string#1\endcsname{#2}\@nil
2834    \bgroup
2835       \lccode\z@#3 %
2836       \lowercase{\egroup
2837       \expandafter\reserved@a\expandafter{\reserved@b}{^^@}}}%
2839 %    \end{macrocode}
2841 %    \begin{macrocode}
2842 \def\extract@default@composite#1{%
2843  \ifx\@text@composite#1%
2844    \expandafter\extract@default@composite@a
2845  \else
2846    \expandafter\extract@default@composite@b\expandafter#1%
2847  \fi}
2848 %    \end{macrocode}
2850 %    \begin{macrocode}
2851 \def\extract@default@composite@a#1\@text@composite#2\@nil{%
2852   \def\reserved@b{#2}}
2853 \def\extract@default@composite@b#1#2\@nil{%
2854   \def\reserved@b{#1#2}}
2855 %    \end{macrocode}
2857 %    \begin{macrocode}
2858 \DeclareTextCommand\textquotesingle \UnicodeEncodingName{%
2859                                                 \remove@tlig{"0027}}
2860 \DeclareTextCommand\textasciigrave  \UnicodeEncodingName{%
2861                                                 \remove@tlig{"0060}}
2862 \DeclareTextCommand\textquotedbl    \UnicodeEncodingName{%
2863                                                 \remove@tlig{"0022}}
2864 %    \end{macrocode}
2866 %    \begin{macrocode}
2867 \DeclareTextSymbol{\textdollar}          \UnicodeEncodingName{"0024}
2868 \DeclareTextSymbol{\textless}            \UnicodeEncodingName{"003C}
2869 \DeclareTextSymbol{\textgreater}         \UnicodeEncodingName{"003E}
2870 \DeclareTextSymbol{\textbackslash}       \UnicodeEncodingName{"005C}
2871 \DeclareTextSymbol{\textasciicircum}     \UnicodeEncodingName{"005E}
2872 \DeclareTextSymbol{\textunderscore}      \UnicodeEncodingName{"005F}
2873 \DeclareTextSymbol{\textbraceleft}       \UnicodeEncodingName{"007B}
2874 \DeclareTextSymbol{\textbar}             \UnicodeEncodingName{"007C}
2875 \DeclareTextSymbol{\textbraceright}      \UnicodeEncodingName{"007D}
2876 \DeclareTextSymbol{\textasciitilde}      \UnicodeEncodingName{"007E}
2877 \DeclareTextSymbol{\textexclamdown}      \UnicodeEncodingName{"00A1}
2878 \DeclareTextSymbol{\textcent}            \UnicodeEncodingName{"00A2}
2879 \DeclareTextSymbol{\textsterling}        \UnicodeEncodingName{"00A3}
2880 \DeclareTextSymbol{\textcurrency}        \UnicodeEncodingName{"00A4}
2881 \DeclareTextSymbol{\textyen}             \UnicodeEncodingName{"00A5}
2882 \DeclareTextSymbol{\textbrokenbar}       \UnicodeEncodingName{"00A6}
2883 \DeclareTextSymbol{\textsection}         \UnicodeEncodingName{"00A7}
2884 \DeclareTextSymbol{\textasciidieresis}   \UnicodeEncodingName{"00A8}
2885 \DeclareTextSymbol{\textcopyright}       \UnicodeEncodingName{"00A9}
2886 \DeclareTextSymbol{\textordfeminine}     \UnicodeEncodingName{"00AA}
2887 \DeclareTextSymbol{\guillemotleft}       \UnicodeEncodingName{"00AB}
2888 \DeclareTextSymbol{\textlnot}            \UnicodeEncodingName{"00AC}
2889 \DeclareTextSymbol{\textregistered}      \UnicodeEncodingName{"00AE}
2890 \DeclareTextSymbol{\textasciimacron}     \UnicodeEncodingName{"00AF}
2891 \DeclareTextSymbol{\textdegree}          \UnicodeEncodingName{"00B0}
2892 \DeclareTextSymbol{\textpm}              \UnicodeEncodingName{"00B1}
2893 \DeclareTextSymbol{\texttwosuperior}     \UnicodeEncodingName{"00B2}
2894 \DeclareTextSymbol{\textthreesuperior}   \UnicodeEncodingName{"00B3}
2895 \DeclareTextSymbol{\textasciiacute}      \UnicodeEncodingName{"00B4}
2896 \DeclareTextSymbol{\textmu}              \UnicodeEncodingName{"00B5}
2897 \DeclareTextSymbol{\textparagraph}       \UnicodeEncodingName{"00B6}
2898 \DeclareTextSymbol{\textperiodcentered}  \UnicodeEncodingName{"00B7}
2899 \DeclareTextSymbol{\textonesuperior}     \UnicodeEncodingName{"00B9}
2900 \DeclareTextSymbol{\textordmasculine}    \UnicodeEncodingName{"00BA}
2901 \DeclareTextSymbol{\guillemotright}      \UnicodeEncodingName{"00BB}
2902 \DeclareTextSymbol{\textonequarter}      \UnicodeEncodingName{"00BC}
2903 \DeclareTextSymbol{\textonehalf}         \UnicodeEncodingName{"00BD}
2904 \DeclareTextSymbol{\textthreequarters}   \UnicodeEncodingName{"00BE}
2905 \DeclareTextSymbol{\textquestiondown}    \UnicodeEncodingName{"00BF}
2906 \DeclareTextSymbol{\AE}                  \UnicodeEncodingName{"00C6}
2907 \DeclareTextSymbol{\DH}                  \UnicodeEncodingName{"00D0}
2908 \DeclareTextSymbol{\texttimes}           \UnicodeEncodingName{"00D7}
2909 \DeclareTextSymbol{\O}                   \UnicodeEncodingName{"00D8}
2910 \DeclareTextSymbol{\TH}                  \UnicodeEncodingName{"00DE}
2911 \DeclareTextSymbol{\ss}                  \UnicodeEncodingName{"00DF}
2912 \DeclareTextSymbol{\ae}                  \UnicodeEncodingName{"00E6}
2913 \DeclareTextSymbol{\dh}                  \UnicodeEncodingName{"00F0}
2914 \DeclareTextSymbol{\textdiv}             \UnicodeEncodingName{"00F7}
2915 \DeclareTextSymbol{\o}                   \UnicodeEncodingName{"00F8}
2916 \DeclareTextSymbol{\th}                  \UnicodeEncodingName{"00FE}
2917 \DeclareTextSymbol{\DJ}                  \UnicodeEncodingName{"0110}
2918 \DeclareTextSymbol{\dj}                  \UnicodeEncodingName{"0111}
2919 \DeclareTextSymbol{\i}                   \UnicodeEncodingName{"0131}
2920 \DeclareTextSymbol{\IJ}                  \UnicodeEncodingName{"0132}
2921 \DeclareTextSymbol{\ij}                  \UnicodeEncodingName{"0133}
2922 \DeclareTextSymbol{\L}                   \UnicodeEncodingName{"0141}
2923 \DeclareTextSymbol{\l}                   \UnicodeEncodingName{"0142}
2924 \DeclareTextSymbol{\NG}                  \UnicodeEncodingName{"014A}
2925 \DeclareTextSymbol{\ng}                  \UnicodeEncodingName{"014B}
2926 \DeclareTextSymbol{\OE}                  \UnicodeEncodingName{"0152}
2927 \DeclareTextSymbol{\oe}                  \UnicodeEncodingName{"0153}
2928 \DeclareTextSymbol{\textflorin}          \UnicodeEncodingName{"0192}
2929 \DeclareTextSymbol{\j}                   \UnicodeEncodingName{"0237}
2930 \DeclareTextSymbol{\textasciicaron}      \UnicodeEncodingName{"02C7}
2931 \DeclareTextSymbol{\textasciibreve}      \UnicodeEncodingName{"02D8}
2932 \DeclareTextSymbol{\textacutedbl}        \UnicodeEncodingName{"02DD}
2933 \DeclareTextSymbol{\textgravedbl}        \UnicodeEncodingName{"02F5}
2934 \DeclareTextSymbol{\texttildelow}        \UnicodeEncodingName{"02F7}
2935 \DeclareTextSymbol{\textbaht}            \UnicodeEncodingName{"0E3F}
2936 \DeclareTextSymbol{\SS}                  \UnicodeEncodingName{"1E9E}
2937 \DeclareTextSymbol{\textcompwordmark}    \UnicodeEncodingName{"200C}
2938 \DeclareTextSymbol{\textendash}          \UnicodeEncodingName{"2013}
2939 \DeclareTextSymbol{\textemdash}          \UnicodeEncodingName{"2014}
2940 \DeclareTextSymbol{\textbardbl}          \UnicodeEncodingName{"2016}
2941 \DeclareTextSymbol{\textquoteleft}       \UnicodeEncodingName{"2018}
2942 \DeclareTextSymbol{\textquoteright}      \UnicodeEncodingName{"2019}
2943 \DeclareTextSymbol{\quotesinglbase}      \UnicodeEncodingName{"201A}
2944 \DeclareTextSymbol{\textquotedblleft}    \UnicodeEncodingName{"201C}
2945 \DeclareTextSymbol{\textquotedblright}   \UnicodeEncodingName{"201D}
2946 \DeclareTextSymbol{\quotedblbase}        \UnicodeEncodingName{"201E}
2947 \DeclareTextSymbol{\textdagger}          \UnicodeEncodingName{"2020}
2948 \DeclareTextSymbol{\textdaggerdbl}       \UnicodeEncodingName{"2021}
2949 \DeclareTextSymbol{\textbullet}          \UnicodeEncodingName{"2022}
2950 \DeclareTextSymbol{\textellipsis}        \UnicodeEncodingName{"2026}
2951 \DeclareTextSymbol{\textperthousand}     \UnicodeEncodingName{"2030}
2952 \DeclareTextSymbol{\textpertenthousand}  \UnicodeEncodingName{"2031}
2953 \DeclareTextSymbol{\guilsinglleft}       \UnicodeEncodingName{"2039}
2954 \DeclareTextSymbol{\guilsinglright}      \UnicodeEncodingName{"203A}
2955 \DeclareTextSymbol{\textreferencemark}   \UnicodeEncodingName{"203B}
2956 \DeclareTextSymbol{\textinterrobang}     \UnicodeEncodingName{"203D}
2957 \DeclareTextSymbol{\textfractionsolidus} \UnicodeEncodingName{"2044}
2958 \DeclareTextSymbol{\textlquill}          \UnicodeEncodingName{"2045}
2959 \DeclareTextSymbol{\textrquill}          \UnicodeEncodingName{"2046}
2960 \DeclareTextSymbol{\textdiscount}        \UnicodeEncodingName{"2052}
2961 \DeclareTextSymbol{\textcolonmonetary}   \UnicodeEncodingName{"20A1}
2962 \DeclareTextSymbol{\textlira}            \UnicodeEncodingName{"20A4}
2963 \DeclareTextSymbol{\textnaira}           \UnicodeEncodingName{"20A6}
2964 \DeclareTextSymbol{\textwon}             \UnicodeEncodingName{"20A9}
2965 \DeclareTextSymbol{\textdong}            \UnicodeEncodingName{"20AB}
2966 \DeclareTextSymbol{\texteuro}            \UnicodeEncodingName{"20AC}
2967 \DeclareTextSymbol{\textpeso}            \UnicodeEncodingName{"20B1}
2968 \DeclareTextSymbol{\textcelsius}         \UnicodeEncodingName{"2103}
2969 \DeclareTextSymbol{\textnumero}          \UnicodeEncodingName{"2116}
2970 \DeclareTextSymbol{\textcircledP}        \UnicodeEncodingName{"2117}
2971 \DeclareTextSymbol{\textrecipe}          \UnicodeEncodingName{"211E}
2972 \DeclareTextSymbol{\textservicemark}     \UnicodeEncodingName{"2120}
2973 \DeclareTextSymbol{\texttrademark}       \UnicodeEncodingName{"2122}
2974 \DeclareTextSymbol{\textohm}             \UnicodeEncodingName{"2126}
2975 \DeclareTextSymbol{\textmho}             \UnicodeEncodingName{"2127}
2976 \DeclareTextSymbol{\textestimated}       \UnicodeEncodingName{"212E}
2977 \DeclareTextSymbol{\textleftarrow}       \UnicodeEncodingName{"2190}
2978 \DeclareTextSymbol{\textuparrow}         \UnicodeEncodingName{"2191}
2979 \DeclareTextSymbol{\textrightarrow}      \UnicodeEncodingName{"2192}
2980 \DeclareTextSymbol{\textdownarrow}       \UnicodeEncodingName{"2193}
2981 \DeclareTextSymbol{\textminus}           \UnicodeEncodingName{"2212}
2982 %    \end{macrocode}
2983 % Not all fonts have U+2217 but using U+002A requires some adjustment.
2984 %    \begin{macrocode}
2985 \DeclareTextCommand{\textasteriskcentered}\UnicodeEncodingName{%
2986   \iffontchar\font"2217 \char"2217 \else
2987     \begingroup
2988       \fontsize
2989        {\the\dimexpr1.2\dimexpr\f@size pt\relax}%
2990        {\f@baselineskip}%
2991       \selectfont
2992       \raisebox{-0.6ex}[\dimexpr\height-0.6ex][0pt]{*}%
2993     \endgroup
2994   \fi
2996 %    \end{macrocode}
2997 %    \begin{macrocode}
2998 \DeclareTextSymbol{\textsurd}            \UnicodeEncodingName{"221A}
2999 \DeclareTextSymbol{\textlangle}          \UnicodeEncodingName{"2329}
3000 \DeclareTextSymbol{\textrangle}          \UnicodeEncodingName{"232A}
3001 \DeclareTextSymbol{\textblank}           \UnicodeEncodingName{"2422}
3002 \DeclareTextSymbol{\textvisiblespace}    \UnicodeEncodingName{"2423}
3003 \DeclareTextSymbol{\textopenbullet}      \UnicodeEncodingName{"25E6}
3004 \DeclareTextSymbol{\textbigcircle}       \UnicodeEncodingName{"25EF}
3005 \DeclareTextSymbol{\textmusicalnote}     \UnicodeEncodingName{"266A}
3006 \DeclareTextSymbol{\textmarried}         \UnicodeEncodingName{"26AD}
3007 \DeclareTextSymbol{\textdivorced}        \UnicodeEncodingName{"26AE}
3008 \DeclareTextSymbol{\textinterrobangdown} \UnicodeEncodingName{"2E18}
3009 %    \end{macrocode}
3010 % Accents must be declared before the composites that use them.
3011 %    \begin{macrocode}
3012 \DeclareUnicodeAccent{\`}                \UnicodeEncodingName{"0300}
3013 \DeclareUnicodeAccent{\'}                \UnicodeEncodingName{"0301}
3014 \DeclareUnicodeAccent{\^}                \UnicodeEncodingName{"0302}
3015 \DeclareUnicodeAccent{\~}                \UnicodeEncodingName{"0303}
3016 \DeclareUnicodeAccent{\=}                \UnicodeEncodingName{"0304}
3017 \DeclareUnicodeAccent{\u}                \UnicodeEncodingName{"0306}
3018 \DeclareUnicodeAccent{\.}                \UnicodeEncodingName{"0307}
3019 \DeclareUnicodeAccent{\"}                \UnicodeEncodingName{"0308}
3020 \DeclareUnicodeAccent{\r}                \UnicodeEncodingName{"030A}
3021 \DeclareUnicodeAccent{\H}                \UnicodeEncodingName{"030B}
3022 \DeclareUnicodeAccent{\v}                \UnicodeEncodingName{"030C}
3023 \DeclareUnicodeAccent{\b}                \UnicodeEncodingName{"0332}
3024 \DeclareUnicodeAccent{\d}                \UnicodeEncodingName{"0323}
3025 \DeclareUnicodeAccent{\c}                \UnicodeEncodingName{"0327}
3026 \DeclareUnicodeAccent{\k}                \UnicodeEncodingName{"0328}
3027 \DeclareTextCommand\textcommabelow       \UnicodeEncodingName[1]
3028   {\hmode@bgroup\ooalign{\null#1\crcr\hidewidth\raise-.31ex
3029    \hbox{\check@mathfonts\fontsize\ssf@size\z@
3030    \math@fontsfalse\selectfont,}\hidewidth}\egroup}
3031 %    \end{macrocode}
3033 %    \begin{macrocode}
3034 \DeclareUnicodeComposite{\^}              {}{"005E}
3035 \DeclareUnicodeComposite{\~}              {}{"007E}
3036 %    \end{macrocode}
3038 %    \begin{macrocode}
3039 \DeclareUnicodeComposite{\`}             {A}{"00C0}
3040 \DeclareUnicodeComposite{\'}             {A}{"00C1}
3041 \DeclareUnicodeComposite{\^}             {A}{"00C2}
3042 \DeclareUnicodeComposite{\~}             {A}{"00C3}
3043 \DeclareUnicodeComposite{\"}             {A}{"00C4}
3044 \DeclareUnicodeComposite{\r}             {A}{"00C5}
3045 \DeclareUnicodeComposite{\c}             {C}{"00C7}
3046 \DeclareUnicodeComposite{\`}             {E}{"00C8}
3047 \DeclareUnicodeComposite{\'}             {E}{"00C9}
3048 \DeclareUnicodeComposite{\^}             {E}{"00CA}
3049 \DeclareUnicodeComposite{\"}             {E}{"00CB}
3050 \DeclareUnicodeComposite{\`}             {I}{"00CC}
3051 \DeclareUnicodeComposite{\'}             {I}{"00CD}
3052 \DeclareUnicodeComposite{\^}             {I}{"00CE}
3053 \DeclareUnicodeComposite{\"}             {I}{"00CF}
3054 \DeclareUnicodeComposite{\~}             {N}{"00D1}
3055 \DeclareUnicodeComposite{\`}             {O}{"00D2}
3056 \DeclareUnicodeComposite{\'}             {O}{"00D3}
3057 \DeclareUnicodeComposite{\^}             {O}{"00D4}
3058 \DeclareUnicodeComposite{\~}             {O}{"00D5}
3059 \DeclareUnicodeComposite{\"}             {O}{"00D6}
3060 \DeclareUnicodeComposite{\`}             {U}{"00D9}
3061 \DeclareUnicodeComposite{\'}             {U}{"00DA}
3062 \DeclareUnicodeComposite{\^}             {U}{"00DB}
3063 \DeclareUnicodeComposite{\"}             {U}{"00DC}
3064 \DeclareUnicodeComposite{\'}             {Y}{"00DD}
3065 \DeclareUnicodeComposite{\`}             {a}{"00E0}
3066 \DeclareUnicodeComposite{\'}             {a}{"00E1}
3067 \DeclareUnicodeComposite{\^}             {a}{"00E2}
3068 \DeclareUnicodeComposite{\~}             {a}{"00E3}
3069 \DeclareUnicodeComposite{\"}             {a}{"00E4}
3070 \DeclareUnicodeComposite{\r}             {a}{"00E5}
3071 \DeclareUnicodeComposite{\c}             {c}{"00E7}
3072 \DeclareUnicodeComposite{\`}             {e}{"00E8}
3073 \DeclareUnicodeComposite{\'}             {e}{"00E9}
3074 \DeclareUnicodeComposite{\^}             {e}{"00EA}
3075 \DeclareUnicodeComposite{\"}             {e}{"00EB}
3076 \DeclareUnicodeComposite{\`}             \i {"00EC}
3077 \DeclareUnicodeComposite{\`}             {i}{"00EC}
3078 \DeclareUnicodeComposite{\'}             \i {"00ED}
3079 \DeclareUnicodeComposite{\'}             {i}{"00ED}
3080 \DeclareUnicodeComposite{\^}             \i {"00EE}
3081 \DeclareUnicodeComposite{\^}             {i}{"00EE}
3082 \DeclareUnicodeComposite{\"}             \i {"00EF}
3083 \DeclareUnicodeComposite{\"}             {i}{"00EF}
3084 \DeclareUnicodeComposite{\~}             {n}{"00F1}
3085 \DeclareUnicodeComposite{\`}             {o}{"00F2}
3086 \DeclareUnicodeComposite{\'}             {o}{"00F3}
3087 \DeclareUnicodeComposite{\^}             {o}{"00F4}
3088 \DeclareUnicodeComposite{\~}             {o}{"00F5}
3089 \DeclareUnicodeComposite{\"}             {o}{"00F6}
3090 \DeclareUnicodeComposite{\`}             {u}{"00F9}
3091 \DeclareUnicodeComposite{\'}             {u}{"00FA}
3092 \DeclareUnicodeComposite{\^}             {u}{"00FB}
3093 \DeclareUnicodeComposite{\"}             {u}{"00FC}
3094 \DeclareUnicodeComposite{\'}             {y}{"00FD}
3095 \DeclareUnicodeComposite{\"}             {y}{"00FF}
3096 \DeclareUnicodeComposite{\=}             {A}{"0100}
3097 \DeclareUnicodeComposite{\=}             {a}{"0101}
3098 \DeclareUnicodeComposite{\u}             {A}{"0102}
3099 \DeclareUnicodeComposite{\u}             {a}{"0103}
3100 \DeclareUnicodeComposite{\k}             {A}{"0104}
3101 \DeclareUnicodeComposite{\k}             {a}{"0105}
3102 \DeclareUnicodeComposite{\'}             {C}{"0106}
3103 \DeclareUnicodeComposite{\'}             {c}{"0107}
3104 \DeclareUnicodeComposite{\^}             {C}{"0108}
3105 \DeclareUnicodeComposite{\^}             {c}{"0109}
3106 \DeclareUnicodeComposite{\.}             {C}{"010A}
3107 \DeclareUnicodeComposite{\.}             {c}{"010B}
3108 \DeclareUnicodeComposite{\v}             {C}{"010C}
3109 \DeclareUnicodeComposite{\v}             {c}{"010D}
3110 \DeclareUnicodeComposite{\v}             {D}{"010E}
3111 \DeclareUnicodeComposite{\v}             {d}{"010F}
3112 \DeclareUnicodeComposite{\=}             {E}{"0112}
3113 \DeclareUnicodeComposite{\=}             {e}{"0113}
3114 \DeclareUnicodeComposite{\u}             {E}{"0114}
3115 \DeclareUnicodeComposite{\u}             {e}{"0115}
3116 \DeclareUnicodeComposite{\.}             {E}{"0116}
3117 \DeclareUnicodeComposite{\.}             {e}{"0117}
3118 \DeclareUnicodeComposite{\k}             {E}{"0118}
3119 \DeclareUnicodeComposite{\k}             {e}{"0119}
3120 \DeclareUnicodeComposite{\v}             {E}{"011A}
3121 \DeclareUnicodeComposite{\v}             {e}{"011B}
3122 \DeclareUnicodeComposite{\^}             {G}{"011C}
3123 \DeclareUnicodeComposite{\^}             {g}{"011D}
3124 \DeclareUnicodeComposite{\u}             {G}{"011E}
3125 \DeclareUnicodeComposite{\u}             {g}{"011F}
3126 \DeclareUnicodeComposite{\.}             {G}{"0120}
3127 \DeclareUnicodeComposite{\.}             {g}{"0121}
3128 \DeclareUnicodeComposite{\c}             {G}{"0122}
3129 \DeclareUnicodeComposite{\c}             {g}{"0123}
3130 \DeclareUnicodeComposite{\^}             {H}{"0124}
3131 \DeclareUnicodeComposite{\^}             {h}{"0125}
3132 \DeclareUnicodeComposite{\~}             {I}{"0128}
3133 \DeclareUnicodeComposite{\~}             \i {"0129}
3134 \DeclareUnicodeComposite{\~}             {i}{"0129}
3135 \DeclareUnicodeComposite{\=}             {I}{"012A}
3136 \DeclareUnicodeComposite{\=}             \i {"012B}
3137 \DeclareUnicodeComposite{\=}             {i}{"012B}
3138 \DeclareUnicodeComposite{\u}             {I}{"012C}
3139 \DeclareUnicodeComposite{\u}             \i {"012D}
3140 \DeclareUnicodeComposite{\u}             {i}{"012D}
3141 \DeclareUnicodeComposite{\k}             {I}{"012E}
3142 \DeclareUnicodeComposite{\k}             \i {"012F}
3143 \DeclareUnicodeComposite{\k}             {i}{"012F}
3144 \DeclareUnicodeComposite{\.}             {I}{"0130}
3145 \DeclareUnicodeComposite{\^}             {J}{"0134}
3146 \DeclareUnicodeComposite{\^}             \j {"0135}
3147 \DeclareUnicodeComposite{\^}             {j}{"0135}
3148 \DeclareUnicodeComposite{\c}             {K}{"0136}
3149 \DeclareUnicodeComposite{\c}             {k}{"0137}
3150 \DeclareUnicodeComposite{\'}             {L}{"0139}
3151 \DeclareUnicodeComposite{\'}             {l}{"013A}
3152 \DeclareUnicodeComposite{\c}             {L}{"013B}
3153 \DeclareUnicodeComposite{\c}             {l}{"013C}
3154 \DeclareUnicodeComposite{\v}             {L}{"013D}
3155 \DeclareUnicodeComposite{\v}             {l}{"013E}
3156 \DeclareUnicodeComposite{\'}             {N}{"0143}
3157 \DeclareUnicodeComposite{\'}             {n}{"0144}
3158 \DeclareUnicodeComposite{\c}             {N}{"0145}
3159 \DeclareUnicodeComposite{\c}             {n}{"0146}
3160 \DeclareUnicodeComposite{\v}             {N}{"0147}
3161 \DeclareUnicodeComposite{\v}             {n}{"0148}
3162 \DeclareUnicodeComposite{\=}             {O}{"014C}
3163 \DeclareUnicodeComposite{\=}             {o}{"014D}
3164 \DeclareUnicodeComposite{\u}             {O}{"014E}
3165 \DeclareUnicodeComposite{\u}             {o}{"014F}
3166 \DeclareUnicodeComposite{\H}             {O}{"0150}
3167 \DeclareUnicodeComposite{\H}             {o}{"0151}
3168 \DeclareUnicodeComposite{\'}             {R}{"0154}
3169 \DeclareUnicodeComposite{\'}             {r}{"0155}
3170 \DeclareUnicodeComposite{\c}             {R}{"0156}
3171 \DeclareUnicodeComposite{\c}             {r}{"0157}
3172 \DeclareUnicodeComposite{\v}             {R}{"0158}
3173 \DeclareUnicodeComposite{\v}             {r}{"0159}
3174 \DeclareUnicodeComposite{\'}             {S}{"015A}
3175 \DeclareUnicodeComposite{\'}             {s}{"015B}
3176 \DeclareUnicodeComposite{\^}             {S}{"015C}
3177 \DeclareUnicodeComposite{\^}             {s}{"015D}
3178 \DeclareUnicodeComposite{\c}             {S}{"015E}
3179 \DeclareUnicodeComposite{\c}             {s}{"015F}
3180 \DeclareUnicodeComposite{\v}             {S}{"0160}
3181 \DeclareUnicodeComposite{\v}             {s}{"0161}
3182 \DeclareUnicodeComposite{\c}             {T}{"0162}
3183 \DeclareUnicodeComposite{\c}             {t}{"0163}
3184 \DeclareUnicodeComposite{\v}             {T}{"0164}
3185 \DeclareUnicodeComposite{\v}             {t}{"0165}
3186 \DeclareUnicodeComposite{\~}             {U}{"0168}
3187 \DeclareUnicodeComposite{\~}             {u}{"0169}
3188 \DeclareUnicodeComposite{\=}             {U}{"016A}
3189 \DeclareUnicodeComposite{\=}             {u}{"016B}
3190 \DeclareUnicodeComposite{\u}             {U}{"016C}
3191 \DeclareUnicodeComposite{\u}             {u}{"016D}
3192 \DeclareUnicodeComposite{\r}             {U}{"016E}
3193 \DeclareUnicodeComposite{\r}             {u}{"016F}
3194 \DeclareUnicodeComposite{\H}             {U}{"0170}
3195 \DeclareUnicodeComposite{\H}             {u}{"0171}
3196 \DeclareUnicodeComposite{\k}             {U}{"0172}
3197 \DeclareUnicodeComposite{\k}             {u}{"0173}
3198 \DeclareUnicodeComposite{\^}             {W}{"0174}
3199 \DeclareUnicodeComposite{\^}             {w}{"0175}
3200 \DeclareUnicodeComposite{\^}             {Y}{"0176}
3201 \DeclareUnicodeComposite{\^}             {y}{"0177}
3202 \DeclareUnicodeComposite{\"}             {Y}{"0178}
3203 \DeclareUnicodeComposite{\'}             {Z}{"0179}
3204 \DeclareUnicodeComposite{\'}             {z}{"017A}
3205 \DeclareUnicodeComposite{\.}             {Z}{"017B}
3206 \DeclareUnicodeComposite{\.}             {z}{"017C}
3207 \DeclareUnicodeComposite{\v}             {Z}{"017D}
3208 \DeclareUnicodeComposite{\v}             {z}{"017E}
3209 \DeclareUnicodeComposite{\v}             {A}{"01CD}
3210 \DeclareUnicodeComposite{\v}             {a}{"01CE}
3211 \DeclareUnicodeComposite{\v}             {I}{"01CF}
3212 \DeclareUnicodeComposite{\v}             \i {"01D0}
3213 \DeclareUnicodeComposite{\v}             {i}{"01D0}
3214 \DeclareUnicodeComposite{\v}             {O}{"01D1}
3215 \DeclareUnicodeComposite{\v}             {o}{"01D2}
3216 \DeclareUnicodeComposite{\v}             {U}{"01D3}
3217 \DeclareUnicodeComposite{\v}             {u}{"01D4}
3218 \DeclareUnicodeComposite{\=}             \AE{"01E2}
3219 \DeclareUnicodeComposite{\=}             \ae{"01E3}
3220 \DeclareUnicodeComposite{\v}             {G}{"01E6}
3221 \DeclareUnicodeComposite{\v}             {g}{"01E7}
3222 \DeclareUnicodeComposite{\v}             {K}{"01E8}
3223 \DeclareUnicodeComposite{\v}             {k}{"01E9}
3224 \DeclareUnicodeComposite{\k}             {O}{"01EA}
3225 \DeclareUnicodeComposite{\k}             {o}{"01EB}
3226 \DeclareUnicodeComposite{\v}             \j {"01F0}
3227 \DeclareUnicodeComposite{\v}             {j}{"01F0}
3228 \DeclareUnicodeComposite{\'}             {G}{"01F4}
3229 \DeclareUnicodeComposite{\'}             {g}{"01F5}
3230 \DeclareUnicodeComposite{\textcommabelow}{S}{"0218}
3231 \DeclareUnicodeComposite{\textcommabelow}{s}{"0219}
3232 \DeclareUnicodeComposite{\textcommabelow}{T}{"021A}
3233 \DeclareUnicodeComposite{\textcommabelow}{t}{"021B}
3234 \DeclareUnicodeComposite{\=}             {Y}{"0232}
3235 \DeclareUnicodeComposite{\=}             {y}{"0232}
3236 \DeclareUnicodeComposite{\.}             {B}{"1E02}
3237 \DeclareUnicodeComposite{\.}             {b}{"1E03}
3238 \DeclareUnicodeComposite{\d}             {B}{"1E04}
3239 \DeclareUnicodeComposite{\d}             {b}{"1E05}
3240 \DeclareUnicodeComposite{\d}             {D}{"1E0C}
3241 \DeclareUnicodeComposite{\d}             {d}{"1E0D}
3242 \DeclareUnicodeComposite{\=}             {G}{"1E20}
3243 \DeclareUnicodeComposite{\=}             {g}{"1E21}
3244 \DeclareUnicodeComposite{\d}             {H}{"1E24}
3245 \DeclareUnicodeComposite{\d}             {h}{"1E25}
3246 \DeclareUnicodeComposite{\d}             {K}{"1E32}
3247 \DeclareUnicodeComposite{\d}             {k}{"1E33}
3248 \DeclareUnicodeComposite{\d}             {L}{"1E36}
3249 \DeclareUnicodeComposite{\d}             {l}{"1E37}
3250 \DeclareUnicodeComposite{\d}             {M}{"1E42}
3251 \DeclareUnicodeComposite{\d}             {m}{"1E43}
3252 \DeclareUnicodeComposite{\d}             {N}{"1E46}
3253 \DeclareUnicodeComposite{\d}             {n}{"1E47}
3254 \DeclareUnicodeComposite{\d}             {R}{"1E5A}
3255 \DeclareUnicodeComposite{\d}             {r}{"1E5B}
3256 \DeclareUnicodeComposite{\d}             {S}{"1E62}
3257 \DeclareUnicodeComposite{\d}             {s}{"1E63}
3258 \DeclareUnicodeComposite{\d}             {T}{"1E6C}
3259 \DeclareUnicodeComposite{\d}             {t}{"1E6D}
3260 \DeclareUnicodeComposite{\d}             {V}{"1E7E}
3261 \DeclareUnicodeComposite{\d}             {v}{"1E7F}
3262 \DeclareUnicodeComposite{\d}             {W}{"1E88}
3263 \DeclareUnicodeComposite{\d}             {w}{"1E89}
3264 \DeclareUnicodeComposite{\d}             {Z}{"1E92}
3265 \DeclareUnicodeComposite{\d}             {z}{"1E93}
3266 \DeclareUnicodeComposite{\d}             {A}{"1EA0}
3267 \DeclareUnicodeComposite{\d}             {a}{"1EA1}
3268 \DeclareUnicodeComposite{\d}             {E}{"1EB8}
3269 \DeclareUnicodeComposite{\d}             {e}{"1EB9}
3270 \DeclareUnicodeComposite{\d}             {I}{"1ECA}
3271 \DeclareUnicodeComposite{\d}             {i}{"1ECB}
3272 \DeclareUnicodeComposite{\d}             {O}{"1ECC}
3273 \DeclareUnicodeComposite{\d}             {o}{"1ECD}
3274 \DeclareUnicodeComposite{\d}             {U}{"1EE4}
3275 \DeclareUnicodeComposite{\d}             {u}{"1EE5}
3276 \DeclareUnicodeComposite{\d}             {Y}{"1EF4}
3277 \DeclareUnicodeComposite{\d}             {y}{"1EF5}
3278 %    \end{macrocode}
3280 %    \begin{macrocode}
3281 %</TU>
3282 %    \end{macrocode}
3284 % \section{Package files}
3286 % \changes{v1.9h}{1997/12/17}{Added section.}
3287 % \changes{v1.9h}{1997/12/17}{Added code for textcomp.sty.}
3288 %    This file now also contains some packages that provide access to
3289 %    the more specialised encodings.
3291 % \subsection{The fontenc package}
3293 % \changes{v1.5c}{1994/05/14}{Added the fontenc package}
3294 % \changes{v1.5g}{1994/05/16}{Removed the lowercasing of the filename.}
3295 % \changes{v1.7a}{1994/11/30}{Always load the enc.def file, so that
3296 %    the default encoding for the commands will change.}
3297 % \changes{v1.7x}{1996/05/18}{Produce error if encoding not found.
3298 %                             pr/2054}
3299 % \changes{v1.7y}{1996/05/21}{Corrected error message (CAR)}
3300 % \changes{v1.8d}{1996/11/18}
3301 %     {(DPC) lowercase external file names. internal/1044}%
3302 % This package allows authors to specify which encodings they will use.
3303 % For each encoding |FOO|, the package looks to see if the encoding
3304 % |FOO| has already been declared.  If it has not, the file |fooenc.def|
3305 % is loaded.  The default encoding is set to be |FOO|.
3307 % In addition the package at the moment contains extra code to extend
3308 % the |\@uclclist| (list of upper/lower case pairs) for encodings that
3309 % involve cyrillic characters. THIS IS A TEMPORARY SOLUTION and will not
3310 % stay this way forever (or so we hope) but right now we are missing a
3311 % proper interface for this and didn't wanted to rush it.
3312 % \changes{v1.9r}{1999/01/07}{Hackery to temp support cyrillic uc/lc}
3313 % \changes{v1.9t}{1999/02/24}{Corrected hackery cyrillic uc/lc list}
3314 % \changes{v1.9x}{1999/12/08}{Changed \cs{CYRRHOOK} and  \cs{cyrrhook}
3315 %    to\cs{CYRRHK} and  \cs{cyrrhk} as name changed in the cyrillic
3316 %    bundle for naming consistency with other ``hook'' glyphs.}
3317 %    \begin{macrocode}
3318 %<*package>
3319 %    \end{macrocode}
3321 % Here we define a macro that extends the |\@uclclist| if needed and
3322 % afterwards turns itself in a noop.
3323 %    \begin{macrocode}
3324 \def\update@uclc@with@cyrillic{%
3325  \expandafter\def\expandafter\@uclclist\expandafter
3326   {\@uclclist
3327   \cyra\CYRA\cyrabhch\CYRABHCH\cyrabhchdsc\CYRABHCHDSC\cyrabhdze
3328   \CYRABHDZE\cyrabhha\CYRABHHA\cyrae\CYRAE\cyrb\CYRB\cyrbyus
3329   \CYRBYUS\cyrc\CYRC\cyrch\CYRCH\cyrchldsc\CYRCHLDSC\cyrchrdsc
3330   \CYRCHRDSC\cyrchvcrs\CYRCHVCRS\cyrd\CYRD\cyrdelta\CYRDELTA
3331   \cyrdje\CYRDJE\cyrdze\CYRDZE\cyrdzhe\CYRDZHE\cyre\CYRE\cyreps
3332   \CYREPS\cyrerev\CYREREV\cyrery\CYRERY\cyrf\CYRF\cyrfita
3333   \CYRFITA\cyrg\CYRG\cyrgdsc\CYRGDSC\cyrgdschcrs\CYRGDSCHCRS
3334   \cyrghcrs\CYRGHCRS\cyrghk\CYRGHK\cyrgup\CYRGUP\cyrh\CYRH
3335   \cyrhdsc\CYRHDSC\cyrhhcrs\CYRHHCRS\cyrhhk\CYRHHK\cyrhrdsn
3336   \CYRHRDSN\cyri\CYRI\cyrie\CYRIE\cyrii\CYRII\cyrishrt\CYRISHRT
3337   \cyrishrtdsc\CYRISHRTDSC\cyrizh\CYRIZH\cyrje\CYRJE\cyrk\CYRK
3338   \cyrkbeak\CYRKBEAK\cyrkdsc\CYRKDSC\cyrkhcrs\CYRKHCRS\cyrkhk
3339   \CYRKHK\cyrkvcrs\CYRKVCRS\cyrl\CYRL\cyrldsc\CYRLDSC\cyrlhk
3340   \CYRLHK\cyrlje\CYRLJE\cyrm\CYRM\cyrmdsc\CYRMDSC\cyrmhk\CYRMHK
3341   \cyrn\CYRN\cyrndsc\CYRNDSC\cyrng\CYRNG\cyrnhk\CYRNHK\cyrnje
3342   \CYRNJE\cyrnlhk\CYRNLHK\cyro\CYRO\cyrotld\CYROTLD\cyrp\CYRP
3343   \cyrphk\CYRPHK\cyrq\CYRQ\cyrr\CYRR\cyrrdsc\CYRRDSC\cyrrhk
3344   \CYRRHK\cyrrtick\CYRRTICK\cyrs\CYRS\cyrsacrs\CYRSACRS
3345   \cyrschwa\CYRSCHWA\cyrsdsc\CYRSDSC\cyrsemisftsn\CYRSEMISFTSN
3346   \cyrsftsn\CYRSFTSN\cyrsh\CYRSH\cyrshch\CYRSHCH\cyrshha\CYRSHHA
3347   \cyrt\CYRT\cyrtdsc\CYRTDSC\cyrtetse\CYRTETSE\cyrtshe\CYRTSHE
3348   \cyru\CYRU\cyrushrt\CYRUSHRT\cyrv\CYRV\cyrw\CYRW\cyry\CYRY
3349   \cyrya\CYRYA\cyryat\CYRYAT\cyryhcrs\CYRYHCRS\cyryi\CYRYI\cyryo
3350   \CYRYO\cyryu\CYRYU\cyrz\CYRZ\cyrzdsc\CYRZDSC\cyrzh\CYRZH
3351   \cyrzhdsc\CYRZHDSC}%
3352  \let\update@uclc@with@cyrillic\relax
3354 %    \end{macrocode}
3356 % Here we process each option:
3357 %    \begin{macrocode}
3358 \DeclareOption*{%
3359    \let\encodingdefault\CurrentOption
3360    \edef\reserved@f{%
3361      \lowercase{\def\noexpand\reserved@f{\CurrentOption enc.def}}}%
3362    \reserved@f
3363    \InputIfFileExists\reserved@f
3364         {}{\PackageError{fontenc}%
3365          {Encoding file `\reserved@f' not found.%
3366           \MessageBreak
3367            You might have misspelt the name of the encoding}%
3368          {Necessary code for this encoding was not
3369           loaded.\MessageBreak
3370           Thus calling the encoding later on will
3371           produce further error messages.}}%
3372   \let\reserved@f\relax
3373 %    \end{macrocode}
3375 % In case the current encoding is one of a list of known
3376 % cyrillic ones we extend the |\@uclclist|:
3377 %    \begin{macrocode}
3378   \expandafter\in@\expandafter{\CurrentOption}%
3379                               {T2A,T2B,T2C,X2,LCY,OT2}%
3380   \ifin@
3381 %    \end{macrocode}
3383 % But only if it hasn't already been extended. This might happen if
3384 % there are several calls to fontenc loading one of the above
3385 % encodings. If we don't do this check the |\@uclclist| gets
3386 % unnecessarily big, slowing down the processing at runtime.
3387 % \changes{v1.9v}{1999/06/12}{Extend \cs{@uclclist} only once}
3388 %    \begin{macrocode}
3389      \expandafter\in@\expandafter\cyra\expandafter
3390                               {\@uclclist}%
3391      \ifin@
3392      \else
3393        \update@uclc@with@cyrillic
3394      \fi
3395   \fi
3397 %    \end{macrocode}
3399 %    \begin{macrocode}
3400 \ProcessOptions*
3401 %    \end{macrocode}
3403 %    \begin{macrocode}
3404 \fontencoding\encodingdefault\selectfont
3405 %    \end{macrocode}
3407 % To save some space we get rid of the macro extending the
3408 % |\@uclclist| (might have happened already).
3409 %    \begin{macrocode}
3410 \let\update@uclc@with@cyrillic\relax
3411 %    \end{macrocode}
3413 % Finally we pretend that the fontenc package wasn't read in. This
3414 % allows for using it several times, e.g., in a class file and in the
3415 % preamble (at the cost of not getting any version info).
3416 % That kind of hackery shows that using a general purpose
3417 % package just for loading an encoding is not the right kind
3418 % of interface for setting up encodings --- it will get replaced at
3419 % some point in the future.
3420 % \changes{v1.9r}{1999/01/07}{Hackery to allow using fontenc several
3421 %    times}
3422 % \changes{v1.9u}{1999/06/10}{Ensure that we also forget old options
3423 %                             (pr/2888)}
3424 %    \begin{macrocode}
3425 \global\expandafter\let\csname ver@fontenc.sty\endcsname\relax
3426 \global\expandafter\let\csname opt@fontenc.sty\endcsname\relax
3427 \global\let\@ifl@ter@@\@ifl@ter
3428 \def\@ifl@ter#1#2#3#4#5{\global\let\@ifl@ter\@ifl@ter@@}
3429 %</package>
3430 %    \end{macrocode}
3433 % \subsection{The textcomp package}
3435 %    This one is for the |TS1| encoding which contains text symbols
3436 %    for use with the |T1|-encoded text fonts.  It therefore first
3437 %    inputs the file |TS1enc.def| and then sets (or resets) the
3438 %    defaults for the symbols it contains.  The result of this is that
3439 %    when one of these symbols is accessed and the current encoding
3440 %    does not provide it, the symbol will be supplied by a silent,
3441 %    local change to this encoding.
3443 %    \begin{macrocode}
3444 %<*TS1sty>
3445 %    \end{macrocode}
3446 %    Since many PostScript fonts only implement a subset of |TS1| many
3447 %    commands only produce black blobs of ink. To resolve the
3448 %    resulting problems a number of options have been introduced and
3449 %    some code  has been developed to distinguish sub-encodings.
3451 %    The sub-encodings have a numerical id and are defined as follows
3452 %    for \texttt{TS1}:
3453 % \begin{description}
3455 % \item[\#5] those \texttt{TS1} symbols that are also in the ISO-Adobe
3456 %       character set; without \verb=textcurrency=, which is often
3457 %       misused for the Euro.  Older Type1 fonts from the non-\TeX{}
3458 %       world provide only this subset.
3460 % \item[\#4] = \#5 + \verb=\texteuro=.  Most newer fonts provide this.
3462 % \item[\#3] = \#4 + \verb=\textomega=.  Can also be described as
3463 %       $\texttt{TS1} \cap (\texttt{ISO-Adobe} \cup
3464 %       \texttt{MacRoman})$.  (Except for the missing "currency".)
3467 % \item[\#2] = \#3 + \verb=\textestimated= + \verb=\textcurrency=.  Can
3468 %       also be described as $\texttt{TS1} \cap
3469 %       \texttt{Adobe-Western-2}$.  This may be relevant for OpenType
3470 %       fonts, which usually show the Adobe-Western-2 character set.
3472 %    \item[\#1] = \texttt{TS1} without \verb=\textcircled= and \verb=\t=.
3473 %       These two glyphs are often not implemented and if their kernel
3474 %       defaults are changed commands like \verb=\copyright=
3475 %       unnecessarily fail.
3477 %    \item[\#0] = full \texttt{TS1}
3478 % \end{description}
3480 %    And here a summary to go in the transcript file:
3481 %    \begin{macrocode}
3482 \PackageInfo{textcomp}{Sub-encoding information:\MessageBreak
3483     \space\space 5 = only ISO-Adobe without
3484                               \string\textcurrency\MessageBreak
3485     \space\space 4 = 5 + \string\texteuro\MessageBreak
3486     \space\space 3 = 4 + \string\textohm\MessageBreak
3487     \space\space 2 = 3 + \noexpand\textestimated+ 
3488                                 \string\textcurrency\MessageBreak
3489     \space\space 1 = TS1 - \noexpand\textcircled-
3490                                             \string\t\MessageBreak
3491     \space\space 0 = TS1 (full)\MessageBreak
3492     Font families with sub-encoding setting implement\MessageBreak
3493     only a restricted character set as indicated.\MessageBreak
3494     Family '?' is the default used for unknown fonts.\MessageBreak
3495     See the documentation for details\@gobble}
3496 %    \end{macrocode}
3498 % \begin{macro}{\DeclareEncodingSubset}
3499 %    An encoding subset to which a font family belongs is declared by
3500 %    the command |\DeclareEncodingSubset| that takes the major encoding as the
3501 %    first argument (e.g., |TS1|), the family name as the second
3502 %    argument (e.g., |cmr|), and the subset encoding id as a third,
3503 %    (e.g., |0| for |cmr|).
3505 %    The default encoding subset to use when nothing is known about
3506 %    the current font family is named |?|.
3507 %    \begin{macrocode}
3508 \def\DeclareEncodingSubset#1#2#3{%
3509    \@ifundefined{#1:#2}%
3510      {\PackageInfo{textcomp}{Setting #2 sub-encoding to #1/#3}}%
3511      {\PackageInfo{textcomp}{Changing #2 sub-encoding to #1/#3}}%
3512    \@namedef{#1:#2}{#3}}
3513 \@onlypreamble\DeclareEncodingSubset
3514 %    \end{macrocode}
3515 % \end{macro}
3518 %  The options for the package are the following:
3519 %    \begin{description}
3520 %    \item[safe]
3521 %       for unknown font families enables only symbols that are also
3522 %       in the ISO-Adobe character set; without "currency", which is
3523 %       often misused for the Euro.  Older Type1 fonts from the
3524 %       non-TeX world provide only this subset.
3526 %    \item[euro]
3527 %       enables the ``safe'' symbols plus the |\texteuro|
3528 %       command. Most newer fonts provide this.
3530 %    \item[full] enables all |TS1| commands; useful only with fonts
3531 %       like EC or CM bright.
3533 %    \item[almostfull]
3534 %       same as ``full'', except that |\textcircled|
3535 %       and |\t| are \emph{not} redefined from their defaults to avoid
3536 %       that commands like |\copyright| suddenly no longer work.
3538 %    \item[force]
3539 %       ignore all subset encoding definitions stored in the package
3540 %       itself or in the configuration file and always use the default
3541 %       subset as specified by one of the other options (seldom useful,
3542 %       only dangerous).
3543 %    \end{description}
3545 % \begin{macro}{\iftc@forced}
3546 %    Switch used to implement the \texttt{force} option
3547 %    \begin{macrocode}
3548 \newif\iftc@forced   \tc@forcedfalse
3549 %    \end{macrocode}
3550 % \end{macro}
3552 %    This is implemented by defining the default subset:
3553 %    \begin{macrocode}
3554 \DeclareOption{full}{\DeclareEncodingSubset{TS1}{?}{0}}
3555 \DeclareOption{almostfull}{\DeclareEncodingSubset{TS1}{?}{1}}
3556 \DeclareOption{euro}{\DeclareEncodingSubset{TS1}{?}{4}}
3557 \DeclareOption{safe}{\DeclareEncodingSubset{TS1}{?}{5}}
3558 %    \end{macrocode}
3559 %    The default is ``almostfull'' which means that old documents will
3560 %    work except that |\textcircled| and |\t| will use the kernel
3561 %    defaults (with the advantage that this also works if the current
3562 %    font (as often the case) doesn't implement these glyphs.
3564 %    The ``force'' option simply sets the switch to true.
3565 %    \begin{macrocode}
3566 \DeclareOption{force}{\tc@forcedtrue}
3567 %    \end{macrocode}
3569 %    The suggestions to user is to use the ``safe'' option always
3570 %    unless that balks in which case they could switch to
3571 %    ``almostfull'' but then better check their output manually.
3573 %    \begin{macrocode}
3574 \def\tc@errorwarn{\PackageError}
3575 \DeclareOption{warn}{\gdef\tc@errorwarn#1#2#3{\PackageWarning{#1}{#2}}}
3576 %    \end{macrocode}
3578 %    \begin{macrocode}
3579 \ExecuteOptions{almostfull}
3580 \ProcessOptions\relax
3581 %    \end{macrocode}
3583 % \begin{macro}{\CheckEncodingSubset}
3584 %    The command |\CheckEncodingSubset| will check if the current font
3585 %    family has the right encoding subset to typeset a certain
3586 %    command. It takes five arguments as follows:
3587 %    first argument is either |\UseTextSymbol|, |\UseTextAccent|
3588 %    depending on whether or not the symbol is a text symbol or a text
3589 %    accent.
3591 %    The second argument is the encoding from which this symbol should
3592 %    be fetched.
3594 %    The third argument is either a fake accessor command or an error
3595 %    message. the code in that argument (if ever executed) receives
3596 %    two arguments: |#2| and |#5| of |\CheckEncodingSubset|.
3598 %    Argument four is the subset encoding id to test against: if this
3599 %    value is higher than the subset id of the current font family
3600 %    then we typeset the symbol, i.e., execute |#1{#2}#5| otherwise
3601 %    it runs |#3#5|, e.g., to produce an error message or fake the
3602 %    glyph somehow.
3604 %    Argument five is the symbol or accent command that is being
3605 %    checked.
3607 %    For usage examples see definitions below.
3608 %    \begin{macrocode}
3609 \iftc@forced
3610 %    \end{macrocode}
3611 %    If the ``force'' option was given we always use the default for
3612 %    testing against.
3613 %    \begin{macrocode}
3614 \def\CheckEncodingSubset#1#2#3#4#5{%
3615     \ifnum #4>%
3616         0\csname #2:?\endcsname
3617         \relax
3618    \expandafter\@firstoftwo
3619   \else
3620    \expandafter\@secondoftwo
3621  \fi
3622   {#1{#2}}{#3}%
3623   #5%
3625 %    \end{macrocode}
3626 %    In normal circumstances the test is a bit more complicated: first
3627 %    check if there exists a macro
3628 %    |\|\meta{arg2}|:|\meta{current-family} and if so use that value
3629 %    to test against, otherwise use the default to test against.
3630 %    \begin{macrocode}
3631 \else
3632 \def\CheckEncodingSubset#1#2#3#4#5{%
3633     \ifnum #4>%
3634       \expandafter\ifx\csname #2:\f@family\endcsname\relax
3635         0\csname #2:?\endcsname
3636       \else
3637         \csname #2:\f@family\endcsname
3638       \fi
3639    \relax
3640    \expandafter\@firstoftwo
3641   \else
3642    \expandafter\@secondoftwo
3643  \fi
3644   {#1{#2}}{#3}%
3645   #5%
3648 %    \end{macrocode}
3649 % \end{macro}
3651 % \begin{macro}{tc@subst}
3652 %    \begin{macrocode}
3653 \def\tc@subst#1{%
3654    \tc@errorwarn{textcomp}%  % should be latex error if general
3655     {Symbol \string#1 not provided by\MessageBreak
3656      font family \f@family\space
3657      in TS1 encoding.\MessageBreak Default family used instead}\@eha
3658   \bgroup\fontfamily\textcompsubstdefault\selectfont#1\egroup
3660 %    \end{macrocode}
3661 % \end{macro}
3663 % \begin{macro}{\textcompsubstdefault}
3664 %    \begin{macrocode}
3665 \def\textcompsubstdefault{cmr}
3666 %    \end{macrocode}
3667 % \end{macro}
3669 % \begin{macro}{\tc@error}
3670 %    |\tc@error| is going to be used in arg |#3| of
3671 %    |\CheckEncodingSubset| when a symbol is not available in a
3672 %    certain font family. It gets pass the encoding it normally lives
3673 %    in (arg one) and the name of the symbol or accent that has a
3674 %    problem.
3676 %    \begin{macrocode}
3677 % error commands take argument:
3678 % #1 symbol to be used
3679 \def\tc@error#1{%
3680    \PackageError{textcomp}%  % should be latex error if general
3681     {Accent \string#1 not provided by\MessageBreak
3682      font family \f@family\space
3683      in TS1 encoding}\@eha
3685 %    \end{macrocode}
3686 % \end{macro}
3689 % \begin{macro}{\tc@fake@euro}
3690 %    |\tc@fake@euro|  is an example of a ``fake'' definition to use in  arg |#3| of
3691 %    |\CheckEncodingSubset| when a symbol is not available in a
3692 %    certain font family. Here we produce an Euro symbol by combining
3693 %    a ``C'' with a ``=''.
3694 %    \begin{macrocode}
3695 \def\tc@fake@euro#1{%
3696    \leavevmode
3697    \PackageInfo{textcomp}{Faking \noexpand#1for font family
3698                           \f@family\MessageBreak in TS1 encoding}%
3699    \valign{##\cr
3700       \vfil\hbox to 0.07em{\dimen@\f@size\p@
3701                            \math@fontsfalse
3702                            \fontsize{.7\dimen@}\z@\selectfont=\hss}%
3703       \vfil\cr%
3704       \hbox{C}\crcr
3705    }%
3707 %    \end{macrocode}
3708 % \end{macro}
3710 % \begin{macro}{\tc@check@symbol}
3711 % \begin{macro}{\tc@check@accent}
3712 %    These are two abbreviations that we use below to check symbols
3713 %    and accents in TS1. Only there to save some space, e.g., we can
3714 %    then write
3715 %\begin{verbatim}
3716 %\DeclareTextCommandDefault{\textcurrency}{\tc@check@symbol3\textcurrency}
3717 %\end{verbatim}
3718 %    to ensure that |\textcurrency| is only typeset if the current
3719 %    font has a \texttt{TS1} subset id of less than 3. Otherwise
3720 %    |\tc@error| is called telling the user that for this font family
3721 %    |\textcurreny| is not available.
3722 %    \begin{macrocode}
3723 \def\tc@check@symbol{\CheckEncodingSubset\UseTextSymbol{TS1}\tc@subst}
3724 \def\tc@check@accent{\CheckEncodingSubset\UseTextAccent{TS1}\tc@error}
3725 %    \end{macrocode}
3726 % \end{macro}
3727 % \end{macro}
3729 %    We start with the commands that are ``safe'' and which can be
3730 %    unconditionally set up, first the accents\ldots
3731 %    \begin{macrocode}
3732 \DeclareTextAccentDefault{\capitalcedilla}{TS1}
3733 \DeclareTextAccentDefault{\capitalogonek}{TS1}
3734 \DeclareTextAccentDefault{\capitalgrave}{TS1}
3735 \DeclareTextAccentDefault{\capitalacute}{TS1}
3736 \DeclareTextAccentDefault{\capitalcircumflex}{TS1}
3737 \DeclareTextAccentDefault{\capitaltilde}{TS1}
3738 \DeclareTextAccentDefault{\capitaldieresis}{TS1}
3739 \DeclareTextAccentDefault{\capitalhungarumlaut}{TS1}
3740 \DeclareTextAccentDefault{\capitalring}{TS1}
3741 \DeclareTextAccentDefault{\capitalcaron}{TS1}
3742 \DeclareTextAccentDefault{\capitalbreve}{TS1}
3743 \DeclareTextAccentDefault{\capitalmacron}{TS1}
3744 \DeclareTextAccentDefault{\capitaldotaccent}{TS1}
3745 %    \end{macrocode}
3746 %    \ldots and then the other glyphs.
3747 % \changes{v1.9p}{1998/06/12}{Renamed \cs{textmacron} pr/2840}
3748 %    \begin{macrocode}
3749 \DeclareTextSymbolDefault{\textcapitalcompwordmark}{TS1}
3750 \DeclareTextSymbolDefault{\textascendercompwordmark}{TS1}
3751 \DeclareTextSymbolDefault{\textquotestraightbase}{TS1}
3752 \DeclareTextSymbolDefault{\textquotestraightdblbase}{TS1}
3753 \DeclareTextSymbolDefault{\texttwelveudash}{TS1}
3754 \DeclareTextSymbolDefault{\textthreequartersemdash}{TS1}
3755 \DeclareTextSymbolDefault{\textdollar}{TS1}
3756 \DeclareTextSymbolDefault{\textquotesingle}{TS1}
3757 \DeclareTextSymbolDefault{\textasteriskcentered}{TS1}
3758 \DeclareTextSymbolDefault{\textfractionsolidus}{TS1}
3759 \DeclareTextSymbolDefault{\textminus}{TS1}
3760 \DeclareTextSymbolDefault{\textlbrackdbl}{TS1}
3761 \DeclareTextSymbolDefault{\textrbrackdbl}{TS1}
3762 \DeclareTextSymbolDefault{\textasciigrave}{TS1}
3763 \DeclareTextSymbolDefault{\texttildelow}{TS1}
3764 \DeclareTextSymbolDefault{\textasciibreve}{TS1}
3765 \DeclareTextSymbolDefault{\textasciicaron}{TS1}
3766 \DeclareTextSymbolDefault{\textgravedbl}{TS1}
3767 \DeclareTextSymbolDefault{\textacutedbl}{TS1}
3768 \DeclareTextSymbolDefault{\textdagger}{TS1}
3769 \DeclareTextSymbolDefault{\textdaggerdbl}{TS1}
3770 \DeclareTextSymbolDefault{\textbardbl}{TS1}
3771 \DeclareTextSymbolDefault{\textperthousand}{TS1}
3772 \DeclareTextSymbolDefault{\textbullet}{TS1}
3773 \DeclareTextSymbolDefault{\textcelsius}{TS1}
3774 \DeclareTextSymbolDefault{\textflorin}{TS1}
3775 \DeclareTextSymbolDefault{\texttrademark}{TS1}
3776 \DeclareTextSymbolDefault{\textcent}{TS1}
3777 \DeclareTextSymbolDefault{\textsterling}{TS1}
3778 \DeclareTextSymbolDefault{\textyen}{TS1}
3779 \DeclareTextSymbolDefault{\textbrokenbar}{TS1}
3780 \DeclareTextSymbolDefault{\textsection}{TS1}
3781 \DeclareTextSymbolDefault{\textasciidieresis}{TS1}
3782 \DeclareTextSymbolDefault{\textcopyright}{TS1}
3783 \DeclareTextSymbolDefault{\textordfeminine}{TS1}
3784 \DeclareTextSymbolDefault{\textlnot}{TS1}
3785 \DeclareTextSymbolDefault{\textregistered}{TS1}
3786 \DeclareTextSymbolDefault{\textasciimacron}{TS1}
3787 \DeclareTextSymbolDefault{\textdegree}{TS1}
3788 \DeclareTextSymbolDefault{\textpm}{TS1}
3789 \DeclareTextSymbolDefault{\texttwosuperior}{TS1}
3790 \DeclareTextSymbolDefault{\textthreesuperior}{TS1}
3791 \DeclareTextSymbolDefault{\textasciiacute}{TS1}
3792 \DeclareTextSymbolDefault{\textmu}{TS1}
3793 \DeclareTextSymbolDefault{\textparagraph}{TS1}
3794 \DeclareTextSymbolDefault{\textperiodcentered}{TS1}
3795 \DeclareTextSymbolDefault{\textonesuperior}{TS1}
3796 \DeclareTextSymbolDefault{\textordmasculine}{TS1}
3797 \DeclareTextSymbolDefault{\textonequarter}{TS1}
3798 \DeclareTextSymbolDefault{\textonehalf}{TS1}
3799 \DeclareTextSymbolDefault{\textthreequarters}{TS1}
3800 \DeclareTextSymbolDefault{\texttimes}{TS1}
3801 \DeclareTextSymbolDefault{\textdiv}{TS1}
3802 %    \end{macrocode}
3804 %    The |\texteuro| is only available for subsets with id 4 or
3805 %    less. Otherwise we fake the glyph using |\tc@fake@euro|
3806 %    \begin{macrocode}
3807 \DeclareTextCommandDefault{\texteuro}
3808    {\CheckEncodingSubset\UseTextSymbol{TS1}\tc@fake@euro5\texteuro}
3809 %    \end{macrocode}
3811 %    The |\textohm| is only available for subsets with id 3 or
3812 %    less. Otherwise we produce an error.
3813 %    \begin{macrocode}
3814 \DeclareTextCommandDefault{\textohm}{\tc@check@symbol4\textohm}
3815 %    \end{macrocode}
3816 %    The |\textestimated| and |\textcurrency| are only provided for
3817 %    fonts with subset encoding with id 2 or less.
3818 %    \begin{macrocode}
3819 \DeclareTextCommandDefault{\textestimated}%
3820     {\tc@check@symbol3\textestimated}
3821 \DeclareTextCommandDefault{\textcurrency}%
3822     {\tc@check@symbol3\textcurrency}
3823 %    \end{macrocode}
3824 %    Nearly all of the remaining glyphs are provided only with fonts
3825 %    with id 1 or 0, i.e., are essentially complete.
3826 %    \begin{macrocode}
3827 \DeclareTextCommandDefault{\capitaltie}%
3828     {\tc@check@accent2\capitaltie}
3829 \DeclareTextCommandDefault{\newtie}%
3830     {\tc@check@accent2\newtie}
3831 \DeclareTextCommandDefault{\capitalnewtie}%
3832     {\tc@check@accent2\capitalnewtie}
3833 \DeclareTextCommandDefault{\textleftarrow}%
3834     {\tc@check@symbol2\textleftarrow}
3835 \DeclareTextCommandDefault{\textrightarrow}%
3836     {\tc@check@symbol2\textrightarrow}
3837 \DeclareTextCommandDefault{\textblank}%
3838     {\tc@check@symbol2\textblank}
3839 \DeclareTextCommandDefault{\textdblhyphen}%
3840     {\tc@check@symbol2\textdblhyphen}
3841 \DeclareTextCommandDefault{\textzerooldstyle}%
3842     {\tc@check@symbol2\textzerooldstyle}
3843 \DeclareTextCommandDefault{\textoneoldstyle}%
3844     {\tc@check@symbol2\textoneoldstyle}
3845 \DeclareTextCommandDefault{\texttwooldstyle}%
3846     {\tc@check@symbol2\texttwooldstyle}
3847 \DeclareTextCommandDefault{\textthreeoldstyle}%
3848     {\tc@check@symbol2\textthreeoldstyle}
3849 \DeclareTextCommandDefault{\textfouroldstyle}%
3850     {\tc@check@symbol2\textfouroldstyle}
3851 \DeclareTextCommandDefault{\textfiveoldstyle}%
3852     {\tc@check@symbol2\textfiveoldstyle}
3853 \DeclareTextCommandDefault{\textsixoldstyle}%
3854     {\tc@check@symbol2\textsixoldstyle}
3855 \DeclareTextCommandDefault{\textsevenoldstyle}%
3856     {\tc@check@symbol2\textsevenoldstyle}
3857 \DeclareTextCommandDefault{\texteightoldstyle}%
3858     {\tc@check@symbol2\texteightoldstyle}
3859 \DeclareTextCommandDefault{\textnineoldstyle}%
3860     {\tc@check@symbol2\textnineoldstyle}
3861 \DeclareTextCommandDefault{\textlangle}%
3862     {\tc@check@symbol2\textlangle}
3863 \DeclareTextCommandDefault{\textrangle}%
3864     {\tc@check@symbol2\textrangle}
3865 \DeclareTextCommandDefault{\textmho}%
3866     {\tc@check@symbol2\textmho}
3867 \DeclareTextCommandDefault{\textbigcircle}%
3868     {\tc@check@symbol2\textbigcircle}
3869 \DeclareTextCommandDefault{\textuparrow}%
3870     {\tc@check@symbol2\textuparrow}
3871 \DeclareTextCommandDefault{\textdownarrow}%
3872     {\tc@check@symbol2\textdownarrow}
3873 \DeclareTextCommandDefault{\textborn}%
3874     {\tc@check@symbol2\textborn}
3875 \DeclareTextCommandDefault{\textdivorced}%
3876     {\tc@check@symbol2\textdivorced}
3877 \DeclareTextCommandDefault{\textdied}%
3878     {\tc@check@symbol2\textdied}
3879 \DeclareTextCommandDefault{\textleaf}%
3880     {\tc@check@symbol2\textleaf}
3881 \DeclareTextCommandDefault{\textmarried}%
3882     {\tc@check@symbol2\textmarried}
3883 \DeclareTextCommandDefault{\textmusicalnote}%
3884     {\tc@check@symbol2\textmusicalnote}
3885 \DeclareTextCommandDefault{\textdblhyphenchar}%
3886     {\tc@check@symbol2\textdblhyphenchar}
3887 \DeclareTextCommandDefault{\textdollaroldstyle}%
3888     {\tc@check@symbol2\textdollaroldstyle}
3889 \DeclareTextCommandDefault{\textcentoldstyle}%
3890     {\tc@check@symbol2\textcentoldstyle}
3891 \DeclareTextCommandDefault{\textcolonmonetary}%
3892     {\tc@check@symbol2\textcolonmonetary}
3893 \DeclareTextCommandDefault{\textwon}%
3894     {\tc@check@symbol2\textwon}
3895 \DeclareTextCommandDefault{\textnaira}%
3896     {\tc@check@symbol2\textnaira}
3897 \DeclareTextCommandDefault{\textguarani}%
3898     {\tc@check@symbol2\textguarani}
3899 \DeclareTextCommandDefault{\textpeso}%
3900     {\tc@check@symbol2\textpeso}
3901 \DeclareTextCommandDefault{\textlira}%
3902     {\tc@check@symbol2\textlira}
3903 \DeclareTextCommandDefault{\textrecipe}%
3904     {\tc@check@symbol2\textrecipe}
3905 \DeclareTextCommandDefault{\textinterrobang}%
3906     {\tc@check@symbol2\textinterrobang}
3907 \DeclareTextCommandDefault{\textinterrobangdown}%
3908     {\tc@check@symbol2\textinterrobangdown}
3909 \DeclareTextCommandDefault{\textdong}%
3910     {\tc@check@symbol2\textdong}
3911 \DeclareTextCommandDefault{\textpertenthousand}%
3912     {\tc@check@symbol2\textpertenthousand}
3913 \DeclareTextCommandDefault{\textpilcrow}%
3914     {\tc@check@symbol2\textpilcrow}
3915 \DeclareTextCommandDefault{\textbaht}%
3916     {\tc@check@symbol2\textbaht}
3917 \DeclareTextCommandDefault{\textnumero}%
3918     {\tc@check@symbol2\textnumero}
3919 \DeclareTextCommandDefault{\textdiscount}%
3920     {\tc@check@symbol2\textdiscount}
3921 \DeclareTextCommandDefault{\textopenbullet}%
3922     {\tc@check@symbol2\textopenbullet}
3923 \DeclareTextCommandDefault{\textservicemark}%
3924     {\tc@check@symbol2\textservicemark}
3925 \DeclareTextCommandDefault{\textlquill}%
3926     {\tc@check@symbol2\textlquill}
3927 \DeclareTextCommandDefault{\textrquill}%
3928     {\tc@check@symbol2\textrquill}
3929 \DeclareTextCommandDefault{\textcopyleft}%
3930     {\tc@check@symbol2\textcopyleft}
3931 \DeclareTextCommandDefault{\textcircledP}%
3932     {\tc@check@symbol2\textcircledP}
3933 \DeclareTextCommandDefault{\textreferencemark}%
3934     {\tc@check@symbol2\textreferencemark}
3935 \DeclareTextCommandDefault{\textsurd}%
3936     {\tc@check@symbol2\textsurd}
3937 %    \end{macrocode}
3938 %    The |\textcircled| and |\t| are handled specially, unless the
3939 %    current font has a subset id of 0 (i.e. full \texttt{TS1}) we
3940 %    pick the symbols up from the the math font encodings, i.e., the
3941 %    third argument to |\CheckEncodingSubset| uses |\UseTextAccent| to
3942 %    get them from there.
3943 %    \begin{macrocode}
3944 \DeclareTextCommandDefault{\textcircled}
3945   {\CheckEncodingSubset\UseTextAccent{TS1}%
3946     {\UseTextAccent{OMS}}1\textcircled}
3947 \DeclareTextCommandDefault{\t}
3948   {\CheckEncodingSubset\UseTextAccent{TS1}%
3949     {\UseTextAccent{OML}}1\t}
3950 %    \end{macrocode}
3954 %    Finally input the encoding-specific definitions for
3955 %    \texttt{TS1} thus making the top-level definitions
3956 %    optimised for this encoding (and not for the default
3957 %    encoding, see section~\ref{sec:orderofdecls}).
3958 % \changes{v1.9o}{1998/03/20}{Load decls after defaults for speed.}
3959 %    \begin{macrocode}
3960 \input{ts1enc.def}
3961 %    \end{macrocode}
3962 %    Now having the new glyphs available we also want to make sure
3963 %    that they are used. For most cases this will automatically happen
3964 %    but for some glyphs there are inferior definitions already known
3965 %    to \LaTeX{} which will prevent the usage of the \texttt{TS1}
3966 %    versions (see section~\ref{sec:removeencspec} above). So we better
3967 %    get rid of them:
3968 % \changes{v1.9o}{1998/03/20}{Added various \cs{UndeclareTextCommand}
3969 %    declarations for pr/2783}
3970 %    \begin{macrocode}
3971 \UndeclareTextCommand{\textsterling}{OT1}
3972 \UndeclareTextCommand{\textdollar}  {OT1}
3973 %    \end{macrocode}
3974 %    Similar declarations should probably be made for other encodings
3975 %    like \texttt{OT4} if they are in use.
3976 %    \begin{macrocode}
3977 %\UndeclareTextCommand{\textsterling}{OT4}
3978 %\UndeclareTextCommand{\textdollar}  {OT4}
3979 %    \end{macrocode}
3980 %    From the \texttt{T1} encoding there are two candidates for removal:
3981 %    \textperthousand{} and \textpertenthousand{} since these are both
3982 %    constructed from \% followed by a tiny
3983 %    `{\fontencoding{T1}\selectfont \char 24}'
3984 %    rather than being a single glyph. The problem with this
3985 %    approach is that in PostScript fonts this small zero is usually not
3986 %    available resulting in \%\rule{3pt}{3pt} rather than
3987 %    \textperthousand{} while the real glyph (at least for
3988 %    |\textperthousand|) is available in the PostScript version of
3989 %    \texttt{TS1}.  So for the moment we compromise by removing the
3990 %    \texttt{T1} declaration for |\textperthousand| but keeping the one
3991 %    for |\textpertenthousand|. This will have the effect that with
3992 %    Computer Modern fonts everything will come out (although
3993 %    \textperthousand{} and \textpertenthousand{} are not taken from the
3994 %    same physical font) and with PostScript fonts \textperthousand{}
3995 %    will come out correctly while \textpertenthousand{} will most
3996 %    likely look like \%\rule{6pt}{3pt} --- which is probably an
3997 %    improvement over just getting a single `\rule{3pt}{3pt}' to
3998 %    indicate a completely missing glyph, which would happen if we
3999 %    also `undeclared' |\textpertenthousand|.
4000 %    \begin{macrocode}
4001 \UndeclareTextCommand{\textperthousand}{T1}
4002 %\UndeclareTextCommand{\textpertenthousand}{T1}
4003 %    \end{macrocode}
4006 %  \subsubsection{Supporting oldstyle digits}
4008 %    \begin{macrocode}
4009 \DeclareRobustCommand\oldstylenums[1]{%
4010  \begingroup
4011   \ifmmode
4012    \mathgroup\symletters #1%
4013   \else
4014    \CheckEncodingSubset\@use@text@encoding{TS1}%
4015        {\PackageWarning{textcomp}%
4016           {Oldstyle digits unavailable for
4017            family \f@family.\MessageBreak
4018            Lining digits used instead}}%
4019        \tw@{#1}%
4020    \fi
4021  \endgroup
4023 %    \end{macrocode}
4025 %  \subsubsection{Subset encoding defaults}
4027 %    For many font families commonly used in the \TeX{} world we
4028 %    provide the subset encoding data here. Users can add additional
4029 %    font families in the file \texttt{textcomp.cfg} if they own other
4030 %    fonts.
4032 %    However, if the option ``forced'' was given then all subset
4033 %    encoding specifications are ignored, so there is no point in
4034 %    setting any of them up:
4035 %    \begin{macrocode}
4036 \iftc@forced \else
4037 %    \end{macrocode}
4039 %    Computer modern based fonts (e.g., CM, CM-Bright, Concrete):
4040 %    \begin{macrocode}
4041 \DeclareEncodingSubset{TS1}{cmr}     {0}
4042 \DeclareEncodingSubset{TS1}{cmss}    {0}
4043 \DeclareEncodingSubset{TS1}{cmtt}    {0}
4044 \DeclareEncodingSubset{TS1}{cmvtt}   {0}
4045 \DeclareEncodingSubset{TS1}{cmbr}    {0}
4046 \DeclareEncodingSubset{TS1}{cmtl}    {0}
4047 \DeclareEncodingSubset{TS1}{ccr}     {0}
4048 %    \end{macrocode}
4050 %    PSNFSS fonts:
4051 %    \begin{macrocode}
4052 \DeclareEncodingSubset{TS1}{ptm}     {4}
4053 \DeclareEncodingSubset{TS1}{pcr}     {4}
4054 \DeclareEncodingSubset{TS1}{phv}     {4}
4055 \DeclareEncodingSubset{TS1}{ppl}     {3}
4056 \DeclareEncodingSubset{TS1}{pag}     {4}
4057 \DeclareEncodingSubset{TS1}{pbk}     {4}
4058 \DeclareEncodingSubset{TS1}{pnc}     {4}
4059 \DeclareEncodingSubset{TS1}{pzc}     {4}
4060 \DeclareEncodingSubset{TS1}{bch}     {4}
4061 \DeclareEncodingSubset{TS1}{put}     {5}
4062 %    \end{macrocode}
4064 %    Other CTAN fonts (probably not complete):
4065 %    \begin{macrocode}
4066 \DeclareEncodingSubset{TS1}{uag}     {5}
4067 \DeclareEncodingSubset{TS1}{ugq}     {5}
4068 \DeclareEncodingSubset{TS1}{ul8}     {4}
4069 \DeclareEncodingSubset{TS1}{ul9}     {4}  % (LuxiSans, one day)
4070 \DeclareEncodingSubset{TS1}{augie}   {5}
4071 \DeclareEncodingSubset{TS1}{dayrom}  {3}
4072 \DeclareEncodingSubset{TS1}{dayroms} {3}
4073 \DeclareEncodingSubset{TS1}{pxr}     {0}
4074 \DeclareEncodingSubset{TS1}{pxss}    {0}
4075 \DeclareEncodingSubset{TS1}{pxtt}    {0}
4076 \DeclareEncodingSubset{TS1}{txr}     {0}
4077 \DeclareEncodingSubset{TS1}{txss}    {0}
4078 \DeclareEncodingSubset{TS1}{txtt}    {0}
4079 %    \end{macrocode}
4081 %    Latin Modern and TeX Gyre:
4082 % \changes{v1.99k}{2009/10/28}{Added Latin Modern and TeX Gyre subsets}
4083 % \changes{v1.99l}{2009/11/04}{Added more Latin Modern and TeX Gyre subsets}
4084 % \changes{v1.99m}{2015/02/16}{Added lmtt (Heiko Oberdiek) latex/4415}
4085 %    \begin{macrocode}
4086 \DeclareEncodingSubset{TS1}{lmr}     {0}
4087 \DeclareEncodingSubset{TS1}{lmdh}    {0}
4088 \DeclareEncodingSubset{TS1}{lmss}    {0}
4089 \DeclareEncodingSubset{TS1}{lmssq}   {0}
4090 \DeclareEncodingSubset{TS1}{lmvtt}   {0}
4091 \DeclareEncodingSubset{TS1}{lmtt}    {0}
4092 %    \end{macrocode}
4094 %    \begin{macrocode}
4095 \DeclareEncodingSubset{TS1}{qhv}     {0}
4096 \DeclareEncodingSubset{TS1}{qag}     {0}
4097 \DeclareEncodingSubset{TS1}{qbk}     {0}
4098 \DeclareEncodingSubset{TS1}{qcr}     {0}
4099 \DeclareEncodingSubset{TS1}{qcs}     {0}
4100 \DeclareEncodingSubset{TS1}{qpl}     {0}
4101 \DeclareEncodingSubset{TS1}{qtm}     {0}
4102 \DeclareEncodingSubset{TS1}{qzc}     {0}
4103 \DeclareEncodingSubset{TS1}{qhvc}    {0}
4104 %    \end{macrocode}
4106 %    Fourier-GUTenberg:
4107 %    \begin{macrocode}
4108 \DeclareEncodingSubset{TS1}{futs}    {4}
4109 \DeclareEncodingSubset{TS1}{futx}    {4}
4110 \DeclareEncodingSubset{TS1}{futj}    {4}
4111 %    \end{macrocode}
4113 %  Y\&Y's Lucida Bright
4114 %    \begin{macrocode}
4115 \DeclareEncodingSubset{TS1}{hlh}     {3}
4116 \DeclareEncodingSubset{TS1}{hls}     {3}
4117 \DeclareEncodingSubset{TS1}{hlst}    {3}
4118 %    \end{macrocode}
4119 %    The remaining settings for Lucida are conservative: the following
4120 %    fonts contain the |\textohm| character but not the |\texteuro|,
4121 %    i.e., belong to neither subset~4 nor subset~3. If you want to
4122 %    use the |\textohm| with these fonts copy these definition to
4123 %    \texttt{textcomp.cfg} and change the subset to~3. However in that
4124 %    case make sure that you do not use the |\texteuro|.
4125 %    \begin{macrocode}
4126 \DeclareEncodingSubset{TS1}{hlct}    {5}
4127 \DeclareEncodingSubset{TS1}{hlx}     {5}
4128 \DeclareEncodingSubset{TS1}{hlce}    {5}
4129 \DeclareEncodingSubset{TS1}{hlcn}    {5}
4130 \DeclareEncodingSubset{TS1}{hlcw}    {5}
4131 \DeclareEncodingSubset{TS1}{hlcf}    {5}
4132 %    \end{macrocode}
4134 %    Other commercial families\ldots
4135 %    \begin{macrocode}
4136 \DeclareEncodingSubset{TS1}{pplx}    {3}
4137 \DeclareEncodingSubset{TS1}{pplj}    {3}
4138 \DeclareEncodingSubset{TS1}{ptmx}    {4}
4139 \DeclareEncodingSubset{TS1}{ptmj}    {4}
4140 %    \end{macrocode}
4142 %    If the file \texttt{textcomp.cfg} exists it will be loaded at
4143 %    this point. This allows to define further subset encodings for
4144 %    font families not covered by default.
4146 %    \begin{macrocode}
4147 \InputIfFileExists{textcomp.cfg}
4148   {\PackageInfo{textcomp}{Local configuration file used}}{}
4149 %    \end{macrocode}
4151 %    \begin{macrocode}
4153 %</TS1sty>
4154 %    \end{macrocode}
4156 % \Finale
4158 \endinput