home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / useful / dist / text / tex / pastex / macros / latex / general / lplain.tex < prev    next >
Text File  |  1992-04-01  |  49KB  |  1,370 lines

  1. % File LPLAIN - Created 29 October 1985 from plain version 1.5CM
  2. %             - Last modified 20 October 1988 to take into account
  3. %               changes to PLAIN.TEX reported by Arthur Ogawa
  4. %             - Modified February 8, 1990 by Dominik Wujastyk to
  5. %               match the PLAIN.TEX meant for TeX 3.0 (\fmtname{plain},
  6. %               \fmtversion{3.0}).
  7. %             - Modified March 15, 1990 by Frank Mittelbach to
  8. %               allow the use of this file both in TeX 2 and 3
  9. %             - Modified June 21, 1991 by RmS to clear the
  10. %               contents of \box0.
  11. %             - Modified July 1, 1991, by RmS to correct \multispan bug.
  12. %             - Modified August 14, 1991, By RmS to make \cases work
  13. %               with NFSS.
  14. %             - Modified October 30, 1991, by RmS to remove \catcode and
  15. %               \mathcode assignments for control characters.
  16. %             - Modified November 1, 1991, by RmS to remove ^^A and ^^K
  17. %               control characters.
  18. %             - Modified November 4, 1991, by RmS to add missing \m@th
  19. %               assignments and to introduce the file lhyphen.tex.
  20. %             - Modified November 7, 1991, by RmS to make it work with
  21. %               MLTeX version 2.
  22. %             - Modified March 17, 1992, by RmS to match changes in
  23. %               plain.tex of March 16, 1992.
  24. %
  25. % This is the LaTeX version of the plain TeX format that's described in
  26. % The TeXbook.  All modifications can be found by searching for
  27. % the word 'LaTeX'.
  28. % N.B.: A version number is defined at the very end of this file;
  29. %       please change that number whenever the file is modified!
  30. % And don't modify the file under any circumstances.
  31. %
  32. %% \CharacterTable
  33. %%  {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
  34. %%   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
  35. %%   Digits        \0\1\2\3\4\5\6\7\8\9
  36. %%   Exclamation   \!     Double quote  \"     Hash (number) \#
  37. %%   Dollar        \$     Percent       \%     Ampersand     \&
  38. %%   Acute accent  \'     Left paren    \(     Right paren   \)
  39. %%   Asterisk      \*     Plus          \+     Comma         \,
  40. %%   Minus         \-     Point         \.     Solidus       \/
  41. %%   Colon         \:     Semicolon     \;     Less than     \<
  42. %%   Equals        \=     Greater than  \>     Question mark \?
  43. %%   Commercial at \@     Left bracket  \[     Backslash     \\
  44. %%   Right bracket \]     Circumflex    \^     Underscore    \_
  45. %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
  46. %%   Right brace   \}     Tilde         \~}
  47. %%
  48.  
  49. \catcode`\{=1 % left brace is begin-group character
  50. \catcode`\}=2 % right brace is end-group character
  51. \catcode`\$=3 % dollar sign is math shift
  52. \catcode`\&=4 % ampersand is alignment tab
  53. \catcode`\#=6 % hash mark is macro parameter character
  54. \catcode`\^=7 % circumflex and uparrow are for superscripts
  55. \catcode`\_=8 % underline and downarrow are for subscripts
  56. \catcode`\^^I=10 % ascii tab is a blank space
  57. \chardef\active=13 \catcode`\~=\active % tilde is active
  58. \catcode`\^^L=\active \outer\def^^L{\par} % ascii form-feed is "\outer\par"
  59.  
  60. \message{Preloading the plain format: codes,}
  61.  
  62. % We had to define the \catcodes right away, before the message line,
  63. % since \message uses the { and } characters.
  64. % When INITEX (the TeX initializer) starts up,
  65. % it has defined the following \catcode values:
  66. % \catcode`\^^@=9 % ascii null is ignored
  67. % \catcode`\^^M=5 % ascii return is end-line
  68. % \catcode`\\=0 % backslash is TeX escape character
  69. % \catcode`\%=14 % percent sign is comment character
  70. % \catcode`\ =10 % ascii space is blank space
  71. % \catcode`\^^?=15 % ascii delete is invalid
  72. % \catcode`\A=11 ... \catcode`\Z=11 % uppercase letters
  73. % \catcode`\a=11 ... \catcode`\z=11 % lowercase letters
  74. % all others are type 12 (other)
  75.  
  76. % Here is a list of the characters that have been specially catcoded:
  77. \def\dospecials{\do\ \do\\\do\{\do\}\do\$\do\&%
  78.   \do\#\do\^\do\_\do\%\do\~}
  79. % (not counting ascii null, tab, linefeed, formfeed, return, delete)
  80. % Each symbol in the list is preceded by \do, which can be defined
  81. % if you want to do something to every item in the list.
  82.  
  83. % We make @ signs act like letters, temporarily, to avoid conflict
  84. % between user names and internal control sequences of plain format.
  85. \catcode`@=11
  86.  
  87. % INITEX sets up \mathcode x=x, for x=0..255, except that
  88. % \mathcode x=x+"7100, for x = `A to `Z and `a to `z;
  89. % \mathcode x=x+"7000, for x = `0 to `9.
  90. % The following changes define internal codes as recommended
  91. % in Appendix C of The TeXbook:
  92. \mathcode`\ ="8000 % \space
  93. \mathcode`\!="5021
  94. \mathcode`\'="8000 % ^\prime
  95. \mathcode`\(="4028
  96. \mathcode`\)="5029
  97. \mathcode`\*="2203 % \ast
  98. \mathcode`\+="202B
  99. \mathcode`\,="613B
  100. \mathcode`\-="2200
  101. \mathcode`\.="013A
  102. \mathcode`\/="013D
  103. \mathcode`\:="303A
  104. \mathcode`\;="603B
  105. \mathcode`\<="313C
  106. \mathcode`\=="303D
  107. \mathcode`\>="313E
  108. \mathcode`\?="503F
  109. \mathcode`\[="405B
  110. \mathcode`\\="026E % \backslash
  111. \mathcode`\]="505D
  112. \mathcode`\_="8000 % \_
  113. \mathcode`\{="4266
  114. \mathcode`\|="026A
  115. \mathcode`\}="5267
  116.  
  117. % INITEX sets \uccode`x=`X and \uccode `X=`X for all letters x,
  118. % and \lccode`x=`x, \lccode`X=`x; all other values are zero.
  119. % No changes to those tables are needed in plain TeX format.
  120.  
  121. % INITEX sets \sfcode x=1000 for all x, except that \sfcode`X=999
  122. % for uppercase letters. The following changes are needed:
  123. \sfcode`\)=0 \sfcode`\'=0 \sfcode`\]=0
  124. % The \nonfrenchspacing macro will make further changes to \sfcode values.
  125.  
  126. % Finally, INITEX sets all \delcode values to -1, except \delcode`.=0
  127. \delcode`\(="028300
  128. \delcode`\)="029301
  129. \delcode`\[="05B302
  130. \delcode`\]="05D303
  131. \delcode`\<="26830A
  132. \delcode`\>="26930B
  133. \delcode`\/="02F30E
  134. \delcode`\|="26A30C
  135. \delcode`\\="26E30F
  136. % N.B. { and } should NOT get delcodes; otherwise parameter grouping fails!
  137.  
  138. % To make the plain macros more efficient in time and space,
  139. % several constant values are declared here as control sequences.
  140. % If they were changed, anything could happen; so they are private symbols.
  141. \chardef\@ne=1
  142. \chardef\tw@=2
  143. \chardef\thr@@=3
  144. \chardef\sixt@@n=16
  145. \chardef\@cclv=255
  146. \mathchardef\@cclvi=256
  147. \mathchardef\@m=1000
  148. \mathchardef\@M=10000
  149. \mathchardef\@MM=20000
  150.  
  151. % Allocation of registers
  152.  
  153. % Here are macros for the automatic allocation of \count, \box, \dimen,
  154. % \skip, \muskip, and \toks registers, as well as \read and \write
  155. % stream numbers, \fam codes, \language codes, and \insert numbers.
  156.  
  157. \message{registers,}
  158.  
  159. % When a register is used only temporarily, it need not be allocated;
  160. % grouping can be used, making the value previously in the register return
  161. % after the close of the group.  The main use of these macros is for
  162. % registers that are defined by one macro and used by others, possibly at
  163. % different nesting levels.  All such registers should be defined through
  164. % these macros; otherwise conflicts may occur, especially when two or more
  165. % more macro packages are being used at once.
  166.  
  167. % The following counters are reserved:
  168. %   0 to 9  page numbering
  169. %       10  count allocation
  170. %       11  dimen allocation
  171. %       12  skip allocation
  172. %       13  muskip allocation
  173. %       14  box allocation
  174. %       15  toks allocation
  175. %       16  read file allocation
  176. %       17  write file allocation
  177. %       18  math family allocation
  178. %       19  language allocation
  179. %       20  insert allocation
  180. %       21  the most recently allocated number
  181. %       22  constant -1
  182. % New counters are allocated starting with 23, 24, etc.  Other registers are
  183. % allocated starting with 10.  This leaves 0 through 9 for the user to play
  184. % with safely, except that counts 0 to 9 are considered to be the page and
  185. % subpage numbers (since they are displayed during output). In this scheme,
  186. % \count 10 always contains the number of the highest-numbered counter that
  187. % has been allocated, \count 14 the highest-numbered box, etc.
  188. % Inserts are given numbers 254, 253, etc., since they require a \count,
  189. % \dimen, \skip, and \box all with the same number; \count 20 contains the
  190. % lowest-numbered insert that has been allocated. Of course, \box255 is
  191. % reserved for \output; \count255, \dimen255, and \skip255 can be used freely.
  192.  
  193. % It is recommended that macro