home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / fweb140x.zip / fwebmac.tex (.txt) < prev    next >
Texinfo Document  |  1996-02-27  |  64KB  |  1,543 lines

  1. % FWEAVE v1.30--beta (February 3, 1993)
  2. \input fwebmac.sty
  3. \Wbegin[eqalign]{article}{1em}{1em}{fwebmac.cts}{{\&}{\|}{\\}{\\}{\\}{\@}{\.}{%
  4. % --- Limbo text from style file ---
  5. \input fweb
  6. % --- Beginning of user's limbo section ---
  7. \Title{FWEBMAC}
  8. \WN1.  INTRODUCTION.  These are the standard macros for \FWEB\ (v.~1.30)
  9. listings (in addition to those of \.{PLAIN.TEX} and/or \LaTeX).
  10. WARNING: Some of these macros are not independent of stuff hard-coded
  11. into \FWEAVE. In other words, if you change something here, you may also need
  12. to recompile \FWEAVE. So caution!
  13. \fi % End of module 1
  14. \WM2. Print a comment at the beginning of the \.{.sty} file that is created.
  15. \WY\WP \5
  16. \WC{ --- THIS IS fwebmac.sty --- }\7
  17. \WC{ This file must be included into all .tex files produced by FWEAVE.  For
  18. the source for this file, please see fwebmac.web. }\7
  19. --------------------------------------------------------------------------- }%
  20. \WY\par
  21. \fi % End of module 2
  22. \WM3. First, we have a flag \WCD{ $\.{\\FWEBisloaded}{}$} that prevents %
  23. \.{fwebmac.sty} from
  24. being loaded twice.  For the use of this flag, see the Dirty Tricks
  25. appendix of the \TeX book.
  26. \WY\WP \5
  27. \WC{ If it's not defined yet, load in the macros. }\6
  28. $\.{\\ifx\\FWEBisloaded\\relax\\endinput\\else\\let\\FWEBisloaded\\relax%
  29. \\fi}{}$\WY\par
  30. \fi % End of module 3
  31. \WM4. Various things need to know the current version number and date.
  32. \WY $\WP \.{\\def\\FWEBversion\{1.30\}}$\6
  33. ${}\.{\\def\\FWEBdate\{May\ 15\1\ 1993\}}{}$\WY\par
  34. \fi % End of module 4
  35. \WM5. \FWEB\ now works with \LaTeX, after a fashion. Here's how to refer to it
  36. (borrowed from \LaTeX's \.{\\p@LaTeX} macro):
  37. \WY $\WP \.{\\def\\LaTeX\{\{\\rm\2L\\kern-0.36em\\raise0.3ex\\hbox\{\\Csc\2a\}%
  38. \\kern-0.15em\ T}{}$\5
  39. \Wx{ }\6
  40. ${}\.{\3\\kern-0.1667em\ \\lower0.7ex\\hbox\{E\}\\kern-0.125em\ X\}\}}{}$\WY\par
  41. \fi % End of module 5
  42. \WM6. We need to distinguish whether or not \LaTeX\ is loaded.  Assuming that
  43. only \TeX\ or \LaTeX\ will be used, one way of doing this is to
  44. discriminate on whether \WCD{ $\.{\\pageno}{}$} is defined.
  45. \WY $\WP \.{\\newif\\ifLaTeXisloaded}{}$\7
  46. ${}\.{\\ifx\\pageno\\undefined}$\6
  47. ${}\.{\3\\LaTeXisloadedtrue}$\6
  48. ${}\.{\\fi}{}$\WY\par
  49. \fi % End of module 6
  50. \WM7. \FWEB\ now supports \LaTeX's NFSS (new font selection scheme).  Macros
  51. courtesy of Charles Karney, Princeton U.
  52. \WY $\WP \.{\\ifx\\selectfont\\undefined\\else}$\6
  53. ${}\.{\3\\fontsize\{10\}\{12pt\}\\rm\2}{}$\5
  54. \WC{ The standard font for bulk of document. }\6
  55. ${}\.{\\fi}{}$\WY\par
  56. \fi % End of module 7
  57. \WM8. If \LaTeX\ is loaded, we equate \WCD{ $\.{\\pageno}{}$} to \LaTeX's
  58. counter so that the
  59. \WCD{ $\.{\\label}{}$} macro works correctly.  Also, \LaTeX\ does its own thing
  60. with the
  61. \WCD{ $\.{\\end}{}$} command.
  62. \WY $\WP \.{\\catcode\`\\@=11}{}$\7
  63. ${}\.{\\ifLaTeXisloaded}$\6
  64. ${}\.{\3\\let\\pageno\\c@page}{}$\5
  65. \WC{ \WEB\ has its own name for the page number. }\6
  66. ${}\.{\3\\def\\FWEBend\{\\let\\clearpage\\newpage}{}$\5
  67. \WC{ Otherwise, one gets a blank page. }\6
  68. ${}\.{\3\3\\end\{document\}\}}{}$\5
  69. \WC{ \LaTeX\ redefines \WCD{ $\.{\\end}{}$}. }\6
  70. ${}\.{\\else}$\6
  71. ${}\.{\3\\let\\FWEBend\\end}$\6
  72. ${}\.{\\fi}{}$\7
  73. ${}\.{\\catcode\`\\@=12}{}$\WY\par
  74. \fi % End of module 8
  75. \WM9. We can comment stuff out by bracketing it with \WCD{ $\.{\\comment...%
  76. \\endcomment}{}$}.
  77. \WY $\WP \.{\\long\\def\\comment\#1\\endcomment\{\}}{}$\WY\par
  78. \fi % End of module 9
  79. \WM10. Here's how to refer to the individual processors.  The user may wish to
  80. redefine these.
  81. \WY $\WP \.{\\def\\WEB\{\\Wtypewriter\{WEB\}\}}$\6
  82. ${}\.{\\def\\FWEB\{\\Wtypewriter\{FWEB\}\}}$\6
  83. ${}\.{\\def\\CWEB\{\\Wtypewriter\{CWEB\}\}}$\6
  84. ${}\.{\\def\\TANGLE\{\\Wtypewriter\{TANGLE\}\}\ \\let\\Tangle\\TANGLE}$\6
  85. ${}\.{\\def\\WEAVE\{\\Wtypewriter\{WEAVE\}\}\ \ \ \\let\\Weave\\WEAVE}$\6
  86. ${}\.{\\def\\FTANGLE\{\\Wtypewriter\{FTANGLE\}\}}$\6
  87. ${}\.{\\def\\FWEAVE\{\\Wtypewriter\{FWEAVE\}\}}{}$\WY\par
  88. \fi % End of module 10
  89. \WM11. Here's how one can refer to the individual languages.  The user may also
  90. to redefine these.
  91. \WY $\WP \.{\\def\\C\{C\}}$\6
  92. ${}\.{\\def\\Cpp\{\\C\{\\tt\2++\}\}}$\6
  93. ${}\.{\\def\\FORTRAN\{\{\\Csc\2Fortran\}\}\ \\let\\Fortran\\FORTRAN}$\6
  94. ${}\.{\\def\\MAKE\{\{\\tt\2MAKE\}\}\ \ \ \ \ \ \ \\let\\Make\\MAKE}$\6
  95. ${}\.{\\def\\RATFOR\{\{\\Csc\2Ratfor\}\}\ \ \ \\let\\Ratfor\\RATFOR}$\6
  96. ${}\.{\\let\\TEX\\TeX}$\6
  97. ${}\.{\\def\\UNIX\{\{\\SC\2UNIX\}\}\3\\let\\Unix\\UNIX}{}$\WY\par
  98. \fi % End of module 11
  99. \WM12. Here's something for trickery with catcodes.
  100. \WY $\WP \.{\\chardef\\other=12}{}$\WY\par
  101. \fi % End of module 12
  102. \WM13. Now remember Plain \TeX\ stuff used for other purposes by \FWEB.
  103. \WY $\WP \.{\\let\\amp\\\&}$\6
  104. ${}\.{\\let\\at\\@}$\6
  105. ${}\.{\\let\\bslash\\\\}$\6
  106. ${}\.{\\let\\caret\\\^}$\6
  107. ${}\.{\\let\\dollar\\\$}$\6
  108. ${}\.{\\let\\dstar\\\ast }$\6
  109. ${}\.{\\let\\equals\\=}$\6
  110. ${}\.{\\let\\leftbrace\\\{}$\6
  111. ${}\.{\\let\\period\\.}$\6
  112. ${}\.{\\let\\rightbrace\\\}}$\6
  113. ${}\.{\\let\\vertbar|}$\6
  114. ${}\.{\\let\\PM\\\#}$\6
  115. ${}\.{\\let\\PC\\\%}{}$\WY\par
  116. \fi % End of module 13
  117. \WM14. Additionally, the TeXbook manual macro package \.{manmac} redefines the
  118. following stuff:
  119.  \WCD{ $\.{\\iftitle\2\\titlefont\2\\rhead\2\\pagewidth\2\\pageheight\2%
  120. \\output}{}$}
  121. \noindent If you want to include \.{manmac.tex} to get various macro
  122. definitions, the best scheme is to use the `\.{-w}'~command-line option to
  123. prevent \FWEAVE\ from outputting \WCD{ $\.{\\input\2fwebmac.sty}{}$} as the
  124. first output line.
  125. Then include both files explicitly, in this order:
  126.     \WCD{ $\.{\\input\2manmac}{}$}
  127.     \WCD{ $\.{\\input\2fwebmac.sty}{}$}
  128. \noindent You can do this by defining the first limbo text command as
  129. follows:
  130.  \WCD{@ $\.{l\ "\\\\input\ manmac\ \\\\input\ fwebmac.sty"}{}$}
  131. \fi % End of module 14
  132. \WM15. Paragraph skip and indentation for \TeX\ text:
  133. \WY $\WP \.{\\newdimen\\pardimen}$\6
  134. ${}\.{\\dimen0=\\normalbaselineskip}$\6
  135. ${}\.{\\parskip=\\dimen0\ plus\ 1pt}{}$\7
  136. \WC{ If you don't like spaces between paragraphs, change \WCD{ $\.{%
  137. \\pardimen}{}$} to \WCD{ $\.{0pt}{}$}. }\6
  138. ${}\.{\\pardimen=\\parskip}{}$\7
  139. ${}\.{\\parskip\20pt}{}$\5
  140. \WC{ No stretch between paragraphs }\7
  141. \WC{ Indentation for the \TeX\ part is handled in a separate variable  \WCD{ $%
  142. \.{\\TeXindent}{}$} from the variable \WCD{ $\.{\\notch}{}$} used for
  143. definition and code parts. }\6
  144. ${}\.{\\newdimen\\TeXindent}$ $\.{\\TeXindent\21em}{}$\5
  145. \WC{ For paragraphs in the \TeX\ part. }\WY\par
  146. \fi % End of module 15
  147. \WN16.  FONTS. Several fonts have been declared in addition to the standard of
  148. \.{PLAIN} format:
  149. $$\vbox{\halign{\.{\\#}\quad\hfil&---\quad#\hfil\cr
  150. titlefont&\titlefont Title.\cr
  151. ttitlefont&\ttitlefont Title.\cr
  152. SC&\SC SMALL CAPS.\cr
  153. Csc&\Csc CAPS/Small caps.\cr
  154. tentex&\tentex \TeX\ extended character set, including~'\.{\ }'.\cr
  155. bfit&\bfit Bold-faced italic.\cr
  156. The font used for comments is called \WCD{ $\.{\\cmntfont}{}$}.  By default,
  157. this is
  158. \WCD{ $\.{\\let}{}$} to \WCD{ $\.{\\tenrm}{}$}.
  159. \WY $\WP \.{\\ifx\\selectfont\\undefined}$\6
  160. ${}\.{\3\\let\\mainfont\\tenrm\2\\let\\cmntfont\\tenrm}$\6
  161. ${}\.{\3\\font\\eightrm=cmr8\ \\let\\SC\\eightrm}{}$\7
  162. ${}\.{\3\\font\\titlefont=cmssbx10\ scaled\ \\magstep2}{}$\5
  163. \WC{ Sans serif }\6
  164. ${}\.{\3\\font\\ttitlefont=cmtt10\ scaled\\magstep2}{}$\5
  165. \WC{ Typewriter type }\7
  166. ${}\.{\3\\font\\tentex=cmtex10\ }{}$\5
  167. \WC{ \TeX\ \.{extended char.\ set} (used in strings) }\6
  168. ${}\.{\3\\font\\Csc=cmcsc10\ }{}$\5
  169. \WC{ Caps/small caps. }\6
  170. ${}\.{\3\\font\\tenbfit=cmbxti10\ }{}$\5
  171. \WC{ \&{Intrinsic functions} }\7
  172. \WC{ Used for module-number subscript: }\6
  173. ${}\.{\3\\font\\seventi=cmti7}$\6
  174. ${}\.{\3\\font\\sevenrm=cmr7}$\6
  175. ${}\.{\3\\font\\sevenbf=cmbx7}{}$\7
  176. \WC{ For special handling of array indices: }\6
  177. ${}\.{\3\\font\\sevenit=cmti7}$\6
  178. ${}\.{\3\\scriptfont\\itfam=\\sevenit}{}$\7
  179. ${}\.{\3\\scriptscriptfont\\itfam=\\sevenit}{}$\7
  180. ${}\.{\\else\2}{}$\5
  181. \WC{ NFSS }\6
  182. ${}\.{\3\\def\\mainfont\{\\fontfamily\{\\rmdefault\}\\fontseries\{m\}%
  183. \\fontshape\{n\}}{}$\5
  184. \Wx{ }\6
  185. ${}\.{\3\3\\normalsize\}}$\6
  186. ${}\.{\3\\let\\cmntfont\\mainfont}{}$\7
  187. ${}\.{\3\\def\\eightrm\{\\fontfamily\{\\rmdefault\}\\fontseries\{m\}\\fontshape%
  188. \{n\}}{}$\5
  189. \Wx{ }\6
  190. ${}\.{\3\3\\footnotesize\}}$\6
  191. ${}\.{\3\\let\\SC\\eightrm}{}$\7
  192. ${}\.{\3\\def\\titlefont\{\\fontfamily\{\\sfdefault\}\\fontseries\{\\bfdefault%
  193. \}}{}$\5
  194. \Wx{ }\6
  195. ${}\.{\3\3\\fontshape\{n\}\\Large\}}$\6
  196. ${}\.{\3\\def\\ttitlefont\{\\fontfamily\{\\ttdefault\}\\fontseries\{m\}%
  197. \\fontshape\{n\}}{}$\5
  198. \Wx{ }\6
  199. ${}\.{\3\3\\Large\}}{}$\7
  200. ${}\.{\3\\def\\tentex\{\\fontfamily\{\\ttdefault\}\\fontseries\{m\}\\fontshape%
  201. \{n\}}{}$\5
  202. \Wx{ }\6
  203. ${}\.{\3\3\\normalsize\}}{}$\7
  204. ${}\.{\3\\def\\Csc\{\\fontfamily\{\\rmdefault\}\\fontseries\{m\}\\fontshape\{%
  205. \\scdefault\}}{}$\5
  206. \Wx{ }\6
  207. ${}\.{\3\3\\normalsize\}}$\6
  208. ${}\.{\3\\def\\tenbfit\{\\fontfamily\{\\rmdefault\}\\fontseries\{\\bfdefault%
  209. \}}{}$\5
  210. \Wx{ }\6
  211. ${}\.{\3\3\\fontshape\{\\itdefault\}\\normalsize\}}{}$\7
  212. ${}\.{\3\\def\\seventi\{\\fontfamily\{\\rmdefault\}\\fontseries\{m\}}{}$\5
  213. \Wx{ }\6
  214. ${}\.{\3\3\\fontshape\{\\itdefault\}\\scriptsize\}}$\6
  215. ${}\.{\3\\def\\sevenrm\{\\fontfamily\{\\rmdefault\}\\fontseries\{m\}\\fontshape%
  216. \{n\}}{}$\5
  217. \Wx{ }\6
  218. ${}\.{\3\3\\scriptsize\}}$\6
  219. ${}\.{\3\\def\\sevenbf\{\\fontfamily\{\\rmdefault\}\\fontseries\{\\bfdefault%
  220. \}}{}$\5
  221. \Wx{ }\6
  222. ${}\.{\3\3\\fontshape\{n\}\\scriptsize\}}{}$\7
  223. ${}\.{\3\\def\\fiveti\{\\fontfamily\{\\rmdefault\}\\fontseries\{m\}}{}$\5
  224. \Wx{ }\6
  225. ${}\.{\3\3\\fontshape\{\\itdefault\}\\tiny\}}$\6
  226. ${}\.{\3\\def\\fiverm\{\\fontfamily\{\\rmdefault\}\\fontseries\{m\}\\fontshape%
  227. \{n\}\\tiny\}}$\6
  228. ${}\.{\3\\def\\fivebf\{\\fontfamily\{\\rmdefault\}\\fontseries\{\\bfdefault%
  229. \}}{}$\5
  230. \Wx{ }\6
  231. ${}\.{\3\3\\fontshape\{n\}\\tiny\}}{}$\7
  232. ${}\.{\3\\def\\tensy\{\\fontfamily\{cmsy\}\\fontseries\{m\}\\fontshape\{n\}%
  233. \\normalsize\}}{}$\7
  234. ${}\.{\3\\def\\pbf\{\\fontfamily\{\\rmdefault\}\\fontseries\{\\bfdefault\}%
  235. \\fontshape\{n\}}{}$\5
  236. \Wx{ }\6
  237. ${}\.{\3\3\\selectfont\}}$\6
  238. ${}\.{\3\\def\\ptt\{\\fontfamily\{\\ttdefault\}\\fontseries\{m\}\\fontshape\{n%
  239. \}\\selectfont\}}$\6
  240. ${}\.{\\fi}{}$\7
  241. \WC{ The next isn't really sufficient; this ought to be put into  the
  242. definitions of \WCD{ $\.{\\tenpoint}{}$}, \WCD{ $\.{\\twelvepoint}{}$}, etc. }\6
  243. ${}\.{\3\\let\\bfit\\tenbfit}{}$\WY\par
  244. \fi % End of module 16
  245. \WN17.  HIGHLIGHTING MACROS.  These are used for displaying identifiers,
  246. reserved words, intrinsic functions, etc.
  247. \WY $\WP \.{\\def\\Wshort\#1\{\\leavevmode\\hbox\{\$\#1\$\}\}}{}$\5
  248. \WC{ One-letter identifiers such  as~\Wshort{x} look better this way. }\7
  249. ${}\.{\\def\\Wid\#1\{\\leavevmode\\hbox\{\\it\#1\\/\\kern.05em\}\}}{}$\5
  250. \WC{ Italic type for ordinary  identifiers such as \Wid{test}. }\7
  251. \WC{ By default, macros are formatted the same way as ordinary identifiers.
  252. However, you can change the following definitions to get special effects.
  253. Either make your own version of \WCD{ $\.{fwebmac.sty}{}$} (use a change file
  254. with  \WCD{ $\.{fwebmac.web}{}$}), or redefine \WCD{ $\.{\\WidD}{}$} and/or %
  255. \WCD{ $\.{\\WidM}{}$} with an \.{@l} command. }\6
  256. ${}\.{\\let\\WidD\\Wid\2}{}$\5
  257. \WC{ Outer macro }\6
  258. ${}\.{\\let\\WidM\\Wid\2}{}$\5
  259. \WC{ WEB macro }\7
  260. ${}\.{\\def\\Wreserved\#1\{\\leavevmode\\hbox\{\\def\\\\\{\\tt\\BS\}\\bf\#1\\/%
  261. \}\}}{}$\5
  262. \WC{ Boldface type  for reserved words such as \&{integer}. }\7
  263. ${}\.{\\def\\Wintrinsic\#1\{\\leavevmode\\hbox\{\\def\\\\\{\\tt\\BS\}\\bfit\#1%
  264. \\/\\kern.05em\}\}}{}$\5
  265. \WC{  Library/intrinsic function name such as \@{sin}. }\7
  266. \WC{ In the following, we use \WCD{ $\.{\\gdef}{}$} instead of \WCD{ $\.{%
  267. \\global\\let}{}$} because we  might want to change the definition of, e.g., %
  268. \WCD{ $\.{\\WidM}{}$} with an \.{@l}  command, which comes \It{after} the \WCD{
  269. $\.{\\Wbegin}{}$} statement. }\6
  270. ${}\.{\\def\\Wequate\#1\#2\#3\#4\#5\#6\#7\#8\{}{}$\5
  271. \Wx{ }\6
  272. ${}\.{\3\\gdef\#1\{\\Wreserved\}}{}$\5
  273. \WC{ \WCD{ $\.{\\\&}{}$} by default. }\6
  274. ${}\.{\3\\gdef\#2\{\\Wshort\}}{}$\5
  275. \WC{ \WCD{ $\.{\\|}{}$} by default.  Don't reorder the following three
  276. statements! In case arguments 3--5 are  identical, we want the ordinary
  277. identifier to win. }\6
  278. ${}\.{\3\\gdef\#5\{\\WidM\}}{}$\5
  279. \WC{ \WCD{ $\.{\\\\}{}$} by default. }\6
  280. ${}\.{\3\\gdef\#4\{\\WidD\}}{}$\5
  281. \WC{ \WCD{ $\.{\\\\}{}$} by default. }\6
  282. ${}\.{\3\\gdef\#3\{\\Wid\}}{}$\5
  283. \WC{ \WCD{ $\.{\\\\}{}$} by default. }\6
  284. ${}\.{\3\\gdef\#6\{\\Wintrinsic\}}{}$\5
  285. \WC{ \WCD{ $\.{\\@}{}$} by default. }\6
  286. ${}\.{\3\\gdef\#7\{\\Wkeyword\}}{}$\5
  287. \WC{ \WCD{ $\.{\\.}{}$} by default. }\6
  288. ${}\.{\3\\gdef\#8\{\\Wtypewriter\}\}}{}$\5
  289. \WC{ \WCD{ $\.{\\.}{}$} by default. }\WY\par
  290. \fi % End of module 17
  291. \WM18. Identifiers that are recognized as function or macro names are followed
  292. by the construction\hfil\break
  293. \.{\\WIN\{{\it name}\_{\it type}\}\{{\it module}\_{\it number}\}}.  The
  294. cases for the first argument correspond to
  295. $$\vbox{\halign{#\hfil&\ ---\ #\hfil\cr
  296. 0&Generic name, defined by \.{@[}.\cr
  297. 1&Function name.\cr
  298. 2&\WEB\ macro (\.{@m}).\cr
  299. 3&Outer macro (\.{@d}).\cr
  300. 4&Reserved name defined with~\.{@`}.\cr
  301. 5&\WCD{ \&{typedef}} name.\cr
  302. If the name was defined in the current module, the second argument will be
  303. zero; otherwise it will be the section number in which the name was
  304. defined.  The macro shows how to display the 0~state differently (here with
  305. a bullet).   Also, note how combinations of underlining and fonts are used
  306. to distinguish the various kinds of identifiers.
  307. \WY $\WP \.{\\def\\Wzero\{0\}}{}$\7
  308. ${}\.{\\def\\WIN\#1\#2\{\\ifmmode\\def\\ZZ\{\}\\else\\def\\ZZ\{\\null\$\\null\}%
  309. \\fi}$\6
  310. ${}\.{\3\\ZZ\_\{\\def\\next\{\#2\}\\ifx\\next\\Wzero\{\\bullet\}\\else\\WINo\{%
  311. \#1\}\{\#2\}\\fi\}\\ZZ\}}{}$\7
  312. \WC{ Format the module-number subscript. }\6
  313. ${}\.{\\def\\WINo\#1\#2\{}{}$\5
  314. \Wx{ }\6
  315. ${}\.{\3\\ifcase\#1\\underline\{\\hbox\{\\sevenrm\#2\}\}}{}$\5
  316. \WC{ Generic name (\.{@[}). [0] }\6
  317. ${}\.{\3\3\\or\\hbox\{\\sevenrm\#2\}}{}$\5
  318. \WC{ Function name. [1] }\6
  319. ${}\.{\3\3\\or\\underline\{\\hbox\{\\seventi\#2\}\}}{}$\5
  320. \WC{ WEB macro. [2] }\6
  321. ${}\.{\3\3\\or\\hbox\{\\seventi\#2\}}{}$\5
  322. \WC{ Outer macro. [3] }\6
  323. ${}\.{\3\3\\or\\underline\{\\hbox\{\\sevenbf\#2\}\}}{}$\5
  324. \WC{ \.{@`}. [4] }\6
  325. ${}\.{\3\3\\or\\hbox\{\\sevenbf\#2\}}{}$\5
  326. \WC{ \&{typedef}. [5] }\6
  327. ${}\.{\3\3\\else\{\#2\}}{}$\5
  328. \WC{ Error trap. }\6
  329. ${}\.{\3\\fi\}}{}$\WY\par
  330. \fi % End of module 18
  331. \WN19.  STRINGS. Strings are indicated by ``\.{\\.\{\dots\}}''.  You can also
  332. use this for typewriter type; remember to escape the appropriate symbols:
  333. ``\.{\ \\\#\%\$\^\{\}\~\&\_}''.  The string macro itself does not surround
  334. its contents with an \WCD{ $\.{\\hbox}{}$}, in order that long strings can be
  335. broken by
  336. discretionaries.
  337. \WY $\WP \.{\\def\\Wtypewriter\#1\{\\relax\\ifmmode\\gdef\\YY\{\\null\$\\null\}%
  338. \\else\\gdef\\YY\{\}\\fi}$\6
  339. ${}\.{\3\\YY\{\\leavevmode\\INITSTR\#1\}\\YY\}}{}$\7
  340. ${}\.{\\let\\Wkeyword\\Wtypewriter}{}$\WY\par
  341. \fi % End of module 19
  342. \WM20. Here is the nucleus for the string macro~\WCD{ $\.{\\.}{}$} (more
  343. precisely, for
  344. \WCD{ $\.{\\Wtypewriter}{}$}).
  345. \WY $\WP \.{\\def\\INITSTR\{}{}$\5
  346. \Wx{ }\6
  347. ${}\.{\3\\tentex\2}{}$\5
  348. \WC{ Typewriter type for strings }\6
  349. ${}\.{\3\\let\\\\=\\BS\2}{}$\5
  350. \WC{ Backslash in a string: '\.\\'. }\6
  351. ${}\.{\3\\let\\'=\\RQ\2}{}$\5
  352. \WC{ Right quote in a string: '\.\''. }\6
  353. ${}\.{\3\\let\\\`=\\LQ\2}{}$\5
  354. \WC{ Left quote in a string: '\.\`'. }\6
  355. ${}\.{\3\\let\\\{=\\LB\2}{}$\5
  356. \WC{ Left brace in a string: '\.\LB'. }\6
  357. ${}\.{\3\\let\\\}=\\RB\2}{}$\5
  358. \WC{ Right brace in a string: '\.\RB'. }\6
  359. ${}\.{\3\\let\\\~=\\TL\2}{}$\5
  360. \WC{ Tilde in a string: '\.\~'. }\6
  361. ${}\.{\3\\let\\\ =\\SP\2}{}$\5
  362. \WC{ Space in a string: '\.\ '. }\6
  363. ${}\.{\3\\let\\\_=\\UL\2}{}$\5
  364. \WC{ Underline in a string: '\.\_'. }\6
  365. ${}\.{\3\\let\\\&=\\AM\2}{}$\5
  366. \WC{ Ampersand in a string: '\.\&'. }\6
  367. ${}\.{\3\\def\\0\{\\discretionary\{\\BS\}\{\}\{\}\}}{}$\5
  368. \WC{ FWEB inserts this automatically every  so often so very long strings will
  369. break. Broken strings will  be marked by a backslash. }\6
  370. ${}\.{\3\\def\\1\{\1\\0\}}{}$\5
  371. \WC{ FWEB replaces commas in strings by this, so strings  tend to break after
  372. commas. }\6
  373. ${}\.{\3\\let\\2\\space\2}{}$\5
  374. \WC{ Ordinary space after control sequences in \TeX. }\6
  375. ${}\.{\3\\def\\3\{\\space\\space\}}{}$\5
  376. \WC{ Translation of a tab in \TeX. }\6
  377. ${}\.{\3\}}{}$\WY\par
  378. \fi % End of module 20
  379. \WM21. Characters for strings:
  380. \WY $\WP \.{\\def\\\#\{\\hbox\{\\tt\\char35\}\}}{}$\5
  381. \WC{ Parameter sign: '\#'. }\6
  382. ${}\.{\\def\\\$\{\\hbox\{\\tt\\char36\}\}}{}$\5
  383. \WC{ Dollar sign: '\$'. }\6
  384. ${}\.{\\def\\\%\{\\hbox\{\\tt\\char37\}\}}{}$\5
  385. \WC{ Percent sign: '\%'. }\6
  386. ${}\.{\\def\\\^\{\\ifmmode\\raise0.45ex\\hbox\{\$\\\1\\scriptstyle%
  387. \\mathchar"25E\\\1\$\}}{}$\5
  388. \Wx{ }\6
  389. ${}\.{\3\\else\\char\`\^\ \\fi\}}{}$\5
  390. \WC{ Pointer or  hat: '\^'.  Circumflex accents can be obtained from \WCD{ $\.{%
  391. \\\^\^D}{}$} instead of \WCD{ $\.{\\\^}{}$}. }\6
  392. ${}\.{\\def\\AT!\{@\}}{}$\5
  393. \WC{ At sign for control text: '\AT!' }\WY\par
  394. \fi % End of module 21
  395. \WM22. The following funny business about asterisks is in case you want to be
  396. clever and make~`\.*' an active character (for example, for complex
  397. conjugation).
  398. \WY $\WP \.{\\chardef\\asterisk=\`\\\ast }$\6
  399. ${}\.{\\def\\ast\{\\ifmmode\{\\displaystyle\\mathchar"2203\}\\else\\asterisk%
  400. \\fi\}}{}$\WY\par
  401. \fi % End of module 22
  402. \WM23. More stuff for strings.
  403. \WY $\WP \.{\\chardef\\AM=\`\\\&}{}$\5
  404. \WC{ Ampersand character in a string: '\.\&'. }\6
  405. ${}\.{\\chardef\\BS=\`\\\\}{}$\5
  406. \WC{ Backslash in a string: '\.\\'. }\6
  407. ${}\.{\\def\\ttBS\{\{\\tt\\BS\}\}}{}$\5
  408. \WC{ Literal backslash: '\ttBS'. }\6
  409. ${}\.{\\chardef\\LB=\`\\\{}{}$\5
  410. \WC{ Left brace in a string: '\.\LB'. }\6
  411. ${}\.{\\def\\LQ\{\{\\tt\\char'22\}\}}{}$\5
  412. \WC{ Left quote in a string: '\.\`'. }\6
  413. ${}\.{\\chardef\\RB=\`\\\}}{}$\5
  414. \WC{ Right brace in a string: '\.\RB'. }\6
  415. ${}\.{\\def\\RQ\{\{\\tt\\char'23\}\}}{}$\5
  416. \WC{ Right quote in a string: '\.\''. }\6
  417. ${}\.{\\def\\SP\{\{\\tt\\char\`\\\ \}\}}{}$\5
  418. \WC{ (Visible) space in a string: '\.\ '. }\6
  419. ${}\.{\\chardef\\TL=\`\\\~}{}$\5
  420. \WC{ Tilde in a string: '\.\~'. }\6
  421. ${}\.{\\chardef\\UL=\`\\\_}{}$\5
  422. \WC{ Underline character in a string: '\.\_'. }\WY\par
  423. \fi % End of module 23
  424. \WM24.
  425. \WY $\WP \.{\\def\\LA\{\\hbox\{\\LQ\}\}}{}$\5
  426. \WC{ Left quote outside a string }\WY\par
  427. \fi % End of module 24
  428. \WN25.  INDENTATION, LINEBREAKS, etc.  These commands are mostly handled by the
  429. macros~\WCD{ $\.{\\1}{}$} to~\WCD{ $\.{\\8}{}$}.
  430. First, here are some macros to draw vertical lines to show off the indentation
  431. scheme.
  432. \WY $\WP \.{\\newbox\\rulebox}$\6
  433. ${}\.{\\newcount\\ruleno}{}$\7
  434. ${}\.{\\def\\rules\#1\{\\leavevmode}$\6
  435. ${}\.{\3\\ruleno=0}$\6
  436. ${}\.{\3\\rlap\{\\vtop\2to\ 0pt\{\\null}$\6
  437. ${}\.{\3\3\\def\\R\{\\setbox0=\\hbox\{\\the\\ruleno\}}{}$\5
  438. \Wx{ }\6
  439. ${}\.{\3\3\3\\rlap\{\\vrule\2height0pt\ depth\#1\}}{}$\5
  440. \Wx{ }\6
  441. ${}\.{\3\3\3\\kern-0.5\\wd0\\copy0\\kern-0.5\\wd0}$\6
  442. ${}\.{\3\3\3\\advance\\ruleno\2by1}$\6
  443. ${}\.{\3\3\3\\hskip1em\}}$\6
  444. ${}\.{\3\3\\rlap\{\\R\\R\\R\\R\\R\\R\\R\}}$\6
  445. ${}\.{\3\3\\vss\}\}\}}{}$\WY\par
  446. \fi % End of module 25
  447. \WM26. The indentation scheme is as follows.  The unit of indentation is
  448. \WCD{ $\.{\\notch}{}$}.
  449. \WY $\WP \.{\\newdimen\\notch}$\6
  450. ${}\.{\\notch\21em}{}$\WY\par
  451. \fi % End of module 26
  452. \WM27. Here is typical output.
  453. \setbox\rulebox\vtop{\null
  454. \WY $\WP\WE:if:\WO{1}{}$\par
  455. \WP\WMd$\|A\WIN2{0}$\5
  456. $\WO{2}{}$\par
  457. \WP\WE:endif:\par
  458. \WP\WMD$\\{ALPHA}$\5
  459. $\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+%
  460. \\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+%
  461. \\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+%
  462. \\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+%
  463. \\{xxx}+\\{yyy}+\\{xxx}{}$\par
  464. \WY\WP$\\{main}(\,)$\1\1\6
  465. \&{int} \1\\{abcde}, \\{abcde}, \\{abcde}, \\{abcde}, \\{abcde}, \\{abcde}, %
  466. \\{abcde}, \\{abcde}, \\{abcde}, \\{abcde}, \\{abcde}, \\{abcde}, \\{abcde}, %
  467. \\{abcde}, \\{abcde}, \\{abcde}, \\{abcde}, \\{abcde}, \\{abcde}, \\{abcde};\2%
  468. \2\2\1\6
  469. $\{{}$\6
  470. \WE:if:$\WO{1111}+\WO{2222}+\WO{1111}+\WO{2222}+\WO{1111}+\WO{2222}+\WO{1111}+%
  471. \WO{2222}+\WO{1111}+\WO{2222}+\\{aaaa}+\\{bbbb}+\WO{1111}+\WO{2222}+\WO{1111}+%
  472. \WO{2222}+\WO{1111}+\WO{2222}+\WO{1111}+\WO{2222}+\WO{1111}+\WO{2222}$\WPs\7
  473. $\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+%
  474. \\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+%
  475. \\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+\\{yyy}+\\{xxx}+%
  476. \\z;{}$%
  477. \WE:endif:\WPs\6
  478. $\}$\2\WY\par
  479. \vbox{\noindent\rules{\dp\rulebox}\box\rulebox}
  480. Preprocessor commands in the definition part are far left, definition-part
  481. commands such
  482. as~\.{@m} are indented one notch, function names are at two notches, and
  483. the body of functions is at three notches.  This distance is given the
  484. special name \WCD{ $\.{\\globalindent}{}$}:
  485. \WY $\WP \.{\\newcount\\globalindent}$ $\.{\\globalindent=3\ }{}$\5
  486. \WC{ Global indentation in notches. }\WY\par
  487. \fi % End of module 27
  488. \WM28. The current indentation is called \WCD{ $\.{\\ind}{}$}.  We also
  489. sometimes need to save
  490. and restore that.
  491. \WY $\WP \.{\\newcount\\ind\2}{}$\5
  492. \WC{ Current indentation in notches. }\6
  493. ${}\.{\\newcount\\lastind\2}{}$\5
  494. \WC{ Used for preprocessor commands. }\6
  495. ${}\.{\\def\\saveind\{\\global\\lastind=\\ind\}}{}$\WY\par
  496. \fi % End of module 28
  497. \WM29. Each output line of code is a separate paragraph.  The scheme proceeds
  498. first setting \WCD{ $\.{\\ind}{}$}~to the appropriate hanging indentation, then
  499. backspacing appropriately.  Here are the backspace quantities.
  500. \WY $\WP \.{\\newbox\\bak\2\2\\setbox\\bak=\\hbox\2to\ -\\notch\{\}}{}$\5
  501. \WC{ Backspace one notch. }\6
  502. ${}\.{\\newbox\\bakk\2\\setbox\\bakk=\\hbox\2to\ -2\\notch\{\}}{}$\5
  503. \WC{ Backspace two notches. }\WY\par
  504. \fi % End of module 29
  505. \WM30. When there's the possibility that a line of code may be continued, we
  506. advance the indentation and set \WCD{ $\.{\\hangindent}{}$}.
  507. \WY $\WP \.{\\def\\1\{\\global\\advance\\ind\2by1\\hangindent\\ind\\notch\}}{}$%
  508. \WC{ Indent one more notch }\WY\par
  509. \fi % End of module 30
  510. \WM31. Here we cancel the above.  We don't need to reset \WCD{ $\.{%
  511. \\hangindent}{}$} because
  512. this will always be followed by a~\WCD{ $\.{\\6}{}$} or~\WCD{ $\.{\\7}{}$},
  513. which already does that.
  514. \WY $\WP \.{\\def\\2\{\\global\\advance\\ind\2by-1\{\}\}}{}$\5
  515. \WC{ Indent one less notch }\WY\par
  516. \fi % End of module 31
  517. \WM32. Now we provide for an optional break within a statement.  (Note that the
  518. argument is multiplied by~10.)
  519. \WY $\WP \.{\\def\\3\#1\{\\hfil\\penalty\#10\\hfilneg\}}{}$\5
  520. \WC{ Optional break within a statement. }\WY\par
  521. \fi % End of module 32
  522. \WM33. A simple command to backspace one notch.
  523. \WY $\WP \.{\\def\\4\{\\copy\\bak\}}{}$\5
  524. \WC{ Backspace one notch }\WY\par
  525. \fi % End of module 33
  526. \WM34. Optional break (the \WCD{ $\.{\\yskipfalse}{}$} may be obsolete).
  527. \WY $\WP \.{\\def\\5\{\\hfil\\penalty-1\\hfilneg\2\\kern2.5\\notch\\copy%
  528. \\bakk}$\6
  529. ${}\.{\3\\yskipfalse\\ignorespaces\}}{}$\WY\par
  530. \fi % End of module 34
  531. \WM35. The next command forces a line break.
  532. \WY $\WP \.{\\def\\6\{\\ifmmode\\else\\par}$\6
  533. ${}\.{\3\\hangindent\\ind\\notch\2\\noindent\2\\kern\\ind\\notch\2\\copy\\bakk%
  534. \2\\ignorespaces\\fi\}}{}$\WY\par
  535. \fi % End of module 35
  536. \WM36. This also forces a line break, but also adds some extra vertical space.
  537. \WY $\WP \.{\\def\\7\{\\WY\\6\}}{}$\5
  538. \WC{ Forced break and a little extra space. }\WY\par
  539. \fi % End of module 36
  540. \WM37. No indentation.
  541. \WY $\WP \.{\\def\\8\{\\hskip-\\ind\\notch\2\\hskip\22\\notch\}}{}$\WY\par
  542. \fi % End of module 37
  543. \WM38.
  544. \WY $\WP \.{\\newif\\ifyskip}$\6
  545. ${}\.{\\def\\yskip\{\\medskip\}}{}$\WY\par
  546. \fi % End of module 38
  547. \WN39.  PREPROCESSOR COMMANDS.  The preprocessor commands are built out of the
  548. previous ones.
  549. First, we define a guaranteed space.
  550. \WY $\WP \.{\\def\\Hspace\{\\hbox\{\ \}\}}{}$\WY\par
  551. \fi % End of module 39
  552. \WM40. Start a preprocessor command such as \.{@\#if}.  When these are issued
  553. in the
  554. code section (rather than in the definition section), we must remember the
  555. present level of indentation.  That's restored with~\WCD{ $\.{\\WPs}{}$}.
  556. \WY $\WP \.{\\def\\WPR\#1\{\\copy\\bakk\2\\saveind}{}$\5
  557. \WC{\quad\WCD{ $\.{\\global\\advance\\ind\2by\ 2}{}$} }\6
  558. ${}\.{\3\\1\\Wreserved\{@\#1\}\\Hspace\}}{}$\7
  559. ${}\.{\\def\\WPs\{\\global\\ind=\\lastind\}}{}$\WY\par
  560. \fi % End of module 40
  561. \WM41. The definition commands such as~\.{@m} are similar, except that they
  562. also take a language argument.
  563. \WY $\WP \.{\\def\\defin\#1\#2\{\\4\\saveind}$ $\.{\3\\1\\Wreserved\{\#1\}%
  564. \\hbox\{\$\^\{\\rm\#2\}\$\}\\Hspace\}}{}$\5
  565. \WC{ Begin @d, @m, or @f. }\WY\par
  566. \fi % End of module 41
  567. \WN42.  Various NUCLEII.
  568. \WY $\WP \.{\\def\\note\#1\#2.\{\\WY\\noindent\{\\hangindent2em%
  569. \\baselineskip10pt\\eightrm\#1\ \#2.\\par\}\}}{}$\7
  570. ${}\.{\\def\\lapstar\{\\rlap\{\ast \}\}}{}$\7
  571. \WC{ If there's a current include file, it's printed at the start of each
  572. section. }\6
  573. ${}\.{\\def\\includefile\{\}}$\6
  574. ${}\.{\\def\\WIF\#1\{\\def\\includefile\{\#1\}\}}$\6
  575. ${}\.{\\def\\startsection\{\\WQ\\noindent\{\\let\\\ast =\\lapstar\\bf%
  576. \\modstar.}{}$\5
  577. \Wx{ }\6
  578. ${}\.{\\ifx\\includefile\\empty\\else\\\ [\{\\tt\\includefile\}]\\fi\\quad\}%
  579. \}}{}$\WY\par
  580. \fi % End of module 42
  581. \WN43.  ALPHABET macros.  These are hard-coded into \FWEAVE.
  582. \fi % End of module 43
  583. \WN44. 1 Comments. Comments are C-style.  The long comment construction `\WCD{
  584. $\.{/\ast \ ...}$ $\.{\ast /}{}$}' is output as `\WCD{ $\.{\\WC\{\ ...\ %
  585. \}}{}$}'; the short comment is output as `\WCD{ $\.{\\Wc\{\ ...}$ $\.{\}}{}$}'.
  586. The \WCD{ $\.{\\WC}{}$} and~\WCD{ $\.{\\Wc}{}$} macros aren't simply defined
  587. with an argument
  588. whose text would be the comment because one wants the comment to be a group
  589. and the user might be wanting to change catcodes inside that group; the
  590. argument form would absorb catcodes before they were changed.
  591. \WY $\WP \.{\\def\\skipbrace\#1\{\\catcode\`\\\{=1\ \}}{}$\7
  592. ${}\.{\\def\\WC\{\\Wcmnt\{\\ast\}\{\\finishcomment\}\}}$\6
  593. ${}\.{\\def\\Wc\{\\Wcmnt\{/\}\{\\XX\}\}}$\6
  594. ${}\.{\\def\\Wcmnt\#1\#2\{\\ifmmode\\gdef\\XX\{\\null\$\\null\}\\else\\gdef\\XX%
  595. \{\}\\fi}{}$\5
  596. \WC{ C-style cmnt }\6
  597. ${}\.{\3\\XX\\hfil\\penalty-1\\hfilneg}$\6
  598. ${}\.{\3\\ifyskip\\else\\quad\\fi\$/\#1\\\1\$}{}$\5
  599. \Wx{ }\6
  600. ${}\.{\3\\bgroup\\cmntfont\2}{}$\5
  601. \WC{ The user can redefine the comment font \WCD{ $\.{\\cmntfont}{}$}. }\6
  602. ${}\.{\3\3\\aftergroup\#2}{}$\5
  603. \Wx{ }\6
  604. ${}\.{\3\3\\catcode\`\\\{=\\other\\skipbrace\}}{}$\7
  605. ${}\.{\\def\\finishcomment\{\$\\\1\\ast/\$\\XX\}}{}$\7
  606. ${}\.{\\def\\Wx\#1\{\\kern-0.5\\notch\\hbox\{\\tt\\\%\}\}}{}$\WY\par
  607. \fi % End of module 44
  608. \WM45. Compiler directives are essentially comments, but are formatted more
  609. preprocessor commands.
  610. \WY $\WP \.{\\def\\WCDIR\#1\{\\WPR!\\Wtypewriter\{\#1\}\\WPs\}}{}$\WY\par
  611. \fi % End of module 45
  612. \WN46. 1 Code mode.  Code mode is entered by vertical bars, giving an effect
  613. such as \WCD{ $\|x=\|y{}$}.
  614. \WY $\WP \.{\\def\\WCD\#1\{\\ifmmode\\hbox\\fi\{\\ignorespaces\#1\}\}}{}$\WY\par
  615. \fi % End of module 46
  616. \WN47. 1 Definitions. Various definition section stuff.
  617. \WY $\WP \.{\\def\\WD:\#1:\{\\defin\{@D\}\{\#1\}\}}{}$\5
  618. \WC{ Outer macro definition: `\.{@D}' }\6
  619. ${}\.{\\def\\Wd:\#1:\{\\defin\{@d\}\{\#1\}\}}{}$\5
  620. \WC{ Outer macro definition: `\.{@d}' }\6
  621. ${}\.{\\def\\WUd:\#1:\{\\defin\{@u\}\{\#1\}\}}{}$\5
  622. \WC{ Undef outer macro: `\.{@u}'. }\6
  623. ${}\.{\\def\\WMD\{\\defin\{@M\}\{\}\}}{}$\5
  624. \WC{ WEB macro definition: `\.{@M}'. }\6
  625. ${}\.{\\def\\WMd\{\\defin\{@m\}\{\}\}}{}$\5
  626. \WC{ WEB macro definition: `\.{@m}'. }\6
  627. ${}\.{\\def\\WE:\#1:\{\\WPR\{\\\#\#1\}\}}{}$\5
  628. \WC{ WEB preprocessor command: `\.{@\#if\dots}'. }\7
  629. ${}\.{\\def\\WF:\#1:\{\\defin\{@f\}\{\#1\}\}}{}$\5
  630. \WC{ Format definition: `\.{@f}'. }\7
  631. ${}\.{\\def\\Wl:\#1:\{\\defin\{@l\}\{\#1\}\}}{}$\5
  632. \WC{ Limbo text definition: `\.{@l}'. }\6
  633. ${}\.{\\def\\Wv:\#1:\{\\defin\{@v\}\{\#1\}\}}{}$\5
  634. \WC{ Operator overloading: `\.{@v}'. }\6
  635. ${}\.{\\def\\WWW:\#1:\{\\defin\{@W\}\{\#1\}\}}{}$\5
  636. \WC{ Identifier overloading:  `\.{@W}'. }\6
  637. ${}\.{\\def\\Ww:\#1:\{\\defin\{@w\}\{\#1\}\}}{}$\5
  638. \WC{ Identifier overloading:  `\.{@w}'. }\WY\par
  639. \fi % End of module 47
  640. \WN48. 1 Sections. Beginning of ordinary section (begun with~`\.{@\ }').
  641. \WY $\WP \.{\\outer\\def\\WM\#1.\{\\MN\#1.\\Wmark\\ifon\\Wskip\\startsection%
  642. \\ignorespaces\}}{}$\WY\par
  643. \fi % End of module 48
  644. \WM49. Beginning of starred section (begun with~`\.{@*}').  Starred sections
  645. have associated level numbers, where 0~denotes the most significant level,
  646. 1~denotes a subsection, 2~denotes a subsubsection, and so on.  You can
  647. indicate the level number in several ways.  By default, you can say
  648. ``\.{@*3\ Section name.}'' or equivalently ``\.{@*...\ Section name.}''
  649. to set the level number to~3.  Alternatively, if you replace the line below
  650. ``\.{\\dotsafterfalse}'' with ``\.{\\dotsaftertrue}'', you can instead say
  651. ``\.{@*\ Section name....}'' By default, major sections get a page break;
  652. subsections don't.  Sections and subsections can be formatted in different
  653. ways in the table of contents by enhancing the definition of~\WCD{ $\.{%
  654. \\WZ}{}$}
  655. (inside~\WCD{ $\.{\\Wcon}{}$}) to include an \WCD{ $\.{\\ifcase}{}$}
  656. construction.  (See how this is
  657. done in \WCD{ $\.{fwebman.tex}{}$}.)
  658. \WY $\WP \.{\\newcount\\Wss\2}{}$\5
  659. \WC{ Counter for the dots. }\7
  660. ${}\.{\\newif\\ifdotsafter\2}{}$\5
  661. \WC{ Do subsection dots come after or before the section name? }\6
  662. ${}\.{\\dotsafterfalse}{}$\7
  663. ${}\.{\\ifdotsafter\2}{}$\5
  664. \WC{ ``@* NAME...'' }\6
  665. ${}\.{\3\\def\\Wbefore:\#1.\{\\Wdefname\#1.\\Wdot\}}{}$\5
  666. \Wx{ }\6
  667. ${}\.{\3\\def\\Wafter\{\\WNss\}}{}$\5
  668. \Wx{ }\6
  669. ${}\.{\\else\2}{}$\5
  670. \WC{ ``@*.. NAME.'' or ``@*2 NAME.'' }\6
  671. ${}\.{\3\\def\\Wbefore:\ \#1\{\\def\\next\{\\Wafter\#1\}}{}$\5
  672. \WC{ Case for neither dot nor number. }\6
  673. ${}\.{\3\3\\ifx\#1.\\def\\next\{\\Wdot.\}}{}$\5
  674. \WC{ Count arbitrary dots. }\6
  675. ${}\.{\3\3\\else\\ifx\#11\\Wsectionnum1}{}$\5
  676. \Wx{ }\6
  677. ${}\.{\3\3\\else\\ifx\#12\\Wsectionnum2}{}$\5
  678. \Wx{ }\6
  679. ${}\.{\3\3\\else\\ifx\#13\\Wsectionnum3}{}$\5
  680. \Wx{ }\6
  681. ${}\.{\3\3\\else\\ifx\#14\\Wsectionnum4}{}$\5
  682. \WC{ Highest numerical level allowed. }\6
  683. ${}\.{\3\3\\fi\\fi\\fi\\fi\\fi}$\6
  684. ${}\.{\3\3\\next\}}{}$\5
  685. \Wx{ }\6
  686. ${}\.{\3\\def\\Wafter\#1.\{\\Wdefname\#1.\\WNss\}}{}$\5
  687. \WC{ Executed after figuring out level. }\6
  688. ${}\.{\\fi}{}$\7
  689. $\.{\\def\\Wsectionnum\#1\{\\Wss\#1\\let\\next\\Wafter\}}{}$\5
  690. \WC{ Assign numerical section number. }\6
  691. ${}\.{\\def\\Wdefname\#1.\{\\def\\Wname\{\#1\}\}}{}$\5
  692. \WC{ Remember name of section. }\7
  693. ${}\.{\\outer\\def\\WN\#1.\{\\MN\#1.\\Wss=0\\Wbefore:\}}{}$\5
  694. \WC{ Begin a starred section. }\WY\par
  695. \fi % End of module 49
  696. \WM50. Here we count the periods before or after the section name.
  697. \WY $\WP \.{\\def\\Wdot\{\\futurelet\\next\\WNs\}}$\6
  698. ${}\.{\\def\\WNs\{\\ifx\\next.\\advance\\Wss\2by\ 1\\let\\next\\Wnext\\else%
  699. \\let\\next\\Wafter\\fi}$\6
  700. ${}\.{\3\\next\}}$\6
  701. ${}\.{\\def\\Wnext\#1\{\\Wdot\}}{}$\WY\par
  702. \fi % End of module 50
  703. \WM51. Now actually begin the section.  Note the use of~\WCD{ $\.{\\ifcase}{}$}
  704. conditionally format the sections and subsections.  Also, the construction
  705. \WCD{ $\.{\\ifon...\\fi}{}$} brackets the section to conditionally suppress
  706. printing.
  707. Finally, we make an entry in the table of contents for all starred names.
  708. The first argument of the \.{\\WZ}~macro is the level number for this
  709. section.  This can be used to format the table of contents in various ways.
  710. The order of expansion is an issue in the~\WCD{ $\.{\\write}{}$} to the table
  711. of contents
  712. file~\WCD{ $\.{\\cont}{}$}.  We want the macro~\WCD{ $\.{\\WZ}{}$} to be sent
  713. unexpanded, so we
  714. \WCD{ $\.{\\let}{}$}~it equal to a primitive.  Also, it's possible that a~\WCD{
  715. $\.{\\WIN}{}$} will
  716. appear inside of~\WCD{ $\.{\\Wname}{}$} (if the user included certain kind of
  717. code inside
  718. the section name).  This shouldn't be expanded until later, so we turn that
  719. into the temporarily unexpandable macro~\WCD{ $\.{\\WIM}{}$}.
  720. \WY\WP \5
  721. \WC{ Page break for major sections. }\6
  722. $\.{\\def\\Wsectionbreak\{\\ifcase\\Wss\\vfil\\eject\\fi\}}{}$\7
  723. \WC{ Running headline. }\6
  724. ${}\.{\\def\\rhead\{\\ifcase\\Wss}$\6
  725. ${}\.{\3\3\\uppercase\{\\ignorespaces\\Wname\}}{}$\5
  726. \Wx{ }\6
  727. ${}\.{\3\\else}$\6
  728. ${}\.{\3\3\\ignorespaces\\Wname}{}$\5
  729. \Wx{ }\6
  730. ${}\.{\3\\fi\}}{}$\5
  731. \WC{ Define running headline. }\7
  732. ${}\.{\\let\\WZ\\let\2}{}$\5
  733. \WC{ Now you can \WCD{ $\.{\\send}{}$} the control sequence \WCD{ $\.{\\WZ}{}$}
  734. ${}\.{\\let\\WIM\\let\2}{}$\5
  735. \WC{ This macro is made temporarily unexpandable; see \WCD{ $\.{\\WZ}{}$}. }\7
  736. ${}\.{\\def\\WNss\{}{}$\5
  737. \Wx{ }\6
  738. ${}\.{\3\\Wmark\2}{}$\5
  739. \WC{ Can't put this in \WCD{ $\.{\\MN}{}$} since \WCD{ $\.{\\rhead}{}$} must be
  740. defined first. }\6
  741. ${}\.{\3\\Wsectionbreak\2}{}$\5
  742. \WC{ Typeset the break between sections. }\6
  743. ${}\.{\3\\message\{\ast \\modno\}}{}$\5
  744. \WC{ Progress report to the terminal. }\6
  745. ${}\.{\3\\ifon}$\6
  746. ${}\.{\3\3\\ifcase\\Wss\\else\\Wskip\\fi}$\6
  747. ${}\.{\3\3\\startsection\{\\bf\\ignorespaces\\Wname.\\quad\}}{}$\5
  748. \Wx{ }\6
  749. ${}\.{\3\3\{\\def\\WIN\{\\WIM\}}{}$\5
  750. \Wx{ }\6
  751. ${}\.{\3\3\\edef\\next\{\\write\\cont\{\\WZ\{\\the\\Wss\}\{\\Wname\}}{}$\5
  752. \Wx{ }\6
  753. ${}\.{\3\3\{\\modno\}\{\\noexpand\\the\\pageno\}\}\}\\next\}}{}$\5
  754. \WC{  To contents file \WCD{ $\.{CONTENTS.tex}{}$}. }\6
  755. ${}\.{\3\3\\ignorespaces\}}{}$\WY\par
  756. \fi % End of module 51
  757. \WM52. The marks that we emit just before \WCD{ $\.{\\Wsectionbreak}{}$} are of
  758. the form
  759. ``{\it modno}\WCD{ $\.{\\else}{}$}{\it section name}''.  We use both of the
  760. parts in the
  761. page headers.  In handling the section name, we must take care to avoid
  762. expanding the macro~\WCD{ $\.{\\WIN}{}$} prematurely.  This is done just as in~%
  763. \WCD{ $\.{\\WNss}{}$} above.
  764. \WY $\WP \.{\\def\\WmarkN\{\\def\\Wmark\{\{\\def\\WIN\{\\WIM\}}$\6
  765. ${}\.{\3\3\\mark\{\\modno\\noexpand\\else\\rhead\}\}\}\}}{}$\7
  766. ${}\.{\\ifx\\selectfont\\undefined}$\6
  767. ${}\.{\3\\WmarkN}$\6
  768. ${}\.{\\else}$\6
  769. ${}\.{\3\\def\\Wmark\{\{\\def\\WIN\{\\WIM\}\\let\\protect\\noexpand}$\6
  770. ${}\.{\3\3\\mark\{\\modno\\noexpand\\else\\rhead\}\}\}}$\6
  771. ${}\.{\\fi}{}$\7
  772. ${}\.{\\def\\Wmodno\{\\iftrue\\topmark\\fi\}}{}$\5
  773. \WC{ Extracts the left-hand part of the mark. }\7
  774. ${}\.{\\def\\Whead\{\{\\let\\WIM\\WIN}$ $\.{\3\\expandafter\\iffalse\\topmark%
  775. \\fi\}\}}{}$\5
  776. \WC{ Extracts the right-hand part. }\WY\par
  777. \fi % End of module 52
  778. \WM53. Common code for \WCD{ $\.{\\WM}{}$}, \WCD{ $\.{\\WN}{}$}.
  779. \WY $\WP \.{\\catcode\`\\@=11}{}$\7
  780. ${}\.{\\def\\MN\#1.\{\\par}$\6
  781. ${}\.{\3\\parskip=\\pardimen\2}{}$\5
  782. \WC{ Reset to \TeX\ spacing }\6
  783. ${}\.{\3\\parindent=\\TeXindent}$\6
  784. ${}\.{\3\{\\xdef\\modstar\{\#1\}\\let\\\ast =\\empty\\xdef\\modno\{\#1\}\}}$\6
  785. ${}\.{\3\\ifLaTeXisloaded}$\6
  786. ${}\.{\3\3\\xdef\\@currentlabel\{\\modno\}}{}$\5
  787. \Wx{ }\6
  788. ${}\.{\3\\fi}$\6
  789. ${}\.{\3\\ifx\\modno\\modstar\2\\onmaybe\2\\else\\ontrue\2\\fi\}}{}$\7
  790. ${}\.{\\catcode\`\\@=12}{}$\WY\par
  791. \fi % End of module 53
  792. \WN54. 1 Constants.  Various kinds of constants are handled:  decimal~(\WCD{ $%
  793. \WO{10}{}$}),
  794. hexadecimal~(\WCD{ $\WO{\`A}{}$}), octal~(\WCD{ $\WO{\~12}{}$}), boolean~(\WCD{
  795. $\WO{\&1010}{}$}),
  796. floating-point (\WCD{ $\WO{1.5\^E-35}{}$}), double-precision (\WCD{ $\WO{3.2%
  797. \^D100}{}$}),
  798. long (\WCD{ $\WO{99999\#1}{}$}), unsigned (\WCD{ $\WO{99999\#2}{}$}),
  799. unsigned long (\WCD{ $\WO{999999\#3}{}$}), and Hollerith (\WCD{ $\WO{3%
  800. \%abc}{}$}).
  801. \WY $\WP \.{\\def\\WDP\#1\{\\ifx\2E\#1\\else\{\\tt\#1\}\\fi\}}{}$\5
  802. \WC{ Used in the exponent macro below. }\7
  803. ${}\.{\\def\\WO\#1\{}{}$\5
  804. \Wx{ }\6
  805. ${}\.{\3\{}{}$\5
  806. \WC{ Make the next definitions local. }\6
  807. ${}\.{\3\\let\\-\\\_}{}$\5
  808. \Wx{ }\6
  809. ${}\.{\3\\let\\d\\\$}{}$\5
  810. \Wx{ }\6
  811. ${}\.{\3\\def\\\\\{\\let\\\_\\-\\let\\\$\\d\}}{}$\5
  812. \Wx{ }\6
  813. ${}\.{\3\\def\\?\{\\kern.2em\}}{}$\5
  814. \Wx{ }\6
  815. ${}\.{\3\\def\\\#\#\#1\{\\kern0.1em\{\\tt\2\\ifcase\#\#1F\\or\2L\\or\2U\\or\2UL%
  816. \\else?\\fi\}\}}{}$\5
  817. \WC{C~constant. }\6
  818. ${}\.{\3\\def\\\^\#\#1\{\\cdot\210\^\{\\aftergroup\}\\aftergroup\\WDP%
  819. \\aftergroup\#\#1\}}{}$\5
  820. \WC{ Power of ten }\6
  821. ${}\.{\3\\def\\\_\{\_\{\\\\\\rm\\aftergroup\}\}}{}$\5
  822. \WC{ Fortran-90 kind parameter. }\6
  823. ${}\.{\3\\def\\\%\{\{\\rm\2H\}\\hbox\{\\aftergroup\}\\Wtypewriter\{\\aftergroup%
  824. \}\}}{}$\5
  825. \WC{ Hollerith constant }\6
  826. ${}\.{\3\\def\\\&\{0\{\\tt\2b\}\}}{}$\5
  827. \WC{ Binary constant. }\6
  828. ${}\.{\3\\def\\\~\{\\hbox\{\\rm\\char'23\\kern-.2em\\it\\aftergroup\\?%
  829. \\aftergroup\}\}}{}$\5
  830. \WC{ Octal }\6
  831. ${}\.{\3\\def\\\`\{\\hbox\{\\rm\\char"7D\\tt\\aftergroup\}\}\#1\}\}}{}$\5
  832. \WC{ Double quotes for hex constant }\WY\par
  833. \fi % End of module 54
  834. \WN55. 1 Code mode.  Either begin the code section, or a preprocessor or
  835. definition command.
  836. The following command sets up~\WCD{ $\.{\\ind}{}$}.  This somewhat peculiar
  837. construction
  838. is for historical reasons.
  839. \WY $\WP \.{\\def\\WPr\{\\global\\ind=\\globalindent\2\\1\}}{}$\WY\par
  840. \fi % End of module 55
  841. \WM56. Now enter code mode.  Note that \WCD{ $\.{\\leavevmode}{}$} starts a new
  842. indented
  843. paragraph; we then move in one more notch.
  844. \WY $\WP \.{\\def\\WP\{\\parskip=0pt\ \\parindent=\\notch}$\6
  845. ${}\.{\3\\rightskip=0pt\ plus\ 100pt\ minus\ 10pt}$\6
  846. ${}\.{\3\\sfcode\`;=3000}$\6
  847. ${}\.{\3\\pretolerance\210000}{}$\6
  848. \WE:if:$\WO{0}$\WPs\6
  849. ${}\.{\3\\hyphenpenalty\210000\ \\exhyphenpenalty\210000\ }{}$\5
  850. \WC{ If you turn these on, the  discretionary breaks in strings won't work! }\6
  851. ${}\.{\3\\global\\ind=\\globalindent\2\\1\\\ \\unskip\}}{}$\6
  852. \WE:endif:\WPs\6
  853. ${}\.{\3\\WPr}$\6
  854. ${}\.{\3\\leavevmode\\kern\\notch\}}{}$\WY\par
  855. \fi % End of module 56
  856. \WM57. Here we leave code mode:
  857. \WY $\WP \.{\\def\\WQ\{\\rightskip=0pt}$\6
  858. ${}\.{\3\\sfcode\`;=1500\ \\pretolerance\2200\ \\hyphenpenalty\250\ %
  859. \\exhyphenpenalty\250\ \}}{}$\WY\par
  860. \fi % End of module 57
  861. \WN58. 1 Miscellaneous operators.
  862. \WY $\WP \.{\\def\\WA\{\\note\{See\ also\}\}}{}$\5
  863. \WC{ Cross-reference for multiply defined section names. }\7
  864. ${}\.{\\def\\Wauto[\#1]\{\\Wtypewriter\{[\#1]\}\\\ \}}{}$\7
  865. ${}\.{\\def\\WB\{\\mathopen\{\\Wtypewriter\{@/\\ast\}\}\}}{}$\5
  866. \WC{ Begin controlled comment. }\7
  867. ${}\.{\\let\\WG\\ge\2}{}$\5
  868. \WC{ Greater than or equal sign: '$\WG$'. }\7
  869. ${}\.{\\let\\WI\\neq\2}{}$\5
  870. \WC{ Unequal sign: '$\WI$'.  (Better reserve \WCD{ $\.{\\ne}{}$} for the
  871. electron density~$n_e$.) }\7
  872. ${}\.{\\def\\WJ\{\\Wtypewriter\{@\\\&\}\}}{}$\5
  873. \WC{ TANGLE's join operation: '\WJ'. }\7
  874. ${}\.{\\let\\WK\\gets\2}{}$\5
  875. \WC{ Left arrow: '$\WK$'. }\7
  876. ${}\.{\\let\\WL\\le\2}{}$\5
  877. \WC{ Less than or equal sign: '$\WL$'. }\7
  878. ${}\.{\\def\\Wskip\{\\vfil\\penalty-100\\vfilneg\2\\vskip12ptminus3pt\}}{}$\5
  879. \WC{ See \WCD{ $\.{\\WM}{}$}, etc. }\7
  880. ${}\.{\\def\\Wskipped\#1\{\\8\\mathhexbox278.\\quad\\Wtypewriter\{@I\ "\#1"\}%
  881. \\\ \\\ \{\\it\2Section(s)}$\6
  882. ${}\.{skipped\}\\dots\\WP\}}{}$\7
  883. $\.{\\let\\WPtr\\Rightarrow\2}{}$\5
  884. \WC{ Fortran's stupid pointer assignment statement:  '$\WPtr$'. }\7
  885. ${}\.{\\let\\WR=\\lnot\2}{}$\5
  886. \WC{ Logical not: '$\WR$'. }\7
  887. ${}\.{\\let\\WS=\\equiv\2}{}$\5
  888. \WC{ Equivalence sign: '$\WS$'. }\7
  889. ${}\.{\\def\\WT\{\\mathclose\{\\Wtypewriter\{@\\ast/\}\}\}}{}$\5
  890. \WC{ Terminate controlled comment. }\7
  891. ${}\.{\\def\\WU\{\\note\{This\ code\ is\ used\ in\}\}}{}$\5
  892. \WC{ Cross-reference for uses of sections. }\7
  893. ${}\.{\\let\\WV\\lor\2}{}$\5
  894. \WC{ Logical or: '$\WV$'. }\7
  895. ${}\.{\\let\\WW=\\land\2}{}$\5
  896. \WC{ Logical and: '$\WW$'. }\WY\par
  897. \fi % End of module 58
  898. \WM59. Here's how to format a section name. Argument~1 is the name, argument~2
  899. is the section number, and argument~3 is the language symbol.
  900. \WY $\WP \.{\\def\\WX\#1:\#2\\X\#3\\X\{\\ifmmode\\gdef\\XX\{\\null\$\\null\}%
  901. \\else\\gdef\\XX\{\}\\fi}$\6
  902. ${}\.{\3\\XX\$\\langle\\\1\$\#2\{\\eightrm\\kern.5em\#1\}\$\\\1\\rangle\^\{\\rm%
  903. \2\#3\}\$\\XX\}}{}$\WY\par
  904. \fi % End of module 59
  905. \WM60.
  906. \WY $\WP \.{\\def\\WY\{\\par\\parskip=0pt\\yskip\}}{}$\WY\par
  907. \fi % End of module 60
  908. \WN61.  VARIOUS OPERATORS.
  909. The following were for Pascal.
  910. \WY \WP\4\4\WX61:Unused\X \X${}\WS{}$\7
  911. $\.{\\def\\)\{\\hbox\{\\Wtypewriter\{@\\\$\}\}\}}{}$\5
  912. \WC{ sign for string pool check sum }\6
  913. ${}\.{\\def\\]\{\\hbox\{\\Wtypewriter\{@\\\\\}\}\}}{}$\5
  914. \WC{ sign for forced line break }\WY\par
  915. \fi % End of module 61
  916. \WM62.  For C's construciton `\WCD{ $\|x\?\WO{1}:\WO{0}{}$}'.
  917. \WY $\WP \.{\\def\\?\{\\mathrel?\}}{}$\WY\par
  918. \fi % End of module 62
  919. \WM63. Colons have several uses.
  920. \WY $\WP \.{\\def\\Colon\{\\ifmmode\\colon\\else:\\fi\}}{}$\7
  921. $\.{\\def\\CC\{\\mathord\{::\}\}}{}$\5
  922. \WC{ '$x\CC y$'. }\6
  923. ${}\.{\\def\\CF\{\{\}\\mathbin\{::\}\{\}\}}{}$\5
  924. \WC{ '$x\CF y$'. }\WY\par
  925. \fi % End of module 63
  926. \WM64. Verbatim strings are boxed for emphasis, like this:  \Wequals{This is a
  927. verbatim string.}
  928. \WY $\WP \.{\\def\\=\#1\{\\kern2pt\\hbox\{\\vrule\\vtop\{\\vbox\{\\hrule}$\6
  929. ${}\.{\3\\hbox\{\\strut\\kern2pt\\Wtypewriter\{\#1\}\\kern2pt\}\}}$\6
  930. ${}\.{\3\\hrule\}\\vrule\}\\kern2pt\}}{}$\7
  931. ${}\.{\\let\\Wequals\\=}{}$\WY\par
  932. \fi % End of module 64
  933. \WM65.
  934. \WY $\WP \.{\\let\\\~=\\ignorespaces}$\6
  935. ${}\.{\\let\\\ast =\ast }{}$\WY\par
  936. \fi % End of module 65
  937. \WM66. The following symbol is used to denote accretions to already-existing
  938. modules.
  939. \WY $\WP \.{\\def\\PQ\{\\mathrel\{+\\mathord\\equiv\}\}}{}$\5
  940. \WC{ '$\PQ$'. }\WY\par
  941. \fi % End of module 66
  942. \WM67.
  943. \WY $\WP \.{\\mathchardef\\TLD="0218}{}$\5
  944. \WC{ '$\TLD$'. }\7
  945. ${}\.{\\def\\PP\{\\mathord\{++\}\}}{}$\5
  946. \WC{ '$\PP$'. }\6
  947. ${}\.{\\def\\MM\{\\mathord\{--\}\}}{}$\5
  948. \WC{ '$\MM$'. }\7
  949. ${}\.{\\def\\MG\{\\mathord\{\\to\}\}}{}$\5
  950. \WC{ '$\MG$'. }\WY\par
  951. \fi % End of module 67
  952. \WM68. The exponentiation macros strip away outer parentheses from the
  953. argument,
  954. turning ``\WCD{ $\.{x\^(a+b)}{}$}'' into ``\WCD{ $\|x\EE{(\|a+\|b)}{}$}''.
  955. \WY $\WP \.{\\def\\LP\{(\}}{}$\5
  956. \WC{ Must be \WCD{ $\.{\\def}{}$}, not \WCD{ $\.{\\let}{}$}. }\6
  957. ${}\.{\\def\\ISL\#1\#2]\{\\def\\next\{\#1\}\}}$\6
  958. ${}\.{\\def\\EE\#1\{\\ISL\#1]\\ifx\\next\\LP\\EXP[\#1]\\else\\EXP[(\#1)]\\fi%
  959. \}}$\6
  960. ${}\.{\\def\\EXP[(\#1)]\{\^\{\#1\}\}}{}$\7
  961. \WE:if:$\WO{0}$\WPs\6
  962. $\.{\\def\\EE\{\\mathord\{\\hbox\{\\tt\\\^\}\}\}}{}$\5
  963. \WC{ Poor-man's exponentiation; above is better. }\6
  964. \WE:endif:\WPs\WY\par
  965. \fi % End of module 68
  966. \WM69.
  967. \WY $\WP \.{\\let\\SlSl\\parallel}{}$\5
  968. \WC{ Concatenation: '$\SlSl$'. }\WY\par
  969. \fi % End of module 69
  970. \WM70. For \Fortran--90's `\WCD{ $\LS\|a,\|b,\|c\SR{}$}'.
  971. \WY $\WP \.{\\def\\LS\{\\mathopen\{(\{/\}\}\}}$\6
  972. ${}\.{\\def\\SR\{\\mathclose\{\{/\})\}\}}{}$\WY\par
  973. \fi % End of module 70
  974. \WM71. Macro stuff:
  975. \WY $\WP \.{\\def\\NN\{\\hbox\{\\\#\\\#\}\}}{}$\5
  976. \WC{ '\NN'. }\6
  977. ${}\.{\\def\\NP\{\\hbox\{\\\#!\}\}}{}$\5
  978. \WC{ '\NP'. }\6
  979. ${}\.{\\def\\NC\{\\hbox\{\\\#:\}\}}{}$\5
  980. \WC{ '\NC'. }\6
  981. ${}\.{\\def\\ND\{\\hbox\{\\\#.\}\}}{}$\5
  982. \WC{ '\ND'. }\6
  983. ${}\.{\\def\\Nq\{\\hbox\{\\\#\\tt'\}\}}{}$\5
  984. \WC{ '\Nq'. }\6
  985. ${}\.{\\def\\NQ\{\\hbox\{\\\#\\tt"\}\}}{}$\5
  986. \WC{ '\NQ'. }\WY\par
  987. \fi % End of module 71
  988. \WM72. The standard \Fortran\ \.{.FALSE.} and \.{.TRUE.} operators.
  989. \WY $\WP \.{\\def\\FALSE\{\{\\cal\2F\}\}}{}$\5
  990. \WC{ '$\FALSE$'. }\6
  991. ${}\.{\\def\\TRUE\{\{\\cal\2T\}\}}{}$\5
  992. \WC{ '$\TRUE$'. }\WY\par
  993. \fi % End of module 72
  994. \WM73. Compound operators.  The following are for~C.
  995. \WY $\WP \.{\\def\\Wcp\{\\mathrel\{+\{=\}\}\}\ \\let\\PE\\Wcp\2}{}$\5
  996. \WC{ `$x\PE y$'. }\6
  997. ${}\.{\\def\\Wcm\{\\mathrel\{-\{=\}\}\}\ \\let\\ME\\Wcm\2}{}$\5
  998. \WC{ `$x\ME y$'. }\6
  999. ${}\.{\\def\\Wcs\{\\mathrel\{\\ast\{=\}\}\}\ \\let\\TE\\Wcs\2}{}$\5
  1000. \WC{ `$x\Wcs y$'. }\6
  1001. ${}\.{\\def\\Wcv\{\\mathrel\{/\{=\}\}\}\ \\let\\FE\\Wcv\2}{}$\5
  1002. \WC{ `$x\FE y$'. }\6
  1003. ${}\.{\\def\\Wcd\{\\mathrel\{\\\%\{=\}\}\}\ \\let\\CE\\Wcd\2}{}$\5
  1004. \WC{ `$x\Wcd y$'. }\6
  1005. ${}\.{\\def\\Wcx\{\\mathrel\{\\\^\\!\{=\}\}\}}{}$\5
  1006. \WC{ `$x\Wcx y$'. }\6
  1007. ${}\.{\\def\\Wca\{\\mathrel\{\\amp\{=\}\}\}}{}$\5
  1008. \WC{ `$x\Wca y$'. }\6
  1009. ${}\.{\\def\\Wco\{\\mathrel\{\\OR\{=\}\}\}}{}$\5
  1010. \WC{ `$x\Wco y$'. }\6
  1011. ${}\.{\\def\\Wcg\{\\mathrel\{\\GG\\!\{=\}\}\}}{}$\5
  1012. \WC{ `$x\Wcg y$'. }\6
  1013. ${}\.{\\def\\Wcl\{\\mathrel\{\\LL\\!\{=\}\}\}}{}$\5
  1014. \WC{ `$x\Wcl y$'. }\7
  1015. ${}\.{\\def\\EQV\{\\mathrel\{?\{=\}\}\}}{}$\5
  1016. \WC{ `$x\EQV y$'. }\6
  1017. ${}\.{\\def\\NEQV\{\\not\\equiv\}}{}$\5
  1018. \WC{ `$x\NEQV y$'. }\WY\par
  1019. \fi % End of module 73
  1020. \WM74. More C operators.
  1021. \WY $\WP \.{\\def\\MOD\{\\mathrel\{\\\%\}\}}{}$\5
  1022. \WC{ `$x\MOD y$'. }\6
  1023. ${}\.{\\def\\OR\{\{\\\1|\\\1\}\}}{}$\5
  1024. \WC{ `$x\OR y$'. }\6
  1025. ${}\.{\\def\\AND\{\{\\\1\\amp\\\1\}\}}{}$\5
  1026. \WC{ `$x\AND y$. }\7
  1027. ${}\.{\\def\\GG\{\\mathrel\{>\\!>\}\}}{}$\5
  1028. \WC{ `$x\GG y$'. }\6
  1029. ${}\.{\\def\\LL\{\\mathrel\{<\\!<\}\}}{}$\5
  1030. \WC{ `$x\LL y$'. }\7
  1031. ${}\.{\\def\\HE\{\\mathrel\{\\uparrow=\}\}}{}$\5
  1032. \WC{ `$x\HE y$'. }\WY\par
  1033. \fi % End of module 74
  1034. \WM75. We allow braces to be easily displayed outside of math mode.
  1035. \WY $\WP \.{\\let\\openbraces=\\\{}$\6
  1036. ${}\.{\\let\\closebraces=\\\}}$\6
  1037. ${}\.{\\def\\\{\{\\ifmmode\\openbraces\\else\$\\openbraces\$\\fi\}}$\6
  1038. ${}\.{\\def\\\}\{\\ifmmode\\closebraces\\else\$\\closebraces\$\\fi\}}{}$\WY\par
  1039. \fi % End of module 75
  1040. \WM76. Metacomments:
  1041. \WY $\WP \.{\\def\\WBM\{\\6\\8\\Wreserved\{@(\}\}}$\6
  1042. ${}\.{\\def\\WEM\{\\6\\8\\Wreserved\{@)\}\}}{}$\WY\par
  1043. \fi % End of module 76
  1044. \WM77. Block/loop numbers in \Fortran.  \It{Note:  You can't replace the
  1045. \WCD{ $\.{\\bgroup}{}$} and \WCD{ $\.{\\egroup}{}$} by braces because of
  1046. peculiarities of~\WCD{ $\.{\\Wc}{}$}.  Also,
  1047. if you put an explicit comment on a line that will be labelled by
  1048. \WCD{ $\.{\\Wblock}{}$}, with the following definition you'll get two comments
  1049. side by
  1050. side.  However, this could be modified by setting a counter to the block
  1051. number and making a fancier definition of~\WCD{ $\.{\\WC}{}$} and~\WCD{ $\.{%
  1052. \\Wc}{}$}.}
  1053. \WY $\WP \.{\\def\\Wblock\#1\{\\Wc\\bgroup\\\ Block\ \#1\\egroup\}}{}$\5
  1054. \WC{ `\Wblock{99}' }\WY\par
  1055. \fi % End of module 77
  1056. \WN78.  OVERLOADING OPERATORS.  Operator overloading is annoying because
  1057. several
  1058. languages may be in use simultaneously.  Therefore, when we define an
  1059. overloaded  macro name, we append to it the language symbol, creating
  1060. macros such as \WCD{ $\.{\\op\_C}{}$}.  These macros are typically defined
  1061. automatically
  1062. at the beginning of the output file from information contained in
  1063. \.{@v}~commands.
  1064. \WY $\WP \.{\\newif\\ifop}$\6
  1065. ${}\.{\\newbox\\dotbox}{}$\7
  1066. ${}\.{\\def\\Wunknown\#1\{\\=\{??\#1??\}\}}{}$\5
  1067. \WC{ For unknown dot constant. }\7
  1068. ${}\.{\{\\catcode\`\\\_=11}{}$\7
  1069. ${}\.{\\gdef\\newop\#1\#2\#3\{}{}$\5
  1070. \Wx{ }\6
  1071. ${}\.{\3\\edef\\next\{\\def\\expandafter\\noexpand\\csname\2\_\#1\_\#2%
  1072. \\endcsname\}}{}$\5
  1073. \Wx{ }\6
  1074. ${}\.{\3\\next\{\#3\}\}}{}$\7
  1075. ${}\.{\\gdef\\newbinop\#1\#2\#3\{}{}$\5
  1076. \Wx{ }\6
  1077. ${}\.{\3\\edef\\next\{\\def\\expandafter\\noexpand\\csname\2\_\#1\_\#2%
  1078. \\endcsname\}}{}$\5
  1079. \Wx{ }\6
  1080. ${}\.{\3\\next\{\\mathrel\{\#3\}\}\}}{}$\7
  1081. ${}\.{\\gdef\\newunop\#1\#2\#3\{}{}$\5
  1082. \Wx{ }\6
  1083. ${}\.{\3\\edef\\next\{\\def\\expandafter\\noexpand\\csname\2\_\#1\_\#2%
  1084. \\endcsname\}}{}$\5
  1085. \Wx{ }\6
  1086. ${}\.{\3\\next\{\\mathbin\{\#3\}\}\}}{}$\7
  1087. ${}\.{\\gdef\\Wop\#1\#2\{\\setbox\\dotbox\\hbox\{\\tt\2.\#1.\}}{}$\5
  1088. \Wx{ }\6
  1089. ${}\.{\3\\edef\\nxt\{\\expandafter\\noexpand\\csname\2\_\#1\_\#2\\endcsname%
  1090. \}}{}$\5
  1091. \Wx{ }\6
  1092. ${}\.{\3\\edef\\ifnxt\{\\noexpand\\ifx\\expandafter\\noexpand\\csname\2\_\#1\_%
  1093. \#2\\endcsname\}}{}$\5
  1094. \Wx{ }\6
  1095. ${}\.{\3\\ifnxt\\empty}$\6
  1096. ${}\.{\3\3\\def\\next\{\\box\\dotbox\}}{}$\5
  1097. \WC{ Macro not defined; just use \.{.NAME.}. }\6
  1098. ${}\.{\3\\else}$\6
  1099. ${}\.{\3\3\\def\\next\{\\futurelet\\nextchar\\Woq\}}{}$\5
  1100. \WC{ Be careful about \WCD{ $\.{\\EE}{}$}. }\6
  1101. ${}\.{\3\\fi}$\6
  1102. ${}\.{\3\\next\}}{}$\5
  1103. \Wx{ }\6
  1104. ${}\.{\}}{}$\7
  1105. ${}\.{\\global\\let\\Wb\\Wop}$\6
  1106. ${}\.{\\global\\let\\Wu\\Wop}{}$\7
  1107. ${}\.{\\let\\Lbrace\{}{}$\7
  1108. ${}\.{\\def\\Woq\{\\ifx\\nextchar\\Lbrace}$\6
  1109. ${}\.{\3\3\\let\\next\\nxt\2}{}$\5
  1110. \WC{ There's an argument coming up. }\6
  1111. ${}\.{\3\\else}$\6
  1112. ${}\.{\3\3\\ifop}$\6
  1113. ${}\.{\3\3\3\\def\\next\{\\nxt\{\}\\equiv\\box\\dotbox\}}{}$\5
  1114. \Wx{ }\6
  1115. ${}\.{\3\3\\else}$\6
  1116. ${}\.{\3\3\3\\let\\next\\nxt}$\6
  1117. ${}\.{\3\3\\fi}$\6
  1118. ${}\.{\3\\fi}$\6
  1119. ${}\.{\3\\opfalse}$\6
  1120. ${}\.{\3\\next\}}{}$\WY\par
  1121. \fi % End of module 78
  1122. \WM79. The following is for special handling of array indices.
  1123. \WY $\WP \.{\\newtoks\\WARRAYarga}$\6
  1124. ${}\.{\\newtoks\\WARRAYargb}{}$\7
  1125. ${}\.{\\def\\WXA\#1\{\\begingroup}{}$\5
  1126. \WC{ We don't want the identifiers to be in hboxes, because we want to get  %
  1127. \WCD{ $\.{\\scriptstyle}{}$} for subscripts.  (We should always be in math mode
  1128. here.) }\6
  1129. ${}\.{\3\\def\\Wshort\#\#1\{\#\#1\}}{}$\5
  1130. \Wx{ }\6
  1131. ${}\.{\3\\def\\Wid\#\#1\{\{\\it\2\#\#1\\/\\kern.05em\}\}}{}$\5
  1132. \Wx{ }\6
  1133. ${}\.{\3\\global\\WARRAYarga\{\#1\}}{}$\5
  1134. \Wx{ }\6
  1135. ${}\.{\3\\futurelet\\Wnext\\WARRAYm\}}{}$\7
  1136. ${}\.{\\def\\WARRAYm\{\\ifx\\Wnext\\WXA}$\6
  1137. ${}\.{\3\3\\global\\let\\Wnext\\WARRAYn}{}$\5
  1138. \WC{ Multiple indices in C:  a[i][j][k] }\6
  1139. ${}\.{\3\\else}$\6
  1140. ${}\.{\3\3\\global\\let\\Wnext\\relax}$\6
  1141. ${}\.{\3\3\\WARRAY\{\\the\\WARRAYarga\}}{}$\5
  1142. \WC{ Typeset the accumulated indices. }\6
  1143. ${}\.{\3\\fi}$\6
  1144. ${}\.{\3\\endgroup}$\6
  1145. ${}\.{\3\\Wnext\}}{}$\7
  1146. ${}\.{\\def\\WARRAYn\#1\#2\{\\WARRAYargb\{\#2\}}{}$\5
  1147. \Wx{ }\6
  1148. ${}\.{\3\\edef\\Wnext\{\\noexpand\\WXA\{\\the\\WARRAYarga\1\\the\\WARRAYargb\}%
  1149. \}}{}$\5
  1150. \WC{Concatenate }\6
  1151. ${}\.{\3\\Wnext\}}{}$\7
  1152. \WC{ Change the following definition to get indices printed in interesting
  1153. ways. }\6
  1154. $\.{\\def\\WARRAY\#1\{[\#1]\}}{}$\5
  1155. \WC{ Default definition. }\6
  1156. ${}\.{\\def\\WSUB\#1\{\_\{\\scriptstyle\#1\}\}}{}$\5
  1157. \WC{ E.g., subscript indices. }\WY\par
  1158. \fi % End of module 79
  1159. \WM80. Handle the \.{@o}~command.
  1160. \WY $\WP \.{\\def\\Wouto\#1\#2\{\\Wreserved\{@\#1\}\\Hspace\\Wtypewriter\{\#2\}%
  1161. \}}$\6
  1162. ${}\.{\\def\\Wout\#1\{\\Wouto\{o\}\{\#1\}\}}$\6
  1163. ${}\.{\\def\\WOut\#1\{\\Wouto\{O\}\{\#1\}\}}{}$\WY\par
  1164. \fi % End of module 80
  1165. \WN81.  TITLES.  Now we deal with the overall page format.
  1166. If you want to list only the modules that have changed,
  1167. together with the index, put the command `\WCD{ $\.{\\let\\maybe=%
  1168. \\iffalse}{}$}' in
  1169. the limbo section before the first module of your \.{WEB} file. It's
  1170. customary to make this the first change in your change file.
  1171. \WY $\WP \.{\\newif\\ifon}$\6
  1172. ${}\.{\\def\\onmaybe\{\\let\\ifon=\\maybe\}\ \\let\\maybe=\\iftrue}{}$\WY\par
  1173. \fi % End of module 81
  1174. \WM82. Some flags, and the number of the table of contents.
  1175. \WY $\WP \.{\\newif\\iftitle\2\\newif\\ifpagesaved}{}$\7
  1176. ${}\.{\\newcount\\contentspageno}{}$\WY\par
  1177. \fi % End of module 82
  1178. \WM83. Top line on left-hand pages:
  1179. \WY $\WP \.{\\def\\lheader\{\\mainfont\\the\\pageno\\eightrm\\qquad\\Whead%
  1180. \\hfill\\Wtitle\\qquad}$\6
  1181. ${}\.{\3\\ifnum\\pageno=\\contentspageno\\else}$\6
  1182. ${}\.{\3\3\\tensy\2x\\mainfont\\Wmodno}$\6
  1183. ${}\.{\3\\fi\}}{}$\WY\par
  1184. \fi % End of module 83
  1185. \WM84. Top line on right-hand pages:
  1186. \WY $\WP \.{\\def\\rheader\{\\ifnum\\pageno=\\contentspageno\\else}$\6
  1187. ${}\.{\3\3\\tensy\2x\\mainfont\\Wmodno}$\6
  1188. ${}\.{\3\\fi}$\6
  1189. ${}\.{\3\\eightrm\\qquad\\Wtitle\\hfill\\Whead}$\6
  1190. ${}\.{\3\\qquad\\mainfont\\the\\pageno\}}{}$\WY\par
  1191. \fi % End of module 84
  1192. \WM85. Here are the page dimensions (in inches).
  1193. \WY $\WP \.{\\def\\pagewidtho\{6.5\}}{}$\5
  1194. \WC{ The width of each page }\6
  1195. ${}\.{\\def\\pageheighto\{8.7\}}{}$\5
  1196. \WC{ The height of each page }\6
  1197. ${}\.{\\def\\fullpageheighto\{9\}}{}$\5
  1198. \WC{ Page height including headlines }\7
  1199. ${}\.{\\newdimen\\pagewidth\2\\pagewidth\\pagewidtho\2in}$\6
  1200. ${}\.{\\newdimen\\pageheight\2\\pageheight\\pageheighto\2in}$\6
  1201. ${}\.{\\newdimen\\fullpageheight\2\\fullpageheight\\fullpageheighto\2in}{}$\7
  1202. ${}\.{\\newdimen\\pageshift\2\\pageshift=0in}{}$\5
  1203. \WC{ Shift righthand pages wrt lefthand ones }\7
  1204. ${}\.{\\def\\magnify\#1\{\\mag=\#1}$\6
  1205. ${}\.{\3\\pagewidth\\pagewidtho\2truein}$\6
  1206. ${}\.{\3\\pageheight\\pageheighto\2truein}$\6
  1207. ${}\.{\3\\fullpageheight\\fullpageheighto\2truein}$\6
  1208. ${}\.{\3\\setpage\}}{}$\7
  1209. $\.{\\def\\setpage\{\\hsize\\pagewidth\2\\vsize\\pageheight\}}{}$\5
  1210. \WC{ Use after changing page size. }\WY\par
  1211. \fi % End of module 85
  1212. \WM86. The output routine is for plain \TeX.
  1213. \WY $\WP \.{\\def\\page\{\\box255\ \}}{}$\7
  1214. ${}\.{\\newif\\ifidenticalpageheads}{}$\7
  1215. ${}\.{\\def\\normaloutput\#1\#2\#3\{}$\6
  1216. ${}\.{\3\\ifodd\\pageno\\hoffset=\\pageshift\\fi}$\6
  1217. ${}\.{\3\\shipout\\vbox}$\6
  1218. ${}\.{\3\3\{}$\6
  1219. ${}\.{\3\3\\vbox\2to\\fullpageheight}$\6
  1220. ${}\.{\3\3\3\{}$\6
  1221. ${}\.{\3\3\3\\iftitle\\global\\titlefalse}$\6
  1222. ${}\.{\3\3\3\\else\2\\hbox\2to\\pagewidth}$\6
  1223. ${}\.{\3\3\3\3\{\\vbox\2to10pt\{\}}{}$\5
  1224. \Wx{ }\6
  1225. ${}\.{\3\3\3\3\\ifidenticalpageheads\#2\\else}$\6
  1226. ${}\.{\3\3\3\3\\ifodd\\pageno}$\6
  1227. ${}\.{\3\3\3\3\3\#3}{}$\5
  1228. \WC{ Pg nos alternate left \& right. }\6
  1229. ${}\.{\3\3\3\3\\else\#2\\fi}$\6
  1230. ${}\.{\3\3\3\3\\fi}$\6
  1231. ${}\.{\3\3\3\3\}}{}$\5
  1232. \WC{\quad }\6
  1233. ${}\.{\3\3\3\\fi}$\6
  1234. ${}\.{\3\3\3\\vfill\#1}{}$\5
  1235. \WC{ Parameter \WCD{ $\.{\#1}{}$} is the page itself. }\6
  1236. ${}\.{\3\3\3\}}$\6
  1237. ${}\.{\3\3\}}$\6
  1238. ${}\.{\3\\global\\advance\\pageno\2by1\}}{}$\7
  1239. ${}\.{\\def\\Wname\{\{\\tt\2FWEB\}\ OUTPUT\}}{}$\5
  1240. \WC{ This section name is reset by starred sections. }\7
  1241. \WC{ An OPTIONAL TITLE can be defined by the user in his limbo section. }\6
  1242. ${}\.{\\def\\Wtitle\{\}}{}$\WY\par
  1243. \fi % End of module 86
  1244. \WM87. Here we provide a storage place for \WCD{ $\.{\\output}{}$}. If you
  1245. include a macro
  1246. package, such as \.{manmac}, that overrides the definition of \WCD{ $\.{%
  1247. \\output}{}$}
  1248. \It{after} \.{fwebmac.sty},  you can get back the \.{fwebmac.sty} definition by
  1249. saying
  1250.         \WCD{ $\.{\\input\2manmac}{}$}
  1251.         \WCD{ $\.{\\output\\Woutput}{}$}
  1252. \WY $\WP \.{\\newtoks\\Woutput}$ $\.{\\Woutput\\output}{}$\5
  1253. \WC{ Remember FWEB's definition. }\WY\par
  1254. \fi % End of module 87
  1255. \WM88. It's very useful to know exactly when you made the run.
  1256. \WY $\WP \.{\\newcount\\minutes}$\6
  1257. ${}\.{\\newcount\\hours}{}$\7
  1258. ${}\.{\\hours=\\time}$\6
  1259. ${}\.{\\divide\\hours\2by\ 60}$\6
  1260. ${}\.{\\multiply\\hours\2by\ 60}$\6
  1261. ${}\.{\\minutes=\\time}$\6
  1262. ${}\.{\\advance\\minutes\2by\ -\\hours}$\6
  1263. ${}\.{\\divide\\hours\2by\ 60}{}$\7
  1264. ${}\.{\\def\\Time\{\\the\\hours:\\ifnum\\minutes<10\ 0\\fi\\the\\minutes\}}{}$\7
  1265. ${}\.{\\def\\Date\{\\ifcase\\month\\or}$\6
  1266. ${}\.{\3January\\or\2February\\or\2March\\or\2April\\or\2May\\or\2June\\or}$\6
  1267. ${}\.{\3July\\or\2August\\or\2September\\or\2October\\or\2November\\or%
  1268. \2December\\fi}$\6
  1269. ${}\.{\3\\space\\number\\day\1\ \\number\\year\}}{}$\WY\par
  1270. \fi % End of module 88
  1271. \WN89.  TABLE OF CONTENTS. An entry is made in the table of contents for each
  1272. starred section.  One can customize things with \WCD{ $\.{\\topofcontents}{}$}
  1273. \WCD{ $\.{botofcontents}{}$}.
  1274. \WY $\WP \.{\\def\\topofcontents\{\\centerline\{\\titlefont\\Wtitle\}}$ $\.{\ \
  1275. \\vfill\}\ }{}$\5
  1276. \WC{ This is the default. }\WY\par
  1277. \fi % End of module 89
  1278. \WM90. End the table of contents page:
  1279. \WY\WP \6
  1280. \WE:if:$\WO{0}$\WPs\6
  1281. $\.{\\def\\botofcontents\{\\vfill\}}{}$\5
  1282. \WC{ This makes the bottom of the contents page empty. }\6
  1283. \WE:endif:\WPs\7
  1284. ${}\.{\\def\\botofcontents\{\\vfill}{}$\6
  1285. \WE:if:$\WO{0}$\WPs\6
  1286. ${}\.{\3\\rightline\{My\ Name\}}{}$\5
  1287. \WC{ You can personalize your output here, for example. }\6
  1288. \WE:endif:\WPs\6
  1289. ${}\.{\3\\rightline\{\\Date\}}$\6
  1290. ${}\.{\3\\rightline\{\\Time\}\}}{}$\7
  1291. $\.{\\contentspageno=0}{}$\5
  1292. \WC{ Default page number for table of contents }\WY\par
  1293. \fi % End of module 90
  1294. \WM91. Here we actually open up the contents file, which is the argument to
  1295. \WCD{ $\.{\\Wbegin}{}$}.  The \WCD{ $\.{\\Wbegin}{}$} macro is issued
  1296. automatically just before the
  1297. stuff for the first module.
  1298. \WY $\WP \.{\\newwrite\\cont\2}{}$\5
  1299. \WC{ For the table of contents. }\7
  1300. ${}\.{\\def\\Wbegin[\#1]\#2\#3\#4\#5\#6\{\\edef\\contentsfile\{\#5\}}{}$\5
  1301. \Wx{ }\6
  1302. ${}\.{\3\\def\\readcontents\{\\input\\contentsfile\}}{}$\5
  1303. \Wx{ }\6
  1304. ${}\.{\3\\Wequate\#6}$\6
  1305. ${}\.{\3\\ifLaTeXisloaded}$\6
  1306. ${}\.{\3\3\\documentstyle[\#1]\{\#2\}}{}$\5
  1307. \Wx{ }\6
  1308. ${}\.{\3\3\\textwidth\\pagewidth}$\6
  1309. ${}\.{\3\3\\textheight\\pageheight}$\6
  1310. ${}\.{\3\3\\TeXindent\#3}$\6
  1311. ${}\.{\3\3\\begin\{document\}}$\6
  1312. ${}\.{\3\3\\pageno=2}$\6
  1313. ${}\.{\3\\else}$\6
  1314. ${}\.{\3\3\\TeXindent\#3}$\6
  1315. ${}\.{\3\\fi}$\6
  1316. ${}\.{\3\\notch\#4}$\6
  1317. ${}\.{\3\\output}$\6
  1318. ${}\.{\3\3\{\\setbox0=\\page}{}$\5
  1319. \WC{ The first page is garbage }\6
  1320. ${}\.{\3\3\\immediate\\openout\\cont=\\contentsfile}$\6
  1321. ${}\.{\3\3\\global\\output\{\\normaloutput\\page\\lheader\\rheader\}}{}$\5
  1322. \Wx{ }\6
  1323. ${}\.{\3\3\}}{}$\5
  1324. \WC{  Here we print out a garbage page, so that the first \WCD{ $\.{%
  1325. \\topmark}{}$} won't be null. }\6
  1326. ${}\.{\3\\setpage}$\6
  1327. ${}\.{\3\\vbox\2to\ \\vsize\{\}}$\6
  1328. ${}\.{\3\}}{}$\WY\par
  1329. \fi % End of module 91
  1330. \WM92.
  1331. \WY $\WP \.{\\def\\Wch\{\\note\{The\ following\ sections\ were\ changed\ by\
  1332. the\ change\ file:\}}$\6
  1333. ${}\.{\3\\let\\\ast =\\relax\}}{}$\WY\par
  1334. \fi % End of module 92
  1335. \WN93.  INDEX.  The index is written by default into \.{INDEX.tex}, but that
  1336. name can be overridden with the style-file entry \.{index.tex}.
  1337. Here we begin the index:
  1338. \WY $\WP \.{\\newbox\\Sbox\2}{}$\5
  1339. \WC{ Saved box preceding the index }\6
  1340. ${}\.{\\newbox\\Lbox\2}{}$\5
  1341. \WC{ Lefthand column in the index }\7
  1342. \WC{ The following macro is the style file entry \.{index.preamble}. }\6
  1343. ${}\.{\\def\\Winx\{\\par\\vskip6pt\ plus\ 1fil}$\6
  1344. ${}\.{\3\\write\\cont\{\}}{}$\5
  1345. \WC{ Ensure that the contents file isn't empty }\6
  1346. ${}\.{\3\\closeout\\cont\2}{}$\5
  1347. \WC{ The contents information has been fully gathered }\6
  1348. ${}\.{\3\\output\{\\ifpagesaved\\normaloutput\{\\box\\Sbox\}\\lheader\\rheader%
  1349. \\fi}$\6
  1350. ${}\.{\3\3\\global\\setbox\\Sbox=\\page\2\\global\\pagesavedtrue\}}$\6
  1351. ${}\.{\3\\pagesavedfalse\2\\eject\2}{}$\5
  1352. \WC{ Eject the page-so-far and predecessors }\6
  1353. ${}\.{\3\\setbox\\Sbox\\vbox\{\\unvbox\\Sbox\}}{}$\5
  1354. \WC{ Take it out of its box }\6
  1355. ${}\.{\3\\vsize=\\pageheight\2\\advance\\vsize\2by\ -\\ht\\Sbox\2}{}$\5
  1356. \WC{ The remaining height }\6
  1357. ${}\.{\3\\hsize=.5\\pagewidth\2\\advance\\hsize\2by\ -10pt}$\6
  1358. ${}\.{\3\3}{}$\5
  1359. \WC{ Column width for the index (20pt between cols) }\6
  1360. ${}\.{\3\\parfillskip\20pt\ plus\ .6\\hsize\2}{}$\5
  1361. \WC{ Try to avoid almost empty lines }\6
  1362. ${}\.{\3\\def\\lr\{L\}}{}$\5
  1363. \WC{ This tells whether the left or right column is next }\6
  1364. ${}\.{\3\\output\{\\if\2L\\lr\\global\\setbox\\Lbox=\\page\2\\gdef\\lr\{R\}}$\6
  1365. ${}\.{\3\3\\else\\normaloutput\{\\vbox\2to\\pageheight\{\\box\\Sbox\\vss}$\6
  1366. ${}\.{\3\3\\hbox\2to\\pagewidth\{\\box\\Lbox\\hfil\\page\}\}\}\\lheader%
  1367. \\rheader}$\6
  1368. ${}\.{\3\3\\global\\vsize\\pageheight\\gdef\\lr\{L\}\\global\\pagesavedfalse%
  1369. \\fi\}}{}$\5
  1370. \WC{  \message{Index:} }\6
  1371. ${}\.{\3\\parskip\20pt\ plus\ .5pt}$\6
  1372. ${}\.{\3\\outer\\def\\:\#\#1\1\ \{\\par\\hangindent2em\\noindent\#\#1:\\kern1em%
  1373. \}}{}$\5
  1374. \WC{ Index entry }\6
  1375. ${}\.{\3\\def\\[\#\#1]\{\$\\underline\{\#\#1\}\$\}}{}$\5
  1376. \WC{ Underlined index item }\6
  1377. ${}\.{\3\\def\\(\#\#1)\{\$\^\{\\rm\2\#\#1\}\$\}}{}$\5
  1378. \WC{ Language marker }\6
  1379. ${}\.{\3\\let\\Windexspace\\medskip\2}{}$\5
  1380. \WC{ Spacing between letter groups in index. }\6
  1381. ${}\.{\3\\rm\2\\rightskip0pt\ plus\ 2.5em\ \\tolerance\210000\ \\let\\\ast =%
  1382. \\lapstar}$\6
  1383. ${}\.{\3\\hyphenpenalty\210000\ \\parindent0pt\}}{}$\WY\par
  1384. \fi % End of module 93
  1385. \WM94. End the index.  This macro is the style-file entry \.{index.postamble}.
  1386. \WY $\WP \.{\\def\\Wfin\{\\par\\vfill\\eject}$\6
  1387. ${}\.{\3\\ifpagesaved\\null\\vfill\\eject\\fi\2}{}$\5
  1388. \WC{ Output a null index column }\6
  1389. ${}\.{\3\\if\2L\\lr\\else\\null\\vfill\\eject\\fi\2}{}$\5
  1390. \WC{ Finish the current page }\6
  1391. ${}\.{\3\\parfillskip\20pt\ plus\ 1fil}$\6
  1392. ${}\.{\3\\def\\rhead\{NAMES\ OF\ THE\ SECTIONS\}}$\6
  1393. ${}\.{\3\\output\{\\normaloutput\\page\\lheader\\rheader\}}$\6
  1394. ${}\.{\3\\setpage}$\6
  1395. ${}\.{\3\\def\\note\#\#1\#\#2.\{\\quad\{\\eightrm\#\#1\ \#\#2.\}\}}$\6
  1396. ${}\.{\3\\def\\WU\{\\note\{Used\ in\}\}}{}$\5
  1397. \WC{ Cross-reference for uses of sections }\6
  1398. ${}\.{\3\\def\\:\{\\par\\hangindent\22em\}\\let\\\ast =\ast \}}{}$\WY\par
  1399. \fi % End of module 94
  1400. \WM95. Begin the module list.  Presently, this is just an unused hook for
  1401. special purposes; it is the style file entry \.{modules.preamble}.
  1402. \WY $\WP \.{\\let\\Wmods\\relax}{}$\WY\par
  1403. \fi % End of module 95
  1404. \WN96.  MISCELLANEOUS.
  1405. Miscellaneous run info:
  1406. \WY $\WP \.{\\def\\Winfo\#1\#2\#3\#4\{\\bigskip}$\6
  1407. ${}\.{\3\\:\{\{\\bf\2COMMAND\ LINE:\}\\\ \\\ \\Wtypewriter\{\#1\}.\}%
  1408. \\smallskip}$\6
  1409. ${}\.{\3\\:\{\{\\bf\2WEB\ FILE:\}\\\ \\\ \\Wtypewriter\{\#2\}.\}\\smallskip}$\6
  1410. ${}\.{\3\\:\{\{\\bf\2CHANGE\ FILE:\}\\\ \\\ \\Wtypewriter\{\#3\}.\}\\medskip}$\6
  1411. ${}\.{\3\\:\{\{\\bf\2GLOBAL\ LANGUAGE:\}\\\ \\\ \\Wtypewriter\{\\rm\2\#4\}.\}%
  1412. \\medskip\}}{}$\WY\par
  1413. \fi % End of module 96
  1414. \WM97. Finish the section names,  do the table of contents and terminate:
  1415. \WY $\WP \.{\\def\\Wcon\{\\par\\vfill\\eject}$\6
  1416. ${}\.{\3\\rightskip\20pt\ \\hyphenpenalty\250\ \\tolerance\2200}$\6
  1417. ${}\.{\3\\setpage}$\6
  1418. ${}\.{\3\\output\{\\normaloutput\\page\\lheader\\rheader\}}$\6
  1419. ${}\.{\3\\titletrue\2}{}$\5
  1420. \WC{ Prepare to output the table of contents }\6
  1421. ${}\.{\3\\pageno=\\contentspageno\2\\def\\rhead\{TABLE\ OF\ CONTENTS\}}$\6
  1422. ${}\.{\3\\topofcontents}$\6
  1423. ${}\.{\3\\catcode\`\\@=11}$\6
  1424. ${}\.{\3\\hbox\2to\\hsize\{\\hfil\2Section\\hbox\2to3em\{\\hss\2Page\}\}}$\6
  1425. ${}\.{\3\\def\\WZ\#\#1\#\#2\#\#3\#\#4\{\\hbox\2to\\hsize\{\\kern\#\#1em%
  1426. \\ignorespaces\#\#2}$\6
  1427. ${}\.{\3\3\\leaders\\hbox\2to\ .5em\{.\\hfil\}\\hfil\\\ \#\#3\\hbox\2to3em\{%
  1428. \\hss\#\#4\}\}\}}$\6
  1429. ${}\.{\3\\let\\WIM\\WIN\2}{}$\5
  1430. \WC{ Restore the proper definition. }\6
  1431. ${}\.{\3\\readcontents\\relax\2}{}$\5
  1432. \WC{ Read the contents info. }\6
  1433. ${}\.{\3\\botofcontents}$\6
  1434. ${}\.{\3\\FWEBend\}}{}$\WY\par
  1435. \fi % End of module 97
  1436. \WM98. Assign a symbolic name to a module.  This scheme has no forward
  1437. referencing at present for plain \TeX, although this could easily be
  1438. extended.  For \LaTeX, forward referencing works because the \.{aux}~file
  1439. is used.
  1440. \WY\WP \5
  1441. \WC{ Label a section with an identifying name. }\6
  1442. $\.{\\def\\modlabel\#1\{}{}$\5
  1443. \Wx{ }\6
  1444. ${}\.{\3\\ifLaTeXisloaded}$\6
  1445. ${}\.{\3\3\\label\{MOD\#1\}}{}$\5
  1446. \Wx{ }\6
  1447. ${}\.{\3\\else}$\6
  1448. ${}\.{\3\3\\edef\\next\{\\gdef\\expandafter\\noexpand\\csname\2MOD\#1%
  1449. \\endcsname\{\\modno\}\}}{}$\5
  1450. \Wx{ }\6
  1451. ${}\.{\3\3\\next}$\6
  1452. ${}\.{\3\\fi\}}{}$\7
  1453. \WC{ Print the number of a labelled section. }\6
  1454. ${}\.{\\def\\Wmodule\#1\{\\ifLaTeXisloaded}$\6
  1455. ${}\.{\3\3\\ref\{MOD\#1\}}{}$\5
  1456. \Wx{ }\6
  1457. ${}\.{\3\\else}$\6
  1458. ${}\.{\3\3\\csname\2MOD\#1\\endcsname}$\6
  1459. ${}\.{\3\\fi\}}{}$\7
  1460. \WC{ Examples of references to sections. }\6
  1461. ${}\.{\\def\\WEBsection\#1\{section\~\\Wmodule\{\#1\}\}}{}$\5
  1462. \WC{ \WCD{ $\.{\\section}{}$} is used by \LaTeX. }\6
  1463. ${}\.{\\def\\WEBmodule\#1\{module\~\\Wmodule\{\#1\}\}}$ $\.{\\let\\module%
  1464. \\WEBmodule}{}$\5
  1465. \WC{ For backward compatibility. }\WY\par
  1466. \fi % End of module 98
  1467. \WM99. Language commands are printed in the left margin, following Knuth's
  1468. solution in Appendix~A of the \TeX book.  They are actually printed one
  1469. line down, because the language command is gobbled up before the line break
  1470. is emitted.
  1471. \WY $\WP \.{\\def\\strutdepth\{\\dp\\strutbox\}}{}$\7
  1472. ${}\.{\\def\\marginal\#1\{\\strut\\vadjust\{\\kern-\\strutdepth\\specialmargin%
  1473. \{\#1\}\}\}}{}$\7
  1474. ${}\.{\\def\\specialmargin\#1\{\\vtop\2to\\strutdepth\{}$\6
  1475. ${}\.{\3\\baselineskip\\strutdepth}$\6
  1476. ${}\.{\3\\vss\\llap\{\#1\ \}\\null\}\}}{}$\7
  1477. ${}\.{\\def\\LANGUAGE\#1\{\\marginal\{\\smash\{\\vtop\{\\hbox\{}{}$\5
  1478. \Wx{ }\6
  1479. ${}\.{\3\\hbox\{\\tt@L\\lowercase\{\#1\}:\\enspace\}\}\\null\}\}\}%
  1480. \\ignorespaces\}}{}$\7
  1481. \WC{ Use the next one if you don't want language changes to be printed. }\6
  1482. \WE:if:$\WO{0}$\WPs\6
  1483. ${}\.{\3\\def\\LANGUAGE\#1\{\\relax\\ignorespaces\}}{}$\6
  1484. \WE:endif:\WPs\WY\par
  1485. \fi % End of module 99
  1486. \WM100. The \WCD{ $\.{\\begintt}{}$} and \WCD{ $\.{\\endtt}{}$} verbatim
  1487. constructions, borrowed from \TeX.
  1488. \WY $\WP \.{\\newskip\\ttglue}{}$\7
  1489. ${}\.{\\ttglue=0.5em\ plus\ 0.25em\ minus\ 0.15em}{}$\7
  1490. ${}\.{\\def\\ttother\{\\catcode\`\\\\=\\other\2\\catcode\`\\\{=\\other\2%
  1491. \\catcode\`\\\}=\\other}$\6
  1492. ${}\.{\3\\catcode\`\\\$=\\other\2\\catcode\`\\\&=\\other\2\\catcode\`\\\#=%
  1493. \\other}$\6
  1494. ${}\.{\3\\catcode\`\\\%=\\other\2\\catcode\`\\\~=\\other\2\\catcode\`\\\_=%
  1495. \\other}$\6
  1496. ${}\.{\3\\catcode\`\\\^=\\other\}}{}$\7
  1497. ${}\.{\\def\\ttverbatim\{\\begingroup\2\\ttother\2\\obeyspaces\2\\obeylines\2%
  1498. \\tt\}}{}$\7
  1499. ${}\.{\{\\obeyspaces\\gdef\2\{\\\ \}\}}{}$\7
  1500. ${}\.{\\def\\begintt\{\$\$\\let\\par=\\endgraf}$\6
  1501. ${}\.{\3\\ttverbatim}$\6
  1502. ${}\.{\3\\parskip=0pt}{}$\5
  1503. \WC{\quad\catcode`\@=0 }\6
  1504. ${}\.{\3\\rightskip=-\\parindent}$\6
  1505. ${}\.{\3\\ttfinish\}}{}$\7
  1506. ${}\.{\\def\\Begintt\{\\bgroup}$\6
  1507. ${}\.{\3\\let\\par=\\endgraf}$\6
  1508. ${}\.{\3\\ttverbatim}$\6
  1509. ${}\.{\3\\parskip=0pt}$\6
  1510. ${}\.{\3\\rightskip=-\\parindent}$\6
  1511. ${}\.{\3\\ttFinish\}}{}$\7
  1512. ${}\.{\{\\catcode\`\\|=0}$\6
  1513. ${}\.{\3|catcode\`|\\=\\other}$\6
  1514. ${}\.{\3|obeylines}{}$\5
  1515. \Wx{ }\6
  1516. ${}\.{\3|gdef|ttfinish\#1\^\^M\#2\\endtt\{\#1|vbox\{\#2\}|endgroup\$\$\}}{}$\5
  1517. \Wx{ }\6
  1518. ${}\.{\3|gdef|ttFinish\#1\\Endtt\{\#1|endgroup|egroup\}\}}{}$\7
  1519. ${}\.{\\let\\verticalbar|}{}$\7
  1520. ${}\.{\\def\\activebar\{\\catcode\`\\|=\\active\}}{}$\7
  1521. ${}\.{\{\\activebar}$\6
  1522. ${}\.{\\gdef\\normalbar\{\\activebar}$\6
  1523. ${}\.{\3\\let|\\verticalbar\}\}}{}$\7
  1524. \WC{\activebar }\7
  1525. ${}\.{\{\\obeylines}{}$\5
  1526. \Wx{ }\6
  1527. ${}\.{\\gdef\\ttbar\{\\activebar}{}$\5
  1528. \Wx{ }\6
  1529. ${}\.{\3\{\\obeylines\\gdef|\{\\ttverbatim}{}$\5
  1530. \Wx{ }\6
  1531. ${}\.{\3\3\\spaceskip=\\ttglue}{}$\5
  1532. \Wx{ }\6
  1533. ${}\.{\3\3\\let\^\^M=\\\ \\let|=\\endgroup\}\}\}\}}{}$\7
  1534. ${}\.{\\let\\WCX\\Begintt}{}$\WY\par
  1535. \fi % End of module 100
  1536. \WN101.  INDEX.
  1537. \fi % End of module 101
  1538. \input fwebmac.ndx
  1539. \input fwebmac.mds
  1540. \Winfo{"fweave fwebmac"}  {"fwebmac.web"} {(none)}
  1541.  {TEX}
  1542. \Wcon
  1543.