updated
[latex2e.git] / base / ltplain.dtx
blobae5a0c7e6f9a4f0c0aacc2f98cbaf5f0618f6d9b
1 % \iffalse meta-comment
3 % Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
4 % The LaTeX3 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 %    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.
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
32 %<*driver>
33 % \fi
34 \ProvidesFile{ltplain.dtx}
35              [2005/09/27 v1.1y 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 \maketitle
47  \DocInput{\filename}
48 \end{document}
49 %</driver>
50 % \fi
52 % \CheckSum{764}
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}
76 % \section{Plain \TeX}
78 % \LaTeX\ includes almost all of the functionality of Knuth's original
79 % `Basic Macros' That is, the plain \TeX\ format described in Appendix~B
80 % of the \TeX{}Book.  However, some of the user commands are not much
81 % use so, in order to save memory, we may remove them from the kernel
82 % into a package.  Here is a list of the commands that may be removed
83 % (PROBABLY NOT COMPLETE).
84 % \begin{verbatim}
85 %    \magstep    \magstephalf
86 %    \mathhexbox
87 %    \vglue      \vgl@
88 %    \hglue      \hgl@
89 % \end{verbatim}
90
91 % This file is by now very small as most of it has been moved to more
92 % appropriate kernel files: it may disappear completely one day.
93
94 % \LaTeX\ font definitions are done using NFSS2 so none of PLAIN's
95 % font definitions are in \LaTeX.
97 % \LaTeX\ has its own tabbing environment, so PLAIN's is disabled.
99 % \LaTeX{} uses its own output routine, so most of the plain one was
100 % removed.
102 % \StopEventually{}
104 % \iffalse
105 %% \CharacterTable
106 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
107 %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
108 %%   Digits        \0\1\2\3\4\5\6\7\8\9
109 %%   Exclamation   \!     Double quote  \"     Hash (number) \#
110 %%   Dollar        \$     Percent       \%     Ampersand     \&
111 %%   Acute accent  \'     Left paren    \(     Right paren   \)
112 %%   Asterisk      \*     Plus          \+     Comma         \,
113 %%   Minus         \-     Point         \.     Solidus       \/
114 %%   Colon         \:     Semicolon     \;     Less than     \<
115 %%   Equals        \=     Greater than  \>     Question mark \?
116 %%   Commercial at \@     Left bracket  \[     Backslash     \\
117 %%   Right bracket \]     Circumflex    \^     Underscore    \_
118 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
119 %%   Right brace   \}     Tilde         \~}
121 % \fi
123 %    \begin{macrocode}
124 %<*2ekernel|autoload>
125 \catcode`\{=1 % left brace is begin-group character
126 \catcode`\}=2 % right brace is end-group character
127 \catcode`\$=3 % dollar sign is math shift
128 \catcode`\&=4 % ampersand is alignment tab
129 \catcode`\#=6 % hash mark is macro parameter character
130 \catcode`\^=7 % circumflex and uparrow are for superscripts
131 \catcode`\_=8 % underline and downarrow are for subscripts
132 \catcode`\^^I=10 % ascii tab is a blank space
133 \chardef\active=13 \catcode`\~=\active % tilde is active
134 \catcode`\^^L=\active \outer\def^^L{\par}% ascii form-feed is \outer\par
135 %    \end{macrocode}
137 %    \begin{macrocode}
138 \message{catcodes,}
139 %    \end{macrocode}
141 % We had to define the |\catcodes| right away, before the message line,
142 % since |\message| uses the |{| and |}| characters.
143 % When INITEX (the \TeX\ initializer) starts up,
144 % it has defined the following |\catcode| values:\\
145 % |\catcode`\^^@=9 % | ascii null is ignored\\
146 % |\catcode`\^^M=5 % | ascii return is end-line\\
147 % |\catcode`\\=0 %   | backslash is TeX escape character\\
148 % |\catcode`\%=14 %  | percent sign is comment character\\
149 % |\catcode`\ =10 %  | ascii space is blank space\\
150 % |\catcode`\^^?=15 %| ascii delete is invalid\\
151 % |\catcode`\A=11 ... \catcode`\Z=11 %| uppercase letters\\
152 % |\catcode`\a=11 ... \catcode`\z=11 %| lowercase letters\\
153 % all others are type 12 (other)
155 % Here is a list of the characters that have been specially catcoded:
156 %    \begin{macrocode}
157 \def\dospecials{\do\ \do\\\do\{\do\}\do\$\do\&%
158   \do\#\do\^\do\_\do\%\do\~}
159 %    \end{macrocode}
160 % (not counting ascii null, tab, linefeed, formfeed, return, delete)
161 % Each symbol in the list is preceded by \do, which can be defined
162 % if you want to do something to every item in the list.
164 % We make |@| signs act like letters, temporarily, to avoid conflict
165 % between user names and internal control sequences of plain format.
166 %    \begin{macrocode}
167 \catcode`@=11
168 %    \end{macrocode}
170 % To make the plain macros more efficient in time and space,
171 % several constant values are declared here as control sequences.
172 % If they were changed, anything could happen;
173 % so they are private symbols.
174 % \begin{macro}{\@ne}
175 % \begin{macro}{\tw@}
176 % \begin{macro}{\thr@@}
177 % \begin{macro}{\sixt@@n}
178 % \begin{macro}{\@cclv}
179 % Small constants are defined using |\chardef|.
180 %    \begin{macrocode}
181 \chardef\@ne=1
182 \chardef\tw@=2
183 \chardef\thr@@=3
184 \chardef\sixt@@n=16
185 \chardef\@cclv=255
186 %    \end{macrocode}
187 % \end{macro}
188 % \end{macro}
189 % \end{macro}
190 % \end{macro}
191 % \end{macro}
193 % \begin{macro}{\@cclvi}
194 % \begin{macro}{\@m}
195 % \begin{macro}{\@M}
196 % \begin{macro}{\@MM}
197 % Constants above 255 defined using |\mathchardef|.
198 %    \begin{macrocode}
199 \mathchardef\@cclvi=256
200 \mathchardef\@m=1000
201 \mathchardef\@M=10000
202 \mathchardef\@MM=20000
203 %    \end{macrocode}
204 % \end{macro}
205 % \end{macro}
206 % \end{macro}
207 % \end{macro}
209 % Allocation of registers
211 % Here are macros for the automatic allocation of |\count|, |\box|,
212 % |\dimen|, |\skip|, |\muskip|, and |\toks| registers, as well as
213 % |\read| and |\write| stream numbers, |\fam| codes, |\language| codes,
214 % and |\insert| numbers.
216 %    \begin{macrocode}
217 \message{registers,}
218 %    \end{macrocode}
220 % When a register is used only temporarily, it need not be allocated;
221 % grouping can be used, making the value previously in the register
222 % return after the close of the group.  The main use of these macros is
223 % for registers that are defined by one macro and used by others,
224 % possibly at different nesting levels.  All such registers should be
225 % defined through these macros; otherwise conflicts may occur,
226 % especially when two or more macro packages are being used at
227 % the same time.
229 % \begin{oldcomments}
230 % The following counters are reserved:
231 %   0 to 9  page numbering
232 %       10  count allocation
233 %       11  dimen allocation
234 %       12  skip allocation
235 %       13  muskip allocation
236 %       14  box allocation
237 %       15  toks allocation
238 %       16  read file allocation
239 %       17  write file allocation
240 %       18  math family allocation
241 %       19  language allocation
242 %       20  insert allocation
243 %       21  the most recently allocated number
244 %       22  constant -1
245 % \end{oldcomments}
247 % New counters are allocated starting with 23, 24, etc.  Other registers
248 % are allocated starting with 10.  This leaves 0 through 9 for the user
249 % to play with safely, except that counts 0 to 9 are considered to be
250 % the page and subpage numbers (since they are displayed during
251 % output). In this scheme, |\count| 10 always contains the number of the
252 % highest-numbered counter that has been allocated, |\count| 14 the
253 % highest-numbered box, etc. Inserts are given numbers 254, 253, etc.,
254 % since they require a |\count|, |\dimen|, |\skip|, and |\box| all with
255 % the same number; |\count| 20 contains the lowest-numbered insert that
256 % has been allocated. Of course, |\box|255 is reserved for |\output|;
257 % |\count|255, |\dimen|255, and |\skip|255 can be used freely.
259 % It is recommended that macro designers always use
260 % |\global| assignments with respect to registers numbered\\
261 % 1, 3, 5, 7, 9,\\
262 % and always non-|\global| assignments with respect to registers\\
263 % 0, 2, 4, 6, 8, 255.\\
264 % This will prevent ``save stack buildup'' that might otherwise occur.
266 %    \begin{macrocode}
267 \count10=22 % allocates \count registers 23, 24, ...
268 \count11=9 % allocates \dimen registers 10, 11, ...
269 \count12=9 % allocates \skip registers 10, 11, ...
270 \count13=9 % allocates \muskip registers 10, 11, ...
271 \count14=9 % allocates \box registers 10, 11, ...
272 \count15=9 % allocates \toks registers 10, 11, ...
273 \count16=-1 % allocates input streams 0, 1, ...
274 \count17=-1 % allocates output streams 0, 1, ...
275 \count18=3 % allocates math families 4, 5, ...
276 \count19=0 % allocates \language codes 1, 2, ...
277 \count20=255 % allocates insertions 254, 253, ...
278 %    \end{macrocode}
280 % \begin{macro}{\insc@unt}
281 % \begin{macro}{\allocationnumber}
282 % The insertion counter and most recent allocation.
283 %    \begin{macrocode}
284 \countdef\insc@unt=20
285 \countdef\allocationnumber=21
286 %    \end{macrocode}
287 % \end{macro}
288 % \end{macro}
290 % \begin{macro}{\m@ne}
291 % The constant $-1$.
292 %    \begin{macrocode}
293 \countdef\m@ne=22 \m@ne=-1
294 %    \end{macrocode}
295 % \end{macro}
297 % \begin{macro}{\wlog}
298 % Write on log file (only)
299 %    \begin{macrocode}
300 \def\wlog{\immediate\write\m@ne}
301 %    \end{macrocode}
302 % \end{macro}
304 % \begin{macro}{\count@}
305 % \begin{macro}{\dimen@}
306 % \begin{macro}{\dimen@i}
307 % \begin{macro}{\dimen@ii}
308 % \begin{macro}{\skip@}
309 % \begin{macro}{\toks@}
310 % Here are abbreviations for the names of scratch registers
311 % that don't need to be allocated.
312 %    \begin{macrocode}
313 \countdef\count@=255
314 \dimendef\dimen@=0
315 \dimendef\dimen@i=1 % global only
316 \dimendef\dimen@ii=2
317 \skipdef\skip@=0
318 \toksdef\toks@=0
319 %    \end{macrocode}
320 % \end{macro}
321 % \end{macro}
322 % \end{macro}
323 % \end{macro}
324 % \end{macro}
325 % \end{macro}
327 % \begin{macro}{\newcount}
328 % \begin{macro}{\newdimen}
329 % \begin{macro}{\newskip}
330 % \begin{macro}{\newmuskip}
331 % \begin{macro}{\newbox}
332 % \begin{macro}{\newhelp}
333 % \begin{macro}{\newtoks}
334 % \changes{v1.0c}{1994/03/28}
335 %         {Remove some \cs{outer} declarations.}
336 % \changes{v1.1h}{1995/04/24}
337 %         {Remove remaining \cs{outer} declarations.}
338 % Now, we define |\newcount|, |\newbox|, etc. so that you can say 
339 % |\newcount\foo| and |\foo| will be defined (with |\countdef|) to
340 % be the next counter.
342 % To find out which counter |\foo| is, you can look at
343 % |\allocationnumber|.
345 % Since there's no |\boxdef| command, |\chardef| is used to define a
346 % |\newbox|, |\newinsert|, |\newfam|, and so on.
348 % \LaTeX\ change: remove |\outer| from |\newcount| and |\newdimen| (FMi)
349 %            This is necessary to use |\newcount| inside |\if...|
350 %            later on. Also remove from |\newskip|, |\newbox|
351 %            |\newwrite| and |\newfam| (DPC) to save later redefinition.
352 %    \begin{macrocode}
353 \def\newcount{\alloc@0\count\countdef\insc@unt}
354 \def\newdimen{\alloc@1\dimen\dimendef\insc@unt}
355 \def\newskip{\alloc@2\skip\skipdef\insc@unt}
356 \def\newmuskip{\alloc@3\muskip\muskipdef\@cclvi}
357 \def\newbox{\alloc@4\box\chardef\insc@unt}
358 \def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}}
359 \def\newtoks{\alloc@5\toks\toksdef\@cclvi}
360 %    \end{macrocode}
361 % \end{macro}
362 % \end{macro}
363 % \end{macro}
364 % \end{macro}
365 % \end{macro}
366 % \end{macro}
367 % \end{macro}
369 % \begin{macro}{\newread}
370 % \begin{macro}{\newwrite}
371 %    \begin{macrocode}
372 \def\newread{\alloc@6\read\chardef\sixt@@n}
373 \def\newwrite{\alloc@7\write\chardef\sixt@@n}
374 %    \end{macrocode}
375 % \end{macro}
376 % \end{macro}
378 % \LaTeX\ defines |\newfam| in |ltfss.dtx|.
379 %\begin{verbatim}
380 %\def\newfam{\alloc@8\fam\chardef\sixt@@n}
381 %\end{verbatim}
383 % \begin{macro}{\newlanguage}
384 %    \begin{macrocode}
385 \def\newlanguage{\alloc@9\language\chardef\@cclvi}
386 %    \end{macrocode}
387 % \end{macro}
389 % \begin{macro}{\alloc@}
390 %    \begin{macrocode}
391 \def\alloc@#1#2#3#4#5{\global\advance\count1#1\@ne
392   \ch@ck#1#4#2% make sure there's still room
393   \allocationnumber\count1#1%
394   \global#3#5\allocationnumber
395   \wlog{\string#5=\string#2\the\allocationnumber}}
396 %    \end{macrocode}
397 % \end{macro}
399 % \begin{macro}{\newinsert}
400 %    \begin{macrocode}
401 \def\newinsert#1{\global\advance\insc@unt \m@ne
402   \ch@ck0\insc@unt\count
403   \ch@ck1\insc@unt\dimen
404   \ch@ck2\insc@unt\skip
405   \ch@ck4\insc@unt\box
406   \allocationnumber\insc@unt
407   \global\chardef#1\allocationnumber
408   \wlog{\string#1=\string\insert\the\allocationnumber}}
409 %    \end{macrocode}
410 % \end{macro}
412 % \begin{macro}{\ch@ck}
413 %    \begin{macrocode}
414 %</2ekernel|autoload>
415 %<*2ekernel|autoload|autoerr>
416 \gdef\ch@ck#1#2#3{%
417   \ifnum\count1#1<#2\else
418 %<!autoload>   \errmessage{No room for a new #3}%
419 %<autoload>    \@autoerr\ch@ck#1#2#3%
420   \fi}
421 %</2ekernel|autoload|autoerr>
422 %<*2ekernel|autoload>
423 %    \end{macrocode}
424 % \end{macro}
426 % \begin{macro}{\maxdimen}
427 % \begin{macro}{\hideskip}
428 % Here are some examples of allocation.
429 %    \begin{macrocode}
430 \newdimen\maxdimen \maxdimen=16383.99999pt % the largest legal <dimen>
431 \newskip\hideskip \hideskip=-1000pt plus 1fill % negative but can grow
432 %    \end{macrocode}
433 % \end{macro}
434 % \end{macro}
436 % \begin{macro}{\p@}
437 % \begin{macro}{\z@}
438 % \begin{macro}{\z@skip}
439 % \begin{macro}{\voidb@x}
440 %    \begin{macrocode}
441 \newdimen\p@ \p@=1pt % this saves macro space and time
442 \newdimen\z@ \z@=0pt % can be used both for 0pt and 0
443 \newskip\z@skip \z@skip=0pt plus0pt minus0pt
444 \newbox\voidb@x % permanently void box register
445 %    \end{macrocode}
446 % \end{macro}
447 % \end{macro}
448 % \end{macro}
449 % \end{macro}
451 %  \changes{v1.1p}{1995/10/02}{Move \cs{newif} to ltdefns}
453 %    \begin{macrocode}
454 \message{compatibility for TeX 2, }
455 %    \end{macrocode}
457 % If this file is used in an old \TeX\ we define the new features
458 % of \TeX\ 3.0 as simple macros or counters so that files that uses
459 % these features can be processed in such an environment
460 % (They will however produce some other results).
462 %    \begin{macrocode}
463 \ifx\@undefined\inputlineno
464   \newcount\inputlineno
465 %    \end{macrocode}
466 % This could be used to detect that an old \TeX\ is in force
467 %    \begin{macrocode}
468   \inputlineno-1
469 %    \end{macrocode}
470 % Extra test for MLTeX 2, RmS 91/11/07.
471 %    \begin{macrocode}
472   \ifx\@undefined\language
473     \newcount\language
474   \fi
475   \newcount\lefthyphenmin
476   \newcount\righthyphenmin
477   \newcount\errorcontextlines
478   \newcount\holdinginserts
479   \newdimen\emergencystretch
480   \newcount\badness
481   \let\noboundary\relax
482   \newcount\setlanguage
484 %    \end{macrocode}
486 % Assign initial values to \TeX's parameters
488 %    \begin{macrocode}
489 \message{parameters,}
490 %    \end{macrocode}
492 % All of \TeX's numeric parameters are listed here,
493 % but the code is commented out if no special value needs to be set.
494 % INITEX makes all parameters zero except where noted.
496 % \begin{oldcomments}
497 %    \begin{macrocode}
498 \pretolerance=100
499 \tolerance=200 % INITEX sets this to 10000
500 \hbadness=1000
501 \vbadness=1000
502 \linepenalty=10
503 \hyphenpenalty=50
504 \exhyphenpenalty=50
505 \binoppenalty=700
506 \relpenalty=500
507 \clubpenalty=150
508 \widowpenalty=150
509 \displaywidowpenalty=50
510 \brokenpenalty=100
511 \predisplaypenalty=10000
512 %    \end{macrocode}
513 % \postdisplaypenalty=0
514 % \interlinepenalty=0
515 % \floatingpenalty=0, set during \insert
516 % \outputpenalty=0, set before TeX enters \output
517 %    \begin{macrocode}
518 \doublehyphendemerits=10000
519 \finalhyphendemerits=5000
520 \adjdemerits=10000
521 %    \end{macrocode}
522 % \looseness=0, cleared by TeX after each paragraph
523 % \pausing=0
524 % \holdinginserts=0
525 % \tracingonline=0
526 % \tracingmacros=0
527 % \tracingstats=0
528 % \tracingparagraphs=0
529 % \tracingpages=0
530 % \tracingoutput=0
531 %    \begin{macrocode}
532 \tracinglostchars=1
533 %    \end{macrocode}
534 % \tracingcommands=0
535 % \tracingrestores=0
536 % \language=0
537 %    \begin{macrocode}
538 \uchyph=1
539 %    \end{macrocode}
540 % \lefthyphenmin=2 \righthyphenmin=3 set below
541 % \globaldefs=0
542 % \maxdeadcycles=25 % INITEX does this
543 % \hangafter=1 % INITEX does this, also TeX after each paragraph
544 % \fam=0
545 % \mag=1000 % INITEX does this
546 % \escapechar=`\\ % INITEX does this
547 %    \begin{macrocode}
548 \defaulthyphenchar=`\-
549 \defaultskewchar=-1
550 %    \end{macrocode}
551 % \endlinechar=`\^^M % INITEX does this
552 % \newlinechar=-1     \LaTeX\ sets this in ltdefns.dtx.
553 %    \begin{macrocode}
554 \delimiterfactor=901
555 %    \end{macrocode}
556 % \time=now % TeX does this at beginning of job
557 % \day=now % TeX does this at beginning of job
558 % \month=now % TeX does this at beginning of job
559 % \year=now % TeX does this at beginning of job
561 % \end{oldcomments}
562 %    In \LaTeX{} we don't want box information in the transcript
563 %    unless we do a full tracing.
564 %  \changes{v1.0g}{1994/04/28}{Turn off overfull box tracing in log}
566 %    \begin{macrocode}
567 \showboxbreadth=-1
568 \showboxdepth=-1
569 \errorcontextlines=-1
570 %    \end{macrocode}
572 %    \begin{macrocode}
573 \hfuzz=0.1pt
574 \vfuzz=0.1pt
575 \overfullrule=5pt
576 \maxdepth=4pt
577 \splitmaxdepth=\maxdimen
578 \boxmaxdepth=\maxdimen
579 %    \end{macrocode}
581 % \begin{oldcomments}
582 % \lineskiplimit=0pt, changed by \normalbaselines
583 %    \begin{macrocode}
584 \delimitershortfall=5pt
585 \nulldelimiterspace=1.2pt
586 \scriptspace=0.5pt
587 %    \end{macrocode}
588 % \mathsurround=0pt
589 % \predisplaysize=0pt, set before TeX enters $$
590 % \displaywidth=0pt, set before TeX enters $$
591 % \displayindent=0pt, set before TeX enters $$
592 %    \begin{macrocode}
593 \parindent=20pt
594 %    \end{macrocode}
595 % \hangindent=0pt, zeroed by TeX after each paragraph
596 % \hoffset=0pt
597 % \voffset=0pt
599 % \baselineskip=0pt, changed by \normalbaselines
600 % \lineskip=0pt, changed by \normalbaselines
601 %    \begin{macrocode}
602 \parskip=0pt plus 1pt
603 \abovedisplayskip=12pt plus 3pt minus 9pt
604 \abovedisplayshortskip=0pt plus 3pt
605 \belowdisplayskip=12pt plus 3pt minus 9pt
606 \belowdisplayshortskip=7pt plus 3pt minus 4pt
607 %    \end{macrocode}
608 % \leftskip=0pt
609 % \rightskip=0pt
610 %    \begin{macrocode}
611 \topskip=10pt
612 \splittopskip=10pt
613 %    \end{macrocode}
614 % \tabskip=0pt
615 % \spaceskip=0pt
616 % \xspaceskip=0pt
617 %    \begin{macrocode}
618 \parfillskip=0pt plus 1fil
619 %    \end{macrocode}
620 % \end{oldcomments}
623 % \begin{macro}{\normalbaselineskip}
624 % \begin{macro}{\normallineskip}
625 % \begin{macro}{\normallineskiplimit}
626 % We also define special registers that function like parameters:
627 %    \begin{macrocode}
628 \newskip\normalbaselineskip \normalbaselineskip=12pt
629 \newskip\normallineskip \normallineskip=1pt
630 \newdimen\normallineskiplimit \normallineskiplimit=0pt
631 %    \end{macrocode}
632 % \end{macro}
633 % \end{macro}
634 % \end{macro}
636 % \begin{macro}{\interfootlinepenalty}
637 %    \begin{macrocode}
638 \newcount\interfootnotelinepenalty \interfootnotelinepenalty=100
639 %    \end{macrocode}
640 % \end{macro}
642 % Definitions for preloaded fonts
644 % \begin{macro}{\magstephalf}
645 % \begin{macro}{\magstep}
646 %    \begin{macrocode}
647 \def\magstephalf{1095 }
648 \def\magstep#1{\ifcase#1 \@m\or 1200\or 1440\or 1728\or 
649                2074\or 2488\fi\relax}
650 %    \end{macrocode}
651 % \end{macro}
652 % \end{macro}
655 % Macros for setting ordinary text
657 % \begin{macro}{\frenchspacing}
658 % \begin{macro}{\nonfrenchspacing}
659 %    \begin{macrocode}
660 \def\frenchspacing{\sfcode`\.\@m \sfcode`\?\@m \sfcode`\!\@m
661   \sfcode`\:\@m \sfcode`\;\@m \sfcode`\,\@m}
662 \def\nonfrenchspacing{\sfcode`\.3000\sfcode`\?3000\sfcode`\!3000%
663   \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 }
664 %    \end{macrocode}
665 % \end{macro}
666 % \end{macro}
668 % \begin{macro}{\normalbaselines}
669 %    \begin{macrocode}
670 \def\normalbaselines{\lineskip\normallineskip
671   \baselineskip\normalbaselineskip \lineskiplimit\normallineskiplimit}
672 %    \end{macrocode}
673 % \end{macro}
675 % \begin{macro}{\M}
676 % \begin{macro}{\I}
677 % \changes{v1.1m}{1995/09/01}{Use \cs{let} to save space}
678 % Save a bit of space by using |\let| here.
679 %    \begin{macrocode}
680 \def\^^M{\ } % control <return> = control <space>
681 \let\^^I\^^M % same for <tab>
682 %    \end{macrocode}
683 % \end{macro}
684 % \end{macro}
686 % \begin{macro}{\lq}
687 % \begin{macro}{\rq}
688 %    \begin{macrocode}
689 \def\lq{`}
690 \def\rq{'}
691 %    \end{macrocode}
692 % \end{macro}
693 % \end{macro}
695 % \begin{macro}{\lbrack}
696 % \begin{macro}{\rbrack}
697 %    \begin{macrocode}
698 \def\lbrack{[}
699 \def\rbrack{]}
700 %    \end{macrocode}
701 % \end{macro}
702 % \end{macro}
704 % \begin{macro}{\aa}
705 % \begin{macro}{\AA}
706 % These are not from plain.tex but they are similar to other commands
707 % found here and nowhere else, being alternate input forms for
708 % characters.
709 %    \begin{macrocode}
710 \def \aa {\r a}
711 \def \AA {\r A}
712 %    \end{macrocode}
713 % \end{macro}
714 % \end{macro}
716 % \begin{macro}{\endgraf}
717 % \begin{macro}{\endline}
718 %    \begin{macrocode}
719 \let\endgraf=\par
720 \let\endline=\cr
721 %    \end{macrocode}
722 % \end{macro}
723 % \end{macro}
725 % \begin{macro}{\space}
726 %    \begin{macrocode}
727 \def\space{ }
728 %    \end{macrocode}
729 % \end{macro}
731 % \begin{macro}{\empty}
732 % \changes{v1.1m}{1995/09/01}{Use \cs{let} to save space}
733 % This probably ought to go altogether, but let it to the \LaTeX\
734 % version to save space.
735 %    \begin{macrocode}
736 \let\empty\@empty
737 %    \end{macrocode}
738 % \end{macro}
740 % \begin{macro}{\null}
741 %    \begin{macrocode}
742 \def\null{\hbox{}}
743 %    \end{macrocode}
744 % \end{macro}
746 % \begin{macro}{\bgroup}
747 % \begin{macro}{\egroup}
748 %    \begin{macrocode}
749 \let\bgroup={
750 \let\egroup=}
751 %    \end{macrocode}
752 % \end{macro}
753 % \end{macro}
755 % \begin{macro}{\obeylines}
756 % \begin{macro}{\obeyspaces}
757 % In |\obeylines|, we say |\let^^M=\par| instead of |\def^^M{\par}|
758 % since this allows, for example, |\let\par=\cr \obeylines \halign{...|
759 %    \begin{macrocode}
760 {\catcode`\^^M=\active % these lines must end with %
761   \gdef\obeylines{\catcode`\^^M\active \let^^M\par}%
762   \global\let^^M\par} % this is in case ^^M appears in a \write
763 \def\obeyspaces{\catcode`\ \active}
764 {\obeyspaces\global\let =\space}
765 %    \end{macrocode}
766 % \end{macro}
767 % \end{macro}
769 %  \begin{macro}{\loop}
770 % \changes{v1.0h}{1994/05/16}{Use Kabelschacht method} 
771 %  \begin{macro}{\iterate}
772 % \changes{v1.1b}{1994/11/10}
773 %         {(CAR) added extra \cs{relax}}
774 % \changes{v1.1m}{1994/05/26}
775 %         {(CAR) added \cs{long}}
776 %  \begin{macro}{\repeat}
777 %    We use Kabelschacht's method of doing loops, see TUB 8\#2 (1987).
778 %    (unless that breaks something :-).  It turned out to need an
779 %    extra |\relax|: see pr/642 (|\loop| could do one iteration too much
780 %    in certain cases).
781 %    \begin{macrocode}
782 \long\def \loop #1\repeat{%
783   \def\iterate{#1\relax  % Extra \relax
784                \expandafter\iterate\fi
785                }%
786   \iterate
787   \let\iterate\relax
789 %    \end{macrocode}
790 %    This setting of |\repeat| is needed to make |\loop...\if...\repeat|
791 %    skippable within another |\if...|.
792 %    \begin{macrocode}
793 \let\repeat=\fi 
794 %    \end{macrocode}
795 %  \end{macro}
796 %  \end{macro}
797 %  \end{macro}
799 % \LaTeX\ defines |\smallskip|, etc.\ in |ltspace.dtx|.
801 % \begin{macro}{\nointerlineskip}
802 % \begin{macro}{\offinterlineskip}
803 % \changes{v1.1n}{1995/07/02}{Replaced 1000 by \cs{@m}}
804 %    \begin{macrocode}
805 \def\nointerlineskip{\prevdepth-\@m\p@}
806 \def\offinterlineskip{\baselineskip-\@m\p@
807   \lineskip\z@ \lineskiplimit\maxdimen}
808 %    \end{macrocode}
809 %  \end{macro}
810 %  \end{macro}
812 % \begin{macro}{\vglue}
813 % \begin{macro}{\hglue}
814 %    \begin{macrocode}
815 \def\vglue{\afterassignment\vgl@\skip@=}
816 \def\vgl@{\par \dimen@\prevdepth \hrule \@height\z@
817   \nobreak\vskip\skip@ \prevdepth\dimen@}
818 \def\hglue{\afterassignment\hgl@\skip@=}
819 \def\hgl@{\leavevmode \count@\spacefactor \vrule \@width\z@
820   \nobreak\hskip\skip@ \spacefactor\count@}
821 %    \end{macrocode}
822 %  \end{macro}
823 %  \end{macro}
825 % \LaTeX\ defines |~| in |ltdefns.dtx|.
827 % \begin{macro}{\slash}
828 %    \begin{macrocode}
829 \def\slash{/\penalty\exhyphenpenalty} % a `/' that acts like a `-'
830 %    \end{macrocode}
831 %  \end{macro}
833 % \begin{macro}{\break}
834 % \begin{macro}{\nobreak}
835 % \begin{macro}{\allowbreak}
836 %    \begin{macrocode}
837 \def\break{\penalty-\@M}
838 \def\nobreak{\penalty \@M}
839 \def\allowbreak{\penalty \z@}
840 %    \end{macrocode}
841 %  \end{macro}
842 %  \end{macro}
843 %  \end{macro}
845 % \begin{macro}{\filbreak}
846 % \begin{macro}{\goodbreak}
847 %    \begin{macrocode}
848 \def\filbreak{\par\vfil\penalty-200\vfilneg}
849 \def\goodbreak{\par\penalty-500 }
850 %    \end{macrocode}
851 %  \end{macro}
852 %  \end{macro}
854 % \begin{macro}{\eject}
855 % \changes{v1.1s}{1995/10/17}{Move \cs{supereject} to compat file}
856 % Define |\eject| as in plain \TeX\ but define |\supereject| only in
857 % the compatibility file.
858 %    \begin{macrocode}
859 \def\eject{\par\break}
860 %    \end{macrocode}
861 %  \end{macro}
863 % \begin{macro}{\removelastskip}
864 %    \begin{macrocode}
865 \def\removelastskip{\ifdim\lastskip=\z@\else\vskip-\lastskip\fi}
866 %    \end{macrocode}
867 %  \end{macro}
869 % \begin{macro}{\smallbreak}
870 % \begin{macro}{\medbreak}
871 % \begin{macro}{\bigbreak}
872 %    \begin{macrocode}
873 \def\smallbreak{\par\ifdim\lastskip<\smallskipamount
874   \removelastskip\penalty-50\smallskip\fi}
875 \def\medbreak{\par\ifdim\lastskip<\medskipamount
876   \removelastskip\penalty-100\medskip\fi}
877 \def\bigbreak{\par\ifdim\lastskip<\bigskipamount
878   \removelastskip\penalty-200\bigskip\fi}
879 %    \end{macrocode}
880 %  \end{macro}
881 %  \end{macro}
882 %  \end{macro}
884 % \begin{macro}{\m@th}
885 % \changes{v1.0h}{1994/05/16}{Remove unnecssary space} 
886 %    \begin{macrocode}
887 \def\m@th{\mathsurround\z@}
888 %    \end{macrocode}
889 %  \end{macro}
891 % \begin{macro}{\underbar}
892 %    Due to \LaTeX's redefinition of |\underline| plain \TeX's 
893 %    |\underbar| can be done in a simpler fashion (but do we 
894 %    need it at all?).
895 % \changes{v1.1m}{1994/05/26}
896 %         {(CAR/FMi) changed to use box \cs{tw@}}
897 % \changes{v1.1p}{1994/05/26}
898 %         {(DPC) changed to use \cs{sbox}}
899 %    \begin{macrocode}
900 \def\underbar#1{\underline{\sbox\tw@{#1}\dp\tw@\z@\box\tw@}}
901 %    \end{macrocode}
902 %  \end{macro}
904 % \begin{macro}{\strutbox}
905 % \begin{macro}{\strut}
906 % \LaTeX\ sets |\strutbox| in |\set@fontsize|.
907 %    \begin{macrocode}
908 \newbox\strutbox
909 \def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi}
910 %    \end{macrocode}
911 %  \end{macro}
912 %  \end{macro}
914 % \begin{macro}{\hidewidth}
915 % For alignment entries that can stick out.
916 %    \begin{macrocode}
917 \def\hidewidth{\hskip\hideskip}
918 %    \end{macrocode}
919 %  \end{macro}
921 % \changes{v1.0h}{1994/05/16}{Remove unnecessary def for \cs{item}}
922 % \changes{v1.1i}{1995/04/27}
923 %   {Move \cs{hang} and \cs{textindent} to latex209.def} 
924 % \changes{RmS}{1991/11/04}{Removed \cs{itemitem} since never 
925 %    needed/useful with \LaTeX.}
927 % \begin{macro}{\narrower}
928 %    \begin{macrocode}
929 \def\narrower{%
930   \advance\leftskip\parindent
931   \advance\rightskip\parindent}
932 %    \end{macrocode}
933 %  \end{macro}
935 % \changes{v1.1c}{1994/11/12}{Comment out more encoding specific 
936 %                             commands} 
937 % \LaTeX\ defines |\ae| and similar commands elsewhere.
939 %    \begin{macrocode}
940 \chardef\%=`\%
941 \chardef\&=`\&
942 \chardef\#=`\#
943 %    \end{macrocode}
945 % Most text commands are actually encoding specific and therefore
946 % defined later, so commented out or removed from this file.
947 % \changes{v1.0h}{1994/05/16}{Comment out encoding specific commands} 
949 % \begin{macro}{\leavevmode}
950 % begins a paragraph, if necessary
951 %    \begin{macrocode}
952 \def\leavevmode{\unhbox\voidb@x}
953 %    \end{macrocode}
954 %  \end{macro}
956 % \begin{macro}{\mathhexbox}
957 %    \begin{macrocode}
958 \def\mathhexbox#1#2#3{\mbox{$\m@th \mathchar"#1#2#3$}}
959 %    \end{macrocode}
960 %  \end{macro}
963 % \begin{macro}{\ialign}
964 %    \begin{macrocode}
965 \def\ialign{\everycr{}\tabskip\z@skip\halign} % initialized \halign
966 %    \end{macrocode}
967 %  \end{macro}
969 % \begin{macro}{\oalign}
970 % \begin{macro}{\o@lign}
971 % \begin{macro}{\ooalign}
972 %    \begin{macrocode}
973 \def\oalign#1{\leavevmode\vtop{\baselineskip\z@skip \lineskip.25ex%
974   \ialign{##\crcr#1\crcr}}}
975 \def\o@lign{\lineskiplimit\z@ \oalign}
976 \def\ooalign{\lineskiplimit-\maxdimen \oalign}
977 %    \end{macrocode}
978 %  \end{macro}
979 %  \end{macro}
980 %  \end{macro}
982 % \begin{macro}{\sh@ft}
983 % \changes{v1.1t}{1996/07/26}{replace \cs{dimen}\cs{z@} by
984 %          \cs{dimen@}}
985 % \changes{v1.1y}{2005/09/27}{Macro no longer used but
986 %   left for compatibility}
987 % The definition of this macro in plain.tex was improved in
988 % about 1997; but as a result its usage was changed and its new
989 % definition is not appropriate for \LaTeX{}.
991 % Since the version given here has been in use by
992 % \LaTeX{} for many years it does not seem prudent to remove it now.
993 % As far as we can tell it has only been used to define~|\b| and~|\d|
994 % but this cannot be certain.
995 %    \begin{macrocode}
996 \def\sh@ft#1{\dimen@.00#1ex\multiply\dimen@\fontdimen1\font
997   \kern-.0156\dimen@} % compensate for slant in lowered accents
998 %    \end{macrocode}
999 %  \end{macro}
1001 % \begin{macro}{\ltx@sh@ft}
1002 % \changes{v1.1y}{2005/09/27}{New macro}
1003 % This is the \LaTeX{} version of the second incarnation of the plain
1004 % macro |\sh@ft|, which takes a dimension as its argument.  It shifts
1005 % a pseudo-accent horizontally by an amount proportional to the product
1006 % of its argument and the slant-per-point (fontdimen 1).  
1008 %    \begin{macrocode}
1009 \def\ltx@sh@ft #1{%
1010   \dimen@ #1%
1011   \kern \strip@pt
1012     \fontdimen1\font \dimen@
1013   } % kern by #1 times the current slant
1014 %    \end{macrocode}
1015 %  \end{macro}
1018 %  
1019 % \LaTeX{} change: the text commands such as
1020 % |\d|, |\b|, |\c|, |\copyright|,~|\TeX|
1021 % are now defined elsewhere.
1023 % \changes{LaTeX2e}
1024 %     {1993/11/29}{All accents in decimals; suggested by Paul Taylor}
1025 % \changes{v1.0d}{1994/04/12}
1026 %         {Define \cs{@acci}}
1027 % \changes{v1.0h}{1994/05/16}{Remove \cs{@acci} and friends again} 
1029 % \LaTeX{} change: Make |\t| work in a moving argument.
1030 % Now defined elsewhere.
1032 % \begin{macro}{\hrulefill}
1033 % \begin{macro}{\dotfill}
1034 % \LaTeX\ change: |\kern\z@| added to end of
1035 % |\hrulefill| and |\dotfill|
1036 % to make them work in `tabular' and `array' environments.
1037 % (Change made 24 July 1987).
1038 % \LaTeX\ change: |\leavevmode| added at begining of
1039 % |\dotfill| and |\hrulefill|
1040 % so that they work as expected in vertical mode.
1041 %    \begin{macrocode}
1042 \def\hrulefill{\leavevmode\leaders\hrule\hfill\kern\z@}
1043 %    \end{macrocode}
1044 % The box in |\dotfill| originally contained (in plain.tex):
1045 % |\mkern 1.5mu .\mkern 1.5mu|; the width of .44em differs from this
1046 % by .04pt which is probably an acceptable difference within leaders.
1047 % \changes{v1.1u}{1996/10/28}{Removed math mode} 
1048 % \changes{v1.1v}{1996/10/29}{Got arithmetic correct (CAR)} 
1049 % \changes{v1.1w}{1996/11/03}{Saved tokens by using \cs{hb@xt@}}
1050 %    \begin{macrocode}
1051 \def\dotfill{%
1052   \leavevmode
1053   \cleaders \hb@xt@ .44em{\hss.\hss}\hfill
1054   \kern\z@}
1055 %    \end{macrocode}
1056 %  \end{macro}
1057 %  \end{macro}
1059 % INITEX sets |\sfcode x=1000| for all x, except that |\sfcode`X=999|
1060 % for uppercase letters. The following changes are needed:
1061 %    \begin{macrocode}
1062 \sfcode`\)=0 \sfcode`\'=0 \sfcode`\]=0
1063 %    \end{macrocode}
1064 % The |\nonfrenchspacing| macro will make further changes to 
1065 % |\sfcode| values.
1068 % Definitions related to output
1071 % \changes{v1.1k}{1995/05/22}{Definitions of \cs{footins} and
1072 %                 \cs{footnoterule} moved to ltfloat.}
1075 % |\magnification| doesn't work in \LaTeX.
1076 %\begin{verbatim}
1077 %\def\magnification{\afterassignment\m@g\count@}
1078 %\def\m@g{\mag\count@
1079 %  \hsize6.5truein\vsize8.9truein\dimen\footins8truein}
1080 %\end{verbatim}
1082 % \begin{macro}{\showoverfull}
1083 % \changes{v0.1k ltfinal}{1994/05/19}{used \cs{@ne} not 1}
1084 % The following commands are used in debugging:
1085 %    \begin{macrocode}
1086 \def\showoverfull{\tracingonline\@ne}
1087 %    \end{macrocode}
1088 % \end{macro}
1090 % \begin{macro}{\showoutput}
1091 % \changes{v0.1k ltfinal}{1994/05/19}
1092 %         {used \cs{maxdimen} not 99999}
1093 % \changes{v1.1n}{1995/07/02}{Use \cs{showoverfull} to save space}
1094 % \changes{v1.1x}{2002/02/24}{Use newly added \cs{loggingoutput}}
1095 % \begin{macro}{\loggingoutput}
1096 % \changes{v1.1x}{2002/02/24}{Macro added}
1097 %    \begin{macrocode}
1098 %</2ekernel|autoload>
1099 %<*2ekernel|autoerr>
1100 \gdef\loggingoutput{\tracingoutput\@ne
1101     \showboxbreadth\maxdimen\showboxdepth\maxdimen\errorstopmode}
1102 \gdef\showoutput{\loggingoutput\showoverfull}
1103 %</2ekernel|autoerr>
1104 %<autoload>\def\showoutput{\@autoerr\showoutput}
1105 %    \end{macrocode}
1106 % \end{macro}
1107 % \end{macro}
1110 % \begin{macro}{\tracingall}
1111 % \changes{LaTeX209}{1991/08/26}{Added 
1112 %    \cs{errorcontextlines}!=\cs{maxdimen}, suggested by J. Schrod}
1113 % \changes{v1.1n}{1995/07/02}{Use \cs{showoutput} to save space}
1114 % \changes{v1.1x}{2002/02/24}{Use newly added \cs{loggingoutput}}
1115 % \begin{macro}{\loggingall}
1116 % \changes{v1.1x}{2002/02/24}{Macro added}
1117 %    \begin{macrocode}
1118 %<*2ekernel|autoerr>
1119 \gdef\loggingall{\tracingcommands\tw@\tracingstats\tw@
1120   \tracingpages\@ne\tracinglostchars\@ne
1121   \tracingmacros\tw@\tracingparagraphs\@ne\tracingrestores\@ne
1122   \errorcontextlines\maxdimen\loggingoutput}
1123 \gdef\tracingall{\loggingall\showoverfull}
1124 %</2ekernel|autoerr>
1125 %<autoload>\def\tracingall{\@autoerr\tracingall}
1126 %    \end{macrocode}
1127 % \end{macro}
1128 % \end{macro}
1130 % \LaTeX\ change: |\showhyphens| Defined later.
1132 % Punctuation affects the spacing.
1133 %    \begin{macrocode}
1134 %<*2ekernel|autoload>
1135 \nonfrenchspacing 
1136 %</2ekernel|autoload>
1137 %    \end{macrocode}
1140 % \Finale