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/10/15 v2.0s LaTeX Kernel (Final Settings)]
38 \documentclass{ltxdoc}
39 \GetFileInfo{ltfinal.dtx}
51 \MaintainedByLaTeXTeam{latex}
53 \DocInput{ltfinal.dtx}
59 % \section{Final settings}
60 % This section contains the final settings for \LaTeX. It initialises
61 % some debugging and typesetting parameters, sets the default
62 % |\catcode|s and uc/lc codes, and inputs the hyphenation file.
66 % \changes{v0.1a}{1994/03/07}{Initial version, split from latex.dtx}
67 % \changes{v0.1a}{1994/03/07}{Remove oldcomments environment}
68 % \changes{v0.1c}{1994/04/21}{Added comments, set the catcodes of
70 % \changes{v0.1d}{1994/04/23}{Check that \cs{font@submax} is still zero}
71 % \changes{v0.1e}{1994/05/02}{Set all the catcodes}
72 % \changes{v0.1f}{1994/05/03}{Set the catcode of control-J to be
73 % `other', for use in messages.}
74 % \changes{v0.1g}{1994/05/05}{Added empty errhelp.}
75 % \changes{v0.1h}{1994/05/13}{Added package ot1enc, and defined
76 % \cs{@acci}, \cs{@accii} and \cs{@acciii}.}
77 % \changes{v0.1j}{1994/05/18}{Corrected the lccode for d-bar.}
78 % \changes{v0.1k}{1994/05/19}{Removed \cs{makeat...}}
79 % \changes{v1.0n}{1994/05/31}{Renamed lthyphen.* to lthyphen.*.}
80 % \changes{v1.0o}{1994/11/17}
81 % {\cs{@tempa} to \cs{reserved@a}}
82 % \changes{v1.0p}{1994/12/01}
83 % {Renamed lthyphen.* to hyphen.*.}
84 % \changes{v1.0r}{1995/06/05}
85 % {Added \cs{MakeUppercase} and \cs{MakeLowercase}.}
86 % \changes{v1.0s}{1995/06/06}
87 % {Made \cs{MakeUppercase} and \cs{MakeLowercase} brace their
89 % \changes{v2.0r}{2016/10/15}{Require \eTeX{}}
90 % \changes{v2.0s}{2016/10/15}{Tidy up status of char 127}
92 % \subsection{Debugging}
94 % By default, \LaTeX{} shows statistics:
100 % \subsection{Typesetting parameters}
102 % \begin{macro}{\@lowpenalty}
103 % \begin{macro}{\@medpenalty}
104 % \begin{macro}{\@highpenalty}
105 % These are penalties used internally.
107 \newcount\@lowpenalty
108 \newcount\@medpenalty
109 \newcount\@highpenalty
116 %\begin{macro}{\newmarks}
117 % \changes{v2.0a}{2014/12/30}{macro added}
118 % \changes{v2.0b}{2015/01/23}{use reserved count 256}
119 % \changes{v2.0g}{2015/06/19}{Use $-1$ for first range to get contiguous allocation}
120 % Allocate extended marks types if etex is active.
121 % Placed here at the end of the format
122 % to increase compatibility with count allocations
123 % in earlier releases.
126 %<*2ekernel|latexrelease>
127 %<latexrelease>\IncludeInRelease{2015/01/01}%
128 %<latexrelease> {\newmarks}{Extended Allocation}%
132 \ifx\marks\@undefined\else
134 \e@alloc\marks \e@alloc@chardef{\count256}\m@ne\e@alloc@top}
139 %</2ekernel|latexrelease>
140 %<latexrelease>\EndIncludeInRelease
141 %<latexrelease>\IncludeInRelease{0000/00/00}%
142 %<latexrelease> {\newmarks}{Extended Allocation}%
143 %<latexrelease>\let\newmarks\@undefined
144 %<latexrelease>\EndIncludeInRelease
149 %\begin{macro}{\newXeTeXintercharclass}
150 % \changes{v2.0a}{2014/12/30}{macro added}
151 % \changes{v2.0b}{2015/01/23}{use reserved count 257}
152 % \changes{v2.0f}{2015/04/28}{define \cs{xe@alloc@intercharclass} for compatibility with older xelatex initilisation}
153 %\begin{macro}{\xe@alloc@intercharclass}
154 %\begin{macro}{\e@alloc@intercharclass@top}
155 % \changes{v2.0j}{2016/01/04}{Start allocation at one not three}
156 % \changes{v2.0k}{2016/01/05}{Remove duplicated code}
157 % Allocate |\XeTeXintercharclass| types if xetex is active.
158 % previously defined in |xetex.ini|.
162 %<*2ekernel|latexrelease>
163 %<latexrelease>\IncludeInRelease{2015/01/01}%
164 %<latexrelease> {\newXeTeXintercharclass}{Extended Allocation}%
167 % Classes allocated 1 to 4094 (or 254 on older xetex)
168 % (In earlier XeLaTeX versions 1, 2 and 3 were pre-set for CJK).
169 % \changes{v2.0g}{2015/06/19}{Use $-1$ for first range to get contiguous allocation}
170 % \changes{v2.0q}{2016/04/22}{XeTeX 0.99996 has 4096 char classes not 256}
172 \ifx\XeTeXcharclass\@undefined
176 \ifdim\the\XeTeXversion\XeTeXrevision\p@>0.99993\p@
177 \chardef\e@alloc@intercharclass@top=4095
179 \chardef\e@alloc@intercharclass@top=255
183 \def\newXeTeXintercharclass{%
184 \e@alloc\XeTeXcharclass
185 \chardef\xe@alloc@intercharclass\m@ne\e@alloc@intercharclass@top}
190 %</2ekernel|latexrelease>
191 %<latexrelease>\EndIncludeInRelease
192 %<latexrelease>\IncludeInRelease{0000/00/00}%
193 %<latexrelease> {\newXeTeXintercharclass}{Extended Allocation}%
194 %<latexrelease> \ifx\XeTeXcharclass\@undefined
195 %<latexrelease> \else
196 %<latexrelease> \def\xe@alloc@#1#2#3#4#5{\global\advance#1\@ne
197 %<latexrelease> \xe@ch@ck#1#4#2%
198 %<latexrelease> \allocationnumber#1%
199 %<latexrelease> \global#3#5\allocationnumber
200 %<latexrelease> \wlog{\string#5=\string#2\the\allocationnumber}}
201 %<latexrelease> \def\xe@ch@ck#1#2#3{%
202 %<latexrelease> \ifnum#1<#2\else
203 %<latexrelease> \errmessage{No room for a new #3}%
205 %<latexrelease> \def\newXeTeXintercharclass{%
206 %<latexrelease> \xe@alloc@\xe@alloc@intercharclass
207 %<latexrelease> \XeTeXcharclass\chardef\@cclv}
209 %<latexrelease>\EndIncludeInRelease
210 %<*2ekernel|latexrelease>
211 %<latexrelease>\IncludeInRelease{2016/02/01}%
212 %<latexrelease> {\xe@alloc@intercharclass}{Start of XeTeX class allocator}%
213 \ifx\XeTeXcharclass\@undefined
215 \countdef\xe@alloc@intercharclass=257
216 \xe@alloc@intercharclass=\z@
218 %</2ekernel|latexrelease>
219 %<latexrelease>\EndIncludeInRelease
220 %<latexrelease>\IncludeInRelease{2015/01/01}%
221 %<latexrelease> {\xe@alloc@intercharclass}{Start of XeTeX class allocator}%
222 %<latexrelease> \ifx\XeTeXcharclass\@undefined
223 %<latexrelease> \else
224 %<latexrelease> \xe@alloc@intercharclass=\thr@@
226 %<latexrelease>\EndIncludeInRelease
227 %<latexrelease>\IncludeInRelease{0000/00/00}%
228 %<latexrelease> {\xe@alloc@intercharclass}{Start of XeTeX class allocator}%
229 %<latexrelease> \ifx\XeTeXcharclass\@undefined
230 %<latexrelease> \else
231 %<latexrelease> \newcount\xe@alloc@intercharclass
232 %<latexrelease> \xe@alloc@intercharclass=\thr@@
234 %<latexrelease>\EndIncludeInRelease
243 % The default values of the picture and |\fbox| parameters:
249 % The saved value of \TeX's |\maxdepth|:
251 \@maxdepth = \maxdepth
253 % |\vsize| initialized because a |\clearpage| with |\vsize < \topskip|
255 % |\@colroom| and |\@colht| also initialized because |\vsize| may be
256 % set to them if a |\clearpage| is done before the |\begin{document}|
263 % Initialise |\textheight| |\textwidth| and page style, to avoid
264 % internal errors if they are not set by the class.
265 % \changes{v0.1b}{1994/04/18}
266 % {Initialise \cs{textheight}, \cs{textwidth} and page style}
268 \textheight=.5\maxdimen
269 \textwidth=\textheight
273 % \subsection{Lccodes for hyphenation}
275 % \changes{v2.0a}{2015/01/03}{Unicode data loading added}
276 % \changes{v2.0c}{2015/01/24}{Skip T1-code entirely with Unicode engines}
277 % \changes{v2.0d}{2015/03/26}{Use renamed
278 % \texttt{unicode-letters.def}}
279 % \changes{v2.0i}{2015/12/10}{Use new common Unicode data loaders}
280 % \changes{v2.0j}{2016/01/04}{Do not set up inter character classes for
282 % \changes{v2.0l}{2016/01/05}{Correct \textsf{latexrelease} guards}
283 % \changes{v2.0l}{2016/01/05}{Ensure old definitions for inter-character
284 % class toks are available using \textsf{latexrelease}}
285 % \changes{v2.0m}{2016/01/05}{Undefine XeTeX classes when using patching
287 % \changes{v2.0l}{2016/01/05}{Missing brace}
288 % \changes{v2.0p}{2016/01/05}{Only apply XeTeX change if XeTeX is in use}
289 % For $7$- and $8$-bit engines the assumption of T1 encodings is the
290 % basis for the hyphenation patterns. That's not the case for the Unicode
291 % engines, where the assumption is engine-native working. The common
292 % loader system provides access to data from the Unicode Consortium
293 % covering not only |\lccode| but also other related data. The
294 % |\lccode| part of that at least needs to be loaded before hyphenation is
295 % tackled: Xe\TeX{} follows the standard \TeX{} route of building patterns
296 % into the format. Lua\TeX{} doesn't require this data be loaded \emph{here}
297 % but it does need to be loaded somewhere. Rather than test for the Unicode
298 % engines by name, the approach here is to look for the extended math mode
299 % handling both provide: any other engine developed in this area will
300 % presumably also provide |\Umathcode|.
303 \ifx\Umathcode\@undefined\else 1\fi
304 \ifx\XeTeXmathcode\@undefined\else 1\fi
306 \message{ Unicode character data,}
307 \input{load-unicode-data}
309 %<latexrelease>\IncludeInRelease{2016/02/01}%
310 %<latexrelease> {\XeTeXintercharclasses}{XeTeX character classes}%
311 %<latexrelease> \ifx\XeTeXinterchartoks\undefined
312 %<latexrelease> \else
313 %<latexrelease> \begingroup
314 %<latexrelease> \chardef\XeTeXcharclassID = 0 %
315 %<latexrelease> \chardef\XeTeXcharclassOP = 0 %
316 %<latexrelease> \chardef\XeTeXcharclassCL = 0 %
317 %<latexrelease> \chardef\XeTeXcharclassEX = 0 %
318 %<latexrelease> \chardef\XeTeXcharclassIS = 0 %
319 %<latexrelease> \chardef\XeTeXcharclassNS = 0 %
320 %<latexrelease> \chardef\XeTeXcharclassCM = 0 %
321 %<latexrelease> \input{load-unicode-xetex-classes}
322 %<latexrelease> \endgroup
323 %<latexrelease> \global\let\xtxHanGlue\undefined
324 %<latexrelease> \global\let\xtxHanSpace\undefined
325 %<latexrelease> \global\XeTeXinterchartoks 0 1 = {}
326 %<latexrelease> \global\XeTeXinterchartoks 0 2 = {}
327 %<latexrelease> \global\XeTeXinterchartoks 0 3 = {}
328 %<latexrelease> \global\XeTeXinterchartoks 1 0 = {}
329 %<latexrelease> \global\XeTeXinterchartoks 2 0 = {}
330 %<latexrelease> \global\XeTeXinterchartoks 3 0 = {}
331 %<latexrelease> \global\XeTeXinterchartoks 1 1 = {}
332 %<latexrelease> \global\XeTeXinterchartoks 1 2 = {}
333 %<latexrelease> \global\XeTeXinterchartoks 1 3 = {}
334 %<latexrelease> \global\XeTeXinterchartoks 2 1 = {}
335 %<latexrelease> \global\XeTeXinterchartoks 2 2 = {}
336 %<latexrelease> \global\XeTeXinterchartoks 2 3 = {}
337 %<latexrelease> \global\XeTeXinterchartoks 3 1 = {}
338 %<latexrelease> \global\XeTeXinterchartoks 3 2 = {}
339 %<latexrelease> \global\XeTeXinterchartoks 3 3 = {}
341 %<latexrelease>\EndIncludeInRelease
342 %<latexrelease>\IncludeInRelease{0000/00/00}%
343 %<latexrelease> {\XeTeXintercharclasses}{XeTeX character classes}%
344 %<latexrelease> \ifx\XeTeXinterchartoks\undefined
345 %<latexrelease> \else
346 %<latexrelease> \input{load-unicode-xetex-classes}
347 %<latexrelease> \gdef\xtxHanGlue{\hskip0pt plus 0.1em\relax}
348 %<latexrelease> \gdef\xtxHanSpace{\hskip0.2em plus 0.2em minus 0.1em\relax}
349 %<latexrelease> \global\XeTeXinterchartoks 0 1 = {\xtxHanSpace}
350 %<latexrelease> \global\XeTeXinterchartoks 0 2 = {\xtxHanSpace}
351 %<latexrelease> \global\XeTeXinterchartoks 0 3 = {\nobreak\xtxHanSpace}
352 %<latexrelease> \global\XeTeXinterchartoks 1 0 = {\xtxHanSpace}
353 %<latexrelease> \global\XeTeXinterchartoks 2 0 = {\nobreak\xtxHanSpace}
354 %<latexrelease> \global\XeTeXinterchartoks 3 0 = {\xtxHanSpace}
355 %<latexrelease> \global\XeTeXinterchartoks 1 1 = {\xtxHanGlue}
356 %<latexrelease> \global\XeTeXinterchartoks 1 2 = {\xtxHanGlue}
357 %<latexrelease> \global\XeTeXinterchartoks 1 3 = {\nobreak\xtxHanGlue}
358 %<latexrelease> \global\XeTeXinterchartoks 2 1 = {\nobreak\xtxHanGlue}
359 %<latexrelease> \global\XeTeXinterchartoks 2 2 = {\nobreak\xtxHanGlue}
360 %<latexrelease> \global\XeTeXinterchartoks 2 3 = {\xtxHanGlue}
361 %<latexrelease> \global\XeTeXinterchartoks 3 1 = {\xtxHanGlue}
362 %<latexrelease> \global\XeTeXinterchartoks 3 2 = {\xtxHanGlue}
363 %<latexrelease> \global\XeTeXinterchartoks 3 3 = {\nobreak\xtxHanGlue}
365 %<latexrelease>\EndIncludeInRelease
368 % \changes{v2.0d}{2015/02/03}{Set \cs{lccode} for \texttt{-} with Unicode
370 % There is one over-ride that makes sense here (see below for the same for
371 % $8$-bit engines): setting the lccode for |-| to itself.
373 \lccode`\- =`\- % default hyphen char
375 % The alternative is that a ``traditional'' engine is in use.
379 % \changes{v1.1b}{1998/05/20}{Set up lccodes before loading
380 % hyphenation files: pr/2639}
381 % We set things up so that hyphenation files can assume that the
382 % default (T1) lccodes are in use (at present this also sets up the
384 % We temporarily define |\reserved@a| to apply |\reserved@c| to
385 % all the numbers in the range of its arguments.
387 \def\reserved@a#1#2{%
393 \ifnum\@tempcnta>\@tempcntb\else
394 \reserved@c\@tempcnta
395 \advance\@tempcnta\@ne
396 \expandafter\reserved@b
400 % Depending on the \TeX{} version, we might not be allowed to do
401 % this for non-ASCII characters.
402 % \changes{v1.0n}{1994/06/09}{For \TeX2, do not set codes for higher
403 % half of character table.}
406 \count@=#1\advance\count@ by -"20
410 \reserved@a{`\a}{`\z}
411 \reserved@a{"A0}{"BC}
412 \reserved@a{"E0}{"FF}
414 % The upper case characters need their |\uccode| and |\lccode| values
415 % set, and their |\sfcode| set to 999.
418 \count@=#1\advance\count@ by "20
423 \reserved@a{`\A}{`\Z}
424 \reserved@a{"80}{"9C}
425 \reserved@a{"C0}{"DF}
427 % Well, it would be nice if that were correct, but unfortunately, the
428 % Cork encoding contains some odd slots whose uccode or lccode isn't
429 % quite what you'd expect.
431 \uccode`\^^Y=`\I % dotless i
432 \lccode`\^^Y=`\^^Y % dotless i
433 \uccode`\^^Z=`\J % dotless j, ae in OT1
434 \lccode`\^^Z=`\^^Z % dotless j, ae in OT1
435 \lccode`\^^9d=`\i % dotted I
436 \uccode`\^^9d=`\^^9d % dotted I
437 \lccode`\^^9e=`\^^9e % d-bar
438 \uccode`\^^9e=`\^^d0 % d-bar
440 % Finally here is one that helps hyphenation in the OT1 encoding.
441 % \changes{v1.0z}{1996/10/31}
442 % {Added extra \cs{lcode}, hoping it does no harm in T1 (pr/1969)}
444 \lccode`\^^[=`\^^[ % oe in OT1
447 % And we also set the |\lccode| of |\-| and |\textcompwordmark| so
448 % that they do not prevent hyphenation in the remainder of the word
449 % (as suggested by Lars Helstr\"om).
450 % \changes{v1.1e}{2003/10/13}
451 % {Added extra \cs{lccode} for \cs{-} and \cs{textcompwordmark}}
453 \lccode`\- =`\- % default hyphen char
454 \lccode 127=127 % alternate hyphen char
455 \lccode 23 =23 % textcompwordmark in T1
458 % End of the conditional to select either Unicode or T1 encoding defaults.
463 % This is as good a place as any to active a few Xe\TeX{}-specific
466 \ifx\XeTeXuseglyphmetrics\@undefined
468 \XeTeXuseglyphmetrics=1 %
469 \XeTeXdashbreakstate=1 %
473 % \subsection{Hyphenation}
475 % \changes{v0.1a}{1994/03/07}{move code here from lhyphen.dtx}
476 % \changes{v0.1a}{1994/03/07}
477 % {use \cs{InputIfFileExists} not \cs{IfFileExists}}
478 % \changes{v1.0x}{1995/11/01}
479 % {(DPC) Switch meaning of \cs{@addtofilelist} for cfg files}%
480 % The following code will be compiled into the format file. It checks
481 % for the existence of \texttt{hyphen.cfg} in inputs that file if
482 % found. Otherwise it inputs \texttt{hyphen.ltx}. Note that these
483 % are loaded in \emph{before} the |\catcode|s are set, so local
484 % hyphenation files can use 8-bit input.
486 % We try to load the customized hyphenation description file.
488 \InputIfFileExists{hyphen.cfg}
489 {\typeout{===========================================^^J%
490 Local configuration file hyphen.cfg used^^J%
491 ===========================================}%
492 \def\@addtofilelist##1{\xdef\@filelist{\@filelist,##1}}%
495 \let\@addtofilelist\@gobble
500 % \subsection{Font loading}
501 % Fonts loaded during the formatting process might already have
502 % changed the |\font@submax| from |0pt| to something higher.
503 % If so, we put out a bold warning.
504 % \changes{v0.1l}{1994/05/20}{Use new font warning commands}
506 % \changes{v1.1c}{2000/08/23}{Fix typo in warning}
507 \ifdim \font@submax >\z@
508 \@font@warning{Size substitutions with differences\MessageBreak
509 up to \font@submax\space have occurred.\MessageBreak
511 Please check the transcript file
512 carefully\MessageBreak
513 and redo the format generation if necessary!
515 \errhelp{Only stopped, to give you time to
516 read the above message.}
519 % We reset the macro. Otherwise every user will get a warning on
522 \def\font@submax{0pt}
526 % \subsection{Input encoding}
528 % We temporarily define |\reserved@a| to apply |\reserved@c| to all the
529 % numbers in the range of its arguments.
531 \def\reserved@a#1#2{%
537 \ifnum\@tempcnta>\@tempcntb\else
538 \reserved@c\@tempcnta
539 \advance\@tempcnta\@ne
540 \expandafter\reserved@b
544 % \changes{v0.1e}{1994/05/02}{Added setting the special catcodes.}
545 % \changes{v0.1f}{1994/05/02}{Set the catcode of control-J.}
546 % Set the special catcodes (although some of these are useless, since an
547 % error will have occurred if the catcodes have changed). Note that
548 % |^^J| has catcode `other' for use in warning messages.
567 % \changes{v0.1e}{1994/05/02}{Added setting the `other' catcodes.}
568 % Set the `other' catcodes.
570 \def\reserved@c#1{\catcode#1=12\relax}
573 \reserved@a{`\'}{`\?}
579 % \changes{v0.1e}{1994/05/02}{Added setting the `letter' catcodes.}
580 % Set the `letter' catcodes.
582 \def\reserved@c#1{\catcode#1=11\relax}
583 \reserved@a{`\A}{`\Z}
584 \reserved@a{`\a}{`\z}
586 % \changes{v0.1e}{1994/05/02}{Made slot 127 illegal}
587 % \changes{v1.0n}{1994/11/18}
588 % {re-allow slots 127--255}
589 % All the characters in the range 0--31 and 127--255 are illegal,
590 % \emph{except} tab (|^^I|), nl (|^^J|), ff (|^^L|) and cr (|^^M|).
592 % Now allow 8-bit characters, although their use in this way is
593 % strongly discouraged. See |inputenc.dtx| for a supported mechanism
596 \def\reserved@c#1{\catcode#1=15\relax}
597 \reserved@a{0}{`\^^H}
599 \reserved@a{`\^^N}{31}
602 % \subsection{Lccodes and uccodes}
604 % \changes{v1.1b}{1998/05/20}{Set up uc/lccodes after loading
605 % hyphenation files: pr/2639}
606 % We now again set up the default (T1) uc/lccodes.
607 % The lower case characters need their |\uccode| and |\lccode| values
608 % set. Some of this is a repeat of the set-up before loading
610 % Depending on the \TeX{} version, we might not be allowed to do
611 % this for non-ASCII characters.
612 % \changes{v1.0n}{1994/06/09}{For \TeX2, do not set codes for higher
613 % half of character table.}
614 % \changes{v2.0a}{2015/01/03}{Skip resetting codes with Unicode engines}
615 % For the Unicode engines (Xe\TeX{} and Lua\TeX{}) there is no need to
616 % do any of this: they use hyphenation data which does not alter any
617 % of the set up and so this entire block is skipped.
620 \ifx\Umathcode\@undefined\else 1\fi
621 \ifx\XeTeXmathcode\@undefined\else 1\fi
625 \count@=#1\advance\count@ by -"20
629 \reserved@a{`\a}{`\z}
630 \reserved@a{"A0}{"BC}
631 \reserved@a{"E0}{"FF}
633 % The upper case characters need their |\uccode| and |\lccode| values
634 % set, and their |\sfcode| set to 999.
637 \count@=#1\advance\count@ by "20
642 \reserved@a{`\A}{`\Z}
643 \reserved@a{"80}{"9C}
644 \reserved@a{"C0}{"DF}
646 % Well, it would be nice if that were correct, but unfortunately, the
647 % Cork encoding contains some odd slots whose uccode or lccode isn't
648 % quite what you'd expect.
650 \uccode`\^^Y=`\I % dotless i
651 \lccode`\^^Y=`\^^Y % dotless i
652 \uccode`\^^Z=`\J % dotless j, ae in OT1
653 \lccode`\^^Z=`\^^Z % dotless j, ae in OT1
654 \lccode`\^^9d=`\i % dotted I
655 \uccode`\^^9d=`\^^9d % dotted I
656 \lccode`\^^9e=`\^^9e % d-bar
657 \uccode`\^^9e=`\^^d0 % d-bar
659 % Finally here is one that helps hyphenation in the OT1 encoding.
660 % \changes{v1.0z}{1996/10/31}
661 % {Added extra \cs{lcode}, hoping it does no harm in T1 (pr/1969)}
663 \lccode`\^^[=`\^^[ % oe in OT1
664 \fi % End of reset block for 8-bit engines
667 % \begin{macro}{\MakeUppercase}
668 % \begin{macro}{\MakeUppercase}
669 % \begin{macro}{\@uclclist}
671 % \changes{v1.1a}{1997/10/20}{Removed \cs{aa} and \cs{AA} from
672 % \cs{@uclclist} as these are macros.}
674 % And whilst we're doing things with uc/lc tables, here are two
675 % commands to upper- and lower-case a string.
677 % \emph{Note} that this implementation is subject to change! At
678 % the moment we're not providing any way to extend the list of
679 % uc/lc commands, since finding a good interface is difficult.
680 % These commands have some nasty features, such as uppercasing
681 % mathematics, environment names, labels, etc. A much better
682 % long-term solution is to use all-caps fonts, but these aren't
683 % generally available.
685 \DeclareRobustCommand{\MakeUppercase}[1]{{%
687 \def\reserved@a##1##2{\let##1##2\reserved@a}%
688 \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
689 \protected@edef\reserved@a{\uppercase{#1}}%
692 \DeclareRobustCommand{\MakeLowercase}[1]{{%
693 \def\reserved@a##1##2{\let##2##1\reserved@a}%
694 \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
695 \protected@edef\reserved@a{\lowercase{#1}}%
698 \def\@uclclist{\oe\OE\o\O\ae\AE
699 \dh\DH\dj\DJ\l\L\ng\NG\ss\SS\th\TH}
701 % The above code works, but has the nasty side-effect that if you
702 % say something like:
704 % \markboth{\MakeUppercase\contentsname}
705 % {\MakeUppercase\contentsname}
707 % then the uppercasing is only done to the first letter of the
708 % contents name, since the mark expands out to:
710 % \mark{\protect\MakeUppercase Table of Contents}
711 % {\protect\MakeUppercase Table of Contents}
713 % In order to get round this, we redefine |\MakeUppercase| and
714 % |\MakeLowercase| to grab their argument and brace it. This is a
715 % very low-level hack, and is \emph{not} recommended practice!
716 % This is an instance of a general problem that makes it unsafe to
717 % grab arguments unbraced, and probably needs a more general
718 % solution. For the moment though, this hack will do:
720 \protected@edef\MakeUppercase#1{\MakeUppercase{#1}}
721 \protected@edef\MakeLowercase#1{\MakeLowercase{#1}}
727 % \changes{v1.0h}{1994/05/13}{Added output enc stuff}
728 % \changes{v1.0i}{1994/05/16}{moved output enc stuff to lfonts}
730 % \changes{v0.1a}{1994/03/07}{Add code from the old dump.dtx}
732 % \subsection{Applying Patch files}
733 % Between major releases, small patches will be distributed in
734 % files |ltpatch.ltx| which must be added at this point.
735 % \changes{v1.0m}{1994/06/08}{Add patch file system}
736 % \changes{v2.0h}{2015/06/23}
737 % {set \cs{patch@level} in ltvers rather than in ltfinal/ltpatch}
739 % Patch file code removed.
741 %\IfFileExists{ltpatch.ltx}
742 % {\typeout{=================================^^J%
743 % Applying patch file ltpatch.ltx^^J%
744 % =================================}
745 % \def\fmtversion@topatch{unknown}
746 % \input{ltpatch.ltx}
747 % \ifx\fmtversion\fmtversion@topatch
748 % \ifx\patch@level\@undefined
749 % \typeout{^^J^^J^^J%
750 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
751 % !! Patch file `ltpatch.ltx' not suitable for this^^J%
752 % !! version of LaTeX.^^J^^J%
753 % !! Please check if initex found an old patch file:^^J%
754 % !! --- if so, rename it or delete it, and redo the^^J%
756 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}%
760 % \changes{v1.0q}{1995/04/21}
761 % {Allow initial patch level 0}
762 % \changes{v1.0t}{1995/06/13}
763 % {Add patch level string more carefully}
764 % The code below adds the `patch level' string to the first |\typeout|
765 % in the startup banner.
767 % \def\fmtversion@topatch{0}%
768 % \ifx\fmtversion@topatch\patch@level\else
769 % \def\reserved@a\typeout##1##2\reserved@a{%
770 % \typeout{##1 patch level \patch@level}##2}
771 % \everyjob\expandafter\expandafter\expandafter{%
772 % \expandafter\reserved@a\the\everyjob\reserved@a}
773 % \let\reserved@a\relax
778 % \typeout{^^J^^J^^J%
779 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
780 % !! Patch file `ltpatch.ltx' (for version <\fmtversion@topatch>)^^J%
781 % !! is not suitable for version <\fmtversion> of LaTeX.^^J^^J%
782 % !! Please check if initex found an old patch file:^^J%
783 % !! --- if so, rename it or delete it, and redo the^^J%
785 % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}%
788 % \let\fmtversion@topatch\relax
792 % \subsection{Freeing Memory}
794 % \begin{macro}{\reserved@a}
795 % \begin{macro}{\reserved@b}
796 % \changes{v1.0v}{1995/10/17}{reset here after the \cs{input} above}
797 % And just to make sure nobody relies on those definitions of
798 % |\reserved@b| and friends.
799 % These macros are reserved for use in the kernel. \emph{Do not use
800 % them as general scratch macros}.
802 \let\reserved@a\@filelist
803 \let\reserved@b=\@undefined
804 \let\reserved@c=\@undefined
805 \let\reserved@d=\@undefined
806 \let\reserved@e=\@undefined
807 \let\reserved@f=\@undefined
812 % \begin{macro}{\toks}
813 % \changes{v1.0y}{1996/07/10}
814 % {Free up memory from scratch registers /2213}
824 % \begin{macro}{\errhelp}
825 % \changes{v0.1g}{1994/05/05}{Set error help empty.}
826 % \changes{v1.1d}{2000/09/01}{Set error help empty at very end
827 % (pr/449 done correctly).}
828 % Empty the error help message, which may have some rubbish:
834 % \subsection{Initialise file list}
836 % \begin{macro}{\@providesfile}
837 % \changes{v1.0v}{1995/10/17}{reset macro}
838 % Initialise for use in the document. During initex a modified version
839 % has been used which leaves debugging information for |latexbug.tex|.
841 \def\@providesfile#1[#2]{%
843 \expandafter\xdef\csname ver@#1\endcsname{#2}%
848 % \begin{macro}{\@filelist}
849 % \changes{v1.0w}{1995/10/19}{Move after \cs{reserved@a} setting:-)}
850 % \begin{macro}{\@addtofilelist}
851 % Reset |\@filelist| so files input while making the format are not
852 % listed. The list built up so far may take up a lot of memory and so
853 % it is moved to |\reserved@a| where it will be overwritten as soon
854 % as almost any \LaTeX\ command is issued in a class file.
855 % However the |latexbug.tex| program will be able to access this
856 % information and insert it into a bug report.
858 \let\@filelist\@gobble
859 \def\@addtofilelist#1{\xdef\@filelist{\@filelist,#1}}%
864 % \subsection{Dumping the format}
865 % Finally we make |@| into a letter, ensure the format will
866 % be in the `normal' error mode, and dump everything into the
868 % \changes{v1.0t}{1995/06/13}
869 % {Call \cs{errorstopmode}}