GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
% texinfo.tex -- TeX macros to handle Texinfo files.1%2% Load plain if necessary, i.e., if running under initex.3\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi4%5\def\texinfoversion{2004-04-07.08}6%7% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,8% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software9% Foundation, Inc.10%11% This texinfo.tex file is free software; you can redistribute it and/or12% modify it under the terms of the GNU General Public License as13% published by the Free Software Foundation; either version 2, or (at14% your option) any later version.15%16% This texinfo.tex file is distributed in the hope that it will be17% useful, but WITHOUT ANY WARRANTY; without even the implied warranty18% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU19% General Public License for more details.20%21% You should have received a copy of the GNU General Public License22% along with this texinfo.tex file; see the file COPYING. If not, write23% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,24% Boston, MA 02110-1301, USA.25%26% As a special exception, when this file is read by TeX when processing27% a Texinfo source document, you may use the result without28% restriction. (This has been our intent since Texinfo was invented.)29%30% Please try the latest version of texinfo.tex before submitting bug31% reports; you can get the latest version from:32% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or33% ftp://tug.org/tex/texinfo.tex34% (and all CTAN mirrors, see http://www.ctan.org).35% The texinfo.tex in any given distribution could well be out36% of date, so if that's what you're using, please check.37%38% Send bug reports to [email protected]. Please include including a39% complete document in each bug report with which we can reproduce the40% problem. Patches are, of course, greatly appreciated.41%42% To process a Texinfo manual with TeX, it's most reliable to use the43% texi2dvi shell script that comes with the distribution. For a simple44% manual foo.texi, however, you can get away with this:45% tex foo.texi46% texindex foo.??47% tex foo.texi48% tex foo.texi49% dvips foo.dvi -o # or whatever; this makes foo.ps.50% The extra TeX runs get the cross-reference information correct.51% Sometimes one run after texindex suffices, and sometimes you need more52% than two; texi2dvi does it as many times as necessary.53%54% It is possible to adapt texinfo.tex for other languages, to some55% extent. You can get the existing language-specific files from the56% full Texinfo distribution.57%58% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.596061\message{Loading texinfo [version \texinfoversion]:}6263% If in a .fmt file, print the version number64% and turn on active characters that we couldn't do earlier because65% they might have appeared in the input file name.66\everyjob{\message{[Texinfo version \texinfoversion]}%67\catcode`+=\active \catcode`\_=\active}6869\message{Basics,}70\chardef\other=127172% We never want plain's \outer definition of \+ in Texinfo.73% For @tex, we can use \tabalign.74\let\+ = \relax7576% Save some plain tex macros whose names we will redefine.77\let\ptexb=\b78\let\ptexbullet=\bullet79\let\ptexc=\c80\let\ptexcomma=\,81\let\ptexdot=\.82\let\ptexdots=\dots83\let\ptexend=\end84\let\ptexequiv=\equiv85\let\ptexexclam=\!86\let\ptexfootnote=\footnote87\let\ptexgtr=>88\let\ptexhat=^89\let\ptexi=\i90\let\ptexindent=\indent91\let\ptexnoindent=\noindent92\let\ptexinsert=\insert93\let\ptexlbrace=\{94\let\ptexless=<95\let\ptexplus=+96\let\ptexrbrace=\}97\let\ptexslash=\/98\let\ptexstar=\*99\let\ptext=\t100101% If this character appears in an error message or help string, it102% starts a new line in the output.103\newlinechar = `^^J104105% Use TeX 3.0's \inputlineno to get the line number, for better error106% messages, but if we're using an old version of TeX, don't do anything.107%108\ifx\inputlineno\thisisundefined109\let\linenumber = \empty % Pre-3.0.110\else111\def\linenumber{l.\the\inputlineno:\space}112\fi113114% Set up fixed words for English if not already set.115\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi116\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi117\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi118\ifx\putwordin\undefined \gdef\putwordin{in}\fi119\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi120\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi121\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi122\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi123\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi124\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi125\ifx\putwordof\undefined \gdef\putwordof{of}\fi126\ifx\putwordon\undefined \gdef\putwordon{on}\fi127\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi128\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi129\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi130\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi131\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi132\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi133\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi134%135\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi136\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi137\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi138\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi139\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi140\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi141\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi142\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi143\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi144\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi145\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi146\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi147%148\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi149\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi150\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi151\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi152\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi153154% In some macros, we cannot use the `\? notation---the left quote is155% in some cases the escape char.156\chardef\colonChar = `\:157\chardef\commaChar = `\,158\chardef\dotChar = `\.159\chardef\exclamChar= `\!160\chardef\questChar = `\?161\chardef\semiChar = `\;162\chardef\underChar = `\_163164\chardef\spaceChar = `\ %165\chardef\spacecat = 10166\def\spaceisspace{\catcode\spaceChar=\spacecat}167168% Ignore a token.169%170\def\gobble#1{}171172% The following is used inside several \edef's.173\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}174175% Hyphenation fixes.176\hyphenation{177Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script178ap-pen-dix bit-map bit-maps179data-base data-bases eshell fall-ing half-way long-est man-u-script180man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm181par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces182spell-ing spell-ings183stand-alone strong-est time-stamp time-stamps which-ever white-space184wide-spread wrap-around185}186187% Margin to add to right of even pages, to left of odd pages.188\newdimen\bindingoffset189\newdimen\normaloffset190\newdimen\pagewidth \newdimen\pageheight191192% For a final copy, take out the rectangles193% that mark overfull boxes (in case you have decided194% that the text looks ok even though it passes the margin).195%196\def\finalout{\overfullrule=0pt}197198% @| inserts a changebar to the left of the current line. It should199% surround any changed text. This approach does *not* work if the200% change spans more than two lines of output. To handle that, we would201% have adopt a much more difficult approach (putting marks into the main202% vertical list for the beginning and end of each change).203%204\def\|{%205% \vadjust can only be used in horizontal mode.206\leavevmode207%208% Append this vertical mode material after the current line in the output.209\vadjust{%210% We want to insert a rule with the height and depth of the current211% leading; that is exactly what \strutbox is supposed to record.212\vskip-\baselineskip213%214% \vadjust-items are inserted at the left edge of the type. So215% the \llap here moves out into the left-hand margin.216\llap{%217%218% For a thicker or thinner bar, change the `1pt'.219\vrule height\baselineskip width1pt220%221% This is the space between the bar and the text.222\hskip 12pt223}%224}%225}226227% Sometimes it is convenient to have everything in the transcript file228% and nothing on the terminal. We don't just call \tracingall here,229% since that produces some useless output on the terminal. We also make230% some effort to order the tracing commands to reduce output in the log231% file; cf. trace.sty in LaTeX.232%233\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%234\def\loggingall{%235\tracingstats2236\tracingpages1237\tracinglostchars2 % 2 gives us more in etex238\tracingparagraphs1239\tracingoutput1240\tracingmacros2241\tracingrestores1242\showboxbreadth\maxdimen \showboxdepth\maxdimen243\ifx\eTeXversion\undefined\else % etex gives us more logging244\tracingscantokens1245\tracingifs1246\tracinggroups1247\tracingnesting2248\tracingassigns1249\fi250\tracingcommands3 % 3 gives us more in etex251\errorcontextlines16252}%253254% add check for \lastpenalty to plain's definitions. If the last thing255% we did was a \nobreak, we don't want to insert more space.256%257\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount258\removelastskip\penalty-50\smallskip\fi\fi}259\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount260\removelastskip\penalty-100\medskip\fi\fi}261\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount262\removelastskip\penalty-200\bigskip\fi\fi}263264% For @cropmarks command.265% Do @cropmarks to get crop marks.266%267\newif\ifcropmarks268\let\cropmarks = \cropmarkstrue269%270% Dimensions to add cropmarks at corners.271% Added by P. A. MacKay, 12 Nov. 1986272%273\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines274\newdimen\cornerlong \cornerlong=1pc275\newdimen\cornerthick \cornerthick=.3pt276\newdimen\topandbottommargin \topandbottommargin=.75in277278% Main output routine.279\chardef\PAGE = 255280\output = {\onepageout{\pagecontents\PAGE}}281282\newbox\headlinebox283\newbox\footlinebox284285% \onepageout takes a vbox as an argument. Note that \pagecontents286% does insertions, but you have to call it yourself.287\def\onepageout#1{%288\ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi289%290\ifodd\pageno \advance\hoffset by \bindingoffset291\else \advance\hoffset by -\bindingoffset\fi292%293% Do this outside of the \shipout so @code etc. will be expanded in294% the headline as they should be, not taken literally (outputting ''code).295\setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%296\setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%297%298{%299% Have to do this stuff outside the \shipout because we want it to300% take effect in \write's, yet the group defined by the \vbox ends301% before the \shipout runs.302%303\escapechar = `\\ % use backslash in output files.304\indexdummies % don't expand commands in the output.305\normalturnoffactive % \ in index entries must not stay \, e.g., if306% the page break happens to be in the middle of an example.307\shipout\vbox{%308% Do this early so pdf references go to the beginning of the page.309\ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi310%311\ifcropmarks \vbox to \outervsize\bgroup312\hsize = \outerhsize313\vskip-\topandbottommargin314\vtop to0pt{%315\line{\ewtop\hfil\ewtop}%316\nointerlineskip317\line{%318\vbox{\moveleft\cornerthick\nstop}%319\hfill320\vbox{\moveright\cornerthick\nstop}%321}%322\vss}%323\vskip\topandbottommargin324\line\bgroup325\hfil % center the page within the outer (page) hsize.326\ifodd\pageno\hskip\bindingoffset\fi327\vbox\bgroup328\fi329%330\unvbox\headlinebox331\pagebody{#1}%332\ifdim\ht\footlinebox > 0pt333% Only leave this space if the footline is nonempty.334% (We lessened \vsize for it in \oddfootingxxx.)335% The \baselineskip=24pt in plain's \makefootline has no effect.336\vskip 2\baselineskip337\unvbox\footlinebox338\fi339%340\ifcropmarks341\egroup % end of \vbox\bgroup342\hfil\egroup % end of (centering) \line\bgroup343\vskip\topandbottommargin plus1fill minus1fill344\boxmaxdepth = \cornerthick345\vbox to0pt{\vss346\line{%347\vbox{\moveleft\cornerthick\nsbot}%348\hfill349\vbox{\moveright\cornerthick\nsbot}%350}%351\nointerlineskip352\line{\ewbot\hfil\ewbot}%353}%354\egroup % \vbox from first cropmarks clause355\fi356}% end of \shipout\vbox357}% end of group with \normalturnoffactive358\advancepageno359\ifnum\outputpenalty>-20000 \else\dosupereject\fi360}361362\newinsert\margin \dimen\margin=\maxdimen363364\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}365{\catcode`\@ =11366\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi367% marginal hacks, [email protected] (Juha Takala)368\ifvoid\margin\else % marginal info is present369\rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi370\dimen@=\dp#1 \unvbox#1371\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi372\ifr@ggedbottom \kern-\dimen@ \vfil \fi}373}374375% Here are the rules for the cropmarks. Note that they are376% offset so that the space between them is truly \outerhsize or \outervsize377% (P. A. MacKay, 12 November, 1986)378%379\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}380\def\nstop{\vbox381{\hrule height\cornerthick depth\cornerlong width\cornerthick}}382\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}383\def\nsbot{\vbox384{\hrule height\cornerlong depth\cornerthick width\cornerthick}}385386% Parse an argument, then pass it to #1. The argument is the rest of387% the input line (except we remove a trailing comment). #1 should be a388% macro which expects an ordinary undelimited TeX argument.389%390\def\parsearg{\parseargusing{}}391\def\parseargusing#1#2{%392\def\next{#2}%393\begingroup394\obeylines395\spaceisspace396#1%397\parseargline\empty% Insert the \empty token, see \finishparsearg below.398}399400{\obeylines %401\gdef\parseargline#1^^M{%402\endgroup % End of the group started in \parsearg.403\argremovecomment #1\comment\ArgTerm%404}%405}406407% First remove any @comment, then any @c comment.408\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}409\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}410411% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.412%413% \argremovec might leave us with trailing space, e.g.,414% @end itemize @c foo415% This space token undergoes the same procedure and is eventually removed416% by \finishparsearg.417%418\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}419\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}420\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%421\def\temp{#3}%422\ifx\temp\empty423% We cannot use \next here, as it holds the macro to run;424% thus we reuse \temp.425\let\temp\finishparsearg426\else427\let\temp\argcheckspaces428\fi429% Put the space token in:430\temp#1 #3\ArgTerm431}432433% If a _delimited_ argument is enclosed in braces, they get stripped; so434% to get _exactly_ the rest of the line, we had to prevent such situation.435% We prepended an \empty token at the very beginning and we expand it now,436% just before passing the control to \next.437% (Similarily, we have to think about #3 of \argcheckspacesY above: it is438% either the null string, or it ends with \^^M---thus there is no danger439% that a pair of braces would be stripped.440%441% But first, we have to remove the trailing space token.442%443\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}}444445% \parseargdef\foo{...}446% is roughly equivalent to447% \def\foo{\parsearg\Xfoo}448% \def\Xfoo#1{...}449%450% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my451% favourite TeX trick. --kasal, 16nov03452453\def\parseargdef#1{%454\expandafter \doparseargdef \csname\string#1\endcsname #1%455}456\def\doparseargdef#1#2{%457\def#2{\parsearg#1}%458\def#1##1%459}460461% Several utility definitions with active space:462{463\obeyspaces464\gdef\obeyedspace{ }465466% Make each space character in the input produce a normal interword467% space in the output. Don't allow a line break at this space, as this468% is used only in environments like @example, where each line of input469% should produce a line of output anyway.470%471\gdef\sepspaces{\obeyspaces\let =\tie}472473% If an index command is used in an @example environment, any spaces474% therein should become regular spaces in the raw index file, not the475% expansion of \tie (\leavevmode \penalty \@M \ ).476\gdef\unsepspaces{\let =\space}477}478479480\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}481482% Define the framework for environments in texinfo.tex. It's used like this:483%484% \envdef\foo{...}485% \def\Efoo{...}486%487% It's the responsibility of \envdef to insert \begingroup before the488% actual body; @end closes the group after calling \Efoo. \envdef also489% defines \thisenv, so the current environment is known; @end checks490% whether the environment name matches. The \checkenv macro can also be491% used to check whether the current environment is the one expected.492%493% Non-false conditionals (@iftex, @ifset) don't fit into this, so they494% are not treated as enviroments; they don't open a group. (The495% implementation of @end takes care not to call \endgroup in this496% special case.)497498499% At runtime, environments start with this:500\def\startenvironment#1{\begingroup\def\thisenv{#1}}501% initialize502\let\thisenv\empty503504% ... but they get defined via ``\envdef\foo{...}'':505\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}506\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}507508% Check whether we're in the right environment:509\def\checkenv#1{%510\def\temp{#1}%511\ifx\thisenv\temp512\else513\badenverr514\fi515}516517% Evironment mismatch, #1 expected:518\def\badenverr{%519\errhelp = \EMsimple520\errmessage{This command can appear only \inenvironment\temp,521not \inenvironment\thisenv}%522}523\def\inenvironment#1{%524\ifx#1\empty525out of any environment%526\else527in environment \expandafter\string#1%528\fi529}530531% @end foo executes the definition of \Efoo.532% But first, it executes a specialized version of \checkenv533%534\parseargdef\end{%535\if 1\csname iscond.#1\endcsname536\else537% The general wording of \badenverr may not be ideal, but... --kasal, 06nov03538\expandafter\checkenv\csname#1\endcsname539\csname E#1\endcsname540\endgroup541\fi542}543544\newhelp\EMsimple{Press RETURN to continue.}545546547%% Simple single-character @ commands548549% @@ prints an @550% Kludge this until the fonts are right (grr).551\def\@{{\tt\char64}}552553% This is turned off because it was never documented554% and you can use @w{...} around a quote to suppress ligatures.555%% Define @` and @' to be the same as ` and '556%% but suppressing ligatures.557%\def\`{{`}}558%\def\'{{'}}559560% Used to generate quoted braces.561\def\mylbrace {{\tt\char123}}562\def\myrbrace {{\tt\char125}}563\let\{=\mylbrace564\let\}=\myrbrace565\begingroup566% Definitions to produce \{ and \} commands for indices,567% and @{ and @} for the aux file.568\catcode`\{ = \other \catcode`\} = \other569\catcode`\[ = 1 \catcode`\] = 2570\catcode`\! = 0 \catcode`\\ = \other571!gdef!lbracecmd[\{]%572!gdef!rbracecmd[\}]%573!gdef!lbraceatcmd[@{]%574!gdef!rbraceatcmd[@}]%575!endgroup576577% @comma{} to avoid , parsing problems.578\let\comma = ,579580% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent581% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.582\let\, = \c583\let\dotaccent = \.584\def\ringaccent#1{{\accent23 #1}}585\let\tieaccent = \t586\let\ubaraccent = \b587\let\udotaccent = \d588589% Other special characters: @questiondown @exclamdown @ordf @ordm590% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.591\def\questiondown{?`}592\def\exclamdown{!`}593\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}594\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}595596% Dotless i and dotless j, used for accents.597\def\imacro{i}598\def\jmacro{j}599\def\dotless#1{%600\def\temp{#1}%601\ifx\temp\imacro \ptexi602\else\ifx\temp\jmacro \j603\else \errmessage{@dotless can be used only with i or j}%604\fi\fi605}606607% The \TeX{} logo, as in plain, but resetting the spacing so that a608% period following counts as ending a sentence. (Idea found in latex.)609%610\edef\TeX{\TeX \spacefactor=3000 }611612% @LaTeX{} logo. Not quite the same results as the definition in613% latex.ltx, since we use a different font for the raised A; it's most614% convenient for us to use an explicitly smaller font, rather than using615% the \scriptstyle font (since we don't reset \scriptstyle and616% \scriptscriptstyle).617%618\def\LaTeX{%619L\kern-.36em620{\setbox0=\hbox{T}%621\vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%622\kern-.15em623\TeX624}625626% Be sure we're in horizontal mode when doing a tie, since we make space627% equivalent to this in @example-like environments. Otherwise, a space628% at the beginning of a line will start with \penalty -- and629% since \penalty is valid in vertical mode, we'd end up putting the630% penalty on the vertical list instead of in the new paragraph.631{\catcode`@ = 11632% Avoid using \@M directly, because that causes trouble633% if the definition is written into an index file.634\global\let\tiepenalty = \@M635\gdef\tie{\leavevmode\penalty\tiepenalty\ }636}637638% @: forces normal size whitespace following.639\def\:{\spacefactor=1000 }640641% @* forces a line break.642\def\*{\hfil\break\hbox{}\ignorespaces}643644% @/ allows a line break.645\let\/=\allowbreak646647% @. is an end-of-sentence period.648\def\.{.\spacefactor=3000 }649650% @! is an end-of-sentence bang.651\def\!{!\spacefactor=3000 }652653% @? is an end-of-sentence query.654\def\?{?\spacefactor=3000 }655656% @w prevents a word break. Without the \leavevmode, @w at the657% beginning of a paragraph, when TeX is still in vertical mode, would658% produce a whole line of output instead of starting the paragraph.659\def\w#1{\leavevmode\hbox{#1}}660661% @group ... @end group forces ... to be all on one page, by enclosing662% it in a TeX vbox. We use \vtop instead of \vbox to construct the box663% to keep its height that of a normal line. According to the rules for664% \topskip (p.114 of the TeXbook), the glue inserted is665% max (\topskip - \ht (first item), 0). If that height is large,666% therefore, no glue is inserted, and the space between the headline and667% the text is small, which looks bad.668%669% Another complication is that the group might be very large. This can670% cause the glue on the previous page to be unduly stretched, because it671% does not have much material. In this case, it's better to add an672% explicit \vfill so that the extra space is at the bottom. The673% threshold for doing this is if the group is more than \vfilllimit674% percent of a page (\vfilllimit can be changed inside of @tex).675%676\newbox\groupbox677\def\vfilllimit{0.7}678%679\envdef\group{%680\ifnum\catcode`\^^M=\active \else681\errhelp = \groupinvalidhelp682\errmessage{@group invalid in context where filling is enabled}%683\fi684\startsavinginserts685%686\setbox\groupbox = \vtop\bgroup687% Do @comment since we are called inside an environment such as688% @example, where each end-of-line in the input causes an689% end-of-line in the output. We don't want the end-of-line after690% the `@group' to put extra space in the output. Since @group691% should appear on a line by itself (according to the Texinfo692% manual), we don't worry about eating any user text.693\comment694}695%696% The \vtop produces a box with normal height and large depth; thus, TeX puts697% \baselineskip glue before it, and (when the next line of text is done)698% \lineskip glue after it. Thus, space below is not quite equal to space699% above. But it's pretty close.700\def\Egroup{%701% To get correct interline space between the last line of the group702% and the first line afterwards, we have to propagate \prevdepth.703\endgraf % Not \par, as it may have been set to \lisppar.704\global\dimen1 = \prevdepth705\egroup % End the \vtop.706% \dimen0 is the vertical size of the group's box.707\dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox708% \dimen2 is how much space is left on the page (more or less).709\dimen2 = \pageheight \advance\dimen2 by -\pagetotal710% if the group doesn't fit on the current page, and it's a big big711% group, force a page break.712\ifdim \dimen0 > \dimen2713\ifdim \pagetotal < \vfilllimit\pageheight714\page715\fi716\fi717\box\groupbox718\prevdepth = \dimen1719\checkinserts720}721%722% TeX puts in an \escapechar (i.e., `@') at the beginning of the help723% message, so this ends up printing `@group can only ...'.724%725\newhelp\groupinvalidhelp{%726group can only be used in environments such as @example,^^J%727where each line of input produces a line of output.}728729% @need space-in-mils730% forces a page break if there is not space-in-mils remaining.731732\newdimen\mil \mil=0.001in733734% Old definition--didn't work.735%\parseargdef\need{\par %736%% This method tries to make TeX break the page naturally737%% if the depth of the box does not fit.738%{\baselineskip=0pt%739%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak740%\prevdepth=-1000pt741%}}742743\parseargdef\need{%744% Ensure vertical mode, so we don't make a big box in the middle of a745% paragraph.746\par747%748% If the @need value is less than one line space, it's useless.749\dimen0 = #1\mil750\dimen2 = \ht\strutbox751\advance\dimen2 by \dp\strutbox752\ifdim\dimen0 > \dimen2753%754% Do a \strut just to make the height of this box be normal, so the755% normal leading is inserted relative to the preceding line.756% And a page break here is fine.757\vtop to #1\mil{\strut\vfil}%758%759% TeX does not even consider page breaks if a penalty added to the760% main vertical list is 10000 or more. But in order to see if the761% empty box we just added fits on the page, we must make it consider762% page breaks. On the other hand, we don't want to actually break the763% page after the empty box. So we use a penalty of 9999.764%765% There is an extremely small chance that TeX will actually break the766% page at this \penalty, if there are no other feasible breakpoints in767% sight. (If the user is using lots of big @group commands, which768% almost-but-not-quite fill up a page, TeX will have a hard time doing769% good page breaking, for example.) However, I could not construct an770% example where a page broke at this \penalty; if it happens in a real771% document, then we can reconsider our strategy.772\penalty9999773%774% Back up by the size of the box, whether we did a page break or not.775\kern -#1\mil776%777% Do not allow a page break right after this kern.778\nobreak779\fi780}781782% @br forces paragraph break (and is undocumented).783784\let\br = \par785786% @page forces the start of a new page.787%788\def\page{\par\vfill\supereject}789790% @exdent text....791% outputs text on separate line in roman font, starting at standard page margin792793% This records the amount of indent in the innermost environment.794% That's how much \exdent should take out.795\newskip\exdentamount796797% This defn is used inside fill environments such as @defun.798\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}799800% This defn is used inside nofill environments such as @example.801\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount802\leftline{\hskip\leftskip{\rm#1}}}}803804% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current805% paragraph. For more general purposes, use the \margin insertion806% class. WHICH is `l' or `r'.807%808\newskip\inmarginspacing \inmarginspacing=1cm809\def\strutdepth{\dp\strutbox}810%811\def\doinmargin#1#2{\strut\vadjust{%812\nobreak813\kern-\strutdepth814\vtop to \strutdepth{%815\baselineskip=\strutdepth816\vss817% if you have multiple lines of stuff to put here, you'll need to818% make the vbox yourself of the appropriate size.819\ifx#1l%820\llap{\ignorespaces #2\hskip\inmarginspacing}%821\else822\rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%823\fi824\null825}%826}}827\def\inleftmargin{\doinmargin l}828\def\inrightmargin{\doinmargin r}829%830% @inmargin{TEXT [, RIGHT-TEXT]}831% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;832% else use TEXT for both).833%834\def\inmargin#1{\parseinmargin #1,,\finish}835\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.836\setbox0 = \hbox{\ignorespaces #2}%837\ifdim\wd0 > 0pt838\def\lefttext{#1}% have both texts839\def\righttext{#2}%840\else841\def\lefttext{#1}% have only one text842\def\righttext{#1}%843\fi844%845\ifodd\pageno846\def\temp{\inrightmargin\righttext}% odd page -> outside is right margin847\else848\def\temp{\inleftmargin\lefttext}%849\fi850\temp851}852853% @include file insert text of that file as input.854%855\def\include{\parseargusing\filenamecatcodes\includezzz}856\def\includezzz#1{%857\pushthisfilestack858\def\thisfile{#1}%859{%860\makevalueexpandable861\def\temp{\input #1 }%862\expandafter863}\temp864\popthisfilestack865}866\def\filenamecatcodes{%867\catcode`\\=\other868\catcode`~=\other869\catcode`^=\other870\catcode`_=\other871\catcode`|=\other872\catcode`<=\other873\catcode`>=\other874\catcode`+=\other875\catcode`-=\other876}877878\def\pushthisfilestack{%879\expandafter\pushthisfilestackX\popthisfilestack\StackTerm880}881\def\pushthisfilestackX{%882\expandafter\pushthisfilestackY\thisfile\StackTerm883}884\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%885\gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%886}887888\def\popthisfilestack{\errthisfilestackempty}889\def\errthisfilestackempty{\errmessage{Internal error:890the stack of filenames is empty.}}891892\def\thisfile{}893894% @center line895% outputs that line, centered.896%897\parseargdef\center{%898\ifhmode899\let\next\centerH900\else901\let\next\centerV902\fi903\next{\hfil \ignorespaces#1\unskip \hfil}%904}905\def\centerH#1{%906{%907\hfil\break908\advance\hsize by -\leftskip909\advance\hsize by -\rightskip910\line{#1}%911\break912}%913}914\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}915916% @sp n outputs n lines of vertical space917918\parseargdef\sp{\vskip #1\baselineskip}919920% @comment ...line which is ignored...921% @c is the same as @comment922% @ignore ... @end ignore is another way to write a comment923924\def\comment{\begingroup \catcode`\^^M=\other%925\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%926\commentxxx}927{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}928929\let\c=\comment930931% @paragraphindent NCHARS932% We'll use ems for NCHARS, close enough.933% NCHARS can also be the word `asis' or `none'.934% We cannot feasibly implement @paragraphindent asis, though.935%936\def\asisword{asis} % no translation, these are keywords937\def\noneword{none}938%939\parseargdef\paragraphindent{%940\def\temp{#1}%941\ifx\temp\asisword942\else943\ifx\temp\noneword944\defaultparindent = 0pt945\else946\defaultparindent = #1em947\fi948\fi949\parindent = \defaultparindent950}951952% @exampleindent NCHARS953% We'll use ems for NCHARS like @paragraphindent.954% It seems @exampleindent asis isn't necessary, but955% I preserve it to make it similar to @paragraphindent.956\parseargdef\exampleindent{%957\def\temp{#1}%958\ifx\temp\asisword959\else960\ifx\temp\noneword961\lispnarrowing = 0pt962\else963\lispnarrowing = #1em964\fi965\fi966}967968% @firstparagraphindent WORD969% If WORD is `none', then suppress indentation of the first paragraph970% after a section heading. If WORD is `insert', then do indent at such971% paragraphs.972%973% The paragraph indentation is suppressed or not by calling974% \suppressfirstparagraphindent, which the sectioning commands do.975% We switch the definition of this back and forth according to WORD.976% By default, we suppress indentation.977%978\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}979\def\insertword{insert}980%981\parseargdef\firstparagraphindent{%982\def\temp{#1}%983\ifx\temp\noneword984\let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent985\else\ifx\temp\insertword986\let\suppressfirstparagraphindent = \relax987\else988\errhelp = \EMsimple989\errmessage{Unknown @firstparagraphindent option `\temp'}%990\fi\fi991}992993% Here is how we actually suppress indentation. Redefine \everypar to994% \kern backwards by \parindent, and then reset itself to empty.995%996% We also make \indent itself not actually do anything until the next997% paragraph.998%999\gdef\dosuppressfirstparagraphindent{%1000\gdef\indent{%1001\restorefirstparagraphindent1002\indent1003}%1004\gdef\noindent{%1005\restorefirstparagraphindent1006\noindent1007}%1008\global\everypar = {%1009\kern -\parindent1010\restorefirstparagraphindent1011}%1012}10131014\gdef\restorefirstparagraphindent{%1015\global \let \indent = \ptexindent1016\global \let \noindent = \ptexnoindent1017\global \everypar = {}%1018}101910201021% @asis just yields its argument. Used with @table, for example.1022%1023\def\asis#1{#1}10241025% @math outputs its argument in math mode.1026%1027% One complication: _ usually means subscripts, but it could also mean1028% an actual _ character, as in @math{@var{some_variable} + 1}. So make1029% _ active, and distinguish by seeing if the current family is \slfam,1030% which is what @var uses.1031{1032\catcode\underChar = \active1033\gdef\mathunderscore{%1034\catcode\underChar=\active1035\def_{\ifnum\fam=\slfam \_\else\sb\fi}%1036}1037}1038% Another complication: we want \\ (and @\) to output a \ character.1039% FYI, plain.tex uses \\ as a temporary control sequence (why?), but1040% this is not advertised and we don't care. Texinfo does not1041% otherwise define @\.1042%1043% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.1044\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}1045%1046\def\math{%1047\tex1048\mathunderscore1049\let\\ = \mathbackslash1050\mathactive1051$\finishmath1052}1053\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.10541055% Some active characters (such as <) are spaced differently in math.1056% We have to reset their definitions in case the @math was an argument1057% to a command which sets the catcodes (such as @item or @section).1058%1059{1060\catcode`^ = \active1061\catcode`< = \active1062\catcode`> = \active1063\catcode`+ = \active1064\gdef\mathactive{%1065\let^ = \ptexhat1066\let< = \ptexless1067\let> = \ptexgtr1068\let+ = \ptexplus1069}1070}10711072% @bullet and @minus need the same treatment as @math, just above.1073\def\bullet{$\ptexbullet$}1074\def\minus{$-$}10751076% @dots{} outputs an ellipsis using the current font.1077% We do .5em per period so that it has the same spacing in a typewriter1078% font as three actual period characters.1079%1080\def\dots{%1081\leavevmode1082\hbox to 1.5em{%1083\hskip 0pt plus 0.25fil1084.\hfil.\hfil.%1085\hskip 0pt plus 0.5fil1086}%1087}10881089% @enddots{} is an end-of-sentence ellipsis.1090%1091\def\enddots{%1092\dots1093\spacefactor=30001094}10951096% @comma{} is so commas can be inserted into text without messing up1097% Texinfo's parsing.1098%1099\let\comma = ,11001101% @refill is a no-op.1102\let\refill=\relax11031104% If working on a large document in chapters, it is convenient to1105% be able to disable indexing, cross-referencing, and contents, for test runs.1106% This is done with @novalidate (before @setfilename).1107%1108\newif\iflinks \linkstrue % by default we want the aux files.1109\let\novalidate = \linksfalse11101111% @setfilename is done at the beginning of every texinfo file.1112% So open here the files we need to have open while reading the input.1113% This makes it possible to make a .fmt file for texinfo.1114\def\setfilename{%1115\fixbackslash % Turn off hack to swallow `\input texinfo'.1116\iflinks1117\tryauxfile1118% Open the new aux file. TeX will close it automatically at exit.1119\immediate\openout\auxfile=\jobname.aux1120\fi % \openindices needs to do some work in any case.1121\openindices1122\let\setfilename=\comment % Ignore extra @setfilename cmds.1123%1124% If texinfo.cnf is present on the system, read it.1125% Useful for site-wide @afourpaper, etc.1126\openin 1 texinfo.cnf1127\ifeof 1 \else \input texinfo.cnf \fi1128\closein 11129%1130\comment % Ignore the actual filename.1131}11321133% Called from \setfilename.1134%1135\def\openindices{%1136\newindex{cp}%1137\newcodeindex{fn}%1138\newcodeindex{vr}%1139\newcodeindex{tp}%1140\newcodeindex{ky}%1141\newcodeindex{pg}%1142}11431144% @bye.1145\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}114611471148\message{pdf,}1149% adobe `portable' document format1150\newcount\tempnum1151\newcount\lnkcount1152\newtoks\filename1153\newcount\filenamelength1154\newcount\pgn1155\newtoks\toksA1156\newtoks\toksB1157\newtoks\toksC1158\newtoks\toksD1159\newbox\boxA1160\newcount\countA1161\newif\ifpdf1162\newif\ifpdfmakepagedest11631164% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=11165% can be set). So we test for \relax and 0 as well as \undefined,1166% borrowed from ifpdf.sty.1167\ifx\pdfoutput\undefined1168\else1169\ifx\pdfoutput\relax1170\else1171\ifcase\pdfoutput1172\else1173\pdftrue1174\fi1175\fi1176\fi1177%1178\ifpdf1179\input pdfcolor1180\pdfcatalog{/PageMode /UseOutlines}%1181\def\dopdfimage#1#2#3{%1182\def\imagewidth{#2}%1183\def\imageheight{#3}%1184% without \immediate, pdftex seg faults when the same image is1185% included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)1186\ifnum\pdftexversion < 141187\immediate\pdfimage1188\else1189\immediate\pdfximage1190\fi1191\ifx\empty\imagewidth\else width \imagewidth \fi1192\ifx\empty\imageheight\else height \imageheight \fi1193\ifnum\pdftexversion<131194#1.pdf%1195\else1196{#1.pdf}%1197\fi1198\ifnum\pdftexversion < 14 \else1199\pdfrefximage \pdflastximage1200\fi}1201\def\pdfmkdest#1{{%1202% We have to set dummies so commands such as @code in a section title1203% aren't expanded.1204\atdummies1205\normalturnoffactive1206\pdfdest name{#1} xyz%1207}}1208\def\pdfmkpgn#1{#1}1209\let\linkcolor = \Blue % was Cyan, but that seems light?1210\def\endlink{\Black\pdfendlink}1211% Adding outlines to PDF; macros for calculating structure of outlines1212% come from Petr Olsak1213\def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%1214\else \csname#1\endcsname \fi}1215\def\advancenumber#1{\tempnum=\expnumber{#1}\relax1216\advance\tempnum by 11217\expandafter\xdef\csname#1\endcsname{\the\tempnum}}1218%1219% #1 is the section text. #2 is the pdf expression for the number1220% of subentries (or empty, for subsubsections). #3 is the node1221% text, which might be empty if this toc entry had no1222% corresponding node. #4 is the page number.1223%1224\def\dopdfoutline#1#2#3#4{%1225% Generate a link to the node text if that exists; else, use the1226% page number. We could generate a destination for the section1227% text in the case where a section has no node, but it doesn't1228% seem worthwhile, since most documents are normally structured.1229\def\pdfoutlinedest{#3}%1230\ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}\fi1231%1232\pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{#1}%1233}1234%1235\def\pdfmakeoutlines{%1236\begingroup1237% Thanh's hack / proper braces in bookmarks1238\edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace1239\edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace1240%1241% Read toc silently, to get counts of subentries for \pdfoutline.1242\def\numchapentry##1##2##3##4{%1243\def\thischapnum{##2}%1244\let\thissecnum\empty1245\let\thissubsecnum\empty1246}%1247\def\numsecentry##1##2##3##4{%1248\advancenumber{chap\thischapnum}%1249\def\thissecnum{##2}%1250\let\thissubsecnum\empty1251}%1252\def\numsubsecentry##1##2##3##4{%1253\advancenumber{sec\thissecnum}%1254\def\thissubsecnum{##2}%1255}%1256\def\numsubsubsecentry##1##2##3##4{%1257\advancenumber{subsec\thissubsecnum}%1258}%1259\let\thischapnum\empty1260\let\thissecnum\empty1261\let\thissubsecnum\empty1262%1263% use \def rather than \let here because we redefine \chapentry et1264% al. a second time, below.1265\def\appentry{\numchapentry}%1266\def\appsecentry{\numsecentry}%1267\def\appsubsecentry{\numsubsecentry}%1268\def\appsubsubsecentry{\numsubsubsecentry}%1269\def\unnchapentry{\numchapentry}%1270\def\unnsecentry{\numsecentry}%1271\def\unnsubsecentry{\numsubsecentry}%1272\def\unnsubsubsecentry{\numsubsubsecentry}%1273\input \jobname.toc1274%1275% Read toc second time, this time actually producing the outlines.1276% The `-' means take the \expnumber as the absolute number of1277% subentries, which we calculated on our first read of the .toc above.1278%1279% We use the node names as the destinations.1280\def\numchapentry##1##2##3##4{%1281\dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%1282\def\numsecentry##1##2##3##4{%1283\dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%1284\def\numsubsecentry##1##2##3##4{%1285\dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%1286\def\numsubsubsecentry##1##2##3##4{% count is always zero1287\dopdfoutline{##1}{}{##3}{##4}}%1288%1289% PDF outlines are displayed using system fonts, instead of1290% document fonts. Therefore we cannot use special characters,1291% since the encoding is unknown. For example, the eogonek from1292% Latin 2 (0xea) gets translated to a | character. Info from1293% Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.1294%1295% xx to do this right, we have to translate 8-bit characters to1296% their "best" equivalent, based on the @documentencoding. Right1297% now, I guess we'll just let the pdf reader have its way.1298\indexnofonts1299\turnoffactive1300\input \jobname.toc1301\endgroup1302}1303%1304\def\makelinks #1,{%1305\def\params{#1}\def\E{END}%1306\ifx\params\E1307\let\nextmakelinks=\relax1308\else1309\let\nextmakelinks=\makelinks1310\ifnum\lnkcount>0,\fi1311\picknum{#1}%1312\startlink attr{/Border [0 0 0]}1313goto name{\pdfmkpgn{\the\pgn}}%1314\linkcolor #1%1315\advance\lnkcount by 1%1316\endlink1317\fi1318\nextmakelinks1319}1320\def\picknum#1{\expandafter\pn#1}1321\def\pn#1{%1322\def\p{#1}%1323\ifx\p\lbrace1324\let\nextpn=\ppn1325\else1326\let\nextpn=\ppnn1327\def\first{#1}1328\fi1329\nextpn1330}1331\def\ppn#1{\pgn=#1\gobble}1332\def\ppnn{\pgn=\first}1333\def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}1334\def\skipspaces#1{\def\PP{#1}\def\D{|}%1335\ifx\PP\D\let\nextsp\relax1336\else\let\nextsp\skipspaces1337\ifx\p\space\else\addtokens{\filename}{\PP}%1338\advance\filenamelength by 11339\fi1340\fi1341\nextsp}1342\def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}1343\ifnum\pdftexversion < 141344\let \startlink \pdfannotlink1345\else1346\let \startlink \pdfstartlink1347\fi1348\def\pdfurl#1{%1349\begingroup1350\normalturnoffactive\def\@{@}%1351\makevalueexpandable1352\leavevmode\Red1353\startlink attr{/Border [0 0 0]}%1354user{/Subtype /Link /A << /S /URI /URI (#1) >>}%1355\endgroup}1356\def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}1357\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}1358\def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}1359\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}1360\def\maketoks{%1361\expandafter\poptoks\the\toksA|ENDTOKS|\relax1362\ifx\first0\adn01363\else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn31364\else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn61365\else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn91366\else1367\ifnum0=\countA\else\makelink\fi1368\ifx\first.\let\next=\done\else1369\let\next=\maketoks1370\addtokens{\toksB}{\the\toksD}1371\ifx\first,\addtokens{\toksB}{\space}\fi1372\fi1373\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi1374\next}1375\def\makelink{\addtokens{\toksB}%1376{\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}1377\def\pdflink#1{%1378\startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}1379\linkcolor #1\endlink}1380\def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}1381\else1382\let\pdfmkdest = \gobble1383\let\pdfurl = \gobble1384\let\endlink = \relax1385\let\linkcolor = \relax1386\let\pdfmakeoutlines = \relax1387\fi % \ifx\pdfoutput138813891390\message{fonts,}13911392% Change the current font style to #1, remembering it in \curfontstyle.1393% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in1394% italics, not bold italics.1395%1396\def\setfontstyle#1{%1397\def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.1398\csname ten#1\endcsname % change the current font1399}14001401% Select #1 fonts with the current style.1402%1403\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}14041405\def\rm{\fam=0 \setfontstyle{rm}}1406\def\it{\fam=\itfam \setfontstyle{it}}1407\def\sl{\fam=\slfam \setfontstyle{sl}}1408\def\bf{\fam=\bffam \setfontstyle{bf}}1409\def\tt{\fam=\ttfam \setfontstyle{tt}}14101411% Texinfo sort of supports the sans serif font style, which plain TeX does not.1412% So we set up a \sf.1413\newfam\sffam1414\def\sf{\fam=\sffam \setfontstyle{sf}}1415\let\li = \sf % Sometimes we call it \li, not \sf.14161417% We don't need math for this font style.1418\def\ttsl{\setfontstyle{ttsl}}14191420% Default leading.1421\newdimen\textleading \textleading = 13.2pt14221423% Set the baselineskip to #1, and the lineskip and strut size1424% correspondingly. There is no deep meaning behind these magic numbers1425% used as factors; they just match (closely enough) what Knuth defined.1426%1427\def\lineskipfactor{.08333}1428\def\strutheightpercent{.70833}1429\def\strutdepthpercent {.29167}1430%1431\def\setleading#1{%1432\normalbaselineskip = #1\relax1433\normallineskip = \lineskipfactor\normalbaselineskip1434\normalbaselines1435\setbox\strutbox =\hbox{%1436\vrule width0pt height\strutheightpercent\baselineskip1437depth \strutdepthpercent \baselineskip1438}%1439}14401441% Set the font macro #1 to the font named #2, adding on the1442% specified font prefix (normally `cm').1443% #3 is the font's design size, #4 is a scale factor1444\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}14451446% Use cm as the default font prefix.1447% To specify the font prefix, you must define \fontprefix1448% before you read in texinfo.tex.1449\ifx\fontprefix\undefined1450\def\fontprefix{cm}1451\fi1452% Support font families that don't use the same naming scheme as CM.1453\def\rmshape{r}1454\def\rmbshape{bx} %where the normal face is bold1455\def\bfshape{b}1456\def\bxshape{bx}1457\def\ttshape{tt}1458\def\ttbshape{tt}1459\def\ttslshape{sltt}1460\def\itshape{ti}1461\def\itbshape{bxti}1462\def\slshape{sl}1463\def\slbshape{bxsl}1464\def\sfshape{ss}1465\def\sfbshape{ss}1466\def\scshape{csc}1467\def\scbshape{csc}14681469% Text fonts (11.2pt, magstep1).1470\newcount\mainmagstep1471\ifx\bigger\relax1472% not really supported.1473\mainmagstep=\magstep11474\setfont\textrm\rmshape{12}{1000}1475\setfont\texttt\ttshape{12}{1000}1476\else1477\mainmagstep=\magstephalf1478\setfont\textrm\rmshape{10}{\mainmagstep}1479\setfont\texttt\ttshape{10}{\mainmagstep}1480\fi1481\setfont\textbf\bfshape{10}{\mainmagstep}1482\setfont\textit\itshape{10}{\mainmagstep}1483\setfont\textsl\slshape{10}{\mainmagstep}1484\setfont\textsf\sfshape{10}{\mainmagstep}1485\setfont\textsc\scshape{10}{\mainmagstep}1486\setfont\textttsl\ttslshape{10}{\mainmagstep}1487\font\texti=cmmi10 scaled \mainmagstep1488\font\textsy=cmsy10 scaled \mainmagstep14891490% A few fonts for @defun names and args.1491\setfont\defbf\bfshape{10}{\magstep1}1492\setfont\deftt\ttshape{10}{\magstep1}1493\setfont\defttsl\ttslshape{10}{\magstep1}1494\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}14951496% Fonts for indices, footnotes, small examples (9pt).1497\setfont\smallrm\rmshape{9}{1000}1498\setfont\smalltt\ttshape{9}{1000}1499\setfont\smallbf\bfshape{10}{900}1500\setfont\smallit\itshape{9}{1000}1501\setfont\smallsl\slshape{9}{1000}1502\setfont\smallsf\sfshape{9}{1000}1503\setfont\smallsc\scshape{10}{900}1504\setfont\smallttsl\ttslshape{10}{900}1505\font\smalli=cmmi91506\font\smallsy=cmsy915071508% Fonts for small examples (8pt).1509\setfont\smallerrm\rmshape{8}{1000}1510\setfont\smallertt\ttshape{8}{1000}1511\setfont\smallerbf\bfshape{10}{800}1512\setfont\smallerit\itshape{8}{1000}1513\setfont\smallersl\slshape{8}{1000}1514\setfont\smallersf\sfshape{8}{1000}1515\setfont\smallersc\scshape{10}{800}1516\setfont\smallerttsl\ttslshape{10}{800}1517\font\smalleri=cmmi81518\font\smallersy=cmsy815191520% Fonts for title page (20.4pt):1521\setfont\titlerm\rmbshape{12}{\magstep3}1522\setfont\titleit\itbshape{10}{\magstep4}1523\setfont\titlesl\slbshape{10}{\magstep4}1524\setfont\titlett\ttbshape{12}{\magstep3}1525\setfont\titlettsl\ttslshape{10}{\magstep4}1526\setfont\titlesf\sfbshape{17}{\magstep1}1527\let\titlebf=\titlerm1528\setfont\titlesc\scbshape{10}{\magstep4}1529\font\titlei=cmmi12 scaled \magstep31530\font\titlesy=cmsy10 scaled \magstep41531\def\authorrm{\secrm}1532\def\authortt{\sectt}15331534% Chapter (and unnumbered) fonts (17.28pt).1535\setfont\chaprm\rmbshape{12}{\magstep2}1536\setfont\chapit\itbshape{10}{\magstep3}1537\setfont\chapsl\slbshape{10}{\magstep3}1538\setfont\chaptt\ttbshape{12}{\magstep2}1539\setfont\chapttsl\ttslshape{10}{\magstep3}1540\setfont\chapsf\sfbshape{17}{1000}1541\let\chapbf=\chaprm1542\setfont\chapsc\scbshape{10}{\magstep3}1543\font\chapi=cmmi12 scaled \magstep21544\font\chapsy=cmsy10 scaled \magstep315451546% Section fonts (14.4pt).1547\setfont\secrm\rmbshape{12}{\magstep1}1548\setfont\secit\itbshape{10}{\magstep2}1549\setfont\secsl\slbshape{10}{\magstep2}1550\setfont\sectt\ttbshape{12}{\magstep1}1551\setfont\secttsl\ttslshape{10}{\magstep2}1552\setfont\secsf\sfbshape{12}{\magstep1}1553\let\secbf\secrm1554\setfont\secsc\scbshape{10}{\magstep2}1555\font\seci=cmmi12 scaled \magstep11556\font\secsy=cmsy10 scaled \magstep215571558% Subsection fonts (13.15pt).1559\setfont\ssecrm\rmbshape{12}{\magstephalf}1560\setfont\ssecit\itbshape{10}{1315}1561\setfont\ssecsl\slbshape{10}{1315}1562\setfont\ssectt\ttbshape{12}{\magstephalf}1563\setfont\ssecttsl\ttslshape{10}{1315}1564\setfont\ssecsf\sfbshape{12}{\magstephalf}1565\let\ssecbf\ssecrm1566\setfont\ssecsc\scbshape{10}{1315}1567\font\sseci=cmmi12 scaled \magstephalf1568\font\ssecsy=cmsy10 scaled 131515691570% Reduced fonts for @acro in text (10pt).1571\setfont\reducedrm\rmshape{10}{1000}1572\setfont\reducedtt\ttshape{10}{1000}1573\setfont\reducedbf\bfshape{10}{1000}1574\setfont\reducedit\itshape{10}{1000}1575\setfont\reducedsl\slshape{10}{1000}1576\setfont\reducedsf\sfshape{10}{1000}1577\setfont\reducedsc\scshape{10}{1000}1578\setfont\reducedttsl\ttslshape{10}{1000}1579\font\reducedi=cmmi101580\font\reducedsy=cmsy1015811582% In order for the font changes to affect most math symbols and letters,1583% we have to define the \textfont of the standard families. Since1584% texinfo doesn't allow for producing subscripts and superscripts except1585% in the main text, we don't bother to reset \scriptfont and1586% \scriptscriptfont (which would also require loading a lot more fonts).1587%1588\def\resetmathfonts{%1589\textfont0=\tenrm \textfont1=\teni \textfont2=\tensy1590\textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf1591\textfont\ttfam=\tentt \textfont\sffam=\tensf1592}15931594% The font-changing commands redefine the meanings of \tenSTYLE, instead1595% of just \STYLE. We do this because \STYLE needs to also set the1596% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire1597% \tenSTYLE to set the current font.1598%1599% Each font-changing command also sets the names \lsize (one size lower)1600% and \lllsize (three sizes lower). These relative commands are used in1601% the LaTeX logo and acronyms.1602%1603% This all needs generalizing, badly.1604%1605\def\textfonts{%1606\let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl1607\let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc1608\let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy1609\let\tenttsl=\textttsl1610\def\lsize{reduced}\def\lllsize{smaller}%1611\resetmathfonts \setleading{\textleading}}1612\def\titlefonts{%1613\let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl1614\let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc1615\let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy1616\let\tenttsl=\titlettsl1617\def\lsize{chap}\def\lllsize{subsec}%1618\resetmathfonts \setleading{25pt}}1619\def\titlefont#1{{\titlefonts\rm #1}}1620\def\chapfonts{%1621\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl1622\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc1623\let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl1624\def\lsize{sec}\def\lllsize{text}%1625\resetmathfonts \setleading{19pt}}1626\def\secfonts{%1627\let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl1628\let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc1629\let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy1630\let\tenttsl=\secttsl1631\def\lsize{subsec}\def\lllsize{reduced}%1632\resetmathfonts \setleading{16pt}}1633\def\subsecfonts{%1634\let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl1635\let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc1636\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy1637\let\tenttsl=\ssecttsl1638\def\lsize{text}\def\lllsize{small}%1639\resetmathfonts \setleading{15pt}}1640\let\subsubsecfonts = \subsecfonts1641\def\reducedfonts{%1642\let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl1643\let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc1644\let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy1645\let\tenttsl=\reducedttsl1646\def\lsize{small}\def\lllsize{smaller}%1647\resetmathfonts \setleading{10.5pt}}1648\def\smallfonts{%1649\let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl1650\let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc1651\let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy1652\let\tenttsl=\smallttsl1653\def\lsize{smaller}\def\lllsize{smaller}%1654\resetmathfonts \setleading{10.5pt}}1655\def\smallerfonts{%1656\let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl1657\let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc1658\let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy1659\let\tenttsl=\smallerttsl1660\def\lsize{smaller}\def\lllsize{smaller}%1661\resetmathfonts \setleading{9.5pt}}16621663% Set the fonts to use with the @small... environments.1664\let\smallexamplefonts = \smallfonts16651666% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample1667% can fit this many characters:1668% 8.5x11=86 smallbook=72 a4=90 a5=691669% If we use \scriptfonts (8pt), then we can fit this many characters:1670% 8.5x11=90+ smallbook=80 a4=90+ a5=771671% For me, subjectively, the few extra characters that fit aren't worth1672% the additional smallness of 8pt. So I'm making the default 9pt.1673%1674% By the way, for comparison, here's what fits with @example (10pt):1675% 8.5x11=71 smallbook=60 a4=75 a5=581676%1677% I wish the USA used A4 paper.1678% --karl, 24jan03.167916801681% Set up the default fonts, so we can use them for creating boxes.1682%1683\textfonts \rm16841685% Define these so they can be easily changed for other fonts.1686\def\angleleft{$\langle$}1687\def\angleright{$\rangle$}16881689% Count depth in font-changes, for error checks1690\newcount\fontdepth \fontdepth=016911692% Fonts for short table of contents.1693\setfont\shortcontrm\rmshape{12}{1000}1694\setfont\shortcontbf\bfshape{10}{\magstep1} % no cmb121695\setfont\shortcontsl\slshape{12}{1000}1696\setfont\shortconttt\ttshape{12}{1000}16971698%% Add scribe-like font environments, plus @l for inline lisp (usually sans1699%% serif) and @ii for TeX italic17001701% \smartitalic{ARG} outputs arg in italics, followed by an italic correction1702% unless the following character is such as not to need one.1703\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else1704\ptexslash\fi\fi\fi}1705\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}1706\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}17071708% like \smartslanted except unconditionally uses \ttsl.1709% @var is set to this for defun arguments.1710\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}17111712% like \smartslanted except unconditionally use \sl. We never want1713% ttsl for book titles, do we?1714\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}17151716\let\i=\smartitalic1717\let\var=\smartslanted1718\let\dfn=\smartslanted1719\let\emph=\smartitalic17201721\def\b#1{{\bf #1}}1722\let\strong=\b17231724% We can't just use \exhyphenpenalty, because that only has effect at1725% the end of a paragraph. Restore normal hyphenation at the end of the1726% group within which \nohyphenation is presumably called.1727%1728\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}1729\def\restorehyphenation{\hyphenchar\font = `- }17301731% Set sfcode to normal for the chars that usually have another value.1732% Can't use plain's \frenchspacing because it uses the `\x notation, and1733% sometimes \x has an active definition that messes things up.1734%1735\catcode`@=111736\def\frenchspacing{%1737\sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m1738\sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m1739}1740\catcode`@=\other17411742\def\t#1{%1743{\tt \rawbackslash \frenchspacing #1}%1744\null1745}1746\def\samp#1{`\tclose{#1}'\null}1747\setfont\keyrm\rmshape{8}{1000}1748\font\keysy=cmsy91749\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%1750\raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%1751\vbox{\hrule\kern-0.4pt1752\hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%1753\kern-0.4pt\hrule}%1754\kern-.06em\raise0.4pt\hbox{\angleright}}}}1755% The old definition, with no lozenge:1756%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}1757\def\ctrl #1{{\tt \rawbackslash \hat}#1}17581759% @file, @option are the same as @samp.1760\let\file=\samp1761\let\option=\samp17621763% @code is a modification of @t,1764% which makes spaces the same size as normal in the surrounding text.1765\def\tclose#1{%1766{%1767% Change normal interword space to be same as for the current font.1768\spaceskip = \fontdimen2\font1769%1770% Switch to typewriter.1771\tt1772%1773% But `\ ' produces the large typewriter interword space.1774\def\ {{\spaceskip = 0pt{} }}%1775%1776% Turn off hyphenation.1777\nohyphenation1778%1779\rawbackslash1780\frenchspacing1781#1%1782}%1783\null1784}17851786% We *must* turn on hyphenation at `-' and `_' in @code.1787% Otherwise, it is too hard to avoid overfull hboxes1788% in the Emacs manual, the Library manual, etc.17891790% Unfortunately, TeX uses one parameter (\hyphenchar) to control1791% both hyphenation at - and hyphenation within words.1792% We must therefore turn them both off (\tclose does that)1793% and arrange explicitly to hyphenate at a dash.1794% -- rms.1795{1796\catcode`\-=\active1797\catcode`\_=\active1798%1799\global\def\code{\begingroup1800\catcode`\-=\active \let-\codedash1801\catcode`\_=\active \let_\codeunder1802\codex1803}1804}18051806\def\realdash{-}1807\def\codedash{-\discretionary{}{}{}}1808\def\codeunder{%1809% this is all so @math{@code{var_name}+1} can work. In math mode, _1810% is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)1811% will therefore expand the active definition of _, which is us1812% (inside @code that is), therefore an endless loop.1813\ifusingtt{\ifmmode1814\mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.1815\else\normalunderscore \fi1816\discretionary{}{}{}}%1817{\_}%1818}1819\def\codex #1{\tclose{#1}\endgroup}18201821% @kbd is like @code, except that if the argument is just one @key command,1822% then @kbd has no effect.18231824% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),1825% `example' (@kbd uses ttsl only inside of @example and friends),1826% or `code' (@kbd uses normal tty font always).1827\parseargdef\kbdinputstyle{%1828\def\arg{#1}%1829\ifx\arg\worddistinct1830\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%1831\else\ifx\arg\wordexample1832\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%1833\else\ifx\arg\wordcode1834\gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%1835\else1836\errhelp = \EMsimple1837\errmessage{Unknown @kbdinputstyle option `\arg'}%1838\fi\fi\fi1839}1840\def\worddistinct{distinct}1841\def\wordexample{example}1842\def\wordcode{code}18431844% Default is `distinct.'1845\kbdinputstyle distinct18461847\def\xkey{\key}1848\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%1849\ifx\one\xkey\ifx\threex\three \key{#2}%1850\else{\tclose{\kbdfont\look}}\fi1851\else{\tclose{\kbdfont\look}}\fi}18521853% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.1854\let\indicateurl=\code1855\let\env=\code1856\let\command=\code18571858% @uref (abbreviation for `urlref') takes an optional (comma-separated)1859% second argument specifying the text to display and an optional third1860% arg as text to display instead of (rather than in addition to) the url1861% itself. First (mandatory) arg is the url. Perhaps eventually put in1862% a hypertex \special here.1863%1864\def\uref#1{\douref #1,,,\finish}1865\def\douref#1,#2,#3,#4\finish{\begingroup1866\unsepspaces1867\pdfurl{#1}%1868\setbox0 = \hbox{\ignorespaces #3}%1869\ifdim\wd0 > 0pt1870\unhbox0 % third arg given, show only that1871\else1872\setbox0 = \hbox{\ignorespaces #2}%1873\ifdim\wd0 > 0pt1874\ifpdf1875\unhbox0 % PDF: 2nd arg given, show only it1876\else1877\unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url1878\fi1879\else1880\code{#1}% only url given, so show it1881\fi1882\fi1883\endlink1884\endgroup}18851886% @url synonym for @uref, since that's how everyone uses it.1887%1888\let\url=\uref18891890% rms does not like angle brackets --karl, 17may97.1891% So now @email is just like @uref, unless we are pdf.1892%1893%\def\email#1{\angleleft{\tt #1}\angleright}1894\ifpdf1895\def\email#1{\doemail#1,,\finish}1896\def\doemail#1,#2,#3\finish{\begingroup1897\unsepspaces1898\pdfurl{mailto:#1}%1899\setbox0 = \hbox{\ignorespaces #2}%1900\ifdim\wd0>0pt\unhbox0\else\code{#1}\fi1901\endlink1902\endgroup}1903\else1904\let\email=\uref1905\fi19061907% Check if we are currently using a typewriter font. Since all the1908% Computer Modern typewriter fonts have zero interword stretch (and1909% shrink), and it is reasonable to expect all typewriter fonts to have1910% this property, we can check that font parameter.1911%1912\def\ifmonospace{\ifdim\fontdimen3\font=0pt }19131914% Typeset a dimension, e.g., `in' or `pt'. The only reason for the1915% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.1916%1917\def\dmn#1{\thinspace #1}19181919\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}19201921% @l was never documented to mean ``switch to the Lisp font'',1922% and it is not used as such in any manual I can find. We need it for1923% Polish suppressed-l. --karl, 22sep96.1924%\def\l#1{{\li #1}\null}19251926% Explicit font changes: @r, @sc, undocumented @ii.1927\def\r#1{{\rm #1}} % roman font1928\def\sc#1{{\smallcaps#1}} % smallcaps font1929\def\ii#1{{\it #1}} % italic font19301931\def\acronym#1{\doacronym #1,,\finish}1932\def\doacronym#1,#2,#3\finish{%1933{\selectfonts\lsize #1}%1934\def\temp{#2}%1935\ifx\temp\empty \else1936\space ({\unsepspaces \ignorespaces \temp \unskip})%1937\fi1938}19391940% @pounds{} is a sterling sign, which is in the CM italic font.1941%1942\def\pounds{{\it\$}}19431944% @registeredsymbol - R in a circle. The font for the R should really1945% be smaller yet, but lllsize is the best we can do for now.1946% Adapted from the plain.tex definition of \copyright.1947%1948\def\registeredsymbol{%1949$^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%1950\hfil\crcr\Orb}}%1951}$%1952}195319541955\message{page headings,}19561957\newskip\titlepagetopglue \titlepagetopglue = 1.5in1958\newskip\titlepagebottomglue \titlepagebottomglue = 2pc19591960% First the title page. Must do @settitle before @titlepage.1961\newif\ifseenauthor1962\newif\iffinishedtitlepage19631964% Do an implicit @contents or @shortcontents after @end titlepage if the1965% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.1966%1967\newif\ifsetcontentsaftertitlepage1968\let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue1969\newif\ifsetshortcontentsaftertitlepage1970\let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue19711972\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%1973\endgroup\page\hbox{}\page}19741975\envdef\titlepage{%1976% Open one extra group, as we want to close it in the middle of \Etitlepage.1977\begingroup1978\parindent=0pt \textfonts1979% Leave some space at the very top of the page.1980\vglue\titlepagetopglue1981% No rule at page bottom unless we print one at the top with @title.1982\finishedtitlepagetrue1983%1984% Most title ``pages'' are actually two pages long, with space1985% at the top of the second. We don't want the ragged left on the second.1986\let\oldpage = \page1987\def\page{%1988\iffinishedtitlepage\else1989\finishtitlepage1990\fi1991\let\page = \oldpage1992\page1993\null1994}%1995}19961997\def\Etitlepage{%1998\iffinishedtitlepage\else1999\finishtitlepage2000\fi2001% It is important to do the page break before ending the group,2002% because the headline and footline are only empty inside the group.2003% If we use the new definition of \page, we always get a blank page2004% after the title page, which we certainly don't want.2005\oldpage2006\endgroup2007%2008% Need this before the \...aftertitlepage checks so that if they are2009% in effect the toc pages will come out with page numbers.2010\HEADINGSon2011%2012% If they want short, they certainly want long too.2013\ifsetshortcontentsaftertitlepage2014\shortcontents2015\contents2016\global\let\shortcontents = \relax2017\global\let\contents = \relax2018\fi2019%2020\ifsetcontentsaftertitlepage2021\contents2022\global\let\contents = \relax2023\global\let\shortcontents = \relax2024\fi2025}20262027\def\finishtitlepage{%2028\vskip4pt \hrule height 2pt width \hsize2029\vskip\titlepagebottomglue2030\finishedtitlepagetrue2031}20322033%%% Macros to be used within @titlepage:20342035\let\subtitlerm=\tenrm2036\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}20372038\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines2039\let\tt=\authortt}20402041\parseargdef\title{%2042\checkenv\titlepage2043\leftline{\titlefonts\rm #1}2044% print a rule at the page bottom also.2045\finishedtitlepagefalse2046\vskip4pt \hrule height 4pt width \hsize \vskip4pt2047}20482049\parseargdef\subtitle{%2050\checkenv\titlepage2051{\subtitlefont \rightline{#1}}%2052}20532054% @author should come last, but may come many times.2055% It can also be used inside @quotation.2056%2057\parseargdef\author{%2058\def\temp{\quotation}%2059\ifx\thisenv\temp2060\def\quotationauthor{#1}% printed in \Equotation.2061\else2062\checkenv\titlepage2063\ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi2064{\authorfont \leftline{#1}}%2065\fi2066}206720682069%%% Set up page headings and footings.20702071\let\thispage=\folio20722073\newtoks\evenheadline % headline on even pages2074\newtoks\oddheadline % headline on odd pages2075\newtoks\evenfootline % footline on even pages2076\newtoks\oddfootline % footline on odd pages20772078% Now make TeX use those variables2079\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline2080\else \the\evenheadline \fi}}2081\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline2082\else \the\evenfootline \fi}\HEADINGShook}2083\let\HEADINGShook=\relax20842085% Commands to set those variables.2086% For example, this is what @headings on does2087% @evenheading @thistitle|@thispage|@thischapter2088% @oddheading @thischapter|@thispage|@thistitle2089% @evenfooting @thisfile||2090% @oddfooting ||@thisfile209120922093\def\evenheading{\parsearg\evenheadingxxx}2094\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}2095\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%2096\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}20972098\def\oddheading{\parsearg\oddheadingxxx}2099\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}2100\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%2101\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}21022103\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%21042105\def\evenfooting{\parsearg\evenfootingxxx}2106\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}2107\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%2108\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}21092110\def\oddfooting{\parsearg\oddfootingxxx}2111\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}2112\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%2113\global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%2114%2115% Leave some space for the footline. Hopefully ok to assume2116% @evenfooting will not be used by itself.2117\global\advance\pageheight by -\baselineskip2118\global\advance\vsize by -\baselineskip2119}21202121\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}212221232124% @headings double turns headings on for double-sided printing.2125% @headings single turns headings on for single-sided printing.2126% @headings off turns them off.2127% @headings on same as @headings double, retained for compatibility.2128% @headings after turns on double-sided headings after this page.2129% @headings doubleafter turns on double-sided headings after this page.2130% @headings singleafter turns on single-sided headings after this page.2131% By default, they are off at the start of a document,2132% and turned `on' after @end titlepage.21332134\def\headings #1 {\csname HEADINGS#1\endcsname}21352136\def\HEADINGSoff{%2137\global\evenheadline={\hfil} \global\evenfootline={\hfil}2138\global\oddheadline={\hfil} \global\oddfootline={\hfil}}2139\HEADINGSoff2140% When we turn headings on, set the page number to 1.2141% For double-sided printing, put current file name in lower left corner,2142% chapter name on inside top of right hand pages, document2143% title on inside top of left hand pages, and page numbers on outside top2144% edge of all pages.2145\def\HEADINGSdouble{%2146\global\pageno=12147\global\evenfootline={\hfil}2148\global\oddfootline={\hfil}2149\global\evenheadline={\line{\folio\hfil\thistitle}}2150\global\oddheadline={\line{\thischapter\hfil\folio}}2151\global\let\contentsalignmacro = \chapoddpage2152}2153\let\contentsalignmacro = \chappager21542155% For single-sided printing, chapter title goes across top left of page,2156% page number on top right.2157\def\HEADINGSsingle{%2158\global\pageno=12159\global\evenfootline={\hfil}2160\global\oddfootline={\hfil}2161\global\evenheadline={\line{\thischapter\hfil\folio}}2162\global\oddheadline={\line{\thischapter\hfil\folio}}2163\global\let\contentsalignmacro = \chappager2164}2165\def\HEADINGSon{\HEADINGSdouble}21662167\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}2168\let\HEADINGSdoubleafter=\HEADINGSafter2169\def\HEADINGSdoublex{%2170\global\evenfootline={\hfil}2171\global\oddfootline={\hfil}2172\global\evenheadline={\line{\folio\hfil\thistitle}}2173\global\oddheadline={\line{\thischapter\hfil\folio}}2174\global\let\contentsalignmacro = \chapoddpage2175}21762177\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}2178\def\HEADINGSsinglex{%2179\global\evenfootline={\hfil}2180\global\oddfootline={\hfil}2181\global\evenheadline={\line{\thischapter\hfil\folio}}2182\global\oddheadline={\line{\thischapter\hfil\folio}}2183\global\let\contentsalignmacro = \chappager2184}21852186% Subroutines used in generating headings2187% This produces Day Month Year style of output.2188% Only define if not already defined, in case a txi-??.tex file has set2189% up a different format (e.g., txi-cs.tex does this).2190\ifx\today\undefined2191\def\today{%2192\number\day\space2193\ifcase\month2194\or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr2195\or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug2196\or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec2197\fi2198\space\number\year}2199\fi22002201% @settitle line... specifies the title of the document, for headings.2202% It generates no output of its own.2203\def\thistitle{\putwordNoTitle}2204\def\settitle{\parsearg{\gdef\thistitle}}220522062207\message{tables,}2208% Tables -- @table, @ftable, @vtable, @item(x).22092210% default indentation of table text2211\newdimen\tableindent \tableindent=.8in2212% default indentation of @itemize and @enumerate text2213\newdimen\itemindent \itemindent=.3in2214% margin between end of table item and start of table text.2215\newdimen\itemmargin \itemmargin=.1in22162217% used internally for \itemindent minus \itemmargin2218\newdimen\itemmax22192220% Note @table, @ftable, and @vtable define @item, @itemx, etc., with2221% these defs.2222% They also define \itemindex2223% to index the item name in whatever manner is desired (perhaps none).22242225\newif\ifitemxneedsnegativevskip22262227\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}22282229\def\internalBitem{\smallbreak \parsearg\itemzzz}2230\def\internalBitemx{\itemxpar \parsearg\itemzzz}22312232\def\itemzzz #1{\begingroup %2233\advance\hsize by -\rightskip2234\advance\hsize by -\tableindent2235\setbox0=\hbox{\itemindicate{#1}}%2236\itemindex{#1}%2237\nobreak % This prevents a break before @itemx.2238%2239% If the item text does not fit in the space we have, put it on a line2240% by itself, and do not allow a page break either before or after that2241% line. We do not start a paragraph here because then if the next2242% command is, e.g., @kindex, the whatsit would get put into the2243% horizontal list on a line by itself, resulting in extra blank space.2244\ifdim \wd0>\itemmax2245%2246% Make this a paragraph so we get the \parskip glue and wrapping,2247% but leave it ragged-right.2248\begingroup2249\advance\leftskip by-\tableindent2250\advance\hsize by\tableindent2251\advance\rightskip by0pt plus1fil2252\leavevmode\unhbox0\par2253\endgroup2254%2255% We're going to be starting a paragraph, but we don't want the2256% \parskip glue -- logically it's part of the @item we just started.2257\nobreak \vskip-\parskip2258%2259% Stop a page break at the \parskip glue coming up. (Unfortunately2260% we can't prevent a possible page break at the following2261% \baselineskip glue.) However, if what follows is an environment2262% such as @example, there will be no \parskip glue; then2263% the negative vskip we just would cause the example and the item to2264% crash together. So we use this bizarre value of 10001 as a signal2265% to \aboveenvbreak to insert \parskip glue after all.2266% (Possibly there are other commands that could be followed by2267% @example which need the same treatment, but not section titles; or2268% maybe section titles are the only special case and they should be2269% penalty 10001...)2270\penalty 100012271\endgroup2272\itemxneedsnegativevskipfalse2273\else2274% The item text fits into the space. Start a paragraph, so that the2275% following text (if any) will end up on the same line.2276\noindent2277% Do this with kerns and \unhbox so that if there is a footnote in2278% the item text, it can migrate to the main vertical list and2279% eventually be printed.2280\nobreak\kern-\tableindent2281\dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd02282\unhbox02283\nobreak\kern\dimen02284\endgroup2285\itemxneedsnegativevskiptrue2286\fi2287}22882289\def\item{\errmessage{@item while not in a list environment}}2290\def\itemx{\errmessage{@itemx while not in a list environment}}22912292% @table, @ftable, @vtable.2293\envdef\table{%2294\let\itemindex\gobble2295\tablex2296}2297\envdef\ftable{%2298\def\itemindex ##1{\doind {fn}{\code{##1}}}%2299\tablex2300}2301\envdef\vtable{%2302\def\itemindex ##1{\doind {vr}{\code{##1}}}%2303\tablex2304}2305\def\tablex#1{%2306\def\itemindicate{#1}%2307\parsearg\tabley2308}2309\def\tabley#1{%2310{%2311\makevalueexpandable2312\edef\temp{\noexpand\tablez #1\space\space\space}%2313\expandafter2314}\temp \endtablez2315}2316\def\tablez #1 #2 #3 #4\endtablez{%2317\aboveenvbreak2318\ifnum 0#1>0 \advance \leftskip by #1\mil \fi2319\ifnum 0#2>0 \tableindent=#2\mil \fi2320\ifnum 0#3>0 \advance \rightskip by #3\mil \fi2321\itemmax=\tableindent2322\advance \itemmax by -\itemmargin2323\advance \leftskip by \tableindent2324\exdentamount=\tableindent2325\parindent = 0pt2326\parskip = \smallskipamount2327\ifdim \parskip=0pt \parskip=2pt \fi2328\let\item = \internalBitem2329\let\itemx = \internalBitemx2330}2331\def\Etable{\endgraf\afterenvbreak}2332\let\Eftable\Etable2333\let\Evtable\Etable2334\let\Eitemize\Etable2335\let\Eenumerate\Etable23362337% This is the counter used by @enumerate, which is really @itemize23382339\newcount \itemno23402341\envdef\itemize{\parsearg\doitemize}23422343\def\doitemize#1{%2344\aboveenvbreak2345\itemmax=\itemindent2346\advance\itemmax by -\itemmargin2347\advance\leftskip by \itemindent2348\exdentamount=\itemindent2349\parindent=0pt2350\parskip=\smallskipamount2351\ifdim\parskip=0pt \parskip=2pt \fi2352\def\itemcontents{#1}%2353% @itemize with no arg is equivalent to @itemize @bullet.2354\ifx\itemcontents\empty\def\itemcontents{\bullet}\fi2355\let\item=\itemizeitem2356}23572358% Definition of @item while inside @itemize and @enumerate.2359%2360\def\itemizeitem{%2361\advance\itemno by 1 % for enumerations2362{\let\par=\endgraf \smallbreak}% reasonable place to break2363{%2364% If the document has an @itemize directly after a section title, a2365% \nobreak will be last on the list, and \sectionheading will have2366% done a \vskip-\parskip. In that case, we don't want to zero2367% parskip, or the item text will crash with the heading. On the2368% other hand, when there is normal text preceding the item (as there2369% usually is), we do want to zero parskip, or there would be too much2370% space. In that case, we won't have a \nobreak before. At least2371% that's the theory.2372\ifnum\lastpenalty<10000 \parskip=0in \fi2373\noindent2374\hbox to 0pt{\hss \itemcontents \kern\itemmargin}%2375\vadjust{\penalty 1200}}% not good to break after first line of item.2376\flushcr2377}23782379% \splitoff TOKENS\endmark defines \first to be the first token in2380% TOKENS, and \rest to be the remainder.2381%2382\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%23832384% Allow an optional argument of an uppercase letter, lowercase letter,2385% or number, to specify the first label in the enumerated list. No2386% argument is the same as `1'.2387%2388\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}2389\def\enumeratey #1 #2\endenumeratey{%2390% If we were given no argument, pretend we were given `1'.2391\def\thearg{#1}%2392\ifx\thearg\empty \def\thearg{1}\fi2393%2394% Detect if the argument is a single token. If so, it might be a2395% letter. Otherwise, the only valid thing it can be is a number.2396% (We will always have one token, because of the test we just made.2397% This is a good thing, since \splitoff doesn't work given nothing at2398% all -- the first parameter is undelimited.)2399\expandafter\splitoff\thearg\endmark2400\ifx\rest\empty2401% Only one token in the argument. It could still be anything.2402% A ``lowercase letter'' is one whose \lccode is nonzero.2403% An ``uppercase letter'' is one whose \lccode is both nonzero, and2404% not equal to itself.2405% Otherwise, we assume it's a number.2406%2407% We need the \relax at the end of the \ifnum lines to stop TeX from2408% continuing to look for a <number>.2409%2410\ifnum\lccode\expandafter`\thearg=0\relax2411\numericenumerate % a number (we hope)2412\else2413% It's a letter.2414\ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax2415\lowercaseenumerate % lowercase letter2416\else2417\uppercaseenumerate % uppercase letter2418\fi2419\fi2420\else2421% Multiple tokens in the argument. We hope it's a number.2422\numericenumerate2423\fi2424}24252426% An @enumerate whose labels are integers. The starting integer is2427% given in \thearg.2428%2429\def\numericenumerate{%2430\itemno = \thearg2431\startenumeration{\the\itemno}%2432}24332434% The starting (lowercase) letter is in \thearg.2435\def\lowercaseenumerate{%2436\itemno = \expandafter`\thearg2437\startenumeration{%2438% Be sure we're not beyond the end of the alphabet.2439\ifnum\itemno=02440\errmessage{No more lowercase letters in @enumerate; get a bigger2441alphabet}%2442\fi2443\char\lccode\itemno2444}%2445}24462447% The starting (uppercase) letter is in \thearg.2448\def\uppercaseenumerate{%2449\itemno = \expandafter`\thearg2450\startenumeration{%2451% Be sure we're not beyond the end of the alphabet.2452\ifnum\itemno=02453\errmessage{No more uppercase letters in @enumerate; get a bigger2454alphabet}2455\fi2456\char\uccode\itemno2457}%2458}24592460% Call \doitemize, adding a period to the first argument and supplying the2461% common last two arguments. Also subtract one from the initial value in2462% \itemno, since @item increments \itemno.2463%2464\def\startenumeration#1{%2465\advance\itemno by -12466\doitemize{#1.}\flushcr2467}24682469% @alphaenumerate and @capsenumerate are abbreviations for giving an arg2470% to @enumerate.2471%2472\def\alphaenumerate{\enumerate{a}}2473\def\capsenumerate{\enumerate{A}}2474\def\Ealphaenumerate{\Eenumerate}2475\def\Ecapsenumerate{\Eenumerate}247624772478% @multitable macros2479% Amy Hendrickson, 8/18/94, 3/6/962480%2481% @multitable ... @end multitable will make as many columns as desired.2482% Contents of each column will wrap at width given in preamble. Width2483% can be specified either with sample text given in a template line,2484% or in percent of \hsize, the current width of text on page.24852486% Table can continue over pages but will only break between lines.24872488% To make preamble:2489%2490% Either define widths of columns in terms of percent of \hsize:2491% @multitable @columnfractions .25 .3 .452492% @item ...2493%2494% Numbers following @columnfractions are the percent of the total2495% current hsize to be used for each column. You may use as many2496% columns as desired.249724982499% Or use a template:2500% @multitable {Column 1 template} {Column 2 template} {Column 3 template}2501% @item ...2502% using the widest term desired in each column.25032504% Each new table line starts with @item, each subsequent new column2505% starts with @tab. Empty columns may be produced by supplying @tab's2506% with nothing between them for as many times as empty columns are needed,2507% ie, @tab@tab@tab will produce two empty columns.25082509% @item, @tab do not need to be on their own lines, but it will not hurt2510% if they are.25112512% Sample multitable:25132514% @multitable {Column 1 template} {Column 2 template} {Column 3 template}2515% @item first col stuff @tab second col stuff @tab third col2516% @item2517% first col stuff2518% @tab2519% second col stuff2520% @tab2521% third col2522% @item first col stuff @tab second col stuff2523% @tab Many paragraphs of text may be used in any column.2524%2525% They will wrap at the width determined by the template.2526% @item@tab@tab This will be in third column.2527% @end multitable25282529% Default dimensions may be reset by user.2530% @multitableparskip is vertical space between paragraphs in table.2531% @multitableparindent is paragraph indent in table.2532% @multitablecolmargin is horizontal space to be left between columns.2533% @multitablelinespace is space to leave between table items, baseline2534% to baseline.2535% 0pt means it depends on current normal line spacing.2536%2537\newskip\multitableparskip2538\newskip\multitableparindent2539\newdimen\multitablecolspace2540\newskip\multitablelinespace2541\multitableparskip=0pt2542\multitableparindent=6pt2543\multitablecolspace=12pt2544\multitablelinespace=0pt25452546% Macros used to set up halign preamble:2547%2548\let\endsetuptable\relax2549\def\xendsetuptable{\endsetuptable}2550\let\columnfractions\relax2551\def\xcolumnfractions{\columnfractions}2552\newif\ifsetpercent25532554% #1 is the @columnfraction, usually a decimal number like .5, but might2555% be just 1. We just use it, whatever it is.2556%2557\def\pickupwholefraction#1 {%2558\global\advance\colcount by 12559\expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%2560\setuptable2561}25622563\newcount\colcount2564\def\setuptable#1{%2565\def\firstarg{#1}%2566\ifx\firstarg\xendsetuptable2567\let\go = \relax2568\else2569\ifx\firstarg\xcolumnfractions2570\global\setpercenttrue2571\else2572\ifsetpercent2573\let\go\pickupwholefraction2574\else2575\global\advance\colcount by 12576\setbox0=\hbox{#1\unskip\space}% Add a normal word space as a2577% separator; typically that is always in the input, anyway.2578\expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%2579\fi2580\fi2581\ifx\go\pickupwholefraction2582% Put the argument back for the \pickupwholefraction call, so2583% we'll always have a period there to be parsed.2584\def\go{\pickupwholefraction#1}%2585\else2586\let\go = \setuptable2587\fi%2588\fi2589\go2590}25912592% multitable-only commands.2593%2594% @headitem starts a heading row, which we typeset in bold.2595% Assignments have to be global since we are inside the implicit group2596% of an alignment entry. Note that \everycr resets \everytab.2597\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}%2598%2599% A \tab used to include \hskip1sp. But then the space in a template2600% line is not enough. That is bad. So let's go back to just `&' until2601% we encounter the problem it was intended to solve again.2602% --karl, [email protected], 20apr99.2603\def\tab{\checkenv\multitable &\the\everytab}%26042605% @multitable ... @end multitable definitions:2606%2607\newtoks\everytab % insert after every tab.2608%2609\envdef\multitable{%2610\vskip\parskip2611\startsavinginserts2612%2613% @item within a multitable starts a normal row.2614\let\item\crcr2615%2616\tolerance=95002617\hbadness=95002618\setmultitablespacing2619\parskip=\multitableparskip2620\parindent=\multitableparindent2621\overfullrule=0pt2622\global\colcount=02623%2624\everycr = {%2625\noalign{%2626\global\everytab={}%2627\global\colcount=0 % Reset the column counter.2628% Check for saved footnotes, etc.2629\checkinserts2630% Keeps underfull box messages off when table breaks over pages.2631%\filbreak2632% Maybe so, but it also creates really weird page breaks when the2633% table breaks over pages. Wouldn't \vfil be better? Wait until the2634% problem manifests itself, so it can be fixed for real --karl.2635}%2636}%2637%2638\parsearg\domultitable2639}2640\def\domultitable#1{%2641% To parse everything between @multitable and @item:2642\setuptable#1 \endsetuptable2643%2644% This preamble sets up a generic column definition, which will2645% be used as many times as user calls for columns.2646% \vtop will set a single line and will also let text wrap and2647% continue for many paragraphs if desired.2648\halign\bgroup &%2649\global\advance\colcount by 12650\multistrut2651\vtop{%2652% Use the current \colcount to find the correct column width:2653\hsize=\expandafter\csname col\the\colcount\endcsname2654%2655% In order to keep entries from bumping into each other2656% we will add a \leftskip of \multitablecolspace to all columns after2657% the first one.2658%2659% If a template has been used, we will add \multitablecolspace2660% to the width of each template entry.2661%2662% If the user has set preamble in terms of percent of \hsize we will2663% use that dimension as the width of the column, and the \leftskip2664% will keep entries from bumping into each other. Table will start at2665% left margin and final column will justify at right margin.2666%2667% Make sure we don't inherit \rightskip from the outer environment.2668\rightskip=0pt2669\ifnum\colcount=12670% The first column will be indented with the surrounding text.2671\advance\hsize by\leftskip2672\else2673\ifsetpercent \else2674% If user has not set preamble in terms of percent of \hsize2675% we will advance \hsize by \multitablecolspace.2676\advance\hsize by \multitablecolspace2677\fi2678% In either case we will make \leftskip=\multitablecolspace:2679\leftskip=\multitablecolspace2680\fi2681% Ignoring space at the beginning and end avoids an occasional spurious2682% blank line, when TeX decides to break the line at the space before the2683% box from the multistrut, so the strut ends up on a line by itself.2684% For example:2685% @multitable @columnfractions .11 .892686% @item @code{#}2687% @tab Legal holiday which is valid in major parts of the whole country.2688% Is automatically provided with highlighting sequences respectively2689% marking characters.2690\noindent\ignorespaces##\unskip\multistrut2691}\cr2692}2693\def\Emultitable{%2694\crcr2695\egroup % end the \halign2696\global\setpercentfalse2697}26982699\def\setmultitablespacing{% test to see if user has set \multitablelinespace.2700% If so, do nothing. If not, give it an appropriate dimension based on2701% current baselineskip.2702\ifdim\multitablelinespace=0pt2703\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip2704\global\advance\multitablelinespace by-\ht02705%% strut to put in table in case some entry doesn't have descenders,2706%% to keep lines equally spaced2707\let\multistrut = \strut2708\else2709%% FIXME: what is \box0 supposed to be?2710\gdef\multistrut{\vrule height\multitablelinespace depth\dp02711width0pt\relax} \fi2712%% Test to see if parskip is larger than space between lines of2713%% table. If not, do nothing.2714%% If so, set to same dimension as multitablelinespace.2715\ifdim\multitableparskip>\multitablelinespace2716\global\multitableparskip=\multitablelinespace2717\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller2718%% than skip between lines in the table.2719\fi%2720\ifdim\multitableparskip=0pt2721\global\multitableparskip=\multitablelinespace2722\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller2723%% than skip between lines in the table.2724\fi}272527262727\message{conditionals,}27282729% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,2730% @ifnotxml always succeed. They currently do nothing; we don't2731% attempt to check whether the conditionals are properly nested. But we2732% have to remember that they are conditionals, so that @end doesn't2733% attempt to close an environment group.2734%2735\def\makecond#1{%2736\expandafter\let\csname #1\endcsname = \relax2737\expandafter\let\csname iscond.#1\endcsname = 12738}2739\makecond{iftex}2740\makecond{ifnotdocbook}2741\makecond{ifnothtml}2742\makecond{ifnotinfo}2743\makecond{ifnotplaintext}2744\makecond{ifnotxml}27452746% Ignore @ignore, @ifhtml, @ifinfo, and the like.2747%2748\def\direntry{\doignore{direntry}}2749\def\documentdescription{\doignore{documentdescription}}2750\def\docbook{\doignore{docbook}}2751\def\html{\doignore{html}}2752\def\ifdocbook{\doignore{ifdocbook}}2753\def\ifhtml{\doignore{ifhtml}}2754\def\ifinfo{\doignore{ifinfo}}2755\def\ifnottex{\doignore{ifnottex}}2756\def\ifplaintext{\doignore{ifplaintext}}2757\def\ifxml{\doignore{ifxml}}2758\def\ignore{\doignore{ignore}}2759\def\menu{\doignore{menu}}2760\def\xml{\doignore{xml}}27612762% Ignore text until a line `@end #1', keeping track of nested conditionals.2763%2764% A count to remember the depth of nesting.2765\newcount\doignorecount27662767\def\doignore#1{\begingroup2768% Scan in ``verbatim'' mode:2769\catcode`\@ = \other2770\catcode`\{ = \other2771\catcode`\} = \other2772%2773% Make sure that spaces turn into tokens that match what \doignoretext wants.2774\spaceisspace2775%2776% Count number of #1's that we've seen.2777\doignorecount = 02778%2779% Swallow text until we reach the matching `@end #1'.2780\dodoignore {#1}%2781}27822783{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.2784\obeylines %2785%2786\gdef\dodoignore#1{%2787% #1 contains the string `ifinfo'.2788%2789% Define a command to find the next `@end #1', which must be on a line2790% by itself.2791\long\def\doignoretext##1^^M@end #1{\doignoretextyyy##1^^M@#1\_STOP_}%2792% And this command to find another #1 command, at the beginning of a2793% line. (Otherwise, we would consider a line `@c @ifset', for2794% example, to count as an @ifset for nesting.)2795\long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%2796%2797% And now expand that command.2798\obeylines %2799\doignoretext ^^M%2800}%2801}28022803\def\doignoreyyy#1{%2804\def\temp{#1}%2805\ifx\temp\empty % Nothing found.2806\let\next\doignoretextzzz2807\else % Found a nested condition, ...2808\advance\doignorecount by 12809\let\next\doignoretextyyy % ..., look for another.2810% If we're here, #1 ends with ^^M\ifinfo (for example).2811\fi2812\next #1% the token \_STOP_ is present just after this macro.2813}28142815% We have to swallow the remaining "\_STOP_".2816%2817\def\doignoretextzzz#1{%2818\ifnum\doignorecount = 0 % We have just found the outermost @end.2819\let\next\enddoignore2820\else % Still inside a nested condition.2821\advance\doignorecount by -12822\let\next\doignoretext % Look for the next @end.2823\fi2824\next2825}28262827% Finish off ignored text.2828\def\enddoignore{\endgroup\ignorespaces}282928302831% @set VAR sets the variable VAR to an empty value.2832% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.2833%2834% Since we want to separate VAR from REST-OF-LINE (which might be2835% empty), we can't just use \parsearg; we have to insert a space of our2836% own to delimit the rest of the line, and then take it out again if we2837% didn't need it.2838% We rely on the fact that \parsearg sets \catcode`\ =10.2839%2840\parseargdef\set{\setyyy#1 \endsetyyy}2841\def\setyyy#1 #2\endsetyyy{%2842{%2843\makevalueexpandable2844\def\temp{#2}%2845\edef\next{\gdef\makecsname{SET#1}}%2846\ifx\temp\empty2847\next{}%2848\else2849\setzzz#2\endsetzzz2850\fi2851}%2852}2853% Remove the trailing space \setxxx inserted.2854\def\setzzz#1 \endsetzzz{\next{#1}}28552856% @clear VAR clears (i.e., unsets) the variable VAR.2857%2858\parseargdef\clear{%2859{%2860\makevalueexpandable2861\global\expandafter\let\csname SET#1\endcsname=\relax2862}%2863}28642865% @value{foo} gets the text saved in variable foo.2866\def\value{\begingroup\makevalueexpandable\valuexxx}2867\def\valuexxx#1{\expandablevalue{#1}\endgroup}2868{2869\catcode`\- = \active \catcode`\_ = \active2870%2871\gdef\makevalueexpandable{%2872\let\value = \expandablevalue2873% We don't want these characters active, ...2874\catcode`\-=\other \catcode`\_=\other2875% ..., but we might end up with active ones in the argument if2876% we're called from @code, as @code{@value{foo-bar_}}, though.2877% So \let them to their normal equivalents.2878\let-\realdash \let_\normalunderscore2879}2880}28812882% We have this subroutine so that we can handle at least some @value's2883% properly in indexes (we call \makevalueexpandable in \indexdummies).2884% The command has to be fully expandable (if the variable is set), since2885% the result winds up in the index file. This means that if the2886% variable's value contains other Texinfo commands, it's almost certain2887% it will fail (although perhaps we could fix that with sufficient work2888% to do a one-level expansion on the result, instead of complete).2889%2890\def\expandablevalue#1{%2891\expandafter\ifx\csname SET#1\endcsname\relax2892{[No value for ``#1'']}%2893\message{Variable `#1', used in @value, is not set.}%2894\else2895\csname SET#1\endcsname2896\fi2897}28982899% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined2900% with @set.2901%2902% To get special treatment of `@end ifset,' call \makeond and the redefine.2903%2904\makecond{ifset}2905\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}2906\def\doifset#1#2{%2907{%2908\makevalueexpandable2909\let\next=\empty2910\expandafter\ifx\csname SET#2\endcsname\relax2911#1% If not set, redefine \next.2912\fi2913\expandafter2914}\next2915}2916\def\ifsetfail{\doignore{ifset}}29172918% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been2919% defined with @set, or has been undefined with @clear.2920%2921% The `\else' inside the `\doifset' parameter is a trick to reuse the2922% above code: if the variable is not set, do nothing, if it is set,2923% then redefine \next to \ifclearfail.2924%2925\makecond{ifclear}2926\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}2927\def\ifclearfail{\doignore{ifclear}}29282929% @dircategory CATEGORY -- specify a category of the dir file2930% which this file should belong to. Ignore this in TeX.2931\let\dircategory=\comment29322933% @defininfoenclose.2934\let\definfoenclose=\comment293529362937\message{indexing,}2938% Index generation facilities29392940% Define \newwrite to be identical to plain tex's \newwrite2941% except not \outer, so it can be used within \newindex.2942{\catcode`\@=112943\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}29442945% \newindex {foo} defines an index named foo.2946% It automatically defines \fooindex such that2947% \fooindex ...rest of line... puts an entry in the index foo.2948% It also defines \fooindfile to be the number of the output channel for2949% the file that accumulates this index. The file's extension is foo.2950% The name of an index should be no more than 2 characters long2951% for the sake of vms.2952%2953\def\newindex#1{%2954\iflinks2955\expandafter\newwrite \csname#1indfile\endcsname2956\openout \csname#1indfile\endcsname \jobname.#1 % Open the file2957\fi2958\expandafter\xdef\csname#1index\endcsname{% % Define @#1index2959\noexpand\doindex{#1}}2960}29612962% @defindex foo == \newindex{foo}2963%2964\def\defindex{\parsearg\newindex}29652966% Define @defcodeindex, like @defindex except put all entries in @code.2967%2968\def\defcodeindex{\parsearg\newcodeindex}2969%2970\def\newcodeindex#1{%2971\iflinks2972\expandafter\newwrite \csname#1indfile\endcsname2973\openout \csname#1indfile\endcsname \jobname.#12974\fi2975\expandafter\xdef\csname#1index\endcsname{%2976\noexpand\docodeindex{#1}}%2977}297829792980% @synindex foo bar makes index foo feed into index bar.2981% Do this instead of @defindex foo if you don't want it as a separate index.2982%2983% @syncodeindex foo bar similar, but put all entries made for index foo2984% inside @code.2985%2986\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}2987\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}29882989% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),2990% #3 the target index (bar).2991\def\dosynindex#1#2#3{%2992% Only do \closeout if we haven't already done it, else we'll end up2993% closing the target index.2994\expandafter \ifx\csname donesynindex#2\endcsname \undefined2995% The \closeout helps reduce unnecessary open files; the limit on the2996% Acorn RISC OS is a mere 16 files.2997\expandafter\closeout\csname#2indfile\endcsname2998\expandafter\let\csname\donesynindex#2\endcsname = 12999\fi3000% redefine \fooindfile:3001\expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname3002\expandafter\let\csname#2indfile\endcsname=\temp3003% redefine \fooindex:3004\expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%3005}30063007% Define \doindex, the driver for all \fooindex macros.3008% Argument #1 is generated by the calling \fooindex macro,3009% and it is "foo", the name of the index.30103011% \doindex just uses \parsearg; it calls \doind for the actual work.3012% This is because \doind is more useful to call from other macros.30133014% There is also \dosubind {index}{topic}{subtopic}3015% which makes an entry in a two-level index such as the operation index.30163017\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}3018\def\singleindexer #1{\doind{\indexname}{#1}}30193020% like the previous two, but they put @code around the argument.3021\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}3022\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}30233024% Take care of Texinfo commands that can appear in an index entry.3025% Since there are some commands we want to expand, and others we don't,3026% we have to laboriously prevent expansion for those that we don't.3027%3028\def\indexdummies{%3029\def\@{@}% change to @@ when we switch to @ as escape char in index files.3030\def\ {\realbackslash\space }%3031% Need these in case \tex is in effect and \{ is a \delimiter again.3032% But can't use \lbracecmd and \rbracecmd because texindex assumes3033% braces and backslashes are used only as delimiters.3034\let\{ = \mylbrace3035\let\} = \myrbrace3036%3037% \definedummyword defines \#1 as \realbackslash #1\space, thus3038% effectively preventing its expansion. This is used only for control3039% words, not control letters, because the \space would be incorrect3040% for control characters, but is needed to separate the control word3041% from whatever follows.3042%3043% For control letters, we have \definedummyletter, which omits the3044% space.3045%3046% These can be used both for control words that take an argument and3047% those that do not. If it is followed by {arg} in the input, then3048% that will dutifully get written to the index (or wherever).3049%3050\def\definedummyword##1{%3051\expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}%3052}%3053\def\definedummyletter##1{%3054\expandafter\def\csname ##1\endcsname{\realbackslash ##1}%3055}%3056%3057% Do the redefinitions.3058\commondummies3059}30603061% For the aux file, @ is the escape character. So we want to redefine3062% everything using @ instead of \realbackslash. When everything uses3063% @, this will be simpler.3064%3065\def\atdummies{%3066\def\@{@@}%3067\def\ {@ }%3068\let\{ = \lbraceatcmd3069\let\} = \rbraceatcmd3070%3071% (See comments in \indexdummies.)3072\def\definedummyword##1{%3073\expandafter\def\csname ##1\endcsname{@##1\space}%3074}%3075\def\definedummyletter##1{%3076\expandafter\def\csname ##1\endcsname{@##1}%3077}%3078%3079% Do the redefinitions.3080\commondummies3081}30823083% Called from \indexdummies and \atdummies. \definedummyword and3084% \definedummyletter must be defined first.3085%3086\def\commondummies{%3087%3088\normalturnoffactive3089%3090\commondummiesnofonts3091%3092\definedummyletter{_}%3093%3094% Non-English letters.3095\definedummyword{AA}%3096\definedummyword{AE}%3097\definedummyword{L}%3098\definedummyword{OE}%3099\definedummyword{O}%3100\definedummyword{aa}%3101\definedummyword{ae}%3102\definedummyword{l}%3103\definedummyword{oe}%3104\definedummyword{o}%3105\definedummyword{ss}%3106\definedummyword{exclamdown}%3107\definedummyword{questiondown}%3108\definedummyword{ordf}%3109\definedummyword{ordm}%3110%3111% Although these internal commands shouldn't show up, sometimes they do.3112\definedummyword{bf}%3113\definedummyword{gtr}%3114\definedummyword{hat}%3115\definedummyword{less}%3116\definedummyword{sf}%3117\definedummyword{sl}%3118\definedummyword{tclose}%3119\definedummyword{tt}%3120%3121\definedummyword{LaTeX}%3122\definedummyword{TeX}%3123%3124% Assorted special characters.3125\definedummyword{bullet}%3126\definedummyword{copyright}%3127\definedummyword{registeredsymbol}%3128\definedummyword{dots}%3129\definedummyword{enddots}%3130\definedummyword{equiv}%3131\definedummyword{error}%3132\definedummyword{expansion}%3133\definedummyword{minus}%3134\definedummyword{pounds}%3135\definedummyword{point}%3136\definedummyword{print}%3137\definedummyword{result}%3138%3139% Handle some cases of @value -- where it does not contain any3140% (non-fully-expandable) commands.3141\makevalueexpandable3142%3143% Normal spaces, not active ones.3144\unsepspaces3145%3146% No macro expansion.3147\turnoffmacros3148}31493150% \commondummiesnofonts: common to \commondummies and \indexnofonts.3151%3152% Better have this without active chars.3153{3154\catcode`\~=\other3155\gdef\commondummiesnofonts{%3156% Control letters and accents.3157\definedummyletter{!}%3158\definedummyletter{"}%3159\definedummyletter{'}%3160\definedummyletter{*}%3161\definedummyletter{,}%3162\definedummyletter{.}%3163\definedummyletter{/}%3164\definedummyletter{:}%3165\definedummyletter{=}%3166\definedummyletter{?}%3167\definedummyletter{^}%3168\definedummyletter{`}%3169\definedummyletter{~}%3170\definedummyword{u}%3171\definedummyword{v}%3172\definedummyword{H}%3173\definedummyword{dotaccent}%3174\definedummyword{ringaccent}%3175\definedummyword{tieaccent}%3176\definedummyword{ubaraccent}%3177\definedummyword{udotaccent}%3178\definedummyword{dotless}%3179%3180% Texinfo font commands.3181\definedummyword{b}%3182\definedummyword{i}%3183\definedummyword{r}%3184\definedummyword{sc}%3185\definedummyword{t}%3186%3187% Commands that take arguments.3188\definedummyword{acronym}%3189\definedummyword{cite}%3190\definedummyword{code}%3191\definedummyword{command}%3192\definedummyword{dfn}%3193\definedummyword{emph}%3194\definedummyword{env}%3195\definedummyword{file}%3196\definedummyword{kbd}%3197\definedummyword{key}%3198\definedummyword{math}%3199\definedummyword{option}%3200\definedummyword{samp}%3201\definedummyword{strong}%3202\definedummyword{tie}%3203\definedummyword{uref}%3204\definedummyword{url}%3205\definedummyword{var}%3206\definedummyword{verb}%3207\definedummyword{w}%3208}3209}32103211% \indexnofonts is used when outputting the strings to sort the index3212% by, and when constructing control sequence names. It eliminates all3213% control sequences and just writes whatever the best ASCII sort string3214% would be for a given command (usually its argument).3215%3216\def\indexnofonts{%3217\def\definedummyword##1{%3218\expandafter\let\csname ##1\endcsname\asis3219}%3220% We can just ignore the accent commands and other control letters.3221\def\definedummyletter##1{%3222\expandafter\def\csname ##1\endcsname{}%3223}%3224%3225\commondummiesnofonts3226%3227% Don't no-op \tt, since it isn't a user-level command3228% and is used in the definitions of the active chars like <, >, |, etc.3229% Likewise with the other plain tex font commands.3230%\let\tt=\asis3231%3232\def\ { }%3233\def\@{@}%3234% how to handle braces?3235\def\_{\normalunderscore}%3236%3237% Non-English letters.3238\def\AA{AA}%3239\def\AE{AE}%3240\def\L{L}%3241\def\OE{OE}%3242\def\O{O}%3243\def\aa{aa}%3244\def\ae{ae}%3245\def\l{l}%3246\def\oe{oe}%3247\def\o{o}%3248\def\ss{ss}%3249\def\exclamdown{!}%3250\def\questiondown{?}%3251\def\ordf{a}%3252\def\ordm{o}%3253%3254\def\LaTeX{LaTeX}%3255\def\TeX{TeX}%3256%3257% Assorted special characters.3258% (The following {} will end up in the sort string, but that's ok.)3259\def\bullet{bullet}%3260\def\copyright{copyright}%3261\def\registeredsymbol{R}%3262\def\dots{...}%3263\def\enddots{...}%3264\def\equiv{==}%3265\def\error{error}%3266\def\expansion{==>}%3267\def\minus{-}%3268\def\pounds{pounds}%3269\def\point{.}%3270\def\print{-|}%3271\def\result{=>}%3272}32733274\let\indexbackslash=0 %overridden during \printindex.3275\let\SETmarginindex=\relax % put index entries in margin (undocumented)?32763277% Most index entries go through here, but \dosubind is the general case.3278% #1 is the index name, #2 is the entry text.3279\def\doind#1#2{\dosubind{#1}{#2}{}}32803281% Workhorse for all \fooindexes.3282% #1 is name of index, #2 is stuff to put there, #3 is subentry --3283% empty if called from \doind, as we usually are (the main exception3284% is with most defuns, which call us directly).3285%3286\def\dosubind#1#2#3{%3287\iflinks3288{%3289% Store the main index entry text (including the third arg).3290\toks0 = {#2}%3291% If third arg is present, precede it with a space.3292\def\thirdarg{#3}%3293\ifx\thirdarg\empty \else3294\toks0 = \expandafter{\the\toks0 \space #3}%3295\fi3296%3297\edef\writeto{\csname#1indfile\endcsname}%3298%3299\ifvmode3300\dosubindsanitize3301\else3302\dosubindwrite3303\fi3304}%3305\fi3306}33073308% Write the entry in \toks0 to the index file:3309%3310\def\dosubindwrite{%3311% Put the index entry in the margin if desired.3312\ifx\SETmarginindex\relax\else3313\insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%3314\fi3315%3316% Remember, we are within a group.3317\indexdummies % Must do this here, since \bf, etc expand at this stage3318\escapechar=`\\3319\def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now3320% so it will be output as is; and it will print as backslash.3321%3322% Process the index entry with all font commands turned off, to3323% get the string to sort by.3324{\indexnofonts3325\edef\temp{\the\toks0}% need full expansion3326\xdef\indexsorttmp{\temp}%3327}%3328%3329% Set up the complete index entry, with both the sort key and3330% the original text, including any font commands. We write3331% three arguments to \entry to the .?? file (four in the3332% subentry case), texindex reduces to two when writing the .??s3333% sorted result.3334\edef\temp{%3335\write\writeto{%3336\string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%3337}%3338\temp3339}33403341% Take care of unwanted page breaks:3342%3343% If a skip is the last thing on the list now, preserve it3344% by backing up by \lastskip, doing the \write, then inserting3345% the skip again. Otherwise, the whatsit generated by the3346% \write will make \lastskip zero. The result is that sequences3347% like this:3348% @end defun3349% @tindex whatever3350% @defun ...3351% will have extra space inserted, because the \medbreak in the3352% start of the @defun won't see the skip inserted by the @end of3353% the previous defun.3354%3355% But don't do any of this if we're not in vertical mode. We3356% don't want to do a \vskip and prematurely end a paragraph.3357%3358% Avoid page breaks due to these extra skips, too.3359%3360% But wait, there is a catch there:3361% We'll have to check whether \lastskip is zero skip. \ifdim is not3362% sufficient for this purpose, as it ignores stretch and shrink parts3363% of the skip. The only way seems to be to check the textual3364% representation of the skip.3365%3366% The following is almost like \def\zeroskipmacro{0.0pt} except that3367% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).3368%3369\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}3370%3371% ..., ready, GO:3372%3373\def\dosubindsanitize{%3374% \lastskip and \lastpenalty cannot both be nonzero simultaneously.3375\skip0 = \lastskip3376\edef\lastskipmacro{\the\lastskip}%3377\count255 = \lastpenalty3378%3379% If \lastskip is nonzero, that means the last item was a3380% skip. And since a skip is discardable, that means this3381% -\skip0 glue we're inserting is preceded by a3382% non-discardable item, therefore it is not a potential3383% breakpoint, therefore no \nobreak needed.3384\ifx\lastskipmacro\zeroskipmacro3385\else3386\vskip-\skip03387\fi3388%3389\dosubindwrite3390%3391\ifx\lastskipmacro\zeroskipmacro3392% if \lastskip was zero, perhaps the last item was a3393% penalty, and perhaps it was >=10000, e.g., a \nobreak.3394% In that case, we want to re-insert the penalty; since we3395% just inserted a non-discardable item, any following glue3396% (such as a \parskip) would be a breakpoint. For example:3397% @deffn deffn-whatever3398% @vindex index-whatever3399% Description.3400% would allow a break between the index-whatever whatsit3401% and the "Description." paragraph.3402\ifnum\count255>9999 \nobreak \fi3403\else3404% On the other hand, if we had a nonzero \lastskip,3405% this make-up glue would be preceded by a non-discardable item3406% (the whatsit from the \write), so we must insert a \nobreak.3407\nobreak\vskip\skip03408\fi3409}34103411% The index entry written in the file actually looks like3412% \entry {sortstring}{page}{topic}3413% or3414% \entry {sortstring}{page}{topic}{subtopic}3415% The texindex program reads in these files and writes files3416% containing these kinds of lines:3417% \initial {c}3418% before the first topic whose initial is c3419% \entry {topic}{pagelist}3420% for a topic that is used without subtopics3421% \primary {topic}3422% for the beginning of a topic that is used with subtopics3423% \secondary {subtopic}{pagelist}3424% for each subtopic.34253426% Define the user-accessible indexing commands3427% @findex, @vindex, @kindex, @cindex.34283429\def\findex {\fnindex}3430\def\kindex {\kyindex}3431\def\cindex {\cpindex}3432\def\vindex {\vrindex}3433\def\tindex {\tpindex}3434\def\pindex {\pgindex}34353436\def\cindexsub {\begingroup\obeylines\cindexsub}3437{\obeylines %3438\gdef\cindexsub "#1" #2^^M{\endgroup %3439\dosubind{cp}{#2}{#1}}}34403441% Define the macros used in formatting output of the sorted index material.34423443% @printindex causes a particular index (the ??s file) to get printed.3444% It does not print any chapter heading (usually an @unnumbered).3445%3446\parseargdef\printindex{\begingroup3447\dobreak \chapheadingskip{10000}%3448%3449\smallfonts \rm3450\tolerance = 95003451\everypar = {}% don't want the \kern\-parindent from indentation suppression.3452%3453% See if the index file exists and is nonempty.3454% Change catcode of @ here so that if the index file contains3455% \initial {@}3456% as its first line, TeX doesn't complain about mismatched braces3457% (because it thinks @} is a control sequence).3458\catcode`\@ = 113459\openin 1 \jobname.#1s3460\ifeof 13461% \enddoublecolumns gets confused if there is no text in the index,3462% and it loses the chapter title and the aux file entries for the3463% index. The easiest way to prevent this problem is to make sure3464% there is some text.3465\putwordIndexNonexistent3466\else3467%3468% If the index file exists but is empty, then \openin leaves \ifeof3469% false. We have to make TeX try to read something from the file, so3470% it can discover if there is anything in it.3471\read 1 to \temp3472\ifeof 13473\putwordIndexIsEmpty3474\else3475% Index files are almost Texinfo source, but we use \ as the escape3476% character. It would be better to use @, but that's too big a change3477% to make right now.3478\def\indexbackslash{\backslashcurfont}%3479\catcode`\\ = 03480\escapechar = `\\3481\begindoublecolumns3482\input \jobname.#1s3483\enddoublecolumns3484\fi3485\fi3486\closein 13487\endgroup}34883489% These macros are used by the sorted index file itself.3490% Change them to control the appearance of the index.34913492\def\initial#1{{%3493% Some minor font changes for the special characters.3494\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt3495%3496% Remove any glue we may have, we'll be inserting our own.3497\removelastskip3498%3499% We like breaks before the index initials, so insert a bonus.3500\penalty -3003501%3502% Typeset the initial. Making this add up to a whole number of3503% baselineskips increases the chance of the dots lining up from column3504% to column. It still won't often be perfect, because of the stretch3505% we need before each entry, but it's better.3506%3507% No shrink because it confuses \balancecolumns.3508\vskip 1.67\baselineskip plus .5\baselineskip3509\leftline{\secbf #1}%3510\vskip .33\baselineskip plus .1\baselineskip3511%3512% Do our best not to break after the initial.3513\nobreak3514}}35153516% \entry typesets a paragraph consisting of the text (#1), dot leaders, and3517% then page number (#2) flushed to the right margin. It is used for index3518% and table of contents entries. The paragraph is indented by \leftskip.3519%3520% A straightforward implementation would start like this:3521% \def\entry#1#2{...3522% But this frozes the catcodes in the argument, and can cause problems to3523% @code, which sets - active. This problem was fixed by a kludge---3524% ``-'' was active throughout whole index, but this isn't really right.3525%3526% The right solution is to prevent \entry from swallowing the whole text.3527% --kasal, 21nov033528\def\entry{%3529\begingroup3530%3531% Start a new paragraph if necessary, so our assignments below can't3532% affect previous text.3533\par3534%3535% Do not fill out the last line with white space.3536\parfillskip = 0in3537%3538% No extra space above this paragraph.3539\parskip = 0in3540%3541% Do not prefer a separate line ending with a hyphen to fewer lines.3542\finalhyphendemerits = 03543%3544% \hangindent is only relevant when the entry text and page number3545% don't both fit on one line. In that case, bob suggests starting the3546% dots pretty far over on the line. Unfortunately, a large3547% indentation looks wrong when the entry text itself is broken across3548% lines. So we use a small indentation and put up with long leaders.3549%3550% \hangafter is reset to 1 (which is the value we want) at the start3551% of each paragraph, so we need not do anything with that.3552\hangindent = 2em3553%3554% When the entry text needs to be broken, just fill out the first line3555% with blank space.3556\rightskip = 0pt plus1fil3557%3558% A bit of stretch before each entry for the benefit of balancing3559% columns.3560\vskip 0pt plus1pt3561%3562% Swallow the left brace of the text (first parameter):3563\afterassignment\doentry3564\let\temp =3565}3566\def\doentry{%3567\bgroup % Instead of the swallowed brace.3568\noindent3569\aftergroup\finishentry3570% And now comes the text of the entry.3571}3572\def\finishentry#1{%3573% #1 is the page number.3574%3575% The following is kludged to not output a line of dots in the index if3576% there are no page numbers. The next person who breaks this will be3577% cursed by a Unix daemon.3578\def\tempa{{\rm }}%3579\def\tempb{#1}%3580\edef\tempc{\tempa}%3581\edef\tempd{\tempb}%3582\ifx\tempc\tempd3583\ %3584\else3585%3586% If we must, put the page number on a line of its own, and fill out3587% this line with blank space. (The \hfil is overwhelmed with the3588% fill leaders glue in \indexdotfill if the page number does fit.)3589\hfil\penalty503590\null\nobreak\indexdotfill % Have leaders before the page number.3591%3592% The `\ ' here is removed by the implicit \unskip that TeX does as3593% part of (the primitive) \par. Without it, a spurious underfull3594% \hbox ensues.3595\ifpdf3596\pdfgettoks#1.%3597\ \the\toksA3598\else3599\ #1%3600\fi3601\fi3602\par3603\endgroup3604}36053606% Like \dotfill except takes at least 1 em.3607\def\indexdotfill{\cleaders3608\hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}36093610\def\primary #1{\line{#1\hfil}}36113612\newskip\secondaryindent \secondaryindent=0.5cm3613\def\secondary#1#2{{%3614\parfillskip=0in3615\parskip=0in3616\hangindent=1in3617\hangafter=13618\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill3619\ifpdf3620\pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.3621\else3622#23623\fi3624\par3625}}36263627% Define two-column mode, which we use to typeset indexes.3628% Adapted from the TeXbook, page 416, which is to say,3629% the manmac.tex format used to print the TeXbook itself.3630\catcode`\@=1136313632\newbox\partialpage3633\newdimen\doublecolumnhsize36343635\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns3636% Grab any single-column material above us.3637\output = {%3638%3639% Here is a possibility not foreseen in manmac: if we accumulate a3640% whole lot of material, we might end up calling this \output3641% routine twice in a row (see the doublecol-lose test, which is3642% essentially a couple of indexes with @setchapternewpage off). In3643% that case we just ship out what is in \partialpage with the normal3644% output routine. Generally, \partialpage will be empty when this3645% runs and this will be a no-op. See the indexspread.tex test case.3646\ifvoid\partialpage \else3647\onepageout{\pagecontents\partialpage}%3648\fi3649%3650\global\setbox\partialpage = \vbox{%3651% Unvbox the main output page.3652\unvbox\PAGE3653\kern-\topskip \kern\baselineskip3654}%3655}%3656\eject % run that output routine to set \partialpage3657%3658% Use the double-column output routine for subsequent pages.3659\output = {\doublecolumnout}%3660%3661% Change the page size parameters. We could do this once outside this3662% routine, in each of @smallbook, @afourpaper, and the default 8.5x113663% format, but then we repeat the same computation. Repeating a couple3664% of assignments once per index is clearly meaningless for the3665% execution time, so we may as well do it in one place.3666%3667% First we halve the line length, less a little for the gutter between3668% the columns. We compute the gutter based on the line length, so it3669% changes automatically with the paper format. The magic constant3670% below is chosen so that the gutter has the same value (well, +-<1pt)3671% as it did when we hard-coded it.3672%3673% We put the result in a separate register, \doublecolumhsize, so we3674% can restore it in \pagesofar, after \hsize itself has (potentially)3675% been clobbered.3676%3677\doublecolumnhsize = \hsize3678\advance\doublecolumnhsize by -.04154\hsize3679\divide\doublecolumnhsize by 23680\hsize = \doublecolumnhsize3681%3682% Double the \vsize as well. (We don't need a separate register here,3683% since nobody clobbers \vsize.)3684\vsize = 2\vsize3685}36863687% The double-column output routine for all double-column pages except3688% the last.3689%3690\def\doublecolumnout{%3691\splittopskip=\topskip \splitmaxdepth=\maxdepth3692% Get the available space for the double columns -- the normal3693% (undoubled) page height minus any material left over from the3694% previous page.3695\dimen@ = \vsize3696\divide\dimen@ by 23697\advance\dimen@ by -\ht\partialpage3698%3699% box0 will be the left-hand column, box2 the right.3700\setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@3701\onepageout\pagesofar3702\unvbox2553703\penalty\outputpenalty3704}3705%3706% Re-output the contents of the output page -- any previous material,3707% followed by the two boxes we just split, in box0 and box2.3708\def\pagesofar{%3709\unvbox\partialpage3710%3711\hsize = \doublecolumnhsize3712\wd0=\hsize \wd2=\hsize3713\hbox to\pagewidth{\box0\hfil\box2}%3714}3715%3716% All done with double columns.3717\def\enddoublecolumns{%3718\output = {%3719% Split the last of the double-column material. Leave it on the3720% current page, no automatic page break.3721\balancecolumns3722%3723% If we end up splitting too much material for the current page,3724% though, there will be another page break right after this \output3725% invocation ends. Having called \balancecolumns once, we do not3726% want to call it again. Therefore, reset \output to its normal3727% definition right away. (We hope \balancecolumns will never be3728% called on to balance too much material, but if it is, this makes3729% the output somewhat more palatable.)3730\global\output = {\onepageout{\pagecontents\PAGE}}%3731}%3732\eject3733\endgroup % started in \begindoublecolumns3734%3735% \pagegoal was set to the doubled \vsize above, since we restarted3736% the current page. We're now back to normal single-column3737% typesetting, so reset \pagegoal to the normal \vsize (after the3738% \endgroup where \vsize got restored).3739\pagegoal = \vsize3740}3741%3742% Called at the end of the double column material.3743\def\balancecolumns{%3744\setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.3745\dimen@ = \ht03746\advance\dimen@ by \topskip3747\advance\dimen@ by-\baselineskip3748\divide\dimen@ by 2 % target to split to3749%debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%3750\splittopskip = \topskip3751% Loop until we get a decent breakpoint.3752{%3753\vbadness = 100003754\loop3755\global\setbox3 = \copy03756\global\setbox1 = \vsplit3 to \dimen@3757\ifdim\ht3>\dimen@3758\global\advance\dimen@ by 1pt3759\repeat3760}%3761%debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%3762\setbox0=\vbox to\dimen@{\unvbox1}%3763\setbox2=\vbox to\dimen@{\unvbox3}%3764%3765\pagesofar3766}3767\catcode`\@ = \other376837693770\message{sectioning,}3771% Chapters, sections, etc.37723773% \unnumberedno is an oxymoron, of course. But we count the unnumbered3774% sections so that we can refer to them unambiguously in the pdf3775% outlines by their "section number". We avoid collisions with chapter3776% numbers by starting them at 10000. (If a document ever has 100003777% chapters, we're in trouble anyway, I'm sure.)3778\newcount\unnumberedno \unnumberedno = 100003779\newcount\chapno3780\newcount\secno \secno=03781\newcount\subsecno \subsecno=03782\newcount\subsubsecno \subsubsecno=037833784% This counter is funny since it counts through charcodes of letters A, B, ...3785\newcount\appendixno \appendixno = `\@3786%3787% \def\appendixletter{\char\the\appendixno}3788% We do the following ugly conditional instead of the above simple3789% construct for the sake of pdftex, which needs the actual3790% letter in the expansion, not just typeset.3791%3792\def\appendixletter{%3793\ifnum\appendixno=`A A%3794\else\ifnum\appendixno=`B B%3795\else\ifnum\appendixno=`C C%3796\else\ifnum\appendixno=`D D%3797\else\ifnum\appendixno=`E E%3798\else\ifnum\appendixno=`F F%3799\else\ifnum\appendixno=`G G%3800\else\ifnum\appendixno=`H H%3801\else\ifnum\appendixno=`I I%3802\else\ifnum\appendixno=`J J%3803\else\ifnum\appendixno=`K K%3804\else\ifnum\appendixno=`L L%3805\else\ifnum\appendixno=`M M%3806\else\ifnum\appendixno=`N N%3807\else\ifnum\appendixno=`O O%3808\else\ifnum\appendixno=`P P%3809\else\ifnum\appendixno=`Q Q%3810\else\ifnum\appendixno=`R R%3811\else\ifnum\appendixno=`S S%3812\else\ifnum\appendixno=`T T%3813\else\ifnum\appendixno=`U U%3814\else\ifnum\appendixno=`V V%3815\else\ifnum\appendixno=`W W%3816\else\ifnum\appendixno=`X X%3817\else\ifnum\appendixno=`Y Y%3818\else\ifnum\appendixno=`Z Z%3819% The \the is necessary, despite appearances, because \appendixletter is3820% expanded while writing the .toc file. \char\appendixno is not3821% expandable, thus it is written literally, thus all appendixes come out3822% with the same letter (or @) in the toc without it.3823\else\char\the\appendixno3824\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi3825\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}38263827% Each @chapter defines this as the name of the chapter.3828% page headings and footings can use it. @section does likewise.3829% However, they are not reliable, because we don't use marks.3830\def\thischapter{}3831\def\thissection{}38323833\newcount\absseclevel % used to calculate proper heading level3834\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count38353836% @raisesections: treat @section as chapter, @subsection as section, etc.3837\def\raisesections{\global\advance\secbase by -1}3838\let\up=\raisesections % original BFox name38393840% @lowersections: treat @chapter as section, @section as subsection, etc.3841\def\lowersections{\global\advance\secbase by 1}3842\let\down=\lowersections % original BFox name38433844% we only have subsub.3845\chardef\maxseclevel = 33846%3847% A numbered section within an unnumbered changes to unnumbered too.3848% To achive this, remember the "biggest" unnum. sec. we are currently in:3849\chardef\unmlevel = \maxseclevel3850%3851% Trace whether the current chapter is an appendix or not:3852% \chapheadtype is "N" or "A", unnumbered chapters are ignored.3853\def\chapheadtype{N}38543855% Choose a heading macro3856% #1 is heading type3857% #2 is heading level3858% #3 is text for heading3859\def\genhead#1#2#3{%3860% Compute the abs. sec. level:3861\absseclevel=#23862\advance\absseclevel by \secbase3863% Make sure \absseclevel doesn't fall outside the range:3864\ifnum \absseclevel < 03865\absseclevel = 03866\else3867\ifnum \absseclevel > 33868\absseclevel = 33869\fi3870\fi3871% The heading type:3872\def\headtype{#1}%3873\if \headtype U%3874\ifnum \absseclevel < \unmlevel3875\chardef\unmlevel = \absseclevel3876\fi3877\else3878% Check for appendix sections:3879\ifnum \absseclevel = 03880\edef\chapheadtype{\headtype}%3881\else3882\if \headtype A\if \chapheadtype N%3883\errmessage{@appendix... within a non-appendix chapter}%3884\fi\fi3885\fi3886% Check for numbered within unnumbered:3887\ifnum \absseclevel > \unmlevel3888\def\headtype{U}%3889\else3890\chardef\unmlevel = 33891\fi3892\fi3893% Now print the heading:3894\if \headtype U%3895\ifcase\absseclevel3896\unnumberedzzz{#3}%3897\or \unnumberedseczzz{#3}%3898\or \unnumberedsubseczzz{#3}%3899\or \unnumberedsubsubseczzz{#3}%3900\fi3901\else3902\if \headtype A%3903\ifcase\absseclevel3904\appendixzzz{#3}%3905\or \appendixsectionzzz{#3}%3906\or \appendixsubseczzz{#3}%3907\or \appendixsubsubseczzz{#3}%3908\fi3909\else3910\ifcase\absseclevel3911\chapterzzz{#3}%3912\or \seczzz{#3}%3913\or \numberedsubseczzz{#3}%3914\or \numberedsubsubseczzz{#3}%3915\fi3916\fi3917\fi3918\suppressfirstparagraphindent3919}39203921% an interface:3922\def\numhead{\genhead N}3923\def\apphead{\genhead A}3924\def\unnmhead{\genhead U}39253926% @chapter, @appendix, @unnumbered. Increment top-level counter, reset3927% all lower-level sectioning counters to zero.3928%3929% Also set \chaplevelprefix, which we prepend to @float sequence numbers3930% (e.g., figures), q.v. By default (before any chapter), that is empty.3931\let\chaplevelprefix = \empty3932%3933\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz3934\def\chapterzzz#1{%3935% section resetting is \global in case the chapter is in a group, such3936% as an @include file.3937\global\secno=0 \global\subsecno=0 \global\subsubsecno=03938\global\advance\chapno by 13939%3940% Used for \float.3941\gdef\chaplevelprefix{\the\chapno.}%3942\resetallfloatnos3943%3944\message{\putwordChapter\space \the\chapno}%3945%3946% Write the actual heading.3947\chapmacro{#1}{Ynumbered}{\the\chapno}%3948%3949% So @section and the like are numbered underneath this chapter.3950\global\let\section = \numberedsec3951\global\let\subsection = \numberedsubsec3952\global\let\subsubsection = \numberedsubsubsec3953}39543955\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz3956\def\appendixzzz#1{%3957\global\secno=0 \global\subsecno=0 \global\subsubsecno=03958\global\advance\appendixno by 13959\gdef\chaplevelprefix{\appendixletter.}%3960\resetallfloatnos3961%3962\def\appendixnum{\putwordAppendix\space \appendixletter}%3963\message{\appendixnum}%3964%3965\chapmacro{#1}{Yappendix}{\appendixletter}%3966%3967\global\let\section = \appendixsec3968\global\let\subsection = \appendixsubsec3969\global\let\subsubsection = \appendixsubsubsec3970}39713972\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz3973\def\unnumberedzzz#1{%3974\global\secno=0 \global\subsecno=0 \global\subsubsecno=03975\global\advance\unnumberedno by 13976%3977% Since an unnumbered has no number, no prefix for figures.3978\global\let\chaplevelprefix = \empty3979\resetallfloatnos3980%3981% This used to be simply \message{#1}, but TeX fully expands the3982% argument to \message. Therefore, if #1 contained @-commands, TeX3983% expanded them. For example, in `@unnumbered The @cite{Book}', TeX3984% expanded @cite (which turns out to cause errors because \cite is meant3985% to be executed, not expanded).3986%3987% Anyway, we don't want the fully-expanded definition of @cite to appear3988% as a result of the \message, we just want `@cite' itself. We use3989% \the<toks register> to achieve this: TeX expands \the<toks> only once,3990% simply yielding the contents of <toks register>. (We also do this for3991% the toc entries.)3992\toks0 = {#1}%3993\message{(\the\toks0)}%3994%3995\chapmacro{#1}{Ynothing}{\the\unnumberedno}%3996%3997\global\let\section = \unnumberedsec3998\global\let\subsection = \unnumberedsubsec3999\global\let\subsubsection = \unnumberedsubsubsec4000}40014002% @centerchap is like @unnumbered, but the heading is centered.4003\outer\parseargdef\centerchap{%4004% Well, we could do the following in a group, but that would break4005% an assumption that \chapmacro is called at the outermost level.4006% Thus we are safer this way: --kasal, 24feb044007\let\centerparametersmaybe = \centerparameters4008\unnmhead0{#1}%4009\let\centerparametersmaybe = \relax4010}40114012% @top is like @unnumbered.4013\let\top\unnumbered40144015% Sections.4016\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz4017\def\seczzz#1{%4018\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 14019\sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%4020}40214022\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz4023\def\appendixsectionzzz#1{%4024\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 14025\sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%4026}4027\let\appendixsec\appendixsection40284029\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz4030\def\unnumberedseczzz#1{%4031\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 14032\sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%4033}40344035% Subsections.4036\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz4037\def\numberedsubseczzz#1{%4038\global\subsubsecno=0 \global\advance\subsecno by 14039\sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%4040}40414042\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz4043\def\appendixsubseczzz#1{%4044\global\subsubsecno=0 \global\advance\subsecno by 14045\sectionheading{#1}{subsec}{Yappendix}%4046{\appendixletter.\the\secno.\the\subsecno}%4047}40484049\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz4050\def\unnumberedsubseczzz#1{%4051\global\subsubsecno=0 \global\advance\subsecno by 14052\sectionheading{#1}{subsec}{Ynothing}%4053{\the\unnumberedno.\the\secno.\the\subsecno}%4054}40554056% Subsubsections.4057\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz4058\def\numberedsubsubseczzz#1{%4059\global\advance\subsubsecno by 14060\sectionheading{#1}{subsubsec}{Ynumbered}%4061{\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%4062}40634064\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz4065\def\appendixsubsubseczzz#1{%4066\global\advance\subsubsecno by 14067\sectionheading{#1}{subsubsec}{Yappendix}%4068{\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%4069}40704071\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz4072\def\unnumberedsubsubseczzz#1{%4073\global\advance\subsubsecno by 14074\sectionheading{#1}{subsubsec}{Ynothing}%4075{\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%4076}40774078% These macros control what the section commands do, according4079% to what kind of chapter we are in (ordinary, appendix, or unnumbered).4080% Define them by default for a numbered chapter.4081\let\section = \numberedsec4082\let\subsection = \numberedsubsec4083\let\subsubsection = \numberedsubsubsec40844085% Define @majorheading, @heading and @subheading40864087% NOTE on use of \vbox for chapter headings, section headings, and such:4088% 1) We use \vbox rather than the earlier \line to permit4089% overlong headings to fold.4090% 2) \hyphenpenalty is set to 10000 because hyphenation in a4091% heading is obnoxious; this forbids it.4092% 3) Likewise, headings look best if no \parindent is used, and4093% if justification is not attempted. Hence \raggedright.409440954096\def\majorheading{%4097{\advance\chapheadingskip by 10pt \chapbreak }%4098\parsearg\chapheadingzzz4099}41004101\def\chapheading{\chapbreak \parsearg\chapheadingzzz}4102\def\chapheadingzzz#1{%4103{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=50004104\parindent=0pt\raggedright4105\rm #1\hfill}}%4106\bigskip \par\penalty 200\relax4107\suppressfirstparagraphindent4108}41094110% @heading, @subheading, @subsubheading.4111\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}4112\suppressfirstparagraphindent}4113\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}4114\suppressfirstparagraphindent}4115\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}4116\suppressfirstparagraphindent}41174118% These macros generate a chapter, section, etc. heading only4119% (including whitespace, linebreaking, etc. around it),4120% given all the information in convenient, parsed form.41214122%%% Args are the skip and penalty (usually negative)4123\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}41244125%%% Define plain chapter starts, and page on/off switching for it4126% Parameter controlling skip before chapter headings (if needed)41274128\newskip\chapheadingskip41294130\def\chapbreak{\dobreak \chapheadingskip {-4000}}4131\def\chappager{\par\vfill\supereject}4132\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}41334134\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}41354136\def\CHAPPAGoff{%4137\global\let\contentsalignmacro = \chappager4138\global\let\pchapsepmacro=\chapbreak4139\global\let\pagealignmacro=\chappager}41404141\def\CHAPPAGon{%4142\global\let\contentsalignmacro = \chappager4143\global\let\pchapsepmacro=\chappager4144\global\let\pagealignmacro=\chappager4145\global\def\HEADINGSon{\HEADINGSsingle}}41464147\def\CHAPPAGodd{%4148\global\let\contentsalignmacro = \chapoddpage4149\global\let\pchapsepmacro=\chapoddpage4150\global\let\pagealignmacro=\chapoddpage4151\global\def\HEADINGSon{\HEADINGSdouble}}41524153\CHAPPAGon41544155% Chapter opening.4156%4157% #1 is the text, #2 is the section type (Ynumbered, Ynothing,4158% Yappendix, Yomitfromtoc), #3 the chapter number.4159%4160% To test against our argument.4161\def\Ynothingkeyword{Ynothing}4162\def\Yomitfromtockeyword{Yomitfromtoc}4163\def\Yappendixkeyword{Yappendix}4164%4165\def\chapmacro#1#2#3{%4166\pchapsepmacro4167{%4168\chapfonts \rm4169%4170% Have to define \thissection before calling \donoderef, because the4171% xref code eventually uses it. On the other hand, it has to be called4172% after \pchapsepmacro, or the headline will change too soon.4173\gdef\thissection{#1}%4174\gdef\thischaptername{#1}%4175%4176% Only insert the separating space if we have a chapter/appendix4177% number, and don't print the unnumbered ``number''.4178\def\temptype{#2}%4179\ifx\temptype\Ynothingkeyword4180\setbox0 = \hbox{}%4181\def\toctype{unnchap}%4182\def\thischapter{#1}%4183\else\ifx\temptype\Yomitfromtockeyword4184\setbox0 = \hbox{}% contents like unnumbered, but no toc entry4185\def\toctype{omit}%4186\xdef\thischapter{}%4187\else\ifx\temptype\Yappendixkeyword4188\setbox0 = \hbox{\putwordAppendix{} #3\enspace}%4189\def\toctype{app}%4190% We don't substitute the actual chapter name into \thischapter4191% because we don't want its macros evaluated now. And we don't4192% use \thissection because that changes with each section.4193%4194\xdef\thischapter{\putwordAppendix{} \appendixletter:4195\noexpand\thischaptername}%4196\else4197\setbox0 = \hbox{#3\enspace}%4198\def\toctype{numchap}%4199\xdef\thischapter{\putwordChapter{} \the\chapno:4200\noexpand\thischaptername}%4201\fi\fi\fi4202%4203% Write the toc entry for this chapter. Must come before the4204% \donoderef, because we include the current node name in the toc4205% entry, and \donoderef resets it to empty.4206\writetocentry{\toctype}{#1}{#3}%4207%4208% For pdftex, we have to write out the node definition (aka, make4209% the pdfdest) after any page break, but before the actual text has4210% been typeset. If the destination for the pdf outline is after the4211% text, then jumping from the outline may wind up with the text not4212% being visible, for instance under high magnification.4213\donoderef{#2}%4214%4215% Typeset the actual heading.4216\vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright4217\hangindent=\wd0 \centerparametersmaybe4218\unhbox0 #1\par}%4219}%4220\nobreak\bigskip % no page break after a chapter title4221\nobreak4222}42234224% @centerchap -- centered and unnumbered.4225\let\centerparametersmaybe = \relax4226\def\centerparameters{%4227\advance\rightskip by 3\rightskip4228\leftskip = \rightskip4229\parfillskip = 0pt4230}423142324233% I don't think this chapter style is supported any more, so I'm not4234% updating it with the new noderef stuff. We'll see. --karl, 11aug03.4235%4236\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}4237%4238\def\unnchfopen #1{%4239\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=50004240\parindent=0pt\raggedright4241\rm #1\hfill}}\bigskip \par\nobreak4242}4243\def\chfopen #1#2{\chapoddpage {\chapfonts4244\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%4245\par\penalty 5000 %4246}4247\def\centerchfopen #1{%4248\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=50004249\parindent=0pt4250\hfill {\rm #1}\hfill}}\bigskip \par\nobreak4251}4252\def\CHAPFopen{%4253\global\let\chapmacro=\chfopen4254\global\let\centerchapmacro=\centerchfopen}425542564257% Section titles. These macros combine the section number parts and4258% call the generic \sectionheading to do the printing.4259%4260\newskip\secheadingskip4261\def\secheadingbreak{\dobreak \secheadingskip{-1000}}42624263% Subsection titles.4264\newskip\subsecheadingskip4265\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}42664267% Subsubsection titles.4268\def\subsubsecheadingskip{\subsecheadingskip}4269\def\subsubsecheadingbreak{\subsecheadingbreak}427042714272% Print any size, any type, section title.4273%4274% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is4275% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the4276% section number.4277%4278\def\sectionheading#1#2#3#4{%4279{%4280% Switch to the right set of fonts.4281\csname #2fonts\endcsname \rm4282%4283% Insert space above the heading.4284\csname #2headingbreak\endcsname4285%4286% Only insert the space after the number if we have a section number.4287\def\sectionlevel{#2}%4288\def\temptype{#3}%4289%4290\ifx\temptype\Ynothingkeyword4291\setbox0 = \hbox{}%4292\def\toctype{unn}%4293\gdef\thissection{#1}%4294\else\ifx\temptype\Yomitfromtockeyword4295% for @headings -- no section number, don't include in toc,4296% and don't redefine \thissection.4297\setbox0 = \hbox{}%4298\def\toctype{omit}%4299\let\sectionlevel=\empty4300\else\ifx\temptype\Yappendixkeyword4301\setbox0 = \hbox{#4\enspace}%4302\def\toctype{app}%4303\gdef\thissection{#1}%4304\else4305\setbox0 = \hbox{#4\enspace}%4306\def\toctype{num}%4307\gdef\thissection{#1}%4308\fi\fi\fi4309%4310% Write the toc entry (before \donoderef). See comments in \chfplain.4311\writetocentry{\toctype\sectionlevel}{#1}{#4}%4312%4313% Write the node reference (= pdf destination for pdftex).4314% Again, see comments in \chfplain.4315\donoderef{#3}%4316%4317% Output the actual section heading.4318\vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright4319\hangindent=\wd0 % zero if no section number4320\unhbox0 #1}%4321}%4322% Add extra space after the heading -- half of whatever came above it.4323% Don't allow stretch, though.4324\kern .5 \csname #2headingskip\endcsname4325%4326% Do not let the kern be a potential breakpoint, as it would be if it4327% was followed by glue.4328\nobreak4329%4330% We'll almost certainly start a paragraph next, so don't let that4331% glue accumulate. (Not a breakpoint because it's preceded by a4332% discardable item.)4333\vskip-\parskip4334%4335% This \nobreak is purely so the last item on the list is a \penalty4336% of 10000. This is so other code, for instance \parsebodycommon, can4337% check for and avoid allowing breakpoints. Otherwise, it would4338% insert a valid breakpoint between:4339% @section sec-whatever4340% @deffn def-whatever4341\nobreak4342}434343444345\message{toc,}4346% Table of contents.4347\newwrite\tocfile43484349% Write an entry to the toc file, opening it if necessary.4350% Called from @chapter, etc.4351%4352% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}4353% We append the current node name (if any) and page number as additional4354% arguments for the \{chap,sec,...}entry macros which will eventually4355% read this. The node name is used in the pdf outlines as the4356% destination to jump to.4357%4358% We open the .toc file for writing here instead of at @setfilename (or4359% any other fixed time) so that @contents can be anywhere in the document.4360% But if #1 is `omit', then we don't do anything. This is used for the4361% table of contents chapter openings themselves.4362%4363\newif\iftocfileopened4364\def\omitkeyword{omit}%4365%4366\def\writetocentry#1#2#3{%4367\edef\writetoctype{#1}%4368\ifx\writetoctype\omitkeyword \else4369\iftocfileopened\else4370\immediate\openout\tocfile = \jobname.toc4371\global\tocfileopenedtrue4372\fi4373%4374\iflinks4375\toks0 = {#2}%4376\toks2 = \expandafter{\lastnode}%4377\edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}{#3}%4378{\the\toks2}{\noexpand\folio}}}%4379\temp4380\fi4381\fi4382%4383% Tell \shipout to create a pdf destination on each page, if we're4384% writing pdf. These are used in the table of contents. We can't4385% just write one on every page because the title pages are numbered4386% 1 and 2 (the page numbers aren't printed), and so are the first4387% two pages of the document. Thus, we'd have two destinations named4388% `1', and two named `2'.4389\ifpdf \global\pdfmakepagedesttrue \fi4390}43914392\newskip\contentsrightmargin \contentsrightmargin=1in4393\newcount\savepageno4394\newcount\lastnegativepageno \lastnegativepageno = -143954396% Prepare to read what we've written to \tocfile.4397%4398\def\startcontents#1{%4399% If @setchapternewpage on, and @headings double, the contents should4400% start on an odd page, unlike chapters. Thus, we maintain4401% \contentsalignmacro in parallel with \pagealignmacro.4402% From: Torbjorn Granlund <[email protected]>4403\contentsalignmacro4404\immediate\closeout\tocfile4405%4406% Don't need to put `Contents' or `Short Contents' in the headline.4407% It is abundantly clear what they are.4408\def\thischapter{}%4409\chapmacro{#1}{Yomitfromtoc}{}%4410%4411\savepageno = \pageno4412\begingroup % Set up to handle contents files properly.4413\catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=114414% We can't do this, because then an actual ^ in a section4415% title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.4416%\catcode`\^=7 % to see ^^e4 as \"a etc. [email protected]4417\raggedbottom % Worry more about breakpoints than the bottom.4418\advance\hsize by -\contentsrightmargin % Don't use the full line length.4419%4420% Roman numerals for page numbers.4421\ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi4422}442344244425% Normal (long) toc.4426\def\contents{%4427\startcontents{\putwordTOC}%4428\openin 1 \jobname.toc4429\ifeof 1 \else4430\input \jobname.toc4431\fi4432\vfill \eject4433\contentsalignmacro % in case @setchapternewpage odd is in effect4434\ifeof 1 \else4435\pdfmakeoutlines4436\fi4437\closein 14438\endgroup4439\lastnegativepageno = \pageno4440\global\pageno = \savepageno4441}44424443% And just the chapters.4444\def\summarycontents{%4445\startcontents{\putwordShortTOC}%4446%4447\let\numchapentry = \shortchapentry4448\let\appentry = \shortchapentry4449\let\unnchapentry = \shortunnchapentry4450% We want a true roman here for the page numbers.4451\secfonts4452\let\rm=\shortcontrm \let\bf=\shortcontbf4453\let\sl=\shortcontsl \let\tt=\shortconttt4454\rm4455\hyphenpenalty = 100004456\advance\baselineskip by 1pt % Open it up a little.4457\def\numsecentry##1##2##3##4{}4458\let\appsecentry = \numsecentry4459\let\unnsecentry = \numsecentry4460\let\numsubsecentry = \numsecentry4461\let\appsubsecentry = \numsecentry4462\let\unnsubsecentry = \numsecentry4463\let\numsubsubsecentry = \numsecentry4464\let\appsubsubsecentry = \numsecentry4465\let\unnsubsubsecentry = \numsecentry4466\openin 1 \jobname.toc4467\ifeof 1 \else4468\input \jobname.toc4469\fi4470\closein 14471\vfill \eject4472\contentsalignmacro % in case @setchapternewpage odd is in effect4473\endgroup4474\lastnegativepageno = \pageno4475\global\pageno = \savepageno4476}4477\let\shortcontents = \summarycontents44784479% Typeset the label for a chapter or appendix for the short contents.4480% The arg is, e.g., `A' for an appendix, or `3' for a chapter.4481%4482\def\shortchaplabel#1{%4483% This space should be enough, since a single number is .5em, and the4484% widest letter (M) is 1em, at least in the Computer Modern fonts.4485% But use \hss just in case.4486% (This space doesn't include the extra space that gets added after4487% the label; that gets put in by \shortchapentry above.)4488%4489% We'd like to right-justify chapter numbers, but that looks strange4490% with appendix letters. And right-justifying numbers and4491% left-justifying letters looks strange when there is less than 104492% chapters. Have to read the whole toc once to know how many chapters4493% there are before deciding ...4494\hbox to 1em{#1\hss}%4495}44964497% These macros generate individual entries in the table of contents.4498% The first argument is the chapter or section name.4499% The last argument is the page number.4500% The arguments in between are the chapter number, section number, ...45014502% Chapters, in the main contents.4503\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}4504%4505% Chapters, in the short toc.4506% See comments in \dochapentry re vbox and related settings.4507\def\shortchapentry#1#2#3#4{%4508\tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%4509}45104511% Appendices, in the main contents.4512% Need the word Appendix, and a fixed-size box.4513%4514\def\appendixbox#1{%4515% We use M since it's probably the widest letter.4516\setbox0 = \hbox{\putwordAppendix{} M}%4517\hbox to \wd0{\putwordAppendix{} #1\hss}}4518%4519\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}45204521% Unnumbered chapters.4522\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}4523\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}45244525% Sections.4526\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}4527\let\appsecentry=\numsecentry4528\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}45294530% Subsections.4531\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}4532\let\appsubsecentry=\numsubsecentry4533\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}45344535% And subsubsections.4536\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}4537\let\appsubsubsecentry=\numsubsubsecentry4538\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}45394540% This parameter controls the indentation of the various levels.4541% Same as \defaultparindent.4542\newdimen\tocindent \tocindent = 15pt45434544% Now for the actual typesetting. In all these, #1 is the text and #2 is the4545% page number.4546%4547% If the toc has to be broken over pages, we want it to be at chapters4548% if at all possible; hence the \penalty.4549\def\dochapentry#1#2{%4550\penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip4551\begingroup4552\chapentryfonts4553\tocentry{#1}{\dopageno\bgroup#2\egroup}%4554\endgroup4555\nobreak\vskip .25\baselineskip plus.1\baselineskip4556}45574558\def\dosecentry#1#2{\begingroup4559\secentryfonts \leftskip=\tocindent4560\tocentry{#1}{\dopageno\bgroup#2\egroup}%4561\endgroup}45624563\def\dosubsecentry#1#2{\begingroup4564\subsecentryfonts \leftskip=2\tocindent4565\tocentry{#1}{\dopageno\bgroup#2\egroup}%4566\endgroup}45674568\def\dosubsubsecentry#1#2{\begingroup4569\subsubsecentryfonts \leftskip=3\tocindent4570\tocentry{#1}{\dopageno\bgroup#2\egroup}%4571\endgroup}45724573% We use the same \entry macro as for the index entries.4574\let\tocentry = \entry45754576% Space between chapter (or whatever) number and the title.4577\def\labelspace{\hskip1em \relax}45784579\def\dopageno#1{{\rm #1}}4580\def\doshortpageno#1{{\rm #1}}45814582\def\chapentryfonts{\secfonts \rm}4583\def\secentryfonts{\textfonts}4584\def\subsecentryfonts{\textfonts}4585\def\subsubsecentryfonts{\textfonts}458645874588\message{environments,}4589% @foo ... @end foo.45904591% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.4592%4593% Since these characters are used in examples, it should be an even number of4594% \tt widths. Each \tt character is 1en, so two makes it 1em.4595%4596\def\point{$\star$}4597\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}4598\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}4599\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}4600\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}46014602% The @error{} command.4603% Adapted from the TeXbook's \boxit.4604%4605\newbox\errorbox4606%4607{\tentt \global\dimen0 = 3em}% Width of the box.4608\dimen2 = .55pt % Thickness of rules4609% The text. (`r' is open on the right, `e' somewhat less so on the left.)4610\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}4611%4612\setbox\errorbox=\hbox to \dimen0{\hfil4613\hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.4614\advance\hsize by -2\dimen2 % Rules.4615\vbox{%4616\hrule height\dimen24617\hbox{\vrule width\dimen2 \kern3pt % Space to left of text.4618\vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.4619\kern3pt\vrule width\dimen2}% Space to right.4620\hrule height\dimen2}4621\hfil}4622%4623\def\error{\leavevmode\lower.7ex\copy\errorbox}46244625% @tex ... @end tex escapes into raw Tex temporarily.4626% One exception: @ is still an escape character, so that @end tex works.4627% But \@ or @@ will get a plain tex @ character.46284629\envdef\tex{%4630\catcode `\\=0 \catcode `\{=1 \catcode `\}=24631\catcode `\$=3 \catcode `\&=4 \catcode `\#=64632\catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie4633\catcode `\%=144634\catcode `\+=\other4635\catcode `\"=\other4636\catcode `\|=\other4637\catcode `\<=\other4638\catcode `\>=\other4639\escapechar=`\\4640%4641\let\b=\ptexb4642\let\bullet=\ptexbullet4643\let\c=\ptexc4644\let\,=\ptexcomma4645\let\.=\ptexdot4646\let\dots=\ptexdots4647\let\equiv=\ptexequiv4648\let\!=\ptexexclam4649\let\i=\ptexi4650\let\indent=\ptexindent4651\let\noindent=\ptexnoindent4652\let\{=\ptexlbrace4653\let\+=\tabalign4654\let\}=\ptexrbrace4655\let\/=\ptexslash4656\let\*=\ptexstar4657\let\t=\ptext4658%4659\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%4660\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%4661\def\@{@}%4662}4663% There is no need to define \Etex.46644665% Define @lisp ... @end lisp.4666% @lisp environment forms a group so it can rebind things,4667% including the definition of @end lisp (which normally is erroneous).46684669% Amount to narrow the margins by for @lisp.4670\newskip\lispnarrowing \lispnarrowing=0.4in46714672% This is the definition that ^^M gets inside @lisp, @example, and other4673% such environments. \null is better than a space, since it doesn't4674% have any width.4675\def\lisppar{\null\endgraf}46764677% This space is always present above and below environments.4678\newskip\envskipamount \envskipamount = 0pt46794680% Make spacing and below environment symmetrical. We use \parskip here4681% to help in doing that, since in @example-like environments \parskip4682% is reset to zero; thus the \afterenvbreak inserts no space -- but the4683% start of the next paragraph will insert \parskip.4684%4685\def\aboveenvbreak{{%4686% =10000 instead of <10000 because of a special case in \itemzzz, q.v.4687\ifnum \lastpenalty=10000 \else4688\advance\envskipamount by \parskip4689\endgraf4690\ifdim\lastskip<\envskipamount4691\removelastskip4692% it's not a good place to break if the last penalty was \nobreak4693% or better ...4694\ifnum\lastpenalty<10000 \penalty-50 \fi4695\vskip\envskipamount4696\fi4697\fi4698}}46994700\let\afterenvbreak = \aboveenvbreak47014702% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.4703\let\nonarrowing=\relax47044705% @cartouche ... @end cartouche: draw rectangle w/rounded corners around4706% environment contents.4707\font\circle=lcircle104708\newdimen\circthick4709\newdimen\cartouter\newdimen\cartinner4710\newskip\normbskip\newskip\normpskip\newskip\normlskip4711\circthick=\fontdimen8\circle4712%4713\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth4714\def\ctr{{\hskip 6pt\circle\char'010}}4715\def\cbl{{\circle\char'012\hskip -6pt}}4716\def\cbr{{\hskip 6pt\circle\char'011}}4717\def\carttop{\hbox to \cartouter{\hskip\lskip4718\ctl\leaders\hrule height\circthick\hfil\ctr4719\hskip\rskip}}4720\def\cartbot{\hbox to \cartouter{\hskip\lskip4721\cbl\leaders\hrule height\circthick\hfil\cbr4722\hskip\rskip}}4723%4724\newskip\lskip\newskip\rskip47254726\envdef\cartouche{%4727\ifhmode\par\fi % can't be in the midst of a paragraph.4728\startsavinginserts4729\lskip=\leftskip \rskip=\rightskip4730\leftskip=0pt\rightskip=0pt % we want these *outside*.4731\cartinner=\hsize \advance\cartinner by-\lskip4732\advance\cartinner by-\rskip4733\cartouter=\hsize4734\advance\cartouter by 18.4pt % allow for 3pt kerns on either4735% side, and for 6pt waste from4736% each corner char, and rule thickness4737\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip4738% Flag to tell @lisp, etc., not to narrow margin.4739\let\nonarrowing=\comment4740\vbox\bgroup4741\baselineskip=0pt\parskip=0pt\lineskip=0pt4742\carttop4743\hbox\bgroup4744\hskip\lskip4745\vrule\kern3pt4746\vbox\bgroup4747\kern3pt4748\hsize=\cartinner4749\baselineskip=\normbskip4750\lineskip=\normlskip4751\parskip=\normpskip4752\vskip -\parskip4753\comment % For explanation, see the end of \def\group.4754}4755\def\Ecartouche{%4756\ifhmode\par\fi4757\kern3pt4758\egroup4759\kern3pt\vrule4760\hskip\rskip4761\egroup4762\cartbot4763\egroup4764\checkinserts4765}476647674768% This macro is called at the beginning of all the @example variants,4769% inside a group.4770\def\nonfillstart{%4771\aboveenvbreak4772\hfuzz = 12pt % Don't be fussy4773\sepspaces % Make spaces be word-separators rather than space tokens.4774\let\par = \lisppar % don't ignore blank lines4775\obeylines % each line of input is a line of output4776\parskip = 0pt4777\parindent = 0pt4778\emergencystretch = 0pt % don't try to avoid overfull boxes4779% @cartouche defines \nonarrowing to inhibit narrowing4780% at next level down.4781\ifx\nonarrowing\relax4782\advance \leftskip by \lispnarrowing4783\exdentamount=\lispnarrowing4784\fi4785\let\exdent=\nofillexdent4786}47874788% If you want all examples etc. small: @set dispenvsize small.4789% If you want even small examples the full size: @set dispenvsize nosmall.4790% This affects the following displayed environments:4791% @example, @display, @format, @lisp4792%4793\def\smallword{small}4794\def\nosmallword{nosmall}4795\let\SETdispenvsize\relax4796\def\setnormaldispenv{%4797\ifx\SETdispenvsize\smallword4798\smallexamplefonts \rm4799\fi4800}4801\def\setsmalldispenv{%4802\ifx\SETdispenvsize\nosmallword4803\else4804\smallexamplefonts \rm4805\fi4806}48074808% We often define two environments, @foo and @smallfoo.4809% Let's do it by one command:4810\def\makedispenv #1#2{4811\expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}4812\expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}4813\expandafter\let\csname E#1\endcsname \afterenvbreak4814\expandafter\let\csname Esmall#1\endcsname \afterenvbreak4815}48164817% Define two synonyms:4818\def\maketwodispenvs #1#2#3{4819\makedispenv{#1}{#3}4820\makedispenv{#2}{#3}4821}48224823% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.4824%4825% @smallexample and @smalllisp: use smaller fonts.4826% Originally contributed by Pavel@xerox.4827%4828\maketwodispenvs {lisp}{example}{%4829\nonfillstart4830\tt4831\let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.4832\gobble % eat return4833}48344835% @display/@smalldisplay: same as @lisp except keep current font.4836%4837\makedispenv {display}{%4838\nonfillstart4839\gobble4840}48414842% @format/@smallformat: same as @display except don't narrow margins.4843%4844\makedispenv{format}{%4845\let\nonarrowing = t%4846\nonfillstart4847\gobble4848}48494850% @flushleft: same as @format, but doesn't obey \SETdispenvsize.4851\envdef\flushleft{%4852\let\nonarrowing = t%4853\nonfillstart4854\gobble4855}4856\let\Eflushleft = \afterenvbreak48574858% @flushright.4859%4860\envdef\flushright{%4861\let\nonarrowing = t%4862\nonfillstart4863\advance\leftskip by 0pt plus 1fill4864\gobble4865}4866\let\Eflushright = \afterenvbreak486748684869% @quotation does normal linebreaking (hence we can't use \nonfillstart)4870% and narrows the margins. We keep \parskip nonzero in general, since4871% we're doing normal filling. So, when using \aboveenvbreak and4872% \afterenvbreak, temporarily make \parskip 0.4873%4874\envdef\quotation{%4875{\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip4876\parindent=0pt4877%4878% @cartouche defines \nonarrowing to inhibit narrowing at next level down.4879\ifx\nonarrowing\relax4880\advance\leftskip by \lispnarrowing4881\advance\rightskip by \lispnarrowing4882\exdentamount = \lispnarrowing4883\let\nonarrowing = \relax4884\fi4885\parsearg\quotationlabel4886}48874888% We have retained a nonzero parskip for the environment, since we're4889% doing normal filling.4890%4891\def\Equotation{%4892\par4893\ifx\quotationauthor\undefined\else4894% indent a bit.4895\leftline{\kern 2\leftskip \sl ---\quotationauthor}%4896\fi4897{\parskip=0pt \afterenvbreak}%4898}48994900% If we're given an argument, typeset it in bold with a colon after.4901\def\quotationlabel#1{%4902\def\temp{#1}%4903\ifx\temp\empty \else4904{\bf #1: }%4905\fi4906}490749084909% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}4910% If we want to allow any <char> as delimiter,4911% we need the curly braces so that makeinfo sees the @verb command, eg:4912% `@verbx...x' would look like the '@verbx' command. [email protected]4913%4914% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.4915%4916% [Knuth] p.344; only we need to do the other characters Texinfo sets4917% active too. Otherwise, they get lost as the first character on a4918% verbatim line.4919\def\dospecials{%4920\do\ \do\\\do\{\do\}\do\$\do\&%4921\do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%4922\do\<\do\>\do\|\do\@\do+\do\"%4923}4924%4925% [Knuth] p. 3804926\def\uncatcodespecials{%4927\def\do##1{\catcode`##1=\other}\dospecials}4928%4929% [Knuth] pp. 380,381,3914930% Disable Spanish ligatures ?` and !` of \tt font4931\begingroup4932\catcode`\`=\active\gdef`{\relax\lq}4933\endgroup4934%4935% Setup for the @verb command.4936%4937% Eight spaces for a tab4938\begingroup4939\catcode`\^^I=\active4940\gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}4941\endgroup4942%4943\def\setupverb{%4944\tt % easiest (and conventionally used) font for verbatim4945\def\par{\leavevmode\endgraf}%4946\catcode`\`=\active4947\tabeightspaces4948% Respect line breaks,4949% print special symbols as themselves, and4950% make each space count4951% must do in this order:4952\obeylines \uncatcodespecials \sepspaces4953}49544955% Setup for the @verbatim environment4956%4957% Real tab expansion4958\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount4959%4960\def\starttabbox{\setbox0=\hbox\bgroup}4961\begingroup4962\catcode`\^^I=\active4963\gdef\tabexpand{%4964\catcode`\^^I=\active4965\def^^I{\leavevmode\egroup4966\dimen0=\wd0 % the width so far, or since the previous tab4967\divide\dimen0 by\tabw4968\multiply\dimen0 by\tabw % compute previous multiple of \tabw4969\advance\dimen0 by\tabw % advance to next multiple of \tabw4970\wd0=\dimen0 \box0 \starttabbox4971}%4972}4973\endgroup4974\def\setupverbatim{%4975\nonfillstart4976\advance\leftskip by -\defbodyindent4977% Easiest (and conventionally used) font for verbatim4978\tt4979\def\par{\leavevmode\egroup\box0\endgraf}%4980\catcode`\`=\active4981\tabexpand4982% Respect line breaks,4983% print special symbols as themselves, and4984% make each space count4985% must do in this order:4986\obeylines \uncatcodespecials \sepspaces4987\everypar{\starttabbox}%4988}49894990% Do the @verb magic: verbatim text is quoted by unique4991% delimiter characters. Before first delimiter expect a4992% right brace, after last delimiter expect closing brace:4993%4994% \def\doverb'{'<char>#1<char>'}'{#1}4995%4996% [Knuth] p. 382; only eat outer {}4997\begingroup4998\catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other4999\gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]5000\endgroup5001%5002\def\verb{\begingroup\setupverb\doverb}5003%5004%5005% Do the @verbatim magic: define the macro \doverbatim so that5006% the (first) argument ends when '@end verbatim' is reached, ie:5007%5008% \def\doverbatim#1@end verbatim{#1}5009%5010% For Texinfo it's a lot easier than for LaTeX,5011% because texinfo's \verbatim doesn't stop at '\end{verbatim}':5012% we need not redefine '\', '{' and '}'.5013%5014% Inspired by LaTeX's verbatim command set [latex.ltx]5015%5016\begingroup5017\catcode`\ =\active5018\obeylines %5019% ignore everything up to the first ^^M, that's the newline at the end5020% of the @verbatim input line itself. Otherwise we get an extra blank5021% line in the output.5022\xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%5023% We really want {...\end verbatim} in the body of the macro, but5024% without the active space; thus we have to use \xdef and \gobble.5025\endgroup5026%5027\envdef\verbatim{%5028\setupverbatim\doverbatim5029}5030\let\Everbatim = \afterenvbreak503150325033% @verbatiminclude FILE - insert text of file in verbatim environment.5034%5035\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}5036%5037\def\doverbatiminclude#1{%5038{%5039\makevalueexpandable5040\setupverbatim5041\input #15042\afterenvbreak5043}%5044}50455046% @copying ... @end copying.5047% Save the text away for @insertcopying later. Many commands won't be5048% allowed in this context, but that's ok.5049%5050% We save the uninterpreted tokens, rather than creating a box.5051% Saving the text in a box would be much easier, but then all the5052% typesetting commands (@smallbook, font changes, etc.) have to be done5053% beforehand -- and a) we want @copying to be done first in the source5054% file; b) letting users define the frontmatter in as flexible order as5055% possible is very desirable.5056%5057\def\copying{\begingroup5058% Define a command to swallow text until we reach `@end copying'.5059% \ is the escape char in this texinfo.tex file, so it is the5060% delimiter for the command; @ will be the escape char when we read5061% it, but that doesn't matter.5062\long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}%5063%5064% We must preserve ^^M's in the input file; see \insertcopying below.5065\catcode`\^^M = \active5066\docopying5067}50685069% What we do to finish off the copying text.5070%5071\def\enddocopying{\endgroup\ignorespaces}50725073% @insertcopying. Here we must play games with ^^M's. On the one hand,5074% we need them to delimit commands such as `@end quotation', so they5075% must be active. On the other hand, we certainly don't want every5076% end-of-line to be a \par, as would happen with the normal active5077% definition of ^^M. On the third hand, two ^^M's in a row should still5078% generate a \par.5079%5080% Our approach is to make ^^M insert a space and a penalty1 normally;5081% then it can also check if \lastpenalty=1. If it does, then manually5082% do \par.5083%5084% This messes up the normal definitions of @c[omment], so we redefine5085% it. Similarly for @ignore. (These commands are used in the gcc5086% manual for man page generation.)5087%5088% Seems pretty fragile, most line-oriented commands will presumably5089% fail, but for the limited use of getting the copying text (which5090% should be quite simple) inserted, we can hope it's ok.5091%5092{\catcode`\^^M=\active %5093\gdef\insertcopying{\begingroup %5094\parindent = 0pt % looks wrong on title page5095\def^^M{%5096\ifnum \lastpenalty=1 %5097\par %5098\else %5099\space \penalty 1 %5100\fi %5101}%5102%5103% Fix @c[omment] for catcode 13 ^^M's.5104\def\c##1^^M{\ignorespaces}%5105\let\comment = \c %5106%5107% Don't bother jumping through all the hoops that \doignore does, it5108% would be very hard since the catcodes are already set.5109\long\def\ignore##1\end ignore{\ignorespaces}%5110%5111\copyingtext %5112\endgroup}%5113}51145115\message{defuns,}5116% @defun etc.51175118\newskip\defbodyindent \defbodyindent=.4in5119\newskip\defargsindent \defargsindent=50pt5120\newskip\deflastargmargin \deflastargmargin=18pt51215122% Start the processing of @deffn:5123\def\startdefun{%5124\ifnum\lastpenalty<100005125\medbreak5126\else5127% If there are two @def commands in a row, we'll have a \nobreak,5128% which is there to keep the function description together with its5129% header. But if there's nothing but headers, we need to allow a5130% break somewhere. Check for penalty 10002 (inserted by5131% \defargscommonending) instead of 10000, since the sectioning5132% commands insert a \penalty10000, and we don't want to allow a break5133% between a section heading and a defun.5134\ifnum\lastpenalty=10002 \penalty2000 \fi5135%5136% Similarly, after a section heading, do not allow a break.5137% But do insert the glue.5138\medskip % preceded by discardable penalty, so not a breakpoint5139\fi5140%5141\parindent=0in5142\advance\leftskip by \defbodyindent5143\exdentamount=\defbodyindent5144}51455146\def\dodefunx#1{%5147% First, check whether we are in the right environment:5148\checkenv#1%5149%5150% As above, allow line break if we have multiple x headers in a row.5151% It's not a great place, though.5152\ifnum\lastpenalty=10002 \penalty3000 \fi5153%5154% And now, it's time to reuse the body of the original defun:5155\expandafter\gobbledefun#1%5156}5157\def\gobbledefun#1\startdefun{}51585159% \printdefunline \deffnheader{text}5160%5161\def\printdefunline#1#2{%5162\begingroup5163% call \deffnheader:5164#1#2 \endheader5165% common ending:5166\interlinepenalty = 100005167\advance\rightskip by 0pt plus 1fil5168\endgraf5169\nobreak\vskip -\parskip5170\penalty 10002 % signal to \startdefun and \dodefunx5171% Some of the @defun-type tags do not enable magic parentheses,5172% rendering the following check redundant. But we don't optimize.5173\checkparencounts5174\endgroup5175}51765177\def\Edefun{\endgraf\medbreak}51785179% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;5180% the only thing remainnig is to define \deffnheader.5181%5182\def\makedefun#1{%5183\expandafter\let\csname E#1\endcsname = \Edefun5184\edef\temp{\noexpand\domakedefun5185\makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%5186\temp5187}51885189% \domakedefun \deffn \deffnx \deffnheader5190%5191% Define \deffn and \deffnx, without parameters.5192% \deffnheader has to be defined explicitly.5193%5194\def\domakedefun#1#2#3{%5195\envdef#1{%5196\startdefun5197\parseargusing\activeparens{\printdefunline#3}%5198}%5199\def#2{\dodefunx#1}%5200\def#3%5201}52025203%%% Untyped functions:52045205% @deffn category name args5206\makedefun{deffn}{\deffngeneral{}}52075208% @deffn category class name args5209\makedefun{defop}#1 {\defopon{#1\ \putwordon}}52105211% \defopon {category on}class name args5212\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }52135214% \deffngeneral {subind}category name args5215%5216\def\deffngeneral#1#2 #3 #4\endheader{%5217% Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.5218\dosubind{fn}{\code{#3}}{#1}%5219\defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%5220}52215222%%% Typed functions:52235224% @deftypefn category type name args5225\makedefun{deftypefn}{\deftypefngeneral{}}52265227% @deftypeop category class type name args5228\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}52295230% \deftypeopon {category on}class type name args5231\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }52325233% \deftypefngeneral {subind}category type name args5234%5235\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%5236\dosubind{fn}{\code{#4}}{#1}%5237\defname{#2}{#3}{#4}\defunargs{#5\unskip}%5238}52395240%%% Typed variables:52415242% @deftypevr category type var args5243\makedefun{deftypevr}{\deftypecvgeneral{}}52445245% @deftypecv category class type var args5246\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}52475248% \deftypecvof {category of}class type var args5249\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }52505251% \deftypecvgeneral {subind}category type var args5252%5253\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%5254\dosubind{vr}{\code{#4}}{#1}%5255\defname{#2}{#3}{#4}\defunargs{#5\unskip}%5256}52575258%%% Untyped variables:52595260% @defvr category var args5261\makedefun{defvr}#1 {\deftypevrheader{#1} {} }52625263% @defcv category class var args5264\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}52655266% \defcvof {category of}class var args5267\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }52685269%%% Type:5270% @deftp category name args5271\makedefun{deftp}#1 #2 #3\endheader{%5272\doind{tp}{\code{#2}}%5273\defname{#1}{}{#2}\defunargs{#3\unskip}%5274}52755276% Remaining @defun-like shortcuts:5277\makedefun{defun}{\deffnheader{\putwordDeffunc} }5278\makedefun{defmac}{\deffnheader{\putwordDefmac} }5279\makedefun{defspec}{\deffnheader{\putwordDefspec} }5280\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }5281\makedefun{defvar}{\defvrheader{\putwordDefvar} }5282\makedefun{defopt}{\defvrheader{\putwordDefopt} }5283\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }5284\makedefun{defmethod}{\defopon\putwordMethodon}5285\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}5286\makedefun{defivar}{\defcvof\putwordInstanceVariableof}5287\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}52885289% \defname, which formats the name of the @def (not the args).5290% #1 is the category, such as "Function".5291% #2 is the return type, if any.5292% #3 is the function name.5293%5294% We are followed by (but not passed) the arguments, if any.5295%5296\def\defname#1#2#3{%5297% Get the values of \leftskip and \rightskip as they were outside the @def...5298\advance\leftskip by -\defbodyindent5299%5300% How we'll format the type name. Putting it in brackets helps5301% distinguish it from the body text that may end up on the next line5302% just below it.5303\def\temp{#1}%5304\setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}5305%5306% Figure out line sizes for the paragraph shape.5307% The first line needs space for \box0; but if \rightskip is nonzero,5308% we need only space for the part of \box0 which exceeds it:5309\dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip5310% The continuations:5311\dimen2=\hsize \advance\dimen2 by -\defargsindent5312% (plain.tex says that \dimen1 should be used only as global.)5313\parshape 2 0in \dimen0 \defargsindent \dimen25314%5315% Put the type name to the right margin.5316\noindent5317\hbox to 0pt{%5318\hfil\box0 \kern-\hsize5319% \hsize has to be shortened this way:5320\kern\leftskip5321% Intentionally do not respect \rightskip, since we need the space.5322}%5323%5324% Allow all lines to be underfull without complaint:5325\tolerance=10000 \hbadness=100005326\exdentamount=\defbodyindent5327{%5328% defun fonts. We use typewriter by default (used to be bold) because:5329% . we're printing identifiers, they should be in tt in principle.5330% . in languages with many accents, such as Czech or French, it's5331% common to leave accents off identifiers. The result looks ok in5332% tt, but exceedingly strange in rm.5333% . we don't want -- and --- to be treated as ligatures.5334% . this still does not fix the ?` and !` ligatures, but so far no5335% one has made identifiers using them :).5336\df \tt5337\def\temp{#2}% return value type5338\ifx\temp\empty\else \tclose{\temp} \fi5339#3% output function name5340}%5341{\rm\enskip}% hskip 0.5 em of \tenrm5342%5343\boldbrax5344% arguments will be output next, if any.5345}53465347% Print arguments in slanted roman (not ttsl), inconsistently with using5348% tt for the name. This is because literal text is sometimes needed in5349% the argument list (groff manual), and ttsl and tt are not very5350% distinguishable. Prevent hyphenation at `-' chars.5351%5352\def\defunargs#1{%5353% use sl by default (not ttsl),5354% tt for the names.5355\df \sl \hyphenchar\font=05356%5357% On the other hand, if an argument has two dashes (for instance), we5358% want a way to get ttsl. Let's try @var for that.5359\let\var=\ttslanted5360#1%5361\sl\hyphenchar\font=455362}53635364% We want ()&[] to print specially on the defun line.5365%5366\def\activeparens{%5367\catcode`\(=\active \catcode`\)=\active5368\catcode`\[=\active \catcode`\]=\active5369\catcode`\&=\active5370}53715372% Make control sequences which act like normal parenthesis chars.5373\let\lparen = ( \let\rparen = )53745375% Be sure that we always have a definition for `(', etc. For example,5376% if the fn name has parens in it, \boldbrax will not be in effect yet,5377% so TeX would otherwise complain about undefined control sequence.5378{5379\activeparens5380\global\let(=\lparen \global\let)=\rparen5381\global\let[=\lbrack \global\let]=\rbrack5382\global\let& = \&53835384\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}5385\gdef\magicamp{\let&=\amprm}5386}53875388\newcount\parencount53895390% If we encounter &foo, then turn on ()-hacking afterwards5391\newif\ifampseen5392\def\amprm#1 {\ampseentrue{\bf\ }}53935394\def\parenfont{%5395\ifampseen5396% At the first level, print parens in roman,5397% otherwise use the default font.5398\ifnum \parencount=1 \rm \fi5399\else5400% The \sf parens (in \boldbrax) actually are a little bolder than5401% the contained text. This is especially needed for [ and ] .5402\sf5403\fi5404}5405\def\infirstlevel#1{%5406\ifampseen5407\ifnum\parencount=15408#1%5409\fi5410\fi5411}5412\def\bfafterword#1 {#1 \bf}54135414\def\opnr{%5415\global\advance\parencount by 15416{\parenfont(}%5417\infirstlevel \bfafterword5418}5419\def\clnr{%5420{\parenfont)}%5421\infirstlevel \sl5422\global\advance\parencount by -15423}54245425\newcount\brackcount5426\def\lbrb{%5427\global\advance\brackcount by 15428{\bf[}%5429}5430\def\rbrb{%5431{\bf]}%5432\global\advance\brackcount by -15433}54345435\def\checkparencounts{%5436\ifnum\parencount=0 \else \badparencount \fi5437\ifnum\brackcount=0 \else \badbrackcount \fi5438}5439\def\badparencount{%5440\errmessage{Unbalanced parentheses in @def}%5441\global\parencount=05442}5443\def\badbrackcount{%5444\errmessage{Unbalanced square braces in @def}%5445\global\brackcount=05446}544754485449\message{macros,}5450% @macro.54515452% To do this right we need a feature of e-TeX, \scantokens,5453% which we arrange to emulate with a temporary file in ordinary TeX.5454\ifx\eTeXversion\undefined5455\newwrite\macscribble5456\def\scantokens#1{%5457\toks0={#1\endinput}%5458\immediate\openout\macscribble=\jobname.tmp5459\immediate\write\macscribble{\the\toks0}%5460\immediate\closeout\macscribble5461\input \jobname.tmp5462}5463\fi54645465\def\scanmacro#1{%5466\begingroup5467\newlinechar`\^^M5468\let\xeatspaces\eatspaces5469% Undo catcode changes of \startcontents and \doprintindex5470\catcode`\@=0 \catcode`\\=\other \escapechar=`\@5471% ... and \example5472\spaceisspace5473%5474% Append \endinput to make sure that TeX does not see the ending newline.5475%5476% I've verified that it is necessary both for e-TeX and for ordinary TeX5477% --kasal, 29nov035478\scantokens{#1\endinput}%5479\endgroup5480}54815482\newcount\paramno % Count of parameters5483\newtoks\macname % Macro name5484\newif\ifrecursive % Is it recursive?5485\def\macrolist{} % List of all defined macros in the form5486% \do\macro1\do\macro2...54875488% Utility routines.5489% This does \let #1 = #2, except with \csnames.5490\def\cslet#1#2{%5491\expandafter\expandafter5492\expandafter\let5493\expandafter\expandafter5494\csname#1\endcsname5495\csname#2\endcsname}54965497% Trim leading and trailing spaces off a string.5498% Concepts from aro-bend problem 15 (see CTAN).5499{\catcode`\@=115500\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}5501\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}5502\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}5503\def\unbrace#1{#1}5504\unbrace{\gdef\trim@@@ #1 } #2@{#1}5505}55065507% Trim a single trailing ^^M off a string.5508{\catcode`\^^M=\other \catcode`\Q=3%5509\gdef\eatcr #1{\eatcra #1Q^^MQ}%5510\gdef\eatcra#1^^MQ{\eatcrb#1Q}%5511\gdef\eatcrb#1Q#2Q{#1}%5512}55135514% Macro bodies are absorbed as an argument in a context where5515% all characters are catcode 10, 11 or 12, except \ which is active5516% (as in normal texinfo). It is necessary to change the definition of \.55175518% It's necessary to have hard CRs when the macro is executed. This is5519% done by making ^^M (\endlinechar) catcode 12 when reading the macro5520% body, and then making it the \newlinechar in \scanmacro.55215522\def\macrobodyctxt{%5523\catcode`\~=\other5524\catcode`\^=\other5525\catcode`\_=\other5526\catcode`\|=\other5527\catcode`\<=\other5528\catcode`\>=\other5529\catcode`\+=\other5530\catcode`\{=\other5531\catcode`\}=\other5532\catcode`\@=\other5533\catcode`\^^M=\other5534\usembodybackslash}55355536\def\macroargctxt{%5537\catcode`\~=\other5538\catcode`\^=\other5539\catcode`\_=\other5540\catcode`\|=\other5541\catcode`\<=\other5542\catcode`\>=\other5543\catcode`\+=\other5544\catcode`\@=\other5545\catcode`\\=\other}55465547% \mbodybackslash is the definition of \ in @macro bodies.5548% It maps \foo\ => \csname macarg.foo\endcsname => #N5549% where N is the macro parameter number.5550% We define \csname macarg.\endcsname to be \realbackslash, so5551% \\ in macro replacement text gets you a backslash.55525553{\catcode`@=0 @catcode`@\=@active5554@gdef@usembodybackslash{@let\=@mbodybackslash}5555@gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}5556}5557\expandafter\def\csname macarg.\endcsname{\realbackslash}55585559\def\macro{\recursivefalse\parsearg\macroxxx}5560\def\rmacro{\recursivetrue\parsearg\macroxxx}55615562\def\macroxxx#1{%5563\getargs{#1}% now \macname is the macname and \argl the arglist5564\ifx\argl\empty % no arguments5565\paramno=0%5566\else5567\expandafter\parsemargdef \argl;%5568\fi5569\if1\csname ismacro.\the\macname\endcsname5570\message{Warning: redefining \the\macname}%5571\else5572\expandafter\ifx\csname \the\macname\endcsname \relax5573\else \errmessage{Macro name \the\macname\space already defined}\fi5574\global\cslet{macsave.\the\macname}{\the\macname}%5575\global\expandafter\let\csname ismacro.\the\macname\endcsname=1%5576% Add the macroname to \macrolist5577\toks0 = \expandafter{\macrolist\do}%5578\xdef\macrolist{\the\toks05579\expandafter\noexpand\csname\the\macname\endcsname}%5580\fi5581\begingroup \macrobodyctxt5582\ifrecursive \expandafter\parsermacbody5583\else \expandafter\parsemacbody5584\fi}55855586\parseargdef\unmacro{%5587\if1\csname ismacro.#1\endcsname5588\global\cslet{#1}{macsave.#1}%5589\global\expandafter\let \csname ismacro.#1\endcsname=0%5590% Remove the macro name from \macrolist:5591\begingroup5592\expandafter\let\csname#1\endcsname \relax5593\let\do\unmacrodo5594\xdef\macrolist{\macrolist}%5595\endgroup5596\else5597\errmessage{Macro #1 not defined}%5598\fi5599}56005601% Called by \do from \dounmacro on each macro. The idea is to omit any5602% macro definitions that have been changed to \relax.5603%5604\def\unmacrodo#1{%5605\ifx#1\relax5606% remove this5607\else5608\noexpand\do \noexpand #1%5609\fi5610}56115612% This makes use of the obscure feature that if the last token of a5613% <parameter list> is #, then the preceding argument is delimited by5614% an opening brace, and that opening brace is not consumed.5615\def\getargs#1{\getargsxxx#1{}}5616\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}5617\def\getmacname #1 #2\relax{\macname={#1}}5618\def\getmacargs#1{\def\argl{#1}}56195620% Parse the optional {params} list. Set up \paramno and \paramlist5621% so \defmacro knows what to do. Define \macarg.blah for each blah5622% in the params list, to be ##N where N is the position in that list.5623% That gets used by \mbodybackslash (above).56245625% We need to get `macro parameter char #' into several definitions.5626% The technique used is stolen from LaTeX: let \hash be something5627% unexpandable, insert that wherever you need a #, and then redefine5628% it to # just before using the token list produced.5629%5630% The same technique is used to protect \eatspaces till just before5631% the macro is used.56325633\def\parsemargdef#1;{\paramno=0\def\paramlist{}%5634\let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}5635\def\parsemargdefxxx#1,{%5636\if#1;\let\next=\relax5637\else \let\next=\parsemargdefxxx5638\advance\paramno by 1%5639\expandafter\edef\csname macarg.\eatspaces{#1}\endcsname5640{\xeatspaces{\hash\the\paramno}}%5641\edef\paramlist{\paramlist\hash\the\paramno,}%5642\fi\next}56435644% These two commands read recursive and nonrecursive macro bodies.5645% (They're different since rec and nonrec macros end differently.)56465647\long\def\parsemacbody#1@end macro%5648{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%5649\long\def\parsermacbody#1@end rmacro%5650{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%56515652% This defines the macro itself. There are six cases: recursive and5653% nonrecursive macros of zero, one, and many arguments.5654% Much magic with \expandafter here.5655% \xdef is used so that macro definitions will survive the file5656% they're defined in; @include reads the file inside a group.5657\def\defmacro{%5658\let\hash=##% convert placeholders to macro parameter chars5659\ifrecursive5660\ifcase\paramno5661% 05662\expandafter\xdef\csname\the\macname\endcsname{%5663\noexpand\scanmacro{\temp}}%5664\or % 15665\expandafter\xdef\csname\the\macname\endcsname{%5666\bgroup\noexpand\macroargctxt5667\noexpand\braceorline5668\expandafter\noexpand\csname\the\macname xxx\endcsname}%5669\expandafter\xdef\csname\the\macname xxx\endcsname##1{%5670\egroup\noexpand\scanmacro{\temp}}%5671\else % many5672\expandafter\xdef\csname\the\macname\endcsname{%5673\bgroup\noexpand\macroargctxt5674\noexpand\csname\the\macname xx\endcsname}%5675\expandafter\xdef\csname\the\macname xx\endcsname##1{%5676\expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%5677\expandafter\expandafter5678\expandafter\xdef5679\expandafter\expandafter5680\csname\the\macname xxx\endcsname5681\paramlist{\egroup\noexpand\scanmacro{\temp}}%5682\fi5683\else5684\ifcase\paramno5685% 05686\expandafter\xdef\csname\the\macname\endcsname{%5687\noexpand\norecurse{\the\macname}%5688\noexpand\scanmacro{\temp}\egroup}%5689\or % 15690\expandafter\xdef\csname\the\macname\endcsname{%5691\bgroup\noexpand\macroargctxt5692\noexpand\braceorline5693\expandafter\noexpand\csname\the\macname xxx\endcsname}%5694\expandafter\xdef\csname\the\macname xxx\endcsname##1{%5695\egroup5696\noexpand\norecurse{\the\macname}%5697\noexpand\scanmacro{\temp}\egroup}%5698\else % many5699\expandafter\xdef\csname\the\macname\endcsname{%5700\bgroup\noexpand\macroargctxt5701\expandafter\noexpand\csname\the\macname xx\endcsname}%5702\expandafter\xdef\csname\the\macname xx\endcsname##1{%5703\expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%5704\expandafter\expandafter5705\expandafter\xdef5706\expandafter\expandafter5707\csname\the\macname xxx\endcsname5708\paramlist{%5709\egroup5710\noexpand\norecurse{\the\macname}%5711\noexpand\scanmacro{\temp}\egroup}%5712\fi5713\fi}57145715\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}57165717% \braceorline decides whether the next nonwhitespace character is a5718% {. If so it reads up to the closing }, if not, it reads the whole5719% line. Whatever was read is then fed to the next control sequence5720% as an argument (by \parsebrace or \parsearg)5721\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}5722\def\braceorlinexxx{%5723\ifx\nchar\bgroup\else5724\expandafter\parsearg5725\fi \next}57265727% We mant to disable all macros during \shipout so that they are not5728% expanded by \write.5729\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%5730\edef\next{\macrolist}\expandafter\endgroup\next}573157325733% @alias.5734% We need some trickery to remove the optional spaces around the equal5735% sign. Just make them active and then expand them all to nothing.5736\def\alias{\parseargusing\obeyspaces\aliasxxx}5737\def\aliasxxx #1{\aliasyyy#1\relax}5738\def\aliasyyy #1=#2\relax{%5739{%5740\expandafter\let\obeyedspace=\empty5741\xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%5742}%5743\next5744}574557465747\message{cross references,}57485749\newwrite\auxfile57505751\newif\ifhavexrefs % True if xref values are known.5752\newif\ifwarnedxrefs % True if we warned once that they aren't known.57535754% @inforef is relatively simple.5755\def\inforef #1{\inforefzzz #1,,,,**}5756\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},5757node \samp{\ignorespaces#1{}}}57585759% @node's only job in TeX is to define \lastnode, which is used in5760% cross-references. The @node line might or might not have commas, and5761% might or might not have spaces before the first comma, like:5762% @node foo , bar , ...5763% We don't want such trailing spaces in the node name.5764%5765\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}5766%5767% also remove a trailing comma, in case of something like this:5768% @node Help-Cross, , , Cross-refs5769\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}5770\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}57715772\let\nwnode=\node5773\let\lastnode=\empty57745775% Write a cross-reference definition for the current node. #1 is the5776% type (Ynumbered, Yappendix, Ynothing).5777%5778\def\donoderef#1{%5779\ifx\lastnode\empty\else5780\setref{\lastnode}{#1}%5781\global\let\lastnode=\empty5782\fi5783}57845785% @anchor{NAME} -- define xref target at arbitrary point.5786%5787\newcount\savesfregister5788%5789\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}5790\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}5791\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}57925793% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an5794% anchor), which consists of three parts:5795% 1) NAME-title - the current sectioning name taken from \thissection,5796% or the anchor name.5797% 2) NAME-snt - section number and type, passed as the SNT arg, or5798% empty for anchors.5799% 3) NAME-pg - the page number.5800%5801% This is called from \donoderef, \anchor, and \dofloat. In the case of5802% floats, there is an additional part, which is not written here:5803% 4) NAME-lof - the text as it should appear in a @listoffloats.5804%5805\def\setref#1#2{%5806\pdfmkdest{#1}%5807\iflinks5808{%5809\atdummies % preserve commands, but don't expand them5810\turnoffactive5811\otherbackslash5812\edef\writexrdef##1##2{%5813\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef5814##1}{##2}}% these are parameters of \writexrdef5815}%5816\toks0 = \expandafter{\thissection}%5817\immediate \writexrdef{title}{\the\toks0 }%5818\immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.5819\writexrdef{pg}{\folio}% will be written later, during \shipout5820}%5821\fi5822}58235824% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is5825% the node name, #2 the name of the Info cross-reference, #3 the printed5826% node name, #4 the name of the Info file, #5 the name of the printed5827% manual. All but the node name can be omitted.5828%5829\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}5830\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}5831\def\ref#1{\xrefX[#1,,,,,,,]}5832\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup5833\unsepspaces5834\def\printedmanual{\ignorespaces #5}%5835\def\printedrefname{\ignorespaces #3}%5836\setbox1=\hbox{\printedmanual\unskip}%5837\setbox0=\hbox{\printedrefname\unskip}%5838\ifdim \wd0 = 0pt5839% No printed node name was explicitly given.5840\expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax5841% Use the node name inside the square brackets.5842\def\printedrefname{\ignorespaces #1}%5843\else5844% Use the actual chapter/section title appear inside5845% the square brackets. Use the real section title if we have it.5846\ifdim \wd1 > 0pt5847% It is in another manual, so we don't have it.5848\def\printedrefname{\ignorespaces #1}%5849\else5850\ifhavexrefs5851% We know the real title if we have the xref values.5852\def\printedrefname{\refx{#1-title}{}}%5853\else5854% Otherwise just copy the Info node name.5855\def\printedrefname{\ignorespaces #1}%5856\fi%5857\fi5858\fi5859\fi5860%5861% Make link in pdf output.5862\ifpdf5863\leavevmode5864\getfilename{#4}%5865{\turnoffactive \otherbackslash5866\ifnum\filenamelength>05867\startlink attr{/Border [0 0 0]}%5868goto file{\the\filename.pdf} name{#1}%5869\else5870\startlink attr{/Border [0 0 0]}%5871goto name{\pdfmkpgn{#1}}%5872\fi5873}%5874\linkcolor5875\fi5876%5877% Float references are printed completely differently: "Figure 1.2"5878% instead of "[somenode], p.3". We distinguish them by the5879% LABEL-title being set to a magic string.5880{%5881% Have to otherify everything special to allow the \csname to5882% include an _ in the xref name, etc.5883\indexnofonts5884\turnoffactive5885\otherbackslash5886\expandafter\global\expandafter\let\expandafter\Xthisreftitle5887\csname XR#1-title\endcsname5888}%5889\iffloat\Xthisreftitle5890% If the user specified the print name (third arg) to the ref,5891% print it instead of our usual "Figure 1.2".5892\ifdim\wd0 = 0pt5893\refx{#1-snt}%5894\else5895\printedrefname5896\fi5897%5898% if the user also gave the printed manual name (fifth arg), append5899% "in MANUALNAME".5900\ifdim \wd1 > 0pt5901\space \putwordin{} \cite{\printedmanual}%5902\fi5903\else5904% node/anchor (non-float) references.5905%5906% If we use \unhbox0 and \unhbox1 to print the node names, TeX does not5907% insert empty discretionaries after hyphens, which means that it will5908% not find a line break at a hyphen in a node names. Since some manuals5909% are best written with fairly long node names, containing hyphens, this5910% is a loss. Therefore, we give the text of the node name again, so it5911% is as if TeX is seeing it for the first time.5912\ifdim \wd1 > 0pt5913\putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%5914\else5915% _ (for example) has to be the character _ for the purposes of the5916% control sequence corresponding to the node, but it has to expand5917% into the usual \leavevmode...\vrule stuff for purposes of5918% printing. So we \turnoffactive for the \refx-snt, back on for the5919% printing, back off for the \refx-pg.5920{\turnoffactive \otherbackslash5921% Only output a following space if the -snt ref is nonempty; for5922% @unnumbered and @anchor, it won't be.5923\setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%5924\ifdim \wd2 > 0pt \refx{#1-snt}\space\fi5925}%5926% output the `[mynode]' via a macro so it can be overridden.5927\xrefprintnodename\printedrefname5928%5929% But we always want a comma and a space:5930,\space5931%5932% output the `page 3'.5933\turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%5934\fi5935\fi5936\endlink5937\endgroup}59385939% This macro is called from \xrefX for the `[nodename]' part of xref5940% output. It's a separate macro only so it can be changed more easily,5941% since square brackets don't work well in some documents. Particularly5942% one that Bob is working on :).5943%5944\def\xrefprintnodename#1{[#1]}59455946% Things referred to by \setref.5947%5948\def\Ynothing{}5949\def\Yomitfromtoc{}5950\def\Ynumbered{%5951\ifnum\secno=05952\putwordChapter@tie \the\chapno5953\else \ifnum\subsecno=05954\putwordSection@tie \the\chapno.\the\secno5955\else \ifnum\subsubsecno=05956\putwordSection@tie \the\chapno.\the\secno.\the\subsecno5957\else5958\putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno5959\fi\fi\fi5960}5961\def\Yappendix{%5962\ifnum\secno=05963\putwordAppendix@tie @char\the\appendixno{}%5964\else \ifnum\subsecno=05965\putwordSection@tie @char\the\appendixno.\the\secno5966\else \ifnum\subsubsecno=05967\putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno5968\else5969\putwordSection@tie5970@char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno5971\fi\fi\fi5972}59735974% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.5975% If its value is nonempty, SUFFIX is output afterward.5976%5977\def\refx#1#2{%5978{%5979\indexnofonts5980\otherbackslash5981\expandafter\global\expandafter\let\expandafter\thisrefX5982\csname XR#1\endcsname5983}%5984\ifx\thisrefX\relax5985% If not defined, say something at least.5986\angleleft un\-de\-fined\angleright5987\iflinks5988\ifhavexrefs5989\message{\linenumber Undefined cross reference `#1'.}%5990\else5991\ifwarnedxrefs\else5992\global\warnedxrefstrue5993\message{Cross reference values unknown; you must run TeX again.}%5994\fi5995\fi5996\fi5997\else5998% It's defined, so just use it.5999\thisrefX6000\fi6001#2% Output the suffix in any case.6002}60036004% This is the macro invoked by entries in the aux file. Usually it's6005% just a \def (we prepend XR to the control sequence name to avoid6006% collisions). But if this is a float type, we have more work to do.6007%6008\def\xrdef#1#2{%6009\expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value.6010%6011% Was that xref control sequence that we just defined for a float?6012\expandafter\iffloat\csname XR#1\endcsname6013% it was a float, and we have the (safe) float type in \iffloattype.6014\expandafter\let\expandafter\floatlist6015\csname floatlist\iffloattype\endcsname6016%6017% Is this the first time we've seen this float type?6018\expandafter\ifx\floatlist\relax6019\toks0 = {\do}% yes, so just \do6020\else6021% had it before, so preserve previous elements in list.6022\toks0 = \expandafter{\floatlist\do}%6023\fi6024%6025% Remember this xref in the control sequence \floatlistFLOATTYPE,6026% for later use in \listoffloats.6027\expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}%6028\fi6029}60306031% Read the last existing aux file, if any. No error if none exists.6032%6033\def\tryauxfile{%6034\openin 1 \jobname.aux6035\ifeof 1 \else6036\readauxfile6037\global\havexrefstrue6038\fi6039\closein 16040}60416042\def\readauxfile{\begingroup6043\catcode`\^^@=\other6044\catcode`\^^A=\other6045\catcode`\^^B=\other6046\catcode`\^^C=\other6047\catcode`\^^D=\other6048\catcode`\^^E=\other6049\catcode`\^^F=\other6050\catcode`\^^G=\other6051\catcode`\^^H=\other6052\catcode`\^^K=\other6053\catcode`\^^L=\other6054\catcode`\^^N=\other6055\catcode`\^^P=\other6056\catcode`\^^Q=\other6057\catcode`\^^R=\other6058\catcode`\^^S=\other6059\catcode`\^^T=\other6060\catcode`\^^U=\other6061\catcode`\^^V=\other6062\catcode`\^^W=\other6063\catcode`\^^X=\other6064\catcode`\^^Z=\other6065\catcode`\^^[=\other6066\catcode`\^^\=\other6067\catcode`\^^]=\other6068\catcode`\^^^=\other6069\catcode`\^^_=\other6070% It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.6071% in xref tags, i.e., node names. But since ^^e4 notation isn't6072% supported in the main text, it doesn't seem desirable. Furthermore,6073% that is not enough: for node names that actually contain a ^6074% character, we would end up writing a line like this: 'xrdef {'hat6075% b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first6076% argument, and \hat is not an expandable control sequence. It could6077% all be worked out, but why? Either we support ^^ or we don't.6078%6079% The other change necessary for this was to define \auxhat:6080% \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter6081% and then to call \auxhat in \setq.6082%6083\catcode`\^=\other6084%6085% Special characters. Should be turned off anyway, but...6086\catcode`\~=\other6087\catcode`\[=\other6088\catcode`\]=\other6089\catcode`\"=\other6090\catcode`\_=\other6091\catcode`\|=\other6092\catcode`\<=\other6093\catcode`\>=\other6094\catcode`\$=\other6095\catcode`\#=\other6096\catcode`\&=\other6097\catcode`\%=\other6098\catcode`+=\other % avoid \+ for paranoia even though we've turned it off6099%6100% This is to support \ in node names and titles, since the \6101% characters end up in a \csname. It's easier than6102% leaving it active and making its active definition an actual \6103% character. What I don't understand is why it works in the *value*6104% of the xrdef. Seems like it should be a catcode12 \, and that6105% should not typeset properly. But it works, so I'm moving on for6106% now. --karl, 15jan04.6107\catcode`\\=\other6108%6109% Make the characters 128-255 be printing characters.6110{%6111\count 1=1286112\def\loop{%6113\catcode\count 1=\other6114\advance\count 1 by 16115\ifnum \count 1<256 \loop \fi6116}%6117}%6118%6119% @ is our escape character in .aux files, and we need braces.6120\catcode`\{=16121\catcode`\}=26122\catcode`\@=06123%6124\input \jobname.aux6125\endgroup}612661276128\message{insertions,}6129% including footnotes.61306131\newcount \footnoteno61326133% The trailing space in the following definition for supereject is6134% vital for proper filling; pages come out unaligned when you do a6135% pagealignmacro call if that space before the closing brace is6136% removed. (Generally, numeric constants should always be followed by a6137% space to prevent strange expansion errors.)6138\def\supereject{\par\penalty -20000\footnoteno =0 }61396140% @footnotestyle is meaningful for info output only.6141\let\footnotestyle=\comment61426143{\catcode `\@=116144%6145% Auto-number footnotes. Otherwise like plain.6146\gdef\footnote{%6147\let\indent=\ptexindent6148\let\noindent=\ptexnoindent6149\global\advance\footnoteno by \@ne6150\edef\thisfootno{$^{\the\footnoteno}$}%6151%6152% In case the footnote comes at the end of a sentence, preserve the6153% extra spacing after we do the footnote number.6154\let\@sf\empty6155\ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi6156%6157% Remove inadvertent blank space before typesetting the footnote number.6158\unskip6159\thisfootno\@sf6160\dofootnote6161}%61626163% Don't bother with the trickery in plain.tex to not require the6164% footnote text as a parameter. Our footnotes don't need to be so general.6165%6166% Oh yes, they do; otherwise, @ifset (and anything else that uses6167% \parseargline) fails inside footnotes because the tokens are fixed when6168% the footnote is read. --karl, 16nov96.6169%6170\gdef\dofootnote{%6171\insert\footins\bgroup6172% We want to typeset this text as a normal paragraph, even if the6173% footnote reference occurs in (for example) a display environment.6174% So reset some parameters.6175\hsize=\pagewidth6176\interlinepenalty\interfootnotelinepenalty6177\splittopskip\ht\strutbox % top baseline for broken footnotes6178\splitmaxdepth\dp\strutbox6179\floatingpenalty\@MM6180\leftskip\z@skip6181\rightskip\z@skip6182\spaceskip\z@skip6183\xspaceskip\z@skip6184\parindent\defaultparindent6185%6186\smallfonts \rm6187%6188% Because we use hanging indentation in footnotes, a @noindent appears6189% to exdent this text, so make it be a no-op. makeinfo does not use6190% hanging indentation so @noindent can still be needed within footnote6191% text after an @example or the like (not that this is good style).6192\let\noindent = \relax6193%6194% Hang the footnote text off the number. Use \everypar in case the6195% footnote extends for more than one paragraph.6196\everypar = {\hang}%6197\textindent{\thisfootno}%6198%6199% Don't crash into the line above the footnote text. Since this6200% expands into a box, it must come within the paragraph, lest it6201% provide a place where TeX can split the footnote.6202\footstrut6203\futurelet\next\fo@t6204}6205}%end \catcode `\@=1162066207% In case a @footnote appears in a vbox, save the footnote text and create6208% the real \insert just after the vbox finished. Otherwise, the insertion6209% would be lost.6210% Similarily, if a @footnote appears inside an alignment, save the footnote6211% text to a box and make the \insert when a row of the table is finished.6212% And the same can be done for other insert classes. --kasal, 16nov03.62136214% Replace the \insert primitive by a cheating macro.6215% Deeper inside, just make sure that the saved insertions are not spilled6216% out prematurely.6217%6218\def\startsavinginserts{%6219\ifx \insert\ptexinsert6220\let\insert\saveinsert6221\else6222\let\checkinserts\relax6223\fi6224}62256226% This \insert replacement works for both \insert\footins{foo} and6227% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.6228%6229\def\saveinsert#1{%6230\edef\next{\noexpand\savetobox \makeSAVEname#1}%6231\afterassignment\next6232% swallow the left brace6233\let\temp =6234}6235\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}6236\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}62376238\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}62396240\def\placesaveins#1{%6241\ptexinsert \csname\expandafter\gobblesave\string#1\endcsname6242{\box#1}%6243}62446245% eat @SAVE -- beware, all of them have catcode \other:6246{6247\def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)6248\gdef\gobblesave @SAVE{}6249}62506251% initialization:6252\def\newsaveins #1{%6253\edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%6254\next6255}6256\def\newsaveinsX #1{%6257\csname newbox\endcsname #1%6258\expandafter\def\expandafter\checkinserts\expandafter{\checkinserts6259\checksaveins #1}%6260}62616262% initialize:6263\let\checkinserts\empty6264\newsaveins\footins6265\newsaveins\margin626662676268% @image. We use the macros from epsf.tex to support this.6269% If epsf.tex is not installed and @image is used, we complain.6270%6271% Check for and read epsf.tex up front. If we read it only at @image6272% time, we might be inside a group, and then its definitions would get6273% undone and the next image would fail.6274\openin 1 = epsf.tex6275\ifeof 1 \else6276% Do not bother showing banner with epsf.tex v2.7k (available in6277% doc/epsf.tex and on ctan).6278\def\epsfannounce{\toks0 = }%6279\input epsf.tex6280\fi6281\closein 16282%6283% We will only complain once about lack of epsf.tex.6284\newif\ifwarnednoepsf6285\newhelp\noepsfhelp{epsf.tex must be installed for images to6286work. It is also included in the Texinfo distribution, or you can get6287it from ftp://tug.org/tex/epsf.tex.}6288%6289\def\image#1{%6290\ifx\epsfbox\undefined6291\ifwarnednoepsf \else6292\errhelp = \noepsfhelp6293\errmessage{epsf.tex not found, images will be ignored}%6294\global\warnednoepsftrue6295\fi6296\else6297\imagexxx #1,,,,,\finish6298\fi6299}6300%6301% Arguments to @image:6302% #1 is (mandatory) image filename; we tack on .eps extension.6303% #2 is (optional) width, #3 is (optional) height.6304% #4 is (ignored optional) html alt text.6305% #5 is (ignored optional) extension.6306% #6 is just the usual extra ignored arg for parsing this stuff.6307\newif\ifimagevmode6308\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup6309\catcode`\^^M = 5 % in case we're inside an example6310\normalturnoffactive % allow _ et al. in names6311% If the image is by itself, center it.6312\ifvmode6313\imagevmodetrue6314\nobreak\bigskip6315% Usually we'll have text after the image which will insert6316% \parskip glue, so insert it here too to equalize the space6317% above and below.6318\nobreak\vskip\parskip6319\nobreak6320\line\bgroup\hss6321\fi6322%6323% Output the image.6324\ifpdf6325\dopdfimage{#1}{#2}{#3}%6326\else6327% \epsfbox itself resets \epsf?size at each figure.6328\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi6329\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi6330\epsfbox{#1.eps}%6331\fi6332%6333\ifimagevmode \hss \egroup \bigbreak \fi % space after the image6334\endgroup}633563366337% @float FLOATTYPE,LOC ... @end float for displayed figures, tables, etc.6338% We don't actually implement floating yet, we just plop the float "here".6339% But it seemed the best name for the future.6340%6341\envparseargdef\float{\dofloat #1,,,\finish}63426343% #1 is the optional FLOATTYPE, the text label for this float, typically6344% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,6345% this float will not be numbered and cannot be referred to.6346%6347% #2 is the optional xref label. Also must be present for the float to6348% be referable.6349%6350% #3 is the optional positioning argument; for now, it is ignored. It6351% will somehow specify the positions allowed to float to (here, top, bottom).6352%6353% We keep a separate counter for each FLOATTYPE, which we reset at each6354% chapter-level command.6355\let\resetallfloatnos=\empty6356%6357\def\dofloat#1,#2,#3,#4\finish{%6358\let\thiscaption=\empty6359\let\thisshortcaption=\empty6360%6361% don't lose footnotes inside @float.6362\startsavinginserts6363%6364% We can't be used inside a paragraph.6365\par6366%6367\vtop\bgroup6368\def\floattype{#1}%6369\def\floatlabel{#2}%6370\def\floatloc{#3}% we do nothing with this yet.6371%6372\ifx\floattype\empty6373\let\safefloattype=\empty6374\else6375{%6376% the floattype might have accents or other special characters,6377% but we need to use it in a control sequence name.6378\indexnofonts6379\turnoffactive6380\xdef\safefloattype{\floattype}%6381}%6382\fi6383%6384% If label is given but no type, we handle that as the empty type.6385\ifx\floatlabel\empty \else6386% We want each FLOATTYPE to be numbered separately (Figure 1,6387% Table 1, Figure 2, ...). (And if no label, no number.)6388%6389\expandafter\getfloatno\csname\safefloattype floatno\endcsname6390\global\advance\floatno by 16391%6392{%6393% This magic value for \thissection is output by \setref as the6394% XREFLABEL-title value. \xrefX uses it to distinguish float6395% labels (which have a completely different output format) from6396% node and anchor labels. And \xrdef uses it to construct the6397% lists of floats.6398%6399\edef\thissection{\floatmagic=\safefloattype}%6400\setref{\floatlabel}{Yfloat}%6401}%6402\fi6403%6404% start with \parskip glue, I guess.6405\vskip\parskip6406%6407% Don't suppress indentation if a float happens to start a section.6408\restorefirstparagraphindent6409}64106411% we have these possibilities:6412% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap6413% @float Foo,lbl & no caption: Foo 1.16414% @float Foo & @caption{Cap}: Foo: Cap6415% @float Foo & no caption: Foo6416% @float ,lbl & Caption{Cap}: 1.1: Cap6417% @float ,lbl & no caption: 1.16418% @float & @caption{Cap}: Cap6419% @float & no caption:6420%6421\def\Efloat{%6422\let\floatident = \empty6423%6424% In all cases, if we have a float type, it comes first.6425\ifx\floattype\empty \else \def\floatident{\floattype}\fi6426%6427% If we have an xref label, the number comes next.6428\ifx\floatlabel\empty \else6429\ifx\floattype\empty \else % if also had float type, need tie first.6430\appendtomacro\floatident{\tie}%6431\fi6432% the number.6433\appendtomacro\floatident{\chaplevelprefix\the\floatno}%6434\fi6435%6436% Start the printed caption with what we've constructed in6437% \floatident, but keep it separate; we need \floatident again.6438\let\captionline = \floatident6439%6440\ifx\thiscaption\empty \else6441\ifx\floatident\empty \else6442\appendtomacro\captionline{: }% had ident, so need a colon between6443\fi6444%6445% caption text.6446\appendtomacro\captionline\thiscaption6447\fi6448%6449% If we have anything to print, print it, with space before.6450% Eventually this needs to become an \insert.6451\ifx\captionline\empty \else6452\vskip.5\parskip6453\captionline6454\fi6455%6456% If have an xref label, write the list of floats info. Do this6457% after the caption, to avoid chance of it being a breakpoint.6458\ifx\floatlabel\empty \else6459% Write the text that goes in the lof to the aux file as6460% \floatlabel-lof. Besides \floatident, we include the short6461% caption if specified, else the full caption if specified, else nothing.6462{%6463\atdummies \turnoffactive \otherbackslash6464\immediate\write\auxfile{@xrdef{\floatlabel-lof}{%6465\floatident6466\ifx\thisshortcaption\empty6467\ifx\thiscaption\empty \else : \thiscaption \fi6468\else6469: \thisshortcaption6470\fi6471}}%6472}%6473\fi6474%6475% Space below caption, if we printed anything.6476\ifx\printedsomething\empty \else \vskip\parskip \fi6477\egroup % end of \vtop6478\checkinserts6479}64806481% Append the tokens #2 to the definition of macro #1, not expanding either.6482%6483\newtoks\appendtomacroAtoks6484\newtoks\appendtomacroBtoks6485\def\appendtomacro#1#2{%6486\appendtomacroAtoks = \expandafter{#1}%6487\appendtomacroBtoks = {#2}%6488\edef#1{\the\appendtomacroAtoks \the\appendtomacroBtoks}%6489}64906491% @caption, @shortcaption are easy.6492%6493\long\def\caption#1{\checkenv\float \def\thiscaption{#1}}6494\def\shortcaption#1{\checkenv\float \def\thisshortcaption{#1}}64956496% The parameter is the control sequence identifying the counter we are6497% going to use. Create it if it doesn't exist and assign it to \floatno.6498\def\getfloatno#1{%6499\ifx#1\relax6500% Haven't seen this figure type before.6501\csname newcount\endcsname #1%6502%6503% Remember to reset this floatno at the next chap.6504\expandafter\gdef\expandafter\resetallfloatnos6505\expandafter{\resetallfloatnos #1=0 }%6506\fi6507\let\floatno#1%6508}65096510% \setref calls this to get the XREFLABEL-snt value. We want an @xref6511% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we6512% first read the @float command.6513%6514\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%65156516% Magic string used for the XREFLABEL-title value, so \xrefX can6517% distinguish floats from other xref types.6518\def\floatmagic{!!float!!}65196520% #1 is the control sequence we are passed; we expand into a conditional6521% which is true if #1 represents a float ref. That is, the magic6522% \thissection value which we \setref above.6523%6524\def\iffloat#1{\expandafter\doiffloat#1==\finish}6525%6526% #1 is (maybe) the \floatmagic string. If so, #2 will be the6527% (safe) float type for this float. We set \iffloattype to #2.6528%6529\def\doiffloat#1=#2=#3\finish{%6530\def\temp{#1}%6531\def\iffloattype{#2}%6532\ifx\temp\floatmagic6533}65346535% @listoffloats FLOATTYPE - print a list of floats like a table of contents.6536%6537\parseargdef\listoffloats{%6538\def\floattype{#1}% floattype6539{%6540% the floattype might have accents or other special characters,6541% but we need to use it in a control sequence name.6542\indexnofonts6543\turnoffactive6544\xdef\safefloattype{\floattype}%6545}%6546%6547% \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.6548\expandafter\ifx\csname floatlist\safefloattype\endcsname \relax6549\ifhavexrefs6550% if the user said @listoffloats foo but never @float foo.6551\message{\linenumber No `\safefloattype' floats to list.}%6552\fi6553\else6554\begingroup6555\leftskip=\tocindent % indent these entries like a toc6556\let\do=\listoffloatsdo6557\csname floatlist\safefloattype\endcsname6558\endgroup6559\fi6560}65616562% This is called on each entry in a list of floats. We're passed the6563% xref label, in the form LABEL-title, which is how we save it in the6564% aux file. We strip off the -title and look up \XRLABEL-lof, which6565% has the text we're supposed to typeset here.6566%6567% Figures without xref labels will not be included in the list (since6568% they won't appear in the aux file).6569%6570\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}6571\def\listoffloatsdoentry#1-title\finish{{%6572% Can't fully expand XR#1-lof because it can contain anything. Just6573% pass the control sequence. On the other hand, XR#1-pg is just the6574% page number, and we want to fully expand that so we can get a link6575% in pdf output.6576\toksA = \expandafter{\csname XR#1-lof\endcsname}%6577%6578% use the same \entry macro we use to generate the TOC and index.6579\edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%6580\writeentry6581}}65826583\message{localization,}6584% and i18n.65856586% @documentlanguage is usually given very early, just after6587% @setfilename. If done too late, it may not override everything6588% properly. Single argument is the language abbreviation.6589% It would be nice if we could set up a hyphenation file here.6590%6591\parseargdef\documentlanguage{%6592\tex % read txi-??.tex file in plain TeX.6593% Read the file if it exists.6594\openin 1 txi-#1.tex6595\ifeof 16596\errhelp = \nolanghelp6597\errmessage{Cannot read language file txi-#1.tex}%6598\else6599\input txi-#1.tex6600\fi6601\closein 16602\endgroup6603}6604\newhelp\nolanghelp{The given language definition file cannot be found or6605is empty. Maybe you need to install it? In the current directory6606should work if nowhere else does.}660766086609% @documentencoding should change something in TeX eventually, most6610% likely, but for now just recognize it.6611\let\documentencoding = \comment661266136614% Page size parameters.6615%6616\newdimen\defaultparindent \defaultparindent = 15pt66176618\chapheadingskip = 15pt plus 4pt minus 2pt6619\secheadingskip = 12pt plus 3pt minus 2pt6620\subsecheadingskip = 9pt plus 2pt minus 2pt66216622% Prevent underfull vbox error messages.6623\vbadness = 1000066246625% Don't be so finicky about underfull hboxes, either.6626\hbadness = 200066276628% Following George Bush, just get rid of widows and orphans.6629\widowpenalty=100006630\clubpenalty=1000066316632% Use TeX 3.0's \emergencystretch to help line breaking, but if we're6633% using an old version of TeX, don't do anything. We want the amount of6634% stretch added to depend on the line length, hence the dependence on6635% \hsize. We call this whenever the paper size is set.6636%6637\def\setemergencystretch{%6638\ifx\emergencystretch\thisisundefined6639% Allow us to assign to \emergencystretch anyway.6640\def\emergencystretch{\dimen0}%6641\else6642\emergencystretch = .15\hsize6643\fi6644}66456646% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;6647% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)6648% physical page width.6649%6650% We also call \setleading{\textleading}, so the caller should define6651% \textleading. The caller should also set \parskip.6652%6653\def\internalpagesizes#1#2#3#4#5#6#7#8{%6654\voffset = #3\relax6655\topskip = #6\relax6656\splittopskip = \topskip6657%6658\vsize = #1\relax6659\advance\vsize by \topskip6660\outervsize = \vsize6661\advance\outervsize by 2\topandbottommargin6662\pageheight = \vsize6663%6664\hsize = #2\relax6665\outerhsize = \hsize6666\advance\outerhsize by 0.5in6667\pagewidth = \hsize6668%6669\normaloffset = #4\relax6670\bindingoffset = #5\relax6671%6672\ifpdf6673\pdfpageheight #7\relax6674\pdfpagewidth #8\relax6675\fi6676%6677\setleading{\textleading}6678%6679\parindent = \defaultparindent6680\setemergencystretch6681}66826683% @letterpaper (the default).6684\def\letterpaper{{\globaldefs = 16685\parskip = 3pt plus 2pt minus 1pt6686\textleading = 13.2pt6687%6688% If page is nothing but text, make it come out even.6689\internalpagesizes{46\baselineskip}{6in}%6690{\voffset}{.25in}%6691{\bindingoffset}{36pt}%6692{11in}{8.5in}%6693}}66946695% Use @smallbook to reset parameters for 7x9.5 (or so) format.6696\def\smallbook{{\globaldefs = 16697\parskip = 2pt plus 1pt6698\textleading = 12pt6699%6700\internalpagesizes{7.5in}{5in}%6701{\voffset}{.25in}%6702{\bindingoffset}{16pt}%6703{9.25in}{7in}%6704%6705\lispnarrowing = 0.3in6706\tolerance = 7006707\hfuzz = 1pt6708\contentsrightmargin = 0pt6709\defbodyindent = .5cm6710}}67116712% Use @afourpaper to print on European A4 paper.6713\def\afourpaper{{\globaldefs = 16714\parskip = 3pt plus 2pt minus 1pt6715\textleading = 13.2pt6716%6717% Double-side printing via postscript on Laserjet 40506718% prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.6719% To change the settings for a different printer or situation, adjust6720% \normaloffset until the front-side and back-side texts align. Then6721% do the same for \bindingoffset. You can set these for testing in6722% your texinfo source file like this:6723% @tex6724% \global\normaloffset = -6mm6725% \global\bindingoffset = 10mm6726% @end tex6727\internalpagesizes{51\baselineskip}{160mm}6728{\voffset}{\hoffset}%6729{\bindingoffset}{44pt}%6730{297mm}{210mm}%6731%6732\tolerance = 7006733\hfuzz = 1pt6734\contentsrightmargin = 0pt6735\defbodyindent = 5mm6736}}67376738% Use @afivepaper to print on European A5 paper.6739% From [email protected], 2 July 2000.6740% He also recommends making @example and @lisp be small.6741\def\afivepaper{{\globaldefs = 16742\parskip = 2pt plus 1pt minus 0.1pt6743\textleading = 12.5pt6744%6745\internalpagesizes{160mm}{120mm}%6746{\voffset}{\hoffset}%6747{\bindingoffset}{8pt}%6748{210mm}{148mm}%6749%6750\lispnarrowing = 0.2in6751\tolerance = 8006752\hfuzz = 1.2pt6753\contentsrightmargin = 0pt6754\defbodyindent = 2mm6755\tableindent = 12mm6756}}67576758% A specific text layout, 24x15cm overall, intended for A4 paper.6759\def\afourlatex{{\globaldefs = 16760\afourpaper6761\internalpagesizes{237mm}{150mm}%6762{\voffset}{4.6mm}%6763{\bindingoffset}{7mm}%6764{297mm}{210mm}%6765%6766% Must explicitly reset to 0 because we call \afourpaper.6767\globaldefs = 06768}}67696770% Use @afourwide to print on A4 paper in landscape format.6771\def\afourwide{{\globaldefs = 16772\afourpaper6773\internalpagesizes{241mm}{165mm}%6774{\voffset}{-2.95mm}%6775{\bindingoffset}{7mm}%6776{297mm}{210mm}%6777\globaldefs = 06778}}67796780% @pagesizes TEXTHEIGHT[,TEXTWIDTH]6781% Perhaps we should allow setting the margins, \topskip, \parskip,6782% and/or leading, also. Or perhaps we should compute them somehow.6783%6784\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}6785\def\pagesizesyyy#1,#2,#3\finish{{%6786\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi6787\globaldefs = 16788%6789\parskip = 3pt plus 2pt minus 1pt6790\setleading{\textleading}%6791%6792\dimen0 = #16793\advance\dimen0 by \voffset6794%6795\dimen2 = \hsize6796\advance\dimen2 by \normaloffset6797%6798\internalpagesizes{#1}{\hsize}%6799{\voffset}{\normaloffset}%6800{\bindingoffset}{44pt}%6801{\dimen0}{\dimen2}%6802}}68036804% Set default to letter.6805%6806\letterpaper680768086809\message{and turning on texinfo input format.}68106811% Define macros to output various characters with catcode for normal text.6812\catcode`\"=\other6813\catcode`\~=\other6814\catcode`\^=\other6815\catcode`\_=\other6816\catcode`\|=\other6817\catcode`\<=\other6818\catcode`\>=\other6819\catcode`\+=\other6820\catcode`\$=\other6821\def\normaldoublequote{"}6822\def\normaltilde{~}6823\def\normalcaret{^}6824\def\normalunderscore{_}6825\def\normalverticalbar{|}6826\def\normalless{<}6827\def\normalgreater{>}6828\def\normalplus{+}6829\def\normaldollar{$}%$ font-lock fix68306831% This macro is used to make a character print one way in \tt6832% (where it can probably be output as-is), and another way in other fonts,6833% where something hairier probably needs to be done.6834%6835% #1 is what to print if we are indeed using \tt; #2 is what to print6836% otherwise. Since all the Computer Modern typewriter fonts have zero6837% interword stretch (and shrink), and it is reasonable to expect all6838% typewriter fonts to have this, we can check that font parameter.6839%6840\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}68416842% Same as above, but check for italic font. Actually this also catches6843% non-italic slanted fonts since it is impossible to distinguish them from6844% italic fonts. But since this is only used by $ and it uses \sl anyway6845% this is not a problem.6846\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}68476848% Turn off all special characters except @6849% (and those which the user can use as if they were ordinary).6850% Most of these we simply print from the \tt font, but for some, we can6851% use math or other variants that look better in normal text.68526853\catcode`\"=\active6854\def\activedoublequote{{\tt\char34}}6855\let"=\activedoublequote6856\catcode`\~=\active6857\def~{{\tt\char126}}6858\chardef\hat=`\^6859\catcode`\^=\active6860\def^{{\tt \hat}}68616862\catcode`\_=\active6863\def_{\ifusingtt\normalunderscore\_}6864% Subroutine for the previous macro.6865\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }68666867\catcode`\|=\active6868\def|{{\tt\char124}}6869\chardef \less=`\<6870\catcode`\<=\active6871\def<{{\tt \less}}6872\chardef \gtr=`\>6873\catcode`\>=\active6874\def>{{\tt \gtr}}6875\catcode`\+=\active6876\def+{{\tt \char 43}}6877\catcode`\$=\active6878\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix68796880% If a .fmt file is being used, characters that might appear in a file6881% name cannot be active until we have parsed the command line.6882% So turn them off again, and have \everyjob (or @setfilename) turn them on.6883% \otherifyactive is called near the end of this file.6884\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}68856886\catcode`\@=068876888% \backslashcurfont outputs one backslash character in current font,6889% as in \char`\\.6890\global\chardef\backslashcurfont=`\\6891\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work68926893% \rawbackslash defines an active \ to do \backslashcurfont.6894% \otherbackslash defines an active \ to be a literal `\' character with6895% catcode other.6896{\catcode`\\=\active6897@gdef@rawbackslash{@let\=@backslashcurfont}6898@gdef@otherbackslash{@let\=@realbackslash}6899}69006901% \realbackslash is an actual character `\' with catcode other.6902{\catcode`\\=\other @gdef@realbackslash{\}}69036904% \normalbackslash outputs one backslash in fixed width font.6905\def\normalbackslash{{\tt\backslashcurfont}}69066907\catcode`\\=\active69086909% Used sometimes to turn off (effectively) the active characters6910% even after parsing them.6911@def@turnoffactive{%6912@let"=@normaldoublequote6913@let\=@realbackslash6914@let~=@normaltilde6915@let^=@normalcaret6916@let_=@normalunderscore6917@let|=@normalverticalbar6918@let<=@normalless6919@let>=@normalgreater6920@let+=@normalplus6921@let$=@normaldollar %$ font-lock fix6922@unsepspaces6923}69246925% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of6926% the literal character `\'. (Thus, \ is not expandable when this is in6927% effect.)6928%6929@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}69306931% Make _ and + \other characters, temporarily.6932% This is canceled by @fixbackslash.6933@otherifyactive69346935% If a .fmt file is being used, we don't want the `\input texinfo' to show up.6936% That is what \eatinput is for; after that, the `\' should revert to printing6937% a backslash.6938%6939@gdef@eatinput input texinfo{@fixbackslash}6940@global@let\ = @eatinput69416942% On the other hand, perhaps the file did not have a `\input texinfo'. Then6943% the first `\{ in the file would cause an error. This macro tries to fix6944% that, assuming it is called before the first `\' could plausibly occur.6945% Also back turn on active characters that might appear in the input6946% file name, in case not using a pre-dumped format.6947%6948@gdef@fixbackslash{%6949@ifx\@eatinput @let\ = @normalbackslash @fi6950@catcode`+=@active6951@catcode`@_=@active6952}69536954% Say @foo, not \foo, in error messages.6955@escapechar = `@@69566957% These look ok in all fonts, so just make them not special.6958@catcode`@& = @other6959@catcode`@# = @other6960@catcode`@% = @other696169626963@c Local variables:6964@c eval: (add-hook 'write-file-hooks 'time-stamp)6965@c page-delimiter: "^\\\\message"6966@c time-stamp-start: "def\\\\texinfoversion{"6967@c time-stamp-format: "%:y-%02m-%02d.%02H"6968@c time-stamp-end: "}"6969@c End:69706971@c vim:sw=2:69726973@ignore6974arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea1156975@end ignore697669776978