texinfo.tex
上传用户:shenzhenrh
上传日期:2013-05-12
资源大小:2904k
文件大小:161k
源码类别:

信息检索与抽取

开发平台:

Unix_Linux

  1. %% TeX macros to handle Texinfo files.
  2. %% $Id: texinfo.tex,v 1.1.1.1 1999/03/14 19:19:20 mgd Exp $
  3. %  Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
  4. %                94, 95, 96, 97 Free Software Foundation, Inc.
  5. %This texinfo.tex file is free software; you can redistribute it and/or
  6. %modify it under the terms of the GNU General Public License as
  7. %published by the Free Software Foundation; either version 2, or (at
  8. %your option) any later version.
  9. %This texinfo.tex file is distributed in the hope that it will be
  10. %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  11. %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. %General Public License for more details.
  13. %You should have received a copy of the GNU General Public License
  14. %along with this texinfo.tex file; see the file COPYING.  If not, write
  15. %to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  16. %Boston, MA 02111-1307, USA.
  17. %In other words, you are welcome to use, share and improve this program.
  18. %You are forbidden to forbid anyone else to use, share and improve
  19. %what you give them.   Help stamp out software-hoarding!
  20. % Send bug reports to bug-texinfo@prep.ai.mit.edu.
  21. % Please include a *precise* test case in each bug report.
  22. % Make it possible to create a .fmt file just by loading this file:
  23. % if the underlying format is not loaded, start by loading it now.
  24. % Added by gildea November 1993.
  25. expandafterifxcsname fmtnameendcsnamerelaxinput plainfi
  26. % This automatically updates the version number based on RCS.
  27. defdeftexinfoversion$#1: #2 ${deftexinfoversion{#2}}
  28. deftexinfoversion$Revision: 1.1.1.1 $
  29. message{Loading texinfo package [Version texinfoversion]:}
  30. % If in a .fmt file, print the version number
  31. % and turn on active characters that we couldn't do earlier because
  32. % they might have appeared in the input file name.
  33. everyjob{message{[Texinfo version texinfoversion]}message{}
  34.   catcode`+=active catcode`_=active}
  35. % Save some parts of plain tex whose names we will redefine.
  36. letptexb=b
  37. letptexbullet=bullet
  38. letptexc=c
  39. letptexcomma=,
  40. letptexdot=.
  41. letptexdots=dots
  42. letptexend=end
  43. letptexequiv = equiv
  44. letptexi=i
  45. letptexlbrace={
  46. letptexrbrace=}
  47. letptexstar=*
  48. letptext=t
  49. % Be sure we're in horizontal mode when doing a tie, since we make space
  50. % equivalent to this in @example-like environments. Otherwise, a space
  51. % at the beginning of a line will start with penalty -- and
  52. % since penalty is valid in vertical mode, we'd end up putting the
  53. % penalty on the vertical list instead of in the new paragraph.
  54. {catcode`@ = 11
  55.  % Avoid using @M directly, because that causes trouble
  56.  % if the definition is written into an index file.
  57.  globallettiepenalty = @M
  58.  gdeftie{leavevmodepenaltytiepenalty }
  59. }
  60. message{Basics,}
  61. chardefother=12
  62. % If this character appears in an error message or help string, it
  63. % starts a new line in the output.
  64. newlinechar = `^^J
  65. % Set up fixed words for English.
  66. ifxputwordChapterundefined{gdefputwordChapter{Chapter}}fi%
  67. defputwordInfo{Info}%
  68. ifxputwordSeeundefined{gdefputwordSee{See}}fi%
  69. ifxputwordseeundefined{gdefputwordsee{see}}fi%
  70. ifxputwordfileundefined{gdefputwordfile{file}}fi%
  71. ifxputwordpageundefined{gdefputwordpage{page}}fi%
  72. ifxputwordsectionundefined{gdefputwordsection{section}}fi%
  73. ifxputwordSectionundefined{gdefputwordSection{Section}}fi%
  74. ifxputwordTableofContentsundefined{gdefputwordTableofContents{Table of Contents}}fi%
  75. ifxputwordShortContentsundefined{gdefputwordShortContents{Short Contents}}fi%
  76. ifxputwordAppendixundefined{gdefputwordAppendix{Appendix}}fi%
  77. % Ignore a token.
  78. %
  79. defgobble#1{}
  80. hyphenation{ap-pen-dix}
  81. hyphenation{mini-buf-fer mini-buf-fers}
  82. hyphenation{eshell}
  83. hyphenation{white-space}
  84. % Margin to add to right of even pages, to left of odd pages.
  85. newdimen bindingoffset
  86. newdimen normaloffset
  87. newdimenpagewidth newdimenpageheight
  88. % Sometimes it is convenient to have everything in the transcript file
  89. % and nothing on the terminal.  We don't just call tracingall here,
  90. % since that produces some useless output on the terminal.
  91. %
  92. defgloggingall{begingroup globaldefs = 1 loggingall endgroup}%
  93. defloggingall{tracingcommands2 tracingstats2
  94.    tracingpages1 tracingoutput1 tracinglostchars1
  95.    tracingmacros2 tracingparagraphs1 tracingrestores1
  96.    showboxbreadthmaxdimenshowboxdepthmaxdimen
  97. }%
  98. % For @cropmarks command.
  99. % Do @cropmarks to get crop marks.
  100. newififcropmarks
  101. letcropmarks = cropmarkstrue
  102. %
  103. % Dimensions to add cropmarks at corners.
  104. % Added by P. A. MacKay, 12 Nov. 1986
  105. %
  106. newdimencornerlong newdimencornerthick
  107. newdimentopandbottommargin
  108. newdimenouterhsize newdimenoutervsize
  109. cornerlong=1pccornerthick=.3pt        % These set size of cropmarks
  110. outerhsize=7in
  111. %outervsize=9.5in
  112. % Alternative @smallbook page size is 9.25in
  113. outervsize=9.25in
  114. topandbottommargin=.75in
  115. % Main output routine.
  116. chardefPAGE = 255
  117. output = {onepageout{pagecontentsPAGE}}
  118. newboxheadlinebox
  119. newboxfootlinebox
  120. % onepageout takes a vbox as an argument.  Note that pagecontents
  121. % does insertions, but you have to call it yourself.
  122. defonepageout#1{%
  123.   ifcropmarks hoffset=0pt else hoffset=normaloffset fi
  124.   %
  125.   ifoddpageno  advancehoffset by bindingoffset
  126.   else advancehoffset by -bindingoffsetfi
  127.   %
  128.   % Do this outside of the shipout so @code etc. will be expanded in
  129.   % the headline as they should be, not taken literally (outputting ''code).
  130.   setboxheadlinebox = vbox{lethsize=pagewidth makeheadline}%
  131.   setboxfootlinebox = vbox{lethsize=pagewidth makefootline}%
  132.   %
  133.   {%
  134.     % Have to do this stuff outside the shipout because we want it to
  135.     % take effect in write's, yet the group defined by the vbox ends
  136.     % before the shipout runs.
  137.     %
  138.     escapechar = `\     % use backslash in output files.
  139.     indexdummies         % don't expand commands in the output.
  140.     normalturnoffactive  %  in index entries must not stay , e.g., if
  141.                    % the page break happens to be in the middle of an example.
  142.     shipoutvbox{%
  143.       ifcropmarks vbox to outervsizebgroup
  144.         hsize = outerhsize
  145.         line{ewtophfilewtop}%
  146.         nointerlineskip
  147.         line{%
  148.           vbox{moveleftcornerthicknstop}%
  149.           hfill
  150.           vbox{moverightcornerthicknstop}%
  151.         }%
  152.         vskiptopandbottommargin
  153.         linebgroup
  154.           hfil % center the page within the outer (page) hsize.
  155.           ifoddpagenohskipbindingoffsetfi
  156.           vboxbgroup
  157.       fi
  158.       %
  159.       unvboxheadlinebox
  160.       pagebody{#1}%
  161.       ifdimhtfootlinebox > 0pt
  162.         % Only leave this space if the footline is nonempty.
  163.         % (We lessened vsize for it in oddfootingxxx.)
  164.         % The baselineskip=24pt in plain's makefootline has no effect.
  165.         vskip 2baselineskip
  166.         unvboxfootlinebox
  167.       fi
  168.       %
  169.       ifcropmarks
  170.           egroup % end of vboxbgroup
  171.         hfilegroup % end of (centering) linebgroup
  172.         vskiptopandbottommargin plus1fill minus1fill
  173.         boxmaxdepth = cornerthick
  174.         line{%
  175.           vbox{moveleftcornerthicknsbot}%
  176.           hfill
  177.           vbox{moverightcornerthicknsbot}%
  178.         }%
  179.         nointerlineskip
  180.         line{ewbothfilewbot}%
  181.       egroup % vbox from first cropmarks clause
  182.       fi
  183.     }% end of shipoutvbox
  184.   }% end of group with turnoffactive
  185.   advancepageno
  186.   ifnumoutputpenalty>-20000 elsedosuperejectfi
  187. }
  188. newinsertmargin dimenmargin=maxdimen
  189. defpagebody#1{vbox topageheight{boxmaxdepth=maxdepth #1}}
  190. {catcode`@ =11
  191. gdefpagecontents#1{ifvoidtopinselseunvboxtopinsfi
  192. % marginal hacks, juha@viisa.uucp (Juha Takala)
  193. ifvoidmarginelse % marginal info is present
  194.   rlap{kernhsizevbox toz@{kern1ptboxmargin vss}}fi
  195. dimen@=dp#1 unvbox#1
  196. ifvoidfootinselsevskipskipfootinsfootnoterule unvboxfootinsfi
  197. ifr@ggedbottom kern-dimen@ vfil fi}
  198. }
  199. % Here are the rules for the cropmarks.  Note that they are
  200. % offset so that the space between them is truly outerhsize or outervsize
  201. % (P. A. MacKay, 12 November, 1986)
  202. %
  203. defewtop{vrule heightcornerthick depth0pt widthcornerlong}
  204. defnstop{vbox
  205.   {hrule heightcornerthick depthcornerlong widthcornerthick}}
  206. defewbot{vrule height0pt depthcornerthick widthcornerlong}
  207. defnsbot{vbox
  208.   {hrule heightcornerlong depthcornerthick widthcornerthick}}
  209. % Parse an argument, then pass it to #1.  The argument is the rest of
  210. % the input line (except we remove a trailing comment).  #1 should be a
  211. % macro which expects an ordinary undelimited TeX argument.
  212. %
  213. defparsearg#1{%
  214.   letnext = #1%
  215.   begingroup
  216.     obeylines
  217.     futurelettempparseargx
  218. }
  219. % If the next token is an obeyed space (from an @example environment or
  220. % the like), remove it and recurse.  Otherwise, we're done.
  221. defparseargx{%
  222.   % obeyedspace is defined far below, after the definition of sepspaces.
  223.   ifxobeyedspacetemp
  224.     expandafterparseargdiscardspace
  225.   else
  226.     expandafterparseargline
  227.   fi
  228. }
  229. % Remove a single space (as the delimiter token to the macro call).
  230. {obeyspaces %
  231.  gdefparseargdiscardspace {futurelettempparseargx}}
  232. {obeylines %
  233.   gdefparseargline#1^^M{%
  234.     endgroup % End of the group started in parsearg.
  235.     %
  236.     % First remove any @c comment, then any @comment.
  237.     % Result of each macro is put in toks0.
  238.     argremovec #1crelax %
  239.     expandafterargremovecomment thetoks0 commentrelax %
  240.     %
  241.     % Call the caller's macro, saved as next in parsearg.
  242.     expandafternextexpandafter{thetoks0}%
  243.   }%
  244. }
  245. % Since all c{,omment} does is throw away the argument, we can let TeX
  246. % do that for us.  The relax here is matched by the relax in the call
  247. % in parseargline; it could be more or less anything, its purpose is
  248. % just to delimit the argument to the c.
  249. defargremovec#1c#2relax{toks0 = {#1}}
  250. defargremovecomment#1comment#2relax{toks0 = {#1}}
  251. % argremovec{,omment} might leave us with trailing spaces, though; e.g.,
  252. %    @end itemize  @c foo
  253. % will have two active spaces as part of the argument with the
  254. % `itemize'.  Here we remove all active spaces from #1, and assign the
  255. % result to toks0.
  256. %
  257. % This loses if there are any *other* active characters besides spaces
  258. % in the argument -- _ ^ +, for example -- since they get expanded.
  259. % Fortunately, Texinfo does not define any such commands.  (If it ever
  260. % does, the catcode of the characters in questionwill have to be changed
  261. % here.)  But this means we cannot call removeactivespaces as part of
  262. % argremovec{,omment}, since @c uses parsearg, and thus the argument
  263. % that parsearg gets might well have any character at all in it.
  264. %
  265. defremoveactivespaces#1{%
  266.   begingroup
  267.     ignoreactivespaces
  268.     edeftemp{#1}%
  269.     globaltoks0 = expandafter{temp}%
  270.   endgroup
  271. }
  272. % Change the active space to expand to nothing.
  273. %
  274. begingroup
  275.   obeyspaces
  276.   gdefignoreactivespaces{obeyspaceslet =empty}
  277. endgroup
  278. defflushcr{ifxparlisppar defnext##1{}else letnext=relax fi next}
  279. %% These are used to keep @begin/@end levels from running away
  280. %% Call inENV within environments (after a begingroup)
  281. newififENV ENVfalse definENV{ifENVrelaxelseENVtruefi}
  282. defENVcheck{%
  283. ifENVerrmessage{Still within an environment.  Type Return to continue.}
  284. endgroupfi} % This is not perfect, but it should reduce lossage
  285. % @begin foo  is the same as @foo, for now.
  286. newhelpEMsimple{Type <Return> to continue.}
  287. outerdefbegin{parseargbeginxxx}
  288. defbeginxxx #1{%
  289. expandafterifxcsname #1endcsnamerelax
  290. {errhelp=EMsimple errmessage{Undefined command @begin #1}}else
  291. csname #1endcsnamefi}
  292. % @end foo executes the definition of Efoo.
  293. %
  294. defend{parseargendxxx}
  295. defendxxx #1{%
  296.   removeactivespaces{#1}%
  297.   edefendthing{thetoks0}%
  298.   %
  299.   expandafterifxcsname Eendthingendcsnamerelax
  300.     expandafterifxcsname endthingendcsnamerelax
  301.       % There's no foo, i.e., no ``environment'' foo.
  302.       errhelp = EMsimple
  303.       errmessage{Undefined command `@end endthing'}%
  304.     else
  305.       unmatchedenderrorendthing
  306.     fi
  307.   else
  308.     % Everything's ok; the right environment has been started.
  309.     csname Eendthingendcsname
  310.   fi
  311. }
  312. % There is an environment #1, but it hasn't been started.  Give an error.
  313. %
  314. defunmatchedenderror#1{%
  315.   errhelp = EMsimple
  316.   errmessage{This `@end #1' doesn't have a matching `@#1'}%
  317. }
  318. % Define the control sequence E#1 to give an unmatched @end error.
  319. %
  320. defdefineunmatchedend#1{%
  321.   expandafterdefcsname E#1endcsname{unmatchedenderror{#1}}%
  322. }
  323. % Single-spacing is done by various environments (specifically, in
  324. % nonfillstart and quotations).
  325. newskipsinglespaceskip singlespaceskip = 12.5pt
  326. defsinglespace{%
  327.   % Why was this kern here?  It messes up equalizing space above and below
  328.   % environments.  --karl, 6may93
  329.   %{advance baselineskip by -singlespaceskip
  330.   %kern baselineskip}%
  331.   setleading singlespaceskip
  332. }
  333. %% Simple single-character @ commands
  334. % @@ prints an @
  335. % Kludge this until the fonts are right (grr).
  336. def@{{tt char '100}}
  337. % This is turned off because it was never documented
  338. % and you can use @w{...} around a quote to suppress ligatures.
  339. %% Define @` and @' to be the same as ` and '
  340. %% but suppressing ligatures.
  341. %def`{{`}}
  342. %def'{{'}}
  343. % Used to generate quoted braces.
  344. defmylbrace {{tt char '173}}
  345. defmyrbrace {{tt char '175}}
  346. let{=mylbrace
  347. let}=myrbrace
  348. begingroup
  349.   % Definitions to produce actual { & } command in an index.
  350.   catcode`{ = 12 catcode`} = 12
  351.   catcode`[ = 1 catcode`] = 2
  352.   catcode`@ = 0 catcode`\ = 12
  353.   @gdef@lbracecmd[{]%
  354.   @gdef@rbracecmd[}]%
  355. @endgroup
  356. % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
  357. % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
  358. let, = c
  359. letdotaccent = .
  360. defringaccent#1{{accent23 #1}}
  361. lettieaccent = t
  362. letubaraccent = b
  363. letudotaccent = d
  364. % Other special characters: @questiondown @exclamdown
  365. % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
  366. defquestiondown{?`}
  367. defexclamdown{!`}
  368. % Dotless i and dotless j, used for accents.
  369. defimacro{i}
  370. defjmacro{j}
  371. defdotless#1{%
  372.   deftemp{#1}%
  373.   ifxtempimacro ptexi
  374.   elseifxtempjmacro j
  375.   else errmessage{@dotless can be used only with i or j}%
  376.   fifi
  377. }
  378. % @: forces normal size whitespace following.
  379. def:{spacefactor=1000 }
  380. % @* forces a line break.
  381. def*{hfilbreakhbox{}ignorespaces}
  382. % @. is an end-of-sentence period.
  383. def.{.spacefactor=3000 }
  384. % @enddots{} is an end-of-sentence ellipsis.
  385. gdefenddots{$mathinner{ldotpldotpldotpldotp}$spacefactor=3000}
  386. % @! is an end-of-sentence bang.
  387. gdef!{!spacefactor=3000 }
  388. % @? is an end-of-sentence query.
  389. gdef?{?spacefactor=3000 }
  390. % @w prevents a word break.  Without the leavevmode, @w at the
  391. % beginning of a paragraph, when TeX is still in vertical mode, would
  392. % produce a whole line of output instead of starting the paragraph.
  393. defw#1{leavevmodehbox{#1}}
  394. % @group ... @end group forces ... to be all on one page, by enclosing
  395. % it in a TeX vbox.  We use vtop instead of vbox to construct the box
  396. % to keep its height that of a normal line.  According to the rules for
  397. % topskip (p.114 of the TeXbook), the glue inserted is
  398. % max (topskip - ht (first item), 0).  If that height is large,
  399. % therefore, no glue is inserted, and the space between the headline and
  400. % the text is small, which looks bad.
  401. %
  402. defgroup{begingroup
  403.   ifnumcatcode13=active else
  404.     errhelp = groupinvalidhelp
  405.     errmessage{@group invalid in context where filling is enabled}%
  406.   fi
  407.   %
  408.   % The vtop we start below produces a box with normal height and large
  409.   % depth; thus, TeX puts baselineskip glue before it, and (when the
  410.   % next line of text is done) lineskip glue after it.  (See p.82 of
  411.   % the TeXbook.)  Thus, space below is not quite equal to space
  412.   % above.  But it's pretty close.
  413.   defEgroup{%
  414.     egroup           % End the vtop.
  415.     endgroup         % End the group.
  416.   }%
  417.   %
  418.   vtopbgroup
  419.     % We have to put a strut on the last line in case the @group is in
  420.     % the midst of an example, rather than completely enclosing it.
  421.     % Otherwise, the interline space between the last line of the group
  422.     % and the first line afterwards is too small.  But we can't put the
  423.     % strut in Egroup, since there it would be on a line by itself.
  424.     % Hence this just inserts a strut at the beginning of each line.
  425.     everypar = {strut}%
  426.     %
  427.     % Since we have a strut on every line, we don't need any of TeX's
  428.     % normal interline spacing.
  429.     offinterlineskip
  430.     %
  431.     % OK, but now we have to do something about blank
  432.     % lines in the input in @example-like environments, which normally
  433.     % just turn into lisppar, which will insert no space now that we've
  434.     % turned off the interline space.  Simplest is to make them be an
  435.     % empty paragraph.
  436.     ifxparlisppar
  437.       edefpar{leavevmode par}%
  438.       %
  439.       % Reset ^^M's definition to new definition of par.
  440.       obeylines
  441.     fi
  442.     %
  443.     % Do @comment since we are called inside an environment such as
  444.     % @example, where each end-of-line in the input causes an
  445.     % end-of-line in the output.  We don't want the end-of-line after
  446.     % the `@group' to put extra space in the output.  Since @group
  447.     % should appear on a line by itself (according to the Texinfo
  448.     % manual), we don't worry about eating any user text.
  449.     comment
  450. }
  451. %
  452. % TeX puts in an escapechar (i.e., `@') at the beginning of the help
  453. % message, so this ends up printing `@group can only ...'.
  454. %
  455. newhelpgroupinvalidhelp{%
  456. group can only be used in environments such as @example,^^J%
  457. where each line of input produces a line of output.}
  458. % @need space-in-mils
  459. % forces a page break if there is not space-in-mils remaining.
  460. newdimenmil  mil=0.001in
  461. defneed{parseargneedx}
  462. % Old definition--didn't work.
  463. %defneedx #1{par %
  464. %% This method tries to make TeX break the page naturally
  465. %% if the depth of the box does not fit.
  466. %{baselineskip=0pt%
  467. %vtop to #1mil{vfil}kern -#1milpenalty 10000
  468. %prevdepth=-1000pt
  469. %}}
  470. defneedx#1{%
  471.   % Go into vertical mode, so we don't make a big box in the middle of a
  472.   % paragraph.
  473.   par
  474.   %
  475.   % Don't add any leading before our big empty box, but allow a page
  476.   % break, since the best break might be right here.
  477.   allowbreak
  478.   nointerlineskip
  479.   vtop to #1mil{vfil}%
  480.   %
  481.   % TeX does not even consider page breaks if a penalty added to the
  482.   % main vertical list is 10000 or more.  But in order to see if the
  483.   % empty box we just added fits on the page, we must make it consider
  484.   % page breaks.  On the other hand, we don't want to actually break the
  485.   % page after the empty box.  So we use a penalty of 9999.
  486.   %
  487.   % There is an extremely small chance that TeX will actually break the
  488.   % page at this penalty, if there are no other feasible breakpoints in
  489.   % sight.  (If the user is using lots of big @group commands, which
  490.   % almost-but-not-quite fill up a page, TeX will have a hard time doing
  491.   % good page breaking, for example.)  However, I could not construct an
  492.   % example where a page broke at this penalty; if it happens in a real
  493.   % document, then we can reconsider our strategy.
  494.   penalty9999
  495.   %
  496.   % Back up by the size of the box, whether we did a page break or not.
  497.   kern -#1mil
  498.   %
  499.   % Do not allow a page break right after this kern.
  500.   nobreak
  501. }
  502. % @br   forces paragraph break
  503. letbr = par
  504. % @dots{}  output some dots
  505. defdots{$ldots$}
  506. % @page    forces the start of a new page
  507. defpage{parvfillsupereject}
  508. % @exdent text....
  509. % outputs text on separate line in roman font, starting at standard page margin
  510. % This records the amount of indent in the innermost environment.
  511. % That's how much exdent should take out.
  512. newskipexdentamount
  513. % This defn is used inside fill environments such as @defun.
  514. defexdent{parseargexdentyyy}
  515. defexdentyyy #1{{hfilbreakhbox{kern -exdentamount{rm#1}}hfilbreak}}
  516. % This defn is used inside nofill environments such as @example.
  517. defnofillexdent{parseargnofillexdentyyy}
  518. defnofillexdentyyy #1{{advance leftskip by -exdentamount
  519. leftline{hskipleftskip{rm#1}}}}
  520. % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
  521. definmargin#1{%
  522. strutvadjust{nobreakkern-strutdepth
  523.   vtop to strutdepth{baselineskipstrutdepthvss
  524.   llap{rightskip=inmarginspacing vbox{noindent #1}}null}}}
  525. newskipinmarginspacing inmarginspacing=1cm
  526. defstrutdepth{dpstrutbox}
  527. %hbox{{rm#1}}hfilbreak}}
  528. % @include file    insert text of that file as input.
  529. % Allow normal characters that  we make active in the argument (a file name).
  530. definclude{begingroup
  531.   catcode`\=12
  532.   catcode`~=12
  533.   catcode`^=12
  534.   catcode`_=12
  535.   catcode`|=12
  536.   catcode`<=12
  537.   catcode`>=12
  538.   catcode`+=12
  539.   parseargincludezzz}
  540. % Restore active chars for included file.
  541. defincludezzz#1{endgroupbegingroup
  542.   % Read the included file in a group so nested @include's work.
  543.   defthisfile{#1}%
  544.   inputthisfile
  545. endgroup}
  546. defthisfile{}
  547. % @center line   outputs that line, centered
  548. defcenter{parseargcenterzzz}
  549. defcenterzzz #1{{advancehsize by -leftskip
  550. advancehsize by -rightskip
  551. centerline{#1}}}
  552. % @sp n   outputs n lines of vertical space
  553. defsp{parseargspxxx}
  554. defspxxx #1{vskip #1baselineskip}
  555. % @comment ...line which is ignored...
  556. % @c is the same as @comment
  557. % @ignore ... @end ignore  is another way to write a comment
  558. defcomment{catcode 64=other catcode 123=other catcode 125=other%
  559. parsearg commentxxx}
  560. defcommentxxx #1{catcode 64=0 catcode 123=1 catcode 125=2 }
  561. letc=comment
  562. % @paragraphindent  is defined for the Info formatting commands only.
  563. letparagraphindent=comment
  564. % Prevent errors for section commands.
  565. % Used in @ignore and in failing conditionals.
  566. defignoresections{%
  567. letchapter=relax
  568. letunnumbered=relax
  569. lettop=relax
  570. letunnumberedsec=relax
  571. letunnumberedsection=relax
  572. letunnumberedsubsec=relax
  573. letunnumberedsubsection=relax
  574. letunnumberedsubsubsec=relax
  575. letunnumberedsubsubsection=relax
  576. letsection=relax
  577. letsubsec=relax
  578. letsubsubsec=relax
  579. letsubsection=relax
  580. letsubsubsection=relax
  581. letappendix=relax
  582. letappendixsec=relax
  583. letappendixsection=relax
  584. letappendixsubsec=relax
  585. letappendixsubsection=relax
  586. letappendixsubsubsec=relax
  587. letappendixsubsubsection=relax
  588. letcontents=relax
  589. letsmallbook=relax
  590. lettitlepage=relax
  591. }
  592. % Used in nested conditionals, where we have to parse the Texinfo source
  593. % and so want to turn off most commands, in case they are used
  594. % incorrectly.
  595. %
  596. defignoremorecommands{%
  597.   letdefcodeindex = relax
  598.   letdefcv = relax
  599.   letdeffn = relax
  600.   letdeffnx = relax
  601.   letdefindex = relax
  602.   letdefivar = relax
  603.   letdefmac = relax
  604.   letdefmethod = relax
  605.   letdefop = relax
  606.   letdefopt = relax
  607.   letdefspec = relax
  608.   letdeftp = relax
  609.   letdeftypefn = relax
  610.   letdeftypefun = relax
  611.   letdeftypevar = relax
  612.   letdeftypevr = relax
  613.   letdefun = relax
  614.   letdefvar = relax
  615.   letdefvr = relax
  616.   letref = relax
  617.   letxref = relax
  618.   letprintindex = relax
  619.   letpxref = relax
  620.   letsettitle = relax
  621.   letsetchapternewpage = relax
  622.   letsetchapterstyle = relax
  623.   leteveryheading = relax
  624.   letevenheading = relax
  625.   letoddheading = relax
  626.   leteveryfooting = relax
  627.   letevenfooting = relax
  628.   letoddfooting = relax
  629.   letheadings = relax
  630.   letinclude = relax
  631.   letlowersections = relax
  632.   letdown = relax
  633.   letraisesections = relax
  634.   letup = relax
  635.   letset = relax
  636.   letclear = relax
  637.   letitem = relax
  638. }
  639. % Ignore @ignore ... @end ignore.
  640. %
  641. defignore{doignore{ignore}}
  642. % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
  643. %
  644. defifinfo{doignore{ifinfo}}
  645. defifhtml{doignore{ifhtml}}
  646. defifnottex{doignore{ifnottex}}
  647. defhtml{doignore{html}}
  648. defmenu{doignore{menu}}
  649. defdirentry{doignore{direntry}}
  650. % Also ignore @macro ... @end macro.  The user must run texi2dvi,
  651. % which runs makeinfo to do macro expansion.  Ignore @unmacro, too.
  652. defmacro{doignore{macro}}
  653. letunmacro = comment
  654. % @dircategory CATEGORY  -- specify a category of the dir file
  655. % which this file should belong to.  Ignore this in TeX.
  656. letdircategory = comment
  657. % Ignore text until a line `@end #1'.
  658. %
  659. defdoignore#1{begingroup
  660.   % Don't complain about control sequences we have declared outer.
  661.   ignoresections
  662.   %
  663.   % Define a command to swallow text until we reach `@end #1'.
  664.   longdefdoignoretext##1end #1{enddoignore}%
  665.   %
  666.   % Make sure that spaces turn into tokens that match what doignoretext wants.
  667.   catcode32 = 10
  668.   %
  669.   % Ignore braces, too, so mismatched braces don't cause trouble.
  670.   catcode`{ = 9
  671.   catcode`} = 9
  672.   %
  673.   % And now expand that command.
  674.   doignoretext
  675. }
  676. % What we do to finish off ignored text.
  677. %
  678. defenddoignore{endgroupignorespaces}%
  679. newififwarnedobswarnedobsfalse
  680. defobstexwarn{%
  681.   ifwarnedobsrelaxelse
  682.   % We need to warn folks that they may have trouble with TeX 3.0.
  683.   % This uses immediatewrite16 rather than message to get newlines.
  684.     immediatewrite16{}
  685.     immediatewrite16{***WARNING*** for users of Unix TeX 3.0!}
  686.     immediatewrite16{This manual trips a bug in TeX version 3.0 (tex hangs).}
  687.     immediatewrite16{If you are running another version of TeX, relax.}
  688.     immediatewrite16{If you are running Unix TeX 3.0, kill this TeX process.}
  689.     immediatewrite16{  Then upgrade your TeX installation if you can.}
  690.     immediatewrite16{  (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
  691.     immediatewrite16{If you are stuck with version 3.0, run the}
  692.     immediatewrite16{  script ``tex3patch'' from the Texinfo distribution}
  693.     immediatewrite16{  to use a workaround.}
  694.     immediatewrite16{}
  695.     globalwarnedobstrue
  696.     fi
  697. }
  698. % **In TeX 3.0, setting text in nullfont hangs tex.  For a
  699. % workaround (which requires the file ``dummy.tfm'' to be installed),
  700. % uncomment the following line:
  701. %%%%%fontnullfont=dummyletobstexwarn=relax
  702. % Ignore text, except that we keep track of conditional commands for
  703. % purposes of nesting, up to an `@end #1' command.
  704. %
  705. defnestedignore#1{%
  706.   obstexwarn
  707.   % We must actually expand the ignored text to look for the @end
  708.   % command, so that nested ignore constructs work.  Thus, we put the
  709.   % text into a vbox and then do nothing with the result.  To minimize
  710.   % the change of memory overflow, we follow the approach outlined on
  711.   % page 401 of the TeXbook: make the current font be a dummy font.
  712.   %
  713.   setbox0 = vboxbgroup
  714.     % Don't complain about control sequences we have declared outer.
  715.     ignoresections
  716.     %
  717.     % Define `@end #1' to end the box, which will in turn undefine the
  718.     % @end command again.
  719.     expandafterdefcsname E#1endcsname{egroupignorespaces}%
  720.     %
  721.     % We are going to be parsing Texinfo commands.  Most cause no
  722.     % trouble when they are used incorrectly, but some commands do
  723.     % complicated argument parsing or otherwise get confused, so we
  724.     % undefine them.
  725.     %
  726.     % We can't do anything about stray @-signs, unfortunately;
  727.     % they'll produce `undefined control sequence' errors.
  728.     ignoremorecommands
  729.     %
  730.     % Set the current font to be nullfont, a TeX primitive, and define
  731.     % all the font commands to also use nullfont.  We don't use
  732.     % dummy.tfm, as suggested in the TeXbook, because not all sites
  733.     % might have that installed.  Therefore, math mode will still
  734.     % produce output, but that should be an extremely small amount of
  735.     % stuff compared to the main input.
  736.     %
  737.     nullfont
  738.     lettenrm = nullfont  lettenit = nullfont  lettensl = nullfont
  739.     lettenbf = nullfont  lettentt = nullfont  letsmallcaps = nullfont
  740.     lettensf = nullfont
  741.     % Similarly for index fonts (mostly for their use in
  742.     % smallexample)
  743.     letindrm = nullfont  letindit = nullfont  letindsl = nullfont
  744.     letindbf = nullfont  letindtt = nullfont  letindsc = nullfont
  745.     letindsf = nullfont
  746.     %
  747.     % Don't complain when characters are missing from the fonts.
  748.     tracinglostchars = 0
  749.     %
  750.     % Don't bother to do space factor calculations.
  751.     frenchspacing
  752.     %
  753.     % Don't report underfull hboxes.
  754.     hbadness = 10000
  755.     %
  756.     % Do minimal line-breaking.
  757.     pretolerance = 10000
  758.     %
  759.     % Do not execute instructions in @tex
  760.     deftex{doignore{tex}}%
  761. }
  762. % @set VAR sets the variable VAR to an empty value.
  763. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
  764. %
  765. % Since we want to separate VAR from REST-OF-LINE (which might be
  766. % empty), we can't just use parsearg; we have to insert a space of our
  767. % own to delimit the rest of the line, and then take it out again if we
  768. % didn't need it.  Make sure the catcode of space is correct to avoid
  769. % losing inside @example, for instance.
  770. %
  771. defset{begingroupcatcode` =10
  772.   catcode`-=12 catcode`_=12 % Allow - and _ in VAR.
  773.   parseargsetxxx}
  774. defsetxxx#1{setyyy#1 endsetyyy}
  775. defsetyyy#1 #2endsetyyy{%
  776.   deftemp{#2}%
  777.   ifxtempempty globalexpandafterletcsname SET#1endcsname = empty
  778.   else setzzz{#1}#2endsetzzz % Remove the trailing space setxxx inserted.
  779.   fi
  780.   endgroup
  781. }
  782. % Can't use xdef to pre-expand #2 and save some time, since temp or
  783. % next or other control sequences that we've defined might get us into
  784. % an infinite loop. Consider `@set foo @cite{bar}'.
  785. defsetzzz#1#2 endsetzzz{expandaftergdefcsname SET#1endcsname{#2}}
  786. % @clear VAR clears (i.e., unsets) the variable VAR.
  787. %
  788. defclear{parseargclearxxx}
  789. defclearxxx#1{globalexpandafterletcsname SET#1endcsname=relax}
  790. % @value{foo} gets the text saved in variable foo.
  791. %
  792. defvalue{begingroup
  793.   catcode`-=12 catcode`_=12 % Allow - and _ in VAR.
  794.   valuexxx}
  795. defvaluexxx#1{%
  796.   expandafterifxcsname SET#1endcsnamerelax
  797.     {{No value for ``#1''}}%
  798.   else
  799.     csname SET#1endcsname
  800.   fi
  801. endgroup}
  802. % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  803. % with @set.
  804. %
  805. defifset{parseargifsetxxx}
  806. defifsetxxx #1{%
  807.   expandafterifxcsname SET#1endcsnamerelax
  808.     expandafterifsetfail
  809.   else
  810.     expandafterifsetsucceed
  811.   fi
  812. }
  813. defifsetsucceed{conditionalsucceed{ifset}}
  814. defifsetfail{nestedignore{ifset}}
  815. defineunmatchedend{ifset}
  816. % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
  817. % defined with @set, or has been undefined with @clear.
  818. %
  819. defifclear{parseargifclearxxx}
  820. defifclearxxx #1{%
  821.   expandafterifxcsname SET#1endcsnamerelax
  822.     expandafterifclearsucceed
  823.   else
  824.     expandafterifclearfail
  825.   fi
  826. }
  827. defifclearsucceed{conditionalsucceed{ifclear}}
  828. defifclearfail{nestedignore{ifclear}}
  829. defineunmatchedend{ifclear}
  830. % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
  831. % following, through the first @end iftex (etc.).  Make `@end iftex'
  832. % (etc.) valid only after an @iftex.
  833. %
  834. defiftex{conditionalsucceed{iftex}}
  835. defifnothtml{conditionalsucceed{ifnothtml}}
  836. defifnotinfo{conditionalsucceed{ifnotinfo}}
  837. defineunmatchedend{iftex}
  838. defineunmatchedend{ifnothtml}
  839. defineunmatchedend{ifnotinfo}
  840. % We can't just want to start a group at @iftex (for example) and end it
  841. % at @end iftex, since then @set commands inside the conditional have no
  842. % effect (they'd get reverted at the end of the group).  So we must
  843. % define Eiftex to redefine itself to be its previous value.  (We can't
  844. % just define it to fail again with an ``unmatched end'' error, since
  845. % the @ifset might be nested.)
  846. %
  847. defconditionalsucceed#1{%
  848.   edeftemp{%
  849.     % Remember the current value of E#1.
  850.     letnece{prevE#1} = nece{E#1}%
  851.     %
  852.     % At the `@end #1', redefine E#1 to be its previous value.
  853.     defnece{E#1}{letnece{E#1} = nece{prevE#1}}%
  854.   }%
  855.   temp
  856. }
  857. % We need to expand lots of csname's, but we don't want to expand the
  858. % control sequences after we've constructed them.
  859. %
  860. defnece#1{expandafternoexpandcsname#1endcsname}
  861. % @asis just yields its argument.  Used with @table, for example.
  862. %
  863. defasis#1{#1}
  864. % @math means output in math mode.
  865. % We don't use $'s directly in the definition of math because control
  866. % sequences like math are expanded when the toc file is written.  Then,
  867. % we read the toc file back, the $'s will be normal characters (as they
  868. % should be, according to the definition of Texinfo).  So we must use a
  869. % control sequence to switch into and out of math mode.
  870. %
  871. % This isn't quite enough for @math to work properly in indices, but it
  872. % seems unlikely it will ever be needed there.
  873. %
  874. letimplicitmath = $
  875. defmath#1{implicitmath #1implicitmath}
  876. % @bullet and @minus need the same treatment as @math, just above.
  877. defbullet{implicitmathptexbulletimplicitmath}
  878. defminus{implicitmath-implicitmath}
  879. defnode{ENVcheckparseargnodezzz}
  880. defnodezzz#1{nodexxx [#1,]}
  881. defnodexxx[#1,#2]{gdeflastnode{#1}}
  882. letnwnode=node
  883. letlastnode=relax
  884. defdonoderef{ifxlastnoderelaxelse
  885. expandafterexpandafterexpandaftersetref{lastnode}fi
  886. globalletlastnode=relax}
  887. defunnumbnoderef{ifxlastnoderelaxelse
  888. expandafterexpandafterexpandafterunnumbsetref{lastnode}fi
  889. globalletlastnode=relax}
  890. defappendixnoderef{ifxlastnoderelaxelse
  891. expandafterexpandafterexpandafterappendixsetref{lastnode}fi
  892. globalletlastnode=relax}
  893. % @refill is a no-op.
  894. letrefill=relax
  895. % @setfilename is done at the beginning of every texinfo file.
  896. % So open here the files we need to have open while reading the input.
  897. % This makes it possible to make a .fmt file for texinfo.
  898. defsetfilename{%
  899.    readauxfile
  900.    opencontents
  901.    openindices
  902.    fixbackslash  % Turn off hack to swallow `input texinfo'.
  903.    globalletsetfilename=comment % Ignore extra @setfilename cmds.
  904.    %
  905.    % If texinfo.cnf is present on the system, read it.
  906.    % Useful for site-wide @afourpaper, etc.
  907.    % Just to be on the safe side, close the input stream before the input.
  908.    openin 1 texinfo.cnf
  909.    ifeof1 lettemp=relax else deftemp{input texinfo.cnf }fi
  910.    closein1
  911.    temp
  912.    %
  913.    comment % Ignore the actual filename.
  914. }
  915. % @bye.
  916. outerdefbye{pagealignmacrotracingstats=1ptexend}
  917. % defmacro#1{begingroupignoresectionscatcode`#=6defmacrotemp{#1}parseargmacroxxx}
  918. % defmacroxxx#1#2 end macro{%
  919. % expandaftergdefmacrotemp#1{#2}%
  920. % endgroup}
  921. %deflinemacro#1{begingroupignoresectionscatcode`#=6defmacrotemp{#1}parsearglinemacroxxx}
  922. %deflinemacroxxx#1#2 end linemacro{%
  923. %letparsearg=relax
  924. %edefmacrotempx{csname Mbutfirstexpandafterstringmacrotempendcsname}%
  925. %expandafterxdefmacrotemp{parseargmacrotempx}%
  926. %expandaftergdefmacrotempx#1{#2}%
  927. %endgroup}
  928. %defbutfirst#1{}
  929. message{fonts,}
  930. % Font-change commands.
  931. % Texinfo supports the sans serif font style, which plain TeX does not.
  932. % So we set up a sf analogous to plain's rm, etc.
  933. newfamsffam
  934. defsf{fam=sffam tensf}
  935. letli = sf % Sometimes we call it li, not sf.
  936. % We don't need math for this one.
  937. defttsl{tenttsl}
  938. % Use Computer Modern fonts at magstephalf (11pt).
  939. newcountmainmagstep
  940. mainmagstep=magstephalf
  941. % Set the font macro #1 to the font named #2, adding on the
  942. % specified font prefix (normally `cm').
  943. % #3 is the font's design size, #4 is a scale factor
  944. defsetfont#1#2#3#4{font#1=fontprefix#2#3 scaled #4}
  945. % Use cm as the default font prefix.
  946. % To specify the font prefix, you must define fontprefix
  947. % before you read in texinfo.tex.
  948. ifxfontprefixundefined
  949. deffontprefix{cm}
  950. fi
  951. % Support font families that don't use the same naming scheme as CM.
  952. defrmshape{r}
  953. defrmbshape{bx}               %where the normal face is bold
  954. defbfshape{b}
  955. defbxshape{bx}
  956. defttshape{tt}
  957. defttbshape{tt}
  958. defttslshape{sltt}
  959. defitshape{ti}
  960. defitbshape{bxti}
  961. defslshape{sl}
  962. defslbshape{bxsl}
  963. defsfshape{ss}
  964. defsfbshape{ss}
  965. defscshape{csc}
  966. defscbshape{csc}
  967. ifxbiggerrelax
  968. letmainmagstep=magstep1
  969. setfonttextrmrmshape{12}{1000}
  970. setfonttextttttshape{12}{1000}
  971. else
  972. setfonttextrmrmshape{10}{mainmagstep}
  973. setfonttextttttshape{10}{mainmagstep}
  974. fi
  975. % Instead of cmb10, you many want to use cmbx10.
  976. % cmbx10 is a prettier font on its own, but cmb10
  977. % looks better when embedded in a line with cmr10.
  978. setfonttextbfbfshape{10}{mainmagstep}
  979. setfonttextititshape{10}{mainmagstep}
  980. setfonttextslslshape{10}{mainmagstep}
  981. setfonttextsfsfshape{10}{mainmagstep}
  982. setfonttextscscshape{10}{mainmagstep}
  983. setfonttextttslttslshape{10}{mainmagstep}
  984. fonttexti=cmmi10 scaled mainmagstep
  985. fonttextsy=cmsy10 scaled mainmagstep
  986. % A few fonts for @defun, etc.
  987. setfontdefbfbxshape{10}{magstep1} %was 1314
  988. setfontdefttttshape{10}{magstep1}
  989. defdf{lettentt=deftt lettenbf = defbf bf}
  990. % Fonts for indices and small examples (9pt).
  991. % We actually use the slanted font rather than the italic,
  992. % because texinfo normally uses the slanted fonts for that.
  993. % Do not make many font distinctions in general in the index, since they
  994. % aren't very useful.
  995. setfontninettttshape{9}{1000}
  996. setfontindrmrmshape{9}{1000}
  997. setfontinditslshape{9}{1000}
  998. letindsl=indit
  999. letindtt=ninett
  1000. letindttsl=ninett
  1001. letindsf=indrm
  1002. letindbf=indrm
  1003. setfontindscscshape{10}{900}
  1004. fontindi=cmmi9
  1005. fontindsy=cmsy9
  1006. % Fonts for title page:
  1007. setfonttitlermrmbshape{12}{magstep3}
  1008. setfonttitleititbshape{10}{magstep4}
  1009. setfonttitleslslbshape{10}{magstep4}
  1010. setfonttitlettttbshape{12}{magstep3}
  1011. setfonttitlettslttslshape{10}{magstep4}
  1012. setfonttitlesfsfbshape{17}{magstep1}
  1013. lettitlebf=titlerm
  1014. setfonttitlescscbshape{10}{magstep4}
  1015. fonttitlei=cmmi12 scaled magstep3
  1016. fonttitlesy=cmsy10 scaled magstep4
  1017. defauthorrm{secrm}
  1018. % Chapter (and unnumbered) fonts (17.28pt).
  1019. setfontchaprmrmbshape{12}{magstep2}
  1020. setfontchapititbshape{10}{magstep3}
  1021. setfontchapslslbshape{10}{magstep3}
  1022. setfontchapttttbshape{12}{magstep2}
  1023. setfontchapttslttslshape{10}{magstep3}
  1024. setfontchapsfsfbshape{17}{1000}
  1025. letchapbf=chaprm
  1026. setfontchapscscbshape{10}{magstep3}
  1027. fontchapi=cmmi12 scaled magstep2
  1028. fontchapsy=cmsy10 scaled magstep3
  1029. % Section fonts (14.4pt).
  1030. setfontsecrmrmbshape{12}{magstep1}
  1031. setfontsecititbshape{10}{magstep2}
  1032. setfontsecslslbshape{10}{magstep2}
  1033. setfontsecttttbshape{12}{magstep1}
  1034. setfontsecttslttslshape{10}{magstep2}
  1035. setfontsecsfsfbshape{12}{magstep1}
  1036. letsecbfsecrm
  1037. setfontsecscscbshape{10}{magstep2}
  1038. fontseci=cmmi12 scaled magstep1
  1039. fontsecsy=cmsy10 scaled magstep2
  1040. % setfontssecrmbxshape{10}{magstep1}    % This size an font looked bad.
  1041. % setfontssecititshape{10}{magstep1}    % The letters were too crowded.
  1042. % setfontssecslslshape{10}{magstep1}
  1043. % setfontssecttttshape{10}{magstep1}
  1044. % setfontssecsfsfshape{10}{magstep1}
  1045. %setfontssecrmbfshape{10}{1315}      % Note the use of cmb rather than cmbx.
  1046. %setfontssecititshape{10}{1315}      % Also, the size is a little larger than
  1047. %setfontssecslslshape{10}{1315}      % being scaled magstep1.
  1048. %setfontssecttttshape{10}{1315}
  1049. %setfontssecsfsfshape{10}{1315}
  1050. %letssecbf=ssecrm
  1051. % Subsection fonts (13.15pt).
  1052. setfontssecrmrmbshape{12}{magstephalf}
  1053. setfontssecititbshape{10}{1315}
  1054. setfontssecslslbshape{10}{1315}
  1055. setfontssecttttbshape{12}{magstephalf}
  1056. setfontssecttslttslshape{10}{1315}
  1057. setfontssecsfsfbshape{12}{magstephalf}
  1058. letssecbfssecrm
  1059. setfontssecscscbshape{10}{magstep1}
  1060. fontsseci=cmmi12 scaled magstephalf
  1061. fontssecsy=cmsy10 scaled 1315
  1062. % The smallcaps and symbol fonts should actually be scaled magstep1.5,
  1063. % but that is not a standard magnification.
  1064. % In order for the font changes to affect most math symbols and letters,
  1065. % we have to define the textfont of the standard families.  Since
  1066. % texinfo doesn't allow for producing subscripts and superscripts, we
  1067. % don't bother to reset scriptfont and scriptscriptfont (which would
  1068. % also require loading a lot more fonts).
  1069. %
  1070. defresetmathfonts{%
  1071.   textfont0 = tenrm textfont1 = teni textfont2 = tensy
  1072.   textfontitfam = tenit textfontslfam = tensl textfontbffam = tenbf
  1073.   textfontttfam = tentt textfontsffam = tensf
  1074. }
  1075. % The font-changing commands redefine the meanings of tenSTYLE, instead
  1076. % of just STYLE.  We do this so that font changes will continue to work
  1077. % in math mode, where it is the current fam that is relevant in most
  1078. % cases, not the current font.  Plain TeX does defbf{fam=bffam
  1079. % tenbf}, for example.  By redefining tenbf, we obviate the need to
  1080. % redefine bf itself.
  1081. deftextfonts{%
  1082.   lettenrm=textrm lettenit=textit lettensl=textsl
  1083.   lettenbf=textbf lettentt=texttt letsmallcaps=textsc
  1084.   lettensf=textsf letteni=texti lettensy=textsy lettenttsl=textttsl
  1085.   resetmathfonts}
  1086. deftitlefonts{%
  1087.   lettenrm=titlerm lettenit=titleit lettensl=titlesl
  1088.   lettenbf=titlebf lettentt=titlett letsmallcaps=titlesc
  1089.   lettensf=titlesf letteni=titlei lettensy=titlesy
  1090.   lettenttsl=titlettsl
  1091.   resetmathfonts setleading{25pt}}
  1092. deftitlefont#1{{titlefonts #1}}
  1093. defchapfonts{%
  1094.   lettenrm=chaprm lettenit=chapit lettensl=chapsl
  1095.   lettenbf=chapbf lettentt=chaptt letsmallcaps=chapsc
  1096.   lettensf=chapsf letteni=chapi lettensy=chapsy lettenttsl=chapttsl
  1097.   resetmathfonts setleading{19pt}}
  1098. defsecfonts{%
  1099.   lettenrm=secrm lettenit=secit lettensl=secsl
  1100.   lettenbf=secbf lettentt=sectt letsmallcaps=secsc
  1101.   lettensf=secsf letteni=seci lettensy=secsy lettenttsl=secttsl
  1102.   resetmathfonts setleading{16pt}}
  1103. defsubsecfonts{%
  1104.   lettenrm=ssecrm lettenit=ssecit lettensl=ssecsl
  1105.   lettenbf=ssecbf lettentt=ssectt letsmallcaps=ssecsc
  1106.   lettensf=ssecsf letteni=sseci lettensy=ssecsy lettenttsl=ssecttsl
  1107.   resetmathfonts setleading{15pt}}
  1108. letsubsubsecfonts = subsecfonts % Maybe make sssec fonts scaled magstephalf?
  1109. defindexfonts{%
  1110.   lettenrm=indrm lettenit=indit lettensl=indsl
  1111.   lettenbf=indbf lettentt=indtt letsmallcaps=indsc
  1112.   lettensf=indsf letteni=indi lettensy=indsy lettenttsl=indttsl
  1113.   resetmathfonts setleading{12pt}}
  1114. % Set up the default fonts, so we can use them for creating boxes.
  1115. %
  1116. textfonts
  1117. % Count depth in font-changes, for error checks
  1118. newcountfontdepth fontdepth=0
  1119. % Fonts for short table of contents.
  1120. setfontshortcontrmrmshape{12}{1000}
  1121. setfontshortcontbfbxshape{12}{1000}
  1122. setfontshortcontslslshape{12}{1000}
  1123. %% Add scribe-like font environments, plus @l for inline lisp (usually sans
  1124. %% serif) and @ii for TeX italic
  1125. % smartitalic{ARG} outputs arg in italics, followed by an italic correction
  1126. % unless the following character is such as not to need one.
  1127. defsmartitalicx{ifxnext,elseifxnext-elseifxnext.else/fififi}
  1128. defsmartitalic#1{{sl #1}futureletnextsmartitalicx}
  1129. leti=smartitalic
  1130. letvar=smartitalic
  1131. letdfn=smartitalic
  1132. letemph=smartitalic
  1133. letcite=smartitalic
  1134. defb#1{{bf #1}}
  1135. letstrong=b
  1136. % We can't just use exhyphenpenalty, because that only has effect at
  1137. % the end of a paragraph.  Restore normal hyphenation at the end of the
  1138. % group within which nohyphenation is presumably called.
  1139. %
  1140. defnohyphenation{hyphencharfont = -1  aftergrouprestorehyphenation}
  1141. defrestorehyphenation{hyphencharfont = `- }
  1142. deft#1{%
  1143.   {tt rawbackslash frenchspacing #1}%
  1144.   null
  1145. }
  1146. letttfont=t
  1147. defsamp #1{`tclose{#1}'null}
  1148. setfontsmallrmrmshape{8}{1000}
  1149. fontsmallsy=cmsy9
  1150. defkey#1{{smallrmtextfont2=smallsy leavevmodehbox{%
  1151.   raise0.4pthbox{$langle$}kern-.08emvtop{%
  1152.     vbox{hrulekern-0.4pt
  1153.      hbox{raise0.4pthbox{vphantom{$langle$}}#1}}%
  1154.     kern-0.4pthrule}%
  1155.   kern-.06emraise0.4pthbox{$rangle$}}}}
  1156. % The old definition, with no lozenge:
  1157. %defkey #1{{ttsl nohyphenation uppercase{#1}}null}
  1158. defctrl #1{{tt rawbackslash hat}#1}
  1159. letfile=samp
  1160. % @code is a modification of @t,
  1161. % which makes spaces the same size as normal in the surrounding text.
  1162. deftclose#1{%
  1163.   {%
  1164.     % Change normal interword space to be same as for the current font.
  1165.     spaceskip = fontdimen2font
  1166.     %
  1167.     % Switch to typewriter.
  1168.     tt
  1169.     %
  1170.     % But ` ' produces the large typewriter interword space.
  1171.     def {{spaceskip = 0pt{} }}%
  1172.     %
  1173.     % Turn off hyphenation.
  1174.     nohyphenation
  1175.     %
  1176.     rawbackslash
  1177.     frenchspacing
  1178.     #1%
  1179.   }%
  1180.   null
  1181. }
  1182. % We *must* turn on hyphenation at `-' and `_' in code.
  1183. % Otherwise, it is too hard to avoid overfull hboxes
  1184. % in the Emacs manual, the Library manual, etc.
  1185. % Unfortunately, TeX uses one parameter (hyphenchar) to control
  1186. % both hyphenation at - and hyphenation within words.
  1187. % We must therefore turn them both off (tclose does that)
  1188. % and arrange explicitly to hyphenate at a dash.
  1189. %  -- rms.
  1190. {
  1191. catcode`-=active
  1192. catcode`_=active
  1193. catcode`|=active
  1194. globaldefcode{begingroup catcode`-=active let-codedash catcode`_=active let_codeunder codex}
  1195. % The following is used by doprintindex to insure that long function names
  1196. % wrap around.  It is necessary for - and _ to be active before the index is
  1197. % read from the file, as entry parses the arguments long before code is
  1198. % ever called.  -- mycroft
  1199. % _ is always active; and it shouldn't be let = to an _ that is a
  1200. % subscript character anyway. Then, @cindex @samp{_} (for example)
  1201. % fails.  --karl
  1202. globaldefindexbreaks{%
  1203.   catcode`-=active let-realdash
  1204. }
  1205. }
  1206. defrealdash{-}
  1207. defcodedash{-discretionary{}{}{}}
  1208. defcodeunder{ifusingtt{normalunderscorediscretionary{}{}{}}{_}}
  1209. defcodex #1{tclose{#1}endgroup}
  1210. %letexp=tclose  %Was temporary
  1211. % @kbd is like @code, except that if the argument is just one @key command,
  1212. % then @kbd has no effect.
  1213. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
  1214. %   `example' (@kbd uses ttsl only inside of @example and friends),
  1215. %   or `code' (@kbd uses normal tty font always).
  1216. defkbdinputstyle{parseargkbdinputstylexxx}
  1217. defkbdinputstylexxx#1{%
  1218.   defarg{#1}%
  1219.   ifxargworddistinct
  1220.     gdefkbdexamplefont{ttsl}gdefkbdfont{ttsl}%
  1221.   elseifxargwordexample
  1222.     gdefkbdexamplefont{ttsl}gdefkbdfont{tt}%
  1223.   elseifxargwordcode
  1224.     gdefkbdexamplefont{tt}gdefkbdfont{tt}%
  1225.   fififi
  1226. }
  1227. defworddistinct{distinct}
  1228. defwordexample{example}
  1229. defwordcode{code}
  1230. % Default is kbdinputdistinct.  (Too much of a hassle to call the macro,
  1231. % the catcodes are wrong for parsearg to work.)
  1232. gdefkbdexamplefont{ttsl}gdefkbdfont{ttsl}
  1233. defxkey{key}
  1234. defkbdfoo#1#2#3par{defone{#1}defthree{#3}defthreex{??}%
  1235. ifxonexkeyifxthreexthree key{#2}%
  1236. else{tclose{kbdfontlook}}fi
  1237. else{tclose{kbdfontlook}}fi}
  1238. % @url.  Quotes do not seem necessary, so use code.
  1239. leturl=code
  1240. % @uref (abbreviation for `urlref') takes an optional second argument
  1241. % specifying the text to display.  First (mandatory) arg is the url.
  1242. % Perhaps eventually put in a hypertex special here.
  1243. defuref#1{urefxxx #1,,finish}
  1244. defurefxxx#1,#2,#3finish{%
  1245.   setbox0 = hbox{ignorespaces #2}%
  1246.   ifdimwd0 > 0pt
  1247.     unhbox0 (code{#1})%
  1248.   else
  1249.     code{#1}%
  1250.   fi
  1251. }
  1252. % rms does not like the angle brackets --karl, 17may97.
  1253. % So now @email is just like @uref.
  1254. %defemail#1{$langle${tt #1}$rangle$}
  1255. letemail=uref
  1256. % Check if we are currently using a typewriter font.  Since all the
  1257. % Computer Modern typewriter fonts have zero interword stretch (and
  1258. % shrink), and it is reasonable to expect all typewriter fonts to have
  1259. % this property, we can check that font parameter.
  1260. %
  1261. defifmonospace{ifdimfontdimen3font=0pt }
  1262. % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
  1263. % argument is to make the input look right: @dmn{pt} instead of
  1264. % @dmn{}pt.
  1265. %
  1266. defdmn#1{thinspace #1}
  1267. defkbd#1{deflook{#1}expandafterkbdfoolook??par}
  1268. % @l was never documented to mean ``switch to the Lisp font'',
  1269. % and it is not used as such in any manual I can find.  We need it for
  1270. % Polish suppressed-l.  --karl, 22sep96.
  1271. %defl#1{{li #1}null}
  1272. defr#1{{rm #1}}              % roman font
  1273. % Use of lowercase was suggested.
  1274. defsc#1{{smallcaps#1}}       % smallcaps font
  1275. defii#1{{it #1}}             % italic font
  1276. % @pounds{} is a sterling sign.
  1277. defpounds{{it$}}
  1278. message{page headings,}
  1279. newskiptitlepagetopglue titlepagetopglue = 1.5in
  1280. newskiptitlepagebottomglue titlepagebottomglue = 2pc
  1281. % First the title page.  Must do @settitle before @titlepage.
  1282. newififseenauthor
  1283. newififfinishedtitlepage
  1284. defshorttitlepage{parseargshorttitlepagezzz}
  1285. defshorttitlepagezzz #1{begingrouphbox{}vskip 1.5in chaprm centerline{#1}%
  1286.         endgrouppagehbox{}page}
  1287. deftitlepage{begingroup parindent=0pt textfonts
  1288.    letsubtitlerm=tenrm
  1289. % I deinstalled the following change because cmr12 is undefined.
  1290. % This change was not in the ChangeLog anyway.  --rms.
  1291. %   letsubtitlerm=cmr12
  1292.    defsubtitlefont{subtitlerm normalbaselineskip = 13pt normalbaselines}%
  1293.    %
  1294.    defauthorfont{authorrm normalbaselineskip = 16pt normalbaselines}%
  1295.    %
  1296.    % Leave some space at the very top of the page.
  1297.    vgluetitlepagetopglue
  1298.    %
  1299.    % Now you can print the title using @title.
  1300.    deftitle{parseargtitlezzz}%
  1301.    deftitlezzz##1{leftline{titlefontsrm ##1}
  1302.                     % print a rule at the page bottom also.
  1303.                     finishedtitlepagefalse
  1304.                     vskip4pt hrule height 4pt width hsize vskip4pt}%
  1305.    % No rule at page bottom unless we print one at the top with @title.
  1306.    finishedtitlepagetrue
  1307.    %
  1308.    % Now you can put text using @subtitle.
  1309.    defsubtitle{parseargsubtitlezzz}%
  1310.    defsubtitlezzz##1{{subtitlefont rightline{##1}}}%
  1311.    %
  1312.    % @author should come last, but may come many times.
  1313.    defauthor{parseargauthorzzz}%
  1314.    defauthorzzz##1{ifseenauthorelsevskip 0pt plus 1filllseenauthortruefi
  1315.       {authorfont leftline{##1}}}%
  1316.    %
  1317.    % Most title ``pages'' are actually two pages long, with space
  1318.    % at the top of the second.  We don't want the ragged left on the second.
  1319.    letoldpage = page
  1320.    defpage{%
  1321.       iffinishedtitlepageelse
  1322.          finishtitlepage
  1323.       fi
  1324.       oldpage
  1325.       letpage = oldpage
  1326.       hbox{}}%
  1327. %   defpage{oldpage hbox{}}
  1328. }
  1329. defEtitlepage{%
  1330.    iffinishedtitlepageelse
  1331.       finishtitlepage
  1332.    fi
  1333.    % It is important to do the page break before ending the group,
  1334.    % because the headline and footline are only empty inside the group.
  1335.    % If we use the new definition of page, we always get a blank page
  1336.    % after the title page, which we certainly don't want.
  1337.    oldpage
  1338.    endgroup
  1339.    HEADINGSon
  1340. }
  1341. deffinishtitlepage{%
  1342.    vskip4pt hrule height 2pt width hsize
  1343.    vskiptitlepagebottomglue
  1344.    finishedtitlepagetrue
  1345. }
  1346. %%% Set up page headings and footings.
  1347. letthispage=folio
  1348. newtoks evenheadline    % Token sequence for heading line of even pages
  1349. newtoks oddheadline     % Token sequence for heading line of odd pages
  1350. newtoks evenfootline    % Token sequence for footing line of even pages
  1351. newtoks oddfootline     % Token sequence for footing line of odd pages
  1352. % Now make Tex use those variables
  1353. headline={{textfontsrm ifoddpageno theoddheadline
  1354.                             else theevenheadline fi}}
  1355. footline={{textfontsrm ifoddpageno theoddfootline
  1356.                             else theevenfootline fi}HEADINGShook}
  1357. letHEADINGShook=relax
  1358. % Commands to set those variables.
  1359. % For example, this is what  @headings on  does
  1360. % @evenheading @thistitle|@thispage|@thischapter
  1361. % @oddheading @thischapter|@thispage|@thistitle
  1362. % @evenfooting @thisfile||
  1363. % @oddfooting ||@thisfile
  1364. defevenheading{parseargevenheadingxxx}
  1365. defoddheading{parseargoddheadingxxx}
  1366. defeveryheading{parseargeveryheadingxxx}
  1367. defevenfooting{parseargevenfootingxxx}
  1368. defoddfooting{parseargoddfootingxxx}
  1369. defeveryfooting{parseargeveryfootingxxx}
  1370. {catcode`@=0 %
  1371. gdefevenheadingxxx #1{evenheadingyyy #1@|@|@|@|finish}
  1372. gdefevenheadingyyy #1@|#2@|#3@|#4finish{%
  1373. globalevenheadline={rlap{centerline{#2}}line{#1hfil#3}}}
  1374. gdefoddheadingxxx #1{oddheadingyyy #1@|@|@|@|finish}
  1375. gdefoddheadingyyy #1@|#2@|#3@|#4finish{%
  1376. globaloddheadline={rlap{centerline{#2}}line{#1hfil#3}}}
  1377. gdefeveryheadingxxx#1{oddheadingxxx{#1}evenheadingxxx{#1}}%
  1378. gdefevenfootingxxx #1{evenfootingyyy #1@|@|@|@|finish}
  1379. gdefevenfootingyyy #1@|#2@|#3@|#4finish{%
  1380. globalevenfootline={rlap{centerline{#2}}line{#1hfil#3}}}
  1381. gdefoddfootingxxx #1{oddfootingyyy #1@|@|@|@|finish}
  1382. gdefoddfootingyyy #1@|#2@|#3@|#4finish{%
  1383.   globaloddfootline = {rlap{centerline{#2}}line{#1hfil#3}}%
  1384.   %
  1385.   % Leave some space for the footline.  Hopefully ok to assume
  1386.   % @evenfooting will not be used by itself.
  1387.   globaladvancepageheight by -baselineskip
  1388.   globaladvancevsize by -baselineskip
  1389. }
  1390. gdefeveryfootingxxx#1{oddfootingxxx{#1}evenfootingxxx{#1}}
  1391. %
  1392. }% unbind the catcode of @.
  1393. % @headings double      turns headings on for double-sided printing.
  1394. % @headings single      turns headings on for single-sided printing.
  1395. % @headings off         turns them off.
  1396. % @headings on          same as @headings double, retained for compatibility.
  1397. % @headings after       turns on double-sided headings after this page.
  1398. % @headings doubleafter turns on double-sided headings after this page.
  1399. % @headings singleafter turns on single-sided headings after this page.
  1400. % By default, they are off at the start of a document,
  1401. % and turned `on' after @end titlepage.
  1402. defheadings #1 {csname HEADINGS#1endcsname}
  1403. defHEADINGSoff{
  1404. globalevenheadline={hfil} globalevenfootline={hfil}
  1405. globaloddheadline={hfil} globaloddfootline={hfil}}
  1406. HEADINGSoff
  1407. % When we turn headings on, set the page number to 1.
  1408. % For double-sided printing, put current file name in lower left corner,
  1409. % chapter name on inside top of right hand pages, document
  1410. % title on inside top of left hand pages, and page numbers on outside top
  1411. % edge of all pages.
  1412. defHEADINGSdouble{
  1413. globalpageno=1
  1414. globalevenfootline={hfil}
  1415. globaloddfootline={hfil}
  1416. globalevenheadline={line{foliohfilthistitle}}
  1417. globaloddheadline={line{thischapterhfilfolio}}
  1418. globalletcontentsalignmacro = chapoddpage
  1419. }
  1420. letcontentsalignmacro = chappager
  1421. % For single-sided printing, chapter title goes across top left of page,
  1422. % page number on top right.
  1423. defHEADINGSsingle{
  1424. globalpageno=1
  1425. globalevenfootline={hfil}
  1426. globaloddfootline={hfil}
  1427. globalevenheadline={line{thischapterhfilfolio}}
  1428. globaloddheadline={line{thischapterhfilfolio}}
  1429. globalletcontentsalignmacro = chappager
  1430. }
  1431. defHEADINGSon{HEADINGSdouble}
  1432. defHEADINGSafter{letHEADINGShook=HEADINGSdoublex}
  1433. letHEADINGSdoubleafter=HEADINGSafter
  1434. defHEADINGSdoublex{%
  1435. globalevenfootline={hfil}
  1436. globaloddfootline={hfil}
  1437. globalevenheadline={line{foliohfilthistitle}}
  1438. globaloddheadline={line{thischapterhfilfolio}}
  1439. globalletcontentsalignmacro = chapoddpage
  1440. }
  1441. defHEADINGSsingleafter{letHEADINGShook=HEADINGSsinglex}
  1442. defHEADINGSsinglex{%
  1443. globalevenfootline={hfil}
  1444. globaloddfootline={hfil}
  1445. globalevenheadline={line{thischapterhfilfolio}}
  1446. globaloddheadline={line{thischapterhfilfolio}}
  1447. globalletcontentsalignmacro = chappager
  1448. }
  1449. % Subroutines used in generating headings
  1450. % Produces Day Month Year style of output.
  1451. deftoday{numberdayspace
  1452. ifcasemonthor
  1453. Januaryor Februaryor Marchor Aprilor Mayor Juneor
  1454. Julyor Augustor Septemberor Octoberor Novemberor Decemberfi
  1455. spacenumberyear}
  1456. % Use this if you want the Month Day, Year style of output.
  1457. %deftoday{ifcasemonthor
  1458. %Januaryor Februaryor Marchor Aprilor Mayor Juneor
  1459. %Julyor Augustor Septemberor Octoberor Novemberor Decemberfi
  1460. %spacenumberday, numberyear}
  1461. % @settitle line...  specifies the title of the document, for headings
  1462. % It generates no output of its own
  1463. defthistitle{No Title}
  1464. defsettitle{parseargsettitlezzz}
  1465. defsettitlezzz #1{gdefthistitle{#1}}
  1466. message{tables,}
  1467. % @tabs -- simple alignment
  1468. % These don't work.  For one thing, + is defined as outer.
  1469. % So these macros cannot even be defined.
  1470. %deftabs{parseargtabszzz}
  1471. %deftabszzz #1{settabs+#1cr}
  1472. %deftabline{parseargtablinezzz}
  1473. %deftablinezzz #1{+#1cr}
  1474. %def&{&}
  1475. % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
  1476. % default indentation of table text
  1477. newdimentableindent tableindent=.8in
  1478. % default indentation of @itemize and @enumerate text
  1479. newdimenitemindent  itemindent=.3in
  1480. % margin between end of table item and start of table text.
  1481. newdimenitemmargin  itemmargin=.1in
  1482. % used internally for itemindent minus itemmargin
  1483. newdimenitemmax
  1484. % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
  1485. % these defs.
  1486. % They also define itemindex
  1487. % to index the item name in whatever manner is desired (perhaps none).
  1488. newififitemxneedsnegativevskip
  1489. defitemxpar{parifitemxneedsnegativevskipnobreakvskip-parskipnobreakfi}
  1490. definternalBitem{smallbreak parseargitemzzz}
  1491. definternalBitemx{itemxpar parseargitemzzz}
  1492. definternalBxitem "#1"{defxitemsubtopix{#1} smallbreak parseargxitemzzz}
  1493. definternalBxitemx "#1"{defxitemsubtopix{#1} itemxpar parseargxitemzzz}
  1494. definternalBkitem{smallbreak parseargkitemzzz}
  1495. definternalBkitemx{itemxpar parseargkitemzzz}
  1496. defkitemzzz #1{dosubind {kw}{code{#1}}{for {bf lastfunction}}%
  1497.                  itemzzz {#1}}
  1498. defxitemzzz #1{dosubind {kw}{code{#1}}{for {bf xitemsubtopic}}%
  1499.                  itemzzz {#1}}
  1500. defitemzzz #1{begingroup %
  1501.   advancehsize by -rightskip
  1502.   advancehsize by -tableindent
  1503.   setbox0=hbox{itemfont{#1}}%
  1504.   itemindex{#1}%
  1505.   nobreak % This prevents a break before @itemx.
  1506.   %
  1507.   % Be sure we are not still in the middle of a paragraph.
  1508.   %{parskip = 0in
  1509.   %par
  1510.   %}%
  1511.   %
  1512.   % If the item text does not fit in the space we have, put it on a line
  1513.   % by itself, and do not allow a page break either before or after that
  1514.   % line.  We do not start a paragraph here because then if the next
  1515.   % command is, e.g., @kindex, the whatsit would get put into the
  1516.   % horizontal list on a line by itself, resulting in extra blank space.
  1517.   ifdim wd0>itemmax
  1518.     %
  1519.     % Make this a paragraph so we get the parskip glue and wrapping,
  1520.     % but leave it ragged-right.
  1521.     begingroup
  1522.       advanceleftskip by-tableindent
  1523.       advancehsize bytableindent
  1524.       advancerightskip by0pt plus1fil
  1525.       leavevmodeunhbox0par
  1526.     endgroup
  1527.     %
  1528.     % We're going to be starting a paragraph, but we don't want the
  1529.     % parskip glue -- logically it's part of the @item we just started.
  1530.     nobreak vskip-parskip
  1531.     %
  1532.     % Stop a page break at the parskip glue coming up.  Unfortunately
  1533.     % we can't prevent a possible page break at the following
  1534.     % baselineskip glue.
  1535.     nobreak
  1536.     endgroup
  1537.     itemxneedsnegativevskipfalse
  1538.   else
  1539.     % The item text fits into the space.  Start a paragraph, so that the
  1540.     % following text (if any) will end up on the same line.  Since that
  1541.     % text will be indented by tableindent, we make the item text be in
  1542.     % a zero-width box.
  1543.     noindent
  1544.     rlap{hskip -tableindentbox0}ignorespaces%
  1545.     endgroup%
  1546.     itemxneedsnegativevskiptrue%
  1547.   fi
  1548. }
  1549. defitem{errmessage{@item while not in a table}}
  1550. defitemx{errmessage{@itemx while not in a table}}
  1551. defkitem{errmessage{@kitem while not in a table}}
  1552. defkitemx{errmessage{@kitemx while not in a table}}
  1553. defxitem{errmessage{@xitem while not in a table}}
  1554. defxitemx{errmessage{@xitemx while not in a table}}
  1555. %% Contains a kludge to get @end[description] to work
  1556. defdescription{tablez{dontindex}{1}{}{}{}{}}
  1557. deftable{begingroupinENVobeylinesobeyspacestablex}
  1558. {obeylinesobeyspaces%
  1559. gdeftablex #1^^M{%
  1560. tableydontindex#1        endtabley}}
  1561. defftable{begingroupinENVobeylinesobeyspacesftablex}
  1562. {obeylinesobeyspaces%
  1563. gdefftablex #1^^M{%
  1564. tableyfnitemindex#1        endtabley
  1565. defEftable{endgrafafterenvbreakendgroup}%
  1566. letEtable=relax}}
  1567. defvtable{begingroupinENVobeylinesobeyspacesvtablex}
  1568. {obeylinesobeyspaces%
  1569. gdefvtablex #1^^M{%
  1570. tableyvritemindex#1        endtabley
  1571. defEvtable{endgrafafterenvbreakendgroup}%
  1572. letEtable=relax}}
  1573. defdontindex #1{}
  1574. deffnitemindex #1{doind {fn}{code{#1}}}%
  1575. defvritemindex #1{doind {vr}{code{#1}}}%
  1576. {obeyspaces %
  1577. gdeftabley#1#2 #3 #4 #5 #6 #7endtabley{endgroup%
  1578. tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
  1579. deftablez #1#2#3#4#5#6{%
  1580. aboveenvbreak %
  1581. begingroup %
  1582. defEdescription{Etable}% Necessary kludge.
  1583. letitemindex=#1%
  1584. ifnum 0#3>0 advance leftskip by #3mil fi %
  1585. ifnum 0#4>0 tableindent=#4mil fi %
  1586. ifnum 0#5>0 advance rightskip by #5mil fi %
  1587. defitemfont{#2}%
  1588. itemmax=tableindent %
  1589. advance itemmax by -itemmargin %
  1590. advance leftskip by tableindent %
  1591. exdentamount=tableindent
  1592. parindent = 0pt
  1593. parskip = smallskipamount
  1594. ifdim parskip=0pt parskip=2pt fi%
  1595. defEtable{endgrafafterenvbreakendgroup}%
  1596. letitem = internalBitem %
  1597. letitemx = internalBitemx %
  1598. letkitem = internalBkitem %
  1599. letkitemx = internalBkitemx %
  1600. letxitem = internalBxitem %
  1601. letxitemx = internalBxitemx %
  1602. }
  1603. % This is the counter used by @enumerate, which is really @itemize
  1604. newcount itemno
  1605. defitemize{parseargitemizezzz}
  1606. defitemizezzz #1{%
  1607.   begingroup % ended by the @end itemsize
  1608.   itemizey {#1}{Eitemize}
  1609. }
  1610. defitemizey #1#2{%
  1611. aboveenvbreak %
  1612. itemmax=itemindent %
  1613. advance itemmax by -itemmargin %
  1614. advance leftskip by itemindent %
  1615. exdentamount=itemindent
  1616. parindent = 0pt %
  1617. parskip = smallskipamount %
  1618. ifdim parskip=0pt parskip=2pt fi%
  1619. def#2{endgrafafterenvbreakendgroup}%
  1620. defitemcontents{#1}%
  1621. letitem=itemizeitem}
  1622. % Set sfcode to normal for the chars that usually have another value.
  1623. % These are `.?!:;,'
  1624. deffrenchspacing{sfcode46=1000 sfcode63=1000 sfcode33=1000
  1625.   sfcode58=1000 sfcode59=1000 sfcode44=1000 }
  1626. % splitoff TOKENSendmark defines first to be the first token in
  1627. % TOKENS, and rest to be the remainder.
  1628. %
  1629. defsplitoff#1#2endmark{deffirst{#1}defrest{#2}}%
  1630. % Allow an optional argument of an uppercase letter, lowercase letter,
  1631. % or number, to specify the first label in the enumerated list.  No
  1632. % argument is the same as `1'.
  1633. %
  1634. defenumerate{parseargenumeratezzz}
  1635. defenumeratezzz #1{enumeratey #1  endenumeratey}
  1636. defenumeratey #1 #2endenumeratey{%
  1637.   begingroup % ended by the @end enumerate
  1638.   %
  1639.   % If we were given no argument, pretend we were given `1'.
  1640.   defthearg{#1}%
  1641.   ifxtheargempty defthearg{1}fi
  1642.   %
  1643.   % Detect if the argument is a single token.  If so, it might be a
  1644.   % letter.  Otherwise, the only valid thing it can be is a number.
  1645.   % (We will always have one token, because of the test we just made.
  1646.   % This is a good thing, since splitoff doesn't work given nothing at
  1647.   % all -- the first parameter is undelimited.)
  1648.   expandaftersplitofftheargendmark
  1649.   ifxrestempty
  1650.     % Only one token in the argument.  It could still be anything.
  1651.     % A ``lowercase letter'' is one whose lccode is nonzero.
  1652.     % An ``uppercase letter'' is one whose lccode is both nonzero, and
  1653.     %   not equal to itself.
  1654.     % Otherwise, we assume it's a number.
  1655.     %
  1656.     % We need the relax at the end of the ifnum lines to stop TeX from
  1657.     % continuing to look for a <number>.
  1658.     %
  1659.     ifnumlccodeexpandafter`thearg=0relax
  1660.       numericenumerate % a number (we hope)
  1661.     else
  1662.       % It's a letter.
  1663.       ifnumlccodeexpandafter`thearg=expandafter`theargrelax
  1664.         lowercaseenumerate % lowercase letter
  1665.       else
  1666.         uppercaseenumerate % uppercase letter
  1667.       fi
  1668.     fi
  1669.   else
  1670.     % Multiple tokens in the argument.  We hope it's a number.
  1671.     numericenumerate
  1672.   fi
  1673. }
  1674. % An @enumerate whose labels are integers.  The starting integer is
  1675. % given in thearg.
  1676. %
  1677. defnumericenumerate{%
  1678.   itemno = thearg
  1679.   startenumeration{theitemno}%
  1680. }
  1681. % The starting (lowercase) letter is in thearg.
  1682. deflowercaseenumerate{%
  1683.   itemno = expandafter`thearg
  1684.   startenumeration{%
  1685.     % Be sure we're not beyond the end of the alphabet.
  1686.     ifnumitemno=0
  1687.       errmessage{No more lowercase letters in @enumerate; get a bigger
  1688.                   alphabet}%
  1689.     fi
  1690.     charlccodeitemno
  1691.   }%
  1692. }
  1693. % The starting (uppercase) letter is in thearg.
  1694. defuppercaseenumerate{%
  1695.   itemno = expandafter`thearg
  1696.   startenumeration{%
  1697.     % Be sure we're not beyond the end of the alphabet.
  1698.     ifnumitemno=0
  1699.       errmessage{No more uppercase letters in @enumerate; get a bigger
  1700.                   alphabet}
  1701.     fi
  1702.     charuccodeitemno
  1703.   }%
  1704. }
  1705. % Call itemizey, adding a period to the first argument and supplying the
  1706. % common last two arguments.  Also subtract one from the initial value in
  1707. % itemno, since @item increments itemno.
  1708. %
  1709. defstartenumeration#1{%
  1710.   advanceitemno by -1
  1711.   itemizey{#1.}Eenumerateflushcr
  1712. }
  1713. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  1714. % to @enumerate.
  1715. %
  1716. defalphaenumerate{enumerate{a}}
  1717. defcapsenumerate{enumerate{A}}
  1718. defEalphaenumerate{Eenumerate}
  1719. defEcapsenumerate{Eenumerate}
  1720. % Definition of @item while inside @itemize.
  1721. defitemizeitem{%
  1722. advanceitemno by 1
  1723. {letpar=endgraf smallbreak}%
  1724. ifhmode errmessage{In hmode at itemizeitem}fi
  1725. {parskip=0in hskip 0pt
  1726. hbox to 0pt{hss itemcontentshskip itemmargin}%
  1727. vadjust{penalty 1200}}%
  1728. flushcr}
  1729. % @multitable macros
  1730. % Amy Hendrickson, 8/18/94, 3/6/96
  1731. %
  1732. % @multitable ... @end multitable will make as many columns as desired.
  1733. % Contents of each column will wrap at width given in preamble.  Width
  1734. % can be specified either with sample text given in a template line,
  1735. % or in percent of hsize, the current width of text on page.
  1736. % Table can continue over pages but will only break between lines.
  1737. % To make preamble:
  1738. %
  1739. % Either define widths of columns in terms of percent of hsize:
  1740. %   @multitable @columnfractions .25 .3 .45
  1741. %   @item ...
  1742. %
  1743. %   Numbers following @columnfractions are the percent of the total
  1744. %   current hsize to be used for each column. You may use as many
  1745. %   columns as desired.
  1746. % Or use a template:
  1747. %   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  1748. %   @item ...
  1749. %   using the widest term desired in each column.
  1750. %
  1751. % For those who want to use more than one line's worth of words in
  1752. % the preamble, break the line within one argument and it
  1753. % will parse correctly, i.e.,
  1754. %
  1755. %     @multitable {Column 1 template} {Column 2 template} {Column 3
  1756. %      template}
  1757. % Not:
  1758. %     @multitable {Column 1 template} {Column 2 template}
  1759. %      {Column 3 template}
  1760. % Each new table line starts with @item, each subsequent new column
  1761. % starts with @tab. Empty columns may be produced by supplying @tab's
  1762. % with nothing between them for as many times as empty columns are needed,
  1763. % ie, @tab@tab@tab will produce two empty columns.
  1764. % @item, @tab, @multitable or @end multitable do not need to be on their
  1765. % own lines, but it will not hurt if they are.
  1766. % Sample multitable:
  1767. %   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  1768. %   @item first col stuff @tab second col stuff @tab third col
  1769. %   @item
  1770. %   first col stuff
  1771. %   @tab
  1772. %   second col stuff
  1773. %   @tab
  1774. %   third col
  1775. %   @item first col stuff @tab second col stuff
  1776. %   @tab Many paragraphs of text may be used in any column.
  1777. %
  1778. %         They will wrap at the width determined by the template.
  1779. %   @item@tab@tab This will be in third column.
  1780. %   @end multitable
  1781. % Default dimensions may be reset by user.
  1782. % @multitableparskip is vertical space between paragraphs in table.
  1783. % @multitableparindent is paragraph indent in table.
  1784. % @multitablecolmargin is horizontal space to be left between columns.
  1785. % @multitablelinespace is space to leave between table items, baseline
  1786. %                                                            to baseline.
  1787. %   0pt means it depends on current normal line spacing.
  1788. %%%%
  1789. % Dimensions
  1790. newskipmultitableparskip
  1791. newskipmultitableparindent
  1792. newdimenmultitablecolspace
  1793. newskipmultitablelinespace
  1794. multitableparskip=0pt
  1795. multitableparindent=6pt
  1796. multitablecolspace=12pt
  1797. multitablelinespace=0pt
  1798. %%%%
  1799. % Macros used to set up halign preamble:
  1800. letendsetuptablerelax
  1801. defxendsetuptable{endsetuptable}
  1802. letcolumnfractionsrelax
  1803. defxcolumnfractions{columnfractions}
  1804. newififsetpercent
  1805. %% 2/1/96, to allow fractions to be given with more than one digit.
  1806. defpickupwholefraction#1 {globaladvancecolcount by1 %
  1807. expandafterxdefcsname colthecolcountendcsname{.#1hsize}%
  1808. setuptable}
  1809. newcountcolcount
  1810. defsetuptable#1{deffirstarg{#1}%
  1811. ifxfirstargxendsetuptableletgorelax%
  1812. else
  1813.   ifxfirstargxcolumnfractionsglobalsetpercenttrue%
  1814.   else
  1815.     ifsetpercent
  1816.        letgopickupwholefraction   % In this case arg of setuptable
  1817.                                      % is the decimal point before the
  1818.                                      % number given in percent of hsize.
  1819.                                      % We don't need this so we don't use it.
  1820.     else
  1821.        globaladvancecolcount by1
  1822.        setbox0=hbox{#1 }% Add a normal word space as a separator;
  1823.                           % typically that is always in the input, anyway.
  1824.        expandafterxdefcsname colthecolcountendcsname{thewd0}%
  1825.     fi%
  1826.   fi%
  1827. ifxgopickupwholefractionelseletgosetuptablefi%
  1828. figo}
  1829. %%%%
  1830. % multitable syntax
  1831. deftab{&hskip1sprelax} % 2/2/96
  1832.                            % tiny skip here makes sure this column space is
  1833.                            % maintained, even if it is never used.
  1834. %%%%
  1835. % @multitable ... @end multitable definitions:
  1836. defmultitable{parseargdotable}
  1837. defdotable#1{bgroup
  1838. letitemcr
  1839. tolerance=9500
  1840. hbadness=9500
  1841. setmultitablespacing
  1842. parskip=multitableparskip
  1843. parindent=multitableparindent
  1844. overfullrule=0pt
  1845. globalcolcount=0relax%
  1846. defEmultitable{globalsetpercentfalseglobaleverycr{}cregroupegroup}%
  1847.  % To parse everything between @multitable and @item :
  1848. setuptable#1 endsetuptable
  1849.  % Need to reset this to 0 after setuptable.
  1850. globalcolcount=0relax%
  1851.  %
  1852.  % This preamble sets up a generic column definition, which will
  1853.  % be used as many times as user calls for columns.
  1854.  % vtop will set a single line and will also let text wrap and
  1855.  % continue for many paragraphs if desired.
  1856. halignbgroup&globaladvancecolcount by 1relax%
  1857. multistrutvtop{hsize=expandaftercsname colthecolcountendcsname
  1858.  % In order to keep entries from bumping into each other
  1859.  % we will add a leftskip of multitablecolspace to all columns after
  1860.  % the first one.
  1861.  %  If a template has been used, we will add multitablecolspace
  1862.  % to the width of each template entry.
  1863.  %  If user has set preamble in terms of percent of hsize
  1864.  % we will use that dimension as the width of the column, and
  1865.  % the leftskip will keep entries from bumping into each other.
  1866.  % Table will start at left margin and final column will justify at
  1867.  % right margin.
  1868. ifnumcolcount=1
  1869. else
  1870.   ifsetpercent
  1871.   else
  1872.    % If user has <not> set preamble in terms of percent of hsize
  1873.    % we will advance hsize by multitablecolspace
  1874.   advancehsize by multitablecolspace
  1875.   fi
  1876.  % In either case we will make leftskip=multitablecolspace:
  1877. leftskip=multitablecolspace
  1878. fi
  1879.  % Ignoring space at the beginning and end avoids an occasional spurious
  1880.  % blank line, when TeX decides to break the line at the space before the
  1881.  % box from the multistrut, so the strut ends up on a line by itself.
  1882.  % For example:
  1883.  % @multitable @columnfractions .11 .89
  1884.  % @item @code{#}
  1885.  % @tab Legal holiday which is valid in major parts of the whole country.
  1886.  % Is automatically provided with highlighting sequences respectively marking
  1887.  % characters.
  1888.  noindentignorespaces##unskipmultistrut}cr
  1889.  % everycr will reset column counter, colcount, at the end of
  1890.  % each line. Every column  entry will cause colcount to advance by one.
  1891.  % The table preamble
  1892.  % looks at the current colcount to find the correct column width.
  1893. globaleverycr{noalign{%
  1894. % filbreak%% keeps underfull box messages off when table breaks over pages.
  1895. % Maybe so, but it also creates really weird page breaks when the table
  1896. % breaks over pages Wouldn't vfil be better?  Wait until the problem
  1897. % manifests itself, so it can be fixed for real --karl.
  1898. globalcolcount=0relax}}
  1899. }
  1900. defsetmultitablespacing{% test to see if user has set multitablelinespace.
  1901. % If so, do nothing. If not, give it an appropriate dimension based on
  1902. % current baselineskip.
  1903. ifdimmultitablelinespace=0pt
  1904. %% strut to put in table in case some entry doesn't have descenders,
  1905. %% to keep lines equally spaced
  1906. letmultistrut = strut
  1907. %% Test to see if parskip is larger than space between lines of
  1908. %% table. If not, do nothing.
  1909. %%        If so, set to same dimension as multitablelinespace.
  1910. else
  1911. gdefmultistrut{vrule heightmultitablelinespace depthdp0
  1912. width0ptrelax} fi
  1913. ifdimmultitableparskip>multitablelinespace
  1914. globalmultitableparskip=multitablelinespace
  1915. globaladvancemultitableparskip-7pt %% to keep parskip somewhat smaller
  1916.                                       %% than skip between lines in the table.
  1917. fi%
  1918. ifdimmultitableparskip=0pt
  1919. globalmultitableparskip=multitablelinespace
  1920. globaladvancemultitableparskip-7pt %% to keep parskip somewhat smaller
  1921.                                       %% than skip between lines in the table.
  1922. fi}
  1923. message{indexing,}
  1924. % Index generation facilities
  1925. % Define newwrite to be identical to plain tex's newwrite
  1926. % except not outer, so it can be used within newindex.
  1927. {catcode`@=11
  1928. gdefnewwrite{alloc@7writechardefsixt@@n}}
  1929. % newindex {foo} defines an index named foo.
  1930. % It automatically defines fooindex such that
  1931. % fooindex ...rest of line... puts an entry in the index foo.
  1932. % It also defines fooindfile to be the number of the output channel for
  1933. % the file that accumulates this index.  The file's extension is foo.
  1934. % The name of an index should be no more than 2 characters long
  1935. % for the sake of vms.
  1936. defnewindex #1{
  1937. expandafternewwrite csname#1indfileendcsname% Define number for output file
  1938. openout csname#1indfileendcsname jobname.#1 % Open the file
  1939. expandafterxdefcsname#1indexendcsname{%     % Define xxxindex
  1940. noexpanddoindex {#1}}
  1941. }
  1942. % @defindex foo  ==  newindex{foo}
  1943. defdefindex{parseargnewindex}
  1944. % Define @defcodeindex, like @defindex except put all entries in @code.
  1945. defnewcodeindex #1{
  1946. expandafternewwrite csname#1indfileendcsname% Define number for output file
  1947. openout csname#1indfileendcsname jobname.#1 % Open the file
  1948. expandafterxdefcsname#1indexendcsname{%     % Define xxxindex
  1949. noexpanddocodeindex {#1}}
  1950. }
  1951. defdefcodeindex{parseargnewcodeindex}
  1952. % @synindex foo bar    makes index foo feed into index bar.
  1953. % Do this instead of @defindex foo if you don't want it as a separate index.
  1954. defsynindex #1 #2 {%
  1955. expandafterletexpandaftersynindexfooexpandafter=csname#2indfileendcsname
  1956. expandafterletcsname#1indfileendcsname=synindexfoo
  1957. expandafterxdefcsname#1indexendcsname{%     % Define xxxindex
  1958. noexpanddoindex {#2}}%
  1959. }
  1960. % @syncodeindex foo bar   similar, but put all entries made for index foo
  1961. % inside @code.
  1962. defsyncodeindex #1 #2 {%
  1963. expandafterletexpandaftersynindexfooexpandafter=csname#2indfileendcsname
  1964. expandafterletcsname#1indfileendcsname=synindexfoo
  1965. expandafterxdefcsname#1indexendcsname{%     % Define xxxindex
  1966. noexpanddocodeindex {#2}}%
  1967. }
  1968. % Define doindex, the driver for all fooindex macros.
  1969. % Argument #1 is generated by the calling fooindex macro,
  1970. %  and it is "foo", the name of the index.
  1971. % doindex just uses parsearg; it calls doind for the actual work.
  1972. % This is because doind is more useful to call from other macros.
  1973. % There is also dosubind {index}{topic}{subtopic}
  1974. % which makes an entry in a two-level index such as the operation index.
  1975. defdoindex#1{edefindexname{#1}parseargsingleindexer}
  1976. defsingleindexer #1{doind{indexname}{#1}}
  1977. % like the previous two, but they put @code around the argument.
  1978. defdocodeindex#1{edefindexname{#1}parseargsinglecodeindexer}
  1979. defsinglecodeindexer #1{doind{indexname}{code{#1}}}
  1980. defindexdummies{%
  1981. % Take care of the plain tex accent commands.
  1982. def"{realbackslash "}%
  1983. def`{realbackslash `}%
  1984. def'{realbackslash '}%
  1985. def^{realbackslash ^}%
  1986. def~{realbackslash ~}%
  1987. def={realbackslash =}%
  1988. defb{realbackslash b}%
  1989. defc{realbackslash c}%
  1990. defd{realbackslash d}%
  1991. defu{realbackslash u}%
  1992. defv{realbackslash v}%
  1993. defH{realbackslash H}%
  1994. % Take care of the plain tex special European modified letters.
  1995. defoe{realbackslash oe}%
  1996. defae{realbackslash ae}%
  1997. defaa{realbackslash aa}%
  1998. defOE{realbackslash OE}%
  1999. defAE{realbackslash AE}%
  2000. defAA{realbackslash AA}%
  2001. defo{realbackslash o}%
  2002. defO{realbackslash O}%
  2003. defl{realbackslash l}%
  2004. defL{realbackslash L}%
  2005. defss{realbackslash ss}%
  2006. % Take care of texinfo commands likely to appear in an index entry.
  2007. % (Must be a way to avoid doing expansion at all, and thus not have to
  2008. % laboriously list every single command here.)
  2009. def@{@}% will be @@ when we switch to @ as escape char.
  2010. %let{ = lbracecmd
  2011. %let} = rbracecmd
  2012. def_{{realbackslash _}}%
  2013. defw{realbackslash w }%
  2014. defbf{realbackslash bf }%
  2015. %defrm{realbackslash rm }%
  2016. defsl{realbackslash sl }%
  2017. defsf{realbackslash sf}%
  2018. deftt{realbackslash tt}%
  2019. defgtr{realbackslash gtr}%
  2020. defless{realbackslash less}%
  2021. defhat{realbackslash hat}%
  2022. %defchar{realbackslash char}%
  2023. defTeX{realbackslash TeX}%
  2024. defdots{realbackslash dots }%
  2025. defresult{realbackslash result}%
  2026. defequiv{realbackslash equiv}%
  2027. defexpansion{realbackslash expansion}%
  2028. defprint{realbackslash print}%
  2029. deferror{realbackslash error}%
  2030. defpoint{realbackslash point}%
  2031. defcopyright{realbackslash copyright}%
  2032. deftclose##1{realbackslash tclose {##1}}%
  2033. defcode##1{realbackslash code {##1}}%
  2034. defdotless##1{realbackslash dotless {##1}}%
  2035. defsamp##1{realbackslash samp {##1}}%
  2036. def,##1{realbackslash ,{##1}}%
  2037. deft##1{realbackslash t {##1}}%
  2038. defr##1{realbackslash r {##1}}%
  2039. defi##1{realbackslash i {##1}}%
  2040. defb##1{realbackslash b {##1}}%
  2041. defsc##1{realbackslash sc {##1}}%
  2042. defcite##1{realbackslash cite {##1}}%
  2043. defkey##1{realbackslash key {##1}}%
  2044. deffile##1{realbackslash file {##1}}%
  2045. defvar##1{realbackslash var {##1}}%
  2046. defkbd##1{realbackslash kbd {##1}}%
  2047. defdfn##1{realbackslash dfn {##1}}%
  2048. defemph##1{realbackslash emph {##1}}%
  2049. defvalue##1{realbackslash value {##1}}%
  2050. unsepspaces
  2051. }
  2052. % If an index command is used in an @example environment, any spaces
  2053. % therein should become regular spaces in the raw index file, not the
  2054. % expansion of tie (\leavevmode penalty @M  ).
  2055. {obeyspaces
  2056.  gdefunsepspaces{obeyspaceslet =space}}
  2057. % indexnofonts no-ops all font-change commands.
  2058. % This is used when outputting the strings to sort the index by.
  2059. defindexdummyfont#1{#1}
  2060. defindexdummytex{TeX}
  2061. defindexdummydots{...}
  2062. defindexnofonts{%
  2063. % Just ignore accents.
  2064. let,=indexdummyfont
  2065. let"=indexdummyfont
  2066. let`=indexdummyfont
  2067. let'=indexdummyfont
  2068. let^=indexdummyfont
  2069. let~=indexdummyfont
  2070. let==indexdummyfont
  2071. letb=indexdummyfont
  2072. letc=indexdummyfont
  2073. letd=indexdummyfont
  2074. letu=indexdummyfont
  2075. letv=indexdummyfont
  2076. letH=indexdummyfont
  2077. letdotless=indexdummyfont
  2078. % Take care of the plain tex special European modified letters.
  2079. defoe{oe}%
  2080. defae{ae}%
  2081. defaa{aa}%
  2082. defOE{OE}%
  2083. defAE{AE}%
  2084. defAA{AA}%
  2085. defo{o}%
  2086. defO{O}%
  2087. defl{l}%
  2088. defL{L}%
  2089. defss{ss}%
  2090. letw=indexdummyfont
  2091. lett=indexdummyfont
  2092. letr=indexdummyfont
  2093. leti=indexdummyfont
  2094. letb=indexdummyfont
  2095. letemph=indexdummyfont
  2096. letstrong=indexdummyfont
  2097. letcite=indexdummyfont
  2098. letsc=indexdummyfont
  2099. %Don't no-op tt, since it isn't a user-level command
  2100. % and is used in the definitions of the active chars like <, >, |...
  2101. %lettt=indexdummyfont
  2102. lettclose=indexdummyfont
  2103. letcode=indexdummyfont
  2104. letfile=indexdummyfont
  2105. letsamp=indexdummyfont
  2106. letkbd=indexdummyfont
  2107. letkey=indexdummyfont
  2108. letvar=indexdummyfont
  2109. letTeX=indexdummytex
  2110. letdots=indexdummydots
  2111. def@{@}%
  2112. }
  2113. % To define realbackslash, we must make  not be an escape.
  2114. % We must first make another character (@) an escape
  2115. % so we do not become unable to do a definition.
  2116. {catcode`@=0 catcode`\=other
  2117. @gdef@realbackslash{}}
  2118. letindexbackslash=0  %overridden during printindex.
  2119. letSETmarginindex=relax %initialize!
  2120. % workhorse for all fooindexes
  2121. % #1 is name of index, #2 is stuff to put there
  2122. defdoind #1#2{%
  2123.   % Put the index entry in the margin if desired.
  2124.   ifxSETmarginindexrelaxelse
  2125.     insertmargin{hbox{vrule height8pt depth3pt width0pt #2}}%
  2126.   fi
  2127.   {%
  2128.     count255=lastpenalty
  2129.     {%
  2130.       indexdummies % Must do this here, since bf, etc expand at this stage
  2131.       escapechar=`\
  2132.       {%
  2133.         letfolio=0% We will expand all macros now EXCEPT folio.
  2134.         defrawbackslashxx{indexbackslash}% indexbackslash isn't defined now
  2135.         % so it will be output as is; and it will print as backslash.
  2136.         %
  2137.         % First process the index-string with all font commands turned off
  2138.         % to get the string to sort by.
  2139.         {indexnofonts xdefindexsorttmp{#2}}%
  2140.         %
  2141.         % Now produce the complete index entry, with both the sort key and the
  2142.         % original text, including any font commands.
  2143.         toks0 = {#2}%
  2144.         edeftemp{%
  2145.           writecsname#1indfileendcsname{%
  2146.             realbackslash entry{indexsorttmp}{folio}{thetoks0}}%
  2147.         }%
  2148.         temp
  2149.       }%
  2150.     }%
  2151.     penaltycount255
  2152.   }%
  2153. }
  2154. defdosubind #1#2#3{%
  2155. {count10=lastpenalty %
  2156. {indexdummies % Must do this here, since bf, etc expand at this stage
  2157. escapechar=`\%
  2158. {letfolio=0%
  2159. defrawbackslashxx{indexbackslash}%
  2160. %
  2161. % Now process the index-string once, with all font commands turned off,
  2162. % to get the string to sort the index by.
  2163. {indexnofonts
  2164. xdeftemp1{#2 #3}%
  2165. }%
  2166. % Now produce the complete index entry.  We process the index-string again,
  2167. % this time with font commands expanded, to get what to print in the index.
  2168. edeftemp{%
  2169. write csname#1indfileendcsname{%
  2170. realbackslash entry {temp1}{folio}{#2}{#3}}}%
  2171. temp }%
  2172. }penaltycount10}}