home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume28 / bcs-2.0 / part07 < prev    next >
Encoding:
Text File  |  1994-03-29  |  50.1 KB  |  1,545 lines

  1. Newsgroups: comp.sources.unix
  2. From: ejb@ERA.COM (Jay Berkenbilt)
  3. Subject: v28i008: bcs-2.0 - A Baseline Configuration System, Part07/25
  4. References: <1.764985670.1461@gw.home.vix.com>
  5. Sender: unix-sources-moderator@gw.home.vix.com
  6. Approved: vixie@gw.home.vix.com
  7.  
  8. Submitted-By: ejb@ERA.COM (Jay Berkenbilt)
  9. Posting-Number: Volume 28, Issue 8
  10. Archive-Name: bcs-2.0/part07
  11.  
  12. #!/bin/sh
  13. # this is bcs.07 (part 7 of bcs-2.0)
  14. # do not concatenate these parts, unpack them in order with /bin/sh
  15. # file bcs-2.0/doc/texinfo.tex continued
  16. #
  17. if test ! -r _shar_seq_.tmp; then
  18.     echo 'Please unpack part 1 first!'
  19.     exit 1
  20. fi
  21. (read Scheck
  22.  if test "$Scheck" != 7; then
  23.     echo Please unpack part "$Scheck" next!
  24.     exit 1
  25.  else
  26.     exit 0
  27.  fi
  28. ) < _shar_seq_.tmp || exit 1
  29. if test ! -f _shar_wnt_.tmp; then
  30.     echo 'x - still skipping bcs-2.0/doc/texinfo.tex'
  31. else
  32. echo 'x - continuing file bcs-2.0/doc/texinfo.tex'
  33. sed 's/^X//' << 'SHAR_EOF' >> 'bcs-2.0/doc/texinfo.tex' &&
  34. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  35. }
  36. X
  37. %
  38. % Here are the rules for the cropmarks.  Note that they are
  39. % offset so that the space between them is truly \outerhsize or \outervsize
  40. % (P. A. MacKay, 12 November, 1986)
  41. %
  42. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  43. \def\nstop{\vbox
  44. X  {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  45. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  46. \def\nsbot{\vbox
  47. X  {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  48. X
  49. % Parse an argument, then pass it to #1.  The argument is the rest of
  50. % the input line (except we remove a trailing comment).  #1 should be a
  51. % macro which expects an ordinary undelimited TeX argument.
  52. %
  53. \def\parsearg#1{%
  54. X  \let\next = #1%
  55. X  \begingroup
  56. X    \obeylines
  57. X    \futurelet\temp\parseargx
  58. }
  59. X
  60. % If the next token is an obeyed space (from an @example environment or
  61. % the like), remove it and recurse.  Otherwise, we're done.
  62. \def\parseargx{%
  63. X  % \obeyedspace is defined far below, after the definition of \sepspaces.
  64. X  \ifx\obeyedspace\temp
  65. X    \expandafter\parseargdiscardspace
  66. X  \else
  67. X    \expandafter\parseargline
  68. X  \fi
  69. }
  70. X
  71. % Remove a single space (as the delimiter token to the macro call).
  72. {\obeyspaces %
  73. X \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
  74. X
  75. {\obeylines %
  76. X  \gdef\parseargline#1^^M{%
  77. X    \endgroup % End of the group started in \parsearg.
  78. X    %
  79. X    % First remove any @c comment, then any @comment.
  80. X    % Result of each macro is put in \toks0.
  81. X    \argremovec #1\c\relax %
  82. X    \expandafter\argremovecomment \the\toks0 \comment\relax %
  83. X    %
  84. X    % Call the caller's macro, saved as \next in \parsearg.
  85. X    \expandafter\next\expandafter{\the\toks0}%
  86. X  }%
  87. }
  88. X
  89. % Since all \c{,omment} does is throw away the argument, we can let TeX
  90. % do that for us.  The \relax here is matched by the \relax in the call
  91. % in \parseargline; it could be more or less anything, its purpose is
  92. % just to delimit the argument to the \c.
  93. \def\argremovec#1\c#2\relax{\toks0 = {#1}}
  94. \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
  95. X
  96. % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
  97. %    @end itemize  @c foo
  98. % will have two active spaces as part of the argument with the
  99. % `itemize'.  Here we remove all active spaces from #1, and assign the
  100. % result to \toks0.
  101. %
  102. % This loses if there are any *other* active characters besides spaces
  103. % in the argument -- _ ^ +, for example -- since they get expanded.
  104. % Fortunately, Texinfo does not define any such commands.  (If it ever
  105. % does, the catcode of the characters in questionwill have to be changed
  106. % here.)  But this means we cannot call \removeactivespaces as part of
  107. % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
  108. % that \parsearg gets might well have any character at all in it.
  109. %
  110. \def\removeactivespaces#1{%
  111. X  \begingroup
  112. X    \ignoreactivespaces
  113. X    \edef\temp{#1}%
  114. X    \global\toks0 = \expandafter{\temp}%
  115. X  \endgroup
  116. }
  117. X
  118. % Change the active space to expand to nothing.
  119. %
  120. \begingroup
  121. X  \obeyspaces
  122. X  \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
  123. \endgroup
  124. X
  125. X
  126. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  127. X
  128. %% These are used to keep @begin/@end levels from running away
  129. %% Call \inENV within environments (after a \begingroup)
  130. \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
  131. \def\ENVcheck{%
  132. \ifENV\errmessage{Still within an environment.  Type Return to continue.}
  133. \endgroup\fi} % This is not perfect, but it should reduce lossage
  134. X
  135. % @begin foo  is the same as @foo, for now.
  136. \newhelp\EMsimple{Type <Return> to continue.}
  137. X
  138. \outer\def\begin{\parsearg\beginxxx}
  139. X
  140. \def\beginxxx #1{%
  141. \expandafter\ifx\csname #1\endcsname\relax
  142. {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
  143. \csname #1\endcsname\fi}
  144. X
  145. % @end foo executes the definition of \Efoo.
  146. %
  147. \def\end{\parsearg\endxxx}
  148. \def\endxxx #1{%
  149. X  \removeactivespaces{#1}%
  150. X  \edef\endthing{\the\toks0}%
  151. X  %
  152. X  \expandafter\ifx\csname E\endthing\endcsname\relax
  153. X    \expandafter\ifx\csname \endthing\endcsname\relax
  154. X      % There's no \foo, i.e., no ``environment'' foo.
  155. X      \errhelp = \EMsimple
  156. X      \errmessage{Undefined command `@end \endthing'}%
  157. X    \else
  158. X      \unmatchedenderror\endthing
  159. X    \fi
  160. X  \else
  161. X    % Everything's ok; the right environment has been started.
  162. X    \csname E\endthing\endcsname
  163. X  \fi
  164. }
  165. X
  166. % There is an environment #1, but it hasn't been started.  Give an error.
  167. %
  168. \def\unmatchedenderror#1{%
  169. X  \errhelp = \EMsimple
  170. X  \errmessage{This `@end #1' doesn't have a matching `@#1'}%
  171. }
  172. X
  173. % Define the control sequence \E#1 to give an unmatched @end error.
  174. %
  175. \def\defineunmatchedend#1{%
  176. X  \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
  177. }
  178. X
  179. X
  180. % Single-spacing is done by various environments (specifically, in
  181. % \nonfillstart and \quotations).
  182. \newskip\singlespaceskip \singlespaceskip = \baselineskip
  183. \def\singlespace{%
  184. % Why was this kern here?  It messes up equalizing space above and below
  185. % environments.  --karl, 6may93
  186. %{\advance \baselineskip by -\singlespaceskip
  187. %\kern \baselineskip}%
  188. \baselineskip=\singlespaceskip
  189. }
  190. X
  191. %% Simple single-character @ commands
  192. X
  193. % @@ prints an @
  194. % Kludge this until the fonts are right (grr).
  195. \def\@{{\tt \char '100}}
  196. X
  197. % This is turned off because it was never documented
  198. % and you can use @w{...} around a quote to suppress ligatures.
  199. %% Define @` and @' to be the same as ` and '
  200. %% but suppressing ligatures.
  201. %\def\`{{`}}
  202. %\def\'{{'}}
  203. X
  204. % Used to generate quoted braces.
  205. X
  206. \def\mylbrace {{\tt \char '173}}
  207. \def\myrbrace {{\tt \char '175}}
  208. \let\{=\mylbrace
  209. \let\}=\myrbrace
  210. X
  211. % @: forces normal size whitespace following.
  212. \def\:{\spacefactor=1000 }
  213. X
  214. % @* forces a line break.
  215. \def\*{\hfil\break\hbox{}\ignorespaces}
  216. X
  217. % @. is an end-of-sentence period.
  218. \def\.{.\spacefactor=3000 }
  219. X
  220. % @w prevents a word break.  Without the \leavevmode, @w at the
  221. % beginning of a paragraph, when TeX is still in vertical mode, would
  222. % produce a whole line of output instead of starting the paragraph.
  223. \def\w#1{\leavevmode\hbox{#1}}
  224. X
  225. % @group ... @end group forces ... to be all on one page, by enclosing
  226. % it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
  227. % to keep its height that of a normal line.  According to the rules for
  228. % \topskip (p.114 of the TeXbook), the glue inserted is
  229. % max (\topskip - \ht (first item), 0).  If that height is large,
  230. % therefore, no glue is inserted, and the space between the headline and
  231. % the text is small, which looks bad.
  232. %
  233. \def\group{\begingroup
  234. X  \ifnum\catcode13=\active \else
  235. X    \errhelp = \groupinvalidhelp
  236. X    \errmessage{@group invalid in context where filling is enabled}%
  237. X  \fi
  238. X  %
  239. X  % The \vtop we start below produces a box with normal height and large
  240. X  % depth; thus, TeX puts \baselineskip glue before it, and (when the
  241. X  % next line of text is done) \lineskip glue after it.  (See p.82 of
  242. X  % the TeXbook.)  Thus, space below is not quite equal to space
  243. X  % above.  But it's pretty close.
  244. X  \def\Egroup{%
  245. X    \egroup           % End the \vtop.
  246. X    \endgroup         % End the \group.
  247. X  }%
  248. X  %
  249. X  \vtop\bgroup
  250. X    % We have to put a strut on the last line in case the @group is in
  251. X    % the midst of an example, rather than completely enclosing it.
  252. X    % Otherwise, the interline space between the last line of the group
  253. X    % and the first line afterwards is too small.  But we can't put the
  254. X    % strut in \Egroup, since there it would be on a line by itself.
  255. X    % Hence this just inserts a strut at the beginning of each line.
  256. X    \everypar = {\strut}%
  257. X    %
  258. X    % Since we have a strut on every line, we don't need any of TeX's
  259. X    % normal interline spacing.
  260. X    \offinterlineskip
  261. X    %
  262. X    % OK, but now we have to do something about blank
  263. X    % lines in the input in @example-like environments, which normally
  264. X    % just turn into \lisppar, which will insert no space now that we've
  265. X    % turned off the interline space.  Simplest is to make them be an
  266. X    % empty paragraph.
  267. X    \ifx\par\lisppar
  268. X      \edef\par{\leavevmode \par}%
  269. X      %
  270. X      % Reset ^^M's definition to new definition of \par.
  271. X      \obeylines
  272. X    \fi
  273. X    %
  274. X    % We do @comment here in case we are called inside an environment,
  275. X    % such as @example, where each end-of-line in the input causes an
  276. X    % end-of-line in the output.  We don't want the end-of-line after
  277. X    % the `@group' to put extra space in the output.  Since @group
  278. X    % should appear on a line by itself (according to the Texinfo
  279. X    % manual), we don't worry about eating any user text.
  280. X    \comment
  281. }
  282. %
  283. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  284. % message, so this ends up printing `@group can only ...'.
  285. %
  286. \newhelp\groupinvalidhelp{%
  287. group can only be used in environments such as @example,^^J%
  288. where each line of input produces a line of output.}
  289. X
  290. % @need space-in-mils
  291. % forces a page break if there is not space-in-mils remaining.
  292. X
  293. \newdimen\mil  \mil=0.001in
  294. X
  295. \def\need{\parsearg\needx}
  296. X
  297. % Old definition--didn't work.
  298. %\def\needx #1{\par %
  299. %% This method tries to make TeX break the page naturally
  300. %% if the depth of the box does not fit.
  301. %{\baselineskip=0pt%
  302. %\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
  303. %\prevdepth=-1000pt
  304. %}}
  305. X
  306. \def\needx#1{%
  307. X  % Go into vertical mode, so we don't make a big box in the middle of a
  308. X  % paragraph.
  309. X  \par
  310. X  %
  311. X  % Don't add any leading before our big empty box, but allow a page
  312. X  % break, since the best break might be right here.
  313. X  \allowbreak
  314. X  \nointerlineskip
  315. X  \vtop to #1\mil{\vfil}%
  316. X  %
  317. X  % TeX does not even consider page breaks if a penalty added to the
  318. X  % main vertical list is 10000 or more.  But in order to see if the
  319. X  % empty box we just added fits on the page, we must make it consider
  320. X  % page breaks.  On the other hand, we don't want to actually break the
  321. X  % page after the empty box.  So we use a penalty of 9999.
  322. X  %
  323. X  % There is an extremely small chance that TeX will actually break the
  324. X  % page at this \penalty, if there are no other feasible breakpoints in
  325. X  % sight.  (If the user is using lots of big @group commands, which
  326. X  % almost-but-not-quite fill up a page, TeX will have a hard time doing
  327. X  % good page breaking, for example.)  However, I could not construct an
  328. X  % example where a page broke at this \penalty; if it happens in a real
  329. X  % document, then we can reconsider our strategy.
  330. X  \penalty9999
  331. X  %
  332. X  % Back up by the size of the box, whether we did a page break or not.
  333. X  \kern -#1\mil
  334. X  %
  335. X  % Do not allow a page break right after this kern.
  336. X  \nobreak
  337. }
  338. X
  339. % @br   forces paragraph break
  340. X
  341. \let\br = \par
  342. X
  343. % @dots{}  output some dots
  344. X
  345. \def\dots{$\ldots$}
  346. X
  347. % @page    forces the start of a new page
  348. X
  349. \def\page{\par\vfill\supereject}
  350. X
  351. % @exdent text....
  352. % outputs text on separate line in roman font, starting at standard page margin
  353. X
  354. % This records the amount of indent in the innermost environment.
  355. % That's how much \exdent should take out.
  356. \newskip\exdentamount
  357. X
  358. % This defn is used inside fill environments such as @defun.
  359. \def\exdent{\parsearg\exdentyyy}
  360. \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
  361. X
  362. % This defn is used inside nofill environments such as @example.
  363. \def\nofillexdent{\parsearg\nofillexdentyyy}
  364. \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
  365. \leftline{\hskip\leftskip{\rm#1}}}}
  366. X
  367. %\hbox{{\rm#1}}\hfil\break}}
  368. X
  369. % @include file    insert text of that file as input.
  370. X
  371. \def\include{\parsearg\includezzz}
  372. %Use \input\thisfile to avoid blank after \input, which may be an active
  373. %char (in which case the blank would become the \input argument).
  374. %The grouping keeps the value of \thisfile correct even when @include
  375. %is nested.
  376. \def\includezzz #1{\begingroup
  377. \def\thisfile{#1}\input\thisfile
  378. \endgroup}
  379. X
  380. \def\thisfile{}
  381. X
  382. % @center line   outputs that line, centered
  383. X
  384. \def\center{\parsearg\centerzzz}
  385. \def\centerzzz #1{{\advance\hsize by -\leftskip
  386. \advance\hsize by -\rightskip
  387. \centerline{#1}}}
  388. X
  389. % @sp n   outputs n lines of vertical space
  390. X
  391. \def\sp{\parsearg\spxxx}
  392. \def\spxxx #1{\par \vskip #1\baselineskip}
  393. X
  394. % @comment ...line which is ignored...
  395. % @c is the same as @comment
  396. % @ignore ... @end ignore  is another way to write a comment
  397. X
  398. \def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
  399. \parsearg \commentxxx}
  400. X
  401. \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
  402. X
  403. \let\c=\comment
  404. X
  405. % Prevent errors for section commands.
  406. % Used in @ignore and in failing conditionals.
  407. \def\ignoresections{%
  408. \let\chapter=\relax
  409. \let\unnumbered=\relax
  410. \let\top=\relax
  411. \let\unnumberedsec=\relax
  412. \let\unnumberedsection=\relax
  413. \let\unnumberedsubsec=\relax
  414. \let\unnumberedsubsection=\relax
  415. \let\unnumberedsubsubsec=\relax
  416. \let\unnumberedsubsubsection=\relax
  417. \let\section=\relax
  418. \let\subsec=\relax
  419. \let\subsubsec=\relax
  420. \let\subsection=\relax
  421. \let\subsubsection=\relax
  422. \let\appendix=\relax
  423. \let\appendixsec=\relax
  424. \let\appendixsection=\relax
  425. \let\appendixsubsec=\relax
  426. \let\appendixsubsection=\relax
  427. \let\appendixsubsubsec=\relax
  428. \let\appendixsubsubsection=\relax
  429. \let\contents=\relax
  430. \let\smallbook=\relax
  431. \let\titlepage=\relax
  432. }
  433. X
  434. % Used in nested conditionals, where we have to parse the Texinfo source
  435. % and so want to turn off most commands, in case they are used
  436. % incorrectly.
  437. %
  438. \def\ignoremorecommands{%
  439. X  \let\defcv = \relax
  440. X  \let\deffn = \relax
  441. X  \let\deffnx = \relax
  442. X  \let\defindex = \relax
  443. X  \let\defivar = \relax
  444. X  \let\defmac = \relax
  445. X  \let\defmethod = \relax
  446. X  \let\defop = \relax
  447. X  \let\defopt = \relax
  448. X  \let\defspec = \relax
  449. X  \let\deftp = \relax
  450. X  \let\deftypefn = \relax
  451. X  \let\deftypefun = \relax
  452. X  \let\deftypevar = \relax
  453. X  \let\deftypevr = \relax
  454. X  \let\defun = \relax
  455. X  \let\defvar = \relax
  456. X  \let\defvr = \relax
  457. X  \let\ref = \relax
  458. X  \let\xref = \relax
  459. X  \let\printindex = \relax
  460. X  \let\pxref = \relax
  461. X  \let\settitle = \relax
  462. X  \let\include = \relax
  463. X  \let\lowersections = \relax
  464. X  \let\down = \relax
  465. X  \let\raisesections = \relax
  466. X  \let\up = \relax
  467. X  \let\set = \relax
  468. X  \let\clear = \relax
  469. }
  470. X
  471. % Ignore @ignore ... @end ignore.
  472. %
  473. \def\ignore{\doignore{ignore}}
  474. X
  475. % Also ignore @ifinfo, @menu, and @direntry text.
  476. %
  477. \def\ifinfo{\doignore{ifinfo}}
  478. \def\menu{\doignore{menu}}
  479. \def\direntry{\doignore{direntry}}
  480. X
  481. % Ignore text until a line `@end #1'.
  482. %
  483. \def\doignore#1{\begingroup
  484. X  % Don't complain about control sequences we have declared \outer.
  485. X  \ignoresections
  486. X  %
  487. X  % Define a command to swallow text until we reach `@end #1'.
  488. X  \long\def\doignoretext##1\end #1{\enddoignore}%
  489. X  %
  490. X  % Make sure that spaces turn into tokens that match what \doignoretext wants.
  491. X  \catcode32 = 10
  492. X  %
  493. X  % And now expand that command.
  494. X  \doignoretext
  495. }
  496. X
  497. % What we do to finish off ignored text.
  498. %
  499. \def\enddoignore{\endgroup\ignorespaces}%
  500. X
  501. \newif\ifwarnedobs\warnedobsfalse
  502. \def\obstexwarn{%
  503. X  \ifwarnedobs\relax\else
  504. X  % We need to warn folks that they may have trouble with TeX 3.0.
  505. X  % This uses \immediate\write16 rather than \message to get newlines.
  506. X    \immediate\write16{}
  507. X    \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
  508. X    \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
  509. X    \immediate\write16{If you are running another version of TeX, relax.}
  510. X    \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
  511. X    \immediate\write16{  Then upgrade your TeX installation if you can.}
  512. X    \immediate\write16{If you are stuck with version 3.0, run the}
  513. X    \immediate\write16{  script ``tex3patch'' from the Texinfo distribution}
  514. X    \immediate\write16{  to use a workaround.}
  515. X    \immediate\write16{}
  516. X    \warnedobstrue
  517. X    \fi
  518. }
  519. X
  520. % **In TeX 3.0, setting text in \nullfont hangs tex.  For a
  521. % workaround (which requires the file ``dummy.tfm'' to be installed),
  522. % uncomment the following line:
  523. %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
  524. X
  525. % Ignore text, except that we keep track of conditional commands for
  526. % purposes of nesting, up to an `@end #1' command.
  527. %
  528. \def\nestedignore#1{%
  529. X  \obstexwarn
  530. X  % We must actually expand the ignored text to look for the @end
  531. X  % command, so that nested ignore constructs work.  Thus, we put the
  532. X  % text into a \vbox and then do nothing with the result.  To minimize
  533. X  % the change of memory overflow, we follow the approach outlined on
  534. X  % page 401 of the TeXbook: make the current font be a dummy font.
  535. X  %
  536. X  \setbox0 = \vbox\bgroup
  537. X    % Don't complain about control sequences we have declared \outer.
  538. X    \ignoresections
  539. X    %
  540. X    % Define `@end #1' to end the box, which will in turn undefine the
  541. X    % @end command again.
  542. X    \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
  543. X    %
  544. X    % We are going to be parsing Texinfo commands.  Most cause no
  545. X    % trouble when they are used incorrectly, but some commands do
  546. X    % complicated argument parsing or otherwise get confused, so we
  547. X    % undefine them.
  548. X    %
  549. X    % We can't do anything about stray @-signs, unfortunately;
  550. X    % they'll produce `undefined control sequence' errors.
  551. X    \ignoremorecommands
  552. X    %
  553. X    % Set the current font to be \nullfont, a TeX primitive, and define
  554. X    % all the font commands to also use \nullfont.  We don't use
  555. X    % dummy.tfm, as suggested in the TeXbook, because not all sites
  556. X    % might have that installed.  Therefore, math mode will still
  557. X    % produce output, but that should be an extremely small amount of
  558. X    % stuff compared to the main input.
  559. X    %
  560. X    \nullfont
  561. X    \let\tenrm = \nullfont  \let\tenit = \nullfont  \let\tensl = \nullfont
  562. X    \let\tenbf = \nullfont  \let\tentt = \nullfont  \let\smallcaps = \nullfont
  563. X    \let\tensf = \nullfont
  564. X    %
  565. X    % Don't complain when characters are missing from the fonts.
  566. X    \tracinglostchars = 0
  567. X    %
  568. X    % Don't bother to do space factor calculations.
  569. X    \frenchspacing
  570. X    %
  571. X    % Don't report underfull hboxes.
  572. X    \hbadness = 10000
  573. X    %
  574. X    % Do minimal line-breaking.
  575. X    \pretolerance = 10000
  576. X    %
  577. X    % Do not execute instructions in @tex
  578. X    \def\tex{\doignore{tex}}
  579. }
  580. X
  581. % @set VAR sets the variable VAR to an empty value.
  582. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
  583. %
  584. % Since we want to separate VAR from REST-OF-LINE (which might be
  585. % empty), we can't just use \parsearg; we have to insert a space of our
  586. % own to delimit the rest of the line, and then take it out again if we
  587. % didn't need it.
  588. %
  589. \def\set{\parsearg\setxxx}
  590. \def\setxxx#1{\setyyy#1 \endsetyyy}
  591. \def\setyyy#1 #2\endsetyyy{%
  592. X  \def\temp{#2}%
  593. X  \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
  594. X  \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
  595. X  \fi
  596. }
  597. \def\setzzz#1#2 \endsetzzz{\expandafter\xdef\csname SET#1\endcsname{#2}}
  598. X
  599. % @clear VAR clears (i.e., unsets) the variable VAR.
  600. %
  601. \def\clear{\parsearg\clearxxx}
  602. \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
  603. X
  604. % @value{foo} gets the text saved in variable foo.
  605. %
  606. \def\value#1{\expandafter
  607. X        \ifx\csname SET#1\endcsname\relax
  608. X            {\{No value for ``#1''\}}
  609. X        \else \csname SET#1\endcsname \fi}
  610. X
  611. % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  612. % with @set.
  613. %
  614. \def\ifset{\parsearg\ifsetxxx}
  615. \def\ifsetxxx #1{%
  616. X  \expandafter\ifx\csname SET#1\endcsname\relax
  617. X    \expandafter\ifsetfail
  618. X  \else
  619. X    \expandafter\ifsetsucceed
  620. X  \fi
  621. }
  622. \def\ifsetsucceed{\conditionalsucceed{ifset}}
  623. \def\ifsetfail{\nestedignore{ifset}}
  624. \defineunmatchedend{ifset}
  625. X
  626. % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
  627. % defined with @set, or has been undefined with @clear.
  628. %
  629. \def\ifclear{\parsearg\ifclearxxx}
  630. \def\ifclearxxx #1{%
  631. X  \expandafter\ifx\csname SET#1\endcsname\relax
  632. X    \expandafter\ifclearsucceed
  633. X  \else
  634. X    \expandafter\ifclearfail
  635. X  \fi
  636. }
  637. \def\ifclearsucceed{\conditionalsucceed{ifclear}}
  638. \def\ifclearfail{\nestedignore{ifclear}}
  639. \defineunmatchedend{ifclear}
  640. X
  641. % @iftex always succeeds; we read the text following, through @end
  642. % iftex).  But `@end iftex' should be valid only after an @iftex.
  643. %
  644. \def\iftex{\conditionalsucceed{iftex}}
  645. \defineunmatchedend{iftex}
  646. X
  647. % We can't just want to start a group at @iftex (for example) and end it
  648. % at @end iftex, since then @set commands inside the conditional have no
  649. % effect (they'd get reverted at the end of the group).  So we must
  650. % define \Eiftex to redefine itself to be its previous value.  (We can't
  651. % just define it to fail again with an ``unmatched end'' error, since
  652. % the @ifset might be nested.)
  653. %
  654. \def\conditionalsucceed#1{%
  655. X  \edef\temp{%
  656. X    % Remember the current value of \E#1.
  657. X    \let\nece{prevE#1} = \nece{E#1}%
  658. X    %
  659. X    % At the `@end #1', redefine \E#1 to be its previous value.
  660. X    \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
  661. X  }%
  662. X  \temp
  663. }
  664. X
  665. % We need to expand lots of \csname's, but we don't want to expand the
  666. % control sequences after we've constructed them.
  667. %
  668. \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
  669. X
  670. % @asis just yields its argument.  Used with @table, for example.
  671. %
  672. \def\asis#1{#1}
  673. X
  674. % @math means output in math mode.
  675. % We don't use $'s directly in the definition of \math because control
  676. % sequences like \math are expanded when the toc file is written.  Then,
  677. % we read the toc file back, the $'s will be normal characters (as they
  678. % should be, according to the definition of Texinfo).  So we must use a
  679. % control sequence to switch into and out of math mode.
  680. %
  681. % This isn't quite enough for @math to work properly in indices, but it
  682. % seems unlikely it will ever be needed there.
  683. %
  684. \let\implicitmath = $
  685. \def\math#1{\implicitmath #1\implicitmath}
  686. X
  687. % @bullet and @minus need the same treatment as @math, just above.
  688. \def\bullet{\implicitmath\ptexbullet\implicitmath}
  689. \def\minus{\implicitmath-\implicitmath}
  690. X
  691. \def\node{\ENVcheck\parsearg\nodezzz}
  692. \def\nodezzz#1{\nodexxx [#1,]}
  693. \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
  694. \let\nwnode=\node
  695. \let\lastnode=\relax
  696. X
  697. \def\donoderef{\ifx\lastnode\relax\else
  698. \expandafter\expandafter\expandafter\setref{\lastnode}\fi
  699. \let\lastnode=\relax}
  700. X
  701. \def\unnumbnoderef{\ifx\lastnode\relax\else
  702. \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
  703. \let\lastnode=\relax}
  704. X
  705. \def\appendixnoderef{\ifx\lastnode\relax\else
  706. \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
  707. \let\lastnode=\relax}
  708. X
  709. \let\refill=\relax
  710. X
  711. % @setfilename is done at the beginning of every texinfo file.
  712. % So open here the files we need to have open while reading the input.
  713. % This makes it possible to make a .fmt file for texinfo.
  714. \def\setfilename{%
  715. X   \readauxfile
  716. X   \opencontents
  717. X   \openindices
  718. X   \fixbackslash  % Turn off hack to swallow `\input texinfo'.
  719. X   \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
  720. X   \comment % Ignore the actual filename.
  721. }
  722. X
  723. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  724. X
  725. \def\inforef #1{\inforefzzz #1,,,,**}
  726. \def\inforefzzz #1,#2,#3,#4**{See Info file \file{\ignorespaces #3{}},
  727. X  node \samp{\ignorespaces#1{}}}
  728. X
  729. \message{fonts,}
  730. X
  731. % Font-change commands.
  732. X
  733. % Texinfo supports the sans serif font style, which plain TeX does not.
  734. % So we set up a \sf analogous to plain's \rm, etc.
  735. \newfam\sffam
  736. \def\sf{\fam=\sffam \tensf}
  737. \let\li = \sf % Sometimes we call it \li, not \sf.
  738. X
  739. %% Try out Computer Modern fonts at \magstephalf
  740. \let\mainmagstep=\magstephalf
  741. X
  742. \ifx\bigger\relax
  743. \let\mainmagstep=\magstep1
  744. \font\textrm=cmr12
  745. \font\texttt=cmtt12
  746. \else
  747. \font\textrm=cmr10 scaled \mainmagstep
  748. \font\texttt=cmtt10 scaled \mainmagstep
  749. \fi
  750. % Instead of cmb10, you many want to use cmbx10.
  751. % cmbx10 is a prettier font on its own, but cmb10
  752. % looks better when embedded in a line with cmr10.
  753. \font\textbf=cmb10 scaled \mainmagstep
  754. \font\textit=cmti10 scaled \mainmagstep
  755. \font\textsl=cmsl10 scaled \mainmagstep
  756. \font\textsf=cmss10 scaled \mainmagstep
  757. \font\textsc=cmcsc10 scaled \mainmagstep
  758. \font\texti=cmmi10 scaled \mainmagstep
  759. \font\textsy=cmsy10 scaled \mainmagstep
  760. X
  761. % A few fonts for @defun, etc.
  762. \font\defbf=cmbx10 scaled \magstep1 %was 1314
  763. \font\deftt=cmtt10 scaled \magstep1
  764. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
  765. X
  766. % Fonts for indices and small examples.
  767. % We actually use the slanted font rather than the italic,
  768. % because texinfo normally uses the slanted fonts for that.
  769. % Do not make many font distinctions in general in the index, since they
  770. % aren't very useful.
  771. \font\ninett=cmtt9
  772. \font\indrm=cmr9
  773. \font\indit=cmsl9
  774. \let\indsl=\indit
  775. \let\indtt=\ninett
  776. \let\indsf=\indrm
  777. \let\indbf=\indrm
  778. \let\indsc=\indrm
  779. \font\indi=cmmi9
  780. \font\indsy=cmsy9
  781. X
  782. % Fonts for headings
  783. \font\chaprm=cmbx12 scaled \magstep2
  784. \font\chapit=cmti12 scaled \magstep2
  785. \font\chapsl=cmsl12 scaled \magstep2
  786. \font\chaptt=cmtt12 scaled \magstep2
  787. \font\chapsf=cmss12 scaled \magstep2
  788. \let\chapbf=\chaprm
  789. \font\chapsc=cmcsc10 scaled\magstep3
  790. \font\chapi=cmmi12 scaled \magstep2
  791. \font\chapsy=cmsy10 scaled \magstep3
  792. X
  793. \font\secrm=cmbx12 scaled \magstep1
  794. \font\secit=cmti12 scaled \magstep1
  795. \font\secsl=cmsl12 scaled \magstep1
  796. \font\sectt=cmtt12 scaled \magstep1
  797. \font\secsf=cmss12 scaled \magstep1
  798. \font\secbf=cmbx12 scaled \magstep1
  799. \font\secsc=cmcsc10 scaled\magstep2
  800. \font\seci=cmmi12 scaled \magstep1
  801. \font\secsy=cmsy10 scaled \magstep2
  802. X
  803. % \font\ssecrm=cmbx10 scaled \magstep1    % This size an font looked bad.
  804. % \font\ssecit=cmti10 scaled \magstep1    % The letters were too crowded.
  805. % \font\ssecsl=cmsl10 scaled \magstep1
  806. % \font\ssectt=cmtt10 scaled \magstep1
  807. % \font\ssecsf=cmss10 scaled \magstep1
  808. X
  809. %\font\ssecrm=cmb10 scaled 1315    % Note the use of cmb rather than cmbx.
  810. %\font\ssecit=cmti10 scaled 1315    % Also, the size is a little larger than
  811. %\font\ssecsl=cmsl10 scaled 1315    % being scaled magstep1.
  812. %\font\ssectt=cmtt10 scaled 1315
  813. %\font\ssecsf=cmss10 scaled 1315
  814. X
  815. %\let\ssecbf=\ssecrm
  816. X
  817. \font\ssecrm=cmbx12 scaled \magstephalf
  818. \font\ssecit=cmti12 scaled \magstephalf
  819. \font\ssecsl=cmsl12 scaled \magstephalf
  820. \font\ssectt=cmtt12 scaled \magstephalf
  821. \font\ssecsf=cmss12 scaled \magstephalf
  822. \font\ssecbf=cmbx12 scaled \magstephalf
  823. \font\ssecsc=cmcsc10 scaled \magstep1
  824. \font\sseci=cmmi12 scaled \magstephalf
  825. \font\ssecsy=cmsy10 scaled \magstep1
  826. % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
  827. % but that is not a standard magnification.
  828. X
  829. % Fonts for title page:
  830. \font\titlerm = cmbx12 scaled \magstep3
  831. \let\authorrm = \secrm
  832. X
  833. % In order for the font changes to affect most math symbols and letters,
  834. % we have to define the \textfont of the standard families.  Since
  835. % texinfo doesn't allow for producing subscripts and superscripts, we
  836. % don't bother to reset \scriptfont and \scriptscriptfont (which would
  837. % also require loading a lot more fonts).
  838. %
  839. \def\resetmathfonts{%
  840. X  \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
  841. X  \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
  842. X  \textfont\ttfam = \tentt \textfont\sffam = \tensf
  843. }
  844. X
  845. X
  846. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  847. % of just \STYLE.  We do this so that font changes will continue to work
  848. % in math mode, where it is the current \fam that is relevant in most
  849. % cases, not the current.  Plain TeX does, for example,
  850. % \def\bf{\fam=\bffam \tenbf}  By redefining \tenbf, we obviate the need
  851. % to redefine \bf itself.
  852. \def\textfonts{%
  853. X  \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  854. X  \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  855. X  \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  856. X  \resetmathfonts}
  857. \def\chapfonts{%
  858. X  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
  859. X  \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  860. X  \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  861. X  \resetmathfonts}
  862. \def\secfonts{%
  863. X  \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  864. X  \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  865. X  \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  866. X  \resetmathfonts}
  867. \def\subsecfonts{%
  868. X  \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  869. X  \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  870. X  \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  871. X  \resetmathfonts}
  872. \def\indexfonts{%
  873. X  \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
  874. X  \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
  875. X  \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy
  876. X  \resetmathfonts}
  877. X
  878. % Set up the default fonts, so we can use them for creating boxes.
  879. %
  880. \textfonts
  881. X
  882. % Count depth in font-changes, for error checks
  883. \newcount\fontdepth \fontdepth=0
  884. X
  885. % Fonts for short table of contents.
  886. \font\shortcontrm=cmr12
  887. \font\shortcontbf=cmbx12
  888. \font\shortcontsl=cmsl12
  889. X
  890. %% Add scribe-like font environments, plus @l for inline lisp (usually sans
  891. %% serif) and @ii for TeX italic
  892. X
  893. % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
  894. % unless the following character is such as not to need one.
  895. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
  896. \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
  897. X
  898. \let\i=\smartitalic
  899. \let\var=\smartitalic
  900. \let\dfn=\smartitalic
  901. \let\emph=\smartitalic
  902. \let\cite=\smartitalic
  903. X
  904. \def\b#1{{\bf #1}}
  905. \let\strong=\b
  906. X
  907. % We can't just use \exhyphenpenalty, because that only has effect at
  908. % the end of a paragraph.  Restore normal hyphenation at the end of the
  909. % group within which \nohyphenation is presumably called.
  910. %
  911. \def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
  912. \def\restorehyphenation{\hyphenchar\font = `- }
  913. X
  914. \def\t#1{%
  915. X  {\tt \nohyphenation \rawbackslash \frenchspacing #1}%
  916. X  \null
  917. }
  918. \let\ttfont = \t
  919. %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
  920. \def\samp #1{`\tclose{#1}'\null}
  921. \def\key #1{{\tt \nohyphenation \uppercase{#1}}\null}
  922. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  923. X
  924. \let\file=\samp
  925. X
  926. % @code is a modification of @t,
  927. % which makes spaces the same size as normal in the surrounding text.
  928. \def\tclose#1{%
  929. X  {%
  930. X    % Change normal interword space to be same as for the current font.
  931. X    \spaceskip = \fontdimen2\font
  932. X    %
  933. X    % Switch to typewriter.
  934. X    \tt
  935. X    %
  936. X    % But `\ ' produces the large typewriter interword space.
  937. X    \def\ {{\spaceskip = 0pt{} }}%
  938. X    %
  939. X    % Turn off hyphenation.
  940. X    \nohyphenation
  941. X    %
  942. X    \rawbackslash
  943. X    \frenchspacing
  944. X    #1%
  945. X  }%
  946. X  \null
  947. }
  948. X
  949. % We *must* turn on hyphenation at `-' and `_' in \code.
  950. % Otherwise, it is too hard to avoid overful hboxes
  951. % in the Emacs manual, the Library manual, etc.
  952. X
  953. % Unfortunately, TeX uses one parameter (\hyphenchar) to control
  954. % both hyphenation at - and hyphenation within words.
  955. % We must therefore turn them both off (\tclose does that)
  956. % and arrange explicitly to hyphenate an a dash.
  957. %  -- rms.
  958. {
  959. \catcode `\-=\active
  960. \catcode `\_=\active
  961. \global\def\code{\begingroup \catcode `\-=\active \let-\codedash \let_\codeunder \codex}
  962. }
  963. \def\codedash{-\discretionary{}{}{}}
  964. \def\codeunder{\normalunderscore\discretionary{}{}{}}
  965. \def\codex #1{\tclose{#1}\endgroup}
  966. X
  967. %\let\exp=\tclose  %Was temporary
  968. X
  969. % @kbd is like @code, except that if the argument is just one @key command,
  970. % then @kbd has no effect.
  971. X
  972. \def\xkey{\key}
  973. \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
  974. \ifx\one\xkey\ifx\threex\three \key{#2}%
  975. \else\tclose{\look}\fi
  976. \else\tclose{\look}\fi}
  977. X
  978. % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
  979. % argument is to make the input look right: @dmn{pt} instead of
  980. % @dmn{}pt.
  981. %
  982. \def\dmn#1{\thinspace #1}
  983. X
  984. \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
  985. X
  986. \def\l#1{{\li #1}\null}        %
  987. X
  988. \def\r#1{{\rm #1}}        % roman font
  989. % Use of \lowercase was suggested.
  990. \def\sc#1{{\smallcaps#1}}    % smallcaps font
  991. \def\ii#1{{\it #1}}        % italic font
  992. X
  993. \message{page headings,}
  994. X
  995. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  996. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  997. X
  998. % First the title page.  Must do @settitle before @titlepage.
  999. \def\titlefont#1{{\titlerm #1}}
  1000. X
  1001. \newif\ifseenauthor
  1002. \newif\iffinishedtitlepage
  1003. X
  1004. \def\shorttitlepage{\parsearg\shorttitlepagezzz}
  1005. \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
  1006. X    \endgroup\page\hbox{}\page}
  1007. X
  1008. \def\titlepage{\begingroup \parindent=0pt \textfonts
  1009. X   \let\subtitlerm=\tenrm
  1010. % I deinstalled the following change because \cmr12 is undefined.
  1011. % This change was not in the ChangeLog anyway.  --rms.
  1012. %   \let\subtitlerm=\cmr12
  1013. X   \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
  1014. X   %
  1015. X   \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
  1016. X   %
  1017. X   % Leave some space at the very top of the page.
  1018. X   \vglue\titlepagetopglue
  1019. X   %
  1020. X   % Now you can print the title using @title.
  1021. X   \def\title{\parsearg\titlezzz}%
  1022. X   \def\titlezzz##1{\leftline{\titlefont{##1}}
  1023. X            % print a rule at the page bottom also.
  1024. X            \finishedtitlepagefalse
  1025. X            \vskip4pt \hrule height 4pt \vskip4pt}%
  1026. X   % No rule at page bottom unless we print one at the top with @title.
  1027. X   \finishedtitlepagetrue
  1028. X   %
  1029. X   % Now you can put text using @subtitle.
  1030. X   \def\subtitle{\parsearg\subtitlezzz}%
  1031. X   \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
  1032. X   %
  1033. X   % @author should come last, but may come many times.
  1034. X   \def\author{\parsearg\authorzzz}%
  1035. X   \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
  1036. X      {\authorfont \leftline{##1}}}%
  1037. X   %
  1038. X   % Most title ``pages'' are actually two pages long, with space
  1039. X   % at the top of the second.  We don't want the ragged left on the second.
  1040. X   \let\oldpage = \page
  1041. X   \def\page{%
  1042. X      \iffinishedtitlepage\else
  1043. X     \finishtitlepage
  1044. X      \fi
  1045. X      \oldpage
  1046. X      \let\page = \oldpage
  1047. X      \hbox{}}%
  1048. %   \def\page{\oldpage \hbox{}}
  1049. }
  1050. X
  1051. \def\Etitlepage{%
  1052. X   \iffinishedtitlepage\else
  1053. X      \finishtitlepage
  1054. X   \fi
  1055. X   % It is important to do the page break before ending the group,
  1056. X   % because the headline and footline are only empty inside the group.
  1057. X   % If we use the new definition of \page, we always get a blank page
  1058. X   % after the title page, which we certainly don't want.
  1059. X   \oldpage
  1060. X   \endgroup
  1061. X   \HEADINGSon
  1062. }
  1063. X
  1064. \def\finishtitlepage{%
  1065. X   \vskip4pt \hrule height 2pt
  1066. X   \vskip\titlepagebottomglue
  1067. X   \finishedtitlepagetrue
  1068. }
  1069. X
  1070. %%% Set up page headings and footings.
  1071. X
  1072. \let\thispage=\folio
  1073. X
  1074. \newtoks \evenheadline    % Token sequence for heading line of even pages
  1075. \newtoks \oddheadline     % Token sequence for heading line of odd pages
  1076. \newtoks \evenfootline    % Token sequence for footing line of even pages
  1077. \newtoks \oddfootline     % Token sequence for footing line of odd pages
  1078. X
  1079. % Now make Tex use those variables
  1080. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  1081. X                            \else \the\evenheadline \fi}}
  1082. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  1083. X                            \else \the\evenfootline \fi}\HEADINGShook}
  1084. \let\HEADINGShook=\relax
  1085. X
  1086. % Commands to set those variables.
  1087. % For example, this is what  @headings on  does
  1088. % @evenheading @thistitle|@thispage|@thischapter
  1089. % @oddheading @thischapter|@thispage|@thistitle
  1090. % @evenfooting @thisfile||
  1091. % @oddfooting ||@thisfile
  1092. X
  1093. \def\evenheading{\parsearg\evenheadingxxx}
  1094. \def\oddheading{\parsearg\oddheadingxxx}
  1095. \def\everyheading{\parsearg\everyheadingxxx}
  1096. X
  1097. \def\evenfooting{\parsearg\evenfootingxxx}
  1098. \def\oddfooting{\parsearg\oddfootingxxx}
  1099. \def\everyfooting{\parsearg\everyfootingxxx}
  1100. X
  1101. {\catcode`\@=0 %
  1102. X
  1103. \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
  1104. \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
  1105. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  1106. X
  1107. \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
  1108. \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
  1109. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  1110. X
  1111. \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
  1112. \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
  1113. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  1114. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  1115. X
  1116. \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
  1117. \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
  1118. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  1119. X
  1120. \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
  1121. \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
  1122. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  1123. X
  1124. \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
  1125. \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
  1126. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  1127. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  1128. %
  1129. }% unbind the catcode of @.
  1130. X
  1131. % @headings double    turns headings on for double-sided printing.
  1132. % @headings single    turns headings on for single-sided printing.
  1133. % @headings off        turns them off.
  1134. % @headings on        same as @headings double, retained for compatibility.
  1135. % @headings after    turns on double-sided headings after this page.
  1136. % @headings doubleafter    turns on double-sided headings after this page.
  1137. % @headings singleafter turns on single-sided headings after this page.
  1138. % By default, they are off.
  1139. X
  1140. \def\headings #1 {\csname HEADINGS#1\endcsname}
  1141. X
  1142. \def\HEADINGSoff{
  1143. \global\evenheadline={\hfil} \global\evenfootline={\hfil}
  1144. \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
  1145. \HEADINGSoff
  1146. % When we turn headings on, set the page number to 1.
  1147. % For double-sided printing, put current file name in lower left corner,
  1148. % chapter name on inside top of right hand pages, document
  1149. % title on inside top of left hand pages, and page numbers on outside top
  1150. % edge of all pages.
  1151. \def\HEADINGSdouble{
  1152. %\pagealignmacro
  1153. \global\pageno=1
  1154. \global\evenfootline={\hfil}
  1155. \global\oddfootline={\hfil}
  1156. \global\evenheadline={\line{\folio\hfil\thistitle}}
  1157. \global\oddheadline={\line{\thischapter\hfil\folio}}
  1158. }
  1159. % For single-sided printing, chapter title goes across top left of page,
  1160. % page number on top right.
  1161. \def\HEADINGSsingle{
  1162. %\pagealignmacro
  1163. \global\pageno=1
  1164. \global\evenfootline={\hfil}
  1165. \global\oddfootline={\hfil}
  1166. \global\evenheadline={\line{\thischapter\hfil\folio}}
  1167. \global\oddheadline={\line{\thischapter\hfil\folio}}
  1168. }
  1169. \def\HEADINGSon{\HEADINGSdouble}
  1170. X
  1171. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  1172. \let\HEADINGSdoubleafter=\HEADINGSafter
  1173. \def\HEADINGSdoublex{%
  1174. \global\evenfootline={\hfil}
  1175. \global\oddfootline={\hfil}
  1176. \global\evenheadline={\line{\folio\hfil\thistitle}}
  1177. \global\oddheadline={\line{\thischapter\hfil\folio}}
  1178. }
  1179. X
  1180. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  1181. \def\HEADINGSsinglex{%
  1182. \global\evenfootline={\hfil}
  1183. \global\oddfootline={\hfil}
  1184. \global\evenheadline={\line{\thischapter\hfil\folio}}
  1185. \global\oddheadline={\line{\thischapter\hfil\folio}}
  1186. }
  1187. X
  1188. % Subroutines used in generating headings
  1189. % Produces Day Month Year style of output.
  1190. \def\today{\number\day\space
  1191. \ifcase\month\or
  1192. January\or February\or March\or April\or May\or June\or
  1193. July\or August\or September\or October\or November\or December\fi
  1194. \space\number\year}
  1195. X
  1196. % Use this if you want the Month Day, Year style of output.
  1197. %\def\today{\ifcase\month\or
  1198. %January\or February\or March\or April\or May\or June\or
  1199. %July\or August\or September\or October\or November\or December\fi
  1200. %\space\number\day, \number\year}
  1201. X
  1202. % @settitle line...  specifies the title of the document, for headings
  1203. % It generates no output of its own
  1204. X
  1205. \def\thistitle{No Title}
  1206. \def\settitle{\parsearg\settitlezzz}
  1207. \def\settitlezzz #1{\gdef\thistitle{#1}}
  1208. X
  1209. \message{tables,}
  1210. X
  1211. % @tabs -- simple alignment
  1212. X
  1213. % These don't work.  For one thing, \+ is defined as outer.
  1214. % So these macros cannot even be defined.
  1215. X
  1216. %\def\tabs{\parsearg\tabszzz}
  1217. %\def\tabszzz #1{\settabs\+#1\cr}
  1218. %\def\tabline{\parsearg\tablinezzz}
  1219. %\def\tablinezzz #1{\+#1\cr}
  1220. %\def\&{&}
  1221. X
  1222. % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
  1223. X
  1224. % default indentation of table text
  1225. \newdimen\tableindent \tableindent=.8in
  1226. % default indentation of @itemize and @enumerate text
  1227. \newdimen\itemindent  \itemindent=.3in
  1228. % margin between end of table item and start of table text.
  1229. \newdimen\itemmargin  \itemmargin=.1in
  1230. X
  1231. % used internally for \itemindent minus \itemmargin
  1232. \newdimen\itemmax
  1233. X
  1234. % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
  1235. % these defs.
  1236. % They also define \itemindex
  1237. % to index the item name in whatever manner is desired (perhaps none).
  1238. X
  1239. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  1240. \def\internalBitemx{\par \parsearg\itemzzz}
  1241. X
  1242. \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
  1243. \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
  1244. X
  1245. \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
  1246. \def\internalBkitemx{\par \parsearg\kitemzzz}
  1247. X
  1248. \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
  1249. X                 \itemzzz {#1}}
  1250. X
  1251. \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
  1252. X                 \itemzzz {#1}}
  1253. X
  1254. \def\itemzzz #1{\begingroup %
  1255. X  \advance\hsize by -\rightskip
  1256. X  \advance\hsize by -\tableindent
  1257. X  \setbox0=\hbox{\itemfont{#1}}%
  1258. X  \itemindex{#1}%
  1259. X  \nobreak % This prevents a break before @itemx.
  1260. X  %
  1261. X  % Be sure we are not still in the middle of a paragraph.
  1262. X  {\parskip = 0in
  1263. X  \par
  1264. X  }%
  1265. X  %
  1266. X  % If the item text does not fit in the space we have, put it on a line
  1267. X  % by itself, and do not allow a page break either before or after that
  1268. X  % line.  We do not start a paragraph here because then if the next
  1269. X  % command is, e.g., @kindex, the whatsit would get put into the
  1270. X  % horizontal list on a line by itself, resulting in extra blank space.
  1271. X  \ifdim \wd0>\itemmax
  1272. X    \setbox0=\hbox{\hskip \leftskip \hskip -\tableindent \unhbox0}\box0
  1273. X    %
  1274. X    % We're going to be starting a paragraph, but we don't want the
  1275. X    % \parskip glue -- logically it's part of the @item we just started.
  1276. X    \nobreak \vskip-\parskip
  1277. X    %
  1278. X    % Stop a page break at the \parskip glue coming up.  Unfortunately
  1279. X    % we can't prevent a possible page break at the following
  1280. X    % \baselineskip glue.
  1281. X    \nobreak
  1282. X  \else
  1283. X    % The item text fits into the space.  Start a paragraph, so that the
  1284. X    % following text (if any) will end up on the same line.  Since that
  1285. X    % text will be indented by \tableindent, we make the item text be in
  1286. X    % a zero-width box.
  1287. X    \noindent
  1288. X    \rlap{\hskip -\tableindent\box0}%
  1289. X  \fi
  1290. X  \endgroup
  1291. }
  1292. X
  1293. \def\item{\errmessage{@item while not in a table}}
  1294. \def\itemx{\errmessage{@itemx while not in a table}}
  1295. \def\kitem{\errmessage{@kitem while not in a table}}
  1296. \def\kitemx{\errmessage{@kitemx while not in a table}}
  1297. \def\xitem{\errmessage{@xitem while not in a table}}
  1298. \def\xitemx{\errmessage{@xitemx while not in a table}}
  1299. X
  1300. %% Contains a kludge to get @end[description] to work
  1301. \def\description{\tablez{\dontindex}{1}{}{}{}{}}
  1302. X
  1303. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
  1304. {\obeylines\obeyspaces%
  1305. \gdef\tablex #1^^M{%
  1306. \tabley\dontindex#1        \endtabley}}
  1307. X
  1308. \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
  1309. {\obeylines\obeyspaces%
  1310. \gdef\ftablex #1^^M{%
  1311. \tabley\fnitemindex#1        \endtabley
  1312. \def\Eftable{\endgraf\afterenvbreak\endgroup}%
  1313. \let\Etable=\relax}}
  1314. X
  1315. \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
  1316. {\obeylines\obeyspaces%
  1317. \gdef\vtablex #1^^M{%
  1318. \tabley\vritemindex#1        \endtabley
  1319. \def\Evtable{\endgraf\afterenvbreak\endgroup}%
  1320. \let\Etable=\relax}}
  1321. X
  1322. \def\dontindex #1{}
  1323. \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
  1324. \def\vritemindex #1{\doind {vr}{\code{#1}}}%
  1325. X
  1326. {\obeyspaces %
  1327. \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
  1328. \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
  1329. X
  1330. \def\tablez #1#2#3#4#5#6{%
  1331. \aboveenvbreak %
  1332. \begingroup %
  1333. \def\Edescription{\Etable}% Neccessary kludge.
  1334. \let\itemindex=#1%
  1335. \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
  1336. \ifnum 0#4>0 \tableindent=#4\mil \fi %
  1337. \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
  1338. \def\itemfont{#2}%
  1339. \itemmax=\tableindent %
  1340. \advance \itemmax by -\itemmargin %
  1341. \advance \leftskip by \tableindent %
  1342. \exdentamount=\tableindent
  1343. \parindent = 0pt
  1344. \parskip = \smallskipamount
  1345. \ifdim \parskip=0pt \parskip=2pt \fi%
  1346. \def\Etable{\endgraf\afterenvbreak\endgroup}%
  1347. \let\item = \internalBitem %
  1348. \let\itemx = \internalBitemx %
  1349. \let\kitem = \internalBkitem %
  1350. \let\kitemx = \internalBkitemx %
  1351. \let\xitem = \internalBxitem %
  1352. \let\xitemx = \internalBxitemx %
  1353. }
  1354. X
  1355. % This is the counter used by @enumerate, which is really @itemize
  1356. X
  1357. \newcount \itemno
  1358. X
  1359. \def\itemize{\parsearg\itemizezzz}
  1360. X
  1361. \def\itemizezzz #1{%
  1362. X  \begingroup % ended by the @end itemsize
  1363. X  \itemizey {#1}{\Eitemize}
  1364. }
  1365. X
  1366. \def\itemizey #1#2{%
  1367. \aboveenvbreak %
  1368. \itemmax=\itemindent %
  1369. \advance \itemmax by -\itemmargin %
  1370. \advance \leftskip by \itemindent %
  1371. \exdentamount=\itemindent
  1372. \parindent = 0pt %
  1373. \parskip = \smallskipamount %
  1374. \ifdim \parskip=0pt \parskip=2pt \fi%
  1375. \def#2{\endgraf\afterenvbreak\endgroup}%
  1376. \def\itemcontents{#1}%
  1377. \let\item=\itemizeitem}
  1378. X
  1379. % Set sfcode to normal for the chars that usually have another value.
  1380. % These are `.?!:;,'
  1381. \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
  1382. X  \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
  1383. X
  1384. % \splitoff TOKENS\endmark defines \first to be the first token in
  1385. % TOKENS, and \rest to be the remainder.
  1386. %
  1387. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  1388. X
  1389. % Allow an optional argument of an uppercase letter, lowercase letter,
  1390. % or number, to specify the first label in the enumerated list.  No
  1391. % argument is the same as `1'.
  1392. %
  1393. \def\enumerate{\parsearg\enumeratezzz}
  1394. \def\enumeratezzz #1{\enumeratey #1  \endenumeratey}
  1395. \def\enumeratey #1 #2\endenumeratey{%
  1396. X  \begingroup % ended by the @end enumerate
  1397. X  %
  1398. X  % If we were given no argument, pretend we were given `1'.
  1399. X  \def\thearg{#1}%
  1400. X  \ifx\thearg\empty \def\thearg{1}\fi
  1401. X  %
  1402. X  % Detect if the argument is a single token.  If so, it might be a
  1403. X  % letter.  Otherwise, the only valid thing it can be is a number.
  1404. X  % (We will always have one token, because of the test we just made.
  1405. X  % This is a good thing, since \splitoff doesn't work given nothing at
  1406. X  % all -- the first parameter is undelimited.)
  1407. X  \expandafter\splitoff\thearg\endmark
  1408. X  \ifx\rest\empty
  1409. X    % Only one token in the argument.  It could still be anything.
  1410. X    % A ``lowercase letter'' is one whose \lccode is nonzero.
  1411. X    % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  1412. X    %   not equal to itself.
  1413. X    % Otherwise, we assume it's a number.
  1414. X    %
  1415. X    % We need the \relax at the end of the \ifnum lines to stop TeX from
  1416. X    % continuing to look for a <number>.
  1417. X    %
  1418. X    \ifnum\lccode\expandafter`\thearg=0\relax
  1419. X      \numericenumerate % a number (we hope)
  1420. X    \else
  1421. X      % It's a letter.
  1422. X      \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  1423. X        \lowercaseenumerate % lowercase letter
  1424. X      \else
  1425. X        \uppercaseenumerate % uppercase letter
  1426. X      \fi
  1427. X    \fi
  1428. X  \else
  1429. X    % Multiple tokens in the argument.  We hope it's a number.
  1430. X    \numericenumerate
  1431. X  \fi
  1432. }
  1433. X
  1434. % An @enumerate whose labels are integers.  The starting integer is
  1435. % given in \thearg.
  1436. %
  1437. \def\numericenumerate{%
  1438. X  \itemno = \thearg
  1439. X  \startenumeration{\the\itemno}%
  1440. }
  1441. X
  1442. % The starting (lowercase) letter is in \thearg.
  1443. \def\lowercaseenumerate{%
  1444. X  \itemno = \expandafter`\thearg
  1445. X  \startenumeration{%
  1446. X    % Be sure we're not beyond the end of the alphabet.
  1447. X    \ifnum\itemno=0
  1448. X      \errmessage{No more lowercase letters in @enumerate; get a bigger
  1449. X                  alphabet}%
  1450. X    \fi
  1451. X    \char\lccode\itemno
  1452. X  }%
  1453. }
  1454. X
  1455. % The starting (uppercase) letter is in \thearg.
  1456. \def\uppercaseenumerate{%
  1457. X  \itemno = \expandafter`\thearg
  1458. X  \startenumeration{%
  1459. X    % Be sure we're not beyond the end of the alphabet.
  1460. X    \ifnum\itemno=0
  1461. X      \errmessage{No more uppercase letters in @enumerate; get a bigger
  1462. X                  alphabet}
  1463. X    \fi
  1464. X    \char\uccode\itemno
  1465. X  }%
  1466. }
  1467. X
  1468. % Call itemizey, adding a period to the first argument and supplying the
  1469. % common last two arguments.  Also subtract one from the initial value in
  1470. % \itemno, since @item increments \itemno.
  1471. %
  1472. \def\startenumeration#1{%
  1473. X  \advance\itemno by -1
  1474. X  \itemizey{#1.}\Eenumerate\flushcr
  1475. }
  1476. X
  1477. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  1478. % to @enumerate.
  1479. %
  1480. \def\alphaenumerate{\enumerate{a}}
  1481. \def\capsenumerate{\enumerate{A}}
  1482. \def\Ealphaenumerate{\Eenumerate}
  1483. \def\Ecapsenumerate{\Eenumerate}
  1484. X
  1485. % Definition of @item while inside @itemize.
  1486. X
  1487. \def\itemizeitem{%
  1488. \advance\itemno by 1
  1489. {\let\par=\endgraf \smallbreak}%
  1490. \ifhmode \errmessage{\in hmode at itemizeitem}\fi
  1491. {\parskip=0in \hskip 0pt
  1492. \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
  1493. \vadjust{\penalty 1200}}%
  1494. \flushcr}
  1495. X
  1496. \message{indexing,}
  1497. % Index generation facilities
  1498. X
  1499. % Define \newwrite to be identical to plain tex's \newwrite
  1500. % except not \outer, so it can be used within \newindex.
  1501. {\catcode`\@=11
  1502. \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
  1503. X
  1504. % \newindex {foo} defines an index named foo.
  1505. % It automatically defines \fooindex such that
  1506. % \fooindex ...rest of line... puts an entry in the index foo.
  1507. % It also defines \fooindfile to be the number of the output channel for
  1508. % the file that    accumulates this index.  The file's extension is foo.
  1509. % The name of an index should be no more than 2 characters long
  1510. % for the sake of vms.
  1511. X
  1512. \def\newindex #1{
  1513. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  1514. \openout \csname#1indfile\endcsname \jobname.#1    % Open the file
  1515. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1516. \noexpand\doindex {#1}}
  1517. }
  1518. X
  1519. % @defindex foo  ==  \newindex{foo}
  1520. X
  1521. \def\defindex{\parsearg\newindex}
  1522. X
  1523. % Define @defcodeindex, like @defindex except put all entries in @code.
  1524. X
  1525. \def\newcodeindex #1{
  1526. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  1527. \openout \csname#1indfile\endcsname \jobname.#1    % Open the file
  1528. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1529. \noexpand\docodeindex {#1}}
  1530. }
  1531. X
  1532. \def\defcodeindex{\parsearg\newcodeindex}
  1533. X
  1534. % @synindex foo bar    makes index foo feed into index bar.
  1535. % Do this instead of @defindex foo if you don't want it as a separate index.
  1536. \def\synindex #1 #2 {%
  1537. \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
  1538. SHAR_EOF
  1539. true || echo 'restore of bcs-2.0/doc/texinfo.tex failed'
  1540. fi
  1541. echo 'End of bcs-2.0 part 7'
  1542. echo 'File bcs-2.0/doc/texinfo.tex is continued in part 8'
  1543. echo 8 > _shar_seq_.tmp
  1544. exit 0
  1545.