Debian Codegraph @

texmf-dist/source/latex-dev/base/ltfinal.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 1993-2026
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 %
30 % \iffalse
31 %%% From File: ltfinal.dtx
32 %
33 %<*driver>
34 % \fi
35 \ProvidesFile{ltfinal.dtx}
36 [2026-04-16 v2.3l LaTeX Kernel (Final Settings)]
37 % \iffalse
38 \documentclass{ltxdoc}
39 \GetFileInfo{ltfinal.dtx}
40 \title{\filename}
41 \date{\filedate}
42 \author{%
43 Johannes Braams\and
44 David Carlisle\and
45 Alan Jeffrey\and
46 Leslie Lamport\and
47 Frank Mittelbach\and
48 Chris Rowley\and
49 Rainer Sch\"opf}
50 \begin{document}
51 \MaintainedByLaTeXTeam{latex}
52 \maketitle
53 \DocInput{ltfinal.dtx}
54 \end{document}
55 %</driver>
56 % \fi
57 %
58 %
59 % \section{Final settings}
60 %
61 % This section contains the final settings for \LaTeX. It initializes
62 % some debugging and typesetting parameters, sets the default
63 % |\catcode|s and uc/lc codes, and inputs the hyphenation file.
64 %
65 %
66 %
67 % \MaybeStop{}
68 %
69 % \changes{v0.1a}{1994/03/07}{Initial version, split from latex.dtx}
70 % \changes{v0.1a}{1994/03/07}{Remove oldcomments environment}
71 % \changes{v0.1c}{1994/04/21}{Added comments, set the catcodes of
72 % 128--255.}
73 % \changes{v0.1d}{1994/04/23}{Check that \cs{font@submax} is still zero}
74 % \changes{v0.1e}{1994/05/02}{Set all the catcodes}
75 % \changes{v0.1f}{1994/05/03}{Set the catcode of control-J to be
76 % `other', for use in messages.}
77 % \changes{v0.1g}{1994/05/05}{Added empty errhelp.}
78 % \changes{v0.1h}{1994/05/13}{Added package ot1enc, and defined
79 % \cs{@acci}, \cs{@accii} and \cs{@acciii}.}
80 % \changes{v0.1j}{1994/05/18}{Corrected the lccode for d-bar.}
81 % \changes{v0.1k}{1994/05/19}{Removed \cs{makeat...}}
82 % \changes{v1.0n}{1994/05/31}{Renamed lthyphen.* to lthyphen.*.}
83 % \changes{v1.0o}{1994/11/17}
84 % {\cs{@tempa} to \cs{reserved@a}}
85 % \changes{v1.0p}{1994/12/01}
86 % {Renamed lthyphen.* to hyphen.*.}
87 % \changes{v1.0r}{1995/06/05}
88 % {Added \cs{MakeUppercase} and \cs{MakeLowercase}.}
89 % \changes{v1.0s}{1995/06/06}
90 % {Made \cs{MakeUppercase} and \cs{MakeLowercase} brace their
91 % argument.}
92 % \changes{v2.0r}{2016/10/15}{Require e\TeX{}}
93 % \changes{v2.0s}{2016/10/15}{Tidy up status of char 127}
94 % \changes{v2.2i}{2020/08/21}{Integration of new hook management interface}
95 % \changes{v2.3k}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type
96 % expansion in expl3 code}
97 %
98 %
99 %
100 % \subsection{Debugging}
101 %
102 % By default, \LaTeX{} shows statistics:
103 % \begin{macrocode}
104 %<*2ekernel>
105 \tracingstats1
106 % \end{macrocode}
107 %
108 % \subsection{Typesetting parameters}
109 %
110 % \begin{macro}{\@lowpenalty}
111 % \begin{macro}{\@medpenalty}
112 % \begin{macro}{\@highpenalty}
113 % These are penalties used internally.
114 % \begin{macrocode}
115 \newcount\@lowpenalty
116 \newcount\@medpenalty
117 \newcount\@highpenalty
118 % \end{macrocode}
119 % \end{macro}
120 % \end{macro}
121 % \end{macro}
122 %
123 %
124 %\begin{macro}{\newmarks}
125 % \changes{v2.0a}{2014/12/30}{macro added}
126 % \changes{v2.0b}{2015/01/23}{use reserved count 256}
127 % \changes{v2.0g}{2015/06/19}{Use $-1$ for first range to get contiguous allocation}
128 % Allocate extended marks types if etex is active.
129 % Placed here at the end of the format
130 % to increase compatibility with count allocations
131 % in earlier releases.
132 % \begin{macrocode}
133 %</2ekernel>
134 %<*2ekernel|latexrelease>
135 %<latexrelease>\IncludeInRelease{2015/01/01}%
136 %<latexrelease> {\newmarks}{Extended Allocation}%
137 % \end{macrocode}
138 %
139 % \begin{macrocode}
140 \ifx\marks\@undefined\else
141 \def\newmarks{%
142 \e@alloc\marks \e@alloc@chardef{\count256}\m@ne\e@alloc@top}
143 \fi
144 % \end{macrocode}
145 %
146 % \begin{macrocode}
147 %</2ekernel|latexrelease>
148 %<latexrelease>\EndIncludeInRelease
149 %<latexrelease>\IncludeInRelease{0000/00/00}%
150 %<latexrelease> {\newmarks}{Extended Allocation}%
151 %<latexrelease>\let\newmarks\@undefined
152 %<latexrelease>\EndIncludeInRelease
153 %<*2ekernel>
154 % \end{macrocode}
155 % \end{macro}
156 %
157 %
158 %
159 % Allocate 3 mark classes to be used in \cs{markboth} and
160 % \cs{markright}. Should be done earlier but for that definition of
161 % \cs{newmarks} needs moving (which it should I guess).
162 % \changes{v2.2s}{2022/04/03}{Integration of new mark management interface}
163 % \begin{macrocode}
164 %</2ekernel>
165 %<*2ekernel|latexrelease>
166 %<latexrelease>\IncludeInRelease{2022/06/01}%
167 %<latexrelease> {2e-left}{Delayed legacy marks}%
168 \NewMarkClass {2e-left}
169 \NewMarkClass {2e-right}
170 \NewMarkClass {2e-right-nonempty}
171 % \end{macrocode}
172 % No rollback really, the marks will remain.
173 % \begin{macrocode}
174 %</2ekernel|latexrelease>
175 %<latexrelease>\EndIncludeInRelease
176 %<latexrelease>\IncludeInRelease{0000/00/00}%
177 %<latexrelease> {2e-left}{Delayed legacy marks}%
178 %<latexrelease>
179 %<latexrelease>\EndIncludeInRelease
180 %<*2ekernel>
181 % \end{macrocode}
182
183
184 %
185 %\begin{macro}{\newXeTeXintercharclass}
186 % \changes{v2.0a}{2014/12/30}{macro added}
187 % \changes{v2.0b}{2015/01/23}{use reserved count 257}
188 % \changes{v2.0f}{2015/04/28}{define \cs{xe@alloc@intercharclass} for compatibility with older xelatex initialization}
189 %\begin{macro}{\xe@alloc@intercharclass}
190 %\begin{macro}{\e@alloc@intercharclass@top}
191 % \changes{v2.0j}{2016/01/04}{Start allocation at one not three}
192 % \changes{v2.0k}{2016/01/05}{Remove duplicated code}
193 % Allocate |\XeTeXintercharclass| types if xetex is active.
194 % previously defined in |xetex.ini|.
195 %
196 % \begin{macrocode}
197 %</2ekernel>
198 %<*2ekernel|latexrelease>
199 %<latexrelease>\IncludeInRelease{2015/01/01}%
200 %<latexrelease> {\newXeTeXintercharclass}{Extended Allocation}%
201 % \end{macrocode}
202 %
203 % Classes allocated 1 to 4094 (or 254 on older xetex)
204 % (In earlier XeLaTeX versions 1, 2 and 3 were pre-set for CJK).
205 % \changes{v2.0g}{2015/06/19}{Use $-1$ for first range to get contiguous allocation}
206 % \changes{v2.0q}{2016/04/22}{XeTeX 0.99996 has 4096 char classes not 256}
207 % \begin{macrocode}
208 \ifx\XeTeXcharclass\@undefined
209 \else
210 % \end{macrocode}
211 % \begin{macrocode}
212 \ifdim\the\XeTeXversion\XeTeXrevision\p@>0.99993\p@
213 \chardef\e@alloc@intercharclass@top=4095
214 \else
215 \chardef\e@alloc@intercharclass@top=255
216 \fi
217 % \end{macrocode}
218 % \begin{macrocode}
219 \def\newXeTeXintercharclass{%
220 \e@alloc\XeTeXcharclass
221 \chardef\xe@alloc@intercharclass\m@ne\e@alloc@intercharclass@top}
222 \fi
223 % \end{macrocode}
224 %
225 % \begin{macrocode}
226 %</2ekernel|latexrelease>
227 %<latexrelease>\EndIncludeInRelease
228 %<latexrelease>\IncludeInRelease{0000/00/00}%
229 %<latexrelease> {\newXeTeXintercharclass}{Extended Allocation}%
230 %<latexrelease> \ifx\XeTeXcharclass\@undefined
231 %<latexrelease> \else
232 %<latexrelease> \def\xe@alloc@#1#2#3#4#5{\global\advance#1\@ne
233 %<latexrelease> \xe@ch@ck#1#4#2%
234 %<latexrelease> \allocationnumber#1%
235 %<latexrelease> \global#3#5\allocationnumber
236 %<latexrelease> \wlog{\string#5=\string#2\the\allocationnumber}}
237 %<latexrelease> \def\xe@ch@ck#1#2#3{%
238 %<latexrelease> \ifnum#1<#2\else
239 %<latexrelease> \errmessage{No room for a new #3}%
240 %<latexrelease> \fi}
241 %<latexrelease> \def\newXeTeXintercharclass{%
242 %<latexrelease> \xe@alloc@\xe@alloc@intercharclass
243 %<latexrelease> \XeTeXcharclass\chardef\@cclv}
244 %<latexrelease> \fi
245 %<latexrelease>\EndIncludeInRelease
246 %<*2ekernel|latexrelease>
247 %<latexrelease>\IncludeInRelease{2016/02/01}%
248 %<latexrelease> {\xe@alloc@intercharclass}{Start of XeTeX class allocator}%
249 \ifx\XeTeXcharclass\@undefined
250 \else
251 \countdef\xe@alloc@intercharclass=257
252 \xe@alloc@intercharclass=\z@
253 \fi
254 %</2ekernel|latexrelease>
255 %<latexrelease>\EndIncludeInRelease
256 %<latexrelease>\IncludeInRelease{2015/01/01}%
257 %<latexrelease> {\xe@alloc@intercharclass}{Start of XeTeX class allocator}%
258 %<latexrelease> \ifx\XeTeXcharclass\@undefined
259 %<latexrelease> \else
260 %<latexrelease> \xe@alloc@intercharclass=\thr@@
261 %<latexrelease> \fi
262 %<latexrelease>\EndIncludeInRelease
263 %<latexrelease>\IncludeInRelease{0000/00/00}%
264 %<latexrelease> {\xe@alloc@intercharclass}{Start of XeTeX class allocator}%
265 %<latexrelease> \ifx\XeTeXcharclass\@undefined
266 %<latexrelease> \else
267 %<latexrelease> \newcount\xe@alloc@intercharclass
268 %<latexrelease> \xe@alloc@intercharclass=\thr@@
269 %<latexrelease> \fi
270 %<latexrelease>\EndIncludeInRelease
271 %<*2ekernel>
272 % \end{macrocode}
273 % \end{macro}
274 % \end{macro}
275 % \end{macro}
276 %
277 % \begin{macro}{trace_stack_levels}
278 % Now define the Lua function to emulate \cs{tracingstacklevels} and
279 % install it in the |input_level_string| callback.
280 % \begin{macrocode}
281 %</2ekernel>
282 %<*2ekernel|latexrelease>
283 % \end{macrocode}
284 % In \texttt{latexrelease} mode we always remove the function from
285 % the callback, then add the correct version later.
286 % \begin{macrocode}
287 %<latexrelease>\ifx\directlua\@undefined
288 %<latexrelease>\else
289 %<latexrelease> \directlua{%
290 %<latexrelease> if luatexbase.callbacktypes['input_level_string'] and %
291 %<latexrelease> luatexbase.in_callback('input_level_string','tracingstacklevels') then
292 %<latexrelease> luatexbase.remove_from_callback('input_level_string','tracingstacklevels')
293 %<latexrelease> end}%
294 %<latexrelease>\fi
295 %<latexrelease>\IncludeInRelease{2021/06/01}{trace_stack_levels}%
296 %<latexrelease> {Lua trace_stack_levels function}%
297 \ifx\directlua\@undefined
298 \else
299 %<*2ekernel>
300 \expanded{%
301 \everyjob{\the\everyjob
302 \noexpand%\directlua
303 %</2ekernel>
304 \directlua{%
305 local function trace_stack_levels (input_ptr)
306 local tracingstacklevels = tex.count.tracingstacklevels
307 if tex.tracingmacros > 0 or input_ptr < tracingstacklevels then
308 if tracingstacklevels > 0 then
309 if input_ptr < tracingstacklevels then
310 return "\string\n\string~" .. string.rep(".",input_ptr)
311 else
312 return "\string~\string~"
313 end
314 else
315 return "\string\n"
316 end
317 else
318 return ""
319 end
320 end
321 %<latexrelease> if luatexbase.callbacktypes['input_level_string'] then
322 luatexbase.add_to_callback('input_level_string',
323 trace_stack_levels,'tracingstacklevels')
324 %<latexrelease> end
325 }%
326 %<*2ekernel>
327 }}%
328 %</2ekernel>
329 \fi
330 %<latexrelease>\EndIncludeInRelease
331 %<latexrelease>
332 % \end{macrocode}
333 % Then for the full rollback, just do nothing, since the function
334 % was already taken out of the rollback above.
335 % \begin{macrocode}
336 %<latexrelease>\IncludeInRelease{0000/00/00}{trace_stack_levels}%
337 %<latexrelease> {Lua trace_stack_levels function}%
338 %<latexrelease>% Nothing here
339 %<latexrelease>\EndIncludeInRelease
340 %</2ekernel|latexrelease>
341 %<*2ekernel>
342 % \end{macrocode}
343 % \end{macro}
344 %
345 % The default values of the picture and |\fbox| parameters:
346 % \begin{macrocode}
347 \unitlength = 1pt
348 \fboxsep = 3pt
349 \fboxrule = .4pt
350 % \end{macrocode}
351 % The saved value of \TeX's |\maxdepth|:
352 % \begin{macrocode}
353 \@maxdepth = \maxdepth
354 % \end{macrocode}
355 % |\vsize| initialized because a |\clearpage| with |\vsize < \topskip|
356 % causes trouble.
357 % |\@colroom| and |\@colht| also initialized because |\vsize| may be
358 % set to them if a |\clearpage| is done before the |\begin{document}|
359 %
360 % \begin{macrocode}
361 \vsize = 1000pt
362 \@colroom = \vsize
363 \@colht = \vsize
364 % \end{macrocode}
365 % Initialise |\textheight| |\textwidth| and page style, to avoid
366 % internal errors if they are not set by the class.
367 % \changes{v0.1b}{1994/04/18}
368 % {Initialise \cs{textheight}, \cs{textwidth} and page style}
369 % \begin{macrocode}
370 \textheight=.5\maxdimen
371 \textwidth=\textheight
372 \ps@empty
373 % \end{macrocode}
374 %
375 % \subsection{Lccodes for hyphenation}
376 %
377 % \changes{v2.0a}{2015/01/03}{Unicode data loading added}
378 % \changes{v2.0c}{2015/01/24}{Skip T1-code entirely with Unicode engines}
379 % \changes{v2.0d}{2015/03/26}{Use renamed
380 % \texttt{unicode-letters.def}}
381 % \changes{v2.0i}{2015/12/10}{Use new common Unicode data loaders}
382 % \changes{v2.0j}{2016/01/04}{Do not set up inter character classes for
383 % XeTeX}
384 % \changes{v2.0l}{2016/01/05}{Correct \textsf{latexrelease} guards}
385 % \changes{v2.0l}{2016/01/05}{Ensure old definitions for inter-character
386 % class toks are available using \textsf{latexrelease}}
387 % \changes{v2.0m}{2016/01/05}{Undefine XeTeX classes when using patching
388 % an older kernel}
389 % \changes{v2.0l}{2016/01/05}{Missing brace}
390 % \changes{v2.0p}{2016/01/05}{Only apply XeTeX change if XeTeX is in use}
391 % For $7$- and $8$-bit engines the assumption of T1 encodings is the
392 % basis for the hyphenation patterns. That's not the case for the Unicode
393 % engines, where the assumption is engine-native working. The common
394 % loader system provides access to data from the Unicode Consortium
395 % covering not only |\lccode| but also other related data. The
396 % |\lccode| part of that at least needs to be loaded before hyphenation is
397 % tackled: Xe\TeX{} follows the standard \TeX{} route of building patterns
398 % into the format. Lua\TeX{} doesn't require this data be loaded \emph{here}
399 % but it does need to be loaded somewhere. Rather than test for the Unicode
400 % engines by name, the approach here is to look for the extended math mode
401 % handling both provide: any other engine developed in this area will
402 % presumably also provide |\Umathcode|.
403 % \begin{macrocode}
404 \ifnum 0%
405 \ifx\Umathcode\@undefined\else 1\fi
406 \ifx\XeTeXmathcode\@undefined\else 1\fi
407 >\z@
408 \message{ Unicode character data,}
409 \input{load-unicode-data}
410 %</2ekernel>
411 %<latexrelease>\IncludeInRelease{2016/02/01}%
412 %<latexrelease> {\XeTeXintercharclasses}{XeTeX character classes}%
413 %<latexrelease> \ifx\XeTeXinterchartoks\undefined
414 %<latexrelease> \else
415 %<latexrelease> \begingroup
416 %<latexrelease> \chardef\XeTeXcharclassID = 0 %
417 %<latexrelease> \chardef\XeTeXcharclassOP = 0 %
418 %<latexrelease> \chardef\XeTeXcharclassCL = 0 %
419 %<latexrelease> \chardef\XeTeXcharclassEX = 0 %
420 %<latexrelease> \chardef\XeTeXcharclassIS = 0 %
421 %<latexrelease> \chardef\XeTeXcharclassNS = 0 %
422 %<latexrelease> \chardef\XeTeXcharclassCM = 0 %
423 %<latexrelease> \input{load-unicode-xetex-classes}
424 %<latexrelease> \endgroup
425 %<latexrelease> \global\let\xtxHanGlue\undefined
426 %<latexrelease> \global\let\xtxHanSpace\undefined
427 %<latexrelease> \global\XeTeXinterchartoks 0 1 = {}
428 %<latexrelease> \global\XeTeXinterchartoks 0 2 = {}
429 %<latexrelease> \global\XeTeXinterchartoks 0 3 = {}
430 %<latexrelease> \global\XeTeXinterchartoks 1 0 = {}
431 %<latexrelease> \global\XeTeXinterchartoks 2 0 = {}
432 %<latexrelease> \global\XeTeXinterchartoks 3 0 = {}
433 %<latexrelease> \global\XeTeXinterchartoks 1 1 = {}
434 %<latexrelease> \global\XeTeXinterchartoks 1 2 = {}
435 %<latexrelease> \global\XeTeXinterchartoks 1 3 = {}
436 %<latexrelease> \global\XeTeXinterchartoks 2 1 = {}
437 %<latexrelease> \global\XeTeXinterchartoks 2 2 = {}
438 %<latexrelease> \global\XeTeXinterchartoks 2 3 = {}
439 %<latexrelease> \global\XeTeXinterchartoks 3 1 = {}
440 %<latexrelease> \global\XeTeXinterchartoks 3 2 = {}
441 %<latexrelease> \global\XeTeXinterchartoks 3 3 = {}
442 %<latexrelease> \fi
443 %<latexrelease>\EndIncludeInRelease
444 %<latexrelease>\IncludeInRelease{0000/00/00}%
445 %<latexrelease> {\XeTeXintercharclasses}{XeTeX character classes}%
446 %<latexrelease> \ifx\XeTeXinterchartoks\undefined
447 %<latexrelease> \else
448 %<latexrelease> \input{load-unicode-xetex-classes}
449 %<latexrelease> \gdef\xtxHanGlue{\hskip0pt plus 0.1em\relax}
450 %<latexrelease> \gdef\xtxHanSpace{\hskip0.2em plus 0.2em minus 0.1em\relax}
451 %<latexrelease> \global\XeTeXinterchartoks 0 1 = {\xtxHanSpace}
452 %<latexrelease> \global\XeTeXinterchartoks 0 2 = {\xtxHanSpace}
453 %<latexrelease> \global\XeTeXinterchartoks 0 3 = {\nobreak\xtxHanSpace}
454 %<latexrelease> \global\XeTeXinterchartoks 1 0 = {\xtxHanSpace}
455 %<latexrelease> \global\XeTeXinterchartoks 2 0 = {\nobreak\xtxHanSpace}
456 %<latexrelease> \global\XeTeXinterchartoks 3 0 = {\xtxHanSpace}
457 %<latexrelease> \global\XeTeXinterchartoks 1 1 = {\xtxHanGlue}
458 %<latexrelease> \global\XeTeXinterchartoks 1 2 = {\xtxHanGlue}
459 %<latexrelease> \global\XeTeXinterchartoks 1 3 = {\nobreak\xtxHanGlue}
460 %<latexrelease> \global\XeTeXinterchartoks 2 1 = {\nobreak\xtxHanGlue}
461 %<latexrelease> \global\XeTeXinterchartoks 2 2 = {\nobreak\xtxHanGlue}
462 %<latexrelease> \global\XeTeXinterchartoks 2 3 = {\xtxHanGlue}
463 %<latexrelease> \global\XeTeXinterchartoks 3 1 = {\xtxHanGlue}
464 %<latexrelease> \global\XeTeXinterchartoks 3 2 = {\xtxHanGlue}
465 %<latexrelease> \global\XeTeXinterchartoks 3 3 = {\nobreak\xtxHanGlue}
466 %<latexrelease> \fi
467 %<latexrelease>\EndIncludeInRelease
468 %<*2ekernel>
469 % \end{macrocode}
470 % \changes{v2.0d}{2015/02/03}{Set \cs{lccode} for \texttt{-} with Unicode
471 % engines}
472 % There is one over-ride that makes sense here (see below for the same for
473 % $8$-bit engines): setting the lccode for |-| to itself.
474 % \begin{macrocode}
475 \lccode`\- =`\- % default hyphen char
476 % \end{macrocode}
477 % The alternative is that a ``traditional'' engine is in use.
478 % \begin{macrocode}
479 \else
480 % \end{macrocode}
481 % \changes{v1.1b}{1998/05/20}{Set up lccodes before loading
482 % hyphenation files: pr/2639}
483 % We set things up so that hyphenation files can assume that the
484 % default (T1) lccodes are in use (at present this also sets up the
485 % uccodes).
486 % We temporarily define |\reserved@a| to apply |\reserved@c| to
487 % all the numbers in the range of its arguments.
488 % \begin{macrocode}
489 \def\reserved@a#1#2{%
490 \@tempcnta#1\relax
491 \@tempcntb#2\relax
492 \reserved@b
493 }
494 \def\reserved@b{%
495 \ifnum\@tempcnta>\@tempcntb\else
496 \reserved@c\@tempcnta
497 \advance\@tempcnta\@ne
498 \expandafter\reserved@b
499 \fi
500 }
501 % \end{macrocode}
502 % Depending on the \TeX{} version, we might not be allowed to do
503 % this for non-ASCII characters.
504 % \changes{v1.0n}{1994/06/09}{For \TeX2, do not set codes for higher
505 % half of character table.}
506 % \begin{macrocode}
507 \def\reserved@c#1{%
508 \count@=#1\advance\count@ by -"20
509 \uccode#1=\count@
510 \lccode#1=#1
511 }
512 \reserved@a{`\a}{`\z}
513 \reserved@a{"A0}{"BC}
514 \reserved@a{"E0}{"FF}
515 % \end{macrocode}
516 % The upper case characters need their |\uccode| and |\lccode| values
517 % set, and their |\sfcode| set to 999.
518 % \begin{macrocode}
519 \def\reserved@c#1{%
520 \count@=#1\advance\count@ by "20
521 \uccode#1=#1
522 \lccode#1=\count@
523 \sfcode#1=999
524 }
525 \reserved@a{`\A}{`\Z}
526 \reserved@a{"80}{"9C}
527 \reserved@a{"C0}{"DF}
528 % \end{macrocode}
529 % Well, it would be nice if that were correct, but unfortunately, the
530 % Cork encoding contains some odd slots whose uccode or lccode isn't
531 % quite what you'd expect.
532 % \begin{macrocode}
533 \uccode`\^^Y=`\I % dotless i
534 \lccode`\^^Y=`\^^Y % dotless i
535 \uccode`\^^Z=`\J % dotless j, ae in OT1
536 \lccode`\^^Z=`\^^Z % dotless j, ae in OT1
537 \lccode`\^^9d=`\i % dotted I
538 \uccode`\^^9d=`\^^9d % dotted I
539 \lccode`\^^9e=`\^^9e % d-bar
540 \uccode`\^^9e=`\^^d0 % d-bar
541 % \end{macrocode}
542 % Finally here is one that helps hyphenation in the OT1 encoding.
543 % \changes{v1.0z}{1996/10/31}
544 % {Added extra \cs{lcode}, hoping it does no harm in T1 (pr/1969)}
545 % \begin{macrocode}
546 \lccode`\^^[=`\^^[ % oe in OT1
547 % \end{macrocode}
548 %
549 % And we also set the |\lccode| of |\-| and |\textcompwordmark| so
550 % that they do not prevent hyphenation in the remainder of the word
551 % (as suggested by Lars Helstr\"om).
552 % \changes{v1.1e}{2003/10/13}
553 % {Added extra \cs{lccode} for \cs{-} and \cs{textcompwordmark}}
554 % \begin{macrocode}
555 \lccode`\- =`\- % default hyphen char
556 \lccode 127=127 % alternate hyphen char
557 \lccode 23 =23 % textcompwordmark in T1
558 % \end{macrocode}
559 %
560 % End of the conditional to select either Unicode or T1 encoding defaults.
561 % \begin{macrocode}
562 \fi
563 % \end{macrocode}
564 %
565 % \changes{v2.2b}{2020/07/08}
566 % {Add a last-minute hook for \textsf{expl3}}
567 % At this stage, we can install any last-minute \textsf{expl3} set-up.
568 % \begin{macrocode}
569 \@expl@finalise@setup@@
570 \def\@expl@finalise@setup@@{}
571 % \end{macrocode}
572 %
573 % This is as good a place as any to active a few Xe\TeX{}-specific
574 % settings
575 % \begin{macrocode}
576 \ifx\XeTeXuseglyphmetrics\@undefined
577 \else
578 \XeTeXuseglyphmetrics=1 %
579 \XeTeXdashbreakstate=1 %
580 \fi
581 % \end{macrocode}
582 %
583 % \subsection{Hyphenation}
584 %
585 % \changes{v0.1a}{1994/03/07}{move code here from lhyphen.dtx}
586 % \changes{v0.1a}{1994/03/07}
587 % {use \cs{InputIfFileExists} not \cs{IfFileExists}}
588 % \changes{v1.0x}{1995/11/01}
589 % {(DPC) Switch meaning of \cs{@addtofilelist} for cfg files}%
590 % The following code will be compiled into the format file. It checks
591 % for the existence of \texttt{hyphen.cfg} in inputs that file if
592 % found. Otherwise it inputs \texttt{hyphen.ltx}. Note that these
593 % are loaded in \emph{before} the |\catcode|s are set, so local
594 % hyphenation files can use 8-bit input.
595 %
596 % We try to load the customized hyphenation description file.
597 % \begin{macrocode}
598 \InputIfFileExists{hyphen.cfg}
599 {\typeout{===========================================^^J%
600 Local configuration file hyphen.cfg used^^J%
601 ===========================================}%
602 \def\@addtofilelist##1{\xdef\@filelist{\@filelist,##1}}%
603 }
604 {\input{hyphen.ltx}}
605 \let\@addtofilelist\@gobble
606 % \end{macrocode}
607 %
608 % \begin{macro}{\l@nohyphenation}
609 % \changes{v2.0t}{2017/03/09}{ensure \cs{l@nohyphenation} is defined.}
610 % \begin{macrocode}
611 \ifx\l@nohyphenation \@undefined
612 \newlanguage\l@nohyphenation
613 \fi
614 % \end{macrocode}
615 % \end{macro}
616 %
617 %
618 % \begin{macro}{\document@default@language}
619 % Default document language. -1 acts as language 0, but used as a flag in |\document|
620 % to see if it has been set in the preamble.
621 % \changes{v2.1f}{2018/08/24}{Add to latexrelease (github/68)}
622 % \begin{macrocode}
623 %</2ekernel>
624 %<*2ekernel|latexrelease>
625 %<latexrelease>\IncludeInRelease{2017/04/15}%
626 %<latexrelease> {\document@default@language}{Save language for hyphenation}%
627 \let\document@default@language\m@ne
628 %</2ekernel|latexrelease>
629 %<latexrelease>\EndIncludeInRelease
630 %<latexrelease>\IncludeInRelease{0000/00/00}%
631 %<latexrelease> {\document@default@language}{Save language for hyphenation}%
632 %
633 %<latexrelease>\let\document@default@language\@undefined
634 %<latexrelease>\EndIncludeInRelease
635 %<*2ekernel>
636 % \end{macrocode}
637 % \end{macro}
638 %
639 %
640 %
641 % \subsection{Font loading}
642 % Fonts loaded during the formatting process might already have
643 % changed the |\font@submax| from |0pt| to something higher.
644 % If so, we put out a bold warning.
645 % \changes{v0.1l}{1994/05/20}{Use new font warning commands}
646 % \changes{v1.1c}{2000/08/23}{Fix typo in warning}
647 % \begin{macrocode}
648 \ifdim \font@submax >\z@
649 \@font@warning{Size substitutions with differences\MessageBreak
650 up to \font@submax\space have occurred.\MessageBreak
651 \MessageBreak
652 Please check the transcript file
653 carefully\MessageBreak
654 and redo the format generation if necessary!
655 \@gobbletwo}%
656 \errhelp{Only stopped, to give you time to
657 read the above message.}
658 \errmessage{}
659 % \end{macrocode}
660 % We reset the macro. Otherwise every user will get a warning on
661 % every job.
662 % \begin{macrocode}
663 \def\font@submax{0pt}
664 \fi
665 % \end{macrocode}
666 %
667 % For pdf\TeX\ preload and enable automatic glyph to Unicode mapping
668 % for more reliable copy and paste support. Since v1.40.22, this data is
669 % dumped into the format so is simply loaded directly. For older engines,
670 % the same method as Lua\TeX{} is used (see below).
671 % \changes{v2.2l}{2021/01/21}{Load glyphtounicode.tex for pdf\TeX}
672 % \changes{v2.2m}{2021/02/25}{Improve speed of ToUnicode everyjob loading code}
673 %
674 % For lua\TeX{} |\pdfextension glyphtounicode| would error in dvi-mode. As the
675 % outputmode can be changed in the preamble we have to test in the definition.
676 % Lua\TeX{} does not dump this information into the format, so we need to load
677 % it in the \cs{everyjob} hook. We can't use \cs{input} there, as it would
678 % set the \cs{jobname} in the event of the run being started without loading
679 % a file. We also don't want to put all of the tokens from the files
680 % \emph{directly} in the hook, so we save to a macro. We need to read with
681 % spaces \enquote{present} as this is part of the syntax of the primitive,
682 % so need \cs{ExplSyntaxOff} in the setup for \cs{file_get:nnN}.
683 %
684 % For other engines we provide the two commands with noop definitions
685 % \changes{v2.3j}{2026-02-25}{Define \cs{pdfglyphtounicode} for lua\TeX}
686 % \changes{v2.3j}{2026-02-25}{Load and enable glyphtounicode.tex for lua\TeX in PDF mode}
687 % \changes{v2.3j}{2026-02-25}{Provide noop definitions for the other engines}
688 % \changes{v2.3l}{2026-04-16}{Revise glyphtounicode loading to reduce tokens
689 % in \cs{everyjob}}
690 % \begin{macrocode}
691 %</2ekernel>
692 %<*2ekernel|latexrelease>
693 %<latexrelease>\IncludeInRelease{2026/06/01}%
694 %<latexrelease> {\pdfgentounicode}{Preload glyphtounicode}%
695 \ifdefined\directlua
696 \protected\def\pdfglyphtounicode{%
697 \ifnum\outputmode=1 %
698 \expandafter\@firstofone
699 \else
700 \expandafter\@gobblethree
701 \fi
702 {\pdfextension glyphtounicode}%
703 }
704 \protected\edef\pdfgentounicode{\pdfvariable gentounicode}
705 \fi
706 \ifdefined\pdfgentounicode
707 %<*2ekernel>
708 \ifnum 0=0%
709 \ifdefined\pdftexversion
710 % \pdftexversion<140 does not have \pdfgentounicode, so we only check higher values
711 \ifnum \pdftexversion=140 \ifnum\pdftexrevision<22 1\fi\fi
712 \else 1%
713 \fi
714 \relax
715 %</2ekernel>
716 \input glyphtounicode %
717 \input glyphtounicode-cmex %
718 %<*2ekernel>
719 \else
720 \ExplSyntaxOn
721 \file_get:nnN { glyphtounicode } { \ExplSyntaxOff }
722 \@@data@glyphtounicode
723 \file_get:nnN { glyphtounicode-cmex } { \ExplSyntaxOff }
724 \@@data@glyphtounicode@cmex
725 \ExplSyntaxOff
726 \everyjob\expandafter{%
727 \the\everyjob
728 \@@data@glyphtounicode
729 \@@data@glyphtounicode@cmex
730 }
731 \fi
732 %</2ekernel>
733 \ifdefined\directlua
734 \pdfvariable gentounicode=1 %
735 \else
736 \pdfgentounicode=1 %
737 \fi
738 \fi
739 % \end{macrocode}
740 % For other engines we provide the two commands with noop definitions
741 % \begin{macrocode}
742 \ifx \pdfgentounicode \@undefined
743 \let\pdfglyphtounicode\@gobbletwo
744 \newcount\pdfgentounicode
745 \fi
746 %</2ekernel|latexrelease>
747 %<latexrelease>\EndIncludeInRelease
748 %<latexrelease>\IncludeInRelease{2021/06/01}%
749 %<latexrelease> {\pdfgentounicode}{Preload glyphtounicode}%
750 %<latexrelease>\ifx \directlua\undefined \else
751 %<latexrelease> \pdfvariable gentounicode=0
752 %<latexrelease>\fi
753 %<latexrelease>\ifdefined\pdftexversion
754 %<latexrelease> \ifx \pdfgentounicode \@undefined \else
755 %<latexrelease> \ifnum 0=0%
756 %<latexrelease> \ifnum \pdftexversion=140 \ifnum\pdftexrevision<22 1\fi\fi
757 %<latexrelease> \relax
758 %<latexrelease> \input glyphtounicode
759 %<latexrelease> \else
760 %<latexrelease> \begingroup
761 %<latexrelease> \everyeof{\noexpand}\endlinechar-1
762 %<latexrelease> \edef\x{\endgroup
763 %<latexrelease> \everyjob{\the\everyjob\@@input glyphtounicode }%
764 %<latexrelease> }\x
765 %<latexrelease> \fi
766 %<latexrelease> \pdfgentounicode=1
767 %<latexrelease> \fi
768 %<latexrelease>\fi
769 %<latexrelease>\EndIncludeInRelease
770 % \end{macrocode}
771 % When rolling back we can't unload the glyphtounicode mappings, but we
772 % can reset |\pdfgentounicode| to ensure that they aren't used and then undefine
773 % the commands for the engines that do not natively support it.
774 % \begin{macrocode}
775 %<latexrelease>\IncludeInRelease{0000/00/00}%
776 %<latexrelease> {\pdfgentounicode}{Preload glyphtounicode}%
777 %<latexrelease> \pdfgentounicode=0
778 %<latexrelease>\EndIncludeInRelease
779 %<*2ekernel>
780 % \end{macrocode}
781 %
782 % \subsection{Input encoding}
783 %
784 % \changes{v2.1a}{2018/03/25}{default to UTF-8}
785 % Starting with the 2018 \LaTeX\ release default the inputencoding
786 % to UTF-8. Unless the format is being used with luatex, xetex, enctex or mltex.
787 %
788 % This is done in a way largely compatible with older releases: |utf8.def| is input just as if\\
789 % |\usepackage[utf8]{inputenc}|\\
790 % had been used, however rather than input the whole package a minimal core part just enough to support
791 % loading the UTF-8 encoding files is defined here.
792 %
793 % If a document re-specifies UTF-8 this is silently ignored.
794 %
795 % \begin{macrocode}
796 %</2ekernel>
797 %<*2ekernel|latexrelease>
798 % \end{macrocode}
799 %
800 % Check that a classic 8-bit tex engine is being used (LaTeX or PDFLaTeX).
801 %
802 % \begin{macrocode}
803 %<latexrelease>\IncludeInRelease{2018/04/01}%
804 %<latexrelease> {\UTFviii@invalid}{UTF-8 default}%
805 % \end{macrocode}
806 %
807 %
808 % Skip this section in Unicode TeX, or if MLTeX and EncTeX are enabled.
809 % \begin{macrocode}
810 \ifnum0%
811 \ifx\Umathcode\@undefined\else 1\fi
812 \ifx\mubyte\@undefined\else 1\fi
813 \ifx\charsubdef\@undefined\else 1\fi
814 =\z@
815 % \end{macrocode}
816 %
817 % \begin{macrocode}
818 \def\saved@space@catcode{10}
819 \let\@inpenc@test\relax
820 \def\IeC{%
821 \ifx\protect\@typeset@protect
822 \expandafter\@firstofone
823 \else
824 \noexpand\IeC
825 \fi
826 }
827 % \end{macrocode}
828 %
829 % Make characters active for UTF-8 input formats
830 % \begin{macrocode}
831 \@tempcnta=1
832 \loop
833 \catcode\@tempcnta=13 %
834 \advance\@tempcnta\@ne %
835 \ifnum\@tempcnta<32 %
836 \repeat %
837 \catcode0=15 % null
838 \catcode9=10 % tab
839 \catcode10=12 % ctrl J
840 \catcode12=13 % ctrl L
841 \catcode13=5 % newline
842 \@tempcnta=128
843 \loop
844 \catcode\@tempcnta=13
845 \advance\@tempcnta\@ne
846 \ifnum\@tempcnta<256
847 \repeat
848 % \end{macrocode}
849 %
850 % \begin{macro}{\UseRawInputEncoding}
851 % \changes{v2.1a}{2018/03/25}{Macro added}
852 % Reset 8 bit characters to catcode 12 so the input encoding matches the ``Raw''
853 % font encoding.
854 % Useful for special behaviours, or for compatibility with older \LaTeX\ formats.
855 % \changes{v2.1b}{2018/04/06}{Undo changes to \cs{DeclareFontEncoding@} and
856 % definition of \cs{DeclareUnicodeCharacter}}
857 % \changes{v2.1c}{2018/04/07}{Undefine \cs{inputencodingname}}
858 % \begin{macrocode}
859 \def\UseRawInputEncoding{%
860 \let\inputencodingname\@undefined % revert
861 \let\DeclareFontEncoding@\DeclareFontEncoding@saved % revert
862 \let\DeclareUnicodeCharacter\@undefined % revert
863 \@tempcnta=1
864 \loop
865 \catcode\@tempcnta=15 %
866 \advance\@tempcnta\@ne %
867 \ifnum\@tempcnta<32 %
868 \repeat %
869 \catcode0=15 % null
870 \catcode9=10 % tab
871 \catcode10=12 % ctrl J
872 \catcode12=13 % ctrl L
873 \catcode13=5 % newline
874 \@tempcnta=128
875 \loop
876 \catcode\@tempcnta=12
877 \advance\@tempcnta\@ne
878 \ifnum\@tempcnta<256
879 \repeat
880 }
881 % \end{macrocode}
882 % \end{macro}
883 %
884 % \begin{macro}{\DeclareFontEncoding@saved}
885 % Saved version of |\DeclareFontEncoding@| before \texttt{utf8.def}
886 % modifies it for use in |\UseRawInputEncoding| above.
887 % \begin{macrocode}
888 \let\DeclareFontEncoding@saved\DeclareFontEncoding@
889 % \end{macrocode}
890 % \end{macro}
891 %
892 % \changes{v2.1d}{2018/04/08}{Delay full UTF-8 handling to \cs{everyjob}}
893 % \changes{v2.18}{2018/05/11}{Make invalid UTF-8 also safe, for legacy filesystem encodings}
894 % \begin{macrocode}
895 \edef\inputencodingname{utf8}%
896 \input{utf8.def}
897 \let\UTFviii@undefined@err@@\UTFviii@undefined@err
898 \let\UTFviii@invalid@err@@\UTFviii@invalid@err
899 \let\UTFviii@two@octets@@\UTFviii@two@octets
900 \let\UTFviii@three@octets@@\UTFviii@three@octets
901 \let\UTFviii@four@octets@@\UTFviii@four@octets
902 %<2ekernel>\def\UTFviii@undefined@err#1{\@gobble#1}%
903 %<2ekernel>\let\UTFviii@invalid@err\string
904 %<2ekernel>\let\UTFviii@two@octets\string
905 %<2ekernel>\let\UTFviii@three@octets\string
906 %<2ekernel>\let\UTFviii@four@octets\string
907 %<2ekernel>\everyjob\expandafter{\the\everyjob
908 %<2ekernel>\let\UTFviii@undefined@err\UTFviii@undefined@err@@
909 %<2ekernel>\let\UTFviii@invalid@err\UTFviii@invalid@err@@
910 %<2ekernel>\let\UTFviii@two@octets\UTFviii@two@octets@@
911 %<2ekernel>\let\UTFviii@three@octets\UTFviii@three@octets@@
912 %<2ekernel>\let\UTFviii@four@octets\UTFviii@four@octets@@
913 %<2ekernel>}
914 \let\@inpenc@test\@undefined
915 \let\saved@space@catcode\@undefined
916 % \end{macrocode}
917 %
918 % For formats not set up for UTF-8 default, set the C0 controls to catcode 15.
919 % \begin{macrocode}
920 \else
921 \@tempcnta=0
922 \loop
923 \catcode\@tempcnta=15 %
924 \advance\@tempcnta\@ne %
925 \ifnum\@tempcnta<32 %
926 \repeat %
927 \catcode0=15 % null
928 \catcode9=10 % tab
929 \catcode10=12 % ctrl J
930 \catcode12=13 % ctrl L
931 \catcode13=5 % newline
932 % \end{macrocode}
933 %
934 % \begin{macrocode}
935 \let\UseRawInputEncoding\relax
936 % \end{macrocode}
937 %
938 % This ends the skipped code in Unicode engines:
939 % \begin{macrocode}
940 \fi
941 %</2ekernel|latexrelease>
942 %<latexrelease>\EndIncludeInRelease
943 %<latexrelease>\IncludeInRelease{0000/00/00}%
944 %<latexrelease> {\UTFviii@invalid}{UTF-8 default}%
945 % \end{macrocode}
946 %
947 % The first block of commands got only introduced in 2019 but we
948 % revert all of Unicode support in one go not jump to the
949 % intermediate version.
950 % \begin{macrocode}
951 %<latexrelease> \let\UTFviii@two@octets@combine\@undefined
952 %<latexrelease> \let\UTFviii@three@octets@combine\@undefined
953 %<latexrelease> \let\UTFviii@four@octets@combine\@undefined
954 %<latexrelease> \let\UTFviii@two@octets@string\@undefined
955 %<latexrelease> \let\UTFviii@three@octets@string\@undefined
956 %<latexrelease> \let\UTFviii@four@octets@string\@undefined
957 %<latexrelease> \let\UTFviii@two@octets@noexpand\@undefined
958 %<latexrelease> \let\UTFviii@three@octets@noexpand\@undefined
959 %<latexrelease> \let\UTFviii@four@octets@noexpand\@undefined
960 % \end{macrocode}
961 %
962 % \begin{macrocode}
963 %<latexrelease>\@tempcnta=0
964 %<latexrelease>\loop
965 %<latexrelease> \catcode\@tempcnta=15
966 %<latexrelease> \advance\@tempcnta\@ne
967 %<latexrelease>\ifnum\@tempcnta<32
968 %<latexrelease>\repeat %
969 %<latexrelease>\catcode9=10 % tab
970 %<latexrelease>\catcode10=12 % ctrl J
971 %<latexrelease>\catcode12=13 % ctrl L
972 %<latexrelease>\catcode13=5 % newline
973 %<latexrelease>\@tempcnta=128
974 %<latexrelease>\loop
975 %<latexrelease>\catcode\@tempcnta=12
976 %<latexrelease>\advance\@tempcnta\@ne
977 %<latexrelease>\ifnum\@tempcnta<256
978 %<latexrelease>\repeat
979 %<latexrelease>\let\IeC\@undefined
980 %<latexrelease>\def\DeclareFontEncoding@#1#2#3{%
981 %<latexrelease> \expandafter
982 %<latexrelease> \ifx\csname T@#1\endcsname\relax
983 %<latexrelease> \def\cdp@elt{\noexpand\cdp@elt}%
984 %<latexrelease> \xdef\cdp@list{\cdp@list\cdp@elt{#1}%
985 %<latexrelease> {\default@family}{\default@series}%
986 %<latexrelease> {\default@shape}}%
987 %<latexrelease> \expandafter\let\csname#1-cmd\endcsname\@changed@cmd
988 %<latexrelease> \else
989 %<latexrelease> \@font@info{Redeclaring font encoding #1}%
990 %<latexrelease> \fi
991 %<latexrelease> \global\@namedef{T@#1}{#2}%
992 %<latexrelease> \global\@namedef{M@#1}{\default@M#3}%
993 %<latexrelease> \xdef\LastDeclaredEncoding{#1}%
994 %<latexrelease> }
995 %<latexrelease> \let\UseRawInputEncoding\@undefined
996 %<latexrelease> \let\DeclareFontEncoding@saved\@undefined
997 %<latexrelease> \let\inputencodingname\@undefined
998 %<latexrelease>\EndIncludeInRelease
999 % \end{macrocode}
1000 %
1001 % \begin{macrocode}
1002 %<*2ekernel>
1003 % \end{macrocode}
1004 %
1005 % We temporarily define |\reserved@a| to apply |\reserved@c| to all the
1006 % numbers in the range of its arguments.
1007 % \begin{macrocode}
1008 \def\reserved@a#1#2{%
1009 \@tempcnta#1\relax
1010 \@tempcntb#2\relax
1011 \reserved@b
1012 }
1013 \def\reserved@b{%
1014 \ifnum\@tempcnta>\@tempcntb\else
1015 \reserved@c\@tempcnta
1016 \advance\@tempcnta\@ne
1017 \expandafter\reserved@b
1018 \fi
1019 }
1020 % \end{macrocode}
1021 % \changes{v0.1e}{1994/05/02}{Added setting the special catcodes.}
1022 % \changes{v0.1f}{1994/05/02}{Set the catcode of control-J.}
1023 % Set the special catcodes (although some of these are useless, since an
1024 % error will have occurred if the catcodes have changed). Note that
1025 % |^^J| has catcode `other' for use in warning messages.
1026 % \begin{macrocode}
1027 \catcode`\ =10
1028 \catcode`\#=6
1029 \catcode`\$=3
1030 \catcode`\%=14
1031 \catcode`\&=4
1032 \catcode`\\=0
1033 \catcode`\^=7
1034 \catcode`\_=8
1035 \catcode`\{=1
1036 \catcode`\}=2
1037 \catcode`\~=13
1038 \catcode`\@=11
1039 \catcode`\^^I=10
1040 \catcode`\^^J=12
1041 \catcode`\^^L=13
1042 \catcode`\^^M=5
1043 % \end{macrocode}
1044 % \changes{v0.1e}{1994/05/02}{Added setting the `other' catcodes.}
1045 % Set the `other' catcodes.
1046 % \begin{macrocode}
1047 \def\reserved@c#1{\catcode#1=12\relax}
1048 \reserved@c{`\!}
1049 \reserved@c{`\"}
1050 \reserved@a{`\'}{`\?}
1051 \reserved@c{`\[}
1052 \reserved@c{`\]}
1053 \reserved@c{`\`}
1054 \reserved@c{`\|}
1055 % \end{macrocode}
1056 % \changes{v0.1e}{1994/05/02}{Added setting the `letter' catcodes.}
1057 % Set the `letter' catcodes.
1058 % \begin{macrocode}
1059 \def\reserved@c#1{\catcode#1=11\relax}
1060 \reserved@a{`\A}{`\Z}
1061 \reserved@a{`\a}{`\z}
1062 % \end{macrocode}
1063 % \changes{v0.1e}{1994/05/02}{Made slot 127 illegal}
1064 % \changes{v1.0n}{1994/11/18}
1065 % {re-allow slots 127--255}
1066 % All the characters in the range 0--31 and 127--255 are illegal,
1067 % \emph{except} tab (|^^I|), nl (|^^J|), ff (|^^L|) and cr (|^^M|).
1068 %
1069 %
1070 % \subsection{Lccodes and uccodes}
1071 %
1072 % \changes{v1.1b}{1998/05/20}{Set up uc/lccodes after loading
1073 % hyphenation files: pr/2639}
1074 % We now again set up the default (T1) uc/lccodes.
1075 % The lower case characters need their |\uccode| and |\lccode| values
1076 % set. Some of this is a repeat of the set-up before loading
1077 % hyphenation files.
1078 % Depending on the \TeX{} version, we might not be allowed to do
1079 % this for non-ASCII characters.
1080 % \changes{v1.0n}{1994/06/09}{For \TeX2, do not set codes for higher
1081 % half of character table.}
1082 % \changes{v2.0a}{2015/01/03}{Skip resetting codes with Unicode engines}
1083 % For the Unicode engines (Xe\TeX{} and Lua\TeX{}) there is no need to
1084 % do any of this: they use hyphenation data which does not alter any
1085 % of the set up and so this entire block is skipped.
1086 % \begin{macrocode}
1087 \ifnum 0%
1088 \ifx\Umathcode\@undefined\else 1\fi
1089 \ifx\XeTeXmathcode\@undefined\else 1\fi
1090 >\z@
1091 \else
1092 \def\reserved@c#1{%
1093 \count@=#1\advance\count@ by -"20
1094 \uccode#1=\count@
1095 \lccode#1=#1
1096 }
1097 \reserved@a{`\a}{`\z}
1098 \reserved@a{"A0}{"BC}
1099 \reserved@a{"E0}{"FF}
1100 % \end{macrocode}
1101 % The upper case characters need their |\uccode| and |\lccode| values
1102 % set, and their |\sfcode| set to 999.
1103 % \begin{macrocode}
1104 \def\reserved@c#1{%
1105 \count@=#1\advance\count@ by "20
1106 \uccode#1=#1
1107 \lccode#1=\count@
1108 \sfcode#1=999
1109 }
1110 \reserved@a{`\A}{`\Z}
1111 \reserved@a{"80}{"9C}
1112 \reserved@a{"C0}{"DF}
1113 % \end{macrocode}
1114 % Well, it would be nice if that were correct, but unfortunately, the
1115 % Cork encoding contains some odd slots whose uccode or lccode isn't
1116 % quite what you'd expect.
1117 % \begin{macrocode}
1118 \uccode`\^^Y=`\I % dotless i
1119 \lccode`\^^Y=`\^^Y % dotless i
1120 \uccode`\^^Z=`\J % dotless j, ae in OT1
1121 \lccode`\^^Z=`\^^Z % dotless j, ae in OT1
1122 \lccode`\^^9d=`\i % dotted I
1123 \uccode`\^^9d=`\^^9d % dotted I
1124 \lccode`\^^9e=`\^^9e % d-bar
1125 \uccode`\^^9e=`\^^d0 % d-bar
1126 % \end{macrocode}
1127 % Finally here is one that helps hyphenation in the OT1 encoding.
1128 % \changes{v1.0z}{1996/10/31}
1129 % {Added extra \cs{lcode}, hoping it does no harm in T1 (pr/1969)}
1130 % \begin{macrocode}
1131 \lccode`\^^[=`\^^[ % oe in OT1
1132 \fi % End of reset block for 8-bit engines
1133 % \end{macrocode}
1134 %
1135 % \begin{macro}{\BCPdata}
1136 % \changes{v2.3a}{2023/04/16}{Command added}
1137 % A stub for use by \pkg{babel}, \pkg{polyglossia}, etc.
1138 % \begin{macrocode}
1139 \ExplSyntaxOn
1140 \newcommand*\BCPdata[1]{
1141 \str_case:nn {#1}
1142 {
1143 { language } { en }
1144 { region } { US }
1145 { script } { Latn }
1146 { tag } { en-US }
1147 }
1148 }
1149 \ExplSyntaxOff
1150 % \end{macrocode}
1151 % \end{macro}
1152 %
1153 % \subsection{Case changing}
1154 %
1155 % \begin{macro}{\MakeUppercase}
1156 % \begin{macro}{\MakeLowercase}
1157 % \begin{macro}{\MakeTitlecase}
1158 % \begin{macro}{\NoCaseChange}
1159 % \begin{macro}{\AddToNoCaseChangeList}
1160 % \begin{macro}{\CaseSwitch}
1161 % \begin{macro}{\DeclareCaseChangeEquivalent}
1162 % \begin{macro}{\DeclareLowercaseMapping}
1163 % \begin{macro}{\DeclareTitlecaseMapping}
1164 % \begin{macro}{\DeclareUppercaseMapping}
1165 % \begin{macro}{\DeclareLowercaseExclusions}
1166 % \begin{macro}{\DeclareTitlecaseExclusions}
1167 % \begin{macro}{\DeclareUppercaseExclusions}
1168 % \begin{macro}{\@uclclist}
1169 %
1170 %
1171 % \changes{v1.1a}{1997/10/20}{Removed \cs{aa} and \cs{AA} from
1172 % \cs{@uclclist} as these are macros.}
1173 % \changes{v2.2r}{2022/02/20}{use \cs{text_lowercase:n}}%
1174 % And whilst we're doing things with uc/lc tables, here are two
1175 % commands to upper- and lower-case a string.
1176 %
1177 %
1178 % \changes{v2.1h}{2019/09/14}{Expand UTF8 chars when case changing (github/177)}
1179 % \changes{v2.2r}{2022/02/20}
1180 % {Use \cs{@expl@text@uppercase@@n}, removing local redefinition of \cs{UTF@two@octets@noexpand}}%
1181 % \changes{v2.2t}{2022/04/21}{Support \cs{noexpand} in argument of \cs{@expl@text@uppercase@@n}}
1182 % \changes{v2.2v}{2022/06/30}{Just use \cs{text_lowercase:n} without \cs{protectd@edf} gh/881x}%
1183 % \changes{v2.2w}{2022/07/04}{Introduced \cs{CaseSwitch}, \cs{DeclareCaseChangeEquivalent} and \cs{MakeTitlecase} to support hooking into case changing gh/889}%
1184 % \changes{v2.2x}{2022/10/26}{Introduce optional argument for case-changing commands}
1185 % \changes{v2.2x}{2022/10/26}{Make case changing commands language-aware}
1186 % \changes{v2.2x}{2022/10/26}{Auto-detect \pkg{babel} locale}
1187 % \changes{v2.3a}{2023/04/11}{Use new generic mechanism to detect locale}
1188 % \changes{v2.3d}{2024/11/12}{Use updated titlecase-first function in \pkg{expl3}}
1189 % \changes{v2.3d}{2024/11/12}{Add option to titlecase first or all words}
1190 % \changes{v2.3f}{2025/06/04}{Add default for titlecasing}
1191 % Wrappers around the L3 case changing functions.
1192 % |\protected| to make them mostly safe as replacements for |uppercase|
1193 % and |\lowercase|.
1194 %
1195 % In
1196 %\begin{verbatim}
1197 % \markboth{\MakeUppercase\contentsname}
1198 % {\MakeUppercase\contentsname}
1199 %\end{verbatim}
1200 % then the uppercasing is only done to the first letter of the
1201 % contents name, since the mark expands out to:
1202 %\begin{verbatim}
1203 % \mark{\MakeUppercase Table of Contents}
1204 % {\MakeUppercase Table of Contents}
1205 %\end{verbatim}
1206 % In order to get round this, we redefine |\MakeUppercase| and
1207 % |\MakeLowercase| to grab their argument and brace it.
1208 %
1209 % Earlier versions needed to process |\@uclclist| in an |\edef|
1210 % to handle legacy input encodings, but recent (2022) expl3 versions
1211 % handle non-UTF8 text natively so we simply call the |\text_...case:n|
1212 % functions.
1213 % \begin{macrocode}
1214 \ExplSyntaxOn
1215 \keys_define:nn { __kernel }
1216 {
1217 lang .str_set:N = \reserved@a ,
1218 locale .str_set:N = \reserved@a ,
1219 words .choices:nn =
1220 { all , first }
1221 { \str_set:Nn \reserved@b {#1} }
1222 }
1223 \cs_new_protected:Npn \@@text@case@aux #1#2#3
1224 {
1225 \cs_set_nopar:Npn \reserved@a { }
1226 \cs_set_nopar:Npn \reserved@b { first }
1227 \tl_if_blank:nTF {#2}
1228 {
1229 \str_set:Ne \reserved@a
1230 { \BCPdata { casing } }
1231 \str_if_empty:NT \reserved@a
1232 {
1233 \str_set:Ne \reserved@a
1234 { \BCPdata { language } }
1235 }
1236 }
1237 { \keys_set:nn { __kernel } {#2} }
1238 \use:c { text_ #1 :Vn } \reserved@a {#3}
1239 }
1240 % \end{macrocode}
1241 % The odd use of \emph{three} spaces here is needed as \pkg{ltcmd} uses the
1242 % name with one and two spaces to give a `friendly' error message for a runaway
1243 % argument: that means we can't use it here.
1244 % \begin{macrocode}
1245 \exp_args_generate:n { cnx }
1246 \cs_set_protected:Npn \reserved@a #1
1247 {
1248 \cs_generate_variant:cn { text_ \str_lowercase:n {#1} case:nn } { V }
1249 \ExpandArgs { cnx } \NewExpandableDocumentCommand
1250 { Make#1case }
1251 { O{} +m }
1252 { \exp_not:c { Make#1case \c_space_tl \c_space_tl \c_space_tl } [####1] {####2} }
1253 }
1254 \reserved@a { Upper }
1255 \reserved@a { Lower }
1256 \reserved@a { Title }
1257 % \end{macrocode}
1258 % These don't get covered above so we do them manually.
1259 % \begin{macrocode}
1260 \cs_generate_variant:Nn \text_titlecase_all:nn { V }
1261 \cs_generate_variant:Nn \text_titlecase_first:nn { V }
1262 % \end{macrocode}
1263 % \changes{v2.2y}{2022/11/30}{Set \cs{oe}/\cs{OE} equal to act as a marker for \pkg{babel}}
1264 % \changes{v2.2z}{2023/03/28}{Use groups for gh/1021}
1265 % Currently, \pkg{babel} uses the equivalence of \cs{oe} and \cs{OE} to force casing of
1266 % some material, most notably in \cs{today}. To enable that to work, we have to set those
1267 % commands equal even though the current case changing code does not work using this
1268 % approach.
1269 % \begin{macrocode}
1270 \cs_new_protected:cpn { MakeLowercase \c_space_tl \c_space_tl \c_space_tl } [#1] #2
1271 {{
1272 \let \OE \oe
1273 \@@text@case@aux { lowercase } {#1} {#2}
1274 }}
1275 \cs_new_protected:cpn { MakeUppercase \c_space_tl \c_space_tl \c_space_tl } [#1] #2
1276 {{
1277 \let \oe \OE
1278 \@@text@case@aux { uppercase } {#1} {#2}
1279 }}
1280 \cs_new_protected:cpn { MakeTitlecase \c_space_tl \c_space_tl \c_space_tl } [#1] #2
1281 {{
1282 \let \oe \OE
1283 \@@text@case@aux { titlecase_ \reserved@b } {#1} {#2}
1284 }}
1285 % \end{macrocode}
1286 %
1287 % \changes{v2.2u}{2022/06/02}{Add \cs{NoCaseChange}}
1288 % \changes{v2.2u}{2022/06/30}{Add \cs{AddToNoCaseChangeList}}
1289 % \changes{v2.3b}{2023/04/19}{Add \cs{DeclareLowercaseMapping},
1290 % \cs{DeclareTitlecaseMapping} and \cs{DeclareUppercaseMapping}}
1291 % \changes{v2.3c}{2023/05/30}{Fix a typo in implementation of
1292 % \cs{DeclareLowercaseMapping}, etc.}
1293 % |\NoCaseChange| protects its argument from the case change functions.
1294 %
1295 % |\AddToNoCaseChangeList| Allows new commands to protect their arguments, eg
1296 % |AddToNoCaseChangeList{\eqref}| would protect the argument of |\eqref|
1297 % in the same way as the argument of |\ref|.
1298 % \begin{macrocode}
1299 \cs_new_protected_nopar:Npn\AddToNoCaseChangeList
1300 {\tl_put_right:Nn \l_text_case_exclude_arg_tl}
1301 \AddToNoCaseChangeList{ \NoCaseChange }
1302 \cs_new_protected:Npn \NoCaseChange #1 {#1}
1303 \cs_new_eq:NN \CaseSwitch \text_case_switch:nnnn
1304 \cs_new_eq:NN \DeclareCaseChangeEquivalent
1305 \text_declare_case_equivalent:Nn
1306 \NewDocumentCommand \DeclareLowercaseMapping { o m m }
1307 {
1308 \IfNoValueTF {#1}
1309 { \text_declare_lowercase_mapping:nn }
1310 { \text_declare_lowercase_mapping:nnn {#1} }
1311 {#2} {#3}
1312 }
1313 \NewDocumentCommand \DeclareTitlecaseMapping { o m m }
1314 {
1315 \IfNoValueTF {#1}
1316 { \text_declare_titlecase_mapping:nn }
1317 { \text_declare_titlecase_mapping:nnn {#1} }
1318 {#2} {#3}
1319 }
1320 \NewDocumentCommand \DeclareUppercaseMapping { o m m }
1321 {
1322 \IfNoValueTF {#1}
1323 { \text_declare_uppercase_mapping:nn }
1324 { \text_declare_uppercase_mapping:nnn {#1} }
1325 {#2} {#3}
1326 }
1327 % \end{macrocode}
1328 %
1329 % \changes{v2.3g}{2025-07-01}{Add \cs{DeclareLowercaseExclusions},
1330 % \cs{DeclareTitlecaseExclusions} and \cs{DeclareUppercaseExclusions}}
1331 % \begin{macrocode}
1332 \cs_new_protected:Npn \DeclareLowercaseExclusions #1
1333 {
1334 \clist_map_inline:nn {#1}
1335 { \text_declare_lowercase_exclusion:n {##1} }
1336 }
1337 \cs_new_protected:Npn \DeclareTitlecaseExclusions #1
1338 {
1339 \clist_map_inline:nn {#1}
1340 { \text_declare_titlecase_exclusion:n {##1} }
1341 }
1342 \cs_new_protected:Npn \DeclareUppercaseExclusions #1
1343 {
1344 \clist_map_inline:nn {#1}
1345 { \text_declare_uppercase_exclusion:n {##1} }
1346 }
1347 \ExplSyntaxOff
1348 % \end{macrocode}
1349 %
1350 % \changes{v2.2q}{2021/09/06}{Correctly upper and lowercase
1351 % \cs{ij} and \cs{IJ} (gh/658)}
1352 % \begin{macrocode}
1353 \def\@uclclist{\oe\OE\o\O\ae\AE
1354 \dh\DH\dj\DJ\l\L\ng\NG\ss\SS\ij\IJ\th\TH}
1355 % \end{macrocode}
1356 %
1357 % \end{macro}
1358 % \end{macro}
1359 % \end{macro}
1360 % \end{macro}
1361 % \end{macro}
1362 % \end{macro}
1363 % \end{macro}
1364 % \end{macro}
1365 % \end{macro}
1366 % \end{macro}
1367 % \end{macro}
1368 % \end{macro}
1369 % \end{macro}
1370 % \end{macro}
1371 %
1372 % \changes{v1.0h}{1994/05/13}{Added output enc stuff}
1373 % \changes{v1.0i}{1994/05/16}{moved output enc stuff to lfonts}
1374 %
1375 % \changes{v0.1a}{1994/03/07}{Add code from the old dump.dtx}
1376 %
1377 % \subsection{Automatic insertion of \cs{par} tokens}
1378 % \changes{v2.3h}{2025/09/23}{Setting \cs{partokencontext}}
1379 % Since 2022 the major \TeX\ engines have a parameter, \cs{partokencontext},
1380 % that controls whether a \cs{par} token is added if \TeX\ is in horizontal mode
1381 % at the end of \cs{vbox} and similar contexts. This gives more control
1382 % than the classical behaviour where the internal \textit{end paragraph} routine
1383 % is invoked with no explicit token being added.
1384 %
1385 % Setting \cs{partokencontext} to 2 ensures a literal \cs{par} is
1386 % used in all contexts, setting to 0 reverts to the classic \TeX\ behavior.
1387 % \begin{macrocode}
1388 %</2ekernel>
1389 %<*2ekernel|latexrelease>
1390 %<latexrelease>\IncludeInRelease{2025/11/01}%
1391 %<latexrelease> {\partokencontext}{automatic par insertion}%
1392 \ifdefined\partokencontext\partokencontext=\tw@\fi
1393 %</2ekernel|latexrelease>
1394 %<latexrelease>\EndIncludeInRelease
1395 %<latexrelease>\IncludeInRelease{0000/00/00}%
1396 %<latexrelease> {\partokencontext}{automatic par insertion}%
1397 %<latexrelease>\ifdefined\partokencontext\partokencontext=\z@\fi
1398 %<latexrelease>\EndIncludeInRelease
1399 %<*2ekernel>
1400 % \end{macrocode}
1401 %
1402 % \subsection{Applying Patch files}
1403 % Between major releases, small patches will be distributed in
1404 % files |ltpatch.ltx| which must be added at this point.
1405 % \changes{v1.0m}{1994/06/08}{Add patch file system}
1406 % \changes{v2.0h}{2015/06/23}
1407 % {set \cs{patch@level} in ltvers rather than in ltfinal/ltpatch}
1408 %
1409 % Patch file code removed.
1410 % \begin{macrocode}
1411 %\IfFileExists{ltpatch.ltx}
1412 % {\typeout{=================================^^J%
1413 % Applying patch file ltpatch.ltx^^J%
1414 % =================================}
1415 % \def\fmtversion@topatch{unknown}
1416 % \input{ltpatch.ltx}
1417 % \ifx\fmtversion\fmtversion@topatch
1418 % \ifx\patch@level\@undefined
1419 % \typeout{^^J^^J^^J%
1420 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
1421 % !! Patch file `ltpatch.ltx' not suitable for this^^J%
1422 % !! version of LaTeX.^^J^^J%
1423 % !! Please check if initex found an old patch file:^^J%
1424 % !! --- if so, rename it or delete it, and redo the^^J%
1425 % !! initex run.^^J%
1426 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}%
1427 % \batchmode \@@end
1428 % \else
1429 % \end{macrocode}
1430 % \changes{v1.0q}{1995/04/21}
1431 % {Allow initial patch level 0}
1432 % \changes{v1.0t}{1995/06/13}
1433 % {Add patch level string more carefully}
1434 % The code below adds the `patch level' string to the first |\typeout|
1435 % in the startup banner.
1436 % \begin{macrocode}
1437 % \def\fmtversion@topatch{0}%
1438 % \ifx\fmtversion@topatch\patch@level\else
1439 % \def\reserved@a\typeout##1##2\reserved@a{%
1440 % \typeout{##1 patch level \patch@level}##2}
1441 % \everyjob\expandafter\expandafter\expandafter{%
1442 % \expandafter\reserved@a\the\everyjob\reserved@a}
1443 % \let\reserved@a\relax
1444 % \the\everyjob
1445 % \fi
1446 % \fi
1447 % \else
1448 % \typeout{^^J^^J^^J%
1449 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
1450 % !! Patch file `ltpatch.ltx' (for version <\fmtversion@topatch>)^^J%
1451 % !! is not suitable for version <\fmtversion> of LaTeX.^^J^^J%
1452 % !! Please check if initex found an old patch file:^^J%
1453 % !! --- if so, rename it or delete it, and redo the^^J%
1454 % !! initex run.^^J%
1455 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}%
1456 % \batchmode \@@end
1457 % \fi
1458 % \let\fmtversion@topatch\relax
1459 % }{}
1460 % \end{macrocode}
1461 %
1462 % \changes{v2.2}{2019-10-02}{Load \textsf{ltexpl}}
1463 % \changes{v2.2a}{2020-06-04}{Load \textsf{ltexpl} in \texttt{ltdefns}}
1464 %
1465 % \subsection{Freeing Memory}
1466 %
1467 % \begin{macro}{\reserved@a}
1468 % \begin{macro}{\reserved@b}
1469 % \changes{v1.0v}{1995/10/17}{reset here after the \cs{input} above}
1470 % And just to make sure nobody relies on those definitions of
1471 % |\reserved@b| and friends.
1472 % These macros are reserved for use in the kernel. \emph{Do not use
1473 % them as general scratch macros}.
1474 % \begin{macrocode}
1475 \let\reserved@a\@filelist
1476 \let\reserved@b=\@undefined
1477 \let\reserved@c=\@undefined
1478 \let\reserved@d=\@undefined
1479 \let\reserved@e=\@undefined
1480 \let\reserved@f=\@undefined
1481 % \end{macrocode}
1482 % \end{macro}
1483 % \end{macro}
1484 %
1485 % \begin{macro}{\toks}
1486 % \changes{v1.0y}{1996/07/10}
1487 % {Free up memory from scratch registers /2213}
1488 % \begin{macrocode}
1489 \toks0{}
1490 \toks2{}
1491 \toks4{}
1492 \toks6{}
1493 \toks8{}
1494 % \end{macrocode}
1495 % \end{macro}
1496 %
1497 % \begin{macro}{\errhelp}
1498 % \changes{v0.1g}{1994/05/05}{Set error help empty.}
1499 % \changes{v1.1d}{2000/09/01}{Set error help empty at very end
1500 % (pr/449 done correctly).}
1501 % Empty the error help message, which may have some rubbish:
1502 % \begin{macrocode}
1503 \errhelp{}
1504 % \end{macrocode}
1505 % \end{macro}
1506 %
1507 % \subsection{Initialise file list}
1508 %
1509 % \begin{macro}{\@providesfile}
1510 % \changes{v1.0v}{1995/10/17}{reset macro}
1511 % Initialise for use in the document. During initex a modified version
1512 % has been used which leaves debugging information for |latexbug.tex|.
1513 % \begin{macrocode}
1514 \def\@providesfile#1[#2]{%
1515 \wlog{File: #1 #2}%
1516 \expandafter\xdef\csname ver@#1\endcsname{#2}%
1517 \endgroup}
1518 % \end{macrocode}
1519 % \end{macro}
1520 %
1521 % \begin{macro}{\@filelist}
1522 % \changes{v1.0w}{1995/10/19}{Move after \cs{reserved@a} setting}
1523 % \begin{macro}{\@addtofilelist}
1524 % \changes{v2.3i}{2025/11/27}{Support commas in file names (gh/1920)}
1525 % \begin{macro}{\@addtofilelist@aux}
1526 % \changes{v2.3i}{2025/11/27}{New macro}
1527 % Reset |\@filelist| so files input while making the format are not
1528 % listed. The list built up so far may take up a lot of memory and so
1529 % it is moved to |\reserved@a| where it will be overwritten as soon
1530 % as almost any \LaTeX\ command is issued in a class file.
1531 % However the |latexbug.tex| program will be able to access this
1532 % information and insert it into a bug report.
1533 % \begin{macrocode}
1534 \let\@filelist\@gobble
1535 \def\@addtofilelist#1{\xdef\@filelist
1536 {\@filelist,\expanded{\noexpand\@addtofilelist@aux#1},\@nil{#1}}}
1537 \def\@addtofilelist@aux#1,#2\@nil#3{%
1538 \if\relax\detokenize\expandafter{\@gobble#2?}\relax
1539 #1%
1540 \else
1541 {#3}%
1542 \fi
1543 }
1544 % \end{macrocode}
1545 % \end{macro}
1546 % \end{macro}
1547 % \end{macro}
1548 %
1549 % \subsection{Preparation for supporting PDF in backends}
1550 %
1551 % At the current point in time, basic support for PDF in
1552 % backends is not part of \LaTeX{} core; it is provided by external
1553 % packages. At some time in the future that work will be placed
1554 % into the kernel but for now it is separate and has to be
1555 % explicitly loaded in the document.
1556 %
1557 % In that code there is a command \cs{IfPDFManagementActiveTF}
1558 % which can be used by packages in order to execute different
1559 % code depending on the whether this basic backend support is loaded.
1560 %
1561 % To make this also work properly when this external package is not
1562 % loaded at all, we here add this command already in the
1563 % kernel (with a trivial definition); thus any package can
1564 % query this loading state in all circumstances.
1565 % Once this basic PDF backend
1566 % support gets moved to the kernel, this definition will vanish
1567 % again from here or, rather, it will be replaced by a real test.
1568 %
1569 % \begin{macro}{\IfPDFManagementActiveTF}
1570 % So long as the code for the basic backend support for PDF is not
1571 % loaded, the test that is implicit here will
1572 % always return the false branch.
1573 % Once this code is loaded, this definition will get
1574 % replaced by a real test (as it is then possible that the
1575 % management code is either activated or not activated).
1576 % \changes{v2.2p}{2021/08/08}{Default definition added (gh/640)}
1577 % \begin{macrocode}
1578 \let \IfPDFManagementActiveTF \@secondoftwo
1579 % \end{macrocode}
1580 %
1581 % The T/F variants are defined in a way that they continue to work
1582 % when the main definition changes.
1583 % \changes{v2.3e}{2025/03/01}{Provide T F variants of
1584 % \cs{IfPDFManagementActiveTF} (gh/1522)}
1585 % \begin{macrocode}
1586 \long\def\IfPDFManagementActiveT#1{\IfPDFManagementActiveTF{#1}{}}
1587 \def\IfPDFManagementActiveF{\IfPDFManagementActiveTF{}}
1588 % \end{macrocode}
1589 % \end{macro}
1590 %
1591 %
1592 %
1593 % \subsection{Do some temporary work for pre-release}
1594 %
1595 % This is a good place to load code that hasn't yet been
1596 % integrated into the other files \ldots
1597 % \begin{macrocode}
1598 % \end{macrocode}
1599 %
1600 % \subsection{Some last minute initializations \ldots}
1601 %
1602 % Load the first aid set of definitions for external packages that await updates.
1603 % \changes{v2.2j}{2020/09/26}
1604 % {Load first aid file if existing}
1605 % \begin{macrocode}
1606 \@input{latex2e-first-aid-for-external-files.ltx}
1607 % \end{macrocode}
1608 %
1609 %
1610 % \subsection{Dumping the format}
1611 % Finally we make |@| into a letter, ensure the format will
1612 % be in the `normal' error mode, and dump everything into the
1613 % format file.
1614 % \changes{v1.0t}{1995/06/13}
1615 % {Call \cs{errorstopmode}}
1616 % \begin{macrocode}
1617 \makeatother
1618 \errorstopmode
1619 \dump
1620 %</2ekernel>
1621 % \end{macrocode}
1622 %
1623 %
1624 % \begin{macrocode}
1625 %<*glyphtounicode>
1626 %% A subset of glyhtounicode-cmr.tex
1627 %
1628 %% Copyright (c) 2008, Han The Thanh <[email protected]>
1629 %% Copyright (c) 2014, Peter Selinger <[email protected]>
1630 %% Copyright (c) 2018, Ross Moore <[email protected]>
1631 %%
1632
1633 %% Glyphs from the cmex fonts:
1634
1635 \pdfglyphtounicode{angbracketleftBig}{27E8 FE02}
1636 \pdfglyphtounicode{angbracketleftBigg}{27E8 FE04}
1637 \pdfglyphtounicode{angbracketleftbig}{27E8 FE01}
1638 \pdfglyphtounicode{angbracketleftbigg}{27E8 FE03}
1639 \pdfglyphtounicode{angbracketrightBig}{27E9 FE02}
1640 \pdfglyphtounicode{angbracketrightBigg}{27E9 FE04}
1641 \pdfglyphtounicode{angbracketrightbig}{27E9 FE01}
1642 \pdfglyphtounicode{angbracketrightbigg}{27E9 FE03}
1643 \pdfglyphtounicode{arrowbt}{2193}
1644 \pdfglyphtounicode{arrowdblbt}{21D3}
1645 \pdfglyphtounicode{arrowdbltp}{21D1}
1646 \pdfglyphtounicode{arrowhookleft}{21AA}
1647 \pdfglyphtounicode{arrowhookright}{21A9}
1648 \pdfglyphtounicode{arrowtp}{2191}
1649 \pdfglyphtounicode{arrowvertex}{23D0}
1650 \pdfglyphtounicode{arrowvertexdbl}{20E6}% was {ED12}% PUA
1651 \pdfglyphtounicode{backslashBig}{005C FE02}
1652 \pdfglyphtounicode{backslashBigg}{005C FE04}
1653 \pdfglyphtounicode{backslashbig}{005C FE01}
1654 \pdfglyphtounicode{backslashbigg}{005C FE03}
1655 \pdfglyphtounicode{braceex}{23AA}
1656 \pdfglyphtounicode{bracehtipdownleft}{23DF}% was {ED17}% PUA
1657 \pdfglyphtounicode{bracehtipdownright}{23DF}% was {ED18}% PUA
1658 \pdfglyphtounicode{bracehtipupleft}{23DE}% was {ED19}% PUA
1659 \pdfglyphtounicode{bracehtipupright}{23DE}% was {ED1A}% PUA
1660 \pdfglyphtounicode{braceleftBig}{007B FE02}
1661 \pdfglyphtounicode{braceleftBigg}{007B FE04}
1662 \pdfglyphtounicode{braceleftbig}{007B FE01}
1663 \pdfglyphtounicode{braceleftbigg}{007B FE03}
1664 \pdfglyphtounicode{braceleftbt}{23A9}
1665 \pdfglyphtounicode{braceleftmid}{23A8}
1666 \pdfglyphtounicode{bracelefttp}{23A7}
1667 \pdfglyphtounicode{bracerightBig}{007D FE02}
1668 \pdfglyphtounicode{bracerightBigg}{007D FE04}
1669 \pdfglyphtounicode{bracerightbig}{007D FE01}
1670 \pdfglyphtounicode{bracerightbigg}{007D FE03}
1671 \pdfglyphtounicode{bracerightbt}{23AD}
1672 \pdfglyphtounicode{bracerightmid}{23AC}
1673 \pdfglyphtounicode{bracerighttp}{23AB}
1674 \pdfglyphtounicode{bracketleftBig}{005B FE02}
1675 \pdfglyphtounicode{bracketleftBigg}{005B FE04}
1676 \pdfglyphtounicode{bracketleftbig}{005B FE01}
1677 \pdfglyphtounicode{bracketleftbigg}{005B FE03}
1678 \pdfglyphtounicode{bracketleftbt}{23A3}
1679 \pdfglyphtounicode{bracketleftex}{23A2}
1680 \pdfglyphtounicode{bracketlefttp}{23A1}
1681 \pdfglyphtounicode{bracketrightBig}{005D FE02}
1682 \pdfglyphtounicode{bracketrightBigg}{005D FE04}
1683 \pdfglyphtounicode{bracketrightbig}{005D FE01}
1684 \pdfglyphtounicode{bracketrightbigg}{005D FE03}
1685 \pdfglyphtounicode{bracketrightbt}{23A6}
1686 \pdfglyphtounicode{bracketrightex}{23A5}
1687 \pdfglyphtounicode{bracketrighttp}{23A4}
1688 \pdfglyphtounicode{ceilingleftBig}{2308 FE02}
1689 \pdfglyphtounicode{ceilingleftBigg}{2308 FE04}
1690 \pdfglyphtounicode{ceilingleftbig}{2308 FE01}
1691 \pdfglyphtounicode{ceilingleftbigg}{2308 FE03}
1692 \pdfglyphtounicode{ceilingrightBig}{2309 FE02}
1693 \pdfglyphtounicode{ceilingrightBigg}{2309 FE04}
1694 \pdfglyphtounicode{ceilingrightbig}{2309 FE01}
1695 \pdfglyphtounicode{ceilingrightbigg}{2309 FE03}
1696 \pdfglyphtounicode{circledotdisplay}{2A00 FE02}
1697 \pdfglyphtounicode{circledottext}{2A00 FE01}
1698 \pdfglyphtounicode{circlemultiplydisplay}{2A02 FE02}
1699 \pdfglyphtounicode{circlemultiplytext}{2A02 FE01}
1700 \pdfglyphtounicode{circleplusdisplay}{2A01 FE02}
1701 \pdfglyphtounicode{circleplustext}{2A01 FE01}
1702 \pdfglyphtounicode{contintegraldisplay}{222E FE02}
1703 \pdfglyphtounicode{contintegraltext}{222E FE01}
1704 \pdfglyphtounicode{coproductdisplay}{2210 FE02}
1705 \pdfglyphtounicode{coproducttext}{2210 FE01}
1706 \pdfglyphtounicode{floorleftBig}{230A FE02}
1707 \pdfglyphtounicode{floorleftBigg}{230A FE04}
1708 \pdfglyphtounicode{floorleftbig}{230A FE01}
1709 \pdfglyphtounicode{floorleftbigg}{230A FE03}
1710 \pdfglyphtounicode{floorrightBig}{230B FE02}
1711 \pdfglyphtounicode{floorrightBigg}{230B FE04}
1712 \pdfglyphtounicode{floorrightbig}{230B FE01}
1713 \pdfglyphtounicode{floorrightbigg}{230B FE03}
1714 \pdfglyphtounicode{hatwide}{02C6 FE01}
1715 \pdfglyphtounicode{hatwider}{02C6 FE02}
1716 \pdfglyphtounicode{hatwidest}{02C6 FE03}
1717 \pdfglyphtounicode{integraldisplay}{222B FE02}
1718 \pdfglyphtounicode{integraltext}{222B FE01}
1719 \pdfglyphtounicode{intersectiondisplay}{22C2 FE02}
1720 \pdfglyphtounicode{intersectiontext}{22C2 FE01}
1721 \pdfglyphtounicode{logicalanddisplay}{22C0 FE02}
1722 \pdfglyphtounicode{logicalandtext}{22C0 FE01}
1723 \pdfglyphtounicode{logicalordisplay}{22C1 FE02}
1724 \pdfglyphtounicode{logicalortext}{22C1 FE01}
1725 \pdfglyphtounicode{mapsto}{21A6}
1726 \pdfglyphtounicode{parenleftBig}{0028 FE02}
1727 \pdfglyphtounicode{parenleftBigg}{0028 FE04}
1728 \pdfglyphtounicode{parenleftbig}{0028 FE01}
1729 \pdfglyphtounicode{parenleftbigg}{0028 FE03}
1730 \pdfglyphtounicode{parenleftbt}{239D}
1731 \pdfglyphtounicode{parenleftex}{239C}
1732 \pdfglyphtounicode{parenlefttp}{239B}
1733 \pdfglyphtounicode{parenrightBig}{0029 FE02}
1734 \pdfglyphtounicode{parenrightBigg}{0029 FE04}
1735 \pdfglyphtounicode{parenrightbig}{0029 FE01}
1736 \pdfglyphtounicode{parenrightbigg}{0029 FE03}
1737 \pdfglyphtounicode{parenrightbt}{23A0}
1738 \pdfglyphtounicode{parenrightex}{239F}
1739 \pdfglyphtounicode{parenrighttp}{239E}
1740 \pdfglyphtounicode{productdisplay}{220F FE02}
1741 \pdfglyphtounicode{producttext}{220F FE01}
1742 \pdfglyphtounicode{radicalBig}{221A FE02}
1743 \pdfglyphtounicode{radicalBigg}{221A FE04}
1744 \pdfglyphtounicode{radicalbig}{221A FE01}
1745 \pdfglyphtounicode{radicalbigg}{221A FE03}
1746 \pdfglyphtounicode{radicalbt}{23B7}% was {221A}
1747 \pdfglyphtounicode{radicaltp}{231C}% was {ED6A}% PUA
1748 \pdfglyphtounicode{radicalvertex}{20D3}% was {ED6B}% PUA
1749 \pdfglyphtounicode{slashBig}{002F FE02}
1750 \pdfglyphtounicode{slashBigg}{002F FE04}
1751 \pdfglyphtounicode{slashbig}{002F FE01}
1752 \pdfglyphtounicode{slashbigg}{002F FE03}
1753 \pdfglyphtounicode{summationdisplay}{2211 FE02}
1754 \pdfglyphtounicode{summationtext}{2211 FE01}
1755 \pdfglyphtounicode{tie}{2040}
1756 \pdfglyphtounicode{tildewide}{02DC FE01}
1757 \pdfglyphtounicode{tildewider}{02DC FE02}
1758 \pdfglyphtounicode{tildewidest}{02DC FE03}
1759 \pdfglyphtounicode{uniondisplay}{22C3 FE02}
1760 \pdfglyphtounicode{unionmultidisplay}{2A04 FE02}
1761 \pdfglyphtounicode{unionmultitext}{2A04 FE01}
1762 \pdfglyphtounicode{unionsqdisplay}{2A06 FE02}
1763 \pdfglyphtounicode{unionsqtext}{2A06 FE01}
1764 \pdfglyphtounicode{uniontext}{22C3 FE01}
1765 \pdfglyphtounicode{vextenddouble}{20E6}% was {ED79}% PUA
1766 \pdfglyphtounicode{vextendsingle}{20D3}%%% was {23D0}
1767 %</glyphtounicode>
1768 % \end{macrocode}
1769 % \Finale
1770 %