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

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