home *** CD-ROM | disk | FTP | other *** search
/ ftp.freefriends.org / ftp.freefriends.org.tar / ftp.freefriends.org / texinfo / texinfo.tex~ (.txt) < prev   
Texinfo Document  |  2011-11-06  |  316KB  |  8,123 lines

  1. % texinfo.tex -- TeX macros to handle Texinfo files.
  2. % Load plain if necessary, i.e., if running under initex.
  3. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
  4. \def\texinfoversion{2011-11-06.09}
  5. % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
  6. % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
  7. % 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
  8. % This texinfo.tex file is free software: you can redistribute it and/or
  9. % modify it under the terms of the GNU General Public License as
  10. % published by the Free Software Foundation, either version 3 of the
  11. % License, or (at your option) any later version.
  12. % This texinfo.tex file is distributed in the hope that it will be
  13. % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  14. % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. % General Public License for more details.
  16. % You should have received a copy of the GNU General Public License
  17. % along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18. % As a special exception, when this file is read by TeX when processing
  19. % a Texinfo source document, you may use the result without
  20. % restriction.  (This has been our intent since Texinfo was invented.)
  21. % Please try the latest version of texinfo.tex before submitting bug
  22. % reports; you can get the latest version from:
  23. %   http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
  24. %   ftp://tug.org/tex/texinfo.tex
  25. %     (and all CTAN mirrors, see http://www.ctan.org).
  26. % The texinfo.tex in any given distribution could well be out
  27. % of date, so if that's what you're using, please check.
  28. % Send bug reports to bug-texinfo@gnu.org.  Please include including a
  29. % complete document in each bug report with which we can reproduce the
  30. % problem.  Patches are, of course, greatly appreciated.
  31. % To process a Texinfo manual with TeX, it's most reliable to use the
  32. % texi2dvi shell script that comes with the distribution.  For a simple
  33. % manual foo.texi, however, you can get away with this:
  34. %   tex foo.texi
  35. %   texindex foo.??
  36. %   tex foo.texi
  37. %   tex foo.texi
  38. %   dvips foo.dvi -o  # or whatever; this makes foo.ps.
  39. % The extra TeX runs get the cross-reference information correct.
  40. % Sometimes one run after texindex suffices, and sometimes you need more
  41. % than two; texi2dvi does it as many times as necessary.
  42. % It is possible to adapt texinfo.tex for other languages, to some
  43. % extent.  You can get the existing language-specific files from the
  44. % full Texinfo distribution.
  45. % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
  46. \message{Loading texinfo [version \texinfoversion]:}
  47. % If in a .fmt file, print the version number
  48. % and turn on active characters that we couldn't do earlier because
  49. % they might have appeared in the input file name.
  50. \everyjob{\message{[Texinfo version \texinfoversion]}%
  51.   \catcode`+=\active \catcode`\_=\active}
  52. \chardef\other=12
  53. % We never want plain's \outer definition of \+ in Texinfo.
  54. % For @tex, we can use \tabalign.
  55. \let\+ = \relax
  56. % Save some plain tex macros whose names we will redefine.
  57. \let\ptexb=\b
  58. \let\ptexbullet=\bullet
  59. \let\ptexc=\c
  60. \let\ptexcomma=\,
  61. \let\ptexdot=\.
  62. \let\ptexdots=\dots
  63. \let\ptexend=\end
  64. \let\ptexequiv=\equiv
  65. \let\ptexexclam=\!
  66. \let\ptexfootnote=\footnote
  67. \let\ptexgtr=>
  68. \let\ptexhat=^
  69. \let\ptexi=\i
  70. \let\ptexindent=\indent
  71. \let\ptexinsert=\insert
  72. \let\ptexlbrace=\{
  73. \let\ptexless=<
  74. \let\ptexnewwrite\newwrite
  75. \let\ptexnoindent=\noindent
  76. \let\ptexplus=+
  77. \let\ptexraggedright=\raggedright
  78. \let\ptexrbrace=\}
  79. \let\ptexslash=\/
  80. \let\ptexstar=\*
  81. \let\ptext=\t
  82. \let\ptextop=\top
  83. {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
  84. % If this character appears in an error message or help string, it
  85. % starts a new line in the output.
  86. \newlinechar = `^^J
  87. % Use TeX 3.0's \inputlineno to get the line number, for better error
  88. % messages, but if we're using an old version of TeX, don't do anything.
  89. \ifx\inputlineno\thisisundefined
  90.   \let\linenumber = \empty % Pre-3.0.
  91. \else
  92.   \def\linenumber{l.\the\inputlineno:\space}
  93. % Set up fixed words for English if not already set.
  94. \ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
  95. \ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
  96. \ifx\putworderror\undefined     \gdef\putwordfile{error}\fi
  97. \ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
  98. \ifx\putwordin\undefined        \gdef\putwordin{in}\fi
  99. \ifx\putwordIndexIsEmpty\undefined       \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
  100. \ifx\putwordIndexNonexistent\undefined   \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
  101. \ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
  102. \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
  103. \ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
  104. \ifx\putwordNoTitle\undefined   \gdef\putwordNoTitle{No Title}\fi
  105. \ifx\putwordof\undefined        \gdef\putwordof{of}\fi
  106. \ifx\putwordon\undefined        \gdef\putwordon{on}\fi
  107. \ifx\putwordpage\undefined      \gdef\putwordpage{page}\fi
  108. \ifx\putwordsection\undefined   \gdef\putwordsection{section}\fi
  109. \ifx\putwordSection\undefined   \gdef\putwordSection{Section}\fi
  110. \ifx\putwordsee\undefined       \gdef\putwordsee{see}\fi
  111. \ifx\putwordSee\undefined       \gdef\putwordSee{See}\fi
  112. \ifx\putwordShortTOC\undefined  \gdef\putwordShortTOC{Short Contents}\fi
  113. \ifx\putwordTOC\undefined       \gdef\putwordTOC{Table of Contents}\fi
  114. \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
  115. \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
  116. \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
  117. \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
  118. \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
  119. \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
  120. \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
  121. \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
  122. \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
  123. \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
  124. \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
  125. \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
  126. \ifx\putwordDefmac\undefined    \gdef\putwordDefmac{Macro}\fi
  127. \ifx\putwordDefspec\undefined   \gdef\putwordDefspec{Special Form}\fi
  128. \ifx\putwordDefvar\undefined    \gdef\putwordDefvar{Variable}\fi
  129. \ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
  130. \ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
  131. % Since the category of space is not known, we have to be careful.
  132. \chardef\spacecat = 10
  133. \def\spaceisspace{\catcode`\ =\spacecat}
  134. % sometimes characters are active, so we need control sequences.
  135. \chardef\ampChar   = `\&
  136. \chardef\colonChar = `\:
  137. \chardef\commaChar = `\,
  138. \chardef\dashChar  = `\-
  139. \chardef\dotChar   = `\.
  140. \chardef\exclamChar= `\!
  141. \chardef\hashChar  = `\#
  142. \chardef\lquoteChar= `\`
  143. \chardef\questChar = `\?
  144. \chardef\rquoteChar= `\'
  145. \chardef\semiChar  = `\;
  146. \chardef\slashChar = `\/
  147. \chardef\underChar = `\_
  148. % Ignore a token.
  149. \def\gobble#1{}
  150. % The following is used inside several \edef's.
  151. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
  152. % Hyphenation fixes.
  153. \hyphenation{
  154.   Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
  155.   ap-pen-dix bit-map bit-maps
  156.   data-base data-bases eshell fall-ing half-way long-est man-u-script
  157.   man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
  158.   par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
  159.   spell-ing spell-ings
  160.   stand-alone strong-est time-stamp time-stamps which-ever white-space
  161.   wide-spread wrap-around
  162. % Margin to add to right of even pages, to left of odd pages.
  163. \newdimen\bindingoffset
  164. \newdimen\normaloffset
  165. \newdimen\pagewidth \newdimen\pageheight
  166. % For a final copy, take out the rectangles
  167. % that mark overfull boxes (in case you have decided
  168. % that the text looks ok even though it passes the margin).
  169. \def\finalout{\overfullrule=0pt }
  170. % Sometimes it is convenient to have everything in the transcript file
  171. % and nothing on the terminal.  We don't just call \tracingall here,
  172. % since that produces some useless output on the terminal.  We also make
  173. % some effort to order the tracing commands to reduce output in the log
  174. % file; cf. trace.sty in LaTeX.
  175. \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
  176. \def\loggingall{%
  177.   \tracingstats2
  178.   \tracingpages1
  179.   \tracinglostchars2  % 2 gives us more in etex
  180.   \tracingparagraphs1
  181.   \tracingoutput1
  182.   \tracingmacros2
  183.   \tracingrestores1
  184.   \showboxbreadth\maxdimen \showboxdepth\maxdimen
  185.   \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
  186.     \tracingscantokens1
  187.     \tracingifs1
  188.     \tracinggroups1
  189.     \tracingnesting2
  190.     \tracingassigns1
  191.   \fi
  192.   \tracingcommands3  % 3 gives us more in etex
  193.   \errorcontextlines16
  194. % add check for \lastpenalty to plain's definitions.  If the last thing
  195. % we did was a \nobreak, we don't want to insert more space.
  196. \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
  197.   \removelastskip\penalty-50\smallskip\fi\fi}
  198. \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
  199.   \removelastskip\penalty-100\medskip\fi\fi}
  200. \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
  201.   \removelastskip\penalty-200\bigskip\fi\fi}
  202. % Do @cropmarks to get crop marks.
  203. \newif\ifcropmarks
  204. \let\cropmarks = \cropmarkstrue
  205. % Dimensions to add cropmarks at corners.
  206. % Added by P. A. MacKay, 12 Nov. 1986
  207. \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
  208. \newdimen\cornerlong  \cornerlong=1pc
  209. \newdimen\cornerthick \cornerthick=.3pt
  210. \newdimen\topandbottommargin \topandbottommargin=.75in
  211. % Output a mark which sets \thischapter, \thissection and \thiscolor.
  212. % We dump everything together because we only have one kind of mark.
  213. % This works because we only use \botmark / \topmark, not \firstmark.
  214. % A mark contains a subexpression of the \ifcase ... \fi construct.
  215. % \get*marks macros below extract the needed part using \ifcase.
  216. % Another complication is to let the user choose whether \thischapter
  217. % (\thissection) refers to the chapter (section) in effect at the top
  218. % of a page, or that at the bottom of a page.  The solution is
  219. % described on page 260 of The TeXbook.  It involves outputting two
  220. % marks for the sectioning macros, one before the section break, and
  221. % one after.  I won't pretend I can describe this better than DEK...
  222. \def\domark{%
  223.   \toks0=\expandafter{\lastchapterdefs}%
  224.   \toks2=\expandafter{\lastsectiondefs}%
  225.   \toks4=\expandafter{\prevchapterdefs}%
  226.   \toks6=\expandafter{\prevsectiondefs}%
  227.   \toks8=\expandafter{\lastcolordefs}%
  228.   \mark{%
  229.                    \the\toks0 \the\toks2
  230.       \noexpand\or \the\toks4 \the\toks6
  231.     \noexpand\else \the\toks8
  232. % \topmark doesn't work for the very first chapter (after the title
  233. % page or the contents), so we use \firstmark there -- this gets us
  234. % the mark with the chapter defs, unless the user sneaks in, e.g.,
  235. % @setcolor (or @url, or @link, etc.) between @contents and the very
  236. % first @chapter.
  237. \def\gettopheadingmarks{%
  238.   \ifcase0\topmark\fi
  239.   \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
  240. \def\getbottomheadingmarks{\ifcase1\botmark\fi}
  241. \def\getcolormarks{\ifcase2\topmark\fi}
  242. % Avoid "undefined control sequence" errors.
  243. \def\lastchapterdefs{}
  244. \def\lastsectiondefs{}
  245. \def\prevchapterdefs{}
  246. \def\prevsectiondefs{}
  247. \def\lastcolordefs{}
  248. % Main output routine.
  249. \chardef\PAGE = 255
  250. \output = {\onepageout{\pagecontents\PAGE}}
  251. \newbox\headlinebox
  252. \newbox\footlinebox
  253. % \onepageout takes a vbox as an argument.  Note that \pagecontents
  254. % does insertions, but you have to call it yourself.
  255. \def\onepageout#1{%
  256.   \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
  257.   \ifodd\pageno  \advance\hoffset by \bindingoffset
  258.   \else \advance\hoffset by -\bindingoffset\fi
  259.   % Do this outside of the \shipout so @code etc. will be expanded in
  260.   % the headline as they should be, not taken literally (outputting ''code).
  261.   \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
  262.   \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
  263.   \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
  264.   \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
  265.     % Have to do this stuff outside the \shipout because we want it to
  266.     % take effect in \write's, yet the group defined by the \vbox ends
  267.     % before the \shipout runs.
  268.     %
  269.     \indexdummies         % don't expand commands in the output.
  270.     \normalturnoffactive  % \ in index entries must not stay \, e.g., if
  271.                % the page break happens to be in the middle of an example.
  272.                % We don't want .vr (or whatever) entries like this:
  273.                % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
  274.                % "\acronym" won't work when it's read back in;
  275.                % it needs to be
  276.                % {\code {{\tt \backslashcurfont }acronym}
  277.     \shipout\vbox{%
  278.       % Do this early so pdf references go to the beginning of the page.
  279.       \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
  280.       %
  281.       \ifcropmarks \vbox to \outervsize\bgroup
  282.         \hsize = \outerhsize
  283.         \vskip-\topandbottommargin
  284.         \vtop to0pt{%
  285.           \line{\ewtop\hfil\ewtop}%
  286.           \nointerlineskip
  287.           \line{%
  288.             \vbox{\moveleft\cornerthick\nstop}%
  289.             \hfill
  290.             \vbox{\moveright\cornerthick\nstop}%
  291.           }%
  292.           \vss}%
  293.         \vskip\topandbottommargin
  294.         \line\bgroup
  295.           \hfil % center the page within the outer (page) hsize.
  296.           \ifodd\pageno\hskip\bindingoffset\fi
  297.           \vbox\bgroup
  298.       \fi
  299.       %
  300.       \unvbox\headlinebox
  301.       \pagebody{#1}%
  302.       \ifdim\ht\footlinebox > 0pt
  303.         % Only leave this space if the footline is nonempty.
  304.         % (We lessened \vsize for it in \oddfootingyyy.)
  305.         % The \baselineskip=24pt in plain's \makefootline has no effect.
  306.         \vskip 24pt
  307.         \unvbox\footlinebox
  308.       \fi
  309.       %
  310.       \ifcropmarks
  311.           \egroup % end of \vbox\bgroup
  312.         \hfil\egroup % end of (centering) \line\bgroup
  313.         \vskip\topandbottommargin plus1fill minus1fill
  314.         \boxmaxdepth = \cornerthick
  315.         \vbox to0pt{\vss
  316.           \line{%
  317.             \vbox{\moveleft\cornerthick\nsbot}%
  318.             \hfill
  319.             \vbox{\moveright\cornerthick\nsbot}%
  320.           }%
  321.           \nointerlineskip
  322.           \line{\ewbot\hfil\ewbot}%
  323.         }%
  324.       \egroup % \vbox from first cropmarks clause
  325.       \fi
  326.     }% end of \shipout\vbox
  327.   }% end of group with \indexdummies
  328.   \advancepageno
  329.   \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  330. \newinsert\margin \dimen\margin=\maxdimen
  331. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  332. {\catcode`\@ =11
  333. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  334. % marginal hacks, juha@viisa.uucp (Juha Takala)
  335. \ifvoid\margin\else % marginal info is present
  336.   \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
  337. \dimen@=\dp#1\relax \unvbox#1\relax
  338. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  339. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  340. % Here are the rules for the cropmarks.  Note that they are
  341. % offset so that the space between them is truly \outerhsize or \outervsize
  342. % (P. A. MacKay, 12 November, 1986)
  343. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  344. \def\nstop{\vbox
  345.   {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  346. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  347. \def\nsbot{\vbox
  348.   {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  349. % Parse an argument, then pass it to #1.  The argument is the rest of
  350. % the input line (except we remove a trailing comment).  #1 should be a
  351. % macro which expects an ordinary undelimited TeX argument.
  352. \def\parsearg{\parseargusing{}}
  353. \def\parseargusing#1#2{%
  354.   \def\argtorun{#2}%
  355.   \begingroup
  356.     \obeylines
  357.     \spaceisspace
  358.     #1%
  359.     \parseargline\empty% Insert the \empty token, see \finishparsearg below.
  360. {\obeylines %
  361.   \gdef\parseargline#1^^M{%
  362.     \endgroup % End of the group started in \parsearg.
  363.     \argremovecomment #1\comment\ArgTerm%
  364. % First remove any @comment, then any @c comment.
  365. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
  366. \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
  367. % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
  368. % \argremovec might leave us with trailing space, e.g.,
  369. %    @end itemize  @c foo
  370. % This space token undergoes the same procedure and is eventually removed
  371. % by \finishparsearg.
  372. \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
  373. \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
  374. \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
  375.   \def\temp{#3}%
  376.   \ifx\temp\empty
  377.     % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
  378.     \let\temp\finishparsearg
  379.   \else
  380.     \let\temp\argcheckspaces
  381.   \fi
  382.   % Put the space token in:
  383.   \temp#1 #3\ArgTerm
  384. % If a _delimited_ argument is enclosed in braces, they get stripped; so
  385. % to get _exactly_ the rest of the line, we had to prevent such situation.
  386. % We prepended an \empty token at the very beginning and we expand it now,
  387. % just before passing the control to \argtorun.
  388. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
  389. % either the null string, or it ends with \^^M---thus there is no danger
  390. % that a pair of braces would be stripped.
  391. % But first, we have to remove the trailing space token.
  392. \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
  393. % \parseargdef\foo{...}
  394. %    is roughly equivalent to
  395. % \def\foo{\parsearg\Xfoo}
  396. % \def\Xfoo#1{...}
  397. % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
  398. % favourite TeX trick.  --kasal, 16nov03
  399. \def\parseargdef#1{%
  400.   \expandafter \doparseargdef \csname\string#1\endcsname #1%
  401. \def\doparseargdef#1#2{%
  402.   \def#2{\parsearg#1}%
  403.   \def#1##1%
  404. % Several utility definitions with active space:
  405.   \obeyspaces
  406.   \gdef\obeyedspace{ }
  407.   % Make each space character in the input produce a normal interword
  408.   % space in the output.  Don't allow a line break at this space, as this
  409.   % is used only in environments like @example, where each line of input
  410.   % should produce a line of output anyway.
  411.   \gdef\sepspaces{\obeyspaces\let =\tie}
  412.   % If an index command is used in an @example environment, any spaces
  413.   % therein should become regular spaces in the raw index file, not the
  414.   % expansion of \tie (\leavevmode \penalty \@M \ ).
  415.   \gdef\unsepspaces{\let =\space}
  416. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  417. % Define the framework for environments in texinfo.tex.  It's used like this:
  418. %   \envdef\foo{...}
  419. %   \def\Efoo{...}
  420. % It's the responsibility of \envdef to insert \begingroup before the
  421. % actual body; @end closes the group after calling \Efoo.  \envdef also
  422. % defines \thisenv, so the current environment is known; @end checks
  423. % whether the environment name matches.  The \checkenv macro can also be
  424. % used to check whether the current environment is the one expected.
  425. % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
  426. % are not treated as environments; they don't open a group.  (The
  427. % implementation of @end takes care not to call \endgroup in this
  428. % special case.)
  429. % At run-time, environments start with this:
  430. \def\startenvironment#1{\begingroup\def\thisenv{#1}}
  431. % initialize
  432. \let\thisenv\empty
  433. % ... but they get defined via ``\envdef\foo{...}'':
  434. \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
  435. \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
  436. % Check whether we're in the right environment:
  437. \def\checkenv#1{%
  438.   \def\temp{#1}%
  439.   \ifx\thisenv\temp
  440.   \else
  441.     \badenverr
  442.   \fi
  443. % Environment mismatch, #1 expected:
  444. \def\badenverr{%
  445.   \errhelp = \EMsimple
  446.   \errmessage{This command can appear only \inenvironment\temp,
  447.     not \inenvironment\thisenv}%
  448. \def\inenvironment#1{%
  449.   \ifx#1\empty
  450.     outside of any environment%
  451.   \else
  452.     in environment \expandafter\string#1%
  453.   \fi
  454. % @end foo executes the definition of \Efoo.
  455. % But first, it executes a specialized version of \checkenv
  456. \parseargdef\end{%
  457.   \if 1\csname iscond.#1\endcsname
  458.   \else
  459.     % The general wording of \badenverr may not be ideal.
  460.     \expandafter\checkenv\csname#1\endcsname
  461.     \csname E#1\endcsname
  462.     \endgroup
  463.   \fi
  464. \newhelp\EMsimple{Press RETURN to continue.}
  465. % Be sure we're in horizontal mode when doing a tie, since we make space
  466. % equivalent to this in @example-like environments. Otherwise, a space
  467. % at the beginning of a line will start with \penalty -- and
  468. % since \penalty is valid in vertical mode, we'd end up putting the
  469. % penalty on the vertical list instead of in the new paragraph.
  470. {\catcode`@ = 11
  471.  % Avoid using \@M directly, because that causes trouble
  472.  % if the definition is written into an index file.
  473.  \global\let\tiepenalty = \@M
  474.  \gdef\tie{\leavevmode\penalty\tiepenalty\ }
  475. % @: forces normal size whitespace following.
  476. \def\:{\spacefactor=1000 }
  477. % @* forces a line break.
  478. \def\*{\hfil\break\hbox{}\ignorespaces}
  479. % @/ allows a line break.
  480. \let\/=\allowbreak
  481. % @. is an end-of-sentence period.
  482. \def\.{.\spacefactor=\endofsentencespacefactor\space}
  483. % @! is an end-of-sentence bang.
  484. \def\!{!\spacefactor=\endofsentencespacefactor\space}
  485. % @? is an end-of-sentence query.
  486. \def\?{?\spacefactor=\endofsentencespacefactor\space}
  487. % @frenchspacing on|off  says whether to put extra space after punctuation.
  488. \def\onword{on}
  489. \def\offword{off}
  490. \parseargdef\frenchspacing{%
  491.   \def\temp{#1}%
  492.   \ifx\temp\onword \plainfrenchspacing
  493.   \else\ifx\temp\offword \plainnonfrenchspacing
  494.   \else
  495.     \errhelp = \EMsimple
  496.     \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
  497.   \fi\fi
  498. % @w prevents a word break.  Without the \leavevmode, @w at the
  499. % beginning of a paragraph, when TeX is still in vertical mode, would
  500. % produce a whole line of output instead of starting the paragraph.
  501. \def\w#1{\leavevmode\hbox{#1}}
  502. % @group ... @end group forces ... to be all on one page, by enclosing
  503. % it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
  504. % to keep its height that of a normal line.  According to the rules for
  505. % \topskip (p.114 of the TeXbook), the glue inserted is
  506. % max (\topskip - \ht (first item), 0).  If that height is large,
  507. % therefore, no glue is inserted, and the space between the headline and
  508. % the text is small, which looks bad.
  509. % Another complication is that the group might be very large.  This can
  510. % cause the glue on the previous page to be unduly stretched, because it
  511. % does not have much material.  In this case, it's better to add an
  512. % explicit \vfill so that the extra space is at the bottom.  The
  513. % threshold for doing this is if the group is more than \vfilllimit
  514. % percent of a page (\vfilllimit can be changed inside of @tex).
  515. \newbox\groupbox
  516. \def\vfilllimit{0.7}
  517. \envdef\group{%
  518.   \ifnum\catcode`\^^M=\active \else
  519.     \errhelp = \groupinvalidhelp
  520.     \errmessage{@group invalid in context where filling is enabled}%
  521.   \fi
  522.   \startsavinginserts
  523.   \setbox\groupbox = \vtop\bgroup
  524.     % Do @comment since we are called inside an environment such as
  525.     % @example, where each end-of-line in the input causes an
  526.     % end-of-line in the output.  We don't want the end-of-line after
  527.     % the `@group' to put extra space in the output.  Since @group
  528.     % should appear on a line by itself (according to the Texinfo
  529.     % manual), we don't worry about eating any user text.
  530.     \comment
  531. % The \vtop produces a box with normal height and large depth; thus, TeX puts
  532. % \baselineskip glue before it, and (when the next line of text is done)
  533. % \lineskip glue after it.  Thus, space below is not quite equal to space
  534. % above.  But it's pretty close.
  535. \def\Egroup{%
  536.     % To get correct interline space between the last line of the group
  537.     % and the first line afterwards, we have to propagate \prevdepth.
  538.     \endgraf % Not \par, as it may have been set to \lisppar.
  539.     \global\dimen1 = \prevdepth
  540.   \egroup           % End the \vtop.
  541.   % \dimen0 is the vertical size of the group's box.
  542.   \dimen0 = \ht\groupbox  \advance\dimen0 by \dp\groupbox
  543.   % \dimen2 is how much space is left on the page (more or less).
  544.   \dimen2 = \pageheight   \advance\dimen2 by -\pagetotal
  545.   % if the group doesn't fit on the current page, and it's a big big
  546.   % group, force a page break.
  547.   \ifdim \dimen0 > \dimen2
  548.     \ifdim \pagetotal < \vfilllimit\pageheight
  549.       \page
  550.     \fi
  551.   \fi
  552.   \box\groupbox
  553.   \prevdepth = \dimen1
  554.   \checkinserts
  555. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  556. % message, so this ends up printing `@group can only ...'.
  557. \newhelp\groupinvalidhelp{%
  558. group can only be used in environments such as @example,^^J%
  559. where each line of input produces a line of output.}
  560. % @need space-in-mils
  561. % forces a page break if there is not space-in-mils remaining.
  562. \newdimen\mil  \mil=0.001in
  563. \parseargdef\need{%
  564.   % Ensure vertical mode, so we don't make a big box in the middle of a
  565.   % paragraph.
  566.   \par
  567.   % If the @need value is less than one line space, it's useless.
  568.   \dimen0 = #1\mil
  569.   \dimen2 = \ht\strutbox
  570.   \advance\dimen2 by \dp\strutbox
  571.   \ifdim\dimen0 > \dimen2
  572.     %
  573.     % Do a \strut just to make the height of this box be normal, so the
  574.     % normal leading is inserted relative to the preceding line.
  575.     % And a page break here is fine.
  576.     \vtop to #1\mil{\strut\vfil}%
  577.     %
  578.     % TeX does not even consider page breaks if a penalty added to the
  579.     % main vertical list is 10000 or more.  But in order to see if the
  580.     % empty box we just added fits on the page, we must make it consider
  581.     % page breaks.  On the other hand, we don't want to actually break the
  582.     % page after the empty box.  So we use a penalty of 9999.
  583.     %
  584.     % There is an extremely small chance that TeX will actually break the
  585.     % page at this \penalty, if there are no other feasible breakpoints in
  586.     % sight.  (If the user is using lots of big @group commands, which
  587.     % almost-but-not-quite fill up a page, TeX will have a hard time doing
  588.     % good page breaking, for example.)  However, I could not construct an
  589.     % example where a page broke at this \penalty; if it happens in a real
  590.     % document, then we can reconsider our strategy.
  591.     \penalty9999
  592.     %
  593.     % Back up by the size of the box, whether we did a page break or not.
  594.     \kern -#1\mil
  595.     %
  596.     % Do not allow a page break right after this kern.
  597.     \nobreak
  598.   \fi
  599. % @br   forces paragraph break (and is undocumented).
  600. \let\br = \par
  601. % @page forces the start of a new page.
  602. \def\page{\par\vfill\supereject}
  603. % @exdent text....
  604. % outputs text on separate line in roman font, starting at standard page margin
  605. % This records the amount of indent in the innermost environment.
  606. % That's how much \exdent should take out.
  607. \newskip\exdentamount
  608. % This defn is used inside fill environments such as @defun.
  609. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
  610. % This defn is used inside nofill environments such as @example.
  611. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
  612.   \leftline{\hskip\leftskip{\rm#1}}}}
  613. % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
  614. % paragraph.  For more general purposes, use the \margin insertion
  615. % class.  WHICH is `l' or `r'.  Not documented, written for gawk manual.
  616. \newskip\inmarginspacing \inmarginspacing=1cm
  617. \def\strutdepth{\dp\strutbox}
  618. \def\doinmargin#1#2{\strut\vadjust{%
  619.   \nobreak
  620.   \kern-\strutdepth
  621.   \vtop to \strutdepth{%
  622.     \baselineskip=\strutdepth
  623.     \vss
  624.     % if you have multiple lines of stuff to put here, you'll need to
  625.     % make the vbox yourself of the appropriate size.
  626.     \ifx#1l%
  627.       \llap{\ignorespaces #2\hskip\inmarginspacing}%
  628.     \else
  629.       \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
  630.     \fi
  631.     \null
  632. \def\inleftmargin{\doinmargin l}
  633. \def\inrightmargin{\doinmargin r}
  634. % @inmargin{TEXT [, RIGHT-TEXT]}
  635. % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
  636. % else use TEXT for both).
  637. \def\inmargin#1{\parseinmargin #1,,\finish}
  638. \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
  639.   \setbox0 = \hbox{\ignorespaces #2}%
  640.   \ifdim\wd0 > 0pt
  641.     \def\lefttext{#1}%  have both texts
  642.     \def\righttext{#2}%
  643.   \else
  644.     \def\lefttext{#1}%  have only one text
  645.     \def\righttext{#1}%
  646.   \fi
  647.   \ifodd\pageno
  648.     \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
  649.   \else
  650.     \def\temp{\inleftmargin\lefttext}%
  651.   \fi
  652.   \temp
  653. % @| inserts a changebar to the left of the current line.  It should
  654. % surround any changed text.  This approach does *not* work if the
  655. % change spans more than two lines of output.  To handle that, we would
  656. % have adopt a much more difficult approach (putting marks into the main
  657. % vertical list for the beginning and end of each change).  This command
  658. % is not documented, not supported, and doesn't work.
  659. \def\|{%
  660.   % \vadjust can only be used in horizontal mode.
  661.   \leavevmode
  662.   % Append this vertical mode material after the current line in the output.
  663.   \vadjust{%
  664.     % We want to insert a rule with the height and depth of the current
  665.     % leading; that is exactly what \strutbox is supposed to record.
  666.     \vskip-\baselineskip
  667.     %
  668.     % \vadjust-items are inserted at the left edge of the type.  So
  669.     % the \llap here moves out into the left-hand margin.
  670.     \llap{%
  671.       %
  672.       % For a thicker or thinner bar, change the `1pt'.
  673.       \vrule height\baselineskip width1pt
  674.       %
  675.       % This is the space between the bar and the text.
  676.       \hskip 12pt
  677.     }%
  678. % @include FILE -- \input text of FILE.
  679. \def\include{\parseargusing\filenamecatcodes\includezzz}
  680. \def\includezzz#1{%
  681.   \pushthisfilestack
  682.   \def\thisfile{#1}%
  683.     \makevalueexpandable  % we want to expand any @value in FILE.
  684.     \turnoffactive        % and allow special characters in the expansion
  685.     \indexnofonts         % Allow `@@' and other weird things in file names.
  686.     \wlog{texinfo.tex: doing @include of #1^^J}%
  687.     \edef\temp{\noexpand\input #1 }%
  688.     %
  689.     % This trickery is to read FILE outside of a group, in case it makes
  690.     % definitions, etc.
  691.     \expandafter
  692.   }\temp
  693.   \popthisfilestack
  694. \def\filenamecatcodes{%
  695.   \catcode`\\=\other
  696.   \catcode`~=\other
  697.   \catcode`^=\other
  698.   \catcode`_=\other
  699.   \catcode`|=\other
  700.   \catcode`<=\other
  701.   \catcode`>=\other
  702.   \catcode`+=\other
  703.   \catcode`-=\other
  704.   \catcode`\`=\other
  705.   \catcode`\'=\other
  706. \def\pushthisfilestack{%
  707.   \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
  708. \def\pushthisfilestackX{%
  709.   \expandafter\pushthisfilestackY\thisfile\StackTerm
  710. \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
  711.   \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
  712. \def\popthisfilestack{\errthisfilestackempty}
  713. \def\errthisfilestackempty{\errmessage{Internal error:
  714.   the stack of filenames is empty.}}
  715. \def\thisfile{}
  716. % @center line
  717. % outputs that line, centered.
  718. \parseargdef\center{%
  719.   \ifhmode
  720.     \let\next\centerH
  721.   \else
  722.     \let\next\centerV
  723.   \fi
  724.   \next{\hfil \ignorespaces#1\unskip \hfil}%
  725. \def\centerH#1{%
  726.     \hfil\break
  727.     \advance\hsize by -\leftskip
  728.     \advance\hsize by -\rightskip
  729.     \line{#1}%
  730.     \break
  731. \def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
  732. % @sp n   outputs n lines of vertical space
  733. \parseargdef\sp{\vskip #1\baselineskip}
  734. % @comment ...line which is ignored...
  735. % @c is the same as @comment
  736. % @ignore ... @end ignore  is another way to write a comment
  737. \def\comment{\begingroup \catcode`\^^M=\other%
  738. \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
  739. \commentxxx}
  740. {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
  741. \let\c=\comment
  742. % @paragraphindent NCHARS
  743. % We'll use ems for NCHARS, close enough.
  744. % NCHARS can also be the word `asis' or `none'.
  745. % We cannot feasibly implement @paragraphindent asis, though.
  746. \def\asisword{asis} % no translation, these are keywords
  747. \def\noneword{none}
  748. \parseargdef\paragraphindent{%
  749.   \def\temp{#1}%
  750.   \ifx\temp\asisword
  751.   \else
  752.     \ifx\temp\noneword
  753.       \defaultparindent = 0pt
  754.     \else
  755.       \defaultparindent = #1em
  756.     \fi
  757.   \fi
  758.   \parindent = \defaultparindent
  759. % @exampleindent NCHARS
  760. % We'll use ems for NCHARS like @paragraphindent.
  761. % It seems @exampleindent asis isn't necessary, but
  762. % I preserve it to make it similar to @paragraphindent.
  763. \parseargdef\exampleindent{%
  764.   \def\temp{#1}%
  765.   \ifx\temp\asisword
  766.   \else
  767.     \ifx\temp\noneword
  768.       \lispnarrowing = 0pt
  769.     \else
  770.       \lispnarrowing = #1em
  771.     \fi
  772.   \fi
  773. % @firstparagraphindent WORD
  774. % If WORD is `none', then suppress indentation of the first paragraph
  775. % after a section heading.  If WORD is `insert', then do indent at such
  776. % paragraphs.
  777. % The paragraph indentation is suppressed or not by calling
  778. % \suppressfirstparagraphindent, which the sectioning commands do.
  779. % We switch the definition of this back and forth according to WORD.
  780. % By default, we suppress indentation.
  781. \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
  782. \def\insertword{insert}
  783. \parseargdef\firstparagraphindent{%
  784.   \def\temp{#1}%
  785.   \ifx\temp\noneword
  786.     \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
  787.   \else\ifx\temp\insertword
  788.     \let\suppressfirstparagraphindent = \relax
  789.   \else
  790.     \errhelp = \EMsimple
  791.     \errmessage{Unknown @firstparagraphindent option `\temp'}%
  792.   \fi\fi
  793. % Here is how we actually suppress indentation.  Redefine \everypar to
  794. % \kern backwards by \parindent, and then reset itself to empty.
  795. % We also make \indent itself not actually do anything until the next
  796. % paragraph.
  797. \gdef\dosuppressfirstparagraphindent{%
  798.   \gdef\indent{%
  799.     \restorefirstparagraphindent
  800.     \indent
  801.   \gdef\noindent{%
  802.     \restorefirstparagraphindent
  803.     \noindent
  804.   \global\everypar = {%
  805.     \kern -\parindent
  806.     \restorefirstparagraphindent
  807. \gdef\restorefirstparagraphindent{%
  808.   \global \let \indent = \ptexindent
  809.   \global \let \noindent = \ptexnoindent
  810.   \global \everypar = {}%
  811. % @refill is a no-op.
  812. \let\refill=\relax
  813. % If working on a large document in chapters, it is convenient to
  814. % be able to disable indexing, cross-referencing, and contents, for test runs.
  815. % This is done with @novalidate (before @setfilename).
  816. \newif\iflinks \linkstrue % by default we want the aux files.
  817. \let\novalidate = \linksfalse
  818. % @setfilename is done at the beginning of every texinfo file.
  819. % So open here the files we need to have open while reading the input.
  820. % This makes it possible to make a .fmt file for texinfo.
  821. \def\setfilename{%
  822.    \fixbackslash  % Turn off hack to swallow `\input texinfo'.
  823.    \iflinks
  824.      \tryauxfile
  825.      % Open the new aux file.  TeX will close it automatically at exit.
  826.      \immediate\openout\auxfile=\jobname.aux
  827.    \fi % \openindices needs to do some work in any case.
  828.    \openindices
  829.    \let\setfilename=\comment % Ignore extra @setfilename cmds.
  830.    % If texinfo.cnf is present on the system, read it.
  831.    % Useful for site-wide @afourpaper, etc.
  832.    \openin 1 texinfo.cnf
  833.    \ifeof 1 \else \input texinfo.cnf \fi
  834.    \closein 1
  835.    \comment % Ignore the actual filename.
  836. % Called from \setfilename.
  837. \def\openindices{%
  838.   \newindex{cp}%
  839.   \newcodeindex{fn}%
  840.   \newcodeindex{vr}%
  841.   \newcodeindex{tp}%
  842.   \newcodeindex{ky}%
  843.   \newcodeindex{pg}%
  844. % @bye.
  845. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  846. \message{pdf,}
  847. % adobe `portable' document format
  848. \newcount\tempnum
  849. \newcount\lnkcount
  850. \newtoks\filename
  851. \newcount\filenamelength
  852. \newcount\pgn
  853. \newtoks\toksA
  854. \newtoks\toksB
  855. \newtoks\toksC
  856. \newtoks\toksD
  857. \newbox\boxA
  858. \newcount\countA
  859. \newif\ifpdf
  860. \newif\ifpdfmakepagedest
  861. % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
  862. % can be set).  So we test for \relax and 0 as well as being undefined.
  863. \ifx\pdfoutput\thisisundefined
  864. \else
  865.   \ifx\pdfoutput\relax
  866.   \else
  867.     \ifcase\pdfoutput
  868.     \else
  869.       \pdftrue
  870.     \fi
  871.   \fi
  872. % PDF uses PostScript string constants for the names of xref targets,
  873. % for display in the outlines, and in other places.  Thus, we have to
  874. % double any backslashes.  Otherwise, a name like "\node" will be
  875. % interpreted as a newline (\n), followed by o, d, e.  Not good.
  876. % http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
  877. % (and related messages, the final outcome is that it is up to the TeX
  878. % user to double the backslashes and otherwise make the string valid, so
  879. % that's what we do).
  880. % double active backslashes.
  881. {\catcode`\@=0 \catcode`\\=\active
  882.  @gdef@activebackslashdouble{%
  883.    @catcode`@\=@active
  884.    @let\=@doublebackslash}
  885. % To handle parens, we must adopt a different approach, since parens are
  886. % not active characters.  hyperref.dtx (which has the same problem as
  887. % us) handles it with this amazing macro to replace tokens, with minor
  888. % changes for Texinfo.  It is included here under the GPL by permission
  889. % from the author, Heiko Oberdiek.
  890. % #1 is the tokens to replace.
  891. % #2 is the replacement.
  892. % #3 is the control sequence with the string.
  893. \def\HyPsdSubst#1#2#3{%
  894.   \def\HyPsdReplace##1#1##2\END{%
  895.     ##1%
  896.     \ifx\\##2\\%
  897.     \else
  898.       #2%
  899.       \HyReturnAfterFi{%
  900.         \HyPsdReplace##2\END
  901.       }%
  902.     \fi
  903.   \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
  904. \long\def\HyReturnAfterFi#1\fi{\fi#1}
  905. % #1 is a control sequence in which to do the replacements.
  906. \def\backslashparens#1{%
  907.   \xdef#1{#1}% redefine it as its expansion; the definition is simply
  908.              % \lastnode when called from \setref -> \pdfmkdest.
  909.   \HyPsdSubst{(}{\realbackslash(}{#1}%
  910.   \HyPsdSubst{)}{\realbackslash)}{#1}%
  911. \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
  912. with PDF output, and none of those formats could be found.  (.eps cannot
  913. be supported due to the design of the PDF format; use regular TeX (DVI
  914. output) for that.)}
  915. \ifpdf
  916.   % Color manipulation macros based on pdfcolor.tex,
  917.   % except using rgb instead of cmyk; the latter is said to render as a
  918.   % very dark gray on-screen and a very dark halftone in print, instead
  919.   % of actual black.
  920.   \def\rgbDarkRed{0.50 0.09 0.12}
  921.   \def\rgbBlack{0 0 0}
  922.   % k sets the color for filling (usual text, etc.);
  923.   % K sets the color for stroking (thin rules, e.g., normal _'s).
  924.   \def\pdfsetcolor#1{\pdfliteral{#1 rg  #1 RG}}
  925.   % Set color, and create a mark which defines \thiscolor accordingly,
  926.   % so that \makeheadline knows which color to restore.
  927.   \def\setcolor#1{%
  928.     \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
  929.     \domark
  930.     \pdfsetcolor{#1}%
  931.   \def\maincolor{\rgbBlack}
  932.   \pdfsetcolor{\maincolor}
  933.   \edef\thiscolor{\maincolor}
  934.   \def\lastcolordefs{}
  935.   \def\makefootline{%
  936.     \baselineskip24pt
  937.     \line{\pdfsetcolor{\maincolor}\the\footline}%
  938.   \def\makeheadline{%
  939.     \vbox to 0pt{%
  940.       \vskip-22.5pt
  941.       \line{%
  942.         \vbox to8.5pt{}%
  943.         % Extract \thiscolor definition from the marks.
  944.         \getcolormarks
  945.         % Typeset the headline with \maincolor, then restore the color.
  946.         \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
  947.       }%
  948.       \vss
  949.     }%
  950.     \nointerlineskip
  951.   \pdfcatalog{/PageMode /UseOutlines}
  952.   % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
  953.   \def\dopdfimage#1#2#3{%
  954.     \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
  955.     \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
  956.     %
  957.     % pdftex (and the PDF format) support .pdf, .png, .jpg (among
  958.     % others).  Let's try in that order, PDF first since if
  959.     % someone has a scalable image, presumably better to use that than a
  960.     % bitmap.
  961.     \let\pdfimgext=\empty
  962.     \begingroup
  963.       \openin 1 #1.pdf \ifeof 1
  964.         \openin 1 #1.PDF \ifeof 1
  965.           \openin 1 #1.png \ifeof 1
  966.             \openin 1 #1.jpg \ifeof 1
  967.               \openin 1 #1.jpeg \ifeof 1
  968.                 \openin 1 #1.JPG \ifeof 1
  969.                   \errhelp = \nopdfimagehelp
  970.                   \errmessage{Could not find image file #1 for pdf}%
  971.                 \else \gdef\pdfimgext{JPG}%
  972.                 \fi
  973.               \else \gdef\pdfimgext{jpeg}%
  974.               \fi
  975.             \else \gdef\pdfimgext{jpg}%
  976.             \fi
  977.           \else \gdef\pdfimgext{png}%
  978.           \fi
  979.         \else \gdef\pdfimgext{PDF}%
  980.         \fi
  981.       \else \gdef\pdfimgext{pdf}%
  982.       \fi
  983.       \closein 1
  984.     \endgroup
  985.     %
  986.     % without \immediate, ancient pdftex seg faults when the same image is
  987.     % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
  988.     \ifnum\pdftexversion < 14
  989.       \immediate\pdfimage
  990.     \else
  991.       \immediate\pdfximage
  992.     \fi
  993.       \ifdim \wd0 >0pt width \imagewidth \fi
  994.       \ifdim \wd2 >0pt height \imageheight \fi
  995.       \ifnum\pdftexversion<13
  996.          #1.\pdfimgext
  997.        \else
  998.          {#1.\pdfimgext}%
  999.        \fi
  1000.     \ifnum\pdftexversion < 14 \else
  1001.       \pdfrefximage \pdflastximage
  1002.     \fi}
  1003.   \def\pdfmkdest#1{{%
  1004.     % We have to set dummies so commands such as @code, and characters
  1005.     % such as \, aren't expanded when present in a section title.
  1006.     \indexnofonts
  1007.     \turnoffactive
  1008.     \activebackslashdouble
  1009.     \makevalueexpandable
  1010.     \def\pdfdestname{#1}%
  1011.     \backslashparens\pdfdestname
  1012.     \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
  1013.   % used to mark target names; must be expandable.
  1014.   \def\pdfmkpgn#1{#1}
  1015.   % by default, use a color that is dark enough to print on paper as
  1016.   % nearly black, but still distinguishable for online viewing.
  1017.   \def\urlcolor{\rgbDarkRed}
  1018.   \def\linkcolor{\rgbDarkRed}
  1019.   \def\endlink{\setcolor{\maincolor}\pdfendlink}
  1020.   % Adding outlines to PDF; macros for calculating structure of outlines
  1021.   % come from Petr Olsak
  1022.   \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
  1023.     \else \csname#1\endcsname \fi}
  1024.   \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
  1025.     \advance\tempnum by 1
  1026.     \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
  1027.   % #1 is the section text, which is what will be displayed in the
  1028.   % outline by the pdf viewer.  #2 is the pdf expression for the number
  1029.   % of subentries (or empty, for subsubsections).  #3 is the node text,
  1030.   % which might be empty if this toc entry had no corresponding node.
  1031.   % #4 is the page number
  1032.   \def\dopdfoutline#1#2#3#4{%
  1033.     % Generate a link to the node text if that exists; else, use the
  1034.     % page number.  We could generate a destination for the section
  1035.     % text in the case where a section has no node, but it doesn't
  1036.     % seem worth the trouble, since most documents are normally structured.
  1037.     \def\pdfoutlinedest{#3}%
  1038.     \ifx\pdfoutlinedest\empty
  1039.       \def\pdfoutlinedest{#4}%
  1040.     \else
  1041.       % Doubled backslashes in the name.
  1042.       {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
  1043.        \backslashparens\pdfoutlinedest}%
  1044.     \fi
  1045.     %
  1046.     % Also double the backslashes in the display string.
  1047.     {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
  1048.      \backslashparens\pdfoutlinetext}%
  1049.     %
  1050.     \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
  1051.   \def\pdfmakeoutlines{%
  1052.     \begingroup
  1053.       % Thanh's hack / proper braces in bookmarks
  1054.       \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
  1055.       \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
  1056.       %
  1057.       % Read toc silently, to get counts of subentries for \pdfoutline.
  1058.       \def\partentry##1##2##3##4{}% ignore parts in the outlines
  1059.       \def\numchapentry##1##2##3##4{%
  1060.     \def\thischapnum{##2}%
  1061.     \def\thissecnum{0}%
  1062.     \def\thissubsecnum{0}%
  1063.       }%
  1064.       \def\numsecentry##1##2##3##4{%
  1065.     \advancenumber{chap\thischapnum}%
  1066.     \def\thissecnum{##2}%
  1067.     \def\thissubsecnum{0}%
  1068.       }%
  1069.       \def\numsubsecentry##1##2##3##4{%
  1070.     \advancenumber{sec\thissecnum}%
  1071.     \def\thissubsecnum{##2}%
  1072.       }%
  1073.       \def\numsubsubsecentry##1##2##3##4{%
  1074.     \advancenumber{subsec\thissubsecnum}%
  1075.       }%
  1076.       \def\thischapnum{0}%
  1077.       \def\thissecnum{0}%
  1078.       \def\thissubsecnum{0}%
  1079.       %
  1080.       % use \def rather than \let here because we redefine \chapentry et
  1081.       % al. a second time, below.
  1082.       \def\appentry{\numchapentry}%
  1083.       \def\appsecentry{\numsecentry}%
  1084.       \def\appsubsecentry{\numsubsecentry}%
  1085.       \def\appsubsubsecentry{\numsubsubsecentry}%
  1086.       \def\unnchapentry{\numchapentry}%
  1087.       \def\unnsecentry{\numsecentry}%
  1088.       \def\unnsubsecentry{\numsubsecentry}%
  1089.       \def\unnsubsubsecentry{\numsubsubsecentry}%
  1090.       \readdatafile{toc}%
  1091.       %
  1092.       % Read toc second time, this time actually producing the outlines.
  1093.       % The `-' means take the \expnumber as the absolute number of
  1094.       % subentries, which we calculated on our first read of the .toc above.
  1095.       %
  1096.       % We use the node names as the destinations.
  1097.       \def\numchapentry##1##2##3##4{%
  1098.         \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
  1099.       \def\numsecentry##1##2##3##4{%
  1100.         \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
  1101.       \def\numsubsecentry##1##2##3##4{%
  1102.         \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
  1103.       \def\numsubsubsecentry##1##2##3##4{% count is always zero
  1104.         \dopdfoutline{##1}{}{##3}{##4}}%
  1105.       %
  1106.       % PDF outlines are displayed using system fonts, instead of
  1107.       % document fonts.  Therefore we cannot use special characters,
  1108.       % since the encoding is unknown.  For example, the eogonek from
  1109.       % Latin 2 (0xea) gets translated to a | character.  Info from
  1110.       % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
  1111.       %
  1112.       % xx to do this right, we have to translate 8-bit characters to
  1113.       % their "best" equivalent, based on the @documentencoding.  Right
  1114.       % now, I guess we'll just let the pdf reader have its way.
  1115.       \indexnofonts
  1116.       \setupdatafile
  1117.       \catcode`\\=\active \otherbackslash
  1118.       \input \tocreadfilename
  1119.     \endgroup
  1120.   \def\skipspaces#1{\def\PP{#1}\def\D{|}%
  1121.     \ifx\PP\D\let\nextsp\relax
  1122.     \else\let\nextsp\skipspaces
  1123.       \ifx\p\space\else\addtokens{\filename}{\PP}%
  1124.         \advance\filenamelength by 1
  1125.       \fi
  1126.     \fi
  1127.     \nextsp}
  1128.   \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
  1129.   \ifnum\pdftexversion < 14
  1130.     \let \startlink \pdfannotlink
  1131.   \else
  1132.     \let \startlink \pdfstartlink
  1133.   \fi
  1134.   % make a live url in pdf output.
  1135.   \def\pdfurl#1{%
  1136.     \begingroup
  1137.       % it seems we really need yet another set of dummies; have not
  1138.       % tried to figure out what each command should do in the context
  1139.       % of @url.  for now, just make @/ a no-op, that's the only one
  1140.       % people have actually reported a problem with.
  1141.       %
  1142.       \normalturnoffactive
  1143.       \def\@{@}%
  1144.       \let\/=\empty
  1145.       \makevalueexpandable
  1146.       % do we want to go so far as to use \indexnofonts instead of just
  1147.       % special-casing \var here?
  1148.       \def\var##1{##1}%
  1149.       %
  1150.       \leavevmode\setcolor{\urlcolor}%
  1151.       \startlink attr{/Border [0 0 0]}%
  1152.         user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
  1153.     \endgroup}
  1154.   \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
  1155.   \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
  1156.   \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
  1157.   \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
  1158.   \def\maketoks{%
  1159.     \expandafter\poptoks\the\toksA|ENDTOKS|\relax
  1160.     \ifx\first0\adn0
  1161.     \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
  1162.     \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
  1163.     \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
  1164.     \else
  1165.       \ifnum0=\countA\else\makelink\fi
  1166.       \ifx\first.\let\next=\done\else
  1167.         \let\next=\maketoks
  1168.         \addtokens{\toksB}{\the\toksD}
  1169.         \ifx\first,\addtokens{\toksB}{\space}\fi
  1170.       \fi
  1171.     \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  1172.     \next}
  1173.   \def\makelink{\addtokens{\toksB}%
  1174.     {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
  1175.   \def\pdflink#1{%
  1176.     \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
  1177.     \setcolor{\linkcolor}#1\endlink}
  1178.   \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
  1179. \else
  1180.   % non-pdf mode
  1181.   \let\pdfmkdest = \gobble
  1182.   \let\pdfurl = \gobble
  1183.   \let\endlink = \relax
  1184.   \let\setcolor = \gobble
  1185.   \let\pdfsetcolor = \gobble
  1186.   \let\pdfmakeoutlines = \relax
  1187. \fi  % \ifx\pdfoutput
  1188. \message{fonts,}
  1189. % Change the current font style to #1, remembering it in \curfontstyle.
  1190. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
  1191. % italics, not bold italics.
  1192. \def\setfontstyle#1{%
  1193.   \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
  1194.   \csname ten#1\endcsname  % change the current font
  1195. % Select #1 fonts with the current style.
  1196. \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
  1197. \def\rm{\fam=0 \setfontstyle{rm}}
  1198. \def\it{\fam=\itfam \setfontstyle{it}}
  1199. \def\sl{\fam=\slfam \setfontstyle{sl}}
  1200. \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
  1201. \def\tt{\fam=\ttfam \setfontstyle{tt}}
  1202. % Unfortunately, we have to override this for titles and the like, since
  1203. % in those cases "rm" is bold.  Sigh.
  1204. \def\rmisbold{\rm\def\curfontstyle{bf}}
  1205. % Texinfo sort of supports the sans serif font style, which plain TeX does not.
  1206. % So we set up a \sf.
  1207. \newfam\sffam
  1208. \def\sf{\fam=\sffam \setfontstyle{sf}}
  1209. \let\li = \sf % Sometimes we call it \li, not \sf.
  1210. % We don't need math for this font style.
  1211. \def\ttsl{\setfontstyle{ttsl}}
  1212. % Default leading.
  1213. \newdimen\textleading  \textleading = 13.2pt
  1214. % Set the baselineskip to #1, and the lineskip and strut size
  1215. % correspondingly.  There is no deep meaning behind these magic numbers
  1216. % used as factors; they just match (closely enough) what Knuth defined.
  1217. \def\lineskipfactor{.08333}
  1218. \def\strutheightpercent{.70833}
  1219. \def\strutdepthpercent {.29167}
  1220. % can get a sort of poor man's double spacing by redefining this.
  1221. \def\baselinefactor{1}
  1222. \def\setleading#1{%
  1223.   \dimen0 = #1\relax
  1224.   \normalbaselineskip = \baselinefactor\dimen0
  1225.   \normallineskip = \lineskipfactor\normalbaselineskip
  1226.   \normalbaselines
  1227.   \setbox\strutbox =\hbox{%
  1228.     \vrule width0pt height\strutheightpercent\baselineskip
  1229.                     depth \strutdepthpercent \baselineskip
  1230. % PDF CMaps.  See also LaTeX's t1.cmap.
  1231. % do nothing with this by default.
  1232. \expandafter\let\csname cmapOT1\endcsname\gobble
  1233. \expandafter\let\csname cmapOT1IT\endcsname\gobble
  1234. \expandafter\let\csname cmapOT1TT\endcsname\gobble
  1235. % if we are producing pdf, and we have \pdffontattr, then define cmaps.
  1236. % (\pdffontattr was introduced many years ago, but people still run
  1237. % older pdftex's; it's easy to conditionalize, so we do.)
  1238. \ifpdf \ifx\pdffontattr\thisisundefined \else
  1239.   \begingroup
  1240.     \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1241.     \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1242. %%DocumentNeededResources: ProcSet (CIDInit)
  1243. %%IncludeResource: ProcSet (CIDInit)
  1244. %%BeginResource: CMap (TeX-OT1-0)
  1245. %%Title: (TeX-OT1-0 TeX OT1 0)
  1246. %%Version: 1.000
  1247. %%EndComments
  1248. /CIDInit /ProcSet findresource begin
  1249. 12 dict begin
  1250. begincmap
  1251. /CIDSystemInfo
  1252. << /Registry (TeX)
  1253. /Ordering (OT1)
  1254. /Supplement 0
  1255. >> def
  1256. /CMapName /TeX-OT1-0 def
  1257. /CMapType 2 def
  1258. 1 begincodespacerange
  1259. <00> <7F>
  1260. endcodespacerange
  1261. 8 beginbfrange
  1262. <00> <01> <0393>
  1263. <09> <0A> <03A8>
  1264. <23> <26> <0023>
  1265. <28> <3B> <0028>
  1266. <3F> <5B> <003F>
  1267. <5D> <5E> <005D>
  1268. <61> <7A> <0061>
  1269. <7B> <7C> <2013>
  1270. endbfrange
  1271. 40 beginbfchar
  1272. <02> <0398>
  1273. <03> <039B>
  1274. <04> <039E>
  1275. <05> <03A0>
  1276. <06> <03A3>
  1277. <07> <03D2>
  1278. <08> <03A6>
  1279. <0B> <00660066>
  1280. <0C> <00660069>
  1281. <0D> <0066006C>
  1282. <0E> <006600660069>
  1283. <0F> <00660066006C>
  1284. <10> <0131>
  1285. <11> <0237>
  1286. <12> <0060>
  1287. <13> <00B4>
  1288. <14> <02C7>
  1289. <15> <02D8>
  1290. <16> <00AF>
  1291. <17> <02DA>
  1292. <18> <00B8>
  1293. <19> <00DF>
  1294. <1A> <00E6>
  1295. <1B> <0153>
  1296. <1C> <00F8>
  1297. <1D> <00C6>
  1298. <1E> <0152>
  1299. <1F> <00D8>
  1300. <21> <0021>
  1301. <22> <201D>
  1302. <27> <2019>
  1303. <3C> <00A1>
  1304. <3D> <003D>
  1305. <3E> <00BF>
  1306. <5C> <201C>
  1307. <5F> <02D9>
  1308. <60> <2018>
  1309. <7D> <02DD>
  1310. <7E> <007E>
  1311. <7F> <00A8>
  1312. endbfchar
  1313. endcmap
  1314. CMapName currentdict /CMap defineresource pop
  1315. %%EndResource
  1316. %%EOF
  1317.     }\endgroup
  1318.   \expandafter\edef\csname cmapOT1\endcsname#1{%
  1319.     \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1320. % \cmapOT1IT
  1321.   \begingroup
  1322.     \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1323.     \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1324. %%DocumentNeededResources: ProcSet (CIDInit)
  1325. %%IncludeResource: ProcSet (CIDInit)
  1326. %%BeginResource: CMap (TeX-OT1IT-0)
  1327. %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
  1328. %%Version: 1.000
  1329. %%EndComments
  1330. /CIDInit /ProcSet findresource begin
  1331. 12 dict begin
  1332. begincmap
  1333. /CIDSystemInfo
  1334. << /Registry (TeX)
  1335. /Ordering (OT1IT)
  1336. /Supplement 0
  1337. >> def
  1338. /CMapName /TeX-OT1IT-0 def
  1339. /CMapType 2 def
  1340. 1 begincodespacerange
  1341. <00> <7F>
  1342. endcodespacerange
  1343. 8 beginbfrange
  1344. <00> <01> <0393>
  1345. <09> <0A> <03A8>
  1346. <25> <26> <0025>
  1347. <28> <3B> <0028>
  1348. <3F> <5B> <003F>
  1349. <5D> <5E> <005D>
  1350. <61> <7A> <0061>
  1351. <7B> <7C> <2013>
  1352. endbfrange
  1353. 42 beginbfchar
  1354. <02> <0398>
  1355. <03> <039B>
  1356. <04> <039E>
  1357. <05> <03A0>
  1358. <06> <03A3>
  1359. <07> <03D2>
  1360. <08> <03A6>
  1361. <0B> <00660066>
  1362. <0C> <00660069>
  1363. <0D> <0066006C>
  1364. <0E> <006600660069>
  1365. <0F> <00660066006C>
  1366. <10> <0131>
  1367. <11> <0237>
  1368. <12> <0060>
  1369. <13> <00B4>
  1370. <14> <02C7>
  1371. <15> <02D8>
  1372. <16> <00AF>
  1373. <17> <02DA>
  1374. <18> <00B8>
  1375. <19> <00DF>
  1376. <1A> <00E6>
  1377. <1B> <0153>
  1378. <1C> <00F8>
  1379. <1D> <00C6>
  1380. <1E> <0152>
  1381. <1F> <00D8>
  1382. <21> <0021>
  1383. <22> <201D>
  1384. <23> <0023>
  1385. <24> <00A3>
  1386. <27> <2019>
  1387. <3C> <00A1>
  1388. <3D> <003D>
  1389. <3E> <00BF>
  1390. <5C> <201C>
  1391. <5F> <02D9>
  1392. <60> <2018>
  1393. <7D> <02DD>
  1394. <7E> <007E>
  1395. <7F> <00A8>
  1396. endbfchar
  1397. endcmap
  1398. CMapName currentdict /CMap defineresource pop
  1399. %%EndResource
  1400. %%EOF
  1401.     }\endgroup
  1402.   \expandafter\edef\csname cmapOT1IT\endcsname#1{%
  1403.     \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1404. % \cmapOT1TT
  1405.   \begingroup
  1406.     \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1407.     \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1408. %%DocumentNeededResources: ProcSet (CIDInit)
  1409. %%IncludeResource: ProcSet (CIDInit)
  1410. %%BeginResource: CMap (TeX-OT1TT-0)
  1411. %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
  1412. %%Version: 1.000
  1413. %%EndComments
  1414. /CIDInit /ProcSet findresource begin
  1415. 12 dict begin
  1416. begincmap
  1417. /CIDSystemInfo
  1418. << /Registry (TeX)
  1419. /Ordering (OT1TT)
  1420. /Supplement 0
  1421. >> def
  1422. /CMapName /TeX-OT1TT-0 def
  1423. /CMapType 2 def
  1424. 1 begincodespacerange
  1425. <00> <7F>
  1426. endcodespacerange
  1427. 5 beginbfrange
  1428. <00> <01> <0393>
  1429. <09> <0A> <03A8>
  1430. <21> <26> <0021>
  1431. <28> <5F> <0028>
  1432. <61> <7E> <0061>
  1433. endbfrange
  1434. 32 beginbfchar
  1435. <02> <0398>
  1436. <03> <039B>
  1437. <04> <039E>
  1438. <05> <03A0>
  1439. <06> <03A3>
  1440. <07> <03D2>
  1441. <08> <03A6>
  1442. <0B> <2191>
  1443. <0C> <2193>
  1444. <0D> <0027>
  1445. <0E> <00A1>
  1446. <0F> <00BF>
  1447. <10> <0131>
  1448. <11> <0237>
  1449. <12> <0060>
  1450. <13> <00B4>
  1451. <14> <02C7>
  1452. <15> <02D8>
  1453. <16> <00AF>
  1454. <17> <02DA>
  1455. <18> <00B8>
  1456. <19> <00DF>
  1457. <1A> <00E6>
  1458. <1B> <0153>
  1459. <1C> <00F8>
  1460. <1D> <00C6>
  1461. <1E> <0152>
  1462. <1F> <00D8>
  1463. <20> <2423>
  1464. <27> <2019>
  1465. <60> <2018>
  1466. <7F> <00A8>
  1467. endbfchar
  1468. endcmap
  1469. CMapName currentdict /CMap defineresource pop
  1470. %%EndResource
  1471. %%EOF
  1472.     }\endgroup
  1473.   \expandafter\edef\csname cmapOT1TT\endcsname#1{%
  1474.     \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1475. \fi\fi
  1476. % Set the font macro #1 to the font named #2, adding on the
  1477. % specified font prefix (normally `cm').
  1478. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
  1479. % encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
  1480. % empty to omit).
  1481. \def\setfont#1#2#3#4#5{%
  1482.   \font#1=\fontprefix#2#3 scaled #4
  1483.   \csname cmap#5\endcsname#1%
  1484. % This is what gets called when #5 of \setfont is empty.
  1485. \let\cmap\gobble
  1486. % emacs-page end of cmaps
  1487. % Use cm as the default font prefix.
  1488. % To specify the font prefix, you must define \fontprefix
  1489. % before you read in texinfo.tex.
  1490. \ifx\fontprefix\thisisundefined
  1491. \def\fontprefix{cm}
  1492. % Support font families that don't use the same naming scheme as CM.
  1493. \def\rmshape{r}
  1494. \def\rmbshape{bx}               %where the normal face is bold
  1495. \def\bfshape{b}
  1496. \def\bxshape{bx}
  1497. \def\ttshape{tt}
  1498. \def\ttbshape{tt}
  1499. \def\ttslshape{sltt}
  1500. \def\itshape{ti}
  1501. \def\itbshape{bxti}
  1502. \def\slshape{sl}
  1503. \def\slbshape{bxsl}
  1504. \def\sfshape{ss}
  1505. \def\sfbshape{ss}
  1506. \def\scshape{csc}
  1507. \def\scbshape{csc}
  1508. % Definitions for a main text size of 11pt.  This is the default in
  1509. % Texinfo.
  1510. \def\definetextfontsizexi{%
  1511. % Text fonts (11.2pt, magstep1).
  1512. \def\textnominalsize{11pt}
  1513. \edef\mainmagstep{\magstephalf}
  1514. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1515. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1516. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1517. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1518. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1519. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1520. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1521. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1522. \font\texti=cmmi10 scaled \mainmagstep
  1523. \font\textsy=cmsy10 scaled \mainmagstep
  1524. \def\textecsize{1095}
  1525. % A few fonts for @defun names and args.
  1526. \setfont\defbf\bfshape{10}{\magstep1}{OT1}
  1527. \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
  1528. \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
  1529. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1530. % Fonts for indices, footnotes, small examples (9pt).
  1531. \def\smallnominalsize{9pt}
  1532. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1533. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1534. \setfont\smallbf\bfshape{10}{900}{OT1}
  1535. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1536. \setfont\smallsl\slshape{9}{1000}{OT1}
  1537. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1538. \setfont\smallsc\scshape{10}{900}{OT1}
  1539. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1540. \font\smalli=cmmi9
  1541. \font\smallsy=cmsy9
  1542. \def\smallecsize{0900}
  1543. % Fonts for small examples (8pt).
  1544. \def\smallernominalsize{8pt}
  1545. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1546. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1547. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1548. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1549. \setfont\smallersl\slshape{8}{1000}{OT1}
  1550. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1551. \setfont\smallersc\scshape{10}{800}{OT1}
  1552. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1553. \font\smalleri=cmmi8
  1554. \font\smallersy=cmsy8
  1555. \def\smallerecsize{0800}
  1556. % Fonts for title page (20.4pt):
  1557. \def\titlenominalsize{20pt}
  1558. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1559. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1560. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1561. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1562. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1563. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1564. \let\titlebf=\titlerm
  1565. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1566. \font\titlei=cmmi12 scaled \magstep3
  1567. \font\titlesy=cmsy10 scaled \magstep4
  1568. \def\titleecsize{2074}
  1569. % Chapter (and unnumbered) fonts (17.28pt).
  1570. \def\chapnominalsize{17pt}
  1571. \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
  1572. \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
  1573. \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
  1574. \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
  1575. \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
  1576. \setfont\chapsf\sfbshape{17}{1000}{OT1}
  1577. \let\chapbf=\chaprm
  1578. \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
  1579. \font\chapi=cmmi12 scaled \magstep2
  1580. \font\chapsy=cmsy10 scaled \magstep3
  1581. \def\chapecsize{1728}
  1582. % Section fonts (14.4pt).
  1583. \def\secnominalsize{14pt}
  1584. \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
  1585. \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
  1586. \setfont\secsl\slbshape{10}{\magstep2}{OT1}
  1587. \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
  1588. \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
  1589. \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
  1590. \let\secbf\secrm
  1591. \setfont\secsc\scbshape{10}{\magstep2}{OT1}
  1592. \font\seci=cmmi12 scaled \magstep1
  1593. \font\secsy=cmsy10 scaled \magstep2
  1594. \def\sececsize{1440}
  1595. % Subsection fonts (13.15pt).
  1596. \def\ssecnominalsize{13pt}
  1597. \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
  1598. \setfont\ssecit\itbshape{10}{1315}{OT1IT}
  1599. \setfont\ssecsl\slbshape{10}{1315}{OT1}
  1600. \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
  1601. \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
  1602. \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
  1603. \let\ssecbf\ssecrm
  1604. \setfont\ssecsc\scbshape{10}{1315}{OT1}
  1605. \font\sseci=cmmi12 scaled \magstephalf
  1606. \font\ssecsy=cmsy10 scaled 1315
  1607. \def\ssececsize{1200}
  1608. % Reduced fonts for @acro in text (10pt).
  1609. \def\reducednominalsize{10pt}
  1610. \setfont\reducedrm\rmshape{10}{1000}{OT1}
  1611. \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
  1612. \setfont\reducedbf\bfshape{10}{1000}{OT1}
  1613. \setfont\reducedit\itshape{10}{1000}{OT1IT}
  1614. \setfont\reducedsl\slshape{10}{1000}{OT1}
  1615. \setfont\reducedsf\sfshape{10}{1000}{OT1}
  1616. \setfont\reducedsc\scshape{10}{1000}{OT1}
  1617. \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
  1618. \font\reducedi=cmmi10
  1619. \font\reducedsy=cmsy10
  1620. \def\reducedecsize{1000}
  1621. \textleading = 13.2pt % line spacing for 11pt CM
  1622. \textfonts            % reset the current fonts
  1623. } % end of 11pt text font size definitions
  1624. % Definitions to make the main text be 10pt Computer Modern, with
  1625. % section, chapter, etc., sizes following suit.  This is for the GNU
  1626. % Press printing of the Emacs 22 manual.  Maybe other manuals in the
  1627. % future.  Used with @smallbook, which sets the leading to 12pt.
  1628. \def\definetextfontsizex{%
  1629. % Text fonts (10pt).
  1630. \def\textnominalsize{10pt}
  1631. \edef\mainmagstep{1000}
  1632. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1633. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1634. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1635. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1636. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1637. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1638. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1639. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1640. \font\texti=cmmi10 scaled \mainmagstep
  1641. \font\textsy=cmsy10 scaled \mainmagstep
  1642. \def\textecsize{1000}
  1643. % A few fonts for @defun names and args.
  1644. \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
  1645. \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
  1646. \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
  1647. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1648. % Fonts for indices, footnotes, small examples (9pt).
  1649. \def\smallnominalsize{9pt}
  1650. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1651. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1652. \setfont\smallbf\bfshape{10}{900}{OT1}
  1653. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1654. \setfont\smallsl\slshape{9}{1000}{OT1}
  1655. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1656. \setfont\smallsc\scshape{10}{900}{OT1}
  1657. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1658. \font\smalli=cmmi9
  1659. \font\smallsy=cmsy9
  1660. \def\smallecsize{0900}
  1661. % Fonts for small examples (8pt).
  1662. \def\smallernominalsize{8pt}
  1663. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1664. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1665. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1666. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1667. \setfont\smallersl\slshape{8}{1000}{OT1}
  1668. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1669. \setfont\smallersc\scshape{10}{800}{OT1}
  1670. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1671. \font\smalleri=cmmi8
  1672. \font\smallersy=cmsy8
  1673. \def\smallerecsize{0800}
  1674. % Fonts for title page (20.4pt):
  1675. \def\titlenominalsize{20pt}
  1676. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1677. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1678. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1679. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1680. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1681. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1682. \let\titlebf=\titlerm
  1683. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1684. \font\titlei=cmmi12 scaled \magstep3
  1685. \font\titlesy=cmsy10 scaled \magstep4
  1686. \def\titleecsize{2074}
  1687. % Chapter fonts (14.4pt).
  1688. \def\chapnominalsize{14pt}
  1689. \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
  1690. \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
  1691. \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
  1692. \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
  1693. \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
  1694. \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
  1695. \let\chapbf\chaprm
  1696. \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
  1697. \font\chapi=cmmi12 scaled \magstep1
  1698. \font\chapsy=cmsy10 scaled \magstep2
  1699. \def\chapecsize{1440}
  1700. % Section fonts (12pt).
  1701. \def\secnominalsize{12pt}
  1702. \setfont\secrm\rmbshape{12}{1000}{OT1}
  1703. \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
  1704. \setfont\secsl\slbshape{10}{\magstep1}{OT1}
  1705. \setfont\sectt\ttbshape{12}{1000}{OT1TT}
  1706. \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
  1707. \setfont\secsf\sfbshape{12}{1000}{OT1}
  1708. \let\secbf\secrm
  1709. \setfont\secsc\scbshape{10}{\magstep1}{OT1}
  1710. \font\seci=cmmi12
  1711. \font\secsy=cmsy10 scaled \magstep1
  1712. \def\sececsize{1200}
  1713. % Subsection fonts (10pt).
  1714. \def\ssecnominalsize{10pt}
  1715. \setfont\ssecrm\rmbshape{10}{1000}{OT1}
  1716. \setfont\ssecit\itbshape{10}{1000}{OT1IT}
  1717. \setfont\ssecsl\slbshape{10}{1000}{OT1}
  1718. \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
  1719. \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
  1720. \setfont\ssecsf\sfbshape{10}{1000}{OT1}
  1721. \let\ssecbf\ssecrm
  1722. \setfont\ssecsc\scbshape{10}{1000}{OT1}
  1723. \font\sseci=cmmi10
  1724. \font\ssecsy=cmsy10
  1725. \def\ssececsize{1000}
  1726. % Reduced fonts for @acro in text (9pt).
  1727. \def\reducednominalsize{9pt}
  1728. \setfont\reducedrm\rmshape{9}{1000}{OT1}
  1729. \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
  1730. \setfont\reducedbf\bfshape{10}{900}{OT1}
  1731. \setfont\reducedit\itshape{9}{1000}{OT1IT}
  1732. \setfont\reducedsl\slshape{9}{1000}{OT1}
  1733. \setfont\reducedsf\sfshape{9}{1000}{OT1}
  1734. \setfont\reducedsc\scshape{10}{900}{OT1}
  1735. \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
  1736. \font\reducedi=cmmi9
  1737. \font\reducedsy=cmsy9
  1738. \def\reducedecsize{0900}
  1739. \divide\parskip by 2  % reduce space between paragraphs
  1740. \textleading = 12pt   % line spacing for 10pt CM
  1741. \textfonts            % reset the current fonts
  1742. } % end of 10pt text font size definitions
  1743. % We provide the user-level command
  1744. %   @fonttextsize 10
  1745. % (or 11) to redefine the text font size.  pt is assumed.
  1746. \def\xiword{11}
  1747. \def\xword{10}
  1748. \def\xwordpt{10pt}
  1749. \parseargdef\fonttextsize{%
  1750.   \def\textsizearg{#1}%
  1751.   %\wlog{doing @fonttextsize \textsizearg}%
  1752.   % Set \globaldefs so that documents can use this inside @tex, since
  1753.   % makeinfo 4.8 does not support it, but we need it nonetheless.
  1754.  \begingroup \globaldefs=1
  1755.   \ifx\textsizearg\xword \definetextfontsizex
  1756.   \else \ifx\textsizearg\xiword \definetextfontsizexi
  1757.   \else
  1758.     \errhelp=\EMsimple
  1759.     \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
  1760.   \fi\fi
  1761.  \endgroup
  1762. % In order for the font changes to affect most math symbols and letters,
  1763. % we have to define the \textfont of the standard families.  Since
  1764. % texinfo doesn't allow for producing subscripts and superscripts except
  1765. % in the main text, we don't bother to reset \scriptfont and
  1766. % \scriptscriptfont (which would also require loading a lot more fonts).
  1767. \def\resetmathfonts{%
  1768.   \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
  1769.   \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
  1770.   \textfont\ttfam=\tentt \textfont\sffam=\tensf
  1771. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  1772. % of just \STYLE.  We do this because \STYLE needs to also set the
  1773. % current \fam for math mode.  Our \STYLE (e.g., \rm) commands hardwire
  1774. % \tenSTYLE to set the current font.
  1775. % Each font-changing command also sets the names \lsize (one size lower)
  1776. % and \lllsize (three sizes lower).  These relative commands are used in
  1777. % the LaTeX logo and acronyms.
  1778. % This all needs generalizing, badly.
  1779. \def\textfonts{%
  1780.   \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  1781.   \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  1782.   \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  1783.   \let\tenttsl=\textttsl
  1784.   \def\curfontsize{text}%
  1785.   \def\lsize{reduced}\def\lllsize{smaller}%
  1786.   \resetmathfonts \setleading{\textleading}}
  1787. \def\titlefonts{%
  1788.   \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
  1789.   \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
  1790.   \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
  1791.   \let\tenttsl=\titlettsl
  1792.   \def\curfontsize{title}%
  1793.   \def\lsize{chap}\def\lllsize{subsec}%
  1794.   \resetmathfonts \setleading{27pt}}
  1795. \def\titlefont#1{{\titlefonts\rmisbold #1}}
  1796. \def\chapfonts{%
  1797.   \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
  1798.   \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  1799.   \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  1800.   \let\tenttsl=\chapttsl
  1801.   \def\curfontsize{chap}%
  1802.   \def\lsize{sec}\def\lllsize{text}%
  1803.   \resetmathfonts \setleading{19pt}}
  1804. \def\secfonts{%
  1805.   \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  1806.   \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  1807.   \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  1808.   \let\tenttsl=\secttsl
  1809.   \def\curfontsize{sec}%
  1810.   \def\lsize{subsec}\def\lllsize{reduced}%
  1811.   \resetmathfonts \setleading{16pt}}
  1812. \def\subsecfonts{%
  1813.   \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  1814.   \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  1815.   \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  1816.   \let\tenttsl=\ssecttsl
  1817.   \def\curfontsize{ssec}%
  1818.   \def\lsize{text}\def\lllsize{small}%
  1819.   \resetmathfonts \setleading{15pt}}
  1820. \let\subsubsecfonts = \subsecfonts
  1821. \def\reducedfonts{%
  1822.   \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
  1823.   \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
  1824.   \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
  1825.   \let\tenttsl=\reducedttsl
  1826.   \def\curfontsize{reduced}%
  1827.   \def\lsize{small}\def\lllsize{smaller}%
  1828.   \resetmathfonts \setleading{10.5pt}}
  1829. \def\smallfonts{%
  1830.   \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
  1831.   \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
  1832.   \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
  1833.   \let\tenttsl=\smallttsl
  1834.   \def\curfontsize{small}%
  1835.   \def\lsize{smaller}\def\lllsize{smaller}%
  1836.   \resetmathfonts \setleading{10.5pt}}
  1837. \def\smallerfonts{%
  1838.   \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
  1839.   \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
  1840.   \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
  1841.   \let\tenttsl=\smallerttsl
  1842.   \def\curfontsize{smaller}%
  1843.   \def\lsize{smaller}\def\lllsize{smaller}%
  1844.   \resetmathfonts \setleading{9.5pt}}
  1845. % Fonts for short table of contents.
  1846. \setfont\shortcontrm\rmshape{12}{1000}{OT1}
  1847. \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1}  % no cmb12
  1848. \setfont\shortcontsl\slshape{12}{1000}{OT1}
  1849. \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
  1850. % Define these just so they can be easily changed for other fonts.
  1851. \def\angleleft{$\langle$}
  1852. \def\angleright{$\rangle$}
  1853. % Set the fonts to use with the @small... environments.
  1854. \let\smallexamplefonts = \smallfonts
  1855. % About \smallexamplefonts.  If we use \smallfonts (9pt), @smallexample
  1856. % can fit this many characters:
  1857. %   8.5x11=86   smallbook=72  a4=90  a5=69
  1858. % If we use \scriptfonts (8pt), then we can fit this many characters:
  1859. %   8.5x11=90+  smallbook=80  a4=90+  a5=77
  1860. % For me, subjectively, the few extra characters that fit aren't worth
  1861. % the additional smallness of 8pt.  So I'm making the default 9pt.
  1862. % By the way, for comparison, here's what fits with @example (10pt):
  1863. %   8.5x11=71  smallbook=60  a4=75  a5=58
  1864. % --karl, 24jan03.
  1865. % Set up the default fonts, so we can use them for creating boxes.
  1866. \definetextfontsizexi
  1867. \message{markup,}
  1868. % Check if we are currently using a typewriter font.  Since all the
  1869. % Computer Modern typewriter fonts have zero interword stretch (and
  1870. % shrink), and it is reasonable to expect all typewriter fonts to have
  1871. % this property, we can check that font parameter.
  1872. \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
  1873. % Markup style infrastructure.  \defmarkupstylesetup\INITMACRO will
  1874. % define and register \INITMACRO to be called on markup style changes.
  1875. % \INITMACRO can check \currentmarkupstyle for the innermost
  1876. % style and the set of \ifmarkupSTYLE switches for all styles
  1877. % currently in effect.
  1878. \newif\ifmarkupvar
  1879. \newif\ifmarkupsamp
  1880. \newif\ifmarkupkey
  1881. %\newif\ifmarkupfile % @file == @samp.
  1882. %\newif\ifmarkupoption % @option == @samp.
  1883. \newif\ifmarkupcode
  1884. \newif\ifmarkupkbd
  1885. %\newif\ifmarkupenv % @env == @code.
  1886. %\newif\ifmarkupcommand % @command == @code.
  1887. \newif\ifmarkuptex % @tex (and part of @math, for now).
  1888. \newif\ifmarkupexample
  1889. \newif\ifmarkupverb
  1890. \newif\ifmarkupverbatim
  1891. \let\currentmarkupstyle\empty
  1892. \def\setupmarkupstyle#1{%
  1893.   \csname markup#1true\endcsname
  1894.   \def\currentmarkupstyle{#1}%
  1895.   \markupstylesetup
  1896. \let\markupstylesetup\empty
  1897. \def\defmarkupstylesetup#1{%
  1898.   \expandafter\def\expandafter\markupstylesetup
  1899.     \expandafter{\markupstylesetup #1}%
  1900.   \def#1%
  1901. % Markup style setup for left and right quotes.
  1902. \defmarkupstylesetup\markupsetuplq{%
  1903.   \expandafter\let\expandafter \temp
  1904.     \csname markupsetuplq\currentmarkupstyle\endcsname
  1905.   \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
  1906. \defmarkupstylesetup\markupsetuprq{%
  1907.   \expandafter\let\expandafter \temp
  1908.     \csname markupsetuprq\currentmarkupstyle\endcsname
  1909.   \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
  1910. \catcode`\'=\active
  1911. \catcode`\`=\active
  1912. \gdef\markupsetuplqdefault{\let`\lq}
  1913. \gdef\markupsetuprqdefault{\let'\rq}
  1914. \gdef\markupsetcodequoteleft{\let`\codequoteleft}
  1915. \gdef\markupsetcodequoteright{\let'\codequoteright}
  1916. \gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
  1917. \let\markupsetuplqcode \markupsetcodequoteleft
  1918. \let\markupsetuprqcode \markupsetcodequoteright
  1919. \let\markupsetuplqexample \markupsetcodequoteleft
  1920. \let\markupsetuprqexample \markupsetcodequoteright
  1921. \let\markupsetuplqsamp \markupsetcodequoteleft
  1922. \let\markupsetuprqsamp \markupsetcodequoteright
  1923. \let\markupsetuplqverb \markupsetcodequoteleft
  1924. \let\markupsetuprqverb \markupsetcodequoteright
  1925. \let\markupsetuplqverbatim \markupsetcodequoteleft
  1926. \let\markupsetuprqverbatim \markupsetcodequoteright
  1927. \let\markupsetuplqkbd \markupsetnoligaturesquoteleft
  1928. % Allow an option to not use regular directed right quote/apostrophe
  1929. % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
  1930. % The undirected quote is ugly, so don't make it the default, but it
  1931. % works for pasting with more pdf viewers (at least evince), the
  1932. % lilypond developers report.  xpdf does work with the regular 0x27.
  1933. \def\codequoteright{%
  1934.   \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
  1935.     \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
  1936.       '%
  1937.     \else \char'15 \fi
  1938.   \else \char'15 \fi
  1939. % and a similar option for the left quote char vs. a grave accent.
  1940. % Modern fonts display ASCII 0x60 as a grave accent, so some people like
  1941. % the code environments to do likewise.
  1942. \def\codequoteleft{%
  1943.   \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
  1944.     \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
  1945.       % [Knuth] pp. 380,381,391
  1946.       % \relax disables Spanish ligatures ?` and !` of \tt font.
  1947.       \relax`%
  1948.     \else \char'22 \fi
  1949.   \else \char'22 \fi
  1950. % Commands to set the quote options.
  1951. \parseargdef\codequoteundirected{%
  1952.   \def\temp{#1}%
  1953.   \ifx\temp\onword
  1954.     \expandafter\let\csname SETtxicodequoteundirected\endcsname
  1955.       = t%
  1956.   \else\ifx\temp\offword
  1957.     \expandafter\let\csname SETtxicodequoteundirected\endcsname
  1958.       = \relax
  1959.   \else
  1960.     \errhelp = \EMsimple
  1961.     \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
  1962.   \fi\fi
  1963. \parseargdef\codequotebacktick{%
  1964.   \def\temp{#1}%
  1965.   \ifx\temp\onword
  1966.     \expandafter\let\csname SETtxicodequotebacktick\endcsname
  1967.       = t%
  1968.   \else\ifx\temp\offword
  1969.     \expandafter\let\csname SETtxicodequotebacktick\endcsname
  1970.       = \relax
  1971.   \else
  1972.     \errhelp = \EMsimple
  1973.     \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
  1974.   \fi\fi
  1975. % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
  1976. \def\noligaturesquoteleft{\relax\lq}
  1977. % Count depth in font-changes, for error checks
  1978. \newcount\fontdepth \fontdepth=0
  1979. % Font commands.
  1980. % #1 is the font command (\sl or \it), #2 is the text to slant.
  1981. % If we are in a monospaced environment, however, 1) always use \ttsl,
  1982. % and 2) do not add an italic correction.
  1983. \def\dosmartslant#1#2{%
  1984.   \ifusingtt 
  1985.     {{\ttsl #2}\let\next=\relax}%
  1986.     {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
  1987.   \next
  1988. \def\smartslanted{\dosmartslant\sl}
  1989. \def\smartitalic{\dosmartslant\it}
  1990. % Output an italic correction unless \next (presumed to be the following
  1991. % character) is such as not to need one.
  1992. \def\smartitaliccorrection{%
  1993.   \ifx\next,%
  1994.   \else\ifx\next-%
  1995.   \else\ifx\next.%
  1996.   \else\ptexslash
  1997.   \fi\fi\fi
  1998.   \aftersmartic
  1999. % like \smartslanted except unconditionally uses \ttsl, and no ic.
  2000. % @var is set to this for defun arguments.
  2001. \def\ttslanted#1{{\ttsl #1}}
  2002. % @cite is like \smartslanted except unconditionally use \sl.  We never want
  2003. % ttsl for book titles, do we?
  2004. \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
  2005. \def\aftersmartic{}
  2006. \def\var#1{%
  2007.   \let\saveaftersmartic = \aftersmartic
  2008.   \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
  2009.   \smartslanted{#1}%
  2010. \let\i=\smartitalic
  2011. \let\slanted=\smartslanted
  2012. \let\dfn=\smartslanted
  2013. \let\emph=\smartitalic
  2014. % Explicit font changes: @r, @sc, undocumented @ii.
  2015. \def\r#1{{\rm #1}}              % roman font
  2016. \def\sc#1{{\smallcaps#1}}       % smallcaps font
  2017. \def\ii#1{{\it #1}}             % italic font
  2018. % @b, explicit bold.  Also @strong.
  2019. \def\b#1{{\bf #1}}
  2020. \let\strong=\b
  2021. % @sansserif, explicit sans.
  2022. \def\sansserif#1{{\sf #1}}
  2023. % We can't just use \exhyphenpenalty, because that only has effect at
  2024. % the end of a paragraph.  Restore normal hyphenation at the end of the
  2025. % group within which \nohyphenation is presumably called.
  2026. \def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
  2027. \def\restorehyphenation{\hyphenchar\font = `- }
  2028. % Set sfcode to normal for the chars that usually have another value.
  2029. % Can't use plain's \frenchspacing because it uses the `\x notation, and
  2030. % sometimes \x has an active definition that messes things up.
  2031. \catcode`@=11
  2032.   \def\plainfrenchspacing{%
  2033.     \sfcode\dotChar  =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
  2034.     \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
  2035.     \def\endofsentencespacefactor{1000}% for @. and friends
  2036.   \def\plainnonfrenchspacing{%
  2037.     \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
  2038.     \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
  2039.     \def\endofsentencespacefactor{3000}% for @. and friends
  2040. \catcode`@=\other
  2041. \def\endofsentencespacefactor{3000}% default
  2042. % @t, explicit typewriter.
  2043. \def\t#1{%
  2044.   {\tt \rawbackslash \plainfrenchspacing #1}%
  2045.   \null
  2046. % @samp.
  2047. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
  2048. % definition of @key that produces a lozenge.  Doesn't adjust to text size.
  2049. %\setfont\keyrm\rmshape{8}{1000}{OT1}
  2050. %\font\keysy=cmsy9
  2051. %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
  2052. %  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
  2053. %    \vbox{\hrule\kern-0.4pt
  2054. %     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
  2055. %    \kern-0.4pt\hrule}%
  2056. %  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
  2057. % definition of @key with no lozenge.  If the current font is already
  2058. % monospace, don't change it; that way, we respect @kbdinputstyle.  But
  2059. % if it isn't monospace, then use \tt.
  2060. \def\key#1{{\setupmarkupstyle{key}%
  2061.   \nohyphenation
  2062.   \ifmonospace\else\tt\fi
  2063.   #1}\null}
  2064. % ctrl is no longer a Texinfo command.
  2065. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  2066. % @file, @option are the same as @samp.
  2067. \let\file=\samp
  2068. \let\option=\samp
  2069. % @code is a modification of @t,
  2070. % which makes spaces the same size as normal in the surrounding text.
  2071. \def\tclose#1{%
  2072.     % Change normal interword space to be same as for the current font.
  2073.     \spaceskip = \fontdimen2\font
  2074.     %
  2075.     % Switch to typewriter.
  2076.     \tt
  2077.     %
  2078.     % But `\ ' produces the large typewriter interword space.
  2079.     \def\ {{\spaceskip = 0pt{} }}%
  2080.     %
  2081.     % Turn off hyphenation.
  2082.     \nohyphenation
  2083.     %
  2084.     \rawbackslash
  2085.     \plainfrenchspacing
  2086.     #1%
  2087.   \null % reset spacefactor to 1000
  2088. % We *must* turn on hyphenation at `-' and `_' in @code.
  2089. % Otherwise, it is too hard to avoid overfull hboxes
  2090. % in the Emacs manual, the Library manual, etc.
  2091. % Unfortunately, TeX uses one parameter (\hyphenchar) to control
  2092. % both hyphenation at - and hyphenation within words.
  2093. % We must therefore turn them both off (\tclose does that)
  2094. % and arrange explicitly to hyphenate at a dash.
  2095. %  -- rms.
  2096.   \catcode`\-=\active \catcode`\_=\active
  2097.   \catcode`\'=\active \catcode`\`=\active
  2098.   \global\let'=\rq \global\let`=\lq  % default definitions
  2099.   \global\def\code{\begingroup
  2100.     \setupmarkupstyle{code}%
  2101.     % The following should really be moved into \setupmarkupstyle handlers.
  2102.     \catcode\dashChar=\active  \catcode\underChar=\active
  2103.     \ifallowcodebreaks
  2104.      \let-\codedash
  2105.      \let_\codeunder
  2106.     \else
  2107.      \let-\realdash
  2108.      \let_\realunder
  2109.     \fi
  2110.     \codex
  2111. \def\codex #1{\tclose{#1}\endgroup}
  2112. \def\realdash{-}
  2113. \def\codedash{-\discretionary{}{}{}}
  2114. \def\codeunder{%
  2115.   % this is all so @math{@code{var_name}+1} can work.  In math mode, _
  2116.   % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
  2117.   % will therefore expand the active definition of _, which is us
  2118.   % (inside @code that is), therefore an endless loop.
  2119.   \ifusingtt{\ifmmode
  2120.                \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
  2121.              \else\normalunderscore \fi
  2122.              \discretionary{}{}{}}%
  2123.             {\_}%
  2124. % An additional complication: the above will allow breaks after, e.g.,
  2125. % each of the four underscores in __typeof__.  This is undesirable in
  2126. % some manuals, especially if they don't have long identifiers in
  2127. % general.  @allowcodebreaks provides a way to control this.
  2128. \newif\ifallowcodebreaks  \allowcodebreakstrue
  2129. \def\keywordtrue{true}
  2130. \def\keywordfalse{false}
  2131. \parseargdef\allowcodebreaks{%
  2132.   \def\txiarg{#1}%
  2133.   \ifx\txiarg\keywordtrue
  2134.     \allowcodebreakstrue
  2135.   \else\ifx\txiarg\keywordfalse
  2136.     \allowcodebreaksfalse
  2137.   \else
  2138.     \errhelp = \EMsimple
  2139.     \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
  2140.   \fi\fi
  2141. % @uref (abbreviation for `urlref') takes an optional (comma-separated)
  2142. % second argument specifying the text to display and an optional third
  2143. % arg as text to display instead of (rather than in addition to) the url
  2144. % itself.  First (mandatory) arg is the url.
  2145. % (This \urefnobreak definition isn't used now, leaving it for a while
  2146. % for comparison.)
  2147. \def\urefnobreak#1{\dourefnobreak #1,,,\finish}
  2148. \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
  2149.   \unsepspaces
  2150.   \pdfurl{#1}%
  2151.   \setbox0 = \hbox{\ignorespaces #3}%
  2152.   \ifdim\wd0 > 0pt
  2153.     \unhbox0 % third arg given, show only that
  2154.   \else
  2155.     \setbox0 = \hbox{\ignorespaces #2}%
  2156.     \ifdim\wd0 > 0pt
  2157.       \ifpdf
  2158.         \unhbox0             % PDF: 2nd arg given, show only it
  2159.       \else
  2160.         \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
  2161.       \fi
  2162.     \else
  2163.       \code{#1}% only url given, so show it
  2164.     \fi
  2165.   \fi
  2166.   \endlink
  2167. \endgroup}
  2168. % This \urefbreak definition is the active one.
  2169. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
  2170. \let\uref=\urefbreak
  2171. \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
  2172. \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
  2173.   \unsepspaces
  2174.   \pdfurl{#1}%
  2175.   \setbox0 = \hbox{\ignorespaces #3}%
  2176.   \ifdim\wd0 > 0pt
  2177.     \unhbox0 % third arg given, show only that
  2178.   \else
  2179.     \setbox0 = \hbox{\ignorespaces #2}%
  2180.     \ifdim\wd0 > 0pt
  2181.       \ifpdf
  2182.         \unhbox0             % PDF: 2nd arg given, show only it
  2183.       \else
  2184.         \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
  2185.       \fi
  2186.     \else
  2187.       \urefcode{#1}% only url given, so show it
  2188.     \fi
  2189.   \fi
  2190.   \endlink
  2191. \endgroup}
  2192. % Allow line breaks around only a few characters (only).
  2193. \def\urefcatcodes{%
  2194.   \catcode\ampChar=\active   \catcode\dotChar=\active
  2195.   \catcode\hashChar=\active  \catcode\questChar=\active
  2196.   \catcode\slashChar=\active
  2197.   \urefcatcodes
  2198.   \global\def\urefcode{\begingroup
  2199.     \setupmarkupstyle{code}%
  2200.     \urefcatcodes
  2201.     \let&\urefcodeamp
  2202.     \let.\urefcodedot
  2203.     \let#\urefcodehash
  2204.     \let?\urefcodequest
  2205.     \let/\urefcodeslash
  2206.     \codex
  2207.   % By default, they are just regular characters.
  2208.   \global\def&{\normalamp}
  2209.   \global\def.{\normaldot}
  2210.   \global\def#{\normalhash}
  2211.   \global\def?{\normalquest}
  2212.   \global\def/{\normalslash}
  2213. % we put a little stretch before and after the breakable chars, to help
  2214. % line breaking of long url's.  The unequal skips make look better in
  2215. % cmtt at least, especially for dots.
  2216. \def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
  2217. \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
  2218. \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
  2219. \def\urefcodedot{\urefprestretch .\urefpoststretch}
  2220. \def\urefcodehash{\urefprestretch \#\urefpoststretch}
  2221. \def\urefcodequest{\urefprestretch ?\urefpoststretch}
  2222. \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
  2223.   \catcode`\/=\active
  2224.   \global\def\urefcodeslashfinish{%
  2225.     \urefprestretch \slashChar
  2226.     % Allow line break only after the final / in a sequence of
  2227.     % slashes, to avoid line break between the slashes in http://.
  2228.     \ifx\next/\else \urefpoststretch \fi
  2229. % One more complication: by default we'll break after the special
  2230. % characters, but some people like to break before the special chars, so
  2231. % allow that.  Also allow no breaking at all, for manual control.
  2232. \parseargdef\urefbreakstyle{%
  2233.   \def\txiarg{#1}%
  2234.   \ifx\txiarg\wordnone
  2235.     \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
  2236.   \else\ifx\txiarg\wordbefore
  2237.     \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
  2238.   \else\ifx\txiarg\wordafter
  2239.     \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
  2240.   \else
  2241.     \errhelp = \EMsimple
  2242.     \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
  2243.   \fi\fi\fi
  2244. \def\wordafter{after}
  2245. \def\wordbefore{before}
  2246. \def\wordnone{none}
  2247. \urefbreakstyle after
  2248. % @url synonym for @uref, since that's how everyone uses it.
  2249. \let\url=\uref
  2250. % rms does not like angle brackets --karl, 17may97.
  2251. % So now @email is just like @uref, unless we are pdf.
  2252. %\def\email#1{\angleleft{\tt #1}\angleright}
  2253. \ifpdf
  2254.   \def\email#1{\doemail#1,,\finish}
  2255.   \def\doemail#1,#2,#3\finish{\begingroup
  2256.     \unsepspaces
  2257.     \pdfurl{mailto:#1}%
  2258.     \setbox0 = \hbox{\ignorespaces #2}%
  2259.     \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
  2260.     \endlink
  2261.   \endgroup}
  2262. \else
  2263.   \let\email=\uref
  2264. % @kbd is like @code, except that if the argument is just one @key command,
  2265. % then @kbd has no effect.
  2266. \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
  2267. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
  2268. %   `example' (@kbd uses ttsl only inside of @example and friends),
  2269. %   or `code' (@kbd uses normal tty font always).
  2270. \parseargdef\kbdinputstyle{%
  2271.   \def\txiarg{#1}%
  2272.   \ifx\txiarg\worddistinct
  2273.     \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
  2274.   \else\ifx\txiarg\wordexample
  2275.     \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
  2276.   \else\ifx\txiarg\wordcode
  2277.     \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
  2278.   \else
  2279.     \errhelp = \EMsimple
  2280.     \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
  2281.   \fi\fi\fi
  2282. \def\worddistinct{distinct}
  2283. \def\wordexample{example}
  2284. \def\wordcode{code}
  2285. % Default is `distinct'.
  2286. \kbdinputstyle distinct
  2287. \def\xkey{\key}
  2288. \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
  2289. \ifx\one\xkey\ifx\threex\three \key{#2}%
  2290. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
  2291. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
  2292. % For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
  2293. \let\indicateurl=\code
  2294. \let\env=\code
  2295. \let\command=\code
  2296. % @clicksequence{File @click{} Open ...}
  2297. \def\clicksequence#1{\begingroup #1\endgroup}
  2298. % @clickstyle @arrow   (by default)
  2299. \parseargdef\clickstyle{\def\click{#1}}
  2300. \def\click{\arrow}
  2301. % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
  2302. % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
  2303. \def\dmn#1{\thinspace #1}
  2304. % @l was never documented to mean ``switch to the Lisp font'',
  2305. % and it is not used as such in any manual I can find.  We need it for
  2306. % Polish suppressed-l.  --karl, 22sep96.
  2307. %\def\l#1{{\li #1}\null}
  2308. % @acronym for "FBI", "NATO", and the like.
  2309. % We print this one point size smaller, since it's intended for
  2310. % all-uppercase.
  2311. \def\acronym#1{\doacronym #1,,\finish}
  2312. \def\doacronym#1,#2,#3\finish{%
  2313.   {\selectfonts\lsize #1}%
  2314.   \def\temp{#2}%
  2315.   \ifx\temp\empty \else
  2316.     \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2317.   \fi
  2318.   \null % reset \spacefactor=1000
  2319. % @abbr for "Comput. J." and the like.
  2320. % No font change, but don't do end-of-sentence spacing.
  2321. \def\abbr#1{\doabbr #1,,\finish}
  2322. \def\doabbr#1,#2,#3\finish{%
  2323.   {\plainfrenchspacing #1}%
  2324.   \def\temp{#2}%
  2325.   \ifx\temp\empty \else
  2326.     \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2327.   \fi
  2328.   \null % reset \spacefactor=1000
  2329. % @asis just yields its argument.  Used with @table, for example.
  2330. \def\asis#1{#1}
  2331. % @math outputs its argument in math mode.
  2332. % One complication: _ usually means subscripts, but it could also mean
  2333. % an actual _ character, as in @math{@var{some_variable} + 1}.  So make
  2334. % _ active, and distinguish by seeing if the current family is \slfam,
  2335. % which is what @var uses.
  2336.   \catcode`\_ = \active
  2337.   \gdef\mathunderscore{%
  2338.     \catcode`\_=\active
  2339.     \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
  2340. % Another complication: we want \\ (and @\) to output a math (or tt) \.
  2341. % FYI, plain.tex uses \\ as a temporary control sequence (for no
  2342. % particular reason), but this is not advertised and we don't care.
  2343. % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
  2344. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
  2345. \def\math{%
  2346.   \tex
  2347.   \mathunderscore
  2348.   \let\\ = \mathbackslash
  2349.   \mathactive
  2350.   % make the texinfo accent commands work in math mode
  2351.   \let\"=\ddot
  2352.   \let\'=\acute
  2353.   \let\==\bar
  2354.   \let\^=\hat
  2355.   \let\`=\grave
  2356.   \let\u=\breve
  2357.   \let\v=\check
  2358.   \let\~=\tilde
  2359.   \let\dotaccent=\dot
  2360.   $\finishmath
  2361. \def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
  2362. % Some active characters (such as <) are spaced differently in math.
  2363. % We have to reset their definitions in case the @math was an argument
  2364. % to a command which sets the catcodes (such as @item or @section).
  2365.   \catcode`^ = \active
  2366.   \catcode`< = \active
  2367.   \catcode`> = \active
  2368.   \catcode`+ = \active
  2369.   \catcode`' = \active
  2370.   \gdef\mathactive{%
  2371.     \let^ = \ptexhat
  2372.     \let< = \ptexless
  2373.     \let> = \ptexgtr
  2374.     \let+ = \ptexplus
  2375.     \let' = \ptexquoteright
  2376. \message{glyphs,}
  2377. % and logos.
  2378. % @@ prints an @.
  2379. \def\@{\char64 }
  2380. % Used to generate quoted braces.  Unless we're in typewriter, use
  2381. % \ecfont because the CM text fonts do not have braces, and we don't
  2382. % want to switch into math.
  2383. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
  2384. \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
  2385. \let\{=\mylbrace
  2386. \let\}=\myrbrace
  2387. \begingroup
  2388.   % Definitions to produce \{ and \} commands for indices,
  2389.   % and @{ and @} for the aux/toc files.
  2390.   \catcode`\{ = \other \catcode`\} = \other
  2391.   \catcode`\[ = 1 \catcode`\] = 2
  2392.   \catcode`\! = 0 \catcode`\\ = \other
  2393.   !gdef!lbracecmd[\{]%
  2394.   !gdef!rbracecmd[\}]%
  2395.   !gdef!lbraceatcmd[@{]%
  2396.   !gdef!rbraceatcmd[@}]%
  2397. !endgroup
  2398. % @comma{} to avoid , parsing problems.
  2399. \let\comma = ,
  2400. % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
  2401. % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
  2402. \let\, = \ptexc
  2403. \let\dotaccent = \ptexdot
  2404. \def\ringaccent#1{{\accent23 #1}}
  2405. \let\tieaccent = \ptext
  2406. \let\ubaraccent = \ptexb
  2407. \let\udotaccent = \d
  2408. % Other special characters: @questiondown @exclamdown @ordf @ordm
  2409. % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
  2410. \def\questiondown{?`}
  2411. \def\exclamdown{!`}
  2412. \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
  2413. \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
  2414. % Dotless i and dotless j, used for accents.
  2415. \def\imacro{i}
  2416. \def\jmacro{j}
  2417. \def\dotless#1{%
  2418.   \def\temp{#1}%
  2419.   \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
  2420.   \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
  2421.   \else \errmessage{@dotless can be used only with i or j}%
  2422.   \fi\fi
  2423. % The \TeX{} logo, as in plain, but resetting the spacing so that a
  2424. % period following counts as ending a sentence.  (Idea found in latex.)
  2425. \edef\TeX{\TeX \spacefactor=1000 }
  2426. % @LaTeX{} logo.  Not quite the same results as the definition in
  2427. % latex.ltx, since we use a different font for the raised A; it's most
  2428. % convenient for us to use an explicitly smaller font, rather than using
  2429. % the \scriptstyle font (since we don't reset \scriptstyle and
  2430. % \scriptscriptstyle).
  2431. \def\LaTeX{%
  2432.   L\kern-.36em
  2433.   {\setbox0=\hbox{T}%
  2434.    \vbox to \ht0{\hbox{%
  2435.      \ifx\textnominalsize\xwordpt
  2436.        % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
  2437.        % Revert to plain's \scriptsize, which is 7pt.
  2438.        \count255=\the\fam $\fam\count255 \scriptstyle A$%
  2439.      \else
  2440.        % For 11pt, we can use our lllsize.
  2441.        \selectfonts\lllsize A%
  2442.      \fi
  2443.      }%
  2444.      \vss
  2445.   }}%
  2446.   \kern-.15em
  2447.   \TeX
  2448. % Some math mode symbols.
  2449. \def\bullet{$\ptexbullet$}
  2450. \def\geq{\ifmmode \ge\else $\ge$\fi}
  2451. \def\leq{\ifmmode \le\else $\le$\fi}
  2452. \def\minus{\ifmmode -\else $-$\fi}
  2453. % @dots{} outputs an ellipsis using the current font.
  2454. % We do .5em per period so that it has the same spacing in the cm
  2455. % typewriter fonts as three actual period characters; on the other hand,
  2456. % in other typewriter fonts three periods are wider than 1.5em.  So do
  2457. % whichever is larger.
  2458. \def\dots{%
  2459.   \leavevmode
  2460.   \setbox0=\hbox{...}% get width of three periods
  2461.   \ifdim\wd0 > 1.5em
  2462.     \dimen0 = \wd0
  2463.   \else
  2464.     \dimen0 = 1.5em
  2465.   \fi
  2466.   \hbox to \dimen0{%
  2467.     \hskip 0pt plus.25fil
  2468.     .\hskip 0pt plus1fil
  2469.     .\hskip 0pt plus1fil
  2470.     .\hskip 0pt plus.5fil
  2471. % @enddots{} is an end-of-sentence ellipsis.
  2472. \def\enddots{%
  2473.   \dots
  2474.   \spacefactor=\endofsentencespacefactor
  2475. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
  2476. % Since these characters are used in examples, they should be an even number of
  2477. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  2478. \def\point{$\star$}
  2479. \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
  2480. \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  2481. \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
  2482. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  2483. \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  2484. % The @error{} command.
  2485. % Adapted from the TeXbook's \boxit.
  2486. \newbox\errorbox
  2487. {\tentt \global\dimen0 = 3em}% Width of the box.
  2488. \dimen2 = .55pt % Thickness of rules
  2489. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  2490. \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
  2491. \setbox\errorbox=\hbox to \dimen0{\hfil
  2492.    \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  2493.    \advance\hsize by -2\dimen2 % Rules.
  2494.    \vbox{%
  2495.       \hrule height\dimen2
  2496.       \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
  2497.          \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  2498.          \kern3pt\vrule width\dimen2}% Space to right.
  2499.       \hrule height\dimen2}
  2500.     \hfil}
  2501. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  2502. % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
  2503. \def\pounds{{\it\$}}
  2504. % @euro{} comes from a separate font, depending on the current style.
  2505. % We use the free feym* fonts from the eurosym package by Henrik
  2506. % Theiling, which support regular, slanted, bold and bold slanted (and
  2507. % "outlined" (blackboard board, sort of) versions, which we don't need).
  2508. % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
  2509. % Although only regular is the truly official Euro symbol, we ignore
  2510. % that.  The Euro is designed to be slightly taller than the regular
  2511. % font height.
  2512. % feymr - regular
  2513. % feymo - slanted
  2514. % feybr - bold
  2515. % feybo - bold slanted
  2516. % There is no good (free) typewriter version, to my knowledge.
  2517. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
  2518. % Hmm.
  2519. % Also doesn't work in math.  Do we need to do math with euro symbols?
  2520. % Hope not.
  2521. \def\euro{{\eurofont e}}
  2522. \def\eurofont{%
  2523.   % We set the font at each command, rather than predefining it in
  2524.   % \textfonts and the other font-switching commands, so that
  2525.   % installations which never need the symbol don't have to have the
  2526.   % font installed.
  2527.   % There is only one designed size (nominal 10pt), so we always scale
  2528.   % that to the current nominal size.
  2529.   % By the way, simply using "at 1em" works for cmr10 and the like, but
  2530.   % does not work for cmbx10 and other extended/shrunken fonts.
  2531.   \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
  2532.   \ifx\curfontstyle\bfstylename
  2533.     % bold:
  2534.     \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
  2535.   \else
  2536.     % regular:
  2537.     \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
  2538.   \fi
  2539.   \thiseurofont
  2540. % Glyphs from the EC fonts.  We don't use \let for the aliases, because
  2541. % sometimes we redefine the original macro, and the alias should reflect
  2542. % the redefinition.
  2543. % Use LaTeX names for the Icelandic letters.
  2544. \def\DH{{\ecfont \char"D0}} % Eth
  2545. \def\dh{{\ecfont \char"F0}} % eth
  2546. \def\TH{{\ecfont \char"DE}} % Thorn
  2547. \def\th{{\ecfont \char"FE}} % thorn
  2548. \def\guillemetleft{{\ecfont \char"13}}
  2549. \def\guillemotleft{\guillemetleft}
  2550. \def\guillemetright{{\ecfont \char"14}}
  2551. \def\guillemotright{\guillemetright}
  2552. \def\guilsinglleft{{\ecfont \char"0E}}
  2553. \def\guilsinglright{{\ecfont \char"0F}}
  2554. \def\quotedblbase{{\ecfont \char"12}}
  2555. \def\quotesinglbase{{\ecfont \char"0D}}
  2556. % This positioning is not perfect (see the ogonek LaTeX package), but
  2557. % we have the precomposed glyphs for the most common cases.  We put the
  2558. % tests to use those glyphs in the single \ogonek macro so we have fewer
  2559. % dummy definitions to worry about for index entries, etc.
  2560. % ogonek is also used with other letters in Lithuanian (IOU), but using
  2561. % the precomposed glyphs for those is not so easy since they aren't in
  2562. % the same EC font.
  2563. \def\ogonek#1{{%
  2564.   \def\temp{#1}%
  2565.   \ifx\temp\macrocharA\Aogonek
  2566.   \else\ifx\temp\macrochara\aogonek
  2567.   \else\ifx\temp\macrocharE\Eogonek
  2568.   \else\ifx\temp\macrochare\eogonek
  2569.   \else
  2570.     \ecfont \setbox0=\hbox{#1}%
  2571.     \ifdim\ht0=1ex\accent"0C #1%
  2572.     \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
  2573.     \fi
  2574.   \fi\fi\fi\fi
  2575. \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
  2576. \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
  2577. \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
  2578. \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
  2579. % Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
  2580. \def\ecfont{%
  2581.   % We can't distinguish serif/sans and italic/slanted, but this
  2582.   % is used for crude hacks anyway (like adding French and German
  2583.   % quotes to documents typeset with CM, where we lose kerning), so
  2584.   % hopefully nobody will notice/care.
  2585.   \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
  2586.   \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
  2587.   \ifx\curfontstyle\bfstylename
  2588.     % bold:
  2589.     \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
  2590.   \else
  2591.     % regular:
  2592.     \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
  2593.   \fi
  2594.   \thisecfont
  2595. % @registeredsymbol - R in a circle.  The font for the R should really
  2596. % be smaller yet, but lllsize is the best we can do for now.
  2597. % Adapted from the plain.tex definition of \copyright.
  2598. \def\registeredsymbol{%
  2599.   $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
  2600.                \hfil\crcr\Orb}}%
  2601.     }$%
  2602. % @textdegree - the normal degrees sign.
  2603. \def\textdegree{$^\circ$}
  2604. % Laurent Siebenmann reports \Orb undefined with:
  2605. %  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
  2606. % so we'll define it if necessary.
  2607. \ifx\Orb\thisisundefined
  2608. \def\Orb{\mathhexbox20D}
  2609. % Quotes.
  2610. \chardef\quotedblleft="5C
  2611. \chardef\quotedblright=`\"
  2612. \chardef\quoteleft=`\`
  2613. \chardef\quoteright=`\'
  2614. \message{page headings,}
  2615. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  2616. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  2617. % First the title page.  Must do @settitle before @titlepage.
  2618. \newif\ifseenauthor
  2619. \newif\iffinishedtitlepage
  2620. % Do an implicit @contents or @shortcontents after @end titlepage if the
  2621. % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
  2622. \newif\ifsetcontentsaftertitlepage
  2623.  \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
  2624. \newif\ifsetshortcontentsaftertitlepage
  2625.  \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
  2626. \parseargdef\shorttitlepage{%
  2627.   \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
  2628.   \endgroup\page\hbox{}\page}
  2629. \envdef\titlepage{%
  2630.   % Open one extra group, as we want to close it in the middle of \Etitlepage.
  2631.   \begingroup
  2632.     \parindent=0pt \textfonts
  2633.     % Leave some space at the very top of the page.
  2634.     \vglue\titlepagetopglue
  2635.     % No rule at page bottom unless we print one at the top with @title.
  2636.     \finishedtitlepagetrue
  2637.     %
  2638.     % Most title ``pages'' are actually two pages long, with space
  2639.     % at the top of the second.  We don't want the ragged left on the second.
  2640.     \let\oldpage = \page
  2641.     \def\page{%
  2642.       \iffinishedtitlepage\else
  2643.      \finishtitlepage
  2644.       \fi
  2645.       \let\page = \oldpage
  2646.       \page
  2647.       \null
  2648.     }%
  2649. \def\Etitlepage{%
  2650.     \iffinishedtitlepage\else
  2651.     \finishtitlepage
  2652.     \fi
  2653.     % It is important to do the page break before ending the group,
  2654.     % because the headline and footline are only empty inside the group.
  2655.     % If we use the new definition of \page, we always get a blank page
  2656.     % after the title page, which we certainly don't want.
  2657.     \oldpage
  2658.   \endgroup
  2659.   % Need this before the \...aftertitlepage checks so that if they are
  2660.   % in effect the toc pages will come out with page numbers.
  2661.   \HEADINGSon
  2662.   % If they want short, they certainly want long too.
  2663.   \ifsetshortcontentsaftertitlepage
  2664.     \shortcontents
  2665.     \contents
  2666.     \global\let\shortcontents = \relax
  2667.     \global\let\contents = \relax
  2668.   \fi
  2669.   \ifsetcontentsaftertitlepage
  2670.     \contents
  2671.     \global\let\contents = \relax
  2672.     \global\let\shortcontents = \relax
  2673.   \fi
  2674. \def\finishtitlepage{%
  2675.   \vskip4pt \hrule height 2pt width \hsize
  2676.   \vskip\titlepagebottomglue
  2677.   \finishedtitlepagetrue
  2678. % Macros to be used within @titlepage:
  2679. \let\subtitlerm=\tenrm
  2680. \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
  2681. \parseargdef\title{%
  2682.   \checkenv\titlepage
  2683.   \leftline{\titlefonts\rmisbold #1}
  2684.   % print a rule at the page bottom also.
  2685.   \finishedtitlepagefalse
  2686.   \vskip4pt \hrule height 4pt width \hsize \vskip4pt
  2687. \parseargdef\subtitle{%
  2688.   \checkenv\titlepage
  2689.   {\subtitlefont \rightline{#1}}%
  2690. % @author should come last, but may come many times.
  2691. % It can also be used inside @quotation.
  2692. \parseargdef\author{%
  2693.   \def\temp{\quotation}%
  2694.   \ifx\thisenv\temp
  2695.     \def\quotationauthor{#1}% printed in \Equotation.
  2696.   \else
  2697.     \checkenv\titlepage
  2698.     \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
  2699.     {\secfonts\rmisbold \leftline{#1}}%
  2700.   \fi
  2701. % Set up page headings and footings.
  2702. \let\thispage=\folio
  2703. \newtoks\evenheadline    % headline on even pages
  2704. \newtoks\oddheadline     % headline on odd pages
  2705. \newtoks\evenfootline    % footline on even pages
  2706. \newtoks\oddfootline     % footline on odd pages
  2707. % Now make TeX use those variables
  2708. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  2709.                             \else \the\evenheadline \fi}}
  2710. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  2711.                             \else \the\evenfootline \fi}\HEADINGShook}
  2712. \let\HEADINGShook=\relax
  2713. % Commands to set those variables.
  2714. % For example, this is what  @headings on  does
  2715. % @evenheading @thistitle|@thispage|@thischapter
  2716. % @oddheading @thischapter|@thispage|@thistitle
  2717. % @evenfooting @thisfile||
  2718. % @oddfooting ||@thisfile
  2719. \def\evenheading{\parsearg\evenheadingxxx}
  2720. \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
  2721. \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
  2722. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  2723. \def\oddheading{\parsearg\oddheadingxxx}
  2724. \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
  2725. \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
  2726. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  2727. \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
  2728. \def\evenfooting{\parsearg\evenfootingxxx}
  2729. \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
  2730. \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
  2731. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  2732. \def\oddfooting{\parsearg\oddfootingxxx}
  2733. \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
  2734. \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
  2735.   \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
  2736.   % Leave some space for the footline.  Hopefully ok to assume
  2737.   % @evenfooting will not be used by itself.
  2738.   \global\advance\pageheight by -12pt
  2739.   \global\advance\vsize by -12pt
  2740. \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
  2741. % @evenheadingmarks top     \thischapter <- chapter at the top of a page
  2742. % @evenheadingmarks bottom  \thischapter <- chapter at the bottom of a page
  2743. % The same set of arguments for:
  2744. % @oddheadingmarks
  2745. % @evenfootingmarks
  2746. % @oddfootingmarks
  2747. % @everyheadingmarks
  2748. % @everyfootingmarks
  2749. \def\evenheadingmarks{\headingmarks{even}{heading}}
  2750. \def\oddheadingmarks{\headingmarks{odd}{heading}}
  2751. \def\evenfootingmarks{\headingmarks{even}{footing}}
  2752. \def\oddfootingmarks{\headingmarks{odd}{footing}}
  2753. \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
  2754.                           \headingmarks{odd}{heading}{#1} }
  2755. \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
  2756.                           \headingmarks{odd}{footing}{#1} }
  2757. % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
  2758. \def\headingmarks#1#2#3 {%
  2759.   \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
  2760.   \global\expandafter\let\csname get#1#2marks\endcsname \temp
  2761. \everyheadingmarks bottom
  2762. \everyfootingmarks bottom
  2763. % @headings double      turns headings on for double-sided printing.
  2764. % @headings single      turns headings on for single-sided printing.
  2765. % @headings off         turns them off.
  2766. % @headings on          same as @headings double, retained for compatibility.
  2767. % @headings after       turns on double-sided headings after this page.
  2768. % @headings doubleafter turns on double-sided headings after this page.
  2769. % @headings singleafter turns on single-sided headings after this page.
  2770. % By default, they are off at the start of a document,
  2771. % and turned `on' after @end titlepage.
  2772. \def\headings #1 {\csname HEADINGS#1\endcsname}
  2773. \def\headingsoff{% non-global headings elimination
  2774.   \evenheadline={\hfil}\evenfootline={\hfil}%
  2775.    \oddheadline={\hfil}\oddfootline={\hfil}%
  2776. \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
  2777. \HEADINGSoff  % it's the default
  2778. % When we turn headings on, set the page number to 1.
  2779. % For double-sided printing, put current file name in lower left corner,
  2780. % chapter name on inside top of right hand pages, document
  2781. % title on inside top of left hand pages, and page numbers on outside top
  2782. % edge of all pages.
  2783. \def\HEADINGSdouble{%
  2784. \global\pageno=1
  2785. \global\evenfootline={\hfil}
  2786. \global\oddfootline={\hfil}
  2787. \global\evenheadline={\line{\folio\hfil\thistitle}}
  2788. \global\oddheadline={\line{\thischapter\hfil\folio}}
  2789. \global\let\contentsalignmacro = \chapoddpage
  2790. \let\contentsalignmacro = \chappager
  2791. % For single-sided printing, chapter title goes across top left of page,
  2792. % page number on top right.
  2793. \def\HEADINGSsingle{%
  2794. \global\pageno=1
  2795. \global\evenfootline={\hfil}
  2796. \global\oddfootline={\hfil}
  2797. \global\evenheadline={\line{\thischapter\hfil\folio}}
  2798. \global\oddheadline={\line{\thischapter\hfil\folio}}
  2799. \global\let\contentsalignmacro = \chappager
  2800. \def\HEADINGSon{\HEADINGSdouble}
  2801. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  2802. \let\HEADINGSdoubleafter=\HEADINGSafter
  2803. \def\HEADINGSdoublex{%
  2804. \global\evenfootline={\hfil}
  2805. \global\oddfootline={\hfil}
  2806. \global\evenheadline={\line{\folio\hfil\thistitle}}
  2807. \global\oddheadline={\line{\thischapter\hfil\folio}}
  2808. \global\let\contentsalignmacro = \chapoddpage
  2809. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  2810. \def\HEADINGSsinglex{%
  2811. \global\evenfootline={\hfil}
  2812. \global\oddfootline={\hfil}
  2813. \global\evenheadline={\line{\thischapter\hfil\folio}}
  2814. \global\oddheadline={\line{\thischapter\hfil\folio}}
  2815. \global\let\contentsalignmacro = \chappager
  2816. % Subroutines used in generating headings
  2817. % This produces Day Month Year style of output.
  2818. % Only define if not already defined, in case a txi-??.tex file has set
  2819. % up a different format (e.g., txi-cs.tex does this).
  2820. \ifx\today\thisisundefined
  2821. \def\today{%
  2822.   \number\day\space
  2823.   \ifcase\month
  2824.   \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
  2825.   \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
  2826.   \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
  2827.   \fi
  2828.   \space\number\year}
  2829. % @settitle line...  specifies the title of the document, for headings.
  2830. % It generates no output of its own.
  2831. \def\thistitle{\putwordNoTitle}
  2832. \def\settitle{\parsearg{\gdef\thistitle}}
  2833. \message{tables,}
  2834. % Tables -- @table, @ftable, @vtable, @item(x).
  2835. % default indentation of table text
  2836. \newdimen\tableindent \tableindent=.8in
  2837. % default indentation of @itemize and @enumerate text
  2838. \newdimen\itemindent  \itemindent=.3in
  2839. % margin between end of table item and start of table text.
  2840. \newdimen\itemmargin  \itemmargin=.1in
  2841. % used internally for \itemindent minus \itemmargin
  2842. \newdimen\itemmax
  2843. % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
  2844. % these defs.
  2845. % They also define \itemindex
  2846. % to index the item name in whatever manner is desired (perhaps none).
  2847. \newif\ifitemxneedsnegativevskip
  2848. \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
  2849. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  2850. \def\internalBitemx{\itemxpar \parsearg\itemzzz}
  2851. \def\itemzzz #1{\begingroup %
  2852.   \advance\hsize by -\rightskip
  2853.   \advance\hsize by -\tableindent
  2854.   \setbox0=\hbox{\itemindicate{#1}}%
  2855.   \itemindex{#1}%
  2856.   \nobreak % This prevents a break before @itemx.
  2857.   % If the item text does not fit in the space we have, put it on a line
  2858.   % by itself, and do not allow a page break either before or after that
  2859.   % line.  We do not start a paragraph here because then if the next
  2860.   % command is, e.g., @kindex, the whatsit would get put into the
  2861.   % horizontal list on a line by itself, resulting in extra blank space.
  2862.   \ifdim \wd0>\itemmax
  2863.     %
  2864.     % Make this a paragraph so we get the \parskip glue and wrapping,
  2865.     % but leave it ragged-right.
  2866.     \begingroup
  2867.       \advance\leftskip by-\tableindent
  2868.       \advance\hsize by\tableindent
  2869.       \advance\rightskip by0pt plus1fil\relax
  2870.       \leavevmode\unhbox0\par
  2871.     \endgroup
  2872.     %
  2873.     % We're going to be starting a paragraph, but we don't want the
  2874.     % \parskip glue -- logically it's part of the @item we just started.
  2875.     \nobreak \vskip-\parskip
  2876.     %
  2877.     % Stop a page break at the \parskip glue coming up.  However, if
  2878.     % what follows is an environment such as @example, there will be no
  2879.     % \parskip glue; then the negative vskip we just inserted would
  2880.     % cause the example and the item to crash together.  So we use this
  2881.     % bizarre value of 10001 as a signal to \aboveenvbreak to insert
  2882.     % \parskip glue after all.  Section titles are handled this way also.
  2883.     %
  2884.     \penalty 10001
  2885.     \endgroup
  2886.     \itemxneedsnegativevskipfalse
  2887.   \else
  2888.     % The item text fits into the space.  Start a paragraph, so that the
  2889.     % following text (if any) will end up on the same line.
  2890.     \noindent
  2891.     % Do this with kerns and \unhbox so that if there is a footnote in
  2892.     % the item text, it can migrate to the main vertical list and
  2893.     % eventually be printed.
  2894.     \nobreak\kern-\tableindent
  2895.     \dimen0 = \itemmax  \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
  2896.     \unhbox0
  2897.     \nobreak\kern\dimen0
  2898.     \endgroup
  2899.     \itemxneedsnegativevskiptrue
  2900.   \fi
  2901. \def\item{\errmessage{@item while not in a list environment}}
  2902. \def\itemx{\errmessage{@itemx while not in a list environment}}
  2903. % @table, @ftable, @vtable.
  2904. \envdef\table{%
  2905.   \let\itemindex\gobble
  2906.   \tablecheck{table}%
  2907. \envdef\ftable{%
  2908.   \def\itemindex ##1{\doind {fn}{\code{##1}}}%
  2909.   \tablecheck{ftable}%
  2910. \envdef\vtable{%
  2911.   \def\itemindex ##1{\doind {vr}{\code{##1}}}%
  2912.   \tablecheck{vtable}%
  2913. \def\tablecheck#1{%
  2914.   \ifnum \the\catcode`\^^M=\active
  2915.     \endgroup
  2916.     \errmessage{This command won't work in this context; perhaps the problem is
  2917.       that we are \inenvironment\thisenv}%
  2918.     \def\next{\doignore{#1}}%
  2919.   \else
  2920.     \let\next\tablex
  2921.   \fi
  2922.   \next
  2923. \def\tablex#1{%
  2924.   \def\itemindicate{#1}%
  2925.   \parsearg\tabley
  2926. \def\tabley#1{%
  2927.     \makevalueexpandable
  2928.     \edef\temp{\noexpand\tablez #1\space\space\space}%
  2929.     \expandafter
  2930.   }\temp \endtablez
  2931. \def\tablez #1 #2 #3 #4\endtablez{%
  2932.   \aboveenvbreak
  2933.   \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
  2934.   \ifnum 0#2>0 \tableindent=#2\mil \fi
  2935.   \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
  2936.   \itemmax=\tableindent
  2937.   \advance \itemmax by -\itemmargin
  2938.   \advance \leftskip by \tableindent
  2939.   \exdentamount=\tableindent
  2940.   \parindent = 0pt
  2941.   \parskip = \smallskipamount
  2942.   \ifdim \parskip=0pt \parskip=2pt \fi
  2943.   \let\item = \internalBitem
  2944.   \let\itemx = \internalBitemx
  2945. \def\Etable{\endgraf\afterenvbreak}
  2946. \let\Eftable\Etable
  2947. \let\Evtable\Etable
  2948. \let\Eitemize\Etable
  2949. \let\Eenumerate\Etable
  2950. % This is the counter used by @enumerate, which is really @itemize
  2951. \newcount \itemno
  2952. \envdef\itemize{\parsearg\doitemize}
  2953. \def\doitemize#1{%
  2954.   \aboveenvbreak
  2955.   \itemmax=\itemindent
  2956.   \advance\itemmax by -\itemmargin
  2957.   \advance\leftskip by \itemindent
  2958.   \exdentamount=\itemindent
  2959.   \parindent=0pt
  2960.   \parskip=\smallskipamount
  2961.   \ifdim\parskip=0pt \parskip=2pt \fi
  2962.   % Try typesetting the item mark that if the document erroneously says
  2963.   % something like @itemize @samp (intending @table), there's an error
  2964.   % right away at the @itemize.  It's not the best error message in the
  2965.   % world, but it's better than leaving it to the @item.  This means if
  2966.   % the user wants an empty mark, they have to say @w{} not just @w.
  2967.   \def\itemcontents{#1}%
  2968.   \setbox0 = \hbox{\itemcontents}%
  2969.   % @itemize with no arg is equivalent to @itemize @bullet.
  2970.   \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
  2971.   \let\item=\itemizeitem
  2972. % Definition of @item while inside @itemize and @enumerate.
  2973. \def\itemizeitem{%
  2974.   \advance\itemno by 1  % for enumerations
  2975.   {\let\par=\endgraf \smallbreak}% reasonable place to break
  2976.    % If the document has an @itemize directly after a section title, a
  2977.    % \nobreak will be last on the list, and \sectionheading will have
  2978.    % done a \vskip-\parskip.  In that case, we don't want to zero
  2979.    % parskip, or the item text will crash with the heading.  On the
  2980.    % other hand, when there is normal text preceding the item (as there
  2981.    % usually is), we do want to zero parskip, or there would be too much
  2982.    % space.  In that case, we won't have a \nobreak before.  At least
  2983.    % that's the theory.
  2984.    \ifnum\lastpenalty<10000 \parskip=0in \fi
  2985.    \noindent
  2986.    \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
  2987.    \vadjust{\penalty 1200}}% not good to break after first line of item.
  2988.   \flushcr
  2989. % \splitoff TOKENS\endmark defines \first to be the first token in
  2990. % TOKENS, and \rest to be the remainder.
  2991. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  2992. % Allow an optional argument of an uppercase letter, lowercase letter,
  2993. % or number, to specify the first label in the enumerated list.  No
  2994. % argument is the same as `1'.
  2995. \envparseargdef\enumerate{\enumeratey #1  \endenumeratey}
  2996. \def\enumeratey #1 #2\endenumeratey{%
  2997.   % If we were given no argument, pretend we were given `1'.
  2998.   \def\thearg{#1}%
  2999.   \ifx\thearg\empty \def\thearg{1}\fi
  3000.   % Detect if the argument is a single token.  If so, it might be a
  3001.   % letter.  Otherwise, the only valid thing it can be is a number.
  3002.   % (We will always have one token, because of the test we just made.
  3003.   % This is a good thing, since \splitoff doesn't work given nothing at
  3004.   % all -- the first parameter is undelimited.)
  3005.   \expandafter\splitoff\thearg\endmark
  3006.   \ifx\rest\empty
  3007.     % Only one token in the argument.  It could still be anything.
  3008.     % A ``lowercase letter'' is one whose \lccode is nonzero.
  3009.     % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  3010.     %   not equal to itself.
  3011.     % Otherwise, we assume it's a number.
  3012.     %
  3013.     % We need the \relax at the end of the \ifnum lines to stop TeX from
  3014.     % continuing to look for a <number>.
  3015.     %
  3016.     \ifnum\lccode\expandafter`\thearg=0\relax
  3017.       \numericenumerate % a number (we hope)
  3018.     \else
  3019.       % It's a letter.
  3020.       \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  3021.         \lowercaseenumerate % lowercase letter
  3022.       \else
  3023.         \uppercaseenumerate % uppercase letter
  3024.       \fi
  3025.     \fi
  3026.   \else
  3027.     % Multiple tokens in the argument.  We hope it's a number.
  3028.     \numericenumerate
  3029.   \fi
  3030. % An @enumerate whose labels are integers.  The starting integer is
  3031. % given in \thearg.
  3032. \def\numericenumerate{%
  3033.   \itemno = \thearg
  3034.   \startenumeration{\the\itemno}%
  3035. % The starting (lowercase) letter is in \thearg.
  3036. \def\lowercaseenumerate{%
  3037.   \itemno = \expandafter`\thearg
  3038.   \startenumeration{%
  3039.     % Be sure we're not beyond the end of the alphabet.
  3040.     \ifnum\itemno=0
  3041.       \errmessage{No more lowercase letters in @enumerate; get a bigger
  3042.                   alphabet}%
  3043.     \fi
  3044.     \char\lccode\itemno
  3045. % The starting (uppercase) letter is in \thearg.
  3046. \def\uppercaseenumerate{%
  3047.   \itemno = \expandafter`\thearg
  3048.   \startenumeration{%
  3049.     % Be sure we're not beyond the end of the alphabet.
  3050.     \ifnum\itemno=0
  3051.       \errmessage{No more uppercase letters in @enumerate; get a bigger
  3052.                   alphabet}
  3053.     \fi
  3054.     \char\uccode\itemno
  3055. % Call \doitemize, adding a period to the first argument and supplying the
  3056. % common last two arguments.  Also subtract one from the initial value in
  3057. % \itemno, since @item increments \itemno.
  3058. \def\startenumeration#1{%
  3059.   \advance\itemno by -1
  3060.   \doitemize{#1.}\flushcr
  3061. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  3062. % to @enumerate.
  3063. \def\alphaenumerate{\enumerate{a}}
  3064. \def\capsenumerate{\enumerate{A}}
  3065. \def\Ealphaenumerate{\Eenumerate}
  3066. \def\Ecapsenumerate{\Eenumerate}
  3067. % @multitable macros
  3068. % Amy Hendrickson, 8/18/94, 3/6/96
  3069. % @multitable ... @end multitable will make as many columns as desired.
  3070. % Contents of each column will wrap at width given in preamble.  Width
  3071. % can be specified either with sample text given in a template line,
  3072. % or in percent of \hsize, the current width of text on page.
  3073. % Table can continue over pages but will only break between lines.
  3074. % To make preamble:
  3075. % Either define widths of columns in terms of percent of \hsize:
  3076. %   @multitable @columnfractions .25 .3 .45
  3077. %   @item ...
  3078. %   Numbers following @columnfractions are the percent of the total
  3079. %   current hsize to be used for each column. You may use as many
  3080. %   columns as desired.
  3081. % Or use a template:
  3082. %   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3083. %   @item ...
  3084. %   using the widest term desired in each column.
  3085. % Each new table line starts with @item, each subsequent new column
  3086. % starts with @tab. Empty columns may be produced by supplying @tab's
  3087. % with nothing between them for as many times as empty columns are needed,
  3088. % ie, @tab@tab@tab will produce two empty columns.
  3089. % @item, @tab do not need to be on their own lines, but it will not hurt
  3090. % if they are.
  3091. % Sample multitable:
  3092. %   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3093. %   @item first col stuff @tab second col stuff @tab third col
  3094. %   @item
  3095. %   first col stuff
  3096. %   @tab
  3097. %   second col stuff
  3098. %   @tab
  3099. %   third col
  3100. %   @item first col stuff @tab second col stuff
  3101. %   @tab Many paragraphs of text may be used in any column.
  3102. %         They will wrap at the width determined by the template.
  3103. %   @item@tab@tab This will be in third column.
  3104. %   @end multitable
  3105. % Default dimensions may be reset by user.
  3106. % @multitableparskip is vertical space between paragraphs in table.
  3107. % @multitableparindent is paragraph indent in table.
  3108. % @multitablecolmargin is horizontal space to be left between columns.
  3109. % @multitablelinespace is space to leave between table items, baseline
  3110. %                                                            to baseline.
  3111. %   0pt means it depends on current normal line spacing.
  3112. \newskip\multitableparskip
  3113. \newskip\multitableparindent
  3114. \newdimen\multitablecolspace
  3115. \newskip\multitablelinespace
  3116. \multitableparskip=0pt
  3117. \multitableparindent=6pt
  3118. \multitablecolspace=12pt
  3119. \multitablelinespace=0pt
  3120. % Macros used to set up halign preamble:
  3121. \let\endsetuptable\relax
  3122. \def\xendsetuptable{\endsetuptable}
  3123. \let\columnfractions\relax
  3124. \def\xcolumnfractions{\columnfractions}
  3125. \newif\ifsetpercent
  3126. % #1 is the @columnfraction, usually a decimal number like .5, but might
  3127. % be just 1.  We just use it, whatever it is.
  3128. \def\pickupwholefraction#1 {%
  3129.   \global\advance\colcount by 1
  3130.   \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
  3131.   \setuptable
  3132. \newcount\colcount
  3133. \def\setuptable#1{%
  3134.   \def\firstarg{#1}%
  3135.   \ifx\firstarg\xendsetuptable
  3136.     \let\go = \relax
  3137.   \else
  3138.     \ifx\firstarg\xcolumnfractions
  3139.       \global\setpercenttrue
  3140.     \else
  3141.       \ifsetpercent
  3142.          \let\go\pickupwholefraction
  3143.       \else
  3144.          \global\advance\colcount by 1
  3145.          \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
  3146.                    % separator; typically that is always in the input, anyway.
  3147.          \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
  3148.       \fi
  3149.     \fi
  3150.     \ifx\go\pickupwholefraction
  3151.       % Put the argument back for the \pickupwholefraction call, so
  3152.       % we'll always have a period there to be parsed.
  3153.       \def\go{\pickupwholefraction#1}%
  3154.     \else
  3155.       \let\go = \setuptable
  3156.     \fi%
  3157.   \fi
  3158.   \go
  3159. % multitable-only commands.
  3160. % @headitem starts a heading row, which we typeset in bold.
  3161. % Assignments have to be global since we are inside the implicit group
  3162. % of an alignment entry.  \everycr resets \everytab so we don't have to
  3163. % undo it ourselves.
  3164. \def\headitemfont{\b}% for people to use in the template row; not changeable
  3165. \def\headitem{%
  3166.   \checkenv\multitable
  3167.   \crcr
  3168.   \global\everytab={\bf}% can't use \headitemfont since the parsing differs
  3169.   \the\everytab % for the first item
  3170. % A \tab used to include \hskip1sp.  But then the space in a template
  3171. % line is not enough.  That is bad.  So let's go back to just `&' until
  3172. % we again encounter the problem the 1sp was intended to solve.
  3173. %                    --karl, nathan@acm.org, 20apr99.
  3174. \def\tab{\checkenv\multitable &\the\everytab}%
  3175. % @multitable ... @end multitable definitions:
  3176. \newtoks\everytab  % insert after every tab.
  3177. \envdef\multitable{%
  3178.   \vskip\parskip
  3179.   \startsavinginserts
  3180.   % @item within a multitable starts a normal row.
  3181.   % We use \def instead of \let so that if one of the multitable entries
  3182.   % contains an @itemize, we don't choke on the \item (seen as \crcr aka
  3183.   % \endtemplate) expanding \doitemize.
  3184.   \def\item{\crcr}%
  3185.   \tolerance=9500
  3186.   \hbadness=9500
  3187.   \setmultitablespacing
  3188.   \parskip=\multitableparskip
  3189.   \parindent=\multitableparindent
  3190.   \overfullrule=0pt
  3191.   \global\colcount=0
  3192.   \everycr = {%
  3193.     \noalign{%
  3194.       \global\everytab={}%
  3195.       \global\colcount=0 % Reset the column counter.
  3196.       % Check for saved footnotes, etc.
  3197.       \checkinserts
  3198.       % Keeps underfull box messages off when table breaks over pages.
  3199.       %\filbreak
  3200.     % Maybe so, but it also creates really weird page breaks when the
  3201.     % table breaks over pages. Wouldn't \vfil be better?  Wait until the
  3202.     % problem manifests itself, so it can be fixed for real --karl.
  3203.     }%
  3204.   \parsearg\domultitable
  3205. \def\domultitable#1{%
  3206.   % To parse everything between @multitable and @item:
  3207.   \setuptable#1 \endsetuptable
  3208.   % This preamble sets up a generic column definition, which will
  3209.   % be used as many times as user calls for columns.
  3210.   % \vtop will set a single line and will also let text wrap and
  3211.   % continue for many paragraphs if desired.
  3212.   \halign\bgroup &%
  3213.     \global\advance\colcount by 1
  3214.     \multistrut
  3215.     \vtop{%
  3216.       % Use the current \colcount to find the correct column width:
  3217.       \hsize=\expandafter\csname col\the\colcount\endcsname
  3218.       %
  3219.       % In order to keep entries from bumping into each other
  3220.       % we will add a \leftskip of \multitablecolspace to all columns after
  3221.       % the first one.
  3222.       %
  3223.       % If a template has been used, we will add \multitablecolspace
  3224.       % to the width of each template entry.
  3225.       %
  3226.       % If the user has set preamble in terms of percent of \hsize we will
  3227.       % use that dimension as the width of the column, and the \leftskip
  3228.       % will keep entries from bumping into each other.  Table will start at
  3229.       % left margin and final column will justify at right margin.
  3230.       %
  3231.       % Make sure we don't inherit \rightskip from the outer environment.
  3232.       \rightskip=0pt
  3233.       \ifnum\colcount=1
  3234.     % The first column will be indented with the surrounding text.
  3235.     \advance\hsize by\leftskip
  3236.       \else
  3237.     \ifsetpercent \else
  3238.       % If user has not set preamble in terms of percent of \hsize
  3239.       % we will advance \hsize by \multitablecolspace.
  3240.       \advance\hsize by \multitablecolspace
  3241.        % In either case we will make \leftskip=\multitablecolspace:
  3242.       \leftskip=\multitablecolspace
  3243.       \fi
  3244.       % Ignoring space at the beginning and end avoids an occasional spurious
  3245.       % blank line, when TeX decides to break the line at the space before the
  3246.       % box from the multistrut, so the strut ends up on a line by itself.
  3247.       % For example:
  3248.       % @multitable @columnfractions .11 .89
  3249.       % @item @code{#}
  3250.       % @tab Legal holiday which is valid in major parts of the whole country.
  3251.       % Is automatically provided with highlighting sequences respectively
  3252.       % marking characters.
  3253.       \noindent\ignorespaces##\unskip\multistrut
  3254.     }\cr
  3255. \def\Emultitable{%
  3256.   \crcr
  3257.   \egroup % end the \halign
  3258.   \global\setpercentfalse
  3259. \def\setmultitablespacing{%
  3260.   \def\multistrut{\strut}% just use the standard line spacing
  3261.   % Compute \multitablelinespace (if not defined by user) for use in
  3262.   % \multitableparskip calculation.  We used define \multistrut based on
  3263.   % this, but (ironically) that caused the spacing to be off.
  3264.   % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
  3265. \ifdim\multitablelinespace=0pt
  3266. \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
  3267. \global\advance\multitablelinespace by-\ht0
  3268. % Test to see if parskip is larger than space between lines of
  3269. % table. If not, do nothing.
  3270. %        If so, set to same dimension as multitablelinespace.
  3271. \ifdim\multitableparskip>\multitablelinespace
  3272. \global\multitableparskip=\multitablelinespace
  3273. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3274.                                       % than skip between lines in the table.
  3275. \ifdim\multitableparskip=0pt
  3276. \global\multitableparskip=\multitablelinespace
  3277. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3278.                                       % than skip between lines in the table.
  3279. \message{conditionals,}
  3280. % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
  3281. % @ifnotxml always succeed.  They currently do nothing; we don't
  3282. % attempt to check whether the conditionals are properly nested.  But we
  3283. % have to remember that they are conditionals, so that @end doesn't
  3284. % attempt to close an environment group.
  3285. \def\makecond#1{%
  3286.   \expandafter\let\csname #1\endcsname = \relax
  3287.   \expandafter\let\csname iscond.#1\endcsname = 1
  3288. \makecond{iftex}
  3289. \makecond{ifnotdocbook}
  3290. \makecond{ifnothtml}
  3291. \makecond{ifnotinfo}
  3292. \makecond{ifnotplaintext}
  3293. \makecond{ifnotxml}
  3294. % Ignore @ignore, @ifhtml, @ifinfo, and the like.
  3295. \def\direntry{\doignore{direntry}}
  3296. \def\documentdescription{\doignore{documentdescription}}
  3297. \def\docbook{\doignore{docbook}}
  3298. \def\html{\doignore{html}}
  3299. \def\ifdocbook{\doignore{ifdocbook}}
  3300. \def\ifhtml{\doignore{ifhtml}}
  3301. \def\ifinfo{\doignore{ifinfo}}
  3302. \def\ifnottex{\doignore{ifnottex}}
  3303. \def\ifplaintext{\doignore{ifplaintext}}
  3304. \def\ifxml{\doignore{ifxml}}
  3305. \def\ignore{\doignore{ignore}}
  3306. \def\menu{\doignore{menu}}
  3307. \def\xml{\doignore{xml}}
  3308. % Ignore text until a line `@end #1', keeping track of nested conditionals.
  3309. % A count to remember the depth of nesting.
  3310. \newcount\doignorecount
  3311. \def\doignore#1{\begingroup
  3312.   % Scan in ``verbatim'' mode:
  3313.   \obeylines
  3314.   \catcode`\@ = \other
  3315.   \catcode`\{ = \other
  3316.   \catcode`\} = \other
  3317.   % Make sure that spaces turn into tokens that match what \doignoretext wants.
  3318.   \spaceisspace
  3319.   % Count number of #1's that we've seen.
  3320.   \doignorecount = 0
  3321.   % Swallow text until we reach the matching `@end #1'.
  3322.   \dodoignore{#1}%
  3323. { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
  3324.   \obeylines %
  3325.   \gdef\dodoignore#1{%
  3326.     % #1 contains the command name as a string, e.g., `ifinfo'.
  3327.     %
  3328.     % Define a command to find the next `@end #1'.
  3329.     \long\def\doignoretext##1^^M@end #1{%
  3330.       \doignoretextyyy##1^^M@#1\_STOP_}%
  3331.     %
  3332.     % And this command to find another #1 command, at the beginning of a
  3333.     % line.  (Otherwise, we would consider a line `@c @ifset', for
  3334.     % example, to count as an @ifset for nesting.)
  3335.     \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
  3336.     %
  3337.     % And now expand that command.
  3338.     \doignoretext ^^M%
  3339. \def\doignoreyyy#1{%
  3340.   \def\temp{#1}%
  3341.   \ifx\temp\empty            % Nothing found.
  3342.     \let\next\doignoretextzzz
  3343.   \else                    % Found a nested condition, ...
  3344.     \advance\doignorecount by 1
  3345.     \let\next\doignoretextyyy        % ..., look for another.
  3346.     % If we're here, #1 ends with ^^M\ifinfo (for example).
  3347.   \fi
  3348.   \next #1% the token \_STOP_ is present just after this macro.
  3349. % We have to swallow the remaining "\_STOP_".
  3350. \def\doignoretextzzz#1{%
  3351.   \ifnum\doignorecount = 0    % We have just found the outermost @end.
  3352.     \let\next\enddoignore
  3353.   \else                % Still inside a nested condition.
  3354.     \advance\doignorecount by -1
  3355.     \let\next\doignoretext      % Look for the next @end.
  3356.   \fi
  3357.   \next
  3358. % Finish off ignored text.
  3359. { \obeylines%
  3360.   % Ignore anything after the last `@end #1'; this matters in verbatim
  3361.   % environments, where otherwise the newline after an ignored conditional
  3362.   % would result in a blank line in the output.
  3363.   \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
  3364. % @set VAR sets the variable VAR to an empty value.
  3365. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
  3366. % Since we want to separate VAR from REST-OF-LINE (which might be
  3367. % empty), we can't just use \parsearg; we have to insert a space of our
  3368. % own to delimit the rest of the line, and then take it out again if we
  3369. % didn't need it.
  3370. % We rely on the fact that \parsearg sets \catcode`\ =10.
  3371. \parseargdef\set{\setyyy#1 \endsetyyy}
  3372. \def\setyyy#1 #2\endsetyyy{%
  3373.     \makevalueexpandable
  3374.     \def\temp{#2}%
  3375.     \edef\next{\gdef\makecsname{SET#1}}%
  3376.     \ifx\temp\empty
  3377.       \next{}%
  3378.     \else
  3379.       \setzzz#2\endsetzzz
  3380.     \fi
  3381. % Remove the trailing space \setxxx inserted.
  3382. \def\setzzz#1 \endsetzzz{\next{#1}}
  3383. % @clear VAR clears (i.e., unsets) the variable VAR.
  3384. \parseargdef\clear{%
  3385.     \makevalueexpandable
  3386.     \global\expandafter\let\csname SET#1\endcsname=\relax
  3387. % @value{foo} gets the text saved in variable foo.
  3388. \def\value{\begingroup\makevalueexpandable\valuexxx}
  3389. \def\valuexxx#1{\expandablevalue{#1}\endgroup}
  3390.   \catcode`\- = \active \catcode`\_ = \active
  3391.   \gdef\makevalueexpandable{%
  3392.     \let\value = \expandablevalue
  3393.     % We don't want these characters active, ...
  3394.     \catcode`\-=\other \catcode`\_=\other
  3395.     % ..., but we might end up with active ones in the argument if
  3396.     % we're called from @code, as @code{@value{foo-bar_}}, though.
  3397.     % So \let them to their normal equivalents.
  3398.     \let-\realdash \let_\normalunderscore
  3399. % We have this subroutine so that we can handle at least some @value's
  3400. % properly in indexes (we call \makevalueexpandable in \indexdummies).
  3401. % The command has to be fully expandable (if the variable is set), since
  3402. % the result winds up in the index file.  This means that if the
  3403. % variable's value contains other Texinfo commands, it's almost certain
  3404. % it will fail (although perhaps we could fix that with sufficient work
  3405. % to do a one-level expansion on the result, instead of complete).
  3406. \def\expandablevalue#1{%
  3407.   \expandafter\ifx\csname SET#1\endcsname\relax
  3408.     {[No value for ``#1'']}%
  3409.     \message{Variable `#1', used in @value, is not set.}%
  3410.   \else
  3411.     \csname SET#1\endcsname
  3412.   \fi
  3413. % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  3414. % with @set.
  3415. % To get special treatment of `@end ifset,' call \makeond and the redefine.
  3416. \makecond{ifset}
  3417. \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
  3418. \def\doifset#1#2{%
  3419.     \makevalueexpandable
  3420.     \let\next=\empty
  3421.     \expandafter\ifx\csname SET#2\endcsname\relax
  3422.       #1% If not set, redefine \next.
  3423.     \fi
  3424.     \expandafter
  3425.   }\next
  3426. \def\ifsetfail{\doignore{ifset}}
  3427. % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
  3428. % defined with @set, or has been undefined with @clear.
  3429. % The `\else' inside the `\doifset' parameter is a trick to reuse the
  3430. % above code: if the variable is not set, do nothing, if it is set,
  3431. % then redefine \next to \ifclearfail.
  3432. \makecond{ifclear}
  3433. \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
  3434. \def\ifclearfail{\doignore{ifclear}}
  3435. % @dircategory CATEGORY  -- specify a category of the dir file
  3436. % which this file should belong to.  Ignore this in TeX.
  3437. \let\dircategory=\comment
  3438. % @defininfoenclose.
  3439. \let\definfoenclose=\comment
  3440. \message{indexing,}
  3441. % Index generation facilities
  3442. % Define \newwrite to be identical to plain tex's \newwrite
  3443. % except not \outer, so it can be used within macros and \if's.
  3444. \edef\newwrite{\makecsname{ptexnewwrite}}
  3445. % \newindex {foo} defines an index named foo.
  3446. % It automatically defines \fooindex such that
  3447. % \fooindex ...rest of line... puts an entry in the index foo.
  3448. % It also defines \fooindfile to be the number of the output channel for
  3449. % the file that accumulates this index.  The file's extension is foo.
  3450. % The name of an index should be no more than 2 characters long
  3451. % for the sake of vms.
  3452. \def\newindex#1{%
  3453.   \iflinks
  3454.     \expandafter\newwrite \csname#1indfile\endcsname
  3455.     \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
  3456.   \fi
  3457.   \expandafter\xdef\csname#1index\endcsname{%     % Define @#1index
  3458.     \noexpand\doindex{#1}}
  3459. % @defindex foo  ==  \newindex{foo}
  3460. \def\defindex{\parsearg\newindex}
  3461. % Define @defcodeindex, like @defindex except put all entries in @code.
  3462. \def\defcodeindex{\parsearg\newcodeindex}
  3463. \def\newcodeindex#1{%
  3464.   \iflinks
  3465.     \expandafter\newwrite \csname#1indfile\endcsname
  3466.     \openout \csname#1indfile\endcsname \jobname.#1
  3467.   \fi
  3468.   \expandafter\xdef\csname#1index\endcsname{%
  3469.     \noexpand\docodeindex{#1}}%
  3470. % @synindex foo bar    makes index foo feed into index bar.
  3471. % Do this instead of @defindex foo if you don't want it as a separate index.
  3472. % @syncodeindex foo bar   similar, but put all entries made for index foo
  3473. % inside @code.
  3474. \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
  3475. \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
  3476. % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
  3477. % #3 the target index (bar).
  3478. \def\dosynindex#1#2#3{%
  3479.   % Only do \closeout if we haven't already done it, else we'll end up
  3480.   % closing the target index.
  3481.   \expandafter \ifx\csname donesynindex#2\endcsname \relax
  3482.     % The \closeout helps reduce unnecessary open files; the limit on the
  3483.     % Acorn RISC OS is a mere 16 files.
  3484.     \expandafter\closeout\csname#2indfile\endcsname
  3485.     \expandafter\let\csname donesynindex#2\endcsname = 1
  3486.   \fi
  3487.   % redefine \fooindfile:
  3488.   \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
  3489.   \expandafter\let\csname#2indfile\endcsname=\temp
  3490.   % redefine \fooindex:
  3491.   \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
  3492. % Define \doindex, the driver for all \fooindex macros.
  3493. % Argument #1 is generated by the calling \fooindex macro,
  3494. %  and it is "foo", the name of the index.
  3495. % \doindex just uses \parsearg; it calls \doind for the actual work.
  3496. % This is because \doind is more useful to call from other macros.
  3497. % There is also \dosubind {index}{topic}{subtopic}
  3498. % which makes an entry in a two-level index such as the operation index.
  3499. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  3500. \def\singleindexer #1{\doind{\indexname}{#1}}
  3501. % like the previous two, but they put @code around the argument.
  3502. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  3503. \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  3504. % Take care of Texinfo commands that can appear in an index entry.
  3505. % Since there are some commands we want to expand, and others we don't,
  3506. % we have to laboriously prevent expansion for those that we don't.
  3507. \def\indexdummies{%
  3508.   \escapechar = `\\     % use backslash in output files.
  3509.   \def\@{@}% change to @@ when we switch to @ as escape char in index files.
  3510.   \def\ {\realbackslash\space }%
  3511.   % Need these unexpandable (because we define \tt as a dummy)
  3512.   % definitions when @{ or @} appear in index entry text.  Also, more
  3513.   % complicated, when \tex is in effect and \{ is a \delimiter again.
  3514.   % We can't use \lbracecmd and \rbracecmd because texindex assumes
  3515.   % braces and backslashes are used only as delimiters.  Perhaps we
  3516.   % should define @lbrace and @rbrace commands a la @comma.
  3517.   \def\{{{\tt\char123}}%
  3518.   \def\}{{\tt\char125}}%
  3519.   % I don't entirely understand this, but when an index entry is
  3520.   % generated from a macro call, the \endinput which \scanmacro inserts
  3521.   % causes processing to be prematurely terminated.  This is,
  3522.   % apparently, because \indexsorttmp is fully expanded, and \endinput
  3523.   % is an expandable command.  The redefinition below makes \endinput
  3524.   % disappear altogether for that purpose -- although logging shows that
  3525.   % processing continues to some further point.  On the other hand, it
  3526.   % seems \endinput does not hurt in the printed index arg, since that
  3527.   % is still getting written without apparent harm.
  3528.   % Sample source (mac-idx3.tex, reported by Graham Percival to
  3529.   % help-texinfo, 22may06):
  3530.   % @macro funindex {WORD}
  3531.   % @findex xyz
  3532.   % @end macro
  3533.   % ...
  3534.   % @funindex commtest
  3535.   % The above is not enough to reproduce the bug, but it gives the flavor.
  3536.   % Sample whatsit resulting:
  3537.   % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
  3538.   % So:
  3539.   \let\endinput = \empty
  3540.   % Do the redefinitions.
  3541.   \commondummies
  3542. % For the aux and toc files, @ is the escape character.  So we want to
  3543. % redefine everything using @ as the escape character (instead of
  3544. % \realbackslash, still used for index files).  When everything uses @,
  3545. % this will be simpler.
  3546. \def\atdummies{%
  3547.   \def\@{@@}%
  3548.   \def\ {@ }%
  3549.   \let\{ = \lbraceatcmd
  3550.   \let\} = \rbraceatcmd
  3551.   % Do the redefinitions.
  3552.   \commondummies
  3553.   \otherbackslash
  3554. % Called from \indexdummies and \atdummies.
  3555. \def\commondummies{%
  3556.   % \definedummyword defines \#1 as \string\#1\space, thus effectively
  3557.   % preventing its expansion.  This is used only for control words,
  3558.   % not control letters, because the \space would be incorrect for
  3559.   % control characters, but is needed to separate the control word
  3560.   % from whatever follows.
  3561.   % For control letters, we have \definedummyletter, which omits the
  3562.   % space.
  3563.   % These can be used both for control words that take an argument and
  3564.   % those that do not.  If it is followed by {arg} in the input, then
  3565.   % that will dutifully get written to the index (or wherever).
  3566.   \def\definedummyword  ##1{\def##1{\string##1\space}}%
  3567.   \def\definedummyletter##1{\def##1{\string##1}}%
  3568.   \let\definedummyaccent\definedummyletter
  3569.   \commondummiesnofonts
  3570.   \definedummyletter\_%
  3571.   \definedummyletter\-%
  3572.   % Non-English letters.
  3573.   \definedummyword\AA
  3574.   \definedummyword\AE
  3575.   \definedummyword\DH
  3576.   \definedummyword\L
  3577.   \definedummyword\O
  3578.   \definedummyword\OE
  3579.   \definedummyword\TH
  3580.   \definedummyword\aa
  3581.   \definedummyword\ae
  3582.   \definedummyword\dh
  3583.   \definedummyword\exclamdown
  3584.   \definedummyword\l
  3585.   \definedummyword\o
  3586.   \definedummyword\oe
  3587.   \definedummyword\ordf
  3588.   \definedummyword\ordm
  3589.   \definedummyword\questiondown
  3590.   \definedummyword\ss
  3591.   \definedummyword\th
  3592.   % Although these internal commands shouldn't show up, sometimes they do.
  3593.   \definedummyword\bf
  3594.   \definedummyword\gtr
  3595.   \definedummyword\hat
  3596.   \definedummyword\less
  3597.   \definedummyword\sf
  3598.   \definedummyword\sl
  3599.   \definedummyword\tclose
  3600.   \definedummyword\tt
  3601.   \definedummyword\LaTeX
  3602.   \definedummyword\TeX
  3603.   % Assorted special characters.
  3604.   \definedummyword\arrow
  3605.   \definedummyword\bullet
  3606.   \definedummyword\comma
  3607.   \definedummyword\copyright
  3608.   \definedummyword\registeredsymbol
  3609.   \definedummyword\dots
  3610.   \definedummyword\enddots
  3611.   \definedummyword\entrybreak
  3612.   \definedummyword\equiv
  3613.   \definedummyword\error
  3614.   \definedummyword\euro
  3615.   \definedummyword\expansion
  3616.   \definedummyword\geq
  3617.   \definedummyword\guillemetleft
  3618.   \definedummyword\guillemetright
  3619.   \definedummyword\guilsinglleft
  3620.   \definedummyword\guilsinglright
  3621.   \definedummyword\leq
  3622.   \definedummyword\minus
  3623.   \definedummyword\ogonek
  3624.   \definedummyword\pounds
  3625.   \definedummyword\point
  3626.   \definedummyword\print
  3627.   \definedummyword\quotedblbase
  3628.   \definedummyword\quotedblleft
  3629.   \definedummyword\quotedblright
  3630.   \definedummyword\quoteleft
  3631.   \definedummyword\quoteright
  3632.   \definedummyword\quotesinglbase
  3633.   \definedummyword\result
  3634.   \definedummyword\textdegree
  3635.   % We want to disable all macros so that they are not expanded by \write.
  3636.   \macrolist
  3637.   \normalturnoffactive
  3638.   % Handle some cases of @value -- where it does not contain any
  3639.   % (non-fully-expandable) commands.
  3640.   \makevalueexpandable
  3641. % \commondummiesnofonts: common to \commondummies and \indexnofonts.
  3642. \def\commondummiesnofonts{%
  3643.   % Control letters and accents.
  3644.   \definedummyletter\!%
  3645.   \definedummyaccent\"%
  3646.   \definedummyaccent\'%
  3647.   \definedummyletter\*%
  3648.   \definedummyaccent\,%
  3649.   \definedummyletter\.%
  3650.   \definedummyletter\/%
  3651.   \definedummyletter\:%
  3652.   \definedummyaccent\=%
  3653.   \definedummyletter\?%
  3654.   \definedummyaccent\^%
  3655.   \definedummyaccent\`%
  3656.   \definedummyaccent\~%
  3657.   \definedummyword\u
  3658.   \definedummyword\v
  3659.   \definedummyword\H
  3660.   \definedummyword\dotaccent
  3661.   \definedummyword\ogonek
  3662.   \definedummyword\ringaccent
  3663.   \definedummyword\tieaccent
  3664.   \definedummyword\ubaraccent
  3665.   \definedummyword\udotaccent
  3666.   \definedummyword\dotless
  3667.   % Texinfo font commands.
  3668.   \definedummyword\b
  3669.   \definedummyword\i
  3670.   \definedummyword\r
  3671.   \definedummyword\sansserif
  3672.   \definedummyword\sc
  3673.   \definedummyword\slanted
  3674.   \definedummyword\t
  3675.   % Commands that take arguments.
  3676.   \definedummyword\acronym
  3677.   \definedummyword\cite
  3678.   \definedummyword\code
  3679.   \definedummyword\command
  3680.   \definedummyword\dfn
  3681.   \definedummyword\dmn
  3682.   \definedummyword\email
  3683.   \definedummyword\emph
  3684.   \definedummyword\env
  3685.   \definedummyword\file
  3686.   \definedummyword\indicateurl
  3687.   \definedummyword\kbd
  3688.   \definedummyword\key
  3689.   \definedummyword\math
  3690.   \definedummyword\option
  3691.   \definedummyword\pxref
  3692.   \definedummyword\ref
  3693.   \definedummyword\samp
  3694.   \definedummyword\strong
  3695.   \definedummyword\tie
  3696.   \definedummyword\uref
  3697.   \definedummyword\url
  3698.   \definedummyword\var
  3699.   \definedummyword\verb
  3700.   \definedummyword\w
  3701.   \definedummyword\xref
  3702. % \indexnofonts is used when outputting the strings to sort the index
  3703. % by, and when constructing control sequence names.  It eliminates all
  3704. % control sequences and just writes whatever the best ASCII sort string
  3705. % would be for a given command (usually its argument).
  3706. \def\indexnofonts{%
  3707.   % Accent commands should become @asis.
  3708.   \def\definedummyaccent##1{\let##1\asis}%
  3709.   % We can just ignore other control letters.
  3710.   \def\definedummyletter##1{\let##1\empty}%
  3711.   % All control words become @asis by default; overrides below.
  3712.   \let\definedummyword\definedummyaccent
  3713.   \commondummiesnofonts
  3714.   % Don't no-op \tt, since it isn't a user-level command
  3715.   % and is used in the definitions of the active chars like <, >, |, etc.
  3716.   % Likewise with the other plain tex font commands.
  3717.   %\let\tt=\asis
  3718.   \def\ { }%
  3719.   \def\@{@}%
  3720.   \def\_{\normalunderscore}%
  3721.   \def\-{}% @- shouldn't affect sorting
  3722.   % Unfortunately, texindex is not prepared to handle braces in the
  3723.   % content at all.  So for index sorting, we map @{ and @} to strings
  3724.   % starting with |, since that ASCII character is between ASCII { and }.
  3725.   \def\{{|a}%
  3726.   \def\}{|b}%
  3727.   % Non-English letters.
  3728.   \def\AA{AA}%
  3729.   \def\AE{AE}%
  3730.   \def\DH{DZZ}%
  3731.   \def\L{L}%
  3732.   \def\OE{OE}%
  3733.   \def\O{O}%
  3734.   \def\TH{ZZZ}%
  3735.   \def\aa{aa}%
  3736.   \def\ae{ae}%
  3737.   \def\dh{dzz}%
  3738.   \def\exclamdown{!}%
  3739.   \def\l{l}%
  3740.   \def\oe{oe}%
  3741.   \def\ordf{a}%
  3742.   \def\ordm{o}%
  3743.   \def\o{o}%
  3744.   \def\questiondown{?}%
  3745.   \def\ss{ss}%
  3746.   \def\th{zzz}%
  3747.   \def\LaTeX{LaTeX}%
  3748.   \def\TeX{TeX}%
  3749.   % Assorted special characters.
  3750.   % (The following {} will end up in the sort string, but that's ok.)
  3751.   \def\arrow{->}%
  3752.   \def\bullet{bullet}%
  3753.   \def\comma{,}%
  3754.   \def\copyright{copyright}%
  3755.   \def\dots{...}%
  3756.   \def\enddots{...}%
  3757.   \def\equiv{==}%
  3758.   \def\error{error}%
  3759.   \def\euro{euro}%
  3760.   \def\expansion{==>}%
  3761.   \def\geq{>=}%
  3762.   \def\guillemetleft{<<}%
  3763.   \def\guillemetright{>>}%
  3764.   \def\guilsinglleft{<}%
  3765.   \def\guilsinglright{>}%
  3766.   \def\leq{<=}%
  3767.   \def\minus{-}%
  3768.   \def\point{.}%
  3769.   \def\pounds{pounds}%
  3770.   \def\print{-|}%
  3771.   \def\quotedblbase{"}%
  3772.   \def\quotedblleft{"}%
  3773.   \def\quotedblright{"}%
  3774.   \def\quoteleft{`}%
  3775.   \def\quoteright{'}%
  3776.   \def\quotesinglbase{,}%
  3777.   \def\registeredsymbol{R}%
  3778.   \def\result{=>}%
  3779.   \def\textdegree{o}%
  3780.   \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
  3781.   \else \indexlquoteignore \fi
  3782.   % We need to get rid of all macros, leaving only the arguments (if present).
  3783.   % Of course this is not nearly correct, but it is the best we can do for now.
  3784.   % makeinfo does not expand macros in the argument to @deffn, which ends up
  3785.   % writing an index entry, and texindex isn't prepared for an index sort entry
  3786.   % that starts with \.
  3787.   % Since macro invocations are followed by braces, we can just redefine them
  3788.   % to take a single TeX argument.  The case of a macro invocation that
  3789.   % goes to end-of-line is not handled.
  3790.   \macrolist
  3791. % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
  3792. % ignore left quotes in the sort term.
  3793. {\catcode`\`=\active
  3794.  \gdef\indexlquoteignore{\let`=\empty}}
  3795. \let\indexbackslash=0  %overridden during \printindex.
  3796. \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
  3797. % Most index entries go through here, but \dosubind is the general case.
  3798. % #1 is the index name, #2 is the entry text.
  3799. \def\doind#1#2{\dosubind{#1}{#2}{}}
  3800. % Workhorse for all \fooindexes.
  3801. % #1 is name of index, #2 is stuff to put there, #3 is subentry --
  3802. % empty if called from \doind, as we usually are (the main exception
  3803. % is with most defuns, which call us directly).
  3804. \def\dosubind#1#2#3{%
  3805.   \iflinks
  3806.     % Store the main index entry text (including the third arg).
  3807.     \toks0 = {#2}%
  3808.     % If third arg is present, precede it with a space.
  3809.     \def\thirdarg{#3}%
  3810.     \ifx\thirdarg\empty \else
  3811.       \toks0 = \expandafter{\the\toks0 \space #3}%
  3812.     \fi
  3813.     %
  3814.     \edef\writeto{\csname#1indfile\endcsname}%
  3815.     %
  3816.     \safewhatsit\dosubindwrite
  3817.   \fi
  3818. % Write the entry in \toks0 to the index file:
  3819. \def\dosubindwrite{%
  3820.   % Put the index entry in the margin if desired.
  3821.   \ifx\SETmarginindex\relax\else
  3822.     \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
  3823.   \fi
  3824.   % Remember, we are within a group.
  3825.   \indexdummies % Must do this here, since \bf, etc expand at this stage
  3826.   \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
  3827.       % so it will be output as is; and it will print as backslash.
  3828.   % Process the index entry with all font commands turned off, to
  3829.   % get the string to sort by.
  3830.   {\indexnofonts
  3831.    \edef\temp{\the\toks0}% need full expansion
  3832.    \xdef\indexsorttmp{\temp}%
  3833.   % Set up the complete index entry, with both the sort key and
  3834.   % the original text, including any font commands.  We write
  3835.   % three arguments to \entry to the .?? file (four in the
  3836.   % subentry case), texindex reduces to two when writing the .??s
  3837.   % sorted result.
  3838.   \edef\temp{%
  3839.     \write\writeto{%
  3840.       \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
  3841.   \temp
  3842. % Take care of unwanted page breaks/skips around a whatsit:
  3843. % If a skip is the last thing on the list now, preserve it
  3844. % by backing up by \lastskip, doing the \write, then inserting
  3845. % the skip again.  Otherwise, the whatsit generated by the
  3846. % \write or \pdfdest will make \lastskip zero.  The result is that
  3847. % sequences like this:
  3848. % @end defun
  3849. % @tindex whatever
  3850. % @defun ...
  3851. % will have extra space inserted, because the \medbreak in the
  3852. % start of the @defun won't see the skip inserted by the @end of
  3853. % the previous defun.
  3854. % But don't do any of this if we're not in vertical mode.  We
  3855. % don't want to do a \vskip and prematurely end a paragraph.
  3856. % Avoid page breaks due to these extra skips, too.
  3857. % But wait, there is a catch there:
  3858. % We'll have to check whether \lastskip is zero skip.  \ifdim is not
  3859. % sufficient for this purpose, as it ignores stretch and shrink parts
  3860. % of the skip.  The only way seems to be to check the textual
  3861. % representation of the skip.
  3862. % The following is almost like \def\zeroskipmacro{0.0pt} except that
  3863. % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
  3864. \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
  3865. \newskip\whatsitskip
  3866. \newcount\whatsitpenalty
  3867. % ..., ready, GO:
  3868. \def\safewhatsit#1{%
  3869. \ifhmode
  3870.   #1%
  3871. \else
  3872.   % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
  3873.   \whatsitskip = \lastskip
  3874.   \edef\lastskipmacro{\the\lastskip}%
  3875.   \whatsitpenalty = \lastpenalty
  3876.   % If \lastskip is nonzero, that means the last item was a
  3877.   % skip.  And since a skip is discardable, that means this
  3878.   % -\whatsitskip glue we're inserting is preceded by a
  3879.   % non-discardable item, therefore it is not a potential
  3880.   % breakpoint, therefore no \nobreak needed.
  3881.   \ifx\lastskipmacro\zeroskipmacro
  3882.   \else
  3883.     \vskip-\whatsitskip
  3884.   \fi
  3885.   #1%
  3886.   \ifx\lastskipmacro\zeroskipmacro
  3887.     % If \lastskip was zero, perhaps the last item was a penalty, and
  3888.     % perhaps it was >=10000, e.g., a \nobreak.  In that case, we want
  3889.     % to re-insert the same penalty (values >10000 are used for various
  3890.     % signals); since we just inserted a non-discardable item, any
  3891.     % following glue (such as a \parskip) would be a breakpoint.  For example:
  3892.     %
  3893.     %   @deffn deffn-whatever
  3894.     %   @vindex index-whatever
  3895.     %   Description.
  3896.     % would allow a break between the index-whatever whatsit
  3897.     % and the "Description." paragraph.
  3898.     \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
  3899.   \else
  3900.     % On the other hand, if we had a nonzero \lastskip,
  3901.     % this make-up glue would be preceded by a non-discardable item
  3902.     % (the whatsit from the \write), so we must insert a \nobreak.
  3903.     \nobreak\vskip\whatsitskip
  3904.   \fi
  3905. % The index entry written in the file actually looks like
  3906. %  \entry {sortstring}{page}{topic}
  3907. %  \entry {sortstring}{page}{topic}{subtopic}
  3908. % The texindex program reads in these files and writes files
  3909. % containing these kinds of lines:
  3910. %  \initial {c}
  3911. %     before the first topic whose initial is c
  3912. %  \entry {topic}{pagelist}
  3913. %     for a topic that is used without subtopics
  3914. %  \primary {topic}
  3915. %     for the beginning of a topic that is used with subtopics
  3916. %  \secondary {subtopic}{pagelist}
  3917. %     for each subtopic.
  3918. % Define the user-accessible indexing commands
  3919. % @findex, @vindex, @kindex, @cindex.
  3920. \def\findex {\fnindex}
  3921. \def\kindex {\kyindex}
  3922. \def\cindex {\cpindex}
  3923. \def\vindex {\vrindex}
  3924. \def\tindex {\tpindex}
  3925. \def\pindex {\pgindex}
  3926. \def\cindexsub {\begingroup\obeylines\cindexsub}
  3927. {\obeylines %
  3928. \gdef\cindexsub "#1" #2^^M{\endgroup %
  3929. \dosubind{cp}{#2}{#1}}}
  3930. % Define the macros used in formatting output of the sorted index material.
  3931. % @printindex causes a particular index (the ??s file) to get printed.
  3932. % It does not print any chapter heading (usually an @unnumbered).
  3933. \parseargdef\printindex{\begingroup
  3934.   \dobreak \chapheadingskip{10000}%
  3935.   \smallfonts \rm
  3936.   \tolerance = 9500
  3937.   \plainfrenchspacing
  3938.   \everypar = {}% don't want the \kern\-parindent from indentation suppression.
  3939.   % See if the index file exists and is nonempty.
  3940.   % Change catcode of @ here so that if the index file contains
  3941.   % \initial {@}
  3942.   % as its first line, TeX doesn't complain about mismatched braces
  3943.   % (because it thinks @} is a control sequence).
  3944.   \catcode`\@ = 11
  3945.   \openin 1 \jobname.#1s
  3946.   \ifeof 1
  3947.     % \enddoublecolumns gets confused if there is no text in the index,
  3948.     % and it loses the chapter title and the aux file entries for the
  3949.     % index.  The easiest way to prevent this problem is to make sure
  3950.     % there is some text.
  3951.     \putwordIndexNonexistent
  3952.   \else
  3953.     %
  3954.     % If the index file exists but is empty, then \openin leaves \ifeof
  3955.     % false.  We have to make TeX try to read something from the file, so
  3956.     % it can discover if there is anything in it.
  3957.     \read 1 to \temp
  3958.     \ifeof 1
  3959.       \putwordIndexIsEmpty
  3960.     \else
  3961.       % Index files are almost Texinfo source, but we use \ as the escape
  3962.       % character.  It would be better to use @, but that's too big a change
  3963.       % to make right now.
  3964.       \def\indexbackslash{\backslashcurfont}%
  3965.       \catcode`\\ = 0
  3966.       \escapechar = `\\
  3967.       \begindoublecolumns
  3968.       \input \jobname.#1s
  3969.       \enddoublecolumns
  3970.     \fi
  3971.   \fi
  3972.   \closein 1
  3973. \endgroup}
  3974. % These macros are used by the sorted index file itself.
  3975. % Change them to control the appearance of the index.
  3976. \def\initial#1{{%
  3977.   % Some minor font changes for the special characters.
  3978.   \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  3979.   % Remove any glue we may have, we'll be inserting our own.
  3980.   \removelastskip
  3981.   % We like breaks before the index initials, so insert a bonus.
  3982.   \nobreak
  3983.   \vskip 0pt plus 3\baselineskip
  3984.   \penalty 0
  3985.   \vskip 0pt plus -3\baselineskip
  3986.   % Typeset the initial.  Making this add up to a whole number of
  3987.   % baselineskips increases the chance of the dots lining up from column
  3988.   % to column.  It still won't often be perfect, because of the stretch
  3989.   % we need before each entry, but it's better.
  3990.   % No shrink because it confuses \balancecolumns.
  3991.   \vskip 1.67\baselineskip plus .5\baselineskip
  3992.   \leftline{\secbf #1}%
  3993.   % Do our best not to break after the initial.
  3994.   \nobreak
  3995.   \vskip .33\baselineskip plus .1\baselineskip
  3996. % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
  3997. % then page number (#2) flushed to the right margin.  It is used for index
  3998. % and table of contents entries.  The paragraph is indented by \leftskip.
  3999. % A straightforward implementation would start like this:
  4000. %    \def\entry#1#2{...
  4001. % But this freezes the catcodes in the argument, and can cause problems to
  4002. % @code, which sets - active.  This problem was fixed by a kludge---
  4003. % ``-'' was active throughout whole index, but this isn't really right.
  4004. % The right solution is to prevent \entry from swallowing the whole text.
  4005. %                                 --kasal, 21nov03
  4006. \def\entry{%
  4007.   \begingroup
  4008.     %
  4009.     % Start a new paragraph if necessary, so our assignments below can't
  4010.     % affect previous text.
  4011.     \par
  4012.     %
  4013.     % Do not fill out the last line with white space.
  4014.     \parfillskip = 0in
  4015.     %
  4016.     % No extra space above this paragraph.
  4017.     \parskip = 0in
  4018.     %
  4019.     % Do not prefer a separate line ending with a hyphen to fewer lines.
  4020.     \finalhyphendemerits = 0
  4021.     %
  4022.     % \hangindent is only relevant when the entry text and page number
  4023.     % don't both fit on one line.  In that case, bob suggests starting the
  4024.     % dots pretty far over on the line.  Unfortunately, a large
  4025.     % indentation looks wrong when the entry text itself is broken across
  4026.     % lines.  So we use a small indentation and put up with long leaders.
  4027.     %
  4028.     % \hangafter is reset to 1 (which is the value we want) at the start
  4029.     % of each paragraph, so we need not do anything with that.
  4030.     \hangindent = 2em
  4031.     %
  4032.     % When the entry text needs to be broken, just fill out the first line
  4033.     % with blank space.
  4034.     \rightskip = 0pt plus1fil
  4035.     %
  4036.     % A bit of stretch before each entry for the benefit of balancing
  4037.     % columns.
  4038.     \vskip 0pt plus1pt
  4039.     %
  4040.     % When reading the text of entry, convert explicit line breaks
  4041.     % from @* into spaces.  The user might give these in long section
  4042.     % titles, for instance.
  4043.     \def\*{\unskip\space\ignorespaces}%
  4044.     \def\entrybreak{\hfil\break}%
  4045.     %
  4046.     % Swallow the left brace of the text (first parameter):
  4047.     \afterassignment\doentry
  4048.     \let\temp =
  4049. \def\entrybreak{\unskip\space\ignorespaces}%
  4050. \def\doentry{%
  4051.     \bgroup % Instead of the swallowed brace.
  4052.       \noindent
  4053.       \aftergroup\finishentry
  4054.       % And now comes the text of the entry.
  4055. \def\finishentry#1{%
  4056.     % #1 is the page number.
  4057.     %
  4058.     % The following is kludged to not output a line of dots in the index if
  4059.     % there are no page numbers.  The next person who breaks this will be
  4060.     % cursed by a Unix daemon.
  4061.     \setbox\boxA = \hbox{#1}%
  4062.     \ifdim\wd\boxA = 0pt
  4063.       \ %
  4064.     \else
  4065.       %
  4066.       % If we must, put the page number on a line of its own, and fill out
  4067.       % this line with blank space.  (The \hfil is overwhelmed with the
  4068.       % fill leaders glue in \indexdotfill if the page number does fit.)
  4069.       \hfil\penalty50
  4070.       \null\nobreak\indexdotfill % Have leaders before the page number.
  4071.       %
  4072.       % The `\ ' here is removed by the implicit \unskip that TeX does as
  4073.       % part of (the primitive) \par.  Without it, a spurious underfull
  4074.       % \hbox ensues.
  4075.       \ifpdf
  4076.     \pdfgettoks#1.%
  4077.     \ \the\toksA
  4078.       \else
  4079.     \ #1%
  4080.       \fi
  4081.     \fi
  4082.     \par
  4083.   \endgroup
  4084. % Like plain.tex's \dotfill, except uses up at least 1 em.
  4085. \def\indexdotfill{\cleaders
  4086.   \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
  4087. \def\primary #1{\line{#1\hfil}}
  4088. \newskip\secondaryindent \secondaryindent=0.5cm
  4089. \def\secondary#1#2{{%
  4090.   \parfillskip=0in
  4091.   \parskip=0in
  4092.   \hangindent=1in
  4093.   \hangafter=1
  4094.   \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
  4095.   \ifpdf
  4096.     \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
  4097.   \else
  4098.     #2
  4099.   \fi
  4100.   \par
  4101. % Define two-column mode, which we use to typeset indexes.
  4102. % Adapted from the TeXbook, page 416, which is to say,
  4103. % the manmac.tex format used to print the TeXbook itself.
  4104. \catcode`\@=11
  4105. \newbox\partialpage
  4106. \newdimen\doublecolumnhsize
  4107. \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
  4108.   % Grab any single-column material above us.
  4109.   \output = {%
  4110.     %
  4111.     % Here is a possibility not foreseen in manmac: if we accumulate a
  4112.     % whole lot of material, we might end up calling this \output
  4113.     % routine twice in a row (see the doublecol-lose test, which is
  4114.     % essentially a couple of indexes with @setchapternewpage off).  In
  4115.     % that case we just ship out what is in \partialpage with the normal
  4116.     % output routine.  Generally, \partialpage will be empty when this
  4117.     % runs and this will be a no-op.  See the indexspread.tex test case.
  4118.     \ifvoid\partialpage \else
  4119.       \onepageout{\pagecontents\partialpage}%
  4120.     \fi
  4121.     %
  4122.     \global\setbox\partialpage = \vbox{%
  4123.       % Unvbox the main output page.
  4124.       \unvbox\PAGE
  4125.       \kern-\topskip \kern\baselineskip
  4126.     }%
  4127.   \eject % run that output routine to set \partialpage
  4128.   % Use the double-column output routine for subsequent pages.
  4129.   \output = {\doublecolumnout}%
  4130.   % Change the page size parameters.  We could do this once outside this
  4131.   % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  4132.   % format, but then we repeat the same computation.  Repeating a couple
  4133.   % of assignments once per index is clearly meaningless for the
  4134.   % execution time, so we may as well do it in one place.
  4135.   % First we halve the line length, less a little for the gutter between
  4136.   % the columns.  We compute the gutter based on the line length, so it
  4137.   % changes automatically with the paper format.  The magic constant
  4138.   % below is chosen so that the gutter has the same value (well, +-<1pt)
  4139.   % as it did when we hard-coded it.
  4140.   % We put the result in a separate register, \doublecolumhsize, so we
  4141.   % can restore it in \pagesofar, after \hsize itself has (potentially)
  4142.   % been clobbered.
  4143.   \doublecolumnhsize = \hsize
  4144.     \advance\doublecolumnhsize by -.04154\hsize
  4145.     \divide\doublecolumnhsize by 2
  4146.   \hsize = \doublecolumnhsize
  4147.   % Double the \vsize as well.  (We don't need a separate register here,
  4148.   % since nobody clobbers \vsize.)
  4149.   \vsize = 2\vsize
  4150. % The double-column output routine for all double-column pages except
  4151. % the last.
  4152. \def\doublecolumnout{%
  4153.   \splittopskip=\topskip \splitmaxdepth=\maxdepth
  4154.   % Get the available space for the double columns -- the normal
  4155.   % (undoubled) page height minus any material left over from the
  4156.   % previous page.
  4157.   \dimen@ = \vsize
  4158.   \divide\dimen@ by 2
  4159.   \advance\dimen@ by -\ht\partialpage
  4160.   % box0 will be the left-hand column, box2 the right.
  4161.   \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  4162.   \onepageout\pagesofar
  4163.   \unvbox255
  4164.   \penalty\outputpenalty
  4165. % Re-output the contents of the output page -- any previous material,
  4166. % followed by the two boxes we just split, in box0 and box2.
  4167. \def\pagesofar{%
  4168.   \unvbox\partialpage
  4169.   \hsize = \doublecolumnhsize
  4170.   \wd0=\hsize \wd2=\hsize
  4171.   \hbox to\pagewidth{\box0\hfil\box2}%
  4172. % All done with double columns.
  4173. \def\enddoublecolumns{%
  4174.   % The following penalty ensures that the page builder is exercised
  4175.   % _before_ we change the output routine.  This is necessary in the
  4176.   % following situation:
  4177.   % The last section of the index consists only of a single entry.
  4178.   % Before this section, \pagetotal is less than \pagegoal, so no
  4179.   % break occurs before the last section starts.  However, the last
  4180.   % section, consisting of \initial and the single \entry, does not
  4181.   % fit on the page and has to be broken off.  Without the following
  4182.   % penalty the page builder will not be exercised until \eject
  4183.   % below, and by that time we'll already have changed the output
  4184.   % routine to the \balancecolumns version, so the next-to-last
  4185.   % double-column page will be processed with \balancecolumns, which
  4186.   % is wrong:  The two columns will go to the main vertical list, with
  4187.   % the broken-off section in the recent contributions.  As soon as
  4188.   % the output routine finishes, TeX starts reconsidering the page
  4189.   % break.  The two columns and the broken-off section both fit on the
  4190.   % page, because the two columns now take up only half of the page
  4191.   % goal.  When TeX sees \eject from below which follows the final
  4192.   % section, it invokes the new output routine that we've set after
  4193.   % \balancecolumns below; \onepageout will try to fit the two columns
  4194.   % and the final section into the vbox of \pageheight (see
  4195.   % \pagebody), causing an overfull box.
  4196.   % Note that glue won't work here, because glue does not exercise the
  4197.   % page builder, unlike penalties (see The TeXbook, pp. 280-281).
  4198.   \penalty0
  4199.   \output = {%
  4200.     % Split the last of the double-column material.  Leave it on the
  4201.     % current page, no automatic page break.
  4202.     \balancecolumns
  4203.     %
  4204.     % If we end up splitting too much material for the current page,
  4205.     % though, there will be another page break right after this \output
  4206.     % invocation ends.  Having called \balancecolumns once, we do not
  4207.     % want to call it again.  Therefore, reset \output to its normal
  4208.     % definition right away.  (We hope \balancecolumns will never be
  4209.     % called on to balance too much material, but if it is, this makes
  4210.     % the output somewhat more palatable.)
  4211.     \global\output = {\onepageout{\pagecontents\PAGE}}%
  4212.   \eject
  4213.   \endgroup % started in \begindoublecolumns
  4214.   % \pagegoal was set to the doubled \vsize above, since we restarted
  4215.   % the current page.  We're now back to normal single-column
  4216.   % typesetting, so reset \pagegoal to the normal \vsize (after the
  4217.   % \endgroup where \vsize got restored).
  4218.   \pagegoal = \vsize
  4219. % Called at the end of the double column material.
  4220. \def\balancecolumns{%
  4221.   \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
  4222.   \dimen@ = \ht0
  4223.   \advance\dimen@ by \topskip
  4224.   \advance\dimen@ by-\baselineskip
  4225.   \divide\dimen@ by 2 % target to split to
  4226.   %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
  4227.   \splittopskip = \topskip
  4228.   % Loop until we get a decent breakpoint.
  4229.     \vbadness = 10000
  4230.     \loop
  4231.       \global\setbox3 = \copy0
  4232.       \global\setbox1 = \vsplit3 to \dimen@
  4233.     \ifdim\ht3>\dimen@
  4234.       \global\advance\dimen@ by 1pt
  4235.     \repeat
  4236.   %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
  4237.   \setbox0=\vbox to\dimen@{\unvbox1}%
  4238.   \setbox2=\vbox to\dimen@{\unvbox3}%
  4239.   \pagesofar
  4240. \catcode`\@ = \other
  4241. \message{sectioning,}
  4242. % Chapters, sections, etc.
  4243. % Let's start with @part.
  4244. \outer\parseargdef\part{\partzzz{#1}}
  4245. \def\partzzz#1{%
  4246.   \chapoddpage
  4247.   \null
  4248.   \vskip.3\vsize  % move it down on the page a bit
  4249.   \begingroup
  4250.     \noindent \titlefonts\rmisbold #1\par % the text
  4251.     \let\lastnode=\empty      % no node to associate with
  4252.     \writetocentry{part}{#1}{}% but put it in the toc
  4253.     \headingsoff              % no headline or footline on the part page
  4254.     \chapoddpage
  4255.   \endgroup
  4256. % \unnumberedno is an oxymoron.  But we count the unnumbered
  4257. % sections so that we can refer to them unambiguously in the pdf
  4258. % outlines by their "section number".  We avoid collisions with chapter
  4259. % numbers by starting them at 10000.  (If a document ever has 10000
  4260. % chapters, we're in trouble anyway, I'm sure.)
  4261. \newcount\unnumberedno \unnumberedno = 10000
  4262. \newcount\chapno
  4263. \newcount\secno        \secno=0
  4264. \newcount\subsecno     \subsecno=0
  4265. \newcount\subsubsecno  \subsubsecno=0
  4266. % This counter is funny since it counts through charcodes of letters A, B, ...
  4267. \newcount\appendixno  \appendixno = `\@
  4268. % \def\appendixletter{\char\the\appendixno}
  4269. % We do the following ugly conditional instead of the above simple
  4270. % construct for the sake of pdftex, which needs the actual
  4271. % letter in the expansion, not just typeset.
  4272. \def\appendixletter{%
  4273.   \ifnum\appendixno=`A A%
  4274.   \else\ifnum\appendixno=`B B%
  4275.   \else\ifnum\appendixno=`C C%
  4276.   \else\ifnum\appendixno=`D D%
  4277.   \else\ifnum\appendixno=`E E%
  4278.   \else\ifnum\appendixno=`F F%
  4279.   \else\ifnum\appendixno=`G G%
  4280.   \else\ifnum\appendixno=`H H%
  4281.   \else\ifnum\appendixno=`I I%
  4282.   \else\ifnum\appendixno=`J J%
  4283.   \else\ifnum\appendixno=`K K%
  4284.   \else\ifnum\appendixno=`L L%
  4285.   \else\ifnum\appendixno=`M M%
  4286.   \else\ifnum\appendixno=`N N%
  4287.   \else\ifnum\appendixno=`O O%
  4288.   \else\ifnum\appendixno=`P P%
  4289.   \else\ifnum\appendixno=`Q Q%
  4290.   \else\ifnum\appendixno=`R R%
  4291.   \else\ifnum\appendixno=`S S%
  4292.   \else\ifnum\appendixno=`T T%
  4293.   \else\ifnum\appendixno=`U U%
  4294.   \else\ifnum\appendixno=`V V%
  4295.   \else\ifnum\appendixno=`W W%
  4296.   \else\ifnum\appendixno=`X X%
  4297.   \else\ifnum\appendixno=`Y Y%
  4298.   \else\ifnum\appendixno=`Z Z%
  4299.   % The \the is necessary, despite appearances, because \appendixletter is
  4300.   % expanded while writing the .toc file.  \char\appendixno is not
  4301.   % expandable, thus it is written literally, thus all appendixes come out
  4302.   % with the same letter (or @) in the toc without it.
  4303.   \else\char\the\appendixno
  4304.   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  4305.   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
  4306. % Each @chapter defines these (using marks) as the number+name, number
  4307. % and name of the chapter.  Page headings and footings can use
  4308. % these.  @section does likewise.
  4309. \def\thischapter{}
  4310. \def\thischapternum{}
  4311. \def\thischaptername{}
  4312. \def\thissection{}
  4313. \def\thissectionnum{}
  4314. \def\thissectionname{}
  4315. \newcount\absseclevel % used to calculate proper heading level
  4316. \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
  4317. % @raisesections: treat @section as chapter, @subsection as section, etc.
  4318. \def\raisesections{\global\advance\secbase by -1}
  4319. \let\up=\raisesections % original BFox name
  4320. % @lowersections: treat @chapter as section, @section as subsection, etc.
  4321. \def\lowersections{\global\advance\secbase by 1}
  4322. \let\down=\lowersections % original BFox name
  4323. % we only have subsub.
  4324. \chardef\maxseclevel = 3
  4325. % A numbered section within an unnumbered changes to unnumbered too.
  4326. % To achieve this, remember the "biggest" unnum. sec. we are currently in:
  4327. \chardef\unnlevel = \maxseclevel
  4328. % Trace whether the current chapter is an appendix or not:
  4329. % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
  4330. \def\chapheadtype{N}
  4331. % Choose a heading macro
  4332. % #1 is heading type
  4333. % #2 is heading level
  4334. % #3 is text for heading
  4335. \def\genhead#1#2#3{%
  4336.   % Compute the abs. sec. level:
  4337.   \absseclevel=#2
  4338.   \advance\absseclevel by \secbase
  4339.   % Make sure \absseclevel doesn't fall outside the range:
  4340.   \ifnum \absseclevel < 0
  4341.     \absseclevel = 0
  4342.   \else
  4343.     \ifnum \absseclevel > 3
  4344.       \absseclevel = 3
  4345.     \fi
  4346.   \fi
  4347.   % The heading type:
  4348.   \def\headtype{#1}%
  4349.   \if \headtype U%
  4350.     \ifnum \absseclevel < \unnlevel
  4351.       \chardef\unnlevel = \absseclevel
  4352.     \fi
  4353.   \else
  4354.     % Check for appendix sections:
  4355.     \ifnum \absseclevel = 0
  4356.       \edef\chapheadtype{\headtype}%
  4357.     \else
  4358.       \if \headtype A\if \chapheadtype N%
  4359.     \errmessage{@appendix... within a non-appendix chapter}%
  4360.       \fi\fi
  4361.     \fi
  4362.     % Check for numbered within unnumbered:
  4363.     \ifnum \absseclevel > \unnlevel
  4364.       \def\headtype{U}%
  4365.     \else
  4366.       \chardef\unnlevel = 3
  4367.     \fi
  4368.   \fi
  4369.   % Now print the heading:
  4370.   \if \headtype U%
  4371.     \ifcase\absseclevel
  4372.     \unnumberedzzz{#3}%
  4373.     \or \unnumberedseczzz{#3}%
  4374.     \or \unnumberedsubseczzz{#3}%
  4375.     \or \unnumberedsubsubseczzz{#3}%
  4376.     \fi
  4377.   \else
  4378.     \if \headtype A%
  4379.       \ifcase\absseclevel
  4380.       \appendixzzz{#3}%
  4381.       \or \appendixsectionzzz{#3}%
  4382.       \or \appendixsubseczzz{#3}%
  4383.       \or \appendixsubsubseczzz{#3}%
  4384.       \fi
  4385.     \else
  4386.       \ifcase\absseclevel
  4387.       \chapterzzz{#3}%
  4388.       \or \seczzz{#3}%
  4389.       \or \numberedsubseczzz{#3}%
  4390.       \or \numberedsubsubseczzz{#3}%
  4391.       \fi
  4392.     \fi
  4393.   \fi
  4394.   \suppressfirstparagraphindent
  4395. % an interface:
  4396. \def\numhead{\genhead N}
  4397. \def\apphead{\genhead A}
  4398. \def\unnmhead{\genhead U}
  4399. % @chapter, @appendix, @unnumbered.  Increment top-level counter, reset
  4400. % all lower-level sectioning counters to zero.
  4401. % Also set \chaplevelprefix, which we prepend to @float sequence numbers
  4402. % (e.g., figures), q.v.  By default (before any chapter), that is empty.
  4403. \let\chaplevelprefix = \empty
  4404. \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
  4405. \def\chapterzzz#1{%
  4406.   % section resetting is \global in case the chapter is in a group, such
  4407.   % as an @include file.
  4408.   \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  4409.     \global\advance\chapno by 1
  4410.   % Used for \float.
  4411.   \gdef\chaplevelprefix{\the\chapno.}%
  4412.   \resetallfloatnos
  4413.   % \putwordChapter can contain complex things in translations.
  4414.   \toks0=\expandafter{\putwordChapter}%
  4415.   \message{\the\toks0 \space \the\chapno}%
  4416.   % Write the actual heading.
  4417.   \chapmacro{#1}{Ynumbered}{\the\chapno}%
  4418.   % So @section and the like are numbered underneath this chapter.
  4419.   \global\let\section = \numberedsec
  4420.   \global\let\subsection = \numberedsubsec
  4421.   \global\let\subsubsection = \numberedsubsubsec
  4422. \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
  4423. \def\appendixzzz#1{%
  4424.   \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  4425.     \global\advance\appendixno by 1
  4426.   \gdef\chaplevelprefix{\appendixletter.}%
  4427.   \resetallfloatnos
  4428.   % \putwordAppendix can contain complex things in translations.
  4429.   \toks0=\expandafter{\putwordAppendix}%
  4430.   \message{\the\toks0 \space \appendixletter}%
  4431.   \chapmacro{#1}{Yappendix}{\appendixletter}%
  4432.   \global\let\section = \appendixsec
  4433.   \global\let\subsection = \appendixsubsec
  4434.   \global\let\subsubsection = \appendixsubsubsec
  4435. % normally unnmhead0 calls unnumberedzzz:
  4436. \outer\parseargdef\unnumbered{\unnmhead0{#1}}
  4437. \def\unnumberedzzz#1{%
  4438.   \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  4439.     \global\advance\unnumberedno by 1
  4440.   % Since an unnumbered has no number, no prefix for figures.
  4441.   \global\let\chaplevelprefix = \empty
  4442.   \resetallfloatnos
  4443.   % This used to be simply \message{#1}, but TeX fully expands the
  4444.   % argument to \message.  Therefore, if #1 contained @-commands, TeX
  4445.   % expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
  4446.   % expanded @cite (which turns out to cause errors because \cite is meant
  4447.   % to be executed, not expanded).
  4448.   % Anyway, we don't want the fully-expanded definition of @cite to appear
  4449.   % as a result of the \message, we just want `@cite' itself.  We use
  4450.   % \the<toks register> to achieve this: TeX expands \the<toks> only once,
  4451.   % simply yielding the contents of <toks register>.  (We also do this for
  4452.   % the toc entries.)
  4453.   \toks0 = {#1}%
  4454.   \message{(\the\toks0)}%
  4455.   \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
  4456.   \global\let\section = \unnumberedsec
  4457.   \global\let\subsection = \unnumberedsubsec
  4458.   \global\let\subsubsection = \unnumberedsubsubsec
  4459. % @centerchap is like @unnumbered, but the heading is centered.
  4460. \outer\parseargdef\centerchap{%
  4461.   % Well, we could do the following in a group, but that would break
  4462.   % an assumption that \chapmacro is called at the outermost level.
  4463.   % Thus we are safer this way:        --kasal, 24feb04
  4464.   \let\centerparametersmaybe = \centerparameters
  4465.   \unnmhead0{#1}%
  4466.   \let\centerparametersmaybe = \relax
  4467. % @top is like @unnumbered.
  4468. \let\top\unnumbered
  4469. % Sections.
  4470. \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
  4471. \def\seczzz#1{%
  4472.   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
  4473.   \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
  4474. % normally calls appendixsectionzzz:
  4475. \outer\parseargdef\appendixsection{\apphead1{#1}}
  4476. \def\appendixsectionzzz#1{%
  4477.   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
  4478.   \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
  4479. \let\appendixsec\appendixsection
  4480. % normally calls unnumberedseczzz:
  4481. \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
  4482. \def\unnumberedseczzz#1{%
  4483.   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
  4484.   \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
  4485. % Subsections.
  4486. % normally calls numberedsubseczzz:
  4487. \outer\parseargdef\numberedsubsec{\numhead2{#1}}
  4488. \def\numberedsubseczzz#1{%
  4489.   \global\subsubsecno=0  \global\advance\subsecno by 1
  4490.   \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
  4491. % normally calls appendixsubseczzz:
  4492. \outer\parseargdef\appendixsubsec{\apphead2{#1}}
  4493. \def\appendixsubseczzz#1{%
  4494.   \global\subsubsecno=0  \global\advance\subsecno by 1
  4495.   \sectionheading{#1}{subsec}{Yappendix}%
  4496.                  {\appendixletter.\the\secno.\the\subsecno}%
  4497. % normally calls unnumberedsubseczzz:
  4498. \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
  4499. \def\unnumberedsubseczzz#1{%
  4500.   \global\subsubsecno=0  \global\advance\subsecno by 1
  4501.   \sectionheading{#1}{subsec}{Ynothing}%
  4502.                  {\the\unnumberedno.\the\secno.\the\subsecno}%
  4503. % Subsubsections.
  4504. % normally numberedsubsubseczzz:
  4505. \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
  4506. \def\numberedsubsubseczzz#1{%
  4507.   \global\advance\subsubsecno by 1
  4508.   \sectionheading{#1}{subsubsec}{Ynumbered}%
  4509.                  {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
  4510. % normally appendixsubsubseczzz:
  4511. \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
  4512. \def\appendixsubsubseczzz#1{%
  4513.   \global\advance\subsubsecno by 1
  4514.   \sectionheading{#1}{subsubsec}{Yappendix}%
  4515.                  {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
  4516. % normally unnumberedsubsubseczzz:
  4517. \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
  4518. \def\unnumberedsubsubseczzz#1{%
  4519.   \global\advance\subsubsecno by 1
  4520.   \sectionheading{#1}{subsubsec}{Ynothing}%
  4521.                  {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
  4522. % These macros control what the section commands do, according
  4523. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  4524. % Define them by default for a numbered chapter.
  4525. \let\section = \numberedsec
  4526. \let\subsection = \numberedsubsec
  4527. \let\subsubsection = \numberedsubsubsec
  4528. % Define @majorheading, @heading and @subheading
  4529. % NOTE on use of \vbox for chapter headings, section headings, and such:
  4530. %       1) We use \vbox rather than the earlier \line to permit
  4531. %          overlong headings to fold.
  4532. %       2) \hyphenpenalty is set to 10000 because hyphenation in a
  4533. %          heading is obnoxious; this forbids it.
  4534. %       3) Likewise, headings look best if no \parindent is used, and
  4535. %          if justification is not attempted.  Hence \raggedright.
  4536. \def\majorheading{%
  4537.   {\advance\chapheadingskip by 10pt \chapbreak }%
  4538.   \parsearg\chapheadingzzz
  4539. \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
  4540. \def\chapheadingzzz#1{%
  4541.   {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  4542.                     \parindent=0pt\ptexraggedright
  4543.                     \rmisbold #1\hfill}}%
  4544.   \bigskip \par\penalty 200\relax
  4545.   \suppressfirstparagraphindent
  4546. % @heading, @subheading, @subsubheading.
  4547. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
  4548.   \suppressfirstparagraphindent}
  4549. \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
  4550.   \suppressfirstparagraphindent}
  4551. \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
  4552.   \suppressfirstparagraphindent}
  4553. % These macros generate a chapter, section, etc. heading only
  4554. % (including whitespace, linebreaking, etc. around it),
  4555. % given all the information in convenient, parsed form.
  4556. % Args are the skip and penalty (usually negative)
  4557. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  4558. % Parameter controlling skip before chapter headings (if needed)
  4559. \newskip\chapheadingskip
  4560. % Define plain chapter starts, and page on/off switching for it.
  4561. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  4562. \def\chappager{\par\vfill\supereject}
  4563. % Because \domark is called before \chapoddpage, the filler page will
  4564. % get the headings for the next chapter, which is wrong.  But we don't
  4565. % care -- we just disable all headings on the filler page.
  4566. \def\chapoddpage{%
  4567.   \chappager
  4568.   \ifodd\pageno \else
  4569.     \begingroup
  4570.       \headingsoff
  4571.       \null
  4572.       \chappager
  4573.     \endgroup
  4574.   \fi
  4575. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  4576. \def\CHAPPAGoff{%
  4577. \global\let\contentsalignmacro = \chappager
  4578. \global\let\pchapsepmacro=\chapbreak
  4579. \global\let\pagealignmacro=\chappager}
  4580. \def\CHAPPAGon{%
  4581. \global\let\contentsalignmacro = \chappager
  4582. \global\let\pchapsepmacro=\chappager
  4583. \global\let\pagealignmacro=\chappager
  4584. \global\def\HEADINGSon{\HEADINGSsingle}}
  4585. \def\CHAPPAGodd{%
  4586. \global\let\contentsalignmacro = \chapoddpage
  4587. \global\let\pchapsepmacro=\chapoddpage
  4588. \global\let\pagealignmacro=\chapoddpage
  4589. \global\def\HEADINGSon{\HEADINGSdouble}}
  4590. \CHAPPAGon
  4591. % Chapter opening.
  4592. % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
  4593. % Yappendix, Yomitfromtoc), #3 the chapter number.
  4594. % To test against our argument.
  4595. \def\Ynothingkeyword{Ynothing}
  4596. \def\Yomitfromtockeyword{Yomitfromtoc}
  4597. \def\Yappendixkeyword{Yappendix}
  4598. \def\chapmacro#1#2#3{%
  4599.   % Insert the first mark before the heading break (see notes for \domark).
  4600.   \let\prevchapterdefs=\lastchapterdefs
  4601.   \let\prevsectiondefs=\lastsectiondefs
  4602.   \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
  4603.                         \gdef\thissection{}}%
  4604.   \def\temptype{#2}%
  4605.   \ifx\temptype\Ynothingkeyword
  4606.     \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  4607.                           \gdef\thischapter{\thischaptername}}%
  4608.   \else\ifx\temptype\Yomitfromtockeyword
  4609.     \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  4610.                           \gdef\thischapter{}}%
  4611.   \else\ifx\temptype\Yappendixkeyword
  4612.     \toks0={#1}%
  4613.     \xdef\lastchapterdefs{%
  4614.       \gdef\noexpand\thischaptername{\the\toks0}%
  4615.       \gdef\noexpand\thischapternum{\appendixletter}%
  4616.       % \noexpand\putwordAppendix avoids expanding indigestible
  4617.       % commands in some of the translations.
  4618.       \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
  4619.                                  \noexpand\thischapternum:
  4620.                                  \noexpand\thischaptername}%
  4621.     }%
  4622.   \else
  4623.     \toks0={#1}%
  4624.     \xdef\lastchapterdefs{%
  4625.       \gdef\noexpand\thischaptername{\the\toks0}%
  4626.       \gdef\noexpand\thischapternum{\the\chapno}%
  4627.       % \noexpand\putwordChapter avoids expanding indigestible
  4628.       % commands in some of the translations.
  4629.       \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
  4630.                                  \noexpand\thischapternum:
  4631.                                  \noexpand\thischaptername}%
  4632.     }%
  4633.   \fi\fi\fi
  4634.   % Output the mark.  Pass it through \safewhatsit, to take care of
  4635.   % the preceding space.
  4636.   \safewhatsit\domark
  4637.   % Insert the chapter heading break.
  4638.   \pchapsepmacro
  4639.   % Now the second mark, after the heading break.  No break points
  4640.   % between here and the heading.
  4641.   \let\prevchapterdefs=\lastchapterdefs
  4642.   \let\prevsectiondefs=\lastsectiondefs
  4643.   \domark
  4644.     \chapfonts \rmisbold
  4645.     %
  4646.     % Have to define \lastsection before calling \donoderef, because the
  4647.     % xref code eventually uses it.  On the other hand, it has to be called
  4648.     % after \pchapsepmacro, or the headline will change too soon.
  4649.     \gdef\lastsection{#1}%
  4650.     %
  4651.     % Only insert the separating space if we have a chapter/appendix
  4652.     % number, and don't print the unnumbered ``number''.
  4653.     \ifx\temptype\Ynothingkeyword
  4654.       \setbox0 = \hbox{}%
  4655.       \def\toctype{unnchap}%
  4656.     \else\ifx\temptype\Yomitfromtockeyword
  4657.       \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
  4658.       \def\toctype{omit}%
  4659.     \else\ifx\temptype\Yappendixkeyword
  4660.       \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
  4661.       \def\toctype{app}%
  4662.     \else
  4663.       \setbox0 = \hbox{#3\enspace}%
  4664.       \def\toctype{numchap}%
  4665.     \fi\fi\fi
  4666.     %
  4667.     % Write the toc entry for this chapter.  Must come before the
  4668.     % \donoderef, because we include the current node name in the toc
  4669.     % entry, and \donoderef resets it to empty.
  4670.     \writetocentry{\toctype}{#1}{#3}%
  4671.     %
  4672.     % For pdftex, we have to write out the node definition (aka, make
  4673.     % the pdfdest) after any page break, but before the actual text has
  4674.     % been typeset.  If the destination for the pdf outline is after the
  4675.     % text, then jumping from the outline may wind up with the text not
  4676.     % being visible, for instance under high magnification.
  4677.     \donoderef{#2}%
  4678.     %
  4679.     % Typeset the actual heading.
  4680.     \nobreak % Avoid page breaks at the interline glue.
  4681.     \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
  4682.           \hangindent=\wd0 \centerparametersmaybe
  4683.           \unhbox0 #1\par}%
  4684.   \nobreak\bigskip % no page break after a chapter title
  4685.   \nobreak
  4686. % @centerchap -- centered and unnumbered.
  4687. \let\centerparametersmaybe = \relax
  4688. \def\centerparameters{%
  4689.   \advance\rightskip by 3\rightskip
  4690.   \leftskip = \rightskip
  4691.   \parfillskip = 0pt
  4692. % I don't think this chapter style is supported any more, so I'm not
  4693. % updating it with the new noderef stuff.  We'll see.  --karl, 11aug03.
  4694. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  4695. \def\unnchfopen #1{%
  4696. \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  4697.                        \parindent=0pt\ptexraggedright
  4698.                        \rmisbold #1\hfill}}\bigskip \par\nobreak
  4699. \def\chfopen #1#2{\chapoddpage {\chapfonts
  4700. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  4701. \par\penalty 5000 %
  4702. \def\centerchfopen #1{%
  4703. \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  4704.                        \parindent=0pt
  4705.                        \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
  4706. \def\CHAPFopen{%
  4707.   \global\let\chapmacro=\chfopen
  4708.   \global\let\centerchapmacro=\centerchfopen}
  4709. % Section titles.  These macros combine the section number parts and
  4710. % call the generic \sectionheading to do the printing.
  4711. \newskip\secheadingskip
  4712. \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
  4713. % Subsection titles.
  4714. \newskip\subsecheadingskip
  4715. \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
  4716. % Subsubsection titles.
  4717. \def\subsubsecheadingskip{\subsecheadingskip}
  4718. \def\subsubsecheadingbreak{\subsecheadingbreak}
  4719. % Print any size, any type, section title.
  4720. % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
  4721. % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
  4722. % section number.
  4723. \def\seckeyword{sec}
  4724. \def\sectionheading#1#2#3#4{%
  4725.     \checkenv{}% should not be in an environment.
  4726.     %
  4727.     % Switch to the right set of fonts.
  4728.     \csname #2fonts\endcsname \rmisbold
  4729.     %
  4730.     \def\sectionlevel{#2}%
  4731.     \def\temptype{#3}%
  4732.     %
  4733.     % Insert first mark before the heading break (see notes for \domark).
  4734.     \let\prevsectiondefs=\lastsectiondefs
  4735.     \ifx\temptype\Ynothingkeyword
  4736.       \ifx\sectionlevel\seckeyword
  4737.         \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
  4738.                               \gdef\thissection{\thissectionname}}%
  4739.       \fi
  4740.     \else\ifx\temptype\Yomitfromtockeyword
  4741.       % Don't redefine \thissection.
  4742.     \else\ifx\temptype\Yappendixkeyword
  4743.       \ifx\sectionlevel\seckeyword
  4744.         \toks0={#1}%
  4745.         \xdef\lastsectiondefs{%
  4746.           \gdef\noexpand\thissectionname{\the\toks0}%
  4747.           \gdef\noexpand\thissectionnum{#4}%
  4748.           % \noexpand\putwordSection avoids expanding indigestible
  4749.           % commands in some of the translations.
  4750.           \gdef\noexpand\thissection{\noexpand\putwordSection{}
  4751.                                      \noexpand\thissectionnum:
  4752.                                      \noexpand\thissectionname}%
  4753.         }%
  4754.       \fi
  4755.     \else
  4756.       \ifx\sectionlevel\seckeyword
  4757.         \toks0={#1}%
  4758.         \xdef\lastsectiondefs{%
  4759.           \gdef\noexpand\thissectionname{\the\toks0}%
  4760.           \gdef\noexpand\thissectionnum{#4}%
  4761.           % \noexpand\putwordSection avoids expanding indigestible
  4762.           % commands in some of the translations.
  4763.           \gdef\noexpand\thissection{\noexpand\putwordSection{}
  4764.                                      \noexpand\thissectionnum:
  4765.                                      \noexpand\thissectionname}%
  4766.         }%
  4767.       \fi
  4768.     \fi\fi\fi
  4769.     %
  4770.     % Go into vertical mode.  Usually we'll already be there, but we
  4771.     % don't want the following whatsit to end up in a preceding paragraph
  4772.     % if the document didn't happen to have a blank line.
  4773.     \par
  4774.     %
  4775.     % Output the mark.  Pass it through \safewhatsit, to take care of
  4776.     % the preceding space.
  4777.     \safewhatsit\domark
  4778.     %
  4779.     % Insert space above the heading.
  4780.     \csname #2headingbreak\endcsname
  4781.     %
  4782.     % Now the second mark, after the heading break.  No break points
  4783.     % between here and the heading.
  4784.     \let\prevsectiondefs=\lastsectiondefs
  4785.     \domark
  4786.     %
  4787.     % Only insert the space after the number if we have a section number.
  4788.     \ifx\temptype\Ynothingkeyword
  4789.       \setbox0 = \hbox{}%
  4790.       \def\toctype{unn}%
  4791.       \gdef\lastsection{#1}%
  4792.     \else\ifx\temptype\Yomitfromtockeyword
  4793.       % for @headings -- no section number, don't include in toc,
  4794.       % and don't redefine \lastsection.
  4795.       \setbox0 = \hbox{}%
  4796.       \def\toctype{omit}%
  4797.       \let\sectionlevel=\empty
  4798.     \else\ifx\temptype\Yappendixkeyword
  4799.       \setbox0 = \hbox{#4\enspace}%
  4800.       \def\toctype{app}%
  4801.       \gdef\lastsection{#1}%
  4802.     \else
  4803.       \setbox0 = \hbox{#4\enspace}%
  4804.       \def\toctype{num}%
  4805.       \gdef\lastsection{#1}%
  4806.     \fi\fi\fi
  4807.     %
  4808.     % Write the toc entry (before \donoderef).  See comments in \chapmacro.
  4809.     \writetocentry{\toctype\sectionlevel}{#1}{#4}%
  4810.     %
  4811.     % Write the node reference (= pdf destination for pdftex).
  4812.     % Again, see comments in \chapmacro.
  4813.     \donoderef{#3}%
  4814.     %
  4815.     % Interline glue will be inserted when the vbox is completed.
  4816.     % That glue will be a valid breakpoint for the page, since it'll be
  4817.     % preceded by a whatsit (usually from the \donoderef, or from the
  4818.     % \writetocentry if there was no node).  We don't want to allow that
  4819.     % break, since then the whatsits could end up on page n while the
  4820.     % section is on page n+1, thus toc/etc. are wrong.  Debian bug 276000.
  4821.     \nobreak
  4822.     %
  4823.     % Output the actual section heading.
  4824.     \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
  4825.           \hangindent=\wd0  % zero if no section number
  4826.           \unhbox0 #1}%
  4827.   % Add extra space after the heading -- half of whatever came above it.
  4828.   % Don't allow stretch, though.
  4829.   \kern .5 \csname #2headingskip\endcsname
  4830.   % Do not let the kern be a potential breakpoint, as it would be if it
  4831.   % was followed by glue.
  4832.   \nobreak
  4833.   % We'll almost certainly start a paragraph next, so don't let that
  4834.   % glue accumulate.  (Not a breakpoint because it's preceded by a
  4835.   % discardable item.)
  4836.   \vskip-\parskip
  4837.   % This is purely so the last item on the list is a known \penalty >
  4838.   % 10000.  This is so \startdefun can avoid allowing breakpoints after
  4839.   % section headings.  Otherwise, it would insert a valid breakpoint between:
  4840.   %   @section sec-whatever
  4841.   %   @deffn def-whatever
  4842.   \penalty 10001
  4843. \message{toc,}
  4844. % Table of contents.
  4845. \newwrite\tocfile
  4846. % Write an entry to the toc file, opening it if necessary.
  4847. % Called from @chapter, etc.
  4848. % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
  4849. % We append the current node name (if any) and page number as additional
  4850. % arguments for the \{chap,sec,...}entry macros which will eventually
  4851. % read this.  The node name is used in the pdf outlines as the
  4852. % destination to jump to.
  4853. % We open the .toc file for writing here instead of at @setfilename (or
  4854. % any other fixed time) so that @contents can be anywhere in the document.
  4855. % But if #1 is `omit', then we don't do anything.  This is used for the
  4856. % table of contents chapter openings themselves.
  4857. \newif\iftocfileopened
  4858. \def\omitkeyword{omit}%
  4859. \def\writetocentry#1#2#3{%
  4860.   \edef\writetoctype{#1}%
  4861.   \ifx\writetoctype\omitkeyword \else
  4862.     \iftocfileopened\else
  4863.       \immediate\openout\tocfile = \jobname.toc
  4864.       \global\tocfileopenedtrue
  4865.     \fi
  4866.     %
  4867.     \iflinks
  4868.       {\atdummies
  4869.        \edef\temp{%
  4870.          \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
  4871.        \temp
  4872.       }%
  4873.     \fi
  4874.   \fi
  4875.   % Tell \shipout to create a pdf destination on each page, if we're
  4876.   % writing pdf.  These are used in the table of contents.  We can't
  4877.   % just write one on every page because the title pages are numbered
  4878.   % 1 and 2 (the page numbers aren't printed), and so are the first
  4879.   % two pages of the document.  Thus, we'd have two destinations named
  4880.   % `1', and two named `2'.
  4881.   \ifpdf \global\pdfmakepagedesttrue \fi
  4882. % These characters do not print properly in the Computer Modern roman
  4883. % fonts, so we must take special care.  This is more or less redundant
  4884. % with the Texinfo input format setup at the end of this file.
  4885. \def\activecatcodes{%
  4886.   \catcode`\"=\active
  4887.   \catcode`\$=\active
  4888.   \catcode`\<=\active
  4889.   \catcode`\>=\active
  4890.   \catcode`\\=\active
  4891.   \catcode`\^=\active
  4892.   \catcode`\_=\active
  4893.   \catcode`\|=\active
  4894.   \catcode`\~=\active
  4895. % Read the toc file, which is essentially Texinfo input.
  4896. \def\readtocfile{%
  4897.   \setupdatafile
  4898.   \activecatcodes
  4899.   \input \tocreadfilename
  4900. \newskip\contentsrightmargin \contentsrightmargin=1in
  4901. \newcount\savepageno
  4902. \newcount\lastnegativepageno \lastnegativepageno = -1
  4903. % Prepare to read what we've written to \tocfile.
  4904. \def\startcontents#1{%
  4905.   % If @setchapternewpage on, and @headings double, the contents should
  4906.   % start on an odd page, unlike chapters.  Thus, we maintain
  4907.   % \contentsalignmacro in parallel with \pagealignmacro.
  4908.   % From: Torbjorn Granlund <tege@matematik.su.se>
  4909.   \contentsalignmacro
  4910.   \immediate\closeout\tocfile
  4911.   % Don't need to put `Contents' or `Short Contents' in the headline.
  4912.   % It is abundantly clear what they are.
  4913.   \chapmacro{#1}{Yomitfromtoc}{}%
  4914.   \savepageno = \pageno
  4915.   \begingroup                  % Set up to handle contents files properly.
  4916.     \raggedbottom              % Worry more about breakpoints than the bottom.
  4917.     \advance\hsize by -\contentsrightmargin % Don't use the full line length.
  4918.     %
  4919.     % Roman numerals for page numbers.
  4920.     \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
  4921. % redefined for the two-volume lispref.  We always output on
  4922. % \jobname.toc even if this is redefined.
  4923. \def\tocreadfilename{\jobname.toc}
  4924. % Normal (long) toc.
  4925. \def\contents{%
  4926.   \startcontents{\putwordTOC}%
  4927.     \openin 1 \tocreadfilename\space
  4928.     \ifeof 1 \else
  4929.       \readtocfile
  4930.     \fi
  4931.     \vfill \eject
  4932.     \contentsalignmacro % in case @setchapternewpage odd is in effect
  4933.     \ifeof 1 \else
  4934.       \pdfmakeoutlines
  4935.     \fi
  4936.     \closein 1
  4937.   \endgroup
  4938.   \lastnegativepageno = \pageno
  4939.   \global\pageno = \savepageno
  4940. % And just the chapters.
  4941. \def\summarycontents{%
  4942.   \startcontents{\putwordShortTOC}%
  4943.     %
  4944.     \let\partentry = \shortpartentry
  4945.     \let\numchapentry = \shortchapentry
  4946.     \let\appentry = \shortchapentry
  4947.     \let\unnchapentry = \shortunnchapentry
  4948.     % We want a true roman here for the page numbers.
  4949.     \secfonts
  4950.     \let\rm=\shortcontrm \let\bf=\shortcontbf
  4951.     \let\sl=\shortcontsl \let\tt=\shortconttt
  4952.     \rm
  4953.     \hyphenpenalty = 10000
  4954.     \advance\baselineskip by 1pt % Open it up a little.
  4955.     \def\numsecentry##1##2##3##4{}
  4956.     \let\appsecentry = \numsecentry
  4957.     \let\unnsecentry = \numsecentry
  4958.     \let\numsubsecentry = \numsecentry
  4959.     \let\appsubsecentry = \numsecentry
  4960.     \let\unnsubsecentry = \numsecentry
  4961.     \let\numsubsubsecentry = \numsecentry
  4962.     \let\appsubsubsecentry = \numsecentry
  4963.     \let\unnsubsubsecentry = \numsecentry
  4964.     \openin 1 \tocreadfilename\space
  4965.     \ifeof 1 \else
  4966.       \readtocfile
  4967.     \fi
  4968.     \closein 1
  4969.     \vfill \eject
  4970.     \contentsalignmacro % in case @setchapternewpage odd is in effect
  4971.   \endgroup
  4972.   \lastnegativepageno = \pageno
  4973.   \global\pageno = \savepageno
  4974. \let\shortcontents = \summarycontents
  4975. % Typeset the label for a chapter or appendix for the short contents.
  4976. % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
  4977. \def\shortchaplabel#1{%
  4978.   % This space should be enough, since a single number is .5em, and the
  4979.   % widest letter (M) is 1em, at least in the Computer Modern fonts.
  4980.   % But use \hss just in case.
  4981.   % (This space doesn't include the extra space that gets added after
  4982.   % the label; that gets put in by \shortchapentry above.)
  4983.   % We'd like to right-justify chapter numbers, but that looks strange
  4984.   % with appendix letters.  And right-justifying numbers and
  4985.   % left-justifying letters looks strange when there is less than 10
  4986.   % chapters.  Have to read the whole toc once to know how many chapters
  4987.   % there are before deciding ...
  4988.   \hbox to 1em{#1\hss}%
  4989. % These macros generate individual entries in the table of contents.
  4990. % The first argument is the chapter or section name.
  4991. % The last argument is the page number.
  4992. % The arguments in between are the chapter number, section number, ...
  4993. % Parts, in the main contents.  Replace the part number, which doesn't
  4994. % exist, with an empty box.  Let's hope all the numbers have the same width.
  4995. % Also ignore the page number, which is conventionally not printed.
  4996. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
  4997. \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
  4998. % Parts, in the short toc.
  4999. \def\shortpartentry#1#2#3#4{%
  5000.   \penalty-300
  5001.   \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
  5002.   \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
  5003. % Chapters, in the main contents.
  5004. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
  5005. % Chapters, in the short toc.
  5006. % See comments in \dochapentry re vbox and related settings.
  5007. \def\shortchapentry#1#2#3#4{%
  5008.   \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
  5009. % Appendices, in the main contents.
  5010. % Need the word Appendix, and a fixed-size box.
  5011. \def\appendixbox#1{%
  5012.   % We use M since it's probably the widest letter.
  5013.   \setbox0 = \hbox{\putwordAppendix{} M}%
  5014.   \hbox to \wd0{\putwordAppendix{} #1\hss}}
  5015. \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
  5016. % Unnumbered chapters.
  5017. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
  5018. \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
  5019. % Sections.
  5020. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
  5021. \let\appsecentry=\numsecentry
  5022. \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
  5023. % Subsections.
  5024. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
  5025. \let\appsubsecentry=\numsubsecentry
  5026. \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
  5027. % And subsubsections.
  5028. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
  5029. \let\appsubsubsecentry=\numsubsubsecentry
  5030. \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
  5031. % This parameter controls the indentation of the various levels.
  5032. % Same as \defaultparindent.
  5033. \newdimen\tocindent \tocindent = 15pt
  5034. % Now for the actual typesetting. In all these, #1 is the text and #2 is the
  5035. % page number.
  5036. % If the toc has to be broken over pages, we want it to be at chapters
  5037. % if at all possible; hence the \penalty.
  5038. \def\dochapentry#1#2{%
  5039.    \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
  5040.    \begingroup
  5041.      \chapentryfonts
  5042.      \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5043.    \endgroup
  5044.    \nobreak\vskip .25\baselineskip plus.1\baselineskip
  5045. \def\dosecentry#1#2{\begingroup
  5046.   \secentryfonts \leftskip=\tocindent
  5047.   \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5048. \endgroup}
  5049. \def\dosubsecentry#1#2{\begingroup
  5050.   \subsecentryfonts \leftskip=2\tocindent
  5051.   \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5052. \endgroup}
  5053. \def\dosubsubsecentry#1#2{\begingroup
  5054.   \subsubsecentryfonts \leftskip=3\tocindent
  5055.   \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5056. \endgroup}
  5057. % We use the same \entry macro as for the index entries.
  5058. \let\tocentry = \entry
  5059. % Space between chapter (or whatever) number and the title.
  5060. \def\labelspace{\hskip1em \relax}
  5061. \def\dopageno#1{{\rm #1}}
  5062. \def\doshortpageno#1{{\rm #1}}
  5063. \def\chapentryfonts{\secfonts \rm}
  5064. \def\secentryfonts{\textfonts}
  5065. \def\subsecentryfonts{\textfonts}
  5066. \def\subsubsecentryfonts{\textfonts}
  5067. \message{environments,}
  5068. % @foo ... @end foo.
  5069. % @tex ... @end tex    escapes into raw TeX temporarily.
  5070. % One exception: @ is still an escape character, so that @end tex works.
  5071. % But \@ or @@ will get a plain @ character.
  5072. \envdef\tex{%
  5073.   \setupmarkupstyle{tex}%
  5074.   \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  5075.   \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  5076.   \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
  5077.   \catcode `\%=14
  5078.   \catcode `\+=\other
  5079.   \catcode `\"=\other
  5080.   \catcode `\|=\other
  5081.   \catcode `\<=\other
  5082.   \catcode `\>=\other
  5083.   \catcode`\`=\other
  5084.   \catcode`\'=\other
  5085.   \escapechar=`\\
  5086.   % ' is active in math mode (mathcode"8000).  So reset it, and all our
  5087.   % other math active characters (just in case), to plain's definitions.
  5088.   \mathactive
  5089.   \let\b=\ptexb
  5090.   \let\bullet=\ptexbullet
  5091.   \let\c=\ptexc
  5092.   \let\,=\ptexcomma
  5093.   \let\.=\ptexdot
  5094.   \let\dots=\ptexdots
  5095.   \let\equiv=\ptexequiv
  5096.   \let\!=\ptexexclam
  5097.   \let\i=\ptexi
  5098.   \let\indent=\ptexindent
  5099.   \let\noindent=\ptexnoindent
  5100.   \let\{=\ptexlbrace
  5101.   \let\+=\tabalign
  5102.   \let\}=\ptexrbrace
  5103.   \let\/=\ptexslash
  5104.   \let\*=\ptexstar
  5105.   \let\t=\ptext
  5106.   \expandafter \let\csname top\endcsname=\ptextop  % outer
  5107.   \let\frenchspacing=\plainfrenchspacing
  5108.   \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
  5109.   \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
  5110.   \def\@{@}%
  5111. % There is no need to define \Etex.
  5112. % Define @lisp ... @end lisp.
  5113. % @lisp environment forms a group so it can rebind things,
  5114. % including the definition of @end lisp (which normally is erroneous).
  5115. % Amount to narrow the margins by for @lisp.
  5116. \newskip\lispnarrowing \lispnarrowing=0.4in
  5117. % This is the definition that ^^M gets inside @lisp, @example, and other
  5118. % such environments.  \null is better than a space, since it doesn't
  5119. % have any width.
  5120. \def\lisppar{\null\endgraf}
  5121. % This space is always present above and below environments.
  5122. \newskip\envskipamount \envskipamount = 0pt
  5123. % Make spacing and below environment symmetrical.  We use \parskip here
  5124. % to help in doing that, since in @example-like environments \parskip
  5125. % is reset to zero; thus the \afterenvbreak inserts no space -- but the
  5126. % start of the next paragraph will insert \parskip.
  5127. \def\aboveenvbreak{{%
  5128.   % =10000 instead of <10000 because of a special case in \itemzzz and
  5129.   % \sectionheading, q.v.
  5130.   \ifnum \lastpenalty=10000 \else
  5131.     \advance\envskipamount by \parskip
  5132.     \endgraf
  5133.     \ifdim\lastskip<\envskipamount
  5134.       \removelastskip
  5135.       % it's not a good place to break if the last penalty was \nobreak
  5136.       % or better ...
  5137.       \ifnum\lastpenalty<10000 \penalty-50 \fi
  5138.       \vskip\envskipamount
  5139.     \fi
  5140.   \fi
  5141. \let\afterenvbreak = \aboveenvbreak
  5142. % \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins; it will
  5143. % also clear it, so that its embedded environments do the narrowing again.
  5144. \let\nonarrowing=\relax
  5145. % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
  5146. % environment contents.
  5147. \font\circle=lcircle10
  5148. \newdimen\circthick
  5149. \newdimen\cartouter\newdimen\cartinner
  5150. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  5151. \circthick=\fontdimen8\circle
  5152. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  5153. \def\ctr{{\hskip 6pt\circle\char'010}}
  5154. \def\cbl{{\circle\char'012\hskip -6pt}}
  5155. \def\cbr{{\hskip 6pt\circle\char'011}}
  5156. \def\carttop{\hbox to \cartouter{\hskip\lskip
  5157.         \ctl\leaders\hrule height\circthick\hfil\ctr
  5158.         \hskip\rskip}}
  5159. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  5160.         \cbl\leaders\hrule height\circthick\hfil\cbr
  5161.         \hskip\rskip}}
  5162. \newskip\lskip\newskip\rskip
  5163. \envdef\cartouche{%
  5164.   \ifhmode\par\fi  % can't be in the midst of a paragraph.
  5165.   \startsavinginserts
  5166.   \lskip=\leftskip \rskip=\rightskip
  5167.   \leftskip=0pt\rightskip=0pt % we want these *outside*.
  5168.   \cartinner=\hsize \advance\cartinner by-\lskip
  5169.   \advance\cartinner by-\rskip
  5170.   \cartouter=\hsize
  5171.   \advance\cartouter by 18.4pt    % allow for 3pt kerns on either
  5172.                 % side, and for 6pt waste from
  5173.                 % each corner char, and rule thickness
  5174.   \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  5175.   % Flag to tell @lisp, etc., not to narrow margin.
  5176.   \let\nonarrowing = t%
  5177.   % If this cartouche directly follows a sectioning command, we need the
  5178.   % \parskip glue (backspaced over by default) or the cartouche can
  5179.   % collide with the section heading.
  5180.   \ifnum\lastpenalty>10000 \vskip\parskip \fi
  5181.   \vbox\bgroup
  5182.       \baselineskip=0pt\parskip=0pt\lineskip=0pt
  5183.       \carttop
  5184.       \hbox\bgroup
  5185.       \hskip\lskip
  5186.       \vrule\kern3pt
  5187.       \vbox\bgroup
  5188.           \kern3pt
  5189.           \hsize=\cartinner
  5190.           \baselineskip=\normbskip
  5191.           \lineskip=\normlskip
  5192.           \parskip=\normpskip
  5193.           \vskip -\parskip
  5194.           \comment % For explanation, see the end of def\group.
  5195. \def\Ecartouche{%
  5196.               \ifhmode\par\fi
  5197.           \kern3pt
  5198.       \egroup
  5199.       \kern3pt\vrule
  5200.       \hskip\rskip
  5201.       \egroup
  5202.       \cartbot
  5203.   \egroup
  5204.   \checkinserts
  5205. % This macro is called at the beginning of all the @example variants,
  5206. % inside a group.
  5207. \newdimen\nonfillparindent
  5208. \def\nonfillstart{%
  5209.   \aboveenvbreak
  5210.   \hfuzz = 12pt % Don't be fussy
  5211.   \sepspaces % Make spaces be word-separators rather than space tokens.
  5212.   \let\par = \lisppar % don't ignore blank lines
  5213.   \obeylines % each line of input is a line of output
  5214.   \parskip = 0pt
  5215.   % Turn off paragraph indentation but redefine \indent to emulate
  5216.   % the normal \indent.
  5217.   \nonfillparindent=\parindent
  5218.   \parindent = 0pt
  5219.   \let\indent\nonfillindent
  5220.   \emergencystretch = 0pt % don't try to avoid overfull boxes
  5221.   \ifx\nonarrowing\relax
  5222.     \advance \leftskip by \lispnarrowing
  5223.     \exdentamount=\lispnarrowing
  5224.   \else
  5225.     \let\nonarrowing = \relax
  5226.   \fi
  5227.   \let\exdent=\nofillexdent
  5228. \begingroup
  5229. \obeyspaces
  5230. % We want to swallow spaces (but not other tokens) after the fake
  5231. % @indent in our nonfill-environments, where spaces are normally
  5232. % active and set to @tie, resulting in them not being ignored after
  5233. % @indent.
  5234. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
  5235. \gdef\nonfillindentcheck{%
  5236. \ifx\temp %
  5237. \expandafter\nonfillindentgobble%
  5238. \else%
  5239. \leavevmode\nonfillindentbox%
  5240. \endgroup
  5241. \def\nonfillindentgobble#1{\nonfillindent}
  5242. \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
  5243. % If you want all examples etc. small: @set dispenvsize small.
  5244. % If you want even small examples the full size: @set dispenvsize nosmall.
  5245. % This affects the following displayed environments:
  5246. %    @example, @display, @format, @lisp
  5247. \def\smallword{small}
  5248. \def\nosmallword{nosmall}
  5249. \let\SETdispenvsize\relax
  5250. \def\setnormaldispenv{%
  5251.   \ifx\SETdispenvsize\smallword
  5252.     % end paragraph for sake of leading, in case document has no blank
  5253.     % line.  This is redundant with what happens in \aboveenvbreak, but
  5254.     % we need to do it before changing the fonts, and it's inconvenient
  5255.     % to change the fonts afterward.
  5256.     \ifnum \lastpenalty=10000 \else \endgraf \fi
  5257.     \smallexamplefonts \rm
  5258.   \fi
  5259. \def\setsmalldispenv{%
  5260.   \ifx\SETdispenvsize\nosmallword
  5261.   \else
  5262.     \ifnum \lastpenalty=10000 \else \endgraf \fi
  5263.     \smallexamplefonts \rm
  5264.   \fi
  5265. % We often define two environments, @foo and @smallfoo.
  5266. % Let's do it in one command.  #1 is the env name, #2 the definition.
  5267. \def\makedispenvdef#1#2{%
  5268.   \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
  5269.   \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
  5270.   \expandafter\let\csname E#1\endcsname \afterenvbreak
  5271.   \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
  5272. % Define two environment synonyms (#1 and #2) for an environment.
  5273. \def\maketwodispenvdef#1#2#3{%
  5274.   \makedispenvdef{#1}{#3}%
  5275.   \makedispenvdef{#2}{#3}%
  5276. % @lisp: indented, narrowed, typewriter font;
  5277. % @example: same as @lisp.
  5278. % @smallexample and @smalllisp: use smaller fonts.
  5279. % Originally contributed by Pavel@xerox.
  5280. \maketwodispenvdef{lisp}{example}{%
  5281.   \nonfillstart
  5282.   \tt\setupmarkupstyle{example}%
  5283.   \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
  5284.   \gobble % eat return
  5285. % @display/@smalldisplay: same as @lisp except keep current font.
  5286. \makedispenvdef{display}{%
  5287.   \nonfillstart
  5288.   \gobble
  5289. % @format/@smallformat: same as @display except don't narrow margins.
  5290. \makedispenvdef{format}{%
  5291.   \let\nonarrowing = t%
  5292.   \nonfillstart
  5293.   \gobble
  5294. % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
  5295. \envdef\flushleft{%
  5296.   \let\nonarrowing = t%
  5297.   \nonfillstart
  5298.   \gobble
  5299. \let\Eflushleft = \afterenvbreak
  5300. % @flushright.
  5301. \envdef\flushright{%
  5302.   \let\nonarrowing = t%
  5303.   \nonfillstart
  5304.   \advance\leftskip by 0pt plus 1fill\relax
  5305.   \gobble
  5306. \let\Eflushright = \afterenvbreak
  5307. % @raggedright does more-or-less normal line breaking but no right
  5308. % justification.  From plain.tex.
  5309. \envdef\raggedright{%
  5310.   \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
  5311. \let\Eraggedright\par
  5312. \envdef\raggedleft{%
  5313.   \parindent=0pt \leftskip0pt plus2em
  5314.   \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  5315.   \hbadness=10000 % Last line will usually be underfull, so turn off
  5316.                   % badness reporting.
  5317. \let\Eraggedleft\par
  5318. \envdef\raggedcenter{%
  5319.   \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
  5320.   \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  5321.   \hbadness=10000 % Last line will usually be underfull, so turn off
  5322.                   % badness reporting.
  5323. \let\Eraggedcenter\par
  5324. % @quotation does normal linebreaking (hence we can't use \nonfillstart)
  5325. % and narrows the margins.  We keep \parskip nonzero in general, since
  5326. % we're doing normal filling.  So, when using \aboveenvbreak and
  5327. % \afterenvbreak, temporarily make \parskip 0.
  5328. \makedispenvdef{quotation}{\quotationstart}
  5329. \def\quotationstart{%
  5330.   {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
  5331.   \parindent=0pt
  5332.   % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
  5333.   \ifx\nonarrowing\relax
  5334.     \advance\leftskip by \lispnarrowing
  5335.     \advance\rightskip by \lispnarrowing
  5336.     \exdentamount = \lispnarrowing
  5337.   \else
  5338.     \let\nonarrowing = \relax
  5339.   \fi
  5340.   \parsearg\quotationlabel
  5341. % We have retained a nonzero parskip for the environment, since we're
  5342. % doing normal filling.
  5343. \def\Equotation{%
  5344.   \par
  5345.   \ifx\quotationauthor\thisisundefined\else
  5346.     % indent a bit.
  5347.     \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
  5348.   \fi
  5349.   {\parskip=0pt \afterenvbreak}%
  5350. \def\Esmallquotation{\Equotation}
  5351. % If we're given an argument, typeset it in bold with a colon after.
  5352. \def\quotationlabel#1{%
  5353.   \def\temp{#1}%
  5354.   \ifx\temp\empty \else
  5355.     {\bf #1: }%
  5356.   \fi
  5357. % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
  5358. % If we want to allow any <char> as delimiter,
  5359. % we need the curly braces so that makeinfo sees the @verb command, eg:
  5360. % `@verbx...x' would look like the '@verbx' command.  --janneke@gnu.org
  5361. % [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
  5362. % [Knuth] p.344; only we need to do the other characters Texinfo sets
  5363. % active too.  Otherwise, they get lost as the first character on a
  5364. % verbatim line.
  5365. \def\dospecials{%
  5366.   \do\ \do\\\do\{\do\}\do\$\do\&%
  5367.   \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
  5368.   \do\<\do\>\do\|\do\@\do+\do\"%
  5369.   % Don't do the quotes -- if we do, @set txicodequoteundirected and
  5370.   % @set txicodequotebacktick will not have effect on @verb and
  5371.   % @verbatim, and ?` and !` ligatures won't get disabled.
  5372.   %\do\`\do\'%
  5373. % [Knuth] p. 380
  5374. \def\uncatcodespecials{%
  5375.   \def\do##1{\catcode`##1=\other}\dospecials}
  5376. % Setup for the @verb command.
  5377. % Eight spaces for a tab
  5378. \begingroup
  5379.   \catcode`\^^I=\active
  5380.   \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
  5381. \endgroup
  5382. \def\setupverb{%
  5383.   \tt  % easiest (and conventionally used) font for verbatim
  5384.   \def\par{\leavevmode\endgraf}%
  5385.   \setupmarkupstyle{verb}%
  5386.   \tabeightspaces
  5387.   % Respect line breaks,
  5388.   % print special symbols as themselves, and
  5389.   % make each space count
  5390.   % must do in this order:
  5391.   \obeylines \uncatcodespecials \sepspaces
  5392. % Setup for the @verbatim environment
  5393. % Real tab expansion.
  5394. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
  5395. % We typeset each line of the verbatim in an \hbox, so we can handle
  5396. % tabs.  The \global is in case the verbatim line starts with an accent,
  5397. % or some other command that starts with a begin-group.  Otherwise, the
  5398. % entire \verbbox would disappear at the corresponding end-group, before
  5399. % it is typeset.  Meanwhile, we can't have nested verbatim commands
  5400. % (can we?), so the \global won't be overwriting itself.
  5401. \newbox\verbbox
  5402. \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
  5403. \begingroup
  5404.   \catcode`\^^I=\active
  5405.   \gdef\tabexpand{%
  5406.     \catcode`\^^I=\active
  5407.     \def^^I{\leavevmode\egroup
  5408.       \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
  5409.       \divide\dimen\verbbox by\tabw
  5410.       \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
  5411.       \advance\dimen\verbbox by\tabw  % advance to next multiple of \tabw
  5412.       \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
  5413.     }%
  5414. \endgroup
  5415. % start the verbatim environment.
  5416. \def\setupverbatim{%
  5417.   \let\nonarrowing = t%
  5418.   \nonfillstart
  5419.   \tt % easiest (and conventionally used) font for verbatim
  5420.   % The \leavevmode here is for blank lines.  Otherwise, we would
  5421.   % never \starttabox and the \egroup would end verbatim mode.
  5422.   \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
  5423.   \tabexpand
  5424.   \setupmarkupstyle{verbatim}%
  5425.   % Respect line breaks,
  5426.   % print special symbols as themselves, and
  5427.   % make each space count.
  5428.   % Must do in this order:
  5429.   \obeylines \uncatcodespecials \sepspaces
  5430.   \everypar{\starttabbox}%
  5431. % Do the @verb magic: verbatim text is quoted by unique
  5432. % delimiter characters.  Before first delimiter expect a
  5433. % right brace, after last delimiter expect closing brace:
  5434. %    \def\doverb'{'<char>#1<char>'}'{#1}
  5435. % [Knuth] p. 382; only eat outer {}
  5436. \begingroup
  5437.   \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
  5438.   \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
  5439. \endgroup
  5440. \def\verb{\begingroup\setupverb\doverb}
  5441. % Do the @verbatim magic: define the macro \doverbatim so that
  5442. % the (first) argument ends when '@end verbatim' is reached, ie:
  5443. %     \def\doverbatim#1@end verbatim{#1}
  5444. % For Texinfo it's a lot easier than for LaTeX,
  5445. % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
  5446. % we need not redefine '\', '{' and '}'.
  5447. % Inspired by LaTeX's verbatim command set [latex.ltx]
  5448. \begingroup
  5449.   \catcode`\ =\active
  5450.   \obeylines %
  5451.   % ignore everything up to the first ^^M, that's the newline at the end
  5452.   % of the @verbatim input line itself.  Otherwise we get an extra blank
  5453.   % line in the output.
  5454.   \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
  5455.   % We really want {...\end verbatim} in the body of the macro, but
  5456.   % without the active space; thus we have to use \xdef and \gobble.
  5457. \endgroup
  5458. \envdef\verbatim{%
  5459.     \setupverbatim\doverbatim
  5460. \let\Everbatim = \afterenvbreak
  5461. % @verbatiminclude FILE - insert text of file in verbatim environment.
  5462. \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
  5463. \def\doverbatiminclude#1{%
  5464.     \makevalueexpandable
  5465.     \setupverbatim
  5466.     \indexnofonts       % Allow `@@' and other weird things in file names.
  5467.     \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
  5468.     \input #1
  5469.     \afterenvbreak
  5470. % @copying ... @end copying.
  5471. % Save the text away for @insertcopying later.
  5472. % We save the uninterpreted tokens, rather than creating a box.
  5473. % Saving the text in a box would be much easier, but then all the
  5474. % typesetting commands (@smallbook, font changes, etc.) have to be done
  5475. % beforehand -- and a) we want @copying to be done first in the source
  5476. % file; b) letting users define the frontmatter in as flexible order as
  5477. % possible is very desirable.
  5478. \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
  5479. \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
  5480. \def\insertcopying{%
  5481.   \begingroup
  5482.     \parindent = 0pt  % paragraph indentation looks wrong on title page
  5483.     \scanexp\copyingtext
  5484.   \endgroup
  5485. \message{defuns,}
  5486. % @defun etc.
  5487. \newskip\defbodyindent \defbodyindent=.4in
  5488. \newskip\defargsindent \defargsindent=50pt
  5489. \newskip\deflastargmargin \deflastargmargin=18pt
  5490. \newcount\defunpenalty
  5491. % Start the processing of @deffn:
  5492. \def\startdefun{%
  5493.   \ifnum\lastpenalty<10000
  5494.     \medbreak
  5495.     \defunpenalty=10003 % Will keep this @deffn together with the
  5496.                         % following @def command, see below.
  5497.   \else
  5498.     % If there are two @def commands in a row, we'll have a \nobreak,
  5499.     % which is there to keep the function description together with its
  5500.     % header.  But if there's nothing but headers, we need to allow a
  5501.     % break somewhere.  Check specifically for penalty 10002, inserted
  5502.     % by \printdefunline, instead of 10000, since the sectioning
  5503.     % commands also insert a nobreak penalty, and we don't want to allow
  5504.     % a break between a section heading and a defun.
  5505.     %
  5506.     % As a further refinement, we avoid "club" headers by signalling
  5507.     % with penalty of 10003 after the very first @deffn in the
  5508.     % sequence (see above), and penalty of 10002 after any following
  5509.     % @def command.
  5510.     \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
  5511.     %
  5512.     % Similarly, after a section heading, do not allow a break.
  5513.     % But do insert the glue.
  5514.     \medskip  % preceded by discardable penalty, so not a breakpoint
  5515.   \fi
  5516.   \parindent=0in
  5517.   \advance\leftskip by \defbodyindent
  5518.   \exdentamount=\defbodyindent
  5519. \def\dodefunx#1{%
  5520.   % First, check whether we are in the right environment:
  5521.   \checkenv#1%
  5522.   % As above, allow line break if we have multiple x headers in a row.
  5523.   % It's not a great place, though.
  5524.   \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
  5525.   % And now, it's time to reuse the body of the original defun:
  5526.   \expandafter\gobbledefun#1%
  5527. \def\gobbledefun#1\startdefun{}
  5528. % \printdefunline \deffnheader{text}
  5529. \def\printdefunline#1#2{%
  5530.   \begingroup
  5531.     % call \deffnheader:
  5532.     #1#2 \endheader
  5533.     % common ending:
  5534.     \interlinepenalty = 10000
  5535.     \advance\rightskip by 0pt plus 1fil\relax
  5536.     \endgraf
  5537.     \nobreak\vskip -\parskip
  5538.     \penalty\defunpenalty  % signal to \startdefun and \dodefunx
  5539.     % Some of the @defun-type tags do not enable magic parentheses,
  5540.     % rendering the following check redundant.  But we don't optimize.
  5541.     \checkparencounts
  5542.   \endgroup
  5543. \def\Edefun{\endgraf\medbreak}
  5544. % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
  5545. % the only thing remaining is to define \deffnheader.
  5546. \def\makedefun#1{%
  5547.   \expandafter\let\csname E#1\endcsname = \Edefun
  5548.   \edef\temp{\noexpand\domakedefun
  5549.     \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
  5550.   \temp
  5551. % \domakedefun \deffn \deffnx \deffnheader
  5552. % Define \deffn and \deffnx, without parameters.
  5553. % \deffnheader has to be defined explicitly.
  5554. \def\domakedefun#1#2#3{%
  5555.   \envdef#1{%
  5556.     \startdefun
  5557.     \doingtypefnfalse    % distinguish typed functions from all else
  5558.     \parseargusing\activeparens{\printdefunline#3}%
  5559.   \def#2{\dodefunx#1}%
  5560.   \def#3%
  5561. \newif\ifdoingtypefn       % doing typed function?
  5562. \newif\ifrettypeownline    % typeset return type on its own line?
  5563. % @deftypefnnewline on|off says whether the return type of typed functions
  5564. % are printed on their own line.  This affects @deftypefn, @deftypefun,
  5565. % @deftypeop, and @deftypemethod.
  5566. \parseargdef\deftypefnnewline{%
  5567.   \def\temp{#1}%
  5568.   \ifx\temp\onword
  5569.     \expandafter\let\csname SETtxideftypefnnl\endcsname
  5570.       = \empty
  5571.   \else\ifx\temp\offword
  5572.     \expandafter\let\csname SETtxideftypefnnl\endcsname
  5573.       = \relax
  5574.   \else
  5575.     \errhelp = \EMsimple
  5576.     \errmessage{Unknown @txideftypefnnl value `\temp',
  5577.                 must be on|off}%
  5578.   \fi\fi
  5579. % Untyped functions:
  5580. % @deffn category name args
  5581. \makedefun{deffn}{\deffngeneral{}}
  5582. % @deffn category class name args
  5583. \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
  5584. % \defopon {category on}class name args
  5585. \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  5586. % \deffngeneral {subind}category name args
  5587. \def\deffngeneral#1#2 #3 #4\endheader{%
  5588.   % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
  5589.   \dosubind{fn}{\code{#3}}{#1}%
  5590.   \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
  5591. % Typed functions:
  5592. % @deftypefn category type name args
  5593. \makedefun{deftypefn}{\deftypefngeneral{}}
  5594. % @deftypeop category class type name args
  5595. \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
  5596. % \deftypeopon {category on}class type name args
  5597. \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  5598. % \deftypefngeneral {subind}category type name args
  5599. \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
  5600.   \dosubind{fn}{\code{#4}}{#1}%
  5601.   \doingtypefntrue
  5602.   \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  5603. % Typed variables:
  5604. % @deftypevr category type var args
  5605. \makedefun{deftypevr}{\deftypecvgeneral{}}
  5606. % @deftypecv category class type var args
  5607. \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
  5608. % \deftypecvof {category of}class type var args
  5609. \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
  5610. % \deftypecvgeneral {subind}category type var args
  5611. \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
  5612.   \dosubind{vr}{\code{#4}}{#1}%
  5613.   \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  5614. % Untyped variables:
  5615. % @defvr category var args
  5616. \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
  5617. % @defcv category class var args
  5618. \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
  5619. % \defcvof {category of}class var args
  5620. \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
  5621. % Types:
  5622. % @deftp category name args
  5623. \makedefun{deftp}#1 #2 #3\endheader{%
  5624.   \doind{tp}{\code{#2}}%
  5625.   \defname{#1}{}{#2}\defunargs{#3\unskip}%
  5626. % Remaining @defun-like shortcuts:
  5627. \makedefun{defun}{\deffnheader{\putwordDeffunc} }
  5628. \makedefun{defmac}{\deffnheader{\putwordDefmac} }
  5629. \makedefun{defspec}{\deffnheader{\putwordDefspec} }
  5630. \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
  5631. \makedefun{defvar}{\defvrheader{\putwordDefvar} }
  5632. \makedefun{defopt}{\defvrheader{\putwordDefopt} }
  5633. \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
  5634. \makedefun{defmethod}{\defopon\putwordMethodon}
  5635. \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
  5636. \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
  5637. \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
  5638. % \defname, which formats the name of the @def (not the args).
  5639. % #1 is the category, such as "Function".
  5640. % #2 is the return type, if any.
  5641. % #3 is the function name.
  5642. % We are followed by (but not passed) the arguments, if any.
  5643. \def\defname#1#2#3{%
  5644.   \par
  5645.   % Get the values of \leftskip and \rightskip as they were outside the @def...
  5646.   \advance\leftskip by -\defbodyindent
  5647.   % Determine if we are typesetting the return type of a typed function
  5648.   % on a line by itself.
  5649.   \rettypeownlinefalse
  5650.   \ifdoingtypefn  % doing a typed function specifically?
  5651.     % then check user option for putting return type on its own line:
  5652.     \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
  5653.       \rettypeownlinetrue
  5654.     \fi
  5655.   \fi
  5656.   % How we'll format the category name.  Putting it in brackets helps
  5657.   % distinguish it from the body text that may end up on the next line
  5658.   % just below it.
  5659.   \def\temp{#1}%
  5660.   \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
  5661.   % Figure out line sizes for the paragraph shape.  We'll always have at
  5662.   % least two.
  5663.   \tempnum = 2
  5664.   % The first line needs space for \box0; but if \rightskip is nonzero,
  5665.   % we need only space for the part of \box0 which exceeds it:
  5666.   \dimen0=\hsize  \advance\dimen0 by -\wd0  \advance\dimen0 by \rightskip
  5667.   % If doing a return type on its own line, we'll have another line.
  5668.   \ifrettypeownline
  5669.     \advance\tempnum by 1
  5670.     \def\maybeshapeline{0in \hsize}%
  5671.   \else
  5672.     \def\maybeshapeline{}%
  5673.   \fi
  5674.   % The continuations:
  5675.   \dimen2=\hsize  \advance\dimen2 by -\defargsindent
  5676.   % The final paragraph shape:
  5677.   \parshape \tempnum  0in \dimen0  \maybeshapeline  \defargsindent \dimen2
  5678.   % Put the category name at the right margin.
  5679.   \noindent
  5680.   \hbox to 0pt{%
  5681.     \hfil\box0 \kern-\hsize
  5682.     % \hsize has to be shortened this way:
  5683.     \kern\leftskip
  5684.     % Intentionally do not respect \rightskip, since we need the space.
  5685.   % Allow all lines to be underfull without complaint:
  5686.   \tolerance=10000 \hbadness=10000
  5687.   \exdentamount=\defbodyindent
  5688.     % defun fonts. We use typewriter by default (used to be bold) because:
  5689.     % . we're printing identifiers, they should be in tt in principle.
  5690.     % . in languages with many accents, such as Czech or French, it's
  5691.     %   common to leave accents off identifiers.  The result looks ok in
  5692.     %   tt, but exceedingly strange in rm.
  5693.     % . we don't want -- and --- to be treated as ligatures.
  5694.     % . this still does not fix the ?` and !` ligatures, but so far no
  5695.     %   one has made identifiers using them :).
  5696.     \df \tt
  5697.     \def\temp{#2}% text of the return type
  5698.     \ifx\temp\empty\else
  5699.       \tclose{\temp}% typeset the return type
  5700.       \ifrettypeownline
  5701.         % put return type on its own line; prohibit line break following:
  5702.         \hfil\vadjust{\nobreak}\break  
  5703.       \else
  5704.         \space  % type on same line, so just followed by a space
  5705.       \fi
  5706.     \fi           % no return type
  5707.     #3% output function name
  5708.   {\rm\enskip}% hskip 0.5 em of \tenrm
  5709.   \boldbrax
  5710.   % arguments will be output next, if any.
  5711. % Print arguments in slanted roman (not ttsl), inconsistently with using
  5712. % tt for the name.  This is because literal text is sometimes needed in
  5713. % the argument list (groff manual), and ttsl and tt are not very
  5714. % distinguishable.  Prevent hyphenation at `-' chars.
  5715. \def\defunargs#1{%
  5716.   % use sl by default (not ttsl),
  5717.   % tt for the names.
  5718.   \df \sl \hyphenchar\font=0
  5719.   % On the other hand, if an argument has two dashes (for instance), we
  5720.   % want a way to get ttsl.  Let's try @var for that.
  5721.   \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
  5722.   #1%
  5723.   \sl\hyphenchar\font=45
  5724. % We want ()&[] to print specially on the defun line.
  5725. \def\activeparens{%
  5726.   \catcode`\(=\active \catcode`\)=\active
  5727.   \catcode`\[=\active \catcode`\]=\active
  5728.   \catcode`\&=\active
  5729. % Make control sequences which act like normal parenthesis chars.
  5730. \let\lparen = ( \let\rparen = )
  5731. % Be sure that we always have a definition for `(', etc.  For example,
  5732. % if the fn name has parens in it, \boldbrax will not be in effect yet,
  5733. % so TeX would otherwise complain about undefined control sequence.
  5734.   \activeparens
  5735.   \global\let(=\lparen \global\let)=\rparen
  5736.   \global\let[=\lbrack \global\let]=\rbrack
  5737.   \global\let& = \&
  5738.   \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  5739.   \gdef\magicamp{\let&=\amprm}
  5740. \newcount\parencount
  5741. % If we encounter &foo, then turn on ()-hacking afterwards
  5742. \newif\ifampseen
  5743. \def\amprm#1 {\ampseentrue{\bf\ }}
  5744. \def\parenfont{%
  5745.   \ifampseen
  5746.     % At the first level, print parens in roman,
  5747.     % otherwise use the default font.
  5748.     \ifnum \parencount=1 \rm \fi
  5749.   \else
  5750.     % The \sf parens (in \boldbrax) actually are a little bolder than
  5751.     % the contained text.  This is especially needed for [ and ] .
  5752.     \sf
  5753.   \fi
  5754. \def\infirstlevel#1{%
  5755.   \ifampseen
  5756.     \ifnum\parencount=1
  5757.       #1%
  5758.     \fi
  5759.   \fi
  5760. \def\bfafterword#1 {#1 \bf}
  5761. \def\opnr{%
  5762.   \global\advance\parencount by 1
  5763.   {\parenfont(}%
  5764.   \infirstlevel \bfafterword
  5765. \def\clnr{%
  5766.   {\parenfont)}%
  5767.   \infirstlevel \sl
  5768.   \global\advance\parencount by -1
  5769. \newcount\brackcount
  5770. \def\lbrb{%
  5771.   \global\advance\brackcount by 1
  5772.   {\bf[}%
  5773. \def\rbrb{%
  5774.   {\bf]}%
  5775.   \global\advance\brackcount by -1
  5776. \def\checkparencounts{%
  5777.   \ifnum\parencount=0 \else \badparencount \fi
  5778.   \ifnum\brackcount=0 \else \badbrackcount \fi
  5779. % these should not use \errmessage; the glibc manual, at least, actually
  5780. % has such constructs (when documenting function pointers).
  5781. \def\badparencount{%
  5782.   \message{Warning: unbalanced parentheses in @def...}%
  5783.   \global\parencount=0
  5784. \def\badbrackcount{%
  5785.   \message{Warning: unbalanced square brackets in @def...}%
  5786.   \global\brackcount=0
  5787. \message{macros,}
  5788. % @macro.
  5789. % To do this right we need a feature of e-TeX, \scantokens,
  5790. % which we arrange to emulate with a temporary file in ordinary TeX.
  5791. \ifx\eTeXversion\thisisundefined
  5792.   \newwrite\macscribble
  5793.   \def\scantokens#1{%
  5794.     \toks0={#1}%
  5795.     \immediate\openout\macscribble=\jobname.tmp
  5796.     \immediate\write\macscribble{\the\toks0}%
  5797.     \immediate\closeout\macscribble
  5798.     \input \jobname.tmp
  5799. \def\scanmacro#1{\begingroup
  5800.   \newlinechar`\^^M
  5801.   \let\xeatspaces\eatspaces
  5802.   % Undo catcode changes of \startcontents and \doprintindex
  5803.   % When called from @insertcopying or (short)caption, we need active
  5804.   % backslash to get it printed correctly.  Previously, we had
  5805.   % \catcode`\\=\other instead.  We'll see whether a problem appears
  5806.   % with macro expansion.                --kasal, 19aug04
  5807.   \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
  5808.   % ... and for \example:
  5809.   \spaceisspace
  5810.   % The \empty here causes a following catcode 5 newline to be eaten as
  5811.   % part of reading whitespace after a control sequence.  It does not
  5812.   % eat a catcode 13 newline.  There's no good way to handle the two
  5813.   % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
  5814.   % would then have different behavior).  See the Macro Details node in
  5815.   % the manual for the workaround we recommend for macros and
  5816.   % line-oriented commands.
  5817.   \scantokens{#1\empty}%
  5818. \endgroup}
  5819. \def\scanexp#1{%
  5820.   \edef\temp{\noexpand\scanmacro{#1}}%
  5821.   \temp
  5822. \newcount\paramno   % Count of parameters
  5823. \newtoks\macname    % Macro name
  5824. \newif\ifrecursive  % Is it recursive?
  5825. % List of all defined macros in the form
  5826. %    \definedummyword\macro1\definedummyword\macro2...
  5827. % Currently is also contains all @aliases; the list can be split
  5828. % if there is a need.
  5829. \def\macrolist{}
  5830. % Add the macro to \macrolist
  5831. \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
  5832. \def\addtomacrolistxxx#1{%
  5833.      \toks0 = \expandafter{\macrolist\definedummyword#1}%
  5834.      \xdef\macrolist{\the\toks0}%
  5835. % Utility routines.
  5836. % This does \let #1 = #2, with \csnames; that is,
  5837. %   \let \csname#1\endcsname = \csname#2\endcsname
  5838. % (except of course we have to play expansion games).
  5839. \def\cslet#1#2{%
  5840.   \expandafter\let
  5841.   \csname#1\expandafter\endcsname
  5842.   \csname#2\endcsname
  5843. % Trim leading and trailing spaces off a string.
  5844. % Concepts from aro-bend problem 15 (see CTAN).
  5845. {\catcode`\@=11
  5846. \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
  5847. \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
  5848. \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
  5849. \def\unbrace#1{#1}
  5850. \unbrace{\gdef\trim@@@ #1 } #2@{#1}
  5851. % Trim a single trailing ^^M off a string.
  5852. {\catcode`\^^M=\other \catcode`\Q=3%
  5853. \gdef\eatcr #1{\eatcra #1Q^^MQ}%
  5854. \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
  5855. \gdef\eatcrb#1Q#2Q{#1}%
  5856. % Macro bodies are absorbed as an argument in a context where
  5857. % all characters are catcode 10, 11 or 12, except \ which is active
  5858. % (as in normal texinfo). It is necessary to change the definition of \
  5859. % to recognize macro arguments; this is the job of \mbodybackslash.
  5860. % Non-ASCII encodings make 8-bit characters active, so un-activate
  5861. % them to avoid their expansion.  Must do this non-globally, to
  5862. % confine the change to the current group.
  5863. % It's necessary to have hard CRs when the macro is executed. This is
  5864. % done by making ^^M (\endlinechar) catcode 12 when reading the macro
  5865. % body, and then making it the \newlinechar in \scanmacro.
  5866. \def\scanctxt{% used as subroutine
  5867.   \catcode`\"=\other
  5868.   \catcode`\+=\other
  5869.   \catcode`\<=\other
  5870.   \catcode`\>=\other
  5871.   \catcode`\@=\other
  5872.   \catcode`\^=\other
  5873.   \catcode`\_=\other
  5874.   \catcode`\|=\other
  5875.   \catcode`\~=\other
  5876.   \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
  5877. \def\scanargctxt{% used for copying and captions, not macros.
  5878.   \scanctxt
  5879.   \catcode`\\=\other
  5880.   \catcode`\^^M=\other
  5881. \def\macrobodyctxt{% used for @macro definitions
  5882.   \scanctxt
  5883.   \catcode`\{=\other
  5884.   \catcode`\}=\other
  5885.   \catcode`\^^M=\other
  5886.   \usembodybackslash
  5887. \def\macroargctxt{% used when scanning invocations
  5888.   \scanctxt
  5889.   \catcode`\\=0
  5890. % why catcode 0 for \ in the above?  To recognize \\ \{ \} as "escapes"
  5891. % for the single characters \ { }.  Thus, we end up with the "commands"
  5892. % that would be written @\ @{ @} in a Texinfo document.
  5893. % We already have @{ and @}.  For @\, we define it here, and only for
  5894. % this purpose, to produce a typewriter backslash (so, the @\ that we
  5895. % define for @math can't be used with @macro calls):
  5896. \def\\{\normalbackslash}%
  5897. % We would like to do this for \, too, since that is what makeinfo does.
  5898. % But it is not possible, because Texinfo already has a command @, for a
  5899. % cedilla accent.  Documents must use @comma{} instead.
  5900. % \anythingelse will almost certainly be an error of some kind.
  5901. % \mbodybackslash is the definition of \ in @macro bodies.
  5902. % It maps \foo\ => \csname macarg.foo\endcsname => #N
  5903. % where N is the macro parameter number.
  5904. % We define \csname macarg.\endcsname to be \realbackslash, so
  5905. % \\ in macro replacement text gets you a backslash.
  5906. {\catcode`@=0 @catcode`@\=@active
  5907.  @gdef@usembodybackslash{@let\=@mbodybackslash}
  5908.  @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
  5909. \expandafter\def\csname macarg.\endcsname{\realbackslash}
  5910. \def\margbackslash#1{\char`\#1 }
  5911. \def\macro{\recursivefalse\parsearg\macroxxx}
  5912. \def\rmacro{\recursivetrue\parsearg\macroxxx}
  5913. \def\macroxxx#1{%
  5914.   \getargs{#1}% now \macname is the macname and \argl the arglist
  5915.   \ifx\argl\empty       % no arguments
  5916.      \paramno=0\relax
  5917.   \else
  5918.      \expandafter\parsemargdef \argl;%
  5919.      \if\paramno>256\relax
  5920.        \ifx\eTeXversion\thisisundefined
  5921.          \errhelp = \EMsimple
  5922.          \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
  5923.        \fi
  5924.      \fi
  5925.   \fi
  5926.   \if1\csname ismacro.\the\macname\endcsname
  5927.      \message{Warning: redefining \the\macname}%
  5928.   \else
  5929.      \expandafter\ifx\csname \the\macname\endcsname \relax
  5930.      \else \errmessage{Macro name \the\macname\space already defined}\fi
  5931.      \global\cslet{macsave.\the\macname}{\the\macname}%
  5932.      \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
  5933.      \addtomacrolist{\the\macname}%
  5934.   \fi
  5935.   \begingroup \macrobodyctxt
  5936.   \ifrecursive \expandafter\parsermacbody
  5937.   \else \expandafter\parsemacbody
  5938.   \fi}
  5939. \parseargdef\unmacro{%
  5940.   \if1\csname ismacro.#1\endcsname
  5941.     \global\cslet{#1}{macsave.#1}%
  5942.     \global\expandafter\let \csname ismacro.#1\endcsname=0%
  5943.     % Remove the macro name from \macrolist:
  5944.     \begingroup
  5945.       \expandafter\let\csname#1\endcsname \relax
  5946.       \let\definedummyword\unmacrodo
  5947.       \xdef\macrolist{\macrolist}%
  5948.     \endgroup
  5949.   \else
  5950.     \errmessage{Macro #1 not defined}%
  5951.   \fi
  5952. % Called by \do from \dounmacro on each macro.  The idea is to omit any
  5953. % macro definitions that have been changed to \relax.
  5954. \def\unmacrodo#1{%
  5955.   \ifx #1\relax
  5956.     % remove this
  5957.   \else
  5958.     \noexpand\definedummyword \noexpand#1%
  5959.   \fi
  5960. % This makes use of the obscure feature that if the last token of a
  5961. % <parameter list> is #, then the preceding argument is delimited by
  5962. % an opening brace, and that opening brace is not consumed.
  5963. \def\getargs#1{\getargsxxx#1{}}
  5964. \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
  5965. \def\getmacname#1 #2\relax{\macname={#1}}
  5966. \def\getmacargs#1{\def\argl{#1}}
  5967. % For macro processing make @ a letter so that we can make Texinfo private macro names.
  5968. \edef\texiatcatcode{\the\catcode`\@}
  5969. \catcode `@=11\relax
  5970. % Parse the optional {params} list.  Set up \paramno and \paramlist
  5971. % so \defmacro knows what to do.  Define \macarg.BLAH for each BLAH
  5972. % in the params list to some hook where the argument si to be expanded.  If
  5973. % there are less than 10 arguments that hook is to be replaced by ##N where N
  5974. % is the position in that list, that is to say the macro arguments are to be
  5975. % defined `a la TeX in the macro body.  
  5976. % That gets used by \mbodybackslash (above).
  5977. % We need to get `macro parameter char #' into several definitions.
  5978. % The technique used is stolen from LaTeX: let \hash be something
  5979. % unexpandable, insert that wherever you need a #, and then redefine
  5980. % it to # just before using the token list produced.
  5981. % The same technique is used to protect \eatspaces till just before
  5982. % the macro is used.
  5983. % If there are 10 or more arguments, a different technique is used, where the
  5984. % hook remains in the body, and when macro is to be expanded the body is
  5985. % processed again to replace the arguments.
  5986. % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
  5987. % argument N value and then \edef  the body (nothing else will expand because of
  5988. % the catcode regime underwhich the body was input).
  5989. % If you compile with TeX (not eTeX), and you have macros with 10 or more
  5990. % arguments, you need that no macro has more than 256 arguments, otherwise an
  5991. % error is produced.
  5992. \def\parsemargdef#1;{%
  5993.   \paramno=0\def\paramlist{}%
  5994.   \let\hash\relax
  5995.   \let\xeatspaces\relax
  5996.   \parsemargdefxxx#1,;,%
  5997.   % In case that there are 10 or more arguments we parse again the arguments
  5998.   % list to set new definitions for the \macarg.BLAH macros corresponding to
  5999.   % each BLAH argument. It was anyhow needed to parse already once this list
  6000.   % in order to count the arguments, and as macros with at most 9 arguments
  6001.   % are by far more frequent than macro with 10 or more arguments, defining
  6002.   % twice the \macarg.BLAH macros does not cost too much processing power.
  6003.   \ifnum\paramno<10\relax\else
  6004.     \paramno0\relax
  6005.     \parsemmanyargdef@@#1,;,% 10 or more arguments
  6006.   \fi
  6007. \def\parsemargdefxxx#1,{%
  6008.   \if#1;\let\next=\relax
  6009.   \else \let\next=\parsemargdefxxx
  6010.     \advance\paramno by 1
  6011.     \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
  6012.         {\xeatspaces{\hash\the\paramno}}%
  6013.     \edef\paramlist{\paramlist\hash\the\paramno,}%
  6014.   \fi\next}
  6015. \def\parsemmanyargdef@@#1,{%
  6016.   \if#1;\let\next=\relax
  6017.   \else 
  6018.     \let\next=\parsemmanyargdef@@
  6019.     \edef\tempb{\eatspaces{#1}}%
  6020.     \expandafter\def\expandafter\tempa
  6021.        \expandafter{\csname macarg.\tempb\endcsname}%
  6022.     % Note that we need some extra \noexpand\noexpand, this is because we
  6023.     % don't want \the  to be expanded in the \parsermacbody  as it uses an
  6024.     % \xdef .
  6025.     \expandafter\edef\tempa
  6026.       {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
  6027.     \advance\paramno by 1\relax
  6028.   \fi\next}
  6029. % These two commands read recursive and nonrecursive macro bodies.
  6030. % (They're different since rec and nonrec macros end differently.)
  6031. \catcode `\@\texiatcatcode
  6032. \long\def\parsemacbody#1@end macro%
  6033. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  6034. \long\def\parsermacbody#1@end rmacro%
  6035. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  6036. \catcode `\@=11\relax
  6037. \let\endargs@\relax
  6038. \let\nil@\relax
  6039. \def\nilm@{\nil@}%
  6040. \long\def\nillm@{\nil@}%
  6041. % This macro is expanded during the Texinfo macro expansion, not during its
  6042. % definition.  It gets all the arguments values and assigns them to macros
  6043. % macarg.ARGNAME
  6044. % #1 is the macro name
  6045. % #2 is the list of argument names
  6046. % #3 is the list of argument values
  6047. \def\getargvals@#1#2#3{%
  6048.   \def\macargdeflist@{}%
  6049.   \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
  6050.   \def\paramlist{#2,\nil@}%
  6051.   \def\macroname{#1}%
  6052.   \begingroup
  6053.   \macroargctxt
  6054.   \def\argvaluelist{#3,\nil@}%
  6055.   \def\@tempa{#3}%
  6056.   \ifx\@tempa\empty
  6057.     \setemptyargvalues@
  6058.   \else
  6059.     \getargvals@@
  6060.   \fi
  6061. \def\getargvals@@{%
  6062.   \ifx\paramlist\nilm@
  6063.       % Some sanity check needed here that \argvaluelist is also empty.
  6064.       \ifx\argvaluelist\nillm@
  6065.       \else
  6066.         \errhelp = \EMsimple
  6067.         \errmessage{Too many arguments in macro `\macroname'!}%
  6068.       \fi
  6069.       \let\next\macargexpandinbody@
  6070.   \else
  6071.     \ifx\argvaluelist\nillm@
  6072.        % No more arguments values passed to macro.  Set remaining named-arg
  6073.        % macros to empty.
  6074.        \let\next\setemptyargvalues@
  6075.     \else
  6076.       % pop current arg name into \@tempb
  6077.       \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
  6078.       \expandafter\@tempa\expandafter{\paramlist}%
  6079.        % pop current argument value into \@tempc
  6080.       \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
  6081.       \expandafter\@tempa\expandafter{\argvaluelist}%
  6082.        % Here \@tempb is the current arg name and \@tempc is the current arg value.
  6083.        % First place the new argument macro definition into \@tempd
  6084.        \expandafter\macname\expandafter{\@tempc}%
  6085.        \expandafter\let\csname macarg.\@tempb\endcsname\relax
  6086.        \expandafter\def\expandafter\@tempe\expandafter{%
  6087.          \csname macarg.\@tempb\endcsname}%
  6088.        \edef\@tempd{\long\def\@tempe{\the\macname}}%
  6089.        \push@\@tempd\macargdeflist@
  6090.        \let\next\getargvals@@
  6091.     \fi
  6092.   \fi
  6093.   \next
  6094. \def\push@#1#2{%
  6095.   \expandafter\expandafter\expandafter\def
  6096.   \expandafter\expandafter\expandafter#2%
  6097.   \expandafter\expandafter\expandafter{%
  6098.   \expandafter#1#2}%
  6099. % Replace arguments by their values in the macro body, and place the result
  6100. % in macro \@tempa
  6101. \def\macvalstoargs@{%
  6102.   %  To do this we use the property that token registers that are \the'ed
  6103.   % within an \edef  expand only once. So we are going to place all argument
  6104.   % values into respective token registers.
  6105.   % First we save the token context, and initialize argument numbering.
  6106.   \begingroup
  6107.     \paramno0\relax
  6108.     % Then, for each argument number #N, we place the corresponding argument
  6109.     % value into a new token list register \toks#N
  6110.     \expandafter\putargsintokens@\saveparamlist@,;,%
  6111.     % Then, we expand the body so that argument are replaced by their
  6112.     % values. The trick for values not to be expanded themselves is that they
  6113.     % are within tokens and that tokens expand only once in an \edef .
  6114.     \edef\@tempc{\csname mac.\macroname .body\endcsname}%
  6115.     % Now we restore the token stack pointer to free the token list registers
  6116.     % which we have used, but we make sure that expanded body is saved after
  6117.     % group.
  6118.     \expandafter
  6119.   \endgroup
  6120.   \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
  6121. \def\macargexpandinbody@{% 
  6122.   %% Define the named-macro outside of this group and then close this group. 
  6123.   \expandafter
  6124.   \endgroup
  6125.   \macargdeflist@
  6126.   % First the replace in body the macro arguments by their values, the result
  6127.   % is in \@tempa .
  6128.   \macvalstoargs@
  6129.   % Then we point at the \norecurse or \gobble (for recursive) macro value
  6130.   % with \@tempb .
  6131.   \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
  6132.   % Depending on whether it is recursive or not, we need some tailing
  6133.   % \egroup .
  6134.   \ifx\@tempb\gobble
  6135.      \let\@tempc\relax
  6136.   \else
  6137.      \let\@tempc\egroup
  6138.   \fi
  6139.   % And now we do the real job:
  6140.   \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
  6141.   \@tempd
  6142. \def\putargsintokens@#1,{%
  6143.   \if#1;\let\next\relax
  6144.   \else
  6145.     \let\next\putargsintokens@
  6146.     % First we allocate the new token list register, and give it a temporary
  6147.     % alias \@tempb .
  6148.     \toksdef\@tempb\the\paramno
  6149.     % Then we place the argument value into that token list register.
  6150.     \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
  6151.     \expandafter\@tempb\expandafter{\@tempa}%
  6152.     \advance\paramno by 1\relax
  6153.   \fi
  6154.   \next
  6155. % Save the token stack pointer into macro #1
  6156. \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
  6157. % Restore the token stack pointer from number in macro #1
  6158. \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
  6159. % newtoks that can be used non \outer .
  6160. \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
  6161. % Tailing missing arguments are set to empty
  6162. \def\setemptyargvalues@{%
  6163.   \ifx\paramlist\nilm@
  6164.     \let\next\macargexpandinbody@
  6165.   \else
  6166.     \expandafter\setemptyargvaluesparser@\paramlist\endargs@
  6167.     \let\next\setemptyargvalues@
  6168.   \fi
  6169.   \next
  6170. \def\setemptyargvaluesparser@#1,#2\endargs@{%
  6171.   \expandafter\def\expandafter\@tempa\expandafter{%
  6172.     \expandafter\def\csname macarg.#1\endcsname{}}%
  6173.   \push@\@tempa\macargdeflist@
  6174.   \def\paramlist{#2}%
  6175. % #1 is the element target macro
  6176. % #2 is the list macro
  6177. % #3,#4\endargs@ is the list value
  6178. \def\pop@#1#2#3,#4\endargs@{%
  6179.    \def#1{#3}%
  6180.    \def#2{#4}%
  6181. \long\def\longpop@#1#2#3,#4\endargs@{%
  6182.    \long\def#1{#3}%
  6183.    \long\def#2{#4}%
  6184. % This defines a Texinfo @macro. There are eight cases: recursive and
  6185. % nonrecursive macros of zero, one, up to nine, and many arguments.
  6186. % Much magic with \expandafter here.
  6187. % \xdef is used so that macro definitions will survive the file
  6188. % they're defined in; @include reads the file inside a group.
  6189. \def\defmacro{%
  6190.   \let\hash=##% convert placeholders to macro parameter chars
  6191.   \ifrecursive
  6192.     \ifcase\paramno
  6193.     % 0
  6194.       \expandafter\xdef\csname\the\macname\endcsname{%
  6195.         \noexpand\scanmacro{\temp}}%
  6196.     \or % 1
  6197.       \expandafter\xdef\csname\the\macname\endcsname{%
  6198.          \bgroup\noexpand\macroargctxt
  6199.          \noexpand\braceorline
  6200.          \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  6201.       \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  6202.          \egroup\noexpand\scanmacro{\temp}}%
  6203.     \else
  6204.       \ifnum\paramno<10\relax % at most 9
  6205.         \expandafter\xdef\csname\the\macname\endcsname{%
  6206.            \bgroup\noexpand\macroargctxt
  6207.            \noexpand\csname\the\macname xx\endcsname}%
  6208.         \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  6209.             \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  6210.         \expandafter\expandafter
  6211.         \expandafter\xdef
  6212.         \expandafter\expandafter
  6213.           \csname\the\macname xxx\endcsname
  6214.             \paramlist{\egroup\noexpand\scanmacro{\temp}}%
  6215.       \else % 10 or more
  6216.         \expandafter\xdef\csname\the\macname\endcsname{%
  6217.           \noexpand\getargvals@{\the\macname}{\argl}%
  6218.         }%    
  6219.         \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  6220.         \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
  6221.       \fi
  6222.     \fi
  6223.   \else
  6224.     \ifcase\paramno
  6225.     % 0
  6226.       \expandafter\xdef\csname\the\macname\endcsname{%
  6227.         \noexpand\norecurse{\the\macname}%
  6228.         \noexpand\scanmacro{\temp}\egroup}%
  6229.     \or % 1
  6230.       \expandafter\xdef\csname\the\macname\endcsname{%
  6231.          \bgroup\noexpand\macroargctxt
  6232.          \noexpand\braceorline
  6233.          \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  6234.       \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  6235.         \egroup
  6236.         \noexpand\norecurse{\the\macname}%
  6237.         \noexpand\scanmacro{\temp}\egroup}%
  6238.     \else % at most 9
  6239.       \ifnum\paramno<10\relax
  6240.         \expandafter\xdef\csname\the\macname\endcsname{%
  6241.            \bgroup\noexpand\macroargctxt
  6242.            \expandafter\noexpand\csname\the\macname xx\endcsname}%
  6243.         \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  6244.             \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  6245.         \expandafter\expandafter
  6246.         \expandafter\xdef
  6247.         \expandafter\expandafter
  6248.         \csname\the\macname xxx\endcsname
  6249.         \paramlist{%
  6250.             \egroup
  6251.             \noexpand\norecurse{\the\macname}%
  6252.             \noexpand\scanmacro{\temp}\egroup}%
  6253.       \else % 10 or more:
  6254.         \expandafter\xdef\csname\the\macname\endcsname{%
  6255.           \noexpand\getargvals@{\the\macname}{\argl}%
  6256.         }%
  6257.         \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  6258.         \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
  6259.       \fi
  6260.     \fi
  6261.   \fi}
  6262. \catcode `\@\texiatcatcode\relax
  6263. \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
  6264. % \braceorline decides whether the next nonwhitespace character is a
  6265. % {.  If so it reads up to the closing }, if not, it reads the whole
  6266. % line.  Whatever was read is then fed to the next control sequence
  6267. % as an argument (by \parsebrace or \parsearg).
  6268. \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
  6269. \def\braceorlinexxx{%
  6270.   \ifx\nchar\bgroup\else
  6271.     \expandafter\parsearg
  6272.   \fi \macnamexxx}
  6273. % @alias.
  6274. % We need some trickery to remove the optional spaces around the equal
  6275. % sign.  Make them active and then expand them all to nothing.
  6276. \def\alias{\parseargusing\obeyspaces\aliasxxx}
  6277. \def\aliasxxx #1{\aliasyyy#1\relax}
  6278. \def\aliasyyy #1=#2\relax{%
  6279.     \expandafter\let\obeyedspace=\empty
  6280.     \addtomacrolist{#1}%
  6281.     \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
  6282.   \next
  6283. \message{cross references,}
  6284. \newwrite\auxfile
  6285. \newif\ifhavexrefs    % True if xref values are known.
  6286. \newif\ifwarnedxrefs  % True if we warned once that they aren't known.
  6287. % @inforef is relatively simple.
  6288. \def\inforef #1{\inforefzzz #1,,,,**}
  6289. \def\inforefzzz #1,#2,#3,#4**{%
  6290.   \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
  6291.   node \samp{\ignorespaces#1{}}}
  6292. % @node's only job in TeX is to define \lastnode, which is used in
  6293. % cross-references.  The @node line might or might not have commas, and
  6294. % might or might not have spaces before the first comma, like:
  6295. % @node foo , bar , ...
  6296. % We don't want such trailing spaces in the node name.
  6297. \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
  6298. % also remove a trailing comma, in case of something like this:
  6299. % @node Help-Cross,  ,  , Cross-refs
  6300. \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
  6301. \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
  6302. \let\nwnode=\node
  6303. \let\lastnode=\empty
  6304. % Write a cross-reference definition for the current node.  #1 is the
  6305. % type (Ynumbered, Yappendix, Ynothing).
  6306. \def\donoderef#1{%
  6307.   \ifx\lastnode\empty\else
  6308.     \setref{\lastnode}{#1}%
  6309.     \global\let\lastnode=\empty
  6310.   \fi
  6311. % @anchor{NAME} -- define xref target at arbitrary point.
  6312. \newcount\savesfregister
  6313. \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
  6314. \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
  6315. \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
  6316. % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  6317. % anchor), which consists of three parts:
  6318. % 1) NAME-title - the current sectioning name taken from \lastsection,
  6319. %                 or the anchor name.
  6320. % 2) NAME-snt   - section number and type, passed as the SNT arg, or
  6321. %                 empty for anchors.
  6322. % 3) NAME-pg    - the page number.
  6323. % This is called from \donoderef, \anchor, and \dofloat.  In the case of
  6324. % floats, there is an additional part, which is not written here:
  6325. % 4) NAME-lof   - the text as it should appear in a @listoffloats.
  6326. \def\setref#1#2{%
  6327.   \pdfmkdest{#1}%
  6328.   \iflinks
  6329.     {%
  6330.       \atdummies  % preserve commands, but don't expand them
  6331.       \edef\writexrdef##1##2{%
  6332.     \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
  6333.       ##1}{##2}}% these are parameters of \writexrdef
  6334.       }%
  6335.       \toks0 = \expandafter{\lastsection}%
  6336.       \immediate \writexrdef{title}{\the\toks0 }%
  6337.       \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
  6338.       \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
  6339.     }%
  6340.   \fi
  6341. % @xrefautosectiontitle on|off says whether @section(ing) names are used
  6342. % automatically in xrefs, if the third arg is not explicitly specified.
  6343. % This was provided as a "secret" @set xref-automatic-section-title
  6344. % variable, now it's official.
  6345. \parseargdef\xrefautomaticsectiontitle{%
  6346.   \def\temp{#1}%
  6347.   \ifx\temp\onword
  6348.     \expandafter\let\csname SETxref-automatic-section-title\endcsname
  6349.       = \empty
  6350.   \else\ifx\temp\offword
  6351.     \expandafter\let\csname SETxref-automatic-section-title\endcsname
  6352.       = \relax
  6353.   \else
  6354.     \errhelp = \EMsimple
  6355.     \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
  6356.                 must be on|off}%
  6357.   \fi\fi
  6358. % @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
  6359. % the node name, #2 the name of the Info cross-reference, #3 the printed
  6360. % node name, #4 the name of the Info file, #5 the name of the printed
  6361. % manual.  All but the node name can be omitted.
  6362. \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
  6363. \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
  6364. \def\ref#1{\xrefX[#1,,,,,,,]}
  6365. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
  6366.   \unsepspaces
  6367.   \def\printedmanual{\ignorespaces #5}%
  6368.   \def\printedrefname{\ignorespaces #3}%
  6369.   \setbox1=\hbox{\printedmanual\unskip}%
  6370.   \setbox0=\hbox{\printedrefname\unskip}%
  6371.   \ifdim \wd0 = 0pt
  6372.     % No printed node name was explicitly given.
  6373.     \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
  6374.       % Use the node name inside the square brackets.
  6375.       \def\printedrefname{\ignorespaces #1}%
  6376.     \else
  6377.       % Use the actual chapter/section title appear inside
  6378.       % the square brackets.  Use the real section title if we have it.
  6379.       \ifdim \wd1 > 0pt
  6380.         % It is in another manual, so we don't have it.
  6381.         \def\printedrefname{\ignorespaces #1}%
  6382.       \else
  6383.         \ifhavexrefs
  6384.           % We know the real title if we have the xref values.
  6385.           \def\printedrefname{\refx{#1-title}{}}%
  6386.         \else
  6387.           % Otherwise just copy the Info node name.
  6388.           \def\printedrefname{\ignorespaces #1}%
  6389.         \fi%
  6390.       \fi
  6391.     \fi
  6392.   \fi
  6393.   % Make link in pdf output.
  6394.   \ifpdf
  6395.     {\indexnofonts
  6396.      \turnoffactive
  6397.      % This expands tokens, so do it after making catcode changes, so _
  6398.      % etc. don't get their TeX definitions.
  6399.      \getfilename{#4}%
  6400.      %
  6401.      % See comments at \activebackslashdouble.
  6402.      {\activebackslashdouble \xdef\pdfxrefdest{#1}%
  6403.       \backslashparens\pdfxrefdest}%
  6404.      %
  6405.      \leavevmode
  6406.      \startlink attr{/Border [0 0 0]}%
  6407.      \ifnum\filenamelength>0
  6408.        goto file{\the\filename.pdf} name{\pdfxrefdest}%
  6409.      \else
  6410.        goto name{\pdfmkpgn{\pdfxrefdest}}%
  6411.      \fi
  6412.     }%
  6413.     \setcolor{\linkcolor}%
  6414.   \fi
  6415.   % Float references are printed completely differently: "Figure 1.2"
  6416.   % instead of "[somenode], p.3".  We distinguish them by the
  6417.   % LABEL-title being set to a magic string.
  6418.     % Have to otherify everything special to allow the \csname to
  6419.     % include an _ in the xref name, etc.
  6420.     \indexnofonts
  6421.     \turnoffactive
  6422.     \expandafter\global\expandafter\let\expandafter\Xthisreftitle
  6423.       \csname XR#1-title\endcsname
  6424.   \iffloat\Xthisreftitle
  6425.     % If the user specified the print name (third arg) to the ref,
  6426.     % print it instead of our usual "Figure 1.2".
  6427.     \ifdim\wd0 = 0pt
  6428.       \refx{#1-snt}{}%
  6429.     \else
  6430.       \printedrefname
  6431.     \fi
  6432.     %
  6433.     % if the user also gave the printed manual name (fifth arg), append
  6434.     % "in MANUALNAME".
  6435.     \ifdim \wd1 > 0pt
  6436.       \space \putwordin{} \cite{\printedmanual}%
  6437.     \fi
  6438.   \else
  6439.     % node/anchor (non-float) references.
  6440.     %
  6441.     % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
  6442.     % insert empty discretionaries after hyphens, which means that it will
  6443.     % not find a line break at a hyphen in a node names.  Since some manuals
  6444.     % are best written with fairly long node names, containing hyphens, this
  6445.     % is a loss.  Therefore, we give the text of the node name again, so it
  6446.     % is as if TeX is seeing it for the first time.
  6447.     \ifdim \wd1 > 0pt
  6448.       \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
  6449.     \else
  6450.       % _ (for example) has to be the character _ for the purposes of the
  6451.       % control sequence corresponding to the node, but it has to expand
  6452.       % into the usual \leavevmode...\vrule stuff for purposes of
  6453.       % printing. So we \turnoffactive for the \refx-snt, back on for the
  6454.       % printing, back off for the \refx-pg.
  6455.       {\turnoffactive
  6456.        % Only output a following space if the -snt ref is nonempty; for
  6457.        % @unnumbered and @anchor, it won't be.
  6458.        \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
  6459.        \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
  6460.       }%
  6461.       % output the `[mynode]' via a macro so it can be overridden.
  6462.       \xrefprintnodename\printedrefname
  6463.       %
  6464.       % But we always want a comma and a space:
  6465.       ,\space
  6466.       %
  6467.       % output the `page 3'.
  6468.       \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
  6469.     \fi
  6470.   \fi
  6471.   \endlink
  6472. \endgroup}
  6473. % This macro is called from \xrefX for the `[nodename]' part of xref
  6474. % output.  It's a separate macro only so it can be changed more easily,
  6475. % since square brackets don't work well in some documents.  Particularly
  6476. % one that Bob is working on :).
  6477. \def\xrefprintnodename#1{[#1]}
  6478. % Things referred to by \setref.
  6479. \def\Ynothing{}
  6480. \def\Yomitfromtoc{}
  6481. \def\Ynumbered{%
  6482.   \ifnum\secno=0
  6483.     \putwordChapter@tie \the\chapno
  6484.   \else \ifnum\subsecno=0
  6485.     \putwordSection@tie \the\chapno.\the\secno
  6486.   \else \ifnum\subsubsecno=0
  6487.     \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
  6488.   \else
  6489.     \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
  6490.   \fi\fi\fi
  6491. \def\Yappendix{%
  6492.   \ifnum\secno=0
  6493.      \putwordAppendix@tie @char\the\appendixno{}%
  6494.   \else \ifnum\subsecno=0
  6495.      \putwordSection@tie @char\the\appendixno.\the\secno
  6496.   \else \ifnum\subsubsecno=0
  6497.     \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
  6498.   \else
  6499.     \putwordSection@tie
  6500.       @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
  6501.   \fi\fi\fi
  6502. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  6503. % If its value is nonempty, SUFFIX is output afterward.
  6504. \def\refx#1#2{%
  6505.     \indexnofonts
  6506.     \otherbackslash
  6507.     \expandafter\global\expandafter\let\expandafter\thisrefX
  6508.       \csname XR#1\endcsname
  6509.   \ifx\thisrefX\relax
  6510.     % If not defined, say something at least.
  6511.     \angleleft un\-de\-fined\angleright
  6512.     \iflinks
  6513.       \ifhavexrefs
  6514.         {\toks0 = {#1}% avoid expansion of possibly-complex value
  6515.          \message{\linenumber Undefined cross reference `\the\toks0'.}}%
  6516.       \else
  6517.         \ifwarnedxrefs\else
  6518.           \global\warnedxrefstrue
  6519.           \message{Cross reference values unknown; you must run TeX again.}%
  6520.         \fi
  6521.       \fi
  6522.     \fi
  6523.   \else
  6524.     % It's defined, so just use it.
  6525.     \thisrefX
  6526.   \fi
  6527.   #2% Output the suffix in any case.
  6528. % This is the macro invoked by entries in the aux file.  Usually it's
  6529. % just a \def (we prepend XR to the control sequence name to avoid
  6530. % collisions).  But if this is a float type, we have more work to do.
  6531. \def\xrdef#1#2{%
  6532.   {% The node name might contain 8-bit characters, which in our current
  6533.    % implementation are changed to commands like @'e.  Don't let these
  6534.    % mess up the control sequence name.
  6535.     \indexnofonts
  6536.     \turnoffactive
  6537.     \xdef\safexrefname{#1}%
  6538.   \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
  6539.   % Was that xref control sequence that we just defined for a float?
  6540.   \expandafter\iffloat\csname XR\safexrefname\endcsname
  6541.     % it was a float, and we have the (safe) float type in \iffloattype.
  6542.     \expandafter\let\expandafter\floatlist
  6543.       \csname floatlist\iffloattype\endcsname
  6544.     %
  6545.     % Is this the first time we've seen this float type?
  6546.     \expandafter\ifx\floatlist\relax
  6547.       \toks0 = {\do}% yes, so just \do
  6548.     \else
  6549.       % had it before, so preserve previous elements in list.
  6550.       \toks0 = \expandafter{\floatlist\do}%
  6551.     \fi
  6552.     %
  6553.     % Remember this xref in the control sequence \floatlistFLOATTYPE,
  6554.     % for later use in \listoffloats.
  6555.     \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
  6556.       {\safexrefname}}%
  6557.   \fi
  6558. % Read the last existing aux file, if any.  No error if none exists.
  6559. \def\tryauxfile{%
  6560.   \openin 1 \jobname.aux
  6561.   \ifeof 1 \else
  6562.     \readdatafile{aux}%
  6563.     \global\havexrefstrue
  6564.   \fi
  6565.   \closein 1
  6566. \def\setupdatafile{%
  6567.   \catcode`\^^@=\other
  6568.   \catcode`\^^A=\other
  6569.   \catcode`\^^B=\other
  6570.   \catcode`\^^C=\other
  6571.   \catcode`\^^D=\other
  6572.   \catcode`\^^E=\other
  6573.   \catcode`\^^F=\other
  6574.   \catcode`\^^G=\other
  6575.   \catcode`\^^H=\other
  6576.   \catcode`\^^K=\other
  6577.   \catcode`\^^L=\other
  6578.   \catcode`\^^N=\other
  6579.   \catcode`\^^P=\other
  6580.   \catcode`\^^Q=\other
  6581.   \catcode`\^^R=\other
  6582.   \catcode`\^^S=\other
  6583.   \catcode`\^^T=\other
  6584.   \catcode`\^^U=\other
  6585.   \catcode`\^^V=\other
  6586.   \catcode`\^^W=\other
  6587.   \catcode`\^^X=\other
  6588.   \catcode`\^^Z=\other
  6589.   \catcode`\^^[=\other
  6590.   \catcode`\^^\=\other
  6591.   \catcode`\^^]=\other
  6592.   \catcode`\^^^=\other
  6593.   \catcode`\^^_=\other
  6594.   % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
  6595.   % in xref tags, i.e., node names.  But since ^^e4 notation isn't
  6596.   % supported in the main text, it doesn't seem desirable.  Furthermore,
  6597.   % that is not enough: for node names that actually contain a ^
  6598.   % character, we would end up writing a line like this: 'xrdef {'hat
  6599.   % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
  6600.   % argument, and \hat is not an expandable control sequence.  It could
  6601.   % all be worked out, but why?  Either we support ^^ or we don't.
  6602.   % The other change necessary for this was to define \auxhat:
  6603.   % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
  6604.   % and then to call \auxhat in \setq.
  6605.   \catcode`\^=\other
  6606.   % Special characters.  Should be turned off anyway, but...
  6607.   \catcode`\~=\other
  6608.   \catcode`\[=\other
  6609.   \catcode`\]=\other
  6610.   \catcode`\"=\other
  6611.   \catcode`\_=\other
  6612.   \catcode`\|=\other
  6613.   \catcode`\<=\other
  6614.   \catcode`\>=\other
  6615.   \catcode`\$=\other
  6616.   \catcode`\#=\other
  6617.   \catcode`\&=\other
  6618.   \catcode`\%=\other
  6619.   \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
  6620.   % This is to support \ in node names and titles, since the \
  6621.   % characters end up in a \csname.  It's easier than
  6622.   % leaving it active and making its active definition an actual \
  6623.   % character.  What I don't understand is why it works in the *value*
  6624.   % of the xrdef.  Seems like it should be a catcode12 \, and that
  6625.   % should not typeset properly.  But it works, so I'm moving on for
  6626.   % now.  --karl, 15jan04.
  6627.   \catcode`\\=\other
  6628.   % Make the characters 128-255 be printing characters.
  6629.     \count1=128
  6630.     \def\loop{%
  6631.       \catcode\count1=\other
  6632.       \advance\count1 by 1
  6633.       \ifnum \count1<256 \loop \fi
  6634.     }%
  6635.   % @ is our escape character in .aux files, and we need braces.
  6636.   \catcode`\{=1
  6637.   \catcode`\}=2
  6638.   \catcode`\@=0
  6639. \def\readdatafile#1{%
  6640. \begingroup
  6641.   \setupdatafile
  6642.   \input\jobname.#1
  6643. \endgroup}
  6644. \message{insertions,}
  6645. % including footnotes.
  6646. \newcount \footnoteno
  6647. % The trailing space in the following definition for supereject is
  6648. % vital for proper filling; pages come out unaligned when you do a
  6649. % pagealignmacro call if that space before the closing brace is
  6650. % removed. (Generally, numeric constants should always be followed by a
  6651. % space to prevent strange expansion errors.)
  6652. \def\supereject{\par\penalty -20000\footnoteno =0 }
  6653. % @footnotestyle is meaningful for Info output only.
  6654. \let\footnotestyle=\comment
  6655. {\catcode `\@=11
  6656. % Auto-number footnotes.  Otherwise like plain.
  6657. \gdef\footnote{%
  6658.   \let\indent=\ptexindent
  6659.   \let\noindent=\ptexnoindent
  6660.   \global\advance\footnoteno by \@ne
  6661.   \edef\thisfootno{$^{\the\footnoteno}$}%
  6662.   % In case the footnote comes at the end of a sentence, preserve the
  6663.   % extra spacing after we do the footnote number.
  6664.   \let\@sf\empty
  6665.   \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
  6666.   % Remove inadvertent blank space before typesetting the footnote number.
  6667.   \unskip
  6668.   \thisfootno\@sf
  6669.   \dofootnote
  6670. % Don't bother with the trickery in plain.tex to not require the
  6671. % footnote text as a parameter.  Our footnotes don't need to be so general.
  6672. % Oh yes, they do; otherwise, @ifset (and anything else that uses
  6673. % \parseargline) fails inside footnotes because the tokens are fixed when
  6674. % the footnote is read.  --karl, 16nov96.
  6675. \gdef\dofootnote{%
  6676.   \insert\footins\bgroup
  6677.   % We want to typeset this text as a normal paragraph, even if the
  6678.   % footnote reference occurs in (for example) a display environment.
  6679.   % So reset some parameters.
  6680.   \hsize=\pagewidth
  6681.   \interlinepenalty\interfootnotelinepenalty
  6682.   \splittopskip\ht\strutbox % top baseline for broken footnotes
  6683.   \splitmaxdepth\dp\strutbox
  6684.   \floatingpenalty\@MM
  6685.   \leftskip\z@skip
  6686.   \rightskip\z@skip
  6687.   \spaceskip\z@skip
  6688.   \xspaceskip\z@skip
  6689.   \parindent\defaultparindent
  6690.   \smallfonts \rm
  6691.   % Because we use hanging indentation in footnotes, a @noindent appears
  6692.   % to exdent this text, so make it be a no-op.  makeinfo does not use
  6693.   % hanging indentation so @noindent can still be needed within footnote
  6694.   % text after an @example or the like (not that this is good style).
  6695.   \let\noindent = \relax
  6696.   % Hang the footnote text off the number.  Use \everypar in case the
  6697.   % footnote extends for more than one paragraph.
  6698.   \everypar = {\hang}%
  6699.   \textindent{\thisfootno}%
  6700.   % Don't crash into the line above the footnote text.  Since this
  6701.   % expands into a box, it must come within the paragraph, lest it
  6702.   % provide a place where TeX can split the footnote.
  6703.   \footstrut
  6704.   % Invoke rest of plain TeX footnote routine.
  6705.   \futurelet\next\fo@t
  6706. }%end \catcode `\@=11
  6707. % In case a @footnote appears in a vbox, save the footnote text and create
  6708. % the real \insert just after the vbox finished.  Otherwise, the insertion
  6709. % would be lost.
  6710. % Similarly, if a @footnote appears inside an alignment, save the footnote
  6711. % text to a box and make the \insert when a row of the table is finished.
  6712. % And the same can be done for other insert classes.  --kasal, 16nov03.
  6713. % Replace the \insert primitive by a cheating macro.
  6714. % Deeper inside, just make sure that the saved insertions are not spilled
  6715. % out prematurely.
  6716. \def\startsavinginserts{%
  6717.   \ifx \insert\ptexinsert
  6718.     \let\insert\saveinsert
  6719.   \else
  6720.     \let\checkinserts\relax
  6721.   \fi
  6722. % This \insert replacement works for both \insert\footins{foo} and
  6723. % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
  6724. \def\saveinsert#1{%
  6725.   \edef\next{\noexpand\savetobox \makeSAVEname#1}%
  6726.   \afterassignment\next
  6727.   % swallow the left brace
  6728.   \let\temp =
  6729. \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
  6730. \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
  6731. \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
  6732. \def\placesaveins#1{%
  6733.   \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
  6734.     {\box#1}%
  6735. % eat @SAVE -- beware, all of them have catcode \other:
  6736.   \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials  %  ;-)
  6737.   \gdef\gobblesave @SAVE{}
  6738. % initialization:
  6739. \def\newsaveins #1{%
  6740.   \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
  6741.   \next
  6742. \def\newsaveinsX #1{%
  6743.   \csname newbox\endcsname #1%
  6744.   \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
  6745.     \checksaveins #1}%
  6746. % initialize:
  6747. \let\checkinserts\empty
  6748. \newsaveins\footins
  6749. \newsaveins\margin
  6750. % @image.  We use the macros from epsf.tex to support this.
  6751. % If epsf.tex is not installed and @image is used, we complain.
  6752. % Check for and read epsf.tex up front.  If we read it only at @image
  6753. % time, we might be inside a group, and then its definitions would get
  6754. % undone and the next image would fail.
  6755. \openin 1 = epsf.tex
  6756. \ifeof 1 \else
  6757.   % Do not bother showing banner with epsf.tex v2.7k (available in
  6758.   % doc/epsf.tex and on ctan).
  6759.   \def\epsfannounce{\toks0 = }%
  6760.   \input epsf.tex
  6761. \closein 1
  6762. % We will only complain once about lack of epsf.tex.
  6763. \newif\ifwarnednoepsf
  6764. \newhelp\noepsfhelp{epsf.tex must be installed for images to
  6765.   work.  It is also included in the Texinfo distribution, or you can get
  6766.   it from ftp://tug.org/tex/epsf.tex.}
  6767. \def\image#1{%
  6768.   \ifx\epsfbox\thisiundefined
  6769.     \ifwarnednoepsf \else
  6770.       \errhelp = \noepsfhelp
  6771.       \errmessage{epsf.tex not found, images will be ignored}%
  6772.       \global\warnednoepsftrue
  6773.     \fi
  6774.   \else
  6775.     \imagexxx #1,,,,,\finish
  6776.   \fi
  6777. % Arguments to @image:
  6778. % #1 is (mandatory) image filename; we tack on .eps extension.
  6779. % #2 is (optional) width, #3 is (optional) height.
  6780. % #4 is (ignored optional) html alt text.
  6781. % #5 is (ignored optional) extension.
  6782. % #6 is just the usual extra ignored arg for parsing stuff.
  6783. \newif\ifimagevmode
  6784. \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
  6785.   \catcode`\^^M = 5     % in case we're inside an example
  6786.   \normalturnoffactive  % allow _ et al. in names
  6787.   % If the image is by itself, center it.
  6788.   \ifvmode
  6789.     \imagevmodetrue
  6790.     \nobreak\medskip
  6791.     % Usually we'll have text after the image which will insert
  6792.     % \parskip glue, so insert it here too to equalize the space
  6793.     % above and below.
  6794.     \nobreak\vskip\parskip
  6795.     \nobreak
  6796.   \fi
  6797.   % Leave vertical mode so that indentation from an enclosing
  6798.   % environment such as @quotation is respected.  On the other hand, if
  6799.   % it's at the top level, we don't want the normal paragraph indentation.
  6800.   \noindent
  6801.   % Output the image.
  6802.   \ifpdf
  6803.     \dopdfimage{#1}{#2}{#3}%
  6804.   \else
  6805.     % \epsfbox itself resets \epsf?size at each figure.
  6806.     \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
  6807.     \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
  6808.     \epsfbox{#1.eps}%
  6809.   \fi
  6810.   \ifimagevmode \medskip \fi  % space after the standalone image
  6811. \endgroup}
  6812. % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
  6813. % etc.  We don't actually implement floating yet, we always include the
  6814. % float "here".  But it seemed the best name for the future.
  6815. \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
  6816. % There may be a space before second and/or third parameter; delete it.
  6817. \def\eatcommaspace#1, {#1,}
  6818. % #1 is the optional FLOATTYPE, the text label for this float, typically
  6819. % "Figure", "Table", "Example", etc.  Can't contain commas.  If omitted,
  6820. % this float will not be numbered and cannot be referred to.
  6821. % #2 is the optional xref label.  Also must be present for the float to
  6822. % be referable.
  6823. % #3 is the optional positioning argument; for now, it is ignored.  It
  6824. % will somehow specify the positions allowed to float to (here, top, bottom).
  6825. % We keep a separate counter for each FLOATTYPE, which we reset at each
  6826. % chapter-level command.
  6827. \let\resetallfloatnos=\empty
  6828. \def\dofloat#1,#2,#3,#4\finish{%
  6829.   \let\thiscaption=\empty
  6830.   \let\thisshortcaption=\empty
  6831.   % don't lose footnotes inside @float.
  6832.   % BEWARE: when the floats start float, we have to issue warning whenever an
  6833.   % insert appears inside a float which could possibly float. --kasal, 26may04
  6834.   \startsavinginserts
  6835.   % We can't be used inside a paragraph.
  6836.   \par
  6837.   \vtop\bgroup
  6838.     \def\floattype{#1}%
  6839.     \def\floatlabel{#2}%
  6840.     \def\floatloc{#3}% we do nothing with this yet.
  6841.     %
  6842.     \ifx\floattype\empty
  6843.       \let\safefloattype=\empty
  6844.     \else
  6845.       {%
  6846.         % the floattype might have accents or other special characters,
  6847.         % but we need to use it in a control sequence name.
  6848.         \indexnofonts
  6849.         \turnoffactive
  6850.         \xdef\safefloattype{\floattype}%
  6851.       }%
  6852.     \fi
  6853.     %
  6854.     % If label is given but no type, we handle that as the empty type.
  6855.     \ifx\floatlabel\empty \else
  6856.       % We want each FLOATTYPE to be numbered separately (Figure 1,
  6857.       % Table 1, Figure 2, ...).  (And if no label, no number.)
  6858.       %
  6859.       \expandafter\getfloatno\csname\safefloattype floatno\endcsname
  6860.       \global\advance\floatno by 1
  6861.       %
  6862.       {%
  6863.         % This magic value for \lastsection is output by \setref as the
  6864.         % XREFLABEL-title value.  \xrefX uses it to distinguish float
  6865.         % labels (which have a completely different output format) from
  6866.         % node and anchor labels.  And \xrdef uses it to construct the
  6867.         % lists of floats.
  6868.         %
  6869.         \edef\lastsection{\floatmagic=\safefloattype}%
  6870.         \setref{\floatlabel}{Yfloat}%
  6871.       }%
  6872.     \fi
  6873.     %
  6874.     % start with \parskip glue, I guess.
  6875.     \vskip\parskip
  6876.     %
  6877.     % Don't suppress indentation if a float happens to start a section.
  6878.     \restorefirstparagraphindent
  6879. % we have these possibilities:
  6880. % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
  6881. % @float Foo,lbl & no caption:    Foo 1.1
  6882. % @float Foo & @caption{Cap}:     Foo: Cap
  6883. % @float Foo & no caption:        Foo
  6884. % @float ,lbl & Caption{Cap}:     1.1: Cap
  6885. % @float ,lbl & no caption:       1.1
  6886. % @float & @caption{Cap}:         Cap
  6887. % @float & no caption:
  6888. \def\Efloat{%
  6889.     \let\floatident = \empty
  6890.     %
  6891.     % In all cases, if we have a float type, it comes first.
  6892.     \ifx\floattype\empty \else \def\floatident{\floattype}\fi
  6893.     %
  6894.     % If we have an xref label, the number comes next.
  6895.     \ifx\floatlabel\empty \else
  6896.       \ifx\floattype\empty \else % if also had float type, need tie first.
  6897.         \appendtomacro\floatident{\tie}%
  6898.       \fi
  6899.       % the number.
  6900.       \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
  6901.     \fi
  6902.     %
  6903.     % Start the printed caption with what we've constructed in
  6904.     % \floatident, but keep it separate; we need \floatident again.
  6905.     \let\captionline = \floatident
  6906.     %
  6907.     \ifx\thiscaption\empty \else
  6908.       \ifx\floatident\empty \else
  6909.     \appendtomacro\captionline{: }% had ident, so need a colon between
  6910.       \fi
  6911.       %
  6912.       % caption text.
  6913.       \appendtomacro\captionline{\scanexp\thiscaption}%
  6914.     \fi
  6915.     %
  6916.     % If we have anything to print, print it, with space before.
  6917.     % Eventually this needs to become an \insert.
  6918.     \ifx\captionline\empty \else
  6919.       \vskip.5\parskip
  6920.       \captionline
  6921.       %
  6922.       % Space below caption.
  6923.       \vskip\parskip
  6924.     \fi
  6925.     %
  6926.     % If have an xref label, write the list of floats info.  Do this
  6927.     % after the caption, to avoid chance of it being a breakpoint.
  6928.     \ifx\floatlabel\empty \else
  6929.       % Write the text that goes in the lof to the aux file as
  6930.       % \floatlabel-lof.  Besides \floatident, we include the short
  6931.       % caption if specified, else the full caption if specified, else nothing.
  6932.       {%
  6933.         \atdummies
  6934.         %
  6935.         % since we read the caption text in the macro world, where ^^M
  6936.         % is turned into a normal character, we have to scan it back, so
  6937.         % we don't write the literal three characters "^^M" into the aux file.
  6938.     \scanexp{%
  6939.       \xdef\noexpand\gtemp{%
  6940.         \ifx\thisshortcaption\empty
  6941.           \thiscaption
  6942.         \else
  6943.           \thisshortcaption
  6944.         \fi
  6945.       }%
  6946.         \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
  6947.       \ifx\gtemp\empty \else : \gtemp \fi}}%
  6948.       }%
  6949.     \fi
  6950.   \egroup  % end of \vtop
  6951.   % place the captured inserts
  6952.   % BEWARE: when the floats start floating, we have to issue warning
  6953.   % whenever an insert appears inside a float which could possibly
  6954.   % float. --kasal, 26may04
  6955.   \checkinserts
  6956. % Append the tokens #2 to the definition of macro #1, not expanding either.
  6957. \def\appendtomacro#1#2{%
  6958.   \expandafter\def\expandafter#1\expandafter{#1#2}%
  6959. % @caption, @shortcaption
  6960. \def\caption{\docaption\thiscaption}
  6961. \def\shortcaption{\docaption\thisshortcaption}
  6962. \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
  6963. \def\defcaption#1#2{\egroup \def#1{#2}}
  6964. % The parameter is the control sequence identifying the counter we are
  6965. % going to use.  Create it if it doesn't exist and assign it to \floatno.
  6966. \def\getfloatno#1{%
  6967.   \ifx#1\relax
  6968.       % Haven't seen this figure type before.
  6969.       \csname newcount\endcsname #1%
  6970.       %
  6971.       % Remember to reset this floatno at the next chap.
  6972.       \expandafter\gdef\expandafter\resetallfloatnos
  6973.         \expandafter{\resetallfloatnos #1=0 }%
  6974.   \fi
  6975.   \let\floatno#1%
  6976. % \setref calls this to get the XREFLABEL-snt value.  We want an @xref
  6977. % to the FLOATLABEL to expand to "Figure 3.1".  We call \setref when we
  6978. % first read the @float command.
  6979. \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
  6980. % Magic string used for the XREFLABEL-title value, so \xrefX can
  6981. % distinguish floats from other xref types.
  6982. \def\floatmagic{!!float!!}
  6983. % #1 is the control sequence we are passed; we expand into a conditional
  6984. % which is true if #1 represents a float ref.  That is, the magic
  6985. % \lastsection value which we \setref above.
  6986. \def\iffloat#1{\expandafter\doiffloat#1==\finish}
  6987. % #1 is (maybe) the \floatmagic string.  If so, #2 will be the
  6988. % (safe) float type for this float.  We set \iffloattype to #2.
  6989. \def\doiffloat#1=#2=#3\finish{%
  6990.   \def\temp{#1}%
  6991.   \def\iffloattype{#2}%
  6992.   \ifx\temp\floatmagic
  6993. % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
  6994. \parseargdef\listoffloats{%
  6995.   \def\floattype{#1}% floattype
  6996.     % the floattype might have accents or other special characters,
  6997.     % but we need to use it in a control sequence name.
  6998.     \indexnofonts
  6999.     \turnoffactive
  7000.     \xdef\safefloattype{\floattype}%
  7001.   % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
  7002.   \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
  7003.     \ifhavexrefs
  7004.       % if the user said @listoffloats foo but never @float foo.
  7005.       \message{\linenumber No `\safefloattype' floats to list.}%
  7006.     \fi
  7007.   \else
  7008.     \begingroup
  7009.       \leftskip=\tocindent  % indent these entries like a toc
  7010.       \let\do=\listoffloatsdo
  7011.       \csname floatlist\safefloattype\endcsname
  7012.     \endgroup
  7013.   \fi
  7014. % This is called on each entry in a list of floats.  We're passed the
  7015. % xref label, in the form LABEL-title, which is how we save it in the
  7016. % aux file.  We strip off the -title and look up \XRLABEL-lof, which
  7017. % has the text we're supposed to typeset here.
  7018. % Figures without xref labels will not be included in the list (since
  7019. % they won't appear in the aux file).
  7020. \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
  7021. \def\listoffloatsdoentry#1-title\finish{{%
  7022.   % Can't fully expand XR#1-lof because it can contain anything.  Just
  7023.   % pass the control sequence.  On the other hand, XR#1-pg is just the
  7024.   % page number, and we want to fully expand that so we can get a link
  7025.   % in pdf output.
  7026.   \toksA = \expandafter{\csname XR#1-lof\endcsname}%
  7027.   % use the same \entry macro we use to generate the TOC and index.
  7028.   \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
  7029.   \writeentry
  7030. \message{localization,}
  7031. % For single-language documents, @documentlanguage is usually given very
  7032. % early, just after @documentencoding.  Single argument is the language
  7033. % (de) or locale (de_DE) abbreviation.
  7034.   \catcode`\_ = \active
  7035.   \globaldefs=1
  7036. \parseargdef\documentlanguage{\begingroup
  7037.   \let_=\normalunderscore  % normal _ character for filenames
  7038.   \tex % read txi-??.tex file in plain TeX.
  7039.     % Read the file by the name they passed if it exists.
  7040.     \openin 1 txi-#1.tex
  7041.     \ifeof 1
  7042.       \documentlanguagetrywithoutunderscore{#1_\finish}%
  7043.     \else
  7044.       \globaldefs = 1  % everything in the txi-LL files needs to persist
  7045.       \input txi-#1.tex
  7046.     \fi
  7047.     \closein 1
  7048.   \endgroup % end raw TeX
  7049. \endgroup}
  7050. % If they passed de_DE, and txi-de_DE.tex doesn't exist,
  7051. % try txi-de.tex.
  7052. \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
  7053.   \openin 1 txi-#1.tex
  7054.   \ifeof 1
  7055.     \errhelp = \nolanghelp
  7056.     \errmessage{Cannot read language file txi-#1.tex}%
  7057.   \else
  7058.     \globaldefs = 1  % everything in the txi-LL files needs to persist
  7059.     \input txi-#1.tex
  7060.   \fi
  7061.   \closein 1
  7062. }% end of special _ catcode
  7063. \newhelp\nolanghelp{The given language definition file cannot be found or
  7064. is empty.  Maybe you need to install it?  Putting it in the current
  7065. directory should work if nowhere else does.}
  7066. % This macro is called from txi-??.tex files; the first argument is the
  7067. % \language name to set (without the "\lang@" prefix), the second and
  7068. % third args are \{left,right}hyphenmin.
  7069. % The language names to pass are determined when the format is built.
  7070. % See the etex.log file created at that time, e.g.,
  7071. % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
  7072. % With TeX Live 2008, etex now includes hyphenation patterns for all
  7073. % available languages.  This means we can support hyphenation in
  7074. % Texinfo, at least to some extent.  (This still doesn't solve the
  7075. % accented characters problem.)
  7076. \catcode`@=11
  7077. \def\txisetlanguage#1#2#3{%
  7078.   % do not set the language if the name is undefined in the current TeX.
  7079.   \expandafter\ifx\csname lang@#1\endcsname \relax
  7080.     \message{no patterns for #1}%
  7081.   \else
  7082.     \global\language = \csname lang@#1\endcsname
  7083.   \fi
  7084.   % but there is no harm in adjusting the hyphenmin values regardless.
  7085.   \global\lefthyphenmin = #2\relax
  7086.   \global\righthyphenmin = #3\relax
  7087. % Helpers for encodings.
  7088. % Set the catcode of characters 128 through 255 to the specified number.
  7089. \def\setnonasciicharscatcode#1{%
  7090.    \count255=128
  7091.    \loop\ifnum\count255<256
  7092.       \global\catcode\count255=#1\relax
  7093.       \advance\count255 by 1
  7094.    \repeat
  7095. \def\setnonasciicharscatcodenonglobal#1{%
  7096.    \count255=128
  7097.    \loop\ifnum\count255<256
  7098.       \catcode\count255=#1\relax
  7099.       \advance\count255 by 1
  7100.    \repeat
  7101. % @documentencoding sets the definition of non-ASCII characters
  7102. % according to the specified encoding.
  7103. \parseargdef\documentencoding{%
  7104.   % Encoding being declared for the document.
  7105.   \def\declaredencoding{\csname #1.enc\endcsname}%
  7106.   % Supported encodings: names converted to tokens in order to be able
  7107.   % to compare them with \ifx.
  7108.   \def\ascii{\csname US-ASCII.enc\endcsname}%
  7109.   \def\latnine{\csname ISO-8859-15.enc\endcsname}%
  7110.   \def\latone{\csname ISO-8859-1.enc\endcsname}%
  7111.   \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
  7112.   \def\utfeight{\csname UTF-8.enc\endcsname}%
  7113.   \ifx \declaredencoding \ascii
  7114.      \asciichardefs
  7115.   \else \ifx \declaredencoding \lattwo
  7116.      \setnonasciicharscatcode\active
  7117.      \lattwochardefs
  7118.   \else \ifx \declaredencoding \latone
  7119.      \setnonasciicharscatcode\active
  7120.      \latonechardefs
  7121.   \else \ifx \declaredencoding \latnine
  7122.      \setnonasciicharscatcode\active
  7123.      \latninechardefs
  7124.   \else \ifx \declaredencoding \utfeight
  7125.      \setnonasciicharscatcode\active
  7126.      \utfeightchardefs
  7127.   \else
  7128.     \message{Unknown document encoding #1, ignoring.}%
  7129.   \fi % utfeight
  7130.   \fi % latnine
  7131.   \fi % latone
  7132.   \fi % lattwo
  7133.   \fi % ascii
  7134. % A message to be logged when using a character that isn't available
  7135. % the default font encoding (OT1).
  7136. \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
  7137. % Take account of \c (plain) vs. \, (Texinfo) difference.
  7138. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
  7139. % First, make active non-ASCII characters in order for them to be
  7140. % correctly categorized when TeX reads the replacement text of
  7141. % macros containing the character definitions.
  7142. \setnonasciicharscatcode\active
  7143. % Latin1 (ISO-8859-1) character definitions.
  7144. \def\latonechardefs{%
  7145.   \gdef^^a0{\tie}
  7146.   \gdef^^a1{\exclamdown}
  7147.   \gdef^^a2{\missingcharmsg{CENT SIGN}}
  7148.   \gdef^^a3{{\pounds}}
  7149.   \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  7150.   \gdef^^a5{\missingcharmsg{YEN SIGN}}
  7151.   \gdef^^a6{\missingcharmsg{BROKEN BAR}}
  7152.   \gdef^^a7{\S}
  7153.   \gdef^^a8{\"{}}
  7154.   \gdef^^a9{\copyright}
  7155.   \gdef^^aa{\ordf}
  7156.   \gdef^^ab{\guillemetleft}
  7157.   \gdef^^ac{$\lnot$}
  7158.   \gdef^^ad{\-}
  7159.   \gdef^^ae{\registeredsymbol}
  7160.   \gdef^^af{\={}}
  7161.   \gdef^^b0{\textdegree}
  7162.   \gdef^^b1{$\pm$}
  7163.   \gdef^^b2{$^2$}
  7164.   \gdef^^b3{$^3$}
  7165.   \gdef^^b4{\'{}}
  7166.   \gdef^^b5{$\mu$}
  7167.   \gdef^^b6{\P}
  7168.   \gdef^^b7{$^.$}
  7169.   \gdef^^b8{\cedilla\ }
  7170.   \gdef^^b9{$^1$}
  7171.   \gdef^^ba{\ordm}
  7172.   \gdef^^bb{\guillemetright}
  7173.   \gdef^^bc{$1\over4$}
  7174.   \gdef^^bd{$1\over2$}
  7175.   \gdef^^be{$3\over4$}
  7176.   \gdef^^bf{\questiondown}
  7177.   \gdef^^c0{\`A}
  7178.   \gdef^^c1{\'A}
  7179.   \gdef^^c2{\^A}
  7180.   \gdef^^c3{\~A}
  7181.   \gdef^^c4{\"A}
  7182.   \gdef^^c5{\ringaccent A}
  7183.   \gdef^^c6{\AE}
  7184.   \gdef^^c7{\cedilla C}
  7185.   \gdef^^c8{\`E}
  7186.   \gdef^^c9{\'E}
  7187.   \gdef^^ca{\^E}
  7188.   \gdef^^cb{\"E}
  7189.   \gdef^^cc{\`I}
  7190.   \gdef^^cd{\'I}
  7191.   \gdef^^ce{\^I}
  7192.   \gdef^^cf{\"I}
  7193.   \gdef^^d0{\DH}
  7194.   \gdef^^d1{\~N}
  7195.   \gdef^^d2{\`O}
  7196.   \gdef^^d3{\'O}
  7197.   \gdef^^d4{\^O}
  7198.   \gdef^^d5{\~O}
  7199.   \gdef^^d6{\"O}
  7200.   \gdef^^d7{$\times$}
  7201.   \gdef^^d8{\O}
  7202.   \gdef^^d9{\`U}
  7203.   \gdef^^da{\'U}
  7204.   \gdef^^db{\^U}
  7205.   \gdef^^dc{\"U}
  7206.   \gdef^^dd{\'Y}
  7207.   \gdef^^de{\TH}
  7208.   \gdef^^df{\ss}
  7209.   \gdef^^e0{\`a}
  7210.   \gdef^^e1{\'a}
  7211.   \gdef^^e2{\^a}
  7212.   \gdef^^e3{\~a}
  7213.   \gdef^^e4{\"a}
  7214.   \gdef^^e5{\ringaccent a}
  7215.   \gdef^^e6{\ae}
  7216.   \gdef^^e7{\cedilla c}
  7217.   \gdef^^e8{\`e}
  7218.   \gdef^^e9{\'e}
  7219.   \gdef^^ea{\^e}
  7220.   \gdef^^eb{\"e}
  7221.   \gdef^^ec{\`{\dotless i}}
  7222.   \gdef^^ed{\'{\dotless i}}
  7223.   \gdef^^ee{\^{\dotless i}}
  7224.   \gdef^^ef{\"{\dotless i}}
  7225.   \gdef^^f0{\dh}
  7226.   \gdef^^f1{\~n}
  7227.   \gdef^^f2{\`o}
  7228.   \gdef^^f3{\'o}
  7229.   \gdef^^f4{\^o}
  7230.   \gdef^^f5{\~o}
  7231.   \gdef^^f6{\"o}
  7232.   \gdef^^f7{$\div$}
  7233.   \gdef^^f8{\o}
  7234.   \gdef^^f9{\`u}
  7235.   \gdef^^fa{\'u}
  7236.   \gdef^^fb{\^u}
  7237.   \gdef^^fc{\"u}
  7238.   \gdef^^fd{\'y}
  7239.   \gdef^^fe{\th}
  7240.   \gdef^^ff{\"y}
  7241. % Latin9 (ISO-8859-15) encoding character definitions.
  7242. \def\latninechardefs{%
  7243.   % Encoding is almost identical to Latin1.
  7244.   \latonechardefs
  7245.   \gdef^^a4{\euro}
  7246.   \gdef^^a6{\v S}
  7247.   \gdef^^a8{\v s}
  7248.   \gdef^^b4{\v Z}
  7249.   \gdef^^b8{\v z}
  7250.   \gdef^^bc{\OE}
  7251.   \gdef^^bd{\oe}
  7252.   \gdef^^be{\"Y}
  7253. % Latin2 (ISO-8859-2) character definitions.
  7254. \def\lattwochardefs{%
  7255.   \gdef^^a0{\tie}
  7256.   \gdef^^a1{\ogonek{A}}
  7257.   \gdef^^a2{\u{}}
  7258.   \gdef^^a3{\L}
  7259.   \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  7260.   \gdef^^a5{\v L}
  7261.   \gdef^^a6{\'S}
  7262.   \gdef^^a7{\S}
  7263.   \gdef^^a8{\"{}}
  7264.   \gdef^^a9{\v S}
  7265.   \gdef^^aa{\cedilla S}
  7266.   \gdef^^ab{\v T}
  7267.   \gdef^^ac{\'Z}
  7268.   \gdef^^ad{\-}
  7269.   \gdef^^ae{\v Z}
  7270.   \gdef^^af{\dotaccent Z}
  7271.   \gdef^^b0{\textdegree}
  7272.   \gdef^^b1{\ogonek{a}}
  7273.   \gdef^^b2{\ogonek{ }}
  7274.   \gdef^^b3{\l}
  7275.   \gdef^^b4{\'{}}
  7276.   \gdef^^b5{\v l}
  7277.   \gdef^^b6{\'s}
  7278.   \gdef^^b7{\v{}}
  7279.   \gdef^^b8{\cedilla\ }
  7280.   \gdef^^b9{\v s}
  7281.   \gdef^^ba{\cedilla s}
  7282.   \gdef^^bb{\v t}
  7283.   \gdef^^bc{\'z}
  7284.   \gdef^^bd{\H{}}
  7285.   \gdef^^be{\v z}
  7286.   \gdef^^bf{\dotaccent z}
  7287.   \gdef^^c0{\'R}
  7288.   \gdef^^c1{\'A}
  7289.   \gdef^^c2{\^A}
  7290.   \gdef^^c3{\u A}
  7291.   \gdef^^c4{\"A}
  7292.   \gdef^^c5{\'L}
  7293.   \gdef^^c6{\'C}
  7294.   \gdef^^c7{\cedilla C}
  7295.   \gdef^^c8{\v C}
  7296.   \gdef^^c9{\'E}
  7297.   \gdef^^ca{\ogonek{E}}
  7298.   \gdef^^cb{\"E}
  7299.   \gdef^^cc{\v E}
  7300.   \gdef^^cd{\'I}
  7301.   \gdef^^ce{\^I}
  7302.   \gdef^^cf{\v D}
  7303.   \gdef^^d0{\DH}
  7304.   \gdef^^d1{\'N}
  7305.   \gdef^^d2{\v N}
  7306.   \gdef^^d3{\'O}
  7307.   \gdef^^d4{\^O}
  7308.   \gdef^^d5{\H O}
  7309.   \gdef^^d6{\"O}
  7310.   \gdef^^d7{$\times$}
  7311.   \gdef^^d8{\v R}
  7312.   \gdef^^d9{\ringaccent U}
  7313.   \gdef^^da{\'U}
  7314.   \gdef^^db{\H U}
  7315.   \gdef^^dc{\"U}
  7316.   \gdef^^dd{\'Y}
  7317.   \gdef^^de{\cedilla T}
  7318.   \gdef^^df{\ss}
  7319.   \gdef^^e0{\'r}
  7320.   \gdef^^e1{\'a}
  7321.   \gdef^^e2{\^a}
  7322.   \gdef^^e3{\u a}
  7323.   \gdef^^e4{\"a}
  7324.   \gdef^^e5{\'l}
  7325.   \gdef^^e6{\'c}
  7326.   \gdef^^e7{\cedilla c}
  7327.   \gdef^^e8{\v c}
  7328.   \gdef^^e9{\'e}
  7329.   \gdef^^ea{\ogonek{e}}
  7330.   \gdef^^eb{\"e}
  7331.   \gdef^^ec{\v e}
  7332.   \gdef^^ed{\'{\dotless{i}}}
  7333.   \gdef^^ee{\^{\dotless{i}}}
  7334.   \gdef^^ef{\v d}
  7335.   \gdef^^f0{\dh}
  7336.   \gdef^^f1{\'n}
  7337.   \gdef^^f2{\v n}
  7338.   \gdef^^f3{\'o}
  7339.   \gdef^^f4{\^o}
  7340.   \gdef^^f5{\H o}
  7341.   \gdef^^f6{\"o}
  7342.   \gdef^^f7{$\div$}
  7343.   \gdef^^f8{\v r}
  7344.   \gdef^^f9{\ringaccent u}
  7345.   \gdef^^fa{\'u}
  7346.   \gdef^^fb{\H u}
  7347.   \gdef^^fc{\"u}
  7348.   \gdef^^fd{\'y}
  7349.   \gdef^^fe{\cedilla t}
  7350.   \gdef^^ff{\dotaccent{}}
  7351. % UTF-8 character definitions.
  7352. % This code to support UTF-8 is based on LaTeX's utf8.def, with some
  7353. % changes for Texinfo conventions.  It is included here under the GPL by
  7354. % permission from Frank Mittelbach and the LaTeX team.
  7355. \newcount\countUTFx
  7356. \newcount\countUTFy
  7357. \newcount\countUTFz
  7358. \gdef\UTFviiiTwoOctets#1#2{\expandafter
  7359.    \UTFviiiDefined\csname u8:#1\string #2\endcsname}
  7360. \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
  7361.    \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
  7362. \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
  7363.    \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
  7364. \gdef\UTFviiiDefined#1{%
  7365.   \ifx #1\relax
  7366.     \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
  7367.   \else
  7368.     \expandafter #1%
  7369.   \fi
  7370. \begingroup
  7371.   \catcode`\~13
  7372.   \catcode`\"12
  7373.   \def\UTFviiiLoop{%
  7374.     \global\catcode\countUTFx\active
  7375.     \uccode`\~\countUTFx
  7376.     \uppercase\expandafter{\UTFviiiTmp}%
  7377.     \advance\countUTFx by 1
  7378.     \ifnum\countUTFx < \countUTFy
  7379.       \expandafter\UTFviiiLoop
  7380.     \fi}
  7381.   \countUTFx = "C2
  7382.   \countUTFy = "E0
  7383.   \def\UTFviiiTmp{%
  7384.     \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
  7385.   \UTFviiiLoop
  7386.   \countUTFx = "E0
  7387.   \countUTFy = "F0
  7388.   \def\UTFviiiTmp{%
  7389.     \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
  7390.   \UTFviiiLoop
  7391.   \countUTFx = "F0
  7392.   \countUTFy = "F4
  7393.   \def\UTFviiiTmp{%
  7394.     \xdef~{\noexpand\UTFviiiFourOctets\string~}}
  7395.   \UTFviiiLoop
  7396. \endgroup
  7397. \begingroup
  7398.   \catcode`\"=12
  7399.   \catcode`\<=12
  7400.   \catcode`\.=12
  7401.   \catcode`\,=12
  7402.   \catcode`\;=12
  7403.   \catcode`\!=12
  7404.   \catcode`\~=13
  7405.   \gdef\DeclareUnicodeCharacter#1#2{%
  7406.     \countUTFz = "#1\relax
  7407.     %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
  7408.     \begingroup
  7409.       \parseXMLCharref
  7410.       \def\UTFviiiTwoOctets##1##2{%
  7411.         \csname u8:##1\string ##2\endcsname}%
  7412.       \def\UTFviiiThreeOctets##1##2##3{%
  7413.         \csname u8:##1\string ##2\string ##3\endcsname}%
  7414.       \def\UTFviiiFourOctets##1##2##3##4{%
  7415.         \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
  7416.       \expandafter\expandafter\expandafter\expandafter
  7417.        \expandafter\expandafter\expandafter
  7418.        \gdef\UTFviiiTmp{#2}%
  7419.     \endgroup}
  7420.   \gdef\parseXMLCharref{%
  7421.     \ifnum\countUTFz < "A0\relax
  7422.       \errhelp = \EMsimple
  7423.       \errmessage{Cannot define Unicode char value < 00A0}%
  7424.     \else\ifnum\countUTFz < "800\relax
  7425.       \parseUTFviiiA,%
  7426.       \parseUTFviiiB C\UTFviiiTwoOctets.,%
  7427.     \else\ifnum\countUTFz < "10000\relax
  7428.       \parseUTFviiiA;%
  7429.       \parseUTFviiiA,%
  7430.       \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
  7431.     \else
  7432.       \parseUTFviiiA;%
  7433.       \parseUTFviiiA,%
  7434.       \parseUTFviiiA!%
  7435.       \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
  7436.     \fi\fi\fi
  7437.   \gdef\parseUTFviiiA#1{%
  7438.     \countUTFx = \countUTFz
  7439.     \divide\countUTFz by 64
  7440.     \countUTFy = \countUTFz
  7441.     \multiply\countUTFz by 64
  7442.     \advance\countUTFx by -\countUTFz
  7443.     \advance\countUTFx by 128
  7444.     \uccode `#1\countUTFx
  7445.     \countUTFz = \countUTFy}
  7446.   \gdef\parseUTFviiiB#1#2#3#4{%
  7447.     \advance\countUTFz by "#10\relax
  7448.     \uccode `#3\countUTFz
  7449.     \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
  7450. \endgroup
  7451. \def\utfeightchardefs{%
  7452.   \DeclareUnicodeCharacter{00A0}{\tie}
  7453.   \DeclareUnicodeCharacter{00A1}{\exclamdown}
  7454.   \DeclareUnicodeCharacter{00A3}{\pounds}
  7455.   \DeclareUnicodeCharacter{00A8}{\"{ }}
  7456.   \DeclareUnicodeCharacter{00A9}{\copyright}
  7457.   \DeclareUnicodeCharacter{00AA}{\ordf}
  7458.   \DeclareUnicodeCharacter{00AB}{\guillemetleft}
  7459.   \DeclareUnicodeCharacter{00AD}{\-}
  7460.   \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
  7461.   \DeclareUnicodeCharacter{00AF}{\={ }}
  7462.   \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
  7463.   \DeclareUnicodeCharacter{00B4}{\'{ }}
  7464.   \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
  7465.   \DeclareUnicodeCharacter{00BA}{\ordm}
  7466.   \DeclareUnicodeCharacter{00BB}{\guillemetright}
  7467.   \DeclareUnicodeCharacter{00BF}{\questiondown}
  7468.   \DeclareUnicodeCharacter{00C0}{\`A}
  7469.   \DeclareUnicodeCharacter{00C1}{\'A}
  7470.   \DeclareUnicodeCharacter{00C2}{\^A}
  7471.   \DeclareUnicodeCharacter{00C3}{\~A}
  7472.   \DeclareUnicodeCharacter{00C4}{\"A}
  7473.   \DeclareUnicodeCharacter{00C5}{\AA}
  7474.   \DeclareUnicodeCharacter{00C6}{\AE}
  7475.   \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
  7476.   \DeclareUnicodeCharacter{00C8}{\`E}
  7477.   \DeclareUnicodeCharacter{00C9}{\'E}
  7478.   \DeclareUnicodeCharacter{00CA}{\^E}
  7479.   \DeclareUnicodeCharacter{00CB}{\"E}
  7480.   \DeclareUnicodeCharacter{00CC}{\`I}
  7481.   \DeclareUnicodeCharacter{00CD}{\'I}
  7482.   \DeclareUnicodeCharacter{00CE}{\^I}
  7483.   \DeclareUnicodeCharacter{00CF}{\"I}
  7484.   \DeclareUnicodeCharacter{00D0}{\DH}
  7485.   \DeclareUnicodeCharacter{00D1}{\~N}
  7486.   \DeclareUnicodeCharacter{00D2}{\`O}
  7487.   \DeclareUnicodeCharacter{00D3}{\'O}
  7488.   \DeclareUnicodeCharacter{00D4}{\^O}
  7489.   \DeclareUnicodeCharacter{00D5}{\~O}
  7490.   \DeclareUnicodeCharacter{00D6}{\"O}
  7491.   \DeclareUnicodeCharacter{00D8}{\O}
  7492.   \DeclareUnicodeCharacter{00D9}{\`U}
  7493.   \DeclareUnicodeCharacter{00DA}{\'U}
  7494.   \DeclareUnicodeCharacter{00DB}{\^U}
  7495.   \DeclareUnicodeCharacter{00DC}{\"U}
  7496.   \DeclareUnicodeCharacter{00DD}{\'Y}
  7497.   \DeclareUnicodeCharacter{00DE}{\TH}
  7498.   \DeclareUnicodeCharacter{00DF}{\ss}
  7499.   \DeclareUnicodeCharacter{00E0}{\`a}
  7500.   \DeclareUnicodeCharacter{00E1}{\'a}
  7501.   \DeclareUnicodeCharacter{00E2}{\^a}
  7502.   \DeclareUnicodeCharacter{00E3}{\~a}
  7503.   \DeclareUnicodeCharacter{00E4}{\"a}
  7504.   \DeclareUnicodeCharacter{00E5}{\aa}
  7505.   \DeclareUnicodeCharacter{00E6}{\ae}
  7506.   \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
  7507.   \DeclareUnicodeCharacter{00E8}{\`e}
  7508.   \DeclareUnicodeCharacter{00E9}{\'e}
  7509.   \DeclareUnicodeCharacter{00EA}{\^e}
  7510.   \DeclareUnicodeCharacter{00EB}{\"e}
  7511.   \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
  7512.   \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
  7513.   \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
  7514.   \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
  7515.   \DeclareUnicodeCharacter{00F0}{\dh}
  7516.   \DeclareUnicodeCharacter{00F1}{\~n}
  7517.   \DeclareUnicodeCharacter{00F2}{\`o}
  7518.   \DeclareUnicodeCharacter{00F3}{\'o}
  7519.   \DeclareUnicodeCharacter{00F4}{\^o}
  7520.   \DeclareUnicodeCharacter{00F5}{\~o}
  7521.   \DeclareUnicodeCharacter{00F6}{\"o}
  7522.   \DeclareUnicodeCharacter{00F8}{\o}
  7523.   \DeclareUnicodeCharacter{00F9}{\`u}
  7524.   \DeclareUnicodeCharacter{00FA}{\'u}
  7525.   \DeclareUnicodeCharacter{00FB}{\^u}
  7526.   \DeclareUnicodeCharacter{00FC}{\"u}
  7527.   \DeclareUnicodeCharacter{00FD}{\'y}
  7528.   \DeclareUnicodeCharacter{00FE}{\th}
  7529.   \DeclareUnicodeCharacter{00FF}{\"y}
  7530.   \DeclareUnicodeCharacter{0100}{\=A}
  7531.   \DeclareUnicodeCharacter{0101}{\=a}
  7532.   \DeclareUnicodeCharacter{0102}{\u{A}}
  7533.   \DeclareUnicodeCharacter{0103}{\u{a}}
  7534.   \DeclareUnicodeCharacter{0104}{\ogonek{A}}
  7535.   \DeclareUnicodeCharacter{0105}{\ogonek{a}}
  7536.   \DeclareUnicodeCharacter{0106}{\'C}
  7537.   \DeclareUnicodeCharacter{0107}{\'c}
  7538.   \DeclareUnicodeCharacter{0108}{\^C}
  7539.   \DeclareUnicodeCharacter{0109}{\^c}
  7540.   \DeclareUnicodeCharacter{0118}{\ogonek{E}}
  7541.   \DeclareUnicodeCharacter{0119}{\ogonek{e}}
  7542.   \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
  7543.   \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
  7544.   \DeclareUnicodeCharacter{010C}{\v{C}}
  7545.   \DeclareUnicodeCharacter{010D}{\v{c}}
  7546.   \DeclareUnicodeCharacter{010E}{\v{D}}
  7547.   \DeclareUnicodeCharacter{0112}{\=E}
  7548.   \DeclareUnicodeCharacter{0113}{\=e}
  7549.   \DeclareUnicodeCharacter{0114}{\u{E}}
  7550.   \DeclareUnicodeCharacter{0115}{\u{e}}
  7551.   \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
  7552.   \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
  7553.   \DeclareUnicodeCharacter{011A}{\v{E}}
  7554.   \DeclareUnicodeCharacter{011B}{\v{e}}
  7555.   \DeclareUnicodeCharacter{011C}{\^G}
  7556.   \DeclareUnicodeCharacter{011D}{\^g}
  7557.   \DeclareUnicodeCharacter{011E}{\u{G}}
  7558.   \DeclareUnicodeCharacter{011F}{\u{g}}
  7559.   \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
  7560.   \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
  7561.   \DeclareUnicodeCharacter{0124}{\^H}
  7562.   \DeclareUnicodeCharacter{0125}{\^h}
  7563.   \DeclareUnicodeCharacter{0128}{\~I}
  7564.   \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
  7565.   \DeclareUnicodeCharacter{012A}{\=I}
  7566.   \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
  7567.   \DeclareUnicodeCharacter{012C}{\u{I}}
  7568.   \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
  7569.   \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
  7570.   \DeclareUnicodeCharacter{0131}{\dotless{i}}
  7571.   \DeclareUnicodeCharacter{0132}{IJ}
  7572.   \DeclareUnicodeCharacter{0133}{ij}
  7573.   \DeclareUnicodeCharacter{0134}{\^J}
  7574.   \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
  7575.   \DeclareUnicodeCharacter{0139}{\'L}
  7576.   \DeclareUnicodeCharacter{013A}{\'l}
  7577.   \DeclareUnicodeCharacter{0141}{\L}
  7578.   \DeclareUnicodeCharacter{0142}{\l}
  7579.   \DeclareUnicodeCharacter{0143}{\'N}
  7580.   \DeclareUnicodeCharacter{0144}{\'n}
  7581.   \DeclareUnicodeCharacter{0147}{\v{N}}
  7582.   \DeclareUnicodeCharacter{0148}{\v{n}}
  7583.   \DeclareUnicodeCharacter{014C}{\=O}
  7584.   \DeclareUnicodeCharacter{014D}{\=o}
  7585.   \DeclareUnicodeCharacter{014E}{\u{O}}
  7586.   \DeclareUnicodeCharacter{014F}{\u{o}}
  7587.   \DeclareUnicodeCharacter{0150}{\H{O}}
  7588.   \DeclareUnicodeCharacter{0151}{\H{o}}
  7589.   \DeclareUnicodeCharacter{0152}{\OE}
  7590.   \DeclareUnicodeCharacter{0153}{\oe}
  7591.   \DeclareUnicodeCharacter{0154}{\'R}
  7592.   \DeclareUnicodeCharacter{0155}{\'r}
  7593.   \DeclareUnicodeCharacter{0158}{\v{R}}
  7594.   \DeclareUnicodeCharacter{0159}{\v{r}}
  7595.   \DeclareUnicodeCharacter{015A}{\'S}
  7596.   \DeclareUnicodeCharacter{015B}{\'s}
  7597.   \DeclareUnicodeCharacter{015C}{\^S}
  7598.   \DeclareUnicodeCharacter{015D}{\^s}
  7599.   \DeclareUnicodeCharacter{015E}{\cedilla{S}}
  7600.   \DeclareUnicodeCharacter{015F}{\cedilla{s}}
  7601.   \DeclareUnicodeCharacter{0160}{\v{S}}
  7602.   \DeclareUnicodeCharacter{0161}{\v{s}}
  7603.   \DeclareUnicodeCharacter{0162}{\cedilla{t}}
  7604.   \DeclareUnicodeCharacter{0163}{\cedilla{T}}
  7605.   \DeclareUnicodeCharacter{0164}{\v{T}}
  7606.   \DeclareUnicodeCharacter{0168}{\~U}
  7607.   \DeclareUnicodeCharacter{0169}{\~u}
  7608.   \DeclareUnicodeCharacter{016A}{\=U}
  7609.   \DeclareUnicodeCharacter{016B}{\=u}
  7610.   \DeclareUnicodeCharacter{016C}{\u{U}}
  7611.   \DeclareUnicodeCharacter{016D}{\u{u}}
  7612.   \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
  7613.   \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
  7614.   \DeclareUnicodeCharacter{0170}{\H{U}}
  7615.   \DeclareUnicodeCharacter{0171}{\H{u}}
  7616.   \DeclareUnicodeCharacter{0174}{\^W}
  7617.   \DeclareUnicodeCharacter{0175}{\^w}
  7618.   \DeclareUnicodeCharacter{0176}{\^Y}
  7619.   \DeclareUnicodeCharacter{0177}{\^y}
  7620.   \DeclareUnicodeCharacter{0178}{\"Y}
  7621.   \DeclareUnicodeCharacter{0179}{\'Z}
  7622.   \DeclareUnicodeCharacter{017A}{\'z}
  7623.   \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
  7624.   \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
  7625.   \DeclareUnicodeCharacter{017D}{\v{Z}}
  7626.   \DeclareUnicodeCharacter{017E}{\v{z}}
  7627.   \DeclareUnicodeCharacter{01C4}{D\v{Z}}
  7628.   \DeclareUnicodeCharacter{01C5}{D\v{z}}
  7629.   \DeclareUnicodeCharacter{01C6}{d\v{z}}
  7630.   \DeclareUnicodeCharacter{01C7}{LJ}
  7631.   \DeclareUnicodeCharacter{01C8}{Lj}
  7632.   \DeclareUnicodeCharacter{01C9}{lj}
  7633.   \DeclareUnicodeCharacter{01CA}{NJ}
  7634.   \DeclareUnicodeCharacter{01CB}{Nj}
  7635.   \DeclareUnicodeCharacter{01CC}{nj}
  7636.   \DeclareUnicodeCharacter{01CD}{\v{A}}
  7637.   \DeclareUnicodeCharacter{01CE}{\v{a}}
  7638.   \DeclareUnicodeCharacter{01CF}{\v{I}}
  7639.   \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
  7640.   \DeclareUnicodeCharacter{01D1}{\v{O}}
  7641.   \DeclareUnicodeCharacter{01D2}{\v{o}}
  7642.   \DeclareUnicodeCharacter{01D3}{\v{U}}
  7643.   \DeclareUnicodeCharacter{01D4}{\v{u}}
  7644.   \DeclareUnicodeCharacter{01E2}{\={\AE}}
  7645.   \DeclareUnicodeCharacter{01E3}{\={\ae}}
  7646.   \DeclareUnicodeCharacter{01E6}{\v{G}}
  7647.   \DeclareUnicodeCharacter{01E7}{\v{g}}
  7648.   \DeclareUnicodeCharacter{01E8}{\v{K}}
  7649.   \DeclareUnicodeCharacter{01E9}{\v{k}}
  7650.   \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
  7651.   \DeclareUnicodeCharacter{01F1}{DZ}
  7652.   \DeclareUnicodeCharacter{01F2}{Dz}
  7653.   \DeclareUnicodeCharacter{01F3}{dz}
  7654.   \DeclareUnicodeCharacter{01F4}{\'G}
  7655.   \DeclareUnicodeCharacter{01F5}{\'g}
  7656.   \DeclareUnicodeCharacter{01F8}{\`N}
  7657.   \DeclareUnicodeCharacter{01F9}{\`n}
  7658.   \DeclareUnicodeCharacter{01FC}{\'{\AE}}
  7659.   \DeclareUnicodeCharacter{01FD}{\'{\ae}}
  7660.   \DeclareUnicodeCharacter{01FE}{\'{\O}}
  7661.   \DeclareUnicodeCharacter{01FF}{\'{\o}}
  7662.   \DeclareUnicodeCharacter{021E}{\v{H}}
  7663.   \DeclareUnicodeCharacter{021F}{\v{h}}
  7664.   \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
  7665.   \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
  7666.   \DeclareUnicodeCharacter{0228}{\cedilla{E}}
  7667.   \DeclareUnicodeCharacter{0229}{\cedilla{e}}
  7668.   \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
  7669.   \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
  7670.   \DeclareUnicodeCharacter{0232}{\=Y}
  7671.   \DeclareUnicodeCharacter{0233}{\=y}
  7672.   \DeclareUnicodeCharacter{0237}{\dotless{j}}
  7673.   \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
  7674.   \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
  7675.   \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
  7676.   \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
  7677.   \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
  7678.   \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
  7679.   \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
  7680.   \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
  7681.   \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
  7682.   \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
  7683.   \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
  7684.   \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
  7685.   \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
  7686.   \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
  7687.   \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
  7688.   \DeclareUnicodeCharacter{1E20}{\=G}
  7689.   \DeclareUnicodeCharacter{1E21}{\=g}
  7690.   \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
  7691.   \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
  7692.   \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
  7693.   \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
  7694.   \DeclareUnicodeCharacter{1E26}{\"H}
  7695.   \DeclareUnicodeCharacter{1E27}{\"h}
  7696.   \DeclareUnicodeCharacter{1E30}{\'K}
  7697.   \DeclareUnicodeCharacter{1E31}{\'k}
  7698.   \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
  7699.   \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
  7700.   \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
  7701.   \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
  7702.   \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
  7703.   \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
  7704.   \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
  7705.   \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
  7706.   \DeclareUnicodeCharacter{1E3E}{\'M}
  7707.   \DeclareUnicodeCharacter{1E3F}{\'m}
  7708.   \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
  7709.   \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
  7710.   \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
  7711.   \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
  7712.   \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
  7713.   \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
  7714.   \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
  7715.   \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
  7716.   \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
  7717.   \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
  7718.   \DeclareUnicodeCharacter{1E54}{\'P}
  7719.   \DeclareUnicodeCharacter{1E55}{\'p}
  7720.   \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
  7721.   \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
  7722.   \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
  7723.   \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
  7724.   \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
  7725.   \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
  7726.   \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
  7727.   \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
  7728.   \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
  7729.   \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
  7730.   \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
  7731.   \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
  7732.   \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
  7733.   \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
  7734.   \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
  7735.   \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
  7736.   \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
  7737.   \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
  7738.   \DeclareUnicodeCharacter{1E7C}{\~V}
  7739.   \DeclareUnicodeCharacter{1E7D}{\~v}
  7740.   \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
  7741.   \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
  7742.   \DeclareUnicodeCharacter{1E80}{\`W}
  7743.   \DeclareUnicodeCharacter{1E81}{\`w}
  7744.   \DeclareUnicodeCharacter{1E82}{\'W}
  7745.   \DeclareUnicodeCharacter{1E83}{\'w}
  7746.   \DeclareUnicodeCharacter{1E84}{\"W}
  7747.   \DeclareUnicodeCharacter{1E85}{\"w}
  7748.   \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
  7749.   \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
  7750.   \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
  7751.   \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
  7752.   \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
  7753.   \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
  7754.   \DeclareUnicodeCharacter{1E8C}{\"X}
  7755.   \DeclareUnicodeCharacter{1E8D}{\"x}
  7756.   \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
  7757.   \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
  7758.   \DeclareUnicodeCharacter{1E90}{\^Z}
  7759.   \DeclareUnicodeCharacter{1E91}{\^z}
  7760.   \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
  7761.   \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
  7762.   \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
  7763.   \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
  7764.   \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
  7765.   \DeclareUnicodeCharacter{1E97}{\"t}
  7766.   \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
  7767.   \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
  7768.   \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
  7769.   \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
  7770.   \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
  7771.   \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
  7772.   \DeclareUnicodeCharacter{1EBC}{\~E}
  7773.   \DeclareUnicodeCharacter{1EBD}{\~e}
  7774.   \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
  7775.   \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
  7776.   \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
  7777.   \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
  7778.   \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
  7779.   \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
  7780.   \DeclareUnicodeCharacter{1EF2}{\`Y}
  7781.   \DeclareUnicodeCharacter{1EF3}{\`y}
  7782.   \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
  7783.   \DeclareUnicodeCharacter{1EF8}{\~Y}
  7784.   \DeclareUnicodeCharacter{1EF9}{\~y}
  7785.   \DeclareUnicodeCharacter{2013}{--}
  7786.   \DeclareUnicodeCharacter{2014}{---}
  7787.   \DeclareUnicodeCharacter{2018}{\quoteleft}
  7788.   \DeclareUnicodeCharacter{2019}{\quoteright}
  7789.   \DeclareUnicodeCharacter{201A}{\quotesinglbase}
  7790.   \DeclareUnicodeCharacter{201C}{\quotedblleft}
  7791.   \DeclareUnicodeCharacter{201D}{\quotedblright}
  7792.   \DeclareUnicodeCharacter{201E}{\quotedblbase}
  7793.   \DeclareUnicodeCharacter{2022}{\bullet}
  7794.   \DeclareUnicodeCharacter{2026}{\dots}
  7795.   \DeclareUnicodeCharacter{2039}{\guilsinglleft}
  7796.   \DeclareUnicodeCharacter{203A}{\guilsinglright}
  7797.   \DeclareUnicodeCharacter{20AC}{\euro}
  7798.   \DeclareUnicodeCharacter{2192}{\expansion}
  7799.   \DeclareUnicodeCharacter{21D2}{\result}
  7800.   \DeclareUnicodeCharacter{2212}{\minus}
  7801.   \DeclareUnicodeCharacter{2217}{\point}
  7802.   \DeclareUnicodeCharacter{2261}{\equiv}
  7803. }% end of \utfeightchardefs
  7804. % US-ASCII character definitions.
  7805. \def\asciichardefs{% nothing need be done
  7806.    \relax
  7807. % Make non-ASCII characters printable again for compatibility with
  7808. % existing Texinfo documents that may use them, even without declaring a
  7809. % document encoding.
  7810. \setnonasciicharscatcode \other
  7811. \message{formatting,}
  7812. \newdimen\defaultparindent \defaultparindent = 15pt
  7813. \chapheadingskip = 15pt plus 4pt minus 2pt
  7814. \secheadingskip = 12pt plus 3pt minus 2pt
  7815. \subsecheadingskip = 9pt plus 2pt minus 2pt
  7816. % Prevent underfull vbox error messages.
  7817. \vbadness = 10000
  7818. % Don't be very finicky about underfull hboxes, either.
  7819. \hbadness = 6666
  7820. % Following George Bush, get rid of widows and orphans.
  7821. \widowpenalty=10000
  7822. \clubpenalty=10000
  7823. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  7824. % using an old version of TeX, don't do anything.  We want the amount of
  7825. % stretch added to depend on the line length, hence the dependence on
  7826. % \hsize.  We call this whenever the paper size is set.
  7827. \def\setemergencystretch{%
  7828.   \ifx\emergencystretch\thisisundefined
  7829.     % Allow us to assign to \emergencystretch anyway.
  7830.     \def\emergencystretch{\dimen0}%
  7831.   \else
  7832.     \emergencystretch = .15\hsize
  7833.   \fi
  7834. % Parameters in order: 1) textheight; 2) textwidth;
  7835. % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
  7836. % 7) physical page height; 8) physical page width.
  7837. % We also call \setleading{\textleading}, so the caller should define
  7838. % \textleading.  The caller should also set \parskip.
  7839. \def\internalpagesizes#1#2#3#4#5#6#7#8{%
  7840.   \voffset = #3\relax
  7841.   \topskip = #6\relax
  7842.   \splittopskip = \topskip
  7843.   \vsize = #1\relax
  7844.   \advance\vsize by \topskip
  7845.   \outervsize = \vsize
  7846.   \advance\outervsize by 2\topandbottommargin
  7847.   \pageheight = \vsize
  7848.   \hsize = #2\relax
  7849.   \outerhsize = \hsize
  7850.   \advance\outerhsize by 0.5in
  7851.   \pagewidth = \hsize
  7852.   \normaloffset = #4\relax
  7853.   \bindingoffset = #5\relax
  7854.   \ifpdf
  7855.     \pdfpageheight #7\relax
  7856.     \pdfpagewidth #8\relax
  7857.     % if we don't reset these, they will remain at "1 true in" of
  7858.     % whatever layout pdftex was dumped with.
  7859.     \pdfhorigin = 1 true in
  7860.     \pdfvorigin = 1 true in
  7861.   \fi
  7862.   \setleading{\textleading}
  7863.   \parindent = \defaultparindent
  7864.   \setemergencystretch
  7865. % @letterpaper (the default).
  7866. \def\letterpaper{{\globaldefs = 1
  7867.   \parskip = 3pt plus 2pt minus 1pt
  7868.   \textleading = 13.2pt
  7869.   % If page is nothing but text, make it come out even.
  7870.   \internalpagesizes{607.2pt}{6in}% that's 46 lines
  7871.                     {\voffset}{.25in}%
  7872.                     {\bindingoffset}{36pt}%
  7873.                     {11in}{8.5in}%
  7874. % Use @smallbook to reset parameters for 7x9.25 trim size.
  7875. \def\smallbook{{\globaldefs = 1
  7876.   \parskip = 2pt plus 1pt
  7877.   \textleading = 12pt
  7878.   \internalpagesizes{7.5in}{5in}%
  7879.                     {-.2in}{0in}%
  7880.                     {\bindingoffset}{16pt}%
  7881.                     {9.25in}{7in}%
  7882.   \lispnarrowing = 0.3in
  7883.   \tolerance = 700
  7884.   \hfuzz = 1pt
  7885.   \contentsrightmargin = 0pt
  7886.   \defbodyindent = .5cm
  7887. % Use @smallerbook to reset parameters for 6x9 trim size.
  7888. % (Just testing, parameters still in flux.)
  7889. \def\smallerbook{{\globaldefs = 1
  7890.   \parskip = 1.5pt plus 1pt
  7891.   \textleading = 12pt
  7892.   \internalpagesizes{7.4in}{4.8in}%
  7893.                     {-.2in}{-.4in}%
  7894.                     {0pt}{14pt}%
  7895.                     {9in}{6in}%
  7896.   \lispnarrowing = 0.25in
  7897.   \tolerance = 700
  7898.   \hfuzz = 1pt
  7899.   \contentsrightmargin = 0pt
  7900.   \defbodyindent = .4cm
  7901. % Use @afourpaper to print on European A4 paper.
  7902. \def\afourpaper{{\globaldefs = 1
  7903.   \parskip = 3pt plus 2pt minus 1pt
  7904.   \textleading = 13.2pt
  7905.   % Double-side printing via postscript on Laserjet 4050
  7906.   % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
  7907.   % To change the settings for a different printer or situation, adjust
  7908.   % \normaloffset until the front-side and back-side texts align.  Then
  7909.   % do the same for \bindingoffset.  You can set these for testing in
  7910.   % your texinfo source file like this:
  7911.   % @tex
  7912.   % \global\normaloffset = -6mm
  7913.   % \global\bindingoffset = 10mm
  7914.   % @end tex
  7915.   \internalpagesizes{673.2pt}{160mm}% that's 51 lines
  7916.                     {\voffset}{\hoffset}%
  7917.                     {\bindingoffset}{44pt}%
  7918.                     {297mm}{210mm}%
  7919.   \tolerance = 700
  7920.   \hfuzz = 1pt
  7921.   \contentsrightmargin = 0pt
  7922.   \defbodyindent = 5mm
  7923. % Use @afivepaper to print on European A5 paper.
  7924. % From romildo@urano.iceb.ufop.br, 2 July 2000.
  7925. % He also recommends making @example and @lisp be small.
  7926. \def\afivepaper{{\globaldefs = 1
  7927.   \parskip = 2pt plus 1pt minus 0.1pt
  7928.   \textleading = 12.5pt
  7929.   \internalpagesizes{160mm}{120mm}%
  7930.                     {\voffset}{\hoffset}%
  7931.                     {\bindingoffset}{8pt}%
  7932.                     {210mm}{148mm}%
  7933.   \lispnarrowing = 0.2in
  7934.   \tolerance = 800
  7935.   \hfuzz = 1.2pt
  7936.   \contentsrightmargin = 0pt
  7937.   \defbodyindent = 2mm
  7938.   \tableindent = 12mm
  7939. % A specific text layout, 24x15cm overall, intended for A4 paper.
  7940. \def\afourlatex{{\globaldefs = 1
  7941.   \afourpaper
  7942.   \internalpagesizes{237mm}{150mm}%
  7943.                     {\voffset}{4.6mm}%
  7944.                     {\bindingoffset}{7mm}%
  7945.                     {297mm}{210mm}%
  7946.   % Must explicitly reset to 0 because we call \afourpaper.
  7947.   \globaldefs = 0
  7948. % Use @afourwide to print on A4 paper in landscape format.
  7949. \def\afourwide{{\globaldefs = 1
  7950.   \afourpaper
  7951.   \internalpagesizes{241mm}{165mm}%
  7952.                     {\voffset}{-2.95mm}%
  7953.                     {\bindingoffset}{7mm}%
  7954.                     {297mm}{210mm}%
  7955.   \globaldefs = 0
  7956. % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
  7957. % Perhaps we should allow setting the margins, \topskip, \parskip,
  7958. % and/or leading, also. Or perhaps we should compute them somehow.
  7959. \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
  7960. \def\pagesizesyyy#1,#2,#3\finish{{%
  7961.   \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
  7962.   \globaldefs = 1
  7963.   \parskip = 3pt plus 2pt minus 1pt
  7964.   \setleading{\textleading}%
  7965.   \dimen0 = #1\relax
  7966.   \advance\dimen0 by \voffset
  7967.   \dimen2 = \hsize
  7968.   \advance\dimen2 by \normaloffset
  7969.   \internalpagesizes{#1}{\hsize}%
  7970.                     {\voffset}{\normaloffset}%
  7971.                     {\bindingoffset}{44pt}%
  7972.                     {\dimen0}{\dimen2}%
  7973. % Set default to letter.
  7974. \letterpaper
  7975. \message{and turning on texinfo input format.}
  7976. \def^^L{\par} % remove \outer, so ^L can appear in an @comment
  7977. % DEL is a comment character, in case @c does not suffice.
  7978. \catcode`\^^? = 14
  7979. % Define macros to output various characters with catcode for normal text.
  7980. \catcode`\"=\other \def\normaldoublequote{"}
  7981. \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
  7982. \catcode`\+=\other \def\normalplus{+}
  7983. \catcode`\<=\other \def\normalless{<}
  7984. \catcode`\>=\other \def\normalgreater{>}
  7985. \catcode`\^=\other \def\normalcaret{^}
  7986. \catcode`\_=\other \def\normalunderscore{_}
  7987. \catcode`\|=\other \def\normalverticalbar{|}
  7988. \catcode`\~=\other \def\normaltilde{~}
  7989. % This macro is used to make a character print one way in \tt
  7990. % (where it can probably be output as-is), and another way in other fonts,
  7991. % where something hairier probably needs to be done.
  7992. % #1 is what to print if we are indeed using \tt; #2 is what to print
  7993. % otherwise.  Since all the Computer Modern typewriter fonts have zero
  7994. % interword stretch (and shrink), and it is reasonable to expect all
  7995. % typewriter fonts to have this, we can check that font parameter.
  7996. \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
  7997. % Same as above, but check for italic font.  Actually this also catches
  7998. % non-italic slanted fonts since it is impossible to distinguish them from
  7999. % italic fonts.  But since this is only used by $ and it uses \sl anyway
  8000. % this is not a problem.
  8001. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
  8002. % Turn off all special characters except @
  8003. % (and those which the user can use as if they were ordinary).
  8004. % Most of these we simply print from the \tt font, but for some, we can
  8005. % use math or other variants that look better in normal text.
  8006. \catcode`\"=\active
  8007. \def\activedoublequote{{\tt\char34}}
  8008. \let"=\activedoublequote
  8009. \catcode`\~=\active
  8010. \def~{{\tt\char126}}
  8011. \chardef\hat=`\^
  8012. \catcode`\^=\active
  8013. \def^{{\tt \hat}}
  8014. \catcode`\_=\active
  8015. \def_{\ifusingtt\normalunderscore\_}
  8016. \let\realunder=_
  8017. % Subroutine for the previous macro.
  8018. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
  8019. \catcode`\|=\active
  8020. \def|{{\tt\char124}}
  8021. \chardef \less=`\<
  8022. \catcode`\<=\active
  8023. \def<{{\tt \less}}
  8024. \chardef \gtr=`\>
  8025. \catcode`\>=\active
  8026. \def>{{\tt \gtr}}
  8027. \catcode`\+=\active
  8028. \def+{{\tt \char 43}}
  8029. \catcode`\$=\active
  8030. \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
  8031. % If a .fmt file is being used, characters that might appear in a file
  8032. % name cannot be active until we have parsed the command line.
  8033. % So turn them off again, and have \everyjob (or @setfilename) turn them on.
  8034. % \otherifyactive is called near the end of this file.
  8035. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
  8036. % Used sometimes to turn off (effectively) the active characters even after
  8037. % parsing them.
  8038. \def\turnoffactive{%
  8039.   \normalturnoffactive
  8040.   \otherbackslash
  8041. \catcode`\@=0
  8042. % \backslashcurfont outputs one backslash character in current font,
  8043. % as in \char`\\.
  8044. \global\chardef\backslashcurfont=`\\
  8045. \global\let\rawbackslashxx=\backslashcurfont  % let existing .??s files work
  8046. % \realbackslash is an actual character `\' with catcode other, and
  8047. % \doublebackslash is two of them (for the pdf outlines).
  8048. {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
  8049. % In texinfo, backslash is an active character; it prints the backslash
  8050. % in fixed width font.
  8051. \catcode`\\=\active
  8052. @def@normalbackslash{{@tt@backslashcurfont}}
  8053. % On startup, @fixbackslash assigns:
  8054. %  @let \ = @normalbackslash
  8055. % \rawbackslash defines an active \ to do \backslashcurfont.
  8056. % \otherbackslash defines an active \ to be a literal `\' character with
  8057. % catcode other.
  8058. @gdef@rawbackslash{@let\=@backslashcurfont}
  8059. @gdef@otherbackslash{@let\=@realbackslash}
  8060. % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
  8061. % the literal character `\'.
  8062. @def@normalturnoffactive{%
  8063.   @let"=@normaldoublequote
  8064.   @let$=@normaldollar %$ font-lock fix
  8065.   @let+=@normalplus
  8066.   @let<=@normalless
  8067.   @let>=@normalgreater
  8068.   @let\=@normalbackslash
  8069.   @let^=@normalcaret
  8070.   @let_=@normalunderscore
  8071.   @let|=@normalverticalbar
  8072.   @let~=@normaltilde
  8073.   @markupsetuplqdefault
  8074.   @markupsetuprqdefault
  8075.   @unsepspaces
  8076. % Make _ and + \other characters, temporarily.
  8077. % This is canceled by @fixbackslash.
  8078. @otherifyactive
  8079. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  8080. % That is what \eatinput is for; after that, the `\' should revert to printing
  8081. % a backslash.
  8082. @gdef@eatinput input texinfo{@fixbackslash}
  8083. @global@let\ = @eatinput
  8084. % On the other hand, perhaps the file did not have a `\input texinfo'. Then
  8085. % the first `\' in the file would cause an error. This macro tries to fix
  8086. % that, assuming it is called before the first `\' could plausibly occur.
  8087. % Also turn back on active characters that might appear in the input
  8088. % file name, in case not using a pre-dumped format.
  8089. @gdef@fixbackslash{%
  8090.   @ifx\@eatinput @let\ = @normalbackslash @fi
  8091.   @catcode`+=@active
  8092.   @catcode`@_=@active
  8093. % Say @foo, not \foo, in error messages.
  8094. @escapechar = `@@
  8095. % These (along with & and #) are made active for url-breaking, so need
  8096. % active definitions as the normal characters.
  8097. @def@normaldot{.}
  8098. @def@normalquest{?}
  8099. @def@normalslash{/}
  8100. % These look ok in all fonts, so just make them not special.
  8101. @catcode`@& = @other @def@normalamp{&}
  8102. @catcode`@# = @other @def@normalhash{#}
  8103. @catcode`@% = @other @def@normalpercent{%}
  8104. @c Finally, make ` and ' active, so that txicodequoteundirected and
  8105. @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}.  If we
  8106. @c don't make ` and ' active, @code will not get them as active chars.
  8107. @c Do this last of all since we use ` in the previous @catcode assignments.
  8108. @catcode`@'=@active
  8109. @catcode`@`=@active
  8110. @markupsetuplqdefault
  8111. @markupsetuprqdefault
  8112. @c Local variables:
  8113. @c eval: (add-hook 'write-file-hooks 'time-stamp)
  8114. @c page-delimiter: "^\\\\message"
  8115. @c time-stamp-start: "def\\\\texinfoversion{"
  8116. @c time-stamp-format: "%:y-%02m-%02d.%02H"
  8117. @c time-stamp-end: "}"
  8118. @c End:
  8119. @c vim:sw=2:
  8120. @ignore
  8121.    arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
  8122. @end ignore
  8123.