Debian Codegraph @

texmf-dist/source/latex/base/ltoutenc.dtx

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