Log changes
[latex2e.git] / latex2e-20151001 / base / ltoutenc.dtx
bloba7932198327d6b11a09fc5e0c809b85f89e8c2db
1 % \iffalse meta-comment
3 % Copyright 1993-2015
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 %<package>\ProvidesPackage{fontenc}
39 %<TS1sty>\ProvidesPackage{textcomp}
40 %<OT1|T1|OMS|OML|OT4|package|TS1sty> [2005/09/27 v1.99g
41 %<OT1|T1|OMS|OML|OT4|TS1>         Standard LaTeX file]
42 %<package|TS1sty>                 Standard LaTeX package]
44 %<*driver>
45 % \fi
46 \ProvidesFile{ltoutenc.dtx}
47              [2015/08/28 v1.99m LaTeX Kernel (font encodings)]
48 % \iffalse
49 \documentclass{ltxdoc}
50 \GetFileInfo{ltoutenc.dtx}
51 \title{\filename}
52 \date{\filedate}
53 \author{%
54   Johannes Braams\and
55   David Carlisle\and
56   Alan Jeffrey\and
57   Frank Mittelbach\and
58   Chris Rowley\and
59   Rainer Sch\"opf}
60 \usepackage{textcomp}
61 \begin{document}
62  \MaintainedByLaTeXTeam{latex}
63  \maketitle
64  \DocInput{\filename}
65 \end{document}
66 %</driver>
67 % \fi
69 % \CheckSum{2825}
71 % \CharacterTable
72 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
73 %   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
74 %   Digits        \0\1\2\3\4\5\6\7\8\9
75 %   Exclamation   \!     Double quote  \"     Hash (number) \#
76 %   Dollar        \$     Percent       \%     Ampersand     \&
77 %   Acute accent  \'     Left paren    \(     Right paren   \)
78 %   Asterisk      \*     Plus          \+     Comma         \,
79 %   Minus         \-     Point         \.     Solidus       \/
80 %   Colon         \:     Semicolon     \;     Less than     \<
81 %   Equals        \=     Greater than  \>     Question mark \?
82 %   Commercial at \@     Left bracket  \[     Backslash     \\
83 %   Right bracket \]     Circumflex    \^     Underscore    \_
84 %   Grave accent  \`     Left brace    \{     Vertical bar  \|
85 %   Right brace   \}     Tilde         \~}
88 % \changes{v1.99e}{2004/02/13}{Documentation fixes: typos}
89 % \changes{v1.9k}{1998/01/12}{Added \cs{ProvidesPackage}
90 %    for textcomp.sty}
91 % \changes{v1.9i}{1997/12/19}{Documentation corrections.}
92 % \changes{v1.9h}{1997/12/17}{Documentation changes and additions.}
93 % \changes{v1.9h}{1997/12/17}{Added textcomp.sty.}
94 % \changes{v1.9f}{1997/08/29}{Added OT4 encoding,
95 %    provided by Marcin Woli\'nski.}
96 % \changes{v1.7r}{1995/11/28}{doc fixes}
97 % \changes{v1.7h}{1995/04/21}{Added \cs{null} \cs{k}  latex/1274}
98 % \changes{v1.7f}{1994/12/14}{Added braces to \cs{copyright} so it
99 %    works unbraced in subscripts.}
100 % \changes{v1.7f}{1994/12/14}{Added check for math mode in
101 %    \cs{@changed@cmd}.}
102 % \changes{v1.7f}{1994/12/14}{Commented out \cs{textasciicircum},
103 %    \cs{textasciitilde}, \cs{textbackslash}, \cs{textbar},
104 %    \cs{textgreater}, \cs{texthyphenchar}, \cs{texthyphen} and
105 %    \cs{textless} to save memory.}
106 % \changes{v1.7e}{1994/12/10}{Added documentation for the OML encoding.}
107 % \changes{v1.7e}{1994/12/10}{Replaced width with \cs{@width} and
108 %    ditto height in vrules.}
109 % \changes{v1.7d}{1994/12/08}{Added \cs{null} and \cs{sh@ft} to \cs{b}
110 %    and \cs{d}.}
111 % \changes{v1.7c}{1994/12/05}{Added braces to \cs{textcircled}.}
112 % \changes{v1.7b}{1994/12/02}{Fixed a bug with \cs{a}.}
113 % \changes{v1.7a}{1994/11/30}{Added new code for encoding-specific
114 %    commands.  These now expand in the mouth, which means that
115 %    ligaturing and kerning can happen.}
116 % \changes{v1.6i}{1994/11/22}{Fixed empty accents.  Again.}
117 % \changes{v1.6i}{1994/11/22}{Corrected \cs{dots} so that there's no
118 %    kerning in monowidth fonts.}
119 % \changes{v1.6i}{1994/11/22}{Corrected typo with
120 %    \cs{mathunderscore}.}
121 % \changes{v1.6h}{1994/11/17}{(DPC) \cs{@tempa} to \cs{reserved@a}}
122 % \changes{v1.6d}{1994/11/02}{Wrapped lines longer than 70 characters.}
123 % \changes{v1.6d}{1994/10/30}{Added math commands.}
124 % \changes{v1.6d}{1994/10/30}{Added OML encoding.}
125 % \changes{v1.6d}{1994/10/30}{Added \cs{textcircled}.}
126 % \changes{v1.6d}{1994/10/30}{Added \cs{DeclareTextCompositeCommand}.}
127 % \changes{v1.6c}{1994/10/29}{Renamed \cs{P}, \cs{S}, \cs{dag} and
128 %    \cs{ddag} to \cs{textparagraph}, \cs{textsection},
129 %    \cs{textdagger} and \cs{textdaggerdbl}.}
130 % \changes{v1.6b}{1994/10/27}{Removed the enc.def files}
131 % \changes{v1.6a}{1994/10/25}{Added \cs{ProvideTextCommand},
132 %    \cs{UseTextSymbol},
133 %    \cs{UseTextAccent},
134 %    \cs{DeclareTextSymbolDefault},
135 %    \cs{DeclareTextAccentDefault},
136 %    \cs{DeclareTextCommandDefault}, and
137 %    \cs{ProvideTextCommandDefault}.}
138 % \changes{v1.5m}{1994/10/18}{Added new definitions of \cs{patterns}
139 %    and \cs{hyphenation}.}
140 % \changes{v1.5l}{1994/10/07}{Moved the ogonek accent.}
141 % \changes{v1.5k}{1994/05/18}{Removed braces from \cs{pounds} and
142 %    \cs{dollar}.}
143 % \changes{v1.5k}{1994/05/18}{Replaced \cs{defaultencoding} with
144 %    \cs{encodingdefault}.}
145 % \changes{v1.5k}{1994/05/18}{Made dotted-i produce `i'.}
146 % \changes{v1.5j}{1994/05/17}{Added braces to \cs{pounds} so it works
147 %    as a subscript.}
148 % \changes{v1.5i}{1994/05/16}{Fixed a bug with \cs{d}.}
149 % \changes{v1.5h}{1994/05/16}{Added \cs{NG}, \cs{ng}, \cs{TH},
150 %    \cs{th}, \cs{DH}, \cs{dh}, \cs{DJ} and \cs{dj}.}
151 % \changes{v1.5h}{1994/05/16}{Added \cs{r} (ring accent) and \cs{k}
152 %    (ogonek) accents.}
153 % \changes{v1.5h}{1994/05/16}{Removed \cs{P} from the OT1 definitions
154 %    file.}
155 % \changes{v1.5h}{1994/05/16}{Fixed a bug with \cs{pounds}.}
156 % \changes{v1.5g}{1994/05/16}{Made fontenc.sty use the new mixed-case
157 %    encoding files.}
158 % \changes{v1.5f}{1994/05/16}{Revert code so that the encoding
159 %                    given is used in \cs{DeclareTextCommand} (FMi)}
160 % \changes{v1.5f}{1994/05/16}{enc files now have uc encoding name
161 %                             parts (FMi)}
162 % \changes{v1.5e}{1994/05/14}{Replaced \cs{ENC@cmd} by \cs{ENC-cmd}.}
163 % \changes{v1.5d}{1994/05/14}{Rewrote \cs{DeclareTextCommand} to define
164 %    its argument to use the current encoding by default, rather than
165 %    the encoding provided to \cs{DeclareTextCommand}.}
166 % \changes{v1.5d}{1994/05/14}{Tidied up the documentation.}
167 % \changes{v1.5c}{1994/05/14}{Added the fontenc package.}
168 % \changes{v1.5c}{1994/05/14}{Fixed a bug which caused an infinite loop
169 %    if \cs{f@encoding} was incorrectly set.}
170 % \changes{v1.5c}{1994/05/14}{Moved fontsmpl to its own dtx file.}
171 % \changes{v1.5b}{1994/05/13}{Added \cmd\{, \cmd\} and \cmd\$.}
172 % \changes{v1.5b}{1994/05/13}
173 %    {Replaces \cs{space} by `~' in \cs{csname}.}
174 % \changes{v1.5b}{1994/05/13}{Renamed \cs{DeclareProtectedCommand} to
175 %    \cs{DeclareRobustCommand}.}
176 % \changes{v1.5a}{1994/05/11}{Renamed the commands again.  Made the
177 %    encoding part of the command syntax.  Added the
178 %    \cs{DeclareTextCommand} interface.  Used
179 %    \cs{DeclareProtectedCommand}.}
180 % \changes{v1.4a}{1994/05/01}{Renamed the commands, removed the
181 %    \cs{EncodingSpecific} command.  Turned all slots into decimal.
182 %    Added \cs{a}.}
183 % \changes{v1.4a}{1994/05/01}{Removed Rokicki's encoding.}
184 % \changes{v1.3d}{1993/12/18}{Some T1 stuff had drifted into the OT1
185 %    file.}
186 % \changes{v1.3c}{1993/12/18}{A new syntax, separating
187 %    accent-definitions from encoding-specific definitions, and
188 %    allowing encoding-specific \cs{chardef}, \cs{let}, etc.}
189 % \changes{v1.3c}{1993/12/18}{Rewrote for the new syntax of
190 %    \cs{EncodingSpecific}.}
191 % \changes{v1.3b}{1993/12/18}{Corrected typos.}
192 % \changes{v1.3b}{1993/12/18}{Replaced the missing last argument to
193 %    \cs{DeclareFontEncoding}.}
194 % \changes{v1.3a}{1993/12/18}{Replaced OT3 by XXX}
195 % \changes{v1.3}{1993/12/17}{Added \cs{EncodingSpecificAccent},
196 %   \cs{EncodingSpecificAccentedLetter} and
197 %   \cs{EncodingSpecificCommand}.}
198 % \changes{v1.3}{1993/12/17}{Made Rokicki's encoding a proper encoding
199 %    scheme rather than a variant of OT1.}
200 % \changes{v1.2b}{1993/12/13}{Corrected file name in driver code.}
201 % \changes{v1.2a}{1993/12/11}{Corrected for t1enc, math.}
202 % \changes{v1.2}{1993/12/10}{Added source code for t1enc.sty.}
203 % \changes{v1.1}{1993/12/07}{Made all character numbers decimal.}
204 % \changes{v1.1}{1993/12/07}{Removed a lot of equal signs and the
205 %   like.}
206 % \changes{v1.99m}{2015/02/21}
207 %         {Removed autoload code}
210 % \section{Font encodings}
212 %    This section of the kernel contains commands for declaring
213 %    encoding-specific
214 %    commands, such as accents.  It also contains the code for some of
215 %    the encoding files, including |omlenc.def|,
216 %    |omsenc.def|, |t1enc.def| and |ot1enc.def| files, which define
217 %    the |OLM|,
218 %    |OMS|, |T1| and |OT1| encodings, and the |fontenc| package
219 %    for selecting encodings.
221 %    The |fontenc| package has options for encodings, of which the
222 %    last option is the default encoding.  For example, to use the
223 %    |OT2|, |OT3| and |T1| encodings, with |T1| as the default, you
224 %    say:
225 %\begin{verbatim}
226 %    \usepackage[OT2,OT3,T1]{fontenc}
227 %\end{verbatim}
228 %    The standard kernel set-up loads font encoding files and selects
229 %    an encoding as follows.
230 %\begin{verbatim}
231 %    \input {omlenc.def}
232 %    \input  {t1enc.def}
233 %    \input {ot1enc.def}
234 %    \input {omsenc.def}
235 %    \fontencoding{OT1}
236 %\end{verbatim}
237 %    Note that the files in the standard |inputenc| package depend on
238 %    this behaviour of the kernel.
240 %    The syntax for declaring encoding-specific commands is:
241 %    \begin{quote}
242 %      |\DeclareTextCommand{|^^A
243 %         \meta{command}|}{|^^A
244 %         \meta{encoding}|}|\\\hspace*{\fill}|[|^^A
245 %         \meta{number}|][|^^A
246 %         \meta{default}|]{|^^A
247 %         \meta{commands}|}|
248 %    \end{quote}
249 %    This command is like |\newcommand|, except that it defines a
250 %    command which is specific to one encoding.  The resulting command
251 %    is always robust, even if its definition is fragile.  For example,
252 %    the definition of |\l| in the |OT1| encoding is:
253 %\begin{verbatim}
254 %    \DeclareTextCommand{\l}{OT1}{{\@xxxii l}}
255 %\end{verbatim}
256 %    |\DeclareTextCommand| takes the same optional arguments as
257 %    |\newcommand|.
258 %    \begin{quote}
259 %      |\ProvideTextCommand{|^^A
260 %         \meta{command}|}{|^^A
261 %         \meta{encoding}|}|\\\hspace*{\fill}|[|^^A
262 %         \meta{number}|][|^^A
263 %         \meta{default}|]{|^^A
264 %         \meta{commands}|}|
265 %    \end{quote}
266 %    This acts like |\DeclareTextCommand|, but does nothing if the
267 %    command is already defined.
268 %    \begin{quote}
269 %      |\DeclareTextSymbol{|^^A
270 %         \meta{command}|}{|^^A
271 %         \meta{encoding}|}{|^^A
272 %         \meta{slot}|}|
273 %    \end{quote}
274 %    This command defines a text symbol, with a particular slot in that
275 %    encoding.  The commands:
276 % \changes{v1.9h}{1997/12/17}{Example corrected, braces removed.}
277 %\begin{verbatim}
278 %    \DeclareTextSymbol{\ss}{OT1}{25}
279 %    \DeclareTextCommand{\ss}{OT1}{\char25 }
280 %\end{verbatim}
281 %    have the same effect, but the |\DeclareTextSymbol| is faster.
282 %    \begin{quote}
283 %      |\DeclareTextAccent{|^^A
284 %         \meta{command}|}{|^^A
285 %         \meta{encoding}|}{|^^A
286 %         \meta{slot}|}|
287 %    \end{quote}
288 % \changes{v1.8e}{1996/11/23}{Corrected description}
289 % \changes{v1.9k}{1997/12/31}{Further correction}
290 %    This command declares a text accent.  The commands:
291 %\begin{verbatim}
292 %    \DeclareTextAccent{\"}{OT1}{127}
293 %    \DeclareTextCommand{\"}{OT1}{\add@accent {127}}
294 %\end{verbatim}
295 %    have the same effect.
296 % \changes{v1.8c}{1996/10/27}
297 %      {Corrected syntax descriptions}
298 %    \begin{quote}
299 %      |\DeclareTextComposite{|^^A
300 %          \meta{command}|}|\\\hspace*{\fill}|{|^^A
301 %         \meta{encoding}|}{|^^A
302 %         \meta{argument}|}{|^^A
303 %             \meta{slot}|}|
304 %    \end{quote}
305 %    This command declares a composite letter, for example in the |T1|
306 %    encoding |\'{a}| is slot 225, which is declared by:
307 %\begin{verbatim}
308 %    \DeclareTextComposite{\'}{T1}{a}{225}
309 %\end{verbatim}
310 % \changes{v1.8e}{1996/11/23}
311 %      {Corrected description}
312 %    The \emph{command} will normally have been declared with
313 %    |\DeclareTextAccent|, or as a one-argument |\DeclareTextCommand|.
315 %    |\DeclareTextComposite| is the most common example of using
316 %    the more general declaration
317 %    |\DeclareTextCompositeCommand|, which can define a composite
318 %    to be an arbitrary piece of text.
319 %    \begin{quote}
320 %      |\DeclareTextCompositeCommand{|^^A
321 %          \meta{command}|}|\\\hspace*{\fill}|{|^^A
322 %         \meta{encoding}|}{|^^A
323 %         \meta{argument}|}{|^^A
324 %             \meta{text}|}|
325 %    \end{quote}
326 %    For example, in the OT1 encoding \r A has a hand-crafted
327 %    definition this is declared as follows
328 %\begin{verbatim}
329 %    \DeclareTextCompositeCommand{\r}{OT1}{A}
330 %     {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex%
331 %      \rlap{\raise.67\dimen@\hbox{\char23}}A}
332 %\end{verbatim}
333 % \changes{v1.8e}{1996/11/23}
334 %      {Corrected description}
335 %    The \emph{command} will normally have been declared with
336 %    |\DeclareTextAccent|, or as a one-argument |\DeclareTextCommand|.
338 %    The commands defined using the above declarations can be used in
339 %    two ways.
340 %    Normally they are used by just calling the command in the
341 %    appropriate encoding, for example |\ss|.  However, sometimes you
342 %    may wish to use a command in an encoding where it is not defined.
343 %    If the command has no arguments, then you can use it in another
344 %    encoding by calling |\UseTextSymbol|:
345 %    \begin{quote}
346 %      |\UseTextSymbol{|^^A
347 %         \meta{encoding}|}{|^^A
348 %         \meta{command}|}|
349 %    \end{quote}
351 % \task{?}{Document the problems of these commands, see pr/3160}
352 % \changes{v1.9e}{1997/08/05}{Corrected order of arguments in
353 %          \cs{UseTextSymbol} example.}
354 %    For example, |\UseTextSymbol{OT1}{\ss}| has the same effect as:
355 %\begin{verbatim}
356 %    {\fontencoding{OT1}\selectfont\ss}
357 %\end{verbatim}
358 %    If the command has one argument then you can use it in another
359 %    encoding by calling
360 %    |\UseTextAccent|:
361 %    \begin{quote}
362 %      |\UseTextAccent{|^^A
363 %         \meta{encoding}|}{|^^A
364 %         \meta{command}|}{|^^A
365 %         \meta{text}|}|
366 %    \end{quote}
367 %    For example, if the current encoding is |OT2| then
368 %    |\UseTextAccent{OT1}{\'}{a}| has the same effect as:
369 %\begin{verbatim}
370 %    {\fontencoding{OT1}\selectfont\'{\fontencoding{OT2}\selectfont a}}
371 %\end{verbatim}
372 % \changes{v1.8e}{1996/11/23}
373 %      {Extended description}
374 %    You can also declare a default definition for a text command, which
375 %    will be used if the current encoding has no appropriate definition.
376 %    Such use will also set the definition for this command in the
377 %    current encoding to equal this default definition; this makes
378 %    subsequent uses of the command much faster.
379 %    \begin{quote}
380 %      |\DeclareTextCommandDefault{|^^A
381 %         \meta{command}|}{|^^A
382 %         \meta{definition}|}|
383 %    \end{quote}
384 %    For example, the default definition of the command
385 %    |\textonequarter| (which produces the fraction $\frac14$) could be
386 %    built using math mode:
387 %\begin{verbatim}
388 %    \DeclareTextCommandDefault{\textonequarter}{\ensuremath {\frac14}}
389 %\end{verbatim}
390 %    There is a matching |\Provide| command which will not override an
391 %    existing default definition:
392 %    \begin{quote}
393 %      |\ProvideTextCommandDefault{|^^A
394 %         \meta{command}|}{|^^A
395 %         \meta{definition}|}|
396 %    \end{quote}
397 %    The most common use for these commands is to use symbols from
398 %    other encodings, so there are some optimizations provided:
399 %    \begin{quote}
400 %      |\DeclareTextSymbolDefault{|^^A
401 %         \meta{command}|}|^^A
402 %         \meta{encoding}|}|\\
403 %      |\DeclareTextAccentDefault{|^^A
404 %         \meta{command}|}|^^A
405 %         \meta{encoding}|}|
406 %    \end{quote}
407 %    are short for:
408 %    \begin{quote}
409 %      |\DeclareTextCommandDefault{|^^A
410 %         \meta{command}|}|\\\hspace*{\fill}^^A
411 %         |{\UseTextSymbol{|^^A
412 %         \meta{encoding}|}{|\meta{command}|}}| \\
413 %      |\DeclareTextCommandDefault[1]{|^^A
414 %         \meta{command}|}|\\\hspace*{\fill}^^A
415 %         |{\UseTextAccent{|^^A
416 %         \meta{encoding}|}{|\meta{command}|}{#1}}|
417 %    \end{quote}
418 %    For example, to make |OT1| the default encoding for |\ss| and
419 %    |\'| you say:
420 %\begin{verbatim}
421 %    \DeclareTextSymbolDefault{\ss}{OT1}
422 %    \DeclareTextAccentDefault{\'}{OT1}
423 %\end{verbatim}
424 %    Note that you can use these commands on any zero- or one-argument
425 %    commands declared with |\DeclareText*| or |\ProvideText*|, not
426 %    just those defined using |\DeclareTextSymbol| or
427 %    |\DeclareTextAccent|.
429 % \subsection{Removing encoding-specific commands}
430 %    \label{sec:removeencspec}
432 % \changes{v1.9o}{1998/03/20}{Documentation added for pr/2783}
434 % In some cases encoding definitions are given to provide some limited
435 % support since nothing better is available, for example, the definition
436 % for |\textdollar| in \texttt{OT1} is a hack since \$ and \pounds{}
437 % actually share the same slot in this encoding. Thus if such a glyph
438 % becomes available in a different encoding (e.g., \texttt{TS1}) one
439 % would like to get rid of the flacky one and make the default
440 % definition point to the new encoding. In such a case defining
441 %\begin{verbatim}
442 %   \DeclareTextSymbol{\textdollar}{TS1}{36}
443 %   \DeclareTextSymbolDefault{\textdollar}{TS1}
444 %\end{verbatim}
445 % is not enough since if typesetting in \texttt{OT1} \LaTeX{} will
446 % still find the encoding specific-definition for \texttt{OT1} and
447 % therefore ignore the new default.
448 % Therefore to ensure that in this case the \texttt{TS1} version is
449 % used  we have to remove the \texttt{OT1} declaration:
450 %\begin{verbatim}
451 %   \UndeclareTextCommand{\textdollar}{OT1}
452 %\end{verbatim}
454 % Since the \$ sign is a proper glyph in the \texttt{T1} encoding there
455 % is no point removing its definition and forcing \LaTeX{} to pick up
456 % the \texttt{TS1} version if typesetting in this encoding.
457 % However, assume you want to use the variant dollar sign,
458 % i.e., \textdollaroldstyle{}
459 % for your dollars. In that case you have to get rid of the \texttt{T1}
460 % declaration as well, e.g., the following would do that for you:
461 %\begin{verbatim}
462 %   \UndeclareTextCommand{\textdollar}{OT1}
463 %   \UndeclareTextCommand{\textdollar} {T1}
464 %   \DeclareTextCommandDefault{\textdollar}
465 %                             {\UseTextSymbol{TS1}\textdollaroldstyle}
466 %\end{verbatim}
468 % \subsection{The order of declarations}\label{sec:orderofdecls}
470 % \changes{v1.9o}{1998/03/20}{Documentation added about order of decls}
472 % If an encoding-specific command is defined for more than one encoding,
473 % then it will execute fastest in the encoding in which it was defined
474 % last since its top-level definition will be set up to execute in that
475 % encoding without any overhead.
477 % For this reason the file \texttt{fonttext.ltx} currently first loads
478 % the definitions for the \texttt{T1} encoding and then those for the
479 % \texttt{OT1} encoding so that typesetting in \texttt{OT1} is optimized
480 % since that is (still) the default. However, when \texttt{T1} is
481 % explicitly requested (via |\usepackage[T1]{fontenc}|) the
482 % top-level definitions are automatically changed to favour
483 % \texttt{T1} since its declarations are reloaded in the process.
485 % For the same reason default declarations should never come last since
486 % they are implemented as a special encoding themselves (with the
487 % name |?|).
488 % Specifying them last would simply mean to make those encoding-specific
489 % commands equally inefficient in all encodings. Therefore the
490 % \texttt{textcomp} package, for example, first sets up all defaults
491 % to point to \texttt{TS1} and then declares the commands in the
492 % \texttt{TS1} encoding.
495 % \StopEventually{}
497 % \subsection{Docstrip modules}
499 %    This |.dtx| file is be used to generate several related files
500 %    containing font encoding definitions. The mutually exclusive
501 %    docstrip options are listed here.
502 %    \begin{center}
503 %    \begin{tabular}{lp{10cm}}
504 %      |T1|       & generates |t1enc.def| for the Cork encoding. \\
505 %      |TS1|      & generates |ts1enc.def| for the Text Companion
506 %                   encoding. \\
507 %      |TS1sty|   & generates |textcomp.sty|, package that sets up use
508 %                   of the Text Companion encoding. \\
509 %      |OT1|      & generates |ot1enc.def| for Knuth's CM encoding. \\
510 %      |OMS|      & generates |omsenc.def| for Knuth's
511 %                   math symbol encoding. \\
512 %      |OML|      & generates |omlenc.def| for Knuth's
513 %                   math letters encoding. \\
514 %      |OT4|      & generates |ot4enc.def| for the Polish extension to
515 %                   the OT1 encoding, created by B.~Jackowski and
516 %                   M.~Ry\'cko for use with the Polish version of
517 %                   Computer Modern and Computer Concrete.\\
518 %      |package|  & generates |fontenc.sty| for
519 %                   selecting encodings. \\
520 %      |2ekernel| & for the kernel commands.\\
521 %    \end{tabular}
522 %    \end{center}
523 % \changes{1.0d}{1993/07/17}{changed \cs{catcoding} @}
524 % \changes{1.0f}{1993/08/13}{Protected against active @ sign.}
525 % \changes{1.0g}{1993/08/16}{Needs space after \cs{string}}
526 % \changes{1.1}{1993/12/07}{Protected all special characters with
527 %                          \cs{string}.}
528 % \changes{1.3}{1993/12/17}{Removed the catcode hackery, since the file
529 %    is only read as a package in the preamble, and removed all the
530 %    messages on the screen, which just confuse users.  Replaced them
531 %    by the appropriate \cs{ProvidesPackage} commands. Added XXXenc.}
532 % \changes{1.3b}{1993/12/18}
533 %   {Fixed typos with \cs{ProvidesPackage} lines.
534 %    Added the \cs{NeedsTeXFormat} line.  Added the last argument to
535 %    \cs{DeclareEncoding}. Moved the use of the encodings to after their
536 %    declaration. }
537 % \changes{1.4a}{1994/04/29}{Removed Rokicki's OT1 variant encoding.
538 %    Moved the driver to the top.}
539 % \changes{1.5a}{1994/05/11}{Made T1 and OT1 generate packages rather
540 %    than def files.  Renamed the `package' module to `teststy'.}
541 % \changes{1.5d}{1994/05/14}{Moved the driver to the top.}
543 % \subsection{Definitions for the kernel}
545 % \subsubsection{Declaration commands}
547 % \changes{1.3}{1993/12/17}{Added this section}
548 % \changes{1.3c}{1993/12/18}{Split \cs{EncodingSpecificAccent} up into
549 %    \cs{EncodingSpecific} and \cs{DeclareAccent}.}
550 % \changes{1.4a}{1994/04/29}{Removed \cs{EncodingSpecific}.  Renamed
551 %    all the commands.  Added \cs{DeclareTextGlyph} and
552 %    \cs{UndeclareTextCommand}.}
553 % \changes{v1.5a}{1994/05/11}{Reimplemented \cs{DeclareTextCommand}
554 %    using \cs{@changed@cmd} and \cs{DeclareProtectedCommand}.}
555 % \changes{v1.5c}{1994/05/14}{Fixed a bug which caused an infinite loop
556 %    if \cs{f@encoding} was incorrectly set.}
557 % \changes{v1.5d}{1994/05/14}{Rewrote \cs{DeclareTextCommand} to define
558 %    its argument to use the current encoding by default, rather than
559 %    the encoding provided to \cs{DeclareTextCommand}.}
560 % \changes{v1.6a}{1994/10/25}{Added the \cs{Provide} commands,
561 %    and the default definitions.}
563 % This section contains definitions for commands such as accents which
564 % depend on the current encoding.  These commands will usually be kept
565 % in |.def| files, for example |ot1enc.def| contains the definitions
566 % for the |OT1| encoding.
567 %    \begin{macrocode}
568 %<*2ekernel>
569 \message{font encodings,}
570 %    \end{macrocode}
572 % \changes{v1.5d}{1994/10/27}{Rewrote \cs{DeclareTextSymbol} to define
573 %    its argument to use the current encoding by default, to fit with
574 %    \cs{DeclareTextCommand}.}
576 % \changes{v1.7a}{1994/11/30}{Redefined \cs{@changed@cmd} to expand in
577 %    the mouth.}
578 % \changes{v1.7a}{1994/11/30}{Removed \cs{@changed@x@mouth} since
579 %    \cs{@changed@x} now expands in the mouth.}
581 % \changes{v1.7r}{1995/11/28}{Renamed \cs{@changed@x@err} to
582 %    \cs{TextSymbolUnavailable}.}
583 % \changes{v1.7r}{1995/11/28}{Added math mode checks to text commands.}
584 % Far too many macros in one block here!
585 % \begin{macro}{\DeclareTextCommand}
586 % \begin{macro}{\ProvideTextCommand}
587 % \begin{macro}{\DeclareTextSymbol}
588 % \begin{macro}{\@dec@text@cmd}
589 % \begin{macro}{\chardef@text@cmd}
590 % \begin{macro}{\@changed@cmd}
591 % \begin{macro}{\@changed@x}
592 % \begin{macro}{\TextSymbolUnavailable}
593 % \begin{macro}{\@inmathwarn}
594 %    If you say:
595 %\begin{verbatim}
596 %    \DeclareTextCommand{\foo}{T1}...
597 %\end{verbatim}
598 %    then |\foo| is defined to be |\T1-cmd \foo \T1\foo|,
599 %    where |\T1\foo| is \emph{one} control sequence, not two!
600 %    We then call |\newcommand| to define |\T1\foo|.
601 %    \begin{macrocode}
602 \def\DeclareTextCommand{%
603    \@dec@text@cmd\newcommand}
604 %    \end{macrocode}
606 %    \begin{macrocode}
607 \def\ProvideTextCommand{%
608    \@dec@text@cmd\providecommand}
609 %    \end{macrocode}
611 %    \begin{macrocode}
612 \def\@dec@text@cmd#1#2#3{%
613    \expandafter\def\expandafter#2%
614       \expandafter{%
615          \csname#3-cmd\expandafter\endcsname
616          \expandafter#2%
617          \csname#3\string#2\endcsname
618       }%
619    \let\@ifdefinable\@rc@ifdefinable
620    \expandafter#1\csname#3\string#2\endcsname}
621 %    \end{macrocode}
622 % \changes{v1.99d}{2004/02/06}{New command added to fix
623 %     severe bug: pr/3563}
624 %    This command was introduced to fix a major bug
625 %    in |\@dec@text@cmd| without changing that command itself.
626 %    This was thought to be necessary because it is defined
627 %    in more than one package. (Perhaps the more serious bug is to put
628 %    complex low-level commands like this in packages?)
630 %    The problem it solves is that whereas both |\newcommand| and
631 %    |\providecommand| (used just above) both handle the
632 %    resetting of |\@ifdefinable| (following its disabling in
633 %    |\@dec@text@cmd|), the primitive |\chardef| neither needs the
634 %    disabling, nor does the resetting.
636 %    \begin{macrocode}
637 \def\chardef@text@cmd{%
638    \let\@ifdefinable\@@ifdefinable
639    \chardef
640   }
641 \def\DeclareTextSymbol#1#2#3{%
642    \@dec@text@cmd\chardef@text@cmd#1{#2}#3\relax
643   }
644 %    \end{macrocode}
646 %    The declarations are only available before |\begin{document}|.
647 % \changes{v1.7h}{1995/05/21}{Added several \cs{@onlypreamble}}
648 % \changes{v1.7k}{1995/06/05}{Removed \cs{protected@cmd} and replaced
649 %    with explicit \cs{noexpand}.}
650 %    \begin{macrocode}
651 \@onlypreamble\DeclareTextCommand
652 \@onlypreamble\DeclareTextSymbol
653 %    \end{macrocode}
654 %    The sneaky bit in all this is what |\T1-cmd \foo \T1\foo| does.
655 %    There are five possibilities, depending on the current values of
656 %    |\protect|, |\cf@encoding| and |\ifmmode|:
657 %    \begin{itemize}
658 %    \item If |\protect| is |\@typeset@protect| and |\cf@encoding| is
659 %       |T1|, then we execute |\T1\foo|.  This should be the normal
660 %       behaviour, and is optimized for speed.
661 %    \item If |\protect| is |\@typeset@protect|, |\cf@encoding| is
662 %       (say) |OT1|, and |\OT1\foo| is defined, then we execute
663 %       |\OT1\foo|.
664 %    \item If |\protect| is |\@typeset@protect|, |\cf@encoding| is
665 %       (say) |OT1|, we're in text mode,
666 %       and |\OT1\foo| is undefined, then we define
667 %       |\OT1\foo| to be the default value of |\foo|, and execute
668 %       |\OT1\foo|.
669 %    \item If |\protect| is |\@typeset@protect|, |\cf@encoding| is
670 %       (say) |OT1|, we're in math mode,
671 %       and |\OT1\foo| is undefined, then we execute the default value
672 %       of |\foo|.  (This is necessary so that things like
673 %       |$X_\copyright$| work properly.)
674 %    \item If |\protect| is not |\@typeset@protect| then we execute
675 %       |\noexpand\foo|.  For example, if we are writing to a file,
676 %       then this results in |\foo| being written.  If we are in a
677 %       |\mark|, then |\foo| will be put in the mark---since |\foo| is
678 %       robust, it will then survive all the things which may happen
679 %       to it whilst it's a |\mark|.
680 %    \end{itemize}
681 %    So after all that, we will either execute the appropriate
682 %    definition of |\foo| for the current encoding, or we will execute
683 %    |\noexpand\foo|.
685 %    The default value of |\foo| is |\?\foo| if it is defined, and an
686 %    error message otherwise.
688 %    When the encoding is changed from |T1| to |OT1|, |\T1-cmd| is
689 %    defined to be |\@changed@cmd| and |\OT1-cmd| is defined to be
690 %    |\@current@cmd|.  This means that the test for what the current
691 %    encoding is can be performed quickly.
692 %    \begin{macrocode}
693 \def\@current@cmd#1{%
694    \ifx\protect\@typeset@protect
695       \@inmathwarn#1%
696    \else
697       \noexpand#1\expandafter\@gobble
698    \fi}
699 %    \end{macrocode}
701 %    \begin{macrocode}
702 \def\@changed@cmd#1#2{%
703    \ifx\protect\@typeset@protect
704       \@inmathwarn#1%
705       \expandafter\ifx\csname\cf@encoding\string#1\endcsname\relax
706          \expandafter\ifx\csname ?\string#1\endcsname\relax
707             \expandafter\def\csname ?\string#1\endcsname{%
708                \TextSymbolUnavailable#1%
709             }%
710          \fi
711          \global\expandafter\let
712                \csname\cf@encoding \string#1\expandafter\endcsname
713                \csname ?\string#1\endcsname
714       \fi
715       \csname\cf@encoding\string#1%
716          \expandafter\endcsname
717    \else
718       \noexpand#1%
719    \fi}
720 %    \end{macrocode}
721 % \changes{v1.7m}{1995/10/09}{Autoload error}
722 % \changes{v1.7v}{1995/12/05}{Changed \cs{TextSymbolUnavailable} text}
723 %    \begin{macrocode}
724 \gdef\TextSymbolUnavailable#1{%
725    \@latex@error{%
726       Command \protect#1 unavailable in encoding \cf@encoding%
727    }\@eha}
728 %    \end{macrocode}
729 %    The command |\@inmathwarn| produces a warning message if we are
730 %    currently in math mode.  Note that since this command is used
731 %    inside text commands, it can't call |\relax| before the
732 %    |\ifmmode|.  This means that it is possible for the warning to
733 %    fail to be issued at the beginning of a row of an halign whose
734 %    template enters math mode.  This is probably a bad feature, but
735 %    there's not much that can be done about it, since adding a |\relax|
736 %    would break ligatures and kerning between text symbols.
738 %    A more efficient solution would be to make |\@inmathwarn| and
739 %    |\@inmatherr| equal to |\@empty| and |\relax| by default, and
740 %    to have
741 %    |\everymath| reset them to their usual definitions.  This is left
742 %    for future investigation (for example it may break some third
743 %    party code).
744 %    \begin{macrocode}
745 \def\@inmathwarn#1{%
746    \ifmmode
747       \@latex@warning{Command \protect#1 invalid in math mode}%
748    \fi}
749 %    \end{macrocode}
750 % \end{macro}
751 % \end{macro}
752 % \end{macro}
753 % \end{macro}
754 % \end{macro}
755 % \end{macro}
756 % \end{macro}
757 % \end{macro}
758 % \end{macro}
760 % \changes{v1.7k}{1995/06/05}{Allowed \cs{ProvideTextCommandDefault}
761 %    after the preamble.}
763 % \begin{macro}{\DeclareTextCommandDefault}
764 % \begin{macro}{\ProvideTextCommandDefault}
765 %    These define commands with encoding |?|.
767 %    Note that |\DeclareTextCommandDefault| can only be used in the
768 %    preamble, but that the |\Provide| version is allowed in inputenc
769 %    |.def| files, so is allowed anywhere.
770 %    \begin{macrocode}
771 \def\DeclareTextCommandDefault#1{%
772    \DeclareTextCommand#1?}
773 %    \end{macrocode}
775 %    \begin{macrocode}
776 \def\ProvideTextCommandDefault#1{%
777    \ProvideTextCommand#1?}
778 %    \end{macrocode}
780 %    \begin{macrocode}
781 \@onlypreamble\DeclareTextCommandDefault
782 %\@onlypreamble\ProvideTextCommandDefault
783 %    \end{macrocode}
784 %    They require |\?-cmd| to be initialized as |\@changed@cmd|.
785 %    \begin{macrocode}
786 \expandafter\let\csname?-cmd\endcsname\@changed@cmd
787 %    \end{macrocode}
788 % \end{macro}
789 % \end{macro}
791 % \begin{macro}{\DeclareTextAccent}
792 % \changes{v1.5a}{1994/05/11}
793 %      {Reimplemented using \cs{DeclareTextCommand}.}
794 % \changes{v1.7z}{1996/05/23}
795 %      {Reimplemented using \cs{add@accent} to save space latex/2133}
796 %    This is just a disguise for defining a \TeX~|\accent| command.
797 %    \begin{macrocode}
798 \def\DeclareTextAccent#1#2#3{%
799    \DeclareTextCommand#1{#2}{\add@accent{#3}}}
800 %    \end{macrocode}
802 %    \begin{macrocode}
803 \@onlypreamble\DeclareTextAccent
804 %    \end{macrocode}
805 % \end{macro}
807 % \changes{v1.7a}{1994/11/30}{Rewrote \cs{@text@composite} so it
808 %    allows an empty argument, or an argument containing lots of
809 %    commands.}
811 %  \begin{macro}{\add@accent}
812 % \changes{v1.7z}{1996/05/23}{macro added. latex/2133}
813 % \changes{v1.91}{2000/08/30}{Rearranged but no change to final code,
814 %    CAR (pr/3160)}
815 % To save space this code is shared between all text accents that are
816 % set using the |\accent| primitive.
817 % The argument is pre-set in a box so that any
818 % font loading that is needed is already done within the box.
819 % This is needed because font-loading involves grouping and that would
820 % prevent the accent mechanism from working so that the accent would
821 % not be positioned over the argument.
822 % Declarations that change the font should be allowed (only low-level
823 % ones are at present) inside the argument of an accent command,
824 % but not size changes, as they involve |\setbox| operations which
825 % also inhibit the mechanism of the |\accent| primitive.
827 % Note that the whole process is within a group.
828 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
829 %    (pr/3160)}
830 %    For a detailed discussion of this reimplementation and its
831 %    deficiencies, see pr/3160.
832 % \task{?}{Improve this and document its problems, see pr/3160}
833 % \changes{v1.9z}{2000/01/30}{Macro reimplemented (pr/3160)}
834 %    \begin{macrocode}
835 \def\add@accent#1#2{\hmode@bgroup
836 %    \end{macrocode}
837 %    Turn off the group in |\UseTextSymbol| in case this is used
838 %    inside the argument of |\add@accent|.
839 %    \begin{macrocode}
840    \let\hmode@start@before@group\@firstofone
841    \setbox\@tempboxa\hbox{#2%
842 %    \end{macrocode}
843 %    When presetting the argument in a box we record its |\spacefactor|
844 %    for later use after the accent got typeset. This way something like
845 %    |\`A| gets the spacefactor of |A| (i.e., 999) rather than the
846 %    default value of 1000.
847 % \changes{v1.9q}{1998/06/12}
848 %    {Explicitly set \cs{spacefactor} after \cs{accent} (pr/2877)}
849 %    \begin{macrocode}
850       \global\mathchardef\accent@spacefactor\spacefactor}%
851    \accent#1 #2\egroup\spacefactor\accent@spacefactor}
852 %    \end{macrocode}
853 %    Default definition for |\accent@spacefactor| prevents a horrible
854 %    death of the above macro inside an unprotected |\edef|.
855 % \changes{v1.9w}{1999/10/28}{Give \cs{accent@spacefactor} a default
856 %    definition (pr/3084)}
857 %    \begin{macrocode}
858 \let\accent@spacefactor\relax
859 %    \end{macrocode}
860 %  \end{macro}
862 % \begin{macro}{\hmode@bgroup}
863 % \changes{v1.9y}{2000/01/30}{Macro added}
864 %    \begin{macrocode}
865 \def\hmode@bgroup{\leavevmode\bgroup}
866 %    \end{macrocode}
867 %  \end{macro}
870 % \begin{macro}{\DeclareTextCompositeCommand}
871 % \changes{v1.7z}{1996/05/23}
872 %      {Modified to cope with new \cs{add@accent} command: required
873 %      removal of check for one argument-command}
874 % \begin{macro}{\DeclareTextComposite}
875 % \changes{v1.7l}{1995/06/09}{Rewrote \cs{DeclareTextComposite} to
876 %    define the composite as a no-argument command rather than a
877 %    two-argument command.}
878 % \begin{macro}{\@text@composite}
879 % \begin{macro}{\@text@composite@x}
880 % \begin{macro}{\@strip@args}
881 % \changes{v1.8c}{1996/10/27}
882 %      {Removed macro}
883 %    Another amusing game to play with |\expandafter|, |\csname|, and
884 %    |\string|.  When you say
885 %    |\DeclareTextCompositeCommand{\foo}{T1}{a}{bar}|, we look to see
886 %    if the expansion of |\T1\foo| begins with |\@text@composite|, and
887 %    if it doesn't, we redefine |\T1\foo| to be:
888 %\begin{verbatim}
889 %    #1 -> \@text@composite \T1\foo #1\@empty \@text@composite {...}
890 %\end{verbatim}
891 %    where |...| is the
892 %    previous definition of |\T1\foo|.  Finally, we define |\\T1\foo-a|
893 %    to expand to |bar|.
894 %    \begin{macrocode}
895 \def\DeclareTextCompositeCommand#1#2#3#4{%
896   \expandafter\let\expandafter\reserved@a\csname#2\string#1\endcsname
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\endcsname{#4}}
910 %    \end{macrocode}
912 %    \begin{macrocode}
913 \@onlypreamble\DeclareTextCompositeCommand
914 %    \end{macrocode}
915 %    This all works because:
916 %\begin{verbatim}
917 %    \@text@composite \T1\foo A\@empty \@text@composite {...}
918 %\end{verbatim}
919 %    expands to
920 %    |\\T1\foo-A| if |\\T1\foo-A| has been defined, and |{...}|
921 %    otherwise.
923 %    Note that |\@text@composite| grabs the first token of the
924 %    argument and puts just that in the
925 %    csname.  This is so that |\'{\textit{e}}| will work---it checks
926 %    whether |\\T1\'-\textit| is defined (which presumably it isn't)
927 %    and so expands to |{\accent 1 \textit{e}}|.
929 %    This trick won't always work, for example |\'{{\itshape e}}| will
930 %    expand to (with spaces added for clarity):
931 %\begin{verbatim}
932 %    \csname \string \T1\' - \string {\itshape e} \@empty \endcsname
933 %\end{verbatim}
934 %    which will die pretty horribly.  Unfortunately there's not much
935 %    can be done about this if we're going to use |\csname| lookups as a
936 %    fast way of accessing composites.
938 %    This has an unfortunate `misfeature' though, which is that in
939 %    the T1 encoding, |\'{aa}| produces \'a.  This is not the expected
940 %    behaviour, and should perhaps be fixed if the fix doesn't affect
941 %    performance too badly.
943 %    Finally, it's worth noting that the |\@empty| is used in
944 %    |\@text@composite| so that accents will work even when the
945 %    argument is empty.  If you say |\'{}| then this looks up
946 %    |\\T1\'-\@empty|, which ought to be |\relax|, and so all is well.
947 %    If we didn't include the |\@empty|, then |\'{}| would expand to:
948 %\begin{verbatim}
949 %    \csname \string \T1\' - \string \endcsname
950 %\end{verbatim}
951 %    so the |\endcsname| would be |\string|'ed and the whole of the
952 %    rest of the document would be put inside the |\csname|.  This
953 %    would not be good.
954 %    \begin{macrocode}
955 \def\@text@composite#1#2#3\@text@composite{%
956    \expandafter\@text@composite@x
957       \csname\string#1-\string#2\endcsname}
958 %    \end{macrocode}
960 % \changes{v1.7z}{1996/05/23}
961 %      {\cs{expandafter} added to match other changes for latex/2133}
962 % \changes{v1.9r}{1999/01/06}{New impl for latex/2930}
963 % \changes{v1.9s}{1999/01/13}{Simplified solution for latex/2930}
964 %    Originally the |\@text@composite@x| macro had two arguments and if
965 %    |#1| was not |\relax| it was executed, otherwise |#2| was executed.
966 %    All this happened within the |\ifx| code so that neither |#1|
967 %    nor |#2| could have picked up any additional arguments form
968 %    the input stream.
969 %    This has now being changed using the typical |\@firstoftwo| /
970 %    |\@secondoftwo| coding. This way the
971 %    final expansion will happen without any |\else| or |\fi|
972 %    intervening in the case that we need to get a further token
973 %    from the input stream.
974 %    \begin{macrocode}
975 \def\@text@composite@x#1{%
976    \ifx#1\relax
977       \expandafter\@secondoftwo
978    \else
979       \expandafter\@firstoftwo
980    \fi
981    #1}
982 %    \end{macrocode}
983 %    The command |\DeclareTextComposite| uses
984 %    |\DeclareTextCompositeCommand| to declare a command which
985 %    expands out to a single glyph.
986 % \changes{v1.8a}{1996/07/19}
987 %      {Use char 0 not @ as carrier for \cs{lowercase} /2197}
988 %    \begin{macrocode}
989 \catcode\z@=11\relax
990 %    \end{macrocode}
992 %    \begin{macrocode}
993 \def\DeclareTextComposite#1#2#3#4{%
994    \def\reserved@a{\DeclareTextCompositeCommand#1{#2}{#3}}%
995    \bgroup
996       \lccode\z@#4%
997       \lowercase{%
998    \egroup
999       \reserved@a ^^@}}
1000 %    \end{macrocode}
1002 %    \begin{macrocode}
1003 \catcode\z@=15\relax
1004 %    \end{macrocode}
1006 %    \begin{macrocode}
1007 \@onlypreamble\DeclareTextComposite
1008 %    \end{macrocode}
1009 % \end{macro}
1010 % \end{macro}
1011 % \end{macro}
1012 % \end{macro}
1013 % \end{macro}
1015 % \begin{macro}{\UseTextAccent}
1016 % \begin{macro}{\UseTextSymbol}
1017 % \changes{v1.7p}{1995/11/17}{Support \cs{@wrong@font@char} latex/1676}
1018 % \changes{v1.7q}{1995/11/18}{Modify message slightly}
1019 % \begin{macro}{\@use@text@encoding}
1020 % \changes{v1.91}{2000/08/30}{Rearranged but no change to final code,
1021 %    CAR (pr/3160)}
1022 %    These fragile commands access glyphs from different encodings.
1023 %    They use grotty low-level calls to the font selection scheme for
1024 %    speed, and in order to make sure that |\UseTextSymbol| doesn't
1025 %    do anything which you're not allowed to do between an |\accent|
1026 %    and its glyph.
1028 %    For a detailed discussion of this reimplementation and its
1029 %    deficiencies, see pr/3160.
1030 % \task{?}{Improve this and document its problems, see pr/3160}
1031 % \changes{v1.9z}{2000/01/30}{Macro reimplemented (pr/3160)}
1032 %    \begin{macrocode}
1033 \def\UseTextAccent#1#2#3{%
1034   \hmode@start@before@group
1035    {%
1036 %    \end{macrocode}
1037 %    Turn off the group in |\UseTextSymbol| in case this is used
1038 %    inside the arguments of |\UseTextAccent|.
1039 %    \begin{macrocode}
1040     \let\hmode@start@before@group\@firstofone
1041     \let\@curr@enc\cf@encoding
1042     \@use@text@encoding{#1}%
1043     #2{\@use@text@encoding\@curr@enc#3}%
1044    }}
1045 %    \end{macrocode}
1047 % \changes{v1.9z}{2000/01/30}{Macro reimplemented (pr/3160)}
1048 %    \begin{macrocode}
1049 \def\UseTextSymbol#1#2{%
1050        \hmode@start@before@group
1051        {%
1052           \def\@wrong@font@char{\MessageBreak
1053              for \noexpand\symbol`\string#2'}%
1054           \@use@text@encoding{#1}%
1055           #2%
1056        }%
1057     }
1058 %    \end{macrocode}
1060 %    \begin{macrocode}
1061 \def\@use@text@encoding#1{%
1062    \edef\f@encoding{#1}%
1063    \xdef\font@name{%
1064       \csname\curr@fontshape/\f@size\endcsname}%
1065    \pickup@font
1066    \font@name
1067    \@@enc@update}
1068 %    \end{macrocode}
1069 % \end{macro}
1070 % \end{macro}
1071 % \end{macro}
1073 % \begin{macro}{\hmode@start@before@group}
1074 %    The |\hmode@start@before@group| starts hmode and should be
1075 %    immediately followed by an explicit |{...}|. Its purpose is to
1076 %    ensure that hmode is started before this group  is opened. Inside
1077 %    |\add@accent| and |\UseTextAccent| it is redefined to remove this
1078 %    group so that it doesn't conflict with the |\accent| primitive.
1080 %    For a detailed discussion see pr/3160.
1081 % \changes{v1.9z}{2000/01/30}{Macro added (pr/3160)}
1082 %    \begin{macrocode}
1083 \let\hmode@start@before@group\leavevmode
1084 %    \end{macrocode}
1085 % \end{macro}
1087 % \begin{macro}{\DeclareTextSymbolDefault}
1088 % \begin{macro}{\DeclareTextAccentDefault}
1089 %    Some syntactic sugar.  Again, these should probably be optimized
1090 %    for speed.
1091 %    \begin{macrocode}
1092 \def\DeclareTextSymbolDefault#1#2{%
1093    \DeclareTextCommandDefault#1{\UseTextSymbol{#2}#1}}
1094 %    \end{macrocode}
1096 %    \begin{macrocode}
1097 \def\DeclareTextAccentDefault#1#2{%
1098    \DeclareTextCommandDefault#1{\UseTextAccent{#2}#1}}
1099 %    \end{macrocode}
1101 %    \begin{macrocode}
1102 \@onlypreamble\DeclareTextSymbolDefault
1103 \@onlypreamble\DeclareTextAccentDefault
1104 %    \end{macrocode}
1105 % \end{macro}
1106 % \end{macro}
1109 % \begin{macro}{\UndeclareTextCommand}
1110 %    This command safely removes and encoding specific declaration
1111 %    for a given encoding. It is helpful if one intends to use the
1112 %    default definition always and therefore wants to get rid of
1113 %    a declaration for some specific encoding.
1114 % \changes{v1.9o}{1998/03/20}{Macro added for pr/2783}
1115 %    \begin{macrocode}
1116 \def\UndeclareTextCommand#1#2{%
1117 %    \end{macrocode}
1118 %    If there is no declaration for the current encoding do nothing.
1119 %    (This makes a hash table entry but without e\TeX{} we can't do
1120 %    anything about that).
1121 %    \begin{macrocode}
1122   \expandafter\ifx\csname#2\string#1\endcsname\relax
1123   \else
1124 %    \end{macrocode}
1125 %    Else: throw away that declaration.
1126 %    \begin{macrocode}
1127      \global\expandafter\let\csname#2\string#1\endcsname
1128             \@undefined
1129 %    \end{macrocode}
1130 %    But this is unfortunately not enough, we have to take a look
1131 %    at the top-level definition of the encoding specific command
1132 %    which for a command |\foo| would look similar to
1133 %    |\T1-cmd \foo \T1\foo| (three tokens).
1135 %    Of course, instead of |T1| one could see a different encoding name;
1136 %    which one depends the encoding for which |\foo| was declared
1137 %    last.
1139 %    Now assume we have just removed the declaration for |\foo| in |T1|
1140 %    and the top-level of |\foo| expands to the above. Then we better
1141 %    change that pretty fast otherwise we do get an ``undefined csname
1142 %    error'' when we try to typeset |\foo| within |T1| instead of
1143 %    getting the default definition for |\foo|.
1144 %    And what is the best way to change that top-level definition? Well,
1145 %    the only ``encoding'' we know for sure will still be around is
1146 %    the default encoding denoted by |?|.
1148 %    Thus in case the last token of the top-level expansion
1149 %    is now undefined we change the declaration to look like
1150 %    |\?-cmd \foo \?\foo| which is done by the following
1151 %    (readable?) code:
1152 %    \begin{macrocode}
1153      \expandafter\expandafter\expandafter
1154      \ifx\expandafter\@thirdofthree#1\@undefined
1155        \expandafter\gdef\expandafter#1\expandafter
1156           {\csname ?-cmd\expandafter\endcsname\expandafter
1157            #1\csname?\string#1\endcsname}%
1158      \fi
1159  \fi
1161 %    \end{macrocode}
1163 %    \begin{macrocode}
1164 \@onlypreamble\UndeclareTextCommand
1165 %    \end{macrocode}
1166 % \end{macro}
1169 % \subsubsection{Hyphenation}
1171 % \changes{v1.5l}{1994/10/18}{Added new definitions of \cs{patterns}
1172 %    and \cs{hyphenation}.}
1173 % \changes{v1.6g}{1994/11/05}{Added setting of \cs{@typeset@protect}
1174 %    to \cs{patterns} and \cs{hyphenation}.}
1175 % \changes{v1.6g}{1994/11/30}{Removed new definitions of \cs{patterns}
1176 %    and \cs{hyphenation}, since encoding-specific commands now expand
1177 %    in the mouth.}
1179 % \begin{macro}{\patterns}
1180 % \begin{macro}{\@@patterns}
1181 % \begin{macro}{\hyphenation}
1182 % \begin{macro}{\@@hyphenation}
1183 %    We redefine |\patterns| and |\hyphenation| to allow the use of
1184 %    commands declared with |\DeclareText*| to be used inside them.
1185 %    \begin{macrocode}
1186 %\let\@@patterns\patterns
1187 %\let\@@hyphenation\hyphenation
1188 %\def\patterns{%
1189 %   \bgroup
1190 %      \let\protect\@empty
1191 %      \let\@typeset@protect\@empty
1192 %      \let\@changed@x\@changed@x@mouth
1193 %   \afterassignment\egroup
1194 %   \@@patterns
1196 %\def\hyphenation{%
1197 %   \bgroup
1198 %      \let\protect\@empty
1199 %      \let\@typeset@protect\@empty
1200 %      \let\@changed@x\@changed@x@mouth
1201 %   \afterassignment\egroup
1202 %   \@@hyphenation
1204 %    \end{macrocode}
1205 % \end{macro}
1206 % \end{macro}
1207 % \end{macro}
1208 % \end{macro}
1210 % \subsubsection{Miscellania}
1212 % \changes{1.4a}{1994/05/01}{Added the \cs{a} command.}
1213 % \changes{1.7a}{1994/11/30}{Redefined \cs{a} for the new scheme.}
1214 % \changes{1.7b}{1994/12/02}{Redefined \cs{a} properly.}
1215 % \changes{1.7g}{1995/03/03}{Corrected an error in documentation
1216 %               referring to the tabular rather than the tabbing
1217 %               environment.}
1218 % \changes{v1.7n}{1995/11/02}{Changed internal name \cs{a} to
1219 % \cs{@tabacckludge} to protect against redefinition by malicious
1220 % users.}
1222 % \begin{macro}{\a}
1223 %    The |\a| command is used to access the accent commands even when
1224 %    they have been redefined (for example by the |tabbing|
1225 %    environment). Its internal name is |\@tabacckludge|.
1227 %    The |\string| within the |\csname| guards against something
1228 %    like |'| being active at the point of use.
1229 % \changes{v1.9r}{1998/09/19}{Added \cs{string} (pr/2878)}
1230 %    \begin{macrocode}
1231 \def\@tabacckludge#1{\expandafter\@changed@cmd
1232                                  \csname\string#1\endcsname\relax}
1233 \let\a=\@tabacckludge
1234 %    \end{macrocode}
1235 % \end{macro}
1237 % \changes{v1.6a}{1994/10/25}{Added the files OT1enc.def, T1enc.def and
1238 %    OMSenc.def.}
1239 % \changes{v1.6b}{1994/10/27}{Removed the files OT1enc.def, T1enc.def
1240 %    and OMSenc.def.}
1242 % \subsubsection{Default encodings}
1244 % We define the default encodings for most commands to be either OT1,
1245 % OML or OMS.  These defaults are in the kernel and therefore
1246 % fonts with these encodings must be available unless these
1247 % defaults are redefined elsewhere.  Recall that the standard kernel
1248 % loads the encoding files for these encodings, and also that for
1249 % the T1 encoding.
1251 % The naming conventions in the kernel are not what we would use if we
1252 % were starting from scratch\dots\
1253 % Those defined by DEK (like |\ae| and |\ss|) or by the \TeX{} Users
1254 % Group Technical Working Group on multi-lingual typesetting (like
1255 % |\th| and |\ng|) have short names.  Those which were added to the
1256 % kernel in 1993 and early 1994 are named after their Adobe glyph
1257 % names (like |\guillemotleft| and |\quotedblbase|).  Unfortunately,
1258 % this naming scheme won't work for all glyphs, since some names (like
1259 % |\space|) are already used, and some (like |\endash|) are very
1260 % likely to be defined by users.  So we're now using the naming scheme
1261 % of |\text| followed by the Adobe name, (like |\textendash| and
1262 % |\textsterling|).  Except that some glyphs don't have Adobe names,
1263 % so we're using the names used by fontinst for those (like
1264 % |\textcompwordmark|).  Sigh.
1266 % \changes{v1.6a}{1994/10/25}{Added the defaults.}
1267 % \changes{v1.6b}{1994/10/27}{Added more defaults for OT1.}
1268 % \changes{v1.6c}{1994/10/29}{Added commands like \cs{dots} for use in
1269 %    text and math.}
1271 % Some accents from OT1:
1272 %    \begin{macrocode}
1273 \DeclareTextAccentDefault{\"}{OT1}
1274 \DeclareTextAccentDefault{\'}{OT1}
1275 \DeclareTextAccentDefault{\.}{OT1}
1276 \DeclareTextAccentDefault{\=}{OT1}
1277 \DeclareTextAccentDefault{\H}{OT1}
1278 \DeclareTextAccentDefault{\^}{OT1}
1279 \DeclareTextAccentDefault{\`}{OT1}
1280 \DeclareTextAccentDefault{\b}{OT1}
1281 \DeclareTextAccentDefault{\c}{OT1}
1282 \DeclareTextAccentDefault{\d}{OT1}
1283 \DeclareTextAccentDefault{\r}{OT1}
1284 \DeclareTextAccentDefault{\u}{OT1}
1285 \DeclareTextAccentDefault{\v}{OT1}
1286 \DeclareTextAccentDefault{\~}{OT1}
1287 %    \end{macrocode}
1288 % Some symbols from OT1:
1289 % \changes{v1.8c}{1996/10/27}
1290 %      {Removed \cs{aa} and \cs{AA}}
1291 %    \begin{macrocode}
1292 %\DeclareTextSymbolDefault{\AA}{OT1}
1293 \DeclareTextSymbolDefault{\AE}{OT1}
1294 \DeclareTextSymbolDefault{\L}{OT1}
1295 \DeclareTextSymbolDefault{\OE}{OT1}
1296 \DeclareTextSymbolDefault{\O}{OT1}
1297 %\DeclareTextSymbolDefault{\aa}{OT1}
1298 \DeclareTextSymbolDefault{\ae}{OT1}
1299 \DeclareTextSymbolDefault{\i}{OT1}
1300 \DeclareTextSymbolDefault{\j}{OT1}
1301 %    \end{macrocode}
1302 % \changes{v1.99h}{2005/11/08}
1303 %      {Added \cs{ij} and \cs{IJ} from babel. (pr/3771)}
1304 %    \begin{macrocode}
1305 \DeclareTextSymbolDefault{\ij}{OT1}
1306 \DeclareTextSymbolDefault{\IJ}{OT1}
1307 %    \end{macrocode}
1308 %    \begin{macrocode}
1309 \DeclareTextSymbolDefault{\l}{OT1}
1310 \DeclareTextSymbolDefault{\oe}{OT1}
1311 \DeclareTextSymbolDefault{\o}{OT1}
1312 \DeclareTextSymbolDefault{\ss}{OT1}
1313 \DeclareTextSymbolDefault{\textdollar}{OT1}
1314 \DeclareTextSymbolDefault{\textemdash}{OT1}
1315 \DeclareTextSymbolDefault{\textendash}{OT1}
1316 \DeclareTextSymbolDefault{\textexclamdown}{OT1}
1317 %\DeclareTextSymbolDefault{\texthyphenchar}{OT1}
1318 %\DeclareTextSymbolDefault{\texthyphen}{OT1}
1319 \DeclareTextSymbolDefault{\textquestiondown}{OT1}
1320 \DeclareTextSymbolDefault{\textquotedblleft}{OT1}
1321 \DeclareTextSymbolDefault{\textquotedblright}{OT1}
1322 \DeclareTextSymbolDefault{\textquoteleft}{OT1}
1323 \DeclareTextSymbolDefault{\textquoteright}{OT1}
1324 \DeclareTextSymbolDefault{\textsterling}{OT1}
1325 %    \end{macrocode}
1326 % Some symbols from OMS:
1327 % \changes{v1.7t}{1995/11/29}{Added \cs{textbackslash} and
1328 %    \cs{textbar}.}
1329 % \changes{v1.8c}{1996/10/27}
1330 %      {Added \cs{textasteriskcentered}}
1331 % \changes{v1.95}{2002/06/16}{Added default for \cs{textbardbl} (pr/3400)}
1332 %    \begin{macrocode}
1333 \DeclareTextSymbolDefault{\textasteriskcentered}{OMS}
1334 \DeclareTextSymbolDefault{\textbackslash}{OMS}
1335 \DeclareTextSymbolDefault{\textbar}{OMS}
1336 \DeclareTextSymbolDefault{\textbardbl}{OMS}
1337 \DeclareTextSymbolDefault{\textbraceleft}{OMS}
1338 \DeclareTextSymbolDefault{\textbraceright}{OMS}
1339 \DeclareTextSymbolDefault{\textbullet}{OMS}
1340 \DeclareTextSymbolDefault{\textdaggerdbl}{OMS}
1341 \DeclareTextSymbolDefault{\textdagger}{OMS}
1342 \DeclareTextSymbolDefault{\textparagraph}{OMS}
1343 \DeclareTextSymbolDefault{\textperiodcentered}{OMS}
1344 \DeclareTextSymbolDefault{\textsection}{OMS}
1345 \DeclareTextAccentDefault{\textcircled}{OMS}
1346 %    \end{macrocode}
1348 % \changes{v1.6d}{1994/10/30}{Added OML encoding.}
1349 % \changes{v1.6d}{1994/10/30}{Made \cs{textless} and \cs{textgreater}
1350 %    come from OML.}
1351 % \changes{v1.6d}{1994/10/30}{Added \cs{t}.}
1352 % \changes{v1.7k}{1995/06/05}{Commented out \cs{textless} and
1353 %    \cs{textgreater}.}
1355 % Some symbols from OML:
1356 % \changes{v1.7t}{1995/11/29}{Added \cs{textless} and
1357 %    \cs{textgreater}.}
1358 %    \begin{macrocode}
1359 \DeclareTextSymbolDefault{\textless}{OML}
1360 \DeclareTextSymbolDefault{\textgreater}{OML}
1361 \DeclareTextAccentDefault{\t}{OML}
1362 %    \end{macrocode}
1364 % \changes{v1.6d}{1994/10/30}{Added \cs{textcircled}.}
1365 % \changes{v1.6d}{1994/10/30}{Rewrote \cs{copyright} to use
1366 %    \cs{textcircled}.}
1367 % \changes{v1.6d}{1994/10/30}{Removed \cs{textregistered}.}
1368 % \changes{v1.7k}{1995/06/05}{Save some tokens in
1369 %    \cs{textvisiblespace} and \cs{textunderscore}.}
1370 % \changes{v1.7t}{1995/11/29}{Added \cs{textasciicircum},
1371 %    \cs{textasciitilde}, \cs{textregistered} and \cs{texttrademark}.}
1372 % \changes{v1.7u}{1995/12/01}{Made \cs{SS} a Default, rather than
1373 %    having the default point to the OT1 definition.}
1374 % \changes{v1.7w}{1995/12/11}{Modified \cs{copyright}}
1375 % \changes{v1.9a}{1997/04/30}{Introduced \cs{textcopyright} and modified
1376 %                             \cs{copyright}}
1378 % Some defaults we can fake.
1380 % The interface for defining |\copyright| changed, it used to
1381 % use |\expandafter| to add braces at the appropriate points.
1382 % \begin{macrocode}
1383 \DeclareTextCommandDefault{\textcopyright}{\textcircled{c}}
1384 % \expandafter\def\expandafter
1385 %                 \copyright\expandafter{\expandafter{\copyright}}
1386 %    \end{macrocode}
1388 % \changes{v1.9a}{1997/04/30}{Modified \cs{textunderscore}, removing
1389 %                                    \cs{mathunderscore}}
1390 % \changes{v1.9b}{1997/04/30}{Added \cs{leavevmode} to
1391 %                                   \cs{textunderscore}}
1392 % \changes{v1.9d}{1997/05/07}{Added \cs{leavevmode} to
1393 %                                   \cs{textcompwordmark}}
1394 %    \begin{macrocode}
1395 \DeclareTextCommandDefault{\textasciicircum}{\^{}}
1396 \DeclareTextCommandDefault{\textasciitilde}{\~{}}
1397 \DeclareTextCommandDefault{\textcompwordmark}{\leavevmode\kern\z@}
1398 \DeclareTextCommandDefault{\textunderscore}{%
1399   \leavevmode \kern.06em\vbox{\hrule\@width.3em}}
1400 %    \end{macrocode}
1402 %    \begin{macrocode}
1403 \DeclareTextCommandDefault{\textvisiblespace}{%
1404    \mbox{\kern.06em\vrule \@height.3ex}%
1405    \vbox{\hrule \@width.3em}%
1406    \hbox{\vrule \@height.3ex}}
1407 %    \end{macrocode}
1409 %    Using |\fontdimen3| in the next definition is some sort of a
1410 %    kludge (since it is the interword stretch) but it makes the
1411 %    ellipsis come out right in mono-spaced fonts too (since there it
1412 %    is zero).
1413 %    \begin{macrocode}
1414 \DeclareTextCommandDefault{\textellipsis}{%
1415    .\kern\fontdimen3\font
1416    .\kern\fontdimen3\font
1417    .\kern\fontdimen3\font}
1418 %    \end{macrocode}
1420 % \changes{v1.9a}{1997/04/30}{Changed \cs{textsc} to \cs{scshape}}
1421 % \changes{v1.95}{2002/06/18}{Changed def for \cs{textregistered} to
1422 %    avoid small caps (pr/3420)}
1423 %    \begin{macrocode}
1424 %\DeclareTextCommandDefault{\textregistered}{\textcircled{\scshape r}}
1425 \DeclareTextCommandDefault{\textregistered}{\textcircled{%
1426      \check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}}
1427 \DeclareTextCommandDefault{\texttrademark}{\textsuperscript{TM}}
1428 \DeclareTextCommandDefault{\SS}{SS}
1429 %    \end{macrocode}
1431 % \changes{v1.9n}{1998/03/05}{Added masc/fem ords as in pr/2579}
1432 %    \begin{macrocode}
1433 \DeclareTextCommandDefault{\textordfeminine}{\textsuperscript{a}}
1434 \DeclareTextCommandDefault{\textordmasculine}{\textsuperscript{o}}
1435 %    \end{macrocode}
1437 % \subsubsection{Math material}
1439 %    Some commands can be used in both text and math mode:
1440 %    \begin{macrocode}
1441 \DeclareRobustCommand{\$}{\ifmmode\mathdollar\else\textdollar\fi}
1442 \DeclareRobustCommand{\{}{\ifmmode\lbrace\else\textbraceleft\fi}
1443 \DeclareRobustCommand{\}}{\ifmmode\rbrace\else\textbraceright\fi}
1444 \DeclareRobustCommand{\P}{\ifmmode\mathparagraph\else\textparagraph\fi}
1445 \DeclareRobustCommand{\S}{\ifmmode\mathsection\else\textsection\fi}
1446 \DeclareRobustCommand{\dag}{\ifmmode{\dagger}\else\textdagger\fi}
1447 \DeclareRobustCommand{\ddag}{\ifmmode{\ddagger}\else\textdaggerdbl\fi}
1448 %    \end{macrocode}
1450 % For historical reasons |\copyright|
1451 % needs |{}| around the definition in maths.
1453 % \changes{v1.6f}{1994/11/04}{Added \cmd\_.}
1455 % \changes{v1.9a}{1997/04/30}{Modified \cs{underscore}, removing
1456 %                                    \cs{mathunderscore}}
1457 % \changes{v1.9a}{1997/04/30}{Introduced \cs{textcopyright} and modify
1458 %                             \cs{copyright}}
1459 %    \begin{macrocode}
1460 \DeclareRobustCommand{\_}{%
1461    \ifmmode\nfss@text{\textunderscore}\else\textunderscore\fi}
1462 \DeclareRobustCommand{\copyright}{%
1463    \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
1464 \DeclareRobustCommand{\pounds}{%
1465    \ifmmode\mathsterling\else\textsterling\fi}
1466 %    \end{macrocode}
1468 %    \begin{macrocode}
1469 \DeclareRobustCommand{\dots}{%
1470    \ifmmode\mathellipsis\else\textellipsis\fi}
1471 %    \end{macrocode}
1473 %    \begin{macrocode}
1474 \let\ldots\dots
1475 %    \end{macrocode}
1476 % \changes{v1.99m}{2015/02/16}{Added \cs{textcommabelow} latex/4414}
1477 % Default definition of comma below.
1478 %    \begin{macrocode}
1479 %</2ekernel>
1480 %<latexrelease>\IncludeInRelease{2015/10/01}{\textcommabelow}{comma accent}%
1481 %<*2ekernel|latexrelease>
1482 \DeclareTextCommandDefault\textcommabelow[1]
1483   {\hmode@bgroup\ooalign{\null#1\crcr\hidewidth\raise-.31ex
1484    \hbox{\check@mathfonts\fontsize\ssf@size\z@
1485    \math@fontsfalse\selectfont,}\hidewidth}\egroup}
1486 %<latexrelease>\EndIncludeInRelease
1487 %</2ekernel|latexrelease>
1488 %<latexrelease>\IncludeInRelease{0000/00/00}{\textcommabelow}{comma accent}%
1489 %<latexrelease>\let\textcommabelow\@undefined
1490 %<latexrelease>\EndIncludeInRelease
1491 %    \end{macrocode}
1493 % \changes{v1.6d}{1994/10/30}{Moved math commands here from ltmath.}
1494 % \changes{v1.6f}{1994/11/04}{Added \cs{mathunderscore}.}
1495 % \changes{v1.7k}{1995/06/05}{Moved math commands to fontdef.dtx.}
1498 % \changes{1.4a}{1994/05/01}{Added the \cs{SaveAtCatcode} and
1499 %    \cs{RestoreAtCatcode} commands.}
1501 % \changes{1.5a}{1994/05/12}{Removed the \cs{SaveAtCatcode} and
1502 %    \cs{RestoreAtCatcode} commands.}
1505 % \subsection{Definitions for the OT1 encoding}
1507 % \changes{1.3}{1993/12/17}{Removed all the hackery for use in
1508 %    \cs{DeclareFontEncoding}, and redid everything using
1509 %    \cs{DeclareTextFoo}.}
1510 % \changes{1.3b}{1993/12/18}{Replaced the missing last argument to
1511 %    \cs{DeclareFontEncoding}.}
1512 % \changes{1.3c}{1993/12/18}{Rewrote for the new syntax of
1513 %    \cs{EncodingSpecific}.}
1514 % \changes{1.4a}{1994/05/01}{Rewrote for the new syntax.}
1515 % \changes{1.5a}{1994/05/12}{Rewrote for the new syntax.}
1516 % \changes{1.5h}{1994/05/16}{\cs{pounds} was still using u rather than
1517 %    ui shape.}
1518 % \changes{1.6b}{1994/10/27}{Added:
1519 %   \cs{textemdash}
1520 %   \cs{textendash}
1521 %   \cs{textexclamdown}
1522 %   \cs{texthyphenchar}
1523 %   \cs{texthyphen}
1524 %   \cs{textquestiondown}
1525 %   \cs{textquotedblleft}
1526 %   \cs{textquotedblright}
1527 %   \cs{textquoteleft}
1528 %   \cs{textquoteright}
1529 % }
1531 % The definitions for the `\TeX{} text' (OT1) encoding.
1533 %    Declare the encoding.
1534 %    \begin{macrocode}
1535 %<*OT1>
1536 \DeclareFontEncoding{OT1}{}{}
1537 %    \end{macrocode}
1538 %    Declare the accents.
1539 %    \begin{macrocode}
1540 \DeclareTextAccent{\"}{OT1}{127}
1541 \DeclareTextAccent{\'}{OT1}{19}
1542 \DeclareTextAccent{\.}{OT1}{95}
1543 \DeclareTextAccent{\=}{OT1}{22}
1544 \DeclareTextAccent{\^}{OT1}{94}
1545 \DeclareTextAccent{\`}{OT1}{18}
1546 \DeclareTextAccent{\~}{OT1}{126}
1547 \DeclareTextAccent{\H}{OT1}{125}
1548 \DeclareTextAccent{\u}{OT1}{21}
1549 \DeclareTextAccent{\v}{OT1}{20}
1550 \DeclareTextAccent{\r}{OT1}{23}
1551 %    \end{macrocode}
1552 %    Some accents have to be built by hand:
1553 %    Note that |\ooalign| and |\o@lign| must be inside a group.
1554 % \changes{v1.7j}{1995/05/21}{Updated some plain macros}
1555 % \changes{v1.7o}{1995/11/07}{Added \cs{leavevmode} at start of
1556 % \cs{c}, otherwise the output routine might be invoked within the
1557 % macro.}
1558 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
1559 %    (pr/3160)}
1560 % \changes{v1.99g}{2005/09/27}{Replace \cs{sh@ft} by \cs{ltx@sh@ft}}
1561 %  In these definitions we no longer use the helper function |\sh@ft|
1562 %  from plain.tex since that now has two incompatible definitions.
1563 %    \begin{macrocode}
1564 \DeclareTextCommand{\b}{OT1}[1]
1565    {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-3ex}%
1566      \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}\egroup}
1567 \DeclareTextCommand{\c}{OT1}[1]
1568    {\leavevmode\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent24 #1%
1569     \else{\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}}\fi}
1570 \DeclareTextCommand{\d}{OT1}[1]
1571    {\hmode@bgroup
1572     \o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-1ex}.\hidewidth}\egroup}
1573 %    \end{macrocode}
1575 %    Declare the text symbols.
1576 %    \begin{macrocode}
1577 \DeclareTextSymbol{\AE}{OT1}{29}
1578 \DeclareTextSymbol{\OE}{OT1}{30}
1579 \DeclareTextSymbol{\O}{OT1}{31}
1580 \DeclareTextSymbol{\ae}{OT1}{26}
1581 \DeclareTextSymbol{\i}{OT1}{16}
1582 \DeclareTextSymbol{\j}{OT1}{17}
1583 \DeclareTextSymbol{\oe}{OT1}{27}
1584 \DeclareTextSymbol{\o}{OT1}{28}
1585 \DeclareTextSymbol{\ss}{OT1}{25}
1586 \DeclareTextSymbol{\textemdash}{OT1}{124}
1587 \DeclareTextSymbol{\textendash}{OT1}{123}
1588 %    \end{macrocode}
1589 %    Using the ligatures helps with OT1 fonts that have
1590 %    |\textexclamdown| and |\textquestiondown| in unusual positions.
1591 % \changes{v1.95}{2002/06/17}{Definition of \cs{textexclamdown} changed (pr/3368)}
1592 % \changes{v1.95}{2002/06/17}{Definition of \cs{textquestiondown} changed (pr/3368)}
1593 %    \begin{macrocode}
1594 %\DeclareTextSymbol{\textexclamdown}{OT1}{60}
1595 %\DeclareTextSymbol{\textquestiondown}{OT1}{62}
1596 \DeclareTextCommand{\textexclamdown}{OT1}{!`}
1597 \DeclareTextCommand{\textquestiondown}{OT1}{?`}
1598 %\DeclareTextSymbol{\texthyphenchar}{OT1}{`\-}
1599 %\DeclareTextSymbol{\texthyphen}{OT1}{`\-}
1600 \DeclareTextSymbol{\textquotedblleft}{OT1}{92}
1601 \DeclareTextSymbol{\textquotedblright}{OT1}{`\"}
1602 \DeclareTextSymbol{\textquoteleft}{OT1}{`\`}
1603 \DeclareTextSymbol{\textquoteright}{OT1}{`\'}
1604 %    \end{macrocode}
1605 %    Some symbols which are faked from others:
1606 % \changes{v1.7o}{1995/11/07}{Changed \cs{char}32 to \cs{@xxxii} (two
1607 % tokens less).}
1608 % \changes{v1.7o}{1995/11/07}{Replaced octal number 27 by decimal
1609 % number 23 to protect against the quote character being active.}
1610 % \changes{v1.7o}{1995/11/07}{Replaced some 0's by \cs{z@} (faster).}
1611 % \changes{v1.8c}{1996/10/27}
1612 %      {Removed \cs{aa} and \cs{AA}}
1613 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
1614 %    (pr/3160)}
1615 %    \begin{macrocode}
1616 % \DeclareTextCommand{\aa}{OT1}
1617 %    {{\accent23a}}
1618 \DeclareTextCommand{\L}{OT1}
1619    {\leavevmode\setbox\z@\hbox{L}\hb@xt@\wd\z@{\hss\@xxxii L}}
1620 \DeclareTextCommand{\l}{OT1}
1621    {\hmode@bgroup\@xxxii l\egroup}
1622 % \DeclareTextCommand{\AA}{OT1}
1623 %    {\leavevmode\setbox\z@\hbox{h}\dimen@\ht\z@\advance\dimen@-1ex%
1624 %     \rlap{\raise.67\dimen@\hbox{\char23}}A}
1625 %    \end{macrocode}
1626 %    In the OT1 encoding \r A has a hand-crafted definition, so we
1627 %    have here the first recorded explicit use of
1628 %    |\DeclareTextCompositeCommand|.
1629 % \changes{v1.8c}{1996/10/27}
1630 %      {Added \cs{r} A}
1631 % \changes{v1.96}{2002/10/28}{%
1632 %   coding change, to follow bug fix by DEK in plain.tex (pr/3469)}
1633 %    \begin{macrocode}
1634 \DeclareTextCompositeCommand{\r}{OT1}{A}
1635    {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex%
1636     \rlap{\raise.67\dimen@\hbox{\char23}}A}
1637 %    \end{macrocode}
1638 % \changes{v1.99h}{2005/11/08}
1639 %      {Added \cs{ij} and \cs{IJ} from babel. (pr/3771)}
1640 %    The dutch language uses the letter `ij'. It is available in
1641 %    \texttt{T1} encoded fonts, but not in the \texttt{OT1} encoded
1642 %    fonts. Therefor we fake it for the \texttt{OT1} encoding.
1643 %    \begin{macrocode}
1644 \DeclareTextCommand{\ij}{OT1}{%
1645   \nobreak\hskip\z@skip i\kern-0.02em j\nobreak\hskip\z@skip}
1646 \DeclareTextCommand{\IJ}{OT1}{%
1647   \nobreak\hskip\z@skip I\kern-0.02em J\nobreak\hskip\z@skip}
1648 %    \end{macrocode}
1649 %    In the OT1 encoding, \pounds~and \$ share a slot.
1650 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
1651 %    (pr/3160)}
1652 %    \begin{macrocode}
1653 \DeclareTextCommand{\textdollar}{OT1}{\hmode@bgroup
1654    \ifdim \fontdimen\@ne\font >\z@
1655       \slshape
1656    \else
1657       \upshape
1658    \fi
1659    \char`\$\egroup}
1660 %    \end{macrocode}
1662 %    \begin{macrocode}
1663 \DeclareTextCommand{\textsterling}{OT1}{\hmode@bgroup
1664    \ifdim \fontdimen\@ne\font >\z@
1665       \itshape
1666    \else
1667       \fontshape{ui}\selectfont
1668    \fi
1669    \char`\$\egroup}
1670 %    \end{macrocode}
1672 %    Here we are adding some more composite commands to the |OT1|
1673 %    encoding.  This makes the use of certain accents with |i|
1674 %    compatible with their use with the |T1| encoding; this
1675 %    enables them to become true \LaTeX{} internal representations.
1676 %    However, it will make these accents work a little less fast since
1677 %    a check will always be made for the existence of a composite.
1679 % \changes{v1.93}{2001/05/28}{Added composites for compatibility with
1680 %                             T1, pr/3295}
1681 % \changes{v1.94}{2001/06/05}{Text composite Commands need kludges for
1682 %                               `,' -- see tlb1903.lvt}
1683 %    \begin{macrocode}
1684 \DeclareTextComposite{\.}{OT1}{i}{`\i}
1685 \DeclareTextComposite{\.}{OT1}{\i}{`\i}
1686 \DeclareTextCompositeCommand{\`}{OT1}{i}{\@tabacckludge`\i}
1687 \DeclareTextCompositeCommand{\'}{OT1}{i}{\@tabacckludge'\i}
1688 \DeclareTextCompositeCommand{\^}{OT1}{i}{\^\i}
1689 \DeclareTextCompositeCommand{\"}{OT1}{i}{\"\i}
1690 %    \end{macrocode}
1692 %    \begin{macrocode}
1693 %</OT1>
1694 %    \end{macrocode}
1696 % \subsection{Definitions for the T1 encoding}
1698 % \changes{1.3}{1993/12/17}{Removed all the hackery for use in
1699 %    \cs{DeclareFontEncoding}, and redid everything using
1700 %    \cs{DeclareTextFoo}.}
1701 % \changes{1.3b}{1993/12/18}{Replaced the missing last argument to
1702 %    \cs{DeclareFontEncoding}.}
1703 % \changes{1.3c}{1993/12/18}{Rewrote for the new syntax of
1704 %    \cs{EncodingSpecific}.}
1705 % \changes{1.4a}{1994/05/01}{Rewrote for the new syntax.}
1706 % \changes{1.5a}{1994/05/12}{Rewrote for the new syntax.}
1707 % \changes{1.6a}{1994/10/25}{Added \cs{textdollar},
1708 %    \cs{textlbrace}, \cs{textrbrace}, \cs{textsterling},
1709 %    \cs{textunderline}.}
1710 % \changes{1.6a}{1994/10/25}{Removed
1711 %    \cs{textlbrace}, \cs{textrbrace}, \cs{textunderline} to give them
1712 %    their proper names.}
1713 % \changes{1.6b}{1994/10/27}{Added
1714 %   \cs{textasciicircum}
1715 %   \cs{textasciitilde}
1716 %   \cs{textbackslash}
1717 %   \cs{textbar}
1718 %   \cs{textbraceleft}
1719 %   \cs{textbraceright}
1720 %   \cs{textcompwordmark}
1721 %   \cs{textemdash}
1722 %   \cs{textendash}
1723 %   \cs{textexclamdown}
1724 %   \cs{textgreater}
1725 %   \cs{texthyphenchar}
1726 %   \cs{texthyphen}
1727 %   \cs{textless}
1728 %   \cs{textquestiondown}
1729 %   \cs{textquotedblleft}
1730 %   \cs{textquotedblright}
1731 %   \cs{textquotedbl}
1732 %   \cs{textquoteleft}
1733 %   \cs{textquoteright}
1734 %   \cs{textunderscore}
1735 %   \cs{textvisiblespace}
1736 % }
1737 % \changes{v1.9h}{1997/12/17}
1738 %    {Added \cs{textperthousand} and \cs{textpertenthousand}}
1740 % The definitions for the `Extended \TeX{} text' (T1) encoding.
1742 %    Declare the encoding.
1743 %    \begin{macrocode}
1744 %<*T1>
1745 \DeclareFontEncoding{T1}{}{}
1746 %    \end{macrocode}
1747 %    Declare the accents.
1748 %    \begin{macrocode}
1749 \DeclareTextAccent{\`}{T1}{0}
1750 \DeclareTextAccent{\'}{T1}{1}
1751 \DeclareTextAccent{\^}{T1}{2}
1752 \DeclareTextAccent{\~}{T1}{3}
1753 \DeclareTextAccent{\"}{T1}{4}
1754 \DeclareTextAccent{\H}{T1}{5}
1755 \DeclareTextAccent{\r}{T1}{6}
1756 \DeclareTextAccent{\v}{T1}{7}
1757 \DeclareTextAccent{\u}{T1}{8}
1758 \DeclareTextAccent{\=}{T1}{9}
1759 \DeclareTextAccent{\.}{T1}{10}
1760 %    \end{macrocode}
1761 %    Some accents have to be built by hand.
1762 %    Note that |\ooalign| and |\o@lign| must be inside a group.
1763 % \changes{v1.9h}{1997/12/17}{As in OT1, Added \cs{leavevmode} at
1764 % start of \cs{c}, otherwise the output routine might be invoked
1765 % within the macro.}
1766 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
1767 %    (pr/3160)}
1768 % \changes{v1.95}{2002/06/17}{Corrected \cs{c} for T1 (pr/3442)}
1769 % \changes{v1.99b}{2004/01/03}{Use \cs{ooalign} for \cs{k} (pr/3532)}
1770 % \changes{v1.99b}{2004/01/03}{Added \cs{textogonekcentered} (pr/3532)}
1771 % \changes{v1.99c}{2004/01/04}{More adjustments for ogonek (pr/3532)}
1772 % \changes{v1.99g}{2005/09/27}{Replace \cs{sh@ft} by \cs{ltx@sh@ft}}
1773 %  In these definitions we no longer use the helper function |\sh@ft|
1774 %  from plain.tex since that now has two incompatible definitions.
1775 %    \begin{macrocode}
1776 \DeclareTextCommand{\b}{T1}[1]
1777    {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-3ex}%
1778      \vbox to.2ex{\hbox{\char9}\vss}\hidewidth}\egroup}
1779 \DeclareTextCommand{\c}{T1}[1]
1780    {\leavevmode\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent11 #1%
1781      \else{\ooalign{\unhbox\z@\crcr
1782         \hidewidth\char11\hidewidth}}\fi}
1783 \DeclareTextCommand{\d}{T1}[1]
1784    {\hmode@bgroup
1785     \o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-1ex}.\hidewidth}\egroup}
1786 \DeclareTextCommand{\k}{T1}[1]
1787    {\hmode@bgroup\ooalign{\null#1\crcr\hidewidth\char12}\egroup}
1788 \DeclareTextCommand{\textogonekcentered}{T1}[1]
1789    {\hmode@bgroup\ooalign{%
1790                 \null#1\crcr\hidewidth\char12\hidewidth}\egroup}
1791 %    \end{macrocode}
1793 %    Some symbols are constructed.
1795 % \changes{v1.9h}{1997/12/17}
1796 %    {Added \cs{textperthousand} and \cs{textpertenthousand}}
1797 %    Slot 24 contains a small circle intended for construction of
1798 %    these two glyphs.
1800 %    \begin{macrocode}
1801 \DeclareTextCommand{\textperthousand}{T1}
1802    {\%\char 24 }          % space or `relax as delimiter?
1803 \DeclareTextCommand{\textpertenthousand}{T1}
1804    {\%\char 24\char 24 }  % space or `relax as delimiter?
1805 %    \end{macrocode}
1807 %    Declare the text symbols.
1808 % \changes{v1.7t}{1995/11/29}{Added \cs{textasciicircum},
1809 %    \cs{textasciitilde}, \cs{textbackslash}, \cs{textbar},
1810 %    \cs{textgreater} and \cs{textless}.}
1811 % \changes{v1.8c}{1996/10/27}
1812 %      {Removed \cs{aa} and \cs{AA}}
1813 % \changes{v1.99h}{2005/11/08}
1814 %      {Added \cs{ij} and \cs{IJ} from babel. (pr/3771)}
1816 %    \begin{macrocode}
1817 %\DeclareTextSymbol{\AA}{T1}{197}
1818 \DeclareTextSymbol{\AE}{T1}{198}
1819 \DeclareTextSymbol{\DH}{T1}{208}
1820 \DeclareTextSymbol{\DJ}{T1}{208}
1821 \DeclareTextSymbol{\L}{T1}{138}
1822 \DeclareTextSymbol{\NG}{T1}{141}
1823 \DeclareTextSymbol{\OE}{T1}{215}
1824 \DeclareTextSymbol{\O}{T1}{216}
1825 \DeclareTextSymbol{\SS}{T1}{223}
1826 \DeclareTextSymbol{\TH}{T1}{222}
1827 %\DeclareTextSymbol{\aa}{T1}{229}
1828 \DeclareTextSymbol{\ae}{T1}{230}
1829 \DeclareTextSymbol{\dh}{T1}{240}
1830 \DeclareTextSymbol{\dj}{T1}{158}
1831 \DeclareTextSymbol{\guillemotleft}{T1}{19}
1832 \DeclareTextSymbol{\guillemotright}{T1}{20}
1833 \DeclareTextSymbol{\guilsinglleft}{T1}{14}
1834 \DeclareTextSymbol{\guilsinglright}{T1}{15}
1835 \DeclareTextSymbol{\i}{T1}{25}
1836 \DeclareTextSymbol{\j}{T1}{26}
1837 \DeclareTextSymbol{\ij}{T1}{188}
1838 \DeclareTextSymbol{\IJ}{T1}{156}
1839 \DeclareTextSymbol{\l}{T1}{170}
1840 \DeclareTextSymbol{\ng}{T1}{173}
1841 \DeclareTextSymbol{\oe}{T1}{247}
1842 \DeclareTextSymbol{\o}{T1}{248}
1843 \DeclareTextSymbol{\quotedblbase}{T1}{18}
1844 \DeclareTextSymbol{\quotesinglbase}{T1}{13}
1845 \DeclareTextSymbol{\ss}{T1}{255}
1846 \DeclareTextSymbol{\textasciicircum}{T1}{`\^}
1847 \DeclareTextSymbol{\textasciitilde}{T1}{`\~}
1848 \DeclareTextSymbol{\textbackslash}{T1}{`\\}
1849 \DeclareTextSymbol{\textbar}{T1}{`\|}
1850 \DeclareTextSymbol{\textbraceleft}{T1}{`\{}
1851 \DeclareTextSymbol{\textbraceright}{T1}{`\}}
1852 \DeclareTextSymbol{\textcompwordmark}{T1}{23}
1853 \DeclareTextSymbol{\textdollar}{T1}{`\$}
1854 \DeclareTextSymbol{\textemdash}{T1}{22}
1855 \DeclareTextSymbol{\textendash}{T1}{21}
1856 \DeclareTextSymbol{\textexclamdown}{T1}{189}
1857 \DeclareTextSymbol{\textgreater}{T1}{`\>}
1858 %\DeclareTextSymbol{\texthyphenchar}{T1}{127}
1859 %\DeclareTextSymbol{\texthyphen}{T1}{`\-}
1860 \DeclareTextSymbol{\textless}{T1}{`\<}
1861 \DeclareTextSymbol{\textquestiondown}{T1}{190}
1862 \DeclareTextSymbol{\textquotedblleft}{T1}{16}
1863 \DeclareTextSymbol{\textquotedblright}{T1}{17}
1864 \DeclareTextSymbol{\textquotedbl}{T1}{`\"}
1865 \DeclareTextSymbol{\textquoteleft}{T1}{`\`}
1866 \DeclareTextSymbol{\textquoteright}{T1}{`\'}
1867 \DeclareTextSymbol{\textsection}{T1}{159}
1868 \DeclareTextSymbol{\textsterling}{T1}{191}
1869 \DeclareTextSymbol{\textunderscore}{T1}{95}
1870 \DeclareTextSymbol{\textvisiblespace}{T1}{32}
1871 \DeclareTextSymbol{\th}{T1}{254}
1872 %    \end{macrocode}
1873 %    Declare the composites.
1874 % \changes{v1.93}{2001/05/28}{Changed the effect of
1875 %                             \cs{.}\cs{i}, pr/3295}
1876 %    \begin{macrocode}
1877 \DeclareTextComposite{\.}{T1}{i}{`\i}
1878 \DeclareTextComposite{\.}{T1}{\i}{`\i}
1879 %    \end{macrocode}
1880 % \changes{v1.9c}{1997/05/04}{Added `hex index tabs'}
1881 %    "80 = 128
1882 %    \begin{macrocode}
1883 \DeclareTextComposite{\u}{T1}{A}{128}
1884 \DeclareTextComposite{\k}{T1}{A}{129}
1885 \DeclareTextComposite{\'}{T1}{C}{130}
1886 \DeclareTextComposite{\v}{T1}{C}{131}
1887 \DeclareTextComposite{\v}{T1}{D}{132}
1888 \DeclareTextComposite{\v}{T1}{E}{133}
1889 \DeclareTextComposite{\k}{T1}{E}{134}
1890 \DeclareTextComposite{\u}{T1}{G}{135}
1891 %    \end{macrocode}
1892 %    "88 = 136
1893 %    \begin{macrocode}
1894 \DeclareTextComposite{\'}{T1}{L}{136}
1895 \DeclareTextComposite{\v}{T1}{L}{137}
1896 \DeclareTextComposite{\'}{T1}{N}{139}
1897 \DeclareTextComposite{\v}{T1}{N}{140}
1898 \DeclareTextComposite{\H}{T1}{O}{142}
1899 \DeclareTextComposite{\'}{T1}{R}{143}
1900 %    \end{macrocode}
1901 %    "90 = 144
1902 %    \begin{macrocode}
1903 \DeclareTextComposite{\v}{T1}{R}{144}
1904 \DeclareTextComposite{\'}{T1}{S}{145}
1905 \DeclareTextComposite{\v}{T1}{S}{146}
1906 \DeclareTextComposite{\c}{T1}{S}{147}
1907 \DeclareTextComposite{\v}{T1}{T}{148}
1908 \DeclareTextComposite{\c}{T1}{T}{149}
1909 \DeclareTextComposite{\H}{T1}{U}{150}
1910 \DeclareTextComposite{\r}{T1}{U}{151}
1911 %    \end{macrocode}
1912 %    "98 = 152
1913 %    \begin{macrocode}
1914 \DeclareTextComposite{\"}{T1}{Y}{152}
1915 \DeclareTextComposite{\'}{T1}{Z}{153}
1916 \DeclareTextComposite{\v}{T1}{Z}{154}
1917 \DeclareTextComposite{\.}{T1}{Z}{155}
1918 \DeclareTextComposite{\.}{T1}{I}{157}
1919 %    \end{macrocode}
1920 %    "A0 = 160
1921 %    \begin{macrocode}
1922 \DeclareTextComposite{\u}{T1}{a}{160}
1923 \DeclareTextComposite{\k}{T1}{a}{161}
1924 \DeclareTextComposite{\'}{T1}{c}{162}
1925 \DeclareTextComposite{\v}{T1}{c}{163}
1926 \DeclareTextComposite{\v}{T1}{d}{164}
1927 \DeclareTextComposite{\v}{T1}{e}{165}
1928 \DeclareTextComposite{\k}{T1}{e}{166}
1929 \DeclareTextComposite{\u}{T1}{g}{167}
1930 %    \end{macrocode}
1931 %    "A8 = 168
1932 %    \begin{macrocode}
1933 \DeclareTextComposite{\'}{T1}{l}{168}
1934 \DeclareTextComposite{\v}{T1}{l}{169}
1935 \DeclareTextComposite{\'}{T1}{n}{171}
1936 \DeclareTextComposite{\v}{T1}{n}{172}
1937 \DeclareTextComposite{\H}{T1}{o}{174}
1938 \DeclareTextComposite{\'}{T1}{r}{175}
1939 %    \end{macrocode}
1940 %    "B0 = 176
1941 %    \begin{macrocode}
1942 \DeclareTextComposite{\v}{T1}{r}{176}
1943 \DeclareTextComposite{\'}{T1}{s}{177}
1944 \DeclareTextComposite{\v}{T1}{s}{178}
1945 \DeclareTextComposite{\c}{T1}{s}{179}
1946 \DeclareTextComposite{\v}{T1}{t}{180}
1947 \DeclareTextComposite{\c}{T1}{t}{181}
1948 \DeclareTextComposite{\H}{T1}{u}{182}
1949 \DeclareTextComposite{\r}{T1}{u}{183}
1950 %    \end{macrocode}
1951 %    "B8 = 184
1952 %    \begin{macrocode}
1953 \DeclareTextComposite{\"}{T1}{y}{184}
1954 \DeclareTextComposite{\'}{T1}{z}{185}
1955 \DeclareTextComposite{\v}{T1}{z}{186}
1956 \DeclareTextComposite{\.}{T1}{z}{187}
1957 %    \end{macrocode}
1958 %    "C0 = 192
1959 %    \begin{macrocode}
1960 \DeclareTextComposite{\`}{T1}{A}{192}
1961 \DeclareTextComposite{\'}{T1}{A}{193}
1962 \DeclareTextComposite{\^}{T1}{A}{194}
1963 \DeclareTextComposite{\~}{T1}{A}{195}
1964 \DeclareTextComposite{\"}{T1}{A}{196}
1965 \DeclareTextComposite{\r}{T1}{A}{197}
1966 \DeclareTextComposite{\c}{T1}{C}{199}
1967 %    \end{macrocode}
1968 %    "C8 = 200
1969 %    \begin{macrocode}
1970 \DeclareTextComposite{\`}{T1}{E}{200}
1971 \DeclareTextComposite{\'}{T1}{E}{201}
1972 \DeclareTextComposite{\^}{T1}{E}{202}
1973 \DeclareTextComposite{\"}{T1}{E}{203}
1974 \DeclareTextComposite{\`}{T1}{I}{204}
1975 \DeclareTextComposite{\'}{T1}{I}{205}
1976 \DeclareTextComposite{\^}{T1}{I}{206}
1977 \DeclareTextComposite{\"}{T1}{I}{207}
1978 %    \end{macrocode}
1979 %    "D0 = 208
1980 %    \begin{macrocode}
1981 \DeclareTextComposite{\~}{T1}{N}{209}
1982 \DeclareTextComposite{\`}{T1}{O}{210}
1983 \DeclareTextComposite{\'}{T1}{O}{211}
1984 \DeclareTextComposite{\^}{T1}{O}{212}
1985 \DeclareTextComposite{\~}{T1}{O}{213}
1986 \DeclareTextComposite{\"}{T1}{O}{214}
1987 %    \end{macrocode}
1988 %    "D8 = 216
1989 %    \begin{macrocode}
1990 \DeclareTextComposite{\`}{T1}{U}{217}
1991 \DeclareTextComposite{\'}{T1}{U}{218}
1992 \DeclareTextComposite{\^}{T1}{U}{219}
1993 \DeclareTextComposite{\"}{T1}{U}{220}
1994 \DeclareTextComposite{\'}{T1}{Y}{221}
1995 %    \end{macrocode}
1996 %    "E0 = 224
1997 %    \begin{macrocode}
1998 \DeclareTextComposite{\`}{T1}{a}{224}
1999 \DeclareTextComposite{\'}{T1}{a}{225}
2000 \DeclareTextComposite{\^}{T1}{a}{226}
2001 \DeclareTextComposite{\~}{T1}{a}{227}
2002 \DeclareTextComposite{\"}{T1}{a}{228}
2003 \DeclareTextComposite{\r}{T1}{a}{229}
2004 \DeclareTextComposite{\c}{T1}{c}{231}
2005 %    \end{macrocode}
2006 %    "E8 = 232
2007 %    \begin{macrocode}
2008 \DeclareTextComposite{\`}{T1}{e}{232}
2009 \DeclareTextComposite{\'}{T1}{e}{233}
2010 \DeclareTextComposite{\^}{T1}{e}{234}
2011 \DeclareTextComposite{\"}{T1}{e}{235}
2012 \DeclareTextComposite{\`}{T1}{i}{236}
2013 \DeclareTextComposite{\`}{T1}{\i}{236}
2014 \DeclareTextComposite{\'}{T1}{i}{237}
2015 \DeclareTextComposite{\'}{T1}{\i}{237}
2016 \DeclareTextComposite{\^}{T1}{i}{238}
2017 \DeclareTextComposite{\^}{T1}{\i}{238}
2018 \DeclareTextComposite{\"}{T1}{i}{239}
2019 \DeclareTextComposite{\"}{T1}{\i}{239}
2020 %    \end{macrocode}
2021 %    "F0 = 240
2022 %    \begin{macrocode}
2023 \DeclareTextComposite{\~}{T1}{n}{241}
2024 \DeclareTextComposite{\`}{T1}{o}{242}
2025 \DeclareTextComposite{\'}{T1}{o}{243}
2026 \DeclareTextComposite{\^}{T1}{o}{244}
2027 \DeclareTextComposite{\~}{T1}{o}{245}
2028 \DeclareTextComposite{\"}{T1}{o}{246}
2029 %    \end{macrocode}
2030 %    "F8 = 248
2031 %    \begin{macrocode}
2032 \DeclareTextComposite{\`}{T1}{u}{249}
2033 \DeclareTextComposite{\'}{T1}{u}{250}
2034 \DeclareTextComposite{\^}{T1}{u}{251}
2035 \DeclareTextComposite{\"}{T1}{u}{252}
2036 \DeclareTextComposite{\'}{T1}{y}{253}
2037 %    \end{macrocode}
2038 % \changes{v1.99b}{2004/01/03}{Added composites for \cs{k} (pr/3532)}
2039 %    \begin{macrocode}
2040 \DeclareTextCompositeCommand{\k}{T1}{o}{\textogonekcentered{o}}
2041 \DeclareTextCompositeCommand{\k}{T1}{O}{\textogonekcentered{O}}
2042 %    \end{macrocode}
2044 %    \begin{macrocode}
2045 %</T1>
2046 %    \end{macrocode}
2048 % \changes{1.4a}{1994/05/01}{Removed the uc/lc table settings, since
2049 %    the T1 uc/lc table is now the default.}
2051 % \subsection{Definitions for the OMS encoding}
2053 % \changes{v1.6a}{1994/10/25}{Added the OMS encoding.}
2054 % \changes{v1.6b}{1994/10/27}{Renamed \cs{textlbrace} to
2055 %    \cs{textbraceleft} and \cs{textrbrace} to \cs{textbraceright}.}
2056 % \changes{v1.6b}{1994/10/27}{Added \cs{textbackslash}.}
2057 % \changes{v1.6d}{1994/10/30}{Added \cs{textcircled}.}
2059 % The definitions for the `\TeX{} math symbol' (OMS) encoding.  Even
2060 % though this is meant to be a math font, it includes some of the
2061 % standard \LaTeX{} text symbols.
2063 %    Declare the encoding.
2064 %    \begin{macrocode}
2065 %<*OMS>
2066 \DeclareFontEncoding{OMS}{}{}
2067 %    \end{macrocode}
2068 %    Declare the symbols.
2069 % \changes{v1.7t}{1995/11/29}{Added \cs{textbackslash} and
2070 %    \cs{textbar}.}
2071 % \changes{v1.8c}{1996/10/27}
2072 %      {Added \cs{textasteriskcentered}}
2073 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
2074 %    (pr/3160)}
2075 % \changes{v1.95}{2002/06/16}{Added \cs{textbardbl} (pr/3400)}
2076 %    \begin{macrocode}
2077 % \changes{v1.99}{2004/02/02}{Added \cs{textbigcircle}}
2078 %    Note that slot 13 has in places been named |\Orb|: please root
2079 %    out and destroy this impolity wherever you find it!
2080 %    \begin{macrocode}
2081 \DeclareTextSymbol{\textasteriskcentered}{OMS}{3}   % "03
2082 \DeclareTextSymbol{\textbackslash}{OMS}{110}        % "6E
2083 \DeclareTextSymbol{\textbar}{OMS}{106}              % "6A
2084 \DeclareTextSymbol{\textbardbl}{OMS}{107}           % "6B
2085 \DeclareTextSymbol{\textbraceleft}{OMS}{102}        % "66
2086 \DeclareTextSymbol{\textbraceright}{OMS}{103}       % "67
2087 \DeclareTextSymbol{\textbullet}{OMS}{15}            % "0F
2088 \DeclareTextSymbol{\textdaggerdbl}{OMS}{122}        % "7A
2089 \DeclareTextSymbol{\textdagger}{OMS}{121}           % "79
2090 \DeclareTextSymbol{\textparagraph}{OMS}{123}        % "7B
2091 \DeclareTextSymbol{\textperiodcentered}{OMS}{1}     % "01
2092 \DeclareTextSymbol{\textsection}{OMS}{120}          % "78
2093 \DeclareTextSymbol{\textbigcircle}{OMS}{13}         % "0D
2094 \DeclareTextCommand{\textcircled}{OMS}[1]{\hmode@bgroup
2095    \ooalign{%
2096       \hfil \raise .07ex\hbox {\upshape#1}\hfil \crcr
2097       \char 13 % "0D
2098    }%
2099  \egroup}
2100 %</OMS>
2101 %    \end{macrocode}
2103 % \subsection{Definitions for the OML encoding}
2105 % \changes{v1.6d}{1994/10/30}{Added the OML encoding.}
2107 % The definitions for the `\TeX{} math italic' (OML) encoding.  Even
2108 % though this is meant to be a math font, it includes some of the
2109 % standard \LaTeX{} text symbols.
2111 %    Declare the encoding.
2112 %    \begin{macrocode}
2113 %<*OML>
2114 \DeclareFontEncoding{OML}{}{}
2115 %    \end{macrocode}
2116 %    Declare the symbols.
2117 % \changes{v1.7t}{1995/11/29}{Added \cs{textless} and
2118 %    \cs{textgreater}.}
2119 % \changes{v1.9h}{1997/12/17}{Changed to decimal codes.}
2120 % \changes{v1.9m}{1998/01/16}{fixed decimal codes. latex/2734}
2121 %    \begin{macrocode}
2122 \DeclareTextSymbol{\textless}{OML}{`\<}
2123 \DeclareTextSymbol{\textgreater}{OML}{`\>}
2124 \DeclareTextAccent{\t}{OML}{127}  % "7F
2125 %</OML>
2126 %    \end{macrocode}
2128 % \subsection{Definitions for the OT4 encoding}
2130 % These definitions are for the Polish extension to the
2131 % `\TeX\ text' (OT1) encoding.
2132 % This encoding was created by B.~Jackowski and M.~Ry\'cko
2133 % for use with the Polish version of Computer Modern and Computer
2134 % Concrete.  In positions 0--127 it is identical to OT1 but it
2135 % contains some additional characters in the upper half.  The \LaTeX{}
2136 % support was developed by Mariusz Olko.
2138 % The PL fonts that use it are available as follows:\\
2139 % Metafont sources
2140 % \texttt{ftp://ftp.gust.org.pl/TeX/language/polish/pl-mf.zip};
2142 % Font files
2143 % \texttt{ftp://ftp.gust.org.pl/TeX/language/polish/pl-tfm.zip}.
2145 %    Declare the encoding.
2146 %    \begin{macrocode}
2147 %<*OT4>
2148 \DeclareFontEncoding{OT4}{}{}
2149 \DeclareFontSubstitution{OT4}{cmr}{m}{n}
2150 %    \end{macrocode}
2151 %    Declare the accents.
2152 %    \begin{macrocode}
2153 \DeclareTextAccent{\"}{OT4}{127}
2154 \DeclareTextAccent{\'}{OT4}{19}
2155 \DeclareTextAccent{\.}{OT4}{95}
2156 \DeclareTextAccent{\=}{OT4}{22}
2157 \DeclareTextAccent{\^}{OT4}{94}
2158 \DeclareTextAccent{\`}{OT4}{18}
2159 \DeclareTextAccent{\~}{OT4}{126}
2160 \DeclareTextAccent{\H}{OT4}{125}
2161 \DeclareTextAccent{\u}{OT4}{21}
2162 \DeclareTextAccent{\v}{OT4}{20}
2163 \DeclareTextAccent{\r}{OT4}{23}
2164 %    \end{macrocode}
2165 %    The ogonek accent is available only under a e A \& E.  But we
2166 %    have to provide some definition for \cs{k}. Some other accents
2167 %    have to be built by hand as in OT1:
2168 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
2169 %    (pr/3160)}
2170 %    \begin{macrocode}
2171 \DeclareTextCommand{\k}{OT4}[1]{%
2172     \TextSymbolUnavailable{\k{#1}}#1}
2173 %    \end{macrocode}
2174 %  In these definitions we no longer use the helper function |\sh@ft|
2175 %  from plain.tex since that now has two incompatible definitions.
2176 % \changes{v1.99g}{2005/09/27}{Replace \cs{sh@ft} by \cs{ltx@sh@ft}}
2177 %    \begin{macrocode}
2178 \DeclareTextCommand{\b}{OT4}[1]
2179    {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-3ex}%
2180      \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}\egroup}
2181 \DeclareTextCommand{\c}{OT4}[1]
2182    {\leavevmode\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent24 #1%
2183     \else{\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}}\fi}
2184 \DeclareTextCommand{\d}{OT4}[1]
2185    {\hmode@bgroup
2186     \o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-1ex}.\hidewidth}\egroup}
2187 %    \end{macrocode}
2188 %    Declare the text symbols.
2189 %    \begin{macrocode}
2190 \DeclareTextSymbol{\AE}{OT4}{29}
2191 \DeclareTextSymbol{\OE}{OT4}{30}
2192 \DeclareTextSymbol{\O}{OT4}{31}
2193 \DeclareTextSymbol{\L}{OT4}{138}
2194 \DeclareTextSymbol{\ae}{OT4}{26}
2195 \DeclareTextSymbol{\guillemotleft}{OT4}{174}
2196 \DeclareTextSymbol{\guillemotright}{OT4}{175}
2197 \DeclareTextSymbol{\i}{OT4}{16}
2198 \DeclareTextSymbol{\j}{OT4}{17}
2199 \DeclareTextSymbol{\l}{OT4}{170}
2200 \DeclareTextSymbol{\o}{OT4}{28}
2201 \DeclareTextSymbol{\oe}{OT4}{27}
2202 \DeclareTextSymbol{\quotedblbase}{OT4}{255}
2203 \DeclareTextSymbol{\ss}{OT4}{25}
2204 \DeclareTextSymbol{\textemdash}{OT4}{124}
2205 \DeclareTextSymbol{\textendash}{OT4}{123}
2206 \DeclareTextSymbol{\textexclamdown}{OT4}{60}
2207 %\DeclareTextSymbol{\texthyphenchar}{OT4}{`\-}
2208 %\DeclareTextSymbol{\texthyphen}{OT4}{`\-}
2209 \DeclareTextSymbol{\textquestiondown}{OT4}{62}
2210 \DeclareTextSymbol{\textquotedblleft}{OT4}{92}
2211 \DeclareTextSymbol{\textquotedblright}{OT4}{`\"}
2212 \DeclareTextSymbol{\textquoteleft}{OT4}{`\`}
2213 \DeclareTextSymbol{\textquoteright}{OT4}{`\'}
2214 %    \end{macrocode}
2215 %    Definition for \r A as in OT1:
2216 % \changes{v1.96}{2002/10/28}{%
2217 %   coding change, to follow bug fix by DEK in plain.tex (pr/3469)}
2218 %    \begin{macrocode}
2219 \DeclareTextCompositeCommand{\r}{OT4}{A}
2220    {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex%
2221     \rlap{\raise.67\dimen@\hbox{\char23}}A}
2222 %    \end{macrocode}
2223 %    In the OT4 encoding, \pounds~and \$ share a slot.
2224 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
2225 %    (pr/3160)}
2226 %    \begin{macrocode}
2227 \DeclareTextCommand{\textdollar}{OT4}{\hmode@bgroup
2228    \ifdim \fontdimen\@ne\font >\z@
2229       \slshape
2230    \else
2231       \upshape
2232    \fi
2233    \char`\$\egroup}
2234 \DeclareTextCommand{\textsterling}{OT4}{\hmode@bgroup
2235    \ifdim \fontdimen\@ne\font >\z@
2236       \itshape
2237    \else
2238       \fontshape{ui}\selectfont
2239    \fi
2240    \char`\$\egroup}
2241 %    \end{macrocode}
2242 %    Declare the composites.
2243 %    \begin{macrocode}
2244 \DeclareTextComposite{\k}{OT4}{A}{129}
2245 \DeclareTextComposite{\'}{OT4}{C}{130}
2246 \DeclareTextComposite{\k}{OT4}{E}{134}
2247 \DeclareTextComposite{\'}{OT4}{N}{139}
2248 \DeclareTextComposite{\'}{OT4}{S}{145}
2249 \DeclareTextComposite{\'}{OT4}{Z}{153}
2250 \DeclareTextComposite{\.}{OT4}{Z}{155}
2251 \DeclareTextComposite{\k}{OT4}{a}{161}
2252 \DeclareTextComposite{\'}{OT4}{c}{162}
2253 \DeclareTextComposite{\k}{OT4}{e}{166}
2254 \DeclareTextComposite{\'}{OT4}{n}{171}
2255 \DeclareTextComposite{\'}{OT4}{s}{177}
2256 \DeclareTextComposite{\'}{OT4}{z}{185}
2257 \DeclareTextComposite{\.}{OT4}{z}{187}
2258 \DeclareTextComposite{\'}{OT4}{O}{211}
2259 \DeclareTextComposite{\'}{OT4}{o}{243}
2260 %</OT4>
2261 %    \end{macrocode}
2264 % \subsection{Definitions for the TS1 encoding}
2266 % \changes{v1.9c}{1997/05/04}{Added TS1 encoding v2.2.beta}
2267 % \changes{v1.9g}{1997/11/23}
2268 %    {Use \cs{textperthousand}, \cs{textpertenthousand} and
2269 %          \cs{textfractionsolidus} not
2270 %         \cs{textpermill}, \cs{textpertenmill} and \cs{textfraction}.
2271 %         /2673 }
2272 % \changes{v1.9h}{1997/12/17}
2273 %     {Removed default settings, see next section.}
2275 %    \begin{macrocode}
2276 %<*TS1>
2277 \DeclareFontEncoding{TS1}{}{}
2278 \DeclareFontSubstitution{TS1}{cmr}{m}{n}
2279 %    \end{macrocode}
2280 %    Some accents have to be built by hand.
2281 %    Note that |\ooalign| and |\o@lign| must be inside a group.
2282 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
2283 %    (pr/3160)}
2284 %    \begin{macrocode}
2285 \DeclareTextCommand{\capitalcedilla}{TS1}[1]
2286    {\hmode@bgroup
2287     \ooalign{\null#1\crcr\hidewidth\char11\hidewidth}\egroup}
2288 \DeclareTextCommand{\capitalogonek}{TS1}[1]
2289    {\hmode@bgroup
2290     \ooalign{\null#1\crcr\hidewidth\char12\hidewidth}\egroup}
2291 %    \end{macrocode}
2293 % Accents for capital letters.
2295 % These commands can be used by the end user either directly or through
2296 % definitions of the type
2297 % \begin{verbatim}
2298 % \DeclareTextCompositeCommand{\'}{T1}{X}{\capitalacute X}
2299 % \end{verbatim}
2300 % None of the latter definitions are provided by default, since they
2301 % are probably rarely used.
2303 %    "00 = 0
2304 %    \begin{macrocode}
2305 \DeclareTextAccent{\capitalgrave}{TS1}{0}
2306 \DeclareTextAccent{\capitalacute}{TS1}{1}
2307 \DeclareTextAccent{\capitalcircumflex}{TS1}{2}
2308 \DeclareTextAccent{\capitaltilde}{TS1}{3}
2309 \DeclareTextAccent{\capitaldieresis}{TS1}{4}
2310 \DeclareTextAccent{\capitalhungarumlaut}{TS1}{5}
2311 \DeclareTextAccent{\capitalring}{TS1}{6}
2312 \DeclareTextAccent{\capitalcaron}{TS1}{7}
2313 %    \end{macrocode}
2314 %    "08 = 8
2315 %    \begin{macrocode}
2316 \DeclareTextAccent{\capitalbreve}{TS1}{8}
2317 \DeclareTextAccent{\capitalmacron}{TS1}{9}
2318 \DeclareTextAccent{\capitaldotaccent}{TS1}{10}
2319 %    \end{macrocode}
2320 % Tie accents.
2322 % The tie accent was borrowed from the |cmmi| font. The tc fonts
2323 % now provide four tie accents, the first two are done in the
2324 % classical way with assymetric glyphs hanging out of their boxes;
2325 % the new ties are centered in their boxes like all other accents.
2326 % They need a name: please tell us if you know what to call them.
2328 %    " =
2329 %    \begin{macrocode}
2330 \DeclareTextAccent{\t}{TS1}{26}
2331 \DeclareTextAccent{\capitaltie}{TS1}{27}
2332 \DeclareTextAccent{\newtie}{TS1}{28}
2333 \DeclareTextAccent{\capitalnewtie}{TS1}{29}
2334 %    \end{macrocode}
2336 % Compund word marks.
2338 % The text companion fonts contain two compound word marks of
2339 % different heights, one has |cap_height|, the other |asc_height|.
2341 %    \begin{macrocode}
2342 \DeclareTextSymbol{\textcapitalcompwordmark}{TS1}{23}
2343 \DeclareTextSymbol{\textascendercompwordmark}{TS1}{31}
2344 %    \end{macrocode}
2346 % The text companion symbols.
2348 %    \begin{macrocode}
2349 \DeclareTextSymbol{\textquotestraightbase}{TS1}{13}
2350 %    \end{macrocode}
2351 %    "10 = 16
2352 %    \begin{macrocode}
2353 \DeclareTextSymbol{\textquotestraightdblbase}{TS1}{18}
2354 \DeclareTextSymbol{\texttwelveudash}{TS1}{21}
2355 \DeclareTextSymbol{\textthreequartersemdash}{TS1}{22}
2356 %    \end{macrocode}
2357 %    "18 = 24
2358 %    \begin{macrocode}
2359 \DeclareTextSymbol{\textleftarrow}{TS1}{24}
2360 \DeclareTextSymbol{\textrightarrow}{TS1}{25}
2361 %    \end{macrocode}
2362 %    "20 = 32
2363 %    \begin{macrocode}
2364 \DeclareTextSymbol{\textblank}{TS1}{32}
2365 \DeclareTextSymbol{\textdollar}{TS1}{36}
2366 \DeclareTextSymbol{\textquotesingle}{TS1}{39}
2367 %    \end{macrocode}
2368 %    "28 = 40
2369 %    \begin{macrocode}
2370 \DeclareTextSymbol{\textasteriskcentered}{TS1}{42}
2371 %    \end{macrocode}
2372 % Note that '054 is a comma and '056 is a full stop: these make
2373 % numbers using oldstyle digits easier to input.
2374 %    \begin{macrocode}
2375 \DeclareTextSymbol{\textdblhyphen}{TS1}{45}
2376 \DeclareTextSymbol{\textfractionsolidus}{TS1}{47}
2377 %    \end{macrocode}
2379 % Oldstyle digits.
2381 %    "30 = 48
2382 %    \begin{macrocode}
2383 \DeclareTextSymbol{\textzerooldstyle}{TS1}{48}
2384 \DeclareTextSymbol{\textoneoldstyle}{TS1}{49}
2385 \DeclareTextSymbol{\texttwooldstyle}{TS1}{50}
2386 \DeclareTextSymbol{\textthreeoldstyle}{TS1}{51}
2387 \DeclareTextSymbol{\textfouroldstyle}{TS1}{52}
2388 \DeclareTextSymbol{\textfiveoldstyle}{TS1}{53}
2389 \DeclareTextSymbol{\textsixoldstyle}{TS1}{54}
2390 \DeclareTextSymbol{\textsevenoldstyle}{TS1}{55}
2391 %    \end{macrocode}
2392 %    "38 = 56
2393 %    \begin{macrocode}
2394 \DeclareTextSymbol{\texteightoldstyle}{TS1}{56}
2395 \DeclareTextSymbol{\textnineoldstyle}{TS1}{57}
2396 %    \end{macrocode}
2398 % More text companion symbols.
2400 %    \begin{macrocode}
2401 \DeclareTextSymbol{\textlangle}{TS1}{60}
2402 \DeclareTextSymbol{\textminus}{TS1}{61}
2403 \DeclareTextSymbol{\textrangle}{TS1}{62}
2404 %    \end{macrocode}
2405 %    "48 = 72
2406 %    \begin{macrocode}
2407 \DeclareTextSymbol{\textmho}{TS1}{77}
2408 %    \end{macrocode}
2410 % \changes{v1.9r}{1999/01/06}{Minor documentation fix.}
2411 % The big circle is here to define the command \cs{textcircled}.
2412 % Formerly it was taken from the |cmsy| font.
2413 % \changes{v1.9h}{1997/12/17}{Changed to decimal codes in \cs{ooalign}.}
2414 % \changes{v1.9k}{1998/01/12}{Adding missing braces and \cs{ushape}.}
2415 % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
2416 %    (pr/3160)}
2417 %    \begin{macrocode}
2418 \DeclareTextSymbol{\textbigcircle}{TS1}{79}
2419 \DeclareTextCommand{\textcircled}{TS1}[1]{\hmode@bgroup
2420    \ooalign{%
2421       \hfil \raise .07ex\hbox {\upshape#1}\hfil \crcr
2422       \char 79   % '117 = "4F
2423    }%
2424  \egroup}
2425 %    \end{macrocode}
2427 % More text companion symbols.
2429 %    "50 = 80
2430 %    \begin{macrocode}
2431 \DeclareTextSymbol{\textohm}{TS1}{87}
2432 %    \end{macrocode}
2433 %    "58 = 88
2434 %    \begin{macrocode}
2435 \DeclareTextSymbol{\textlbrackdbl}{TS1}{91}
2436 \DeclareTextSymbol{\textrbrackdbl}{TS1}{93}
2437 \DeclareTextSymbol{\textuparrow}{TS1}{94}
2438 \DeclareTextSymbol{\textdownarrow}{TS1}{95}
2439 %    \end{macrocode}
2440 %    "60 = 96
2441 %    \begin{macrocode}
2442 \DeclareTextSymbol{\textasciigrave}{TS1}{96}
2443 \DeclareTextSymbol{\textborn}{TS1}{98}
2444 \DeclareTextSymbol{\textdivorced}{TS1}{99}
2445 \DeclareTextSymbol{\textdied}{TS1}{100}
2446 %    \end{macrocode}
2447 %    "68 = 104
2448 %    \begin{macrocode}
2449 \DeclareTextSymbol{\textleaf}{TS1}{108}
2450 \DeclareTextSymbol{\textmarried}{TS1}{109}
2451 \DeclareTextSymbol{\textmusicalnote}{TS1}{110}
2452 %    \end{macrocode}
2453 %    "78 = 120
2454 %    \begin{macrocode}
2455 \DeclareTextSymbol{\texttildelow}{TS1}{126}
2456 %    \end{macrocode}
2458 % This glyph, |\textdblhyphenchar| is hanging, like the hyphenchar of
2459 % the ec fonts.
2461 %    \begin{macrocode}
2462 \DeclareTextSymbol{\textdblhyphenchar}{TS1}{127}
2463 %    \end{macrocode}
2464 %    "80 = 128
2465 %    \begin{macrocode}
2466 \DeclareTextSymbol{\textasciibreve}{TS1}{128}
2467 \DeclareTextSymbol{\textasciicaron}{TS1}{129}
2468 %    \end{macrocode}
2470 % This next glyph is \emph{not} the same as |\textquotedbl|.
2472 % \changes{v1.9p}{1998/06/12}{Corrected 130 and 131, see pr/2834}
2473 %    \begin{macrocode}
2474 \DeclareTextSymbol{\textacutedbl}{TS1}{130}
2475 \DeclareTextSymbol{\textgravedbl}{TS1}{131}
2476 \DeclareTextSymbol{\textdagger}{TS1}{132}
2477 \DeclareTextSymbol{\textdaggerdbl}{TS1}{133}
2478 \DeclareTextSymbol{\textbardbl}{TS1}{134}
2479 \DeclareTextSymbol{\textperthousand}{TS1}{135}
2480 %    \end{macrocode}
2481 %    "88 = 136
2482 %    \begin{macrocode}
2483 \DeclareTextSymbol{\textbullet}{TS1}{136}
2484 \DeclareTextSymbol{\textcelsius}{TS1}{137}
2485 \DeclareTextSymbol{\textdollaroldstyle}{TS1}{138}
2486 \DeclareTextSymbol{\textcentoldstyle}{TS1}{139}
2487 \DeclareTextSymbol{\textflorin}{TS1}{140}
2488 \DeclareTextSymbol{\textcolonmonetary}{TS1}{141}
2489 \DeclareTextSymbol{\textwon}{TS1}{142}
2490 \DeclareTextSymbol{\textnaira}{TS1}{143}
2491 %    \end{macrocode}
2492 %    "90 = 144
2493 %    \begin{macrocode}
2494 \DeclareTextSymbol{\textguarani}{TS1}{144}
2495 \DeclareTextSymbol{\textpeso}{TS1}{145}
2496 \DeclareTextSymbol{\textlira}{TS1}{146}
2497 \DeclareTextSymbol{\textrecipe}{TS1}{147}
2498 \DeclareTextSymbol{\textinterrobang}{TS1}{148}
2499 \DeclareTextSymbol{\textinterrobangdown}{TS1}{149}
2500 \DeclareTextSymbol{\textdong}{TS1}{150}
2501 \DeclareTextSymbol{\texttrademark}{TS1}{151}
2502 %    \end{macrocode}
2503 %    "98 = 152
2504 %    \begin{macrocode}
2505 \DeclareTextSymbol{\textpertenthousand}{TS1}{152}
2506 \DeclareTextSymbol{\textpilcrow}{TS1}{153}
2507 \DeclareTextSymbol{\textbaht}{TS1}{154}
2508 \DeclareTextSymbol{\textnumero}{TS1}{155}
2509 %    \end{macrocode}
2510 % This next name may change.
2511 % For the following sign we know only a german name, which is
2512 % abz\"uglich. The meaning is something like ``commercial minus''.
2513 % An ASCII ersatz is ./. (dot slash dot).
2514 % The temporary English name is |\textdiscount|.
2515 %    \begin{macrocode}
2516 \DeclareTextSymbol{\textdiscount}{TS1}{156}
2517 \DeclareTextSymbol{\textestimated}{TS1}{157}
2518 \DeclareTextSymbol{\textopenbullet}{TS1}{158}
2519 \DeclareTextSymbol{\textservicemark}{TS1}{159}
2520 %    \end{macrocode}
2521 %    "A0 = 160
2522 %    \begin{macrocode}
2523 \DeclareTextSymbol{\textlquill}{TS1}{160}
2524 \DeclareTextSymbol{\textrquill}{TS1}{161}
2525 \DeclareTextSymbol{\textcent}{TS1}{162}
2526 \DeclareTextSymbol{\textsterling}{TS1}{163}
2527 \DeclareTextSymbol{\textcurrency}{TS1}{164}
2528 \DeclareTextSymbol{\textyen}{TS1}{165}
2529 \DeclareTextSymbol{\textbrokenbar}{TS1}{166}
2530 \DeclareTextSymbol{\textsection}{TS1}{167}
2531 %    \end{macrocode}
2532 %    "A8 = 168
2533 %    \begin{macrocode}
2534 \DeclareTextSymbol{\textasciidieresis}{TS1}{168}
2535 \DeclareTextSymbol{\textcopyright}{TS1}{169}
2536 \DeclareTextSymbol{\textordfeminine}{TS1}{170}
2537 \DeclareTextSymbol{\textcopyleft}{TS1}{171}
2538 \DeclareTextSymbol{\textlnot}{TS1}{172}
2539 %    \end{macrocode}
2541 % The meaning of the circled-P is ``sound recording copyright''.
2543 % \changes{v1.9p}{1998/06/12}{Renamed \cs{textmacron} pr/2840}
2544 %    \begin{macrocode}
2545 \DeclareTextSymbol{\textcircledP}{TS1}{173}
2546 \DeclareTextSymbol{\textregistered}{TS1}{174}
2547 \DeclareTextSymbol{\textasciimacron}{TS1}{175}
2548 %    \end{macrocode}
2549 %    "B0 = 176
2550 %    \begin{macrocode}
2551 \DeclareTextSymbol{\textdegree}{TS1}{176}
2552 \DeclareTextSymbol{\textpm}{TS1}{177}
2553 \DeclareTextSymbol{\texttwosuperior}{TS1}{178}
2554 \DeclareTextSymbol{\textthreesuperior}{TS1}{179}
2555 \DeclareTextSymbol{\textasciiacute}{TS1}{180}
2556 \DeclareTextSymbol{\textmu}{TS1}{181} % micro sign
2557 \DeclareTextSymbol{\textparagraph}{TS1}{182}
2558 \DeclareTextSymbol{\textperiodcentered}{TS1}{183}
2559 %    \end{macrocode}
2560 %    "B8 = 184
2561 %    \begin{macrocode}
2562 \DeclareTextSymbol{\textreferencemark}{TS1}{184}
2563 \DeclareTextSymbol{\textonesuperior}{TS1}{185}
2564 \DeclareTextSymbol{\textordmasculine}{TS1}{186}
2565 \DeclareTextSymbol{\textsurd}{TS1}{187}
2566 \DeclareTextSymbol{\textonequarter}{TS1}{188}
2567 \DeclareTextSymbol{\textonehalf}{TS1}{189}
2568 \DeclareTextSymbol{\textthreequarters}{TS1}{190}
2569 \DeclareTextSymbol{\texteuro}{TS1}{191}
2570 %    \end{macrocode}
2571 %    "E0 = 208
2572 %    \begin{macrocode}
2573 \DeclareTextSymbol{\texttimes}{TS1}{214}
2574 %    \end{macrocode}
2575 %    "F0 = 240
2576 %    \begin{macrocode}
2577 \DeclareTextSymbol{\textdiv}{TS1}{246}
2578 %</TS1>
2579 %    \end{macrocode}
2581 % \section{Package files}
2583 % \changes{v1.9h}{1997/12/17}{Added section.}
2584 % \changes{v1.9h}{1997/12/17}{Added code for textcomp.sty.}
2585 %    This file now also contains some packages that provide access to
2586 %    the more specialised encodings.
2588 % \subsection{The fontenc package}
2590 % \changes{v1.5c}{1994/05/14}{Added the fontenc package}
2591 % \changes{v1.5g}{1994/05/16}{Removed the lowercasing of the filename.}
2592 % \changes{v1.7a}{1994/11/30}{Always load the enc.def file, so that
2593 %    the default encoding for the commands will change.}
2594 % \changes{v1.7x}{1996/05/18}{Produce error if encoding not found.
2595 %                             pr/2054}
2596 % \changes{v1.7y}{1996/05/21}{Corrected error message (CAR)}
2597 % \changes{v1.8d}{1996/11/18}
2598 %     {(DPC) lowercase external file names. internal/1044}%
2599 % This package allows authors to specify which encodings they will use.
2600 % For each encoding |FOO|, the package looks to see if the encoding
2601 % |FOO| has already been declared.  If it has not, the file |fooenc.def|
2602 % is loaded.  The default encoding is set to be |FOO|.
2604 % In addition the package at the moment contains extra code to extend
2605 % the |\@uclclist| (list of upper/lower case pairs) for encodings that
2606 % involve cyrillic characters. THIS IS A TEMPORARY SOLUTION and will not
2607 % stay this way forever (or so we hope) but right now we are missing a
2608 % proper interface for this and didn't wanted to rush it.
2609 % \changes{v1.9r}{1999/01/07}{Hackery to temp support cyrillic uc/lc}
2610 % \changes{v1.9t}{1999/02/24}{Corrected hackery cyrillic uc/lc list}
2611 % \changes{v1.9x}{1999/12/08}{Changed \cs{CYRRHOOK} and  \cs{cyrrhook}
2612 %    to\cs{CYRRHK} and  \cs{cyrrhk} as name changed in the cyrillic
2613 %    bundle for naming consistency with other ``hook'' glyphs.}
2614 %    \begin{macrocode}
2615 %<*package>
2616 %    \end{macrocode}
2618 % Here we define a macro that extends the |\@uclclist| if needed and
2619 % afterwards turns itself in a noop.
2620 %    \begin{macrocode}
2621 \def\update@uclc@with@cyrillic{%
2622  \expandafter\def\expandafter\@uclclist\expandafter
2623   {\@uclclist
2624   \cyra\CYRA\cyrabhch\CYRABHCH\cyrabhchdsc\CYRABHCHDSC\cyrabhdze
2625   \CYRABHDZE\cyrabhha\CYRABHHA\cyrae\CYRAE\cyrb\CYRB\cyrbyus
2626   \CYRBYUS\cyrc\CYRC\cyrch\CYRCH\cyrchldsc\CYRCHLDSC\cyrchrdsc
2627   \CYRCHRDSC\cyrchvcrs\CYRCHVCRS\cyrd\CYRD\cyrdelta\CYRDELTA
2628   \cyrdje\CYRDJE\cyrdze\CYRDZE\cyrdzhe\CYRDZHE\cyre\CYRE\cyreps
2629   \CYREPS\cyrerev\CYREREV\cyrery\CYRERY\cyrf\CYRF\cyrfita
2630   \CYRFITA\cyrg\CYRG\cyrgdsc\CYRGDSC\cyrgdschcrs\CYRGDSCHCRS
2631   \cyrghcrs\CYRGHCRS\cyrghk\CYRGHK\cyrgup\CYRGUP\cyrh\CYRH
2632   \cyrhdsc\CYRHDSC\cyrhhcrs\CYRHHCRS\cyrhhk\CYRHHK\cyrhrdsn
2633   \CYRHRDSN\cyri\CYRI\cyrie\CYRIE\cyrii\CYRII\cyrishrt\CYRISHRT
2634   \cyrishrtdsc\CYRISHRTDSC\cyrizh\CYRIZH\cyrje\CYRJE\cyrk\CYRK
2635   \cyrkbeak\CYRKBEAK\cyrkdsc\CYRKDSC\cyrkhcrs\CYRKHCRS\cyrkhk
2636   \CYRKHK\cyrkvcrs\CYRKVCRS\cyrl\CYRL\cyrldsc\CYRLDSC\cyrlhk
2637   \CYRLHK\cyrlje\CYRLJE\cyrm\CYRM\cyrmdsc\CYRMDSC\cyrmhk\CYRMHK
2638   \cyrn\CYRN\cyrndsc\CYRNDSC\cyrng\CYRNG\cyrnhk\CYRNHK\cyrnje
2639   \CYRNJE\cyrnlhk\CYRNLHK\cyro\CYRO\cyrotld\CYROTLD\cyrp\CYRP
2640   \cyrphk\CYRPHK\cyrq\CYRQ\cyrr\CYRR\cyrrdsc\CYRRDSC\cyrrhk
2641   \CYRRHK\cyrrtick\CYRRTICK\cyrs\CYRS\cyrsacrs\CYRSACRS
2642   \cyrschwa\CYRSCHWA\cyrsdsc\CYRSDSC\cyrsemisftsn\CYRSEMISFTSN
2643   \cyrsftsn\CYRSFTSN\cyrsh\CYRSH\cyrshch\CYRSHCH\cyrshha\CYRSHHA
2644   \cyrt\CYRT\cyrtdsc\CYRTDSC\cyrtetse\CYRTETSE\cyrtshe\CYRTSHE
2645   \cyru\CYRU\cyrushrt\CYRUSHRT\cyrv\CYRV\cyrw\CYRW\cyry\CYRY
2646   \cyrya\CYRYA\cyryat\CYRYAT\cyryhcrs\CYRYHCRS\cyryi\CYRYI\cyryo
2647   \CYRYO\cyryu\CYRYU\cyrz\CYRZ\cyrzdsc\CYRZDSC\cyrzh\CYRZH
2648   \cyrzhdsc\CYRZHDSC}%
2649  \let\update@uclc@with@cyrillic\relax
2651 %    \end{macrocode}
2653 % Here we process each option:
2654 %    \begin{macrocode}
2655 \DeclareOption*{%
2656    \let\encodingdefault\CurrentOption
2657    \edef\reserved@f{%
2658      \lowercase{\def\noexpand\reserved@f{\CurrentOption enc.def}}}%
2659    \reserved@f
2660    \InputIfFileExists\reserved@f
2661         {}{\PackageError{fontenc}%
2662          {Encoding file `\reserved@f' not found.%
2663           \MessageBreak
2664            You might have misspelt the name of the encoding}%
2665          {Necessary code for this encoding was not
2666           loaded.\MessageBreak
2667           Thus calling the encoding later on will
2668           produce further error messages.}}%
2669   \let\reserved@f\relax
2670 %    \end{macrocode}
2672 % In case the current encoding is one of a list of known
2673 % cyrillic ones we extend the |\@uclclist|:
2674 %    \begin{macrocode}
2675   \expandafter\in@\expandafter{\CurrentOption}%
2676                               {T2A,T2B,T2C,X2,LCY,OT2}%
2677   \ifin@
2678 %    \end{macrocode}
2680 % But only if it hasn't already been extended. This might happen if
2681 % there are several calls to fontenc loading one of the above
2682 % encodings. If we don't do this check the |\@uclclist| gets
2683 % unnecessarily big, slowing down the processing at runtime.
2684 % \changes{v1.9v}{1999/06/12}{Extend \cs{@uclclist} only once}
2685 %    \begin{macrocode}
2686      \expandafter\in@\expandafter\cyra\expandafter
2687                               {\@uclclist}%
2688      \ifin@
2689      \else
2690        \update@uclc@with@cyrillic
2691      \fi
2692   \fi
2694 %    \end{macrocode}
2696 %    \begin{macrocode}
2697 \ProcessOptions*
2698 %    \end{macrocode}
2700 %    \begin{macrocode}
2701 \fontencoding\encodingdefault\selectfont
2702 %    \end{macrocode}
2704 % To save some space we get rid of the macro extending the
2705 % |\@uclclist| (might have happened already).
2706 %    \begin{macrocode}
2707 \let\update@uclc@with@cyrillic\relax
2708 %    \end{macrocode}
2710 % Finally we pretend that the fontenc package wasn't read in. This
2711 % allows for using it several times, e.g., in a class file and in the
2712 % preamble (at the cost of not getting any version info).
2713 % That kind of hackery shows that using a general purpose
2714 % package just for loading an encoding is not the right kind
2715 % of interface for setting up encodings --- it will get replaced at
2716 % some point in the future.
2717 % \changes{v1.9r}{1999/01/07}{Hackery to allow using fontenc several
2718 %    times}
2719 % \changes{v1.9u}{1999/06/10}{Ensure that we also forget old options
2720 %                             (pr/2888)}
2721 %    \begin{macrocode}
2722 \global\expandafter\let\csname ver@fontenc.sty\endcsname\relax
2723 \global\expandafter\let\csname opt@fontenc.sty\endcsname\relax
2724 \global\let\@ifl@ter@@\@ifl@ter
2725 \def\@ifl@ter#1#2#3#4#5{\global\let\@ifl@ter\@ifl@ter@@}
2726 %</package>
2727 %    \end{macrocode}
2730 % \subsection{The textcomp package}
2732 %    This one is for the |TS1| encoding which contains text symbols
2733 %    for use with the |T1|-encoded text fonts.  It therefore first
2734 %    inputs the file |TS1enc.def| and then sets (or resets) the
2735 %    defaults for the symbols it contains.  The result of this is that
2736 %    when one of these symbols is accessed and the current encoding
2737 %    does not provide it, the symbol will be supplied by a silent,
2738 %    local change to this encoding.
2740 %    \begin{macrocode}
2741 %<*TS1sty>
2742 %    \end{macrocode}
2743 %    Since many PostScript fonts only implement a subset of |TS1| many
2744 %    commands only produce black blobs of ink. To resolve the
2745 %    resulting problems a number of options have been introduced and
2746 %    some code  has been developed to distinguish sub-encodings.
2748 %    The sub-encodings have a numerical id and are defined as follows
2749 %    for \texttt{TS1}:
2750 % \begin{description}
2752 % \item[\#5] those \texttt{TS1} symbols that are also in the ISO-Adobe
2753 %       character set; without \verb=textcurrency=, which is often
2754 %       misused for the Euro.  Older Type1 fonts from the non-\TeX{}
2755 %       world provide only this subset.
2757 % \item[\#4] = \#5 + \verb=\texteuro=.  Most newer fonts provide this.
2759 % \item[\#3] = \#4 + \verb=\textomega=.  Can also be described as
2760 %       $\texttt{TS1} \cap (\texttt{ISO-Adobe} \cup
2761 %       \texttt{MacRoman})$.  (Except for the missing "currency".)
2764 % \item[\#2] = \#3 + \verb=\textestimated= + \verb=\textcurrency=.  Can
2765 %       also be described as $\texttt{TS1} \cap
2766 %       \texttt{Adobe-Western-2}$.  This may be relevant for OpenType
2767 %       fonts, which usually show the Adobe-Western-2 character set.
2769 %    \item[\#1] = \texttt{TS1} without \verb=\textcircled= and \verb=\t=.
2770 %       These two glyphs are often not implemented and if their kernel
2771 %       defaults are changed commands like \verb=\copyright=
2772 %       unnecessarily fail.
2774 %    \item[\#0] = full \texttt{TS1}
2775 % \end{description}
2777 %    And here a summary to go in the transcript file:
2778 %    \begin{macrocode}
2779 \PackageInfo{textcomp}{Sub-encoding information:\MessageBreak
2780     \space\space 5 = only ISO-Adobe without
2781                               \string\textcurrency\MessageBreak
2782     \space\space 4 = 5 + \string\texteuro\MessageBreak
2783     \space\space 3 = 4 + \string\textohm\MessageBreak
2784     \space\space 2 = 3 + \noexpand\textestimated+ 
2785                                 \string\textcurrency\MessageBreak
2786     \space\space 1 = TS1 - \noexpand\textcircled-
2787                                             \string\t\MessageBreak
2788     \space\space 0 = TS1 (full)\MessageBreak
2789     Font families with sub-encoding setting implement\MessageBreak
2790     only a restricted character set as indicated.\MessageBreak
2791     Family '?' is the default used for unknown fonts.\MessageBreak
2792     See the documentation for details\@gobble}
2793 %    \end{macrocode}
2795 % \begin{macro}{\DeclareEncodingSubset}
2796 %    An encoding subset to which a font family belongs is declared by
2797 %    the command |\DeclareEncodingSubset| that takes the major encoding as the
2798 %    first argument (e.g., |TS1|), the family name as the second
2799 %    argument (e.g., |cmr|), and the subset encoding id as a third,
2800 %    (e.g., |0| for |cmr|).
2802 %    The default encoding subset to use when nothing is known about
2803 %    the current font family is named |?|.
2804 %    \begin{macrocode}
2805 \def\DeclareEncodingSubset#1#2#3{%
2806    \@ifundefined{#1:#2}%
2807      {\PackageInfo{textcomp}{Setting #2 sub-encoding to #1/#3}}%
2808      {\PackageInfo{textcomp}{Changing #2 sub-encoding to #1/#3}}%
2809    \@namedef{#1:#2}{#3}}
2810 \@onlypreamble\DeclareEncodingSubset
2811 %    \end{macrocode}
2812 % \end{macro}
2815 %  The options for the package are the following:
2816 %    \begin{description}
2817 %    \item[safe]
2818 %       for unknown font families enables only symbols that are also
2819 %       in the ISO-Adobe character set; without "currency", which is
2820 %       often misused for the Euro.  Older Type1 fonts from the
2821 %       non-TeX world provide only this subset.
2823 %    \item[euro]
2824 %       enables the ``safe'' symbols plus the |\texteuro|
2825 %       command. Most newer fonts provide this.
2827 %    \item[full] enables all |TS1| commands; useful only with fonts
2828 %       like EC or CM bright.
2830 %    \item[almostfull]
2831 %       same as ``full'', except that |\textcircled|
2832 %       and |\t| are \emph{not} redefined from their defaults to avoid
2833 %       that commands like |\copyright| suddenly no longer work.
2835 %    \item[force]
2836 %       ignore all subset encoding definitions stored in the package
2837 %       itself or in the configuration file and always use the default
2838 %       subset as specified by one of the other options (seldom useful,
2839 %       only dangerous).
2840 %    \end{description}
2842 % \begin{macro}{\iftc@forced}
2843 %    Switch used to implement the \texttt{force} option
2844 %    \begin{macrocode}
2845 \newif\iftc@forced   \tc@forcedfalse
2846 %    \end{macrocode}
2847 % \end{macro}
2849 %    This is implemented by defining the default subset:
2850 %    \begin{macrocode}
2851 \DeclareOption{full}{\DeclareEncodingSubset{TS1}{?}{0}}
2852 \DeclareOption{almostfull}{\DeclareEncodingSubset{TS1}{?}{1}}
2853 \DeclareOption{euro}{\DeclareEncodingSubset{TS1}{?}{4}}
2854 \DeclareOption{safe}{\DeclareEncodingSubset{TS1}{?}{5}}
2855 %    \end{macrocode}
2856 %    The default is ``almostfull'' which means that old documents will
2857 %    work except that |\textcircled| and |\t| will use the kernel
2858 %    defaults (with the advantage that this also works if the current
2859 %    font (as often the case) doesn't implement these glyphs.
2861 %    The ``force'' option simply sets the switch to true.
2862 %    \begin{macrocode}
2863 \DeclareOption{force}{\tc@forcedtrue}
2864 %    \end{macrocode}
2866 %    The suggestions to user is to use the ``safe'' option always
2867 %    unless that balks in which case they could switch to
2868 %    ``almostfull'' but then better check their output manually.
2870 %    \begin{macrocode}
2871 \def\tc@errorwarn{\PackageError}
2872 \DeclareOption{warn}{\gdef\tc@errorwarn#1#2#3{\PackageWarning{#1}{#2}}}
2873 %    \end{macrocode}
2875 %    \begin{macrocode}
2876 \ExecuteOptions{almostfull}
2877 \ProcessOptions\relax
2878 %    \end{macrocode}
2880 % \begin{macro}{\CheckEncodingSubset}
2881 %    The command |\CheckEncodingSubset| will check if the current font
2882 %    family has the right encoding subset to typeset a certain
2883 %    command. It takes five arguments as follows:
2884 %    first argument is either |\UseTextSymbol|, |\UseTextAccent|
2885 %    depending on whether or not the symbol is a text symbol or a text
2886 %    accent.
2888 %    The second argument is the encoding from which this symbol should
2889 %    be fetched.
2891 %    The third argument is either a fake accessor command or an error
2892 %    message. the code in that argument (if ever executed) receives
2893 %    two arguments: |#2| and |#5| of |\CheckEncodingSubset|.
2895 %    Argument four is the subset encoding id to test against: if this
2896 %    value is higher than the subset id of the current font family
2897 %    then we typeset the symbol, i.e., execute |#1{#2}#5| otherwise
2898 %    it runs |#3#5|, e.g., to produce an error message or fake the
2899 %    glyph somehow.
2901 %    Argument five is the symbol or accent command that is being
2902 %    checked.
2904 %    For usage examples see definitions below.
2905 %    \begin{macrocode}
2906 \iftc@forced
2907 %    \end{macrocode}
2908 %    If the ``force'' option was given we always use the default for
2909 %    testing against.
2910 %    \begin{macrocode}
2911 \def\CheckEncodingSubset#1#2#3#4#5{%
2912     \ifnum #4>%
2913         0\csname #2:?\endcsname
2914         \relax
2915    \expandafter\@firstoftwo
2916   \else
2917    \expandafter\@secondoftwo
2918  \fi
2919   {#1{#2}}{#3}%
2920   #5%
2922 %    \end{macrocode}
2923 %    In normal circumstances the test is a bit more complicated: first
2924 %    check if there exists a macro
2925 %    |\|\meta{arg2}|:|\meta{current-family} and if so use that value
2926 %    to test against, otherwise use the default to test against.
2927 %    \begin{macrocode}
2928 \else
2929 \def\CheckEncodingSubset#1#2#3#4#5{%
2930     \ifnum #4>%
2931       \expandafter\ifx\csname #2:\f@family\endcsname\relax
2932         0\csname #2:?\endcsname
2933       \else
2934         \csname #2:\f@family\endcsname
2935       \fi
2936    \relax
2937    \expandafter\@firstoftwo
2938   \else
2939    \expandafter\@secondoftwo
2940  \fi
2941   {#1{#2}}{#3}%
2942   #5%
2945 %    \end{macrocode}
2946 % \end{macro}
2948 % \begin{macro}{tc@subst}
2949 %    \begin{macrocode}
2950 \def\tc@subst#1{%
2951    \tc@errorwarn{textcomp}%  % should be latex error if general
2952     {Symbol \string#1 not provided by\MessageBreak
2953      font family \f@family\space
2954      in TS1 encoding.\MessageBreak Default family used instead}\@eha
2955   \bgroup\fontfamily\textcompsubstdefault\selectfont#1\egroup
2957 %    \end{macrocode}
2958 % \end{macro}
2960 % \begin{macro}{\textcompsubstdefault}
2961 %    \begin{macrocode}
2962 \def\textcompsubstdefault{cmr}
2963 %    \end{macrocode}
2964 % \end{macro}
2966 % \begin{macro}{\tc@error}
2967 %    |\tc@error| is going to be used in arg |#3| of
2968 %    |\CheckEncodingSubset| when a symbol is not available in a
2969 %    certain font family. It gets pass the encoding it normally lives
2970 %    in (arg one) and the name of the symbol or accent that has a
2971 %    problem.
2973 %    \begin{macrocode}
2974 % error commands take argument:
2975 % #1 symbol to be used
2976 \def\tc@error#1{%
2977    \PackageError{textcomp}%  % should be latex error if general
2978     {Accent \string#1 not provided by\MessageBreak
2979      font family \f@family\space
2980      in TS1 encoding}\@eha
2982 %    \end{macrocode}
2983 % \end{macro}
2986 % \begin{macro}{\tc@fake@euro}
2987 %    |\tc@fake@euro|  is an example of a ``fake'' definition to use in  arg |#3| of
2988 %    |\CheckEncodingSubset| when a symbol is not available in a
2989 %    certain font family. Here we produce an Euro symbol by combining
2990 %    a ``C'' with a ``=''.
2991 %    \begin{macrocode}
2992 \def\tc@fake@euro#1{%
2993    \leavevmode
2994    \PackageInfo{textcomp}{Faking \noexpand#1for font family
2995                           \f@family\MessageBreak in TS1 encoding}%
2996    \valign{##\cr
2997       \vfil\hbox to 0.07em{\dimen@\f@size\p@
2998                            \math@fontsfalse
2999                            \fontsize{.7\dimen@}\z@\selectfont=\hss}%
3000       \vfil\cr%
3001       \hbox{C}\crcr
3002    }%
3004 %    \end{macrocode}
3005 % \end{macro}
3007 % \begin{macro}{\tc@check@symbol}
3008 % \begin{macro}{\tc@check@accent}
3009 %    These are two abbreviations that we use below to check symbols
3010 %    and accents in TS1. Only there to save some space, e.g., we can
3011 %    then write
3012 %\begin{verbatim}
3013 %\DeclareTextCommandDefault{\textcurrency}{\tc@check@symbol3\textcurrency}
3014 %\end{verbatim}
3015 %    to ensure that |\textcurrency| is only typeset if the current
3016 %    font has a \texttt{TS1} subset id of less than 3. Otherwise
3017 %    |\tc@error| is called telling the user that for this font family
3018 %    |\textcurreny| is not available.
3019 %    \begin{macrocode}
3020 \def\tc@check@symbol{\CheckEncodingSubset\UseTextSymbol{TS1}\tc@subst}
3021 \def\tc@check@accent{\CheckEncodingSubset\UseTextAccent{TS1}\tc@error}
3022 %    \end{macrocode}
3023 % \end{macro}
3024 % \end{macro}
3026 %    We start with the commands that are ``safe'' and which can be
3027 %    unconditionally set up, first the accents\ldots
3028 %    \begin{macrocode}
3029 \DeclareTextAccentDefault{\capitalcedilla}{TS1}
3030 \DeclareTextAccentDefault{\capitalogonek}{TS1}
3031 \DeclareTextAccentDefault{\capitalgrave}{TS1}
3032 \DeclareTextAccentDefault{\capitalacute}{TS1}
3033 \DeclareTextAccentDefault{\capitalcircumflex}{TS1}
3034 \DeclareTextAccentDefault{\capitaltilde}{TS1}
3035 \DeclareTextAccentDefault{\capitaldieresis}{TS1}
3036 \DeclareTextAccentDefault{\capitalhungarumlaut}{TS1}
3037 \DeclareTextAccentDefault{\capitalring}{TS1}
3038 \DeclareTextAccentDefault{\capitalcaron}{TS1}
3039 \DeclareTextAccentDefault{\capitalbreve}{TS1}
3040 \DeclareTextAccentDefault{\capitalmacron}{TS1}
3041 \DeclareTextAccentDefault{\capitaldotaccent}{TS1}
3042 %    \end{macrocode}
3043 %    \ldots and then the other glyphs.
3044 % \changes{v1.9p}{1998/06/12}{Renamed \cs{textmacron} pr/2840}
3045 %    \begin{macrocode}
3046 \DeclareTextSymbolDefault{\textcapitalcompwordmark}{TS1}
3047 \DeclareTextSymbolDefault{\textascendercompwordmark}{TS1}
3048 \DeclareTextSymbolDefault{\textquotestraightbase}{TS1}
3049 \DeclareTextSymbolDefault{\textquotestraightdblbase}{TS1}
3050 \DeclareTextSymbolDefault{\texttwelveudash}{TS1}
3051 \DeclareTextSymbolDefault{\textthreequartersemdash}{TS1}
3052 \DeclareTextSymbolDefault{\textdollar}{TS1}
3053 \DeclareTextSymbolDefault{\textquotesingle}{TS1}
3054 \DeclareTextSymbolDefault{\textasteriskcentered}{TS1}
3055 \DeclareTextSymbolDefault{\textfractionsolidus}{TS1}
3056 \DeclareTextSymbolDefault{\textminus}{TS1}
3057 \DeclareTextSymbolDefault{\textlbrackdbl}{TS1}
3058 \DeclareTextSymbolDefault{\textrbrackdbl}{TS1}
3059 \DeclareTextSymbolDefault{\textasciigrave}{TS1}
3060 \DeclareTextSymbolDefault{\texttildelow}{TS1}
3061 \DeclareTextSymbolDefault{\textasciibreve}{TS1}
3062 \DeclareTextSymbolDefault{\textasciicaron}{TS1}
3063 \DeclareTextSymbolDefault{\textgravedbl}{TS1}
3064 \DeclareTextSymbolDefault{\textacutedbl}{TS1}
3065 \DeclareTextSymbolDefault{\textdagger}{TS1}
3066 \DeclareTextSymbolDefault{\textdaggerdbl}{TS1}
3067 \DeclareTextSymbolDefault{\textbardbl}{TS1}
3068 \DeclareTextSymbolDefault{\textperthousand}{TS1}
3069 \DeclareTextSymbolDefault{\textbullet}{TS1}
3070 \DeclareTextSymbolDefault{\textcelsius}{TS1}
3071 \DeclareTextSymbolDefault{\textflorin}{TS1}
3072 \DeclareTextSymbolDefault{\texttrademark}{TS1}
3073 \DeclareTextSymbolDefault{\textcent}{TS1}
3074 \DeclareTextSymbolDefault{\textsterling}{TS1}
3075 \DeclareTextSymbolDefault{\textyen}{TS1}
3076 \DeclareTextSymbolDefault{\textbrokenbar}{TS1}
3077 \DeclareTextSymbolDefault{\textsection}{TS1}
3078 \DeclareTextSymbolDefault{\textasciidieresis}{TS1}
3079 \DeclareTextSymbolDefault{\textcopyright}{TS1}
3080 \DeclareTextSymbolDefault{\textordfeminine}{TS1}
3081 \DeclareTextSymbolDefault{\textlnot}{TS1}
3082 \DeclareTextSymbolDefault{\textregistered}{TS1}
3083 \DeclareTextSymbolDefault{\textasciimacron}{TS1}
3084 \DeclareTextSymbolDefault{\textdegree}{TS1}
3085 \DeclareTextSymbolDefault{\textpm}{TS1}
3086 \DeclareTextSymbolDefault{\texttwosuperior}{TS1}
3087 \DeclareTextSymbolDefault{\textthreesuperior}{TS1}
3088 \DeclareTextSymbolDefault{\textasciiacute}{TS1}
3089 \DeclareTextSymbolDefault{\textmu}{TS1}
3090 \DeclareTextSymbolDefault{\textparagraph}{TS1}
3091 \DeclareTextSymbolDefault{\textperiodcentered}{TS1}
3092 \DeclareTextSymbolDefault{\textonesuperior}{TS1}
3093 \DeclareTextSymbolDefault{\textordmasculine}{TS1}
3094 \DeclareTextSymbolDefault{\textonequarter}{TS1}
3095 \DeclareTextSymbolDefault{\textonehalf}{TS1}
3096 \DeclareTextSymbolDefault{\textthreequarters}{TS1}
3097 \DeclareTextSymbolDefault{\texttimes}{TS1}
3098 \DeclareTextSymbolDefault{\textdiv}{TS1}
3099 %    \end{macrocode}
3101 %    The |\texteuro| is only available for subsets with id 4 or
3102 %    less. Otherwise we fake the glyph using |\tc@fake@euro|
3103 %    \begin{macrocode}
3104 \DeclareTextCommandDefault{\texteuro}
3105    {\CheckEncodingSubset\UseTextSymbol{TS1}\tc@fake@euro5\texteuro}
3106 %    \end{macrocode}
3108 %    The |\textohm| is only available for subsets with id 3 or
3109 %    less. Otherwise we produce an error.
3110 %    \begin{macrocode}
3111 \DeclareTextCommandDefault{\textohm}{\tc@check@symbol4\textohm}
3112 %    \end{macrocode}
3113 %    The |\textestimated| and |\textcurrency| are only provided for
3114 %    fonts with subset encoding with id 2 or less.
3115 %    \begin{macrocode}
3116 \DeclareTextCommandDefault{\textestimated}%
3117     {\tc@check@symbol3\textestimated}
3118 \DeclareTextCommandDefault{\textcurrency}%
3119     {\tc@check@symbol3\textcurrency}
3120 %    \end{macrocode}
3121 %    Nearly all of the remaining glyphs are provided only with fonts
3122 %    with id 1 or 0, i.e., are essentially complete.
3123 %    \begin{macrocode}
3124 \DeclareTextCommandDefault{\capitaltie}%
3125     {\tc@check@accent2\capitaltie}
3126 \DeclareTextCommandDefault{\newtie}%
3127     {\tc@check@accent2\newtie}
3128 \DeclareTextCommandDefault{\capitalnewtie}%
3129     {\tc@check@accent2\capitalnewtie}
3130 \DeclareTextCommandDefault{\textleftarrow}%
3131     {\tc@check@symbol2\textleftarrow}
3132 \DeclareTextCommandDefault{\textrightarrow}%
3133     {\tc@check@symbol2\textrightarrow}
3134 \DeclareTextCommandDefault{\textblank}%
3135     {\tc@check@symbol2\textblank}
3136 \DeclareTextCommandDefault{\textdblhyphen}%
3137     {\tc@check@symbol2\textdblhyphen}
3138 \DeclareTextCommandDefault{\textzerooldstyle}%
3139     {\tc@check@symbol2\textzerooldstyle}
3140 \DeclareTextCommandDefault{\textoneoldstyle}%
3141     {\tc@check@symbol2\textoneoldstyle}
3142 \DeclareTextCommandDefault{\texttwooldstyle}%
3143     {\tc@check@symbol2\texttwooldstyle}
3144 \DeclareTextCommandDefault{\textthreeoldstyle}%
3145     {\tc@check@symbol2\textthreeoldstyle}
3146 \DeclareTextCommandDefault{\textfouroldstyle}%
3147     {\tc@check@symbol2\textfouroldstyle}
3148 \DeclareTextCommandDefault{\textfiveoldstyle}%
3149     {\tc@check@symbol2\textfiveoldstyle}
3150 \DeclareTextCommandDefault{\textsixoldstyle}%
3151     {\tc@check@symbol2\textsixoldstyle}
3152 \DeclareTextCommandDefault{\textsevenoldstyle}%
3153     {\tc@check@symbol2\textsevenoldstyle}
3154 \DeclareTextCommandDefault{\texteightoldstyle}%
3155     {\tc@check@symbol2\texteightoldstyle}
3156 \DeclareTextCommandDefault{\textnineoldstyle}%
3157     {\tc@check@symbol2\textnineoldstyle}
3158 \DeclareTextCommandDefault{\textlangle}%
3159     {\tc@check@symbol2\textlangle}
3160 \DeclareTextCommandDefault{\textrangle}%
3161     {\tc@check@symbol2\textrangle}
3162 \DeclareTextCommandDefault{\textmho}%
3163     {\tc@check@symbol2\textmho}
3164 \DeclareTextCommandDefault{\textbigcircle}%
3165     {\tc@check@symbol2\textbigcircle}
3166 \DeclareTextCommandDefault{\textuparrow}%
3167     {\tc@check@symbol2\textuparrow}
3168 \DeclareTextCommandDefault{\textdownarrow}%
3169     {\tc@check@symbol2\textdownarrow}
3170 \DeclareTextCommandDefault{\textborn}%
3171     {\tc@check@symbol2\textborn}
3172 \DeclareTextCommandDefault{\textdivorced}%
3173     {\tc@check@symbol2\textdivorced}
3174 \DeclareTextCommandDefault{\textdied}%
3175     {\tc@check@symbol2\textdied}
3176 \DeclareTextCommandDefault{\textleaf}%
3177     {\tc@check@symbol2\textleaf}
3178 \DeclareTextCommandDefault{\textmarried}%
3179     {\tc@check@symbol2\textmarried}
3180 \DeclareTextCommandDefault{\textmusicalnote}%
3181     {\tc@check@symbol2\textmusicalnote}
3182 \DeclareTextCommandDefault{\textdblhyphenchar}%
3183     {\tc@check@symbol2\textdblhyphenchar}
3184 \DeclareTextCommandDefault{\textdollaroldstyle}%
3185     {\tc@check@symbol2\textdollaroldstyle}
3186 \DeclareTextCommandDefault{\textcentoldstyle}%
3187     {\tc@check@symbol2\textcentoldstyle}
3188 \DeclareTextCommandDefault{\textcolonmonetary}%
3189     {\tc@check@symbol2\textcolonmonetary}
3190 \DeclareTextCommandDefault{\textwon}%
3191     {\tc@check@symbol2\textwon}
3192 \DeclareTextCommandDefault{\textnaira}%
3193     {\tc@check@symbol2\textnaira}
3194 \DeclareTextCommandDefault{\textguarani}%
3195     {\tc@check@symbol2\textguarani}
3196 \DeclareTextCommandDefault{\textpeso}%
3197     {\tc@check@symbol2\textpeso}
3198 \DeclareTextCommandDefault{\textlira}%
3199     {\tc@check@symbol2\textlira}
3200 \DeclareTextCommandDefault{\textrecipe}%
3201     {\tc@check@symbol2\textrecipe}
3202 \DeclareTextCommandDefault{\textinterrobang}%
3203     {\tc@check@symbol2\textinterrobang}
3204 \DeclareTextCommandDefault{\textinterrobangdown}%
3205     {\tc@check@symbol2\textinterrobangdown}
3206 \DeclareTextCommandDefault{\textdong}%
3207     {\tc@check@symbol2\textdong}
3208 \DeclareTextCommandDefault{\textpertenthousand}%
3209     {\tc@check@symbol2\textpertenthousand}
3210 \DeclareTextCommandDefault{\textpilcrow}%
3211     {\tc@check@symbol2\textpilcrow}
3212 \DeclareTextCommandDefault{\textbaht}%
3213     {\tc@check@symbol2\textbaht}
3214 \DeclareTextCommandDefault{\textnumero}%
3215     {\tc@check@symbol2\textnumero}
3216 \DeclareTextCommandDefault{\textdiscount}%
3217     {\tc@check@symbol2\textdiscount}
3218 \DeclareTextCommandDefault{\textopenbullet}%
3219     {\tc@check@symbol2\textopenbullet}
3220 \DeclareTextCommandDefault{\textservicemark}%
3221     {\tc@check@symbol2\textservicemark}
3222 \DeclareTextCommandDefault{\textlquill}%
3223     {\tc@check@symbol2\textlquill}
3224 \DeclareTextCommandDefault{\textrquill}%
3225     {\tc@check@symbol2\textrquill}
3226 \DeclareTextCommandDefault{\textcopyleft}%
3227     {\tc@check@symbol2\textcopyleft}
3228 \DeclareTextCommandDefault{\textcircledP}%
3229     {\tc@check@symbol2\textcircledP}
3230 \DeclareTextCommandDefault{\textreferencemark}%
3231     {\tc@check@symbol2\textreferencemark}
3232 \DeclareTextCommandDefault{\textsurd}%
3233     {\tc@check@symbol2\textsurd}
3234 %    \end{macrocode}
3235 %    The |\textcircled| and |\t| are handled specially, unless the
3236 %    current font has a subset id of 0 (i.e. full \texttt{TS1}) we
3237 %    pick the symbols up from the the math font encodings, i.e., the
3238 %    third argument to |\CheckEncodingSubset| uses |\UseTextAccent| to
3239 %    get them from there.
3240 %    \begin{macrocode}
3241 \DeclareTextCommandDefault{\textcircled}
3242   {\CheckEncodingSubset\UseTextAccent{TS1}%
3243     {\UseTextAccent{OMS}}1\textcircled}
3244 \DeclareTextCommandDefault{\t}
3245   {\CheckEncodingSubset\UseTextAccent{TS1}%
3246     {\UseTextAccent{OML}}1\t}
3247 %    \end{macrocode}
3251 %    Finally input the encoding-specific definitions for
3252 %    \texttt{TS1} thus making the top-level definitions
3253 %    optimised for this encoding (and not for the default
3254 %    encoding, see section~\ref{sec:orderofdecls}).
3255 % \changes{v1.9o}{1998/03/20}{Load decls after defaults for speed.}
3256 %    \begin{macrocode}
3257 \input{ts1enc.def}
3258 %    \end{macrocode}
3259 %    Now having the new glyphs available we also want to make sure
3260 %    that they are used. For most cases this will automatically happen
3261 %    but for some glyphs there are inferior definitions already known
3262 %    to \LaTeX{} which will prevent the usage of the \texttt{TS1}
3263 %    versions (see section~\ref{sec:removeencspec} above). So we better
3264 %    get rid of them:
3265 % \changes{v1.9o}{1998/03/20}{Added various \cs{UndeclareTextCommand}
3266 %    declarations for pr/2783}
3267 %    \begin{macrocode}
3268 \UndeclareTextCommand{\textsterling}{OT1}
3269 \UndeclareTextCommand{\textdollar}  {OT1}
3270 %    \end{macrocode}
3271 %    Similar declarations should probably be made for other encodings
3272 %    like \texttt{OT4} if they are in use.
3273 %    \begin{macrocode}
3274 %\UndeclareTextCommand{\textsterling}{OT4}
3275 %\UndeclareTextCommand{\textdollar}  {OT4}
3276 %    \end{macrocode}
3277 %    From the \texttt{T1} encoding there are two candidates for removal:
3278 %    \textperthousand{} and \textpertenthousand{} since these are both
3279 %    constructed from \% followed by a tiny
3280 %    `{\fontencoding{T1}\selectfont \char 24}'
3281 %    rather than being a single glyph. The problem with this
3282 %    approach is that in PostScript fonts this small zero is usually not
3283 %    available resulting in \%\rule{3pt}{3pt} rather than
3284 %    \textperthousand{} while the real glyph (at least for
3285 %    |\textperthousand|) is available in the PostScript version of
3286 %    \texttt{TS1}.  So for the moment we compromise by removing the
3287 %    \texttt{T1} declaration for |\textperthousand| but keeping the one
3288 %    for |\textpertenthousand|. This will have the effect that with
3289 %    Computer Modern fonts everything will come out (although
3290 %    \textperthousand{} and \textpertenthousand{} are not taken from the
3291 %    same physical font) and with PostScript fonts \textperthousand{}
3292 %    will come out correctly while \textpertenthousand{} will most
3293 %    likely look like \%\rule{6pt}{3pt} --- which is probably an
3294 %    improvement over just getting a single `\rule{3pt}{3pt}' to
3295 %    indicate a completely missing glyph, which would happen if we
3296 %    also `undeclared' |\textpertenthousand|.
3297 %    \begin{macrocode}
3298 \UndeclareTextCommand{\textperthousand}{T1}
3299 %\UndeclareTextCommand{\textpertenthousand}{T1}
3300 %    \end{macrocode}
3303 %  \subsubsection{Supporting oldstyle digits}
3305 %    \begin{macrocode}
3306 \DeclareRobustCommand\oldstylenums[1]{%
3307  \begingroup
3308   \ifmmode
3309    \mathgroup\symletters #1%
3310   \else
3311    \CheckEncodingSubset\@use@text@encoding{TS1}%
3312        {\PackageWarning{textcomp}%
3313           {Oldstyle digits unavailable for
3314            family \f@family.\MessageBreak
3315            Lining digits used instead}}%
3316        \tw@{#1}%
3317    \fi
3318  \endgroup
3320 %    \end{macrocode}
3322 %  \subsubsection{Subset encoding defaults}
3324 %    For many font families commonly used in the \TeX{} world we
3325 %    provide the subset encoding data here. Users can add additional
3326 %    font families in the file \texttt{textcomp.cfg} if they own other
3327 %    fonts.
3329 %    However, if the option ``forced'' was given then all subset
3330 %    encoding specifications are ignored, so there is no point in
3331 %    setting any of them up:
3332 %    \begin{macrocode}
3333 \iftc@forced \else
3334 %    \end{macrocode}
3336 %    Computer modern based fonts (e.g., CM, CM-Bright, Concrete):
3337 %    \begin{macrocode}
3338 \DeclareEncodingSubset{TS1}{cmr}     {0}
3339 \DeclareEncodingSubset{TS1}{cmss}    {0}
3340 \DeclareEncodingSubset{TS1}{cmtt}    {0}
3341 \DeclareEncodingSubset{TS1}{cmvtt}   {0}
3342 \DeclareEncodingSubset{TS1}{cmbr}    {0}
3343 \DeclareEncodingSubset{TS1}{cmtl}    {0}
3344 \DeclareEncodingSubset{TS1}{ccr}     {0}
3345 %    \end{macrocode}
3347 %    PSNFSS fonts:
3348 %    \begin{macrocode}
3349 \DeclareEncodingSubset{TS1}{ptm}     {4}
3350 \DeclareEncodingSubset{TS1}{pcr}     {4}
3351 \DeclareEncodingSubset{TS1}{phv}     {4}
3352 \DeclareEncodingSubset{TS1}{ppl}     {3}
3353 \DeclareEncodingSubset{TS1}{pag}     {4}
3354 \DeclareEncodingSubset{TS1}{pbk}     {4}
3355 \DeclareEncodingSubset{TS1}{pnc}     {4}
3356 \DeclareEncodingSubset{TS1}{pzc}     {4}
3357 \DeclareEncodingSubset{TS1}{bch}     {4}
3358 \DeclareEncodingSubset{TS1}{put}     {5}
3359 %    \end{macrocode}
3361 %    Other CTAN fonts (probably not complete):
3362 %    \begin{macrocode}
3363 \DeclareEncodingSubset{TS1}{uag}     {5}
3364 \DeclareEncodingSubset{TS1}{ugq}     {5}
3365 \DeclareEncodingSubset{TS1}{ul8}     {4}
3366 \DeclareEncodingSubset{TS1}{ul9}     {4}  % (LuxiSans, one day)
3367 \DeclareEncodingSubset{TS1}{augie}   {5}
3368 \DeclareEncodingSubset{TS1}{dayrom}  {3}
3369 \DeclareEncodingSubset{TS1}{dayroms} {3}
3370 \DeclareEncodingSubset{TS1}{pxr}     {0}
3371 \DeclareEncodingSubset{TS1}{pxss}    {0}
3372 \DeclareEncodingSubset{TS1}{pxtt}    {0}
3373 \DeclareEncodingSubset{TS1}{txr}     {0}
3374 \DeclareEncodingSubset{TS1}{txss}    {0}
3375 \DeclareEncodingSubset{TS1}{txtt}    {0}
3376 %    \end{macrocode}
3378 %    Latin Modern and TeX Gyre:
3379 % \changes{v1.99k}{2009/10/28}{Added Latin Modern and TeX Gyre subsets}
3380 % \changes{v1.99l}{2009/11/04}{Added more Latin Modern and TeX Gyre subsets}
3381 % \changes{v1.99m}{2015/02/16}{Added lmtt (Heiko Oberdiek) latex/4415}
3382 %    \begin{macrocode}
3383 \DeclareEncodingSubset{TS1}{lmr}     {0}
3384 \DeclareEncodingSubset{TS1}{lmdh}    {0}
3385 \DeclareEncodingSubset{TS1}{lmss}    {0}
3386 \DeclareEncodingSubset{TS1}{lmssq}   {0}
3387 \DeclareEncodingSubset{TS1}{lmvtt}   {0}
3388 \DeclareEncodingSubset{TS1}{lmtt}    {0}
3389 %    \end{macrocode}
3391 %    \begin{macrocode}
3392 \DeclareEncodingSubset{TS1}{qhv}     {0}
3393 \DeclareEncodingSubset{TS1}{qag}     {0}
3394 \DeclareEncodingSubset{TS1}{qbk}     {0}
3395 \DeclareEncodingSubset{TS1}{qcr}     {0}
3396 \DeclareEncodingSubset{TS1}{qcs}     {0}
3397 \DeclareEncodingSubset{TS1}{qpl}     {0}
3398 \DeclareEncodingSubset{TS1}{qtm}     {0}
3399 \DeclareEncodingSubset{TS1}{qzc}     {0}
3400 \DeclareEncodingSubset{TS1}{qhvc}    {0}
3401 %    \end{macrocode}
3403 %    Fourier-GUTenberg:
3404 %    \begin{macrocode}
3405 \DeclareEncodingSubset{TS1}{futs}    {4}
3406 \DeclareEncodingSubset{TS1}{futx}    {4}
3407 \DeclareEncodingSubset{TS1}{futj}    {4}
3408 %    \end{macrocode}
3410 %  Y\&Y's Lucida Bright
3411 %    \begin{macrocode}
3412 \DeclareEncodingSubset{TS1}{hlh}     {3}
3413 \DeclareEncodingSubset{TS1}{hls}     {3}
3414 \DeclareEncodingSubset{TS1}{hlst}    {3}
3415 %    \end{macrocode}
3416 %    The remaining settings for Lucida are conservative: the following
3417 %    fonts contain the |\textohm| character but not the |\texteuro|,
3418 %    i.e., belong to neither subset~4 nor subset~3. If you want to
3419 %    use the |\textohm| with these fonts copy these definition to
3420 %    \texttt{textcomp.cfg} and change the subset to~3. However in that
3421 %    case make sure that you do not use the |\texteuro|.
3422 %    \begin{macrocode}
3423 \DeclareEncodingSubset{TS1}{hlct}    {5}
3424 \DeclareEncodingSubset{TS1}{hlx}     {5}
3425 \DeclareEncodingSubset{TS1}{hlce}    {5}
3426 \DeclareEncodingSubset{TS1}{hlcn}    {5}
3427 \DeclareEncodingSubset{TS1}{hlcw}    {5}
3428 \DeclareEncodingSubset{TS1}{hlcf}    {5}
3429 %    \end{macrocode}
3431 %    Other commercial families\ldots
3432 %    \begin{macrocode}
3433 \DeclareEncodingSubset{TS1}{pplx}    {3}
3434 \DeclareEncodingSubset{TS1}{pplj}    {3}
3435 \DeclareEncodingSubset{TS1}{ptmx}    {4}
3436 \DeclareEncodingSubset{TS1}{ptmj}    {4}
3437 %    \end{macrocode}
3439 %    If the file \texttt{textcomp.cfg} exists it will be loaded at
3440 %    this point. This allows to define further subset encodings for
3441 %    font families not covered by default.
3443 %    \begin{macrocode}
3444 \InputIfFileExists{textcomp.cfg}
3445   {\PackageInfo{textcomp}{Local configuration file used}}{}
3446 %    \end{macrocode}
3448 %    \begin{macrocode}
3450 %</TS1sty>
3451 %    \end{macrocode}
3453 % \Finale
3455 \endinput