1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
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.
31 %%% From File: ltfinal.dtx
35 \ProvidesFile{ltfinal.dtx}
36 [2016/01/05 v2.0o LaTeX Kernel (Final Settings)]
38 \documentclass{ltxdoc}
39 \GetFileInfo{ltfinal.dtx}
51 \MaintainedByLaTeXTeam{latex}
53 \DocInput{ltfinal.dtx}
60 % \section{Final settings}
61 % This section contains the final settings for \LaTeX. It initialises
62 % some debugging and typesetting parameters, sets the default
63 % |\catcode|s and uc/lc codes, and inputs the hyphenation file.
67 % \changes{v0.1a}{1994/03/07}{Initial version, split from latex.dtx}
68 % \changes{v0.1a}{1994/03/07}{Remove oldcomments environment}
69 % \changes{v0.1c}{1994/04/21}{Added comments, set the catcodes of
71 % \changes{v0.1d}{1994/04/23}{Check that \cs{font@submax} is still zero}
72 % \changes{v0.1e}{1994/05/02}{Set all the catcodes}
73 % \changes{v0.1f}{1994/05/03}{Set the catcode of control-J to be
74 % `other', for use in messages.}
75 % \changes{v0.1g}{1994/05/05}{Added empty errhelp.}
76 % \changes{v0.1h}{1994/05/13}{Added package ot1enc, and defined
77 % \cs{@acci}, \cs{@accii} and \cs{@acciii}.}
78 % \changes{v0.1j}{1994/05/18}{Corrected the lccode for d-bar.}
79 % \changes{v0.1k}{1994/05/19}{Removed \cs{makeat...}}
80 % \changes{v1.0n}{1994/05/31}{Renamed lthyphen.* to lthyphen.*.}
81 % \changes{v1.0o}{1994/11/17}
82 % {\cs{@tempa} to \cs{reserved@a}}
83 % \changes{v1.0p}{1994/12/01}
84 % {Renamed lthyphen.* to hyphen.*.}
85 % \changes{v1.0r}{1995/06/05}
86 % {Added \cs{MakeUppercase} and \cs{MakeLowercase}.}
87 % \changes{v1.0s}{1995/06/06}
88 % {Made \cs{MakeUppercase} and \cs{MakeLowercase} brace their
91 % \subsection{Debugging}
93 % By default, \LaTeX{} shows statistics:
99 % \subsection{Typesetting parameters}
101 % \begin{macro}{\@lowpenalty}
102 % \begin{macro}{\@medpenalty}
103 % \begin{macro}{\@highpenalty}
104 % These are penalties used internally.
106 \newcount\@lowpenalty
107 \newcount\@medpenalty
108 \newcount\@highpenalty
115 %\begin{macro}{\newmarks}
116 % \changes{v2.0a}{2014/12/30}{macro added}
117 % \changes{v2.0b}{2015/01/23}{use reserved count 256}
118 % \changes{v2.0g}{2015/06/19}{Use $-1$ for first range to get contiguous allocation}
119 % Allocate extended marks types if etex is active.
120 % Placed here at the end of the format
121 % to increase compatibility with count allocations
122 % in earlier releases.
125 %<*2ekernel|latexrelease>
126 %<latexrelease>\IncludeInRelease{2015/01/01}%
127 %<latexrelease> {\newmarks}{Extended Allocation}%
131 \ifx\marks\@undefined\else
133 \e@alloc\marks \e@alloc@chardef{\count256}\m@ne\e@alloc@top}
138 %</2ekernel|latexrelease>
139 %<latexrelease>\EndIncludeInRelease
140 %<latexrelease>\IncludeInRelease{0000/00/00}%
141 %<latexrelease> {\newmarks}{Extended Allocation}%
142 %<latexrelease>\let\newmarks\@undefined
143 %<latexrelease>\EndIncludeInRelease
148 %\begin{macro}{\newXeTeXintercharclass}
149 % \changes{v2.0a}{2014/12/30}{macro added}
150 % \changes{v2.0b}{2015/01/23}{use reserved count 257}
151 % \changes{v2.0f}{2015/04/28}{define \cs{xe@alloc@intercharclass} for compatibility with older xelatex initilisation}
152 %\begin{macro}{\xe@alloc@intercharclass}
153 % \changes{v2.0j}{2016/01/04}{Start allocation at one not three}
154 % \changes{v2.0k}{2016/01/05}{Remove duplicated code}
155 % Allocate |\XeTeXintercharclass| types if xetex is active.
156 % previously defined in |xetex.ini|.
160 %<*2ekernel|latexrelease>
161 %<latexrelease>\IncludeInRelease{2015/01/01}%
162 %<latexrelease> {\newXeTeXintercharclass}{Extended Allocation}%
165 % Classes allocated 1 to 254 (early 1, 2 and 3 were pre-set for CJK).
166 % \changes{v2.0g}{2015/06/19}{Use $-1$ for first range to get contiguous allocation}
168 \ifx\XeTeXcharclass\@undefined
170 \def\newXeTeXintercharclass{%
171 \e@alloc\XeTeXcharclass\chardef\xe@alloc@intercharclass\m@ne\@cclv}
176 %</2ekernel|latexrelease>
177 %<latexrelease>\EndIncludeInRelease
178 %<latexrelease>\IncludeInRelease{0000/00/00}%
179 %<latexrelease> {\newXeTeXintercharclass}{Extended Allocation}%
180 %<latexrelease> \ifx\XeTeXcharclass\@undefined
181 %<latexrelease> \else
182 %<latexrelease> \def\xe@alloc@#1#2#3#4#5{\global\advance#1\@ne
183 %<latexrelease> \xe@ch@ck#1#4#2%
184 %<latexrelease> \allocationnumber#1%
185 %<latexrelease> \global#3#5\allocationnumber
186 %<latexrelease> \wlog{\string#5=\string#2\the\allocationnumber}}
187 %<latexrelease> \def\xe@ch@ck#1#2#3{%
188 %<latexrelease> \ifnum#1<#2\else
189 %<latexrelease> \errmessage{No room for a new #3}%
191 %<latexrelease> \def\newXeTeXintercharclass{%
192 %<latexrelease> \xe@alloc@\xe@alloc@intercharclass
193 %<latexrelease> \XeTeXcharclass\chardef\@cclv}
195 %<latexrelease>\EndIncludeInRelease
196 %<*2ekernel|latexrelease>
197 %<latexrelease>\IncludeInRelease{2016/01/01}%
198 %<latexrelease> {\xe@alloc@intercharclass}{Start of XeTeX class allocator}%
199 \ifx\XeTeXcharclass\@undefined
201 \countdef\xe@alloc@intercharclass=257
202 \xe@alloc@intercharclass=\z@
204 %</2ekernel|latexrelease>
205 %<latexrelease>\EndIncludeInRelease
206 %<latexrelease>\IncludeInRelease{2015/01/01}%
207 %<latexrelease> {\xe@alloc@intercharclass}{Start of XeTeX class allocator}%
208 %<latexrelease> \ifx\XeTeXcharclass\@undefined
209 %<latexrelease> \else
210 %<latexrelease> \xe@alloc@intercharclass=\thr@@
212 %<latexrelease>\EndIncludeInRelease
213 %<latexrelease>\IncludeInRelease{0000/00/00}%
214 %<latexrelease> {\xe@alloc@intercharclass}{Start of XeTeX class allocator}%
215 %<latexrelease> \ifx\XeTeXcharclass\@undefined
216 %<latexrelease> \else
217 %<latexrelease> \newcount\xe@alloc@intercharclass
218 %<latexrelease> \xe@alloc@intercharclass=\thr@@
220 %<latexrelease>\EndIncludeInRelease
228 % The default values of the picture and |\fbox| parameters:
234 % The saved value of \TeX's |\maxdepth|:
236 \@maxdepth = \maxdepth
238 % |\vsize| initialized because a |\clearpage| with |\vsize < \topskip|
240 % |\@colroom| and |\@colht| also initialized because |\vsize| may be
241 % set to them if a |\clearpage| is done before the |\begin{document}|
248 % Initialise |\textheight| |\textwidth| and page style, to avoid
249 % internal errors if they are not set by the class.
250 % \changes{v0.1b}{1994/04/18}
251 % {Initialise \cs{textheight}, \cs{textwidth} and page style}
253 \textheight=.5\maxdimen
254 \textwidth=\textheight
258 % \subsection{Lccodes for hyphenation}
260 % \changes{v2.0a}{2015/01/03}{Unicode data loading added}
261 % \changes{v2.0c}{2015/01/24}{Skip T1-code entirely with Unicode engines}
262 % \changes{v2.0d}{2015/03/26}{Use renamed
263 % \texttt{unicode-letters.def}}
264 % \changes{v2.0i}{2015/12/10}{Use new common Unicode data loaders}
265 % \changes{v2.0j}{2016/01/04}{Do not set up inter character classes for
267 % \changes{v2.0l}{2016/01/05}{Correct \textsf{latexrelease} guards}
268 % \changes{v2.0l}{2016/01/05}{Ensure old definitions for inter-character
269 % class toks are available using \textsf{latexrelease}}
270 % \changes{v2.0m}{2016/01/05}{Undefine XeTeX classes when using patching
272 % \changes{v2.0l}{2016/01/05}{Missing brace}
273 % For $7$- and $8$-bit engines the assumption of T1 encodings is the
274 % basis for the hyphenation patterns. That's not the case for the Unicode
275 % engines, where the assumption is engine-native working. The common
276 % loader system provides access to data from the Unicode Consortium
277 % covering not only |\lccode| but also other related data. The
278 % |\lccode| part of that at least needs to be loaded before hyphenation is
279 % tackled: Xe\TeX{} follows the standard \TeX{} route of building patterns
280 % into the format. Lua\TeX{} doesn't require this data be loaded \emph{here}
281 % but it does need to be loaded somewhere. Rather than test for the Unicode
282 % engines by name, the approach here is to look for the extended math mode
283 % handling both provide: any other engine developed in this area will
284 % presumably also provide |\Umathcode|.
287 \ifx\Umathcode\@undefined\else 1\fi
288 \ifx\XeTeXmathcode\@undefined\else 1\fi
290 \message{ Unicode character data,}
291 \input{load-unicode-data}
293 %<latexrelease>\IncludeInRelease{2016/01/01}%
294 %<latexrelease> {\XeTeXintercharclasses}{XeTeX character classes}%
295 %<latexrelease> \begingroup
296 %<latexrelease> \chardef\XeTeXcharclassID = 0 %
297 %<latexrelease> \chardef\XeTeXcharclassOP = 0 %
298 %<latexrelease> \chardef\XeTeXcharclassCL = 0 %
299 %<latexrelease> \chardef\XeTeXcharclassEX = 0 %
300 %<latexrelease> \chardef\XeTeXcharclassIS = 0 %
301 %<latexrelease> \chardef\XeTeXcharclassNS = 0 %
302 %<latexrelease> \chardef\XeTeXcharclassCM = 0 %
303 %<latexrelease> \input load-unicode-xetex-classes %
304 %<latexrelease> \endgroup
305 %<latexrelease> \global\let\xtxHanGlue\undefined
306 %<latexrelease> \global\let\xtxHanSpace\undefined
307 %<latexrelease> \global\XeTeXinterchartoks 0 1 = {}
308 %<latexrelease> \global\XeTeXinterchartoks 0 2 = {}
309 %<latexrelease> \global\XeTeXinterchartoks 0 3 = {}
310 %<latexrelease> \global\XeTeXinterchartoks 1 0 = {}
311 %<latexrelease> \global\XeTeXinterchartoks 2 0 = {}
312 %<latexrelease> \global\XeTeXinterchartoks 3 0 = {}
313 %<latexrelease> \global\XeTeXinterchartoks 1 1 = {}
314 %<latexrelease> \global\XeTeXinterchartoks 1 2 = {}
315 %<latexrelease> \global\XeTeXinterchartoks 1 3 = {}
316 %<latexrelease> \global\XeTeXinterchartoks 2 1 = {}
317 %<latexrelease> \global\XeTeXinterchartoks 2 2 = {}
318 %<latexrelease> \global\XeTeXinterchartoks 2 3 = {}
319 %<latexrelease> \global\XeTeXinterchartoks 3 1 = {}
320 %<latexrelease> \global\XeTeXinterchartoks 3 2 = {}
321 %<latexrelease> \global\XeTeXinterchartoks 3 3 = {}
322 %<latexrelease>\EndIncludeInRelease
323 %<latexrelease>\IncludeInRelease{0000/00/00}%
324 %<latexrelease> {\XeTeXintercharclasses}{XeTeX character classes}%
325 %<latexrelease> \input{load-unicode-xetex-classes}
326 %<latexrelease> \gdef\xtxHanGlue{\hskip0pt plus 0.1em\relax}
327 %<latexrelease> \gdef\xtxHanSpace{\hskip0.2em plus 0.2em minus 0.1em\relax}
328 %<latexrelease> \global\XeTeXinterchartoks 0 1 = {\xtxHanSpace}
329 %<latexrelease> \global\XeTeXinterchartoks 0 2 = {\xtxHanSpace}
330 %<latexrelease> \global\XeTeXinterchartoks 0 3 = {\nobreak\xtxHanSpace}
331 %<latexrelease> \global\XeTeXinterchartoks 1 0 = {\xtxHanSpace}
332 %<latexrelease> \global\XeTeXinterchartoks 2 0 = {\nobreak\xtxHanSpace}
333 %<latexrelease> \global\XeTeXinterchartoks 3 0 = {\xtxHanSpace}
334 %<latexrelease> \global\XeTeXinterchartoks 1 1 = {\xtxHanGlue}
335 %<latexrelease> \global\XeTeXinterchartoks 1 2 = {\xtxHanGlue}
336 %<latexrelease> \global\XeTeXinterchartoks 1 3 = {\nobreak\xtxHanGlue}
337 %<latexrelease> \global\XeTeXinterchartoks 2 1 = {\nobreak\xtxHanGlue}
338 %<latexrelease> \global\XeTeXinterchartoks 2 2 = {\nobreak\xtxHanGlue}
339 %<latexrelease> \global\XeTeXinterchartoks 2 3 = {\xtxHanGlue}
340 %<latexrelease> \global\XeTeXinterchartoks 3 1 = {\xtxHanGlue}
341 %<latexrelease> \global\XeTeXinterchartoks 3 2 = {\xtxHanGlue}
342 %<latexrelease> \global\XeTeXinterchartoks 3 3 = {\nobreak\xtxHanGlue}
343 %<latexrelease>\EndIncludeInRelease
346 % \changes{v2.0d}{2015/02/03}{Set \cs{lccode} for \texttt{-} with Unicode
348 % There is one over-ride that makes sense here (see below for the same for
349 % $8$-bit engines): setting the lccode for |-| to itself.
351 \lccode`\- =`\- % default hyphen char
353 % The alternative is that a ``traditional'' engine is in use.
357 % \changes{v1.1b}{1998/05/20}{Set up lccodes before loading
358 % hyphenation files: pr/2639}
359 % We set things up so that hyphenation files can assume that the
360 % default (T1) lccodes are in use (at present this also sets up the
362 % We temporarily define |\reserved@a| to apply |\reserved@c| to
363 % all the numbers in the range of its arguments.
365 \def\reserved@a#1#2{%
371 \ifnum\@tempcnta>\@tempcntb\else
372 \reserved@c\@tempcnta
373 \advance\@tempcnta\@ne
374 \expandafter\reserved@b
378 % Depending on the \TeX{} version, we might not be allowed to do
379 % this for non-ASCII characters.
380 % \changes{v1.0n}{1994/06/09}{For \TeX2, do not set codes for higher
381 % half of character table.}
384 \count@=#1\advance\count@ by -"20
388 \reserved@a{`\a}{`\z}
389 \ifnum\inputlineno=\m@ne\else
390 \reserved@a{"A0}{"BC}
391 \reserved@a{"E0}{"FF}
394 % The upper case characters need their |\uccode| and |\lccode| values
395 % set, and their |\sfcode| set to 999.
398 \count@=#1\advance\count@ by "20
403 \reserved@a{`\A}{`\Z}
404 \ifnum\inputlineno=\m@ne\else
405 \reserved@a{"80}{"9C}
406 \reserved@a{"C0}{"DF}
409 % Well, it would be nice if that were correct, but unfortunately, the
410 % Cork encoding contains some odd slots whose uccode or lccode isn't
411 % quite what you'd expect.
413 \uccode`\^^Y=`\I % dotless i
414 \lccode`\^^Y=`\^^Y % dotless i
415 \uccode`\^^Z=`\J % dotless j, ae in OT1
416 \lccode`\^^Z=`\^^Z % dotless j, ae in OT1
417 \ifnum\inputlineno=\m@ne\else
418 \lccode`\^^9d=`\i % dotted I
419 \uccode`\^^9d=`\^^9d % dotted I
420 \lccode`\^^9e=`\^^9e % d-bar
421 \uccode`\^^9e=`\^^d0 % d-bar
424 % Finally here is one that helps hyphenation in the OT1 encoding.
425 % \changes{v1.0z}{1996/10/31}
426 % {Added extra \cs{lcode}, hoping it does no harm in T1 (pr/1969)}
428 \lccode`\^^[=`\^^[ % oe in OT1
431 % And we also set the |\lccode| of |\-| and |\textcompwordmark| so
432 % that they do not prevent hyphenation in the remainder of the word
433 % (as suggested by Lars Helstr\"om).
434 % \changes{v1.1e}{2003/10/13}
435 % {Added extra \cs{lccode} for \cs{-} and \cs{textcompwordmark}}
437 \lccode`\- =`\- % default hyphen char
438 \lccode 127=127 % alternate hyphen char
439 \lccode 23 =23 % textcompwordmark in T1
442 % End of the conditional to select either Unicode or T1 encoding defaults.
447 % This is as good a place as any to active a few Xe\TeX{}-specific
450 \ifx\XeTeXuseglyphmetrics\@undefined
452 \XeTeXuseglyphmetrics=1 %
453 \XeTeXdashbreakstate=1 %
457 % \subsection{Hyphenation}
459 % \changes{v0.1a}{1994/03/07}{move code here from lhyphen.dtx}
460 % \changes{v0.1a}{1994/03/07}
461 % {use \cs{InputIfFileExists} not \cs{IfFileExists}}
462 % \changes{v1.0x}{1995/11/01}
463 % {(DPC) Switch meaning of \cs{@addtofilelist} for cfg files}%
464 % The following code will be compiled into the format file. It checks
465 % for the existence of \texttt{hyphen.cfg} in inputs that file if
466 % found. Otherwise it inputs \texttt{hyphen.ltx}. Note that these
467 % are loaded in \emph{before} the |\catcode|s are set, so local
468 % hyphenation files can use 8-bit input.
470 % We try to load the customized hyphenation description file.
472 \InputIfFileExists{hyphen.cfg}
473 {\typeout{===========================================^^J%
474 Local configuration file hyphen.cfg used^^J%
475 ===========================================}%
476 \def\@addtofilelist##1{\xdef\@filelist{\@filelist,##1}}%
479 \let\@addtofilelist\@gobble
484 % \subsection{Font loading}
485 % Fonts loaded during the formatting process might already have
486 % changed the |\font@submax| from |0pt| to something higher.
487 % If so, we put out a bold warning.
488 % \changes{v0.1l}{1994/05/20}{Use new font warning commands}
490 % \changes{v1.1c}{2000/08/23}{Fix typo in warning}
491 \ifdim \font@submax >\z@
492 \@font@warning{Size substitutions with differences\MessageBreak
493 up to \font@submax\space have occurred.\MessageBreak
495 Please check the transcript file
496 carefully\MessageBreak
497 and redo the format generation if necessary!
499 \errhelp{Only stopped, to give you time to
500 read the above message.}
503 % We reset the macro. Otherwise every user will get a warning on
506 \def\font@submax{0pt}
510 % \subsection{Input encoding}
512 % We temporarily define |\reserved@a| to apply |\reserved@c| to all the
513 % numbers in the range of its arguments.
515 \def\reserved@a#1#2{%
521 \ifnum\@tempcnta>\@tempcntb\else
522 \reserved@c\@tempcnta
523 \advance\@tempcnta\@ne
524 \expandafter\reserved@b
528 % \changes{v0.1e}{1994/05/02}{Added setting the special catcodes.}
529 % \changes{v0.1f}{1994/05/02}{Set the catcode of control-J.}
530 % Set the special catcodes (although some of these are useless, since an
531 % error will have occurred if the catcodes have changed). Note that
532 % |^^J| has catcode `other' for use in warning messages.
551 % \changes{v0.1e}{1994/05/02}{Added setting the `other' catcodes.}
552 % Set the `other' catcodes.
554 \def\reserved@c#1{\catcode#1=12\relax}
557 \reserved@a{`\'}{`\?}
563 % \changes{v0.1e}{1994/05/02}{Added setting the `letter' catcodes.}
564 % Set the `letter' catcodes.
566 \def\reserved@c#1{\catcode#1=11\relax}
567 \reserved@a{`\A}{`\Z}
568 \reserved@a{`\a}{`\z}
570 % \changes{v0.1e}{1994/05/02}{Made slot 127 illegal}
571 % \changes{v1.0n}{1994/11/18}
572 % {re-allow slots 127--255}
573 % All the characters in the range 0--31 and 127--255 are illegal,
574 % \emph{except} tab (|^^I|), nl (|^^J|), ff (|^^L|) and cr (|^^M|).
576 % Now allow 8-bit characters, although their use in this way is
577 % strongly discouraged. See |inputenc.dtx| for a supported mechanism
580 \def\reserved@c#1{\catcode#1=15\relax}
581 \reserved@a{0}{`\^^H}
583 \reserved@a{`\^^N}{31}
584 %\ifnum\inputlineno=\m@ne
587 % \reserved@a{"7F}{"FF}
591 % \subsection{Lccodes and uccodes}
593 % \changes{v1.1b}{1998/05/20}{Set up uc/lccodes after loading
594 % hyphenation files: pr/2639}
595 % We now again set up the default (T1) uc/lccodes.
596 % The lower case characters need their |\uccode| and |\lccode| values
597 % set. Some of this is a repeat of the set-up before loading
599 % Depending on the \TeX{} version, we might not be allowed to do
600 % this for non-ASCII characters.
601 % \changes{v1.0n}{1994/06/09}{For \TeX2, do not set codes for higher
602 % half of character table.}
603 % \changes{v2.0a}{2015/01/03}{Skip resetting codes with Unicode engines}
604 % For the Unicode engines (Xe\TeX{} and Lua\TeX{}) there is no need to
605 % do any of this: they use hyphenation data which does not alter any
606 % of the set up and so this entire block is skipped.
609 \ifx\Umathcode\@undefined\else 1\fi
610 \ifx\XeTeXmathcode\@undefined\else 1\fi
614 \count@=#1\advance\count@ by -"20
618 \reserved@a{`\a}{`\z}
619 \ifnum\inputlineno=\m@ne\else
620 \reserved@a{"A0}{"BC}
621 \reserved@a{"E0}{"FF}
624 % The upper case characters need their |\uccode| and |\lccode| values
625 % set, and their |\sfcode| set to 999.
628 \count@=#1\advance\count@ by "20
633 \reserved@a{`\A}{`\Z}
634 \ifnum\inputlineno=\m@ne\else
635 \reserved@a{"80}{"9C}
636 \reserved@a{"C0}{"DF}
639 % Well, it would be nice if that were correct, but unfortunately, the
640 % Cork encoding contains some odd slots whose uccode or lccode isn't
641 % quite what you'd expect.
643 \uccode`\^^Y=`\I % dotless i
644 \lccode`\^^Y=`\^^Y % dotless i
645 \uccode`\^^Z=`\J % dotless j, ae in OT1
646 \lccode`\^^Z=`\^^Z % dotless j, ae in OT1
647 \ifnum\inputlineno=\m@ne\else
648 \lccode`\^^9d=`\i % dotted I
649 \uccode`\^^9d=`\^^9d % dotted I
650 \lccode`\^^9e=`\^^9e % d-bar
651 \uccode`\^^9e=`\^^d0 % d-bar
654 % Finally here is one that helps hyphenation in the OT1 encoding.
655 % \changes{v1.0z}{1996/10/31}
656 % {Added extra \cs{lcode}, hoping it does no harm in T1 (pr/1969)}
658 \lccode`\^^[=`\^^[ % oe in OT1
659 \fi % End of reset block for 8-bit engines
662 % \begin{macro}{\MakeUppercase}
663 % \begin{macro}{\MakeUppercase}
664 % \begin{macro}{\@uclclist}
666 % \changes{v1.1a}{1997/10/20}{Removed \cs{aa} and \cs{AA} from
667 % \cs{@uclclist} as these are macros.}
669 % And whilst we're doing things with uc/lc tables, here are two
670 % commands to upper- and lower-case a string.
672 % \emph{Note} that this implementation is subject to change! At
673 % the moment we're not providing any way to extend the list of
674 % uc/lc commands, since finding a good interface is difficult.
675 % These commands have some nasty features, such as uppercasing
676 % mathematics, environment names, labels, etc. A much better
677 % long-term solution is to use all-caps fonts, but these aren't
678 % generally available.
680 \DeclareRobustCommand{\MakeUppercase}[1]{{%
682 \def\reserved@a##1##2{\let##1##2\reserved@a}%
683 \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
684 \protected@edef\reserved@a{\uppercase{#1}}%
687 \DeclareRobustCommand{\MakeLowercase}[1]{{%
688 \def\reserved@a##1##2{\let##2##1\reserved@a}%
689 \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
690 \protected@edef\reserved@a{\lowercase{#1}}%
693 \def\@uclclist{\oe\OE\o\O\ae\AE
694 \dh\DH\dj\DJ\l\L\ng\NG\ss\SS\th\TH}
696 % The above code works, but has the nasty side-effect that if you
697 % say something like:
699 % \markboth{\MakeUppercase\contentsname}
700 % {\MakeUppercase\contentsname}
702 % then the uppercasing is only done to the first letter of the
703 % contents name, since the mark expands out to:
705 % \mark{\protect\MakeUppercase Table of Contents}
706 % {\protect\MakeUppercase Table of Contents}
708 % In order to get round this, we redefine |\MakeUppercase| and
709 % |\MakeLowercase| to grab their argument and brace it. This is a
710 % very low-level hack, and is \emph{not} recommended practice!
711 % This is an instance of a general problem that makes it unsafe to
712 % grab arguments unbraced, and probably needs a more general
713 % solution. For the moment though, this hack will do:
715 \protected@edef\MakeUppercase#1{\MakeUppercase{#1}}
716 \protected@edef\MakeLowercase#1{\MakeLowercase{#1}}
722 % \changes{v1.0h}{1994/05/13}{Added output enc stuff}
723 % \changes{v1.0i}{1994/05/16}{moved output enc stuff to lfonts}
725 % \changes{v0.1a}{1994/03/07}{Add code from the old dump.dtx}
727 % \subsection{Applying Patch files}
728 % Between major releases, small patches will be distributed in
729 % files |ltpatch.ltx| which must be added at this point.
730 % \changes{v1.0m}{1994/06/08}{Add patch file system}
731 % \changes{v2.0h}{2015/06/23}
732 % {set \cs{patch@level} in ltvers rather than in ltfinal/ltpatch}
734 % Patch file code removed.
736 %\IfFileExists{ltpatch.ltx}
737 % {\typeout{=================================^^J%
738 % Applying patch file ltpatch.ltx^^J%
739 % =================================}
740 % \def\fmtversion@topatch{unknown}
741 % \input{ltpatch.ltx}
742 % \ifx\fmtversion\fmtversion@topatch
743 % \ifx\patch@level\@undefined
744 % \typeout{^^J^^J^^J%
745 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
746 % !! Patch file `ltpatch.ltx' not suitable for this^^J%
747 % !! version of LaTeX.^^J^^J%
748 % !! Please check if initex found an old patch file:^^J%
749 % !! --- if so, rename it or delete it, and redo the^^J%
751 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}%
755 % \changes{v1.0q}{1995/04/21}
756 % {Allow initial patch level 0}
757 % \changes{v1.0t}{1995/06/13}
758 % {Add patch level string more carefully}
759 % The code below adds the `patch level' string to the first |\typeout|
760 % in the startup banner.
762 % \def\fmtversion@topatch{0}%
763 % \ifx\fmtversion@topatch\patch@level\else
764 % \def\reserved@a\typeout##1##2\reserved@a{%
765 % \typeout{##1 patch level \patch@level}##2}
766 % \everyjob\expandafter\expandafter\expandafter{%
767 % \expandafter\reserved@a\the\everyjob\reserved@a}
768 % \let\reserved@a\relax
773 % \typeout{^^J^^J^^J%
774 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
775 % !! Patch file `ltpatch.ltx' (for version <\fmtversion@topatch>)^^J%
776 % !! is not suitable for version <\fmtversion> of LaTeX.^^J^^J%
777 % !! Please check if initex found an old patch file:^^J%
778 % !! --- if so, rename it or delete it, and redo the^^J%
780 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}%
783 % \let\fmtversion@topatch\relax
787 % \subsection{Freeing Memory}
789 % \begin{macro}{\reserved@a}
790 % \begin{macro}{\reserved@b}
791 % \changes{v1.0v}{1995/10/17}{reset here after the \cs{input} above}
792 % And just to make sure nobody relies on those definitions of
793 % |\reserved@b| and friends.
794 % These macros are reserved for use in the kernel. \emph{Do not use
795 % them as general scratch macros}.
797 \let\reserved@a\@filelist
798 \let\reserved@b=\@undefined
799 \let\reserved@c=\@undefined
800 \let\reserved@d=\@undefined
801 \let\reserved@e=\@undefined
802 \let\reserved@f=\@undefined
807 % \begin{macro}{\toks}
808 % \changes{v1.0y}{1996/07/10}
809 % {Free up memory from scratch registers /2213}
819 % \begin{macro}{\errhelp}
820 % \changes{v0.1g}{1994/05/05}{Set error help empty.}
821 % \changes{v1.1d}{2000/09/01}{Set error help empty at very end
822 % (pr/449 done correctly).}
823 % Empty the error help message, which may have some rubbish:
829 % \subsection{Initialise file list}
831 % \begin{macro}{\@providesfile}
832 % \changes{v1.0v}{1995/10/17}{reset macro}
833 % Initialise for use in the document. During initex a modified version
834 % has been used which leaves debugging information for |latexbug.tex|.
836 \def\@providesfile#1[#2]{%
838 \expandafter\xdef\csname ver@#1\endcsname{#2}%
843 % \begin{macro}{\@filelist}
844 % \changes{v1.0w}{1995/10/19}{Move after \cs{reserved@a} setting:-)}
845 % \begin{macro}{\@addtofilelist}
846 % Reset |\@filelist| so files input while making the format are not
847 % listed. The list built up so far may take up a lot of memory and so
848 % it is moved to |\reserved@a| where it will be overwritten as soon
849 % as almost any \LaTeX\ command is issued in a class file.
850 % However the |latexbug.tex| program will be able to access this
851 % information and insert it into a bug report.
853 \let\@filelist\@gobble
854 \def\@addtofilelist#1{\xdef\@filelist{\@filelist,#1}}%
859 % \subsection{Dumping the format}
860 % Finally we make |@| into a letter, ensure the format will
861 % be in the `normal' error mode, and dump everything into the
863 % \changes{v1.0t}{1995/06/13}
864 % {Call \cs{errorstopmode}}