| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 1993-2025 |
| 4 |
% The LaTeX Project and any individual authors listed elsewhere |
| 5 |
% in this file. |
| 6 |
% |
| 7 |
% This file is part of the LaTeX base system. |
| 8 |
% ------------------------------------------- |
| 9 |
% |
| 10 |
% It may be distributed and/or modified under the |
| 11 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 12 |
% of this license or (at your option) any later version. |
| 13 |
% The latest version of this license is in |
| 14 |
% https://www.latex-project.org/lppl.txt |
| 15 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 16 |
% version 2008 or later. |
| 17 |
% |
| 18 |
% This file has the LPPL maintenance status "maintained". |
| 19 |
% |
| 20 |
% The list of all files belonging to the LaTeX base distribution is |
| 21 |
% given in the file `manifest.txt'. See also `legal.txt' for additional |
| 22 |
% information. |
| 23 |
% |
| 24 |
% The list of derived (unpacked) files belonging to the distribution |
| 25 |
% and covered by LPPL is defined by the unpacking scripts (with |
| 26 |
% extension .ins) which are part of the distribution. |
| 27 |
% |
| 28 |
% \fi |
| 29 |
% \iffalse |
| 30 |
%%% From File: ltplain.dtx |
| 31 |
% |
| 32 |
%<*driver> |
| 33 |
% \fi |
| 34 |
\ProvidesFile{ltplain.dtx} |
| 35 |
[2025/04/14 v2.3m LaTeX Kernel (Plain TeX)] |
| 36 |
% \iffalse |
| 37 |
\documentclass{ltxdoc} |
| 38 |
\GetFileInfo{ltplain.dtx} |
| 39 |
\begin{document} |
| 40 |
\title{\filename\\(The file plain.tex, modified for \LaTeX)} |
| 41 |
\author{Donald~E.~Knuth\\ |
| 42 |
Modified by |
| 43 |
Leslie Lamport, Frank Mittelbach,\\ |
| 44 |
Rainer Sch\"opf, David Carlisle} |
| 45 |
\date{\filedate} |
| 46 |
\MaintainedByLaTeXTeam{latex} |
| 47 |
\maketitle |
| 48 |
\DocInput{\filename} |
| 49 |
\end{document} |
| 50 |
%</driver> |
| 51 |
% \fi |
| 52 |
% |
| 53 |
% |
| 54 |
% \changes{v1.0a}{1994/03/08} |
| 55 |
% {Remove need for a driver file.} |
| 56 |
% \changes{v1.0b}{1994/03/12} |
| 57 |
% {Name changed from lplain. The end of an era} |
| 58 |
% \changes{v1.0e}{1994/03/12}{Replaced remaining width, height, depth |
| 59 |
% by \LaTeX{} macro names to save tokens.} |
| 60 |
% \changes{v1.1a}{1994/10/14} |
| 61 |
% {Moved code to other files.} |
| 62 |
% \changes{v1.1b}{1994/11/10} |
| 63 |
% {(CAR) added patch to \cs{loop}.} |
| 64 |
% \changes{v1.1f}{1994/11/25} |
| 65 |
% {(DPC) Comment out lots of obsolete code} |
| 66 |
% \changes{v1.1g}{1994/12/01} |
| 67 |
% {(DPC) More doc changes} |
| 68 |
% \changes{v1.1j}{1995/05/07}{Use \cs{hb@xt@}} |
| 69 |
% \changes{v1.1j}{1995/05/21}{Moved some code to other files} |
| 70 |
% \changes{v1.1n}{1995/07/02}{Removed surplus `by' and `\quotechar=' in |
| 71 |
% various places} |
| 72 |
% \changes{v1.1o}{1995/09/14}{Moved \cs{multispan} to lttab.dtx} |
| 73 |
% \changes{v1.1r}{1995/10/10}{Autoload tracing code} |
| 74 |
% \changes{v1.1u}{1996/10/28}{(CAR) More doc changes} |
| 75 |
% \changes{v2.0e}{2015/02/21}{Removed autoload code} |
| 76 |
% \changes{v2.2d}{2016/10/15}{Require e\TeX{}} |
| 77 |
% \changes{v2.3b}{2016/11/06}{Drop \cs{outer} entirely} |
| 78 |
% |
| 79 |
% \section{Plain \TeX} |
| 80 |
% |
| 81 |
% \LaTeX\ includes almost all of the functionality of Knuth's original |
| 82 |
% `Basic Macros' That is, the plain \TeX\ format described in Appendix~B |
| 83 |
% of the \TeX{}Book. However, some of the user commands are not much |
| 84 |
% use so, in order to save memory, we may remove them from the kernel |
| 85 |
% into a package. Here is a list of the commands that may be removed |
| 86 |
% (PROBABLY NOT COMPLETE). |
| 87 |
% \begin{verbatim} |
| 88 |
% \magstep \magstephalf |
| 89 |
% \mathhexbox |
| 90 |
% \vglue \vgl@ |
| 91 |
% \hglue \hgl@ |
| 92 |
% \end{verbatim} |
| 93 |
% |
| 94 |
% This file is by now very small as most of it has been moved to more |
| 95 |
% appropriate kernel files: it may disappear completely one day. |
| 96 |
% |
| 97 |
% \LaTeX\ font definitions are done using NFSS2 so none of PLAIN's |
| 98 |
% font definitions are in \LaTeX. |
| 99 |
% |
| 100 |
% \LaTeX\ has its own tabbing environment, so PLAIN's is disabled. |
| 101 |
% |
| 102 |
% \LaTeX{} uses its own output routine, so most of the plain one was |
| 103 |
% removed. |
| 104 |
% |
| 105 |
% \MaybeStop{} |
| 106 |
% |
| 107 |
% |
| 108 |
% \begin{macrocode} |
| 109 |
%<*2ekernel> |
| 110 |
\catcode`\{=1 % left brace is begin-group character |
| 111 |
\catcode`\}=2 % right brace is end-group character |
| 112 |
\catcode`\$=3 % dollar sign is math shift |
| 113 |
\catcode`\&=4 % ampersand is alignment tab |
| 114 |
\catcode`\#=6 % hash mark is macro parameter character |
| 115 |
\catcode`\^=7 % circumflex and uparrow are for superscripts |
| 116 |
\catcode`\_=8 % underline and downarrow are for subscripts |
| 117 |
\catcode`\^^I=10 % ascii tab is a blank space |
| 118 |
\chardef\active=13 \catcode`\~=\active % tilde is active |
| 119 |
\catcode`\^^L=\active \def^^L{\par}% ascii form-feed is \par |
| 120 |
% \end{macrocode} |
| 121 |
% |
| 122 |
% \begin{macrocode} |
| 123 |
\message{catcodes,} |
| 124 |
% \end{macrocode} |
| 125 |
% |
| 126 |
% We had to define the |\catcodes| right away, before the message line, |
| 127 |
% since |\message| uses the |{| and |}| characters. |
| 128 |
% When INITEX (the \TeX\ initializer) starts up, |
| 129 |
% it has defined the following |\catcode| values:\\ |
| 130 |
% |\catcode`\^^@=9 % | ascii null is ignored\\ |
| 131 |
% |\catcode`\^^M=5 % | ascii return is end-line\\ |
| 132 |
% |\catcode`\\=0 % | backslash is TeX escape character\\ |
| 133 |
% |\catcode`\%=14 % | percent sign is comment character\\ |
| 134 |
% |\catcode`\ =10 % | ascii space is blank space\\ |
| 135 |
% |\catcode`\^^?=15 %| ascii delete is invalid\\ |
| 136 |
% |\catcode`\A=11 ... \catcode`\Z=11 %| uppercase letters\\ |
| 137 |
% |\catcode`\a=11 ... \catcode`\z=11 %| lowercase letters\\ |
| 138 |
% all others are type 12 (other) |
| 139 |
% |
| 140 |
% \changes{v1.3k}{2024/11/02}{Add tab char to \cs{dospecials}} |
| 141 |
% Here is a list of the characters that have been specially catcoded: |
| 142 |
% \begin{macrocode} |
| 143 |
\def\dospecials{\do\ \do\\\do\{\do\}\do\$\do\&% |
| 144 |
\do\#\do\^\do\_\do\%\do\~\do\^^I} |
| 145 |
% \end{macrocode} |
| 146 |
% (not counting ascii null, linefeed, formfeed, return, delete) |
| 147 |
% Each symbol in the list is preceded by \do, which can be defined |
| 148 |
% if you want to do something to every item in the list. |
| 149 |
% |
| 150 |
% We make |@| signs act like letters, temporarily, to avoid conflict |
| 151 |
% between user names and internal control sequences of plain format. |
| 152 |
% \begin{macrocode} |
| 153 |
\catcode`@=11 |
| 154 |
% \end{macrocode} |
| 155 |
% |
| 156 |
% To make the plain macros more efficient in time and space, |
| 157 |
% several constant values are declared here as control sequences. |
| 158 |
% If they were changed, anything could happen; |
| 159 |
% so they are private symbols. |
| 160 |
% \begin{macro}{\@ne} |
| 161 |
% \begin{macro}{\tw@} |
| 162 |
% \begin{macro}{\thr@@} |
| 163 |
% \begin{macro}{\sixt@@n} |
| 164 |
% \begin{macro}{\@cclv} |
| 165 |
% Small constants are defined using |\chardef|. |
| 166 |
% \begin{macrocode} |
| 167 |
\chardef\@ne=1 |
| 168 |
\chardef\tw@=2 |
| 169 |
\chardef\thr@@=3 |
| 170 |
\chardef\sixt@@n=16 |
| 171 |
\chardef\@cclv=255 |
| 172 |
% \end{macrocode} |
| 173 |
% \end{macro} |
| 174 |
% \end{macro} |
| 175 |
% \end{macro} |
| 176 |
% \end{macro} |
| 177 |
% \end{macro} |
| 178 |
% |
| 179 |
% \begin{macro}{\@cclvi} |
| 180 |
% \begin{macro}{\@m} |
| 181 |
% \begin{macro}{\@M} |
| 182 |
% \begin{macro}{\@MM} |
| 183 |
% Constants above 255 defined using |\mathchardef|. |
| 184 |
% \begin{macrocode} |
| 185 |
\mathchardef\@cclvi=256 |
| 186 |
\mathchardef\@m=1000 |
| 187 |
\mathchardef\@M=10000 |
| 188 |
\mathchardef\@MM=20000 |
| 189 |
% \end{macrocode} |
| 190 |
% \end{macro} |
| 191 |
% \end{macro} |
| 192 |
% \end{macro} |
| 193 |
% \end{macro} |
| 194 |
% |
| 195 |
% Allocation of registers |
| 196 |
% |
| 197 |
% Here are macros for the automatic allocation of |\count|, |\box|, |
| 198 |
% |\dimen|, |\skip|, |\muskip|, and |\toks| registers, as well as |
| 199 |
% |\read| and |\write| stream numbers, |\fam| codes, |\language| codes, |
| 200 |
% and |\insert| numbers. |
| 201 |
% |
| 202 |
% \begin{macrocode} |
| 203 |
\message{registers,} |
| 204 |
% \end{macrocode} |
| 205 |
% |
| 206 |
% When a register is used only temporarily, it need not be allocated; |
| 207 |
% grouping can be used, making the value previously in the register |
| 208 |
% return after the close of the group. The main use of these macros is |
| 209 |
% for registers that are defined by one macro and used by others, |
| 210 |
% possibly at different nesting levels. All such registers should be |
| 211 |
% defined through these macros; otherwise conflicts may occur, |
| 212 |
% especially when two or more macro packages are being used at |
| 213 |
% the same time. |
| 214 |
% |
| 215 |
% \begin{oldcomments} |
| 216 |
% The following counters are reserved: |
| 217 |
% 0 to 9 page numbering |
| 218 |
% 10 count allocation |
| 219 |
% 11 dimen allocation |
| 220 |
% 12 skip allocation |
| 221 |
% 13 muskip allocation |
| 222 |
% 14 box allocation |
| 223 |
% 15 toks allocation |
| 224 |
% 16 read file allocation |
| 225 |
% 17 write file allocation |
| 226 |
% 18 math family allocation |
| 227 |
% 19 language allocation |
| 228 |
% 20 insert allocation |
| 229 |
% 21 the most recently allocated number |
| 230 |
% 22 constant -1 |
| 231 |
% \end{oldcomments} |
| 232 |
% |
| 233 |
% New counters are allocated starting with 23, 24, etc. Other registers |
| 234 |
% are allocated starting with 10. This leaves 0 through 9 for the user |
| 235 |
% to play with safely, except that counts 0 to 9 are considered to be |
| 236 |
% the page and subpage numbers (since they are displayed during |
| 237 |
% output). In this scheme, |\count| 10 always contains the number of the |
| 238 |
% highest-numbered counter that has been allocated, |\count| 14 the |
| 239 |
% highest-numbered box, etc. Inserts are given numbers 254, 253, etc., |
| 240 |
% since they require a |\count|, |\dimen|, |\skip|, and |\box| all with |
| 241 |
% the same number; |\count| 20 contains the lowest-numbered insert that |
| 242 |
% has been allocated. Of course, |\box|255 is reserved for |\output|; |
| 243 |
% |\count|255, |\dimen|255, and |\skip|255 can be used freely. |
| 244 |
% |
| 245 |
% It is recommended that macro designers always use |
| 246 |
% |\global| assignments with respect to registers numbered\\ |
| 247 |
% 1, 3, 5, 7, 9,\\ |
| 248 |
% and always non-|\global| assignments with respect to registers\\ |
| 249 |
% 0, 2, 4, 6, 8, 255.\\ |
| 250 |
% This will prevent ``save stack buildup'' that might otherwise occur. |
| 251 |
% |
| 252 |
% \begin{macrocode} |
| 253 |
\count10=22 % allocates \count registers 23, 24, ... |
| 254 |
\count11=9 % allocates \dimen registers 10, 11, ... |
| 255 |
\count12=9 % allocates \skip registers 10, 11, ... |
| 256 |
\count13=9 % allocates \muskip registers 10, 11, ... |
| 257 |
\count14=9 % allocates \box registers 10, 11, ... |
| 258 |
\count15=9 % allocates \toks registers 10, 11, ... |
| 259 |
\count16=-1 % allocates input streams 0, 1, ... |
| 260 |
\count17=-1 % allocates output streams 0, 1, ... |
| 261 |
\count18=3 % allocates math families 4, 5, ... |
| 262 |
\count19=0 % allocates \language codes 1, 2, ... |
| 263 |
\count20=255 % allocates insertions 254, 253, ... |
| 264 |
% \end{macrocode} |
| 265 |
% |
| 266 |
% \begin{macro}{\insc@unt} |
| 267 |
% \begin{macro}{\allocationnumber} |
| 268 |
% The insertion counter and most recent allocation. |
| 269 |
% \begin{macrocode} |
| 270 |
\countdef\insc@unt=20 |
| 271 |
\countdef\allocationnumber=21 |
| 272 |
% \end{macrocode} |
| 273 |
% \end{macro} |
| 274 |
% \end{macro} |
| 275 |
% |
| 276 |
% \begin{macro}{\m@ne} |
| 277 |
% The constant $-1$. |
| 278 |
% \begin{macrocode} |
| 279 |
\countdef\m@ne=22 \m@ne=-1 |
| 280 |
% \end{macrocode} |
| 281 |
% \end{macro} |
| 282 |
% |
| 283 |
% \begin{macro}{\wlog} |
| 284 |
% Write on log file (only) |
| 285 |
% \begin{macrocode} |
| 286 |
\def\wlog{\immediate\write\m@ne} |
| 287 |
% \end{macrocode} |
| 288 |
% \end{macro} |
| 289 |
% |
| 290 |
% \begin{macro}{\count@} |
| 291 |
% \begin{macro}{\dimen@} |
| 292 |
% \begin{macro}{\dimen@i} |
| 293 |
% \begin{macro}{\dimen@ii} |
| 294 |
% \begin{macro}{\skip@} |
| 295 |
% \begin{macro}{\toks@} |
| 296 |
% Here are abbreviations for the names of scratch registers |
| 297 |
% that don't need to be allocated. |
| 298 |
% \begin{macrocode} |
| 299 |
\countdef\count@=255 |
| 300 |
\dimendef\dimen@=0 |
| 301 |
\dimendef\dimen@i=1 % global only |
| 302 |
\dimendef\dimen@ii=2 |
| 303 |
\skipdef\skip@=0 |
| 304 |
\toksdef\toks@=0 |
| 305 |
% \end{macrocode} |
| 306 |
% \end{macro} |
| 307 |
% \end{macro} |
| 308 |
% \end{macro} |
| 309 |
% \end{macro} |
| 310 |
% \end{macro} |
| 311 |
% \end{macro} |
| 312 |
% |
| 313 |
% \begin{macro}{\newcount} |
| 314 |
% \begin{macro}{\newdimen} |
| 315 |
% \begin{macro}{\newskip} |
| 316 |
% \begin{macro}{\newmuskip} |
| 317 |
% \begin{macro}{\newbox} |
| 318 |
% \begin{macro}{\newtoks} |
| 319 |
% \begin{macro}{\newread} |
| 320 |
% \begin{macro}{\newwrite} |
| 321 |
% \begin{macro}{\newfam} |
| 322 |
% \begin{macro}{\newlanguage} |
| 323 |
% \changes{v1.0c}{1994/03/28} |
| 324 |
% {Remove some \cs{outer} declarations.} |
| 325 |
% \changes{v1.1h}{1995/04/24} |
| 326 |
% {Remove remaining \cs{outer} declarations.} |
| 327 |
% Now, we define |\newcount|, |\newbox|, etc. so that you can say |
| 328 |
% |\newcount\foo| and |\foo| will be defined (with |\countdef|) to |
| 329 |
% be the next counter. |
| 330 |
% |
| 331 |
% To find out which counter |\foo| is, you can look at |
| 332 |
% |\allocationnumber|. |
| 333 |
% |
| 334 |
% Since there's no |\boxdef| command, |\chardef| is used to define a |
| 335 |
% |\newbox|, |\newinsert|, |\newfam|, and so on. |
| 336 |
% |
| 337 |
% \LaTeX\ change: remove |\outer| from |\newcount| and |\newdimen| (FMi) |
| 338 |
% This is necessary to use |\newcount| inside |\if...| |
| 339 |
% later on. Also remove from |\newskip|, |\newbox| |
| 340 |
% |\newwrite| and |\newfam| (DPC) to save later redefinition. |
| 341 |
% \changes{v2.0a}{2014/12/30}{New engine-specific allocation scheme (latexrelease)} |
| 342 |
% \changes{v2.0f}{2015/03/02}{allow 255 math groups in Unicode engines} |
| 343 |
% \changes{v2.0h}{2015/06/19}{Use $-1$ for first range to get contiguous allocation} |
| 344 |
% \changes{v2.3m}{2025/04/14}{Always use extended allocation} |
| 345 |
% Rolling back the allocation routine runs us into trouble nowadays as the |
| 346 |
% kernel itself will use up all of the standard pool. So we pretend we've |
| 347 |
% always used the full range: this is needed for roll forward. |
| 348 |
% \begin{macrocode} |
| 349 |
\def\newcount {\e@alloc\count \countdef {\count10}\insc@unt\float@count} |
| 350 |
\def\newdimen {\e@alloc\dimen \dimendef {\count11}\insc@unt\float@count} |
| 351 |
\def\newskip {\e@alloc\skip \skipdef {\count12}\insc@unt\float@count} |
| 352 |
\def\newmuskip |
| 353 |
{\e@alloc\muskip\muskipdef{\count13}\m@ne\e@alloc@top} |
| 354 |
% \end{macrocode} |
| 355 |
% For compatibility use |\chardef| in the classical range. |
| 356 |
% \begin{macrocode} |
| 357 |
\def\newbox {\e@alloc\box |
| 358 |
{\ifnum\allocationnumber<\@cclvi |
| 359 |
\expandafter\chardef |
| 360 |
\else |
| 361 |
\expandafter\e@alloc@chardef |
| 362 |
\fi} |
| 363 |
{\count14}\insc@unt\float@count} |
| 364 |
\def\newtoks {\e@alloc\toks \toksdef{\count15}\m@ne\e@alloc@top} |
| 365 |
\def\newread {\e@alloc\read \chardef{\count16}\m@ne\sixt@@n} |
| 366 |
% \end{macrocode} |
| 367 |
% |
| 368 |
% \changes{v2.2a}{2015/11/18} |
| 369 |
% {Extended stream allocation in luatex (0.85)} |
| 370 |
% \changes{v2.2b}{2015/11/19} |
| 371 |
% {Only extend allocation of write streams (see luatex list)} |
| 372 |
% \changes{v2.3c}{2017/04/10} |
| 373 |
% {Correction to code to skip write18 in luatex} |
| 374 |
% Skip |\write18| due to its traditional use as a shell-escape. |
| 375 |
% \begin{macrocode} |
| 376 |
\ifx\directlua\@undefined |
| 377 |
\def\newwrite {\e@alloc\write \chardef{\count17}\m@ne\sixt@@n} |
| 378 |
\else |
| 379 |
\def\newwrite {\e@alloc\write |
| 380 |
{\ifnum\allocationnumber=18 |
| 381 |
\advance\count17\@ne |
| 382 |
\allocationnumber\count17 % |
| 383 |
\fi |
| 384 |
\global\chardef}% |
| 385 |
{\count17}% |
| 386 |
\m@ne |
| 387 |
{128}} |
| 388 |
\fi |
| 389 |
% \end{macrocode} |
| 390 |
% |
| 391 |
% \begin{macrocode} |
| 392 |
\def\new@mathgroup |
| 393 |
{\e@alloc\mathgroup\chardef{\count18}\m@ne\e@mathgroup@top} |
| 394 |
\let\newfam\new@mathgroup |
| 395 |
% \end{macrocode} |
| 396 |
% |
| 397 |
% \changes{v2.3a}{2016/10/16}{Allow languages up to 16383 in luatex} |
| 398 |
% \begin{macrocode} |
| 399 |
\ifx\directlua\@undefined |
| 400 |
\def\newlanguage {\e@alloc\language \chardef{\count19}\m@ne\@cclvi} |
| 401 |
\else |
| 402 |
\def\newlanguage {\e@alloc\language \chardef{\count19}\m@ne{16384}} |
| 403 |
\fi |
| 404 |
% \end{macrocode} |
| 405 |
% \end{macro} |
| 406 |
% \end{macro} |
| 407 |
% \end{macro} |
| 408 |
% \end{macro} |
| 409 |
% \end{macro} |
| 410 |
% \end{macro} |
| 411 |
% \end{macro} |
| 412 |
% \end{macro} |
| 413 |
% \end{macro} |
| 414 |
% \end{macro} |
| 415 |
% |
| 416 |
%\begin{macro}{\e@alloc@chardef} |
| 417 |
% \changes{v2.0a}{2014/12/30}{macro added} |
| 418 |
% \changes{v2.3m}{2025/04/14}{Always use extended allocation} |
| 419 |
%\begin{macro}{\e@alloc@top} |
| 420 |
% \changes{v2.0a}{2014/12/30}{macro added} |
| 421 |
% \changes{v2.3m}{2025/04/14}{Drop a redundant \eTeX{} test} |
| 422 |
% The upper limit of extended registers, which leaves |
| 423 |
% this number (eg |\dimen32767|) always unallocated |
| 424 |
% by these macros. |
| 425 |
% cf traditional |\dimen255|. |
| 426 |
% \begin{macrocode} |
| 427 |
\ifx\directlua\@undefined |
| 428 |
\mathchardef\e@alloc@top=32767 |
| 429 |
\let\e@alloc@chardef\mathchardef |
| 430 |
\else |
| 431 |
% \end{macrocode} |
| 432 |
% luatex has $2^{16}$ registers. |
| 433 |
% \begin{macrocode} |
| 434 |
\chardef\e@alloc@top=65535 |
| 435 |
\let\e@alloc@chardef\chardef |
| 436 |
\fi |
| 437 |
% \end{macrocode} |
| 438 |
% \end{macro} |
| 439 |
% \end{macro} |
| 440 |
% |
| 441 |
%\begin{macro}{\e@mathgroup@top} |
| 442 |
% \changes{v2.0f}{2015/03/02}{macro added} |
| 443 |
% \changes{v2.3m}{2025/04/14}{Always use extended allocation} |
| 444 |
% The upper limit of extended math groups (|\fam|) |
| 445 |
% 16 in classic \TeX\ and e-\TeX, but 256 in Unicode TeX variants. |
| 446 |
% \begin{macrocode} |
| 447 |
\ifx\Umathcode\@undefined |
| 448 |
% \end{macrocode} |
| 449 |
% classic and e tex have 16 fam (0--15). |
| 450 |
% \begin{macrocode} |
| 451 |
\chardef\e@mathgroup@top=16 |
| 452 |
\else |
| 453 |
% \end{macrocode} |
| 454 |
% xetex and luatex have 256 fam (0--255). |
| 455 |
% \begin{macrocode} |
| 456 |
\chardef\e@mathgroup@top=256 |
| 457 |
\fi |
| 458 |
% \end{macrocode} |
| 459 |
% \end{macro} |
| 460 |
% |
| 461 |
% \begin{macro}{\e@alloc} |
| 462 |
% \changes{v2.0a}{2014/12/30}{macro added} |
| 463 |
% A modified version of |\alloc@| that |
| 464 |
% takes the count register rather than just the final digit of its number |
| 465 |
% (assuming |\count|$1x$). |
| 466 |
% It also has an extra argument to give the top of the extended range. |
| 467 |
% |
| 468 |
% | #1 #2 #3 #4 #5 #6 | |
| 469 |
% |
| 470 |
% | \e@alloc type defcmd current top extended-top newname| |
| 471 |
% |
| 472 |
% Note that if just a single allocation range is required |
| 473 |
% (not omitting a range up to 255 for inserts) then $-1$ |
| 474 |
% should be used for the first upper bound argument, |#4|. |
| 475 |
% |
| 476 |
% \begin{macrocode} |
| 477 |
% \end{macrocode} |
| 478 |
% |
| 479 |
% \changes{v2.0h}{2015/06/19}{extra braces in case arguments not single token} |
| 480 |
% \changes{v2.3m}{2025/04/14}{Always use extended allocation} |
| 481 |
% \begin{macrocode} |
| 482 |
\def\e@alloc#1#2#3#4#5#6{% |
| 483 |
\global\advance#3\@ne |
| 484 |
\e@ch@ck{#3}{#4}{#5}#1% |
| 485 |
\allocationnumber#3\relax |
| 486 |
\global#2#6\allocationnumber |
| 487 |
\wlog{\string#6=\string#1\the\allocationnumber}}% |
| 488 |
% \end{macrocode} |
| 489 |
% |
| 490 |
% \end{macro} |
| 491 |
% |
| 492 |
%\begin{macro}{\e@ch@ck} |
| 493 |
% \changes{v2.0a}{2014/12/30}{macro added} |
| 494 |
% Extended check command. |
| 495 |
% If the first range is exceeded, bump to 256 (or 266 for counts) |
| 496 |
% and try again, testing the extended range. |
| 497 |
%\begin{macro}{\extrafloats} |
| 498 |
% \changes{v2.0a}{2014/12/30}{macro added} |
| 499 |
% \changes{v2.0c}{2015/01/23}{reserve counts 256--265} |
| 500 |
% \changes{v2.3m}{2025/04/14}{Always use extended allocation} |
| 501 |
% Allocate matching registers from the top of the extended range |
| 502 |
% and add to |\@freelist|. |
| 503 |
% \begin{macrocode} |
| 504 |
\gdef\e@ch@ck#1#2#3#4{% |
| 505 |
\ifnum#1<#2\else |
| 506 |
% \end{macrocode} |
| 507 |
% |
| 508 |
% If we've reached the classical top limit, bump to 256 |
| 509 |
% or 266 for counts (count 256--265 are reserved by the allocation |
| 510 |
% system). |
| 511 |
% \changes{v2.1b}{2015/10/27} |
| 512 |
% {Use global assignment when switching to extended range} |
| 513 |
% \begin{macrocode} |
| 514 |
\ifnum#1=#2\relax |
| 515 |
\global#1\@cclvi |
| 516 |
\ifx\count#4\global\advance#1 10 \fi |
| 517 |
\fi |
| 518 |
% \end{macrocode} |
| 519 |
% Check we are below the extended limit. |
| 520 |
% \changes{v2.0i}{2015/08/06} |
| 521 |
% {Add \cs{string} in case argument is not an unexpandable primitive} |
| 522 |
% \begin{macrocode} |
| 523 |
\ifnum#1<#3\relax |
| 524 |
\else |
| 525 |
\errmessage{No room for a new \string#4}% |
| 526 |
\fi |
| 527 |
\fi}% |
| 528 |
% \end{macrocode} |
| 529 |
% \end{macro} |
| 530 |
% |
| 531 |
% \begin{macrocode} |
| 532 |
\let\float@count\e@alloc@top |
| 533 |
% \end{macrocode} |
| 534 |
% |
| 535 |
% \begin{macro}{\extrafloats} |
| 536 |
% \changes{v2.2c}{2016/07/29}{use \cs{global} \cs{chardef}} |
| 537 |
% \begin{macrocode} |
| 538 |
\ifx\numexpr\@undefined |
| 539 |
% \end{macrocode} |
| 540 |
% In classic TeX use |\newinsert| to allocate float boxes. |
| 541 |
% \begin{macrocode} |
| 542 |
\def\extrafloats#1{% |
| 543 |
\count@#1\relax |
| 544 |
\ifnum\count@>\z@ |
| 545 |
\newinsert\reserved@a |
| 546 |
\global\expandafter\chardef |
| 547 |
\csname bx@\the\allocationnumber\endcsname\allocationnumber |
| 548 |
\@cons\@freelist{\csname bx@\the\allocationnumber\endcsname}% |
| 549 |
\advance\count@\m@ne |
| 550 |
\expandafter\extrafloats |
| 551 |
\expandafter\count@ |
| 552 |
\fi |
| 553 |
}% |
| 554 |
% \end{macrocode} |
| 555 |
% |
| 556 |
% \begin{macrocode} |
| 557 |
\else |
| 558 |
% \end{macrocode} |
| 559 |
% In e-tex take float boxes from the top of the extended range. |
| 560 |
% \begin{macrocode} |
| 561 |
\def\extrafloats#1{% |
| 562 |
\ifnum#1>\z@ |
| 563 |
\count@\numexpr\float@count-1\relax |
| 564 |
% \end{macrocode} |
| 565 |
% \changes{v2.3i}{2023/04/15}{Protect box 255 in lualatex gh/1041} |
| 566 |
% \begin{macrocode} |
| 567 |
\ifnum\count@<266 \ch@ck0\m@ne\insert\fi |
| 568 |
\ch@ck0\count@\count |
| 569 |
\ch@ck1\count@\dimen |
| 570 |
\ch@ck2\count@\skip |
| 571 |
\ch@ck4\count@\box |
| 572 |
\global\e@alloc@chardef\float@count\count@ |
| 573 |
\global\expandafter\e@alloc@chardef |
| 574 |
\csname bx@\the\float@count\endcsname\float@count |
| 575 |
\@cons\@freelist{\csname bx@\the\float@count\endcsname}% |
| 576 |
% \end{macrocode} |
| 577 |
% \changes{v2.3i}{2023/04/15}{unwind numexpr and ifnum nesting} |
| 578 |
% \begin{macrocode} |
| 579 |
\expandafter\extrafloats\expandafter{\the\numexpr#1-1\expandafter}% |
| 580 |
% \end{macrocode} |
| 581 |
% \begin{macrocode} |
| 582 |
\fi}% |
| 583 |
% \end{macrocode} |
| 584 |
% |
| 585 |
% \begin{macrocode} |
| 586 |
\fi |
| 587 |
% \end{macrocode} |
| 588 |
% \end{macro} |
| 589 |
% \end{macro} |
| 590 |
% |
| 591 |
% \begin{macro}{\alloc@} |
| 592 |
% \changes{v2.3d}{2020/08/20} |
| 593 |
% {Define \cs{alloc@} in terms of \cs{e@alloc}} |
| 594 |
% Since |\e@alloc| was added in 2015, |\@alloc| has not been used, |
| 595 |
% but was left as some legacy code calls it. However the original |
| 596 |
% definition gives spurious errors once the ``classic'' registers |
| 597 |
% run out, so it is now defined to call |\e@alloc| internally. |
| 598 |
% \begin{macrocode} |
| 599 |
\def\alloc@#1#2#3#4{\e@alloc#2#3{\count1#1}#4\float@count} |
| 600 |
% \end{macrocode} |
| 601 |
% \end{macro} |
| 602 |
% |
| 603 |
% \begin{macro}{\newinsert} |
| 604 |
% \changes{v2.1a}{2015/08/30}{new \cs{newinsert} implementation} |
| 605 |
% \changes{v2.3m}{2025/04/14}{Always use extended allocation} |
| 606 |
% \changes{v2.3m}{2025/04/14}{Drop redundant \eTeX{} test} |
| 607 |
% The highest register allowed with |\insert|. |
| 608 |
% \begin{macrocode} |
| 609 |
\ifx\directlua\@undefined |
| 610 |
\chardef\e@insert@top255 |
| 611 |
\else |
| 612 |
\chardef\e@insert@top\e@alloc@top |
| 613 |
\fi |
| 614 |
% \end{macrocode} |
| 615 |
% If the classic registers are exhausted, take an insert from the free |
| 616 |
% float list and use |\extrafloats| to add a new float to that list. |
| 617 |
% \changes{v2.2c}{2016/07/29}{fix for tlb-newinsert-001} |
| 618 |
% \begin{macrocode} |
| 619 |
\def\newinsert#1{% |
| 620 |
\@tempswafalse |
| 621 |
\global\advance\insc@unt\m@ne |
| 622 |
\ifnum\count10<\insc@unt |
| 623 |
\ifnum\count11<\insc@unt |
| 624 |
\ifnum\count12<\insc@unt |
| 625 |
\ifnum\count14<\insc@unt |
| 626 |
\@tempswatrue |
| 627 |
\fi\fi\fi\fi |
| 628 |
\if@tempswa |
| 629 |
\allocationnumber\insc@unt |
| 630 |
\else |
| 631 |
\global\advance\insc@unt\@ne |
| 632 |
\extrafloats\@ne |
| 633 |
\@next\@currbox\@freelist |
| 634 |
{\ifnum\@currbox<\e@insert@top |
| 635 |
\allocationnumber\@currbox |
| 636 |
\else |
| 637 |
\ch@ck0\m@ne\insert |
| 638 |
\fi}% |
| 639 |
{\ch@ck0\m@ne\insert}% |
| 640 |
\fi |
| 641 |
\global\chardef#1\allocationnumber |
| 642 |
\wlog{\string#1=\string\insert\the\allocationnumber}% |
| 643 |
} |
| 644 |
% \end{macrocode} |
| 645 |
% \end{macro} |
| 646 |
% |
| 647 |
% \begin{macro}{\ch@ck} |
| 648 |
% \begin{macrocode} |
| 649 |
\gdef\ch@ck#1#2#3{% |
| 650 |
\ifnum\count1#1<#2\else |
| 651 |
\errmessage{No room for a new #3}% |
| 652 |
\fi} |
| 653 |
% \end{macrocode} |
| 654 |
% \end{macro} |
| 655 |
% |
| 656 |
% \changes{v2.0h}{2015/06/19}{delete spurious old definition of \cs{newtoks}} |
| 657 |
% \begin{macro}{\newhelp} |
| 658 |
% \begin{macrocode} |
| 659 |
\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}} |
| 660 |
% \end{macrocode} |
| 661 |
% \end{macro} |
| 662 |
% |
| 663 |
% |
| 664 |
% |
| 665 |
% \begin{macro}{\@inputcheck} |
| 666 |
% \begin{macro}{\@unused} |
| 667 |
% Allocate read stream for testing and output stream that is never open an |
| 668 |
% thus writes to the terminal. |
| 669 |
% \changes{v1.0l}{1994/11/07} |
| 670 |
% {move here from ltdefns, remove duplicate \cs{@mainaux}} |
| 671 |
% \changes{v2.3e}{2021/03/26}{Allocate \cs{@inputcheck} and |
| 672 |
% \cs{@unused} early so that they are before expl3 allocates |
| 673 |
% more streams (gh/538)} |
| 674 |
% \begin{macrocode} |
| 675 |
\newread\@inputcheck |
| 676 |
\newwrite\@unused |
| 677 |
% \end{macrocode} |
| 678 |
% \end{macro} |
| 679 |
% \end{macro} |
| 680 |
% |
| 681 |
% |
| 682 |
% |
| 683 |
% |
| 684 |
% |
| 685 |
% \begin{macro}{\maxdimen} |
| 686 |
% \begin{macro}{\hideskip} |
| 687 |
% Here are some examples of allocation. |
| 688 |
% \begin{macrocode} |
| 689 |
\newdimen\maxdimen \maxdimen=16383.99999pt % the largest legal <dimen> |
| 690 |
\newskip\hideskip \hideskip=-1000pt plus 1fill % negative but can grow |
| 691 |
% \end{macrocode} |
| 692 |
% \end{macro} |
| 693 |
% \end{macro} |
| 694 |
% |
| 695 |
% \begin{macro}{\p@} |
| 696 |
% \begin{macro}{\z@} |
| 697 |
% \begin{macro}{\z@skip} |
| 698 |
% \begin{macro}{\voidb@x} |
| 699 |
% \begin{macrocode} |
| 700 |
\newdimen\p@ \p@=1pt % this saves macro space and time |
| 701 |
\newdimen\z@ \z@=0pt % can be used both for 0pt and 0 |
| 702 |
\newskip\z@skip \z@skip=0pt plus0pt minus0pt |
| 703 |
\newbox\voidb@x % permanently void box register |
| 704 |
% \end{macrocode} |
| 705 |
% \end{macro} |
| 706 |
% \end{macro} |
| 707 |
% \end{macro} |
| 708 |
% \end{macro} |
| 709 |
% |
| 710 |
% Assign initial values to \TeX's parameters |
| 711 |
% |
| 712 |
% \begin{macrocode} |
| 713 |
\message{parameters,} |
| 714 |
% \end{macrocode} |
| 715 |
% |
| 716 |
% All of \TeX's numeric parameters are listed here, |
| 717 |
% but the code is commented out if no special value needs to be set. |
| 718 |
% INITEX makes all parameters zero except where noted. |
| 719 |
% |
| 720 |
% \begin{macrocode} |
| 721 |
\pretolerance=100 |
| 722 |
\tolerance=200 % INITEX sets this to 10000 |
| 723 |
\hbadness=1000 |
| 724 |
\vbadness=1000 |
| 725 |
\linepenalty=10 |
| 726 |
\hyphenpenalty=50 |
| 727 |
\exhyphenpenalty=50 |
| 728 |
\binoppenalty=700 |
| 729 |
\relpenalty=500 |
| 730 |
\clubpenalty=150 |
| 731 |
\widowpenalty=150 |
| 732 |
\displaywidowpenalty=50 |
| 733 |
\brokenpenalty=100 |
| 734 |
\predisplaypenalty=10000 |
| 735 |
% \end{macrocode} |
| 736 |
% |
| 737 |
% \begin{macrocode} |
| 738 |
% \postdisplaypenalty=0 |
| 739 |
% \interlinepenalty=0 |
| 740 |
% \floatingpenalty=0, set during \insert |
| 741 |
% \outputpenalty=0, set before TeX enters \output |
| 742 |
% \end{macrocode} |
| 743 |
% |
| 744 |
% \begin{macrocode} |
| 745 |
\doublehyphendemerits=10000 |
| 746 |
\finalhyphendemerits=5000 |
| 747 |
\adjdemerits=10000 |
| 748 |
% \end{macrocode} |
| 749 |
% \begin{macrocode} |
| 750 |
% \looseness=0, cleared by TeX after each paragraph |
| 751 |
% \pausing=0 |
| 752 |
% \holdinginserts=0 |
| 753 |
% \tracingonline=0 |
| 754 |
% \tracingmacros=0 |
| 755 |
% \tracingstats=0 |
| 756 |
% \tracingparagraphs=0 |
| 757 |
% \tracingpages=0 |
| 758 |
% \tracingoutput=0 |
| 759 |
% \end{macrocode} |
| 760 |
% In the past \LaTeX{} used the default value of \texttt{1} for |
| 761 |
% \cs{tracinglostchars} because this was the best it could do. This |
| 762 |
% way one would at least get a warning in the \texttt{.log} |
| 763 |
% file. e-\TeX{} improved on that and supported a value of \texttt{2} |
| 764 |
% to show the warning on the terminal, so we could have changed the |
| 765 |
% default when we made the e-\TeX{} extensions required---however, |
| 766 |
% we overlooked that opportunity. |
| 767 |
% In 2021 this parameter was improved on again and now also accepts |
| 768 |
% the value \texttt{3} |
| 769 |
% (error on the terminal). This made us realize that we should |
| 770 |
% change the default. Using \texttt{3} would really be the |
| 771 |
% best, but for compatibility reasons we only use \texttt{2}. |
| 772 |
% For recent Lua\TeX{} releases, we set \texttt{4}: this is offset by~2 |
| 773 |
% from the e-\TeX{} value as otherwise Lua\TeX{} only issues a warning |
| 774 |
% for text in a box when the box is used, not saved. (Accepting values of |
| 775 |
% 4 and 5 was updated in the \TeX{}~Live 2025 release.) |
| 776 |
% \changes{v2.3g}{2021/07/16}{Use 2 as default value for \cs{tracinglostchars}} |
| 777 |
% \changes{v2.3l}{2025/03/05}{Use 4 as default value for \cs{tracinglostchars} |
| 778 |
% in Lua\TeX{} (gh/1687)} |
| 779 |
% \begin{macrocode} |
| 780 |
\tracinglostchars=2 |
| 781 |
\ifdefined\luatexversion |
| 782 |
\ifnum\luatexversion>120 |
| 783 |
\tracinglostchars=4 |
| 784 |
\fi |
| 785 |
\fi |
| 786 |
% \end{macrocode} |
| 787 |
% \begin{macrocode} |
| 788 |
% \tracingcommands=0 |
| 789 |
% \tracingrestores=0 |
| 790 |
% \end{macrocode} |
| 791 |
% |
| 792 |
% \begin{macro}{\tracingstacklevels} |
| 793 |
% For Lua\TeX, the \cs{tracingstacklevels} functionality was |
| 794 |
% implemented as a callback, so here we just define the count register |
| 795 |
% to hold the value of the parameter. |
| 796 |
% \begin{macrocode} |
| 797 |
%</2ekernel> |
| 798 |
%<*2ekernel|latexrelease> |
| 799 |
%<latexrelease>\IncludeInRelease{2021/06/01}{\tracingstacklevels}% |
| 800 |
%<latexrelease> {tracingstacklevels}% |
| 801 |
\ifx\directlua\@undefined |
| 802 |
% \tracingstacklevels=0 % added in 2021 |
| 803 |
\else |
| 804 |
\newcount\tracingstacklevels |
| 805 |
% Code for \tracingstacklevels defined in ltfinal.dtx |
| 806 |
\fi |
| 807 |
%<latexrelease>\EndIncludeInRelease |
| 808 |
%<latexrelease> |
| 809 |
%<latexrelease>\IncludeInRelease{0000/00/00}{\tracingstacklevels}% |
| 810 |
%<latexrelease> {tracingstacklevels}% |
| 811 |
%<latexrelease>\ifx\directlua\@undefined |
| 812 |
%<latexrelease>\else |
| 813 |
%<latexrelease> \let\tracingstacklevels\@undefined |
| 814 |
%<latexrelease>\fi |
| 815 |
%<latexrelease>\EndIncludeInRelease |
| 816 |
%</2ekernel|latexrelease> |
| 817 |
%<*2ekernel> |
| 818 |
% \end{macrocode} |
| 819 |
% \end{macro} |
| 820 |
% |
| 821 |
% \language=0 |
| 822 |
% \begin{macrocode} |
| 823 |
\uchyph=1 |
| 824 |
% \end{macrocode} |
| 825 |
% |
| 826 |
% \begin{macrocode} |
| 827 |
% \lefthyphenmin=2 \righthyphenmin=3 set below |
| 828 |
% \globaldefs=0 |
| 829 |
% \maxdeadcycles=25 % INITEX does this |
| 830 |
% \hangafter=1 % INITEX does this, also TeX after each paragraph |
| 831 |
% \fam=0 |
| 832 |
% \mag=1000 % INITEX does this |
| 833 |
% \escapechar=`\\ % INITEX does this |
| 834 |
% \end{macrocode} |
| 835 |
% |
| 836 |
% \begin{macrocode} |
| 837 |
\defaulthyphenchar=`\- |
| 838 |
\defaultskewchar=-1 |
| 839 |
% \end{macrocode} |
| 840 |
% |
| 841 |
% \begin{macrocode} |
| 842 |
% \endlinechar=`\^^M % INITEX does this |
| 843 |
% \newlinechar=-1 \LaTeX\ sets this in ltdefns.dtx. |
| 844 |
% \end{macrocode} |
| 845 |
% |
| 846 |
% \begin{macrocode} |
| 847 |
\delimiterfactor=901 |
| 848 |
% \end{macrocode} |
| 849 |
% |
| 850 |
% \begin{macrocode} |
| 851 |
% \time=now % TeX does this at beginning of job |
| 852 |
% \day=now % TeX does this at beginning of job |
| 853 |
% \month=now % TeX does this at beginning of job |
| 854 |
% \year=now % TeX does this at beginning of job |
| 855 |
% \end{macrocode} |
| 856 |
% |
| 857 |
% In \LaTeX{} we don't want box information in the transcript |
| 858 |
% unless we do a full tracing. |
| 859 |
% \changes{v1.0g}{1994/04/28}{Turn off overfull box tracing in log} |
| 860 |
% |
| 861 |
% \begin{macrocode} |
| 862 |
\showboxbreadth=-1 |
| 863 |
\showboxdepth=-1 |
| 864 |
\errorcontextlines=-1 |
| 865 |
% \end{macrocode} |
| 866 |
% |
| 867 |
% \begin{macrocode} |
| 868 |
\hfuzz=0.1pt |
| 869 |
\vfuzz=0.1pt |
| 870 |
\overfullrule=5pt |
| 871 |
\maxdepth=4pt |
| 872 |
\splitmaxdepth=\maxdimen |
| 873 |
\boxmaxdepth=\maxdimen |
| 874 |
% \end{macrocode} |
| 875 |
% |
| 876 |
% \begin{macrocode} |
| 877 |
% \lineskiplimit=0pt, changed by \normalbaselines |
| 878 |
% \end{macrocode} |
| 879 |
% |
| 880 |
% \begin{macrocode} |
| 881 |
\delimitershortfall=5pt |
| 882 |
\nulldelimiterspace=1.2pt |
| 883 |
\scriptspace=0.5pt |
| 884 |
% \end{macrocode} |
| 885 |
% |
| 886 |
% \begin{macrocode} |
| 887 |
% \mathsurround=0pt |
| 888 |
% \predisplaysize=0pt, set before TeX enters $$ |
| 889 |
% \displaywidth=0pt, set before TeX enters $$ |
| 890 |
% \displayindent=0pt, set before TeX enters $$ |
| 891 |
% \end{macrocode} |
| 892 |
% |
| 893 |
% \begin{macrocode} |
| 894 |
\parindent=20pt |
| 895 |
% \end{macrocode} |
| 896 |
% |
| 897 |
% \begin{macrocode} |
| 898 |
% \hangindent=0pt, zeroed by TeX after each paragraph |
| 899 |
% \hoffset=0pt |
| 900 |
% \voffset=0pt |
| 901 |
% |
| 902 |
% \baselineskip=0pt, changed by \normalbaselines |
| 903 |
% \lineskip=0pt, changed by \normalbaselines |
| 904 |
% \end{macrocode} |
| 905 |
% |
| 906 |
% \begin{macrocode} |
| 907 |
\parskip=0pt plus 1pt |
| 908 |
\abovedisplayskip=12pt plus 3pt minus 9pt |
| 909 |
\abovedisplayshortskip=0pt plus 3pt |
| 910 |
\belowdisplayskip=12pt plus 3pt minus 9pt |
| 911 |
\belowdisplayshortskip=7pt plus 3pt minus 4pt |
| 912 |
% \end{macrocode} |
| 913 |
% |
| 914 |
% \begin{macrocode} |
| 915 |
% \leftskip=0pt |
| 916 |
% \rightskip=0pt |
| 917 |
% \end{macrocode} |
| 918 |
% |
| 919 |
% \begin{macrocode} |
| 920 |
\topskip=10pt |
| 921 |
\splittopskip=10pt |
| 922 |
% \end{macrocode} |
| 923 |
% |
| 924 |
% \begin{macrocode} |
| 925 |
% \tabskip=0pt |
| 926 |
% \spaceskip=0pt |
| 927 |
% \xspaceskip=0pt |
| 928 |
% \end{macrocode} |
| 929 |
% |
| 930 |
% \begin{macrocode} |
| 931 |
\parfillskip=0pt plus 1fil |
| 932 |
% \end{macrocode} |
| 933 |
% |
| 934 |
% |
| 935 |
% \begin{macro}{\normalbaselineskip} |
| 936 |
% \begin{macro}{\normallineskip} |
| 937 |
% \begin{macro}{\normallineskiplimit} |
| 938 |
% We also define special registers that function like parameters: |
| 939 |
% \begin{macrocode} |
| 940 |
\newskip\normalbaselineskip \normalbaselineskip=12pt |
| 941 |
\newskip\normallineskip \normallineskip=1pt |
| 942 |
\newdimen\normallineskiplimit \normallineskiplimit=0pt |
| 943 |
% \end{macrocode} |
| 944 |
% \end{macro} |
| 945 |
% \end{macro} |
| 946 |
% \end{macro} |
| 947 |
% |
| 948 |
% \begin{macro}{\interfootlinepenalty} |
| 949 |
% \begin{macrocode} |
| 950 |
\newcount\interfootnotelinepenalty \interfootnotelinepenalty=100 |
| 951 |
% \end{macrocode} |
| 952 |
% \end{macro} |
| 953 |
% |
| 954 |
% Definitions for preloaded fonts |
| 955 |
% |
| 956 |
% \begin{macro}{\magstephalf} |
| 957 |
% \begin{macro}{\magstep} |
| 958 |
% \begin{macrocode} |
| 959 |
\def\magstephalf{1095 } |
| 960 |
\def\magstep#1{\ifcase#1 \@m\or 1200\or 1440\or 1728\or |
| 961 |
2074\or 2488\fi\relax} |
| 962 |
% \end{macrocode} |
| 963 |
% \end{macro} |
| 964 |
% \end{macro} |
| 965 |
% |
| 966 |
% |
| 967 |
% Macros for setting ordinary text |
| 968 |
% |
| 969 |
% \begin{macro}{\frenchspacing} |
| 970 |
% \begin{macro}{\nonfrenchspacing} |
| 971 |
% \begin{macrocode} |
| 972 |
\def\frenchspacing{\sfcode`\.\@m \sfcode`\?\@m \sfcode`\!\@m |
| 973 |
\sfcode`\:\@m \sfcode`\;\@m \sfcode`\,\@m} |
| 974 |
\def\nonfrenchspacing{\sfcode`\.3000\sfcode`\?3000\sfcode`\!3000% |
| 975 |
\sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 } |
| 976 |
% \end{macrocode} |
| 977 |
% \end{macro} |
| 978 |
% \end{macro} |
| 979 |
% |
| 980 |
% \begin{macro}{\normalbaselines} |
| 981 |
% \begin{macrocode} |
| 982 |
\def\normalbaselines{\lineskip\normallineskip |
| 983 |
\baselineskip\normalbaselineskip \lineskiplimit\normallineskiplimit} |
| 984 |
% \end{macrocode} |
| 985 |
% \end{macro} |
| 986 |
% |
| 987 |
% \begin{macro}{\M} |
| 988 |
% \begin{macro}{\I} |
| 989 |
% \changes{v1.1m}{1995/09/01}{Use \cs{let} to save space} |
| 990 |
% Save a bit of space by using |\let| here. |
| 991 |
% \begin{macrocode} |
| 992 |
\def\^^M{\ } % control <return> = control <space> |
| 993 |
\let\^^I\^^M % same for <tab> |
| 994 |
% \end{macrocode} |
| 995 |
% \end{macro} |
| 996 |
% \end{macro} |
| 997 |
% |
| 998 |
% \begin{macro}{\lq} |
| 999 |
% \begin{macro}{\rq} |
| 1000 |
% \begin{macrocode} |
| 1001 |
\def\lq{`} |
| 1002 |
\def\rq{'} |
| 1003 |
% \end{macrocode} |
| 1004 |
% \end{macro} |
| 1005 |
% \end{macro} |
| 1006 |
% |
| 1007 |
% \begin{macro}{\lbrack} |
| 1008 |
% \begin{macro}{\rbrack} |
| 1009 |
% \begin{macrocode} |
| 1010 |
\def\lbrack{[} |
| 1011 |
\def\rbrack{]} |
| 1012 |
% \end{macrocode} |
| 1013 |
% \end{macro} |
| 1014 |
% \end{macro} |
| 1015 |
% |
| 1016 |
% \begin{macro}{\aa} |
| 1017 |
% \begin{macro}{\AA} |
| 1018 |
% These are not from plain.tex but they are similar to other commands |
| 1019 |
% found here and nowhere else, being alternate input forms for |
| 1020 |
% characters. |
| 1021 |
% \begin{macrocode} |
| 1022 |
\def \aa {\r a} |
| 1023 |
\def \AA {\r A} |
| 1024 |
% \end{macrocode} |
| 1025 |
% \end{macro} |
| 1026 |
% \end{macro} |
| 1027 |
% |
| 1028 |
% \begin{macro}{\endgraf} |
| 1029 |
% \begin{macro}{\endline} |
| 1030 |
% \begin{macrocode} |
| 1031 |
\let\endgraf=\par |
| 1032 |
\let\endline=\cr |
| 1033 |
% \end{macrocode} |
| 1034 |
% \end{macro} |
| 1035 |
% \end{macro} |
| 1036 |
% |
| 1037 |
% \begin{macro}{\space} |
| 1038 |
% \begin{macrocode} |
| 1039 |
\def\space{ } |
| 1040 |
% \end{macrocode} |
| 1041 |
% \end{macro} |
| 1042 |
% |
| 1043 |
% \begin{macro}{\empty} |
| 1044 |
% \changes{v1.1m}{1995/09/01}{Use \cs{let} to save space} |
| 1045 |
% This probably ought to go altogether, but let it to the \LaTeX\ |
| 1046 |
% version to save space. |
| 1047 |
% \begin{macrocode} |
| 1048 |
\let\empty\@empty |
| 1049 |
% \end{macrocode} |
| 1050 |
% \end{macro} |
| 1051 |
% |
| 1052 |
% \begin{macro}{\null} |
| 1053 |
% \begin{macrocode} |
| 1054 |
\def\null{\hbox{}} |
| 1055 |
% \end{macrocode} |
| 1056 |
% \end{macro} |
| 1057 |
% |
| 1058 |
% \begin{macro}{\bgroup} |
| 1059 |
% \begin{macro}{\egroup} |
| 1060 |
% \begin{macrocode} |
| 1061 |
\let\bgroup={ |
| 1062 |
\let\egroup=} |
| 1063 |
% \end{macrocode} |
| 1064 |
% \end{macro} |
| 1065 |
% \end{macro} |
| 1066 |
% |
| 1067 |
% \begin{macro}{\obeylines,\obeyspaces} |
| 1068 |
% In |\obeylines|, we say |\let^^M=\obeyedline| instead of |\def^^M{\obeyedline}| |
| 1069 |
% since this allows, for example, |
| 1070 |
% |\let\obeyedline=\cr \obeylines \halign{...|. |
| 1071 |
% |
| 1072 |
% This is essentially a plain \TeX{} trick and in its original |
| 1073 |
% version where you had to use to use |\let\par=\cr| not really a |
| 1074 |
% safe idea in \LaTeX. If anybody used this trick |
| 1075 |
% this now breaks (and one needs to use \cs{obeyedline} instead). |
| 1076 |
% \changes{v2.3h}{2022/01/25}{Provide redirection to support special |
| 1077 |
% use cases (gh/367)} |
| 1078 |
% \begin{macrocode} |
| 1079 |
%</2ekernel> |
| 1080 |
%<*2ekernel|latexrelease> |
| 1081 |
%<latexrelease>\IncludeInRelease{2022/06/01}{\obeylines}% |
| 1082 |
%<latexrelease> {Add a redirection to obeylines and obeyspaces}% |
| 1083 |
% \end{macrocode} |
| 1084 |
% If the active |^^M| escapes, e.g., into a \cs{write} (which is |
| 1085 |
% effectively in a different context) then we don't want the definition |
| 1086 |
% from \cs{obeylines} but rather a simple \cs{par} (in fact even |
| 1087 |
% the primitive one, not the \LaTeX{} version \cs{para\_end:} which |
| 1088 |
% is only defined later). |
| 1089 |
% |
| 1090 |
% \begin{macrocode} |
| 1091 |
\begingroup |
| 1092 |
\catcode`\^^M=\active % these lines must end with % |
| 1093 |
\gdef\obeylines{\catcode`\^^M\active% |
| 1094 |
\let^^M\obeyedline% |
| 1095 |
% \end{macrocode} |
| 1096 |
% |
| 1097 |
% The next line ending the definition is rather curious and it took |
| 1098 |
% me awhile to understand why rollback fails. The problem is the |
| 1099 |
% following: if \texttt{latexrelease} is used, then blocks of |
| 1100 |
% \cs{IncludeInRelease} \dots\ \cs{EndIncludeInRelease} are |
| 1101 |
% bypassed at high speed by grabbing each as a delimited |
| 1102 |
% argument. However, in that case |^^M| is seen not as code but as |
| 1103 |
% line ending characters and in that mode \TeX{} discards |
| 1104 |
% everything from that point onwards to the real end of the line so |
| 1105 |
% it works like a comment --- pretty strange really (and I think |
| 1106 |
% due to the fact that the original pascal compiler could have some |
| 1107 |
% garbage showing up after the normal line ending character. Thus |
| 1108 |
% we really have to make sure that any closing braces is not one |
| 1109 |
% the same line as an |^^M|, because otherwise it would get dropped |
| 1110 |
% and we end with unbalanced braces and never see the |
| 1111 |
% \cs{EndIncludeInRelease} --- weird. In other places it doesn't |
| 1112 |
% matter because we aren't using the incomplete result. |
| 1113 |
% \begin{macrocode} |
| 1114 |
}% |
| 1115 |
\global\let^^M\par % this is in case ^^M appears in a \write |
| 1116 |
\endgroup |
| 1117 |
% \end{macrocode} |
| 1118 |
% |
| 1119 |
% \begin{macro}{\obeyedline} |
| 1120 |
% The \cs{obeyedline} expands by default to |
| 1121 |
% \cs{par} with whatever definition \cs{par} has when it is |
| 1122 |
% executed. It can, however, be |
| 1123 |
% redefined (before calling \cs{obeylines}!) to achieve some |
| 1124 |
% special effects. If you want to alter this definition when already |
| 1125 |
% in the scope of \cs{obeylines}, it has no effect (because |
| 1126 |
% \cs{let} is used above). |
| 1127 |
% In that case simply make another call to \cs{obeylines} |
| 1128 |
% immediately. As you are in a restricted scope all that happens is |
| 1129 |
% that your redefinition is applied. |
| 1130 |
% |
| 1131 |
% For the default definition we have to use \cs{def} not \cs{let} |
| 1132 |
% because the meaning of \cs{par} can change and we want to use the |
| 1133 |
% one that is current when \cs{obeylines} act. |
| 1134 |
% |
| 1135 |
% There is a small subtlety here: in an \cs{edef} the active |^^M| stayed |
| 1136 |
% put (because it was equal to the primitive \cs{par}), now |
| 1137 |
% \cs{obeyedline} expands and you get what it contains, i.e., in that |
| 1138 |
% case \cs{par}, into the \cs{edef} or \cs{mark} unless we use |
| 1139 |
% \cs{protected} on it. |
| 1140 |
% \begin{macrocode} |
| 1141 |
\protected\gdef\obeyedline{\par} |
| 1142 |
% \end{macrocode} |
| 1143 |
% \end{macro} |
| 1144 |
% |
| 1145 |
% \begin{macro}{\obeyedspace} |
| 1146 |
% The definition of \cs{obeyspaces} is changed in the same way and |
| 1147 |
% now executes \cs{obeyedspace} for each active space. |
| 1148 |
% \begin{macrocode} |
| 1149 |
\global\let\obeyedspace\space |
| 1150 |
% \end{macrocode} |
| 1151 |
% \end{macro} |
| 1152 |
% |
| 1153 |
% \begin{macrocode} |
| 1154 |
\begingroup |
| 1155 |
\catcode`\ =\active% |
| 1156 |
\gdef\obeyspaces{\catcode`\ \active\let =\obeyedspace}% |
| 1157 |
% \end{macrocode} |
| 1158 |
% An active space elsewhere generates \cs{space} by default |
| 1159 |
% (for example in a \cs{write}). |
| 1160 |
% \begin{macrocode} |
| 1161 |
\global\let =\space% |
| 1162 |
\endgroup |
| 1163 |
% \end{macrocode} |
| 1164 |
% |
| 1165 |
% \begin{macrocode} |
| 1166 |
%</2ekernel|latexrelease> |
| 1167 |
%<latexrelease>\EndIncludeInRelease |
| 1168 |
%<latexrelease>\IncludeInRelease{0000/00/00}{\obeylines}% |
| 1169 |
%<latexrelease> {Add a redirection to obeylines and obeyspaces}% |
| 1170 |
%<latexrelease> |
| 1171 |
% \end{macrocode} |
| 1172 |
% From 2019 onwards the commands are made robust (somewhat later in |
| 1173 |
% the kernel sources). So if we roll back they are robust, so when |
| 1174 |
% redefining them we have get rid of the robust payload |
| 1175 |
% first. Otherwise that is seen by the later rollback below, which |
| 1176 |
% then installs a fragile version of the new definition on top of |
| 1177 |
% the one we roll back to here, sigh. \cs{kernel@make@fragile} also |
| 1178 |
% changes its definition (later own) so this is done directly. |
| 1179 |
% \begin{macrocode} |
| 1180 |
%<latexrelease>\expandafter\let\csname obeylines \endcsname\@undefined |
| 1181 |
%<latexrelease>\expandafter\let\csname obeyspace \endcsname\@undefined |
| 1182 |
%<latexrelease> |
| 1183 |
%<latexrelease>\begingroup |
| 1184 |
%<latexrelease>\catcode`\^^M=\active % these lines must end with % |
| 1185 |
%<latexrelease> \gdef\obeylines{\catcode`\^^M\active \let^^M\par % |
| 1186 |
% \end{macrocode} |
| 1187 |
% Closing brace on a separate line (see comment above). |
| 1188 |
% \begin{macrocode} |
| 1189 |
%<latexrelease> }% |
| 1190 |
% \end{macrocode} |
| 1191 |
% Another pitfall: if we do a rollback \cs{par} is no longer the |
| 1192 |
% primitive, so the roll back definition needs \cs{let} to what is |
| 1193 |
% new the primitive. |
| 1194 |
% \begin{macrocode} |
| 1195 |
%<latexrelease> \global\let^^M\RawParEnd % this is in case ^^M appears in a \write |
| 1196 |
%<latexrelease>\endgroup |
| 1197 |
%<latexrelease>\def\obeyspaces{\catcode`\ \active} |
| 1198 |
%<latexrelease> |
| 1199 |
%<latexrelease>\let\obeyedline\@undefined |
| 1200 |
%<latexrelease>\let\obeyedspace\@undefined |
| 1201 |
%<latexrelease>\EndIncludeInRelease |
| 1202 |
%<*2ekernel> |
| 1203 |
% \end{macrocode} |
| 1204 |
% \end{macro} |
| 1205 |
% |
| 1206 |
% \begin{macro}{\loop} |
| 1207 |
% \changes{v1.0h}{1994/05/16}{Use Kabelschacht method} |
| 1208 |
% \begin{macro}{\iterate} |
| 1209 |
% \changes{v1.1b}{1994/11/10} |
| 1210 |
% {(CAR) added extra \cs{relax}} |
| 1211 |
% \changes{v1.1m}{1994/05/26} |
| 1212 |
% {(CAR) added \cs{long}} |
| 1213 |
% \begin{macro}{\repeat} |
| 1214 |
% We use Kabelschacht's method of doing loops, see TUB 8\#2 (1987). |
| 1215 |
% (unless that breaks something :-). It turned out to need an |
| 1216 |
% extra |\relax|: see pr/642 (|\loop| could do one iteration too much |
| 1217 |
% in certain cases). |
| 1218 |
% \begin{macrocode} |
| 1219 |
\long\def \loop #1\repeat{% |
| 1220 |
\def\iterate{#1\relax % Extra \relax |
| 1221 |
\expandafter\iterate\fi |
| 1222 |
}% |
| 1223 |
\iterate |
| 1224 |
\let\iterate\relax |
| 1225 |
} |
| 1226 |
% \end{macrocode} |
| 1227 |
% This setting of |\repeat| is needed to make |\loop...\if...\repeat| |
| 1228 |
% skippable within another |\if...|. |
| 1229 |
% \begin{macrocode} |
| 1230 |
\let\repeat=\fi |
| 1231 |
% \end{macrocode} |
| 1232 |
% \end{macro} |
| 1233 |
% \end{macro} |
| 1234 |
% \end{macro} |
| 1235 |
% |
| 1236 |
% \LaTeX\ defines |\smallskip|, etc.\ in |ltspace.dtx|. |
| 1237 |
% |
| 1238 |
% \begin{macro}{\nointerlineskip} |
| 1239 |
% \begin{macro}{\offinterlineskip} |
| 1240 |
% \changes{v1.1n}{1995/07/02}{Replaced 1000 by \cs{@m}} |
| 1241 |
% \begin{macrocode} |
| 1242 |
\def\nointerlineskip{\prevdepth-\@m\p@} |
| 1243 |
\def\offinterlineskip{\baselineskip-\@m\p@ |
| 1244 |
\lineskip\z@ \lineskiplimit\maxdimen} |
| 1245 |
% \end{macrocode} |
| 1246 |
% \end{macro} |
| 1247 |
% \end{macro} |
| 1248 |
% |
| 1249 |
% \begin{macro}{\vglue} |
| 1250 |
% \begin{macro}{\hglue} |
| 1251 |
% \begin{macrocode} |
| 1252 |
\def\vglue{\afterassignment\vgl@\skip@=} |
| 1253 |
\def\vgl@{\par \dimen@\prevdepth \hrule \@height\z@ |
| 1254 |
\nobreak\vskip\skip@ \prevdepth\dimen@} |
| 1255 |
\def\hglue{\afterassignment\hgl@\skip@=} |
| 1256 |
\def\hgl@{\leavevmode \count@\spacefactor \vrule \@width\z@ |
| 1257 |
\nobreak\hskip\skip@ \spacefactor\count@} |
| 1258 |
% \end{macrocode} |
| 1259 |
% \end{macro} |
| 1260 |
% \end{macro} |
| 1261 |
% |
| 1262 |
% \LaTeX\ defines |~| in |ltdefns.dtx|. |
| 1263 |
% |
| 1264 |
% \begin{macro}{\slash} |
| 1265 |
% This generates a |/| acting a bit like |-| but still allows hyphenation |
| 1266 |
% in the word part preceding it (but not after). |
| 1267 |
% \begin{macrocode} |
| 1268 |
\def\slash{/\penalty\exhyphenpenalty} |
| 1269 |
% \end{macrocode} |
| 1270 |
% \end{macro} |
| 1271 |
% |
| 1272 |
% \begin{macro}{\break} |
| 1273 |
% \begin{macro}{\nobreak} |
| 1274 |
% \begin{macro}{\allowbreak} |
| 1275 |
% \begin{macrocode} |
| 1276 |
\def\break{\penalty-\@M} |
| 1277 |
\def\nobreak{\penalty \@M} |
| 1278 |
\def\allowbreak{\penalty \z@} |
| 1279 |
% \end{macrocode} |
| 1280 |
% \end{macro} |
| 1281 |
% \end{macro} |
| 1282 |
% \end{macro} |
| 1283 |
% |
| 1284 |
% \begin{macro}{\filbreak} |
| 1285 |
% \begin{macro}{\goodbreak} |
| 1286 |
% \begin{macrocode} |
| 1287 |
\def\filbreak{\par\vfil\penalty-200\vfilneg} |
| 1288 |
\def\goodbreak{\par\penalty-500 } |
| 1289 |
% \end{macrocode} |
| 1290 |
% \end{macro} |
| 1291 |
% \end{macro} |
| 1292 |
% |
| 1293 |
% \begin{macro}{\eject} |
| 1294 |
% \changes{v1.1s}{1995/10/17}{Move \cs{supereject} to compat file} |
| 1295 |
% Define |\eject| as in plain \TeX\ but define |\supereject| only in |
| 1296 |
% the compatibility file. |
| 1297 |
% \begin{macrocode} |
| 1298 |
\def\eject{\par\break} |
| 1299 |
% \end{macrocode} |
| 1300 |
% \end{macro} |
| 1301 |
% |
| 1302 |
% \begin{macro}{\removelastskip} |
| 1303 |
% \begin{macrocode} |
| 1304 |
\def\removelastskip{\ifdim\lastskip=\z@\else\vskip-\lastskip\fi} |
| 1305 |
% \end{macrocode} |
| 1306 |
% \end{macro} |
| 1307 |
% |
| 1308 |
% \begin{macro}{\smallbreak} |
| 1309 |
% \begin{macro}{\medbreak} |
| 1310 |
% \begin{macro}{\bigbreak} |
| 1311 |
% \begin{macrocode} |
| 1312 |
\def\smallbreak{\par\ifdim\lastskip<\smallskipamount |
| 1313 |
\removelastskip\penalty-50\smallskip\fi} |
| 1314 |
\def\medbreak{\par\ifdim\lastskip<\medskipamount |
| 1315 |
\removelastskip\penalty-100\medskip\fi} |
| 1316 |
\def\bigbreak{\par\ifdim\lastskip<\bigskipamount |
| 1317 |
\removelastskip\penalty-200\bigskip\fi} |
| 1318 |
% \end{macrocode} |
| 1319 |
% \end{macro} |
| 1320 |
% \end{macro} |
| 1321 |
% \end{macro} |
| 1322 |
% |
| 1323 |
% \begin{macro}{\m@th} |
| 1324 |
% \changes{v1.0h}{1994/05/16}{Remove unnecessary space} |
| 1325 |
% \begin{macrocode} |
| 1326 |
\def\m@th{\mathsurround\z@} |
| 1327 |
% \end{macrocode} |
| 1328 |
% \end{macro} |
| 1329 |
% |
| 1330 |
% \begin{macro}{\underbar} |
| 1331 |
% Due to \LaTeX's redefinition of |\underline| plain \TeX's |
| 1332 |
% |\underbar| can be done in a simpler fashion (but do we |
| 1333 |
% need it at all?). |
| 1334 |
% \changes{v1.1m}{1994/05/26} |
| 1335 |
% {(CAR/FMi) changed to use box \cs{tw@}} |
| 1336 |
% \changes{v1.1p}{1994/05/26} |
| 1337 |
% {(DPC) changed to use \cs{sbox}} |
| 1338 |
% \begin{macrocode} |
| 1339 |
\def\underbar#1{\underline{\sbox\tw@{#1}\dp\tw@\z@\box\tw@}} |
| 1340 |
% \end{macrocode} |
| 1341 |
% \end{macro} |
| 1342 |
% |
| 1343 |
% \begin{macro}{\strutbox} |
| 1344 |
% \begin{macro}{\strut} |
| 1345 |
% \LaTeX\ sets |\strutbox| in |\set@fontsize|. |
| 1346 |
% \begin{macrocode} |
| 1347 |
\newbox\strutbox |
| 1348 |
\def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi} |
| 1349 |
% \end{macrocode} |
| 1350 |
% \end{macro} |
| 1351 |
% \end{macro} |
| 1352 |
% |
| 1353 |
% \begin{macro}{\hidewidth} |
| 1354 |
% For alignment entries that can stick out. |
| 1355 |
% \begin{macrocode} |
| 1356 |
\def\hidewidth{\hskip\hideskip} |
| 1357 |
% \end{macrocode} |
| 1358 |
% \end{macro} |
| 1359 |
% |
| 1360 |
% \changes{v1.0h}{1994/05/16}{Remove unnecessary def for \cs{item}} |
| 1361 |
% \changes{v1.1i}{1995/04/27} |
| 1362 |
% {Move \cs{hang} and \cs{textindent} to latex209.def} |
| 1363 |
% \changes{RmS}{1991/11/04}{Removed \cs{itemitem} since never |
| 1364 |
% needed/useful with \LaTeX.} |
| 1365 |
% |
| 1366 |
% \begin{macro}{\narrower} |
| 1367 |
% \begin{macrocode} |
| 1368 |
\def\narrower{% |
| 1369 |
\advance\leftskip\parindent |
| 1370 |
\advance\rightskip\parindent} |
| 1371 |
% \end{macrocode} |
| 1372 |
% \end{macro} |
| 1373 |
% |
| 1374 |
% \changes{v1.1c}{1994/11/12}{Comment out more encoding specific |
| 1375 |
% commands} |
| 1376 |
% \LaTeX\ defines |\ae| and similar commands elsewhere. |
| 1377 |
% |
| 1378 |
% \begin{macrocode} |
| 1379 |
\chardef\%=`\% |
| 1380 |
\chardef\&=`\& |
| 1381 |
\chardef\#=`\# |
| 1382 |
% \end{macrocode} |
| 1383 |
% |
| 1384 |
% Most text commands are actually encoding specific and therefore |
| 1385 |
% defined later, so commented out or removed from this file. |
| 1386 |
% \changes{v1.0h}{1994/05/16}{Comment out encoding specific commands} |
| 1387 |
% |
| 1388 |
% \begin{macro}{\leavevmode} |
| 1389 |
% begins a paragraph, if necessary |
| 1390 |
% \begin{macrocode} |
| 1391 |
\def\leavevmode{\unhbox\voidb@x} |
| 1392 |
% \end{macrocode} |
| 1393 |
% \end{macro} |
| 1394 |
% |
| 1395 |
% \begin{macro}{\mathhexbox} |
| 1396 |
% \begin{macrocode} |
| 1397 |
\def\mathhexbox#1#2#3{\mbox{$\m@th \mathchar"#1#2#3$}} |
| 1398 |
% \end{macrocode} |
| 1399 |
% \end{macro} |
| 1400 |
% |
| 1401 |
% |
| 1402 |
% \begin{macro}{\ialign} |
| 1403 |
% \begin{macrocode} |
| 1404 |
\def\ialign{\everycr{}\tabskip\z@skip\halign} % initialized \halign |
| 1405 |
% \end{macrocode} |
| 1406 |
% \end{macro} |
| 1407 |
% |
| 1408 |
% \begin{macro}{\oalign} |
| 1409 |
% \begin{macro}{\o@lign} |
| 1410 |
% \begin{macro}{\ooalign} |
| 1411 |
% \begin{macrocode} |
| 1412 |
\def\oalign#1{\leavevmode\vtop{\baselineskip\z@skip \lineskip.25ex% |
| 1413 |
\ialign{##\crcr#1\crcr}}} |
| 1414 |
\def\o@lign{\lineskiplimit\z@ \oalign} |
| 1415 |
\def\ooalign{\lineskiplimit-\maxdimen \oalign} |
| 1416 |
% \end{macrocode} |
| 1417 |
% \end{macro} |
| 1418 |
% \end{macro} |
| 1419 |
% \end{macro} |
| 1420 |
% |
| 1421 |
% \begin{macro}{\sh@ft} |
| 1422 |
% \changes{v1.1t}{1996/07/26}{replace \cs{dimen}\cs{z@} by |
| 1423 |
% \cs{dimen@}} |
| 1424 |
% \changes{v1.1y}{2005/09/27}{Macro no longer used but |
| 1425 |
% left for compatibility} |
| 1426 |
% The definition of this macro in plain.tex was improved in |
| 1427 |
% about 1997; but as a result its usage was changed and its new |
| 1428 |
% definition is not appropriate for \LaTeX{}. |
| 1429 |
% |
| 1430 |
% Since the version given here has been in use by |
| 1431 |
% \LaTeX{} for many years it does not seem prudent to remove it now. |
| 1432 |
% As far as we can tell it has only been used to define~|\b| and~|\d| |
| 1433 |
% but this cannot be certain. |
| 1434 |
% \begin{macrocode} |
| 1435 |
\def\sh@ft#1{\[email protected]#1ex\multiply\dimen@\fontdimen1\font |
| 1436 |
\kern-.0156\dimen@} % compensate for slant in lowered accents |
| 1437 |
% \end{macrocode} |
| 1438 |
% \end{macro} |
| 1439 |
% |
| 1440 |
% \begin{macro}{\ltx@sh@ft} |
| 1441 |
% \changes{v1.1y}{2005/09/27}{New macro} |
| 1442 |
% This is the \LaTeX{} version of the second incarnation of the plain |
| 1443 |
% macro |\sh@ft|, which takes a dimension as its argument. It shifts |
| 1444 |
% a pseudo-accent horizontally by an amount proportional to the product |
| 1445 |
% of its argument and the slant-per-point (fontdimen 1). |
| 1446 |
% |
| 1447 |
% \begin{macrocode} |
| 1448 |
\def\ltx@sh@ft #1{% |
| 1449 |
\dimen@ #1% |
| 1450 |
\kern \strip@pt |
| 1451 |
\fontdimen1\font \dimen@ |
| 1452 |
} % kern by #1 times the current slant |
| 1453 |
% \end{macrocode} |
| 1454 |
% \end{macro} |
| 1455 |
% |
| 1456 |
% |
| 1457 |
% |
| 1458 |
% \LaTeX{} change: the text commands such as |
| 1459 |
% |\d|, |\b|, |\c|, |\copyright|,~|\TeX| |
| 1460 |
% are now defined elsewhere. |
| 1461 |
% |
| 1462 |
% \changes{LaTeX2e} |
| 1463 |
% {1993/11/29}{All accents in decimals; suggested by Paul Taylor} |
| 1464 |
% \changes{v1.0d}{1994/04/12} |
| 1465 |
% {Define \cs{@acci}} |
| 1466 |
% \changes{v1.0h}{1994/05/16}{Remove \cs{@acci} and friends again} |
| 1467 |
% |
| 1468 |
% \LaTeX{} change: Make |\t| work in a moving argument. |
| 1469 |
% Now defined elsewhere. |
| 1470 |
% |
| 1471 |
% \begin{macro}{\hrulefill} |
| 1472 |
% \begin{macro}{\dotfill} |
| 1473 |
% \LaTeX\ change: |\kern\z@| added to end of |
| 1474 |
% |\hrulefill| and |\dotfill| |
| 1475 |
% to make them work in `tabular' and `array' environments. |
| 1476 |
% (Change made 24 July 1987). |
| 1477 |
% \LaTeX\ change: |\leavevmode| added at beginning of |
| 1478 |
% |\dotfill| and |\hrulefill| |
| 1479 |
% so that they work as expected in vertical mode. |
| 1480 |
% \begin{macrocode} |
| 1481 |
\def\hrulefill{\leavevmode\leaders\hrule\hfill\kern\z@} |
| 1482 |
% \end{macrocode} |
| 1483 |
% The box in |\dotfill| originally contained (in plain.tex):\\ |
| 1484 |
% |\mkern 1.5mu .\mkern 1.5mu|;\\ |
| 1485 |
% the width of .44em differs from this |
| 1486 |
% by .04pt which is probably an acceptable difference within leaders. |
| 1487 |
% \changes{v1.1u}{1996/10/28}{Removed math mode} |
| 1488 |
% \changes{v1.1v}{1996/10/29}{Got arithmetic correct (CAR)} |
| 1489 |
% \changes{v1.1w}{1996/11/03}{Saved tokens by using \cs{hb@xt@}} |
| 1490 |
% \begin{macrocode} |
| 1491 |
\def\dotfill{% |
| 1492 |
\leavevmode |
| 1493 |
\cleaders \hb@xt@ .44em{\hss.\hss}\hfill |
| 1494 |
\kern\z@} |
| 1495 |
% \end{macrocode} |
| 1496 |
% \end{macro} |
| 1497 |
% \end{macro} |
| 1498 |
% |
| 1499 |
% INITEX sets |\sfcode x=1000| for all x, except that |\sfcode`X=999| |
| 1500 |
% for uppercase letters. The following changes are needed: |
| 1501 |
% \begin{macrocode} |
| 1502 |
\sfcode`\)=0 \sfcode`\'=0 \sfcode`\]=0 |
| 1503 |
% \end{macrocode} |
| 1504 |
% The |\nonfrenchspacing| macro will make further changes to |
| 1505 |
% |\sfcode| values. |
| 1506 |
% |
| 1507 |
% |
| 1508 |
% Definitions related to output |
| 1509 |
% |
| 1510 |
% |
| 1511 |
% \changes{v1.1k}{1995/05/22}{Definitions of \cs{footins} and |
| 1512 |
% \cs{footnoterule} moved to ltfloat.} |
| 1513 |
% |
| 1514 |
% |
| 1515 |
% |\magnification| doesn't work in \LaTeX. |
| 1516 |
%\begin{verbatim} |
| 1517 |
%\def\magnification{\afterassignment\m@g\count@} |
| 1518 |
%\def\m@g{\mag\count@ |
| 1519 |
% \hsize6.5truein\vsize8.9truein\dimen\footins8truein} |
| 1520 |
%\end{verbatim} |
| 1521 |
% |
| 1522 |
% \begin{macro}{\showoverfull} |
| 1523 |
% \changes{v0.1k ltfinal}{1994/05/19}{used \cs{@ne} not 1} |
| 1524 |
% The following commands are used in debugging: |
| 1525 |
% \begin{macrocode} |
| 1526 |
\def\showoverfull{\tracingonline\@ne} |
| 1527 |
% \end{macrocode} |
| 1528 |
% \end{macro} |
| 1529 |
% |
| 1530 |
% \begin{macro}{\showoutput} |
| 1531 |
% \changes{v0.1k ltfinal}{1994/05/19} |
| 1532 |
% {used \cs{maxdimen} not 99999} |
| 1533 |
% \changes{v1.1n}{1995/07/02}{Use \cs{showoverfull} to save space} |
| 1534 |
% \changes{v1.1x}{2002/02/24}{Use newly added \cs{loggingoutput}} |
| 1535 |
% \begin{macro}{\loggingoutput} |
| 1536 |
% \changes{v1.1x}{2002/02/24}{Macro added} |
| 1537 |
% \begin{macrocode} |
| 1538 |
\gdef\loggingoutput{\tracingoutput\@ne |
| 1539 |
\showboxbreadth\maxdimen\showboxdepth\maxdimen\errorstopmode} |
| 1540 |
\gdef\showoutput{\loggingoutput\showoverfull} |
| 1541 |
%</2ekernel> |
| 1542 |
% \end{macrocode} |
| 1543 |
% \end{macro} |
| 1544 |
% \end{macro} |
| 1545 |
% |
| 1546 |
% |
| 1547 |
% \begin{macro}{\tracingall} |
| 1548 |
% \changes{LaTeX209}{1991/08/26}{Added |
| 1549 |
% \cs{errorcontextlines}!=\cs{maxdimen}, suggested by J. Schrod} |
| 1550 |
% \changes{v1.1n}{1995/07/02}{Use \cs{showoutput} to save space} |
| 1551 |
% \changes{v1.1x}{2002/02/24}{Use newly added \cs{loggingoutput}} |
| 1552 |
% \begin{macro}{\loggingall} |
| 1553 |
% \changes{v1.1x}{2002/02/24}{Macro added} |
| 1554 |
% \changes{v2.0b}{2012/01/20}{etex tracing if available} |
| 1555 |
% \changes{v2.0d}{2015/02/20}{Spell commands correctly :-)} |
| 1556 |
% \changes{v2.0g}{2015/03/10}{Reorganize to be less noisy} |
| 1557 |
% \changes{v2.3f}{2021/04/18}{Drop pre-$\varepsilon$-\TeX{} support} |
| 1558 |
% \changes{v2.3f}{2021/04/18} |
| 1559 |
% {Add \cs{tracingstacklevels} and \cs{tracinglostchars}=3} |
| 1560 |
% \changes{v2.3l}{2025/03/05}{Remove \cs{tracinglostchars} setting (gh/1691)} |
| 1561 |
% \begin{macrocode} |
| 1562 |
%<latexrelease>\IncludeInRelease{2021/06/01}{\loggingall} |
| 1563 |
%<latexrelease> {\tracingstacklevels and \tracinglostchars=3}% |
| 1564 |
%<*2ekernel|latexrelease> |
| 1565 |
\edef\loggingall{% |
| 1566 |
\tracingstats\tw@ |
| 1567 |
\tracingpages\@ne |
| 1568 |
\tracingparagraphs\@ne |
| 1569 |
\tracinggroups\@ne |
| 1570 |
\tracingifs\@ne |
| 1571 |
\tracingscantokens\@ne |
| 1572 |
\tracingnesting\@ne |
| 1573 |
\errorcontextlines\maxdimen |
| 1574 |
\ifdefined\tracingstacklevels \tracingstacklevels\maxdimen \fi |
| 1575 |
\noexpand \loggingoutput |
| 1576 |
\tracingmacros\tw@ |
| 1577 |
\tracingcommands\thr@@ |
| 1578 |
\tracingrestores\@ne |
| 1579 |
\tracingassigns\@ne |
| 1580 |
}% |
| 1581 |
\def\tracingall{\showoverfull\loggingall} |
| 1582 |
%</2ekernel|latexrelease> |
| 1583 |
%<latexrelease>\EndIncludeInRelease |
| 1584 |
%<latexrelease> |
| 1585 |
%<latexrelease>\IncludeInRelease{2015/01/01}{\loggingall}{etex tracing}% |
| 1586 |
%<latexrelease>\ifx\tracingscantokens\@undefined |
| 1587 |
%<latexrelease>\gdef\loggingall{% |
| 1588 |
%<latexrelease> \tracingstats\tw@ |
| 1589 |
%<latexrelease> \tracingpages\@ne |
| 1590 |
%<latexrelease> \tracinglostchars\@ne |
| 1591 |
%<latexrelease> \tracingparagraphs\@ne |
| 1592 |
%<latexrelease> \errorcontextlines\maxdimen |
| 1593 |
%<latexrelease> \loggingoutput |
| 1594 |
%<latexrelease> \tracingmacros\tw@ |
| 1595 |
%<latexrelease> \tracingcommands\tw@ |
| 1596 |
%<latexrelease> \tracingrestores\@ne |
| 1597 |
%<latexrelease> }% |
| 1598 |
%<latexrelease>\else |
| 1599 |
%<latexrelease>\gdef\loggingall{% |
| 1600 |
%<latexrelease> \tracingstats\tw@ |
| 1601 |
%<latexrelease> \tracingpages\@ne |
| 1602 |
%<latexrelease> \tracinglostchars\tw@ |
| 1603 |
%<latexrelease> \tracingparagraphs\@ne |
| 1604 |
%<latexrelease> \tracinggroups\@ne |
| 1605 |
%<latexrelease> \tracingifs\@ne |
| 1606 |
%<latexrelease> \tracingscantokens\@ne |
| 1607 |
%<latexrelease> \tracingnesting\@ne |
| 1608 |
%<latexrelease> \errorcontextlines\maxdimen |
| 1609 |
%<latexrelease> \loggingoutput |
| 1610 |
%<latexrelease> \tracingmacros\tw@ |
| 1611 |
%<latexrelease> \tracingcommands\thr@@ |
| 1612 |
%<latexrelease> \tracingrestores\@ne |
| 1613 |
%<latexrelease> \tracingassigns\@ne |
| 1614 |
%<latexrelease>}% |
| 1615 |
%<latexrelease>\fi |
| 1616 |
%<latexrelease>\gdef\tracingall{\showoverfull\loggingall} |
| 1617 |
%<latexrelease>\EndIncludeInRelease |
| 1618 |
%<latexrelease> |
| 1619 |
%<latexrelease>\IncludeInRelease{0000/00/00}{\loggingall}{etex tracing}% |
| 1620 |
%<latexrelease>\gdef\loggingall{\tracingcommands\tw@\tracingstats\tw@ |
| 1621 |
%<latexrelease> \tracingpages\@ne\tracinglostchars\@ne |
| 1622 |
%<latexrelease> \tracingmacros\tw@\tracingparagraphs\@ne\tracingrestores\@ne |
| 1623 |
%<latexrelease> \errorcontextlines\maxdimen\loggingoutput} |
| 1624 |
%<latexrelease> \gdef\tracingall{\loggingall\showoverfull} |
| 1625 |
%<latexrelease>\EndIncludeInRelease |
| 1626 |
% \end{macrocode} |
| 1627 |
% \end{macro} |
| 1628 |
% \end{macro} |
| 1629 |
% |
| 1630 |
% |
| 1631 |
% \begin{macro}{\tracingnone} |
| 1632 |
% \changes{v2.0g}{2015/03/10}{macro added} |
| 1633 |
% \changes{v2.3f}{2021/04/18}{Drop pre-$\varepsilon$-\TeX{} support} |
| 1634 |
% \changes{v2.3f}{2021/04/18} |
| 1635 |
% {Add \cs{tracingstacklevels} and \cs{tracinglostchars}=3} |
| 1636 |
% \changes{v2.3j}{2023/11/07}{Set \cs{tracinglostchars} to 2 in |
| 1637 |
% \cs{tracingnone} (gh/549)} |
| 1638 |
% \changes{v2.3l}{2025/03/05}{Remove \cs{tracinglostchars} setting (gh/1691)} |
| 1639 |
% \begin{macrocode} |
| 1640 |
%<latexrelease>\IncludeInRelease{2015/01/01}{\tracingnone}% |
| 1641 |
%<latexrelease> {turn off etex tracing}% |
| 1642 |
%<*2ekernel|latexrelease> |
| 1643 |
\edef\tracingnone{% |
| 1644 |
\tracingassigns\z@ |
| 1645 |
\tracingrestores\z@ |
| 1646 |
\tracingonline\z@ |
| 1647 |
\tracingcommands\z@ |
| 1648 |
\showboxdepth\m@ne |
| 1649 |
\showboxbreadth\m@ne |
| 1650 |
\tracingoutput\z@ |
| 1651 |
\errorcontextlines\m@ne |
| 1652 |
\ifdefined\tracingstacklevels \tracingstacklevels\z@ \fi |
| 1653 |
\tracingnesting\z@ |
| 1654 |
\tracingscantokens\z@ |
| 1655 |
\tracingifs\z@ |
| 1656 |
\tracinggroups\z@ |
| 1657 |
\tracingparagraphs\z@ |
| 1658 |
\tracingmacros\z@ |
| 1659 |
\tracingpages\z@ |
| 1660 |
\tracingstats\z@ |
| 1661 |
}% |
| 1662 |
%</2ekernel|latexrelease> |
| 1663 |
%<latexrelease>\EndIncludeInRelease |
| 1664 |
%<latexrelease> |
| 1665 |
%<latexrelease>\IncludeInRelease{2015/01/01}{\tracingnone}% |
| 1666 |
%<latexrelease> {turn off etex tracing}% |
| 1667 |
%<latexrelease>\ifx\tracingscantokens\@undefined |
| 1668 |
%<latexrelease>\def\tracingnone{% |
| 1669 |
%<latexrelease> \tracingonline\z@ |
| 1670 |
%<latexrelease> \tracingcommands\z@ |
| 1671 |
%<latexrelease> \showboxdepth\m@ne |
| 1672 |
%<latexrelease> \showboxbreadth\m@ne |
| 1673 |
%<latexrelease> \tracingoutput\z@ |
| 1674 |
%<latexrelease> \errorcontextlines\m@ne |
| 1675 |
%<latexrelease> \tracingrestores\z@ |
| 1676 |
%<latexrelease> \tracingparagraphs\z@ |
| 1677 |
%<latexrelease> \tracingmacros\z@ |
| 1678 |
%<latexrelease> \tracinglostchars\@ne |
| 1679 |
%<latexrelease> \tracingpages\z@ |
| 1680 |
%<latexrelease> \tracingstats\z@ |
| 1681 |
%<latexrelease>}% |
| 1682 |
%<latexrelease>\else |
| 1683 |
%<latexrelease>\def\tracingnone{% |
| 1684 |
%<latexrelease> \tracingassigns\z@ |
| 1685 |
%<latexrelease> \tracingrestores\z@ |
| 1686 |
%<latexrelease> \tracingonline\z@ |
| 1687 |
%<latexrelease> \tracingcommands\z@ |
| 1688 |
%<latexrelease> \showboxdepth\m@ne |
| 1689 |
%<latexrelease> \showboxbreadth\m@ne |
| 1690 |
%<latexrelease> \tracingoutput\z@ |
| 1691 |
%<latexrelease> \errorcontextlines\m@ne |
| 1692 |
%<latexrelease> \tracingnesting\z@ |
| 1693 |
%<latexrelease> \tracingscantokens\z@ |
| 1694 |
%<latexrelease> \tracingifs\z@ |
| 1695 |
%<latexrelease> \tracinggroups\z@ |
| 1696 |
%<latexrelease> \tracingparagraphs\z@ |
| 1697 |
%<latexrelease> \tracingmacros\z@ |
| 1698 |
%<latexrelease> \tracinglostchars\@ne |
| 1699 |
%<latexrelease> \tracingpages\z@ |
| 1700 |
%<latexrelease> \tracingstats\z@ |
| 1701 |
%<latexrelease>}% |
| 1702 |
%<latexrelease>\fi |
| 1703 |
%<latexrelease>\EndIncludeInRelease |
| 1704 |
%<latexrelease> |
| 1705 |
%<latexrelease>\IncludeInRelease{0000/00/00}{\tracingnone}% |
| 1706 |
%<latexrelease> {turn off etex tracing}% |
| 1707 |
%<latexrelease>\let\tracingnone\@undefined |
| 1708 |
%<latexrelease>\EndIncludeInRelease |
| 1709 |
% \end{macrocode} |
| 1710 |
% \end{macro} |
| 1711 |
% |
| 1712 |
% \begin{macro}{\hideoutput} |
| 1713 |
% \changes{v2.0g}{2015/03/10}{macro added} |
| 1714 |
% \begin{macrocode} |
| 1715 |
%<*2ekernel|latexrelease> |
| 1716 |
%<latexrelease>\IncludeInRelease{2015/01/01}{\hideoutput}% |
| 1717 |
%<latexrelease> {hide output from tracing}% |
| 1718 |
\def\hideoutput{% |
| 1719 |
\tracingoutput\z@ |
| 1720 |
\showboxbreadth\m@ne |
| 1721 |
\showboxdepth\m@ne |
| 1722 |
\tracingonline\m@ne |
| 1723 |
}% |
| 1724 |
%<latexrelease>\EndIncludeInRelease |
| 1725 |
%<latexrelease> |
| 1726 |
%<latexrelease>\IncludeInRelease{0000/00/00}{\hideoutput}% |
| 1727 |
%<latexrelease> {hide output from tracing}% |
| 1728 |
%<latexrelease>\let\hideoutput\@undefined |
| 1729 |
%<latexrelease>\EndIncludeInRelease |
| 1730 |
%</2ekernel|latexrelease> |
| 1731 |
% \end{macrocode} |
| 1732 |
% \end{macro} |
| 1733 |
% |
| 1734 |
% \LaTeX\ change: |\showhyphens| Defined later. |
| 1735 |
% |
| 1736 |
% Punctuation affects the spacing. |
| 1737 |
% \begin{macrocode} |
| 1738 |
%<*2ekernel> |
| 1739 |
\nonfrenchspacing |
| 1740 |
%</2ekernel> |
| 1741 |
% \end{macrocode} |
| 1742 |
% |
| 1743 |
% |
| 1744 |
% \Finale |
| 1745 |
% |