1 % texinfo.tex -- TeX macros to handle Texinfo files.
3 % Load plain if necessary, i.e., if running under initex.
4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
6 \def\texinfoversion{2013-12-21.11}
8 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
10 % 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
12 % This texinfo.tex file is free software: you can redistribute it and/or
13 % modify it under the terms of the GNU General Public License as
14 % published by the Free Software Foundation, either version 3 of the
15 % License, or (at your option) any later version.
17 % This texinfo.tex file is distributed in the hope that it will be
18 % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
19 % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 % General Public License for more details.
22 % You should have received a copy of the GNU General Public License
23 % along with this program. If not, see <http://www.gnu.org/licenses/>.
25 % As a special exception, when this file is read by TeX when processing
26 % a Texinfo source document, you may use the result without
27 % restriction. This Exception is an additional permission under section 7
28 % of the GNU General Public License, version 3 ("GPLv3").
30 % Please try the latest version of texinfo.tex before submitting bug
31 % reports; you can get the latest version from:
32 % http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
33 % http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
34 % http://www.gnu.org/software/texinfo/ (the Texinfo home page)
35 % The texinfo.tex in any given distribution could well be out
36 % of date, so if that's what you're using, please check.
38 % Send bug reports to bug-texinfo@gnu.org. Please include including a
39 % complete document in each bug report with which we can reproduce the
40 % problem. Patches are, of course, greatly appreciated.
42 % To process a Texinfo manual with TeX, it's most reliable to use the
43 % texi2dvi shell script that comes with the distribution. For a simple
44 % manual foo.texi, however, you can get away with this:
49 % 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 more
52 % than two; texi2dvi does it as many times as necessary.
54 % It is possible to adapt texinfo.tex for other languages, to some
55 % extent. You can get the existing language-specific files from the
56 % full Texinfo distribution.
58 % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
61 \message{Loading texinfo [version \texinfoversion]:}
63 % If in a .fmt file, print the version number
64 % and turn on active characters that we couldn't do earlier because
65 % they might have appeared in the input file name.
66 \everyjob{\message{[Texinfo version \texinfoversion]}%
67 \catcode`+=\active \catcode`\_=\active}
69 % (Aug. 17, 1999 --ak)
70 % Japanese support. (pTeX is a free Japanese TeX by ASCII corp., Japan,
71 % and jTeX is a free Japanese TeX by NTT corp. and T. Sakurai)
75 \ifx\kanjiskip\undefined\else
79 \ifx\jkern\undefined\else
92 % We never want plain's \outer definition of \+ in Texinfo.
93 % For @tex, we can use \tabalign.
96 % Save some plain tex macros whose names we will redefine.
98 \let\ptexbullet=\bullet
104 \let\ptexequiv=\equiv
106 \let\ptexfootnote=\footnote
110 \let\ptexindent=\indent
111 \let\ptexinsert=\insert
114 \let\ptexnewwrite\newwrite
115 \let\ptexnoindent=\noindent
117 \let\ptexraggedright=\raggedright
123 {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
125 % If this character appears in an error message or help string, it
126 % starts a new line in the output.
129 % Use TeX 3.0's \inputlineno to get the line number, for better error
130 % messages, but if we're using an old version of TeX, don't do anything.
132 \ifx\inputlineno\thisisundefined
133 \let\linenumber = \empty % Pre-3.0.
135 \def\linenumber{l.\the\inputlineno:\space}
138 % Set up fixed words for English if not already set.
139 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{付録}\fi
140 \ifx\putwordChapter\undefined \gdef\putwordChapter{章}\fi
141 \ifx\putworderror\undefined \gdef\putworderror{エラー}\fi
142 \ifx\putwordfile\undefined \gdef\putwordfile{ファイル}\fi
143 \ifx\putwordin\undefined \gdef\putwordin{in}\fi
144 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
145 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
146 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
147 \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
148 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
149 \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
150 \ifx\putwordof\undefined \gdef\putwordof{of}\fi
151 \ifx\putwordon\undefined \gdef\putwordon{on}\fi
152 \ifx\putwordpage\undefined \gdef\putwordpage{ページ}\fi
153 \ifx\putwordsection\undefined \gdef\putwordsection{セクション}\fi
154 \ifx\putwordSection\undefined \gdef\putwordSection{セクション}\fi
155 \ifx\putwordsee\undefined \gdef\putwordsee{See}\fi
156 \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
157 \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
158 \ifx\putwordTOC\undefined \gdef\putwordTOC{目次}\fi
160 \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
161 \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
162 \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
163 \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
164 \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
165 \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
166 \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
167 \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
168 \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
169 \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
170 \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
171 \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
173 \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
174 \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
175 \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
176 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
177 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
179 % Since the category of space is not known, we have to be careful.
180 \chardef\spacecat = 10
181 \def\spaceisspace{\catcode`\ =\spacecat}
183 % sometimes characters are active, so we need control sequences.
184 \chardef\ampChar = `\&
185 \chardef\colonChar = `\:
186 \chardef\commaChar = `\,
187 \chardef\dashChar = `\-
188 \chardef\dotChar = `\.
189 \chardef\exclamChar= `\!
190 \chardef\hashChar = `\#
191 \chardef\lquoteChar= `\`
192 \chardef\questChar = `\?
193 \chardef\rquoteChar= `\'
194 \chardef\semiChar = `\;
195 \chardef\slashChar = `\/
196 \chardef\underChar = `\_
202 % The following is used inside several \edef's.
203 \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
207 Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
208 ap-pen-dix bit-map bit-maps
209 data-base data-bases eshell fall-ing half-way long-est man-u-script
210 man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
211 par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
213 stand-alone strong-est time-stamp time-stamps which-ever white-space
214 wide-spread wrap-around
217 % Margin to add to right of even pages, to left of odd pages.
218 \newdimen\bindingoffset
219 \newdimen\normaloffset
220 \newdimen\pagewidth \newdimen\pageheight
222 % For a final copy, take out the rectangles
223 % that mark overfull boxes (in case you have decided
224 % that the text looks ok even though it passes the margin).
226 \def\finalout{\overfullrule=0pt }
228 % Sometimes it is convenient to have everything in the transcript file
229 % and nothing on the terminal. We don't just call \tracingall here,
230 % since that produces some useless output on the terminal. We also make
231 % some effort to order the tracing commands to reduce output in the log
232 % file; cf. trace.sty in LaTeX.
234 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
238 \tracinglostchars2 % 2 gives us more in etex
243 \showboxbreadth\maxdimen \showboxdepth\maxdimen
244 \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
251 \tracingcommands3 % 3 gives us more in etex
255 % @errormsg{MSG}. Do the index-like expansions on MSG, but if things
256 % aren't perfect, it's not the end of the world, being an error message,
259 \def\errormsg{\begingroup \indexnofonts \doerrormsg}
260 \def\doerrormsg#1{\errmessage{#1}}
262 % add check for \lastpenalty to plain's definitions. If the last thing
263 % we did was a \nobreak, we don't want to insert more space.
265 \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
266 \removelastskip\penalty-50\smallskip\fi\fi}
267 \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
268 \removelastskip\penalty-100\medskip\fi\fi}
269 \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
270 \removelastskip\penalty-200\bigskip\fi\fi}
272 % Do @cropmarks to get crop marks.
275 \let\cropmarks = \cropmarkstrue
277 % Dimensions to add cropmarks at corners.
278 % Added by P. A. MacKay, 12 Nov. 1986
280 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
281 \newdimen\cornerlong \cornerlong=1pc
282 \newdimen\cornerthick \cornerthick=.3pt
283 \newdimen\topandbottommargin \topandbottommargin=.75in
285 % Output a mark which sets \thischapter, \thissection and \thiscolor.
286 % We dump everything together because we only have one kind of mark.
287 % This works because we only use \botmark / \topmark, not \firstmark.
289 % A mark contains a subexpression of the \ifcase ... \fi construct.
290 % \get*marks macros below extract the needed part using \ifcase.
292 % Another complication is to let the user choose whether \thischapter
293 % (\thissection) refers to the chapter (section) in effect at the top
294 % of a page, or that at the bottom of a page. The solution is
295 % described on page 260 of The TeXbook. It involves outputting two
296 % marks for the sectioning macros, one before the section break, and
297 % one after. I won't pretend I can describe this better than DEK...
299 \toks0=\expandafter{\lastchapterdefs}%
300 \toks2=\expandafter{\lastsectiondefs}%
301 \toks4=\expandafter{\prevchapterdefs}%
302 \toks6=\expandafter{\prevsectiondefs}%
303 \toks8=\expandafter{\lastcolordefs}%
305 \the\toks0 \the\toks2
306 \noexpand\or \the\toks4 \the\toks6
307 \noexpand\else \the\toks8
310 % \topmark doesn't work for the very first chapter (after the title
311 % page or the contents), so we use \firstmark there -- this gets us
312 % the mark with the chapter defs, unless the user sneaks in, e.g.,
313 % @setcolor (or @url, or @link, etc.) between @contents and the very
315 \def\gettopheadingmarks{%
317 \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
319 \def\getbottomheadingmarks{\ifcase1\botmark\fi}
320 \def\getcolormarks{\ifcase2\topmark\fi}
322 % Avoid "undefined control sequence" errors.
323 \def\lastchapterdefs{}
324 \def\lastsectiondefs{}
325 \def\prevchapterdefs{}
326 \def\prevsectiondefs{}
329 % Main output routine.
331 \output = {\onepageout{\pagecontents\PAGE}}
336 % \onepageout takes a vbox as an argument. Note that \pagecontents
337 % does insertions, but you have to call it yourself.
339 \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
341 \ifodd\pageno \advance\hoffset by \bindingoffset
342 \else \advance\hoffset by -\bindingoffset\fi
344 % Do this outside of the \shipout so @code etc. will be expanded in
345 % the headline as they should be, not taken literally (outputting ''code).
346 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
347 \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
348 \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
349 \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
352 % Have to do this stuff outside the \shipout because we want it to
353 % take effect in \write's, yet the group defined by the \vbox ends
354 % before the \shipout runs.
356 \indexdummies % don't expand commands in the output.
357 \normalturnoffactive % \ in index entries must not stay \, e.g., if
358 % the page break happens to be in the middle of an example.
359 % We don't want .vr (or whatever) entries like this:
360 % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
361 % "\acronym" won't work when it's read back in;
363 % {\code {{\tt \backslashcurfont }acronym}
365 % Do this early so pdf references go to the beginning of the page.
366 \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
368 \ifcropmarks \vbox to \outervsize\bgroup
370 \vskip-\topandbottommargin
372 \line{\ewtop\hfil\ewtop}%
375 \vbox{\moveleft\cornerthick\nstop}%
377 \vbox{\moveright\cornerthick\nstop}%
380 \vskip\topandbottommargin
382 \hfil % center the page within the outer (page) hsize.
383 \ifodd\pageno\hskip\bindingoffset\fi
389 \ifdim\ht\footlinebox > 0pt
390 % Only leave this space if the footline is nonempty.
391 % (We lessened \vsize for it in \oddfootingyyy.)
392 % The \baselineskip=24pt in plain's \makefootline has no effect.
398 \egroup % end of \vbox\bgroup
399 \hfil\egroup % end of (centering) \line\bgroup
400 \vskip\topandbottommargin plus1fill minus1fill
401 \boxmaxdepth = \cornerthick
404 \vbox{\moveleft\cornerthick\nsbot}%
406 \vbox{\moveright\cornerthick\nsbot}%
409 \line{\ewbot\hfil\ewbot}%
411 \egroup % \vbox from first cropmarks clause
413 }% end of \shipout\vbox
414 }% end of group with \indexdummies
416 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
419 \newinsert\margin \dimen\margin=\maxdimen
421 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
423 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
424 % marginal hacks, juha@viisa.uucp (Juha Takala)
425 \ifvoid\margin\else % marginal info is present
426 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
427 \dimen@=\dp#1\relax \unvbox#1\relax
428 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
429 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
432 % Here are the rules for the cropmarks. Note that they are
433 % offset so that the space between them is truly \outerhsize or \outervsize
434 % (P. A. MacKay, 12 November, 1986)
436 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
438 {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
439 \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
441 {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
443 % Parse an argument, then pass it to #1. The argument is the rest of
444 % the input line (except we remove a trailing comment). #1 should be a
445 % macro which expects an ordinary undelimited TeX argument.
447 \def\parsearg{\parseargusing{}}
448 \def\parseargusing#1#2{%
454 \parseargline\empty% Insert the \empty token, see \finishparsearg below.
458 \gdef\parseargline#1^^M{%
459 \endgroup % End of the group started in \parsearg.
460 \argremovecomment #1\comment\ArgTerm%
464 % First remove any @comment, then any @c comment.
465 \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
466 \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
468 % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
470 % \argremovec might leave us with trailing space, e.g.,
471 % @end itemize @c foo
472 % This space token undergoes the same procedure and is eventually removed
473 % by \finishparsearg.
475 \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
476 \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
477 \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
480 % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
481 \let\temp\finishparsearg
483 \let\temp\argcheckspaces
485 % Put the space token in:
489 % If a _delimited_ argument is enclosed in braces, they get stripped; so
490 % to get _exactly_ the rest of the line, we had to prevent such situation.
491 % We prepended an \empty token at the very beginning and we expand it now,
492 % just before passing the control to \argtorun.
493 % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
494 % either the null string, or it ends with \^^M---thus there is no danger
495 % that a pair of braces would be stripped.
497 % But first, we have to remove the trailing space token.
499 \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
501 % \parseargdef\foo{...}
502 % is roughly equivalent to
503 % \def\foo{\parsearg\Xfoo}
506 % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
507 % favourite TeX trick. --kasal, 16nov03
510 \expandafter \doparseargdef \csname\string#1\endcsname #1%
512 \def\doparseargdef#1#2{%
517 % Several utility definitions with active space:
522 % Make each space character in the input produce a normal interword
523 % space in the output. Don't allow a line break at this space, as this
524 % is used only in environments like @example, where each line of input
525 % should produce a line of output anyway.
527 \gdef\sepspaces{\obeyspaces\let =\tie}
529 % If an index command is used in an @example environment, any spaces
530 % therein should become regular spaces in the raw index file, not the
531 % expansion of \tie (\leavevmode \penalty \@M \ ).
532 \gdef\unsepspaces{\let =\space}
536 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
538 % Define the framework for environments in texinfo.tex. It's used like this:
543 % It's the responsibility of \envdef to insert \begingroup before the
544 % actual body; @end closes the group after calling \Efoo. \envdef also
545 % defines \thisenv, so the current environment is known; @end checks
546 % whether the environment name matches. The \checkenv macro can also be
547 % used to check whether the current environment is the one expected.
549 % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
550 % are not treated as environments; they don't open a group. (The
551 % implementation of @end takes care not to call \endgroup in this
555 % At run-time, environments start with this:
556 \def\startenvironment#1{\begingroup\def\thisenv{#1}}
560 % ... but they get defined via ``\envdef\foo{...}'':
561 \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
562 \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
564 % Check whether we're in the right environment:
573 % Environment mismatch, #1 expected:
576 \errmessage{This command can appear only \inenvironment\temp,
577 not \inenvironment\thisenv}%
579 \def\inenvironment#1{%
581 outside of any environment%
583 in environment \expandafter\string#1%
587 % @end foo executes the definition of \Efoo.
588 % But first, it executes a specialized version of \checkenv
591 \if 1\csname iscond.#1\endcsname
593 % The general wording of \badenverr may not be ideal.
594 \expandafter\checkenv\csname#1\endcsname
595 \csname E#1\endcsname
600 \newhelp\EMsimple{Press RETURN to continue.}
603 % Be sure we're in horizontal mode when doing a tie, since we make space
604 % equivalent to this in @example-like environments. Otherwise, a space
605 % at the beginning of a line will start with \penalty -- and
606 % since \penalty is valid in vertical mode, we'd end up putting the
607 % penalty on the vertical list instead of in the new paragraph.
609 % Avoid using \@M directly, because that causes trouble
610 % if the definition is written into an index file.
611 \global\let\tiepenalty = \@M
612 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
615 % @: forces normal size whitespace following.
616 \def\:{\spacefactor=1000 }
618 % @* forces a line break.
619 \def\*{\unskip\hfil\break\hbox{}\ignorespaces}
621 % @/ allows a line break.
624 % @. is an end-of-sentence period.
625 \def\.{.\spacefactor=\endofsentencespacefactor\space}
627 % @! is an end-of-sentence bang.
628 \def\!{!\spacefactor=\endofsentencespacefactor\space}
630 % @? is an end-of-sentence query.
631 \def\?{?\spacefactor=\endofsentencespacefactor\space}
633 % @frenchspacing on|off says whether to put extra space after punctuation.
638 \parseargdef\frenchspacing{%
640 \ifx\temp\onword \plainfrenchspacing
641 \else\ifx\temp\offword \plainnonfrenchspacing
644 \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
648 % @w prevents a word break. Without the \leavevmode, @w at the
649 % beginning of a paragraph, when TeX is still in vertical mode, would
650 % produce a whole line of output instead of starting the paragraph.
651 \def\w#1{\leavevmode\hbox{#1}}
653 % @group ... @end group forces ... to be all on one page, by enclosing
654 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
655 % to keep its height that of a normal line. According to the rules for
656 % \topskip (p.114 of the TeXbook), the glue inserted is
657 % max (\topskip - \ht (first item), 0). If that height is large,
658 % therefore, no glue is inserted, and the space between the headline and
659 % the text is small, which looks bad.
661 % Another complication is that the group might be very large. This can
662 % cause the glue on the previous page to be unduly stretched, because it
663 % does not have much material. In this case, it's better to add an
664 % explicit \vfill so that the extra space is at the bottom. The
665 % threshold for doing this is if the group is more than \vfilllimit
666 % percent of a page (\vfilllimit can be changed inside of @tex).
672 \ifnum\catcode`\^^M=\active \else
673 \errhelp = \groupinvalidhelp
674 \errmessage{@group invalid in context where filling is enabled}%
678 \setbox\groupbox = \vtop\bgroup
679 % Do @comment since we are called inside an environment such as
680 % @example, where each end-of-line in the input causes an
681 % end-of-line in the output. We don't want the end-of-line after
682 % the `@group' to put extra space in the output. Since @group
683 % should appear on a line by itself (according to the Texinfo
684 % manual), we don't worry about eating any user text.
688 % The \vtop produces a box with normal height and large depth; thus, TeX puts
689 % \baselineskip glue before it, and (when the next line of text is done)
690 % \lineskip glue after it. Thus, space below is not quite equal to space
691 % above. But it's pretty close.
693 % To get correct interline space between the last line of the group
694 % and the first line afterwards, we have to propagate \prevdepth.
695 \endgraf % Not \par, as it may have been set to \lisppar.
696 \global\dimen1 = \prevdepth
697 \egroup % End the \vtop.
698 % \dimen0 is the vertical size of the group's box.
699 \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
700 % \dimen2 is how much space is left on the page (more or less).
701 \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
702 % if the group doesn't fit on the current page, and it's a big big
703 % group, force a page break.
704 \ifdim \dimen0 > \dimen2
705 \ifdim \pagetotal < \vfilllimit\pageheight
714 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
715 % message, so this ends up printing `@group can only ...'.
717 \newhelp\groupinvalidhelp{%
718 group can only be used in environments such as @example,^^J%
719 where each line of input produces a line of output.}
721 % @need space-in-mils
722 % forces a page break if there is not space-in-mils remaining.
724 \newdimen\mil \mil=0.001in
727 % Ensure vertical mode, so we don't make a big box in the middle of a
731 % If the @need value is less than one line space, it's useless.
733 \dimen2 = \ht\strutbox
734 \advance\dimen2 by \dp\strutbox
735 \ifdim\dimen0 > \dimen2
737 % Do a \strut just to make the height of this box be normal, so the
738 % normal leading is inserted relative to the preceding line.
739 % And a page break here is fine.
740 \vtop to #1\mil{\strut\vfil}%
742 % TeX does not even consider page breaks if a penalty added to the
743 % main vertical list is 10000 or more. But in order to see if the
744 % empty box we just added fits on the page, we must make it consider
745 % page breaks. On the other hand, we don't want to actually break the
746 % page after the empty box. So we use a penalty of 9999.
748 % There is an extremely small chance that TeX will actually break the
749 % page at this \penalty, if there are no other feasible breakpoints in
750 % sight. (If the user is using lots of big @group commands, which
751 % almost-but-not-quite fill up a page, TeX will have a hard time doing
752 % good page breaking, for example.) However, I could not construct an
753 % example where a page broke at this \penalty; if it happens in a real
754 % document, then we can reconsider our strategy.
757 % Back up by the size of the box, whether we did a page break or not.
760 % Do not allow a page break right after this kern.
765 % @br forces paragraph break (and is undocumented).
769 % @page forces the start of a new page.
771 \def\page{\par\vfill\supereject}
774 % outputs text on separate line in roman font, starting at standard page margin
776 % This records the amount of indent in the innermost environment.
777 % That's how much \exdent should take out.
778 \newskip\exdentamount
780 % This defn is used inside fill environments such as @defun.
781 \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
783 % This defn is used inside nofill environments such as @example.
784 \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
785 \leftline{\hskip\leftskip{\rm#1}}}}
787 % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
788 % paragraph. For more general purposes, use the \margin insertion
789 % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
791 \newskip\inmarginspacing \inmarginspacing=1cm
792 \def\strutdepth{\dp\strutbox}
794 \def\doinmargin#1#2{\strut\vadjust{%
797 \vtop to \strutdepth{%
798 \baselineskip=\strutdepth
800 % if you have multiple lines of stuff to put here, you'll need to
801 % make the vbox yourself of the appropriate size.
803 \llap{\ignorespaces #2\hskip\inmarginspacing}%
805 \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
810 \def\inleftmargin{\doinmargin l}
811 \def\inrightmargin{\doinmargin r}
813 % @inmargin{TEXT [, RIGHT-TEXT]}
814 % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
815 % else use TEXT for both).
817 \def\inmargin#1{\parseinmargin #1,,\finish}
818 \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
819 \setbox0 = \hbox{\ignorespaces #2}%
821 \def\lefttext{#1}% have both texts
824 \def\lefttext{#1}% have only one text
829 \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
831 \def\temp{\inleftmargin\lefttext}%
836 % @| inserts a changebar to the left of the current line. It should
837 % surround any changed text. This approach does *not* work if the
838 % change spans more than two lines of output. To handle that, we would
839 % have adopt a much more difficult approach (putting marks into the main
840 % vertical list for the beginning and end of each change). This command
841 % is not documented, not supported, and doesn't work.
844 % \vadjust can only be used in horizontal mode.
847 % Append this vertical mode material after the current line in the output.
849 % We want to insert a rule with the height and depth of the current
850 % leading; that is exactly what \strutbox is supposed to record.
853 % \vadjust-items are inserted at the left edge of the type. So
854 % the \llap here moves out into the left-hand margin.
857 % For a thicker or thinner bar, change the `1pt'.
858 \vrule height\baselineskip width1pt
860 % This is the space between the bar and the text.
866 % @include FILE -- \input text of FILE.
868 \def\include{\parseargusing\filenamecatcodes\includezzz}
873 \makevalueexpandable % we want to expand any @value in FILE.
874 \turnoffactive % and allow special characters in the expansion
875 \indexnofonts % Allow `@@' and other weird things in file names.
876 \wlog{texinfo.tex: doing @include of #1^^J}%
877 \edef\temp{\noexpand\input #1 }%
879 % This trickery is to read FILE outside of a group, in case it makes
885 \def\filenamecatcodes{%
899 \def\pushthisfilestack{%
900 \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
902 \def\pushthisfilestackX{%
903 \expandafter\pushthisfilestackY\thisfile\StackTerm
905 \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
906 \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
909 \def\popthisfilestack{\errthisfilestackempty}
910 \def\errthisfilestackempty{\errmessage{Internal error:
911 the stack of filenames is empty.}}
916 % outputs that line, centered.
918 \parseargdef\center{%
920 \let\centersub\centerH
922 \let\centersub\centerV
924 \centersub{\hfil \ignorespaces#1\unskip \hfil}%
925 \let\centersub\relax % don't let the definition persist, just in case
929 \advance\hsize by -\leftskip
930 \advance\hsize by -\rightskip
935 \newcount\centerpenalty
937 % The idea here is the same as in \startdefun, \cartouche, etc.: if
938 % @center is the first thing after a section heading, we need to wipe
939 % out the negative parskip inserted by \sectionheading, but still
940 % prevent a page break here.
941 \centerpenalty = \lastpenalty
942 \ifnum\centerpenalty>10000 \vskip\parskip \fi
943 \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
944 \line{\kern\leftskip #1\kern\rightskip}%
947 % @sp n outputs n lines of vertical space
949 \parseargdef\sp{\vskip #1\baselineskip}
951 % @comment ...line which is ignored...
952 % @c is the same as @comment
953 % @ignore ... @end ignore is another way to write a comment
955 \def\comment{\begingroup \catcode`\^^M=\other%
956 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
958 {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
962 % @paragraphindent NCHARS
963 % We'll use ems for NCHARS, close enough.
964 % NCHARS can also be the word `asis' or `none'.
965 % We cannot feasibly implement @paragraphindent asis, though.
967 \def\asisword{asis} % no translation, these are keywords
970 \parseargdef\paragraphindent{%
975 \defaultparindent = 0pt
977 \defaultparindent = #1em
980 \parindent = \defaultparindent
983 % @exampleindent NCHARS
984 % We'll use ems for NCHARS like @paragraphindent.
985 % It seems @exampleindent asis isn't necessary, but
986 % I preserve it to make it similar to @paragraphindent.
987 \parseargdef\exampleindent{%
994 \lispnarrowing = #1em
999 % @firstparagraphindent WORD
1000 % If WORD is `none', then suppress indentation of the first paragraph
1001 % after a section heading. If WORD is `insert', then do indent at such
1004 % The paragraph indentation is suppressed or not by calling
1005 % \suppressfirstparagraphindent, which the sectioning commands do.
1006 % We switch the definition of this back and forth according to WORD.
1007 % By default, we suppress indentation.
1009 \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
1010 \def\insertword{insert}
1012 \parseargdef\firstparagraphindent{%
1015 \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
1016 \else\ifx\temp\insertword
1017 \let\suppressfirstparagraphindent = \relax
1019 \errhelp = \EMsimple
1020 \errmessage{Unknown @firstparagraphindent option `\temp'}%
1024 % Here is how we actually suppress indentation. Redefine \everypar to
1025 % \kern backwards by \parindent, and then reset itself to empty.
1027 % We also make \indent itself not actually do anything until the next
1030 \gdef\dosuppressfirstparagraphindent{%
1032 \restorefirstparagraphindent
1036 \restorefirstparagraphindent
1039 \global\everypar = {%
1041 \restorefirstparagraphindent
1045 \gdef\restorefirstparagraphindent{%
1046 \global \let \indent = \ptexindent
1047 \global \let \noindent = \ptexnoindent
1048 \global \everypar = {}%
1052 % @refill is a no-op.
1055 % If working on a large document in chapters, it is convenient to
1056 % be able to disable indexing, cross-referencing, and contents, for test runs.
1057 % This is done with @novalidate (before @setfilename).
1059 \newif\iflinks \linkstrue % by default we want the aux files.
1060 \let\novalidate = \linksfalse
1062 % @setfilename is done at the beginning of every texinfo file.
1063 % So open here the files we need to have open while reading the input.
1064 % This makes it possible to make a .fmt file for texinfo.
1066 \fixbackslash % Turn off hack to swallow `\input texinfo'.
1069 % Open the new aux file. TeX will close it automatically at exit.
1070 \immediate\openout\auxfile=\jobname.aux
1071 \fi % \openindices needs to do some work in any case.
1073 \let\setfilename=\comment % Ignore extra @setfilename cmds.
1075 % If texinfo.cnf is present on the system, read it.
1076 % Useful for site-wide @afourpaper, etc.
1077 \openin 1 texinfo.cnf
1078 \ifeof 1 \else \input texinfo.cnf \fi
1081 \comment % Ignore the actual filename.
1084 % Called from \setfilename.
1096 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
1100 % adobe `portable' document format
1104 \newcount\filenamelength
1113 \newif\ifpdfmakepagedest
1115 % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
1116 % can be set). So we test for \relax and 0 as well as being undefined.
1117 \ifx\pdfoutput\thisisundefined
1119 \ifx\pdfoutput\relax
1128 % PDF uses PostScript string constants for the names of xref targets,
1129 % for display in the outlines, and in other places. Thus, we have to
1130 % double any backslashes. Otherwise, a name like "\node" will be
1131 % interpreted as a newline (\n), followed by o, d, e. Not good.
1133 % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
1134 % related messages. The final outcome is that it is up to the TeX user
1135 % to double the backslashes and otherwise make the string valid, so
1136 % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
1137 % do this reliably, so we use it.
1139 % #1 is a control sequence in which to do the replacements,
1141 \def\txiescapepdf#1{%
1142 \ifx\pdfescapestring\thisisundefined
1143 % No primitive available; should we give a warning or log?
1144 % Many times it won't matter.
1146 % The expandable \pdfescapestring primitive escapes parentheses,
1147 % backslashes, and other special chars.
1148 \xdef#1{\pdfescapestring{#1}}%
1152 \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
1153 with PDF output, and none of those formats could be found. (.eps cannot
1154 be supported due to the design of the PDF format; use regular TeX (DVI
1159 % Color manipulation macros based on pdfcolor.tex,
1160 % except using rgb instead of cmyk; the latter is said to render as a
1161 % very dark gray on-screen and a very dark halftone in print, instead
1163 \def\rgbDarkRed{0.50 0.09 0.12}
1164 \def\rgbBlack{0 0 0}
1166 % k sets the color for filling (usual text, etc.);
1167 % K sets the color for stroking (thin rules, e.g., normal _'s).
1168 \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
1170 % Set color, and create a mark which defines \thiscolor accordingly,
1171 % so that \makeheadline knows which color to restore.
1173 \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
1178 \def\maincolor{\rgbBlack}
1179 \pdfsetcolor{\maincolor}
1180 \edef\thiscolor{\maincolor}
1181 \def\lastcolordefs{}
1185 \line{\pdfsetcolor{\maincolor}\the\footline}%
1193 % Extract \thiscolor definition from the marks.
1195 % Typeset the headline with \maincolor, then restore the color.
1196 \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
1204 \pdfcatalog{/PageMode /UseOutlines}
1206 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1207 \def\dopdfimage#1#2#3{%
1208 \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1209 \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1211 % pdftex (and the PDF format) support .pdf, .png, .jpg (among
1212 % others). Let's try in that order, PDF first since if
1213 % someone has a scalable image, presumably better to use that than a
1215 \let\pdfimgext=\empty
1217 \openin 1 #1.pdf \ifeof 1
1218 \openin 1 #1.PDF \ifeof 1
1219 \openin 1 #1.png \ifeof 1
1220 \openin 1 #1.jpg \ifeof 1
1221 \openin 1 #1.jpeg \ifeof 1
1222 \openin 1 #1.JPG \ifeof 1
1223 \errhelp = \nopdfimagehelp
1224 \errmessage{Could not find image file #1 for pdf}%
1225 \else \gdef\pdfimgext{JPG}%
1227 \else \gdef\pdfimgext{jpeg}%
1229 \else \gdef\pdfimgext{jpg}%
1231 \else \gdef\pdfimgext{png}%
1233 \else \gdef\pdfimgext{PDF}%
1235 \else \gdef\pdfimgext{pdf}%
1240 % without \immediate, ancient pdftex seg faults when the same image is
1241 % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
1242 \ifnum\pdftexversion < 14
1245 \immediate\pdfximage
1247 \ifdim \wd0 >0pt width \pdfimagewidth \fi
1248 \ifdim \wd2 >0pt height \pdfimageheight \fi
1249 \ifnum\pdftexversion<13
1254 \ifnum\pdftexversion < 14 \else
1255 \pdfrefximage \pdflastximage
1259 % We have to set dummies so commands such as @code, and characters
1260 % such as \, aren't expanded when present in a section title.
1263 \makevalueexpandable
1264 \def\pdfdestname{#1}%
1265 \txiescapepdf\pdfdestname
1266 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1269 % used to mark target names; must be expandable.
1272 % by default, use a color that is dark enough to print on paper as
1273 % nearly black, but still distinguishable for online viewing.
1274 \def\urlcolor{\rgbDarkRed}
1275 \def\linkcolor{\rgbDarkRed}
1276 \def\endlink{\setcolor{\maincolor}\pdfendlink}
1278 % Adding outlines to PDF; macros for calculating structure of outlines
1279 % come from Petr Olsak
1280 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
1281 \else \csname#1\endcsname \fi}
1282 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
1283 \advance\tempnum by 1
1284 \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
1286 % #1 is the section text, which is what will be displayed in the
1287 % outline by the pdf viewer. #2 is the pdf expression for the number
1288 % of subentries (or empty, for subsubsections). #3 is the node text,
1289 % which might be empty if this toc entry had no corresponding node.
1290 % #4 is the page number
1292 \def\dopdfoutline#1#2#3#4{%
1293 % Generate a link to the node text if that exists; else, use the
1294 % page number. We could generate a destination for the section
1295 % text in the case where a section has no node, but it doesn't
1296 % seem worth the trouble, since most documents are normally structured.
1297 \edef\pdfoutlinedest{#3}%
1298 \ifx\pdfoutlinedest\empty
1299 \def\pdfoutlinedest{#4}%
1301 \txiescapepdf\pdfoutlinedest
1304 % Also escape PDF chars in the display string.
1305 \edef\pdfoutlinetext{#1}%
1306 \txiescapepdf\pdfoutlinetext
1308 \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
1311 \def\pdfmakeoutlines{%
1313 % Read toc silently, to get counts of subentries for \pdfoutline.
1314 \def\partentry##1##2##3##4{}% ignore parts in the outlines
1315 \def\numchapentry##1##2##3##4{%
1316 \def\thischapnum{##2}%
1318 \def\thissubsecnum{0}%
1320 \def\numsecentry##1##2##3##4{%
1321 \advancenumber{chap\thischapnum}%
1322 \def\thissecnum{##2}%
1323 \def\thissubsecnum{0}%
1325 \def\numsubsecentry##1##2##3##4{%
1326 \advancenumber{sec\thissecnum}%
1327 \def\thissubsecnum{##2}%
1329 \def\numsubsubsecentry##1##2##3##4{%
1330 \advancenumber{subsec\thissubsecnum}%
1332 \def\thischapnum{0}%
1334 \def\thissubsecnum{0}%
1336 % use \def rather than \let here because we redefine \chapentry et
1337 % al. a second time, below.
1338 \def\appentry{\numchapentry}%
1339 \def\appsecentry{\numsecentry}%
1340 \def\appsubsecentry{\numsubsecentry}%
1341 \def\appsubsubsecentry{\numsubsubsecentry}%
1342 \def\unnchapentry{\numchapentry}%
1343 \def\unnsecentry{\numsecentry}%
1344 \def\unnsubsecentry{\numsubsecentry}%
1345 \def\unnsubsubsecentry{\numsubsubsecentry}%
1348 % Read toc second time, this time actually producing the outlines.
1349 % The `-' means take the \expnumber as the absolute number of
1350 % subentries, which we calculated on our first read of the .toc above.
1352 % We use the node names as the destinations.
1353 \def\numchapentry##1##2##3##4{%
1354 \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
1355 \def\numsecentry##1##2##3##4{%
1356 \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
1357 \def\numsubsecentry##1##2##3##4{%
1358 \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
1359 \def\numsubsubsecentry##1##2##3##4{% count is always zero
1360 \dopdfoutline{##1}{}{##3}{##4}}%
1362 % PDF outlines are displayed using system fonts, instead of
1363 % document fonts. Therefore we cannot use special characters,
1364 % since the encoding is unknown. For example, the eogonek from
1365 % Latin 2 (0xea) gets translated to a | character. Info from
1366 % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
1368 % TODO this right, we have to translate 8-bit characters to
1369 % their "best" equivalent, based on the @documentencoding. Too
1370 % much work for too little return. Just use the ASCII equivalents
1371 % we use for the index sort strings.
1375 % We can have normal brace characters in the PDF outlines, unlike
1376 % Texinfo index files. So set that up.
1377 \def\{{\lbracecharliteral}%
1378 \def\}{\rbracecharliteral}%
1379 \catcode`\\=\active \otherbackslash
1380 \input \tocreadfilename
1383 {\catcode`[=1 \catcode`]=2
1384 \catcode`{=\other \catcode`}=\other
1385 \gdef\lbracecharliteral[{]%
1386 \gdef\rbracecharliteral[}]%
1389 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1390 \ifx\PP\D\let\nextsp\relax
1391 \else\let\nextsp\skipspaces
1392 \addtokens{\filename}{\PP}%
1393 \advance\filenamelength by 1
1396 \def\getfilename#1{%
1398 % If we don't expand the argument now, \skipspaces will get
1399 % snagged on things like "@value{foo}".
1401 \expandafter\skipspaces\temp|\relax
1403 \ifnum\pdftexversion < 14
1404 \let \startlink \pdfannotlink
1406 \let \startlink \pdfstartlink
1408 % make a live url in pdf output.
1411 % it seems we really need yet another set of dummies; have not
1412 % tried to figure out what each command should do in the context
1413 % of @url. for now, just make @/ a no-op, that's the only one
1414 % people have actually reported a problem with.
1416 \normalturnoffactive
1419 \makevalueexpandable
1420 % do we want to go so far as to use \indexnofonts instead of just
1421 % special-casing \var here?
1424 \leavevmode\setcolor{\urlcolor}%
1425 \startlink attr{/Border [0 0 0]}%
1426 user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
1428 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
1429 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1430 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1431 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1433 \expandafter\poptoks\the\toksA|ENDTOKS|\relax
1435 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1436 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1437 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1439 \ifnum0=\countA\else\makelink\fi
1440 \ifx\first.\let\next=\done\else
1442 \addtokens{\toksB}{\the\toksD}
1443 \ifx\first,\addtokens{\toksB}{\space}\fi
1445 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
1447 \def\makelink{\addtokens{\toksB}%
1448 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1450 \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
1451 \setcolor{\linkcolor}#1\endlink}
1452 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1455 \let\pdfmkdest = \gobble
1456 \let\pdfurl = \gobble
1457 \let\endlink = \relax
1458 \let\setcolor = \gobble
1459 \let\pdfsetcolor = \gobble
1460 \let\pdfmakeoutlines = \relax
1461 \fi % \ifx\pdfoutput
1466 % Change the current font style to #1, remembering it in \curfontstyle.
1467 % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
1468 % italics, not bold italics.
1470 \def\setfontstyle#1{%
1471 \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
1472 \csname ten#1\endcsname % change the current font
1475 % Select #1 fonts with the current style.
1477 \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
1479 % Japanese fonts. (--ak)
1481 \csname newfam\endcsname\mcfam
1482 \csname newfam\endcsname\gtfam
1483 \def\mc{\fam\mcfam \setfontstyle{min}}
1484 \def\gt{\fam\gtfam \setfontstyle{gt}}
1485 \def\rm{\mc \fam=0 \setfontstyle{rm}}
1486 \def\it{\fam=\itfam \setfontstyle{it}}
1487 \def\sl{\fam=\slfam \setfontstyle{sl}}
1488 \def\bf{\gt \fam\bffam \setfontstyle{bf}}\def\bfstylename{bf}
1489 \def\tt{\fam=\ttfam \setfontstyle{tt}}
1491 \def\rm{\fam=0 \setfontstyle{rm}}
1492 \def\it{\fam=\itfam \setfontstyle{it}}
1493 \def\sl{\fam=\slfam \setfontstyle{sl}}
1494 \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
1495 \def\tt{\fam=\ttfam \setfontstyle{tt}}
1498 % Unfortunately, we have to override this for titles and the like, since
1499 % in those cases "rm" is bold. Sigh.
1501 \def\rmisbold{\rm\gt\def\curfontstyle{bf}}
1503 \def\rmisbold{\rm\def\curfontstyle{bf}}
1506 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
1507 % So we set up a \sf.
1510 \def\sf{\gt \fam\sffam \setfontstyle{sf}}
1512 \def\sf{\fam=\sffam \setfontstyle{sf}}
1514 \let\li = \sf % Sometimes we call it \li, not \sf.
1516 % We don't need math for this font style.
1517 \def\ttsl{\setfontstyle{ttsl}}
1520 % Set the baselineskip to #1, and the lineskip and strut size
1521 % correspondingly. There is no deep meaning behind these magic numbers
1522 % used as factors; they just match (closely enough) what Knuth defined.
1524 \def\lineskipfactor{.08333}
1525 \def\strutheightpercent{.70833}
1526 \def\strutdepthpercent {.29167}
1528 % can get a sort of poor man's double spacing by redefining this.
1529 \def\baselinefactor{1}
1531 \newdimen\textleading
1534 \normalbaselineskip = \baselinefactor\dimen0
1535 \normallineskip = \lineskipfactor\normalbaselineskip
1537 \setbox\strutbox =\hbox{%
1538 \vrule width0pt height\strutheightpercent\baselineskip
1539 depth \strutdepthpercent \baselineskip
1543 % PDF CMaps. See also LaTeX's t1.cmap.
1545 % do nothing with this by default.
1546 \expandafter\let\csname cmapOT1\endcsname\gobble
1547 \expandafter\let\csname cmapOT1IT\endcsname\gobble
1548 \expandafter\let\csname cmapOT1TT\endcsname\gobble
1550 % if we are producing pdf, and we have \pdffontattr, then define cmaps.
1551 % (\pdffontattr was introduced many years ago, but people still run
1552 % older pdftex's; it's easy to conditionalize, so we do.)
1553 \ifpdf \ifx\pdffontattr\thisisundefined \else
1555 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1556 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1557 %%DocumentNeededResources: ProcSet (CIDInit)
1558 %%IncludeResource: ProcSet (CIDInit)
1559 %%BeginResource: CMap (TeX-OT1-0)
1560 %%Title: (TeX-OT1-0 TeX OT1 0)
1563 /CIDInit /ProcSet findresource begin
1571 /CMapName /TeX-OT1-0 def
1573 1 begincodespacerange
1629 CMapName currentdict /CMap defineresource pop
1635 \expandafter\edef\csname cmapOT1\endcsname#1{%
1636 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1641 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1642 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1643 %%DocumentNeededResources: ProcSet (CIDInit)
1644 %%IncludeResource: ProcSet (CIDInit)
1645 %%BeginResource: CMap (TeX-OT1IT-0)
1646 %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
1649 /CIDInit /ProcSet findresource begin
1657 /CMapName /TeX-OT1IT-0 def
1659 1 begincodespacerange
1717 CMapName currentdict /CMap defineresource pop
1723 \expandafter\edef\csname cmapOT1IT\endcsname#1{%
1724 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1729 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1730 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1731 %%DocumentNeededResources: ProcSet (CIDInit)
1732 %%IncludeResource: ProcSet (CIDInit)
1733 %%BeginResource: CMap (TeX-OT1TT-0)
1734 %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
1737 /CIDInit /ProcSet findresource begin
1745 /CMapName /TeX-OT1TT-0 def
1747 1 begincodespacerange
1792 CMapName currentdict /CMap defineresource pop
1798 \expandafter\edef\csname cmapOT1TT\endcsname#1{%
1799 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1804 % Set the font macro #1 to the font named \fontprefix#2.
1805 % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
1806 % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
1814 \def\setfont#1#2#3#4#5{%
1815 \font#1=\fontprefix#2#3 scaled #4
1816 \csname cmap#5\endcsname#1%
1818 % This is what gets called when #5 of \setfont is empty.
1823 % Use cm as the default font prefix.
1824 % To specify the font prefix, you must define \fontprefix
1825 % before you read in texinfo.tex.
1826 \ifx\fontprefix\thisisundefined
1829 % Support font families that don't use the same naming scheme as CM.
1831 \def\rmbshape{bx} % where the normal face is bold
1836 \def\ttslshape{sltt}
1846 % Definitions for a main text size of 11pt. (The default in Texinfo.)
1848 \def\definetextfontsizexi{%
1849 % Text fonts (11.2pt, magstep1).
1850 \def\textnominalsize{11pt}
1851 \edef\mainmagstep{\magstephalf}
1852 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
1853 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
1855 \font\textmc=min10 scaled \mainmagstep
1856 \font\textgt=goth10 scaled \mainmagstep
1859 \jfont\textmc=dm10 scaled \mainmagstep
1860 \jfont\textgt=dg10 scaled \mainmagstep
1862 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
1863 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
1864 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
1865 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
1866 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
1867 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
1868 \font\texti=cmmi10 scaled \mainmagstep
1869 \font\textsy=cmsy10 scaled \mainmagstep
1870 \def\textecsize{1095}
1872 % A few fonts for @defun names and args.
1874 \setfont\defbf\bfshape{10}{\magstep1}{OT1}
1875 \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
1876 \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
1877 \font\defmc=min10 scaled \magstep1
1878 \font\defgt=goth10 scaled \magstep1
1879 \def\df{\let\tentt=\deftt \let\tenmin=\defmc
1880 \let\tengt=\defgt \let\tenbf=\defbf \let\tenttsl=\defttsl \bf}
1882 \setfont\defbf\bfshape{10}{\magstep1}{OT1}
1883 \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
1884 \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
1885 \jfont\defmc=dm10 scaled \magstep1
1886 \jfont\defgt=dg10 scaled \magstep1
1887 \def\df{\let\tentt=\deftt \let\tenmin=\defmc
1888 \let\tengt=\defgt\let\tenbf=\defbf \let\tenttsl=\defttsl \bf}
1890 \setfont\defbf\bfshape{10}{\magstep1}{OT1}
1891 \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
1892 \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
1893 \def\df{\let\tentt=\deftt \let\tenbf=\defbf \let\tenttsl=\defttsl \bf}
1896 % Fonts for indices, footnotes, small examples (9pt).
1897 \def\smallnominalsize{9pt}
1898 \setfont\smallrm\rmshape{9}{1000}{OT1}
1899 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
1900 \setfont\smallbf\bfshape{10}{900}{OT1}
1901 \setfont\smallit\itshape{9}{1000}{OT1IT}
1902 \setfont\smallsl\slshape{9}{1000}{OT1}
1903 \setfont\smallsf\sfshape{9}{1000}{OT1}
1904 \setfont\smallsc\scshape{10}{900}{OT1}
1905 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
1916 \def\smallecsize{0900}
1918 % Fonts for small examples (8pt).
1919 \def\smallernominalsize{8pt}
1920 \setfont\smallerrm\rmshape{8}{1000}{OT1}
1921 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
1922 \setfont\smallerbf\bfshape{10}{800}{OT1}
1923 \setfont\smallerit\itshape{8}{1000}{OT1IT}
1924 \setfont\smallersl\slshape{8}{1000}{OT1}
1925 \setfont\smallersf\sfshape{8}{1000}{OT1}
1926 \setfont\smallersc\scshape{10}{800}{OT1}
1927 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
1928 \font\smalleri=cmmi8
1929 \font\smallersy=cmsy8
1931 \font\smallermc=min8
1932 \font\smallergt=goth8
1935 \jfont\smallermc=dm8
1936 \jfont\smallergt=dg8
1938 \def\smallerecsize{0800}
1940 % Fonts for title page (20.4pt):
1941 \def\titlenominalsize{20pt}
1942 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
1943 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
1944 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
1945 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
1946 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
1947 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
1949 \font\titlemc=min10 scaled \magstep4
1950 \font\titlegt=goth10 scaled \magstep4
1953 \jfont\titlemc=dm10 scaled \magstep4
1954 \jfont\titlegt=dg10 scaled \magstep4
1956 \let\titlebf=\titlerm
1957 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
1958 \font\titlei=cmmi12 scaled \magstep3
1959 \font\titlesy=cmsy10 scaled \magstep4
1960 \def\titleecsize{2074}
1962 % Chapter (and unnumbered) fonts (17.28pt).
1963 \def\chapnominalsize{17pt}
1964 \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
1965 \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
1966 \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
1967 \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
1968 \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
1969 \setfont\chapsf\sfbshape{17}{1000}{OT1}
1971 \font\chapmc=min10 scaled \magstep3
1972 \font\chapgt=goth10 scaled \magstep3
1975 \jfont\chapmc=dm10 scaled \magstep3
1976 \jfont\chapgt=dg10 scaled \magstep3
1979 \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
1980 \font\chapi=cmmi12 scaled \magstep2
1981 \font\chapsy=cmsy10 scaled \magstep3
1982 \def\chapecsize{1728}
1984 % Section fonts (14.4pt).
1985 \def\secnominalsize{14pt}
1986 \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
1987 \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
1988 \setfont\secsl\slbshape{10}{\magstep2}{OT1}
1989 \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
1990 \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
1991 \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
1993 \font\secmc=min10 scaled \magstep2
1994 \font\secgt=goth10 scaled \magstep2
1997 \jfont\secmc=dm10 scaled \magstep2
1998 \jfont\secgt=dg10 scaled \magstep2
2001 \setfont\secsc\scbshape{10}{\magstep2}{OT1}
2002 \font\seci=cmmi12 scaled \magstep1
2003 \font\secsy=cmsy10 scaled \magstep2
2004 \def\sececsize{1440}
2006 % Subsection fonts (13.15pt).
2007 \def\ssecnominalsize{13pt}
2008 \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
2009 \setfont\ssecit\itbshape{10}{1315}{OT1IT}
2010 \setfont\ssecsl\slbshape{10}{1315}{OT1}
2011 \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
2012 \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
2013 \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
2015 \font\ssecmc=min10 scaled 1315
2016 \font\ssecgt=goth10 scaled 1315
2019 \jfont\ssecmc=dm10 scaled 1315
2020 \jfont\ssecgt=dg10 scaled 1315
2023 \setfont\ssecsc\scbshape{10}{1315}{OT1}
2024 \font\sseci=cmmi12 scaled \magstephalf
2025 \font\ssecsy=cmsy10 scaled 1315
2026 \def\ssececsize{1200}
2028 % Reduced fonts for @acro in text (10pt).
2029 \def\reducednominalsize{10pt}
2030 \setfont\reducedrm\rmshape{10}{1000}{OT1}
2031 \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
2032 \setfont\reducedbf\bfshape{10}{1000}{OT1}
2033 \setfont\reducedit\itshape{10}{1000}{OT1IT}
2034 \setfont\reducedsl\slshape{10}{1000}{OT1}
2035 \setfont\reducedsf\sfshape{10}{1000}{OT1}
2036 \setfont\reducedsc\scshape{10}{1000}{OT1}
2037 \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
2038 \font\reducedi=cmmi10
2039 \font\reducedsy=cmsy10
2041 \font\reducedmc=min10
2042 \font\reducedgt=goth10
2045 \jfont\reducedmc=dm10
2046 \jfont\reducedgt=dg10
2048 \def\reducedecsize{1000}
2050 \textleading = 13.2pt % line spacing for 11pt CM
2051 \textfonts % reset the current fonts
2053 } % end of 11pt text font size definitions, \definetextfontsizexi
2056 % Definitions to make the main text be 10pt Computer Modern, with
2057 % section, chapter, etc., sizes following suit. This is for the GNU
2058 % Press printing of the Emacs 22 manual. Maybe other manuals in the
2059 % future. Used with @smallbook, which sets the leading to 12pt.
2061 \def\definetextfontsizex{%
2062 % Text fonts (10pt).
2063 \def\textnominalsize{10pt}
2064 \edef\mainmagstep{1000}
2065 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2066 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2068 \font\textmc=min10 scaled \mainmagstep
2069 \font\textgt=goth10 scaled \mainmagstep
2072 \jfont\textmc=dm10 scaled \mainmagstep
2073 \jfont\textgt=dg10 scaled \mainmagstep
2075 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2076 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2077 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2078 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2079 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2080 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2081 \font\texti=cmmi10 scaled \mainmagstep
2082 \font\textsy=cmsy10 scaled \mainmagstep
2083 \def\textecsize{1000}
2085 % A few fonts for @defun names and args.
2087 \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
2088 \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
2089 \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
2090 \font\defmc=min10 scaled \magstephalf
2091 \font\defgt=goth10 scaled \magstephalf
2092 \def\df{\let\tentt=\deftt \let\tenmin=\defmc
2093 \let\tengt=\defgt \let\tenbf=\defbf \let\tenttsl=\defttsl \bf}
2095 \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
2096 \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
2097 \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
2098 \jfont\defmc=dm10 scaled \magstephalf
2099 \jfont\defgt=dg10 scaled \magstephalf
2100 \def\df{\let\tentt=\deftt \let\tenmin=\defmc
2101 \let\tengt=\defgt \let\tenbf=\defbf \let\tenttsl=\defttsl \bf}
2103 \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
2104 \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
2105 \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
2106 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
2109 % Fonts for indices, footnotes, small examples (9pt).
2110 \def\smallnominalsize{9pt}
2111 \setfont\smallrm\rmshape{9}{1000}{OT1}
2112 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
2113 \setfont\smallbf\bfshape{10}{900}{OT1}
2114 \setfont\smallit\itshape{9}{1000}{OT1IT}
2115 \setfont\smallsl\slshape{9}{1000}{OT1}
2116 \setfont\smallsf\sfshape{9}{1000}{OT1}
2117 \setfont\smallsc\scshape{10}{900}{OT1}
2118 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2129 \def\smallecsize{0900}
2131 % Fonts for small examples (8pt).
2132 \def\smallernominalsize{8pt}
2133 \setfont\smallerrm\rmshape{8}{1000}{OT1}
2134 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
2135 \setfont\smallerbf\bfshape{10}{800}{OT1}
2136 \setfont\smallerit\itshape{8}{1000}{OT1IT}
2137 \setfont\smallersl\slshape{8}{1000}{OT1}
2138 \setfont\smallersf\sfshape{8}{1000}{OT1}
2139 \setfont\smallersc\scshape{10}{800}{OT1}
2140 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2141 \font\smalleri=cmmi8
2142 \font\smallersy=cmsy8
2144 \font\smallermc=min8
2145 \font\smallergt=goth8
2148 \jfont\smallermc=dm8
2149 \jfont\smallergt=dg8
2151 \def\smallerecsize{0800}
2153 % Fonts for title page (20.4pt):
2154 \def\titlenominalsize{20pt}
2155 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2156 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2157 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2158 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2159 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2160 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2162 \font\titlemc=min10 scaled \magstep4
2163 \font\titlegt=goth10 scaled \magstep4
2166 \jfont\titlemc=dm10 scaled \magstep4
2167 \jfont\titlegt=dg10 scaled \magstep4
2169 \let\titlebf=\titlerm
2170 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2171 \font\titlei=cmmi12 scaled \magstep3
2172 \font\titlesy=cmsy10 scaled \magstep4
2173 \def\titleecsize{2074}
2175 % Chapter fonts (14.4pt).
2176 \def\chapnominalsize{14pt}
2177 \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
2178 \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
2179 \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
2180 \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
2181 \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
2182 \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
2184 \font\chapmc=min10 scaled \magstep2
2185 \font\chapgt=goth10 scaled \magstep2
2188 \jfont\chapmc=dm10 scaled \magstep2
2189 \jfont\chapgt=dg10 scaled \magstep2
2192 \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
2193 \font\chapi=cmmi12 scaled \magstep1
2194 \font\chapsy=cmsy10 scaled \magstep2
2195 \def\chapecsize{1440}
2197 % Section fonts (12pt).
2198 \def\secnominalsize{12pt}
2199 \setfont\secrm\rmbshape{12}{1000}{OT1}
2200 \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
2201 \setfont\secsl\slbshape{10}{\magstep1}{OT1}
2202 \setfont\sectt\ttbshape{12}{1000}{OT1TT}
2203 \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
2204 \setfont\secsf\sfbshape{12}{1000}{OT1}
2206 \font\secmc=min10 scaled \magstep1
2207 \font\secgt=goth10 scaled \magstep1
2210 \jfont\secmc=dm10 scaled \magstep1
2211 \jfont\secgt=dg10 scaled \magstep1
2214 \setfont\secsc\scbshape{10}{\magstep1}{OT1}
2216 \font\secsy=cmsy10 scaled \magstep1
2217 \def\sececsize{1200}
2219 % Subsection fonts (10pt).
2220 \def\ssecnominalsize{10pt}
2221 \setfont\ssecrm\rmbshape{10}{1000}{OT1}
2222 \setfont\ssecit\itbshape{10}{1000}{OT1IT}
2223 \setfont\ssecsl\slbshape{10}{1000}{OT1}
2224 \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
2225 \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
2226 \setfont\ssecsf\sfbshape{10}{1000}{OT1}
2236 \setfont\ssecsc\scbshape{10}{1000}{OT1}
2239 \def\ssececsize{1000}
2241 % Reduced fonts for @acro in text (9pt).
2242 \def\reducednominalsize{9pt}
2243 \setfont\reducedrm\rmshape{9}{1000}{OT1}
2244 \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
2245 \setfont\reducedbf\bfshape{10}{900}{OT1}
2246 \setfont\reducedit\itshape{9}{1000}{OT1IT}
2247 \setfont\reducedsl\slshape{9}{1000}{OT1}
2248 \setfont\reducedsf\sfshape{9}{1000}{OT1}
2249 \setfont\reducedsc\scshape{10}{900}{OT1}
2250 \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
2251 \font\reducedi=cmmi9
2252 \font\reducedsy=cmsy9
2254 \font\reducedmc=min9
2255 \font\reducedgt=goth9
2258 \jfont\reducedmc=dm9
2259 \jfont\reducedgt=dg9
2261 \def\reducedecsize{0900}
2263 \divide\parskip by 2 % reduce space between paragraphs
2264 \textleading = 12pt % line spacing for 10pt CM
2265 \textfonts % reset the current fonts
2267 } % end of 10pt text font size definitions, \definetextfontsizex
2270 % We provide the user-level command
2272 % (or 11) to redefine the text font size. pt is assumed.
2278 \parseargdef\fonttextsize{%
2279 \def\textsizearg{#1}%
2280 %\wlog{doing @fonttextsize \textsizearg}%
2282 % Set \globaldefs so that documents can use this inside @tex, since
2283 % makeinfo 4.8 does not support it, but we need it nonetheless.
2285 \begingroup \globaldefs=1
2286 \ifx\textsizearg\xword \definetextfontsizex
2287 \else \ifx\textsizearg\xiword \definetextfontsizexi
2290 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
2296 % In order for the font changes to affect most math symbols and letters,
2297 % we have to define the \textfont of the standard families. Since
2298 % texinfo doesn't allow for producing subscripts and superscripts except
2299 % in the main text, we don't bother to reset \scriptfont and
2300 % \scriptscriptfont (which would also require loading a lot more fonts).
2303 \def\resetmathfonts{%
2304 \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
2305 \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
2306 \textfont\ttfam=\tentt \textfont\sffam=\tensf
2307 \textfont\mcfam = \tenmin \textfont\gtfam = \tengt
2310 \def\resetmathfonts{%
2311 \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
2312 \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
2313 \textfont\ttfam=\tentt \textfont\sffam=\tensf
2317 % The font-changing commands redefine the meanings of \tenSTYLE, instead
2318 % of just \STYLE. We do this because \STYLE needs to also set the
2319 % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
2320 % \tenSTYLE to set the current font.
2322 % Each font-changing command also sets the names \lsize (one size lower)
2323 % and \lllsize (three sizes lower). These relative commands are used in
2324 % the LaTeX logo and acronyms.
2326 % This all needs generalizing, badly.
2330 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
2331 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
2332 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
2333 \let\tenttsl=\textttsl
2334 \let\tenmin=\textmc \let\tengt=\textgt
2335 \def\curfontsize{text}%
2336 \def\lsize{reduced}\def\lllsize{smaller}%
2337 \resetmathfonts \setleading{\textleading}}
2340 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
2341 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
2342 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
2343 \let\tenttsl=\textttsl
2344 \def\curfontsize{text}%
2345 \def\lsize{reduced}\def\lllsize{smaller}%
2346 \resetmathfonts \setleading{\textleading}}
2350 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
2351 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
2352 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
2353 \let\tenttsl=\titlettsl
2354 \let\tenmin=\titlemc \let\tengt=\titlegt
2355 \def\curfontsize{title}%
2356 \def\lsize{chap}\def\lllsize{subsec}%
2357 \resetmathfonts \setleading{27pt}}
2358 \def\titlefont#1{{\titlefonts\rmisbold #1}}
2361 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
2362 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
2363 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
2364 \let\tenttsl=\titlettsl
2365 \def\curfontsize{title}%
2366 \def\lsize{chap}\def\lllsize{subsec}%
2367 \resetmathfonts \setleading{25pt}}
2368 \def\titlefont#1{{\titlefonts\rmisbold #1}}
2372 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
2373 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
2374 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
2375 \let\tenttsl=\chapttsl
2376 \let\tenmin=\chapmc \let\tengt=\chapgt
2377 \def\curfontsize{chap}%
2378 \def\lsize{sec}\def\lllsize{text}%
2379 \resetmathfonts \setleading{19pt}}
2382 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
2383 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
2384 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
2385 \let\tenttsl=\chapttsl
2386 \def\curfontsize{chap}%
2387 \def\lsize{sec}\def\lllsize{text}%
2388 \resetmathfonts \setleading{19pt}}
2392 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
2393 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
2394 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
2395 \let\tenttsl=\secttsl
2396 \let\tenmin=\secmc \let\tengt=\secgt
2397 \def\curfontsize{sec}%
2398 \def\lsize{subsec}\def\lllsize{reduced}%
2399 \resetmathfonts \setleading{16pt}}
2402 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
2403 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
2404 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
2405 \let\tenttsl=\secttsl
2406 \def\curfontsize{sec}%
2407 \def\lsize{subsec}\def\lllsize{reduced}%
2408 \resetmathfonts \setleading{16pt}}
2412 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
2413 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
2414 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
2415 \let\tenttsl=\ssecttsl
2416 \let\tenmin=\ssecmc \let\tengt=\ssecgt
2417 \def\curfontsize{ssec}%
2418 \def\lsize{text}\def\lllsize{small}%
2419 \resetmathfonts \setleading{15pt}}
2422 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
2423 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
2424 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
2425 \let\tenttsl=\ssecttsl
2426 \def\curfontsize{ssec}%
2427 \def\lsize{text}\def\lllsize{small}%
2428 \resetmathfonts \setleading{15pt}}
2431 \let\subsubsecfonts = \subsecfonts
2433 \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
2434 \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
2435 \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
2436 \let\tenttsl=\reducedttsl
2437 \let\tenmc=\reducedmc
2438 \let\tengt=\reducedgt
2439 \def\curfontsize{reduced}%
2440 \def\lsize{small}\def\lllsize{smaller}%
2441 \resetmathfonts \setleading{10.5pt}}
2443 \let\subsubsecfonts = \subsecfonts
2445 \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
2446 \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
2447 \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
2448 \let\tenttsl=\reducedttsl
2449 \def\curfontsize{reduced}%
2450 \def\lsize{small}\def\lllsize{smaller}%
2451 \resetmathfonts \setleading{10.5pt}}
2455 \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
2456 \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
2457 \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
2458 \let\tenttsl=\smallttsl
2459 \let\tenmin=\smallmc \let\tengt=\smallgt
2460 \def\curfontsize{small}%
2461 \def\lsize{smaller}\def\lllsize{smaller}%
2462 \resetmathfonts \setleading{10.5pt}}
2465 \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
2466 \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
2467 \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
2468 \let\tenttsl=\smallttsl
2469 \def\curfontsize{small}%
2470 \def\lsize{smaller}\def\lllsize{smaller}%
2471 \resetmathfonts \setleading{10.5pt}}
2475 \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
2476 \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
2477 \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
2478 \let\tenttsl=\smallerttsl
2479 \let\tenmin=\smallermc \let\tengt=\smallergt
2480 \def\curfontsize{smaller}%
2481 \def\lsize{smaller}\def\lllsize{smaller}%
2482 \resetmathfonts \setleading{9.5pt}}
2485 \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
2486 \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
2487 \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
2488 \let\tenttsl=\smallerttsl
2489 \def\curfontsize{smaller}%
2490 \def\lsize{smaller}\def\lllsize{smaller}%
2491 \resetmathfonts \setleading{9.5pt}}
2494 % Fonts for short table of contents.
2495 \setfont\shortcontrm\rmshape{12}{1000}{OT1}
2496 \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
2497 \setfont\shortcontsl\slshape{12}{1000}{OT1}
2498 \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
2500 \font\shortcontmc=min10 scaled \magstep1
2501 \font\shortcontgt=goth10 scaled \magstep1
2504 \jfont\shortcontmc=dm10 scaled \magstep1
2505 \jfont\shortcontgt=dg10 scaled \magstep1
2508 % Define these just so they can be easily changed for other fonts.
2509 \def\angleleft{$\langle$}
2510 \def\angleright{$\rangle$}
2512 % Set the fonts to use with the @small... environments.
2513 \let\smallexamplefonts = \smallfonts
2515 % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
2516 % can fit this many characters:
2517 % 8.5x11=86 smallbook=72 a4=90 a5=69
2518 % If we use \scriptfonts (8pt), then we can fit this many characters:
2519 % 8.5x11=90+ smallbook=80 a4=90+ a5=77
2520 % For me, subjectively, the few extra characters that fit aren't worth
2521 % the additional smallness of 8pt. So I'm making the default 9pt.
2523 % By the way, for comparison, here's what fits with @example (10pt):
2524 % 8.5x11=71 smallbook=60 a4=75 a5=58
2527 % Set up the default fonts, so we can use them for creating boxes.
2529 \definetextfontsizexi
2534 % Check if we are currently using a typewriter font. Since all the
2535 % Computer Modern typewriter fonts have zero interword stretch (and
2536 % shrink), and it is reasonable to expect all typewriter fonts to have
2537 % this property, we can check that font parameter.
2539 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
2541 % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
2542 % define and register \INITMACRO to be called on markup style changes.
2543 % \INITMACRO can check \currentmarkupstyle for the innermost
2544 % style and the set of \ifmarkupSTYLE switches for all styles
2545 % currently in effect.
2549 %\newif\ifmarkupfile % @file == @samp.
2550 %\newif\ifmarkupoption % @option == @samp.
2553 %\newif\ifmarkupenv % @env == @code.
2554 %\newif\ifmarkupcommand % @command == @code.
2555 \newif\ifmarkuptex % @tex (and part of @math, for now).
2556 \newif\ifmarkupexample
2558 \newif\ifmarkupverbatim
2560 \let\currentmarkupstyle\empty
2562 \def\setupmarkupstyle#1{%
2563 \csname markup#1true\endcsname
2564 \def\currentmarkupstyle{#1}%
2568 \let\markupstylesetup\empty
2570 \def\defmarkupstylesetup#1{%
2571 \expandafter\def\expandafter\markupstylesetup
2572 \expandafter{\markupstylesetup #1}%
2576 % Markup style setup for left and right quotes.
2577 \defmarkupstylesetup\markupsetuplq{%
2578 \expandafter\let\expandafter \temp
2579 \csname markupsetuplq\currentmarkupstyle\endcsname
2580 \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
2583 \defmarkupstylesetup\markupsetuprq{%
2584 \expandafter\let\expandafter \temp
2585 \csname markupsetuprq\currentmarkupstyle\endcsname
2586 \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
2593 \gdef\markupsetuplqdefault{\let`\lq}
2594 \gdef\markupsetuprqdefault{\let'\rq}
2596 \gdef\markupsetcodequoteleft{\let`\codequoteleft}
2597 \gdef\markupsetcodequoteright{\let'\codequoteright}
2600 \let\markupsetuplqcode \markupsetcodequoteleft
2601 \let\markupsetuprqcode \markupsetcodequoteright
2603 \let\markupsetuplqexample \markupsetcodequoteleft
2604 \let\markupsetuprqexample \markupsetcodequoteright
2606 \let\markupsetuplqkbd \markupsetcodequoteleft
2607 \let\markupsetuprqkbd \markupsetcodequoteright
2609 \let\markupsetuplqsamp \markupsetcodequoteleft
2610 \let\markupsetuprqsamp \markupsetcodequoteright
2612 \let\markupsetuplqverb \markupsetcodequoteleft
2613 \let\markupsetuprqverb \markupsetcodequoteright
2615 \let\markupsetuplqverbatim \markupsetcodequoteleft
2616 \let\markupsetuprqverbatim \markupsetcodequoteright
2618 % Allow an option to not use regular directed right quote/apostrophe
2619 % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
2620 % The undirected quote is ugly, so don't make it the default, but it
2621 % works for pasting with more pdf viewers (at least evince), the
2622 % lilypond developers report. xpdf does work with the regular 0x27.
2624 \def\codequoteright{%
2625 \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
2626 \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
2632 % and a similar option for the left quote char vs. a grave accent.
2633 % Modern fonts display ASCII 0x60 as a grave accent, so some people like
2634 % the code environments to do likewise.
2636 \def\codequoteleft{%
2637 \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
2638 \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
2639 % [Knuth] pp. 380,381,391
2640 % \relax disables Spanish ligatures ?` and !` of \tt font.
2646 % Commands to set the quote options.
2648 \parseargdef\codequoteundirected{%
2651 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2653 \else\ifx\temp\offword
2654 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2657 \errhelp = \EMsimple
2658 \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
2662 \parseargdef\codequotebacktick{%
2665 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2667 \else\ifx\temp\offword
2668 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2671 \errhelp = \EMsimple
2672 \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
2676 % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
2677 \def\noligaturesquoteleft{\relax\lq}
2679 % Count depth in font-changes, for error checks
2680 \newcount\fontdepth \fontdepth=0
2684 % #1 is the font command (\sl or \it), #2 is the text to slant.
2685 % If we are in a monospaced environment, however, 1) always use \ttsl,
2686 % and 2) do not add an italic correction.
2687 \def\dosmartslant#1#2{%
2689 {{\ttsl #2}\let\next=\relax}%
2690 {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
2693 \def\smartslanted{\dosmartslant\sl}
2694 \def\smartitalic{\dosmartslant\it}
2696 % Output an italic correction unless \next (presumed to be the following
2697 % character) is such as not to need one.
2698 \def\smartitaliccorrection{%
2707 % Unconditional use \ttsl, and no ic. @var is set to this for defuns.
2708 \def\ttslanted#1{{\ttsl #1}}
2710 % @cite is like \smartslanted except unconditionally use \sl. We never want
2711 % ttsl for book titles, do we?
2712 \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
2716 \let\saveaftersmartic = \aftersmartic
2717 \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
2722 \let\slanted=\smartslanted
2723 \let\dfn=\smartslanted
2724 \let\emph=\smartitalic
2726 % Explicit font changes: @r, @sc, undocumented @ii.
2727 \def\r#1{{\rm #1}} % roman font
2728 \def\sc#1{{\smallcaps#1}} % smallcaps font
2729 \def\ii#1{{\it #1}} % italic font
2731 % @b, explicit bold. Also @strong.
2735 % @sansserif, explicit sans.
2736 \def\sansserif#1{{\sf #1}}
2738 % We can't just use \exhyphenpenalty, because that only has effect at
2739 % the end of a paragraph. Restore normal hyphenation at the end of the
2740 % group within which \nohyphenation is presumably called.
2742 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
2743 \def\restorehyphenation{\hyphenchar\font = `- }
2745 % Set sfcode to normal for the chars that usually have another value.
2746 % Can't use plain's \frenchspacing because it uses the `\x notation, and
2747 % sometimes \x has an active definition that messes things up.
2750 \def\plainfrenchspacing{%
2751 \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
2752 \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
2753 \def\endofsentencespacefactor{1000}% for @. and friends
2755 \def\plainnonfrenchspacing{%
2756 \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
2757 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
2758 \def\endofsentencespacefactor{3000}% for @. and friends
2761 \def\endofsentencespacefactor{3000}% default
2763 % @t, explicit typewriter.
2765 {\tt \rawbackslash \plainfrenchspacing #1}%
2770 \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
2772 % @indicateurl is \samp, that is, with quotes.
2773 \let\indicateurl=\samp
2775 % @code (and similar) prints in typewriter, but with spaces the same
2776 % size as normal in the surrounding text, without hyphenation, etc.
2777 % This is a subroutine for that.
2780 % Change normal interword space to be same as for the current font.
2781 \spaceskip = \fontdimen2\font
2783 % Switch to typewriter.
2786 % But `\ ' produces the large typewriter interword space.
2787 \def\ {{\spaceskip = 0pt{} }}%
2789 % Turn off hyphenation.
2796 \null % reset spacefactor to 1000
2799 % We *must* turn on hyphenation at `-' and `_' in @code.
2800 % (But see \codedashfinish below.)
2801 % Otherwise, it is too hard to avoid overfull hboxes
2802 % in the Emacs manual, the Library manual, etc.
2804 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
2805 % both hyphenation at - and hyphenation within words.
2806 % We must therefore turn them both off (\tclose does that)
2807 % and arrange explicitly to hyphenate at a dash. -- rms.
2809 \catcode`\-=\active \catcode`\_=\active
2810 \catcode`\'=\active \catcode`\`=\active
2811 \global\let'=\rq \global\let`=\lq % default definitions
2813 \global\def\code{\begingroup
2814 \setupmarkupstyle{code}%
2815 % The following should really be moved into \setupmarkupstyle handlers.
2816 \catcode\dashChar=\active \catcode\underChar=\active
2824 % Given -foo (with a single dash), we do not want to allow a break
2826 \global\let\codedashprev=\codedash
2831 \gdef\codedash{\futurelet\next\codedashfinish}
2832 \gdef\codedashfinish{%
2833 \normaldash % always output the dash character itself.
2835 % Now, output a discretionary to allow a line break, unless
2836 % (a) the next character is a -, or
2837 % (b) the preceding character is a -.
2838 % E.g., given --posix, we do not want to allow a break after either -.
2839 % Given --foo-bar, we do want to allow a break between the - and the b.
2840 \ifx\next\codedash \else
2841 \ifx\codedashprev\codedash
2842 \else \discretionary{}{}{}\fi
2844 \global\let\codedashprev=\next
2849 \def\codex #1{\tclose{#1}\endgroup}
2852 % this is all so @math{@code{var_name}+1} can work. In math mode, _
2853 % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
2854 % will therefore expand the active definition of _, which is us
2855 % (inside @code that is), therefore an endless loop.
2857 \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
2858 \else\normalunderscore \fi
2859 \discretionary{}{}{}}%
2863 % An additional complication: the above will allow breaks after, e.g.,
2864 % each of the four underscores in __typeof__. This is bad.
2865 % @allowcodebreaks provides a document-level way to turn breaking at -
2868 \newif\ifallowcodebreaks \allowcodebreakstrue
2870 \def\keywordtrue{true}
2871 \def\keywordfalse{false}
2873 \parseargdef\allowcodebreaks{%
2875 \ifx\txiarg\keywordtrue
2876 \allowcodebreakstrue
2877 \else\ifx\txiarg\keywordfalse
2878 \allowcodebreaksfalse
2880 \errhelp = \EMsimple
2881 \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
2885 % For @command, @env, @file, @option quotes seem unnecessary,
2886 % so use \code rather than \samp.
2892 % @uref (abbreviation for `urlref') takes an optional (comma-separated)
2893 % second argument specifying the text to display and an optional third
2894 % arg as text to display instead of (rather than in addition to) the url
2895 % itself. First (mandatory) arg is the url.
2896 % (This \urefnobreak definition isn't used now, leaving it for a while
2898 \def\urefnobreak#1{\dourefnobreak #1,,,\finish}
2899 \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
2902 \setbox0 = \hbox{\ignorespaces #3}%
2904 \unhbox0 % third arg given, show only that
2906 \setbox0 = \hbox{\ignorespaces #2}%
2909 \unhbox0 % PDF: 2nd arg given, show only it
2911 \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
2914 \code{#1}% only url given, so show it
2920 % This \urefbreak definition is the active one.
2921 \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
2922 \let\uref=\urefbreak
2923 \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
2924 \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
2927 \setbox0 = \hbox{\ignorespaces #3}%
2929 \unhbox0 % third arg given, show only that
2931 \setbox0 = \hbox{\ignorespaces #2}%
2934 \unhbox0 % PDF: 2nd arg given, show only it
2936 \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
2939 \urefcode{#1}% only url given, so show it
2945 % Allow line breaks around only a few characters (only).
2947 \catcode\ampChar=\active \catcode\dotChar=\active
2948 \catcode\hashChar=\active \catcode\questChar=\active
2949 \catcode\slashChar=\active
2954 \global\def\urefcode{\begingroup
2955 \setupmarkupstyle{code}%
2965 % By default, they are just regular characters.
2966 \global\def&{\normalamp}
2967 \global\def.{\normaldot}
2968 \global\def#{\normalhash}
2969 \global\def?{\normalquest}
2970 \global\def/{\normalslash}
2973 % we put a little stretch before and after the breakable chars, to help
2974 % line breaking of long url's. The unequal skips make look better in
2975 % cmtt at least, especially for dots.
2976 \def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
2977 \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
2979 \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
2980 \def\urefcodedot{\urefprestretch .\urefpoststretch}
2981 \def\urefcodehash{\urefprestretch \#\urefpoststretch}
2982 \def\urefcodequest{\urefprestretch ?\urefpoststretch}
2983 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
2986 \global\def\urefcodeslashfinish{%
2987 \urefprestretch \slashChar
2988 % Allow line break only after the final / in a sequence of
2989 % slashes, to avoid line break between the slashes in http://.
2990 \ifx\next/\else \urefpoststretch \fi
2994 % One more complication: by default we'll break after the special
2995 % characters, but some people like to break before the special chars, so
2996 % allow that. Also allow no breaking at all, for manual control.
2998 \parseargdef\urefbreakstyle{%
3000 \ifx\txiarg\wordnone
3001 \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
3002 \else\ifx\txiarg\wordbefore
3003 \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
3004 \else\ifx\txiarg\wordafter
3005 \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
3007 \errhelp = \EMsimple
3008 \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
3011 \def\wordafter{after}
3012 \def\wordbefore{before}
3015 \urefbreakstyle after
3017 % @url synonym for @uref, since that's how everyone uses it.
3021 % rms does not like angle brackets --karl, 17may97.
3022 % So now @email is just like @uref, unless we are pdf.
3024 %\def\email#1{\angleleft{\tt #1}\angleright}
3026 \def\email#1{\doemail#1,,\finish}
3027 \def\doemail#1,#2,#3\finish{\begingroup
3030 \setbox0 = \hbox{\ignorespaces #2}%
3031 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
3038 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
3039 % `example' (@kbd uses ttsl only inside of @example and friends),
3040 % or `code' (@kbd uses normal tty font always).
3041 \parseargdef\kbdinputstyle{%
3043 \ifx\txiarg\worddistinct
3044 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
3045 \else\ifx\txiarg\wordexample
3046 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
3047 \else\ifx\txiarg\wordcode
3048 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
3050 \errhelp = \EMsimple
3051 \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
3054 \def\worddistinct{distinct}
3055 \def\wordexample{example}
3058 % Default is `distinct'.
3059 \kbdinputstyle distinct
3061 % @kbd is like @code, except that if the argument is just one @key command,
3062 % then @kbd has no effect.
3063 \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
3066 \def\kbdsub#1#2#3\par{%
3067 \def\one{#1}\def\three{#3}\def\threex{??}%
3068 \ifx\one\xkey\ifx\threex\three \key{#2}%
3069 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
3070 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
3073 % definition of @key that produces a lozenge. Doesn't adjust to text size.
3074 %\setfont\keyrm\rmshape{8}{1000}{OT1}
3076 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
3077 % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
3078 % \vbox{\hrule\kern-0.4pt
3079 % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
3080 % \kern-0.4pt\hrule}%
3081 % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
3083 % definition of @key with no lozenge. If the current font is already
3084 % monospace, don't change it; that way, we respect @kbdinputstyle. But
3085 % if it isn't monospace, then use \tt.
3087 \def\key#1{{\setupmarkupstyle{key}%
3089 \ifmonospace\else\tt\fi
3092 % @clicksequence{File @click{} Open ...}
3093 \def\clicksequence#1{\begingroup #1\endgroup}
3095 % @clickstyle @arrow (by default)
3096 \parseargdef\clickstyle{\def\click{#1}}
3099 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
3100 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
3102 \def\dmn#1{\thinspace #1}
3104 % @l was never documented to mean ``switch to the Lisp font'',
3105 % and it is not used as such in any manual I can find. We need it for
3106 % Polish suppressed-l. --karl, 22sep96.
3107 %\def\l#1{{\li #1}\null}
3109 % @acronym for "FBI", "NATO", and the like.
3110 % We print this one point size smaller, since it's intended for
3113 \def\acronym#1{\doacronym #1,,\finish}
3114 \def\doacronym#1,#2,#3\finish{%
3115 {\selectfonts\lsize #1}%
3117 \ifx\temp\empty \else
3118 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3120 \null % reset \spacefactor=1000
3123 % @abbr for "Comput. J." and the like.
3124 % No font change, but don't do end-of-sentence spacing.
3126 \def\abbr#1{\doabbr #1,,\finish}
3127 \def\doabbr#1,#2,#3\finish{%
3128 {\plainfrenchspacing #1}%
3130 \ifx\temp\empty \else
3131 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3133 \null % reset \spacefactor=1000
3136 % @asis just yields its argument. Used with @table, for example.
3140 % @math outputs its argument in math mode.
3142 % One complication: _ usually means subscripts, but it could also mean
3143 % an actual _ character, as in @math{@var{some_variable} + 1}. So make
3144 % _ active, and distinguish by seeing if the current family is \slfam,
3145 % which is what @var uses.
3147 \catcode`\_ = \active
3148 \gdef\mathunderscore{%
3150 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
3153 % Another complication: we want \\ (and @\) to output a math (or tt) \.
3154 % FYI, plain.tex uses \\ as a temporary control sequence (for no
3155 % particular reason), but this is not advertised and we don't care.
3157 % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
3158 \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
3163 \let\\ = \mathbackslash
3165 % make the texinfo accent commands work in math mode
3177 \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
3179 % Some active characters (such as <) are spaced differently in math.
3180 % We have to reset their definitions in case the @math was an argument
3181 % to a command which sets the catcodes (such as @item or @section).
3184 \catcode`^ = \active
3185 \catcode`< = \active
3186 \catcode`> = \active
3187 \catcode`+ = \active
3188 \catcode`' = \active
3194 \let' = \ptexquoteright
3198 % ctrl is no longer a Texinfo command, but leave this definition for fun.
3199 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
3201 % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
3202 % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
3203 % except specified as a normal braced arg, so no newlines to worry about.
3205 \def\outfmtnametex{tex}
3207 \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
3208 \long\def\doinlinefmt#1,#2,\finish{%
3209 \def\inlinefmtname{#1}%
3210 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
3212 % For raw, must switch into @tex before parsing the argument, to avoid
3213 % setting catcodes prematurely. Doing it this way means that, for
3214 % example, @inlineraw{html, foo{bar} gets a parse error instead of being
3215 % ignored. But this isn't important because if people want a literal
3216 % *right* brace they would have to use a command anyway, so they may as
3217 % well use a command to get a left brace too. We could re-use the
3218 % delimiter character idea from \verb, but it seems like overkill.
3220 \long\def\inlineraw{\tex \doinlineraw}
3221 \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
3222 \def\doinlinerawtwo#1,#2,\finish{%
3223 \def\inlinerawname{#1}%
3224 \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
3225 \endgroup % close group opened by \tex.
3232 % @@ prints an @, as does @atchar{}.
3236 % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
3237 % Unless we're in typewriter, use \ecfont because the CM text fonts do
3238 % not have braces, and we don't want to switch into math.
3239 \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
3240 \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
3241 \let\{=\mylbrace \let\lbracechar=\{
3242 \let\}=\myrbrace \let\rbracechar=\}
3244 % Definitions to produce \{ and \} commands for indices,
3245 % and @{ and @} for the aux/toc files.
3246 \catcode`\{ = \other \catcode`\} = \other
3247 \catcode`\[ = 1 \catcode`\] = 2
3248 \catcode`\! = 0 \catcode`\\ = \other
3249 !gdef!lbracecmd[\{]%
3250 !gdef!rbracecmd[\}]%
3251 !gdef!lbraceatcmd[@{]%
3252 !gdef!rbraceatcmd[@}]%
3255 % @comma{} to avoid , parsing problems.
3258 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
3259 % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
3261 \let\dotaccent = \ptexdot
3262 \def\ringaccent#1{{\accent23 #1}}
3263 \let\tieaccent = \ptext
3264 \let\ubaraccent = \ptexb
3265 \let\udotaccent = \d
3267 % Other special characters: @questiondown @exclamdown @ordf @ordm
3268 % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
3269 \def\questiondown{?`}
3271 \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
3272 \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
3274 % Dotless i and dotless j, used for accents.
3279 \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
3280 \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
3281 \else \errmessage{@dotless can be used only with i or j}%
3285 % The \TeX{} logo, as in plain, but resetting the spacing so that a
3286 % period following counts as ending a sentence. (Idea found in latex.)
3288 \edef\TeX{\TeX \spacefactor=1000 }
3290 % @LaTeX{} logo. Not quite the same results as the definition in
3291 % latex.ltx, since we use a different font for the raised A; it's most
3292 % convenient for us to use an explicitly smaller font, rather than using
3293 % the \scriptstyle font (since we don't reset \scriptstyle and
3294 % \scriptscriptstyle).
3299 \vbox to \ht0{\hbox{%
3300 \ifx\textnominalsize\xwordpt
3301 % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
3302 % Revert to plain's \scriptsize, which is 7pt.
3303 \count255=\the\fam $\fam\count255 \scriptstyle A$%
3305 % For 11pt, we can use our lllsize.
3306 \selectfonts\lllsize A%
3315 % Some math mode symbols.
3316 \def\bullet{$\ptexbullet$}
3317 \def\geq{\ifmmode \ge\else $\ge$\fi}
3318 \def\leq{\ifmmode \le\else $\le$\fi}
3319 \def\minus{\ifmmode -\else $-$\fi}
3321 % @dots{} outputs an ellipsis using the current font.
3322 % We do .5em per period so that it has the same spacing in the cm
3323 % typewriter fonts as three actual period characters; on the other hand,
3324 % in other typewriter fonts three periods are wider than 1.5em. So do
3325 % whichever is larger.
3329 \setbox0=\hbox{...}% get width of three periods
3336 \hskip 0pt plus.25fil
3337 .\hskip 0pt plus1fil
3338 .\hskip 0pt plus1fil
3339 .\hskip 0pt plus.5fil
3343 % @enddots{} is an end-of-sentence ellipsis.
3347 \spacefactor=\endofsentencespacefactor
3350 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3352 % Since these characters are used in examples, they should be an even number of
3353 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3356 \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
3357 \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
3358 \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
3359 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
3360 \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
3362 % The @error{} command.
3363 % Adapted from the TeXbook's \boxit.
3367 {\tentt \global\dimen0 = 3em}% Width of the box.
3368 \dimen2 = .55pt % Thickness of rules
3369 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3370 \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
3372 \setbox\errorbox=\hbox to \dimen0{\hfil
3373 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
3374 \advance\hsize by -2\dimen2 % Rules.
3376 \hrule height\dimen2
3377 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
3378 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
3379 \kern3pt\vrule width\dimen2}% Space to right.
3380 \hrule height\dimen2}
3383 \def\error{\leavevmode\lower.7ex\copy\errorbox}
3385 % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
3387 \def\pounds{{\it\$}}
3389 % @euro{} comes from a separate font, depending on the current style.
3390 % We use the free feym* fonts from the eurosym package by Henrik
3391 % Theiling, which support regular, slanted, bold and bold slanted (and
3392 % "outlined" (blackboard board, sort of) versions, which we don't need).
3393 % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
3395 % Although only regular is the truly official Euro symbol, we ignore
3396 % that. The Euro is designed to be slightly taller than the regular
3402 % feybo - bold slanted
3404 % There is no good (free) typewriter version, to my knowledge.
3405 % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
3408 % Also doesn't work in math. Do we need to do math with euro symbols?
3412 \def\euro{{\eurofont e}}
3414 % We set the font at each command, rather than predefining it in
3415 % \textfonts and the other font-switching commands, so that
3416 % installations which never need the symbol don't have to have the
3419 % There is only one designed size (nominal 10pt), so we always scale
3420 % that to the current nominal size.
3422 % By the way, simply using "at 1em" works for cmr10 and the like, but
3423 % does not work for cmbx10 and other extended/shrunken fonts.
3425 \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
3427 \ifx\curfontstyle\bfstylename
3429 \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
3432 \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
3437 % Glyphs from the EC fonts. We don't use \let for the aliases, because
3438 % sometimes we redefine the original macro, and the alias should reflect
3441 % Use LaTeX names for the Icelandic letters.
3442 \def\DH{{\ecfont \char"D0}} % Eth
3443 \def\dh{{\ecfont \char"F0}} % eth
3444 \def\TH{{\ecfont \char"DE}} % Thorn
3445 \def\th{{\ecfont \char"FE}} % thorn
3447 \def\guillemetleft{{\ecfont \char"13}}
3448 \def\guillemotleft{\guillemetleft}
3449 \def\guillemetright{{\ecfont \char"14}}
3450 \def\guillemotright{\guillemetright}
3451 \def\guilsinglleft{{\ecfont \char"0E}}
3452 \def\guilsinglright{{\ecfont \char"0F}}
3453 \def\quotedblbase{{\ecfont \char"12}}
3454 \def\quotesinglbase{{\ecfont \char"0D}}
3456 % This positioning is not perfect (see the ogonek LaTeX package), but
3457 % we have the precomposed glyphs for the most common cases. We put the
3458 % tests to use those glyphs in the single \ogonek macro so we have fewer
3459 % dummy definitions to worry about for index entries, etc.
3461 % ogonek is also used with other letters in Lithuanian (IOU), but using
3462 % the precomposed glyphs for those is not so easy since they aren't in
3466 \ifx\temp\macrocharA\Aogonek
3467 \else\ifx\temp\macrochara\aogonek
3468 \else\ifx\temp\macrocharE\Eogonek
3469 \else\ifx\temp\macrochare\eogonek
3471 \ecfont \setbox0=\hbox{#1}%
3472 \ifdim\ht0=1ex\accent"0C #1%
3473 \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
3478 \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
3479 \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
3480 \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
3481 \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
3483 % Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
3485 % We can't distinguish serif/sans and italic/slanted, but this
3486 % is used for crude hacks anyway (like adding French and German
3487 % quotes to documents typeset with CM, where we lose kerning), so
3488 % hopefully nobody will notice/care.
3489 \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
3490 \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
3493 \font\thisecfont = ectt\ecsize \space at \nominalsize
3495 \ifx\curfontstyle\bfstylename
3497 \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
3500 \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
3506 % @registeredsymbol - R in a circle. The font for the R should really
3507 % be smaller yet, but lllsize is the best we can do for now.
3508 % Adapted from the plain.tex definition of \copyright.
3510 \font\onlytodefineregisteredsymbol=psyr at 7pt
3511 \def\registeredsymbol{%
3512 $^{\hbox{\onlytodefineregisteredsymbol\char210\relax}}$%
3515 % @textdegree - the normal degrees sign.
3517 \def\textdegree{$^\circ$}
3519 % Laurent Siebenmann reports \Orb undefined with:
3520 % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
3521 % so we'll define it if necessary.
3523 \ifx\Orb\thisisundefined
3524 \def\Orb{\mathhexbox20D}
3528 \chardef\quotedblleft="5C
3529 \chardef\quotedblright=`\"
3530 \chardef\quoteleft=`\`
3531 \chardef\quoteright=`\'
3534 \message{page headings,}
3536 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
3537 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
3539 % First the title page. Must do @settitle before @titlepage.
3541 \newif\iffinishedtitlepage
3543 % Do an implicit @contents or @shortcontents after @end titlepage if the
3544 % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
3546 \newif\ifsetcontentsaftertitlepage
3547 \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
3548 \newif\ifsetshortcontentsaftertitlepage
3549 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
3551 \parseargdef\shorttitlepage{%
3552 \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
3553 \endgroup\page\hbox{}\page}
3556 % Open one extra group, as we want to close it in the middle of \Etitlepage.
3558 \parindent=0pt \textfonts
3559 % Leave some space at the very top of the page.
3560 \vglue\titlepagetopglue
3561 % No rule at page bottom unless we print one at the top with @title.
3562 \finishedtitlepagetrue
3564 % Most title ``pages'' are actually two pages long, with space
3565 % at the top of the second. We don't want the ragged left on the second.
3566 \let\oldpage = \page
3568 \iffinishedtitlepage\else
3571 \let\page = \oldpage
3578 \iffinishedtitlepage\else
3581 % It is important to do the page break before ending the group,
3582 % because the headline and footline are only empty inside the group.
3583 % If we use the new definition of \page, we always get a blank page
3584 % after the title page, which we certainly don't want.
3588 % Need this before the \...aftertitlepage checks so that if they are
3589 % in effect the toc pages will come out with page numbers.
3592 % If they want short, they certainly want long too.
3593 \ifsetshortcontentsaftertitlepage
3596 \global\let\shortcontents = \relax
3597 \global\let\contents = \relax
3600 \ifsetcontentsaftertitlepage
3602 \global\let\contents = \relax
3603 \global\let\shortcontents = \relax
3607 \def\finishtitlepage{%
3608 \vskip4pt \hrule height 2pt width \hsize
3609 \vskip\titlepagebottomglue
3610 \finishedtitlepagetrue
3613 % Settings used for typesetting titles: no hyphenation, no indentation,
3614 % don't worry much about spacing, ragged right. This should be used
3615 % inside a \vbox, and fonts need to be set appropriately first. Because
3616 % it is always used for titles, nothing else, we call \rmisbold. \par
3617 % should be specified before the end of the \vbox, since a vbox is a group.
3619 \def\raggedtitlesettings{%
3621 \hyphenpenalty=10000
3627 % Macros to be used within @titlepage:
3629 \let\subtitlerm=\tenrm
3630 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
3632 \parseargdef\title{%
3634 \vbox{\titlefonts \raggedtitlesettings #1\par}%
3635 % print a rule at the page bottom also.
3636 \finishedtitlepagefalse
3637 \vskip4pt \hrule height 4pt width \hsize \vskip4pt
3640 \parseargdef\subtitle{%
3642 {\subtitlefont \rightline{#1}}%
3645 % @author should come last, but may come many times.
3646 % It can also be used inside @quotation.
3648 \parseargdef\author{%
3649 \def\temp{\quotation}%
3651 \def\quotationauthor{#1}% printed in \Equotation.
3654 \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
3655 {\secfonts\rmisbold \leftline{#1}}%
3660 % Set up page headings and footings.
3662 \let\thispage=\folio
3664 \newtoks\evenheadline % headline on even pages
3665 \newtoks\oddheadline % headline on odd pages
3666 \newtoks\evenfootline % footline on even pages
3667 \newtoks\oddfootline % footline on odd pages
3669 % Now make TeX use those variables
3670 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
3671 \else \the\evenheadline \fi}}
3672 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
3673 \else \the\evenfootline \fi}\HEADINGShook}
3674 \let\HEADINGShook=\relax
3676 % Commands to set those variables.
3677 % For example, this is what @headings on does
3678 % @evenheading @thistitle|@thispage|@thischapter
3679 % @oddheading @thischapter|@thispage|@thistitle
3680 % @evenfooting @thisfile||
3681 % @oddfooting ||@thisfile
3684 \def\evenheading{\parsearg\evenheadingxxx}
3685 \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
3686 \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
3687 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3689 \def\oddheading{\parsearg\oddheadingxxx}
3690 \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
3691 \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
3692 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3694 \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
3696 \def\evenfooting{\parsearg\evenfootingxxx}
3697 \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
3698 \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
3699 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3701 \def\oddfooting{\parsearg\oddfootingxxx}
3702 \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
3703 \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
3704 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
3706 % Leave some space for the footline. Hopefully ok to assume
3707 % @evenfooting will not be used by itself.
3708 \global\advance\pageheight by -12pt
3709 \global\advance\vsize by -12pt
3712 \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
3714 % @evenheadingmarks top \thischapter <- chapter at the top of a page
3715 % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
3717 % The same set of arguments for:
3722 % @everyheadingmarks
3723 % @everyfootingmarks
3725 \def\evenheadingmarks{\headingmarks{even}{heading}}
3726 \def\oddheadingmarks{\headingmarks{odd}{heading}}
3727 \def\evenfootingmarks{\headingmarks{even}{footing}}
3728 \def\oddfootingmarks{\headingmarks{odd}{footing}}
3729 \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
3730 \headingmarks{odd}{heading}{#1} }
3731 \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
3732 \headingmarks{odd}{footing}{#1} }
3733 % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
3734 \def\headingmarks#1#2#3 {%
3735 \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
3736 \global\expandafter\let\csname get#1#2marks\endcsname \temp
3739 \everyheadingmarks bottom
3740 \everyfootingmarks bottom
3742 % @headings double turns headings on for double-sided printing.
3743 % @headings single turns headings on for single-sided printing.
3744 % @headings off turns them off.
3745 % @headings on same as @headings double, retained for compatibility.
3746 % @headings after turns on double-sided headings after this page.
3747 % @headings doubleafter turns on double-sided headings after this page.
3748 % @headings singleafter turns on single-sided headings after this page.
3749 % By default, they are off at the start of a document,
3750 % and turned `on' after @end titlepage.
3752 \def\headings #1 {\csname HEADINGS#1\endcsname}
3754 \def\headingsoff{% non-global headings elimination
3755 \evenheadline={\hfil}\evenfootline={\hfil}%
3756 \oddheadline={\hfil}\oddfootline={\hfil}%
3759 \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
3760 \HEADINGSoff % it's the default
3762 % When we turn headings on, set the page number to 1.
3763 % For double-sided printing, put current file name in lower left corner,
3764 % chapter name on inside top of right hand pages, document
3765 % title on inside top of left hand pages, and page numbers on outside top
3766 % edge of all pages.
3767 \def\HEADINGSdouble{%
3769 \global\evenfootline={\hfil}
3770 \global\oddfootline={\hfil}
3771 \global\evenheadline={\line{\folio\hfil\thistitle}}
3772 \global\oddheadline={\line{\thischapter\hfil\folio}}
3773 \global\let\contentsalignmacro = \chapoddpage
3775 \let\contentsalignmacro = \chappager
3777 % For single-sided printing, chapter title goes across top left of page,
3778 % page number on top right.
3779 \def\HEADINGSsingle{%
3781 \global\evenfootline={\hfil}
3782 \global\oddfootline={\hfil}
3783 \global\evenheadline={\line{\thischapter\hfil\folio}}
3784 \global\oddheadline={\line{\thischapter\hfil\folio}}
3785 \global\let\contentsalignmacro = \chappager
3787 \def\HEADINGSon{\HEADINGSdouble}
3789 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
3790 \let\HEADINGSdoubleafter=\HEADINGSafter
3791 \def\HEADINGSdoublex{%
3792 \global\evenfootline={\hfil}
3793 \global\oddfootline={\hfil}
3794 \global\evenheadline={\line{\folio\hfil\thistitle}}
3795 \global\oddheadline={\line{\thischapter\hfil\folio}}
3796 \global\let\contentsalignmacro = \chapoddpage
3799 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
3800 \def\HEADINGSsinglex{%
3801 \global\evenfootline={\hfil}
3802 \global\oddfootline={\hfil}
3803 \global\evenheadline={\line{\thischapter\hfil\folio}}
3804 \global\oddheadline={\line{\thischapter\hfil\folio}}
3805 \global\let\contentsalignmacro = \chappager
3808 % Subroutines used in generating headings
3809 % This produces Day Month Year style of output.
3810 % Only define if not already defined, in case a txi-??.tex file has set
3811 % up a different format (e.g., txi-cs.tex does this).
3812 \ifx\today\thisisundefined
3816 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
3817 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
3818 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
3823 % @settitle line... specifies the title of the document, for headings.
3824 % It generates no output of its own.
3825 \def\thistitle{\putwordNoTitle}
3826 \def\settitle{\parsearg{\gdef\thistitle}}
3830 % Tables -- @table, @ftable, @vtable, @item(x).
3832 % default indentation of table text
3833 \newdimen\tableindent \tableindent=.8in
3834 % default indentation of @itemize and @enumerate text
3835 \newdimen\itemindent \itemindent=.3in
3836 % margin between end of table item and start of table text.
3837 \newdimen\itemmargin \itemmargin=.1in
3839 % used internally for \itemindent minus \itemmargin
3842 % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
3844 % They also define \itemindex
3845 % to index the item name in whatever manner is desired (perhaps none).
3847 \newif\ifitemxneedsnegativevskip
3849 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
3851 \def\internalBitem{\smallbreak \parsearg\itemzzz}
3852 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
3854 \def\itemzzz #1{\begingroup %
3855 \advance\hsize by -\rightskip
3856 \advance\hsize by -\tableindent
3857 \setbox0=\hbox{\itemindicate{#1}}%
3859 \nobreak % This prevents a break before @itemx.
3861 % If the item text does not fit in the space we have, put it on a line
3862 % by itself, and do not allow a page break either before or after that
3863 % line. We do not start a paragraph here because then if the next
3864 % command is, e.g., @kindex, the whatsit would get put into the
3865 % horizontal list on a line by itself, resulting in extra blank space.
3866 \ifdim \wd0>\itemmax
3868 % Make this a paragraph so we get the \parskip glue and wrapping,
3869 % but leave it ragged-right.
3871 \advance\leftskip by-\tableindent
3872 \advance\hsize by\tableindent
3873 \advance\rightskip by0pt plus1fil\relax
3874 \leavevmode\unhbox0\par
3877 % We're going to be starting a paragraph, but we don't want the
3878 % \parskip glue -- logically it's part of the @item we just started.
3879 \nobreak \vskip-\parskip
3881 % Stop a page break at the \parskip glue coming up. However, if
3882 % what follows is an environment such as @example, there will be no
3883 % \parskip glue; then the negative vskip we just inserted would
3884 % cause the example and the item to crash together. So we use this
3885 % bizarre value of 10001 as a signal to \aboveenvbreak to insert
3886 % \parskip glue after all. Section titles are handled this way also.
3890 \itemxneedsnegativevskipfalse
3892 % The item text fits into the space. Start a paragraph, so that the
3893 % following text (if any) will end up on the same line.
3895 % Do this with kerns and \unhbox so that if there is a footnote in
3896 % the item text, it can migrate to the main vertical list and
3897 % eventually be printed.
3898 \nobreak\kern-\tableindent
3899 \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
3901 \nobreak\kern\dimen0
3903 \itemxneedsnegativevskiptrue
3907 \def\item{\errmessage{@item while not in a list environment}}
3908 \def\itemx{\errmessage{@itemx while not in a list environment}}
3910 % @table, @ftable, @vtable.
3912 \let\itemindex\gobble
3916 \def\itemindex ##1{\doind {fn}{\code{##1}}}%
3917 \tablecheck{ftable}%
3920 \def\itemindex ##1{\doind {vr}{\code{##1}}}%
3921 \tablecheck{vtable}%
3924 \ifnum \the\catcode`\^^M=\active
3926 \errmessage{This command won't work in this context; perhaps the problem is
3927 that we are \inenvironment\thisenv}%
3928 \def\next{\doignore{#1}}%
3935 \def\itemindicate{#1}%
3940 \makevalueexpandable
3941 \edef\temp{\noexpand\tablez #1\space\space\space}%
3945 \def\tablez #1 #2 #3 #4\endtablez{%
3947 \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
3948 \ifnum 0#2>0 \tableindent=#2\mil \fi
3949 \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
3950 \itemmax=\tableindent
3951 \advance \itemmax by -\itemmargin
3952 \advance \leftskip by \tableindent
3953 \exdentamount=\tableindent
3955 \parskip = \smallskipamount
3956 \ifdim \parskip=0pt \parskip=2pt \fi
3957 \let\item = \internalBitem
3958 \let\itemx = \internalBitemx
3960 \def\Etable{\endgraf\afterenvbreak}
3963 \let\Eitemize\Etable
3964 \let\Eenumerate\Etable
3966 % This is the counter used by @enumerate, which is really @itemize
3970 \envdef\itemize{\parsearg\doitemize}
3974 \itemmax=\itemindent
3975 \advance\itemmax by -\itemmargin
3976 \advance\leftskip by \itemindent
3977 \exdentamount=\itemindent
3979 \parskip=\smallskipamount
3980 \ifdim\parskip=0pt \parskip=2pt \fi
3982 % Try typesetting the item mark that if the document erroneously says
3983 % something like @itemize @samp (intending @table), there's an error
3984 % right away at the @itemize. It's not the best error message in the
3985 % world, but it's better than leaving it to the @item. This means if
3986 % the user wants an empty mark, they have to say @w{} not just @w.
3987 \def\itemcontents{#1}%
3988 \setbox0 = \hbox{\itemcontents}%
3990 % @itemize with no arg is equivalent to @itemize @bullet.
3991 \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
3993 \let\item=\itemizeitem
3996 % Definition of @item while inside @itemize and @enumerate.
3999 \advance\itemno by 1 % for enumerations
4000 {\let\par=\endgraf \smallbreak}% reasonable place to break
4002 % If the document has an @itemize directly after a section title, a
4003 % \nobreak will be last on the list, and \sectionheading will have
4004 % done a \vskip-\parskip. In that case, we don't want to zero
4005 % parskip, or the item text will crash with the heading. On the
4006 % other hand, when there is normal text preceding the item (as there
4007 % usually is), we do want to zero parskip, or there would be too much
4008 % space. In that case, we won't have a \nobreak before. At least
4009 % that's the theory.
4010 \ifnum\lastpenalty<10000 \parskip=0in \fi
4012 \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
4014 \vadjust{\penalty 1200}}% not good to break after first line of item.
4018 % \splitoff TOKENS\endmark defines \first to be the first token in
4019 % TOKENS, and \rest to be the remainder.
4021 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
4023 % Allow an optional argument of an uppercase letter, lowercase letter,
4024 % or number, to specify the first label in the enumerated list. No
4025 % argument is the same as `1'.
4027 \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
4028 \def\enumeratey #1 #2\endenumeratey{%
4029 % If we were given no argument, pretend we were given `1'.
4031 \ifx\thearg\empty \def\thearg{1}\fi
4033 % Detect if the argument is a single token. If so, it might be a
4034 % letter. Otherwise, the only valid thing it can be is a number.
4035 % (We will always have one token, because of the test we just made.
4036 % This is a good thing, since \splitoff doesn't work given nothing at
4037 % all -- the first parameter is undelimited.)
4038 \expandafter\splitoff\thearg\endmark
4040 % Only one token in the argument. It could still be anything.
4041 % A ``lowercase letter'' is one whose \lccode is nonzero.
4042 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
4043 % not equal to itself.
4044 % Otherwise, we assume it's a number.
4046 % We need the \relax at the end of the \ifnum lines to stop TeX from
4047 % continuing to look for a <number>.
4049 \ifnum\lccode\expandafter`\thearg=0\relax
4050 \numericenumerate % a number (we hope)
4053 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
4054 \lowercaseenumerate % lowercase letter
4056 \uppercaseenumerate % uppercase letter
4060 % Multiple tokens in the argument. We hope it's a number.
4065 % An @enumerate whose labels are integers. The starting integer is
4068 \def\numericenumerate{%
4070 \startenumeration{\the\itemno}%
4073 % The starting (lowercase) letter is in \thearg.
4074 \def\lowercaseenumerate{%
4075 \itemno = \expandafter`\thearg
4077 % Be sure we're not beyond the end of the alphabet.
4079 \errmessage{No more lowercase letters in @enumerate; get a bigger
4086 % The starting (uppercase) letter is in \thearg.
4087 \def\uppercaseenumerate{%
4088 \itemno = \expandafter`\thearg
4090 % Be sure we're not beyond the end of the alphabet.
4092 \errmessage{No more uppercase letters in @enumerate; get a bigger
4099 % Call \doitemize, adding a period to the first argument and supplying the
4100 % common last two arguments. Also subtract one from the initial value in
4101 % \itemno, since @item increments \itemno.
4103 \def\startenumeration#1{%
4104 \advance\itemno by -1
4105 \doitemize{#1.}\flushcr
4108 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
4111 \def\alphaenumerate{\enumerate{a}}
4112 \def\capsenumerate{\enumerate{A}}
4113 \def\Ealphaenumerate{\Eenumerate}
4114 \def\Ecapsenumerate{\Eenumerate}
4117 % @multitable macros
4118 % Amy Hendrickson, 8/18/94, 3/6/96
4120 % @multitable ... @end multitable will make as many columns as desired.
4121 % Contents of each column will wrap at width given in preamble. Width
4122 % can be specified either with sample text given in a template line,
4123 % or in percent of \hsize, the current width of text on page.
4125 % Table can continue over pages but will only break between lines.
4129 % Either define widths of columns in terms of percent of \hsize:
4130 % @multitable @columnfractions .25 .3 .45
4133 % Numbers following @columnfractions are the percent of the total
4134 % current hsize to be used for each column. You may use as many
4135 % columns as desired.
4138 % Or use a template:
4139 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
4141 % using the widest term desired in each column.
4143 % Each new table line starts with @item, each subsequent new column
4144 % starts with @tab. Empty columns may be produced by supplying @tab's
4145 % with nothing between them for as many times as empty columns are needed,
4146 % ie, @tab@tab@tab will produce two empty columns.
4148 % @item, @tab do not need to be on their own lines, but it will not hurt
4151 % Sample multitable:
4153 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
4154 % @item first col stuff @tab second col stuff @tab third col
4161 % @item first col stuff @tab second col stuff
4162 % @tab Many paragraphs of text may be used in any column.
4164 % They will wrap at the width determined by the template.
4165 % @item@tab@tab This will be in third column.
4168 % Default dimensions may be reset by user.
4169 % @multitableparskip is vertical space between paragraphs in table.
4170 % @multitableparindent is paragraph indent in table.
4171 % @multitablecolmargin is horizontal space to be left between columns.
4172 % @multitablelinespace is space to leave between table items, baseline
4174 % 0pt means it depends on current normal line spacing.
4176 \newskip\multitableparskip
4177 \newskip\multitableparindent
4178 \newdimen\multitablecolspace
4179 \newskip\multitablelinespace
4180 \multitableparskip=0pt
4181 \multitableparindent=6pt
4182 \multitablecolspace=12pt
4183 \multitablelinespace=0pt
4185 % Macros used to set up halign preamble:
4187 \let\endsetuptable\relax
4188 \def\xendsetuptable{\endsetuptable}
4189 \let\columnfractions\relax
4190 \def\xcolumnfractions{\columnfractions}
4193 % #1 is the @columnfraction, usually a decimal number like .5, but might
4194 % be just 1. We just use it, whatever it is.
4196 \def\pickupwholefraction#1 {%
4197 \global\advance\colcount by 1
4198 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
4205 \ifx\firstarg\xendsetuptable
4208 \ifx\firstarg\xcolumnfractions
4209 \global\setpercenttrue
4212 \let\go\pickupwholefraction
4214 \global\advance\colcount by 1
4215 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
4216 % separator; typically that is always in the input, anyway.
4217 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
4220 \ifx\go\pickupwholefraction
4221 % Put the argument back for the \pickupwholefraction call, so
4222 % we'll always have a period there to be parsed.
4223 \def\go{\pickupwholefraction#1}%
4225 \let\go = \setuptable
4231 % multitable-only commands.
4233 % @headitem starts a heading row, which we typeset in bold.
4234 % Assignments have to be global since we are inside the implicit group
4235 % of an alignment entry. \everycr resets \everytab so we don't have to
4236 % undo it ourselves.
4237 \def\headitemfont{\b}% for people to use in the template row; not changeable
4239 \checkenv\multitable
4241 \global\everytab={\bf}% can't use \headitemfont since the parsing differs
4242 \the\everytab % for the first item
4245 % A \tab used to include \hskip1sp. But then the space in a template
4246 % line is not enough. That is bad. So let's go back to just `&' until
4247 % we again encounter the problem the 1sp was intended to solve.
4248 % --karl, nathan@acm.org, 20apr99.
4249 \def\tab{\checkenv\multitable &\the\everytab}%
4251 % @multitable ... @end multitable definitions:
4253 \newtoks\everytab % insert after every tab.
4255 \envdef\multitable{%
4259 % @item within a multitable starts a normal row.
4260 % We use \def instead of \let so that if one of the multitable entries
4261 % contains an @itemize, we don't choke on the \item (seen as \crcr aka
4262 % \endtemplate) expanding \doitemize.
4267 \setmultitablespacing
4268 \parskip=\multitableparskip
4269 \parindent=\multitableparindent
4275 \global\everytab={}%
4276 \global\colcount=0 % Reset the column counter.
4277 % Check for saved footnotes, etc.
4279 % Keeps underfull box messages off when table breaks over pages.
4281 % Maybe so, but it also creates really weird page breaks when the
4282 % table breaks over pages. Wouldn't \vfil be better? Wait until the
4283 % problem manifests itself, so it can be fixed for real --karl.
4287 \parsearg\domultitable
4289 \def\domultitable#1{%
4290 % To parse everything between @multitable and @item:
4291 \setuptable#1 \endsetuptable
4293 % This preamble sets up a generic column definition, which will
4294 % be used as many times as user calls for columns.
4295 % \vtop will set a single line and will also let text wrap and
4296 % continue for many paragraphs if desired.
4298 \global\advance\colcount by 1
4301 % Use the current \colcount to find the correct column width:
4302 \hsize=\expandafter\csname col\the\colcount\endcsname
4304 % In order to keep entries from bumping into each other
4305 % we will add a \leftskip of \multitablecolspace to all columns after
4308 % If a template has been used, we will add \multitablecolspace
4309 % to the width of each template entry.
4311 % If the user has set preamble in terms of percent of \hsize we will
4312 % use that dimension as the width of the column, and the \leftskip
4313 % will keep entries from bumping into each other. Table will start at
4314 % left margin and final column will justify at right margin.
4316 % Make sure we don't inherit \rightskip from the outer environment.
4319 % The first column will be indented with the surrounding text.
4320 \advance\hsize by\leftskip
4323 % If user has not set preamble in terms of percent of \hsize
4324 % we will advance \hsize by \multitablecolspace.
4325 \advance\hsize by \multitablecolspace
4327 % In either case we will make \leftskip=\multitablecolspace:
4328 \leftskip=\multitablecolspace
4330 % Ignoring space at the beginning and end avoids an occasional spurious
4331 % blank line, when TeX decides to break the line at the space before the
4332 % box from the multistrut, so the strut ends up on a line by itself.
4334 % @multitable @columnfractions .11 .89
4336 % @tab Legal holiday which is valid in major parts of the whole country.
4337 % Is automatically provided with highlighting sequences respectively
4338 % marking characters.
4339 \noindent\ignorespaces##\unskip\multistrut
4344 \egroup % end the \halign
4345 \global\setpercentfalse
4348 \def\setmultitablespacing{%
4349 \def\multistrut{\strut}% just use the standard line spacing
4351 % Compute \multitablelinespace (if not defined by user) for use in
4352 % \multitableparskip calculation. We used define \multistrut based on
4353 % this, but (ironically) that caused the spacing to be off.
4354 % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
4355 \ifdim\multitablelinespace=0pt
4356 \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
4357 \global\advance\multitablelinespace by-\ht0
4359 % Test to see if parskip is larger than space between lines of
4360 % table. If not, do nothing.
4361 % If so, set to same dimension as multitablelinespace.
4362 \ifdim\multitableparskip>\multitablelinespace
4363 \global\multitableparskip=\multitablelinespace
4364 \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
4365 % than skip between lines in the table.
4367 \ifdim\multitableparskip=0pt
4368 \global\multitableparskip=\multitablelinespace
4369 \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
4370 % than skip between lines in the table.
4374 \message{conditionals,}
4376 % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
4377 % @ifnotxml always succeed. They currently do nothing; we don't
4378 % attempt to check whether the conditionals are properly nested. But we
4379 % have to remember that they are conditionals, so that @end doesn't
4380 % attempt to close an environment group.
4383 \expandafter\let\csname #1\endcsname = \relax
4384 \expandafter\let\csname iscond.#1\endcsname = 1
4387 \makecond{ifnotdocbook}
4388 \makecond{ifnothtml}
4389 \makecond{ifnotinfo}
4390 \makecond{ifnotplaintext}
4393 % Ignore @ignore, @ifhtml, @ifinfo, and the like.
4395 \def\direntry{\doignore{direntry}}
4396 \def\documentdescription{\doignore{documentdescription}}
4397 \def\docbook{\doignore{docbook}}
4398 \def\html{\doignore{html}}
4399 \def\ifdocbook{\doignore{ifdocbook}}
4400 \def\ifhtml{\doignore{ifhtml}}
4401 \def\ifinfo{\doignore{ifinfo}}
4402 \def\ifnottex{\doignore{ifnottex}}
4403 \def\ifplaintext{\doignore{ifplaintext}}
4404 \def\ifxml{\doignore{ifxml}}
4405 \def\ignore{\doignore{ignore}}
4406 \def\menu{\doignore{menu}}
4407 \def\xml{\doignore{xml}}
4409 % Ignore text until a line `@end #1', keeping track of nested conditionals.
4411 % A count to remember the depth of nesting.
4412 \newcount\doignorecount
4414 \def\doignore#1{\begingroup
4415 % Scan in ``verbatim'' mode:
4417 \catcode`\@ = \other
4418 \catcode`\{ = \other
4419 \catcode`\} = \other
4421 % Make sure that spaces turn into tokens that match what \doignoretext wants.
4424 % Count number of #1's that we've seen.
4427 % Swallow text until we reach the matching `@end #1'.
4431 { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
4434 \gdef\dodoignore#1{%
4435 % #1 contains the command name as a string, e.g., `ifinfo'.
4437 % Define a command to find the next `@end #1'.
4438 \long\def\doignoretext##1^^M@end #1{%
4439 \doignoretextyyy##1^^M@#1\_STOP_}%
4441 % And this command to find another #1 command, at the beginning of a
4442 % line. (Otherwise, we would consider a line `@c @ifset', for
4443 % example, to count as an @ifset for nesting.)
4444 \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
4446 % And now expand that command.
4451 \def\doignoreyyy#1{%
4453 \ifx\temp\empty % Nothing found.
4454 \let\next\doignoretextzzz
4455 \else % Found a nested condition, ...
4456 \advance\doignorecount by 1
4457 \let\next\doignoretextyyy % ..., look for another.
4458 % If we're here, #1 ends with ^^M\ifinfo (for example).
4460 \next #1% the token \_STOP_ is present just after this macro.
4463 % We have to swallow the remaining "\_STOP_".
4465 \def\doignoretextzzz#1{%
4466 \ifnum\doignorecount = 0 % We have just found the outermost @end.
4467 \let\next\enddoignore
4468 \else % Still inside a nested condition.
4469 \advance\doignorecount by -1
4470 \let\next\doignoretext % Look for the next @end.
4475 % Finish off ignored text.
4477 % Ignore anything after the last `@end #1'; this matters in verbatim
4478 % environments, where otherwise the newline after an ignored conditional
4479 % would result in a blank line in the output.
4480 \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
4484 % @set VAR sets the variable VAR to an empty value.
4485 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
4487 % Since we want to separate VAR from REST-OF-LINE (which might be
4488 % empty), we can't just use \parsearg; we have to insert a space of our
4489 % own to delimit the rest of the line, and then take it out again if we
4491 % We rely on the fact that \parsearg sets \catcode`\ =10.
4493 \parseargdef\set{\setyyy#1 \endsetyyy}
4494 \def\setyyy#1 #2\endsetyyy{%
4496 \makevalueexpandable
4498 \edef\next{\gdef\makecsname{SET#1}}%
4506 % Remove the trailing space \setxxx inserted.
4507 \def\setzzz#1 \endsetzzz{\next{#1}}
4509 % @clear VAR clears (i.e., unsets) the variable VAR.
4511 \parseargdef\clear{%
4513 \makevalueexpandable
4514 \global\expandafter\let\csname SET#1\endcsname=\relax
4518 % @value{foo} gets the text saved in variable foo.
4519 \def\value{\begingroup\makevalueexpandable\valuexxx}
4520 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
4522 \catcode`\- = \active \catcode`\_ = \active
4524 \gdef\makevalueexpandable{%
4525 \let\value = \expandablevalue
4526 % We don't want these characters active, ...
4527 \catcode`\-=\other \catcode`\_=\other
4528 % ..., but we might end up with active ones in the argument if
4529 % we're called from @code, as @code{@value{foo-bar_}}, though.
4530 % So \let them to their normal equivalents.
4531 \let-\normaldash \let_\normalunderscore
4535 % We have this subroutine so that we can handle at least some @value's
4536 % properly in indexes (we call \makevalueexpandable in \indexdummies).
4537 % The command has to be fully expandable (if the variable is set), since
4538 % the result winds up in the index file. This means that if the
4539 % variable's value contains other Texinfo commands, it's almost certain
4540 % it will fail (although perhaps we could fix that with sufficient work
4541 % to do a one-level expansion on the result, instead of complete).
4543 \def\expandablevalue#1{%
4544 \expandafter\ifx\csname SET#1\endcsname\relax
4545 {[No value for ``#1'']}%
4546 \message{Variable `#1', used in @value, is not set.}%
4548 \csname SET#1\endcsname
4552 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
4555 % To get the special treatment we need for `@end ifset,' we call
4556 % \makecond and then redefine.
4559 \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
4562 \makevalueexpandable
4564 \expandafter\ifx\csname SET#2\endcsname\relax
4565 #1% If not set, redefine \next.
4570 \def\ifsetfail{\doignore{ifset}}
4572 % @ifclear VAR ... @end executes the `...' iff VAR has never been
4573 % defined with @set, or has been undefined with @clear.
4575 % The `\else' inside the `\doifset' parameter is a trick to reuse the
4576 % above code: if the variable is not set, do nothing, if it is set,
4577 % then redefine \next to \ifclearfail.
4580 \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
4581 \def\ifclearfail{\doignore{ifclear}}
4583 % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
4584 % without the @) is in fact defined. We can only feasibly check at the
4585 % TeX level, so something like `mathcode' is going to considered
4586 % defined even though it is not a Texinfo command.
4588 \makecond{ifcommanddefined}
4589 \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
4591 \def\doifcmddefined#1#2{{%
4592 \makevalueexpandable
4594 \expandafter\ifx\csname #2\endcsname\relax
4595 #1% If not defined, \let\next as above.
4600 \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
4602 % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
4603 \makecond{ifcommandnotdefined}
4604 \def\ifcommandnotdefined{%
4605 \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
4606 \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
4608 % Set the `txicommandconditionals' variable, so documents have a way to
4609 % test if the @ifcommand...defined conditionals are available.
4610 \set txicommandconditionals
4612 % @dircategory CATEGORY -- specify a category of the dir file
4613 % which this file should belong to. Ignore this in TeX.
4614 \let\dircategory=\comment
4616 % @defininfoenclose.
4617 \let\definfoenclose=\comment
4621 % Index generation facilities
4623 % Define \newwrite to be identical to plain tex's \newwrite
4624 % except not \outer, so it can be used within macros and \if's.
4625 \edef\newwrite{\makecsname{ptexnewwrite}}
4627 % \newindex {foo} defines an index named foo.
4628 % It automatically defines \fooindex such that
4629 % \fooindex ...rest of line... puts an entry in the index foo.
4630 % It also defines \fooindfile to be the number of the output channel for
4631 % the file that accumulates this index. The file's extension is foo.
4632 % The name of an index should be no more than 2 characters long
4633 % for the sake of vms.
4637 \expandafter\newwrite \csname#1indfile\endcsname
4638 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
4640 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
4641 \noexpand\doindex{#1}}
4644 % @defindex foo == \newindex{foo}
4646 \def\defindex{\parsearg\newindex}
4648 % Define @defcodeindex, like @defindex except put all entries in @code.
4650 \def\defcodeindex{\parsearg\newcodeindex}
4652 \def\newcodeindex#1{%
4654 \expandafter\newwrite \csname#1indfile\endcsname
4655 \openout \csname#1indfile\endcsname \jobname.#1
4657 \expandafter\xdef\csname#1index\endcsname{%
4658 \noexpand\docodeindex{#1}}%
4662 % @synindex foo bar makes index foo feed into index bar.
4663 % Do this instead of @defindex foo if you don't want it as a separate index.
4665 % @syncodeindex foo bar similar, but put all entries made for index foo
4668 \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
4669 \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
4671 % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
4672 % #3 the target index (bar).
4673 \def\dosynindex#1#2#3{%
4674 % Only do \closeout if we haven't already done it, else we'll end up
4675 % closing the target index.
4676 \expandafter \ifx\csname donesynindex#2\endcsname \relax
4677 % The \closeout helps reduce unnecessary open files; the limit on the
4678 % Acorn RISC OS is a mere 16 files.
4679 \expandafter\closeout\csname#2indfile\endcsname
4680 \expandafter\let\csname donesynindex#2\endcsname = 1
4682 % redefine \fooindfile:
4683 \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
4684 \expandafter\let\csname#2indfile\endcsname=\temp
4685 % redefine \fooindex:
4686 \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
4689 % Define \doindex, the driver for all \fooindex macros.
4690 % Argument #1 is generated by the calling \fooindex macro,
4691 % and it is "foo", the name of the index.
4693 % \doindex just uses \parsearg; it calls \doind for the actual work.
4694 % This is because \doind is more useful to call from other macros.
4696 % There is also \dosubind {index}{topic}{subtopic}
4697 % which makes an entry in a two-level index such as the operation index.
4699 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
4700 \def\singleindexer #1{\doind{\indexname}{#1}}
4702 % like the previous two, but they put @code around the argument.
4703 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
4704 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
4706 % Take care of Texinfo commands that can appear in an index entry.
4707 % Since there are some commands we want to expand, and others we don't,
4708 % we have to laboriously prevent expansion for those that we don't.
4711 \escapechar = `\\ % use backslash in output files.
4712 \def\@{@}% change to @@ when we switch to @ as escape char in index files.
4713 \def\ {\realbackslash\space }%
4715 % Need these unexpandable (because we define \tt as a dummy)
4716 % definitions when @{ or @} appear in index entry text. Also, more
4717 % complicated, when \tex is in effect and \{ is a \delimiter again.
4718 % We can't use \lbracecmd and \rbracecmd because texindex assumes
4719 % braces and backslashes are used only as delimiters. Perhaps we
4720 % should define @lbrace and @rbrace commands a la @comma.
4721 \def\{{{\tt\char123}}%
4722 \def\}{{\tt\char125}}%
4724 % I don't entirely understand this, but when an index entry is
4725 % generated from a macro call, the \endinput which \scanmacro inserts
4726 % causes processing to be prematurely terminated. This is,
4727 % apparently, because \indexsorttmp is fully expanded, and \endinput
4728 % is an expandable command. The redefinition below makes \endinput
4729 % disappear altogether for that purpose -- although logging shows that
4730 % processing continues to some further point. On the other hand, it
4731 % seems \endinput does not hurt in the printed index arg, since that
4732 % is still getting written without apparent harm.
4734 % Sample source (mac-idx3.tex, reported by Graham Percival to
4735 % help-texinfo, 22may06):
4736 % @macro funindex {WORD}
4740 % @funindex commtest
4742 % The above is not enough to reproduce the bug, but it gives the flavor.
4744 % Sample whatsit resulting:
4745 % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
4748 \let\endinput = \empty
4750 % Do the redefinitions.
4754 % For the aux and toc files, @ is the escape character. So we want to
4755 % redefine everything using @ as the escape character (instead of
4756 % \realbackslash, still used for index files). When everything uses @,
4757 % this will be simpler.
4762 \let\{ = \lbraceatcmd
4763 \let\} = \rbraceatcmd
4765 % Do the redefinitions.
4770 % Called from \indexdummies and \atdummies.
4772 \def\commondummies{%
4774 % \definedummyword defines \#1 as \string\#1\space, thus effectively
4775 % preventing its expansion. This is used only for control words,
4776 % not control letters, because the \space would be incorrect for
4777 % control characters, but is needed to separate the control word
4778 % from whatever follows.
4780 % For control letters, we have \definedummyletter, which omits the
4783 % These can be used both for control words that take an argument and
4784 % those that do not. If it is followed by {arg} in the input, then
4785 % that will dutifully get written to the index (or wherever).
4787 \def\definedummyword ##1{\def##1{\string##1\space}}%
4788 \def\definedummyletter##1{\def##1{\string##1}}%
4789 \let\definedummyaccent\definedummyletter
4791 \commondummiesnofonts
4793 \definedummyletter\_%
4794 \definedummyletter\-%
4796 % Non-English letters.
4807 \definedummyword\exclamdown
4811 \definedummyword\ordf
4812 \definedummyword\ordm
4813 \definedummyword\questiondown
4817 % Although these internal commands shouldn't show up, sometimes they do.
4819 \definedummyword\gtr
4820 \definedummyword\hat
4821 \definedummyword\less
4824 \definedummyword\tclose
4827 \definedummyword\LaTeX
4828 \definedummyword\TeX
4830 % Assorted special characters.
4831 \definedummyword\arrow
4832 \definedummyword\bullet
4833 \definedummyword\comma
4834 \definedummyword\copyright
4835 \definedummyword\registeredsymbol
4836 \definedummyword\dots
4837 \definedummyword\enddots
4838 \definedummyword\entrybreak
4839 \definedummyword\equiv
4840 \definedummyword\error
4841 \definedummyword\euro
4842 \definedummyword\expansion
4843 \definedummyword\geq
4844 \definedummyword\guillemetleft
4845 \definedummyword\guillemetright
4846 \definedummyword\guilsinglleft
4847 \definedummyword\guilsinglright
4848 \definedummyword\lbracechar
4849 \definedummyword\leq
4850 \definedummyword\minus
4851 \definedummyword\ogonek
4852 \definedummyword\pounds
4853 \definedummyword\point
4854 \definedummyword\print
4855 \definedummyword\quotedblbase
4856 \definedummyword\quotedblleft
4857 \definedummyword\quotedblright
4858 \definedummyword\quoteleft
4859 \definedummyword\quoteright
4860 \definedummyword\quotesinglbase
4861 \definedummyword\rbracechar
4862 \definedummyword\result
4863 \definedummyword\textdegree
4865 % We want to disable all macros so that they are not expanded by \write.
4868 \normalturnoffactive
4870 % Handle some cases of @value -- where it does not contain any
4871 % (non-fully-expandable) commands.
4872 \makevalueexpandable
4875 % \commondummiesnofonts: common to \commondummies and \indexnofonts.
4877 \def\commondummiesnofonts{%
4878 % Control letters and accents.
4879 \definedummyletter\!%
4880 \definedummyaccent\"%
4881 \definedummyaccent\'%
4882 \definedummyletter\*%
4883 \definedummyaccent\,%
4884 \definedummyletter\.%
4885 \definedummyletter\/%
4886 \definedummyletter\:%
4887 \definedummyaccent\=%
4888 \definedummyletter\?%
4889 \definedummyaccent\^%
4890 \definedummyaccent\`%
4891 \definedummyaccent\~%
4895 \definedummyword\dotaccent
4896 \definedummyword\ogonek
4897 \definedummyword\ringaccent
4898 \definedummyword\tieaccent
4899 \definedummyword\ubaraccent
4900 \definedummyword\udotaccent
4901 \definedummyword\dotless
4903 % Texinfo font commands.
4907 \definedummyword\sansserif
4909 \definedummyword\slanted
4912 % Commands that take arguments.
4913 \definedummyword\abbr
4914 \definedummyword\acronym
4915 \definedummyword\anchor
4916 \definedummyword\cite
4917 \definedummyword\code
4918 \definedummyword\command
4919 \definedummyword\dfn
4920 \definedummyword\dmn
4921 \definedummyword\email
4922 \definedummyword\emph
4923 \definedummyword\env
4924 \definedummyword\file
4925 \definedummyword\image
4926 \definedummyword\indicateurl
4927 \definedummyword\inforef
4928 \definedummyword\kbd
4929 \definedummyword\key
4930 \definedummyword\math
4931 \definedummyword\option
4932 \definedummyword\pxref
4933 \definedummyword\ref
4934 \definedummyword\samp
4935 \definedummyword\strong
4936 \definedummyword\tie
4937 \definedummyword\uref
4938 \definedummyword\url
4939 \definedummyword\var
4940 \definedummyword\verb
4942 \definedummyword\xref
4945 % \indexnofonts is used when outputting the strings to sort the index
4946 % by, and when constructing control sequence names. It eliminates all
4947 % control sequences and just writes whatever the best ASCII sort string
4948 % would be for a given command (usually its argument).
4951 % Accent commands should become @asis.
4952 \def\definedummyaccent##1{\let##1\asis}%
4953 % We can just ignore other control letters.
4954 \def\definedummyletter##1{\let##1\empty}%
4955 % All control words become @asis by default; overrides below.
4956 \let\definedummyword\definedummyaccent
4958 \commondummiesnofonts
4960 % Don't no-op \tt, since it isn't a user-level command
4961 % and is used in the definitions of the active chars like <, >, |, etc.
4962 % Likewise with the other plain tex font commands.
4967 \def\_{\normalunderscore}%
4968 \def\-{}% @- shouldn't affect sorting
4970 % Unfortunately, texindex is not prepared to handle braces in the
4971 % content at all. So for index sorting, we map @{ and @} to strings
4972 % starting with |, since that ASCII character is between ASCII { and }.
4974 \def\lbracechar{|a}%
4977 \def\rbracechar{|b}%
4979 % Non-English letters.
4996 \def\questiondown{?}%
5003 % Assorted special characters.
5004 % (The following {} will end up in the sort string, but that's ok.)
5006 \def\bullet{bullet}%
5008 \def\copyright{copyright}%
5014 \def\expansion{==>}%
5016 \def\guillemetleft{<<}%
5017 \def\guillemetright{>>}%
5018 \def\guilsinglleft{<}%
5019 \def\guilsinglright{>}%
5023 \def\pounds{pounds}%
5025 \def\quotedblbase{"}%
5026 \def\quotedblleft{"}%
5027 \def\quotedblright{"}%
5030 \def\quotesinglbase{,}%
5031 \def\registeredsymbol{R}%
5035 \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
5036 \else \indexlquoteignore \fi
5038 % We need to get rid of all macros, leaving only the arguments (if present).
5039 % Of course this is not nearly correct, but it is the best we can do for now.
5040 % makeinfo does not expand macros in the argument to @deffn, which ends up
5041 % writing an index entry, and texindex isn't prepared for an index sort entry
5042 % that starts with \.
5044 % Since macro invocations are followed by braces, we can just redefine them
5045 % to take a single TeX argument. The case of a macro invocation that
5046 % goes to end-of-line is not handled.
5051 % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
5052 % ignore left quotes in the sort term.
5053 {\catcode`\`=\active
5054 \gdef\indexlquoteignore{\let`=\empty}}
5056 \let\indexbackslash=0 %overridden during \printindex.
5057 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
5059 % Most index entries go through here, but \dosubind is the general case.
5060 % #1 is the index name, #2 is the entry text.
5061 \def\doind#1#2{\dosubind{#1}{#2}{}}
5063 % Workhorse for all \fooindexes.
5064 % #1 is name of index, #2 is stuff to put there, #3 is subentry --
5065 % empty if called from \doind, as we usually are (the main exception
5066 % is with most defuns, which call us directly).
5068 \def\dosubind#1#2#3{%
5071 % Store the main index entry text (including the third arg).
5073 % If third arg is present, precede it with a space.
5075 \ifx\thirdarg\empty \else
5076 \toks0 = \expandafter{\the\toks0 \space #3}%
5079 \edef\writeto{\csname#1indfile\endcsname}%
5081 \safewhatsit\dosubindwrite
5086 % Write the entry in \toks0 to the index file:
5088 \def\dosubindwrite{%
5089 % Put the index entry in the margin if desired.
5090 \ifx\SETmarginindex\relax\else
5091 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
5094 % Remember, we are within a group.
5095 \indexdummies % Must do this here, since \bf, etc expand at this stage
5096 \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
5097 % so it will be output as is; and it will print as backslash.
5099 % Process the index entry with all font commands turned off, to
5100 % get the string to sort by.
5102 \edef\temp{\the\toks0}% need full expansion
5103 \xdef\indexsorttmp{\temp}%
5106 % Set up the complete index entry, with both the sort key and
5107 % the original text, including any font commands. We write
5108 % three arguments to \entry to the .?? file (four in the
5109 % subentry case), texindex reduces to two when writing the .??s
5113 \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
5118 % Take care of unwanted page breaks/skips around a whatsit:
5120 % If a skip is the last thing on the list now, preserve it
5121 % by backing up by \lastskip, doing the \write, then inserting
5122 % the skip again. Otherwise, the whatsit generated by the
5123 % \write or \pdfdest will make \lastskip zero. The result is that
5124 % sequences like this:
5128 % will have extra space inserted, because the \medbreak in the
5129 % start of the @defun won't see the skip inserted by the @end of
5130 % the previous defun.
5132 % But don't do any of this if we're not in vertical mode. We
5133 % don't want to do a \vskip and prematurely end a paragraph.
5135 % Avoid page breaks due to these extra skips, too.
5137 % But wait, there is a catch there:
5138 % We'll have to check whether \lastskip is zero skip. \ifdim is not
5139 % sufficient for this purpose, as it ignores stretch and shrink parts
5140 % of the skip. The only way seems to be to check the textual
5141 % representation of the skip.
5143 % The following is almost like \def\zeroskipmacro{0.0pt} except that
5144 % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
5146 \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
5148 \newskip\whatsitskip
5149 \newcount\whatsitpenalty
5153 \def\safewhatsit#1{\ifhmode
5156 % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
5157 \whatsitskip = \lastskip
5158 \edef\lastskipmacro{\the\lastskip}%
5159 \whatsitpenalty = \lastpenalty
5161 % If \lastskip is nonzero, that means the last item was a
5162 % skip. And since a skip is discardable, that means this
5163 % -\whatsitskip glue we're inserting is preceded by a
5164 % non-discardable item, therefore it is not a potential
5165 % breakpoint, therefore no \nobreak needed.
5166 \ifx\lastskipmacro\zeroskipmacro
5173 \ifx\lastskipmacro\zeroskipmacro
5174 % If \lastskip was zero, perhaps the last item was a penalty, and
5175 % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
5176 % to re-insert the same penalty (values >10000 are used for various
5177 % signals); since we just inserted a non-discardable item, any
5178 % following glue (such as a \parskip) would be a breakpoint. For example:
5179 % @deffn deffn-whatever
5180 % @vindex index-whatever
5182 % would allow a break between the index-whatever whatsit
5183 % and the "Description." paragraph.
5184 \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
5186 % On the other hand, if we had a nonzero \lastskip,
5187 % this make-up glue would be preceded by a non-discardable item
5188 % (the whatsit from the \write), so we must insert a \nobreak.
5189 \nobreak\vskip\whatsitskip
5193 % The index entry written in the file actually looks like
5194 % \entry {sortstring}{page}{topic}
5196 % \entry {sortstring}{page}{topic}{subtopic}
5197 % The texindex program reads in these files and writes files
5198 % containing these kinds of lines:
5200 % before the first topic whose initial is c
5201 % \entry {topic}{pagelist}
5202 % for a topic that is used without subtopics
5204 % for the beginning of a topic that is used with subtopics
5205 % \secondary {subtopic}{pagelist}
5206 % for each subtopic.
5208 % Define the user-accessible indexing commands
5209 % @findex, @vindex, @kindex, @cindex.
5211 \def\findex {\fnindex}
5212 \def\kindex {\kyindex}
5213 \def\cindex {\cpindex}
5214 \def\vindex {\vrindex}
5215 \def\tindex {\tpindex}
5216 \def\pindex {\pgindex}
5218 \def\cindexsub {\begingroup\obeylines\cindexsub}
5220 \gdef\cindexsub "#1" #2^^M{\endgroup %
5221 \dosubind{cp}{#2}{#1}}}
5223 % Define the macros used in formatting output of the sorted index material.
5225 % @printindex causes a particular index (the ??s file) to get printed.
5226 % It does not print any chapter heading (usually an @unnumbered).
5228 \parseargdef\printindex{\begingroup
5229 \dobreak \chapheadingskip{10000}%
5234 \everypar = {}% don't want the \kern\-parindent from indentation suppression.
5236 % See if the index file exists and is nonempty.
5237 % Change catcode of @ here so that if the index file contains
5239 % as its first line, TeX doesn't complain about mismatched braces
5240 % (because it thinks @} is a control sequence).
5242 \openin 1 \jobname.#1s
5244 % \enddoublecolumns gets confused if there is no text in the index,
5245 % and it loses the chapter title and the aux file entries for the
5246 % index. The easiest way to prevent this problem is to make sure
5247 % there is some text.
5248 \putwordIndexNonexistent
5251 % If the index file exists but is empty, then \openin leaves \ifeof
5252 % false. We have to make TeX try to read something from the file, so
5253 % it can discover if there is anything in it.
5256 \putwordIndexIsEmpty
5258 % Index files are almost Texinfo source, but we use \ as the escape
5259 % character. It would be better to use @, but that's too big a change
5260 % to make right now.
5261 \def\indexbackslash{\backslashcurfont}%
5272 % These macros are used by the sorted index file itself.
5273 % Change them to control the appearance of the index.
5276 % Some minor font changes for the special characters.
5278 \let\tentt=\sectt \let\tt=\sectt \let\sf=\gt\sectt
5280 \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
5283 % Remove any glue we may have, we'll be inserting our own.
5286 % We like breaks before the index initials, so insert a bonus.
5288 \vskip 0pt plus 3\baselineskip
5290 \vskip 0pt plus -3\baselineskip
5292 % Typeset the initial. Making this add up to a whole number of
5293 % baselineskips increases the chance of the dots lining up from column
5294 % to column. It still won't often be perfect, because of the stretch
5295 % we need before each entry, but it's better.
5297 % No shrink because it confuses \balancecolumns.
5298 \vskip 1.67\baselineskip plus .5\baselineskip
5300 \leftline{\secgt\secbf #1}%
5302 \leftline{\secbf #1}%
5304 % Do our best not to break after the initial.
5306 \vskip .33\baselineskip plus .1\baselineskip
5309 % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
5310 % then page number (#2) flushed to the right margin. It is used for index
5311 % and table of contents entries. The paragraph is indented by \leftskip.
5313 % A straightforward implementation would start like this:
5314 % \def\entry#1#2{...
5315 % But this freezes the catcodes in the argument, and can cause problems to
5316 % @code, which sets - active. This problem was fixed by a kludge---
5317 % ``-'' was active throughout whole index, but this isn't really right.
5318 % The right solution is to prevent \entry from swallowing the whole text.
5323 % Start a new paragraph if necessary, so our assignments below can't
5324 % affect previous text.
5327 % Do not fill out the last line with white space.
5330 % No extra space above this paragraph.
5333 % Do not prefer a separate line ending with a hyphen to fewer lines.
5334 \finalhyphendemerits = 0
5336 % \hangindent is only relevant when the entry text and page number
5337 % don't both fit on one line. In that case, bob suggests starting the
5338 % dots pretty far over on the line. Unfortunately, a large
5339 % indentation looks wrong when the entry text itself is broken across
5340 % lines. So we use a small indentation and put up with long leaders.
5342 % \hangafter is reset to 1 (which is the value we want) at the start
5343 % of each paragraph, so we need not do anything with that.
5346 % When the entry text needs to be broken, just fill out the first line
5348 \rightskip = 0pt plus1fil
5350 % A bit of stretch before each entry for the benefit of balancing
5354 % When reading the text of entry, convert explicit line breaks
5355 % from @* into spaces. The user might give these in long section
5356 % titles, for instance.
5357 \def\*{\unskip\space\ignorespaces}%
5358 \def\entrybreak{\hfil\break}%
5360 % Swallow the left brace of the text (first parameter):
5361 \afterassignment\doentry
5364 \def\entrybreak{\unskip\space\ignorespaces}%
5366 \bgroup % Instead of the swallowed brace.
5368 \aftergroup\finishentry
5369 % And now comes the text of the entry.
5371 \def\finishentry#1{%
5372 % #1 is the page number.
5374 % The following is kludged to not output a line of dots in the index if
5375 % there are no page numbers. The next person who breaks this will be
5376 % cursed by a Unix daemon.
5377 \setbox\boxA = \hbox{#1}%
5378 \ifdim\wd\boxA = 0pt
5382 % If we must, put the page number on a line of its own, and fill out
5383 % this line with blank space. (The \hfil is overwhelmed with the
5384 % fill leaders glue in \indexdotfill if the page number does fit.)
5386 \null\nobreak\indexdotfill % Have leaders before the page number.
5388 % The `\ ' here is removed by the implicit \unskip that TeX does as
5389 % part of (the primitive) \par. Without it, a spurious underfull
5402 % Like plain.tex's \dotfill, except uses up at least 1 em.
5403 \def\indexdotfill{\cleaders
5404 \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
5406 \def\primary #1{\line{#1\hfil}}
5408 \newskip\secondaryindent \secondaryindent=0.5cm
5409 \def\secondary#1#2{{%
5414 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
5416 \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
5423 % Define two-column mode, which we use to typeset indexes.
5424 % Adapted from the TeXbook, page 416, which is to say,
5425 % the manmac.tex format used to print the TeXbook itself.
5429 \newdimen\doublecolumnhsize
5431 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
5432 % Grab any single-column material above us.
5435 % Here is a possibility not foreseen in manmac: if we accumulate a
5436 % whole lot of material, we might end up calling this \output
5437 % routine twice in a row (see the doublecol-lose test, which is
5438 % essentially a couple of indexes with @setchapternewpage off). In
5439 % that case we just ship out what is in \partialpage with the normal
5440 % output routine. Generally, \partialpage will be empty when this
5441 % runs and this will be a no-op. See the indexspread.tex test case.
5442 \ifvoid\partialpage \else
5443 \onepageout{\pagecontents\partialpage}%
5446 \global\setbox\partialpage = \vbox{%
5447 % Unvbox the main output page.
5449 \kern-\topskip \kern\baselineskip
5452 \eject % run that output routine to set \partialpage
5454 % Use the double-column output routine for subsequent pages.
5455 \output = {\doublecolumnout}%
5457 % Change the page size parameters. We could do this once outside this
5458 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
5459 % format, but then we repeat the same computation. Repeating a couple
5460 % of assignments once per index is clearly meaningless for the
5461 % execution time, so we may as well do it in one place.
5463 % First we halve the line length, less a little for the gutter between
5464 % the columns. We compute the gutter based on the line length, so it
5465 % changes automatically with the paper format. The magic constant
5466 % below is chosen so that the gutter has the same value (well, +-<1pt)
5467 % as it did when we hard-coded it.
5469 % We put the result in a separate register, \doublecolumhsize, so we
5470 % can restore it in \pagesofar, after \hsize itself has (potentially)
5473 \doublecolumnhsize = \hsize
5474 \advance\doublecolumnhsize by -.04154\hsize
5475 \divide\doublecolumnhsize by 2
5476 \hsize = \doublecolumnhsize
5478 % Double the \vsize as well. (We don't need a separate register here,
5479 % since nobody clobbers \vsize.)
5483 % The double-column output routine for all double-column pages except
5486 \def\doublecolumnout{%
5487 \splittopskip=\topskip \splitmaxdepth=\maxdepth
5488 % Get the available space for the double columns -- the normal
5489 % (undoubled) page height minus any material left over from the
5493 \advance\dimen@ by -\ht\partialpage
5495 % box0 will be the left-hand column, box2 the right.
5496 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
5497 \onepageout\pagesofar
5499 \penalty\outputpenalty
5502 % Re-output the contents of the output page -- any previous material,
5503 % followed by the two boxes we just split, in box0 and box2.
5507 \hsize = \doublecolumnhsize
5508 \wd0=\hsize \wd2=\hsize
5509 \hbox to\pagewidth{\box0\hfil\box2}%
5512 % All done with double columns.
5513 \def\enddoublecolumns{%
5514 % The following penalty ensures that the page builder is exercised
5515 % _before_ we change the output routine. This is necessary in the
5516 % following situation:
5518 % The last section of the index consists only of a single entry.
5519 % Before this section, \pagetotal is less than \pagegoal, so no
5520 % break occurs before the last section starts. However, the last
5521 % section, consisting of \initial and the single \entry, does not
5522 % fit on the page and has to be broken off. Without the following
5523 % penalty the page builder will not be exercised until \eject
5524 % below, and by that time we'll already have changed the output
5525 % routine to the \balancecolumns version, so the next-to-last
5526 % double-column page will be processed with \balancecolumns, which
5527 % is wrong: The two columns will go to the main vertical list, with
5528 % the broken-off section in the recent contributions. As soon as
5529 % the output routine finishes, TeX starts reconsidering the page
5530 % break. The two columns and the broken-off section both fit on the
5531 % page, because the two columns now take up only half of the page
5532 % goal. When TeX sees \eject from below which follows the final
5533 % section, it invokes the new output routine that we've set after
5534 % \balancecolumns below; \onepageout will try to fit the two columns
5535 % and the final section into the vbox of \pageheight (see
5536 % \pagebody), causing an overfull box.
5538 % Note that glue won't work here, because glue does not exercise the
5539 % page builder, unlike penalties (see The TeXbook, pp. 280-281).
5543 % Split the last of the double-column material. Leave it on the
5544 % current page, no automatic page break.
5547 % If we end up splitting too much material for the current page,
5548 % though, there will be another page break right after this \output
5549 % invocation ends. Having called \balancecolumns once, we do not
5550 % want to call it again. Therefore, reset \output to its normal
5551 % definition right away. (We hope \balancecolumns will never be
5552 % called on to balance too much material, but if it is, this makes
5553 % the output somewhat more palatable.)
5554 \global\output = {\onepageout{\pagecontents\PAGE}}%
5557 \endgroup % started in \begindoublecolumns
5559 % \pagegoal was set to the doubled \vsize above, since we restarted
5560 % the current page. We're now back to normal single-column
5561 % typesetting, so reset \pagegoal to the normal \vsize (after the
5562 % \endgroup where \vsize got restored).
5566 % Called at the end of the double column material.
5567 \def\balancecolumns{%
5568 \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
5570 \advance\dimen@ by \topskip
5571 \advance\dimen@ by-\baselineskip
5572 \divide\dimen@ by 2 % target to split to
5573 %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
5574 \splittopskip = \topskip
5575 % Loop until we get a decent breakpoint.
5579 \global\setbox3 = \copy0
5580 \global\setbox1 = \vsplit3 to \dimen@
5582 \global\advance\dimen@ by 1pt
5585 %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
5586 \setbox0=\vbox to\dimen@{\unvbox1}%
5587 \setbox2=\vbox to\dimen@{\unvbox3}%
5591 \catcode`\@ = \other
5594 \message{sectioning,}
5595 % Chapters, sections, etc.
5597 % Let's start with @part.
5598 \outer\parseargdef\part{\partzzz{#1}}
5602 \vskip.3\vsize % move it down on the page a bit
5604 \noindent \titlefonts\rmisbold #1\par % the text
5605 \let\lastnode=\empty % no node to associate with
5606 \writetocentry{part}{#1}{}% but put it in the toc
5607 \headingsoff % no headline or footline on the part page
5612 % \unnumberedno is an oxymoron. But we count the unnumbered
5613 % sections so that we can refer to them unambiguously in the pdf
5614 % outlines by their "section number". We avoid collisions with chapter
5615 % numbers by starting them at 10000. (If a document ever has 10000
5616 % chapters, we're in trouble anyway, I'm sure.)
5617 \newcount\unnumberedno \unnumberedno = 10000
5619 \newcount\secno \secno=0
5620 \newcount\subsecno \subsecno=0
5621 \newcount\subsubsecno \subsubsecno=0
5623 % This counter is funny since it counts through charcodes of letters A, B, ...
5624 \newcount\appendixno \appendixno = `\@
5626 % \def\appendixletter{\char\the\appendixno}
5627 % We do the following ugly conditional instead of the above simple
5628 % construct for the sake of pdftex, which needs the actual
5629 % letter in the expansion, not just typeset.
5631 \def\appendixletter{%
5632 \ifnum\appendixno=`A A%
5633 \else\ifnum\appendixno=`B B%
5634 \else\ifnum\appendixno=`C C%
5635 \else\ifnum\appendixno=`D D%
5636 \else\ifnum\appendixno=`E E%
5637 \else\ifnum\appendixno=`F F%
5638 \else\ifnum\appendixno=`G G%
5639 \else\ifnum\appendixno=`H H%
5640 \else\ifnum\appendixno=`I I%
5641 \else\ifnum\appendixno=`J J%
5642 \else\ifnum\appendixno=`K K%
5643 \else\ifnum\appendixno=`L L%
5644 \else\ifnum\appendixno=`M M%
5645 \else\ifnum\appendixno=`N N%
5646 \else\ifnum\appendixno=`O O%
5647 \else\ifnum\appendixno=`P P%
5648 \else\ifnum\appendixno=`Q Q%
5649 \else\ifnum\appendixno=`R R%
5650 \else\ifnum\appendixno=`S S%
5651 \else\ifnum\appendixno=`T T%
5652 \else\ifnum\appendixno=`U U%
5653 \else\ifnum\appendixno=`V V%
5654 \else\ifnum\appendixno=`W W%
5655 \else\ifnum\appendixno=`X X%
5656 \else\ifnum\appendixno=`Y Y%
5657 \else\ifnum\appendixno=`Z Z%
5658 % The \the is necessary, despite appearances, because \appendixletter is
5659 % expanded while writing the .toc file. \char\appendixno is not
5660 % expandable, thus it is written literally, thus all appendixes come out
5661 % with the same letter (or @) in the toc without it.
5662 \else\char\the\appendixno
5663 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
5664 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
5666 % Each @chapter defines these (using marks) as the number+name, number
5667 % and name of the chapter. Page headings and footings can use
5668 % these. @section does likewise.
5670 \def\thischapternum{}
5671 \def\thischaptername{}
5673 \def\thissectionnum{}
5674 \def\thissectionname{}
5676 \newcount\absseclevel % used to calculate proper heading level
5677 \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
5679 % @raisesections: treat @section as chapter, @subsection as section, etc.
5680 \def\raisesections{\global\advance\secbase by -1}
5681 \let\up=\raisesections % original BFox name
5683 % @lowersections: treat @chapter as section, @section as subsection, etc.
5684 \def\lowersections{\global\advance\secbase by 1}
5685 \let\down=\lowersections % original BFox name
5687 % we only have subsub.
5688 \chardef\maxseclevel = 3
5690 % A numbered section within an unnumbered changes to unnumbered too.
5691 % To achieve this, remember the "biggest" unnum. sec. we are currently in:
5692 \chardef\unnlevel = \maxseclevel
5694 % Trace whether the current chapter is an appendix or not:
5695 % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
5696 \def\chapheadtype{N}
5698 % Choose a heading macro
5699 % #1 is heading type
5700 % #2 is heading level
5701 % #3 is text for heading
5702 \def\genhead#1#2#3{%
5703 % Compute the abs. sec. level:
5705 \advance\absseclevel by \secbase
5706 % Make sure \absseclevel doesn't fall outside the range:
5707 \ifnum \absseclevel < 0
5710 \ifnum \absseclevel > 3
5717 \ifnum \absseclevel < \unnlevel
5718 \chardef\unnlevel = \absseclevel
5721 % Check for appendix sections:
5722 \ifnum \absseclevel = 0
5723 \edef\chapheadtype{\headtype}%
5725 \if \headtype A\if \chapheadtype N%
5726 \errmessage{@appendix... within a non-appendix chapter}%
5729 % Check for numbered within unnumbered:
5730 \ifnum \absseclevel > \unnlevel
5733 \chardef\unnlevel = 3
5736 % Now print the heading:
5740 \or \unnumberedseczzz{#3}%
5741 \or \unnumberedsubseczzz{#3}%
5742 \or \unnumberedsubsubseczzz{#3}%
5748 \or \appendixsectionzzz{#3}%
5749 \or \appendixsubseczzz{#3}%
5750 \or \appendixsubsubseczzz{#3}%
5756 \or \numberedsubseczzz{#3}%
5757 \or \numberedsubsubseczzz{#3}%
5761 \suppressfirstparagraphindent
5765 \def\numhead{\genhead N}
5766 \def\apphead{\genhead A}
5767 \def\unnmhead{\genhead U}
5769 % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
5770 % all lower-level sectioning counters to zero.
5772 % Also set \chaplevelprefix, which we prepend to @float sequence numbers
5773 % (e.g., figures), q.v. By default (before any chapter), that is empty.
5774 \let\chaplevelprefix = \empty
5776 \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
5778 % section resetting is \global in case the chapter is in a group, such
5779 % as an @include file.
5780 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
5781 \global\advance\chapno by 1
5784 \gdef\chaplevelprefix{\the\chapno.}%
5787 % \putwordChapter can contain complex things in translations.
5788 \toks0=\expandafter{\putwordChapter}%
5789 \message{\the\toks0 \space \the\chapno}%
5791 % Write the actual heading.
5792 \chapmacro{#1}{Ynumbered}{\the\chapno}%
5794 % So @section and the like are numbered underneath this chapter.
5795 \global\let\section = \numberedsec
5796 \global\let\subsection = \numberedsubsec
5797 \global\let\subsubsection = \numberedsubsubsec
5800 \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
5802 \def\appendixzzz#1{%
5803 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
5804 \global\advance\appendixno by 1
5805 \gdef\chaplevelprefix{\appendixletter.}%
5808 % \putwordAppendix can contain complex things in translations.
5809 \toks0=\expandafter{\putwordAppendix}%
5810 \message{\the\toks0 \space \appendixletter}%
5812 \chapmacro{#1}{Yappendix}{\appendixletter}%
5814 \global\let\section = \appendixsec
5815 \global\let\subsection = \appendixsubsec
5816 \global\let\subsubsection = \appendixsubsubsec
5819 % normally unnmhead0 calls unnumberedzzz:
5820 \outer\parseargdef\unnumbered{\unnmhead0{#1}}
5821 \def\unnumberedzzz#1{%
5822 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
5823 \global\advance\unnumberedno by 1
5825 % Since an unnumbered has no number, no prefix for figures.
5826 \global\let\chaplevelprefix = \empty
5829 % This used to be simply \message{#1}, but TeX fully expands the
5830 % argument to \message. Therefore, if #1 contained @-commands, TeX
5831 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
5832 % expanded @cite (which turns out to cause errors because \cite is meant
5833 % to be executed, not expanded).
5835 % Anyway, we don't want the fully-expanded definition of @cite to appear
5836 % as a result of the \message, we just want `@cite' itself. We use
5837 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
5838 % simply yielding the contents of <toks register>. (We also do this for
5841 \message{(\the\toks0)}%
5843 \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
5845 \global\let\section = \unnumberedsec
5846 \global\let\subsection = \unnumberedsubsec
5847 \global\let\subsubsection = \unnumberedsubsubsec
5850 % @centerchap is like @unnumbered, but the heading is centered.
5851 \outer\parseargdef\centerchap{%
5852 % Well, we could do the following in a group, but that would break
5853 % an assumption that \chapmacro is called at the outermost level.
5854 % Thus we are safer this way: --kasal, 24feb04
5855 \let\centerparametersmaybe = \centerparameters
5857 \let\centerparametersmaybe = \relax
5860 % @top is like @unnumbered.
5865 \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
5867 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
5868 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
5871 % normally calls appendixsectionzzz:
5872 \outer\parseargdef\appendixsection{\apphead1{#1}}
5873 \def\appendixsectionzzz#1{%
5874 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
5875 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
5877 \let\appendixsec\appendixsection
5879 % normally calls unnumberedseczzz:
5880 \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
5881 \def\unnumberedseczzz#1{%
5882 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
5883 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
5888 % normally calls numberedsubseczzz:
5889 \outer\parseargdef\numberedsubsec{\numhead2{#1}}
5890 \def\numberedsubseczzz#1{%
5891 \global\subsubsecno=0 \global\advance\subsecno by 1
5892 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
5895 % normally calls appendixsubseczzz:
5896 \outer\parseargdef\appendixsubsec{\apphead2{#1}}
5897 \def\appendixsubseczzz#1{%
5898 \global\subsubsecno=0 \global\advance\subsecno by 1
5899 \sectionheading{#1}{subsec}{Yappendix}%
5900 {\appendixletter.\the\secno.\the\subsecno}%
5903 % normally calls unnumberedsubseczzz:
5904 \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
5905 \def\unnumberedsubseczzz#1{%
5906 \global\subsubsecno=0 \global\advance\subsecno by 1
5907 \sectionheading{#1}{subsec}{Ynothing}%
5908 {\the\unnumberedno.\the\secno.\the\subsecno}%
5913 % normally numberedsubsubseczzz:
5914 \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
5915 \def\numberedsubsubseczzz#1{%
5916 \global\advance\subsubsecno by 1
5917 \sectionheading{#1}{subsubsec}{Ynumbered}%
5918 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
5921 % normally appendixsubsubseczzz:
5922 \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
5923 \def\appendixsubsubseczzz#1{%
5924 \global\advance\subsubsecno by 1
5925 \sectionheading{#1}{subsubsec}{Yappendix}%
5926 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
5929 % normally unnumberedsubsubseczzz:
5930 \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
5931 \def\unnumberedsubsubseczzz#1{%
5932 \global\advance\subsubsecno by 1
5933 \sectionheading{#1}{subsubsec}{Ynothing}%
5934 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
5937 % These macros control what the section commands do, according
5938 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
5939 % Define them by default for a numbered chapter.
5940 \let\section = \numberedsec
5941 \let\subsection = \numberedsubsec
5942 \let\subsubsection = \numberedsubsubsec
5944 % Define @majorheading, @heading and @subheading
5947 {\advance\chapheadingskip by 10pt \chapbreak }%
5948 \parsearg\chapheadingzzz
5951 \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
5952 \def\chapheadingzzz#1{%
5953 \vbox{\chapfonts \raggedtitlesettings #1\par}%
5954 \nobreak\bigskip \nobreak
5955 \suppressfirstparagraphindent
5958 % @heading, @subheading, @subsubheading.
5959 \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
5960 \suppressfirstparagraphindent}
5961 \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
5962 \suppressfirstparagraphindent}
5963 \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
5964 \suppressfirstparagraphindent}
5966 % These macros generate a chapter, section, etc. heading only
5967 % (including whitespace, linebreaking, etc. around it),
5968 % given all the information in convenient, parsed form.
5970 % Args are the skip and penalty (usually negative)
5971 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
5973 % Parameter controlling skip before chapter headings (if needed)
5974 \newskip\chapheadingskip
5976 % Define plain chapter starts, and page on/off switching for it.
5977 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
5978 \def\chappager{\par\vfill\supereject}
5979 % Because \domark is called before \chapoddpage, the filler page will
5980 % get the headings for the next chapter, which is wrong. But we don't
5981 % care -- we just disable all headings on the filler page.
5993 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
5996 \global\let\contentsalignmacro = \chappager
5997 \global\let\pchapsepmacro=\chapbreak
5998 \global\let\pagealignmacro=\chappager}
6001 \global\let\contentsalignmacro = \chappager
6002 \global\let\pchapsepmacro=\chappager
6003 \global\let\pagealignmacro=\chappager
6004 \global\def\HEADINGSon{\HEADINGSsingle}}
6007 \global\let\contentsalignmacro = \chapoddpage
6008 \global\let\pchapsepmacro=\chapoddpage
6009 \global\let\pagealignmacro=\chapoddpage
6010 \global\def\HEADINGSon{\HEADINGSdouble}}
6016 % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
6017 % Yappendix, Yomitfromtoc), #3 the chapter number.
6019 % To test against our argument.
6020 \def\Ynothingkeyword{Ynothing}
6021 \def\Yomitfromtockeyword{Yomitfromtoc}
6022 \def\Yappendixkeyword{Yappendix}
6024 \def\chapmacro#1#2#3{%
6025 % Insert the first mark before the heading break (see notes for \domark).
6026 \let\prevchapterdefs=\lastchapterdefs
6027 \let\prevsectiondefs=\lastsectiondefs
6028 \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
6029 \gdef\thissection{}}%
6032 \ifx\temptype\Ynothingkeyword
6033 \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6034 \gdef\thischapter{\thischaptername}}%
6035 \else\ifx\temptype\Yomitfromtockeyword
6036 \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6037 \gdef\thischapter{}}%
6038 \else\ifx\temptype\Yappendixkeyword
6040 \xdef\lastchapterdefs{%
6041 \gdef\noexpand\thischaptername{\the\toks0}%
6042 \gdef\noexpand\thischapternum{\appendixletter}%
6043 % \noexpand\putwordAppendix avoids expanding indigestible
6044 % commands in some of the translations.
6045 \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
6046 \noexpand\thischapternum:
6047 \noexpand\thischaptername}%
6051 \xdef\lastchapterdefs{%
6052 \gdef\noexpand\thischaptername{\the\toks0}%
6053 \gdef\noexpand\thischapternum{\the\chapno}%
6054 % \noexpand\putwordChapter avoids expanding indigestible
6055 % commands in some of the translations.
6056 \gdef\noexpand\thischapter{\noexpand\thischapternum
6057 \noexpand\putwordChapter{}\
6058 \noexpand\thischaptername}%
6062 % Output the mark. Pass it through \safewhatsit, to take care of
6063 % the preceding space.
6066 % Insert the chapter heading break.
6069 % Now the second mark, after the heading break. No break points
6070 % between here and the heading.
6071 \let\prevchapterdefs=\lastchapterdefs
6072 \let\prevsectiondefs=\lastsectiondefs
6076 \chapfonts \rmisbold
6078 % Have to define \lastsection before calling \donoderef, because the
6079 % xref code eventually uses it. On the other hand, it has to be called
6080 % after \pchapsepmacro, or the headline will change too soon.
6081 \gdef\lastsection{#1}%
6083 % Only insert the separating space if we have a chapter/appendix
6084 % number, and don't print the unnumbered ``number''.
6085 \ifx\temptype\Ynothingkeyword
6087 \def\toctype{unnchap}%
6088 \else\ifx\temptype\Yomitfromtockeyword
6089 \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
6091 \else\ifx\temptype\Yappendixkeyword
6092 \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
6095 \setbox0 = \hbox{#3\enspace}%
6096 \def\toctype{numchap}%
6099 % Write the toc entry for this chapter. Must come before the
6100 % \donoderef, because we include the current node name in the toc
6101 % entry, and \donoderef resets it to empty.
6102 \writetocentry{\toctype}{#1}{#3}%
6104 % For pdftex, we have to write out the node definition (aka, make
6105 % the pdfdest) after any page break, but before the actual text has
6106 % been typeset. If the destination for the pdf outline is after the
6107 % text, then jumping from the outline may wind up with the text not
6108 % being visible, for instance under high magnification.
6111 % Typeset the actual heading.
6112 \nobreak % Avoid page breaks at the interline glue.
6113 \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
6116 \nobreak\bigskip % no page break after a chapter title
6120 % @centerchap -- centered and unnumbered.
6121 \let\centerparametersmaybe = \relax
6122 \def\centerparameters{%
6123 \advance\rightskip by 3\rightskip
6124 \leftskip = \rightskip
6129 % I don't think this chapter style is supported any more, so I'm not
6130 % updating it with the new noderef stuff. We'll see. --karl, 11aug03.
6132 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
6134 \def\unnchfopen #1{%
6136 \vbox{\chapfonts \raggedtitlesettings #1\par}%
6137 \nobreak\bigskip\nobreak
6139 \def\chfopen #1#2{\chapoddpage {\chapfonts
6140 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
6143 \def\centerchfopen #1{%
6145 \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
6146 \nobreak\bigskip \nobreak
6149 \global\let\chapmacro=\chfopen
6150 \global\let\centerchapmacro=\centerchfopen}
6153 % Section titles. These macros combine the section number parts and
6154 % call the generic \sectionheading to do the printing.
6156 \newskip\secheadingskip
6157 \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
6159 % Subsection titles.
6160 \newskip\subsecheadingskip
6161 \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
6163 % Subsubsection titles.
6164 \def\subsubsecheadingskip{\subsecheadingskip}
6165 \def\subsubsecheadingbreak{\subsecheadingbreak}
6168 % Print any size, any type, section title.
6170 % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
6171 % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
6174 \def\seckeyword{sec}
6176 \def\sectionheading#1#2#3#4{%
6178 \checkenv{}% should not be in an environment.
6180 % Switch to the right set of fonts.
6181 \csname #2fonts\endcsname \rmisbold
6183 \def\sectionlevel{#2}%
6186 % Insert first mark before the heading break (see notes for \domark).
6187 \let\prevsectiondefs=\lastsectiondefs
6188 \ifx\temptype\Ynothingkeyword
6189 \ifx\sectionlevel\seckeyword
6190 \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
6191 \gdef\thissection{\thissectionname}}%
6193 \else\ifx\temptype\Yomitfromtockeyword
6194 % Don't redefine \thissection.
6195 \else\ifx\temptype\Yappendixkeyword
6196 \ifx\sectionlevel\seckeyword
6198 \xdef\lastsectiondefs{%
6199 \gdef\noexpand\thissectionname{\the\toks0}%
6200 \gdef\noexpand\thissectionnum{#4}%
6201 % \noexpand\putwordSection avoids expanding indigestible
6202 % commands in some of the translations.
6203 \gdef\noexpand\thissection{\noexpand\putwordSection{}
6204 \noexpand\thissectionnum:
6205 \noexpand\thissectionname}%
6209 \ifx\sectionlevel\seckeyword
6211 \xdef\lastsectiondefs{%
6212 \gdef\noexpand\thissectionname{\the\toks0}%
6213 \gdef\noexpand\thissectionnum{#4}%
6214 % \noexpand\putwordSection avoids expanding indigestible
6215 % commands in some of the translations.
6216 \gdef\noexpand\thissection{\noexpand\putwordSection{}
6217 \noexpand\thissectionnum:
6218 \noexpand\thissectionname}%
6223 % Go into vertical mode. Usually we'll already be there, but we
6224 % don't want the following whatsit to end up in a preceding paragraph
6225 % if the document didn't happen to have a blank line.
6228 % Output the mark. Pass it through \safewhatsit, to take care of
6229 % the preceding space.
6232 % Insert space above the heading.
6233 \csname #2headingbreak\endcsname
6235 % Now the second mark, after the heading break. No break points
6236 % between here and the heading.
6237 \let\prevsectiondefs=\lastsectiondefs
6240 % Only insert the space after the number if we have a section number.
6241 \ifx\temptype\Ynothingkeyword
6244 \gdef\lastsection{#1}%
6245 \else\ifx\temptype\Yomitfromtockeyword
6246 % for @headings -- no section number, don't include in toc,
6247 % and don't redefine \lastsection.
6250 \let\sectionlevel=\empty
6251 \else\ifx\temptype\Yappendixkeyword
6252 \setbox0 = \hbox{#4\enspace}%
6254 \gdef\lastsection{#1}%
6256 \setbox0 = \hbox{#4\enspace}%
6258 \gdef\lastsection{#1}%
6261 % Write the toc entry (before \donoderef). See comments in \chapmacro.
6262 \writetocentry{\toctype\sectionlevel}{#1}{#4}%
6264 % Write the node reference (= pdf destination for pdftex).
6265 % Again, see comments in \chapmacro.
6268 % Interline glue will be inserted when the vbox is completed.
6269 % That glue will be a valid breakpoint for the page, since it'll be
6270 % preceded by a whatsit (usually from the \donoderef, or from the
6271 % \writetocentry if there was no node). We don't want to allow that
6272 % break, since then the whatsits could end up on page n while the
6273 % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
6276 % Output the actual section heading.
6277 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
6278 \hangindent=\wd0 % zero if no section number
6281 % Add extra space after the heading -- half of whatever came above it.
6282 % Don't allow stretch, though.
6283 \kern .5 \csname #2headingskip\endcsname
6285 % Do not let the kern be a potential breakpoint, as it would be if it
6286 % was followed by glue.
6289 % We'll almost certainly start a paragraph next, so don't let that
6290 % glue accumulate. (Not a breakpoint because it's preceded by a
6291 % discardable item.) However, when a paragraph is not started next
6292 % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
6293 % or the negative glue will cause weirdly wrong output, typically
6294 % obscuring the section heading with something else.
6297 % This is so the last item on the main vertical list is a known
6298 % \penalty > 10000, so \startdefun, etc., can recognize the situation
6299 % and do the needful.
6305 % Table of contents.
6308 % Write an entry to the toc file, opening it if necessary.
6309 % Called from @chapter, etc.
6311 % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
6312 % We append the current node name (if any) and page number as additional
6313 % arguments for the \{chap,sec,...}entry macros which will eventually
6314 % read this. The node name is used in the pdf outlines as the
6315 % destination to jump to.
6317 % We open the .toc file for writing here instead of at @setfilename (or
6318 % any other fixed time) so that @contents can be anywhere in the document.
6319 % But if #1 is `omit', then we don't do anything. This is used for the
6320 % table of contents chapter openings themselves.
6322 \newif\iftocfileopened
6323 \def\omitkeyword{omit}%
6325 \def\writetocentry#1#2#3{%
6326 \edef\writetoctype{#1}%
6327 \ifx\writetoctype\omitkeyword \else
6328 \iftocfileopened\else
6329 \immediate\openout\tocfile = \jobname.toc
6330 \global\tocfileopenedtrue
6336 \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
6342 % Tell \shipout to create a pdf destination on each page, if we're
6343 % writing pdf. These are used in the table of contents. We can't
6344 % just write one on every page because the title pages are numbered
6345 % 1 and 2 (the page numbers aren't printed), and so are the first
6346 % two pages of the document. Thus, we'd have two destinations named
6347 % `1', and two named `2'.
6348 \ifpdf \global\pdfmakepagedesttrue \fi
6352 % These characters do not print properly in the Computer Modern roman
6353 % fonts, so we must take special care. This is more or less redundant
6354 % with the Texinfo input format setup at the end of this file.
6356 \def\activecatcodes{%
6369 % Read the toc file, which is essentially Texinfo input.
6373 \input \tocreadfilename
6376 \newskip\contentsrightmargin \contentsrightmargin=1in
6377 \newcount\savepageno
6378 \newcount\lastnegativepageno \lastnegativepageno = -1
6380 % Prepare to read what we've written to \tocfile.
6382 \def\startcontents#1{%
6383 % If @setchapternewpage on, and @headings double, the contents should
6384 % start on an odd page, unlike chapters. Thus, we maintain
6385 % \contentsalignmacro in parallel with \pagealignmacro.
6386 % From: Torbjorn Granlund <tege@matematik.su.se>
6388 \immediate\closeout\tocfile
6390 % Don't need to put `Contents' or `Short Contents' in the headline.
6391 % It is abundantly clear what they are.
6392 \chapmacro{#1}{Yomitfromtoc}{}%
6394 \savepageno = \pageno
6395 \begingroup % Set up to handle contents files properly.
6396 \raggedbottom % Worry more about breakpoints than the bottom.
6397 \advance\hsize by -\contentsrightmargin % Don't use the full line length.
6399 % Roman numerals for page numbers.
6400 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
6403 % redefined for the two-volume lispref. We always output on
6404 % \jobname.toc even if this is redefined.
6406 \def\tocreadfilename{\jobname.toc}
6408 % Normal (long) toc.
6411 \startcontents{\putwordTOC}%
6412 \openin 1 \tocreadfilename\space
6417 \contentsalignmacro % in case @setchapternewpage odd is in effect
6423 \lastnegativepageno = \pageno
6424 \global\pageno = \savepageno
6427 % And just the chapters.
6428 \def\summarycontents{%
6429 \startcontents{\putwordShortTOC}%
6431 \let\partentry = \shortpartentry
6432 \let\numchapentry = \shortchapentry
6433 \let\appentry = \shortchapentry
6434 \let\unnchapentry = \shortunnchapentry
6435 % We want a true roman here for the page numbers.
6437 \let\rm=\shortcontrm \let\bf=\shortcontbf
6438 \let\sl=\shortcontsl \let\tt=\shortconttt
6440 \hyphenpenalty = 10000
6441 \advance\baselineskip by 1pt % Open it up a little.
6442 \def\numsecentry##1##2##3##4{}
6443 \let\appsecentry = \numsecentry
6444 \let\unnsecentry = \numsecentry
6445 \let\numsubsecentry = \numsecentry
6446 \let\appsubsecentry = \numsecentry
6447 \let\unnsubsecentry = \numsecentry
6448 \let\numsubsubsecentry = \numsecentry
6449 \let\appsubsubsecentry = \numsecentry
6450 \let\unnsubsubsecentry = \numsecentry
6451 \openin 1 \tocreadfilename\space
6457 \contentsalignmacro % in case @setchapternewpage odd is in effect
6459 \lastnegativepageno = \pageno
6460 \global\pageno = \savepageno
6462 \let\shortcontents = \summarycontents
6464 % Typeset the label for a chapter or appendix for the short contents.
6465 % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
6467 \def\shortchaplabel#1{%
6468 % This space should be enough, since a single number is .5em, and the
6469 % widest letter (M) is 1em, at least in the Computer Modern fonts.
6470 % But use \hss just in case.
6471 % (This space doesn't include the extra space that gets added after
6472 % the label; that gets put in by \shortchapentry above.)
6474 % We'd like to right-justify chapter numbers, but that looks strange
6475 % with appendix letters. And right-justifying numbers and
6476 % left-justifying letters looks strange when there is less than 10
6477 % chapters. Have to read the whole toc once to know how many chapters
6478 % there are before deciding ...
6479 \hbox to 1em{#1\hss}%
6482 % These macros generate individual entries in the table of contents.
6483 % The first argument is the chapter or section name.
6484 % The last argument is the page number.
6485 % The arguments in between are the chapter number, section number, ...
6487 % Parts, in the main contents. Replace the part number, which doesn't
6488 % exist, with an empty box. Let's hope all the numbers have the same width.
6489 % Also ignore the page number, which is conventionally not printed.
6490 \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
6491 \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
6493 % Parts, in the short toc.
6494 \def\shortpartentry#1#2#3#4{%
6496 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
6497 \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
6500 % Chapters, in the main contents.
6501 \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
6503 % Chapters, in the short toc.
6504 % See comments in \dochapentry re vbox and related settings.
6505 \def\shortchapentry#1#2#3#4{%
6506 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
6509 % Appendices, in the main contents.
6510 % Need the word Appendix, and a fixed-size box.
6512 \def\appendixbox#1{%
6513 % We use M since it's probably the widest letter.
6514 \setbox0 = \hbox{\putwordAppendix{} M}%
6515 \hbox to \wd0{\putwordAppendix{} #1\hss}}
6517 \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
6519 % Unnumbered chapters.
6520 \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
6521 \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
6524 \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
6525 \let\appsecentry=\numsecentry
6526 \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
6529 \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
6530 \let\appsubsecentry=\numsubsecentry
6531 \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
6533 % And subsubsections.
6534 \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
6535 \let\appsubsubsecentry=\numsubsubsecentry
6536 \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
6538 % This parameter controls the indentation of the various levels.
6539 % Same as \defaultparindent.
6540 \newdimen\tocindent \tocindent = 15pt
6542 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
6545 % If the toc has to be broken over pages, we want it to be at chapters
6546 % if at all possible; hence the \penalty.
6547 \def\dochapentry#1#2{%
6548 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
6551 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6553 \nobreak\vskip .25\baselineskip plus.1\baselineskip
6556 \def\dosecentry#1#2{\begingroup
6557 \secentryfonts \leftskip=\tocindent
6558 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6561 \def\dosubsecentry#1#2{\begingroup
6562 \subsecentryfonts \leftskip=2\tocindent
6563 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6566 \def\dosubsubsecentry#1#2{\begingroup
6567 \subsubsecentryfonts \leftskip=3\tocindent
6568 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6571 % We use the same \entry macro as for the index entries.
6572 \let\tocentry = \entry
6574 % Space between chapter (or whatever) number and the title.
6575 \def\labelspace{\hskip1em \relax}
6577 \def\dopageno#1{{\rm #1}}
6578 \def\doshortpageno#1{{\rm #1}}
6580 \def\chapentryfonts{\secfonts \rm}
6581 \def\secentryfonts{\textfonts}
6582 \def\subsecentryfonts{\textfonts}
6583 \def\subsubsecentryfonts{\textfonts}
6586 \message{environments,}
6587 % @foo ... @end foo.
6589 % @tex ... @end tex escapes into raw TeX temporarily.
6590 % One exception: @ is still an escape character, so that @end tex works.
6591 % But \@ or @@ will get a plain @ character.
6594 \setupmarkupstyle{tex}%
6595 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
6596 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
6597 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
6608 % ' is active in math mode (mathcode"8000). So reset it, and all our
6609 % other math active characters (just in case), to plain's definitions.
6613 \let\bullet=\ptexbullet
6618 \let\equiv=\ptexequiv
6621 \let\indent=\ptexindent
6622 \let\noindent=\ptexnoindent
6629 \expandafter \let\csname top\endcsname=\ptextop % outer
6630 \let\frenchspacing=\plainfrenchspacing
6632 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
6633 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
6636 % There is no need to define \Etex.
6638 % Define @lisp ... @end lisp.
6639 % @lisp environment forms a group so it can rebind things,
6640 % including the definition of @end lisp (which normally is erroneous).
6642 % Amount to narrow the margins by for @lisp.
6643 \newskip\lispnarrowing \lispnarrowing=0.4in
6645 % This is the definition that ^^M gets inside @lisp, @example, and other
6646 % such environments. \null is better than a space, since it doesn't
6648 \def\lisppar{\null\endgraf}
6650 % This space is always present above and below environments.
6651 \newskip\envskipamount \envskipamount = 0pt
6653 % Make spacing and below environment symmetrical. We use \parskip here
6654 % to help in doing that, since in @example-like environments \parskip
6655 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
6656 % start of the next paragraph will insert \parskip.
6658 \def\aboveenvbreak{{%
6659 % =10000 instead of <10000 because of a special case in \itemzzz and
6660 % \sectionheading, q.v.
6661 \ifnum \lastpenalty=10000 \else
6662 \advance\envskipamount by \parskip
6664 \ifdim\lastskip<\envskipamount
6666 % it's not a good place to break if the last penalty was \nobreak
6668 \ifnum\lastpenalty<10000 \penalty-50 \fi
6669 \vskip\envskipamount
6674 \let\afterenvbreak = \aboveenvbreak
6676 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
6677 % also clear it, so that its embedded environments do the narrowing again.
6678 \let\nonarrowing=\relax
6680 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
6681 % environment contents.
6682 \font\circle=lcircle10
6684 \newdimen\cartouter\newdimen\cartinner
6685 \newskip\normbskip\newskip\normpskip\newskip\normlskip
6686 \circthick=\fontdimen8\circle
6688 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
6689 \def\ctr{{\hskip 6pt\circle\char'010}}
6690 \def\cbl{{\circle\char'012\hskip -6pt}}
6691 \def\cbr{{\hskip 6pt\circle\char'011}}
6692 \def\carttop{\hbox to \cartouter{\hskip\lskip
6693 \ctl\leaders\hrule height\circthick\hfil\ctr
6695 \def\cartbot{\hbox to \cartouter{\hskip\lskip
6696 \cbl\leaders\hrule height\circthick\hfil\cbr
6699 \newskip\lskip\newskip\rskip
6702 \ifhmode\par\fi % can't be in the midst of a paragraph.
6704 \lskip=\leftskip \rskip=\rightskip
6705 \leftskip=0pt\rightskip=0pt % we want these *outside*.
6706 \cartinner=\hsize \advance\cartinner by-\lskip
6707 \advance\cartinner by-\rskip
6709 \advance\cartouter by 18.4pt % allow for 3pt kerns on either
6710 % side, and for 6pt waste from
6711 % each corner char, and rule thickness
6712 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
6713 % Flag to tell @lisp, etc., not to narrow margin.
6714 \let\nonarrowing = t%
6716 % If this cartouche directly follows a sectioning command, we need the
6717 % \parskip glue (backspaced over by default) or the cartouche can
6718 % collide with the section heading.
6719 \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
6722 \baselineskip=0pt\parskip=0pt\lineskip=0pt
6730 \baselineskip=\normbskip
6731 \lineskip=\normlskip
6734 \comment % For explanation, see the end of def\group.
6749 % This macro is called at the beginning of all the @example variants,
6751 \newdimen\nonfillparindent
6754 \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
6755 \sepspaces % Make spaces be word-separators rather than space tokens.
6756 \let\par = \lisppar % don't ignore blank lines
6757 \obeylines % each line of input is a line of output
6759 % Turn off paragraph indentation but redefine \indent to emulate
6760 % the normal \indent.
6761 \nonfillparindent=\parindent
6763 \let\indent\nonfillindent
6765 \emergencystretch = 0pt % don't try to avoid overfull boxes
6766 \ifx\nonarrowing\relax
6767 \advance \leftskip by \lispnarrowing
6768 \exdentamount=\lispnarrowing
6770 \let\nonarrowing = \relax
6772 \let\exdent=\nofillexdent
6777 % We want to swallow spaces (but not other tokens) after the fake
6778 % @indent in our nonfill-environments, where spaces are normally
6779 % active and set to @tie, resulting in them not being ignored after
6781 \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
6782 \gdef\nonfillindentcheck{%
6784 \expandafter\nonfillindentgobble%
6786 \leavevmode\nonfillindentbox%
6790 \def\nonfillindentgobble#1{\nonfillindent}
6791 \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
6793 % If you want all examples etc. small: @set dispenvsize small.
6794 % If you want even small examples the full size: @set dispenvsize nosmall.
6795 % This affects the following displayed environments:
6796 % @example, @display, @format, @lisp
6798 \def\smallword{small}
6799 \def\nosmallword{nosmall}
6800 \let\SETdispenvsize\relax
6801 \def\setnormaldispenv{%
6802 \ifx\SETdispenvsize\smallword
6803 % end paragraph for sake of leading, in case document has no blank
6804 % line. This is redundant with what happens in \aboveenvbreak, but
6805 % we need to do it before changing the fonts, and it's inconvenient
6806 % to change the fonts afterward.
6807 \ifnum \lastpenalty=10000 \else \endgraf \fi
6808 \smallexamplefonts \rm
6811 \def\setsmalldispenv{%
6812 \ifx\SETdispenvsize\nosmallword
6814 \ifnum \lastpenalty=10000 \else \endgraf \fi
6815 \smallexamplefonts \rm
6819 % We often define two environments, @foo and @smallfoo.
6820 % Let's do it in one command. #1 is the env name, #2 the definition.
6821 \def\makedispenvdef#1#2{%
6822 \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
6823 \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
6824 \expandafter\let\csname E#1\endcsname \afterenvbreak
6825 \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
6828 % Define two environment synonyms (#1 and #2) for an environment.
6829 \def\maketwodispenvdef#1#2#3{%
6830 \makedispenvdef{#1}{#3}%
6831 \makedispenvdef{#2}{#3}%
6834 % @lisp: indented, narrowed, typewriter font;
6835 % @example: same as @lisp.
6837 % @smallexample and @smalllisp: use smaller fonts.
6838 % Originally contributed by Pavel@xerox.
6840 \maketwodispenvdef{lisp}{example}{%
6842 \tt\setupmarkupstyle{example}%
6843 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
6844 \gobble % eat return
6846 % @display/@smalldisplay: same as @lisp except keep current font.
6848 \makedispenvdef{display}{%
6853 % @format/@smallformat: same as @display except don't narrow margins.
6855 \makedispenvdef{format}{%
6856 \let\nonarrowing = t%
6861 % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
6863 \let\nonarrowing = t%
6867 \let\Eflushleft = \afterenvbreak
6871 \envdef\flushright{%
6872 \let\nonarrowing = t%
6874 \advance\leftskip by 0pt plus 1fill\relax
6877 \let\Eflushright = \afterenvbreak
6880 % @raggedright does more-or-less normal line breaking but no right
6881 % justification. From plain.tex.
6882 \envdef\raggedright{%
6883 \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
6885 \let\Eraggedright\par
6887 \envdef\raggedleft{%
6888 \parindent=0pt \leftskip0pt plus2em
6889 \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
6890 \hbadness=10000 % Last line will usually be underfull, so turn off
6891 % badness reporting.
6893 \let\Eraggedleft\par
6895 \envdef\raggedcenter{%
6896 \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
6897 \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
6898 \hbadness=10000 % Last line will usually be underfull, so turn off
6899 % badness reporting.
6901 \let\Eraggedcenter\par
6904 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
6905 % and narrows the margins. We keep \parskip nonzero in general, since
6906 % we're doing normal filling. So, when using \aboveenvbreak and
6907 % \afterenvbreak, temporarily make \parskip 0.
6909 \makedispenvdef{quotation}{\quotationstart}
6911 \def\quotationstart{%
6912 \indentedblockstart % same as \indentedblock, but increase right margin too.
6913 \ifx\nonarrowing\relax
6914 \advance\rightskip by \lispnarrowing
6916 \parsearg\quotationlabel
6919 % We have retained a nonzero parskip for the environment, since we're
6920 % doing normal filling.
6924 \ifx\quotationauthor\thisisundefined\else
6926 \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
6928 {\parskip=0pt \afterenvbreak}%
6930 \def\Esmallquotation{\Equotation}
6932 % If we're given an argument, typeset it in bold with a colon after.
6933 \def\quotationlabel#1{%
6935 \ifx\temp\empty \else
6940 % @indentedblock is like @quotation, but indents only on the left and
6941 % has no optional argument.
6943 \makedispenvdef{indentedblock}{\indentedblockstart}
6945 \def\indentedblockstart{%
6946 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
6949 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
6950 \ifx\nonarrowing\relax
6951 \advance\leftskip by \lispnarrowing
6952 \exdentamount = \lispnarrowing
6954 \let\nonarrowing = \relax
6958 % Keep a nonzero parskip for the environment, since we're doing normal filling.
6960 \def\Eindentedblock{%
6962 {\parskip=0pt \afterenvbreak}%
6964 \def\Esmallindentedblock{\Eindentedblock}
6967 % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
6968 % If we want to allow any <char> as delimiter,
6969 % we need the curly braces so that makeinfo sees the @verb command, eg:
6970 % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
6972 % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
6974 % [Knuth] p.344; only we need to do the other characters Texinfo sets
6975 % active too. Otherwise, they get lost as the first character on a
6978 \do\ \do\\\do\{\do\}\do\$\do\&%
6979 \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
6980 \do\<\do\>\do\|\do\@\do+\do\"%
6981 % Don't do the quotes -- if we do, @set txicodequoteundirected and
6982 % @set txicodequotebacktick will not have effect on @verb and
6983 % @verbatim, and ?` and !` ligatures won't get disabled.
6988 \def\uncatcodespecials{%
6989 \def\do##1{\catcode`##1=\other}\dospecials}
6991 % Setup for the @verb command.
6993 % Eight spaces for a tab
6995 \catcode`\^^I=\active
6996 \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
7000 \tt % easiest (and conventionally used) font for verbatim
7001 \def\par{\leavevmode\endgraf}%
7002 \setupmarkupstyle{verb}%
7004 % Respect line breaks,
7005 % print special symbols as themselves, and
7006 % make each space count
7007 % must do in this order:
7008 \obeylines \uncatcodespecials \sepspaces
7011 % Setup for the @verbatim environment
7013 % Real tab expansion.
7014 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
7016 % We typeset each line of the verbatim in an \hbox, so we can handle
7017 % tabs. The \global is in case the verbatim line starts with an accent,
7018 % or some other command that starts with a begin-group. Otherwise, the
7019 % entire \verbbox would disappear at the corresponding end-group, before
7020 % it is typeset. Meanwhile, we can't have nested verbatim commands
7021 % (can we?), so the \global won't be overwriting itself.
7023 \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
7026 \catcode`\^^I=\active
7028 \catcode`\^^I=\active
7029 \def^^I{\leavevmode\egroup
7030 \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
7031 \divide\dimen\verbbox by\tabw
7032 \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
7033 \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
7034 \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
7039 % start the verbatim environment.
7040 \def\setupverbatim{%
7041 \let\nonarrowing = t%
7043 \tt % easiest (and conventionally used) font for verbatim
7044 % The \leavevmode here is for blank lines. Otherwise, we would
7045 % never \starttabox and the \egroup would end verbatim mode.
7046 \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
7048 \setupmarkupstyle{verbatim}%
7049 % Respect line breaks,
7050 % print special symbols as themselves, and
7051 % make each space count.
7052 % Must do in this order:
7053 \obeylines \uncatcodespecials \sepspaces
7054 \everypar{\starttabbox}%
7057 % Do the @verb magic: verbatim text is quoted by unique
7058 % delimiter characters. Before first delimiter expect a
7059 % right brace, after last delimiter expect closing brace:
7061 % \def\doverb'{'<char>#1<char>'}'{#1}
7063 % [Knuth] p. 382; only eat outer {}
7065 \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
7066 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
7069 \def\verb{\begingroup\setupverb\doverb}
7072 % Do the @verbatim magic: define the macro \doverbatim so that
7073 % the (first) argument ends when '@end verbatim' is reached, ie:
7075 % \def\doverbatim#1@end verbatim{#1}
7077 % For Texinfo it's a lot easier than for LaTeX,
7078 % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
7079 % we need not redefine '\', '{' and '}'.
7081 % Inspired by LaTeX's verbatim command set [latex.ltx]
7086 % ignore everything up to the first ^^M, that's the newline at the end
7087 % of the @verbatim input line itself. Otherwise we get an extra blank
7088 % line in the output.
7089 \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
7090 % We really want {...\end verbatim} in the body of the macro, but
7091 % without the active space; thus we have to use \xdef and \gobble.
7095 \setupverbatim\doverbatim
7097 \let\Everbatim = \afterenvbreak
7100 % @verbatiminclude FILE - insert text of file in verbatim environment.
7102 \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
7104 \def\doverbatiminclude#1{%
7106 \makevalueexpandable
7108 \indexnofonts % Allow `@@' and other weird things in file names.
7109 \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
7115 % @copying ... @end copying.
7116 % Save the text away for @insertcopying later.
7118 % We save the uninterpreted tokens, rather than creating a box.
7119 % Saving the text in a box would be much easier, but then all the
7120 % typesetting commands (@smallbook, font changes, etc.) have to be done
7121 % beforehand -- and a) we want @copying to be done first in the source
7122 % file; b) letting users define the frontmatter in as flexible order as
7123 % possible is very desirable.
7125 \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
7126 \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
7128 \def\insertcopying{%
7130 \parindent = 0pt % paragraph indentation looks wrong on title page
7131 \scanexp\copyingtext
7139 \newskip\defbodyindent \defbodyindent=.4in
7140 \newskip\defargsindent \defargsindent=50pt
7141 \newskip\deflastargmargin \deflastargmargin=18pt
7142 \newcount\defunpenalty
7144 % Start the processing of @deffn:
7146 \ifnum\lastpenalty<10000
7148 \defunpenalty=10003 % Will keep this @deffn together with the
7149 % following @def command, see below.
7151 % If there are two @def commands in a row, we'll have a \nobreak,
7152 % which is there to keep the function description together with its
7153 % header. But if there's nothing but headers, we need to allow a
7154 % break somewhere. Check specifically for penalty 10002, inserted
7155 % by \printdefunline, instead of 10000, since the sectioning
7156 % commands also insert a nobreak penalty, and we don't want to allow
7157 % a break between a section heading and a defun.
7159 % As a further refinement, we avoid "club" headers by signalling
7160 % with penalty of 10003 after the very first @deffn in the
7161 % sequence (see above), and penalty of 10002 after any following
7163 \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
7165 % Similarly, after a section heading, do not allow a break.
7166 % But do insert the glue.
7167 \medskip % preceded by discardable penalty, so not a breakpoint
7171 \advance\leftskip by \defbodyindent
7172 \exdentamount=\defbodyindent
7176 % First, check whether we are in the right environment:
7179 % As above, allow line break if we have multiple x headers in a row.
7180 % It's not a great place, though.
7181 \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
7183 % And now, it's time to reuse the body of the original defun:
7184 \expandafter\gobbledefun#1%
7186 \def\gobbledefun#1\startdefun{}
7188 % \printdefunline \deffnheader{text}
7190 \def\printdefunline#1#2{%
7192 % call \deffnheader:
7195 \interlinepenalty = 10000
7196 \advance\rightskip by 0pt plus 1fil\relax
7198 \nobreak\vskip -\parskip
7199 \penalty\defunpenalty % signal to \startdefun and \dodefunx
7200 % Some of the @defun-type tags do not enable magic parentheses,
7201 % rendering the following check redundant. But we don't optimize.
7206 \def\Edefun{\endgraf\medbreak}
7208 % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
7209 % the only thing remaining is to define \deffnheader.
7212 \expandafter\let\csname E#1\endcsname = \Edefun
7213 \edef\temp{\noexpand\domakedefun
7214 \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
7218 % \domakedefun \deffn \deffnx \deffnheader
7220 % Define \deffn and \deffnx, without parameters.
7221 % \deffnheader has to be defined explicitly.
7223 \def\domakedefun#1#2#3{%
7226 \doingtypefnfalse % distinguish typed functions from all else
7227 \parseargusing\activeparens{\printdefunline#3}%
7229 \def#2{\dodefunx#1}%
7233 \newif\ifdoingtypefn % doing typed function?
7234 \newif\ifrettypeownline % typeset return type on its own line?
7236 % @deftypefnnewline on|off says whether the return type of typed functions
7237 % are printed on their own line. This affects @deftypefn, @deftypefun,
7238 % @deftypeop, and @deftypemethod.
7240 \parseargdef\deftypefnnewline{%
7243 \expandafter\let\csname SETtxideftypefnnl\endcsname
7245 \else\ifx\temp\offword
7246 \expandafter\let\csname SETtxideftypefnnl\endcsname
7249 \errhelp = \EMsimple
7250 \errmessage{Unknown @txideftypefnnl value `\temp',
7255 % Untyped functions:
7257 % @deffn category name args
7258 \makedefun{deffn}{\deffngeneral{}}
7260 % @deffn category class name args
7261 \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
7263 % \defopon {category on}class name args
7264 \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
7266 % \deffngeneral {subind}category name args
7268 \def\deffngeneral#1#2 #3 #4\endheader{%
7269 % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
7270 \dosubind{fn}{\code{#3}}{#1}%
7271 \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
7276 % @deftypefn category type name args
7277 \makedefun{deftypefn}{\deftypefngeneral{}}
7279 % @deftypeop category class type name args
7280 \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
7282 % \deftypeopon {category on}class type name args
7283 \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
7285 % \deftypefngeneral {subind}category type name args
7287 \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
7288 \dosubind{fn}{\code{#4}}{#1}%
7290 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
7295 % @deftypevr category type var args
7296 \makedefun{deftypevr}{\deftypecvgeneral{}}
7298 % @deftypecv category class type var args
7299 \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
7301 % \deftypecvof {category of}class type var args
7302 \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
7304 % \deftypecvgeneral {subind}category type var args
7306 \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
7307 \dosubind{vr}{\code{#4}}{#1}%
7308 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
7311 % Untyped variables:
7313 % @defvr category var args
7314 \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
7316 % @defcv category class var args
7317 \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
7319 % \defcvof {category of}class var args
7320 \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
7324 % @deftp category name args
7325 \makedefun{deftp}#1 #2 #3\endheader{%
7326 \doind{tp}{\code{#2}}%
7327 \defname{#1}{}{#2}\defunargs{#3\unskip}%
7330 % Remaining @defun-like shortcuts:
7331 \makedefun{defun}{\deffnheader{\putwordDeffunc} }
7332 \makedefun{defmac}{\deffnheader{\putwordDefmac} }
7333 \makedefun{defspec}{\deffnheader{\putwordDefspec} }
7334 \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
7335 \makedefun{defvar}{\defvrheader{\putwordDefvar} }
7336 \makedefun{defopt}{\defvrheader{\putwordDefopt} }
7337 \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
7338 \makedefun{defmethod}{\defopon\putwordMethodon}
7339 \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
7340 \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
7341 \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
7343 % \defname, which formats the name of the @def (not the args).
7344 % #1 is the category, such as "Function".
7345 % #2 is the return type, if any.
7346 % #3 is the function name.
7348 % We are followed by (but not passed) the arguments, if any.
7350 \def\defname#1#2#3{%
7352 % Get the values of \leftskip and \rightskip as they were outside the @def...
7353 \advance\leftskip by -\defbodyindent
7355 % Determine if we are typesetting the return type of a typed function
7356 % on a line by itself.
7357 \rettypeownlinefalse
7358 \ifdoingtypefn % doing a typed function specifically?
7359 % then check user option for putting return type on its own line:
7360 \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
7365 % How we'll format the category name. Putting it in brackets helps
7366 % distinguish it from the body text that may end up on the next line
7369 \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
7371 % Figure out line sizes for the paragraph shape. We'll always have at
7375 % The first line needs space for \box0; but if \rightskip is nonzero,
7376 % we need only space for the part of \box0 which exceeds it:
7377 \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
7379 % If doing a return type on its own line, we'll have another line.
7381 \advance\tempnum by 1
7382 \def\maybeshapeline{0in \hsize}%
7384 \def\maybeshapeline{}%
7387 % The continuations:
7388 \dimen2=\hsize \advance\dimen2 by -\defargsindent
7390 % The final paragraph shape:
7391 \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
7393 % Put the category name at the right margin.
7396 \hfil\box0 \kern-\hsize
7397 % \hsize has to be shortened this way:
7399 % Intentionally do not respect \rightskip, since we need the space.
7402 % Allow all lines to be underfull without complaint:
7403 \tolerance=10000 \hbadness=10000
7404 \exdentamount=\defbodyindent
7406 % defun fonts. We use typewriter by default (used to be bold) because:
7407 % . we're printing identifiers, they should be in tt in principle.
7408 % . in languages with many accents, such as Czech or French, it's
7409 % common to leave accents off identifiers. The result looks ok in
7410 % tt, but exceedingly strange in rm.
7411 % . we don't want -- and --- to be treated as ligatures.
7412 % . this still does not fix the ?` and !` ligatures, but so far no
7413 % one has made identifiers using them :).
7415 \def\temp{#2}% text of the return type
7416 \ifx\temp\empty\else
7417 \tclose{\temp}% typeset the return type
7419 % put return type on its own line; prohibit line break following:
7420 \hfil\vadjust{\nobreak}\break
7422 \space % type on same line, so just followed by a space
7424 \fi % no return type
7425 #3% output function name
7427 {\rm\enskip}% hskip 0.5 em of \tenrm
7430 % arguments will be output next, if any.
7433 % Print arguments in slanted roman (not ttsl), inconsistently with using
7434 % tt for the name. This is because literal text is sometimes needed in
7435 % the argument list (groff manual), and ttsl and tt are not very
7436 % distinguishable. Prevent hyphenation at `-' chars.
7439 % use sl by default (not ttsl),
7441 \df \sl \hyphenchar\font=0
7443 % On the other hand, if an argument has two dashes (for instance), we
7444 % want a way to get ttsl. We used to recommend @var for that, so
7445 % leave the code in, but it's strange for @var to lead to typewriter.
7446 % Nowadays we recommend @code, since the difference between a ttsl hyphen
7447 % and a tt hyphen is pretty tiny. @code also disables ?` !`.
7448 \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
7450 \sl\hyphenchar\font=45
7453 % We want ()&[] to print specially on the defun line.
7456 \catcode`\(=\active \catcode`\)=\active
7457 \catcode`\[=\active \catcode`\]=\active
7461 % Make control sequences which act like normal parenthesis chars.
7462 \let\lparen = ( \let\rparen = )
7464 % Be sure that we always have a definition for `(', etc. For example,
7465 % if the fn name has parens in it, \boldbrax will not be in effect yet,
7466 % so TeX would otherwise complain about undefined control sequence.
7469 \global\let(=\lparen \global\let)=\rparen
7470 \global\let[=\lbrack \global\let]=\rbrack
7473 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
7474 \gdef\magicamp{\let&=\amprm}
7477 \newcount\parencount
7479 % If we encounter &foo, then turn on ()-hacking afterwards
7481 \def\amprm#1 {\ampseentrue{\bf\ }}
7485 % At the first level, print parens in roman,
7486 % otherwise use the default font.
7487 \ifnum \parencount=1 \rm \fi
7489 % The \sf parens (in \boldbrax) actually are a little bolder than
7490 % the contained text. This is especially needed for [ and ] .
7494 \def\infirstlevel#1{%
7501 \def\bfafterword#1 {#1 \bf}
7504 \global\advance\parencount by 1
7506 \infirstlevel \bfafterword
7511 \global\advance\parencount by -1
7514 \newcount\brackcount
7516 \global\advance\brackcount by 1
7521 \global\advance\brackcount by -1
7524 \def\checkparencounts{%
7525 \ifnum\parencount=0 \else \badparencount \fi
7526 \ifnum\brackcount=0 \else \badbrackcount \fi
7528 % these should not use \errmessage; the glibc manual, at least, actually
7529 % has such constructs (when documenting function pointers).
7530 \def\badparencount{%
7531 \message{Warning: unbalanced parentheses in @def...}%
7532 \global\parencount=0
7534 \def\badbrackcount{%
7535 \message{Warning: unbalanced square brackets in @def...}%
7536 \global\brackcount=0
7543 % To do this right we need a feature of e-TeX, \scantokens,
7544 % which we arrange to emulate with a temporary file in ordinary TeX.
7545 \ifx\eTeXversion\thisisundefined
7546 \newwrite\macscribble
7549 \immediate\openout\macscribble=\jobname.tmp
7550 \immediate\write\macscribble{\the\toks0}%
7551 \immediate\closeout\macscribble
7556 \def\scanmacro#1{\begingroup
7558 \let\xeatspaces\eatspaces
7560 % Undo catcode changes of \startcontents and \doprintindex
7561 % When called from @insertcopying or (short)caption, we need active
7562 % backslash to get it printed correctly. Previously, we had
7563 % \catcode`\\=\other instead. We'll see whether a problem appears
7564 % with macro expansion. --kasal, 19aug04
7565 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
7567 % ... and for \example:
7570 % The \empty here causes a following catcode 5 newline to be eaten as
7571 % part of reading whitespace after a control sequence. It does not
7572 % eat a catcode 13 newline. There's no good way to handle the two
7573 % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
7574 % would then have different behavior). See the Macro Details node in
7575 % the manual for the workaround we recommend for macros and
7576 % line-oriented commands.
7578 \scantokens{#1\empty}%
7582 \edef\temp{\noexpand\scanmacro{#1}}%
7586 \newcount\paramno % Count of parameters
7587 \newtoks\macname % Macro name
7588 \newif\ifrecursive % Is it recursive?
7590 % List of all defined macros in the form
7591 % \definedummyword\macro1\definedummyword\macro2...
7592 % Currently is also contains all @aliases; the list can be split
7593 % if there is a need.
7596 % Add the macro to \macrolist
7597 \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
7598 \def\addtomacrolistxxx#1{%
7599 \toks0 = \expandafter{\macrolist\definedummyword#1}%
7600 \xdef\macrolist{\the\toks0}%
7604 % This does \let #1 = #2, with \csnames; that is,
7605 % \let \csname#1\endcsname = \csname#2\endcsname
7606 % (except of course we have to play expansion games).
7610 \csname#1\expandafter\endcsname
7614 % Trim leading and trailing spaces off a string.
7615 % Concepts from aro-bend problem 15 (see CTAN).
7617 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
7618 \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
7619 \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
7621 \unbrace{\gdef\trim@@@ #1 } #2@{#1}
7624 % Trim a single trailing ^^M off a string.
7625 {\catcode`\^^M=\other \catcode`\Q=3%
7626 \gdef\eatcr #1{\eatcra #1Q^^MQ}%
7627 \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
7628 \gdef\eatcrb#1Q#2Q{#1}%
7631 % Macro bodies are absorbed as an argument in a context where
7632 % all characters are catcode 10, 11 or 12, except \ which is active
7633 % (as in normal texinfo). It is necessary to change the definition of \
7634 % to recognize macro arguments; this is the job of \mbodybackslash.
7636 % Non-ASCII encodings make 8-bit characters active, so un-activate
7637 % them to avoid their expansion. Must do this non-globally, to
7638 % confine the change to the current group.
7640 % It's necessary to have hard CRs when the macro is executed. This is
7641 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
7642 % body, and then making it the \newlinechar in \scanmacro.
7644 \def\scanctxt{% used as subroutine
7654 \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
7657 \def\scanargctxt{% used for copying and captions, not macros.
7660 \catcode`\^^M=\other
7663 \def\macrobodyctxt{% used for @macro definitions
7667 \catcode`\^^M=\other
7671 \def\macroargctxt{% used when scanning invocations
7675 % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
7676 % for the single characters \ { }. Thus, we end up with the "commands"
7677 % that would be written @\ @{ @} in a Texinfo document.
7679 % We already have @{ and @}. For @\, we define it here, and only for
7680 % this purpose, to produce a typewriter backslash (so, the @\ that we
7681 % define for @math can't be used with @macro calls):
7683 \def\\{\normalbackslash}%
7685 % We would like to do this for \, too, since that is what makeinfo does.
7686 % But it is not possible, because Texinfo already has a command @, for a
7687 % cedilla accent. Documents must use @comma{} instead.
7689 % \anythingelse will almost certainly be an error of some kind.
7692 % \mbodybackslash is the definition of \ in @macro bodies.
7693 % It maps \foo\ => \csname macarg.foo\endcsname => #N
7694 % where N is the macro parameter number.
7695 % We define \csname macarg.\endcsname to be \realbackslash, so
7696 % \\ in macro replacement text gets you a backslash.
7698 {\catcode`@=0 @catcode`@\=@active
7699 @gdef@usembodybackslash{@let\=@mbodybackslash}
7700 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
7702 \expandafter\def\csname macarg.\endcsname{\realbackslash}
7704 \def\margbackslash#1{\char`\#1 }
7706 \def\macro{\recursivefalse\parsearg\macroxxx}
7707 \def\rmacro{\recursivetrue\parsearg\macroxxx}
7710 \getargs{#1}% now \macname is the macname and \argl the arglist
7711 \ifx\argl\empty % no arguments
7714 \expandafter\parsemargdef \argl;%
7715 \if\paramno>256\relax
7716 \ifx\eTeXversion\thisisundefined
7717 \errhelp = \EMsimple
7718 \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
7722 \if1\csname ismacro.\the\macname\endcsname
7723 \message{Warning: redefining \the\macname}%
7725 \expandafter\ifx\csname \the\macname\endcsname \relax
7726 \else \errmessage{Macro name \the\macname\space already defined}\fi
7727 \global\cslet{macsave.\the\macname}{\the\macname}%
7728 \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
7729 \addtomacrolist{\the\macname}%
7731 \begingroup \macrobodyctxt
7732 \ifrecursive \expandafter\parsermacbody
7733 \else \expandafter\parsemacbody
7736 \parseargdef\unmacro{%
7737 \if1\csname ismacro.#1\endcsname
7738 \global\cslet{#1}{macsave.#1}%
7739 \global\expandafter\let \csname ismacro.#1\endcsname=0%
7740 % Remove the macro name from \macrolist:
7742 \expandafter\let\csname#1\endcsname \relax
7743 \let\definedummyword\unmacrodo
7744 \xdef\macrolist{\macrolist}%
7747 \errmessage{Macro #1 not defined}%
7751 % Called by \do from \dounmacro on each macro. The idea is to omit any
7752 % macro definitions that have been changed to \relax.
7758 \noexpand\definedummyword \noexpand#1%
7762 % This makes use of the obscure feature that if the last token of a
7763 % <parameter list> is #, then the preceding argument is delimited by
7764 % an opening brace, and that opening brace is not consumed.
7765 \def\getargs#1{\getargsxxx#1{}}
7766 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
7767 \def\getmacname#1 #2\relax{\macname={#1}}
7768 \def\getmacargs#1{\def\argl{#1}}
7770 % For macro processing make @ a letter so that we can make Texinfo private macro names.
7771 \edef\texiatcatcode{\the\catcode`\@}
7772 \catcode `@=11\relax
7774 % Parse the optional {params} list. Set up \paramno and \paramlist
7775 % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
7776 % in the params list to some hook where the argument si to be expanded. If
7777 % there are less than 10 arguments that hook is to be replaced by ##N where N
7778 % is the position in that list, that is to say the macro arguments are to be
7779 % defined `a la TeX in the macro body.
7781 % That gets used by \mbodybackslash (above).
7783 % We need to get `macro parameter char #' into several definitions.
7784 % The technique used is stolen from LaTeX: let \hash be something
7785 % unexpandable, insert that wherever you need a #, and then redefine
7786 % it to # just before using the token list produced.
7788 % The same technique is used to protect \eatspaces till just before
7789 % the macro is used.
7791 % If there are 10 or more arguments, a different technique is used, where the
7792 % hook remains in the body, and when macro is to be expanded the body is
7793 % processed again to replace the arguments.
7795 % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
7796 % argument N value and then \edef the body (nothing else will expand because of
7797 % the catcode regime underwhich the body was input).
7799 % If you compile with TeX (not eTeX), and you have macros with 10 or more
7800 % arguments, you need that no macro has more than 256 arguments, otherwise an
7801 % error is produced.
7802 \def\parsemargdef#1;{%
7803 \paramno=0\def\paramlist{}%
7805 \let\xeatspaces\relax
7806 \parsemargdefxxx#1,;,%
7807 % In case that there are 10 or more arguments we parse again the arguments
7808 % list to set new definitions for the \macarg.BLAH macros corresponding to
7809 % each BLAH argument. It was anyhow needed to parse already once this list
7810 % in order to count the arguments, and as macros with at most 9 arguments
7811 % are by far more frequent than macro with 10 or more arguments, defining
7812 % twice the \macarg.BLAH macros does not cost too much processing power.
7813 \ifnum\paramno<10\relax\else
7815 \parsemmanyargdef@@#1,;,% 10 or more arguments
7818 \def\parsemargdefxxx#1,{%
7819 \if#1;\let\next=\relax
7820 \else \let\next=\parsemargdefxxx
7821 \advance\paramno by 1
7822 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
7823 {\xeatspaces{\hash\the\paramno}}%
7824 \edef\paramlist{\paramlist\hash\the\paramno,}%
7827 \def\parsemmanyargdef@@#1,{%
7828 \if#1;\let\next=\relax
7830 \let\next=\parsemmanyargdef@@
7831 \edef\tempb{\eatspaces{#1}}%
7832 \expandafter\def\expandafter\tempa
7833 \expandafter{\csname macarg.\tempb\endcsname}%
7834 % Note that we need some extra \noexpand\noexpand, this is because we
7835 % don't want \the to be expanded in the \parsermacbody as it uses an
7837 \expandafter\edef\tempa
7838 {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
7839 \advance\paramno by 1\relax
7842 % These two commands read recursive and nonrecursive macro bodies.
7843 % (They're different since rec and nonrec macros end differently.)
7846 \catcode `\@\texiatcatcode
7847 \long\def\parsemacbody#1@end macro%
7848 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
7849 \long\def\parsermacbody#1@end rmacro%
7850 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
7851 \catcode `\@=11\relax
7856 \long\def\nillm@{\nil@}%
7858 % This macro is expanded during the Texinfo macro expansion, not during its
7859 % definition. It gets all the arguments values and assigns them to macros
7862 % #1 is the macro name
7863 % #2 is the list of argument names
7864 % #3 is the list of argument values
7865 \def\getargvals@#1#2#3{%
7866 \def\macargdeflist@{}%
7867 \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
7868 \def\paramlist{#2,\nil@}%
7872 \def\argvaluelist{#3,\nil@}%
7883 \ifx\paramlist\nilm@
7884 % Some sanity check needed here that \argvaluelist is also empty.
7885 \ifx\argvaluelist\nillm@
7887 \errhelp = \EMsimple
7888 \errmessage{Too many arguments in macro `\macroname'!}%
7890 \let\next\macargexpandinbody@
7892 \ifx\argvaluelist\nillm@
7893 % No more arguments values passed to macro. Set remaining named-arg
7895 \let\next\setemptyargvalues@
7897 % pop current arg name into \@tempb
7898 \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
7899 \expandafter\@tempa\expandafter{\paramlist}%
7900 % pop current argument value into \@tempc
7901 \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
7902 \expandafter\@tempa\expandafter{\argvaluelist}%
7903 % Here \@tempb is the current arg name and \@tempc is the current arg value.
7904 % First place the new argument macro definition into \@tempd
7905 \expandafter\macname\expandafter{\@tempc}%
7906 \expandafter\let\csname macarg.\@tempb\endcsname\relax
7907 \expandafter\def\expandafter\@tempe\expandafter{%
7908 \csname macarg.\@tempb\endcsname}%
7909 \edef\@tempd{\long\def\@tempe{\the\macname}}%
7910 \push@\@tempd\macargdeflist@
7911 \let\next\getargvals@@
7918 \expandafter\expandafter\expandafter\def
7919 \expandafter\expandafter\expandafter#2%
7920 \expandafter\expandafter\expandafter{%
7924 % Replace arguments by their values in the macro body, and place the result
7926 \def\macvalstoargs@{%
7927 % To do this we use the property that token registers that are \the'ed
7928 % within an \edef expand only once. So we are going to place all argument
7929 % values into respective token registers.
7931 % First we save the token context, and initialize argument numbering.
7934 % Then, for each argument number #N, we place the corresponding argument
7935 % value into a new token list register \toks#N
7936 \expandafter\putargsintokens@\saveparamlist@,;,%
7937 % Then, we expand the body so that argument are replaced by their
7938 % values. The trick for values not to be expanded themselves is that they
7939 % are within tokens and that tokens expand only once in an \edef .
7940 \edef\@tempc{\csname mac.\macroname .body\endcsname}%
7941 % Now we restore the token stack pointer to free the token list registers
7942 % which we have used, but we make sure that expanded body is saved after
7946 \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
7949 \def\macargexpandinbody@{%
7950 %% Define the named-macro outside of this group and then close this group.
7954 % First the replace in body the macro arguments by their values, the result
7957 % Then we point at the \norecurse or \gobble (for recursive) macro value
7959 \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
7960 % Depending on whether it is recursive or not, we need some tailing
7967 % And now we do the real job:
7968 \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
7972 \def\putargsintokens@#1,{%
7973 \if#1;\let\next\relax
7975 \let\next\putargsintokens@
7976 % First we allocate the new token list register, and give it a temporary
7978 \toksdef\@tempb\the\paramno
7979 % Then we place the argument value into that token list register.
7980 \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
7981 \expandafter\@tempb\expandafter{\@tempa}%
7982 \advance\paramno by 1\relax
7987 % Save the token stack pointer into macro #1
7988 \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
7989 % Restore the token stack pointer from number in macro #1
7990 \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
7991 % newtoks that can be used non \outer .
7992 \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
7994 % Tailing missing arguments are set to empty
7995 \def\setemptyargvalues@{%
7996 \ifx\paramlist\nilm@
7997 \let\next\macargexpandinbody@
7999 \expandafter\setemptyargvaluesparser@\paramlist\endargs@
8000 \let\next\setemptyargvalues@
8005 \def\setemptyargvaluesparser@#1,#2\endargs@{%
8006 \expandafter\def\expandafter\@tempa\expandafter{%
8007 \expandafter\def\csname macarg.#1\endcsname{}}%
8008 \push@\@tempa\macargdeflist@
8012 % #1 is the element target macro
8013 % #2 is the list macro
8014 % #3,#4\endargs@ is the list value
8015 \def\pop@#1#2#3,#4\endargs@{%
8019 \long\def\longpop@#1#2#3,#4\endargs@{%
8024 % This defines a Texinfo @macro. There are eight cases: recursive and
8025 % nonrecursive macros of zero, one, up to nine, and many arguments.
8026 % Much magic with \expandafter here.
8027 % \xdef is used so that macro definitions will survive the file
8028 % they're defined in; @include reads the file inside a group.
8031 \let\hash=##% convert placeholders to macro parameter chars
8035 \expandafter\xdef\csname\the\macname\endcsname{%
8036 \noexpand\scanmacro{\temp}}%
8038 \expandafter\xdef\csname\the\macname\endcsname{%
8039 \bgroup\noexpand\macroargctxt
8040 \noexpand\braceorline
8041 \expandafter\noexpand\csname\the\macname xxx\endcsname}%
8042 \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
8043 \egroup\noexpand\scanmacro{\temp}}%
8045 \ifnum\paramno<10\relax % at most 9
8046 \expandafter\xdef\csname\the\macname\endcsname{%
8047 \bgroup\noexpand\macroargctxt
8048 \noexpand\csname\the\macname xx\endcsname}%
8049 \expandafter\xdef\csname\the\macname xx\endcsname##1{%
8050 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
8051 \expandafter\expandafter
8053 \expandafter\expandafter
8054 \csname\the\macname xxx\endcsname
8055 \paramlist{\egroup\noexpand\scanmacro{\temp}}%
8057 \expandafter\xdef\csname\the\macname\endcsname{%
8058 \noexpand\getargvals@{\the\macname}{\argl}%
8060 \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
8061 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
8067 \expandafter\xdef\csname\the\macname\endcsname{%
8068 \noexpand\norecurse{\the\macname}%
8069 \noexpand\scanmacro{\temp}\egroup}%
8071 \expandafter\xdef\csname\the\macname\endcsname{%
8072 \bgroup\noexpand\macroargctxt
8073 \noexpand\braceorline
8074 \expandafter\noexpand\csname\the\macname xxx\endcsname}%
8075 \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
8077 \noexpand\norecurse{\the\macname}%
8078 \noexpand\scanmacro{\temp}\egroup}%
8080 \ifnum\paramno<10\relax
8081 \expandafter\xdef\csname\the\macname\endcsname{%
8082 \bgroup\noexpand\macroargctxt
8083 \expandafter\noexpand\csname\the\macname xx\endcsname}%
8084 \expandafter\xdef\csname\the\macname xx\endcsname##1{%
8085 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
8086 \expandafter\expandafter
8088 \expandafter\expandafter
8089 \csname\the\macname xxx\endcsname
8092 \noexpand\norecurse{\the\macname}%
8093 \noexpand\scanmacro{\temp}\egroup}%
8095 \expandafter\xdef\csname\the\macname\endcsname{%
8096 \noexpand\getargvals@{\the\macname}{\argl}%
8098 \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
8099 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
8104 \catcode `\@\texiatcatcode\relax
8106 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
8108 % \braceorline decides whether the next nonwhitespace character is a
8109 % {. If so it reads up to the closing }, if not, it reads the whole
8110 % line. Whatever was read is then fed to the next control sequence
8111 % as an argument (by \parsebrace or \parsearg).
8113 \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
8114 \def\braceorlinexxx{%
8115 \ifx\nchar\bgroup\else
8116 \expandafter\parsearg
8121 % We need some trickery to remove the optional spaces around the equal
8122 % sign. Make them active and then expand them all to nothing.
8124 \def\alias{\parseargusing\obeyspaces\aliasxxx}
8125 \def\aliasxxx #1{\aliasyyy#1\relax}
8126 \def\aliasyyy #1=#2\relax{%
8128 \expandafter\let\obeyedspace=\empty
8129 \addtomacrolist{#1}%
8130 \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
8136 \message{cross references,}
8139 \newif\ifhavexrefs % True if xref values are known.
8140 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
8142 % @inforef is relatively simple.
8143 \def\inforef #1{\inforefzzz #1,,,,**}
8144 \def\inforefzzz #1,#2,#3,#4**{%
8145 \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
8146 node \samp{\ignorespaces#1{}}}
8148 % @node's only job in TeX is to define \lastnode, which is used in
8149 % cross-references. The @node line might or might not have commas, and
8150 % might or might not have spaces before the first comma, like:
8151 % @node foo , bar , ...
8152 % We don't want such trailing spaces in the node name.
8154 \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
8156 % also remove a trailing comma, in case of something like this:
8157 % @node Help-Cross, , , Cross-refs
8158 \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
8159 \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
8162 \let\lastnode=\empty
8164 % Write a cross-reference definition for the current node. #1 is the
8165 % type (Ynumbered, Yappendix, Ynothing).
8168 \ifx\lastnode\empty\else
8169 \setref{\lastnode}{#1}%
8170 \global\let\lastnode=\empty
8174 % @anchor{NAME} -- define xref target at arbitrary point.
8176 \newcount\savesfregister
8178 \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
8179 \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
8180 \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
8182 % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
8183 % anchor), which consists of three parts:
8184 % 1) NAME-title - the current sectioning name taken from \lastsection,
8185 % or the anchor name.
8186 % 2) NAME-snt - section number and type, passed as the SNT arg, or
8187 % empty for anchors.
8188 % 3) NAME-pg - the page number.
8190 % This is called from \donoderef, \anchor, and \dofloat. In the case of
8191 % floats, there is an additional part, which is not written here:
8192 % 4) NAME-lof - the text as it should appear in a @listoffloats.
8198 \atdummies % preserve commands, but don't expand them
8199 \edef\writexrdef##1##2{%
8200 \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
8201 ##1}{##2}}% these are parameters of \writexrdef
8203 \toks0 = \expandafter{\lastsection}%
8204 \immediate \writexrdef{title}{\the\toks0 }%
8205 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
8206 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
8211 % @xrefautosectiontitle on|off says whether @section(ing) names are used
8212 % automatically in xrefs, if the third arg is not explicitly specified.
8213 % This was provided as a "secret" @set xref-automatic-section-title
8214 % variable, now it's official.
8216 \parseargdef\xrefautomaticsectiontitle{%
8219 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8221 \else\ifx\temp\offword
8222 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8225 \errhelp = \EMsimple
8226 \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
8232 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
8233 % the node name, #2 the name of the Info cross-reference, #3 the printed
8234 % node name, #4 the name of the Info file, #5 the name of the printed
8235 % manual. All but the node name can be omitted.
8237 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
8238 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
8239 \def\ref#1{\xrefX[#1,,,,,,,]}
8242 \newbox\printedrefnamebox
8243 \newbox\infofilenamebox
8244 \newbox\printedmanualbox
8246 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
8249 % Get args without leading/trailing spaces.
8250 \def\printedrefname{\ignorespaces #3}%
8251 \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
8253 \def\infofilename{\ignorespaces #4}%
8254 \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
8256 \def\printedmanual{\ignorespaces #5}%
8257 \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
8259 % If the printed reference name (arg #3) was not explicitly given in
8260 % the @xref, figure out what we want to use.
8261 \ifdim \wd\printedrefnamebox = 0pt
8262 % No printed node name was explicitly given.
8263 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
8264 % Not auto section-title: use node name inside the square brackets.
8265 \def\printedrefname{\ignorespaces #1}%
8267 % Auto section-title: use chapter/section title inside
8268 % the square brackets if we have it.
8269 \ifdim \wd\printedmanualbox > 0pt
8270 % It is in another manual, so we don't have it; use node name.
8271 \def\printedrefname{\ignorespaces #1}%
8274 % We (should) know the real title if we have the xref values.
8275 \def\printedrefname{\refx{#1-title}{}}%
8277 % Otherwise just copy the Info node name.
8278 \def\printedrefname{\ignorespaces #1}%
8284 % Make link in pdf output.
8288 \makevalueexpandable
8289 % This expands tokens, so do it after making catcode changes, so _
8290 % etc. don't get their TeX definitions. This ignores all spaces in
8291 % #4, including (wrongly) those in the middle of the filename.
8294 % This (wrongly) does not take account of leading or trailing
8295 % spaces in #1, which should be ignored.
8296 \edef\pdfxrefdest{#1}%
8297 \ifx\pdfxrefdest\empty
8298 \def\pdfxrefdest{Top}% no empty targets
8300 \txiescapepdf\pdfxrefdest % escape PDF special chars
8304 \startlink attr{/Border [0 0 0]}%
8305 \ifnum\filenamelength>0
8306 goto file{\the\filename.pdf} name{\pdfxrefdest}%
8308 goto name{\pdfmkpgn{\pdfxrefdest}}%
8311 \setcolor{\linkcolor}%
8314 % Float references are printed completely differently: "Figure 1.2"
8315 % instead of "[somenode], p.3". We distinguish them by the
8316 % LABEL-title being set to a magic string.
8318 % Have to otherify everything special to allow the \csname to
8319 % include an _ in the xref name, etc.
8322 \expandafter\global\expandafter\let\expandafter\Xthisreftitle
8323 \csname XR#1-title\endcsname
8325 \iffloat\Xthisreftitle
8326 % If the user specified the print name (third arg) to the ref,
8327 % print it instead of our usual "Figure 1.2".
8328 \ifdim\wd\printedrefnamebox = 0pt
8334 % If the user also gave the printed manual name (fifth arg), append
8336 \ifdim \wd\printedmanualbox > 0pt
8337 \space \putwordin{} \cite{\printedmanual}%
8340 % node/anchor (non-float) references.
8342 % If we use \unhbox to print the node names, TeX does not insert
8343 % empty discretionaries after hyphens, which means that it will not
8344 % find a line break at a hyphen in a node names. Since some manuals
8345 % are best written with fairly long node names, containing hyphens,
8346 % this is a loss. Therefore, we give the text of the node name
8347 % again, so it is as if TeX is seeing it for the first time.
8349 \ifdim \wd\printedmanualbox > 0pt
8350 % Cross-manual reference with a printed manual name.
8352 \crossmanualxref{\cite{\printedmanual\unskip}}%
8354 \else\ifdim \wd\infofilenamebox > 0pt
8355 % Cross-manual reference with only an info filename (arg 4), no
8356 % printed manual name (arg 5). This is essentially the same as
8357 % the case above; we output the filename, since we have nothing else.
8359 \crossmanualxref{\code{\infofilename\unskip}}%
8362 % Reference within this manual.
8364 % _ (for example) has to be the character _ for the purposes of the
8365 % control sequence corresponding to the node, but it has to expand
8366 % into the usual \leavevmode...\vrule stuff for purposes of
8367 % printing. So we \turnoffactive for the \refx-snt, back on for the
8368 % printing, back off for the \refx-pg.
8370 % Only output a following space if the -snt ref is nonempty; for
8371 % @unnumbered and @anchor, it won't be.
8372 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
8373 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
8375 % output the `[mynode]' via the macro below so it can be overridden.
8376 \xrefprintnodename\printedrefname
8378 % But we always want a comma and a space:
8381 % output the `page 3'.
8382 \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
8388 % Output a cross-manual xref to #1. Used just above (twice).
8390 % Only include the text "Section ``foo'' in" if the foo is neither
8391 % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
8392 % "see The Foo Manual", the idea being to refer to the whole manual.
8394 % But, this being TeX, we can't easily compare our node name against the
8395 % string "Top" while ignoring the possible spaces before and after in
8396 % the input. By adding the arbitrary 7sp below, we make it much less
8397 % likely that a real node name would have the same width as "Top" (e.g.,
8398 % in a monospaced font). Hopefully it will never happen in practice.
8400 % For the same basic reason, we retypeset the "Top" at every
8401 % reference, since the current font is indeterminate.
8403 \def\crossmanualxref#1{%
8404 \setbox\toprefbox = \hbox{Top\kern7sp}%
8405 \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
8406 \ifdim \wd2 > 7sp % nonempty?
8407 \ifdim \wd2 = \wd\toprefbox \else % same as Top?
8408 \putwordSection{} ``\printedrefname'' \putwordin{}\space
8414 % This macro is called from \xrefX for the `[nodename]' part of xref
8415 % output. It's a separate macro only so it can be changed more easily,
8416 % since square brackets don't work well in some documents. Particularly
8417 % one that Bob is working on :).
8419 \def\xrefprintnodename#1{[#1]}
8421 % Things referred to by \setref.
8427 \putwordChapter@tie \the\chapno
8428 \else \ifnum\subsecno=0
8429 \putwordSection@tie \the\chapno.\the\secno
8430 \else \ifnum\subsubsecno=0
8431 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
8433 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
8438 \putwordAppendix@tie @char\the\appendixno{}%
8439 \else \ifnum\subsecno=0
8440 \putwordSection@tie @char\the\appendixno.\the\secno
8441 \else \ifnum\subsubsecno=0
8442 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
8445 @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
8449 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
8450 % If its value is nonempty, SUFFIX is output afterward.
8456 \expandafter\global\expandafter\let\expandafter\thisrefX
8457 \csname XR#1\endcsname
8460 % If not defined, say something at least.
8461 \angleleft un\-de\-fined\angleright
8464 {\toks0 = {#1}% avoid expansion of possibly-complex value
8465 \message{\linenumber Undefined cross reference `\the\toks0'.}}%
8468 \global\warnedxrefstrue
8469 \message{Cross reference values unknown; you must run TeX again.}%
8474 % It's defined, so just use it.
8477 #2% Output the suffix in any case.
8480 % This is the macro invoked by entries in the aux file. Usually it's
8481 % just a \def (we prepend XR to the control sequence name to avoid
8482 % collisions). But if this is a float type, we have more work to do.
8485 {% The node name might contain 8-bit characters, which in our current
8486 % implementation are changed to commands like @'e. Don't let these
8487 % mess up the control sequence name.
8490 \xdef\safexrefname{#1}%
8493 \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
8495 % Was that xref control sequence that we just defined for a float?
8496 \expandafter\iffloat\csname XR\safexrefname\endcsname
8497 % it was a float, and we have the (safe) float type in \iffloattype.
8498 \expandafter\let\expandafter\floatlist
8499 \csname floatlist\iffloattype\endcsname
8501 % Is this the first time we've seen this float type?
8502 \expandafter\ifx\floatlist\relax
8503 \toks0 = {\do}% yes, so just \do
8505 % had it before, so preserve previous elements in list.
8506 \toks0 = \expandafter{\floatlist\do}%
8509 % Remember this xref in the control sequence \floatlistFLOATTYPE,
8510 % for later use in \listoffloats.
8511 \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
8516 % Read the last existing aux file, if any. No error if none exists.
8519 \openin 1 \jobname.aux
8522 \global\havexrefstrue
8527 \def\setupdatafile{%
8528 \catcode`\^^@=\other
8529 \catcode`\^^A=\other
8530 \catcode`\^^B=\other
8531 \catcode`\^^C=\other
8532 \catcode`\^^D=\other
8533 \catcode`\^^E=\other
8534 \catcode`\^^F=\other
8535 \catcode`\^^G=\other
8536 \catcode`\^^H=\other
8537 \catcode`\^^K=\other
8538 \catcode`\^^L=\other
8539 \catcode`\^^N=\other
8540 \catcode`\^^P=\other
8541 \catcode`\^^Q=\other
8542 \catcode`\^^R=\other
8543 \catcode`\^^S=\other
8544 \catcode`\^^T=\other
8545 \catcode`\^^U=\other
8546 \catcode`\^^V=\other
8547 \catcode`\^^W=\other
8548 \catcode`\^^X=\other
8549 \catcode`\^^Z=\other
8550 \catcode`\^^[=\other
8551 \catcode`\^^\=\other
8552 \catcode`\^^]=\other
8553 \catcode`\^^^=\other
8554 \catcode`\^^_=\other
8555 % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
8556 % in xref tags, i.e., node names. But since ^^e4 notation isn't
8557 % supported in the main text, it doesn't seem desirable. Furthermore,
8558 % that is not enough: for node names that actually contain a ^
8559 % character, we would end up writing a line like this: 'xrdef {'hat
8560 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
8561 % argument, and \hat is not an expandable control sequence. It could
8562 % all be worked out, but why? Either we support ^^ or we don't.
8564 % The other change necessary for this was to define \auxhat:
8565 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
8566 % and then to call \auxhat in \setq.
8570 % Special characters. Should be turned off anyway, but...
8583 \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
8585 % This is to support \ in node names and titles, since the \
8586 % characters end up in a \csname. It's easier than
8587 % leaving it active and making its active definition an actual \
8588 % character. What I don't understand is why it works in the *value*
8589 % of the xrdef. Seems like it should be a catcode12 \, and that
8590 % should not typeset properly. But it works, so I'm moving on for
8591 % now. --karl, 15jan04.
8594 % Make the characters 128-255 be printing characters.
8598 \catcode\count1=\other
8599 \advance\count1 by 1
8600 \ifnum \count1<256 \loop \fi
8604 % @ is our escape character in .aux files, and we need braces.
8610 \def\readdatafile#1{%
8617 \message{insertions,}
8618 % including footnotes.
8620 \newcount \footnoteno
8622 % The trailing space in the following definition for supereject is
8623 % vital for proper filling; pages come out unaligned when you do a
8624 % pagealignmacro call if that space before the closing brace is
8625 % removed. (Generally, numeric constants should always be followed by a
8626 % space to prevent strange expansion errors.)
8627 \def\supereject{\par\penalty -20000\footnoteno =0 }
8629 % @footnotestyle is meaningful for Info output only.
8630 \let\footnotestyle=\comment
8634 % Auto-number footnotes. Otherwise like plain.
8636 \let\indent=\ptexindent
8637 \let\noindent=\ptexnoindent
8638 \global\advance\footnoteno by \@ne
8639 \edef\thisfootno{$^{\the\footnoteno}$}%
8641 % In case the footnote comes at the end of a sentence, preserve the
8642 % extra spacing after we do the footnote number.
8644 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
8646 % Remove inadvertent blank space before typesetting the footnote number.
8652 % Don't bother with the trickery in plain.tex to not require the
8653 % footnote text as a parameter. Our footnotes don't need to be so general.
8655 % Oh yes, they do; otherwise, @ifset (and anything else that uses
8656 % \parseargline) fails inside footnotes because the tokens are fixed when
8657 % the footnote is read. --karl, 16nov96.
8660 \insert\footins\bgroup
8661 % We want to typeset this text as a normal paragraph, even if the
8662 % footnote reference occurs in (for example) a display environment.
8663 % So reset some parameters.
8665 \interlinepenalty\interfootnotelinepenalty
8666 \splittopskip\ht\strutbox % top baseline for broken footnotes
8667 \splitmaxdepth\dp\strutbox
8668 \floatingpenalty\@MM
8673 \parindent\defaultparindent
8677 % Because we use hanging indentation in footnotes, a @noindent appears
8678 % to exdent this text, so make it be a no-op. makeinfo does not use
8679 % hanging indentation so @noindent can still be needed within footnote
8680 % text after an @example or the like (not that this is good style).
8681 \let\noindent = \relax
8683 % Hang the footnote text off the number. Use \everypar in case the
8684 % footnote extends for more than one paragraph.
8685 \everypar = {\hang}%
8686 \textindent{\thisfootno}%
8688 % Don't crash into the line above the footnote text. Since this
8689 % expands into a box, it must come within the paragraph, lest it
8690 % provide a place where TeX can split the footnote.
8693 % Invoke rest of plain TeX footnote routine.
8694 \futurelet\next\fo@t
8696 }%end \catcode `\@=11
8698 % In case a @footnote appears in a vbox, save the footnote text and create
8699 % the real \insert just after the vbox finished. Otherwise, the insertion
8701 % Similarly, if a @footnote appears inside an alignment, save the footnote
8702 % text to a box and make the \insert when a row of the table is finished.
8703 % And the same can be done for other insert classes. --kasal, 16nov03.
8705 % Replace the \insert primitive by a cheating macro.
8706 % Deeper inside, just make sure that the saved insertions are not spilled
8709 \def\startsavinginserts{%
8710 \ifx \insert\ptexinsert
8711 \let\insert\saveinsert
8713 \let\checkinserts\relax
8717 % This \insert replacement works for both \insert\footins{foo} and
8718 % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
8721 \edef\next{\noexpand\savetobox \makeSAVEname#1}%
8722 \afterassignment\next
8723 % swallow the left brace
8726 \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
8727 \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
8729 \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
8731 \def\placesaveins#1{%
8732 \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
8736 % eat @SAVE -- beware, all of them have catcode \other:
8738 \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
8739 \gdef\gobblesave @SAVE{}
8743 \def\newsaveins #1{%
8744 \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
8747 \def\newsaveinsX #1{%
8748 \csname newbox\endcsname #1%
8749 \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
8754 \let\checkinserts\empty
8759 % @image. We use the macros from epsf.tex to support this.
8760 % If epsf.tex is not installed and @image is used, we complain.
8762 % Check for and read epsf.tex up front. If we read it only at @image
8763 % time, we might be inside a group, and then its definitions would get
8764 % undone and the next image would fail.
8765 \openin 1 = epsf.tex
8767 % Do not bother showing banner with epsf.tex v2.7k (available in
8768 % doc/epsf.tex and on ctan).
8769 \def\epsfannounce{\toks0 = }%
8774 % We will only complain once about lack of epsf.tex.
8775 \newif\ifwarnednoepsf
8776 \newhelp\noepsfhelp{epsf.tex must be installed for images to
8777 work. It is also included in the Texinfo distribution, or you can get
8778 it from ftp://tug.org/tex/epsf.tex.}
8781 \ifx\epsfbox\thisisundefined
8782 \ifwarnednoepsf \else
8783 \errhelp = \noepsfhelp
8784 \errmessage{epsf.tex not found, images will be ignored}%
8785 \global\warnednoepsftrue
8788 \imagexxx #1,,,,,\finish
8792 % Arguments to @image:
8793 % #1 is (mandatory) image filename; we tack on .eps extension.
8794 % #2 is (optional) width, #3 is (optional) height.
8795 % #4 is (ignored optional) html alt text.
8796 % #5 is (ignored optional) extension.
8797 % #6 is just the usual extra ignored arg for parsing stuff.
8799 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
8800 \catcode`\^^M = 5 % in case we're inside an example
8801 \normalturnoffactive % allow _ et al. in names
8802 % If the image is by itself, center it.
8805 \else \ifx\centersub\centerV
8806 % for @center @image, we need a vbox so we can have our vertical space
8808 \vbox\bgroup % vbox has better behavior than vtop herev
8813 % Usually we'll have text after the image which will insert
8814 % \parskip glue, so insert it here too to equalize the space
8816 \nobreak\vskip\parskip
8820 % Leave vertical mode so that indentation from an enclosing
8821 % environment such as @quotation is respected.
8822 % However, if we're at the top level, we don't want the
8823 % normal paragraph indentation.
8824 % On the other hand, if we are in the case of @center @image, we don't
8825 % want to start a paragraph, which will create a hsize-width box and
8826 % eradicate the centering.
8827 \ifx\centersub\centerV\else \noindent \fi
8831 \dopdfimage{#1}{#2}{#3}%
8833 % \epsfbox itself resets \epsf?size at each figure.
8834 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
8835 \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
8840 \medskip % space after a standalone image
8842 \ifx\centersub\centerV \egroup \fi
8846 % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
8847 % etc. We don't actually implement floating yet, we always include the
8848 % float "here". But it seemed the best name for the future.
8850 \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
8852 % There may be a space before second and/or third parameter; delete it.
8853 \def\eatcommaspace#1, {#1,}
8855 % #1 is the optional FLOATTYPE, the text label for this float, typically
8856 % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
8857 % this float will not be numbered and cannot be referred to.
8859 % #2 is the optional xref label. Also must be present for the float to
8862 % #3 is the optional positioning argument; for now, it is ignored. It
8863 % will somehow specify the positions allowed to float to (here, top, bottom).
8865 % We keep a separate counter for each FLOATTYPE, which we reset at each
8866 % chapter-level command.
8867 \let\resetallfloatnos=\empty
8869 \def\dofloat#1,#2,#3,#4\finish{%
8870 \let\thiscaption=\empty
8871 \let\thisshortcaption=\empty
8873 % don't lose footnotes inside @float.
8875 % BEWARE: when the floats start float, we have to issue warning whenever an
8876 % insert appears inside a float which could possibly float. --kasal, 26may04
8880 % We can't be used inside a paragraph.
8885 \def\floatlabel{#2}%
8886 \def\floatloc{#3}% we do nothing with this yet.
8888 \ifx\floattype\empty
8889 \let\safefloattype=\empty
8892 % the floattype might have accents or other special characters,
8893 % but we need to use it in a control sequence name.
8896 \xdef\safefloattype{\floattype}%
8900 % If label is given but no type, we handle that as the empty type.
8901 \ifx\floatlabel\empty \else
8902 % We want each FLOATTYPE to be numbered separately (Figure 1,
8903 % Table 1, Figure 2, ...). (And if no label, no number.)
8905 \expandafter\getfloatno\csname\safefloattype floatno\endcsname
8906 \global\advance\floatno by 1
8909 % This magic value for \lastsection is output by \setref as the
8910 % XREFLABEL-title value. \xrefX uses it to distinguish float
8911 % labels (which have a completely different output format) from
8912 % node and anchor labels. And \xrdef uses it to construct the
8915 \edef\lastsection{\floatmagic=\safefloattype}%
8916 \setref{\floatlabel}{Yfloat}%
8920 % start with \parskip glue, I guess.
8923 % Don't suppress indentation if a float happens to start a section.
8924 \restorefirstparagraphindent
8927 % we have these possibilities:
8928 % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
8929 % @float Foo,lbl & no caption: Foo 1.1
8930 % @float Foo & @caption{Cap}: Foo: Cap
8931 % @float Foo & no caption: Foo
8932 % @float ,lbl & Caption{Cap}: 1.1: Cap
8933 % @float ,lbl & no caption: 1.1
8934 % @float & @caption{Cap}: Cap
8935 % @float & no caption:
8938 \let\floatident = \empty
8940 % In all cases, if we have a float type, it comes first.
8941 \ifx\floattype\empty \else \def\floatident{\floattype}\fi
8943 % If we have an xref label, the number comes next.
8944 \ifx\floatlabel\empty \else
8945 \ifx\floattype\empty \else % if also had float type, need tie first.
8946 \appendtomacro\floatident{\tie}%
8949 \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
8952 % Start the printed caption with what we've constructed in
8953 % \floatident, but keep it separate; we need \floatident again.
8954 \let\captionline = \floatident
8956 \ifx\thiscaption\empty \else
8957 \ifx\floatident\empty \else
8958 \appendtomacro\captionline{: }% had ident, so need a colon between
8962 \appendtomacro\captionline{\scanexp\thiscaption}%
8965 % If we have anything to print, print it, with space before.
8966 % Eventually this needs to become an \insert.
8967 \ifx\captionline\empty \else
8971 % Space below caption.
8975 % If have an xref label, write the list of floats info. Do this
8976 % after the caption, to avoid chance of it being a breakpoint.
8977 \ifx\floatlabel\empty \else
8978 % Write the text that goes in the lof to the aux file as
8979 % \floatlabel-lof. Besides \floatident, we include the short
8980 % caption if specified, else the full caption if specified, else nothing.
8984 % since we read the caption text in the macro world, where ^^M
8985 % is turned into a normal character, we have to scan it back, so
8986 % we don't write the literal three characters "^^M" into the aux file.
8988 \xdef\noexpand\gtemp{%
8989 \ifx\thisshortcaption\empty
8996 \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
8997 \ifx\gtemp\empty \else : \gtemp \fi}}%
9000 \egroup % end of \vtop
9002 % place the captured inserts
9004 % BEWARE: when the floats start floating, we have to issue warning
9005 % whenever an insert appears inside a float which could possibly
9006 % float. --kasal, 26may04
9011 % Append the tokens #2 to the definition of macro #1, not expanding either.
9013 \def\appendtomacro#1#2{%
9014 \expandafter\def\expandafter#1\expandafter{#1#2}%
9017 % @caption, @shortcaption
9019 \def\caption{\docaption\thiscaption}
9020 \def\shortcaption{\docaption\thisshortcaption}
9021 \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
9022 \def\defcaption#1#2{\egroup \def#1{#2}}
9024 % The parameter is the control sequence identifying the counter we are
9025 % going to use. Create it if it doesn't exist and assign it to \floatno.
9028 % Haven't seen this figure type before.
9029 \csname newcount\endcsname #1%
9031 % Remember to reset this floatno at the next chap.
9032 \expandafter\gdef\expandafter\resetallfloatnos
9033 \expandafter{\resetallfloatnos #1=0 }%
9038 % \setref calls this to get the XREFLABEL-snt value. We want an @xref
9039 % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
9040 % first read the @float command.
9042 \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
9044 % Magic string used for the XREFLABEL-title value, so \xrefX can
9045 % distinguish floats from other xref types.
9046 \def\floatmagic{!!float!!}
9048 % #1 is the control sequence we are passed; we expand into a conditional
9049 % which is true if #1 represents a float ref. That is, the magic
9050 % \lastsection value which we \setref above.
9052 \def\iffloat#1{\expandafter\doiffloat#1==\finish}
9054 % #1 is (maybe) the \floatmagic string. If so, #2 will be the
9055 % (safe) float type for this float. We set \iffloattype to #2.
9057 \def\doiffloat#1=#2=#3\finish{%
9059 \def\iffloattype{#2}%
9060 \ifx\temp\floatmagic
9063 % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
9065 \parseargdef\listoffloats{%
9066 \def\floattype{#1}% floattype
9068 % the floattype might have accents or other special characters,
9069 % but we need to use it in a control sequence name.
9072 \xdef\safefloattype{\floattype}%
9075 % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
9076 \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
9078 % if the user said @listoffloats foo but never @float foo.
9079 \message{\linenumber No `\safefloattype' floats to list.}%
9083 \leftskip=\tocindent % indent these entries like a toc
9084 \let\do=\listoffloatsdo
9085 \csname floatlist\safefloattype\endcsname
9090 % This is called on each entry in a list of floats. We're passed the
9091 % xref label, in the form LABEL-title, which is how we save it in the
9092 % aux file. We strip off the -title and look up \XRLABEL-lof, which
9093 % has the text we're supposed to typeset here.
9095 % Figures without xref labels will not be included in the list (since
9096 % they won't appear in the aux file).
9098 \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
9099 \def\listoffloatsdoentry#1-title\finish{{%
9100 % Can't fully expand XR#1-lof because it can contain anything. Just
9101 % pass the control sequence. On the other hand, XR#1-pg is just the
9102 % page number, and we want to fully expand that so we can get a link
9104 \toksA = \expandafter{\csname XR#1-lof\endcsname}%
9106 % use the same \entry macro we use to generate the TOC and index.
9107 \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
9112 \message{localization,}
9114 % For single-language documents, @documentlanguage is usually given very
9115 % early, just after @documentencoding. Single argument is the language
9116 % (de) or locale (de_DE) abbreviation.
9119 \catcode`\_ = \active
9121 \parseargdef\documentlanguage{\begingroup
9122 \let_=\normalunderscore % normal _ character for filenames
9123 \tex % read txi-??.tex file in plain TeX.
9124 % Read the file by the name they passed if it exists.
9125 \openin 1 txi-#1.tex
9127 \documentlanguagetrywithoutunderscore{#1_\finish}%
9129 \globaldefs = 1 % everything in the txi-LL files needs to persist
9133 \endgroup % end raw TeX
9136 % If they passed de_DE, and txi-de_DE.tex doesn't exist,
9139 \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
9140 \openin 1 txi-#1.tex
9142 \errhelp = \nolanghelp
9143 \errmessage{Cannot read language file txi-#1.tex}%
9145 \globaldefs = 1 % everything in the txi-LL files needs to persist
9150 }% end of special _ catcode
9152 \newhelp\nolanghelp{The given language definition file cannot be found or
9153 is empty. Maybe you need to install it? Putting it in the current
9154 directory should work if nowhere else does.}
9156 % This macro is called from txi-??.tex files; the first argument is the
9157 % \language name to set (without the "\lang@" prefix), the second and
9158 % third args are \{left,right}hyphenmin.
9160 % The language names to pass are determined when the format is built.
9161 % See the etex.log file created at that time, e.g.,
9162 % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
9164 % With TeX Live 2008, etex now includes hyphenation patterns for all
9165 % available languages. This means we can support hyphenation in
9166 % Texinfo, at least to some extent. (This still doesn't solve the
9167 % accented characters problem.)
9170 \def\txisetlanguage#1#2#3{%
9171 % do not set the language if the name is undefined in the current TeX.
9172 \expandafter\ifx\csname lang@#1\endcsname \relax
9173 \message{no patterns for #1}%
9175 \global\language = \csname lang@#1\endcsname
9177 % but there is no harm in adjusting the hyphenmin values regardless.
9178 \global\lefthyphenmin = #2\relax
9179 \global\righthyphenmin = #3\relax
9182 % Helpers for encodings.
9183 % Set the catcode of characters 128 through 255 to the specified number.
9185 \def\setnonasciicharscatcode#1{%
9187 \loop\ifnum\count255<256
9188 \global\catcode\count255=#1\relax
9189 \advance\count255 by 1
9193 \def\setnonasciicharscatcodenonglobal#1{%
9195 \loop\ifnum\count255<256
9196 \catcode\count255=#1\relax
9197 \advance\count255 by 1
9201 % @documentencoding sets the definition of non-ASCII characters
9202 % according to the specified encoding.
9204 \parseargdef\documentencoding{%
9205 % Encoding being declared for the document.
9206 \def\declaredencoding{\csname #1.enc\endcsname}%
9208 % Supported encodings: names converted to tokens in order to be able
9209 % to compare them with \ifx.
9210 \def\ascii{\csname US-ASCII.enc\endcsname}%
9211 \def\latnine{\csname ISO-8859-15.enc\endcsname}%
9212 \def\latone{\csname ISO-8859-1.enc\endcsname}%
9213 \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
9214 \def\utfeight{\csname UTF-8.enc\endcsname}%
9216 \ifx \declaredencoding \ascii
9219 \else \ifx \declaredencoding \lattwo
9220 \setnonasciicharscatcode\active
9223 \else \ifx \declaredencoding \latone
9224 \setnonasciicharscatcode\active
9227 \else \ifx \declaredencoding \latnine
9228 \setnonasciicharscatcode\active
9231 \else \ifx \declaredencoding \utfeight
9232 \setnonasciicharscatcode\active
9236 \message{Unknown document encoding #1, ignoring.}%
9245 % A message to be logged when using a character that isn't available
9246 % the default font encoding (OT1).
9248 \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
9250 % Take account of \c (plain) vs. \, (Texinfo) difference.
9251 \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
9253 % First, make active non-ASCII characters in order for them to be
9254 % correctly categorized when TeX reads the replacement text of
9255 % macros containing the character definitions.
9256 \setnonasciicharscatcode\active
9258 % Latin1 (ISO-8859-1) character definitions.
9259 \def\latonechardefs{%
9261 \gdef^^a1{\exclamdown}
9262 \gdef^^a2{\missingcharmsg{CENT SIGN}}
9263 \gdef^^a3{{\pounds}}
9264 \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
9265 \gdef^^a5{\missingcharmsg{YEN SIGN}}
9266 \gdef^^a6{\missingcharmsg{BROKEN BAR}}
9269 \gdef^^a9{\copyright}
9271 \gdef^^ab{\guillemetleft}
9274 \gdef^^ae{\registeredsymbol}
9277 \gdef^^b0{\textdegree}
9286 \gdef^^b8{\cedilla\ }
9290 \gdef^^bb{\guillemetright}
9291 \gdef^^bc{$1\over4$}
9292 \gdef^^bd{$1\over2$}
9293 \gdef^^be{$3\over4$}
9294 \gdef^^bf{\questiondown}
9301 \gdef^^c5{\ringaccent A}
9303 \gdef^^c7{\cedilla C}
9335 \gdef^^e5{\ringaccent a}
9337 \gdef^^e7{\cedilla c}
9342 \gdef^^ec{\`{\dotless i}}
9343 \gdef^^ed{\'{\dotless i}}
9344 \gdef^^ee{\^{\dotless i}}
9345 \gdef^^ef{\"{\dotless i}}
9365 % Latin9 (ISO-8859-15) encoding character definitions.
9366 \def\latninechardefs{%
9367 % Encoding is almost identical to Latin1.
9380 % Latin2 (ISO-8859-2) character definitions.
9381 \def\lattwochardefs{%
9383 \gdef^^a1{\ogonek{A}}
9386 \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
9392 \gdef^^aa{\cedilla S}
9397 \gdef^^af{\dotaccent Z}
9399 \gdef^^b0{\textdegree}
9400 \gdef^^b1{\ogonek{a}}
9401 \gdef^^b2{\ogonek{ }}
9407 \gdef^^b8{\cedilla\ }
9409 \gdef^^ba{\cedilla s}
9414 \gdef^^bf{\dotaccent z}
9423 \gdef^^c7{\cedilla C}
9426 \gdef^^ca{\ogonek{E}}
9442 \gdef^^d9{\ringaccent U}
9447 \gdef^^de{\cedilla T}
9457 \gdef^^e7{\cedilla c}
9460 \gdef^^ea{\ogonek{e}}
9463 \gdef^^ed{\'{\dotless{i}}}
9464 \gdef^^ee{\^{\dotless{i}}}
9476 \gdef^^f9{\ringaccent u}
9481 \gdef^^fe{\cedilla t}
9482 \gdef^^ff{\dotaccent{}}
9485 % UTF-8 character definitions.
9487 % This code to support UTF-8 is based on LaTeX's utf8.def, with some
9488 % changes for Texinfo conventions. It is included here under the GPL by
9489 % permission from Frank Mittelbach and the LaTeX team.
9495 \gdef\UTFviiiTwoOctets#1#2{\expandafter
9496 \UTFviiiDefined\csname u8:#1\string #2\endcsname}
9498 \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
9499 \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
9501 \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
9502 \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
9504 \gdef\UTFviiiDefined#1{%
9506 \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
9517 \global\catcode\countUTFx\active
9518 \uccode`\~\countUTFx
9519 \uppercase\expandafter{\UTFviiiTmp}%
9520 \advance\countUTFx by 1
9521 \ifnum\countUTFx < \countUTFy
9522 \expandafter\UTFviiiLoop
9528 \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
9534 \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
9540 \xdef~{\noexpand\UTFviiiFourOctets\string~}}
9553 \gdef\DeclareUnicodeCharacter#1#2{%
9554 \countUTFz = "#1\relax
9555 %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
9558 \def\UTFviiiTwoOctets##1##2{%
9559 \csname u8:##1\string ##2\endcsname}%
9560 \def\UTFviiiThreeOctets##1##2##3{%
9561 \csname u8:##1\string ##2\string ##3\endcsname}%
9562 \def\UTFviiiFourOctets##1##2##3##4{%
9563 \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
9564 \expandafter\expandafter\expandafter\expandafter
9565 \expandafter\expandafter\expandafter
9566 \gdef\UTFviiiTmp{#2}%
9569 \gdef\parseXMLCharref{%
9570 \ifnum\countUTFz < "A0\relax
9571 \errhelp = \EMsimple
9572 \errmessage{Cannot define Unicode char value < 00A0}%
9573 \else\ifnum\countUTFz < "800\relax
9575 \parseUTFviiiB C\UTFviiiTwoOctets.,%
9576 \else\ifnum\countUTFz < "10000\relax
9579 \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
9584 \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
9588 \gdef\parseUTFviiiA#1{%
9589 \countUTFx = \countUTFz
9590 \divide\countUTFz by 64
9591 \countUTFy = \countUTFz
9592 \multiply\countUTFz by 64
9593 \advance\countUTFx by -\countUTFz
9594 \advance\countUTFx by 128
9595 \uccode `#1\countUTFx
9596 \countUTFz = \countUTFy}
9598 \gdef\parseUTFviiiB#1#2#3#4{%
9599 \advance\countUTFz by "#10\relax
9600 \uccode `#3\countUTFz
9601 \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
9604 \def\utfeightchardefs{%
9605 \DeclareUnicodeCharacter{00A0}{\tie}
9606 \DeclareUnicodeCharacter{00A1}{\exclamdown}
9607 \DeclareUnicodeCharacter{00A3}{\pounds}
9608 \DeclareUnicodeCharacter{00A8}{\"{ }}
9609 \DeclareUnicodeCharacter{00A9}{\copyright}
9610 \DeclareUnicodeCharacter{00AA}{\ordf}
9611 \DeclareUnicodeCharacter{00AB}{\guillemetleft}
9612 \DeclareUnicodeCharacter{00AD}{\-}
9613 \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
9614 \DeclareUnicodeCharacter{00AF}{\={ }}
9616 \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
9617 \DeclareUnicodeCharacter{00B4}{\'{ }}
9618 \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
9619 \DeclareUnicodeCharacter{00BA}{\ordm}
9620 \DeclareUnicodeCharacter{00BB}{\guillemetright}
9621 \DeclareUnicodeCharacter{00BF}{\questiondown}
9623 \DeclareUnicodeCharacter{00C0}{\`A}
9624 \DeclareUnicodeCharacter{00C1}{\'A}
9625 \DeclareUnicodeCharacter{00C2}{\^A}
9626 \DeclareUnicodeCharacter{00C3}{\~A}
9627 \DeclareUnicodeCharacter{00C4}{\"A}
9628 \DeclareUnicodeCharacter{00C5}{\AA}
9629 \DeclareUnicodeCharacter{00C6}{\AE}
9630 \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
9631 \DeclareUnicodeCharacter{00C8}{\`E}
9632 \DeclareUnicodeCharacter{00C9}{\'E}
9633 \DeclareUnicodeCharacter{00CA}{\^E}
9634 \DeclareUnicodeCharacter{00CB}{\"E}
9635 \DeclareUnicodeCharacter{00CC}{\`I}
9636 \DeclareUnicodeCharacter{00CD}{\'I}
9637 \DeclareUnicodeCharacter{00CE}{\^I}
9638 \DeclareUnicodeCharacter{00CF}{\"I}
9640 \DeclareUnicodeCharacter{00D0}{\DH}
9641 \DeclareUnicodeCharacter{00D1}{\~N}
9642 \DeclareUnicodeCharacter{00D2}{\`O}
9643 \DeclareUnicodeCharacter{00D3}{\'O}
9644 \DeclareUnicodeCharacter{00D4}{\^O}
9645 \DeclareUnicodeCharacter{00D5}{\~O}
9646 \DeclareUnicodeCharacter{00D6}{\"O}
9647 \DeclareUnicodeCharacter{00D8}{\O}
9648 \DeclareUnicodeCharacter{00D9}{\`U}
9649 \DeclareUnicodeCharacter{00DA}{\'U}
9650 \DeclareUnicodeCharacter{00DB}{\^U}
9651 \DeclareUnicodeCharacter{00DC}{\"U}
9652 \DeclareUnicodeCharacter{00DD}{\'Y}
9653 \DeclareUnicodeCharacter{00DE}{\TH}
9654 \DeclareUnicodeCharacter{00DF}{\ss}
9656 \DeclareUnicodeCharacter{00E0}{\`a}
9657 \DeclareUnicodeCharacter{00E1}{\'a}
9658 \DeclareUnicodeCharacter{00E2}{\^a}
9659 \DeclareUnicodeCharacter{00E3}{\~a}
9660 \DeclareUnicodeCharacter{00E4}{\"a}
9661 \DeclareUnicodeCharacter{00E5}{\aa}
9662 \DeclareUnicodeCharacter{00E6}{\ae}
9663 \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
9664 \DeclareUnicodeCharacter{00E8}{\`e}
9665 \DeclareUnicodeCharacter{00E9}{\'e}
9666 \DeclareUnicodeCharacter{00EA}{\^e}
9667 \DeclareUnicodeCharacter{00EB}{\"e}
9668 \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
9669 \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
9670 \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
9671 \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
9673 \DeclareUnicodeCharacter{00F0}{\dh}
9674 \DeclareUnicodeCharacter{00F1}{\~n}
9675 \DeclareUnicodeCharacter{00F2}{\`o}
9676 \DeclareUnicodeCharacter{00F3}{\'o}
9677 \DeclareUnicodeCharacter{00F4}{\^o}
9678 \DeclareUnicodeCharacter{00F5}{\~o}
9679 \DeclareUnicodeCharacter{00F6}{\"o}
9680 \DeclareUnicodeCharacter{00F8}{\o}
9681 \DeclareUnicodeCharacter{00F9}{\`u}
9682 \DeclareUnicodeCharacter{00FA}{\'u}
9683 \DeclareUnicodeCharacter{00FB}{\^u}
9684 \DeclareUnicodeCharacter{00FC}{\"u}
9685 \DeclareUnicodeCharacter{00FD}{\'y}
9686 \DeclareUnicodeCharacter{00FE}{\th}
9687 \DeclareUnicodeCharacter{00FF}{\"y}
9689 \DeclareUnicodeCharacter{0100}{\=A}
9690 \DeclareUnicodeCharacter{0101}{\=a}
9691 \DeclareUnicodeCharacter{0102}{\u{A}}
9692 \DeclareUnicodeCharacter{0103}{\u{a}}
9693 \DeclareUnicodeCharacter{0104}{\ogonek{A}}
9694 \DeclareUnicodeCharacter{0105}{\ogonek{a}}
9695 \DeclareUnicodeCharacter{0106}{\'C}
9696 \DeclareUnicodeCharacter{0107}{\'c}
9697 \DeclareUnicodeCharacter{0108}{\^C}
9698 \DeclareUnicodeCharacter{0109}{\^c}
9699 \DeclareUnicodeCharacter{0118}{\ogonek{E}}
9700 \DeclareUnicodeCharacter{0119}{\ogonek{e}}
9701 \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
9702 \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
9703 \DeclareUnicodeCharacter{010C}{\v{C}}
9704 \DeclareUnicodeCharacter{010D}{\v{c}}
9705 \DeclareUnicodeCharacter{010E}{\v{D}}
9707 \DeclareUnicodeCharacter{0112}{\=E}
9708 \DeclareUnicodeCharacter{0113}{\=e}
9709 \DeclareUnicodeCharacter{0114}{\u{E}}
9710 \DeclareUnicodeCharacter{0115}{\u{e}}
9711 \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
9712 \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
9713 \DeclareUnicodeCharacter{011A}{\v{E}}
9714 \DeclareUnicodeCharacter{011B}{\v{e}}
9715 \DeclareUnicodeCharacter{011C}{\^G}
9716 \DeclareUnicodeCharacter{011D}{\^g}
9717 \DeclareUnicodeCharacter{011E}{\u{G}}
9718 \DeclareUnicodeCharacter{011F}{\u{g}}
9720 \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
9721 \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
9722 \DeclareUnicodeCharacter{0124}{\^H}
9723 \DeclareUnicodeCharacter{0125}{\^h}
9724 \DeclareUnicodeCharacter{0128}{\~I}
9725 \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
9726 \DeclareUnicodeCharacter{012A}{\=I}
9727 \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
9728 \DeclareUnicodeCharacter{012C}{\u{I}}
9729 \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
9731 \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
9732 \DeclareUnicodeCharacter{0131}{\dotless{i}}
9733 \DeclareUnicodeCharacter{0132}{IJ}
9734 \DeclareUnicodeCharacter{0133}{ij}
9735 \DeclareUnicodeCharacter{0134}{\^J}
9736 \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
9737 \DeclareUnicodeCharacter{0139}{\'L}
9738 \DeclareUnicodeCharacter{013A}{\'l}
9740 \DeclareUnicodeCharacter{0141}{\L}
9741 \DeclareUnicodeCharacter{0142}{\l}
9742 \DeclareUnicodeCharacter{0143}{\'N}
9743 \DeclareUnicodeCharacter{0144}{\'n}
9744 \DeclareUnicodeCharacter{0147}{\v{N}}
9745 \DeclareUnicodeCharacter{0148}{\v{n}}
9746 \DeclareUnicodeCharacter{014C}{\=O}
9747 \DeclareUnicodeCharacter{014D}{\=o}
9748 \DeclareUnicodeCharacter{014E}{\u{O}}
9749 \DeclareUnicodeCharacter{014F}{\u{o}}
9751 \DeclareUnicodeCharacter{0150}{\H{O}}
9752 \DeclareUnicodeCharacter{0151}{\H{o}}
9753 \DeclareUnicodeCharacter{0152}{\OE}
9754 \DeclareUnicodeCharacter{0153}{\oe}
9755 \DeclareUnicodeCharacter{0154}{\'R}
9756 \DeclareUnicodeCharacter{0155}{\'r}
9757 \DeclareUnicodeCharacter{0158}{\v{R}}
9758 \DeclareUnicodeCharacter{0159}{\v{r}}
9759 \DeclareUnicodeCharacter{015A}{\'S}
9760 \DeclareUnicodeCharacter{015B}{\'s}
9761 \DeclareUnicodeCharacter{015C}{\^S}
9762 \DeclareUnicodeCharacter{015D}{\^s}
9763 \DeclareUnicodeCharacter{015E}{\cedilla{S}}
9764 \DeclareUnicodeCharacter{015F}{\cedilla{s}}
9766 \DeclareUnicodeCharacter{0160}{\v{S}}
9767 \DeclareUnicodeCharacter{0161}{\v{s}}
9768 \DeclareUnicodeCharacter{0162}{\cedilla{t}}
9769 \DeclareUnicodeCharacter{0163}{\cedilla{T}}
9770 \DeclareUnicodeCharacter{0164}{\v{T}}
9772 \DeclareUnicodeCharacter{0168}{\~U}
9773 \DeclareUnicodeCharacter{0169}{\~u}
9774 \DeclareUnicodeCharacter{016A}{\=U}
9775 \DeclareUnicodeCharacter{016B}{\=u}
9776 \DeclareUnicodeCharacter{016C}{\u{U}}
9777 \DeclareUnicodeCharacter{016D}{\u{u}}
9778 \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
9779 \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
9781 \DeclareUnicodeCharacter{0170}{\H{U}}
9782 \DeclareUnicodeCharacter{0171}{\H{u}}
9783 \DeclareUnicodeCharacter{0174}{\^W}
9784 \DeclareUnicodeCharacter{0175}{\^w}
9785 \DeclareUnicodeCharacter{0176}{\^Y}
9786 \DeclareUnicodeCharacter{0177}{\^y}
9787 \DeclareUnicodeCharacter{0178}{\"Y}
9788 \DeclareUnicodeCharacter{0179}{\'Z}
9789 \DeclareUnicodeCharacter{017A}{\'z}
9790 \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
9791 \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
9792 \DeclareUnicodeCharacter{017D}{\v{Z}}
9793 \DeclareUnicodeCharacter{017E}{\v{z}}
9795 \DeclareUnicodeCharacter{01C4}{D\v{Z}}
9796 \DeclareUnicodeCharacter{01C5}{D\v{z}}
9797 \DeclareUnicodeCharacter{01C6}{d\v{z}}
9798 \DeclareUnicodeCharacter{01C7}{LJ}
9799 \DeclareUnicodeCharacter{01C8}{Lj}
9800 \DeclareUnicodeCharacter{01C9}{lj}
9801 \DeclareUnicodeCharacter{01CA}{NJ}
9802 \DeclareUnicodeCharacter{01CB}{Nj}
9803 \DeclareUnicodeCharacter{01CC}{nj}
9804 \DeclareUnicodeCharacter{01CD}{\v{A}}
9805 \DeclareUnicodeCharacter{01CE}{\v{a}}
9806 \DeclareUnicodeCharacter{01CF}{\v{I}}
9808 \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
9809 \DeclareUnicodeCharacter{01D1}{\v{O}}
9810 \DeclareUnicodeCharacter{01D2}{\v{o}}
9811 \DeclareUnicodeCharacter{01D3}{\v{U}}
9812 \DeclareUnicodeCharacter{01D4}{\v{u}}
9814 \DeclareUnicodeCharacter{01E2}{\={\AE}}
9815 \DeclareUnicodeCharacter{01E3}{\={\ae}}
9816 \DeclareUnicodeCharacter{01E6}{\v{G}}
9817 \DeclareUnicodeCharacter{01E7}{\v{g}}
9818 \DeclareUnicodeCharacter{01E8}{\v{K}}
9819 \DeclareUnicodeCharacter{01E9}{\v{k}}
9821 \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
9822 \DeclareUnicodeCharacter{01F1}{DZ}
9823 \DeclareUnicodeCharacter{01F2}{Dz}
9824 \DeclareUnicodeCharacter{01F3}{dz}
9825 \DeclareUnicodeCharacter{01F4}{\'G}
9826 \DeclareUnicodeCharacter{01F5}{\'g}
9827 \DeclareUnicodeCharacter{01F8}{\`N}
9828 \DeclareUnicodeCharacter{01F9}{\`n}
9829 \DeclareUnicodeCharacter{01FC}{\'{\AE}}
9830 \DeclareUnicodeCharacter{01FD}{\'{\ae}}
9831 \DeclareUnicodeCharacter{01FE}{\'{\O}}
9832 \DeclareUnicodeCharacter{01FF}{\'{\o}}
9834 \DeclareUnicodeCharacter{021E}{\v{H}}
9835 \DeclareUnicodeCharacter{021F}{\v{h}}
9837 \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
9838 \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
9839 \DeclareUnicodeCharacter{0228}{\cedilla{E}}
9840 \DeclareUnicodeCharacter{0229}{\cedilla{e}}
9841 \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
9842 \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
9844 \DeclareUnicodeCharacter{0232}{\=Y}
9845 \DeclareUnicodeCharacter{0233}{\=y}
9846 \DeclareUnicodeCharacter{0237}{\dotless{j}}
9848 \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
9850 \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
9851 \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
9852 \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
9853 \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
9854 \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
9855 \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
9856 \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
9857 \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
9858 \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
9859 \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
9860 \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
9861 \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
9863 \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
9864 \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
9866 \DeclareUnicodeCharacter{1E20}{\=G}
9867 \DeclareUnicodeCharacter{1E21}{\=g}
9868 \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
9869 \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
9870 \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
9871 \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
9872 \DeclareUnicodeCharacter{1E26}{\"H}
9873 \DeclareUnicodeCharacter{1E27}{\"h}
9875 \DeclareUnicodeCharacter{1E30}{\'K}
9876 \DeclareUnicodeCharacter{1E31}{\'k}
9877 \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
9878 \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
9879 \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
9880 \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
9881 \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
9882 \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
9883 \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
9884 \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
9885 \DeclareUnicodeCharacter{1E3E}{\'M}
9886 \DeclareUnicodeCharacter{1E3F}{\'m}
9888 \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
9889 \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
9890 \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
9891 \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
9892 \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
9893 \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
9894 \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
9895 \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
9896 \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
9897 \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
9899 \DeclareUnicodeCharacter{1E54}{\'P}
9900 \DeclareUnicodeCharacter{1E55}{\'p}
9901 \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
9902 \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
9903 \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
9904 \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
9905 \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
9906 \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
9907 \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
9908 \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
9910 \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
9911 \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
9912 \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
9913 \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
9914 \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
9915 \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
9916 \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
9917 \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
9918 \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
9919 \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
9921 \DeclareUnicodeCharacter{1E7C}{\~V}
9922 \DeclareUnicodeCharacter{1E7D}{\~v}
9923 \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
9924 \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
9926 \DeclareUnicodeCharacter{1E80}{\`W}
9927 \DeclareUnicodeCharacter{1E81}{\`w}
9928 \DeclareUnicodeCharacter{1E82}{\'W}
9929 \DeclareUnicodeCharacter{1E83}{\'w}
9930 \DeclareUnicodeCharacter{1E84}{\"W}
9931 \DeclareUnicodeCharacter{1E85}{\"w}
9932 \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
9933 \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
9934 \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
9935 \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
9936 \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
9937 \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
9938 \DeclareUnicodeCharacter{1E8C}{\"X}
9939 \DeclareUnicodeCharacter{1E8D}{\"x}
9940 \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
9941 \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
9943 \DeclareUnicodeCharacter{1E90}{\^Z}
9944 \DeclareUnicodeCharacter{1E91}{\^z}
9945 \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
9946 \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
9947 \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
9948 \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
9949 \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
9950 \DeclareUnicodeCharacter{1E97}{\"t}
9951 \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
9952 \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
9954 \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
9955 \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
9957 \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
9958 \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
9959 \DeclareUnicodeCharacter{1EBC}{\~E}
9960 \DeclareUnicodeCharacter{1EBD}{\~e}
9962 \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
9963 \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
9964 \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
9965 \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
9967 \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
9968 \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
9970 \DeclareUnicodeCharacter{1EF2}{\`Y}
9971 \DeclareUnicodeCharacter{1EF3}{\`y}
9972 \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
9974 \DeclareUnicodeCharacter{1EF8}{\~Y}
9975 \DeclareUnicodeCharacter{1EF9}{\~y}
9977 \DeclareUnicodeCharacter{2013}{--}
9978 \DeclareUnicodeCharacter{2014}{---}
9979 \DeclareUnicodeCharacter{2018}{\quoteleft}
9980 \DeclareUnicodeCharacter{2019}{\quoteright}
9981 \DeclareUnicodeCharacter{201A}{\quotesinglbase}
9982 \DeclareUnicodeCharacter{201C}{\quotedblleft}
9983 \DeclareUnicodeCharacter{201D}{\quotedblright}
9984 \DeclareUnicodeCharacter{201E}{\quotedblbase}
9985 \DeclareUnicodeCharacter{2022}{\bullet}
9986 \DeclareUnicodeCharacter{2026}{\dots}
9987 \DeclareUnicodeCharacter{2039}{\guilsinglleft}
9988 \DeclareUnicodeCharacter{203A}{\guilsinglright}
9989 \DeclareUnicodeCharacter{20AC}{\euro}
9991 \DeclareUnicodeCharacter{2192}{\expansion}
9992 \DeclareUnicodeCharacter{21D2}{\result}
9994 \DeclareUnicodeCharacter{2212}{\minus}
9995 \DeclareUnicodeCharacter{2217}{\point}
9996 \DeclareUnicodeCharacter{2261}{\equiv}
9997 }% end of \utfeightchardefs
10000 % US-ASCII character definitions.
10001 \def\asciichardefs{% nothing need be done
10005 % Make non-ASCII characters printable again for compatibility with
10006 % existing Texinfo documents that may use them, even without declaring a
10007 % document encoding.
10009 \setnonasciicharscatcode \other
10012 \message{formatting,}
10014 \newdimen\defaultparindent \defaultparindent = 15pt
10016 \chapheadingskip = 15pt plus 4pt minus 2pt
10017 \secheadingskip = 12pt plus 3pt minus 2pt
10018 \subsecheadingskip = 9pt plus 2pt minus 2pt
10020 % Prevent underfull vbox error messages.
10023 % Don't be very finicky about underfull hboxes, either.
10026 % Following George Bush, get rid of widows and orphans.
10027 \widowpenalty=10000
10030 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
10031 % using an old version of TeX, don't do anything. We want the amount of
10032 % stretch added to depend on the line length, hence the dependence on
10033 % \hsize. We call this whenever the paper size is set.
10035 \def\setemergencystretch{%
10036 \ifx\emergencystretch\thisisundefined
10037 % Allow us to assign to \emergencystretch anyway.
10038 \def\emergencystretch{\dimen0}%
10040 \emergencystretch = .15\hsize
10044 % Parameters in order: 1) textheight; 2) textwidth;
10045 % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
10046 % 7) physical page height; 8) physical page width.
10048 % We also call \setleading{\textleading}, so the caller should define
10049 % \textleading. The caller should also set \parskip.
10051 \def\internalpagesizes#1#2#3#4#5#6#7#8{%
10052 \voffset = #3\relax
10053 \topskip = #6\relax
10054 \splittopskip = \topskip
10057 \advance\vsize by \topskip
10058 \outervsize = \vsize
10059 \advance\outervsize by 2\topandbottommargin
10060 \pageheight = \vsize
10063 \outerhsize = \hsize
10064 \advance\outerhsize by 0.5in
10065 \pagewidth = \hsize
10067 \normaloffset = #4\relax
10068 \bindingoffset = #5\relax
10071 \pdfpageheight #7\relax
10072 \pdfpagewidth #8\relax
10073 % if we don't reset these, they will remain at "1 true in" of
10074 % whatever layout pdftex was dumped with.
10075 \pdfhorigin = 1 true in
10076 \pdfvorigin = 1 true in
10079 \setleading{\textleading}
10081 \parindent = \defaultparindent
10082 \setemergencystretch
10085 % @letterpaper (the default).
10086 \def\letterpaper{{\globaldefs = 1
10087 \parskip = 3pt plus 2pt minus 1pt
10088 \textleading = 13.2pt
10090 % If page is nothing but text, make it come out even.
10091 \internalpagesizes{607.2pt}{6in}% that's 46 lines
10093 {\bindingoffset}{36pt}%
10097 % Use @smallbook to reset parameters for 7x9.25 trim size.
10098 \def\smallbook{{\globaldefs = 1
10099 \parskip = 2pt plus 1pt
10100 \textleading = 12pt
10102 \internalpagesizes{7.5in}{5in}%
10104 {\bindingoffset}{16pt}%
10107 \lispnarrowing = 0.3in
10110 \contentsrightmargin = 0pt
10111 \defbodyindent = .5cm
10114 % Use @smallerbook to reset parameters for 6x9 trim size.
10115 % (Just testing, parameters still in flux.)
10116 \def\smallerbook{{\globaldefs = 1
10117 \parskip = 1.5pt plus 1pt
10118 \textleading = 12pt
10120 \internalpagesizes{7.4in}{4.8in}%
10125 \lispnarrowing = 0.25in
10128 \contentsrightmargin = 0pt
10129 \defbodyindent = .4cm
10132 % Use @afourpaper to print on European A4 paper.
10133 \def\afourpaper{{\globaldefs = 1
10134 \parskip = 3pt plus 2pt minus 1pt
10135 \textleading = 13.2pt
10137 % Double-side printing via postscript on Laserjet 4050
10138 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
10139 % To change the settings for a different printer or situation, adjust
10140 % \normaloffset until the front-side and back-side texts align. Then
10141 % do the same for \bindingoffset. You can set these for testing in
10142 % your texinfo source file like this:
10144 % \global\normaloffset = -6mm
10145 % \global\bindingoffset = 10mm
10147 \internalpagesizes{673.2pt}{160mm}% that's 51 lines
10148 {\voffset}{\hoffset}%
10149 {\bindingoffset}{44pt}%
10154 \contentsrightmargin = 0pt
10155 \defbodyindent = 5mm
10158 % Use @afivepaper to print on European A5 paper.
10159 % From romildo@urano.iceb.ufop.br, 2 July 2000.
10160 % He also recommends making @example and @lisp be small.
10161 \def\afivepaper{{\globaldefs = 1
10162 \parskip = 2pt plus 1pt minus 0.1pt
10163 \textleading = 12.5pt
10165 \internalpagesizes{160mm}{120mm}%
10166 {\voffset}{\hoffset}%
10167 {\bindingoffset}{8pt}%
10170 \lispnarrowing = 0.2in
10173 \contentsrightmargin = 0pt
10174 \defbodyindent = 2mm
10175 \tableindent = 12mm
10178 % A specific text layout, 24x15cm overall, intended for A4 paper.
10179 \def\afourlatex{{\globaldefs = 1
10181 \internalpagesizes{237mm}{150mm}%
10183 {\bindingoffset}{7mm}%
10186 % Must explicitly reset to 0 because we call \afourpaper.
10190 % Use @afourwide to print on A4 paper in landscape format.
10191 \def\afourwide{{\globaldefs = 1
10193 \internalpagesizes{241mm}{165mm}%
10194 {\voffset}{-2.95mm}%
10195 {\bindingoffset}{7mm}%
10200 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
10201 % Perhaps we should allow setting the margins, \topskip, \parskip,
10202 % and/or leading, also. Or perhaps we should compute them somehow.
10204 \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
10205 \def\pagesizesyyy#1,#2,#3\finish{{%
10206 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
10209 \parskip = 3pt plus 2pt minus 1pt
10210 \setleading{\textleading}%
10213 \advance\dimen0 by \voffset
10216 \advance\dimen2 by \normaloffset
10218 \internalpagesizes{#1}{\hsize}%
10219 {\voffset}{\normaloffset}%
10220 {\bindingoffset}{44pt}%
10221 {\dimen0}{\dimen2}%
10224 % Set default to letter.
10229 \message{and turning on texinfo input format.}
10231 \def^^L{\par} % remove \outer, so ^L can appear in an @comment
10233 % DEL is a comment character, in case @c does not suffice.
10236 % Define macros to output various characters with catcode for normal text.
10237 \catcode`\"=\other \def\normaldoublequote{"}
10238 \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
10239 \catcode`\+=\other \def\normalplus{+}
10240 \catcode`\<=\other \def\normalless{<}
10241 \catcode`\>=\other \def\normalgreater{>}
10242 \catcode`\^=\other \def\normalcaret{^}
10243 \catcode`\_=\other \def\normalunderscore{_}
10244 \catcode`\|=\other \def\normalverticalbar{|}
10245 \catcode`\~=\other \def\normaltilde{~}
10247 % This macro is used to make a character print one way in \tt
10248 % (where it can probably be output as-is), and another way in other fonts,
10249 % where something hairier probably needs to be done.
10251 % #1 is what to print if we are indeed using \tt; #2 is what to print
10252 % otherwise. Since all the Computer Modern typewriter fonts have zero
10253 % interword stretch (and shrink), and it is reasonable to expect all
10254 % typewriter fonts to have this, we can check that font parameter.
10256 \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
10258 % Same as above, but check for italic font. Actually this also catches
10259 % non-italic slanted fonts since it is impossible to distinguish them from
10260 % italic fonts. But since this is only used by $ and it uses \sl anyway
10261 % this is not a problem.
10262 \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
10264 % Turn off all special characters except @
10265 % (and those which the user can use as if they were ordinary).
10266 % Most of these we simply print from the \tt font, but for some, we can
10267 % use math or other variants that look better in normal text.
10269 \catcode`\"=\active
10270 \def\activedoublequote{{\tt\char34}}
10271 \let"=\activedoublequote
10272 \catcode`\~=\active
10273 \def~{{\tt\char126}}
10275 \catcode`\^=\active
10278 \catcode`\_=\active
10279 \def_{\ifusingtt\normalunderscore\_}
10281 % Subroutine for the previous macro.
10282 \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
10284 \catcode`\|=\active
10285 \def|{{\tt\char124}}
10287 \catcode`\<=\active
10290 \catcode`\>=\active
10292 \catcode`\+=\active
10293 \def+{{\tt \char 43}}
10294 \catcode`\$=\active
10295 \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
10297 % If a .fmt file is being used, characters that might appear in a file
10298 % name cannot be active until we have parsed the command line.
10299 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
10300 % \otherifyactive is called near the end of this file.
10301 \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
10303 % Used sometimes to turn off (effectively) the active characters even after
10305 \def\turnoffactive{%
10306 \normalturnoffactive
10312 % \backslashcurfont outputs one backslash character in current font,
10314 \global\chardef\backslashcurfont=`\\
10315 \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
10317 % \realbackslash is an actual character `\' with catcode other, and
10318 % \doublebackslash is two of them (for the pdf outlines).
10319 {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
10321 % In texinfo, backslash is an active character; it prints the backslash
10322 % in fixed width font.
10323 \catcode`\\=\active % @ for escape char from now on.
10325 % The story here is that in math mode, the \char of \backslashcurfont
10326 % ends up printing the roman \ from the math symbol font (because \char
10327 % in math mode uses the \mathcode, and plain.tex sets
10328 % \mathcode`\\="026E). It seems better for @backslashchar{} to always
10329 % print a typewriter backslash, hence we use an explicit \mathchar,
10330 % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
10331 % ignored family value; char position "5C). We can't use " for the
10332 % usual hex value because it has already been made active.
10333 @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
10334 @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
10336 % On startup, @fixbackslash assigns:
10337 % @let \ = @normalbackslash
10338 % \rawbackslash defines an active \ to do \backslashcurfont.
10339 % \otherbackslash defines an active \ to be a literal `\' character with
10340 % catcode other. We switch back and forth between these.
10341 @gdef@rawbackslash{@let\=@backslashcurfont}
10342 @gdef@otherbackslash{@let\=@realbackslash}
10344 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
10345 % the literal character `\'. Also revert - to its normal character, in
10346 % case the active - from code has slipped in.
10348 {@catcode`- = @active
10349 @gdef@normalturnoffactive{%
10351 @let"=@normaldoublequote
10352 @let$=@normaldollar %$ font-lock fix
10355 @let>=@normalgreater
10356 @let\=@normalbackslash
10358 @let_=@normalunderscore
10359 @let|=@normalverticalbar
10361 @markupsetuplqdefault
10362 @markupsetuprqdefault
10367 % Make _ and + \other characters, temporarily.
10368 % This is canceled by @fixbackslash.
10371 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
10372 % That is what \eatinput is for; after that, the `\' should revert to printing
10375 @gdef@eatinput input texinfo{@fixbackslash}
10376 @global@let\ = @eatinput
10378 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
10379 % the first `\' in the file would cause an error. This macro tries to fix
10380 % that, assuming it is called before the first `\' could plausibly occur.
10381 % Also turn back on active characters that might appear in the input
10382 % file name, in case not using a pre-dumped format.
10384 @gdef@fixbackslash{%
10385 @ifx\@eatinput @let\ = @normalbackslash @fi
10387 @catcode`@_=@active
10390 % Say @foo, not \foo, in error messages.
10393 % These (along with & and #) are made active for url-breaking, so need
10394 % active definitions as the normal characters.
10396 @def@normalquest{?}
10397 @def@normalslash{/}
10399 % These look ok in all fonts, so just make them not special.
10400 % @hashchar{} gets its own user-level command, because of #line.
10401 @catcode`@& = @other @def@normalamp{&}
10402 @catcode`@# = @other @def@normalhash{#}
10403 @catcode`@% = @other @def@normalpercent{%}
10405 @let @hashchar = @normalhash
10407 @c Finally, make ` and ' active, so that txicodequoteundirected and
10408 @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
10409 @c don't make ` and ' active, @code will not get them as active chars.
10410 @c Do this last of all since we use ` in the previous @catcode assignments.
10411 @catcode`@'=@active
10412 @catcode`@`=@active
10413 @markupsetuplqdefault
10414 @markupsetuprqdefault
10416 @c Local variables:
10417 @c eval: (add-hook 'write-file-hooks 'time-stamp)
10418 @c page-delimiter: "^\\\\message"
10419 @c time-stamp-start: "def\\\\texinfoversion{"
10420 @c time-stamp-format: "%:y-%02m-%02d.%02H"
10421 @c time-stamp-end: "}"
10427 arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115